Files
pfm/PostFundManagement.ConsoleUI/dist/assets/index-BU8qSe7k.js
T
2026-09-17 07:23:18 +02:00

400 lines
781 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var Dv=e=>{throw TypeError(e)};var Qm=(e,n,r)=>n.has(e)||Dv("Cannot "+r);var k=(e,n,r)=>(Qm(e,n,"read from private field"),r?r.call(e):n.get(e)),De=(e,n,r)=>n.has(e)?Dv("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,r),ve=(e,n,r,a)=>(Qm(e,n,"write to private field"),a?a.call(e,r):n.set(e,r),r),Ze=(e,n,r)=>(Qm(e,n,"access private method"),r);var gd=(e,n,r,a)=>({set _(o){ve(e,n,o,r)},get _(){return k(e,n,a)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function r(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(o){if(o.ep)return;o.ep=!0;const u=r(o);fetch(o.href,u)}})();function lE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Km={exports:{}},rc={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Mv;function oE(){if(Mv)return rc;Mv=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(a,o,u){var f=null;if(u!==void 0&&(f=""+u),o.key!==void 0&&(f=""+o.key),"key"in o){u={};for(var m in o)m!=="key"&&(u[m]=o[m])}else u=o;return o=u.ref,{$$typeof:e,type:a,key:f,ref:o!==void 0?o:null,props:u}}return rc.Fragment=n,rc.jsx=r,rc.jsxs=r,rc}var zv;function cE(){return zv||(zv=1,Km.exports=oE()),Km.exports}var c=cE(),Ym={exports:{}},Be={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Uv;function uE(){if(Uv)return Be;Uv=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.for("react.view_transition"),S=Symbol.iterator;function A(_){return _===null||typeof _!="object"?null:(_=S&&_[S]||_["@@iterator"],typeof _=="function"?_:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,N={};function j(_,Y,he){this.props=_,this.context=Y,this.refs=N,this.updater=he||C}j.prototype.isReactComponent={},j.prototype.setState=function(_,Y){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,Y,"setState")},j.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function F(){}F.prototype=j.prototype;function q(_,Y,he){this.props=_,this.context=Y,this.refs=N,this.updater=he||C}var B=q.prototype=new F;B.constructor=q,O(B,j.prototype),B.isPureReactComponent=!0;var re=Array.isArray;function Q(){}var X={H:null,A:null,T:null,S:null},se=Object.prototype.hasOwnProperty;function fe(_,Y,he){var ce=he.ref;return{$$typeof:e,type:_,key:Y,ref:ce!==void 0?ce:null,props:he}}function we(_,Y){return fe(_.type,Y,_.props)}function Ce(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function Z(_){var Y={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(he){return Y[he]})}var W=/\/+/g;function oe(_,Y){return typeof _=="object"&&_!==null&&_.key!=null?Z(""+_.key):Y.toString(36)}function ee(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(Q,Q):(_.status="pending",_.then(function(Y){_.status==="pending"&&(_.status="fulfilled",_.value=Y)},function(Y){_.status==="pending"&&(_.status="rejected",_.reason=Y)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function z(_,Y,he,ce,Oe){var Pe=typeof _;(Pe==="undefined"||Pe==="boolean")&&(_=null);var qe=!1;if(_===null)qe=!0;else switch(Pe){case"bigint":case"string":case"number":qe=!0;break;case"object":switch(_.$$typeof){case e:case n:qe=!0;break;case g:return qe=_._init,z(qe(_._payload),Y,he,ce,Oe)}}if(qe)return Oe=Oe(_),qe=ce===""?"."+oe(_,0):ce,re(Oe)?(he="",qe!=null&&(he=qe.replace(W,"$&/")+"/"),z(Oe,Y,he,"",function(at){return at})):Oe!=null&&(Ce(Oe)&&(Oe=we(Oe,he+(Oe.key==null||_&&_.key===Oe.key?"":(""+Oe.key).replace(W,"$&/")+"/")+qe)),Y.push(Oe)),1;qe=0;var _e=ce===""?".":ce+":";if(re(_))for(var je=0;je<_.length;je++)ce=_[je],Pe=_e+oe(ce,je),qe+=z(ce,Y,he,Pe,Oe);else if(je=A(_),typeof je=="function")for(_=je.call(_),je=0;!(ce=_.next()).done;)ce=ce.value,Pe=_e+oe(ce,je++),qe+=z(ce,Y,he,Pe,Oe);else if(Pe==="object"){if(typeof _.then=="function")return z(ee(_),Y,he,ce,Oe);throw Y=String(_),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return qe}function ue(_,Y,he){if(_==null)return _;var ce=[],Oe=0;return z(_,ce,"","",function(Pe){return Y.call(he,Pe,Oe++)}),ce}function Me(_){if(_._status===-1){var Y=_._result,he=Y();he.then(function(ce){(_._status===0||_._status===-1)&&(_._status=1,_._result=ce,he.status===void 0&&(he.status="fulfilled",he.value=ce))},function(ce){(_._status===0||_._status===-1)&&(_._status=2,_._result=ce,he.status===void 0&&(he.status="rejected",he.reason=ce))}),_._status===-1&&(_._status=0,_._result=he)}if(_._status===1)return _._result.default;throw _._result}var Ae=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)};function Ye(_){var Y=X.T,he={};he.types=Y!==null?Y.types:null,X.T=he;try{var ce=_(),Oe=X.S;Oe!==null&&Oe(he,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(Q,Ae)}catch(Pe){Ae(Pe)}finally{Y!==null&&he.types!==null&&(Y.types=he.types),X.T=Y}}function $e(_){var Y=X.T;if(Y!==null){var he=Y.types;he===null?Y.types=[_]:he.indexOf(_)===-1&&he.push(_)}else Ye($e.bind(null,_))}var ut={map:ue,forEach:function(_,Y,he){ue(_,function(){Y.apply(this,arguments)},he)},count:function(_){var Y=0;return ue(_,function(){Y++}),Y},toArray:function(_){return ue(_,function(Y){return Y})||[]},only:function(_){if(!Ce(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return Be.Activity=b,Be.Children=ut,Be.Component=j,Be.Fragment=r,Be.Profiler=o,Be.PureComponent=q,Be.StrictMode=a,Be.Suspense=p,Be.ViewTransition=v,Be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,Be.__COMPILER_RUNTIME={__proto__:null,c:function(_){return X.H.useMemoCache(_)}},Be.addTransitionType=$e,Be.cache=function(_){return function(){return _.apply(null,arguments)}},Be.cacheSignal=function(){return null},Be.cloneElement=function(_,Y,he){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var ce=O({},_.props),Oe=_.key;if(Y!=null)for(Pe in Y.key!==void 0&&(Oe=""+Y.key),Y)!se.call(Y,Pe)||Pe==="key"||Pe==="__self"||Pe==="__source"||Pe==="ref"&&Y.ref===void 0||(ce[Pe]=Y[Pe]);var Pe=arguments.length-2;if(Pe===1)ce.children=he;else if(1<Pe){for(var qe=Array(Pe),_e=0;_e<Pe;_e++)qe[_e]=arguments[_e+2];ce.children=qe}return fe(_.type,Oe,ce)},Be.createContext=function(_){return _={$$typeof:f,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:u,_context:_},_},Be.createElement=function(_,Y,he){var ce,Oe={},Pe=null;if(Y!=null)for(ce in Y.key!==void 0&&(Pe=""+Y.key),Y)se.call(Y,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&(Oe[ce]=Y[ce]);var qe=arguments.length-2;if(qe===1)Oe.children=he;else if(1<qe){for(var _e=Array(qe),je=0;je<qe;je++)_e[je]=arguments[je+2];Oe.children=_e}if(_&&_.defaultProps)for(ce in qe=_.defaultProps,qe)Oe[ce]===void 0&&(Oe[ce]=qe[ce]);return fe(_,Pe,Oe)},Be.createRef=function(){return{current:null}},Be.forwardRef=function(_){return{$$typeof:m,render:_}},Be.isValidElement=Ce,Be.lazy=function(_){return{$$typeof:g,_payload:{_status:-1,_result:_},_init:Me}},Be.memo=function(_,Y){return{$$typeof:y,type:_,compare:Y===void 0?null:Y}},Be.startTransition=Ye,Be.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},Be.use=function(_){return X.H.use(_)},Be.useActionState=function(_,Y,he){return X.H.useActionState(_,Y,he)},Be.useCallback=function(_,Y){return X.H.useCallback(_,Y)},Be.useContext=function(_){return X.H.useContext(_)},Be.useDebugValue=function(){},Be.useDeferredValue=function(_,Y){return X.H.useDeferredValue(_,Y)},Be.useEffect=function(_,Y){return X.H.useEffect(_,Y)},Be.useEffectEvent=function(_){return X.H.useEffectEvent(_)},Be.useId=function(){return X.H.useId()},Be.useImperativeHandle=function(_,Y,he){return X.H.useImperativeHandle(_,Y,he)},Be.useInsertionEffect=function(_,Y){return X.H.useInsertionEffect(_,Y)},Be.useLayoutEffect=function(_,Y){return X.H.useLayoutEffect(_,Y)},Be.useMemo=function(_,Y){return X.H.useMemo(_,Y)},Be.useOptimistic=function(_,Y){return X.H.useOptimistic(_,Y)},Be.useReducer=function(_,Y,he){return X.H.useReducer(_,Y,he)},Be.useRef=function(_){return X.H.useRef(_)},Be.useState=function(_){return X.H.useState(_)},Be.useSyncExternalStore=function(_,Y,he){return X.H.useSyncExternalStore(_,Y,he)},Be.useTransition=function(){return X.H.useTransition()},Be.version="19.3.0",Be}var Iv;function yp(){return Iv||(Iv=1,Ym.exports=uE()),Ym.exports}var T=yp();const It=lE(T);var Jm={exports:{}},ic={},Xm={exports:{}},Wm={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Lv;function dE(){return Lv||(Lv=1,(function(e){function n(ee,z){var ue=ee.length;ee.push(z);e:for(;0<ue;){var Me=ue-1>>>1,Ae=ee[Me];if(0<o(Ae,z))ee[Me]=z,ee[ue]=Ae,ue=Me;else break e}}function r(ee){return ee.length===0?null:ee[0]}function a(ee){if(ee.length===0)return null;var z=ee[0],ue=ee.pop();if(ue!==z){ee[0]=ue;e:for(var Me=0,Ae=ee.length,Ye=Ae>>>1;Me<Ye;){var $e=2*(Me+1)-1,ut=ee[$e],_=$e+1,Y=ee[_];if(0>o(ut,ue))_<Ae&&0>o(Y,ut)?(ee[Me]=Y,ee[_]=ue,Me=_):(ee[Me]=ut,ee[$e]=ue,Me=$e);else if(_<Ae&&0>o(Y,ue))ee[Me]=Y,ee[_]=ue,Me=_;else break e}}return z}function o(ee,z){var ue=ee.sortIndex-z.sortIndex;return ue!==0?ue:ee.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var f=Date,m=f.now();e.unstable_now=function(){return f.now()-m}}var p=[],y=[],g=1,b=null,v=3,S=!1,A=!1,C=!1,O=!1,N=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,F=typeof setImmediate<"u"?setImmediate:null;function q(ee){for(var z=r(y);z!==null;){if(z.callback===null)a(y);else if(z.startTime<=ee)a(y),z.sortIndex=z.expirationTime,n(p,z);else break;z=r(y)}}function B(ee){if(C=!1,q(ee),!A)if(r(p)!==null)A=!0,re||(re=!0,Ce());else{var z=r(y);z!==null&&oe(B,z.startTime-ee)}}var re=!1,Q=-1,X=5,se=-1;function fe(){return O?!0:!(e.unstable_now()-se<X)}function we(){if(O=!1,re){var ee=e.unstable_now();se=ee;var z=!0;try{e:{A=!1,C&&(C=!1,j(Q),Q=-1),S=!0;var ue=v;try{t:{for(q(ee),b=r(p);b!==null&&!(b.expirationTime>ee&&fe());){var Me=b.callback;if(typeof Me=="function"){b.callback=null,v=b.priorityLevel;var Ae=Me(b.expirationTime<=ee);if(ee=e.unstable_now(),typeof Ae=="function"){b.callback=Ae,q(ee),z=!0;break t}b===r(p)&&a(p),q(ee)}else a(p);b=r(p)}if(b!==null)z=!0;else{var Ye=r(y);Ye!==null&&oe(B,Ye.startTime-ee),z=!1}}break e}finally{b=null,v=ue,S=!1}z=void 0}}finally{z?Ce():re=!1}}}var Ce;if(typeof F=="function")Ce=function(){F(we)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,W=Z.port2;Z.port1.onmessage=we,Ce=function(){W.postMessage(null)}}else Ce=function(){N(we,0)};function oe(ee,z){Q=N(function(){ee(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(ee){ee.callback=null},e.unstable_forceFrameRate=function(ee){0>ee||125<ee?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<ee?Math.floor(1e3/ee):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(ee){switch(v){case 1:case 2:case 3:var z=3;break;default:z=v}var ue=v;v=z;try{return ee()}finally{v=ue}},e.unstable_requestPaint=function(){O=!0},e.unstable_runWithPriority=function(ee,z){switch(ee){case 1:case 2:case 3:case 4:case 5:break;default:ee=3}var ue=v;v=ee;try{return z()}finally{v=ue}},e.unstable_scheduleCallback=function(ee,z,ue){var Me=e.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?Me+ue:Me):ue=Me,ee){case 1:var Ae=-1;break;case 2:Ae=250;break;case 5:Ae=1073741823;break;case 4:Ae=1e4;break;default:Ae=5e3}return Ae=ue+Ae,ee={id:g++,callback:z,priorityLevel:ee,startTime:ue,expirationTime:Ae,sortIndex:-1},ue>Me?(ee.sortIndex=ue,n(y,ee),r(p)===null&&ee===r(y)&&(C?(j(Q),Q=-1):C=!0,oe(B,ue-Me))):(ee.sortIndex=Ae,n(p,ee),A||S||(A=!0,re||(re=!0,Ce()))),ee},e.unstable_shouldYield=fe,e.unstable_wrapCallback=function(ee){var z=v;return function(){var ue=v;v=z;try{return ee.apply(this,arguments)}finally{v=ue}}}})(Wm)),Wm}var Pv;function fE(){return Pv||(Pv=1,Xm.exports=dE()),Xm.exports}var e0={exports:{}},vn={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Hv;function hE(){if(Hv)return vn;Hv=1;var e=yp();function n(g){var b="https://react.dev/errors/"+g;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)b+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+g+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal"),u=Symbol.for("react.recoverable"),f=Symbol.for("react.optimistic_key");function m(g,b,v){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:S==null?null:S===f?f:""+S,children:g,containerInfo:b,implementation:v}}var p=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(g,b){if(g==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return vn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,vn.browser=function(g){return{$$typeof:u,_reason:g}},vn.createPortal=function(g,b){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(n(299));return m(g,b,null,v)},vn.flushSync=function(g){var b=p.T,v=a.p;try{if(p.T=null,a.p=2,g)return g()}finally{p.T=b,a.p=v,a.d.f()}},vn.preconnect=function(g,b){typeof g=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,a.d.C(g,b))},vn.prefetchDNS=function(g){typeof g=="string"&&a.d.D(g)},vn.preinit=function(g,b){if(typeof g=="string"&&b&&typeof b.as=="string"){var v=b.as,S=y(v,b.crossOrigin),A=typeof b.integrity=="string"?b.integrity:void 0,C=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;v==="style"?a.d.S(g,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:S,integrity:A,fetchPriority:C}):v==="script"&&a.d.X(g,{crossOrigin:S,integrity:A,fetchPriority:C,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},vn.preinitModule=function(g,b){if(typeof g=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var v=y(b.as,b.crossOrigin);a.d.M(g,{crossOrigin:v,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}}else b==null&&a.d.M(g)},vn.preload=function(g,b){if(typeof g=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var v=b.as,S=y(v,b.crossOrigin);a.d.L(g,v,{crossOrigin:S,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},vn.preloadModule=function(g,b){if(typeof g=="string")if(b){var v=y(b.as,b.crossOrigin);a.d.m(g,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:v,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}else a.d.m(g)},vn.requestFormReset=function(g){a.d.r(g)},vn.unstable_batchedUpdates=function(g,b){return g(b)},vn.useFormState=function(g,b,v){return p.H.useFormState(g,b,v)},vn.useFormStatus=function(){return p.H.useHostTransitionStatus()},vn.version="19.3.0",vn}var qv;function mE(){if(qv)return e0.exports;qv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),e0.exports=hE(),e0.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Bv;function pE(){if(Bv)return ic;Bv=1;var e=fE(),n=yp(),r=mE();function a(t){var s="https://react.dev/errors/"+t;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)s+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function u(t){for(var s=t,i=s;i&&!i.alternate;)s=i,(s.flags&4098)!==0&&(t=s.return),i=s.return;for(;s.return;)s=s.return;return s.tag===3?t:null}function f(t){if(t.tag===13){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function m(t){if(t.tag===31){var s=t.memoizedState;if(s===null&&(t=t.alternate,t!==null&&(s=t.memoizedState)),s!==null)return s.dehydrated}return null}function p(t){if(u(t)!==t)throw Error(a(188))}function y(t){var s=t.alternate;if(!s){if(s=u(t),s===null)throw Error(a(188));return s!==t?null:t}for(var i=t,l=s;;){var d=i.return;if(d===null)break;var h=d.alternate;if(h===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===i)return p(d),t;if(h===l)return p(d),s;h=h.sibling}throw Error(a(188))}if(i.return!==l.return)i=d,l=h;else{for(var x=!1,w=d.child;w;){if(w===i){x=!0,i=d,l=h;break}if(w===l){x=!0,l=d,i=h;break}w=w.sibling}if(!x){for(w=h.child;w;){if(w===i){x=!0,i=h,l=d;break}if(w===l){x=!0,l=h,i=d;break}w=w.sibling}if(!x)throw Error(a(189))}}if(i.alternate!==l)throw Error(a(190))}if(i.tag!==3)throw Error(a(188));return i.stateNode.current===i?t:s}function g(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t;for(t=t.child;t!==null;){if(s=g(t),s!==null)return s;t=t.sibling}return null}function b(t,s,i,l,d,h){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&i(t,l,d,h)||(t.tag!==22||t.memoizedState===null)&&(s||t.tag!==5&&t.tag!==27)&&b(t.child,s,i,l,d,h))return!0;t=t.sibling}return!1}function v(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function S(t){var s=!1;for(t=t.return;t!==null&&(t.tag===4&&(s=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return s}function A(t){var s=[null,null],i=v(t);return i===null||C(s,t,i.child,{foundSelf:!1}),s}function C(t,s,i,l){for(;i!==null;){if(i===s)l.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(l.foundSelf)return t[1]=i,!0;t[0]=i}else if((i.tag!==22||i.memoizedState===null)&&C(t,s,i.child,l))return!0;i=i.sibling}return!1}function O(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(a(559))}}var N=null,j=null;function F(t,s,i){return t===i?!0:t===s?(N=t,!0):!1}function q(t,s,i){return t===i?(j=t,!1):t===s?(j!==null&&(N=t),!0):!1}function B(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function re(t,s,i){for(var l=0,d=t;d;d=i(d))l++;d=0;for(var h=s;h;h=i(h))d++;for(;0<l-d;)t=i(t),l--;for(;0<d-l;)s=i(s),d--;for(;l--;){if(t===s||s!==null&&t===s.alternate)return t;t=i(t),s=i(s)}return null}var Q=Object.assign,X=Symbol.for("react.element"),se=Symbol.for("react.transitional.element"),fe=Symbol.for("react.portal"),we=Symbol.for("react.fragment"),Ce=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),oe=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),ue=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),Ae=Symbol.for("react.lazy"),Ye=Symbol.for("react.activity"),$e=Symbol.for("react.legacy_hidden"),ut=Symbol.for("react.memo_cache_sentinel"),_=Symbol.for("react.view_transition"),Y=Symbol.for("react.recoverable"),he=Symbol.iterator;function ce(t){return t===null||typeof t!="object"?null:(t=he&&t[he]||t["@@iterator"],typeof t=="function"?t:null)}var Oe=Symbol.for("react.client.reference");function Pe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Oe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case we:return"Fragment";case Z:return"Profiler";case Ce:return"StrictMode";case z:return"Suspense";case ue:return"SuspenseList";case Ye:return"Activity";case _:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case fe:return"Portal";case oe:return t.displayName||"Context";case W:return(t._context.displayName||"Context")+".Consumer";case ee:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Me:return s=t.displayName||null,s!==null?s:Pe(t.type)||"Memo";case Ae:s=t._payload,t=t._init;try{return Pe(t(s))}catch{}}return null}var qe=Array.isArray,_e=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,je=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,at={pending:!1,data:null,method:null,action:null},Tt=[],Zt=-1;function J(t){return{current:t}}function Re(t){0>Zt||(t.current=Tt[Zt],Tt[Zt]=null,Zt--)}function pe(t,s){Zt++,Tt[Zt]=t.current,t.current=s}var $=J(null),Ge=J(null),rt=J(null),qt=J(null);function Sr(t,s){switch(pe(rt,s),pe(Ge,t),pe($,null),s.nodeType){case 9:case 11:t=(t=s.documentElement)&&(t=t.namespaceURI)?By(t):0;break;default:if(t=s.tagName,s=s.namespaceURI)s=By(s),t=$y(s,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Re($),pe($,t)}function Sn(){Re($),Re(Ge),Re(rt)}function Hi(t){var s=t.memoizedState;s!==null&&(Cl._currentValue=s.memoizedState,pe(qt,t)),s=$.current;var i=$y(s,t.type);s!==i&&(pe(Ge,t),pe($,i))}function Kr(t){Ge.current===t&&(Re($),Re(Ge)),qt.current===t&&(Re(qt),Cl._currentValue=at)}var er,qa;function ae(t){if(er===void 0)try{throw Error()}catch(i){var s=i.stack.trim().match(/\n( *(at )?)/);er=s&&s[1]||"",qa=-1<i.stack.indexOf(`
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
`+er+t+qa}var dt=!1;function qi(t,s){if(!t||dt)return"";dt=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(s){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(ge){var U=ge}Reflect.construct(t,[],ne)}else{try{ne.call()}catch(ge){U=ge}ne=!1;try{var G=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),ne=!0,new t}finally{ne&&(G!==void 0?Object.defineProperty(t.prototype,"props",G):delete t.prototype.props)}}}else{try{throw Error()}catch(ge){U=ge}(ne=t())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(ge){if(ge&&U&&typeof ge.stack=="string")return[ge.stack,U.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),x=h[0],w=h[1];if(x&&w){var R=x.split(`
`),P=w.split(`
`);for(d=l=0;l<R.length&&!R[l].includes("DetermineComponentFrameRoot");)l++;for(;d<P.length&&!P[d].includes("DetermineComponentFrameRoot");)d++;if(l===R.length||d===P.length)for(l=R.length-1,d=P.length-1;1<=l&&0<=d&&R[l]!==P[d];)d--;for(;1<=l&&0<=d;l--,d--)if(R[l]!==P[d]){if(l!==1||d!==1)do if(l--,d--,0>d||R[l]!==P[d]){var K=`
`+R[l].replace(" at new "," at ");return t.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",t.displayName)),K}while(1<=l&&0<=d);break}}}finally{dt=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?ae(i):""}function Bi(t,s){switch(t.tag){case 26:case 27:case 5:return ae(t.type);case 16:return ae("Lazy");case 13:return t.child!==s&&s!==null?ae("Suspense Fallback"):ae("Suspense");case 19:return ae("SuspenseList");case 0:case 15:return qi(t.type,!1);case 11:return qi(t.type.render,!1);case 1:return qi(t.type,!0);case 31:return ae("Activity");case 30:return ae("ViewTransition");default:return""}}function E(t){try{var s="",i=null;do s+=Bi(t,i),i=t,t=t.return;while(t);return s}catch(l){return`
Error generating stack: `+l.message+`
`+l.stack}}var H=Object.prototype.hasOwnProperty,I=e.unstable_scheduleCallback,le=e.unstable_cancelCallback,de=e.unstable_shouldYield,be=e.unstable_requestPaint,me=e.unstable_now,xe=e.unstable_getCurrentPriorityLevel,Te=e.unstable_ImmediatePriority,Ue=e.unstable_UserBlockingPriority,vt=e.unstable_NormalPriority,Rn=e.unstable_LowPriority,Bn=e.unstable_IdlePriority,$i=e.log,vf=e.unstable_setDisableYieldValue,Ds=null,Tn=null;function Ms(t){if(typeof $i=="function"&&vf(t),Tn&&typeof Tn.setStrictMode=="function")try{Tn.setStrictMode(Ds,t)}catch{}}var Wn=Math.clz32?Math.clz32:vj,xj=Math.log,yj=Math.LN2;function vj(t){return t>>>=0,t===0?32:31-(xj(t)/yj|0)|0}var Fc=256,Vc=262144,Zc=4194304;function Fi(t){var s=t&42;if(s!==0)return s;switch(t&-t){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Gc(t,s,i){var l=t.pendingLanes;if(l===0)return 0;var d=0,h=t.suspendedLanes,x=t.pingedLanes;t=t.warmLanes;var w=l&134217727;return w!==0?(l=w&~h,l!==0?d=Fi(l):(x&=w,x!==0?d=Fi(x):i||(i=w&~t,i!==0&&(d=Fi(i))))):(w=l&~h,w!==0?d=Fi(w):x!==0?d=Fi(x):i||(i=l&~t,i!==0&&(d=Fi(i)))),d===0?0:s!==0&&s!==d&&(s&h)===0&&(h=d&-d,i=s&-s,h>=i||h===32&&(i&4194048)!==0)?s:d}function fo(t,s){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&s)===0}function mg(t,s){(s&8)!==0&&(s|=s&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=s;0<i;){var l=31-Wn(i),d=1<<l;s|=t[l],i&=~d}return s}function wj(t,s){switch(t){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32: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 s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pg(){var t=Zc;return Zc<<=1,(Zc&62914560)===0&&(Zc=4194304),t}function wf(t){for(var s=[],i=0;31>i;i++)s.push(t);return s}function ho(t,s){t.pendingLanes|=s,s!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function _j(t,s,i,l,d,h){var x=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var w=t.entanglements,R=t.expirationTimes,P=t.hiddenUpdates;for(i=x&~i;0<i;){var K=31-Wn(i),ne=1<<K;w[K]=0,R[K]=-1;var U=P[K];if(U!==null)for(P[K]=null,K=0;K<U.length;K++){var G=U[K];G!==null&&(G.lane&=-536870913)}i&=~ne}l!==0&&gg(t,l,0),h!==0&&d===0&&t.tag!==0&&(t.suspendedLanes|=h&~(x&~s))}function gg(t,s,i){t.pendingLanes|=s,t.suspendedLanes&=~s;var l=31-Wn(s);t.entangledLanes|=s,t.entanglements[l]=t.entanglements[l]|1073741824|i&261930}function bg(t,s){var i=t.entangledLanes|=s;for(t=t.entanglements;i;){var l=31-Wn(i),d=1<<l;d&s|t[l]&s&&(t[l]|=s),i&=~d}}function xg(t,s){var i=s&-s;return i=(i&42)!==0?1:_f(i),(i&(t.suspendedLanes|s))!==0?0:i}function _f(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Sf(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function yg(){var t=je.p;return t!==0?t:(t=window.event,t===void 0?32:Ev(t.type))}function vg(t,s){var i=je.p;try{return je.p=t,s()}finally{je.p=i}}var Nr=Math.random().toString(36).slice(2),mn="__reactFiber$"+Nr,$n="__reactProps$"+Nr,Ba="__reactContainer$"+Nr,wg="__reactEvents$"+Nr,Sj="__reactListeners$"+Nr,Nj="__reactHandles$"+Nr,_g="__reactResources$"+Nr,mo="__reactMarker$"+Nr,Qc="__reactLoad$"+Nr;function Kc(t){delete t[mn],delete t[$n],delete t[Sj],delete t[Nj]}function Vi(t){var s;if(s=t[mn])return s;for(var i=t.parentNode;i;){if(s=i[Ba]||i[mn]){if(i=s.alternate,s.child!==null||i!==null&&i.child!==null)for(t=av(t);t!==null;){if(i=t[mn])return i;t=av(t)}return s}t=i,i=t.parentNode}return null}function $a(t){if(t=t[mn]||t[Ba]){var s=t.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return t}return null}function po(t){var s=t.tag;if(s===5||s===26||s===27||s===6)return t.stateNode;throw Error(a(33))}function Fa(t){var s=t[_g];return s||(s=t[_g]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function rn(t){t[mo]=!0}function Sg(t){t[Qc]=void 0}var Ng=new Set,jg={};function Zi(t,s){Va(t,s),Va(t+"Capture",s)}function Va(t,s){for(jg[t]=s,t=0;t<s.length;t++)Ng.add(s[t])}var jj=RegExp("^[: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]*$"),Eg={},Ag={};function Ej(t){return H.call(Ag,t)?!0:H.call(Eg,t)?!1:jj.test(t)?Ag[t]=!0:(Eg[t]=!0,!1)}var it=!1;function Cg(){var t=it;return it=!1,t}function Yc(t,s,i){if(Ej(s))if(i===null)t.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":t.removeAttribute(s);return;case"boolean":var l=s.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(s);return}}t.setAttribute(s,i)}}function Jc(t,s,i){if(i===null)t.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttribute(s,i)}}function jr(t,s,i,l){if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttributeNS(s,i,l)}}function es(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Og(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Aj(t,s,i){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,s);if(!t.hasOwnProperty(s)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,h=l.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return d.call(this)},set:function(x){i=""+x,h.call(this,x)}}),Object.defineProperty(t,s,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(x){i=""+x},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function Nf(t){if(!t._valueTracker){var s=Og(t)?"checked":"value";t._valueTracker=Aj(t,s,""+t[s])}}function Rg(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var i=s.getValue(),l="";return t&&(l=Og(t)?t.checked?"true":"false":t.value),t=l,t!==i?(s.setValue(t),!0):!1}var Cj=/[\n"\\]/g;function xs(t){return t.replace(Cj,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function jf(t,s,i,l,d,h,x,w){t.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?t.type=x:t.removeAttribute("type"),s!=null?x==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+es(s)):t.value!==""+es(s)&&(t.value=""+es(s)):x!=="submit"&&x!=="reset"||t.removeAttribute("value"),s!=null?x==="number"&&t.value==s?Ef(t,es(t.value)):Ef(t,es(s)):i!=null?Ef(t,es(i)):l!=null&&t.removeAttribute("value"),d==null&&h!=null&&(t.defaultChecked=!!h),d!=null&&(t.checked=d&&typeof d!="function"&&typeof d!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.name=""+es(w):t.removeAttribute("name")}function Tg(t,s,i,l,d,h,x,w){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),s!=null||i!=null){if(!(h!=="submit"&&h!=="reset"||s!=null)){Nf(t);return}i=i!=null?""+es(i):"",s=s!=null?""+es(s):i,w||s===t.value||(t.value=s),t.defaultValue=s}l=l??d,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=w?t.checked:!!l,t.defaultChecked=!!l,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.name=x),Nf(t)}function Ef(t,s){t.defaultValue!==""+s&&(t.defaultValue=""+s)}function Za(t,s,i,l){if(t=t.options,s){s={};for(var d=0;d<i.length;d++)s["$"+i[d]]=!0;for(i=0;i<t.length;i++)d=s.hasOwnProperty("$"+t[i].value),t[i].selected!==d&&(t[i].selected=d),d&&l&&(t[i].defaultSelected=!0)}else{for(i=""+es(i),s=null,d=0;d<t.length;d++){if(t[d].value===i){t[d].selected=!0,l&&(t[d].defaultSelected=!0);return}s!==null||t[d].disabled||(s=t[d])}s!==null&&(s.selected=!0)}}function kg(t,s,i){if(s!=null&&(s=""+es(s),s!==t.value&&(t.value=s),i==null)){t.defaultValue!==s&&(t.defaultValue=s);return}t.defaultValue=i!=null?""+es(i):""}function Dg(t,s,i,l){if(s==null){if(l!=null){if(i!=null)throw Error(a(92));if(qe(l)){if(1<l.length)throw Error(a(93));l=l[0]}i=l}i==null&&(i=""),s=i}i=es(s),t.defaultValue=i,l=t.textContent,l===i&&l!==""&&l!==null&&(t.value=l),Nf(t)}function Ga(t,s){if(s){var i=t.firstChild;if(i&&i===t.lastChild&&i.nodeType===3){i.nodeValue=s;return}}t.textContent=s}var Oj=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Mg(t,s,i){var l=s.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?t.setProperty(s,""):s==="float"?t.cssFloat="":t[s]="":l?t.setProperty(s,i):typeof i!="number"||i===0||Oj.has(s)?s==="float"?t.cssFloat=i:t[s]=(""+i).trim():t[s]=i+"px"}function zg(t,s,i){if(s!=null&&typeof s!="object")throw Error(a(62));if(t=t.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||s!=null&&s.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="",it=!0);for(var d in s)l=s[d],s.hasOwnProperty(d)&&i[d]!==l&&(Mg(t,d,l),it=!0)}else for(var h in s)s.hasOwnProperty(h)&&Mg(t,h,s[h])}function Af(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Rj=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Tj=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xc(t){return Tj.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function tr(){}var Cf=null;function Of(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Qa=null,Ka=null;function Ug(t){var s=$a(t);if(s&&(t=s.stateNode)){var i=t[$n]||null;e:switch(t=s.stateNode,s.type){case"input":if(jf(t,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),s=i.name,i.type==="radio"&&s!=null){for(i=t;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+xs(""+s)+'"][type="radio"]'),s=0;s<i.length;s++){var l=i[s];if(l!==t&&l.form===t.form){var d=l[$n]||null;if(!d)throw Error(a(90));jf(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(s=0;s<i.length;s++)l=i[s],l.form===t.form&&Rg(l)}break e;case"textarea":kg(t,i.value,i.defaultValue);break e;case"select":s=i.value,s!=null&&Za(t,!!i.multiple,s,!1)}}}var Rf=!1;function Ig(t,s,i){if(Rf)return t(s,i);Rf=!0;try{var l=t(s);return l}finally{if(Rf=!1,(Qa!==null||Ka!==null)&&(Xu(),Qa&&(s=Qa,t=Ka,Ka=Qa=null,Ug(s),t)))for(s=0;s<t.length;s++)Ug(t[s])}}function go(t,s){var i=t.stateNode;if(i===null)return null;var l=i[$n]||null;if(l===null)return null;i=l[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(i&&typeof i!="function")throw Error(a(231,s,typeof i));return i}var Er=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tf=!1;if(Er)try{var bo={};Object.defineProperty(bo,"passive",{get:function(){Tf=!0}}),window.addEventListener("test",bo,bo),window.removeEventListener("test",bo,bo)}catch{Tf=!1}var Yr=null,kf=null,Wc=null;function Lg(){if(Wc)return Wc;var t,s=kf,i=s.length,l,d="value"in Yr?Yr.value:Yr.textContent,h=d.length;for(t=0;t<i&&s[t]===d[t];t++);var x=i-t;for(l=1;l<=x&&s[i-l]===d[h-l];l++);return Wc=d.slice(t,1<l?1-l:void 0)}function eu(t){var s=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&s===13&&(t=13)):t=s,t===10&&(t=13),32<=t||t===13?t:0}function tu(){return!0}function Pg(){return!1}function kn(t){function s(i,l,d,h,x){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=h,this.target=x,this.currentTarget=null;for(var w in t)t.hasOwnProperty(w)&&(i=t[w],this[w]=i?i(h):h[w]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?tu:Pg,this.isPropagationStopped=Pg,this}return Q(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=tu)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=tu)},persist:function(){},isPersistent:tu}),s}var Jr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nu=kn(Jr),xo=Q({},Jr,{view:0,detail:0}),kj=kn(xo),Df,Mf,yo,su=Q({},xo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==yo&&(yo&&t.type==="mousemove"?(Df=t.screenX-yo.screenX,Mf=t.screenY-yo.screenY):Mf=Df=0,yo=t),Df)},movementY:function(t){return"movementY"in t?t.movementY:Mf}}),Hg=kn(su),Dj=Q({},su,{dataTransfer:0}),Mj=kn(Dj),zj=Q({},xo,{relatedTarget:0}),zf=kn(zj),Uj=Q({},Jr,{animationName:0,elapsedTime:0,pseudoElement:0}),Ij=kn(Uj),Lj=Q({},Jr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Pj=kn(Lj),Hj=Q({},Jr,{data:0}),qg=kn(Hj),qj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bj={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"},$j={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fj(t){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(t):(t=$j[t])?!!s[t]:!1}function Uf(){return Fj}var Vj=Q({},xo,{key:function(t){if(t.key){var s=qj[t.key]||t.key;if(s!=="Unidentified")return s}return t.type==="keypress"?(t=eu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Bj[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uf,charCode:function(t){return t.type==="keypress"?eu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?eu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Zj=kn(Vj),Gj=Q({},su,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bg=kn(Gj),Qj=Q({},Jr,{submitter:0}),Kj=kn(Qj),Yj=Q({},xo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uf}),Jj=kn(Yj),Xj=Q({},Jr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wj=kn(Xj),e5=Q({},su,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),t5=kn(e5),n5=Q({},Jr,{newState:0,oldState:0,source:0}),s5=kn(n5),r5=[9,13,27,32],If=Er&&"CompositionEvent"in window,vo=null;Er&&"documentMode"in document&&(vo=document.documentMode);var i5=Er&&"TextEvent"in window&&!vo,$g=Er&&(!If||vo&&8<vo&&11>=vo),Fg=" ",Vg=!1;function Zg(t,s){switch(t){case"keyup":return r5.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ya=!1;function a5(t,s){switch(t){case"compositionend":return Gg(s);case"keypress":return s.which!==32?null:(Vg=!0,Fg);case"textInput":return t=s.data,t===Fg&&Vg?null:t;default:return null}}function l5(t,s){if(Ya)return t==="compositionend"||!If&&Zg(t,s)?(t=Lg(),Wc=kf=Yr=null,Ya=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return $g&&s.locale!=="ko"?null:s.data;default:return null}}var o5={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 Qg(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s==="input"?!!o5[t.type]:s==="textarea"}function Kg(t,s,i,l){Qa?Ka?Ka.push(l):Ka=[l]:Qa=l,s=rd(s,"onChange"),0<s.length&&(i=new nu("onChange","change",null,i,l),t.push({event:i,listeners:s}))}var wo=null,_o=null;function c5(t){Uy(t,0)}function ru(t){var s=po(t);if(Rg(s))return t}function Yg(t,s){if(t==="change")return s}var Jg=!1;if(Er){var Lf;if(Er){var Pf="oninput"in document;if(!Pf){var Xg=document.createElement("div");Xg.setAttribute("oninput","return;"),Pf=typeof Xg.oninput=="function"}Lf=Pf}else Lf=!1;Jg=Lf&&(!document.documentMode||9<document.documentMode)}function Wg(){wo&&(wo.detachEvent("onpropertychange",eb),_o=wo=null)}function eb(t){if(t.propertyName==="value"&&ru(_o)){var s=[];Kg(s,_o,t,Of(t)),Ig(c5,s)}}function u5(t,s,i){t==="focusin"?(Wg(),wo=s,_o=i,wo.attachEvent("onpropertychange",eb)):t==="focusout"&&Wg()}function d5(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ru(_o)}function f5(t,s){if(t==="click")return ru(s)}function h5(t,s){if(t==="input"||t==="change")return ru(s)}function m5(t,s){return t===s&&(t!==0||1/t===1/s)||t!==t&&s!==s}var ts=typeof Object.is=="function"?Object.is:m5;function So(t,s){if(ts(t,s))return!0;if(typeof t!="object"||t===null||typeof s!="object"||s===null)return!1;var i=Object.keys(t),l=Object.keys(s);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!H.call(s,d)||!ts(t[d],s[d]))return!1}return!0}function Hf(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function tb(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function nb(t,s){var i=tb(t);t=0;for(var l;i;){if(i.nodeType===3){if(l=t+i.textContent.length,t<=s&&l>=s)return{node:i,offset:s-t};t=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=tb(i)}}function sb(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?sb(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function rb(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var s=Hf(t.document);s instanceof t.HTMLIFrameElement;){try{var i=typeof s.contentWindow.location.href=="string"}catch{i=!1}if(i)t=s.contentWindow;else break;s=Hf(t.document)}return s}function qf(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}var p5=Er&&"documentMode"in document&&11>=document.documentMode,Ja=null,Bf=null,No=null,$f=!1;function ib(t,s,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;$f||Ja==null||Ja!==Hf(l)||(l=Ja,"selectionStart"in l&&qf(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),No&&So(No,l)||(No=l,l=rd(Bf,"onSelect"),0<l.length&&(s=new nu("onSelect","select",null,s,i),t.push({event:s,listeners:l}),s.target=Ja)))}function Gi(t,s){var i={};return i[t.toLowerCase()]=s.toLowerCase(),i["Webkit"+t]="webkit"+s,i["Moz"+t]="moz"+s,i}var Xa={animationend:Gi("Animation","AnimationEnd"),animationiteration:Gi("Animation","AnimationIteration"),animationstart:Gi("Animation","AnimationStart"),transitionrun:Gi("Transition","TransitionRun"),transitionstart:Gi("Transition","TransitionStart"),transitioncancel:Gi("Transition","TransitionCancel"),transitionend:Gi("Transition","TransitionEnd")},Ff={},ab={};Er&&(ab=document.createElement("div").style,"AnimationEvent"in window||(delete Xa.animationend.animation,delete Xa.animationiteration.animation,delete Xa.animationstart.animation),"TransitionEvent"in window||delete Xa.transitionend.transition);function Qi(t){if(Ff[t])return Ff[t];if(!Xa[t])return t;var s=Xa[t],i;for(i in s)if(s.hasOwnProperty(i)&&i in ab)return Ff[t]=s[i];return t}var lb=Qi("animationend"),ob=Qi("animationiteration"),cb=Qi("animationstart"),g5=Qi("transitionrun"),b5=Qi("transitionstart"),x5=Qi("transitioncancel"),ub=Qi("transitionend"),db=new Map,Vf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Vf.push("scrollEnd");function zs(t,s){db.set(t,s),Zi(s,[t])}var y5=0;function Ar(t,s){if(t.name!=null&&t.name!=="auto")return t.name;if(s.autoName!==null)return s.autoName;t=Ps.identifierPrefix;var i=y5++;return t="_"+t+"t_"+i.toString(32)+"_",s.autoName=t}function fb(t){if(t==null||typeof t=="string")return t;var s=null,i=xl;if(i!==null)for(var l=0;l<i.length;l++){var d=t[i[l]];if(d!=null){if(d==="none")return"none";s=s==null?d:s+(" "+d)}}return s??t.default}function Cr(t,s){return t=fb(t),s=fb(s),s==null?t==="auto"?null:t:s==="auto"?null:s}var iu=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ys=[],Wa=0,Zf=0;function au(){for(var t=Wa,s=Zf=Wa=0;s<t;){var i=ys[s];ys[s++]=null;var l=ys[s];ys[s++]=null;var d=ys[s];ys[s++]=null;var h=ys[s];if(ys[s++]=null,l!==null&&d!==null){var x=l.pending;x===null?d.next=d:(d.next=x.next,x.next=d),l.pending=d}h!==0&&hb(i,d,h)}}function lu(t,s,i,l){ys[Wa++]=t,ys[Wa++]=s,ys[Wa++]=i,ys[Wa++]=l,Zf|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Gf(t,s,i,l){return lu(t,s,i,l),ou(t)}function Ki(t,s){return lu(t,null,null,s),ou(t)}function hb(t,s,i){t.lanes|=i;var l=t.alternate;l!==null&&(l.lanes|=i);for(var d=!1,h=t.return;h!==null;)h.childLanes|=i,l=h.alternate,l!==null&&(l.childLanes|=i),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(d=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,d&&s!==null&&(d=31-Wn(i),t=h.hiddenUpdates,l=t[d],l===null?t[d]=[s]:l.push(s),s.lane=i|536870912),h):null}function ou(t){if(50<Zo)throw Zo=0,Ju=null,Error(a(185));for(var s=t.return;s!==null;)t=s,s=t.return;return t.tag===3?t.stateNode:null}var el={};function v5(t,s,i,l){this.tag=t,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fn(t,s,i,l){return new v5(t,s,i,l)}function Qf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Or(t,s){var i=t.alternate;return i===null?(i=Fn(t.tag,s,t.key,t.mode),i.elementType=t.elementType,i.type=t.type,i.stateNode=t.stateNode,i.alternate=t,t.alternate=i):(i.pendingProps=s,i.type=t.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=t.flags&1206910976,i.childLanes=t.childLanes,i.lanes=t.lanes,i.child=t.child,i.memoizedProps=t.memoizedProps,i.memoizedState=t.memoizedState,i.updateQueue=t.updateQueue,s=t.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},i.sibling=t.sibling,i.index=t.index,i.ref=t.ref,i.refCleanup=t.refCleanup,i}function mb(t,s){t.flags&=1206910978;var i=t.alternate;return i===null?(t.childLanes=0,t.lanes=s,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=i.childLanes,t.lanes=i.lanes,t.child=i.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=i.memoizedProps,t.memoizedState=i.memoizedState,t.updateQueue=i.updateQueue,t.type=i.type,s=i.dependencies,t.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),t}function cu(t,s,i,l,d,h){var x=0;if(l=t,typeof l=="function")Qf(l)&&(x=1);else if(typeof l=="string")x=Q2(t,i,$.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(l){case Ye:return t=Fn(31,i,s,d),t.elementType=Ye,t.lanes=h,t;case we:return Yi(i.children,d,h,s);case Ce:x=8,d|=24;break;case Z:return t=Fn(12,i,s,d|2),t.elementType=Z,t.lanes=h,t;case z:return t=Fn(13,i,s,d),t.elementType=z,t.lanes=h,t;case ue:return t=Fn(19,i,s,d),t.elementType=ue,t.lanes=h,t;case $e:case _:return t=d|32,t=Fn(30,i,s,t),t.elementType=_,t.lanes=h,t.stateNode={autoName:null,paired:null,clones:null,ref:null},t;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case oe:x=10;break e;case W:x=9;break e;case ee:x=11;break e;case Me:x=14;break e;case Ae:x=16,l=null;break e}x=29,i=Error(a(130,t===null?"null":typeof t,"")),l=null}return s=Fn(x,i,s,d),s.elementType=t,s.type=l,s.lanes=h,s}function Yi(t,s,i,l){return t=Fn(7,t,l,s),t.lanes=i,t}function Kf(t,s,i){return t=Fn(6,t,null,s),t.lanes=i,t}function pb(t){var s=Fn(18,null,null,0);return s.stateNode=t,s}function Yf(t,s,i){return s=Fn(4,t.children!==null?t.children:[],t.key,s),s.lanes=i,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}var gb=new WeakMap;function vs(t,s){if(typeof t=="object"&&t!==null){var i=gb.get(t);return i!==void 0?i:(s={value:t,source:s,stack:E(s)},gb.set(t,s),s)}return{value:t,source:s,stack:E(s)}}var tl=[],nl=0,uu=null,jo=0,ws=[],_s=0,Xr=null,nr=1,sr="";function Rr(t,s){tl[nl++]=jo,tl[nl++]=uu,uu=t,jo=s}function bb(t,s,i){ws[_s++]=nr,ws[_s++]=sr,ws[_s++]=Xr,Xr=t;var l=nr;t=sr;var d=32-Wn(l)-1;l&=~(1<<d),i+=1;var h=32-Wn(s)+d;if(30<h){var x=d-d%5;h=(l&(1<<x)-1).toString(32),l>>=x,d-=x,nr=1<<32-Wn(s)+d|i<<d|l,sr=h+t}else nr=1<<h|i<<d|l,sr=t}function du(t){t.return!==null&&(Rr(t,1),bb(t,1,0))}function Jf(t){for(;t===uu;)uu=tl[--nl],tl[nl]=null,jo=tl[--nl],tl[nl]=null;for(;t===Xr;)Xr=ws[--_s],ws[_s]=null,sr=ws[--_s],ws[_s]=null,nr=ws[--_s],ws[_s]=null}function xb(t,s){ws[_s++]=nr,ws[_s++]=sr,ws[_s++]=Xr,nr=s.id,sr=s.overflow,Xr=t}var an=null,Nt=null,Qe=!1,Wr=null,Ss=!1,Xf=Error(a(519));function ei(t){var s=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Eo(vs(s,t)),Xf}function yb(t){var s=t.stateNode,i=t.type,l=t.memoizedProps;switch(s[mn]=t,s[$n]=l,i){case"dialog":Xe("cancel",s),Xe("close",s);break;case"iframe":case"object":case"embed":Xe("load",s);break;case"video":case"audio":for(i=0;i<Qo.length;i++)Xe(Qo[i],s);break;case"source":Xe("error",s);break;case"img":case"image":case"link":Xe("error",s),Xe("load",s);break;case"details":Xe("toggle",s);break;case"input":Xe("invalid",s),Tg(s,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Xe("invalid",s);break;case"textarea":Xe("invalid",s),Dg(s,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||s.textContent===""+i||l.suppressHydrationWarning===!0||Hy(s.textContent,i)?(l.popover!=null&&(Xe("beforetoggle",s),Xe("toggle",s)),l.onScroll!=null&&Xe("scroll",s),l.onScrollEnd!=null&&Xe("scrollend",s),l.onClick!=null&&(s.onclick=tr),s=!0):s=!1,s||ei(t,!0)}function fu(t){for(an=t.return;an;)switch(an.tag){case 5:case 31:case 13:Ss=!1;return;case 27:case 3:Ss=!0;return;default:an=an.return}}function sl(t){if(t!==an)return!1;if(!Qe)return fu(t),Qe=!0,!1;var s=t.tag,i;if((i=s!==3&&s!==27)&&((i=s===5)&&(i=t.type,i=!(i!=="form"&&i!=="button")||Cm(t.type,t.memoizedProps)),i=!i),i&&Nt&&ei(t),fu(t),s===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Nt=iv(t)}else if(s===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Nt=iv(t)}else s===27?(s=Nt,gi(t.type)?(t=Im,Im=null,Nt=t):Nt=s):Nt=an?js(t.stateNode.nextSibling):null;return!0}function Ji(){Nt=an=null,Qe=!1}function Wf(){var t=Wr;return t!==null&&(Gn===null?Gn=t:Gn.push.apply(Gn,t),Wr=null),t}function Eo(t){Wr===null?Wr=[t]:Wr.push(t)}var eh=J(null),Xi=null,Tr=null;function ti(t,s,i){pe(eh,s._currentValue),s._currentValue=i}function kr(t){t._currentValue=eh.current,Re(eh)}function hu(t,s,i){for(;t!==null;){var l=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,l!==null&&(l.childLanes|=s)):l!==null&&(l.childLanes&s)!==s&&(l.childLanes|=s),t===i)break;t=t.return}}function th(t,s,i,l){var d=t.child;for(d!==null&&(d.return=t);d!==null;){var h=d.dependencies;if(h!==null){var x=d.child;h=h.firstContext;e:for(;h!==null;){var w=h;h=d;for(var R=0;R<s.length;R++)if(w.context===s[R]){h.lanes|=i,w=h.alternate,w!==null&&(w.lanes|=i),hu(h.return,i,t),l||(x=null);break e}h=w.next}}else if(d.tag===18){if(x=d.return,x===null)throw Error(a(341));x.lanes|=i,h=x.alternate,h!==null&&(h.lanes|=i),hu(x,i,t),x=null}else d.tag===13&&d.memoizedState!==null&&d.memoizedState.dehydrated===null?(d.lanes|=i,x=d.alternate,x!==null&&(x.lanes|=i),hu(d.return,i,t),x=d.child,x=x!==null?x.sibling:null):x=d.child;if(x!==null)x.return=d;else for(x=d;x!==null;){if(x===t){x=null;break}if(d=x.sibling,d!==null){d.return=x.return,x=d;break}x=x.return}d=x}}function Wi(t,s,i,l){t=null;for(var d=s,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var x=d.alternate;if(x===null)throw Error(a(387));if(x=x.memoizedProps,x!==null){var w=d.type;ts(d.pendingProps.value,x.value)||(t!==null?t.push(w):t=[w])}}else if(d===qt.current){if(x=d.alternate,x===null)throw Error(a(387));x.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(t!==null?t.push(Cl):t=[Cl])}d=d.return}return t!==null&&th(s,t,i,l),s.flags|=262144,t!==null}function mu(t){for(t=t.firstContext;t!==null;){if(!ts(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ea(t){Xi=t,Tr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function pn(t){return vb(Xi,t)}function pu(t,s){return Xi===null&&ea(t),vb(t,s)}function vb(t,s){var i=s._currentValue;if(s={context:s,memoizedValue:i,next:null},Tr===null){if(t===null)throw Error(a(308));Tr=s,t.dependencies={lanes:0,firstContext:s},t.flags|=524288}else Tr=Tr.next=s;return i}var w5=typeof AbortController<"u"?AbortController:function(){var t=[],s=this.signal={aborted:!1,addEventListener:function(i,l){t.push(l)}};this.abort=function(){s.aborted=!0,t.forEach(function(i){return i()})}},_5=e.unstable_scheduleCallback,S5=e.unstable_NormalPriority,Gt={$$typeof:oe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nh(){return{controller:new w5,data:new Map,refCount:0}}function Ao(t){t.refCount--,t.refCount===0&&_5(S5,function(){t.controller.abort()})}function wb(t,s){if((t.pendingLanes&4194048)!==0){var i=t.transitionTypes;for(i===null&&(i=t.transitionTypes=[]),t=0;t<s.length;t++){var l=s[t];i.indexOf(l)===-1&&i.push(l)}}}var Co=null;function N5(t){var s=t.transitionTypes;return t.transitionTypes=null,s}var Oo=null,sh=0,ta=0,rl=null;function j5(t,s){if(Oo===null){var i=Oo=[];sh=0,ta=ym(),rl={status:"pending",value:void 0,then:function(l){i.push(l)}}}return sh++,s.then(_b,_b),s}function _b(){if(--sh===0&&(Co=null,Oo!==null)){rl!==null&&(rl.status="fulfilled");var t=Oo;Oo=null,ta=0,rl=null;for(var s=0;s<t.length;s++)(0,t[s])()}}function E5(t,s){var i=[],l={status:"pending",value:null,reason:null,then:function(d){i.push(d)}};return t.then(function(){l.status="fulfilled",l.value=s;for(var d=0;d<i.length;d++)(0,i[d])(s)},function(d){for(l.status="rejected",l.reason=d,d=0;d<i.length;d++)(0,i[d])(void 0)}),l}var Sb=_e.S;_e.S=function(t,s){if(py=me(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&j5(t,s),Co!==null)for(var i=_l;i!==null;)wb(i,Co),i=i.next;if(i=t.types,i!==null){for(var l=_l;l!==null;)wb(l,i),l=l.next;if(ta!==0){l=Co,l===null&&(l=Co=[]);for(var d=0;d<i.length;d++){var h=i[d];l.indexOf(h)===-1&&l.push(h)}}}Sb!==null&&Sb(t,s)};var na=J(null);function rh(){var t=na.current;return t!==null?t:St.pooledCache}function gu(t,s){s===null?pe(na,na.current):pe(na,s.pool)}function Nb(){var t=rh();return t===null?null:{parent:Gt._currentValue,pool:t}}var il=Error(a(460)),ih=Error(a(474)),bu=Error(a(542)),xu={then:function(){}};function jb(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Eb(t,s,i){switch(i=t[i],i===void 0?t.push(s):i!==s&&(s.then(tr,tr),s=i),s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,Cb(t),t===void 0&&!("reason"in s)?Error(a(600)):t;default:if(typeof s.status=="string")s.then(tr,tr);else{if(t=St,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=s,t.status="pending",t.then(function(l){if(s.status==="pending"){var d=s;d.status="fulfilled",d.value=l}},function(l){if(s.status==="pending"){var d=s;d.status="rejected",d.reason=l}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw t=s.reason,Cb(t),t}throw ra=s,il}}function sa(t){try{var s=t._init;return s(t._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(ra=i,il):i}}var ra=null;function Ab(){if(ra===null)throw Error(a(459));var t=ra;return ra=null,t}function Cb(t){if(t===il||t===bu)throw Error(a(483))}var al=null,Ro=0;function yu(t){var s=Ro;return Ro+=1,al===null&&(al=[]),Eb(al,t,s)}function ni(t,s){s=s.props.ref,t.ref=s!==void 0?s:null}function vu(t,s){throw s.$$typeof===X?Error(a(525)):(t=Object.prototype.toString.call(s),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":t)))}function Ob(t){function s(L,D){if(t){var V=L.deletions;V===null?(L.deletions=[D],L.flags|=16):V.push(D)}}function i(L,D){if(!t)return null;for(;D!==null;)s(L,D),D=D.sibling;return null}function l(L){for(var D=new Map;L!==null;)L.key===null?D.set(L.index,L):D.set(L.key,L),L=L.sibling;return D}function d(L,D){return L=Or(L,D),L.index=0,L.sibling=null,L}function h(L,D,V){return L.index=V,t?(V=L.alternate,V!==null?(V=V.index,V<D?(L.flags|=2,D):V):(L.flags|=134217730,D)):(L.flags|=1048576,D)}function x(L){return t&&L.alternate===null&&(L.flags|=134217730),L}function w(L,D,V,te){return D===null||D.tag!==6?(D=Kf(V,L.mode,te),D.return=L,D):(D=d(D,V),D.return=L,D)}function R(L,D,V,te){var Ne=V.type;return Ne===we?(L=K(L,D,V.props.children,te,V.key),ni(L,V),L):D!==null&&(D.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Ae&&sa(Ne)===D.type)?(D=d(D,V.props),ni(D,V),D.return=L,D):(D=cu(V.type,V.key,V.props,null,L.mode,te),ni(D,V),D.return=L,D)}function P(L,D,V,te){return D===null||D.tag!==4||D.stateNode.containerInfo!==V.containerInfo||D.stateNode.implementation!==V.implementation?(D=Yf(V,L.mode,te),D.return=L,D):(D=d(D,V.children||[]),D.return=L,D)}function K(L,D,V,te,Ne){return D===null||D.tag!==7?(D=Yi(V,L.mode,te,Ne),D.return=L,D):(D=d(D,V),D.return=L,D)}function ne(L,D,V){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=Kf(""+D,L.mode,V),D.return=L,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case se:return V=cu(D.type,D.key,D.props,null,L.mode,V),ni(V,D),V.return=L,V;case fe:return D=Yf(D,L.mode,V),D.return=L,D;case Ae:return D=sa(D),ne(L,D,V)}if(qe(D)||ce(D))return D=Yi(D,L.mode,V,null),D.return=L,D;if(typeof D.then=="function")return ne(L,yu(D),V);if(D.$$typeof===oe)return ne(L,pu(L,D),V);vu(L,D)}return null}function U(L,D,V,te){var Ne=D!==null?D.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return Ne!==null?null:w(L,D,""+V,te);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case se:return V.key===Ne?R(L,D,V,te):null;case fe:return V.key===Ne?P(L,D,V,te):null;case Ae:return V=sa(V),U(L,D,V,te)}if(qe(V)||ce(V))return Ne!==null?null:K(L,D,V,te,null);if(typeof V.then=="function")return U(L,D,yu(V),te);if(V.$$typeof===oe)return U(L,D,pu(L,V),te);vu(L,V)}return null}function G(L,D,V,te,Ne){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return L=L.get(V)||null,w(D,L,""+te,Ne);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case se:return L=L.get(te.key===null?V:te.key)||null,R(D,L,te,Ne);case fe:return L=L.get(te.key===null?V:te.key)||null,P(D,L,te,Ne);case Ae:return te=sa(te),G(L,D,V,te,Ne)}if(qe(te)||ce(te))return L=L.get(V)||null,K(D,L,te,Ne,null);if(typeof te.then=="function")return G(L,D,V,yu(te),Ne);if(te.$$typeof===oe)return G(L,D,V,pu(D,te),Ne);vu(D,te)}return null}function ge(L,D,V,te){for(var Ne=null,et=null,ke=D,He=D=0,Yt=null;ke!==null&&He<V.length;He++){ke.index>He?(Yt=ke,ke=null):Yt=ke.sibling;var st=U(L,ke,V[He],te);if(st===null){ke===null&&(ke=Yt);break}t&&ke&&st.alternate===null&&s(L,ke),D=h(st,D,He),et===null?Ne=st:et.sibling=st,et=st,ke=Yt}if(He===V.length)return i(L,ke),Qe&&Rr(L,He),Ne;if(ke===null){for(;He<V.length;He++)ke=ne(L,V[He],te),ke!==null&&(D=h(ke,D,He),et===null?Ne=ke:et.sibling=ke,et=ke);return Qe&&Rr(L,He),Ne}for(ke=l(ke);He<V.length;He++)Yt=G(ke,L,He,V[He],te),Yt!==null&&(t&&(st=Yt.alternate,st!==null&&ke.delete(st.key===null?He:st.key)),D=h(Yt,D,He),et===null?Ne=Yt:et.sibling=Yt,et=Yt);return t&&ke.forEach(function(wi){return s(L,wi)}),Qe&&Rr(L,He),Ne}function Ee(L,D,V,te){if(V==null)throw Error(a(151));for(var Ne=null,et=null,ke=D,He=D=0,Yt=null,st=V.next();ke!==null&&!st.done;He++,st=V.next()){ke.index>He?(Yt=ke,ke=null):Yt=ke.sibling;var wi=U(L,ke,st.value,te);if(wi===null){ke===null&&(ke=Yt);break}t&&ke&&wi.alternate===null&&s(L,ke),D=h(wi,D,He),et===null?Ne=wi:et.sibling=wi,et=wi,ke=Yt}if(st.done)return i(L,ke),Qe&&Rr(L,He),Ne;if(ke===null){for(;!st.done;He++,st=V.next())st=ne(L,st.value,te),st!==null&&(D=h(st,D,He),et===null?Ne=st:et.sibling=st,et=st);return Qe&&Rr(L,He),Ne}for(ke=l(ke);!st.done;He++,st=V.next())st=G(ke,L,He,st.value,te),st!==null&&(t&&(Yt=st.alternate,Yt!==null&&ke.delete(Yt.key===null?He:Yt.key)),D=h(st,D,He),et===null?Ne=st:et.sibling=st,et=st);return t&&ke.forEach(function(aE){return s(L,aE)}),Qe&&Rr(L,He),Ne}function Ve(L,D,V,te){if(typeof V=="object"&&V!==null&&V.type===we&&V.key===null&&V.props.ref===void 0&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case se:e:{for(var Ne=V.key;D!==null;){if(D.key===Ne){if(Ne=V.type,Ne===we){if(D.tag===7){i(L,D.sibling),te=d(D,V.props.children),ni(te,V),te.return=L,L=te;break e}}else if(D.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Ae&&sa(Ne)===D.type){i(L,D.sibling),te=d(D,V.props),ni(te,V),te.return=L,L=te;break e}i(L,D);break}else s(L,D);D=D.sibling}V.type===we?(te=Yi(V.props.children,L.mode,te,V.key),ni(te,V),te.return=L,L=te):(te=cu(V.type,V.key,V.props,null,L.mode,te),ni(te,V),te.return=L,L=te)}return x(L);case fe:e:{for(Ne=V.key;D!==null;){if(D.key===Ne)if(D.tag===4&&D.stateNode.containerInfo===V.containerInfo&&D.stateNode.implementation===V.implementation){i(L,D.sibling),te=d(D,V.children||[]),te.return=L,L=te;break e}else{i(L,D);break}else s(L,D);D=D.sibling}te=Yf(V,L.mode,te),te.return=L,L=te}return x(L);case Ae:return V=sa(V),Ve(L,D,V,te)}if(qe(V))return ge(L,D,V,te);if(ce(V)){if(Ne=ce(V),typeof Ne!="function")throw Error(a(150));return V=Ne.call(V),Ee(L,D,V,te)}if(typeof V.then=="function")return Ve(L,D,yu(V),te);if(V.$$typeof===oe)return Ve(L,D,pu(L,V),te);vu(L,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,D!==null&&D.tag===6?(i(L,D.sibling),te=d(D,V),te.return=L,L=te):(i(L,D),te=Kf(V,L.mode,te),te.return=L,L=te),x(L)):i(L,D)}return function(L,D,V,te){try{Ro=0;var Ne=Ve(L,D,V,te);return al=null,Ne}catch(ke){if(ke===il||ke===bu)throw ke;var et=Fn(29,ke,null,L.mode);return et.lanes=te,et.return=L,et}finally{}}}var ia=Ob(!0),Rb=Ob(!1),si=!1;function ah(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lh(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ri(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ii(t,s,i){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(lt&2)!==0){var d=l.pending;return d===null?s.next=s:(s.next=d.next,d.next=s),l.pending=s,s=ou(t),hb(t,null,i),s}return lu(t,l,s,i),ou(t)}function To(t,s,i){if(s=s.updateQueue,s!==null&&(s=s.shared,(i&4194048)!==0)){var l=s.lanes;l&=t.pendingLanes,i|=l,s.lanes=i,bg(t,i)}}function oh(t,s){var i=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var x={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};h===null?d=h=x:h=h.next=x,i=i.next}while(i!==null);h===null?d=h=s:h=h.next=s}else d=h=s;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:l.shared,callbacks:l.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=s:t.next=s,i.lastBaseUpdate=s}var ch=!1;function ko(){if(ch){var t=rl;if(t!==null)throw t}}function Do(t,s,i,l){ch=!1;var d=t.updateQueue;si=!1;var h=d.firstBaseUpdate,x=d.lastBaseUpdate,w=d.shared.pending;if(w!==null){d.shared.pending=null;var R=w,P=R.next;R.next=null,x===null?h=P:x.next=P,x=R;var K=t.alternate;K!==null&&(K=K.updateQueue,w=K.lastBaseUpdate,w!==x&&(w===null?K.firstBaseUpdate=P:w.next=P,K.lastBaseUpdate=R))}if(h!==null){var ne=d.baseState;x=0,K=P=R=null,w=h;do{var U=w.lane&-536870913,G=U!==w.lane;if(G?(We&U)===U:(l&U)===U){U!==0&&U===ta&&(ch=!0),K!==null&&(K=K.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var ge=t,Ee=w;U=s;var Ve=i;switch(Ee.tag){case 1:if(ge=Ee.payload,typeof ge=="function"){ne=ge.call(Ve,ne,U);break e}ne=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ee.payload,U=typeof ge=="function"?ge.call(Ve,ne,U):ge,U==null)break e;ne=Q({},ne,U);break e;case 2:si=!0}}U=w.callback,U!==null&&(t.flags|=64,G&&(t.flags|=8192),G=d.callbacks,G===null?d.callbacks=[U]:G.push(U))}else G={lane:U,tag:w.tag,payload:w.payload,callback:w.callback,next:null},K===null?(P=K=G,R=ne):K=K.next=G,x|=U;if(w=w.next,w===null){if(w=d.shared.pending,w===null)break;G=w,w=G.next,G.next=null,d.lastBaseUpdate=G,d.shared.pending=null}}while(!0);K===null&&(R=ne),d.baseState=R,d.firstBaseUpdate=P,d.lastBaseUpdate=K,h===null&&(d.shared.lanes=0),fi|=x,t.lanes=x,t.memoizedState=ne}}function Tb(t,s){if(typeof t!="function")throw Error(a(191,t));t.call(s)}function kb(t,s){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;t<i.length;t++)Tb(i[t],s)}var ai=J(null),wu=J(0);function Db(t,s){t=Ir,pe(wu,t),pe(ai,s),Ir=t|s.baseLanes}function uh(){pe(wu,Ir),pe(ai,ai.current)}function dh(){Ir=wu.current,Re(ai),Re(wu)}var gn=J(null),Nn=null;function li(t){var s=t.alternate;pe(bn,bn.current&1),pe(gn,t),Nn===null&&(s===null||ai.current!==null||s.memoizedState!==null)&&(Nn=t)}function fh(t){pe(bn,bn.current),pe(gn,t),Nn===null&&(Nn=t)}function Mb(t){t.tag===22?(pe(bn,bn.current),pe(gn,t),Nn===null&&(Nn=t)):oi()}function oi(){pe(bn,bn.current),pe(gn,gn.current)}function ns(t){Re(gn),Nn===t&&(Nn=null),Re(bn)}var bn=J(0);function Mo(t,s){pe(gn,gn.current),pe(bn,s)}function hh(t){Re(bn),Re(gn),Nn===t&&(Nn=null)}function _u(t){for(var s=t;s!==null;){if(s.tag===13){var i=s.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||zm(i)||Um(i)))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!=="independent"){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Dr=0,Fe=null,wt=null,Qt=null,Su=!1,ll=!1,aa=!1,Nu=0,zo=0,ol=null,A5=0;function zt(){throw Error(a(321))}function mh(t,s){if(s===null)return!1;for(var i=0;i<s.length&&i<t.length;i++)if(!ts(t[i],s[i]))return!1;return!0}function ph(t,s,i,l,d,h){return Dr=h,Fe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,_e.H=t===null||t.memoizedState===null?bx:xx,aa=!1,h=i(l,d),aa=!1,ll&&(h=Ub(s,i,l,d)),zb(t),h}function zb(t){_e.H=Tu;var s=wt!==null&&wt.next!==null;if(Dr=0,Qt=wt=Fe=null,Su=!1,zo=0,ol=null,s)throw Error(a(300));t===null||Kt||(t=t.dependencies,t!==null&&mu(t)&&(Kt=!0))}function Ub(t,s,i,l){Fe=t;var d=0;do{if(ll&&(ol=null),zo=0,ll=!1,25<=d)throw Error(a(301));if(d+=1,Qt=wt=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}_e.H=z5,h=s(i,l)}while(ll);return h}function C5(){var t=_e.H,s=t.useState()[0];return s=typeof s.then=="function"?Uo(s):s,t=t.useState()[0],(wt!==null?wt.memoizedState:null)!==t&&(Fe.flags|=1024),s}function gh(){var t=Nu!==0;return Nu=0,t}function bh(t,s,i){s.updateQueue=t.updateQueue,s.flags&=-2053,t.lanes&=~i}function xh(t){if(Su){for(t=t.memoizedState;t!==null;){var s=t.queue;s!==null&&(s.pending=null),t=t.next}Su=!1}Dr=0,Qt=wt=Fe=null,ll=!1,zo=Nu=0,ol=null}function Dn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qt===null?Fe.memoizedState=Qt=t:Qt=Qt.next=t,Qt}function Bt(){if(wt===null){var t=Fe.alternate;t=t!==null?t.memoizedState:null}else t=wt.next;var s=Qt===null?Fe.memoizedState:Qt.next;if(s!==null)Qt=s,wt=t;else{if(t===null)throw Fe.alternate===null?Error(a(467)):Error(a(310));wt=t,t={memoizedState:wt.memoizedState,baseState:wt.baseState,baseQueue:wt.baseQueue,queue:wt.queue,next:null},Qt===null?Fe.memoizedState=Qt=t:Qt=Qt.next=t}return Qt}function ju(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Uo(t){var s=zo;return zo+=1,ol===null&&(ol=[]),t=Eb(ol,t,s),s=Fe,(Qt===null?s.memoizedState:Qt.next)===null&&(s=s.alternate,_e.H=s===null||s.memoizedState===null?bx:xx),t}function Eu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Uo(t);if(t.$$typeof===Y)return;if(t.$$typeof===oe)return pn(t)}throw Error(a(438,String(t)))}function yh(t){var s=null,i=Fe.updateQueue;if(i!==null&&(s=i.memoCache),s==null){var l=Fe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(s={data:l.data.map(function(d){return d.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),i===null&&(i=ju(),Fe.updateQueue=i),i.memoCache=s,i=s.data[s.index],i===void 0)for(i=s.data[s.index]=Array(t),l=0;l<t;l++)i[l]=ut;return s.index++,i}function Mr(t,s){return typeof s=="function"?s(t):s}function Au(t){var s=Bt();return vh(s,wt,t)}function vh(t,s,i){var l=t.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=i;var d=t.baseQueue,h=l.pending;if(h!==null){if(d!==null){var x=d.next;d.next=h.next,h.next=x}s.baseQueue=d=h,l.pending=null}if(h=t.baseState,d===null)t.memoizedState=h;else{s=d.next;var w=x=null,R=null,P=s,K=!1;do{var ne=P.lane&-536870913;if(ne!==P.lane?(We&ne)===ne:(Dr&ne)===ne){var U=P.revertLane;if(U===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),ne===ta&&(K=!0);else if((Dr&U)===U){P=P.next,U===ta&&(K=!0);continue}else ne={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},R===null?(w=R=ne,x=h):R=R.next=ne,Fe.lanes|=U,fi|=U;ne=P.action,aa&&i(h,ne),h=P.hasEagerState?P.eagerState:i(h,ne)}else U={lane:ne,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},R===null?(w=R=U,x=h):R=R.next=U,Fe.lanes|=ne,fi|=ne;P=P.next}while(P!==null&&P!==s);if(R===null?x=h:R.next=w,!ts(h,t.memoizedState)&&(Kt=!0,K&&(i=rl,i!==null)))throw i;t.memoizedState=h,t.baseState=x,t.baseQueue=R,l.lastRenderedState=h}return d===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function wh(t){var s=Bt(),i=s.queue;if(i===null)throw Error(a(311));i.lastRenderedReducer=t;var l=i.dispatch,d=i.pending,h=s.memoizedState;if(d!==null){i.pending=null;var x=d=d.next;do h=t(h,x.action),x=x.next;while(x!==d);ts(h,s.memoizedState)||(Kt=!0),s.memoizedState=h,s.baseQueue===null&&(s.baseState=h),i.lastRenderedState=h}return[h,l]}function Ib(t,s,i){var l=Fe,d=Bt(),h=Qe;if(h){if(i===void 0)throw Error(a(407));i=i()}else i=s();var x=!ts((wt||d).memoizedState,i);if(x&&(d.memoizedState=i,Kt=!0),d=d.queue,Nh(Hb.bind(null,l,d,t),[t]),t=d.getSnapshot!==s||x||Qt!==null&&(Qt.memoizedState.tag&1)!==0,cl(t?9:8,{destroy:void 0},Pb.bind(null,l,d,i,s),null),t){if(l.flags|=2048,St===null)throw Error(a(349));h||(Dr&127)!==0||Lb(l,s,i)}return i}function Lb(t,s,i){t.flags|=16384,t={getSnapshot:s,value:i},s=Fe.updateQueue,s===null?(s=ju(),Fe.updateQueue=s,s.stores=[t]):(i=s.stores,i===null?s.stores=[t]:i.push(t))}function Pb(t,s,i,l){s.value=i,s.getSnapshot=l,qb(s)&&Bb(t)}function Hb(t,s,i){return i(function(){qb(s)&&Bb(t)})}function qb(t){var s=t.getSnapshot;t=t.value;try{var i=s();return!ts(t,i)}catch{return!0}}function Bb(t){var s=Ki(t,2);s!==null&&Qn(s,t,2)}function _h(t){var s=Dn();if(typeof t=="function"){var i=t;if(t=i(),aa){Ms(!0);try{i()}finally{Ms(!1)}}}return s.memoizedState=s.baseState=t,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mr,lastRenderedState:t},s}function $b(t,s,i,l){return t.baseState=i,vh(t,wt,typeof l=="function"?l:Mr)}function O5(t,s,i,l,d){if(Ru(t))throw Error(a(485));if(t=s.action,t!==null){var h={payload:d,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){h.listeners.push(x)}};_e.T!==null?i(!0):h.isTransition=!1,l(h),i=s.pending,i===null?(h.next=s.pending=h,Fb(s,h)):(h.next=i.next,s.pending=i.next=h)}}function Fb(t,s){var i=s.action,l=s.payload,d=t.state;if(s.isTransition){var h=_e.T,x={};x.types=h!==null?h.types:null,_e.T=x;try{var w=i(d,l),R=_e.S;R!==null&&R(x,w),Vb(t,s,w)}catch(P){Sh(t,s,P)}finally{h!==null&&x.types!==null&&(h.types=x.types),_e.T=h}}else try{h=i(d,l),Vb(t,s,h)}catch(P){Sh(t,s,P)}}function Vb(t,s,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){Zb(t,s,l)},function(l){return Sh(t,s,l)}):Zb(t,s,i)}function Zb(t,s,i){s.status="fulfilled",s.value=i,Gb(s),t.state=i,s=t.pending,s!==null&&(i=s.next,i===s?t.pending=null:(i=i.next,s.next=i,Fb(t,i)))}function Sh(t,s,i){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do s.status="rejected",s.reason=i,Gb(s),s=s.next;while(s!==l)}t.action=null}function Gb(t){t=t.listeners;for(var s=0;s<t.length;s++)(0,t[s])()}function Qb(t,s){return s}function Kb(t,s){if(Qe){var i=St.formState;if(i!==null){e:{var l=Fe;if(Qe){if(Nt){t:{for(var d=Nt,h=Ss;d.nodeType!==8;){if(!h){d=null;break t}if(d=js(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){Nt=js(d.nextSibling),l=d.data==="F!";break e}}ei(l)}l=!1}l&&(s=i[0])}}return i=Dn(),i.memoizedState=i.baseState=s,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qb,lastRenderedState:s},i.queue=l,i=mx.bind(null,Fe,l),l.dispatch=i,l=_h(!1),h=Oh.bind(null,Fe,!1,l.queue),l=Dn(),d={state:s,dispatch:null,action:t,pending:null},l.queue=d,i=O5.bind(null,Fe,d,h,i),d.dispatch=i,l.memoizedState=t,[s,i,!1]}function Yb(t){var s=Bt();return Jb(s,wt,t)}function Jb(t,s,i){if(s=vh(t,s,Qb)[0],t=Au(Mr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var l=Uo(s)}catch(x){throw x===il?bu:x}else l=s;s=Bt();var d=s.queue,h=d.dispatch;return i!==s.memoizedState&&(Fe.flags|=2048,cl(9,{destroy:void 0},R5.bind(null,d,i),null)),[l,h,t]}function R5(t,s){t.action=s}function Xb(t){var s=Bt(),i=wt;if(i!==null)return Jb(s,i,t);Bt(),s=s.memoizedState,i=Bt();var l=i.queue.dispatch;return i.memoizedState=t,[s,l,!1]}function cl(t,s,i,l){return t={tag:t,create:i,deps:l,inst:s,next:null},s=Fe.updateQueue,s===null&&(s=ju(),Fe.updateQueue=s),i=s.lastEffect,i===null?s.lastEffect=t.next=t:(l=i.next,i.next=t,t.next=l,s.lastEffect=t),t}function Wb(){return Bt().memoizedState}function Cu(t,s,i,l){var d=Dn();Fe.flags|=t,d.memoizedState=cl(1|s,{destroy:void 0},i,l===void 0?null:l)}function Ou(t,s,i,l){var d=Bt();l=l===void 0?null:l;var h=d.memoizedState.inst;wt!==null&&l!==null&&mh(l,wt.memoizedState.deps)?d.memoizedState=cl(s,h,i,l):(Fe.flags|=t,d.memoizedState=cl(1|s,h,i,l))}function ex(t,s){Cu(8390656,8,t,s)}function Nh(t,s){Ou(2048,8,t,s)}function T5(t){Fe.flags|=4;var s=Fe.updateQueue;if(s===null)s=ju(),Fe.updateQueue=s,s.events=[t];else{var i=s.events;i===null?s.events=[t]:i.push(t)}}function tx(t){var s=Bt().memoizedState;return T5({ref:s,nextImpl:t}),function(){if((lt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}function nx(t,s){return Ou(4,2,t,s)}function sx(t,s){return Ou(4,4,t,s)}function rx(t,s){if(typeof s=="function"){t=t();var i=s(t);return function(){typeof i=="function"?i():s(null)}}if(s!=null)return t=t(),s.current=t,function(){s.current=null}}function ix(t,s,i){i=i!=null?i.concat([t]):null,Ou(4,4,rx.bind(null,s,t),i)}function jh(){}function ax(t,s){var i=Bt();s=s===void 0?null:s;var l=i.memoizedState;return s!==null&&mh(s,l[1])?l[0]:(i.memoizedState=[t,s],t)}function lx(t,s){var i=Bt();s=s===void 0?null:s;var l=i.memoizedState;if(s!==null&&mh(s,l[1]))return l[0];if(l=t(),aa){Ms(!0);try{t()}finally{Ms(!1)}}return i.memoizedState=[l,s],l}function Eh(t,s,i){return i===void 0||(Dr&1073741824)!==0&&(We&261930)===0?t.memoizedState=s:(t.memoizedState=i,t=by(),Fe.lanes|=t,fi|=t,i)}function ox(t,s,i,l){return ts(i,s)?i:ai.current!==null?(t=Eh(t,i,l),ts(t,s)||(Kt=!0),t):(Dr&106)===0||(Dr&1073741824)!==0&&(We&261930)===0?(Kt=!0,t.memoizedState=i):(t=by(),Fe.lanes|=t,fi|=t,s)}function cx(t,s,i,l,d){var h=je.p;je.p=h!==0&&8>h?h:8;var x=_e.T,w={};w.types=x!==null?x.types:null,_e.T=w,Oh(t,!1,s,i);try{var R=d(),P=_e.S;if(P!==null&&P(w,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var K=E5(R,l);Io(t,s,K,as(t))}else Io(t,s,l,as(t))}catch(ne){Io(t,s,{then:function(){},status:"rejected",reason:ne},as())}finally{je.p=h,x!==null&&w.types!==null&&(x.types=w.types),_e.T=x}}function k5(){}function Ah(t,s,i,l){if(t.tag!==5)throw Error(a(476));var d=ux(t).queue;cx(t,d,s,at,i===null?k5:function(){return dx(t),i(l)})}function ux(t){var s=t.memoizedState;if(s!==null)return s;s={memoizedState:at,baseState:at,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mr,lastRenderedState:at},next:null};var i={};return s.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mr,lastRenderedState:i},next:null},t.memoizedState=s,t=t.alternate,t!==null&&(t.memoizedState=s),s}function dx(t){var s=ux(t);s.next===null&&(s=t.alternate.memoizedState),Io(t,s.next.queue,{},as())}function Ch(){return pn(Cl)}function fx(){return Bt().memoizedState}function hx(){return Bt().memoizedState}function D5(t){for(var s=t.return;s!==null;){switch(s.tag){case 24:case 3:var i=as();t=ri(i);var l=ii(s,t,i);l!==null&&(Qn(l,s,i),To(l,s,i)),s={cache:nh()},t.payload=s;return}s=s.return}}function M5(t,s,i){var l=as();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ru(t)?px(s,i):(i=Gf(t,s,i,l),i!==null&&(Qn(i,t,l),gx(i,s,l)))}function mx(t,s,i){var l=as();Io(t,s,i,l)}function Io(t,s,i,l){var d={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Ru(t))px(s,d);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=s.lastRenderedReducer,h!==null))try{var x=s.lastRenderedState,w=h(x,i);if(d.hasEagerState=!0,d.eagerState=w,ts(w,x))return lu(t,s,d,0),St===null&&au(),!1}catch{}finally{}if(i=Gf(t,s,d,l),i!==null)return Qn(i,t,l),gx(i,s,l),!0}return!1}function Oh(t,s,i,l){if(l={lane:2,revertLane:ym(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ru(t)){if(s)throw Error(a(479))}else s=Gf(t,i,l,2),s!==null&&Qn(s,t,2)}function Ru(t){var s=t.alternate;return t===Fe||s!==null&&s===Fe}function px(t,s){ll=Su=!0;var i=t.pending;i===null?s.next=s:(s.next=i.next,i.next=s),t.pending=s}function gx(t,s,i){if((i&4194048)!==0){var l=s.lanes;l&=t.pendingLanes,i|=l,s.lanes=i,bg(t,i)}}var Tu={readContext:pn,use:Eu,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt,useEffectEvent:zt},bx={readContext:pn,use:Eu,useCallback:function(t,s){return Dn().memoizedState=[t,s===void 0?null:s],t},useContext:pn,useEffect:ex,useImperativeHandle:function(t,s,i){i=i!=null?i.concat([t]):null,Cu(4194308,4,rx.bind(null,s,t),i)},useLayoutEffect:function(t,s){return Cu(4194308,4,t,s)},useInsertionEffect:function(t,s){Cu(4,2,t,s)},useMemo:function(t,s){var i=Dn();s=s===void 0?null:s;var l=t();if(aa){Ms(!0);try{t()}finally{Ms(!1)}}return i.memoizedState=[l,s],l},useReducer:function(t,s,i){var l=Dn();if(i!==void 0){var d=i(s);if(aa){Ms(!0);try{i(s)}finally{Ms(!1)}}}else d=s;return l.memoizedState=l.baseState=d,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:d},l.queue=t,t=t.dispatch=M5.bind(null,Fe,t),[l.memoizedState,t]},useRef:function(t){var s=Dn();return t={current:t},s.memoizedState=t},useState:function(t){t=_h(t);var s=t.queue,i=mx.bind(null,Fe,s);return s.dispatch=i,[t.memoizedState,i]},useDebugValue:jh,useDeferredValue:function(t,s){var i=Dn();return Eh(i,t,s)},useTransition:function(){var t=_h(!1);return t=cx.bind(null,Fe,t.queue,!0,!1),Dn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,s,i){var l=Fe,d=Dn();if(Qe){if(i===void 0)throw Error(a(407));i=i()}else{if(i=s(),St===null)throw Error(a(349));(We&127)!==0||Lb(l,s,i)}d.memoizedState=i;var h={value:i,getSnapshot:s};return d.queue=h,ex(Hb.bind(null,l,h,t),[t]),l.flags|=2048,cl(9,{destroy:void 0},Pb.bind(null,l,h,i,s),null),i},useId:function(){var t=Dn(),s=St.identifierPrefix;if(Qe){var i=sr,l=nr;i=(l&~(1<<32-Wn(l)-1)).toString(32)+i,s="_"+s+"R_"+i,i=Nu++,0<i&&(s+="H"+i.toString(32)),s+="_"}else i=A5++,s="_"+s+"r_"+i.toString(32)+"_";return t.memoizedState=s},useHostTransitionStatus:Ch,useFormState:Kb,useActionState:Kb,useOptimistic:function(t){var s=Dn();s.memoizedState=s.baseState=t;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=i,s=Oh.bind(null,Fe,!0,i),i.dispatch=s,[t,s]},useMemoCache:yh,useCacheRefresh:function(){return Dn().memoizedState=D5.bind(null,Fe)},useEffectEvent:function(t){var s=Dn(),i={impl:t};return s.memoizedState=i,function(){if((lt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}},xx={readContext:pn,use:Eu,useCallback:ax,useContext:pn,useEffect:Nh,useImperativeHandle:ix,useInsertionEffect:nx,useLayoutEffect:sx,useMemo:lx,useReducer:Au,useRef:Wb,useState:function(){return Au(Mr)},useDebugValue:jh,useDeferredValue:function(t,s){var i=Bt();return ox(i,wt.memoizedState,t,s)},useTransition:function(){var t=Au(Mr)[0],s=Bt().memoizedState;return[typeof t=="boolean"?t:Uo(t),s]},useSyncExternalStore:Ib,useId:fx,useHostTransitionStatus:Ch,useFormState:Yb,useActionState:Yb,useOptimistic:function(t,s){var i=Bt();return $b(i,wt,t,s)},useMemoCache:yh,useCacheRefresh:hx,useEffectEvent:tx},z5={readContext:pn,use:Eu,useCallback:ax,useContext:pn,useEffect:Nh,useImperativeHandle:ix,useInsertionEffect:nx,useLayoutEffect:sx,useMemo:lx,useReducer:wh,useRef:Wb,useState:function(){return wh(Mr)},useDebugValue:jh,useDeferredValue:function(t,s){var i=Bt();return wt===null?Eh(i,t,s):ox(i,wt.memoizedState,t,s)},useTransition:function(){var t=wh(Mr)[0],s=Bt().memoizedState;return[typeof t=="boolean"?t:Uo(t),s]},useSyncExternalStore:Ib,useId:fx,useHostTransitionStatus:Ch,useFormState:Xb,useActionState:Xb,useOptimistic:function(t,s){var i=Bt();return wt!==null?$b(i,wt,t,s):(i.baseState=t,[t,i.queue.dispatch])},useMemoCache:yh,useCacheRefresh:hx,useEffectEvent:tx};function Rh(t,s,i,l){s=t.memoizedState,i=i(l,s),i=i==null?s:Q({},s,i),t.memoizedState=i,t.lanes===0&&(t.updateQueue.baseState=i)}var Th={enqueueSetState:function(t,s,i){t=t._reactInternals;var l=as(),d=ri(l);d.payload=s,i!=null&&(d.callback=i),s=ii(t,d,l),s!==null&&(Qn(s,t,l),To(s,t,l))},enqueueReplaceState:function(t,s,i){t=t._reactInternals;var l=as(),d=ri(l);d.tag=1,d.payload=s,i!=null&&(d.callback=i),s=ii(t,d,l),s!==null&&(Qn(s,t,l),To(s,t,l))},enqueueForceUpdate:function(t,s){t=t._reactInternals;var i=as(),l=ri(i);l.tag=2,s!=null&&(l.callback=s),s=ii(t,l,i),s!==null&&(Qn(s,t,i),To(s,t,i))}};function yx(t,s,i,l,d,h,x){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,h,x):s.prototype&&s.prototype.isPureReactComponent?!So(i,l)||!So(d,h):!0}function vx(t,s,i,l){t=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(i,l),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(i,l),s.state!==t&&Th.enqueueReplaceState(s,s.state,null)}function la(t,s){var i=s;if("ref"in s){i={};for(var l in s)l!=="ref"&&(i[l]=s[l])}if(t=t.defaultProps){i===s&&(i=Q({},i));for(var d in t)i[d]===void 0&&(i[d]=t[d])}return i}function wx(t){iu(t)}function _x(t){console.error(t)}function Sx(t){iu(t)}function ku(t,s){try{var i=t.onUncaughtError;i(s.value,{componentStack:s.stack})}catch(l){setTimeout(function(){throw l})}}function Nx(t,s,i){try{var l=t.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function kh(t,s,i){return i=ri(i),i.tag=3,i.payload={element:null},i.callback=function(){ku(t,s)},i}function jx(t){return t=ri(t),t.tag=3,t}function Ex(t,s,i,l){var d=i.type.getDerivedStateFromError;if(typeof d=="function"){var h=l.value;t.payload=function(){return d(h)},t.callback=function(){Nx(s,i,l)}}var x=i.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(t.callback=function(){Nx(s,i,l),typeof d!="function"&&(hi===null?hi=new Set([this]):hi.add(this));var w=l.stack;this.componentDidCatch(l.value,{componentStack:w!==null?w:""})})}function U5(t,s,i,l,d){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(s=i.alternate,s!==null&&Wi(s,i,d,!0),i=gn.current,i!==null){switch(i.tag){case 31:case 13:case 19:return Nn===null?Wu():i.alternate===null&&Ut===0&&(Ut=3),i.flags&=-257,i.flags|=65536,i.lanes=d,l===xu?i.flags|=16384:(s=i.updateQueue,s===null?i.updateQueue=new Set([l]):s.add(l),gm(t,l,d)),!1;case 22:return i.flags|=65536,l===xu?i.flags|=16384:(s=i.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=s):(i=s.retryQueue,i===null?s.retryQueue=new Set([l]):i.add(l)),gm(t,l,d)),!1}throw Error(a(435,i.tag))}return gm(t,l,d),Wu(),!1}if(Qe)return s=gn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=d,l!==Xf&&(t=Error(a(422),{cause:l}),Eo(vs(t,i)))):(l!==Xf&&(s=Error(a(423),{cause:l}),Eo(vs(s,i))),t=t.current.alternate,t.flags|=65536,d&=-d,t.lanes|=d,l=vs(l,i),d=kh(t.stateNode,l,d),oh(t,d),Ut!==4&&(Ut=2)),!1;var h=Error(a(520),{cause:l});if(h=vs(h,i),Vo===null?Vo=[h]:Vo.push(h),Ut!==4&&(Ut=2),s===null)return!0;l=vs(l,i),i=s;do{switch(i.tag){case 3:return i.flags|=65536,t=d&-d,i.lanes|=t,t=kh(i.stateNode,l,t),oh(i,t),!1;case 1:if(s=i.type,h=i.stateNode,(i.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(hi===null||!hi.has(h))))return i.flags|=65536,d&=-d,i.lanes|=d,d=jx(d),Ex(d,t,i,l),oh(i,d),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var Dh=Error(a(461)),Kt=!1;function tn(t,s,i,l){s.child=t===null?Rb(s,null,i,l):ia(s,t.child,i,l)}function Ax(t,s,i,l,d){i=i.render;var h=s.ref;if("ref"in l){var x={};for(var w in l)w!=="ref"&&(x[w]=l[w])}else x=l;return ea(s),l=ph(t,s,i,x,h,d),w=gh(),t!==null&&!Kt?(bh(t,s,d),zr(t,s,d)):(Qe&&w&&du(s),s.flags|=1,tn(t,s,l,d),s.child)}function Cx(t,s,i,l,d){if(t===null){var h=i.type;return typeof h=="function"&&!Qf(h)&&h.defaultProps===void 0&&i.compare===null?(s.tag=15,s.type=h,Ox(t,s,h,l,d)):(t=cu(i.type,null,l,s,s.mode,d),t.ref=s.ref,t.return=s,s.child=t)}if(h=t.child,!qh(t,d)){var x=h.memoizedProps;if(i=i.compare,i=i!==null?i:So,i(x,l)&&t.ref===s.ref)return zr(t,s,d)}return s.flags|=1,t=Or(h,l),t.ref=s.ref,t.return=s,s.child=t}function Ox(t,s,i,l,d){if(t!==null){var h=t.memoizedProps;if(So(h,l)&&t.ref===s.ref)if(Kt=!1,s.pendingProps=l=h,qh(t,d))(t.flags&131072)!==0&&(Kt=!0);else return s.lanes=t.lanes,zr(t,s,d)}return Mh(t,s,i,l,d)}function Rx(t,s,i,l){var d=l.children,h=t!==null?t.memoizedState:null;if(t===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((s.flags&128)!==0){if(h=h!==null?h.baseLanes|i:i,t!==null){for(l=s.child=t.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~h}else l=0,s.child=null;return Tx(t,s,h,i,l)}if((i&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},t!==null&&gu(s,h!==null?h.cachePool:null),h!==null?Db(s,h):uh(),Mb(s);else return l=s.lanes=536870912,Tx(t,s,h!==null?h.baseLanes|i:i,i,l)}else h!==null?(gu(s,h.cachePool),Db(s,h),oi(),s.memoizedState=null):(t!==null&&gu(s,null),uh(),oi());return tn(t,s,d,i),s.child}function Lo(t,s){return t!==null&&t.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Tx(t,s,i,l,d){var h=rh();return h=h===null?null:{parent:Gt._currentValue,pool:h},s.memoizedState={baseLanes:i,cachePool:h},t!==null&&gu(s,null),uh(),Mb(s),t!==null&&Wi(t,s,l,!0),s.childLanes=d,null}function Du(t,s){return s=Mu({mode:s.mode,children:s.children},t.mode),s.ref=t.ref,t.child=s,s.return=t,s}function kx(t,s,i){return ia(s,t.child,null,i),t=Du(s,s.pendingProps),t.flags|=2,ns(s),s.memoizedState=null,t}function I5(t,s,i){var l=s.pendingProps,d=(s.flags&128)!==0;if(s.flags&=-129,t===null){if(Qe){if(l.mode==="hidden")return t=Du(s,l),s.lanes=536870912,t.memoizedState={baseLanes:0,cachePool:null},Lo(null,t);if(fh(s),(t=Nt)?(t=rv(t,Ss),t=t!==null&&t.data==="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:Xr!==null?{id:nr,overflow:sr}:null,retryLane:536870912,hydrationErrors:null},i=pb(t),i.return=s,s.child=i,an=s,Nt=null)):t=null,t===null)throw ei(s);return s.lanes=536870912,null}return Du(s,l)}var h=t.memoizedState;if(h!==null){var x=h.dehydrated;if(fh(s),d)if(s.flags&256)s.flags&=-257,s=kx(t,s,i);else if(s.memoizedState!==null)s.child=t.child,s.flags|=128,s=null;else throw Error(a(558));else if(Kt||Wi(t,s,i,!1),d=(i&t.childLanes)!==0,Kt||d){if(ai.current===null){if(l=St,l!==null&&(x=xg(l,i),x!==0&&x!==h.retryLane))throw h.retryLane=x,Ki(t,x),Qn(l,t,x),Dh;Wu()}s=kx(t,s,i)}else t=h.treeContext,Nt=js(x.nextSibling),an=s,Qe=!0,Wr=null,Ss=!1,t!==null&&xb(s,t),s=Du(s,l),s.flags|=134221824;return s}return t=Or(t.child,{mode:l.mode,children:l.children}),t.ref=s.ref,s.child=t,t.return=s,t}function ul(t,s){var i=s.ref;if(i===null)t!==null&&t.ref!==null&&(s.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(a(284));(t===null||t.ref!==i)&&(s.flags|=4194816)}}function Mh(t,s,i,l,d){return ea(s),i=ph(t,s,i,l,void 0,d),l=gh(),t!==null&&!Kt?(bh(t,s,d),zr(t,s,d)):(Qe&&l&&du(s),s.flags|=1,tn(t,s,i,d),s.child)}function Dx(t,s,i,l,d,h){return ea(s),s.updateQueue=null,i=Ub(s,l,i,d),zb(t),l=gh(),t!==null&&!Kt?(bh(t,s,h),zr(t,s,h)):(Qe&&l&&du(s),s.flags|=1,tn(t,s,i,h),s.child)}function Mx(t,s,i,l,d){if(ea(s),s.stateNode===null){var h=el,x=i.contextType;typeof x=="object"&&x!==null&&(h=pn(x)),h=new i(l,h),s.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Th,s.stateNode=h,h._reactInternals=s,h=s.stateNode,h.props=l,h.state=s.memoizedState,h.refs={},ah(s),x=i.contextType,h.context=typeof x=="object"&&x!==null?pn(x):el,h.state=s.memoizedState,x=i.getDerivedStateFromProps,typeof x=="function"&&(Rh(s,i,x,l),h.state=s.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(x=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),x!==h.state&&Th.enqueueReplaceState(h,h.state,null),Do(s,l,h,d),ko(),h.state=s.memoizedState),typeof h.componentDidMount=="function"&&(s.flags|=4194308),l=!0}else if(t===null){h=s.stateNode;var w=s.memoizedProps,R=la(i,w);h.props=R;var P=h.context,K=i.contextType;x=el,typeof K=="object"&&K!==null&&(x=pn(K));var ne=i.getDerivedStateFromProps;K=typeof ne=="function"||typeof h.getSnapshotBeforeUpdate=="function",w=s.pendingProps!==w,K||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(w||P!==x)&&vx(s,h,l,x),si=!1;var U=s.memoizedState;h.state=U,Do(s,l,h,d),ko(),P=s.memoizedState,w||U!==P||si?(typeof ne=="function"&&(Rh(s,i,ne,l),P=s.memoizedState),(R=si||yx(s,i,R,l,U,P,x))?(K||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(s.flags|=4194308)):(typeof h.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=l,s.memoizedState=P),h.props=l,h.state=P,h.context=x,l=R):(typeof h.componentDidMount=="function"&&(s.flags|=4194308),l=!1)}else{h=s.stateNode,lh(t,s),x=s.memoizedProps,K=la(i,x),h.props=K,ne=s.pendingProps,U=h.context,P=i.contextType,R=el,typeof P=="object"&&P!==null&&(R=pn(P)),w=i.getDerivedStateFromProps,(P=typeof w=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==ne||U!==R)&&vx(s,h,l,R),si=!1,U=s.memoizedState,h.state=U,Do(s,l,h,d),ko();var G=s.memoizedState;x!==ne||U!==G||si||t!==null&&t.dependencies!==null&&mu(t.dependencies)?(typeof w=="function"&&(Rh(s,i,w,l),G=s.memoizedState),(K=si||yx(s,i,K,l,U,G,R)||t!==null&&t.dependencies!==null&&mu(t.dependencies))?(P||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(l,G,R),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(l,G,R)),typeof h.componentDidUpdate=="function"&&(s.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===t.memoizedProps&&U===t.memoizedState||(s.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===t.memoizedProps&&U===t.memoizedState||(s.flags|=1024),s.memoizedProps=l,s.memoizedState=G),h.props=l,h.state=G,h.context=R,l=K):(typeof h.componentDidUpdate!="function"||x===t.memoizedProps&&U===t.memoizedState||(s.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===t.memoizedProps&&U===t.memoizedState||(s.flags|=1024),l=!1)}return h=l,ul(t,s),l=(s.flags&128)!==0,h||l?(h=s.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:h.render(),s.flags|=1,t!==null&&l?(s.child=ia(s,t.child,null,d),s.child=ia(s,null,i,d)):tn(t,s,i,d),s.memoizedState=h.state,t=s.child):t=zr(t,s,d),t}function zx(t,s,i,l){return Ji(),s.flags|=256,tn(t,s,i,l),s.child}var zh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uh(t){return{baseLanes:t,cachePool:Nb()}}function Ih(t,s,i){return t=t!==null?t.childLanes&~i:0,s&&(t|=is),t}function Ux(t,s,i){var l=s.pendingProps,d=!1,h=(s.flags&128)!==0,x;if((x=h)||(x=t!==null&&t.memoizedState===null?!1:(bn.current&2)!==0),x&&(d=!0,s.flags&=-129),x=(s.flags&32)!==0,s.flags&=-33,t===null){if(Qe){if(d?li(s):oi(),(t=Nt)?(t=rv(t,Ss),t=t!==null&&t.data!=="&"?t:null,t!==null&&(s.memoizedState={dehydrated:t,treeContext:Xr!==null?{id:nr,overflow:sr}:null,retryLane:536870912,hydrationErrors:null},i=pb(t),i.return=s,s.child=i,an=s,Nt=null)):t=null,t===null)throw ei(s);return Um(t)?s.lanes=32:s.lanes=536870912,null}return h=l.children,l=l.fallback,d?(oi(),d=s.mode,h=Mu({mode:"hidden",children:h},d),l=Yi(l,d,i,null),h.return=s,l.return=s,h.sibling=l,s.child=h,l=s.child,l.memoizedState=Uh(i),l.childLanes=Ih(t,x,i),s.memoizedState=zh,Lo(null,l)):(li(s),Lh(s,h))}var w=t.memoizedState;if(w!==null){var R=w.dehydrated;if(R!==null)return L5(t,s,h,x,l,R,w,i)}return d?(oi(),d=l.fallback,h=s.mode,w=t.child,R=w.sibling,l=Or(w,{mode:"hidden",children:l.children}),l.subtreeFlags=w.subtreeFlags&1206910976,R!==null?d=Or(R,d):(d=Yi(d,h,i,null),d.flags|=2),d.return=s,l.return=s,l.sibling=d,s.child=l,Lo(null,l),l=s.child,d=t.child.memoizedState,d===null?d=Uh(i):(h=d.cachePool,h!==null?(w=Gt._currentValue,h=h.parent!==w?{parent:w,pool:w}:h):h=Nb(),d={baseLanes:d.baseLanes|i,cachePool:h}),l.memoizedState=d,l.childLanes=Ih(t,x,i),s.memoizedState=zh,Lo(t.child,l)):(li(s),i=t.child,t=i.sibling,i=Or(i,{mode:"visible",children:l.children}),i.return=s,i.sibling=null,t!==null&&(x=s.deletions,x===null?(s.deletions=[t],s.flags|=16):x.push(t)),s.child=i,s.memoizedState=null,i)}function Lh(t,s){return s=Mu({mode:"visible",children:s},t.mode),s.return=t,t.child=s}function Mu(t,s){return t=Fn(22,t,null,s),t.lanes=0,t}function zu(t,s,i){return ia(s,t.child,null,i),t=Lh(s,s.pendingProps.children),t.flags|=2,s.memoizedState=null,t}function L5(t,s,i,l,d,h,x,w){if(i)return s.flags&256?(li(s),s.flags&=-257,zu(t,s,w)):s.memoizedState!==null?(oi(),s.child=t.child,s.flags|=128,null):(oi(),h=d.fallback,x=s.mode,d=Mu({mode:"visible",children:d.children},x),h=Yi(h,x,w,null),h.flags|=2,d.return=s,h.return=s,d.sibling=h,s.child=d,ia(s,t.child,null,w),d=s.child,d.memoizedState=Uh(w),d.childLanes=Ih(t,l,w),s.memoizedState=zh,Lo(null,d));if(li(s),Um(h)){if(l=h.nextSibling&&h.nextSibling.dataset,l)var R=l.dgst;return l=R,l!==""&&(d=Error(a(419)),d.stack="",d.digest=l,Eo({value:d,source:null,stack:null})),zu(t,s,w)}if(Kt||Wi(t,s,w,!1),l=(w&t.childLanes)!==0,Kt||l){if(ai.current!==null)return zu(t,s,w);if(l=St,l!==null&&(d=xg(l,w),d!==0&&d!==x.retryLane))throw x.retryLane=d,Ki(t,d),Qn(l,t,d),Dh;return zm(h)||Wu(),zu(t,s,w)}return zm(h)?(s.flags|=192,s.child=t.child,null):(t=x.treeContext,Nt=js(h.nextSibling),an=s,Qe=!0,Wr=null,Ss=!1,t!==null&&xb(s,t),s=Lh(s,d.children),s.flags|=134221824,s)}function Ix(t,s,i){t.lanes|=s;var l=t.alternate;l!==null&&(l.lanes|=s),hu(t.return,s,i)}function Lx(t){for(var s=null;t!==null;){var i=t.alternate;i!==null&&_u(i)===null&&(s=t),t=t.sibling}return s}function Uu(t,s,i,l,d,h){var x=t.memoizedState;x===null?t.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d,treeForkCount:h}:(x.isBackwards=s,x.rendering=null,x.renderingStartTime=0,x.last=l,x.tail=i,x.tailMode=d,x.treeForkCount=h)}function Ph(t){var s=t.child;for(t.child=null;s!==null;){var i=s.sibling;s.sibling=t.child,t.child=s,s=i}}function Hh(t,s,i){var l=s.pendingProps,d=l.revealOrder,h=l.tail;l=l.children;var x=bn.current;if(s.flags&128)return Mo(s,x),null;var w=(x&2)!==0;if(w?(x=x&1|2,s.flags|=128):x&=1,Mo(s,x),d==="backwards"&&t!==null?(Ph(t),tn(t,s,l,i),Ph(t)):tn(t,s,l,i),l=Qe?jo:0,!w&&t!==null&&(t.flags&128)!==0)e:for(t=s.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Ix(t,i,s);else if(t.tag===19)Ix(t,i,s);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===s)break e;for(;t.sibling===null;){if(t.return===null||t.return===s)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(d){case"backwards":i=Lx(s.child),i===null?(d=s.child,s.child=null):(d=i.sibling,i.sibling=null,Ph(s)),Uu(s,!0,d,null,h,l);break;case"unstable_legacy-backwards":for(i=null,d=s.child,s.child=null;d!==null;){if(t=d.alternate,t!==null&&_u(t)===null){s.child=d;break}t=d.sibling,d.sibling=i,i=d,d=t}Uu(s,!0,i,null,h,l);break;case"together":Uu(s,!1,null,null,void 0,l);break;case"independent":s.memoizedState=null;break;default:i=Lx(s.child),i===null?(d=s.child,s.child=null):(d=i.sibling,i.sibling=null),Uu(s,!1,d,i,h,l)}return s.child}function Px(t,s,i){var l=s.pendingProps;return ti(s,s.type,l.value),tn(t,s,l.children,i),s.child}function zr(t,s,i){if(t!==null&&(s.dependencies=t.dependencies),fi|=s.lanes,(i&s.childLanes)===0)if(t!==null){if(Wi(t,s,i,!1),(i&s.childLanes)===0)return null}else return null;if(t!==null&&s.child!==t.child)throw Error(a(153));if(s.child!==null){for(t=s.child,i=Or(t,t.pendingProps),s.child=i,i.return=s;t.sibling!==null;)t=t.sibling,i=i.sibling=Or(t,t.pendingProps),i.return=s;i.sibling=null}return s.child}function qh(t,s){return(t.lanes&s)!==0?!0:(t=t.dependencies,!!(t!==null&&mu(t)))}function P5(t,s,i){switch(s.tag){case 3:Sr(s,s.stateNode.containerInfo),ti(s,Gt,t.memoizedState.cache),Ji();break;case 27:case 5:Hi(s);break;case 4:Sr(s,s.stateNode.containerInfo);break;case 10:ti(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,fh(s),null;break;case 13:var l=s.memoizedState;if(l!==null){if(l.dehydrated!==null)return li(s),s.flags|=128,null;l=Wi(t,s,i,!1);var d=s.child.childLanes;return l||(i&d)!==0?Ux(t,s,i):(li(s),t=zr(t,s,i),t!==null?t.sibling:null)}li(s);break;case 19:if(s.flags&128)return Hh(t,s,i);if(d=(t.flags&128)!==0,l=(i&s.childLanes)!==0,l||(Wi(t,s,i,!1),l=(i&s.childLanes)!==0),d){if(l)return Hh(t,s,i);s.flags|=128}if(d=s.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Mo(s,bn.current),l)break;return null;case 22:return s.lanes=0,Rx(t,s,i,s.pendingProps);case 24:ti(s,Gt,t.memoizedState.cache)}return zr(t,s,i)}function Hx(t,s,i){if(t!==null)if(t.memoizedProps!==s.pendingProps)Kt=!0;else{if(!qh(t,i)&&(s.flags&128)===0)return Kt=!1,P5(t,s,i);Kt=(t.flags&131072)!==0}else Kt=!1,Qe&&(s.flags&1048576)!==0&&bb(s,jo,s.index);switch(s.lanes=0,s.tag){case 16:e:{var l=s.pendingProps;if(t=sa(s.elementType),s.type=t,typeof t=="function")Qf(t)?(l=la(t,l),s.tag=1,s=Mx(null,s,t,l,i)):(s.tag=0,s=Mh(null,s,t,l,i));else{if(t!=null){var d=t.$$typeof;if(d===ee){s.tag=11,s=Ax(null,s,t,l,i);break e}else if(d===Me){s.tag=14,s=Cx(null,s,t,l,i);break e}else if(d===oe){s.tag=10,s.type=t,s=Px(null,s,i);break e}}throw s=Pe(t)||t,Error(a(306,s,""))}}return s;case 0:return Mh(t,s,s.type,s.pendingProps,i);case 1:return l=s.type,d=la(l,s.pendingProps),Mx(t,s,l,d,i);case 3:e:{if(Sr(s,s.stateNode.containerInfo),t===null)throw Error(a(387));l=s.pendingProps;var h=s.memoizedState;d=h.element,lh(t,s),Do(s,l,null,i);var x=s.memoizedState;if(l=x.cache,ti(s,Gt,l),l!==h.cache&&th(s,[Gt],i,!0),ko(),l=x.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:x.cache},s.updateQueue.baseState=h,s.memoizedState=h,s.flags&256){s=zx(t,s,l,i);break e}else if(l!==d){d=vs(Error(a(424)),s),Eo(d),s=zx(t,s,l,i);break e}else{switch(t=s.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Nt=js(t.firstChild),an=s,Qe=!0,Wr=null,Ss=!0,i=Rb(s,null,l,i),s.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling}else{if(Ji(),l===d){s=zr(t,s,i);break e}tn(t,s,l,i)}s=s.child}return s;case 26:return ul(t,s),t===null?(i=dv(s.type,null,s.pendingProps,null))?s.memoizedState=i:Qe||(s.stateNode=Fy(s.type,s.pendingProps,rt.current,s)):s.memoizedState=dv(s.type,t.memoizedProps,s.pendingProps,t.memoizedState),null;case 27:return Hi(s),t===null&&Qe&&(l=s.stateNode=lv(s.type,s.pendingProps,rt.current),an=s,Ss=!0,d=Nt,gi(s.type)?(Im=d,Nt=js(l.firstChild)):Nt=d),tn(t,s,s.pendingProps.children,i),ul(t,s),t===null&&(s.flags|=4194304),s.child;case 5:return t===null&&Qe&&((d=l=Nt)&&(l=D2(l,s.type,s.pendingProps,Ss),l!==null?(s.stateNode=l,an=s,Nt=js(l.firstChild),Ss=!1,d=!0):d=!1),d||ei(s)),Hi(s),d=s.type,h=s.pendingProps,x=t!==null?t.memoizedProps:null,l=h.children,Cm(d,h)?l=null:x!==null&&Cm(d,x)&&(s.flags|=32),s.memoizedState!==null&&(d=ph(t,s,C5,null,null,i),Cl._currentValue=d),ul(t,s),tn(t,s,l,i),s.child;case 6:return t===null&&Qe&&((t=i=Nt)&&(i=M2(i,s.pendingProps,Ss),i!==null?(s.stateNode=i,an=s,Nt=null,t=!0):t=!1),t||ei(s)),null;case 13:return Ux(t,s,i);case 4:return Sr(s,s.stateNode.containerInfo),l=s.pendingProps,t===null?s.child=ia(s,null,l,i):tn(t,s,l,i),s.child;case 11:return Ax(t,s,s.type,s.pendingProps,i);case 7:return l=s.pendingProps,ul(t,s),tn(t,s,l,i),s.child;case 8:return tn(t,s,s.pendingProps.children,i),s.child;case 12:return tn(t,s,s.pendingProps.children,i),s.child;case 10:return Px(t,s,i);case 9:return d=s.type._context,l=s.pendingProps.children,ea(s),d=pn(d),l=l(d),s.flags|=1,tn(t,s,l,i),s.child;case 14:return Cx(t,s,s.type,s.pendingProps,i);case 15:return Ox(t,s,s.type,s.pendingProps,i);case 19:return Hh(t,s,i);case 31:return I5(t,s,i);case 22:return Rx(t,s,i,s.pendingProps);case 24:return ea(s),l=pn(Gt),t===null?(d=rh(),d===null&&(d=St,h=nh(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=i),d=h),s.memoizedState={parent:l,cache:d},ah(s),ti(s,Gt,d)):((t.lanes&i)!==0&&(lh(t,s),Do(s,null,null,i),ko()),d=t.memoizedState,h=s.memoizedState,d.parent!==l?(d={parent:l,cache:l},s.memoizedState=d,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=d),ti(s,Gt,l)):(l=h.cache,ti(s,Gt,l),l!==d.cache&&th(s,[Gt],i,!0))),tn(t,s,s.pendingProps.children,i),s.child;case 30:return s.stateNode===null&&(s.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=s.pendingProps,l.name!=null&&l.name!=="auto"?s.flags|=t===null?18882560:18874368:Qe&&du(s),t!==null&&t.memoizedProps.name!==l.name?s.flags|=4194816:ul(t,s),tn(t,s,l.children,i),s.child;case 29:throw s.pendingProps}throw Error(a(156,s.tag))}function Ur(t){t.flags|=4}function Bh(t,s,i,l,d){var h;if((h=(t.mode&32)!==0)&&(h=i===null?pv(s,l):pv(s,l)&&(l.src!==i.src||l.srcSet!==i.srcSet)),h){if(t.flags|=16777216,(d&335544128)===d)if(t.stateNode.complete)t.flags|=8192;else if(wy())t.flags|=8192;else throw ra=xu,ih}else t.flags&=-16777217}function qx(t,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!gv(s))if(wy())t.flags|=8192;else throw ra=xu,ih}function Iu(t,s){s!==null&&(t.flags|=4),t.flags&16384&&(s=t.tag!==22?pg():536870912,t.lanes|=s,pl|=s)}function Po(t,s){if(!Qe)switch(t.tailMode){case"visible":break;case"collapsed":for(var i=t.tail,l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?s||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null;break;default:for(s=t.tail,i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t.tail=null:i.sibling=null}}function jt(t){var s=t.alternate!==null&&t.alternate.child===t.child,i=0,l=0;if(s)for(var d=t.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&1206910976,l|=d.flags&1206910976,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=l,t.childLanes=i,s}function H5(t,s,i){var l=s.pendingProps;switch(Jf(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(s),null;case 1:return jt(s),null;case 3:return i=s.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),kr(Gt),Sn(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(sl(s)?Ur(s):t===null||t.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Wf())),jt(s),null;case 26:var d=s.type,h=s.memoizedState;return t===null?(Ur(s),h!==null?(jt(s),qx(s,h)):(jt(s),Bh(s,d,null,l,i))):h?h!==t.memoizedState?(Ur(s),jt(s),qx(s,h)):(jt(s),s.flags&=-16777217):(t=t.memoizedProps,t!==l&&Ur(s),jt(s),Bh(s,d,t,l,i)),null;case 27:if(Kr(s),i=rt.current,d=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==l&&Ur(s);else{if(!l){if(s.stateNode===null)throw Error(a(166));return jt(s),s.subtreeFlags&=-33554433,null}t=$.current,sl(s)?yb(s):(t=lv(d,l,i),s.stateNode=t,Ur(s))}return jt(s),s.subtreeFlags&=-33554433,null;case 5:if(Kr(s),d=s.type,t!==null&&s.stateNode!=null)t.memoizedProps!==l&&Ur(s);else{if(!l){if(s.stateNode===null)throw Error(a(166));return jt(s),s.subtreeFlags&=-33554433,null}if(h=$.current,sl(s))yb(s);else{var x=Yo(rt.current);switch(h){case 1:h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=x.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof l.is=="string"?x.createElement("select",{is:l.is}):x.createElement("select"),l.multiple?h.multiple=!0:l.size&&(h.size=l.size);break;default:h=typeof l.is=="string"?x.createElement(d,{is:l.is}):x.createElement(d)}}h[mn]=s,h[$n]=l;e:for(x=s.child;x!==null;){if(x.tag===5||x.tag===6)h.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===s)break e;for(;x.sibling===null;){if(x.return===null||x.return===s)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}s.stateNode=h;e:switch(yn(h,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ur(s)}}return jt(s),s.subtreeFlags&=-33554433,Bh(s,s.type,t===null?null:t.memoizedProps,s.pendingProps,i),null;case 6:if(t&&s.stateNode!=null)t.memoizedProps!==l&&Ur(s);else{if(typeof l!="string"&&s.stateNode===null)throw Error(a(166));if(t=rt.current,sl(s)){if(t=s.stateNode,i=s.memoizedProps,l=null,d=an,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}t[mn]=s,t=!!(t.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||Hy(t.nodeValue,i)),t||ei(s,!0)}else t=Yo(t).createTextNode(l),t[mn]=s,s.stateNode=t}return jt(s),null;case 31:if(i=s.memoizedState,t===null||t.memoizedState!==null){if(l=sl(s),i!==null){if(t===null){if(!l)throw Error(a(318));if(t=s.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[mn]=s}else Ji(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;jt(s),t=!1}else i=Wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return s.flags&256?(ns(s),s):(ns(s),null);if((s.flags&128)!==0)throw Error(a(558))}return jt(s),null;case 13:if(l=s.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(d=sl(s),l!==null&&l.dehydrated!==null){if(t===null){if(!d)throw Error(a(318));if(d=s.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(a(317));d[mn]=s}else Ji(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;jt(s),d=!1}else d=Wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=d),d=!0;if(!d)return s.flags&256?(ns(s),s):(ns(s),null)}return ns(s),(s.flags&128)!==0?(s.lanes=i,s):(i=l!==null,t=t!==null&&t.memoizedState!==null,i&&(l=s.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==d&&(l.flags|=2048)),i!==t&&i&&(s.child.flags|=8192),Iu(s,s.updateQueue),jt(s),null);case 4:return Sn(),t===null&&Sm(s.stateNode.containerInfo),s.flags|=67108864,jt(s),null;case 10:return kr(s.type),jt(s),null;case 19:if(hh(s),l=s.memoizedState,l===null)return jt(s),null;if(d=(s.flags&128)!==0,h=l.rendering,h===null)if(d)Po(l,!1);else{if(Ut!==0||t!==null&&(t.flags&128)!==0)for(t=s.child;t!==null;){if(h=_u(t),h!==null){for(s.flags|=128,Po(l,!1),t=h.updateQueue,s.updateQueue=t,Iu(s,t),s.subtreeFlags=0,t=i,i=s.child;i!==null;)mb(i,t),i=i.sibling;return Mo(s,bn.current&1|2),Qe&&Rr(s,l.treeForkCount),s.child}t=t.sibling}l.tail!==null&&me()>Ku&&(s.flags|=128,d=!0,Po(l,!1),s.lanes=4194304)}else{if(!d)if(t=_u(h),t!==null){if(s.flags|=128,d=!0,t=t.updateQueue,s.updateQueue=t,Iu(s,t),Po(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!h.alternate&&!Qe)return jt(s),null}else 2*me()-l.renderingStartTime>Ku&&i!==536870912&&(s.flags|=128,d=!0,Po(l,!1),s.lanes=4194304);l.isBackwards?(h.sibling=s.child,s.child=h):(t=l.last,t!==null?t.sibling=h:s.child=h,l.last=h)}if(l.tail!==null){t=l.tail;e:{for(i=t;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return l.rendering=t,l.tail=t.sibling,l.renderingStartTime=me(),t.sibling=null,h=bn.current,h=d?h&1|2:h&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!i||Qe?Mo(s,h):(i=h,pe(gn,s),pe(bn,i),Nn===null&&(Nn=s)),Qe&&Rr(s,l.treeForkCount),t}return jt(s),null;case 22:case 23:return ns(s),dh(),l=s.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(s.flags|=8192):l&&(s.flags|=8192),l?(i&536870912)!==0&&(s.flags&128)===0&&(jt(s),s.subtreeFlags&6&&(s.flags|=8192)):jt(s),i=s.updateQueue,i!==null&&Iu(s,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),l=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(l=s.memoizedState.cachePool.pool),l!==i&&(s.flags|=2048),t!==null&&Re(na),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),s.memoizedState.cache!==i&&(s.flags|=2048),kr(Gt),jt(s),null;case 25:return null;case 30:return s.flags|=33554432,jt(s),null}throw Error(a(156,s.tag))}function q5(t,s){switch(Jf(s),s.tag){case 1:return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return kr(Gt),Sn(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 26:case 27:case 5:return Kr(s),null;case 31:if(s.memoizedState!==null){if(ns(s),s.alternate===null)throw Error(a(340));Ji()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 13:if(ns(s),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(a(340));Ji()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return hh(s),t=s.flags,t&65536?(s.flags=t&-65537|128,t=s.memoizedState,t!==null&&(t.rendering=null,t.tail=null),s.flags|=4,s):null;case 4:return Sn(),null;case 10:return kr(s.type),null;case 22:case 23:return ns(s),dh(),t!==null&&Re(na),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 24:return kr(Gt),null;case 25:return null;default:return null}}function Bx(t,s){switch(Jf(s),s.tag){case 3:kr(Gt),Sn();break;case 26:case 27:case 5:Kr(s);break;case 4:Sn();break;case 31:s.memoizedState!==null&&ns(s);break;case 13:ns(s);break;case 19:hh(s);break;case 10:kr(s.type);break;case 22:case 23:ns(s),dh(),t!==null&&Re(na);break;case 24:kr(Gt)}}function Ho(t,s){try{var i=s.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var d=l.next;i=d;do{if((i.tag&t)===t){l=void 0;var h=i.create,x=i.inst;l=h(),x.destroy=l}i=i.next}while(i!==d)}}catch(w){mt(s,s.return,w)}}function ci(t,s,i){try{var l=s.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var h=d.next;l=h;do{if((l.tag&t)===t){var x=l.inst,w=x.destroy;if(w!==void 0){x.destroy=void 0,d=s;var R=i,P=w;try{P()}catch(K){mt(d,R,K)}}}l=l.next}while(l!==h)}}catch(K){mt(s,s.return,K)}}function $x(t){var s=t.updateQueue;if(s!==null){var i=t.stateNode;try{kb(s,i)}catch(l){mt(t,t.return,l)}}}function Fx(t,s,i){i.props=la(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(l){mt(t,s,l)}}function rr(t,s){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:var d=t.stateNode,h=Ar(t.memoizedProps,d);(d.ref===null||d.ref.name!==h)&&(d.ref=Jy(h)),l=d.ref;break;case 7:if(t.stateNode===null){var x=new ls(t);b(t.child,!1,T2,x,void 0,void 0),t.stateNode=x}l=t.stateNode;break;default:l=t.stateNode}typeof i=="function"?t.refCleanup=i(l):i.current=l}}catch(w){mt(t,s,w)}}function xn(t,s){var i=t.ref,l=t.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(d){mt(t,s,d)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(d){mt(t,s,d)}else i.current=null}function Lu(t,s){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&s!==null)for(var i=0;i<s.length;i++)sv(t.stateNode,s[i])}function Vx(t){for(var s=t.return;s!==null&&(Fh(s)&&sv(t.stateNode,s.stateNode),!$h(s));)s=s.return}function qo(t){for(var s=t.return;s!==null&&(Fh(s)&&k2(t.stateNode,s.stateNode),!$h(s));)s=s.return}function $h(t){return t.tag===5||t.tag===3||t.tag===27}function Fh(t){return t&&t.tag===7&&t.stateNode!==null}function Vh(t){var s=t.type,i=t.memoizedProps,l=t.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(d){mt(t,t.return,d)}}function Zh(t,s,i){try{var l=t.stateNode;h2(l,t.type,i,s),l[$n]=s}catch(d){mt(t,t.return,d)}}function Zx(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&gi(t.type)||t.tag===4}function Gh(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Zx(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&gi(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Qh(t,s,i,l){var d=t.tag;if(d===5||d===6)d=t.stateNode,s?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(d,s):(s=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,s.appendChild(d),i=i._reactRootContainer,i!=null||s.onclick!==null||(s.onclick=tr)),Lu(t,l),it=!0;else if(d!==4&&(d===27&&(Lu(t,l),l=null,gi(t.type)&&(i=t.stateNode,s=null)),t=t.child,t!==null))for(Qh(t,s,i,l),t=t.sibling;t!==null;)Qh(t,s,i,l),t=t.sibling}function Pu(t,s,i,l){var d=t.tag;if(d===5||d===6)d=t.stateNode,s?i.insertBefore(d,s):i.appendChild(d),Lu(t,l),it=!0;else if(d!==4&&(d===27&&(Lu(t,l),l=null,gi(t.type)&&(i=t.stateNode)),t=t.child,t!==null))for(Pu(t,s,i,l),t=t.sibling;t!==null;)Pu(t,s,i,l),t=t.sibling}function Gx(t){var s=t.stateNode,i=t.memoizedProps;try{for(var l=t.type,d=s.attributes;d.length;)s.removeAttributeNode(d[0]);yn(s,l,i),s[mn]=t,s[$n]=i}catch(h){mt(t,t.return,h)}}var Hu=!1,ss=null;function Qx(t){(t.tag===30||(t.subtreeFlags&33554432)!==0)&&(Hu=!0)}var ir=null;function Kx(){var t=ir;return ir=null,t}var Vn=0;function dl(t,s,i,l,d){return Vn=0,Yx(t.child,s,i,l,d)}function Yx(t,s,i,l,d){for(var h=!1;t!==null;){if(t.tag===5){var x=t.stateNode;if(l!==null){var w=Tm(x);l.push(w),w.view&&(h=!0)}else h||Tm(x).view&&(h=!0);Hu=!0,Ky(x,Vn===0?s:s+"_"+Vn,i),Vn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&d||Yx(t.child,s,i,l,d)&&(h=!0));t=t.sibling}return h}function ar(t,s){for(;t!==null;)t.tag===5?Yy(t.stateNode,t.memoizedProps):(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&s||ar(t.child,s)),t=t.sibling}function qu(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if((t.tag!==22||t.memoizedState===null)&&(qu(t),t.tag===30&&(t.flags&18874368)!==0&&t.stateNode.paired)){var s=t.memoizedProps;if(s.name==null||s.name==="auto")throw Error(a(544));var i=s.name;s=Cr(s.default,s.share),s!=="none"&&(dl(t,i,s,null,!1)||ar(t.child,!1))}t=t.sibling}}function Kh(t,s){if(t.tag===30){var i=t.stateNode,l=t.memoizedProps,d=Ar(l,i),h=Cr(l.default,i.paired?l.share:l.enter);h!=="none"?dl(t,d,h,null,!1)?(qu(t),i.paired||s||yl(t,l.onEnter)):ar(t.child,!1):qu(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Kh(t,s),t=t.sibling;else qu(t)}function Yh(t){if(ss!==null&&ss.size!==0){var s=ss;if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var i=t.memoizedProps,l=i.name;if(l!=null&&l!=="auto"){var d=s.get(l);if(d!==void 0){var h=Cr(i.default,i.share);if(h!=="none"&&(dl(t,l,h,null,!1)?(h=t.stateNode,d.paired=h,h.paired=d,yl(t,i.onShare)):ar(t.child,!1)),s.delete(l),s.size===0)break}}}Yh(t)}t=t.sibling}}}function Jh(t){if(t.tag===30){var s=t.memoizedProps,i=Ar(s,t.stateNode),l=ss!==null?ss.get(i):void 0,d=Cr(s.default,l!==void 0?s.share:s.exit);d!=="none"&&(dl(t,i,d,null,!1)?l!==void 0?(d=t.stateNode,l.paired=d,d.paired=l,ss.delete(i),yl(t,s.onShare)):yl(t,s.onExit):ar(t.child,!1)),ss!==null&&Yh(t)}else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Jh(t),t=t.sibling;else ss!==null&&Yh(t)}function Jx(t){for(t=t.child;t!==null;){if(t.tag===30){var s=t.memoizedProps,i=Ar(s,t.stateNode);s=Cr(s.default,s.update),t.flags&=-5,s!=="none"&&dl(t,i,s,t.memoizedState=[],!1)}else(t.subtreeFlags&33554432)!==0&&Jx(t);t=t.sibling}}function Xh(t){if((t.subtreeFlags&18874368)!==0)for(t=t.child;t!==null;){if(t.tag!==22||t.memoizedState===null){if(t.tag===30&&(t.flags&18874368)!==0){var s=t.stateNode;s.paired!==null&&(s.paired=null,ar(t.child,!1))}Xh(t)}t=t.sibling}}function Bu(t){if(t.tag===30)t.stateNode.paired=null,ar(t.child,!1),Xh(t);else if((t.subtreeFlags&33554432)!==0)for(t=t.child;t!==null;)Bu(t),t=t.sibling;else Xh(t)}function Xx(t){for(t=t.child;t!==null;)t.tag===30?ar(t.child,!1):(t.subtreeFlags&33554432)!==0&&Xx(t),t=t.sibling}function Wh(t,s,i,l,d,h,x){for(var w=!1;s!==null;){if(s.tag===5){var R=s.stateNode;if(h!==null&&Vn<h.length){var P=h[Vn],K=Tm(R);(P.view||K.view)&&(w=!0);var ne;if(ne=(t.flags&4)===0)if(K.clip)ne=!0;else{ne=P.rect;var U=K.rect;ne=ne.y!==U.y||ne.x!==U.x||ne.height!==U.height||ne.width!==U.width}ne&&(t.flags|=4),K.abs?K=!P.abs:(P=P.rect,K=K.rect,K=P.height!==K.height||P.width!==K.width),K&&(t.flags|=32)}else t.flags|=32;(t.flags&4)!==0&&Ky(R,Vn===0?i:i+"_"+Vn,d),w&&(t.flags&4)!==0||(ir===null&&(ir=[]),ir.push(R,Vn===0?l:l+"_"+Vn,s.memoizedProps)),Vn++}else(s.tag!==22||s.memoizedState===null)&&(s.tag===30&&x?t.flags|=s.flags&32:Wh(t,s.child,i,l,d,h,x)&&(w=!0));s=s.sibling}return w}function Wx(t,s){for(t=t.child;t!==null;){if(t.tag===30){var i=t.memoizedProps,l=t.stateNode,d=Ar(i,l),h=Cr(i.default,i.update),x;x=t.memoizedState,t.memoizedState=null,l=t;var w=t.child;Vn=0,d=Wh(l,w,d,d,h,x,!1),(t.flags&4)!==0&&d&&yl(t,i.onUpdate)}else(t.subtreeFlags&33554432)!==0&&Wx(t);t=t.sibling}}var ln=!1,ft=!1,lr=!1,em=!1,ey=typeof WeakSet=="function"?WeakSet:Set,on=null,or=!1,Bo=!1,$u=!1,tm=!1;function B5(t,s,i){if(t=t.containerInfo,Em=Ol,t=rb(t),qf(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var h=d.anchorOffset,x=d.focusNode;d=d.focusOffset;try{l.nodeType,x.nodeType}catch{l=null;break e}var w=0,R=-1,P=-1,K=0,ne=0,U=t,G=null;t:for(;;){for(var ge;U!==l||h!==0&&U.nodeType!==3||(R=w+h),U!==x||d!==0&&U.nodeType!==3||(P=w+d),U.nodeType===3&&(w+=U.nodeValue.length),(ge=U.firstChild)!==null;)G=U,U=ge;for(;;){if(U===t)break t;if(G===l&&++K===h&&(R=w),G===x&&++ne===d&&(P=w),(ge=U.nextSibling)!==null)break;U=G,G=U.parentNode}U=ge}l=R===-1||P===-1?null:{start:R,end:P}}else l=null}l=l||{start:0,end:0}}else l=null;for(Am={focusedElem:t,selectionRange:l},Ol=!1,i=(i&335544064)===i,on=s,s=i?9270:1024;on!==null;){if(t=on,i&&(l=t.deletions,l!==null))for(h=0;h<l.length;h++)i&&Jh(l[h]);if(t.alternate===null&&(t.flags&2)!==0)i&&Qx(t),Fu(i);else{if(t.tag===22){if(l=t.alternate,t.memoizedState!==null){l!==null&&l.memoizedState===null&&i&&Jh(l),Fu(i);continue}else if(l!==null&&l.memoizedState!==null){i&&Qx(t),Fu(i);continue}}l=t.child,(t.subtreeFlags&s)!==0&&l!==null?(l.return=t,on=l):(i&&Jx(t),Fu(i))}}ss=null}function Fu(t){for(;on!==null;){var s=on,i=t,l=s.alternate,d=s.flags;switch(s.tag){case 0:case 11:case 15:break;case 1:if((d&1024)!==0&&l!==null){i=void 0,d=l.memoizedProps,l=l.memoizedState;var h=s.stateNode;try{var x=la(s.type,d);i=h.getSnapshotBeforeUpdate(x,l),h.__reactInternalSnapshotBeforeUpdate=i}catch(w){mt(s,s.return,w)}}break;case 3:if((d&1024)!==0){if(l=s.stateNode.containerInfo,i=l.nodeType,i===9)Mm(l);else if(i===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":Mm(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&l!==null&&(i=Ar(l.memoizedProps,l.stateNode),d=s.memoizedProps,d=Cr(d.default,d.update),d!=="none"&&dl(l,i,d,l.memoizedState=[],!0));break;default:if((d&1024)!==0)throw Error(a(163))}if(l=s.sibling,l!==null){l.return=s.return,on=l;break}on=s.return}}function ty(t,s,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:cr(t,i),l&4&&Ho(5,i);break;case 1:if(cr(t,i),l&4)if(t=i.stateNode,s===null)try{t.componentDidMount()}catch(x){mt(i,i.return,x)}else{var d=la(i.type,s.memoizedProps);s=s.memoizedState;try{t.componentDidUpdate(d,s,t.__reactInternalSnapshotBeforeUpdate)}catch(x){mt(i,i.return,x)}}l&64&&$x(i),l&512&&rr(i,i.return);break;case 3:if(cr(t,i),l&64&&(t=i.updateQueue,t!==null)){if(s=null,i.child!==null)switch(i.child.tag){case 27:case 5:s=i.child.stateNode;break;case 1:s=i.child.stateNode}try{kb(t,s)}catch(x){mt(i,i.return,x)}}break;case 27:s===null&&l&4&&Gx(i);case 26:case 5:cr(t,i),s===null&&l&4&&Vh(i),l&512&&rr(i,i.return);break;case 12:cr(t,i);break;case 31:cr(t,i),l&4&&iy(t,i);break;case 13:cr(t,i),l&4&&ay(t,i),l&64&&(t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(i=e2.bind(null,i),z2(t,i))));break;case 22:if(l=i.memoizedState!==null||ln,!l){var h=s!==null&&s.memoizedState!==null||ft;s=ln,d=ft,ln=l,(ft=h)&&!d?(l=2,(i.subtreeFlags&8772)!==0&&(l|=1),Ls(t,i,l)):cr(t,i),ln=s,ft=d}break;case 30:cr(t,i),l&512&&rr(i,i.return);break;case 7:l&512&&rr(i,i.return);default:cr(t,i)}}function nm(t,s){for(t=t.child;t!==null;)ny(t,s),t=t.sibling}function ny(t,s){switch(t.tag){case 5:case 26:try{var i=t.stateNode;if(s){var l=i.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var d=t.stateNode,h=t.memoizedProps.style,x=h!=null&&h.hasOwnProperty("display")?h.display:null;d.style.display=x==null||typeof x=="boolean"?"":(""+x).trim()}}catch(R){mt(t,t.return,R)}sm(t,s);break;case 6:try{t.stateNode.nodeValue=s?"":t.memoizedProps,it=!0}catch(R){mt(t,t.return,R)}break;case 18:try{var w=t.stateNode;s?Qy(w,!0):Qy(t.stateNode,!1)}catch(R){mt(t,t.return,R)}break;case 22:case 23:t.memoizedState===null&&nm(t,s);break;default:nm(t,s)}}function sm(t,s){if(t.subtreeFlags&67108864)for(t=t.child;t!==null;){e:{var i=t,l=s;switch(i.tag){case 4:ny(i,l);break e;case 22:i.memoizedState===null&&sm(i,l);break e;default:sm(i,l)}}t=t.sibling}}function sy(t){var s=t.alternate;s!==null&&(t.alternate=null,sy(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&Kc(s)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var At=null,Zn=!1;function Us(t,s,i){for(i=i.child;i!==null;)ry(t,s,i),i=i.sibling}function ry(t,s,i){if(Tn&&typeof Tn.onCommitFiberUnmount=="function")try{Tn.onCommitFiberUnmount(Ds,i)}catch{}switch(i.tag){case 26:ft||xn(i,s),Us(t,s,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!ft&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ft||xn(i,s),qo(i);var l=At,d=Zn;gi(i.type)&&(At=i.stateNode,Zn=!1),Us(t,s,i),ov(i.stateNode,i.type,i.memoizedProps),At=l,Zn=d;break;case 5:ft||xn(i,s),qo(i);case 6:if(i.tag===6&&qo(i),l=At,d=Zn,At=null,Us(t,s,i),At=l,Zn=d,At!==null)if(Zn)try{(At.nodeType===9?At.body:At.nodeName==="HTML"?At.ownerDocument.body:At).removeChild(i.stateNode),it=!0}catch(h){mt(i,s,h)}else try{At.removeChild(i.stateNode),it=!0}catch(h){mt(i,s,h)}break;case 18:At!==null&&(Zn?(t=At,Gy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,i.stateNode),Rl(t)):Gy(At,i.stateNode));break;case 4:l=At,d=Zn,At=i.stateNode.containerInfo,Zn=!0,Us(t,s,i),At=l,Zn=d;break;case 0:case 11:case 14:case 15:ci(2,i,s),ft||ci(4,i,s),Us(t,s,i);break;case 1:ft||(xn(i,s),l=i.stateNode,typeof l.componentWillUnmount=="function"&&Fx(i,s,l)),Us(t,s,i);break;case 21:Us(t,s,i);break;case 22:ft=(l=ft)||i.memoizedState!==null,Us(t,s,i),ft=l;break;case 30:xn(i,s),Us(t,s,i);break;case 7:ft||xn(i,s),Us(t,s,i);break;default:Us(t,s,i)}}function iy(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Rl(t)}catch(i){mt(s,s.return,i)}}}function ay(t,s){if(s.memoizedState===null&&(t=s.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Rl(t)}catch(i){mt(s,s.return,i)}}function $5(t){switch(t.tag){case 31:case 13:case 19:var s=t.stateNode;return s===null&&(s=t.stateNode=new ey),s;case 22:return t=t.stateNode,s=t._retryCache,s===null&&(s=t._retryCache=new ey),s;default:throw Error(a(435,t.tag))}}function Vu(t,s){var i=$5(t);s.forEach(function(l){if(!i.has(l)){i.add(l);var d=t2.bind(null,t,l);l.then(d,d)}})}function Mn(t,s,i){var l=s.deletions;if(l!==null)for(var d=0;d<l.length;d++){var h=l[d],x=t,w=s,R=w;e:for(;R!==null;){switch(R.tag){case 27:if(gi(R.type)){At=R.stateNode,Zn=!1;break e}break;case 5:At=R.stateNode,Zn=!1;break e;case 3:case 4:At=R.stateNode.containerInfo,Zn=!0;break e}R=R.return}if(At===null)throw Error(a(160));ry(x,w,h),At=null,Zn=!1,x=h.alternate,x!==null&&(x.return=null),h.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)ly(s,t,i),s=s.sibling}var Is=null;function ly(t,s,i){var l=t.alternate,d=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(d&4&&(l=t.updateQueue,l=l!==null?l.events:null,l!==null))for(var h=0;h<l.length;h++){var x=l[h];x.ref.impl=x.nextImpl}Mn(s,t,i),zn(t),d&4&&(ci(3,t,t.return),Ho(3,t),ci(5,t,t.return));break;case 1:Mn(s,t,i),zn(t),d&512&&(ft||l===null||xn(l,l.return)),d&64&&ln&&(t=t.updateQueue,t!==null&&(s=t.callbacks,s!==null&&(i=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:if(h=Is,Mn(s,t,i),zn(t),d&512&&(ft||l===null||xn(l,l.return)),d&4)if(d=l!==null?l.memoizedState:null,i=t.memoizedState,l===null)if(i===null)if(t.stateNode===null)if(ln)t.stateNode=Fy(t.type,t.memoizedProps,s.containerInfo,t);else{e:{s=t.type,i=t.memoizedProps,d=h.ownerDocument||h;t:switch(s){case"title":l=d.getElementsByTagName("title")[0],(!l||l[mo]||l[mn]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=d.createElement(s),d.head.insertBefore(l,d.querySelector("head > title"))),yn(l,s,i),l[mn]=t,rn(l),s=l;break e;case"link":if(h=mv("link","href",d).get(s+(i.href||""))){for(x=0;x<h.length;x++)if(l=h[x],l.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&l.getAttribute("rel")===(i.rel==null?null:i.rel)&&l.getAttribute("title")===(i.title==null?null:i.title)&&l.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){h.splice(x,1);break t}}l=d.createElement(s),yn(l,s,i),d.head.appendChild(l);break;case"meta":if(h=mv("meta","content",d).get(s+(i.content||""))){for(x=0;x<h.length;x++)if(l=h[x],l.getAttribute("content")===(i.content==null?null:""+i.content)&&l.getAttribute("name")===(i.name==null?null:i.name)&&l.getAttribute("property")===(i.property==null?null:i.property)&&l.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&l.getAttribute("charset")===(i.charSet==null?null:i.charSet)){h.splice(x,1);break t}}l=d.createElement(s),yn(l,s,i),d.head.appendChild(l);break;default:throw Error(a(468,s))}l[mn]=t,rn(l),s=l}t.stateNode=s}else ln||qm(h,t.type,t.stateNode);else t.stateNode=hv(h,i,t.memoizedProps);else d!==i?(d===null?(s=l.stateNode,s===null||ft||s.parentNode.removeChild(s)):d.count--,i===null?ln||qm(h,t.type,t.stateNode):hv(h,i,t.memoizedProps)):i===null&&t.stateNode!==null&&Zh(t,t.memoizedProps,l.memoizedProps);break;case 27:Mn(s,t,i),zn(t),d&512&&(ft||l===null||xn(l,l.return)),l!==null&&d&4&&Zh(t,t.memoizedProps,l.memoizedProps);break;case 5:if(h=lr,lr=!1,Mn(s,t,i),lr=h,zn(t),d&512&&(ft||l===null||xn(l,l.return)),t.flags&32){s=t.stateNode;try{Ga(s,""),it=!0}catch(K){mt(t,t.return,K)}}d&4&&t.stateNode!=null&&(s=t.memoizedProps,Zh(t,s,l!==null?l.memoizedProps:s)),d&1024&&(em=!0);break;case 6:if(Mn(s,t,i),zn(t),d&4){if(t.stateNode===null)throw Error(a(162));s=t.memoizedProps,i=t.stateNode;try{i.nodeValue=s,it=!0}catch(K){mt(t,t.return,K)}}break;case 3:if(it=!1,ad=null,h=Is,Is=Jo(s.containerInfo),Mn(s,t,i),Is=h,zn(t),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Rl(s.containerInfo)}catch(K){mt(t,t.return,K)}em&&(em=!1,oy(t)),it=!1;break;case 4:d=lr,lr=ln,l=Cg(),h=Is,Is=Jo(t.stateNode.containerInfo),Mn(s,t,i),zn(t),Is=h,it&&Bo&&($u=!0),it=l,lr=d;break;case 12:Mn(s,t,i),zn(t);break;case 31:Mn(s,t,i),zn(t),d&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,Vu(t,s)));break;case 13:Mn(s,t,i),zn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Qu=me()),d&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,Vu(t,s)));break;case 22:h=t.memoizedState!==null,x=l!==null&&l.memoizedState!==null;var w=ln,R=ft,P=lr;ln=w||h,lr=P||h,ft=R||x,Mn(s,t,i),ft=R,lr=P,ln=w,zn(t),d&8192&&(s=t.stateNode,s._visibility=h?s._visibility&-2:s._visibility|1,!h||l===null||x||ln||ft||(s=x||ft,i=ln,l=ft,ln=h||ln,ft=s,ui(t,2),ln=i,ft=l),!h&&lr||nm(t,h)),d&4&&(s=t.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,Vu(t,i))));break;case 19:Mn(s,t,i),zn(t),d&4&&(s=t.updateQueue,s!==null&&(t.updateQueue=null,Vu(t,s)));break;case 30:d&512&&(ft||l===null||xn(l,l.return)),d=Cg(),h=Bo,x=(i&335544064)===i,w=t.memoizedProps,Bo=x&&Cr(w.default,w.update)!=="none",Mn(s,t,i),zn(t),x&&l!==null&&it&&(t.flags|=4),Bo=h,it=d;break;case 21:break;case 7:d&512&&(ft||l===null||xn(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=t);default:Mn(s,t,i),zn(t)}}function zn(t){var s=t.flags;if(s&2){try{for(var i,l=t.return;l!==null;){if(Zx(l)){i=l;break}l=l.return}l=null;for(var d=t.return;d!==null;){if(Fh(d)){var h=d.stateNode;l===null?l=[h]:l.push(h)}if($h(d))break;d=d.return}var x=l;if(i==null)throw Error(a(160));switch(i.tag){case 27:var w=i.stateNode,R=Gh(t);Pu(t,R,w,x);break;case 5:var P=i.stateNode;i.flags&32&&(Ga(P,""),i.flags&=-33);var K=Gh(t);Pu(t,K,P,x);break;case 3:case 4:var ne=i.stateNode.containerInfo,U=Gh(t);Qh(t,U,ne,x);break;default:throw Error(a(161))}}catch(G){mt(t,t.return,G)}t.flags&=-3}s&4096&&(t.flags&=-4097)}function oy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var s=t;oy(s),s.tag===5&&s.flags&1024&&(s=s.stateNode,Ol=!0,s.reset(),Ol=!1),t=t.sibling}}function fl(t,s){if(s.subtreeFlags&9270)for(s=s.child;s!==null;)cy(s,t),s=s.sibling;else Wx(s)}function cy(t,s){var i=t.alternate;if(i===null)Kh(t,!1);else switch(t.tag){case 3:if(tm=or=!1,Kx(),fl(s,t),!or&&!$u){if(t=ir,t!==null)for(var l=0;l<t.length;l+=3){i=t[l];var d=t[l+1];Yy(i,t[l+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+d+")"})}t=s.containerInfo,t=t.nodeType===9?t.documentElement:t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName===""&&(t.style.viewTransitionName="none",t.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),t.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),tm=!0}ir=null;break;case 5:fl(s,t);break;case 4:l=or,or=!1,fl(s,t),or&&($u=!0),or=l;break;case 22:t.memoizedState===null&&(i.memoizedState!==null?Kh(t,!1):fl(s,t));break;case 30:l=or,d=Kx(),or=!1,fl(s,t),or&&(t.flags|=4);var h=t.memoizedProps,x=t.stateNode;s=Ar(h,x),x=Ar(i.memoizedProps,x);var w=Cr(h.default,h.update);w==="none"?s=!1:(h=i.memoizedState,i.memoizedState=null,i=t.child,Vn=0,s=Wh(t,i,s,x,w,h,!0),Vn!==(h===null?0:h.length)&&(t.flags|=32)),(t.flags&4)!==0&&s?(yl(t,t.memoizedProps.onUpdate),ir=d):d!==null&&(d.push.apply(d,ir),ir=d),or=(t.flags&32)!==0?!0:l;break;default:fl(s,t)}}function cr(t,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)ty(t,s.alternate,s),s=s.sibling}function ui(t,s){for(t=t.child;t!==null;){var i=t,l=s;switch(i.tag){case 0:case 11:case 14:case 15:ci(4,i,i.return),ui(i,l);break;case 1:xn(i,i.return);var d=i.stateNode;typeof d.componentWillUnmount=="function"&&Fx(i,i.return,d),ui(i,l);break;case 27:(l&2)!==0&&ov(i.stateNode,i.type,i.memoizedProps);case 5:xn(i,i.return),i.tag!==5&&i.tag!==27||qo(i),ui(i,l);break;case 6:qo(i);break;case 26:xn(i,i.return),d=i.stateNode,i.memoizedState!==null||d===null||ft||d.parentNode.removeChild(d),ui(i,l);break;case 22:i.memoizedState===null&&ui(i,l);break;case 30:xn(i,i.return),ui(i,l);break;case 7:xn(i,i.return);default:ui(i,l)}t=t.sibling}}function Ls(t,s,i){for(i=(s.subtreeFlags&8772)!==0?i:i&-2,s=s.child;s!==null;){var l=s.alternate,d=t,h=s,x=h.flags,w=(i&1)!==0;switch(h.tag){case 0:case 11:case 15:Ls(d,h,i),Ho(4,h);break;case 1:if(Ls(d,h,i),l=h,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(K){mt(l,l.return,K)}if(l=h,d=l.updateQueue,d!==null){var R=l.stateNode;try{var P=d.shared.hiddenCallbacks;if(P!==null)for(d.shared.hiddenCallbacks=null,d=0;d<P.length;d++)Tb(P[d],R)}catch(K){mt(l,l.return,K)}}w&&x&64&&$x(h),rr(h,h.return);break;case 27:(i&2)!==0&&Gx(h);case 5:h.tag!==5&&h.tag!==27||Vx(h),Ls(d,h,i),w&&l===null&&x&4&&Vh(h),rr(h,h.return);break;case 6:Vx(h);break;case 26:R=h.stateNode,h.memoizedState!==null||R===null||ln||qm(Jo(R.ownerDocument),h.type,R),Ls(d,h,i),w&&l===null&&x&4&&Vh(h),rr(h,h.return);break;case 12:Ls(d,h,i);break;case 31:Ls(d,h,i),w&&x&4&&iy(d,h);break;case 13:Ls(d,h,i),w&&x&4&&ay(d,h);break;case 22:h.memoizedState===null&&Ls(d,h,i),rr(h,h.return);break;case 30:Ls(d,h,i),rr(h,h.return);break;case 7:rr(h,h.return);default:Ls(d,h,i)}s=s.sibling}}function rm(t,s){var i=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),t=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(t=s.memoizedState.cachePool.pool),t!==i&&(t!=null&&t.refCount++,i!=null&&Ao(i))}function im(t,s){t=null,s.alternate!==null&&(t=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==t&&(s.refCount++,t!=null&&Ao(t))}function Ns(t,s,i,l){var d=(i&335544064)===i;if(s.subtreeFlags&(d?10262:10256))for(s=s.child;s!==null;)uy(t,s,i,l),s=s.sibling;else d&&Xx(s)}function uy(t,s,i,l){var d=(i&335544064)===i;d&&s.alternate===null&&s.return!==null&&s.return.alternate!==null&&Bu(s);var h=s.flags;switch(s.tag){case 0:case 11:case 15:Ns(t,s,i,l),h&2048&&Ho(9,s);break;case 1:Ns(t,s,i,l);break;case 3:Ns(t,s,i,l),d&&tm&&(t=t.containerInfo,t=t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,t.style.viewTransitionName==="root"&&(t.style.viewTransitionName=""),t=t.ownerDocument.documentElement,t!==null&&t.style.viewTransitionName==="none"&&(t.style.viewTransitionName="")),h&2048&&(h=null,s.alternate!==null&&(h=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==h&&(s.refCount++,h!=null&&Ao(h)));break;case 12:if(h&2048){Ns(t,s,i,l),h=s.stateNode;try{var x=s.memoizedProps,w=x.id,R=x.onPostCommit;typeof R=="function"&&R(w,s.alternate===null?"mount":"update",h.passiveEffectDuration,-0)}catch(P){mt(s,s.return,P)}}else Ns(t,s,i,l);break;case 31:Ns(t,s,i,l);break;case 13:Ns(t,s,i,l);break;case 23:break;case 22:x=s.stateNode,w=s.alternate,s.memoizedState!==null?(d&&w!==null&&w.memoizedState===null&&Bu(w),x._visibility&2?Ns(t,s,i,l):$o(t,s)):(d&&w!==null&&w.memoizedState!==null&&Bu(s),x._visibility&2?Ns(t,s,i,l):(x._visibility|=2,hl(t,s,i,l,(s.subtreeFlags&10256)!==0||!1))),h&2048&&rm(w,s);break;case 24:Ns(t,s,i,l),h&2048&&im(s.alternate,s);break;case 30:d&&(h=s.alternate,h!==null&&(ar(h.child,!0),ar(s.child,!0))),Ns(t,s,i,l);break;default:Ns(t,s,i,l)}}function hl(t,s,i,l,d){for(d=d&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var h=t,x=s,w=i,R=l,P=x.flags;switch(x.tag){case 0:case 11:case 15:hl(h,x,w,R,d),Ho(8,x);break;case 23:break;case 22:var K=x.stateNode;x.memoizedState!==null?K._visibility&2?hl(h,x,w,R,d):$o(h,x):(K._visibility|=2,hl(h,x,w,R,d)),d&&P&2048&&rm(x.alternate,x);break;case 24:hl(h,x,w,R,d),d&&P&2048&&im(x.alternate,x);break;default:hl(h,x,w,R,d)}s=s.sibling}}function $o(t,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var i=t,l=s,d=l.flags;switch(l.tag){case 22:$o(i,l),d&2048&&rm(l.alternate,l);break;case 24:$o(i,l),d&2048&&im(l.alternate,l);break;default:$o(i,l)}s=s.sibling}}var oa=8192;function ca(t,s,i){if(t.subtreeFlags&oa)for(t=t.child;t!==null;)dy(t,s,i),t=t.sibling}function dy(t,s,i){switch(t.tag){case 26:ca(t,s,i),t.flags&oa&&(t.memoizedState!==null?K2(i,Is,t.memoizedState,t.memoizedProps):(t=t.stateNode,(s&335544128)===s&&xv(i,t)));break;case 5:ca(t,s,i),t.flags&oa&&(t=t.stateNode,(s&335544128)===s&&xv(i,t));break;case 3:case 4:var l=Is;Is=Jo(t.stateNode.containerInfo),ca(t,s,i),Is=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=oa,oa=16777216,ca(t,s,i),oa=l):ca(t,s,i));break;case 30:if((t.flags&oa)!==0&&(l=t.memoizedProps.name,l!=null&&l!=="auto")){var d=t.stateNode;d.paired=null,ss===null&&(ss=new Map),ss.set(l,d)}ca(t,s,i);break;default:ca(t,s,i)}}function fy(t){var s=t.alternate;if(s!==null&&(t=s.child,t!==null)){s.child=null;do s=t.sibling,t.sibling=null,t=s;while(t!==null)}}function Fo(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var i=0;i<s.length;i++){var l=s[i];on=l,my(l,t)}fy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hy(t),t=t.sibling}function hy(t){switch(t.tag){case 0:case 11:case 15:Fo(t),t.flags&2048&&ci(9,t,t.return);break;case 3:Fo(t);break;case 12:Fo(t);break;case 22:var s=t.stateNode;t.memoizedState!==null&&s._visibility&2&&(t.return===null||t.return.tag!==13)?(s._visibility&=-3,Zu(t)):Fo(t);break;default:Fo(t)}}function Zu(t){var s=t.deletions;if((t.flags&16)!==0){if(s!==null)for(var i=0;i<s.length;i++){var l=s[i];on=l,my(l,t)}fy(t)}for(t=t.child;t!==null;){switch(s=t,s.tag){case 0:case 11:case 15:ci(8,s,s.return),Zu(s);break;case 22:i=s.stateNode,i._visibility&2&&(i._visibility&=-3,Zu(s));break;default:Zu(s)}t=t.sibling}}function my(t,s){for(;on!==null;){var i=on;switch(i.tag){case 0:case 11:case 15:ci(8,i,s);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Ao(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,on=l;else e:for(i=t;on!==null;){l=on;var d=l.sibling,h=l.return;if(sy(l),l===i){on=null;break e}if(d!==null){d.return=h,on=d;break e}on=h}}}var F5={getCacheForType:function(t){var s=pn(Gt),i=s.data.get(t);return i===void 0&&(i=t(),s.data.set(t,i)),i},cacheSignal:function(){return pn(Gt).controller.signal}},V5=typeof WeakMap=="function"?WeakMap:Map,lt=0,St=null,Je=null,We=0,ht=0,rs=null,di=!1,ml=!1,am=!1,Ir=0,Ut=0,fi=0,ua=0,Gu=0,is=0,pl=0,Vo=null,Gn=null,lm=!1,Qu=0,py=0,Ku=1/0,Yu=null,hi=null,kt=0,Ps=null,da=null,ur=0,om=0,cm=null,gy=null,gl=null,bl=null,xl=null,Zo=0,Ju=null;function as(){return(lt&2)!==0&&We!==0?We&-We:_e.T!==null?ym():yg()}function by(){if(is===0)if((We&536870912)===0||Qe){var t=Vc;Vc<<=1,(Vc&3932160)===0&&(Vc=262144),is=t}else is=536870912;return t=gn.current,t!==null&&(t.flags|=32),is}function yl(t,s){if(s!=null){var i=t.stateNode,l=i.ref;l===null&&(l=i.ref=Jy(Ar(t.memoizedProps,i))),bl===null&&(bl=[]),bl.push(s.bind(null,l))}}function Qn(t,s,i){(t===St&&(ht===2||ht===9)||t.cancelPendingCommit!==null)&&(vl(t,0),mi(t,We,is,!1)),ho(t,i),((lt&2)===0||t!==St)&&(t===St&&((lt&2)===0&&(ua|=i),Ut===4&&mi(t,We,is,!1)),dr(t))}function xy(t,s,i){if((lt&6)!==0)throw Error(a(327));var l=!i&&(s&127)===0&&(s&t.expiredLanes)===0||fo(t,s),d=l?Q5(t,s):dm(t,s,!0),h=l;do{if(d===0){ml&&!l&&mi(t,s,0,!1);break}else{if(i=t.current.alternate,h&&!Z5(i)){d=dm(t,s,!1),h=!1;continue}if(d===2){if(h=s,t.errorRecoveryDisabledLanes&h)var x=0;else x=t.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){s=x;e:{var w=t;d=Vo;var R=w.current.memoizedState.isDehydrated;if(R&&(vl(w,x).flags|=256),x=dm(w,x,!1),x!==2&&x!==6){if(am&&!R){w.errorRecoveryDisabledLanes|=h,ua|=h,d=4;break e}h=Gn,Gn=d,h!==null&&(Gn===null?Gn=h:Gn.push.apply(Gn,h))}d=x}if(h=!1,d!==2)continue}}if(d===1){vl(t,0),mi(t,s,0,!0);break}e:{switch(l=t,h=d,h){case 0:case 1:throw Error(a(345));case 4:if((s&4194048)!==s&&(s&62914560)!==s)break;case 6:mi(l,s,is,!di);break e;case 2:Gn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((s&62914560)===s&&(d=Qu+300-me(),10<d)){if(mi(l,s,is,!di),Gc(l,0,!0)!==0)break e;ur=s,l.timeoutHandle=Rm(yy.bind(null,l,i,Gn,Yu,lm,s,is,ua,pl,di,h,"Throttled",-0,0),d);break e}yy(l,i,Gn,Yu,lm,s,is,ua,pl,di,h,null,-0,0)}}break}while(!0);dr(t)}function yy(t,s,i,l,d,h,x,w,R,P,K,ne,U,G){t.timeoutHandle=-1;var ge=s.subtreeFlags,Ee=(h&335544064)===h;if(ne=null,(Ee||ge&8192||(ge&16785408)===16785408)&&(ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tr},ss=null,dy(s,h,ne),Ee&&(ge=ne,Ee=t.containerInfo,Ee=(Ee.nodeType===9?Ee:Ee.ownerDocument).__reactViewTransition,Ee!=null&&(ge.count++,ge.waitingForViewTransition=!0,ge=ec.bind(ge),Ee.finished.then(ge,ge))),ge=(h&62914560)===h?Qu-me():(h&4194048)===h?py-me():0,ge=Y2(ne,ge),ge!==null)){ur=h,t.cancelPendingCommit=ge(Ay.bind(null,t,s,h,i,l,d,x,w,R,P,K,ne,null,U,G)),mi(t,h,x,!P);return}Ay(t,s,h,i,l,d,x,w,R,P,K,ne)}function Z5(t){for(var s=t;;){var i=s.tag;if((i===0||i===11||i===15)&&s.flags&16384&&(i=s.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var d=i[l],h=d.getSnapshot;d=d.value;try{if(!ts(h(),d))return!1}catch{return!1}}if(i=s.child,s.subtreeFlags&16384&&i!==null)i.return=s,s=i;else{if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function mi(t,s,i,l){s=mg(t,s),s&=~Gu,s&=~ua,t.suspendedLanes|=s,t.pingedLanes&=~s,l&&(t.warmLanes|=s),l=t.expirationTimes;for(var d=s;0<d;){var h=31-Wn(d),x=1<<h;l[h]=-1,d&=~x}i!==0&&gg(t,i,s)}function Xu(){return(lt&6)===0?(Go(0),!1):!0}function um(){if(Je!==null){if(ht===0)var t=Je.return;else t=Je,Tr=Xi=null,xh(t),al=null,Ro=0,t=Je;for(;t!==null;)Bx(t.alternate,t),t=t.return;Je=null}}function vl(t,s){var i=t.timeoutHandle;return i!==-1&&(t.timeoutHandle=-1,g2(i)),i=t.cancelPendingCommit,i!==null&&(t.cancelPendingCommit=null,i()),ur=0,um(),St=t,Je=i=Or(t.current,null),We=s,ht=0,rs=null,di=!1,ml=fo(t,s),am=!1,pl=is=Gu=ua=fi=Ut=0,Gn=Vo=null,lm=!1,Ir=mg(t,s),au(),i}function vy(t,s){Fe=null,_e.H=Tu,s===il||s===bu?(s=Ab(),ht=3):s===ih?(s=Ab(),ht=4):ht=s===Dh?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,rs=s,Je===null&&(Ut=1,ku(t,vs(s,t.current)))}function wy(){var t=gn.current;return t===null?!0:(We&4194048)===We?Nn===null:(We&62914560)===We||(We&536870912)!==0?t===Nn:!1}function _y(){var t=_e.H;return _e.H=Tu,t===null?Tu:t}function Sy(){var t=_e.A;return _e.A=F5,t}function Wu(){Ut=4,di||(We&4194048)!==We&&gn.current!==null||(ml=!0),(fi&134217727)===0&&(ua&134217727)===0||St===null||mi(St,We,is,!1)}function dm(t,s,i){var l=lt;lt|=2;var d=_y(),h=Sy();(St!==t||We!==s)&&(Yu=null,vl(t,s)),s=!1;var x=Ut;e:do try{if(ht!==0&&Je!==null){var w=Je,R=rs;switch(ht){case 8:um(),x=6;break e;case 3:case 2:case 9:case 6:gn.current===null&&(s=!0);var P=ht;if(ht=0,rs=null,wl(t,w,R,P),i&&ml){x=0;break e}break;default:P=ht,ht=0,rs=null,wl(t,w,R,P)}}G5(),x=Ut;break}catch(K){vy(t,K)}while(!0);return s&&t.shellSuspendCounter++,Tr=Xi=null,lt=l,_e.H=d,_e.A=h,Je===null&&(St=null,We=0,au()),x}function G5(){for(;Je!==null;)Ny(Je)}function Q5(t,s){var i=lt;lt|=2;var l=_y(),d=Sy();St!==t||We!==s?(Yu=null,Ku=me()+500,vl(t,s)):ml=fo(t,s);e:do try{if(ht!==0&&Je!==null){s=Je;var h=rs;t:switch(ht){case 1:ht=0,rs=null,wl(t,s,h,1);break;case 2:case 9:if(jb(h)){ht=0,rs=null,jy(s);break}s=function(){ht!==2&&ht!==9||St!==t||(ht=7),dr(t)},h.then(s,s);break e;case 3:ht=7;break e;case 4:ht=5;break e;case 7:jb(h)?(ht=0,rs=null,jy(s)):(ht=0,rs=null,wl(t,s,h,7));break;case 5:var x=null;switch(Je.tag){case 26:x=Je.memoizedState;case 5:case 27:var w=Je;if(x?gv(x):w.stateNode.complete){ht=0,rs=null;var R=w.sibling;if(R!==null)Je=R;else{var P=w.return;P!==null?(Je=P,ed(P)):Je=null}break t}}ht=0,rs=null,wl(t,s,h,5);break;case 6:ht=0,rs=null,wl(t,s,h,6);break;case 8:um(),Ut=6;break e;default:throw Error(a(462))}}K5();break}catch(K){vy(t,K)}while(!0);return Tr=Xi=null,_e.H=l,_e.A=d,lt=i,Je!==null?0:(St=null,We=0,au(),Ut)}function K5(){for(;Je!==null&&!de();)Ny(Je)}function Ny(t){var s=Hx(t.alternate,t,Ir);t.memoizedProps=t.pendingProps,s===null?ed(t):Je=s}function jy(t){var s=t,i=s.alternate;switch(s.tag){case 15:case 0:s=Dx(i,s,s.pendingProps,s.type,void 0,We);break;case 11:s=Dx(i,s,s.pendingProps,s.type.render,s.ref,We);break;case 5:xh(s);var l=s;l===an&&(Qe?(fu(l),l.tag===5&&l.stateNode!=null&&(Nt=l.stateNode)):(fu(l),Qe=!0));default:Bx(i,s),s=Je=mb(s,Ir),s=Hx(i,s,Ir)}t.memoizedProps=t.pendingProps,s===null?ed(t):Je=s}function wl(t,s,i,l){Tr=Xi=null,xh(s),al=null,Ro=0;var d=s.return;try{if(U5(t,d,s,i,We)){Ut=1,ku(t,vs(i,t.current)),Je=null;return}}catch(h){if(d!==null)throw Je=d,h;Ut=1,ku(t,vs(i,t.current)),Je=null;return}s.flags&32768?(Qe||l===1?t=!0:ml||(We&536870912)!==0?t=!1:(di=t=!0,(l===2||l===9||l===3||l===6)&&(l=gn.current,l!==null&&l.tag===13&&(l.flags|=16384))),Ey(s,t)):ed(s)}function ed(t){var s=t;do{if((s.flags&32768)!==0){Ey(s,di);return}t=s.return;var i=H5(s.alternate,s,Ir);if(i!==null){Je=i;return}if(s=s.sibling,s!==null){Je=s;return}Je=s=t}while(s!==null);Ut===0&&(Ut=5)}function Ey(t,s){do{var i=q5(t.alternate,t);if(i!==null){i.flags&=32767,Je=i;return}if(i=t.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!s&&(t=t.sibling,t!==null)){Je=t;return}Je=t=i}while(t!==null);Ut=6,Je=null}function Ay(t,s,i,l,d,h,x,w,R,P,K,ne){t.cancelPendingCommit=null;do td();while(kt!==0);if((lt&6)!==0)throw Error(a(327));if(s!==null){if(s===t.current)throw Error(a(177));t===St&&(Je=St=null,We=0),da=s,Ps=t,ur=i,cm=d,gy=l,Y5(t,s,i,x,w,R,ne)}}function Y5(t,s,i,l,d,h,x){var w=s.lanes|s.childLanes;if(om=w,w|=Zf,_j(t,i,w,l,d,h),bl=null,(i&335544064)===i?(xl=N5(t),l=10262):(xl=null,l=10256),(s.subtreeFlags&l)!==0||(s.flags&l)!==0?(t.callbackNode=null,t.callbackPriority=0,n2(vt,function(){return pm(),null})):(t.callbackNode=null,t.callbackPriority=0),Hu=!1,l=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||l){l=_e.T,_e.T=null,d=je.p,je.p=2,h=lt,lt|=4;try{B5(t,s,i)}finally{lt=h,je.p=d,_e.T=l}}kt=1,Hu?gl=_2(x,t.containerInfo,xl,fm,hm,X5,mm,pm,J5):(fm(),hm(),mm())}function J5(t){if(kt!==0){var s=Ps.onRecoverableError;s(t,{componentStack:null})}}function X5(){kt===3&&(kt=0,cy(da,Ps),kt=4)}function fm(){if(kt===1){kt=0;var t=Ps,s=da,i=ur,l=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||l){l=_e.T,_e.T=null;var d=je.p;je.p=2;var h=lt;lt|=4;try{Bo=$u=!1,ly(s,t,i),i=Am;var x=rb(t.containerInfo),w=i.focusedElem,R=i.selectionRange;if(x!==w&&w&&w.ownerDocument&&sb(w.ownerDocument.documentElement,w)){if(R!==null&&qf(w)){var P=R.start,K=R.end;if(K===void 0&&(K=P),"selectionStart"in w)w.selectionStart=P,w.selectionEnd=Math.min(K,w.value.length);else{var ne=w.ownerDocument||document,U=ne&&ne.defaultView||window;if(U.getSelection){var G=U.getSelection(),ge=w.textContent.length,Ee=Math.min(R.start,ge),Ve=R.end===void 0?Ee:Math.min(R.end,ge);!G.extend&&Ee>Ve&&(x=Ve,Ve=Ee,Ee=x);var L=nb(w,Ee),D=nb(w,Ve);if(L&&D&&(G.rangeCount!==1||G.anchorNode!==L.node||G.anchorOffset!==L.offset||G.focusNode!==D.node||G.focusOffset!==D.offset)){var V=ne.createRange();V.setStart(L.node,L.offset),G.removeAllRanges(),Ee>Ve?(G.addRange(V),G.extend(D.node,D.offset)):(V.setEnd(D.node,D.offset),G.addRange(V))}}}}for(ne=[],G=w;G=G.parentNode;)G.nodeType===1&&ne.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<ne.length;w++){var te=ne[w];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Ol=!!Em,Am=Em=null}finally{lt=h,je.p=d,_e.T=l}}t.current=s,kt=2}}function hm(){if(kt===2){kt=0;var t=Ps,s=da,i=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||i){i=_e.T,_e.T=null;var l=je.p;je.p=2;var d=lt;lt|=4;try{ty(t,s.alternate,s)}finally{lt=d,je.p=l,_e.T=i}}kt=3}}function mm(){if(kt===4||kt===3){kt=0;var t=gl;gl=null,be();var s=Ps,i=da,l=ur,d=gy,h=(l&335544064)===l?10262:10256;if((i.subtreeFlags&h)!==0||(i.flags&h)!==0?kt=5:(kt=0,da=Ps=null,Cy(s,s.pendingLanes)),h=s.pendingLanes,h===0&&(hi=null),Sf(l),i=i.stateNode,Tn&&typeof Tn.onCommitFiberRoot=="function")try{Tn.onCommitFiberRoot(Ds,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=_e.T,h=je.p,je.p=2,_e.T=null;try{for(var x=s.onRecoverableError,w=0;w<d.length;w++){var R=d[w];x(R.value,{componentStack:R.stack})}}finally{_e.T=i,je.p=h}}if(d=bl,x=xl,xl=null,d!==null&&(bl=null,x===null&&(x=[]),t!==null))for(R=0;R<d.length;R++)i=(0,d[R])(x),i!==void 0&&t.finished.finally(i);(ur&3)!==0&&td(),dr(s),h=s.pendingLanes,(l&261930)!==0&&(h&42)!==0?s===Ju?Zo++:(Zo=0,Ju=s):(Zo=0,Ju=null),Go(0)}}function Cy(t,s){(t.pooledCacheLanes&=s)===0&&(s=t.pooledCache,s!=null&&(t.pooledCache=null,Ao(s)))}function td(){return gl!==null&&(gl.skipTransition(),gl=null),fm(),hm(),mm(),pm()}function pm(){if(kt!==5)return!1;var t=Ps,s=om;om=0;var i=Sf(ur),l=_e.T,d=je.p;try{je.p=32>i?32:i,_e.T=null,i=cm,cm=null;var h=Ps,x=ur;if(kt=0,da=Ps=null,ur=0,(lt&6)!==0)throw Error(a(331));var w=lt;if(lt|=4,hy(h.current),uy(h,h.current,x,i),lt=w,Go(0,!1),Tn&&typeof Tn.onPostCommitFiberRoot=="function")try{Tn.onPostCommitFiberRoot(Ds,h)}catch{}return!0}finally{je.p=d,_e.T=l,Cy(t,s)}}function Oy(t,s,i){s=vs(i,s),s=kh(t.stateNode,s,2),t=ii(t,s,2),t!==null&&(ho(t,2),dr(t))}function mt(t,s,i){if(t.tag===3)Oy(t,t,i);else for(;s!==null;){if(s.tag===3){Oy(s,t,i);break}else if(s.tag===1){var l=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(hi===null||!hi.has(l))){t=vs(i,t),i=jx(2),l=ii(s,i,2),l!==null&&(Ex(i,l,s,t),ho(l,2),dr(l));break}}s=s.return}}function gm(t,s,i){var l=t.pingCache;if(l===null){l=t.pingCache=new V5;var d=new Set;l.set(s,d)}else d=l.get(s),d===void 0&&(d=new Set,l.set(s,d));d.has(i)||(am=!0,d.add(i),t=W5.bind(null,t,s,i),s.then(t,t))}function W5(t,s,i){var l=t.pingCache;l!==null&&l.delete(s),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,St===t&&(We&i)===i&&((Ut===4||Ut===3&&(We&62914560)===We&&300>me()-Qu)&&(lt&2)===0?vl(t,0):Gu|=i,pl===We&&(pl=0)),dr(t)}function Ry(t,s){s===0&&(s=pg()),t=Ki(t,s),t!==null&&(ho(t,s),dr(t))}function e2(t){var s=t.memoizedState,i=0;s!==null&&(i=s.retryLane),Ry(t,i)}function t2(t,s){var i=0;switch(t.tag){case 31:case 13:var l=t.stateNode,d=t.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(s),Ry(t,i)}function n2(t,s){return I(t,s)}var _l=null,Sl=null,bm=!1,nd=!1,xm=!1,pi=0;function dr(t){t!==Sl&&t.next===null&&(Sl===null?_l=Sl=t:Sl=Sl.next=t),nd=!0,bm||(bm=!0,r2())}function Go(t,s){if(!xm&&nd){xm=!0;do for(var i=!1,l=_l;l!==null;){if(t!==0){var d=l.pendingLanes;if(d===0)var h=0;else{var x=l.suspendedLanes,w=l.pingedLanes;h=(1<<31-Wn(42|t)+1)-1,h&=d&~(x&~w),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(i=!0,My(l,h))}else h=We,h=Gc(l,l===St?h:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(h&3)===0||fo(l,h)||(i=!0,My(l,h));l=l.next}while(i);xm=!1}}function s2(){Ty()}function Ty(){nd=bm=!1;var t=0;pi!==0&&p2()&&(t=pi);for(var s=me(),i=null,l=_l;l!==null;){var d=l.next,h=ky(l,s);h===0?(l.next=null,i===null?_l=d:i.next=d,d===null&&(Sl=i)):(i=l,(t!==0||(h&3)!==0)&&(nd=!0)),l=d}kt!==0&&kt!==5||Go(t),pi!==0&&(pi=0)}function ky(t,s){for(var i=t.suspendedLanes,l=t.pingedLanes,d=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var x=31-Wn(h),w=1<<x,R=d[x];R===-1?((w&i)===0||(w&l)!==0)&&(d[x]=wj(w,s)):R<=s&&(t.expiredLanes|=w),h&=~w}if(s=St,i=We,i=Gc(t,t===s?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,i===0||t===s&&(ht===2||ht===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&le(l),t.callbackNode=null,t.callbackPriority=0;if((i&3)===0||fo(t,i)){if(s=i&-i,s===t.callbackPriority)return s;switch(l!==null&&le(l),Sf(i)){case 2:case 8:i=Ue;break;case 32:i=vt;break;case 268435456:i=Bn;break;default:i=vt}return l=Dy.bind(null,t),i=I(i,l),t.callbackPriority=s,t.callbackNode=i,s}return l!==null&&l!==null&&le(l),t.callbackPriority=2,t.callbackNode=null,2}function Dy(t,s){if(kt!==0&&kt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var i=t.callbackNode;if(td()&&t.callbackNode!==i)return null;var l=We;return l=Gc(t,t===St?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(xy(t,l,s),ky(t,me()),t.callbackNode!=null&&t.callbackNode===i?Dy.bind(null,t):null)}function My(t,s){if(td())return null;xy(t,s,!0)}function r2(){b2(function(){(lt&6)!==0?I(Te,s2):Ty()})}function ym(){if(pi===0){var t=ta;t===0&&(t=Fc,Fc<<=1,(Fc&261888)===0&&(Fc=256)),pi=t}return pi}function zy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Xc(t)}function i2(t,s,i,l,d){if(s==="submit"&&i&&i.stateNode===d){var h=zy((d[$n]||null).action),x=l.submitter;x&&(s=(s=x[$n]||null)?zy(s.formAction):x.getAttribute("formAction"),s!==null&&(h=s,x=null));var w=new nu("action","action",null,l,d);t.push({event:w,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(pi!==0){var R=new FormData(d,x);Ah(i,{pending:!0,data:R,method:d.method,action:h},null,R)}}else typeof h=="function"&&(w.preventDefault(),R=new FormData(d,x),Ah(i,{pending:!0,data:R,method:d.method,action:h},h,R))},currentTarget:d}]})}}for(var vm=0;vm<Vf.length;vm++){var wm=Vf[vm],a2=wm.toLowerCase(),l2=wm[0].toUpperCase()+wm.slice(1);zs(a2,"on"+l2)}zs(lb,"onAnimationEnd"),zs(ob,"onAnimationIteration"),zs(cb,"onAnimationStart"),zs("dblclick","onDoubleClick"),zs("focusin","onFocus"),zs("focusout","onBlur"),zs(g5,"onTransitionRun"),zs(b5,"onTransitionStart"),zs(x5,"onTransitionCancel"),zs(ub,"onTransitionEnd"),Va("onMouseEnter",["mouseout","mouseover"]),Va("onMouseLeave",["mouseout","mouseover"]),Va("onPointerEnter",["pointerout","pointerover"]),Va("onPointerLeave",["pointerout","pointerover"]),Zi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qo="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(" "),o2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qo));function Uy(t,s){s=(s&4)!==0;for(var i=0;i<t.length;i++){var l=t[i],d=l.event;l=l.listeners;e:{var h=void 0;if(s)for(var x=l.length-1;0<=x;x--){var w=l[x],R=w.instance,P=w.currentTarget;if(w=w.listener,R!==h&&d.isPropagationStopped())break e;h=w,d.currentTarget=P;try{h(d)}catch(K){iu(K)}d.currentTarget=null,h=R}else for(x=0;x<l.length;x++){if(w=l[x],R=w.instance,P=w.currentTarget,w=w.listener,R!==h&&d.isPropagationStopped())break e;h=w,d.currentTarget=P;try{h(d)}catch(K){iu(K)}d.currentTarget=null,h=R}}}}function Xe(t,s){var i=s[wg];i===void 0&&(i=s[wg]=new Set);var l=t+"__bubble";i.has(l)||(Iy(s,t,2,!1),i.add(l))}function _m(t,s,i){var l=0;s&&(l|=4),Iy(i,t,l,s)}var sd="_reactListening"+Math.random().toString(36).slice(2);function Sm(t){if(!t[sd]){t[sd]=!0,Ng.forEach(function(i){i!=="selectionchange"&&(o2.has(i)||_m(i,!1,t),_m(i,!0,t))});var s=t.nodeType===9?t:t.ownerDocument;s===null||s[sd]||(s[sd]=!0,_m("selectionchange",!1,s))}}function Iy(t,s,i,l){switch(Ev(s)){case 2:var d=eE;break;case 8:d=tE;break;default:d=$m}i=d.bind(null,s,i,t),d=void 0,!Tf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(d=!0),l?d!==void 0?t.addEventListener(s,i,{capture:!0,passive:d}):t.addEventListener(s,i,!0):d!==void 0?t.addEventListener(s,i,{passive:d}):t.addEventListener(s,i,!1)}function Nm(t,s,i,l,d){var h=l;if((s&1)===0&&(s&2)===0&&l!==null)e:for(;;){if(l===null)return;var x=l.tag;if(x===3||x===4){var w=l.stateNode.containerInfo;if(w===d)break;if(x===4)for(x=l.return;x!==null;){var R=x.tag;if((R===3||R===4)&&x.stateNode.containerInfo===d)return;x=x.return}for(;w!==null;){if(x=Vi(w),x===null)return;if(R=x.tag,R===5||R===6||R===26||R===27){l=h=x;continue e}w=w.parentNode}}l=l.return}Ig(function(){var P=h,K=Of(i),ne=[];e:{var U=db.get(t);if(U!==void 0){var G=nu,ge=t;switch(t){case"keypress":if(eu(i)===0)break e;case"keydown":case"keyup":G=Zj;break;case"focusin":ge="focus",G=zf;break;case"focusout":ge="blur",G=zf;break;case"beforeblur":case"afterblur":G=zf;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":G=Hg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=Mj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=Jj;break;case lb:case ob:case cb:G=Ij;break;case ub:G=Wj;break;case"scroll":case"scrollend":G=kj;break;case"wheel":G=t5;break;case"copy":case"cut":case"paste":G=Pj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=Bg;break;case"submit":G=Kj;break;case"toggle":case"beforetoggle":G=s5}var Ee=(s&4)!==0,Ve=!Ee&&(t==="scroll"||t==="scrollend"),L=Ee?U!==null?U+"Capture":null:U;Ee=[];for(var D=P,V;D!==null;){var te=D;if(V=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||V===null||L===null||(te=go(D,L),te!=null&&Ee.push(Ko(D,te,V))),Ve)break;D=D.return}0<Ee.length&&(U=new G(U,ge,null,i,K),ne.push({event:U,listeners:Ee}))}}if((s&7)===0){e:{if(G=t==="mouseover"||t==="pointerover",U=t==="mouseout"||t==="pointerout",G&&i!==Cf&&(ge=i.relatedTarget||i.fromElement)&&(Vi(ge)||ge[Ba]))break e;(U||G)&&(ge=K.window===K?K:(G=K.ownerDocument)?G.defaultView||G.parentWindow:window,U?(G=i.relatedTarget||i.toElement,U=P,G=G?Vi(G):null,G!==null&&(Ve=u(G),Ee=G.tag,G!==Ve||Ee!==5&&Ee!==27&&Ee!==6)&&(G=null)):(U=null,G=P),U!==G&&(Ee=Hg,te="onMouseLeave",L="onMouseEnter",D="mouse",(t==="pointerout"||t==="pointerover")&&(Ee=Bg,te="onPointerLeave",L="onPointerEnter",D="pointer"),Ve=U==null?ge:po(U),V=G==null?ge:po(G),ge=new Ee(te,D+"leave",U,i,K),ge.target=Ve,ge.relatedTarget=V,te=null,Vi(K)===P&&(Ee=new Ee(L,D+"enter",G,i,K),Ee.target=V,Ee.relatedTarget=Ve,te=Ee),Ve=te,Ee=U&&G?re(U,G,c2):null,U!==null&&Ly(ne,ge,U,Ee,!1),G!==null&&Ve!==null&&Ly(ne,Ve,G,Ee,!0)))}e:{if(U=P?po(P):window,G=U.nodeName&&U.nodeName.toLowerCase(),G==="select"||G==="input"&&U.type==="file")var Ne=Yg;else if(Qg(U))if(Jg)Ne=h5;else{Ne=d5;var et=u5}else G=U.nodeName,!G||G.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?P&&Af(P.elementType)&&(Ne=Yg):Ne=f5;if(Ne&&(Ne=Ne(t,P))){Kg(ne,Ne,i,K);break e}et&&et(t,U,P)}switch(et=P?po(P):window,t){case"focusin":(Qg(et)||et.contentEditable==="true")&&(Ja=et,Bf=P,No=null);break;case"focusout":No=Bf=Ja=null;break;case"mousedown":$f=!0;break;case"contextmenu":case"mouseup":case"dragend":$f=!1,ib(ne,i,K);break;case"selectionchange":if(p5)break;case"keydown":case"keyup":ib(ne,i,K)}var ke;if(If)e:{switch(t){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Ya?Zg(t,i)&&(He="onCompositionEnd"):t==="keydown"&&i.keyCode===229&&(He="onCompositionStart");He&&($g&&i.locale!=="ko"&&(Ya||He!=="onCompositionStart"?He==="onCompositionEnd"&&Ya&&(ke=Lg()):(Yr=K,kf="value"in Yr?Yr.value:Yr.textContent,Ya=!0)),et=rd(P,He),0<et.length&&(He=new qg(He,t,null,i,K),ne.push({event:He,listeners:et}),ke?He.data=ke:(ke=Gg(i),ke!==null&&(He.data=ke)))),(ke=i5?a5(t,i):l5(t,i))&&(He=rd(P,"onBeforeInput"),0<He.length&&(et=new qg("onBeforeInput","beforeinput",null,i,K),ne.push({event:et,listeners:He}),et.data=ke)),i2(ne,t,P,i,K)}Uy(ne,s)})}function Ko(t,s,i){return{instance:t,listener:s,currentTarget:i}}function rd(t,s){for(var i=s+"Capture",l=[];t!==null;){var d=t,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=go(t,i),d!=null&&l.unshift(Ko(t,d,h)),d=go(t,s),d!=null&&l.push(Ko(t,d,h))),t.tag===3)return l;t=t.return}return[]}function c2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ly(t,s,i,l,d){for(var h=s._reactName,x=[];i!==null&&i!==l;){var w=i,R=w.alternate,P=w.stateNode;if(w=w.tag,R!==null&&R===l)break;w!==5&&w!==26&&w!==27||P===null||(R=P,d?(P=go(i,h),P!=null&&x.unshift(Ko(i,P,R))):d||(P=go(i,h),P!=null&&x.push(Ko(i,P,R)))),i=i.return}x.length!==0&&t.push({event:s,listeners:x})}var u2=/\r\n?/g,d2=/\u0000|\uFFFD/g;function Py(t){return(typeof t=="string"?t:""+t).replace(u2,`
`).replace(d2,"")}function Hy(t,s){return s=Py(s),Py(t)===s}function pt(t,s,i,l,d,h){switch(i){case"children":if(typeof l=="string")s==="body"||s==="textarea"&&l===""||Ga(t,l);else if(typeof l=="number"||typeof l=="bigint")s!=="body"&&Ga(t,""+l);else return;break;case"className":Jc(t,"class",l);break;case"tabIndex":Jc(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Jc(t,i,l);break;case"style":zg(t,l,h);return;case"data":if(s!=="object"){Jc(t,"data",l);break}case"src":case"href":if(l===""&&(s!=="a"||i!=="href")){t.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(i);break}l=Xc(l),t.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(i==="formAction"?(s!=="input"&&pt(t,s,"name",d.name,d,null),pt(t,s,"formEncType",d.formEncType,d,null),pt(t,s,"formMethod",d.formMethod,d,null),pt(t,s,"formTarget",d.formTarget,d,null)):(pt(t,s,"encType",d.encType,d,null),pt(t,s,"method",d.method,d,null),pt(t,s,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(i);break}l=Xc(l),t.setAttribute(i,l);break;case"onClick":l!=null&&(t.onclick=tr);return;case"onScroll":l!=null&&Xe("scroll",t);return;case"onScrollEnd":l!=null&&Xe("scrollend",t);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(i=l.__html,i!=null){if(d.children!=null)throw Error(a(60));(h!=null?h.__html:void 0)!==i&&(t.innerHTML=i)}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}i=Xc(l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,l):t.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,""):t.removeAttribute(i);break;case"capture":case"download":l===!0?t.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(i,l):t.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(i,l):t.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(i):t.setAttribute(i,l);break;case"popover":Xe("beforetoggle",t),Xe("toggle",t),Yc(t,"popover",l);break;case"xlinkActuate":jr(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":jr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":jr(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":jr(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":jr(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":jr(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":jr(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":jr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":jr(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Yc(t,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=Rj.get(i)||i,Yc(t,i,l);else return}it=!0}function jm(t,s,i,l,d,h){switch(i){case"style":zg(t,l,h);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(i=l.__html,i!=null){if(d.children!=null)throw Error(a(60));(h!=null?h.__html:void 0)!==i&&(t.innerHTML=i)}}break;case"children":if(typeof l=="string")Ga(t,l);else if(typeof l=="number"||typeof l=="bigint")Ga(t,""+l);else return;break;case"onScroll":l!=null&&Xe("scroll",t);return;case"onScrollEnd":l!=null&&Xe("scrollend",t);return;case"onClick":l!=null&&(t.onclick=tr);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!jg.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(d=i.endsWith("Capture"),h=i.slice(2,d?i.length-7:void 0),s=t[$n]||null,s=s!=null?s[i]:null,typeof s=="function"&&t.removeEventListener(h,s,d),typeof l=="function")){typeof s!="function"&&s!==null&&(i in t?t[i]=null:t.hasAttribute(i)&&t.removeAttribute(i)),t.addEventListener(h,l,d);break e}it=!0,i in t?t[i]=l:l===!0?t.setAttribute(i,""):Yc(t,i,l)}return}it=!0}function yn(t,s,i){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Xe("error",t),Xe("load",t);var l=!1,d=!1,h;for(h in i)if(i.hasOwnProperty(h)){var x=i[h];if(x!=null)switch(h){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,s));default:pt(t,s,h,x,i,null)}}d&&pt(t,s,"srcSet",i.srcSet,i,null),l&&pt(t,s,"src",i.src,i,null);return;case"input":Xe("invalid",t);var w=h=x=d=null,R=null,P=null;for(l in i)if(i.hasOwnProperty(l)){var K=i[l];if(K!=null)switch(l){case"name":d=K;break;case"type":x=K;break;case"checked":R=K;break;case"defaultChecked":P=K;break;case"value":h=K;break;case"defaultValue":w=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(a(137,s));break;default:pt(t,s,l,K,i,null)}}Tg(t,h,w,R,P,x,d,!1);return;case"select":Xe("invalid",t),l=x=h=null;for(d in i)if(i.hasOwnProperty(d)&&(w=i[d],w!=null))switch(d){case"value":h=w;break;case"defaultValue":x=w;break;case"multiple":l=w;default:pt(t,s,d,w,i,null)}s=h,i=x,t.multiple=!!l,s!=null?Za(t,!!l,s,!1):i!=null&&Za(t,!!l,i,!0);return;case"textarea":Xe("invalid",t),h=d=l=null;for(x in i)if(i.hasOwnProperty(x)&&(w=i[x],w!=null))switch(x){case"value":l=w;break;case"defaultValue":d=w;break;case"children":h=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(a(91));break;default:pt(t,s,x,w,i,null)}Dg(t,l,d,h);return;case"option":for(R in i)if(i.hasOwnProperty(R)&&(l=i[R],l!=null))switch(R){case"selected":t.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:pt(t,s,R,l,i,null)}return;case"dialog":Xe("beforetoggle",t),Xe("toggle",t),Xe("cancel",t),Xe("close",t);break;case"iframe":case"object":Xe("load",t);break;case"video":case"audio":for(l=0;l<Qo.length;l++)Xe(Qo[l],t);break;case"image":Xe("error",t),Xe("load",t);break;case"details":Xe("toggle",t);break;case"embed":case"source":case"link":Xe("error",t),Xe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in i)if(i.hasOwnProperty(P)&&(l=i[P],l!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,s));default:pt(t,s,P,l,i,null)}return;default:if(Af(s)){for(K in i)i.hasOwnProperty(K)&&(l=i[K],l!==void 0&&jm(t,s,K,l,i,void 0));return}}for(w in i)i.hasOwnProperty(w)&&(l=i[w],l!=null&&pt(t,s,w,l,i,null))}var f2={};function h2(t,s,i,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,x=null,w=null,R=null,P=null,K=null;for(G in i){var ne=i[G];if(i.hasOwnProperty(G)&&ne!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":R=ne;default:l.hasOwnProperty(G)||pt(t,s,G,null,l,ne)}}for(var U in l){var G=l[U];if(ne=i[U],l.hasOwnProperty(U)&&(G!=null||ne!=null))switch(U){case"type":G!==ne&&(it=!0),h=G;break;case"name":G!==ne&&(it=!0),d=G;break;case"checked":G!==ne&&(it=!0),P=G;break;case"defaultChecked":G!==ne&&(it=!0),K=G;break;case"value":G!==ne&&(it=!0),x=G;break;case"defaultValue":G!==ne&&(it=!0),w=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(a(137,s));break;default:G!==ne&&pt(t,s,U,G,l,ne)}}jf(t,x,w,R,P,K,h,d);return;case"select":G=x=w=U=null;for(h in i)if(R=i[h],i.hasOwnProperty(h)&&R!=null)switch(h){case"value":break;case"multiple":G=R;default:l.hasOwnProperty(h)||pt(t,s,h,null,l,R)}for(d in l)if(h=l[d],R=i[d],l.hasOwnProperty(d)&&(h!=null||R!=null))switch(d){case"value":h!==R&&(it=!0),U=h;break;case"defaultValue":h!==R&&(it=!0),w=h;break;case"multiple":h!==R&&(it=!0),x=h;default:h!==R&&pt(t,s,d,h,l,R)}s=w,i=x,l=G,U!=null?Za(t,!!i,U,!1):!!l!=!!i&&(s!=null?Za(t,!!i,s,!0):Za(t,!!i,i?[]:"",!1));return;case"textarea":G=U=null;for(w in i)if(d=i[w],i.hasOwnProperty(w)&&d!=null&&!l.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:pt(t,s,w,null,l,d)}for(x in l)if(d=l[x],h=i[x],l.hasOwnProperty(x)&&(d!=null||h!=null))switch(x){case"value":d!==h&&(it=!0),U=d;break;case"defaultValue":d!==h&&(it=!0),G=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(a(91));break;default:d!==h&&pt(t,s,x,d,l,h)}kg(t,U,G);return;case"option":for(var ge in i)if(U=i[ge],i.hasOwnProperty(ge)&&U!=null&&!l.hasOwnProperty(ge))switch(ge){case"selected":t.selected=!1;break;default:pt(t,s,ge,null,l,U)}for(R in l)if(U=l[R],G=i[R],l.hasOwnProperty(R)&&U!==G&&(U!=null||G!=null))switch(R){case"selected":U!==G&&(it=!0),t.selected=U&&typeof U!="function"&&typeof U!="symbol";break;default:pt(t,s,R,U,l,G)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ee in i)U=i[Ee],i.hasOwnProperty(Ee)&&U!=null&&!l.hasOwnProperty(Ee)&&pt(t,s,Ee,null,l,U);for(P in l)if(U=l[P],G=i[P],l.hasOwnProperty(P)&&U!==G&&(U!=null||G!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(a(137,s));break;default:pt(t,s,P,U,l,G)}return;default:if(Af(s)){for(var Ve in i)U=i[Ve],i.hasOwnProperty(Ve)&&U!==void 0&&!l.hasOwnProperty(Ve)&&jm(t,s,Ve,void 0,l,U);for(K in l)U=l[K],G=i[K],!l.hasOwnProperty(K)||U===G||U===void 0&&G===void 0||jm(t,s,K,U,l,G);return}}for(var L in i)U=i[L],i.hasOwnProperty(L)&&U!=null&&!l.hasOwnProperty(L)&&pt(t,s,L,null,l,U);for(ne in l)U=l[ne],G=i[ne],!l.hasOwnProperty(ne)||U===G||U==null&&G==null||pt(t,s,ne,U,l,G)}function qy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function m2(){if(typeof performance.getEntriesByType=="function"){for(var t=0,s=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var d=i[l],h=d.transferSize,x=d.initiatorType,w=d.duration;if(h&&w&&qy(x)){for(x=0,w=d.responseEnd,l+=1;l<i.length;l++){var R=i[l],P=R.startTime;if(P>w)break;var K=R.transferSize,ne=R.initiatorType;K&&qy(ne)&&(R=R.responseEnd,x+=K*(R<w?1:(w-P)/(R-P)))}if(--l,s+=8*(h+x)/(d.duration/1e3),t++,10<t)break}}if(0<t)return s/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Em=null,Am=null;function Yo(t){return t.nodeType===9?t:t.ownerDocument}function By(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $y(t,s){if(t===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&s==="foreignObject"?0:t}function Fy(t,s,i,l){return i=Yo(i).createElement(t),i[mn]=l,i[$n]=s,yn(i,t,s),rn(i),i}function Cm(t,s){return t==="textarea"||t==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Om=null;function p2(){var t=window.event;return t&&t.type==="popstate"?t===Om?!1:(Om=t,!0):(Om=null,!1)}var Rm=typeof setTimeout=="function"?setTimeout:void 0,g2=typeof clearTimeout=="function"?clearTimeout:void 0,Vy=typeof Promise=="function"?Promise:void 0,Zy=typeof requestAnimationFrame=="function"?requestAnimationFrame:Rm,b2=typeof queueMicrotask=="function"?queueMicrotask:typeof Vy<"u"?function(t){return Vy.resolve(null).then(t).catch(x2)}:Rm;function x2(t){setTimeout(function(){throw t})}function gi(t){return t==="head"}function Gy(t,s){var i=s,l=0;do{var d=i.nextSibling;if(t.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"||i==="/&"){if(l===0){t.removeChild(d),Rl(s);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")Lm(t.ownerDocument.documentElement);else if(i==="head"){i=t.ownerDocument.head,Lm(i);for(var h=i.firstChild;h;){var x=h.nextSibling,w=h.nodeName;h[mo]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&h.rel.toLowerCase()==="stylesheet"||i.removeChild(h),h=x}}else i==="body"&&Lm(t.ownerDocument.body);i=d}while(i);Rl(s)}function Qy(t,s){var i=t;t=0;do{var l=i.nextSibling;if(i.nodeType===1?s?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(s?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(t===0)break;t--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||t++;i=l}while(i)}function Ky(t,s,i){if(s=CSS.escape(s)!==s?"r-"+btoa(s).replace(/=/g,""):s,t.style.viewTransitionName=s,i!=null&&(t.style.viewTransitionClass=i),i=getComputedStyle(t),i.display==="inline"){if(s=t.getClientRects(),s.length===1)var l=1;else for(var d=l=0;d<s.length;d++){var h=s[d];0<h.width&&0<h.height&&l++}l===1&&(t=t.style,t.display=s.length===1?"inline-block":"block",t.marginTop="-"+i.paddingTop,t.marginBottom="-"+i.paddingBottom)}}function Yy(t,s){t=t.style,s=s.style;var i=s!=null?s.hasOwnProperty("viewTransitionName")?s.viewTransitionName:s.hasOwnProperty("view-transition-name")?s["view-transition-name"]:null:null;t.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=s!=null?s.hasOwnProperty("viewTransitionClass")?s.viewTransitionClass:s.hasOwnProperty("view-transition-class")?s["view-transition-class"]:null:null,t.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),t.display==="inline-block"&&(s==null?t.display=t.margin="":(i=s.display,t.display=i==null||typeof i=="boolean"?"":i,i=s.margin,i!=null?t.margin=i:(i=s.hasOwnProperty("marginTop")?s.marginTop:s["margin-top"],t.marginTop=i==null||typeof i=="boolean"?"":i,s=s.hasOwnProperty("marginBottom")?s.marginBottom:s["margin-bottom"],t.marginBottom=s==null||typeof s=="boolean"?"":s)))}function y2(t,s,i){return i=i.ownerDocument.defaultView,{rect:t,abs:s.position==="absolute"||s.position==="fixed",clip:s.clipPath!=="none"||s.overflow!=="visible"||s.filter!=="none"||s.mask!=="none"||s.mask!=="none"||s.borderRadius!=="0px",view:0<=t.bottom&&0<=t.right&&t.top<=i.innerHeight&&t.left<=i.innerWidth}}function Tm(t){var s=t.getBoundingClientRect(),i=getComputedStyle(t);return y2(s,i,t)}function v2(t){return t.documentElement.clientHeight}function w2(t){this.addEventListener("load",t),this.addEventListener("error",t)}function _2(t,s,i,l,d,h,x,w,R){var P=s.nodeType===9?s:s.ownerDocument;try{var K=P.startViewTransition({update:function(){var U=P.defaultView,G=U.navigation&&U.navigation.transition,ge=P.fonts.status;l();var Ee=[];if(ge==="loaded"&&(v2(P),P.fonts.status==="loading"&&Ee.push(P.fonts.ready)),ge=Ee.length,t!==null)for(var Ve=t.suspenseyImages,L=0,D=0;D<Ve.length;D++){var V=Ve[D];if(!V.complete){var te=V.getBoundingClientRect();if(0<te.bottom&&0<te.right&&te.top<U.innerHeight&&te.left<U.innerWidth){if(L+=bv(V),L>ld){Ee.length=ge;break}V=new Promise(w2.bind(V)),Ee.push(V)}}}if(0<Ee.length)return U=Promise.race([Promise.all(Ee),new Promise(function(Ne){return setTimeout(Ne,500)})]).then(d,d),(G?Promise.allSettled([G.finished,U]):U).then(h,h);if(d(),G)return G.finished.then(h,h);h()},types:i});P.__reactViewTransition=K;var ne=[];return K.ready.then(function(){for(var U=P.documentElement.getAnimations({subtree:!0}),G=0;G<U.length;G++){var ge=U[G],Ee=ge.effect,Ve=Ee.pseudoElement;if(Ve!=null&&Ve.startsWith("::view-transition")){ne.push(ge),ge=Ee.getKeyframes();for(var L=Ve=void 0,D=!0,V=0;V<ge.length;V++){var te=ge[V],Ne=te.width;if(Ve===void 0)Ve=Ne;else if(Ve!==Ne){D=!1;break}if(Ne=te.height,L===void 0)L=Ne;else if(L!==Ne){D=!1;break}delete te.width,delete te.height,te.transform==="none"&&delete te.transform}D&&Ve!==void 0&&L!==void 0&&(Ee.setKeyframes(ge),D=getComputedStyle(Ee.target,Ee.pseudoElement),D.width!==Ve||D.height!==L)&&(D=ge[0],D.width=Ve,D.height=L,D=ge[ge.length-1],D.width=Ve,D.height=L,Ee.setKeyframes(ge))}}x()},function(U){P.__reactViewTransition===K&&(P.__reactViewTransition=null);try{if(typeof U=="object"&&U!==null)switch(U.name){case"InvalidStateError":(U.message==="View transition was skipped because document visibility state is hidden."||U.message==="Skipping view transition because document visibility state has become hidden."||U.message==="Skipping view transition because viewport size changed."||U.message==="Transition was aborted because of invalid state")&&(U=null)}U!==null&&R(U)}finally{l(),d(),x()}}),K.finished.finally(function(){for(var U=0;U<ne.length;U++)ne[U].cancel();P.__reactViewTransition===K&&(P.__reactViewTransition=null),w()}),K}catch{return l(),d(),x(),null}}function fa(t,s){this._scope=document.documentElement,this._selector="::view-transition-"+t+"("+s+")"}fa.prototype.animate=function(t,s){return s=typeof s=="number"?{duration:s}:Q({},s),s.pseudoElement=this._selector,this._scope.animate(t,s)},fa.prototype.getAnimations=function(){for(var t=this._scope,s=this._selector,i=t.getAnimations({subtree:!0}),l=[],d=0;d<i.length;d++){var h=i[d].effect;h!==null&&h.target===t&&h.pseudoElement===s&&l.push(i[d])}return l},fa.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Jy(t){return{name:t,group:new fa("group",t),imagePair:new fa("image-pair",t),old:new fa("old",t),new:new fa("new",t)}}function ls(t){this._fragmentFiber=t,this._observers=this._eventListeners=null}ls.prototype.addEventListener=function(t,s,i){var l=null,d=null;if(!(i!=null&&typeof i!="boolean"&&(l=i.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var h=this._eventListeners;if(Wy(h,t,s,i)===-1){var x=this,w=s;i!=null&&typeof i!="boolean"&&i.once===!0&&(w=function(R){x.removeEventListener(t,s,i),typeof s=="function"?s.call(this,R):s.handleEvent(R)}),l!==null&&(d=x.removeEventListener.bind(x,t,s,i),l.addEventListener("abort",d,{once:!0}),d=l.removeEventListener.bind(l,"abort",d)),l=Nl(i),h.push({type:t,listener:s,optionsOrUseCapture:i,attachedListener:w,cleanup:d}),b(this._fragmentFiber.child,!1,S2,t,w,l)}this._eventListeners=h}};function S2(t,s,i,l){return O(t).addEventListener(s,i,l),!1}ls.prototype.removeEventListener=function(t,s,i){var l=this._eventListeners;if(l!==null&&(s=Wy(l,t,s,i),s!==-1)){var d=l[s];i=d.attachedListener;var h=d.cleanup;d=Nl(d.optionsOrUseCapture),b(this._fragmentFiber.child,!1,N2,t,i,d),l.splice(s,1),h!==null&&h()}};function N2(t,s,i,l){return O(t).removeEventListener(s,i,l),!1}function Nl(t){return t!=null&&typeof t!="boolean"&&(t.once===!0||t.signal instanceof AbortSignal)?{capture:t.capture,passive:t.passive}:t}function Xy(t){return t==null?"c=0":typeof t=="boolean"?"c="+(t?"1":"0"):"c="+(t.capture?"1":"0")}function Wy(t,s,i,l){if(t.length===0)return-1;l=Xy(l);for(var d=0;d<t.length;d++){var h=t[d];if(h.type===s&&h.listener===i&&Xy(h.optionsOrUseCapture)===l)return d}return-1}ls.prototype.dispatchEvent=function(t){var s=v(this._fragmentFiber);if(s===null)return!0;s=O(s);var i=this._eventListeners;if(i!==null&&0<i.length||!t.bubbles){var l=s.nodeType===9?s.createComment(""):document.createTextNode("");if(i)for(var d=0;d<i.length;d++){var h=i[d];l.addEventListener(h.type,h.attachedListener,Nl(h.optionsOrUseCapture))}if(s.appendChild(l),t=l.dispatchEvent(t),i)for(d=0;d<i.length;d++)h=i[d],l.removeEventListener(h.type,h.attachedListener,Nl(h.optionsOrUseCapture));return s.removeChild(l),t}return s.dispatchEvent(t)},ls.prototype.focus=function(t){b(this._fragmentFiber.child,!0,ev,t,void 0,void 0)};function ev(t,s){return t.tag===6?!1:(t=O(t),U2(t,s))}ls.prototype.focusLast=function(t){var s=[];b(this._fragmentFiber.child,!0,km,s,void 0,void 0);for(var i=s.length-1;0<=i&&!ev(s[i],t);i--);};function km(t,s){return s.push(t),!1}ls.prototype.blur=function(){var t=v(this._fragmentFiber);t!==null&&(t=O(t),t=Yo(t).activeElement,t!==null&&b(this._fragmentFiber.child,!1,j2,t,void 0,void 0))};function j2(t,s){return t.tag===6?!1:(t=O(t),t===s||t.contains(s)?(s.blur(),!0):!1)}ls.prototype.observeUsing=function(t){this._observers===null&&(this._observers=new Set),this._observers.add(t),b(this._fragmentFiber.child,!1,E2,t,void 0,void 0)};function E2(t,s){return t.tag===6||(t=O(t),s.observe(t)),!1}ls.prototype.unobserveUsing=function(t){var s=this._observers;if(s!==null&&s.has(t)){s.delete(t),b(this._fragmentFiber.child,!1,A2,t,void 0,void 0);for(var i=s=0;i<Hs.length;i++){var l=Hs[i];l.fragmentInstance===this&&l.observer===t?t.unobserve(l.instance):Hs[s++]=l}Hs.length=s}};function A2(t,s){return t.tag===6||(t=O(t),s.unobserve(t)),!1}var Hs=[],Dm=!1;function C2(t,s,i){Hs.push({fragmentInstance:t,observer:s,instance:i}),Dm||(Dm=!0,I2(function(){Dm=!1;var l=Hs;Hs=[];for(var d=0;d<l.length;d++){var h=l[d];h.observer.unobserve(h.instance)}}))}ls.prototype.getClientRects=function(){var t=[];return b(this._fragmentFiber.child,!1,O2,t,void 0,void 0),t};function O2(t,s){if(t.tag===6){t=t.stateNode;var i=t.ownerDocument.createRange();i.selectNodeContents(t),s.push.apply(s,i.getClientRects())}else t=O(t),s.push.apply(s,t.getClientRects());return!1}ls.prototype.getRootNode=function(t){var s=v(this._fragmentFiber);return s===null?this:O(s).getRootNode(t)},ls.prototype.compareDocumentPosition=function(t){var s=v(this._fragmentFiber);if(s===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];b(this._fragmentFiber.child,!1,km,i,void 0,void 0);var l=O(s);if(i.length===0){if(i=l,S(this._fragmentFiber)){e:{for(s=this._fragmentFiber.return;s!==null;){if(s.tag===4){s=s.stateNode.containerInfo;break e}if(s.tag===3||s.tag===5||s.tag===27)break;s=s.return}s=null}s!=null&&(i=s)}s=this._fragmentFiber;var d=l=i.compareDocumentPosition(t);return i===t?d=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=A(s)[1],i===null?d=Node.DOCUMENT_POSITION_PRECEDING:(t=O(i).compareDocumentPosition(t),d=t===0||t&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),d|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}s=O(i[0]),d=O(i[i.length-1]);var h=S(this._fragmentFiber)?s.parentElement:l;if(h==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=h.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINED_BY,h=h.compareDocumentPosition(d)&Node.DOCUMENT_POSITION_CONTAINED_BY;var x=s.compareDocumentPosition(t),w=d.compareDocumentPosition(t),R=x&Node.DOCUMENT_POSITION_CONTAINED_BY||w&Node.DOCUMENT_POSITION_CONTAINED_BY;return w=l&&h&&x&Node.DOCUMENT_POSITION_FOLLOWING&&w&Node.DOCUMENT_POSITION_PRECEDING,s=l&&s===t||h&&d===t||R||w?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&s===t||!h&&d===t?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:x,s&Node.DOCUMENT_POSITION_DISCONNECTED||s&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||R2(s,this._fragmentFiber,i[0],i[i.length-1],t)?s:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function R2(t,s,i,l,d){var h=Vi(d);if(t&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!h)e:{for(;h!==null;){if(h.tag===7&&(h===s||h.alternate===s)){i=!0;break e}h=h.return}i=!1}return i}if(t&Node.DOCUMENT_POSITION_CONTAINS){if(h===null)return h=d.ownerDocument,d===h||d===h.documentElement||d===h.body;e:{for(h=s,s=v(s);h!==null;){if(!(h.tag!==5&&h.tag!==3&&h.tag!==27||h!==s&&h.alternate!==s)){h=!0;break e}h=h.return}h=!1}return h}return t&Node.DOCUMENT_POSITION_PRECEDING?((s=!!h)&&!(s=h===i)&&(s=re(i,h,B),s===null?s=!1:(b(s,!0,F,h,i),h=N,N=null,s=h!==null)),s):t&Node.DOCUMENT_POSITION_FOLLOWING?((s=!!h)&&!(s=h===l)&&(s=re(l,h,B),s===null?s=!1:(b(s,!0,q,h,l),h=N,j=N=null,s=h!==null)),s):!1}function tv(t,s){var i=t.ownerDocument.createRange();i.selectNodeContents(t),t=i.getBoundingClientRect(),window.scrollTo(window.scrollX+t.left,s?window.scrollY+t.top:window.scrollY+t.bottom-window.innerHeight)}ls.prototype.scrollIntoView=function(t){if(typeof t=="object")throw Error(a(566));var s=[];b(this._fragmentFiber.child,!1,km,s,void 0,void 0);var i=t!==!1;if(s.length===0){var l=A(this._fragmentFiber);if(l=i?l[1]||l[0]||v(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){t=O(l),tv(t,i);return}if(l=O(l),l.nodeType!==9){if(l.nodeType===11){i="host"in l?l.host:null,i!==null&&i.scrollIntoView(t);return}l.scrollIntoView(t)}}for(l=i?s.length-1:0;l!==(i?-1:s.length);){var d=s[l];d.tag===6?(d=O(d),tv(d,i)):O(d).scrollIntoView(t),l+=i?-1:1}};function T2(t,s){return t=O(t),nv(t,s),!1}function nv(t,s){t.reactFragments==null&&(t.reactFragments=new Set),t.reactFragments.add(s)}function sv(t,s){var i=s._eventListeners;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];t.addEventListener(d.type,d.attachedListener,Nl(d.optionsOrUseCapture))}t.nodeType!==3&&(i=s._observers,i!==null&&i.forEach(function(h){for(var x=0,w=0;w<Hs.length;w++){var R=Hs[w];(R.fragmentInstance!==s||R.observer!==h||R.instance!==t)&&(Hs[x++]=R)}Hs.length=x,h.observe(t)}),nv(t,s))}function k2(t,s){var i=s._eventListeners;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];t.removeEventListener(d.type,d.attachedListener,Nl(d.optionsOrUseCapture))}t.nodeType!==3&&(i=s._observers,i!==null&&i.forEach(function(h){typeof h.rootMargin=="string"?C2(s,h,t):h.unobserve(t)}),t.reactFragments!=null&&t.reactFragments.delete(s))}function Mm(t){var s=t.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var i=s;switch(s=s.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Mm(i),Kc(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}t.removeChild(i)}}function D2(t,s,i,l){for(;t.nodeType===1;){var d=i;if(t.nodeName.toLowerCase()!==s.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[mo])switch(s){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==d.rel||t.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||t.getAttribute("title")!==(d.title==null?null:d.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(d.src==null?null:d.src)||t.getAttribute("type")!==(d.type==null?null:d.type)||t.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(s==="input"&&t.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=js(t.nextSibling),t===null)break}return null}function M2(t,s,i){if(s==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=js(t.nextSibling),t===null))return null;return t}function rv(t,s){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=js(t.nextSibling),t===null))return null;return t}function zm(t){return t.data==="$?"||t.data==="$~"}function Um(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function z2(t,s){var i=t.ownerDocument;if(t.data==="$~")t._reactRetry=s;else if(t.data!=="$?"||i.readyState!=="loading")s();else{var l=function(){s(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function js(t){for(;t!=null;t=t.nextSibling){var s=t.nodeType;if(s===1||s===3)break;if(s===8){if(s=t.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return t}var Im=null;function iv(t){t=t.nextSibling;for(var s=0;t;){if(t.nodeType===8){var i=t.data;if(i==="/$"||i==="/&"){if(s===0)return js(t.nextSibling);s--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||s++}t=t.nextSibling}return null}function av(t){t=t.previousSibling;for(var s=0;t;){if(t.nodeType===8){var i=t.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(s===0)return t;s--}else i!=="/$"&&i!=="/&"||s++}t=t.previousSibling}return null}function U2(t,s){function i(){l=!0}if(t.ownerDocument.activeElement===t)return!0;var l=!1;try{t.ownerDocument.addEventListener("focus",i,!0),(t.focus||HTMLElement.prototype.focus).call(t,s)}finally{t.ownerDocument.removeEventListener("focus",i,!0)}return l}function I2(t){Zy(function(){Zy(function(s){return t(s)})})}function lv(t,s,i){switch(s=Yo(i),t){case"html":if(t=s.documentElement,!t)throw Error(a(452));return t;case"head":if(t=s.head,!t)throw Error(a(453));return t;case"body":if(t=s.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function ov(t,s,i){for(var l in i){var d=i[l];i.hasOwnProperty(l)&&d!=null&&pt(t,s,l,null,f2,d)}i.dangerouslySetInnerHTML!=null&&(t.textContent=""),t.onclick===tr&&(t.onclick=null),Kc(t)}function Lm(t){for(var s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Kc(t)}var Es=new Map,cv=new Set;function Jo(t){if(typeof t.getRootNode=="function"){var s=t.getRootNode();if(s.nodeType===9||s.nodeType===11)return s}return t.nodeType===9?t:t.ownerDocument}var Lr=je.d;je.d={f:L2,r:P2,D:H2,C:q2,L:B2,m:$2,X:V2,S:F2,M:Z2};function L2(){var t=Lr.f(),s=Xu();return t||s}function P2(t){var s=$a(t);s!==null&&s.tag===5&&s.type==="form"?dx(s):Lr.r(t)}var jl=typeof document>"u"?null:document;function uv(t,s,i){var l=jl;if(l&&typeof s=="string"&&s){var d=xs(s);d='link[rel="'+t+'"][href="'+d+'"]',typeof i=="string"&&(d+='[crossorigin="'+i+'"]'),cv.has(d)||(cv.add(d),t={rel:t,crossOrigin:i,href:s},l.querySelector(d)===null&&(s=l.createElement("link"),yn(s,"link",t),rn(s),l.head.appendChild(s)))}}function H2(t){Lr.D(t),uv("dns-prefetch",t,null)}function q2(t,s){Lr.C(t,s),uv("preconnect",t,s)}function B2(t,s,i){Lr.L(t,s,i);var l=jl;if(l&&t&&s){var d='link[rel="preload"][as="'+xs(s)+'"]';s==="image"&&i&&i.imageSrcSet?(d+='[imagesrcset="'+xs(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(d+='[imagesizes="'+xs(i.imageSizes)+'"]')):d+='[href="'+xs(t)+'"]';var h=d;switch(s){case"style":h=El(t);break;case"script":h=Al(t)}if(!(Es.has(h)||(t=Q({rel:"preload",href:s==="image"&&i&&i.imageSrcSet?void 0:t,as:s},i),Es.set(h,t),l.querySelector(d)!==null||s==="style"&&l.querySelector(Xo(h))||s==="script"&&l.querySelector(Wo(h))))){var x=l.createElement("link");yn(x,"link",t),s==="style"&&(x[Qc]=!0,x.onload=x.onerror=function(){Sg(x)}),rn(x),l.head.appendChild(x)}}}function $2(t,s){Lr.m(t,s);var i=jl;if(i&&t){var l=s&&typeof s.as=="string"?s.as:"script",d='link[rel="modulepreload"][as="'+xs(l)+'"][href="'+xs(t)+'"]',h=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Al(t)}if(!Es.has(h)&&(t=Q({rel:"modulepreload",href:t},s),Es.set(h,t),i.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Wo(h)))return}l=i.createElement("link"),yn(l,"link",t),rn(l),i.head.appendChild(l)}}}function F2(t,s,i){Lr.S(t,s,i);var l=jl;if(l&&t){var d=Fa(l).hoistableStyles,h=El(t);s=s||"default";var x=d.get(h);if(!x){var w={loading:0,preload:null};if(x=l.querySelector(Xo(h)))w.loading=5;else{t=Q({rel:"stylesheet",href:t,"data-precedence":s},i),(i=Es.get(h))&&Pm(t,i);var R=x=l.createElement("link");rn(R),yn(R,"link",t),R._p=new Promise(function(P,K){R.onload=P,R.onerror=K}),R.addEventListener("load",function(){w.loading|=1}),R.addEventListener("error",function(){w.loading|=2}),w.loading|=4,id(x,s,l)}x={type:"stylesheet",instance:x,count:1,state:w},d.set(h,x)}}}function V2(t,s){Lr.X(t,s);var i=jl;if(i&&t){var l=Fa(i).hoistableScripts,d=Al(t),h=l.get(d);h||(h=i.querySelector(Wo(d)),h||(t=Q({src:t,async:!0},s),(s=Es.get(d))&&Hm(t,s),h=i.createElement("script"),rn(h),yn(h,"link",t),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function Z2(t,s){Lr.M(t,s);var i=jl;if(i&&t){var l=Fa(i).hoistableScripts,d=Al(t),h=l.get(d);h||(h=i.querySelector(Wo(d)),h||(t=Q({src:t,async:!0,type:"module"},s),(s=Es.get(d))&&Hm(t,s),h=i.createElement("script"),rn(h),yn(h,"link",t),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},l.set(d,h))}}function dv(t,s,i,l){var d=(d=rt.current)?Jo(d):null;if(!d)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=El(i.href),s=Fa(d).hoistableStyles,l=s.get(i),l||(l={type:"style",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=El(i.href);var h=Fa(d).hoistableStyles,x=h.get(t);if(x||(d=d.ownerDocument||d,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,x),(h=d.querySelector(Xo(t)))?h._p||(x.instance=h,x.state.loading=5):(h=Es.get(t),h||(h={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Es.set(t,h)),G2(d,t,h,x.state))),s&&l===null)throw Error(a(528,""));return x}if(s&&l!==null)throw Error(a(529,""));return null;case"script":return s=i.async,i=i.src,typeof i=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(i=Al(i),s=Fa(d).hoistableScripts,l=s.get(i),l||(l={type:"script",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function El(t){return'href="'+xs(t)+'"'}function Xo(t){return'link[rel="stylesheet"]['+t+"]"}function fv(t){return Q({},t,{"data-precedence":t.precedence,precedence:null})}function G2(t,s,i,l){if(s=t.querySelector('link[rel="preload"][as="style"]['+s+"]")){if(s[Qc]!==!0){l.loading=1;return}}else s=t.createElement("link"),s[Qc]=!0,s.onload=s.onerror=Sg.bind(null,s),yn(s,"link",i),rn(s),t.head.appendChild(s);l.preload=s,s.addEventListener("load",function(){return l.loading|=1}),s.addEventListener("error",function(){return l.loading|=2})}function Al(t){return'[src="'+xs(t)+'"]'}function Wo(t){return"script[async]"+t}function hv(t,s,i){if(s.count++,s.instance===null)switch(s.type){case"style":var l=t.querySelector('style[data-href~="'+xs(i.href)+'"]');if(l)return s.instance=l,rn(l),l;var d=Q({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),rn(l),yn(l,"style",d),id(l,i.precedence,t),s.instance=l;case"stylesheet":d=El(i.href);var h=t.querySelector(Xo(d));if(h)return s.state.loading|=4,s.instance=h,rn(h),h;l=fv(i),(d=Es.get(d))&&Pm(l,d),h=(t.ownerDocument||t).createElement("link"),rn(h);var x=h;return x._p=new Promise(function(w,R){x.onload=w,x.onerror=R}),yn(h,"link",l),s.state.loading|=4,id(h,i.precedence,t),s.instance=h;case"script":return h=Al(i.src),(d=t.querySelector(Wo(h)))?(s.instance=d,rn(d),d):(l=i,(d=Es.get(h))&&(l=Q({},i),Hm(l,d)),t=t.ownerDocument||t,d=t.createElement("script"),rn(d),yn(d,"link",l),t.head.appendChild(d),s.instance=d);case"void":return null;default:throw Error(a(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(l=s.instance,s.state.loading|=4,id(l,i.precedence,t));return s.instance}function id(t,s,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,h=d,x=0;x<l.length;x++){var w=l[x];if(w.dataset.precedence===s)h=w;else if(h!==d)break}h?h.parentNode.insertBefore(t,h.nextSibling):(s=i.nodeType===9?i.head:i,s.insertBefore(t,s.firstChild))}function Pm(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.title==null&&(t.title=s.title)}function Hm(t,s){t.crossOrigin==null&&(t.crossOrigin=s.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=s.referrerPolicy),t.integrity==null&&(t.integrity=s.integrity)}var ad=null;function mv(t,s,i){if(ad===null){var l=new Map,d=ad=new Map;d.set(i,l)}else d=ad,l=d.get(i),l||(l=new Map,d.set(i,l));if(l.has(t))return l;for(l.set(t,null),i=i.getElementsByTagName(t),d=0;d<i.length;d++){var h=i[d];if(!(h[mo]||h[mn]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var x=h.getAttribute(s)||"";x=t+x;var w=l.get(x);w?w.push(h):l.set(x,[h])}}return l}function qm(t,s,i){t=t.ownerDocument||t,t.head.insertBefore(i,s==="title"?t.querySelector("head > title"):null)}function Q2(t,s,i){if(i===1||s.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return t=s.disabled,typeof s.precedence=="string"&&t==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function pv(t,s){return t==="img"&&s.src!=null&&s.src!==""&&s.onLoad==null&&s.loading!=="lazy"}function gv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function bv(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function xv(t,s){typeof s.decode=="function"&&(t.imgCount++,s.complete||(t.imgBytes+=bv(s),t.suspenseyImages.push(s)),t=J2.bind(t),s.decode().then(t,t))}function K2(t,s,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var d=El(l.href),h=s.querySelector(Xo(d));if(h){s=h._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(t.count++,t=ec.bind(t),s.then(t,t)),i.state.loading|=4,i.instance=h,rn(h);return}h=s.ownerDocument||s,l=fv(l),(d=Es.get(d))&&Pm(l,d),h=h.createElement("link"),rn(h);var x=h;x._p=new Promise(function(w,R){x.onload=w,x.onerror=R}),yn(h,"link",l),i.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,s),(s=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=ec.bind(t),s.addEventListener("load",i),s.addEventListener("error",i))}}var ld=0;function Y2(t,s){return t.stylesheets&&t.count===0&&cd(t,t.stylesheets),0<t.count||0<t.imgCount?function(i){var l=setTimeout(function(){if(t.stylesheets&&cd(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+s);0<t.imgBytes&&ld===0&&(ld=62500*m2());var d=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&cd(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>ld?50:800)+s);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function yv(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)cd(t,t.stylesheets);else if(t.unsuspend){var s=t.unsuspend;t.unsuspend=null,s()}}}function ec(){this.count--,yv(this)}function J2(){this.imgCount--,yv(this)}var od=null;function cd(t,s){t.stylesheets=null,t.unsuspend!==null&&(t.count++,od=new Map,s.forEach(X2,t),od=null,ec.call(t))}function X2(t,s){if(!(s.state.loading&4)){var i=od.get(t);if(i)var l=i.get(null);else{i=new Map,od.set(t,i);for(var d=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var x=d[h];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(i.set(x.dataset.precedence,x),l=x)}l&&i.set(null,l)}d=s.instance,x=d.getAttribute("data-precedence"),h=i.get(x)||l,h===l&&i.set(null,d),i.set(x,d),this.count++,l=ec.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),h?h.parentNode.insertBefore(d,h.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(d,t.firstChild)),s.state.loading|=4}}var Cl={$$typeof:oe,Provider:null,Consumer:null,_currentValue:at,_currentValue2:at,_threadCount:0};function W2(t,s,i,l,d,h,x,w,R){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wf(0),this.hiddenUpdates=wf(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.transitionTypes=null,this.incompleteTransitions=new Map}function vv(t,s,i,l,d,h,x,w,R,P,K,ne){return t=new W2(t,s,i,x,R,P,K,ne,w),s=1,h===!0&&(s|=24),h=Fn(3,null,null,s),t.current=h,h.stateNode=t,s=nh(),s.refCount++,t.pooledCache=s,s.refCount++,h.memoizedState={element:l,isDehydrated:i,cache:s},ah(h),t}function wv(t){return t?(t=el,t):el}function _v(t,s,i,l,d,h){d=wv(d),l.context===null?l.context=d:l.pendingContext=d,l=ri(s),l.payload={element:i},h=h===void 0?null:h,h!==null&&(l.callback=h),i=ii(t,l,s),i!==null&&(Qn(i,t,s),To(i,t,s))}function Sv(t,s){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var i=t.retryLane;t.retryLane=i!==0&&i<s?i:s}}function Bm(t,s){Sv(t,s),(t=t.alternate)&&Sv(t,s)}function Nv(t){if(t.tag===13||t.tag===31){var s=Ki(t,67108864);s!==null&&Qn(s,t,67108864),Bm(t,67108864)}}function jv(t){if(t.tag===13||t.tag===31){var s=as();s=_f(s);var i=Ki(t,s);i!==null&&Qn(i,t,s),Bm(t,s)}}var Ol=!0;function eE(t,s,i,l){var d=_e.T;_e.T=null;var h=je.p;try{je.p=2,$m(t,s,i,l)}finally{je.p=h,_e.T=d}}function tE(t,s,i,l){var d=_e.T;_e.T=null;var h=je.p;try{je.p=8,$m(t,s,i,l)}finally{je.p=h,_e.T=d}}function $m(t,s,i,l){if(Ol){var d=Fm(l);if(d===null)Nm(t,s,l,ud,i),Av(t,l);else if(sE(d,t,s,i,l))l.stopPropagation();else if(Av(t,l),s&4&&-1<nE.indexOf(t)){for(;d!==null;){var h=$a(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var x=Fi(h.pendingLanes);if(x!==0){var w=h;for(w.pendingLanes|=2,w.entangledLanes|=2;x;){var R=1<<31-Wn(x);w.entanglements[1]|=R,x&=~R}dr(h),(lt&6)===0&&(Ku=me()+500,Go(0))}}break;case 31:case 13:w=Ki(h,2),w!==null&&Qn(w,h,2),Xu(),Bm(h,2)}if(h=Fm(l),h===null&&Nm(t,s,l,ud,i),h===d)break;d=h}d!==null&&l.stopPropagation()}else Nm(t,s,l,null,i)}}function Fm(t){return t=Of(t),Vm(t)}var ud=null;function Vm(t){if(ud=null,t=Vi(t),t!==null){var s=u(t);if(s===null)t=null;else{var i=s.tag;if(i===13){if(t=f(s),t!==null)return t;t=null}else if(i===31){if(t=m(s),t!==null)return t;t=null}else if(i===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;t=null}else s!==t&&(t=null)}}return ud=t,null}function Ev(t){switch(t){case"beforetoggle":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"seeked":case"submit":case"toggle":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"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(xe()){case Te:return 2;case Ue:return 8;case vt:case Rn:return 32;case Bn:return 268435456;default:return 32}default:return 32}}var Zm=!1,bi=null,xi=null,yi=null,tc=new Map,nc=new Map,vi=[],nE="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".split(" ");function Av(t,s){switch(t){case"focusin":case"focusout":bi=null;break;case"dragenter":case"dragleave":xi=null;break;case"mouseover":case"mouseout":yi=null;break;case"pointerover":case"pointerout":tc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":nc.delete(s.pointerId)}}function sc(t,s,i,l,d,h){return t===null||t.nativeEvent!==h?(t={blockedOn:s,domEventName:i,eventSystemFlags:l,nativeEvent:h,targetContainers:[d]},s!==null&&(s=$a(s),s!==null&&Nv(s)),t):(t.eventSystemFlags|=l,s=t.targetContainers,d!==null&&s.indexOf(d)===-1&&s.push(d),t)}function sE(t,s,i,l,d){switch(s){case"focusin":return bi=sc(bi,t,s,i,l,d),!0;case"dragenter":return xi=sc(xi,t,s,i,l,d),!0;case"mouseover":return yi=sc(yi,t,s,i,l,d),!0;case"pointerover":var h=d.pointerId;return tc.set(h,sc(tc.get(h)||null,t,s,i,l,d)),!0;case"gotpointercapture":return h=d.pointerId,nc.set(h,sc(nc.get(h)||null,t,s,i,l,d)),!0}return!1}function Cv(t){var s=Vi(t.target);if(s!==null){var i=u(s);if(i!==null){if(s=i.tag,s===13){if(s=f(i),s!==null){t.blockedOn=s,vg(t.priority,function(){jv(i)});return}}else if(s===31){if(s=m(i),s!==null){t.blockedOn=s,vg(t.priority,function(){jv(i)});return}}else if(s===3&&i.stateNode.current.memoizedState.isDehydrated){t.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}t.blockedOn=null}function dd(t){if(t.blockedOn!==null)return!1;for(var s=t.targetContainers;0<s.length;){var i=Fm(t.nativeEvent);if(i===null){i=t.nativeEvent;var l=new i.constructor(i.type,i);Cf=l,i.target.dispatchEvent(l),Cf=null}else return s=$a(i),s!==null&&Nv(s),t.blockedOn=i,!1;s.shift()}return!0}function Ov(t,s,i){dd(t)&&i.delete(s)}function rE(){Zm=!1,bi!==null&&dd(bi)&&(bi=null),xi!==null&&dd(xi)&&(xi=null),yi!==null&&dd(yi)&&(yi=null),tc.forEach(Ov),nc.forEach(Ov)}function fd(t,s){t.blockedOn===s&&(t.blockedOn=null,Zm||(Zm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,rE)))}var hd=null;function Rv(t){hd!==t&&(hd=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){hd===t&&(hd=null);for(var s=0;s<t.length;s+=3){var i=t[s],l=t[s+1],d=t[s+2];if(typeof l!="function"){if(Vm(l||i)===null)continue;break}var h=$a(i);h!==null&&(t.splice(s,3),s-=3,Ah(h,{pending:!0,data:d,method:i.method,action:l},l,d))}}))}function Rl(t){function s(R){return fd(R,t)}bi!==null&&fd(bi,t),xi!==null&&fd(xi,t),yi!==null&&fd(yi,t),tc.forEach(s),nc.forEach(s);for(var i=0;i<vi.length;i++){var l=vi[i];l.blockedOn===t&&(l.blockedOn=null)}for(;0<vi.length&&(i=vi[0],i.blockedOn===null);)Cv(i),i.blockedOn===null&&vi.shift();if(i=(t.ownerDocument||t).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var d=i[l],h=i[l+1],x=d[$n]||null;if(typeof h=="function")x||Rv(i);else if(x){var w=null;if(h&&h.hasAttribute("formAction")){if(d=h,x=h[$n]||null)w=x.formAction;else if(Vm(d)!==null)continue}else w=x.action;typeof w=="function"?i[l+1]=w:(i.splice(l,3),l-=3),Rv(i)}}}function Tv(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(x){return d=x})},focusReset:"manual",scroll:"manual"})}function s(){d!==null&&(d(),d=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),d!==null&&(d(),d=null)}}}function Gm(t){this._internalRoot=t}md.prototype.render=Gm.prototype.render=function(t){var s=this._internalRoot;if(s===null)throw Error(a(409));var i=s.current,l=as();_v(i,l,t,s,null,null)},md.prototype.unmount=Gm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var s=t.containerInfo;_v(t.current,2,null,t,null,null),Xu(),s[Ba]=null}};function md(t){this._internalRoot=t}md.prototype.unstable_scheduleHydration=function(t){if(t){var s=yg();t={blockedOn:null,target:t,priority:s};for(var i=0;i<vi.length&&s!==0&&s<vi[i].priority;i++);vi.splice(i,0,t),i===0&&Cv(t)}};var kv=n.version;if(kv!=="19.3.0")throw Error(a(527,kv,"19.3.0"));je.findDOMNode=function(t){var s=t._reactInternals;if(s===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=y(s),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var iE={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:_e,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pd.isDisabled&&pd.supportsFiber)try{Ds=pd.inject(iE),Tn=pd}catch{}}return ic.createRoot=function(t,s){if(!o(t))throw Error(a(299));var i=!1,l="",d=wx,h=_x,x=Sx;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(l=s.identifierPrefix),s.onUncaughtError!==void 0&&(d=s.onUncaughtError),s.onCaughtError!==void 0&&(h=s.onCaughtError),s.onRecoverableError!==void 0&&(x=s.onRecoverableError)),s=vv(t,1,!1,null,null,i,l,null,d,h,x,Tv),t[Ba]=s.current,Sm(t),new Gm(s)},ic.hydrateRoot=function(t,s,i){if(!o(t))throw Error(a(299));var l=!1,d="",h=wx,x=_x,w=Sx,R=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError),i.formState!==void 0&&(R=i.formState)),s=vv(t,1,!0,s,i??null,l,d,R,h,x,w,Tv),s.context=wv(null),i=s.current,l=as(),l=_f(l),d=ri(l),d.callback=null,ii(i,d,l),i=l,s.current.lanes=i,ho(s,i),dr(s),t[Ba]=s.current,Sm(t),new md(s)},ic.version="19.3.0",ic}var $v;function gE(){if($v)return Jm.exports;$v=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Jm.exports=pE(),Jm.exports}var bE=gE();/**
* react-router v7.18.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
*/var vp=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,l_=/^[\\/]{2}/;function xE(e,n){return n+e.replace(/\\/g,"/")}var Fv="popstate";function Vv(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function yE(e={}){function n(a,o){var y;let u=(y=o.state)==null?void 0:y.masked,{pathname:f,search:m,hash:p}=u||a.location;return R0("",{pathname:f,search:m,hash:p},o.state&&o.state.usr||null,o.state&&o.state.key||"default",u?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,o){return typeof o=="string"?o:Ta(o)}return wE(n,r,null,e)}function Ot(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Js(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function vE(){return Math.random().toString(36).substring(2,10)}function Zv(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function R0(e,n,r=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?no(n):n,state:r,key:n&&n.key||a||vE(),mask:o}}function Ta({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function no(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(n.search=e.substring(a),e=e.substring(0,a)),e&&(n.pathname=e)}return n}function wE(e,n,r,a={}){let{window:o=document.defaultView,v5Compat:u=!1}=a,f=o.history,m="POP",p=null,y=g();y==null&&(y=0,f.replaceState({...f.state,idx:y},""));function g(){return(f.state||{idx:null}).idx}function b(){m="POP";let O=g(),N=O==null?null:O-y;y=O,p&&p({action:m,location:C.location,delta:N})}function v(O,N){m="PUSH";let j=Vv(O)?O:R0(C.location,O,N);y=g()+1;let F=Zv(j,y),q=C.createHref(j.mask||j);try{f.pushState(F,"",q)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;o.location.assign(q)}u&&p&&p({action:m,location:C.location,delta:1})}function S(O,N){m="REPLACE";let j=Vv(O)?O:R0(C.location,O,N);y=g();let F=Zv(j,y),q=C.createHref(j.mask||j);f.replaceState(F,"",q),u&&p&&p({action:m,location:C.location,delta:0})}function A(O){return _E(o,O)}let C={get action(){return m},get location(){return e(o,f)},listen(O){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(Fv,b),p=O,()=>{o.removeEventListener(Fv,b),p=null}},createHref(O){return n(o,O)},createURL:A,encodeLocation(O){let N=A(O);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:v,replace:S,go(O){return f.go(O)}};return C}function _E(e,n,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),Ot(a,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:Ta(n);return o=o.replace(/ $/,"%20"),!r&&l_.test(o)&&(o=a+o),new URL(o,a)}function o_(e,n,r="/"){return SE(e,n,r,!1)}function SE(e,n,r,a,o){let u=typeof n=="string"?no(n):n,f=Zr(u.pathname||"/",r);if(f==null)return null;let m=NE(e),p=null,y=zE(f);for(let g=0;p==null&&g<m.length;++g)p=ME(m[g],y,a);return p}function NE(e){let n=c_(e);return jE(n),n}function c_(e,n=[],r=[],a="",o=!1){let u=(f,m,p=o,y)=>{let g={relativePath:y===void 0?f.path||"":y,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&p)return;Ot(g.relativePath.startsWith(a),`Absolute route path "${g.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(a.length)}let b=Ys([a,g.relativePath]),v=r.concat(g);f.children&&f.children.length>0&&(Ot(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),c_(f.children,n,v,b,p)),!(f.path==null&&!f.index)&&n.push({path:b,score:kE(b,f.index),routesMeta:v.map((S,A)=>{let[C,O]=f_(S.relativePath,S.caseSensitive,A===v.length-1);return{...S,matcher:C,compiledParams:O}})})};return e.forEach((f,m)=>{var p;if(f.path===""||!((p=f.path)!=null&&p.includes("?")))u(f,m);else for(let y of u_(f.path))u(f,m,!0,y)}),n}function u_(e){let n=e.split("/");if(n.length===0)return[];let[r,...a]=n,o=r.endsWith("?"),u=r.replace(/\?$/,"");if(a.length===0)return o?[u,""]:[u];let f=u_(a.join("/")),m=[];return m.push(...f.map(p=>p===""?u:[u,p].join("/"))),o&&m.push(...f),m.map(p=>e.startsWith("/")&&p===""?"/":p)}function jE(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:DE(n.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var EE=/^:[\w-]+$/,AE=3,CE=2,OE=1,RE=10,TE=-2,Gv=e=>e==="*";function kE(e,n){let r=e.split("/"),a=r.length;return r.some(Gv)&&(a+=TE),n&&(a+=CE),r.filter(o=>!Gv(o)).reduce((o,u)=>o+(EE.test(u)?AE:u===""?OE:RE),a)}function DE(e,n){return e.length===n.length&&e.slice(0,-1).every((a,o)=>a===n[o])?e[e.length-1]-n[n.length-1]:0}function ME(e,n,r=!1){let{routesMeta:a}=e,o={},u="/",f=[];for(let m=0;m<a.length;++m){let p=a[m],y=m===a.length-1,g=u==="/"?n:n.slice(u.length)||"/",b={path:p.relativePath,caseSensitive:p.caseSensitive,end:y},v=p.matcher&&p.compiledParams?d_(b,g,p.matcher,p.compiledParams):$d(b,g),S=p.route;if(!v&&y&&r&&!a[a.length-1].route.index&&(v=$d({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},g)),!v)return null;Object.assign(o,v.params),f.push({params:o,pathname:Ys([u,v.pathname]),pathnameBase:LE(Ys([u,v.pathnameBase])),route:S}),v.pathnameBase!=="/"&&(u=Ys([u,v.pathnameBase]))}return f}function $d(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=f_(e.path,e.caseSensitive,e.end);return d_(e,n,r,a)}function d_(e,n,r,a){let o=n.match(r);if(!o)return null;let u=o[0],f=Kl(u,1),m=o.slice(1);return{params:a.reduce((y,{paramName:g,isOptional:b},v)=>{if(g==="*"){let A=m[v]||"";f=Kl(u.slice(0,u.length-A.length),1)}const S=m[v];return b&&!S?y[g]=void 0:y[g]=(S||"").replace(/%2F/g,"/"),y},{}),pathname:u,pathnameBase:f,pattern:e}}function f_(e,n=!1,r=!0){Js(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,p,y,g)=>{if(a.push({paramName:m,isOptional:p!=null}),p){let b=g.charAt(y+f.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),a]}function zE(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Js(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function Zr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function UE(e,n="/"){let{pathname:r,search:a="",hash:o=""}=typeof e=="string"?no(e):e,u;return r?(r=h_(r),r.startsWith("/")||r.startsWith("\\")?u=Qv(r.substring(1),"/"):u=Qv(r,n)):u=n,{pathname:u,search:PE(a),hash:HE(o)}}function Qv(e,n){let r=Kl(n).split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function t0(e,n,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function IE(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function wp(e){let n=IE(e);return n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase)}function nf(e,n,r,a=!1){let o;typeof e=="string"?o=no(e):(o={...e},Ot(!o.pathname||!o.pathname.includes("?"),t0("?","pathname","search",o)),Ot(!o.pathname||!o.pathname.includes("#"),t0("#","pathname","hash",o)),Ot(!o.search||!o.search.includes("#"),t0("#","search","hash",o)));let u=e===""||o.pathname==="",f=u?"/":o.pathname,m;if(f==null)m=r;else{let b=n.length-1;if(!a&&f.startsWith("..")){let v=f.split("/");for(;v[0]==="..";)v.shift(),b-=1;o.pathname=v.join("/")}m=b>=0?n[b]:"/"}let p=UE(o,m),y=f&&f!=="/"&&f.endsWith("/"),g=(u||f===".")&&r.endsWith("/");return!p.pathname.endsWith("/")&&(y||g)&&(p.pathname+="/"),p}var h_=e=>e.replace(/[\\/]{2,}/g,"/"),Ys=e=>h_(e.join("/"));function Kl(e,n=0){let r=e.length;for(;r>n&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var LE=e=>Kl(e).replace(/^\/*/,"/"),PE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,HE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,qE=class{constructor(e,n,r,a=!1){this.status=e,this.statusText=n||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function BE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function $E(e){let n=e.map(r=>r.route.path).filter(Boolean);return Ys(n)||"/"}var m_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function p_(e,n){let r=e;if(typeof r!="string"||!vp.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,o=!1;if(m_)try{let u=new URL(window.location.href),f=l_.test(r)?new URL(xE(r,u.protocol)):new URL(r),m=Zr(f.pathname,n);f.origin===u.origin&&m!=null?r=m+f.search+f.hash:o=!0}catch{Js(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Kv=new URL("http://localhost");function _p(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),Kv)}catch{return Kv}}function n0(e,n){return e.origin===n.origin&&(e.origin!=="null"||e.protocol===n.protocol&&e.host===n.host)}function FE(e,n){if(e.startsWith("//"))return!0;let r=n.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?n.host===""||e.slice(r.length).startsWith("//"):!1}function Sp(e,n,r,a){let o=null;try{o=e==null?null:new URL(e,r)}catch{}let u=new URL(n,r),f=o!=null&&!n0(o,r),m=!n0(u,r);if(a==="reject"){if(f||m)throw new Error("External navigation is not allowed")}else if(m&&(o==null||!FE(e,o)||!n0(o,u)))throw new Error("External navigation is not allowed")}var g_=["POST","PUT","PATCH","DELETE"];new Set(g_);var VE=["GET",...g_];new Set(VE);var ZE=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function GE(e){try{return ZE.includes(new URL(e).protocol)}catch{return!1}}var so=T.createContext(null);so.displayName="DataRouter";var sf=T.createContext(null);sf.displayName="DataRouterState";var b_=T.createContext(!1);function QE(){return T.useContext(b_)}var x_=T.createContext({isTransitioning:!1});x_.displayName="ViewTransition";var KE=T.createContext(new Map);KE.displayName="Fetchers";var YE=T.createContext(null);YE.displayName="Await";var gs=T.createContext(null);gs.displayName="Navigation";var Mc=T.createContext(null);Mc.displayName="Location";var Xs=T.createContext({outlet:null,matches:[],isDataRoute:!1});Xs.displayName="Route";var Np=T.createContext(null);Np.displayName="RouteError";var y_="REACT_ROUTER_ERROR",JE="REDIRECT",XE="ROUTE_ERROR_RESPONSE";function WE(e){if(e.startsWith(`${y_}:${JE}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function e4(e){if(e.startsWith(`${y_}:${XE}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new qE(n.status,n.statusText,n.data)}catch{}}function t4(e,{relative:n}={}){Ot(ro(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=T.useContext(gs),{hash:o,pathname:u,search:f}=zc(e,{relative:n}),m=u;return r!=="/"&&(m=u==="/"?r:Ys([r,u])),a.createHref({pathname:m,search:f,hash:o})}function ro(){return T.useContext(Mc)!=null}function Ws(){return Ot(ro(),"useLocation() may be used only in the context of a <Router> component."),T.useContext(Mc).location}var v_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function w_(e){T.useContext(gs).static||T.useLayoutEffect(e)}function rf(){let{isDataRoute:e}=T.useContext(Xs);return e?g4():n4()}function n4(){Ot(ro(),"useNavigate() may be used only in the context of a <Router> component.");let e=T.useContext(so),{basename:n,navigator:r}=T.useContext(gs),{matches:a}=T.useContext(Xs),{pathname:o}=Ws(),u=JSON.stringify(wp(a)),f=T.useRef(!1);return w_(()=>{f.current=!0}),T.useCallback((p,y={})=>{if(Js(f.current,v_),!f.current)return;if(typeof p=="number"){r.go(p);return}let g=nf(p,JSON.parse(u),o,y.relative==="path");e==null&&n!=="/"&&(g.pathname=g.pathname==="/"?n:Ys([n,g.pathname])),Sp(typeof p=="string"?p:Ta(p),r.createHref(g),_p(r),"reject"),(y.replace?r.replace:r.push)(g,y.state,y)},[n,r,u,o,e])}var s4=T.createContext(null);function r4(e){let n=T.useContext(Xs).outlet;return T.useMemo(()=>n&&T.createElement(s4.Provider,{value:e},n),[n,e])}function zc(e,{relative:n}={}){let{matches:r}=T.useContext(Xs),{pathname:a}=Ws(),o=JSON.stringify(wp(r));return T.useMemo(()=>nf(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function i4(e,n){return __(e,n)}function __(e,n,r){var O;Ot(ro(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=T.useContext(gs),{matches:o}=T.useContext(Xs),u=o[o.length-1],f=u?u.params:{},m=u?u.pathname:"/",p=u?u.pathnameBase:"/",y=u&&u.route;{let N=y&&y.path||"";N_(m,!y||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let g=Ws(),b;if(n){let N=typeof n=="string"?no(n):n;Ot(p==="/"||((O=N.pathname)==null?void 0:O.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${N.pathname}" was given in the \`location\` prop.`),b=N}else b=g;let v=b.pathname||"/",S=v;if(p!=="/"){let N=p.replace(/^\//,"").split("/");S="/"+v.replace(/^\//,"").split("/").slice(N.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(N=>Object.assign(N,{route:r.manifest[N.route.id]||N.route})):o_(e,{pathname:S});Js(y||A!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Js(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=u4(A&&A.map(N=>Object.assign({},N,{params:Object.assign({},f,N.params),pathname:Ys([p,a.encodeLocation?a.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?p:Ys([p,a.encodeLocation?a.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),o,r);return n&&C?T.createElement(Mc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...b},navigationType:"POP"}},C):C}function a4(){let e=p4(),n=BE(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},u={padding:"2px 4px",backgroundColor:a},f=null;return console.error("Error handled by React Router default ErrorBoundary:",e),f=T.createElement(T.Fragment,null,T.createElement("p",null,"💿 Hey developer 👋"),T.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",T.createElement("code",{style:u},"ErrorBoundary")," or"," ",T.createElement("code",{style:u},"errorElement")," prop on your route.")),T.createElement(T.Fragment,null,T.createElement("h2",null,"Unexpected Application Error!"),T.createElement("h3",{style:{fontStyle:"italic"}},n),r?T.createElement("pre",{style:o},r):null,f)}var l4=T.createElement(a4,null),S_=class extends T.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=e4(e.digest);r&&(e=r)}let n=e!==void 0?T.createElement(Xs.Provider,{value:this.props.routeContext},T.createElement(Np.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?T.createElement(o4,{error:e},n):n}};S_.contextType=b_;var s0=new WeakMap;function o4({children:e,error:n}){let{basename:r,navigator:a}=T.useContext(gs);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=WE(n.digest);if(o){let u=s0.get(n);if(u)throw u;let f=p_(o.location,r),m=f.absoluteURL||f.to;if(Sp(o.location,m,_p(a),"allow-explicit"),GE(m))throw new Error("Invalid redirect location");if(m_&&!s0.get(n))if(f.isExternal||o.reloadDocument)window.location.href=m;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:o.replace}));throw s0.set(n,p),p}return T.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m}`})}}return e}function c4({routeContext:e,match:n,children:r}){let a=T.useContext(so);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),T.createElement(Xs.Provider,{value:e},r)}function u4(e,n=[],r){let a=r==null?void 0:r.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(n.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let o=e,u=a==null?void 0:a.errors;if(u!=null){let g=o.findIndex(b=>b.route.id&&(u==null?void 0:u[b.route.id])!==void 0);Ot(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),o=o.slice(0,Math.min(o.length,g+1))}let f=!1,m=-1;if(r&&a){f=a.renderFallback;for(let g=0;g<o.length;g++){let b=o[g];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(m=g),b.route.id){let{loaderData:v,errors:S}=a,A=b.route.loader&&!v.hasOwnProperty(b.route.id)&&(!S||S[b.route.id]===void 0);if(b.route.lazy||A){r.isStatic&&(f=!0),m>=0?o=o.slice(0,m+1):o=[o[0]];break}}}}let p=r==null?void 0:r.onError,y=a&&p?(g,b)=>{var v,S;p(g,{location:a.location,params:((S=(v=a.matches)==null?void 0:v[0])==null?void 0:S.params)??{},pattern:$E(a.matches),errorInfo:b})}:void 0;return o.reduceRight((g,b,v)=>{let S,A=!1,C=null,O=null;a&&(S=u&&b.route.id?u[b.route.id]:void 0,C=b.route.errorElement||l4,f&&(m<0&&v===0?(N_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,O=null):m===v&&(A=!0,O=b.route.hydrateFallbackElement||null)));let N=n.concat(o.slice(0,v+1)),j=()=>{let F;return S?F=C:A?F=O:b.route.Component?F=T.createElement(b.route.Component,null):b.route.element?F=b.route.element:F=g,T.createElement(c4,{match:b,routeContext:{outlet:g,matches:N,isDataRoute:a!=null},children:F})};return a&&(b.route.ErrorBoundary||b.route.errorElement||v===0)?T.createElement(S_,{location:a.location,revalidation:a.revalidation,component:C,error:S,children:j(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:y}):j()},null)}function jp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function d4(e){let n=T.useContext(so);return Ot(n,jp(e)),n}function f4(e){let n=T.useContext(sf);return Ot(n,jp(e)),n}function h4(e){let n=T.useContext(Xs);return Ot(n,jp(e)),n}function Ep(e){let n=h4(e),r=n.matches[n.matches.length-1];return Ot(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function m4(){return Ep("useRouteId")}function p4(){var a;let e=T.useContext(Np),n=f4("useRouteError"),r=Ep("useRouteError");return e!==void 0?e:(a=n.errors)==null?void 0:a[r]}function g4(){let{router:e}=d4("useNavigate"),n=Ep("useNavigate"),r=T.useRef(!1);return w_(()=>{r.current=!0}),T.useCallback(async(o,u={})=>{Js(r.current,v_),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...u}))},[e,n])}var Yv={};function N_(e,n,r){!n&&!Yv[e]&&(Yv[e]=!0,Js(!1,r))}T.memo(b4);function b4({routes:e,manifest:n,future:r,state:a,isStatic:o,onError:u}){return __(e,void 0,{manifest:n,state:a,isStatic:o,onError:u})}function j_({to:e,replace:n,state:r,relative:a}){Ot(ro(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:u}=T.useContext(gs);Js(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=T.useContext(Xs),{pathname:m}=Ws(),p=rf(),y=nf(e,wp(f),m,a==="path");Sp(typeof e=="string"?e:Ta(e),u.createHref(y),_p(u),"reject");let g=JSON.stringify(y);return T.useEffect(()=>{p(JSON.parse(g),{replace:n,state:r,relative:a})},[p,g,a,n,r]),null}function x4(e){return r4(e.context)}function qs(e){Ot(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function y4({basename:e="/",children:n=null,location:r,navigationType:a="POP",navigator:o,static:u=!1,useTransitions:f}){Ot(!ro(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=e.replace(/^\/*/,"/"),p=T.useMemo(()=>({basename:m,navigator:o,static:u,useTransitions:f,future:{}}),[m,o,u,f]);typeof r=="string"&&(r=no(r));let{pathname:y="/",search:g="",hash:b="",state:v=null,key:S="default",mask:A}=r,C=T.useMemo(()=>{let O=Zr(y,m);return O==null?null:{location:{pathname:O,search:g,hash:b,state:v,key:S,mask:A},navigationType:a}},[m,y,g,b,v,S,a,A]);return Js(C!=null,`<Router basename="${m}"> is not able to match the URL "${y}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:T.createElement(gs.Provider,{value:p},T.createElement(Mc.Provider,{children:n,value:C}))}function v4({children:e,location:n}){return i4(T0(e),n)}function T0(e,n=[]){let r=[];return T.Children.forEach(e,(a,o)=>{if(!T.isValidElement(a))return;let u=[...n,o];if(a.type===T.Fragment){r.push.apply(r,T0(a.props.children,u));return}Ot(a.type===qs,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ot(!a.props.index||!a.props.children,"An index route cannot have child routes.");let f={id:a.props.id||u.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(f.children=T0(a.props.children,u)),r.push(f)}),r}var Od="get",Rd="application/x-www-form-urlencoded";function af(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function w4(e){return af(e)&&e.tagName.toLowerCase()==="button"}function _4(e){return af(e)&&e.tagName.toLowerCase()==="form"}function S4(e){return af(e)&&e.tagName.toLowerCase()==="input"}function N4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function j4(e,n){return e.button===0&&(!n||n==="_self")&&!N4(e)}var bd=null;function E4(){if(bd===null)try{new FormData(document.createElement("form"),0),bd=!1}catch{bd=!0}return bd}var A4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function r0(e){return e!=null&&!A4.has(e)?(Js(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Rd}"`),null):e}function C4(e,n){let r,a,o,u,f;if(_4(e)){let m=e.getAttribute("action");a=m?Zr(m,n):null,r=e.getAttribute("method")||Od,o=r0(e.getAttribute("enctype"))||Rd,u=new FormData(e)}else if(w4(e)||S4(e)&&(e.type==="submit"||e.type==="image")){let m=e.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||m.getAttribute("action");if(a=p?Zr(p,n):null,r=e.getAttribute("formmethod")||m.getAttribute("method")||Od,o=r0(e.getAttribute("formenctype"))||r0(m.getAttribute("enctype"))||Rd,u=new FormData(m,e),!E4()){let{name:y,type:g,value:b}=e;if(g==="image"){let v=y?`${y}.`:"";u.append(`${v}x`,"0"),u.append(`${v}y`,"0")}else y&&u.append(y,b)}}else{if(af(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Od,a=null,o=Rd,f=e}return u&&o==="text/plain"&&(f=u,u=void 0),{action:a,method:r.toLowerCase(),encType:o,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ap(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function E_(e,n,r,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:n&&Zr(o.pathname,n)==="/"?o.pathname=`${Kl(n)}/_root.${a}`:o.pathname=`${Kl(o.pathname)}.${a}`,o}async function O4(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function R4(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function T4(e,n,r){let a=await Promise.all(e.map(async o=>{let u=n.routes[o.route.id];if(u){let f=await O4(u,r);return f.links?f.links():[]}return[]}));return z4(a.flat(1).filter(R4).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Jv(e,n,r,a,o,u){let f=(p,y)=>r[y]?p.route.id!==r[y].route.id:!0,m=(p,y)=>{var g;return r[y].pathname!==p.pathname||((g=r[y].route.path)==null?void 0:g.endsWith("*"))&&r[y].params["*"]!==p.params["*"]};return u==="assets"?n.filter((p,y)=>f(p,y)||m(p,y)):u==="data"?n.filter((p,y)=>{var b;let g=a.routes[p.route.id];if(!g||!g.hasLoader)return!1;if(f(p,y)||m(p,y))return!0;if(p.route.shouldRevalidate){let v=p.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((b=r[0])==null?void 0:b.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function k4(e,n,{includeHydrateFallback:r}={}){return D4(e.map(a=>{let o=n.routes[a.route.id];if(!o)return[];let u=[o.module];return o.clientActionModule&&(u=u.concat(o.clientActionModule)),o.clientLoaderModule&&(u=u.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(u=u.concat(o.hydrateFallbackModule)),o.imports&&(u=u.concat(o.imports)),u}).flat(1))}function D4(e){return[...new Set(e)]}function M4(e){let n={},r=Object.keys(e).sort();for(let a of r)n[a]=e[a];return n}function z4(e,n){let r=new Set;return new Set(n),e.reduce((a,o)=>{let u=JSON.stringify(M4(o));return r.has(u)||(r.add(u),a.push({key:u,link:o})),a},[])}function Cp(){let e=T.useContext(so);return Ap(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function U4(){let e=T.useContext(sf);return Ap(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Op=T.createContext(void 0);Op.displayName="FrameworkContext";function lf(){let e=T.useContext(Op);return Ap(e,"You must render this element inside a <HydratedRouter> element"),e}function I4(e,n){let r=T.useContext(Op),[a,o]=T.useState(!1),[u,f]=T.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:y,onMouseLeave:g,onTouchStart:b}=n,v=T.useRef(null);T.useEffect(()=>{if(e==="render"&&f(!0),e==="viewport"){let C=N=>{N.forEach(j=>{f(j.isIntersecting)})},O=new IntersectionObserver(C,{threshold:.5});return v.current&&O.observe(v.current),()=>{O.disconnect()}}},[e]),T.useEffect(()=>{if(a){let C=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(C)}}},[a]);let S=()=>{o(!0)},A=()=>{o(!1),f(!1)};return r?e!=="intent"?[u,v,{}]:[u,v,{onFocus:ac(m,S),onBlur:ac(p,A),onMouseEnter:ac(y,S),onMouseLeave:ac(g,A),onTouchStart:ac(b,S)}]:[!1,v,{}]}function ac(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function L4({page:e,...n}){let r=QE(),{nonce:a}=lf(),{router:o}=Cp(),u=T.useMemo(()=>o_(o.routes,e,o.basename),[o.routes,e,o.basename]);return u?(n.nonce==null&&a&&(n={...n,nonce:a}),r?T.createElement(H4,{page:e,matches:u,...n}):T.createElement(q4,{page:e,matches:u,...n})):null}function P4(e){let{manifest:n,routeModules:r}=lf(),[a,o]=T.useState([]);return T.useEffect(()=>{let u=!1;return T4(e,n,r).then(f=>{u||o(f)}),()=>{u=!0}},[e,n,r]),a}function H4({page:e,matches:n,...r}){let a=Ws(),{future:o}=lf(),{basename:u}=Cp(),f=T.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let m=E_(e,u,o.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,y=[];for(let g of n)typeof g.route.shouldRevalidate=="function"?p=!0:y.push(g.route.id);return p&&y.length>0&&m.searchParams.set("_routes",y.join(",")),[m.pathname+m.search]},[u,o.v8_trailingSlashAwareDataRequests,e,a,n]);return T.createElement(T.Fragment,null,f.map(m=>T.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...r})))}function q4({page:e,matches:n,...r}){let a=Ws(),{future:o,manifest:u,routeModules:f}=lf(),{basename:m}=Cp(),{loaderData:p,matches:y}=U4(),g=T.useMemo(()=>Jv(e,n,y,u,a,"data"),[e,n,y,u,a]),b=T.useMemo(()=>Jv(e,n,y,u,a,"assets"),[e,n,y,u,a]),v=T.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let C=new Set,O=!1;if(n.forEach(j=>{var q;let F=u.routes[j.route.id];!F||!F.hasLoader||(!g.some(B=>B.route.id===j.route.id)&&j.route.id in p&&((q=f[j.route.id])!=null&&q.shouldRevalidate)||F.hasClientLoader?O=!0:C.add(j.route.id))}),C.size===0)return[];let N=E_(e,m,o.v8_trailingSlashAwareDataRequests,"data");return O&&C.size>0&&N.searchParams.set("_routes",n.filter(j=>C.has(j.route.id)).map(j=>j.route.id).join(",")),[N.pathname+N.search]},[m,o.v8_trailingSlashAwareDataRequests,p,a,u,g,n,e,f]),S=T.useMemo(()=>k4(b,u),[b,u]),A=P4(b);return T.createElement(T.Fragment,null,v.map(C=>T.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...r})),S.map(C=>T.createElement("link",{key:C,rel:"modulepreload",href:C,...r})),A.map(({key:C,link:O})=>T.createElement("link",{key:C,nonce:r.nonce,...O,crossOrigin:O.crossOrigin??r.crossOrigin})))}function B4(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var $4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{$4&&(window.__reactRouterVersion="7.18.3")}catch{}function F4({basename:e,children:n,useTransitions:r,window:a}){let o=T.useRef();o.current==null&&(o.current=yE({window:a,v5Compat:!0}));let u=o.current,[f,m]=T.useState({action:u.action,location:u.location}),p=T.useCallback(y=>{r===!1?m(y):T.startTransition(()=>m(y))},[r]);return T.useLayoutEffect(()=>u.listen(p),[u,p]),T.createElement(y4,{basename:e,children:n,location:f.location,navigationType:f.action,navigator:u,useTransitions:r})}var Qs=T.forwardRef(function({onClick:n,discover:r="render",prefetch:a="none",relative:o,reloadDocument:u,replace:f,mask:m,state:p,target:y,to:g,preventScrollReset:b,viewTransition:v,defaultShouldRevalidate:S,...A},C){let{basename:O,navigator:N,useTransitions:j}=T.useContext(gs),F=typeof g=="string"&&vp.test(g),q=p_(g,O);g=q.to;let B=t4(g,{relative:o}),re=Ws(),Q=null;if(m){let oe=nf(m,[],re.mask?re.mask.pathname:"/",!0);O!=="/"&&(oe.pathname=oe.pathname==="/"?O:Ys([O,oe.pathname])),Q=N.createHref(oe)}let[X,se,fe]=I4(a,A),we=G4(g,{replace:f,mask:m,state:p,target:y,preventScrollReset:b,relative:o,viewTransition:v,defaultShouldRevalidate:S,useTransitions:j});function Ce(oe){n&&n(oe),oe.defaultPrevented||we(oe)}let Z=!(q.isExternal||u),W=T.createElement("a",{...A,...fe,href:(Z?Q:void 0)||q.absoluteURL||B,onClick:Z?Ce:n,ref:B4(C,se),target:y,"data-discover":!F&&r==="render"?"true":void 0});return X&&!F?T.createElement(T.Fragment,null,W,T.createElement(L4,{page:B})):W});Qs.displayName="Link";var A_=T.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:a="",end:o=!1,style:u,to:f,viewTransition:m,children:p,...y},g){let b=zc(f,{relative:y.relative}),v=Ws(),S=T.useContext(sf),{navigator:A,basename:C}=T.useContext(gs),O=S!=null&&X4(b)&&m===!0,N=A.encodeLocation?A.encodeLocation(b).pathname:b.pathname,j=v.pathname,F=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;r||(j=j.toLowerCase(),F=F?F.toLowerCase():null,N=N.toLowerCase()),F&&C&&(F=Zr(F,C)||F);const q=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let B=j===N||!o&&j.startsWith(N)&&j.charAt(q)==="/",re=F!=null&&(F===N||!o&&F.startsWith(N)&&F.charAt(N.length)==="/"),Q={isActive:B,isPending:re,isTransitioning:O},X=B?n:void 0,se;typeof a=="function"?se=a(Q):se=[a,B?"active":null,re?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let fe=typeof u=="function"?u(Q):u;return T.createElement(Qs,{...y,"aria-current":X,className:se,ref:g,style:fe,to:f,viewTransition:m},typeof p=="function"?p(Q):p)});A_.displayName="NavLink";var V4=T.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:u,method:f=Od,action:m,onSubmit:p,relative:y,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:v,...S},A)=>{let{useTransitions:C}=T.useContext(gs),O=Y4(),N=J4(m,{relative:y}),j=f.toLowerCase()==="get"?"get":"post",F=typeof m=="string"&&vp.test(m),q=B=>{if(p&&p(B),B.defaultPrevented)return;B.preventDefault();let re=B.nativeEvent.submitter,Q=(re==null?void 0:re.getAttribute("formmethod"))||f,X=()=>O(re||B.currentTarget,{fetcherKey:n,method:Q,navigate:r,replace:o,state:u,relative:y,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:v});C&&r!==!1?T.startTransition(()=>X()):X()};return T.createElement("form",{ref:A,method:j,action:N,onSubmit:a?p:q,...S,"data-discover":!F&&e==="render"?"true":void 0})});V4.displayName="Form";function Z4(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function C_(e){let n=T.useContext(so);return Ot(n,Z4(e)),n}function G4(e,{target:n,replace:r,mask:a,state:o,preventScrollReset:u,relative:f,viewTransition:m,defaultShouldRevalidate:p,useTransitions:y}={}){let g=rf(),b=Ws(),v=zc(e,{relative:f});return T.useCallback(S=>{if(j4(S,n)){S.preventDefault();let A=r!==void 0?r:Ta(b)===Ta(v),C=()=>g(e,{replace:A,mask:a,state:o,preventScrollReset:u,relative:f,viewTransition:m,defaultShouldRevalidate:p});y?T.startTransition(()=>C()):C()}},[b,g,v,r,a,o,n,e,u,f,m,p,y])}var Q4=0,K4=()=>`__${String(++Q4)}__`;function Y4(){let{router:e}=C_("useSubmit"),{basename:n}=T.useContext(gs),r=m4(),a=e.fetch,o=e.navigate;return T.useCallback(async(u,f={})=>{let{action:m,method:p,encType:y,formData:g,body:b}=C4(u,n);if(f.navigate===!1){let v=f.fetcherKey||K4();await a(v,r,f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:b,formMethod:f.method||p,formEncType:f.encType||y,flushSync:f.flushSync})}else await o(f.action||m,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:g,body:b,formMethod:f.method||p,formEncType:f.encType||y,replace:f.replace,state:f.state,fromRouteId:r,flushSync:f.flushSync,viewTransition:f.viewTransition})},[a,o,n,r])}function J4(e,{relative:n}={}){let{basename:r}=T.useContext(gs),a=T.useContext(Xs);Ot(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),u={...zc(e||".",{relative:n})},f=Ws();if(e==null){u.search=f.search;let m=new URLSearchParams(u.search),p=m.getAll("index");if(p.some(g=>g==="")){m.delete("index"),p.filter(b=>b).forEach(b=>m.append("index",b));let g=m.toString();u.search=g?`?${g}`:""}}return(!e||e===".")&&o.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(u.pathname=u.pathname==="/"?r:Ys([r,u.pathname])),Ta(u)}function X4(e,{relative:n}={}){let r=T.useContext(x_);Ot(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=C_("useViewTransitionState"),o=zc(e,{relative:n});if(!r.isTransitioning)return!1;let u=Zr(r.currentLocation.pathname,a)||r.currentLocation.pathname,f=Zr(r.nextLocation.pathname,a)||r.nextLocation.pathname;return $d(o.pathname,f)!=null||$d(o.pathname,u)!=null}const O_=T.createContext(void 0),Pa=e=>{const n=T.useContext(O_);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},W4=({client:e,children:n})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(O_.Provider,{value:e,children:n})),e3={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)};var Ai,xp,Y1,t3=(Y1=class{constructor(){De(this,Ai,e3);De(this,xp,!1)}setTimeoutProvider(e){ve(this,Ai,e)}setTimeout(e,n){return k(this,Ai).setTimeout(e,n)}clearTimeout(e){k(this,Ai).clearTimeout(e)}setInterval(e,n){return k(this,Ai).setInterval(e,n)}clearInterval(e){k(this,Ai).clearInterval(e)}},Ai=new WeakMap,xp=new WeakMap,Y1);const ga=new t3;function n3(e){setTimeout(e,0)}const s3=typeof window>"u"||"Deno"in globalThis;function Hn(){}function r3(e,n){return typeof e=="function"?e(n):e}function R_(e){return typeof e=="number"&&e>=0&&e!==1/0}function T_(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Lt(e,n){return typeof e=="function"?e(n):e}function Xv(e,n){const{type:r="all",exact:a,fetchStatus:o,predicate:u,queryKey:f,stale:m}=e;if(f){if(a){if(n.queryHash!==Rp(f,n.options))return!1}else if(!Yl(n.queryKey,f))return!1}if(r!=="all"){const p=n.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof m=="boolean"&&n.isStale()!==m||o&&o!==n.state.fetchStatus||u&&!u(n))}function Wv(e,n){const{exact:r,status:a,predicate:o,mutationKey:u}=e;if(u){if(!n.options.mutationKey)return!1;if(r){if(ka(n.options.mutationKey)!==ka(u))return!1}else if(!Yl(n.options.mutationKey,u))return!1}return!(a&&n.state.status!==a||o&&!o(n))}function Rp(e,n){return((n==null?void 0:n.queryKeyHashFn)||ka)(e)}function ka(e){return JSON.stringify(e,(n,r)=>k0(r)?Object.keys(r).sort().reduce((a,o)=>(a[o]=r[o],a),{}):r)}function Yl(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(Array.isArray(e)&&Array.isArray(n)){for(let a=0;a<n.length;a++)if(!Yl(e[a],n[a]))return!1;return!0}const r=Object.keys(n);for(const a of r)if(!Yl(e[a],n[a]))return!1;return!0}return!1}const i3=Object.prototype.hasOwnProperty;function k_(e,n,r=0){if(e===n)return e;if(r>500)return n;const a=ew(e)&&ew(n);if(!a&&!(k0(e)&&k0(n)))return n;const o=(a?e:Object.keys(e)).length,u=a?n:Object.keys(n),f=u.length,m=a?new Array(f):{};let p=0;for(let y=0;y<f;y++){const g=a?y:u[y],b=e[g],v=n[g];if(b===v){m[g]=b,(a?y<o:i3.call(e,g))&&p++;continue}if(b===null||v===null||typeof b!="object"||typeof v!="object"){m[g]=v;continue}const S=k_(b,v,r+1);m[g]=S,S===b&&p++}return o===f&&p===o?e:m}function Td(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}function ew(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function k0(e){if(!tw(e))return!1;const n=e.constructor;if(n===void 0)return!0;const r=n.prototype;return!(!tw(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function tw(e){return Object.prototype.toString.call(e)==="[object Object]"}function a3(e){return new Promise(n=>{ga.setTimeout(n,e)})}function D0(e,n,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,n):r.structuralSharing!==!1?k_(e,n):n}function l3(e,n,r=0){const a=[...e,n];return r&&a.length>r?a.slice(1):a}function o3(e,n,r=0){const a=[n,...e];return r&&a.length>r?a.slice(0,-1):a}const Tp=Symbol();function D_(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===Tp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function kp(e,n){return typeof e=="function"?e(...n):!!e}function c3(e,n,r){let a=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=n()),a||(a=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}let u3=()=>s3;const Dp=()=>u3();var io=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},va,Ci,Ul,J1,d3=(J1=class extends io{constructor(){super();De(this,va);De(this,Ci);De(this,Ul);ve(this,Ul,n=>{if(typeof window<"u"&&window.addEventListener){const r=()=>n();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){k(this,Ci)||this.setEventListener(k(this,Ul))}onUnsubscribe(){var n;this.hasListeners()||((n=k(this,Ci))==null||n.call(this),ve(this,Ci,void 0))}setEventListener(n){var r;ve(this,Ul,n),(r=k(this,Ci))==null||r.call(this),ve(this,Ci,n(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(n){k(this,va)!==n&&(ve(this,va,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(r=>{r(n)})}isFocused(){var n;return typeof k(this,va)=="boolean"?k(this,va):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},va=new WeakMap,Ci=new WeakMap,Ul=new WeakMap,J1);const Mp=new d3,f3=n3;function h3(){let e=[],n=0,r=m=>{m()},a=m=>{m()},o=f3;const u=m=>{n?e.push(m):o(()=>{r(m)})},f=()=>{const m=e;e=[],m.length&&o(()=>{a(()=>{m.forEach(p=>{r(p)})})})};return{batch:m=>{let p;n++;try{p=m()}finally{n--,n||f()}return p},batchCalls:m=>(...p)=>{u(()=>{m(...p)})},schedule:u,setNotifyFunction:m=>{r=m},setBatchNotifyFunction:m=>{a=m},setScheduler:m=>{o=m}}}const sn=h3();var Il,Oi,Ll,X1,m3=(X1=class extends io{constructor(){super();De(this,Il,!0);De(this,Oi);De(this,Ll);ve(this,Ll,n=>{if(typeof window<"u"&&window.addEventListener){const r=()=>n(!0),a=()=>n(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",a)}}})}onSubscribe(){k(this,Oi)||this.setEventListener(k(this,Ll))}onUnsubscribe(){var n;this.hasListeners()||((n=k(this,Oi))==null||n.call(this),ve(this,Oi,void 0))}setEventListener(n){var r;ve(this,Ll,n),(r=k(this,Oi))==null||r.call(this),ve(this,Oi,n(this.setOnline.bind(this)))}setOnline(n){k(this,Il)!==n&&(ve(this,Il,n),this.listeners.forEach(r=>{r(n)}))}isOnline(){return k(this,Il)}},Il=new WeakMap,Oi=new WeakMap,Ll=new WeakMap,X1);const Fd=new m3;function p3(e){return Math.min(1e3*2**e,3e4)}function M_(e){return(e??"online")==="online"?Fd.isOnline():!0}var M0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function z_(e){let n=!1,r=0,a,o="pending",u,f;const m=new Promise((j,F)=>{u=j,f=F});m.catch(Hn);const p=()=>o!=="pending",y=j=>{var F;if(!p()){const q=new M0(j);C(q),(F=e.onCancel)==null||F.call(e,q)}},g=()=>{n=!0},b=()=>{n=!1},v=()=>Mp.isFocused()&&(e.networkMode==="always"||Fd.isOnline())&&e.canRun(),S=()=>M_(e.networkMode)&&e.canRun(),A=j=>{p()||(a==null||a(),o="resolved",u(j))},C=j=>{p()||(a==null||a(),o="rejected",f(j))},O=()=>new Promise(j=>{var F;a=q=>{(p()||v())&&j(q)},(F=e.onPause)==null||F.call(e)}).then(()=>{var j;a=void 0,p()||(j=e.onContinue)==null||j.call(e)}),N=()=>{if(p())return;let j;const F=r===0?e.initialPromise:void 0;try{j=F??e.fn()}catch(q){j=Promise.reject(q)}Promise.resolve(j).then(A).catch(q=>{var se;if(p())return;const B=e.retry??(Dp()?0:3),re=e.retryDelay??p3,Q=typeof re=="function"?re(r,q):re,X=B===!0||typeof B=="number"&&r<B||typeof B=="function"&&B(r,q);if(n||!X){C(q);return}r++,(se=e.onFail)==null||se.call(e,r,q),a3(Q).then(()=>v()?void 0:O()).then(()=>{n?C(q):N()})})};return{promise:m,status:()=>o,cancel:y,continue:()=>(a==null||a(),m),cancelRetry:g,continueRetry:b,canStart:S,start:()=>(S()?N():O().then(N),m)}}var wa,W1,U_=(W1=class{constructor(){De(this,wa)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),R_(this.gcTime)&&ve(this,wa,ga.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Dp()?1/0:3e5))}clearGcTimeout(){k(this,wa)!==void 0&&(ga.clearTimeout(k(this,wa)),ve(this,wa,void 0))}},wa=new WeakMap,W1);function g3(e){return{onFetch:(n,r)=>{var g,b,v,S,A;const a=n.options,o=(v=(b=(g=n.fetchOptions)==null?void 0:g.meta)==null?void 0:b.fetchMore)==null?void 0:v.direction,u=((S=n.state.data)==null?void 0:S.pages)||[],f=((A=n.state.data)==null?void 0:A.pageParams)||[];let m={pages:[],pageParams:[]},p=0;const y=async()=>{let C=!1;const O=F=>{c3(F,()=>n.signal,()=>C=!0)},N=D_(n.options,n.fetchOptions),j=async(F,q,B)=>{if(C)return Promise.reject(n.signal.reason);if(q==null&&F.pages.length)return Promise.resolve(F);const Q=(()=>{const we={client:n.client,queryKey:n.queryKey,pageParam:q,direction:B?"backward":"forward",meta:n.options.meta};return O(we),we})(),X=await N(Q),{maxPages:se}=n.options,fe=B?o3:l3;return{pages:fe(F.pages,X,se),pageParams:fe(F.pageParams,q,se)}};if(o&&u.length){const F=o==="backward",q=F?b3:nw,B={pages:u,pageParams:f};m=await j(B,q(a,B),F)}else{const F=e??u.length;do{const q=p===0?f[0]??a.initialPageParam:nw(a,m);if(p>0&&q==null)break;m=await j(m,q),p++}while(p<F)}return m};n.options.persister?n.fetchFn=()=>{var C,O;return(O=(C=n.options).persister)==null?void 0:O.call(C,y,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r)}:n.fetchFn=y}}}function nw(e,{pages:n,pageParams:r}){const a=n.length-1;return n.length>0?e.getNextPageParam(n[a],n,r[a],r):void 0}function b3(e,{pages:n,pageParams:r}){var a;return n.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,n[0],n,r[0],r):void 0}var Pl,_a,Hl,Cs,Sa,nn,Oc,Na,Vs,Hr,e_,x3=(e_=class extends U_{constructor(n){super();De(this,Vs);De(this,Pl);De(this,_a);De(this,Hl);De(this,Cs);De(this,Sa);De(this,nn);De(this,Oc);De(this,Na);ve(this,Na,!1),ve(this,Oc,n.defaultOptions),this.setOptions(n.options),this.observers=[],ve(this,Sa,n.client),ve(this,Cs,k(this,Sa).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,ve(this,_a,rw(this.options)),this.state=n.state??k(this,_a),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return k(this,Pl)}get promise(){var n;return(n=k(this,nn))==null?void 0:n.promise}setOptions(n){if(this.options={...k(this,Oc),...n},n!=null&&n._type&&ve(this,Pl,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=rw(this.options);r.data!==void 0&&(this.setState(sw(r.data,r.dataUpdatedAt)),ve(this,_a,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,Cs).remove(this)}setData(n,r){const a=D0(this.state.data,n,this.options);return Ze(this,Vs,Hr).call(this,{data:a,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),a}setState(n){Ze(this,Vs,Hr).call(this,{type:"setState",state:n})}cancel(n){var a,o;const r=(a=k(this,nn))==null?void 0:a.promise;return(o=k(this,nn))==null||o.cancel(n),r?r.then(Hn).catch(Hn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return k(this,_a)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>Lt(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tp||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Lt(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:!T_(this.state.dataUpdatedAt,n)}onFocus(){var n,r;(n=this.observers.find(a=>a.shouldFetchOnWindowFocus()))==null||n.refetch({cancelRefetch:!1}),(r=k(this,nn))==null||r.continue()}onOnline(){var n,r;(n=this.observers.find(a=>a.shouldFetchOnReconnect()))==null||n.refetch({cancelRefetch:!1}),(r=k(this,nn))==null||r.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),k(this,Cs).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const r=this.observers.indexOf(n);r!==-1&&(this.observers.splice(r,1),this.observers.length||(k(this,nn)&&(k(this,Na)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?k(this,nn).cancel({revert:!0}):k(this,nn).cancelRetry()),this.scheduleGc()),k(this,Cs).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ze(this,Vs,Hr).call(this,{type:"invalidate"})}async fetch(n,r){var y,g,b,v,S,A,C,O,N,j,F,q;if(this.state.fetchStatus!=="idle"&&((y=k(this,nn))==null?void 0:y.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(k(this,nn))return k(this,nn).continueRetry(),k(this,nn).promise}if(n&&this.setOptions(n),!this.options.queryFn){const B=this.observers.find(re=>re.options.queryFn);B&&this.setOptions(B.options)}const a=new AbortController,o=B=>{Object.defineProperty(B,"signal",{enumerable:!0,get:()=>(ve(this,Na,!0),a.signal)})},u=()=>{const B=D_(this.options,r),Q=(()=>{const X={client:k(this,Sa),queryKey:this.queryKey,meta:this.meta};return o(X),X})();return ve(this,Na,!1),this.options.persister?this.options.persister(B,Q,this):B(Q)},m=(()=>{const B={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:k(this,Sa),state:this.state,fetchFn:u};return o(B),B})();(g=k(this,Pl)==="infinite"?g3(this.options.pages):this.options.behavior)==null||g.onFetch(m,this),ve(this,Hl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=m.fetchOptions)==null?void 0:b.meta))&&Ze(this,Vs,Hr).call(this,{type:"fetch",meta:(v=m.fetchOptions)==null?void 0:v.meta});const p=ve(this,nn,z_({initialPromise:r==null?void 0:r.initialPromise,fn:m.fetchFn,onCancel:B=>{B instanceof M0&&B.revert&&this.setState({...k(this,Hl),fetchStatus:"idle"}),a.abort()},onFail:(B,re)=>{Ze(this,Vs,Hr).call(this,{type:"failed",failureCount:B,error:re})},onPause:()=>{Ze(this,Vs,Hr).call(this,{type:"pause"})},onContinue:()=>{Ze(this,Vs,Hr).call(this,{type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0}));try{const B=await p.start();if(B===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(B),(A=(S=k(this,Cs).config).onSuccess)==null||A.call(S,B,this),(O=(C=k(this,Cs).config).onSettled)==null||O.call(C,B,this.state.error,this),B}catch(B){if(B instanceof M0){if(B.silent)return k(this,nn).promise;if(B.revert){if(this.state.data===void 0)throw B;return this.state.data}}throw Ze(this,Vs,Hr).call(this,{type:"error",error:B}),(j=(N=k(this,Cs).config).onError)==null||j.call(N,B,this),(q=(F=k(this,Cs).config).onSettled)==null||q.call(F,this.state.data,B,this),B}finally{k(this,nn)===p&&ve(this,nn,void 0),this.scheduleGc()}}},Pl=new WeakMap,_a=new WeakMap,Hl=new WeakMap,Cs=new WeakMap,Sa=new WeakMap,nn=new WeakMap,Oc=new WeakMap,Na=new WeakMap,Vs=new WeakSet,Hr=function(n){const r=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,...I_(a.data,this.options),fetchMeta:n.meta??null};case"success":const o={...a,...sw(n.data,n.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ve(this,Hl,n.manual?o:void 0),o;case"error":const u=n.error;return{...a,error:u,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...n.state}}};this.state=r(this.state),sn.batch(()=>{this.observers.slice().forEach(a=>{a.onQueryUpdate()}),k(this,Cs).notify({query:this,type:"updated",action:n})})},e_);function I_(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:M_(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function sw(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function rw(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,r=n!==void 0,a=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:r?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ln,tt,Rc,Pn,ja,ql,qr,Tc,Bl,$l,Ea,Aa,Ri,Fl,ct,mc,z0,U0,I0,L0,P0,H0,q0,B0,t_,y3=(t_=class extends io{constructor(n,r){super();De(this,ct);De(this,Ln);De(this,tt);De(this,Rc);De(this,Pn);De(this,ja);De(this,ql);De(this,qr);De(this,Tc);De(this,Bl);De(this,$l);De(this,Ea);De(this,Aa);De(this,Ri);De(this,Fl,new Set);this.options=r,ve(this,Ln,n),ve(this,qr,null),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,tt).addObserver(this),iw(k(this,tt),this.options)?Ze(this,ct,mc).call(this):this.updateResult(),Ze(this,ct,P0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $0(k(this,tt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $0(k(this,tt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ze(this,ct,H0).call(this),Ze(this,ct,q0).call(this),k(this,tt).removeObserver(this)}setOptions(n){const r=this.options,a=k(this,tt);if(this.options=k(this,Ln).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Lt(this.options.enabled,k(this,tt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ze(this,ct,B0).call(this),k(this,tt).setOptions(this.options),r._defaulted&&!Td(this.options,r)&&k(this,Ln).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,tt),observer:this});const o=this.hasListeners();o&&aw(k(this,tt),a,this.options,r)&&Ze(this,ct,mc).call(this),this.updateResult(),o&&(k(this,tt)!==a||Lt(this.options.enabled,k(this,tt))!==Lt(r.enabled,k(this,tt))||Lt(this.options.staleTime,k(this,tt))!==Lt(r.staleTime,k(this,tt)))&&Ze(this,ct,U0).call(this);const u=Ze(this,ct,I0).call(this);o&&(k(this,tt)!==a||Lt(this.options.enabled,k(this,tt))!==Lt(r.enabled,k(this,tt))||u!==k(this,Ri))&&Ze(this,ct,L0).call(this,u)}getOptimisticResult(n){const r=k(this,Ln).getQueryCache().build(k(this,Ln),n),a=this.createResult(r,n);return Td(this.getCurrentResult(),a)||(ve(this,Pn,a),ve(this,ql,this.options),ve(this,ja,k(this,tt).state)),a}getCurrentResult(){return k(this,Pn)}trackResult(n,r){return new Proxy(n,{get:(a,o)=>(this.trackProp(o),r==null||r(o),Reflect.get(a,o))})}trackProp(n){k(this,Fl).add(n)}getCurrentQuery(){return k(this,tt)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const r=k(this,Ln).defaultQueryOptions(n),a=k(this,Ln).getQueryCache().build(k(this,Ln),r);let o=()=>{},u;const f=new Promise(m=>{u=m,o=k(this,Ln).getQueryCache().subscribe(p=>{p.type==="updated"&&p.query.queryHash===a.queryHash&&a.state.data!==void 0&&(o(),m(this.createResult(a,r)))})});return Promise.race([a.fetch().then(()=>{const m=this.createResult(a,r);return u==null||u(m),m}).finally(()=>{o()}),f])}fetch(n){return Ze(this,ct,mc).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,Pn)))}createResult(n,r){var re;const a=k(this,tt),o=this.options,u=k(this,Pn),f=k(this,ja),m=k(this,ql),p=n!==a?n.state:k(this,Rc),{state:y}=n;let g={...y},b=!1,v;if(r._optimisticResults){const Q=this.hasListeners(),X=!Q&&iw(n,r),se=Q&&aw(n,a,r,o);(X||se)&&(g={...g,...I_(y.data,n.options)}),r._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:S,errorUpdatedAt:A,status:C}=g;v=g.data;let O=!1;if(r.placeholderData!==void 0&&v===void 0&&C==="pending"){let Q;u!=null&&u.isPlaceholderData&&r.placeholderData===(m==null?void 0:m.placeholderData)?(Q=u.data,O=!0):Q=typeof r.placeholderData=="function"?r.placeholderData((re=k(this,$l))==null?void 0:re.state.data,k(this,$l)):r.placeholderData,Q!==void 0&&(C="success",v=D0(u==null?void 0:u.data,Q,r),b=!0)}if(r.select&&v!==void 0&&!O)if(u&&v===(f==null?void 0:f.data)&&r.select===k(this,Tc))v=k(this,Bl);else try{ve(this,Tc,r.select),v=r.select(v),v=D0(u==null?void 0:u.data,v,r),ve(this,Bl,v),ve(this,qr,null)}catch(Q){ve(this,qr,Q)}else v===void 0&&ve(this,qr,null);k(this,qr)&&(S=k(this,qr),v=k(this,Bl),A=Date.now(),C="error",b=!1);const N=g.fetchStatus==="fetching",j=C==="pending",F=C==="error",q=j&&N,B=v!==void 0;return{status:C,fetchStatus:g.fetchStatus,isPending:j,isSuccess:C==="success",isError:F,isInitialLoading:q,isLoading:q,data:v,dataUpdatedAt:g.dataUpdatedAt,error:S,errorUpdatedAt:A,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:N,isRefetching:N&&!j,isLoadingError:F&&!B,isPaused:g.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:F&&B,isStale:zp(n,r),refetch:this.refetch,isEnabled:Lt(r.enabled,n)!==!1}}updateResult(){const n=k(this,Pn),r=this.createResult(k(this,tt),this.options);if(ve(this,ja,k(this,tt).state),ve(this,ql,this.options),k(this,ja).data!==void 0&&ve(this,$l,k(this,tt)),Td(r,n))return;ve(this,Pn,r);const o=(()=>{if(!n)return!0;const{notifyOnChangeProps:u}=this.options,f=typeof u=="function"?u():u;if(f==="all"||!f&&!k(this,Fl).size)return!0;const m=new Set(f??k(this,Fl));return this.options.throwOnError&&m.add("error"),Object.keys(k(this,Pn)).some(p=>{const y=p;return k(this,Pn)[y]!==n[y]&&m.has(y)})})();sn.batch(()=>{o&&this.listeners.forEach(u=>{u(k(this,Pn))}),k(this,Ln).getQueryCache().notify({query:k(this,tt),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ze(this,ct,P0).call(this)}},Ln=new WeakMap,tt=new WeakMap,Rc=new WeakMap,Pn=new WeakMap,ja=new WeakMap,ql=new WeakMap,qr=new WeakMap,Tc=new WeakMap,Bl=new WeakMap,$l=new WeakMap,Ea=new WeakMap,Aa=new WeakMap,Ri=new WeakMap,Fl=new WeakMap,ct=new WeakSet,mc=function(n){Ze(this,ct,B0).call(this);let r=k(this,tt).fetch(this.options,n);return n!=null&&n.throwOnError||(r=r.catch(Hn)),r},z0=function(n){return!Dp()&&Lt(this.options.enabled,k(this,tt))!==!1&&R_(n)},U0=function(){Ze(this,ct,H0).call(this);const n=Lt(this.options.staleTime,k(this,tt));if(k(this,Pn).isStale||!Ze(this,ct,z0).call(this,n))return;const r=T_(k(this,Pn).dataUpdatedAt,n)+1;ve(this,Ea,ga.setTimeout(()=>{k(this,Pn).isStale||this.updateResult()},r))},I0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,tt)):this.options.refetchInterval)??!1},L0=function(n){Ze(this,ct,q0).call(this),ve(this,Ri,n),!(k(this,Ri)===0||!Ze(this,ct,z0).call(this,k(this,Ri)))&&ve(this,Aa,ga.setInterval(()=>{(this.options.refetchIntervalInBackground||Mp.isFocused())&&Ze(this,ct,mc).call(this)},k(this,Ri)))},P0=function(){Ze(this,ct,U0).call(this),Ze(this,ct,L0).call(this,Ze(this,ct,I0).call(this))},H0=function(){k(this,Ea)!==void 0&&(ga.clearTimeout(k(this,Ea)),ve(this,Ea,void 0))},q0=function(){k(this,Aa)!==void 0&&(ga.clearInterval(k(this,Aa)),ve(this,Aa,void 0))},B0=function(){const n=k(this,Ln).getQueryCache().build(k(this,Ln),this.options);if(n===k(this,tt))return;const r=k(this,tt);ve(this,tt,n),ve(this,Rc,n.state),this.hasListeners()&&(r==null||r.removeObserver(this),n.addObserver(this))},t_);function v3(e,n){return Lt(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Lt(n.retryOnMount,e)===!1)}function iw(e,n){return v3(e,n)||e.state.data!==void 0&&$0(e,n,n.refetchOnMount)}function $0(e,n,r){if(Lt(n.enabled,e)!==!1&&Lt(n.staleTime,e)!=="static"){const a=typeof r=="function"?r(e):r;return a==="always"||a!==!1&&zp(e,n)}return!1}function aw(e,n,r,a){return(e!==n||Lt(a.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&zp(e,r)}function zp(e,n){return Lt(n.enabled,e)!==!1&&e.isStaleByTime(Lt(n.staleTime,e))}var kc,gr,En,Ca,br,_i,n_,w3=(n_=class extends U_{constructor(n){super();De(this,br);De(this,kc);De(this,gr);De(this,En);De(this,Ca);ve(this,kc,n.client),this.mutationId=n.mutationId,ve(this,En,n.mutationCache),ve(this,gr,[]),this.state=n.state||L_(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){k(this,gr).includes(n)||(k(this,gr).push(n),this.clearGcTimeout(),k(this,En).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){ve(this,gr,k(this,gr).filter(r=>r!==n)),this.scheduleGc(),k(this,En).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){k(this,gr).length||(this.state.status==="pending"?this.scheduleGc():k(this,En).remove(this))}continue(){var n;return((n=k(this,Ca))==null?void 0:n.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){var m,p,y,g,b,v,S,A,C,O,N,j,F,q,B,re,Q,X;const r=()=>{Ze(this,br,_i).call(this,{type:"continue"})},a={client:k(this,kc),meta:this.options.meta,mutationKey:this.options.mutationKey},o=ve(this,Ca,z_({fn:()=>this.options.mutationFn?this.options.mutationFn(n,a):Promise.reject(new Error("No mutationFn found")),onFail:(se,fe)=>{Ze(this,br,_i).call(this,{type:"failed",failureCount:se,error:fe})},onPause:()=>{Ze(this,br,_i).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,En).canRun(this)})),u=this.state.status==="pending",f=!o.canStart();try{if(u)r();else{Ze(this,br,_i).call(this,{type:"pending",variables:n,isPaused:f}),k(this,En).config.onMutate&&await k(this,En).config.onMutate(n,this,a);const fe=await((p=(m=this.options).onMutate)==null?void 0:p.call(m,n,a));fe!==this.state.context&&Ze(this,br,_i).call(this,{type:"pending",context:fe,variables:n,isPaused:f})}const se=await o.start();return await((g=(y=k(this,En).config).onSuccess)==null?void 0:g.call(y,se,n,this.state.context,this,a)),await((v=(b=this.options).onSuccess)==null?void 0:v.call(b,se,n,this.state.context,a)),await((A=(S=k(this,En).config).onSettled)==null?void 0:A.call(S,se,null,this.state.variables,this.state.context,this,a)),await((O=(C=this.options).onSettled)==null?void 0:O.call(C,se,null,n,this.state.context,a)),Ze(this,br,_i).call(this,{type:"success",data:se}),se}catch(se){try{await((j=(N=k(this,En).config).onError)==null?void 0:j.call(N,se,n,this.state.context,this,a))}catch(fe){Promise.reject(fe)}try{await((q=(F=this.options).onError)==null?void 0:q.call(F,se,n,this.state.context,a))}catch(fe){Promise.reject(fe)}try{await((re=(B=k(this,En).config).onSettled)==null?void 0:re.call(B,void 0,se,this.state.variables,this.state.context,this,a))}catch(fe){Promise.reject(fe)}try{await((X=(Q=this.options).onSettled)==null?void 0:X.call(Q,void 0,se,n,this.state.context,a))}catch(fe){Promise.reject(fe)}throw Ze(this,br,_i).call(this,{type:"error",error:se}),se}finally{k(this,Ca)===o&&ve(this,Ca,void 0),k(this,En).runNext(this)}}},kc=new WeakMap,gr=new WeakMap,En=new WeakMap,Ca=new WeakMap,br=new WeakSet,_i=function(n){const r=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=r(this.state),sn.batch(()=>{k(this,gr).forEach(a=>{a.onMutationUpdate(n)}),k(this,En).notify({mutation:this,type:"updated",action:n})})},n_);function L_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Br,Zs,Dc,s_,_3=(s_=class extends io{constructor(n={}){super();De(this,Br);De(this,Zs);De(this,Dc);this.config=n,ve(this,Br,new Set),ve(this,Zs,new Map),ve(this,Dc,0)}build(n,r,a){const o=new w3({client:n,mutationCache:this,mutationId:++gd(this,Dc)._,options:n.defaultMutationOptions(r),state:a});return this.add(o),o}add(n){k(this,Br).add(n);const r=xd(n);if(typeof r=="string"){const a=k(this,Zs).get(r);a?a.push(n):k(this,Zs).set(r,[n])}this.notify({type:"added",mutation:n})}remove(n){if(k(this,Br).delete(n)){const r=xd(n);if(typeof r=="string"){const a=k(this,Zs).get(r);if(a)if(a.length>1){const o=a.indexOf(n);o!==-1&&a.splice(o,1)}else a[0]===n&&k(this,Zs).delete(r)}}this.notify({type:"removed",mutation:n})}canRun(n){var a;const r=xd(n);if(typeof r=="string"){const o=(a=k(this,Zs).get(r))==null?void 0:a.find(u=>u.state.status==="pending");return!o||o===n}else return!0}runNext(n){var a,o;const r=xd(n);return typeof r=="string"?((o=(a=k(this,Zs).get(r))==null?void 0:a.find(u=>u!==n&&u.state.isPaused))==null?void 0:o.continue())??Promise.resolve():Promise.resolve()}clear(){sn.batch(()=>{k(this,Br).forEach(n=>{this.notify({type:"removed",mutation:n})}),k(this,Br).clear(),k(this,Zs).clear()})}getAll(){return Array.from(k(this,Br))}find(n){const r={exact:!0,...n};return this.getAll().find(a=>Wv(r,a))}findAll(n={}){return this.getAll().filter(r=>Wv(n,r))}notify(n){sn.batch(()=>{this.listeners.forEach(r=>{r(n)})})}resumePausedMutations(){const n=this.getAll().filter(r=>r.state.isPaused);return sn.batch(()=>Promise.all(n.map(r=>r.continue().catch(Hn))))}},Br=new WeakMap,Zs=new WeakMap,Dc=new WeakMap,s_);function xd(e){var n;return(n=e.options.scope)==null?void 0:n.id}var $r,Ti,An,Fr,wr,pc,F0,r_,S3=(r_=class extends io{constructor(r,a){super();De(this,wr);De(this,$r);De(this,Ti);De(this,An);De(this,Fr);ve(this,$r,r),this.setOptions(a),this.bindMethods(),Ze(this,wr,pc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var o;const a=this.options;this.options=k(this,$r).defaultMutationOptions(r),Td(this.options,a)||k(this,$r).getMutationCache().notify({type:"observerOptionsUpdated",mutation:k(this,An),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&ka(a.mutationKey)!==ka(this.options.mutationKey)?this.reset():((o=k(this,An))==null?void 0:o.state.status)==="pending"&&k(this,An).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&k(this,An)&&(k(this,An).addObserver(this),Ze(this,wr,pc).call(this))}onUnsubscribe(){var r;this.hasListeners()||(r=k(this,An))==null||r.removeObserver(this)}onMutationUpdate(r){Ze(this,wr,pc).call(this),Ze(this,wr,F0).call(this,r)}getCurrentResult(){return k(this,Ti)}reset(){var r;(r=k(this,An))==null||r.removeObserver(this),ve(this,An,void 0),Ze(this,wr,pc).call(this),Ze(this,wr,F0).call(this)}mutate(r,a){var o;return ve(this,Fr,a),(o=k(this,An))==null||o.removeObserver(this),ve(this,An,k(this,$r).getMutationCache().build(k(this,$r),this.options)),k(this,An).addObserver(this),k(this,An).execute(r)}},$r=new WeakMap,Ti=new WeakMap,An=new WeakMap,Fr=new WeakMap,wr=new WeakSet,pc=function(){var a;const r=((a=k(this,An))==null?void 0:a.state)??L_();ve(this,Ti,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},F0=function(r){sn.batch(()=>{var a,o,u,f,m,p,y,g;if(k(this,Fr)&&this.hasListeners()){const b=k(this,Ti).variables,v=k(this,Ti).context,S={client:k(this,$r),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(o=(a=k(this,Fr)).onSuccess)==null||o.call(a,r.data,b,v,S)}catch(A){Promise.reject(A)}try{(f=(u=k(this,Fr)).onSettled)==null||f.call(u,r.data,null,b,v,S)}catch(A){Promise.reject(A)}}else if((r==null?void 0:r.type)==="error"){try{(p=(m=k(this,Fr)).onError)==null||p.call(m,r.error,b,v,S)}catch(A){Promise.reject(A)}try{(g=(y=k(this,Fr)).onSettled)==null||g.call(y,void 0,r.error,b,v,S)}catch(A){Promise.reject(A)}}}this.listeners.forEach(b=>{b(k(this,Ti))})})},r_),xr,i_,N3=(i_=class extends io{constructor(n={}){super();De(this,xr);this.config=n,ve(this,xr,new Map)}build(n,r,a){const o=r.queryKey,u=r.queryHash??Rp(o,r);let f=this.get(u);return f||(f=new x3({client:n,queryKey:o,queryHash:u,options:n.defaultQueryOptions(r),state:a,defaultOptions:n.getQueryDefaults(o)}),this.add(f)),f}add(n){k(this,xr).has(n.queryHash)||(k(this,xr).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const r=k(this,xr).get(n.queryHash);r&&(n.destroy(),r===n&&k(this,xr).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){sn.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return k(this,xr).get(n)}getAll(){return[...k(this,xr).values()]}find(n){const r={exact:!0,...n};return this.getAll().find(a=>Xv(r,a))}findAll(n={}){const r=this.getAll();return Object.keys(n).length>0?r.filter(a=>Xv(n,a)):r}notify(n){sn.batch(()=>{this.listeners.forEach(r=>{r(n)})})}onFocus(){sn.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){sn.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},xr=new WeakMap,i_),Dt,ki,Di,Vl,Zl,Mi,Gl,Ql,a_,j3=(a_=class{constructor(e={}){De(this,Dt);De(this,ki);De(this,Di);De(this,Vl);De(this,Zl);De(this,Mi);De(this,Gl);De(this,Ql);ve(this,Dt,e.queryCache||new N3),ve(this,ki,e.mutationCache||new _3),ve(this,Di,e.defaultOptions||{}),ve(this,Vl,new Map),ve(this,Zl,new Map),ve(this,Mi,0)}mount(){gd(this,Mi)._++,k(this,Mi)===1&&(ve(this,Gl,Mp.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,Dt).onFocus())})),ve(this,Ql,Fd.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,Dt).onOnline())})))}unmount(){var e,n;gd(this,Mi)._--,k(this,Mi)===0&&((e=k(this,Gl))==null||e.call(this),ve(this,Gl,void 0),(n=k(this,Ql))==null||n.call(this),ve(this,Ql,void 0))}isFetching(e){return k(this,Dt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,ki).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const n=this.defaultQueryOptions({queryKey:e});return(r=k(this,Dt).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),r=k(this,Dt).build(this,n),a=r.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Lt(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(a))}getQueriesData(e){return k(this,Dt).findAll(e).map(({queryKey:n,state:r})=>[n,r.data])}setQueryData(e,n,r){var f;const a=this.defaultQueryOptions({queryKey:e}),o=(f=k(this,Dt).get(a.queryHash))==null?void 0:f.state.data,u=r3(n,o);if(u!==void 0)return k(this,Dt).build(this,a).setData(u,{...r,manual:!0})}setQueriesData(e,n,r){return sn.batch(()=>k(this,Dt).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,n,r)]))}getQueryState(e){var r;const n=this.defaultQueryOptions({queryKey:e});return(r=k(this,Dt).get(n.queryHash))==null?void 0:r.state}removeQueries(e){const n=k(this,Dt);sn.batch(()=>{n.findAll(e).forEach(r=>{n.remove(r)})})}resetQueries(e,n){const r=k(this,Dt);return sn.batch(()=>{const a=r.findAll(e),o=new Set(a);return a.forEach(u=>{u.reset()}),this.refetchQueries({type:"active",predicate:u=>o.has(u)},n)})}cancelQueries(e,n={}){const r={revert:!0,...n},a=sn.batch(()=>k(this,Dt).findAll(e).map(o=>o.cancel(r)));return Promise.all(a).then(Hn).catch(Hn)}invalidateQueries(e,n={}){return sn.batch(()=>(k(this,Dt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},a=sn.batch(()=>k(this,Dt).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let u=o.fetch(void 0,r);return r.throwOnError||(u=u.catch(Hn)),o.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(a).then(Hn)}async query(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=k(this,Dt).build(this,n),a=r.isStaleByTime(Lt(n.staleTime,r))?await r.fetch(n):r.state.data,o=n.select;return o?o(a):a}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=k(this,Dt).build(this,n);return r.isStaleByTime(Lt(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Hn).catch(Hn)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Hn).catch(Hn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Fd.isOnline()?k(this,ki).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,Dt)}getMutationCache(){return k(this,ki)}getDefaultOptions(){return k(this,Di)}setDefaultOptions(e){ve(this,Di,e)}setQueryDefaults(e,n){k(this,Vl).set(ka(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...k(this,Vl).values()],r={};return n.forEach(a=>{Yl(e,a.queryKey)&&Object.assign(r,a.defaultOptions)}),r}setMutationDefaults(e,n){k(this,Zl).set(ka(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...k(this,Zl).values()],r={};return n.forEach(a=>{Yl(e,a.mutationKey)&&Object.assign(r,a.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const n={...k(this,Di).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=Rp(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===Tp&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,Di).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,Dt).clear(),k(this,ki).clear()}},Dt=new WeakMap,ki=new WeakMap,Di=new WeakMap,Vl=new WeakMap,Zl=new WeakMap,Mi=new WeakMap,Gl=new WeakMap,Ql=new WeakMap,a_);const P_=T.createContext(!1),E3=()=>T.useContext(P_);P_.Provider;function A3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const C3=T.createContext(A3()),O3=()=>T.useContext(C3),R3=(e,n,r)=>{const a=r!=null&&r.state.error&&typeof e.throwOnError=="function"?kp(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||a)&&(n.isReset()||(e.retryOnMount=!1))},T3=e=>{T.useEffect(()=>{e.clearReset()},[e])},k3=({result:e,errorResetBoundary:n,throwOnError:r,query:a,suspense:o})=>e.isError&&!n.isReset()&&!e.isFetching&&a&&(o&&e.data===void 0||kp(r,[e.error,a])),D3=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...o)=>r(a(...o)):r(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},M3=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,z3=(e,n,r)=>n.fetchOptimistic(e).catch(()=>{r.clearReset()});function U3(e,n,r){const a=E3(),o=O3(),u=Pa(),f=u.defaultQueryOptions(e),m=u.getQueryCache().get(f.queryHash),p=e.subscribed!==!1;f._optimisticResults=a?"isRestoring":p?"optimistic":void 0,D3(f),R3(f,o,m),T3(o);const[y]=T.useState(()=>new n(u,f)),g=y.getOptimisticResult(f),b=!a&&p;if(T.useSyncExternalStore(T.useCallback(v=>{const S=b?y.subscribe(sn.batchCalls(v)):Hn;return y.updateResult(),S},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),T.useEffect(()=>{y.setOptions(f)},[f,y]),M3(f,g))throw z3(f,y,o);if(k3({result:g,errorResetBoundary:o,throwOnError:f.throwOnError,query:m,suspense:f.suspense}))throw g.error;return f.notifyOnChangeProps?g:y.trackResult(g)}function Ke(e,n){return U3(e,y3)}function Ft(e,n){const r=Pa(),[a]=T.useState(()=>new S3(r,e));T.useEffect(()=>{a.setOptions(e)},[a,e]);const o=T.useSyncExternalStore(T.useCallback(f=>a.subscribe(sn.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),u=T.useCallback((...f)=>{a.mutate(f[0],f[1]).catch(Hn)},[a]);if(o.error&&kp(a.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:u,mutateAsync:o.mutate}}const I3=new j3({defaultOptions:{queries:{staleTime:1e3*60*3,refetchOnWindowFocus:!1,retry:1}}});class gc extends Error{}gc.prototype.name="InvalidTokenError";function L3(e){return decodeURIComponent(atob(e).replace(/(.)/g,(n,r)=>{let a=r.charCodeAt(0).toString(16).toUpperCase();return a.length<2&&(a="0"+a),"%"+a}))}function P3(e){let n=e.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return L3(n)}catch{return atob(n)}}function H3(e,n){if(typeof e!="string")throw new gc("Invalid token specified: must be a string");n||(n={});const r=n.header===!0?0:1,a=e.split(".")[r];if(typeof a!="string")throw new gc(`Invalid token specified: missing part #${r+1}`);let o;try{o=P3(a)}catch(u){throw new gc(`Invalid token specified: invalid base64 for part #${r+1} (${u.message})`)}try{return JSON.parse(o)}catch(u){throw new gc(`Invalid token specified: invalid json for part #${r+1} (${u.message})`)}}var q3={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},hr,mr,Vd=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(Vd||{});(e=>{function n(){hr=3,mr=q3}e.reset=n;function r(o){if(!(0<=o&&o<=4))throw new Error("Invalid log level");hr=o}e.setLevel=r;function a(o){mr=o}e.setLogger=a})(Vd||(Vd={}));var nt=class fr{constructor(n){this._name=n}debug(...n){hr>=4&&mr.debug(fr._format(this._name,this._method),...n)}info(...n){hr>=3&&mr.info(fr._format(this._name,this._method),...n)}warn(...n){hr>=2&&mr.warn(fr._format(this._name,this._method),...n)}error(...n){hr>=1&&mr.error(fr._format(this._name,this._method),...n)}throw(n){throw this.error(n),n}create(n){const r=Object.create(this);return r._method=n,r.debug("begin"),r}static createStatic(n,r){const a=new fr(`${n}.${r}`);return a.debug("begin"),a}static _format(n,r){const a=`[${n}]`;return r?`${a} ${r}:`:a}static debug(n,...r){hr>=4&&mr.debug(fr._format(n),...r)}static info(n,...r){hr>=3&&mr.info(fr._format(n),...r)}static warn(n,...r){hr>=2&&mr.warn(fr._format(n),...r)}static error(n,...r){hr>=1&&mr.error(fr._format(n),...r)}};Vd.reset();var Sc=class{static decode(e){try{return H3(e)}catch(n){throw nt.error("JwtUtils.decode",n),n}}static async generateSignedJwt(e,n,r){const a=Xt.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e))),o=Xt.encodeBase64Url(new TextEncoder().encode(JSON.stringify(n))),u=`${a}.${o}`,f=await window.crypto.subtle.sign({name:"ECDSA",hash:{name:"SHA-256"}},r,new TextEncoder().encode(u)),m=Xt.encodeBase64Url(new Uint8Array(f));return`${u}.${m}`}static async generateSignedJwtWithHmac(e,n,r){const a=Xt.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e))),o=Xt.encodeBase64Url(new TextEncoder().encode(JSON.stringify(n))),u=`${a}.${o}`,f=await window.crypto.subtle.sign("HMAC",r,new TextEncoder().encode(u)),m=Xt.encodeBase64Url(new Uint8Array(f));return`${u}.${m}`}},B3="10000000-1000-4000-8000-100000000000",V0=e=>btoa([...new Uint8Array(e)].map(n=>String.fromCharCode(n)).join("")),H_=class Bs{static _randomWord(){const n=new Uint32Array(1);return crypto.getRandomValues(n),n[0]}static generateUUIDv4(){return B3.replace(/[018]/g,r=>(+r^Bs._randomWord()&15>>+r/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Bs.generateUUIDv4()+Bs.generateUUIDv4()+Bs.generateUUIDv4()}static async generateCodeChallenge(n){if(!crypto.subtle)throw new Error("Crypto.subtle is available only in secure contexts (HTTPS).");try{const a=new TextEncoder().encode(n),o=await crypto.subtle.digest("SHA-256",a);return V0(o).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(r){throw nt.error("CryptoUtils.generateCodeChallenge",r),r}}static generateBasicAuth(n,r){const o=new TextEncoder().encode([n,r].join(":"));return V0(o)}static async hash(n,r){const a=new TextEncoder().encode(r),o=await crypto.subtle.digest(n,a);return new Uint8Array(o)}static async customCalculateJwkThumbprint(n){let r;switch(n.kty){case"RSA":r={e:n.e,kty:n.kty,n:n.n};break;case"EC":r={crv:n.crv,kty:n.kty,x:n.x,y:n.y};break;case"OKP":r={crv:n.crv,kty:n.kty,x:n.x};break;case"oct":r={crv:n.k,kty:n.kty};break;default:throw new Error("Unknown jwk type")}const a=await Bs.hash("SHA-256",JSON.stringify(r));return Bs.encodeBase64Url(a)}static async generateDPoPProof({url:n,accessToken:r,httpMethod:a,keyPair:o,nonce:u}){let f,m;const p={jti:window.crypto.randomUUID(),htm:a??"GET",htu:n,iat:Math.floor(Date.now()/1e3)};r&&(f=await Bs.hash("SHA-256",r),m=Bs.encodeBase64Url(f),p.ath=m),u&&(p.nonce=u);try{const y=await crypto.subtle.exportKey("jwk",o.publicKey),g={alg:"ES256",typ:"dpop+jwt",jwk:{crv:y.crv,kty:y.kty,x:y.x,y:y.y}};return await Sc.generateSignedJwt(g,p,o.privateKey)}catch(y){throw y instanceof TypeError?new Error(`Error exporting dpop public key: ${y.message}`):y}}static async generateDPoPJkt(n){try{const r=await crypto.subtle.exportKey("jwk",n.publicKey);return await Bs.customCalculateJwkThumbprint(r)}catch(r){throw r instanceof TypeError?new Error(`Could not retrieve dpop keys from storage: ${r.message}`):r}}static async generateDPoPKeys(){return await window.crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign","verify"])}static async generateClientAssertionJwt(n,r,a,o="HS256"){const u=Math.floor(Date.now()/1e3),f={alg:o,typ:"JWT"},m={iss:n,sub:n,aud:a,jti:Bs.generateUUIDv4(),exp:u+300,iat:u},y={HS256:"SHA-256",HS384:"SHA-384",HS512:"SHA-512"}[o];if(!y)throw new Error(`Unsupported algorithm: ${o}. Supported algorithms are: HS256, HS384, HS512`);const g=new TextEncoder,b=await crypto.subtle.importKey("raw",g.encode(r),{name:"HMAC",hash:y},!1,["sign"]);return await Sc.generateSignedJwtWithHmac(f,m,b)}};H_.encodeBase64Url=e=>V0(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");var Xt=H_,Ni=class{constructor(e){this._name=e,this._callbacks=[],this._logger=new nt(`Event('${this._name}')`)}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const n=this._callbacks.lastIndexOf(e);n>=0&&this._callbacks.splice(n,1)}async raise(...e){this._logger.debug("raise:",...e);for(const n of this._callbacks)await n(...e)}},lw=class{static center({...e}){var n,r,a;return e.width==null&&(e.width=(n=[800,720,600,480].find(o=>o<=window.outerWidth/1.618))!=null?n:360),(r=e.left)!=null||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),e.height!=null&&((a=e.top)!=null||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter(([,n])=>n!=null).map(([n,r])=>`${n}=${typeof r!="boolean"?r:r?"yes":"no"}`).join(",")}},Gr=class kd extends Ni{constructor(){super(...arguments),this._logger=new nt(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const n=this._expiration-kd.getEpochTime();this._logger.debug("timer completes in",n),this._expiration<=kd.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(n){const r=this._logger.create("init");n=Math.max(Math.floor(n),1);const a=kd.getEpochTime()+n;if(this.expiration===a&&this._timerHandle){r.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),r.debug("using duration",n),this._expiration=a;const o=Math.min(n,5);this._timerHandle=setInterval(this._callback,o*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},Z0=class{static readParams(e,n="query"){if(!e)throw new TypeError("Invalid URL");const a=new URL(e,"http://127.0.0.1")[n==="fragment"?"hash":"search"];return new URLSearchParams(a.slice(1))}},Jl=";",Da=class extends Error{constructor(e,n){var r,a,o;if(super(e.error_description||e.error||""),this.form=n,this.name="ErrorResponse",!e.error)throw nt.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=(r=e.error_description)!=null?r:null,this.error_uri=(a=e.error_uri)!=null?a:null,this.state=e.userState,this.session_state=(o=e.session_state)!=null?o:null,this.url_state=e.url_state}},Up=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},$3=class{constructor(e){this._logger=new nt("AccessTokenEvents"),this._expiringTimer=new Gr("Access token expiring"),this._expiredTimer=new Gr("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}async load(e){const n=this._logger.create("load");if(e.access_token&&e.expires_in!==void 0){const r=e.expires_in;if(n.debug("access token present, remaining duration:",r),r>0){let o=r-this._expiringNotificationTimeInSeconds;o<=0&&(o=1),n.debug("registering expiring timer, raising in",o,"seconds"),this._expiringTimer.init(o)}else n.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const a=r+1;n.debug("registering expired timer, raising in",a,"seconds"),this._expiredTimer.init(a)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}async unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},F3=class{constructor(e,n,r,a,o){this._callback=e,this._client_id=n,this._intervalInSeconds=a,this._stopOnError=o,this._logger=new nt("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=f=>{f.origin===this._frame_origin&&f.source===this._frame.contentWindow&&(f.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):f.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(f.data+" message from check session op iframe"))};const u=new URL(r);this._frame_origin=u.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=u.href}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const n=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};n(),this._timer=setInterval(n,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},q_=class{constructor(){this._logger=new nt("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,n){this._logger.create(`setItem('${e}')`),this._data[e]=n}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},G0=class extends Error{constructor(e,n){super(n),this.name="ErrorDPoPNonce",this.nonce=e}},Ip=class{constructor(e=[],n=null,r={}){this._jwtHandler=n,this._extraHeaders=r,this._logger=new nt("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),n&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,n={}){const{timeoutInSeconds:r,...a}=n;if(!r)return await fetch(e,a);const o=new AbortController,u=setTimeout(()=>o.abort(),r*1e3);try{return await fetch(e,{...n,signal:o.signal})}catch(f){throw f instanceof DOMException&&f.name==="AbortError"?new Up("Network timed out"):f}finally{clearTimeout(u)}}async getJson(e,{token:n,credentials:r,timeoutInSeconds:a}={}){const o=this._logger.create("getJson"),u={Accept:this._contentTypes.join(", ")};n&&(o.debug("token passed, setting Authorization header"),u.Authorization="Bearer "+n),this._appendExtraHeaders(u);let f;try{o.debug("url:",e),f=await this.fetchWithTimeout(e,{method:"GET",headers:u,timeoutInSeconds:a,credentials:r})}catch(y){throw o.error("Network Error"),y}o.debug("HTTP response received, status",f.status);const m=f.headers.get("Content-Type");if(m&&!this._contentTypes.find(y=>m.startsWith(y))&&o.throw(new Error(`Invalid response Content-Type: ${m??"undefined"}, from URL: ${e}`)),f.ok&&this._jwtHandler&&(m!=null&&m.startsWith("application/jwt")))return await this._jwtHandler(await f.text());let p;try{p=await f.json()}catch(y){throw o.error("Error parsing JSON response",y),f.ok?y:new Error(`${f.statusText} (${f.status})`)}if(!f.ok)throw o.error("Error from server:",p),p.error?new Da(p):new Error(`${f.statusText} (${f.status}): ${JSON.stringify(p)}`);return p}async postForm(e,{body:n,basicAuth:r,timeoutInSeconds:a,initCredentials:o,extraHeaders:u}){const f=this._logger.create("postForm"),m={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded",...u};r!==void 0&&(m.Authorization="Basic "+r),this._appendExtraHeaders(m);let p;try{f.debug("url:",e),p=await this.fetchWithTimeout(e,{method:"POST",headers:m,body:n,timeoutInSeconds:a,credentials:o})}catch(v){throw f.error("Network error"),v}f.debug("HTTP response received, status",p.status);const y=p.headers.get("Content-Type");if(y&&!this._contentTypes.find(v=>y.startsWith(v)))throw new Error(`Invalid response Content-Type: ${y??"undefined"}, from URL: ${e}`);const g=await p.text();let b={};if(g)try{b=JSON.parse(g)}catch(v){throw f.error("Error parsing JSON response",v),p.ok?v:new Error(`${p.statusText} (${p.status})`)}if(!p.ok){if(f.error("Error from server:",b),p.headers.has("dpop-nonce")){const v=p.headers.get("dpop-nonce");throw new G0(v,`${JSON.stringify(b)}`)}throw b.error?new Da(b,n):new Error(`${p.statusText} (${p.status}): ${JSON.stringify(b)}`)}return b}_appendExtraHeaders(e){const n=this._logger.create("appendExtraHeaders"),r=Object.keys(this._extraHeaders),a=["accept","content-type"],o=["authorization"];r.length!==0&&r.forEach(u=>{if(a.includes(u.toLocaleLowerCase())){n.warn("Protected header could not be set",u,a);return}if(o.includes(u.toLocaleLowerCase())&&Object.keys(e).includes(u)){n.warn("Header could not be overridden",u,o);return}const f=typeof this._extraHeaders[u]=="function"?this._extraHeaders[u]():this._extraHeaders[u];f&&f!==""&&(e[u]=f)})}},V3=class{constructor(e){this._settings=e,this._logger=new nt("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new Ip(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const n=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},n,this._settings.metadataSeed),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,n=!1){const r=this._logger.create(`_getMetadataProperty('${e}')`),a=await this.getMetadata();if(r.debug("resolved"),a[e]===void 0){if(n===!0){r.warn("Metadata does not contain optional property");return}r.throw(new Error("Metadata does not contain property "+e))}return a[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const n=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",n);const r=await this._jsonService.getJson(n,{timeoutInSeconds:this._settings.requestTimeoutInSeconds});if(e.debug("got key set",r),!Array.isArray(r.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=r.keys,this._signingKeys}},Lp=class{constructor({prefix:e="oidc.",store:n=localStorage}={}){this._logger=new nt("WebStorageStateStore"),this._store=n,this._prefix=e}async set(e,n){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,n)}async get(e){return this._logger.create(`get('${e}')`),e=this._prefix+e,await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const n=await this._store.getItem(e);return await this._store.removeItem(e),n}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,n=[];for(let r=0;r<e;r++){const a=await this._store.key(r);a&&a.indexOf(this._prefix)===0&&n.push(a.substr(this._prefix.length))}return n}},Z3="code",G3="openid",Q3="client_secret_post",K3=900,Q0=class{constructor({authority:e,metadataUrl:n,metadata:r,signingKeys:a,metadataSeed:o,client_id:u,client_secret:f,response_type:m=Z3,scope:p=G3,redirect_uri:y,post_logout_redirect_uri:g,client_authentication:b=Q3,token_endpoint_auth_signing_alg:v="HS256",prompt:S,display:A,max_age:C,ui_locales:O,acr_values:N,resource:j,response_mode:F,filterProtocolClaims:q=!0,loadUserInfo:B=!1,requestTimeoutInSeconds:re,staleStateAgeInSeconds:Q=K3,mergeClaimsStrategy:X={array:"replace"},disablePKCE:se=!1,stateStore:fe,revokeTokenAdditionalContentTypes:we,fetchRequestCredentials:Ce,refreshTokenAllowedScope:Z,extraQueryParams:W={},extraTokenParams:oe={},extraHeaders:ee={},dpop:z,omitScopeWhenRequesting:ue=!1}){var Me;if(this.authority=e,n?this.metadataUrl=n:(this.metadataUrl=e,e&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=r,this.metadataSeed=o,this.signingKeys=a,this.client_id=u,this.client_secret=f,this.response_type=m,this.scope=p,this.redirect_uri=y,this.post_logout_redirect_uri=g,this.client_authentication=b,this.token_endpoint_auth_signing_alg=v,this.prompt=S,this.display=A,this.max_age=C,this.ui_locales=O,this.acr_values=N,this.resource=j,this.response_mode=F,this.filterProtocolClaims=q??!0,this.loadUserInfo=!!B,this.staleStateAgeInSeconds=Q,this.mergeClaimsStrategy=X,this.omitScopeWhenRequesting=ue,this.disablePKCE=!!se,this.revokeTokenAdditionalContentTypes=we,this.fetchRequestCredentials=Ce||"same-origin",this.requestTimeoutInSeconds=re,fe)this.stateStore=fe;else{const Ae=typeof window<"u"?window.localStorage:new q_;this.stateStore=new Lp({store:Ae})}if(this.refreshTokenAllowedScope=Z,this.extraQueryParams=W,this.extraTokenParams=oe,this.extraHeaders=ee,this.dpop=z,this.dpop&&!((Me=this.dpop)!=null&&Me.store))throw new Error("A DPoPStore is required when dpop is enabled")}},Y3=class{constructor(e,n){this._settings=e,this._metadataService=n,this._logger=new nt("UserInfoService"),this._getClaimsFromJwt=async r=>{const a=this._logger.create("_getClaimsFromJwt");try{const o=Sc.decode(r);return a.debug("JWT decoding successful"),o}catch(o){throw a.error("Error parsing JWT response"),o}},this._jsonService=new Ip(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const n=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const r=await this._metadataService.getUserInfoEndpoint();n.debug("got userinfo url",r);const a=await this._jsonService.getJson(r,{token:e,credentials:this._settings.fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return n.debug("got claims",a),a}},B_=class{constructor(e,n){this._settings=e,this._metadataService=n,this._logger=new nt("TokenClient"),this._jsonService=new Ip(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:n=this._settings.redirect_uri,client_id:r=this._settings.client_id,client_secret:a=this._settings.client_secret,extraHeaders:o,...u}){const f=this._logger.create("exchangeCode");r||f.throw(new Error("A client_id is required")),n||f.throw(new Error("A redirect_uri is required")),u.code||f.throw(new Error("A code is required"));const m=new URLSearchParams({grant_type:e,redirect_uri:n});for(const[b,v]of Object.entries(u))v!=null&&m.set(b,v);if((this._settings.client_authentication==="client_secret_basic"||this._settings.client_authentication==="client_secret_jwt")&&a==null)throw f.throw(new Error("A client_secret is required")),null;let p;const y=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":p=Xt.generateBasicAuth(r,a);break;case"client_secret_post":m.append("client_id",r),a&&m.append("client_secret",a);break;case"client_secret_jwt":{const b=await Xt.generateClientAssertionJwt(r,a,y,this._settings.token_endpoint_auth_signing_alg);m.append("client_id",r),m.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),m.append("client_assertion",b);break}}f.debug("got token endpoint");const g=await this._jsonService.postForm(y,{body:m,basicAuth:p,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:o});return f.debug("got response"),g}async exchangeCredentials({grant_type:e="password",client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,scope:a=this._settings.scope,...o}){const u=this._logger.create("exchangeCredentials");n||u.throw(new Error("A client_id is required"));const f=new URLSearchParams({grant_type:e});this._settings.omitScopeWhenRequesting||f.set("scope",a);for(const[g,b]of Object.entries(o))b!=null&&f.set(g,b);if((this._settings.client_authentication==="client_secret_basic"||this._settings.client_authentication==="client_secret_jwt")&&r==null)throw u.throw(new Error("A client_secret is required")),null;let m;const p=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":m=Xt.generateBasicAuth(n,r);break;case"client_secret_post":f.append("client_id",n),r&&f.append("client_secret",r);break;case"client_secret_jwt":{const g=await Xt.generateClientAssertionJwt(n,r,p,this._settings.token_endpoint_auth_signing_alg);f.append("client_id",n),f.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),f.append("client_assertion",g);break}}u.debug("got token endpoint");const y=await this._jsonService.postForm(p,{body:f,basicAuth:m,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials});return u.debug("got response"),y}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,timeoutInSeconds:a,extraHeaders:o,...u}){const f=this._logger.create("exchangeRefreshToken");n||f.throw(new Error("A client_id is required")),u.refresh_token||f.throw(new Error("A refresh_token is required"));const m=new URLSearchParams({grant_type:e});for(const[b,v]of Object.entries(u))Array.isArray(v)?v.forEach(S=>m.append(b,S)):v!=null&&m.set(b,v);if((this._settings.client_authentication==="client_secret_basic"||this._settings.client_authentication==="client_secret_jwt")&&r==null)throw f.throw(new Error("A client_secret is required")),null;let p;const y=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":p=Xt.generateBasicAuth(n,r);break;case"client_secret_post":m.append("client_id",n),r&&m.append("client_secret",r);break;case"client_secret_jwt":{const b=await Xt.generateClientAssertionJwt(n,r,y,this._settings.token_endpoint_auth_signing_alg);m.append("client_id",n),m.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),m.append("client_assertion",b);break}}f.debug("got token endpoint");const g=await this._jsonService.postForm(y,{body:m,basicAuth:p,timeoutInSeconds:a,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:o});return f.debug("got response"),g}async revoke(e){var n;const r=this._logger.create("revoke");e.token||r.throw(new Error("A token is required"));const a=await this._metadataService.getRevocationEndpoint(!1);r.debug(`got revocation endpoint, revoking ${(n=e.token_type_hint)!=null?n:"default token type"}`);const o=new URLSearchParams;for(const[u,f]of Object.entries(e))f!=null&&o.set(u,f);o.set("client_id",this._settings.client_id),this._settings.client_secret&&o.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(a,{body:o,timeoutInSeconds:this._settings.requestTimeoutInSeconds}),r.debug("got response")}},J3=class{constructor(e,n,r){this._settings=e,this._metadataService=n,this._claimsService=r,this._logger=new nt("ResponseValidator"),this._userInfoService=new Y3(this._settings,this._metadataService),this._tokenClient=new B_(this._settings,this._metadataService)}async validateSigninResponse(e,n,r){const a=this._logger.create("validateSigninResponse");this._processSigninState(e,n),a.debug("state processed"),await this._processCode(e,n,r),a.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e,"",n.nonce),a.debug("tokens validated"),await this._processClaims(e,n==null?void 0:n.skipUserInfo,e.isOpenId),a.debug("claims processed")}async validateCredentialsResponse(e,n){const r=this._logger.create("validateCredentialsResponse"),a=e.isOpenId&&!!e.id_token;a&&this._validateIdTokenAttributes(e),r.debug("tokens validated"),await this._processClaims(e,n,a),r.debug("claims processed")}async validateRefreshResponse(e,n){var r,a;const o=this._logger.create("validateRefreshResponse");e.userState=n.data,(r=e.session_state)!=null||(e.session_state=n.session_state),(a=e.scope)!=null||(e.scope=n.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,n.id_token),o.debug("ID Token validated")),e.id_token||(e.id_token=n.id_token,e.profile=n.profile);const u=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,u),o.debug("claims processed")}validateSignoutResponse(e,n){const r=this._logger.create("validateSignoutResponse");if(n.id!==e.state&&r.throw(new Error("State does not match")),r.debug("state validated"),e.userState=n.data,e.error)throw r.warn("Response was error",e.error),new Da(e)}_processSigninState(e,n){var r;const a=this._logger.create("_processSigninState");if(n.id!==e.state&&a.throw(new Error("State does not match")),n.client_id||a.throw(new Error("No client_id on state")),n.authority||a.throw(new Error("No authority on state")),this._settings.authority!==n.authority&&a.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==n.client_id&&a.throw(new Error("client_id mismatch on settings vs. signin state")),a.debug("state validated"),e.userState=n.data,e.url_state=n.url_state,(r=e.scope)!=null||(e.scope=n.scope),e.error)throw a.warn("Response was error",e.error),new Da(e);n.code_verifier&&!e.code&&a.throw(new Error("Expected code in response"))}async _processClaims(e,n=!1,r=!0){const a=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),n||!this._settings.loadUserInfo||!e.access_token){a.debug("not loading user info");return}a.debug("loading user info");const o=await this._userInfoService.getClaims(e.access_token);a.debug("user info claims received from user info endpoint"),r&&o.sub!==e.profile.sub&&a.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(o)),a.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,n,r){const a=this._logger.create("_processCode");if(e.code){a.debug("Validating code");const o=await this._tokenClient.exchangeCode({client_id:n.client_id,client_secret:n.client_secret,code:e.code,redirect_uri:n.redirect_uri,code_verifier:n.code_verifier,extraHeaders:r,...n.extraTokenParams});Object.assign(e,o)}else a.debug("No code to process")}_validateIdTokenAttributes(e,n,r){var a;const o=this._logger.create("_validateIdTokenAttributes");o.debug("decoding ID Token JWT");const u=Sc.decode((a=e.id_token)!=null?a:"");if(u.sub||o.throw(new Error("ID Token is missing a subject claim")),r&&u.nonce!==r&&o.throw(new Error("nonce in id_token does not match nonce in client storage")),n){const f=Sc.decode(n);u.sub!==f.sub&&o.throw(new Error("sub in id_token does not match current sub")),u.auth_time&&u.auth_time!==f.auth_time&&o.throw(new Error("auth_time in id_token does not match original auth_time")),u.azp&&u.azp!==f.azp&&o.throw(new Error("azp in id_token does not match original azp")),!u.azp&&f.azp&&o.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=u}},Zd=class K0{constructor(n){this.id=n.id||Xt.generateUUIDv4(),this.data=n.data,n.created&&n.created>0?this.created=n.created:this.created=Gr.getEpochTime(),this.request_type=n.request_type,this.url_state=n.url_state}toStorageString(){return new nt("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(n){return nt.createStatic("State","fromStorageString"),Promise.resolve(new K0(JSON.parse(n)))}static async clearStaleState(n,r){const a=nt.createStatic("State","clearStaleState"),o=Gr.getEpochTime()-r,u=await n.getAllKeys();a.debug("got keys",u);for(let f=0;f<u.length;f++){const m=u[f],p=await n.get(m);let y=!1;if(p)try{const g=await K0.fromStorageString(p);a.debug("got item from key:",m,g.created),g.created<=o&&(y=!0)}catch(g){a.error("Error parsing state for key:",m,g),y=!0}else a.debug("no item in storage for key:",m),y=!0;y&&(a.debug("removed item for key:",m),n.remove(m))}}},$_=class Y0 extends Zd{constructor(n){super(n),this.code_verifier=n.code_verifier,this.code_challenge=n.code_challenge,this.authority=n.authority,this.client_id=n.client_id,this.redirect_uri=n.redirect_uri,this.scope=n.scope,this.client_secret=n.client_secret,this.extraTokenParams=n.extraTokenParams,this.response_mode=n.response_mode,this.skipUserInfo=n.skipUserInfo,this.nonce=n.nonce}static async create(n){const r=n.code_verifier===!0?Xt.generateCodeVerifier():n.code_verifier||void 0,a=r?await Xt.generateCodeChallenge(r):void 0;return new Y0({...n,code_verifier:r,code_challenge:a})}toStorageString(){return new nt("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo,nonce:this.nonce})}static fromStorageString(n){nt.createStatic("SigninState","fromStorageString");const r=JSON.parse(n);return Y0.create(r)}},F_=class V_{constructor(n){this.url=n.url,this.state=n.state}static async create({url:n,authority:r,client_id:a,redirect_uri:o,response_type:u,scope:f,state_data:m,response_mode:p,request_type:y,client_secret:g,nonce:b,url_state:v,resource:S,skipUserInfo:A,extraQueryParams:C,extraTokenParams:O,disablePKCE:N,dpopJkt:j,omitScopeWhenRequesting:F,...q}){if(!n)throw this._logger.error("create: No url passed"),new Error("url");if(!a)throw this._logger.error("create: No client_id passed"),new Error("client_id");if(!o)throw this._logger.error("create: No redirect_uri passed"),new Error("redirect_uri");if(!u)throw this._logger.error("create: No response_type passed"),new Error("response_type");if(!f)throw this._logger.error("create: No scope passed"),new Error("scope");if(!r)throw this._logger.error("create: No authority passed"),new Error("authority");const B=await $_.create({data:m,request_type:y,url_state:v,code_verifier:!N,client_id:a,authority:r,redirect_uri:o,response_mode:p,client_secret:g,scope:f,extraTokenParams:O,skipUserInfo:A,nonce:b}),re=new URL(n);re.searchParams.append("client_id",a),re.searchParams.append("redirect_uri",o),re.searchParams.append("response_type",u),F||re.searchParams.append("scope",f),b&&re.searchParams.append("nonce",b),j&&re.searchParams.append("dpop_jkt",j);let Q=B.id;v&&(Q=`${Q}${Jl}${v}`),re.searchParams.append("state",Q),B.code_challenge&&(re.searchParams.append("code_challenge",B.code_challenge),re.searchParams.append("code_challenge_method","S256")),S&&(Array.isArray(S)?S:[S]).forEach(se=>re.searchParams.append("resource",se));for(const[X,se]of Object.entries({response_mode:p,...q,...C}))se!=null&&re.searchParams.append(X,se.toString());return new V_({url:re.href,state:B})}};F_._logger=new nt("SigninRequest");var X3=F_,W3="openid",i0=class{constructor(e){if(this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.state){const n=decodeURIComponent(this.state).split(Jl);this.state=n[0],n.length>1&&(this.url_state=n.slice(1).join(Jl))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-Gr.getEpochTime()}set expires_in(e){typeof e=="string"&&(e=Number(e)),e!==void 0&&e>=0&&(this.expires_at=Math.floor(e)+Gr.getEpochTime())}get isOpenId(){var e;return((e=this.scope)==null?void 0:e.split(" ").includes(W3))||!!this.id_token}},eA=class{constructor({url:e,state_data:n,id_token_hint:r,post_logout_redirect_uri:a,extraQueryParams:o,request_type:u,client_id:f,url_state:m}){if(this._logger=new nt("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const p=new URL(e);if(r&&p.searchParams.append("id_token_hint",r),f&&p.searchParams.append("client_id",f),a&&(p.searchParams.append("post_logout_redirect_uri",a),n||m)){this.state=new Zd({data:n,request_type:u,url_state:m});let y=this.state.id;m&&(y=`${y}${Jl}${m}`),p.searchParams.append("state",y)}for(const[y,g]of Object.entries({...o}))g!=null&&p.searchParams.append(y,g.toString());this.url=p.href}},tA=class{constructor(e){if(this.state=e.get("state"),this.state){const n=decodeURIComponent(this.state).split(Jl);this.state=n[0],n.length>1&&(this.url_state=n.slice(1).join(Jl))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},nA=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],sA=["sub","iss","aud","exp","iat"],rA=class{constructor(e){this._settings=e,this._logger=new nt("ClaimsService")}filterProtocolClaims(e){const n={...e};if(this._settings.filterProtocolClaims){let r;Array.isArray(this._settings.filterProtocolClaims)?r=this._settings.filterProtocolClaims:r=nA;for(const a of r)sA.includes(a)||delete n[a]}return n}mergeClaims(e,n){const r={...e};for(const[a,o]of Object.entries(n))if(r[a]!==o)if(Array.isArray(r[a])||Array.isArray(o))if(this._settings.mergeClaimsStrategy.array=="replace")r[a]=o;else{const u=Array.isArray(r[a])?r[a]:[r[a]];for(const f of Array.isArray(o)?o:[o])u.includes(f)||u.push(f);r[a]=u}else typeof r[a]=="object"&&typeof o=="object"?r[a]=this.mergeClaims(r[a],o):r[a]=o;return r}},Z_=class{constructor(e,n){this.keys=e,this.nonce=n}},iA=class{constructor(e,n){this._logger=new nt("OidcClient"),this.settings=e instanceof Q0?e:new Q0(e),this.metadataService=n??new V3(this.settings),this._claimsService=new rA(this.settings),this._validator=new J3(this.settings,this.metadataService,this._claimsService),this._tokenClient=new B_(this.settings,this.metadataService)}async createSigninRequest({state:e,request:n,request_uri:r,request_type:a,id_token_hint:o,login_hint:u,skipUserInfo:f,nonce:m,url_state:p,response_type:y=this.settings.response_type,scope:g=this.settings.scope,redirect_uri:b=this.settings.redirect_uri,prompt:v=this.settings.prompt,display:S=this.settings.display,max_age:A=this.settings.max_age,ui_locales:C=this.settings.ui_locales,acr_values:O=this.settings.acr_values,resource:N=this.settings.resource,response_mode:j=this.settings.response_mode,extraQueryParams:F=this.settings.extraQueryParams,extraTokenParams:q=this.settings.extraTokenParams,dpopJkt:B,omitScopeWhenRequesting:re=this.settings.omitScopeWhenRequesting}){const Q=this._logger.create("createSigninRequest");if(y!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const X=await this.metadataService.getAuthorizationEndpoint();Q.debug("Received authorization endpoint",X);const se=await X3.create({url:X,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:b,response_type:y,scope:g,state_data:e,url_state:p,prompt:v,display:S,max_age:A,ui_locales:C,id_token_hint:o,login_hint:u,acr_values:O,dpopJkt:B,resource:N,request:n,request_uri:r,extraQueryParams:F,extraTokenParams:q,request_type:a,response_mode:j,client_secret:this.settings.client_secret,skipUserInfo:f,nonce:m,disablePKCE:this.settings.disablePKCE,omitScopeWhenRequesting:re});await this.clearStaleState();const fe=se.state;return await this.settings.stateStore.set(fe.id,fe.toStorageString()),se}async readSigninResponseState(e,n=!1){const r=this._logger.create("readSigninResponseState"),a=new i0(Z0.readParams(e,this.settings.response_mode));if(!a.state)throw r.throw(new Error("No state in response")),null;const o=await this.settings.stateStore[n?"remove":"get"](a.state);if(!o)throw r.throw(new Error("No matching state found in storage")),null;return{state:await $_.fromStorageString(o),response:a}}async processSigninResponse(e,n,r=!0){const a=this._logger.create("processSigninResponse"),{state:o,response:u}=await this.readSigninResponseState(e,r);if(a.debug("received state from storage; validating response"),this.settings.dpop&&this.settings.dpop.store){const f=await this.getDpopProof(this.settings.dpop.store);n={...n,DPoP:f}}try{await this._validator.validateSigninResponse(u,o,n)}catch(f){if(f instanceof G0&&this.settings.dpop){const m=await this.getDpopProof(this.settings.dpop.store,f.nonce);n.DPoP=m,await this._validator.validateSigninResponse(u,o,n)}else throw f}return u}async getDpopProof(e,n){let r,a;return(await e.getAllKeys()).includes(this.settings.client_id)?(a=await e.get(this.settings.client_id),a.nonce!==n&&n&&(a.nonce=n,await e.set(this.settings.client_id,a))):(r=await Xt.generateDPoPKeys(),a=new Z_(r,n),await e.set(this.settings.client_id,a)),await Xt.generateDPoPProof({url:await this.metadataService.getTokenEndpoint(!1),httpMethod:"POST",keyPair:a.keys,nonce:a.nonce})}async processResourceOwnerPasswordCredentials({username:e,password:n,skipUserInfo:r=!1,extraTokenParams:a={}}){const o=await this._tokenClient.exchangeCredentials({username:e,password:n,...a}),u=new i0(new URLSearchParams);return Object.assign(u,o),await this._validator.validateCredentialsResponse(u,r),u}async useRefreshToken({state:e,redirect_uri:n,resource:r,timeoutInSeconds:a,extraHeaders:o,extraTokenParams:u}){var f;const m=this._logger.create("useRefreshToken");let p;if(this.settings.refreshTokenAllowedScope===void 0)p=e.scope;else{const b=this.settings.refreshTokenAllowedScope.split(" ");p=(((f=e.scope)==null?void 0:f.split(" "))||[]).filter(S=>b.includes(S)).join(" ")}if(this.settings.dpop&&this.settings.dpop.store){const b=await this.getDpopProof(this.settings.dpop.store);o={...o,DPoP:b}}let y;try{y=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:p,redirect_uri:n,resource:r,timeoutInSeconds:a,extraHeaders:o,...u})}catch(b){if(b instanceof G0&&this.settings.dpop)o.DPoP=await this.getDpopProof(this.settings.dpop.store,b.nonce),y=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:p,redirect_uri:n,resource:r,timeoutInSeconds:a,extraHeaders:o,...u});else throw b}const g=new i0(new URLSearchParams);return Object.assign(g,y),m.debug("validating response",g),await this._validator.validateRefreshResponse(g,{...e,scope:p}),g}async createSignoutRequest({state:e,id_token_hint:n,client_id:r,request_type:a,url_state:o,post_logout_redirect_uri:u=this.settings.post_logout_redirect_uri,extraQueryParams:f=this.settings.extraQueryParams}={}){const m=this._logger.create("createSignoutRequest"),p=await this.metadataService.getEndSessionEndpoint();if(!p)throw m.throw(new Error("No end session endpoint")),null;m.debug("Received end session endpoint",p),!r&&u&&!n&&(r=this.settings.client_id);const y=new eA({url:p,id_token_hint:n,client_id:r,post_logout_redirect_uri:u,state_data:e,extraQueryParams:f,request_type:a,url_state:o});await this.clearStaleState();const g=y.state;return g&&(m.debug("Signout request has state to persist"),await this.settings.stateStore.set(g.id,g.toStorageString())),y}async readSignoutResponseState(e,n=!1){const r=this._logger.create("readSignoutResponseState"),a=new tA(Z0.readParams(e,this.settings.response_mode));if(!a.state){if(r.debug("No state in response"),a.error)throw r.warn("Response was error:",a.error),new Da(a);return{state:void 0,response:a}}const o=await this.settings.stateStore[n?"remove":"get"](a.state);if(!o)throw r.throw(new Error("No matching state found in storage")),null;return{state:await Zd.fromStorageString(o),response:a}}async processSignoutResponse(e){const n=this._logger.create("processSignoutResponse"),{state:r,response:a}=await this.readSignoutResponseState(e,!0);return r?(n.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(a,r)):n.debug("No state from storage; skipping response validation"),a}clearStaleState(){return this._logger.create("clearStaleState"),Zd.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,n){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:n})}},aA=class{constructor(e){this._userManager=e,this._logger=new nt("SessionMonitor"),this._start=async n=>{const r=n.session_state;if(!r)return;const a=this._logger.create("_start");if(n.profile?(this._sub=n.profile.sub,a.debug("session_state",r,", sub",this._sub)):(this._sub=void 0,a.debug("session_state",r,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(r);return}try{const o=await this._userManager.metadataService.getCheckSessionIframe();if(o){a.debug("initializing check session iframe");const u=this._userManager.settings.client_id,f=this._userManager.settings.checkSessionIntervalInSeconds,m=this._userManager.settings.stopCheckSessionOnError,p=new F3(this._callback,u,o,f,m);await p.load(),this._checkSessionIFrame=p,p.start(r)}else a.warn("no check session iframe found in the metadata")}catch(o){a.error("Error from getCheckSessionIframe:",o instanceof Error?o.message:o)}},this._stop=()=>{const n=this._logger.create("_stop");if(this._sub=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const r=setInterval(async()=>{clearInterval(r);try{const a=await this._userManager.querySessionStatus();if(a){const o={session_state:a.session_state,profile:a.sub?{sub:a.sub}:null};this._start(o)}}catch(a){n.error("error from querySessionStatus",a instanceof Error?a.message:a)}},1e3)}},this._callback=async()=>{const n=this._logger.create("_callback");try{const r=await this._userManager.querySessionStatus();let a=!0;r&&this._checkSessionIFrame?r.sub===this._sub?(a=!1,this._checkSessionIFrame.start(r.session_state),n.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",r.session_state),await this._userManager.events._raiseUserSessionChanged()):n.debug("different subject signed into OP",r.sub):n.debug("subject no longer signed into OP"),a?this._sub?await this._userManager.events._raiseUserSignedOut():await this._userManager.events._raiseUserSignedIn():n.debug("no change in session detected, no event to raise")}catch(r){this._sub&&(n.debug("Error calling queryCurrentSigninSession; raising signed out event",r),await this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(n=>{this._logger.error(n)})}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const n=await this._userManager.querySessionStatus();if(n){const r={session_state:n.session_state,profile:n.sub?{sub:n.sub}:null};this._start(r)}}}},a0=class G_{constructor(n){var r;this.id_token=n.id_token,this.session_state=(r=n.session_state)!=null?r:null,this.access_token=n.access_token,this.refresh_token=n.refresh_token,this.token_type=n.token_type,this.scope=n.scope,this.profile=n.profile,this.expires_at=n.expires_at,this.state=n.userState,this.url_state=n.url_state}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-Gr.getEpochTime()}set expires_in(n){n!==void 0&&(this.expires_at=Math.floor(n)+Gr.getEpochTime())}get expired(){const n=this.expires_in;if(n!==void 0)return n<=0}get scopes(){var n,r;return(r=(n=this.scope)==null?void 0:n.split(" "))!=null?r:[]}toStorageString(){return new nt("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(n){return nt.createStatic("User","fromStorageString"),new G_(JSON.parse(n))}},ow="oidc-client",Q_=class{constructor(){this._abort=new Ni("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const n=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");n.debug("setting URL in window"),this._window.location.replace(e.url);const{url:r,keepOpen:a}=await new Promise((o,u)=>{const f=p=>{var y;const g=p.data,b=(y=e.scriptOrigin)!=null?y:window.location.origin;if(!(p.origin!==b||(g==null?void 0:g.source)!==ow)){try{const v=Z0.readParams(g.url,e.response_mode).get("state");if(v||n.warn("no state found in response url"),p.source!==this._window&&v!==e.state)return}catch{this._dispose(),u(new Error("Invalid response from window"))}o(g)}};window.addEventListener("message",f,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",f,!1));const m=new BroadcastChannel(`oidc-client-popup-${e.state}`);m.addEventListener("message",f,!1),this._disposeHandlers.add(()=>m.close()),this._disposeHandlers.add(this._abort.addHandler(p=>{this._dispose(),u(p)}))});return n.debug("got response from window"),this._dispose(),a||this.close(),{url:r}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,n,r=!1,a=window.location.origin){const o={source:ow,url:n,keepOpen:r},u=new nt("_notifyParent");if(e)u.debug("With parent. Using parent.postMessage."),e.postMessage(o,a);else{u.debug("No parent. Using BroadcastChannel.");const f=new URL(n).searchParams.get("state");if(!f)throw new Error("No parent and no state in URL. Can't complete notification.");const m=new BroadcastChannel(`oidc-client-popup-${f}`);m.postMessage(o),m.close()}}},K_={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},Y_="_blank",lA=60,oA=2,J_=10,cA=class extends Q0{constructor(e){const{popup_redirect_uri:n=e.redirect_uri,popup_post_logout_redirect_uri:r=e.post_logout_redirect_uri,popupWindowFeatures:a=K_,popupWindowTarget:o=Y_,redirectMethod:u="assign",redirectTarget:f="self",iframeNotifyParentOrigin:m=e.iframeNotifyParentOrigin,iframeScriptOrigin:p=e.iframeScriptOrigin,requestTimeoutInSeconds:y,silent_redirect_uri:g=e.redirect_uri,silentRequestTimeoutInSeconds:b,automaticSilentRenew:v=!0,validateSubOnSilentRenew:S=!0,includeIdTokenInSilentRenew:A=!1,monitorSession:C=!1,monitorAnonymousSession:O=!1,checkSessionIntervalInSeconds:N=oA,query_status_response_type:j="code",stopCheckSessionOnError:F=!0,revokeTokenTypes:q=["access_token","refresh_token"],revokeTokensOnSignout:B=!1,includeIdTokenInSilentSignout:re=!1,accessTokenExpiringNotificationTimeInSeconds:Q=lA,maxSilentRenewTimeoutRetries:X,userStore:se}=e;if(super(e),this.popup_redirect_uri=n,this.popup_post_logout_redirect_uri=r,this.popupWindowFeatures=a,this.popupWindowTarget=o,this.redirectMethod=u,this.redirectTarget=f,this.iframeNotifyParentOrigin=m,this.iframeScriptOrigin=p,this.silent_redirect_uri=g,this.silentRequestTimeoutInSeconds=b||y||J_,this.automaticSilentRenew=v,this.validateSubOnSilentRenew=S,this.includeIdTokenInSilentRenew=A,this.monitorSession=C,this.monitorAnonymousSession=O,this.checkSessionIntervalInSeconds=N,this.stopCheckSessionOnError=F,this.query_status_response_type=j,this.revokeTokenTypes=q,this.revokeTokensOnSignout=B,this.includeIdTokenInSilentSignout=re,this.accessTokenExpiringNotificationTimeInSeconds=Q,this.maxSilentRenewTimeoutRetries=X,se)this.userStore=se;else{const fe=typeof window<"u"?window.sessionStorage:new q_;this.userStore=new Lp({store:fe})}}},cw=class X_ extends Q_{constructor({silentRequestTimeoutInSeconds:n=J_}){super(),this._logger=new nt("IFrameWindow"),this._timeoutInSeconds=n,this._frame=X_.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const n=window.document.createElement("iframe");return n.style.visibility="hidden",n.style.position="fixed",n.style.left="-1000px",n.style.top="0",n.width="0",n.height="0",window.document.body.appendChild(n),n}async navigate(n){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const r=setTimeout(()=>void this._abort.raise(new Up("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(r)),await super.navigate(n)}close(){var n;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",r=>{var a;const o=r.target;(a=o.parentNode)==null||a.removeChild(o),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(n=this._frame.contentWindow)==null||n.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(n,r){return super._notifyParent(window.parent,n,!1,r)}},uA=class{constructor(e){this._settings=e,this._logger=new nt("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new cw({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),cw.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},dA=500,fA=1e3,uw=class extends Q_{constructor({popupWindowTarget:e=Y_,popupWindowFeatures:n={},popupSignal:r,popupAbortOnClose:a}){super(),this._logger=new nt("PopupWindow");const o=lw.center({...K_,...n});this._window=window.open(void 0,e,lw.serialize(o)),this.abortOnClose=!!a,r&&r.addEventListener("abort",()=>{var u;this._abort.raise(new Error((u=r.reason)!=null?u:"Popup aborted"))}),n.closePopupWindowAfterInSeconds&&n.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{if(!this._window||typeof this._window.closed!="boolean"||this._window.closed){this._abort.raise(new Error("Popup blocked by user"));return}this.close()},n.closePopupWindowAfterInSeconds*fA)}async navigate(e){var n;(n=this._window)==null||n.focus();const r=setInterval(()=>{(!this._window||this._window.closed)&&(this._logger.debug("Popup closed by user or isolated by redirect"),a(),this._disposeHandlers.delete(a),this.abortOnClose&&this._abort.raise(new Error("Popup closed by user")))},dA),a=()=>clearInterval(r);return this._disposeHandlers.add(a),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,n){super._notifyParent(window.opener,e,n),!n&&!window.opener&&window.close()}},hA=class{constructor(e){this._settings=e,this._logger=new nt("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:n=this._settings.popupWindowTarget,popupSignal:r,popupAbortOnClose:a}){return new uw({popupWindowFeatures:e,popupWindowTarget:n,popupSignal:r,popupAbortOnClose:a})}async callback(e,{keepOpen:n=!1}){this._logger.create("callback"),uw.notifyOpener(e,n)}},mA=class{constructor(e){this._settings=e,this._logger=new nt("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:n=this._settings.redirectTarget}){var r;this._logger.create("prepare");let a=window.self;n==="top"&&(a=(r=window.top)!=null?r:window.self);const o=a.location[e].bind(a.location);let u;return{navigate:async f=>(this._logger.create("navigate"),await new Promise((p,y)=>{u=y,window.addEventListener("pageshow",()=>p(window.location.href)),o(f.url)})),close:()=>{this._logger.create("close"),u==null||u(new Error("Redirect aborted")),a.stop()}}}async callback(){}},pA=class extends $3{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new nt("UserManagerEvents"),this._userLoaded=new Ni("User loaded"),this._userUnloaded=new Ni("User unloaded"),this._silentRenewError=new Ni("Silent renew error"),this._userSignedIn=new Ni("User signed in"),this._userSignedOut=new Ni("User signed out"),this._userSessionChanged=new Ni("User session changed")}async load(e,n=!0){await super.load(e),n&&await this._userLoaded.raise(e)}async unload(){await super.unload(),await this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}async _raiseSilentRenewError(e){await this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}async _raiseUserSignedIn(){await this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}async _raiseUserSignedOut(){await this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}async _raiseUserSessionChanged(){await this._userSessionChanged.raise()}},gA=class{constructor(e){this._userManager=e,this._logger=new nt("SilentRenewService"),this._isStarted=!1,this._retryTimer=new Gr("Retry Silent Renew"),this._timeoutRetryCount=0,this._tokenExpiring=async()=>{const n=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),this._timeoutRetryCount=0,n.debug("silent token renewal successful")}catch(r){if(r instanceof Up){this._timeoutRetryCount++;const a=this._userManager.settings.maxSilentRenewTimeoutRetries;if(a!==void 0&&this._timeoutRetryCount>a){n.error(`Timeout retry limit reached (${this._timeoutRetryCount} > ${a}), raising silentRenewError:`,r),this._timeoutRetryCount=0,await this._userManager.events._raiseSilentRenewError(r);return}n.warn(`ErrorTimeout from signinSilent (attempt ${this._timeoutRetryCount}), retry in 5s:`,r),this._retryTimer.init(5);return}n.error("Error from signinSilent:",r),this._timeoutRetryCount=0,await this._userManager.events._raiseSilentRenewError(r)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(n){e.error("getUser error",n)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},bA=class{constructor(e){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.data=e.state}},xA=class{constructor(e,n,r,a){this._logger=new nt("UserManager"),this.settings=new cA(e),this._client=new iA(e),this._redirectNavigator=n??new mA(this.settings),this._popupNavigator=r??new hA(this.settings),this._iframeNavigator=a??new uA(this.settings),this._events=new pA(this.settings),this._silentRenewService=new gA(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new aA(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(e=!1){const n=this._logger.create("getUser"),r=await this._loadUser();return r?(n.info("user loaded"),await this._events.load(r,e),r):(n.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),await this._events.unload()}async signinRedirect(e={}){var n;this._logger.create("signinRedirect");const{redirectMethod:r,...a}=e;let o;(n=this.settings.dpop)!=null&&n.bind_authorization_code&&(o=await this.generateDPoPJkt(this.settings.dpop));const u=await this._redirectNavigator.prepare({redirectMethod:r});await this._signinStart({request_type:"si:r",dpopJkt:o,...a},u)}async signinRedirectCallback(e=window.location.href){const n=this._logger.create("signinRedirectCallback"),r=await this._signinEnd(e);return r.profile&&r.profile.sub?n.info("success, signed in subject",r.profile.sub):n.info("no subject"),r}async signinResourceOwnerCredentials({username:e,password:n,skipUserInfo:r=!1}){const a=this._logger.create("signinResourceOwnerCredential"),o=await this._client.processResourceOwnerPasswordCredentials({username:e,password:n,skipUserInfo:r,extraTokenParams:this.settings.extraTokenParams});a.debug("got signin response");const u=await this._buildUser(o);return u.profile&&u.profile.sub?a.info("success, signed in subject",u.profile.sub):a.info("no subject"),u}async signinPopup(e={}){var n;const r=this._logger.create("signinPopup");let a;(n=this.settings.dpop)!=null&&n.bind_authorization_code&&(a=await this.generateDPoPJkt(this.settings.dpop));const{popupWindowFeatures:o,popupWindowTarget:u,popupSignal:f,popupAbortOnClose:m,...p}=e,y=this.settings.popup_redirect_uri;y||r.throw(new Error("No popup_redirect_uri configured"));const g=await this._popupNavigator.prepare({popupWindowFeatures:o,popupWindowTarget:u,popupSignal:f,popupAbortOnClose:m}),b=await this._signin({request_type:"si:p",redirect_uri:y,display:"popup",dpopJkt:a,...p},g);return b&&(b.profile&&b.profile.sub?r.info("success, signed in subject",b.profile.sub):r.info("no subject")),b}async signinPopupCallback(e=window.location.href,n=!1){const r=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,{keepOpen:n}),r.info("success")}async signinSilent(e={}){var n,r;const a=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:o,...u}=e;let f=await this._loadUser();if(!e.forceIframeAuth&&(f!=null&&f.refresh_token)){a.debug("using refresh token");const b=new bA(f);return await this._useRefreshToken({state:b,redirect_uri:u.redirect_uri,resource:u.resource,extraTokenParams:u.extraTokenParams,timeoutInSeconds:o})}let m;(n=this.settings.dpop)!=null&&n.bind_authorization_code&&(m=await this.generateDPoPJkt(this.settings.dpop));const p=this.settings.silent_redirect_uri;p||a.throw(new Error("No silent_redirect_uri configured"));let y;f&&this.settings.validateSubOnSilentRenew&&(a.debug("subject prior to silent renew:",f.profile.sub),y=f.profile.sub);const g=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:o});return f=await this._signin({request_type:"si:s",redirect_uri:p,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?f==null?void 0:f.id_token:void 0,dpopJkt:m,...u},g,y),f&&((r=f.profile)!=null&&r.sub?a.info("success, signed in subject",f.profile.sub):a.info("no subject")),f}async _useRefreshToken(e){const n=await this._client.useRefreshToken({timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds,...e}),r=new a0({...e.state,...n});return await this.storeUser(r),await this._events.load(r),r}async signinSilentCallback(e=window.location.href){const n=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),n.info("success")}async signinCallback(e=window.location.href){const{state:n}=await this._client.readSigninResponseState(e);switch(n.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":await this.signinPopupCallback(e);break;case"si:s":await this.signinSilentCallback(e);break;default:throw new Error("invalid request_type in state")}}async signoutCallback(e=window.location.href,n=!1){const{state:r}=await this._client.readSignoutResponseState(e);if(r)switch(r.request_type){case"so:r":return await this.signoutRedirectCallback(e);case"so:p":await this.signoutPopupCallback(e,n);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid request_type in state")}}async querySessionStatus(e={}){const n=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:r,...a}=e,o=this.settings.silent_redirect_uri;o||n.throw(new Error("No silent_redirect_uri configured"));const u=await this._loadUser(),f=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r}),m=await this._signinStart({request_type:"si:s",redirect_uri:o,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?u==null?void 0:u.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...a},f);try{const p={},y=await this._client.processSigninResponse(m.url,p);return n.debug("got signin response"),y.session_state&&y.profile.sub?(n.info("success for subject",y.profile.sub),{session_state:y.session_state,sub:y.profile.sub}):(n.info("success, user not authenticated"),null)}catch(p){if(this.settings.monitorAnonymousSession&&p instanceof Da)switch(p.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return n.info("success for anonymous user"),{session_state:p.session_state}}throw p}}async _signin(e,n,r){const a=await this._signinStart(e,n);return await this._signinEnd(a.url,r)}async _signinStart(e,n){const r=this._logger.create("_signinStart");try{const a=await this._client.createSigninRequest(e);return r.debug("got signin request"),await n.navigate({url:a.url,state:a.state.id,response_mode:a.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(a){throw r.debug("error after preparing navigator, closing navigator window"),n.close(),a}}async _signinEnd(e,n){const r=this._logger.create("_signinEnd"),a={},o=await this._client.processSigninResponse(e,a);return r.debug("got signin response"),await this._buildUser(o,n)}async _buildUser(e,n){const r=this._logger.create("_buildUser"),a=new a0(e);if(n){if(n!==a.profile.sub)throw r.debug("current user does not match user returned from signin. sub from signin:",a.profile.sub),new Da({...e,error:"login_required"});r.debug("current user matches user returned from signin")}return await this.storeUser(a),r.debug("user stored"),await this._events.load(a),a}async signoutRedirect(e={}){const n=this._logger.create("signoutRedirect"),{redirectMethod:r,...a}=e,o=await this._redirectNavigator.prepare({redirectMethod:r});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...a},o),n.info("success")}async signoutRedirectCallback(e=window.location.href){const n=this._logger.create("signoutRedirectCallback"),r=await this._signoutEnd(e);return n.info("success"),r}async signoutPopup(e={}){const n=this._logger.create("signoutPopup"),{popupWindowFeatures:r,popupWindowTarget:a,popupSignal:o,...u}=e,f=this.settings.popup_post_logout_redirect_uri,m=await this._popupNavigator.prepare({popupWindowFeatures:r,popupWindowTarget:a,popupSignal:o});await this._signout({request_type:"so:p",post_logout_redirect_uri:f,state:f==null?void 0:{},...u},m),n.info("success")}async signoutPopupCallback(e=window.location.href,n=!1){const r=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,{keepOpen:n}),r.info("success")}async _signout(e,n){const r=await this._signoutStart(e,n);return await this._signoutEnd(r.url)}async _signoutStart(e={},n){var r;const a=this._logger.create("_signoutStart");try{const o=await this._loadUser();a.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(o);const u=e.id_token_hint||o&&o.id_token;u&&(a.debug("setting id_token_hint in signout request"),e.id_token_hint=u),await this.removeUser(),a.debug("user removed, creating signout request");const f=await this._client.createSignoutRequest(e);return a.debug("got signout request"),await n.navigate({url:f.url,state:(r=f.state)==null?void 0:r.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(o){throw a.debug("error after preparing navigator, closing navigator window"),n.close(),o}}async _signoutEnd(e){const n=this._logger.create("_signoutEnd"),r=await this._client.processSignoutResponse(e);return n.debug("got signout response"),r}async signoutSilent(e={}){var n;const r=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:a,...o}=e,u=this.settings.includeIdTokenInSilentSignout?(n=await this._loadUser())==null?void 0:n.id_token:void 0,f=this.settings.popup_post_logout_redirect_uri,m=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:a});await this._signout({request_type:"so:s",post_logout_redirect_uri:f,id_token_hint:u,...o},m),r.info("success")}async signoutSilentCallback(e=window.location.href){const n=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),n.info("success")}async revokeTokens(e){const n=await this._loadUser();await this._revokeInternal(n,e)}async _revokeInternal(e,n=this.settings.revokeTokenTypes){const r=this._logger.create("_revokeInternal");if(!e)return;const a=n.filter(o=>typeof e[o]=="string");if(!a.length){r.debug("no need to revoke due to no token(s)");return}for(const o of a)await this._client.revokeToken(e[o],o),r.info(`${o} revoked successfully`),o!=="access_token"&&(e[o]=null);await this.storeUser(e),r.debug("user stored"),await this._events.load(e)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),n=await this.settings.userStore.get(this._userStoreKey);return n?(e.debug("user storageString loaded"),a0.fromStorageString(n)):(e.debug("no user storageString"),null)}async storeUser(e){const n=this._logger.create("storeUser");if(e){n.debug("storing user");const r=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,r)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey),this.settings.dpop&&await this.settings.dpop.store.remove(this.settings.client_id)}async clearStaleState(){await this._client.clearStaleState()}async dpopProof(e,n,r,a){var o,u;const f=await((u=(o=this.settings.dpop)==null?void 0:o.store)==null?void 0:u.get(this.settings.client_id));if(f)return await Xt.generateDPoPProof({url:e,accessToken:n==null?void 0:n.access_token,httpMethod:r,keyPair:f.keys,nonce:a})}async generateDPoPJkt(e){let n=await e.store.get(this.settings.client_id);if(!n){const r=await Xt.generateDPoPKeys();n=new Z_(r),await e.store.set(this.settings.client_id,n)}return await Xt.generateDPoPJkt(n.keys)}};const yA=e=>[...new Set(e)],vA=(e,n)=>e.filter(r=>!n.includes(r)),wA=(e,n)=>e.filter(r=>n.includes(r)),_A=e=>typeof e=="bigint"||!Number.isNaN(Number(e))&&Math.floor(Number(e))===e,SA=e=>typeof e=="bigint"||e>=0&&Number.isSafeInteger(e);function lc(e,n){if(n.length===0)return e;let r;const a=[...e];for(let o=a.length-1,u=0,f=0;o>0;o--,u++){u%=n.length,f+=r=n[u].codePointAt(0);const m=(r+u+f)%o,p=a[o],y=a[m];a[m]=p,a[o]=y}return a}const NA=(e,n)=>{const r=[];let a=e;if(typeof a=="bigint"){const o=BigInt(n.length);do r.unshift(n[Number(a%o)]),a/=o;while(a>BigInt(0))}else do r.unshift(n[a%n.length]),a=Math.floor(a/n.length);while(a>0);return r},jA=(e,n)=>e.reduce((r,a)=>{const o=n.indexOf(a);if(o===-1)throw new Error(`The provided ID (${e.join("")}) is invalid, as it contains characters that do not exist in the alphabet (${n.join("")})`);if(typeof r=="bigint")return r*BigInt(n.length)+BigInt(o);const u=r*n.length+o;return Number.isSafeInteger(u)?u:(eS("Unable to decode the provided string, due to lack of support for BigInt numbers in the current environment"),BigInt(r)*BigInt(n.length)+BigInt(o))},0),EA=/^\+?\d+$/,AA=e=>{if(!EA.test(e))return Number.NaN;const n=Number.parseInt(e,10);return Number.isSafeInteger(n)?n:(eS("Unable to encode the provided BigInt string without loss of information due to lack of support for BigInt type in the current environment"),BigInt(e))},CA=(e,n,r)=>Array.from({length:Math.ceil(e.length/n)},(a,o)=>r(e.slice(o*n,(o+1)*n))),dw=e=>new RegExp(e.map(n=>W_(n)).sort((n,r)=>r.length-n.length).join("|")),OA=e=>new RegExp(`^[${e.map(n=>W_(n)).sort((n,r)=>r.length-n.length).join("")}]+$`),W_=e=>e.replace(/[\s#$()*+,.?[\\\]^{|}-]/g,"\\$&"),eS=(e="BigInt is not available in this environment")=>{if(typeof BigInt!="function")throw new TypeError(e)},fw=16,hw=3.5,RA=12,mw=16,TA=12,pw=100;class tS{constructor(n="",r=0,a="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",o="cfhistuCFHISTU"){if(this.minLength=r,typeof r!="number")throw new TypeError(`Hashids: Provided 'minLength' has to be a number (is ${typeof r})`);if(typeof n!="string")throw new TypeError(`Hashids: Provided 'salt' has to be a string (is ${typeof n})`);if(typeof a!="string")throw new TypeError(`Hashids: Provided alphabet has to be a string (is ${typeof a})`);const u=Array.from(n),f=Array.from(a),m=Array.from(o);this.salt=u;const p=yA(f);if(p.length<fw)throw new Error(`Hashids: alphabet must contain at least ${fw} unique characters, provided: ${p.join("")}`);this.alphabet=vA(p,m);const y=wA(m,p);this.seps=lc(y,u);let g,b;(this.seps.length===0||this.alphabet.length/this.seps.length>hw)&&(g=Math.ceil(this.alphabet.length/hw),g>this.seps.length&&(b=g-this.seps.length,this.seps.push(...this.alphabet.slice(0,b)),this.alphabet=this.alphabet.slice(b))),this.alphabet=lc(this.alphabet,u);const v=Math.ceil(this.alphabet.length/RA);this.alphabet.length<3?(this.guards=this.seps.slice(0,v),this.seps=this.seps.slice(v)):(this.guards=this.alphabet.slice(0,v),this.alphabet=this.alphabet.slice(v)),this.guardsRegExp=dw(this.guards),this.sepsRegExp=dw(this.seps),this.allowedCharsRegExp=OA([...this.alphabet,...this.guards,...this.seps])}encode(n,...r){let o=Array.isArray(n)?n:[...n!=null?[n]:[],...r];return o.length===0||(o.every(_A)||(o=o.map(u=>typeof u=="bigint"||typeof u=="number"?u:AA(String(u)))),!o.every(SA))?"":this._encode(o).join("")}decode(n){return!n||typeof n!="string"||n.length===0?[]:this._decode(n)}encodeHex(n){let r=n;switch(typeof r){case"bigint":r=r.toString(mw);break;case"string":if(!/^[\dA-Fa-f]+$/.test(r))return"";break;default:throw new Error(`Hashids: The provided value is neither a string, nor a BigInt (got: ${typeof r})`)}const a=CA(r,TA,o=>Number.parseInt(`1${o}`,16));return this.encode(a)}decodeHex(n){return this.decode(n).map(r=>r.toString(mw).slice(1)).join("")}isValidId(n){return this.allowedCharsRegExp.test(n)}_encode(n){let{alphabet:r}=this;const a=n.reduce((y,g,b)=>y+(typeof g=="bigint"?Number(g%BigInt(b+pw)):g%(b+pw)),0);let o=[r[a%r.length]];const u=[...o],{seps:f}=this,{guards:m}=this;if(n.forEach((y,g)=>{const b=u.concat(this.salt,r);r=lc(r,b);const v=NA(y,r);if(o.push(...v),g+1<n.length){const S=v[0].codePointAt(0)+g,A=typeof y=="bigint"?Number(y%BigInt(S)):y%S;o.push(f[A%f.length])}}),o.length<this.minLength){const y=(a+o[0].codePointAt(0))%m.length;if(o.unshift(m[y]),o.length<this.minLength){const g=(a+o[2].codePointAt(0))%m.length;o.push(m[g])}}const p=Math.floor(r.length/2);for(;o.length<this.minLength;){r=lc(r,r),o.unshift(...r.slice(p)),o.push(...r.slice(0,p));const y=o.length-this.minLength;if(y>0){const g=y/2;o=o.slice(g,g+this.minLength)}}return o}_decode(n){if(!this.isValidId(n))throw new Error(`The provided ID (${n}) is invalid, as it contains characters that do not exist in the alphabet (${this.guards.join("")}${this.seps.join("")}${this.alphabet.join("")})`);const r=n.split(this.guardsRegExp),a=r.length===3||r.length===2?1:0,o=r[a];if(o.length===0)return[];const u=o[Symbol.iterator]().next().value,f=o.slice(u.length).split(this.sepsRegExp);let m=this.alphabet;const p=[];for(const y of f){const g=[u,...this.salt,...m],b=lc(m,g.slice(0,m.length));p.push(jA(Array.from(y),b)),m=b}return this._encode(p).join("")!==n?[]:p}}const gw={VITE_HASHER_MIN_LENGTH:"11",VITE_HASHER_SALT:"TGlnaHQgQ2hhcm1zLCBNaWRyYW5kQm9va3MgbWFrZSBsb3RzIG9mIG1vbmV5IGFuZCBhcmUgYSBzdWNjZXNzZnVsIHZpcmFsIHN0b3J5IGluIFNvdXRoIEFmcmljYQ=="},bw=typeof import.meta<"u"&&gw?gw:{},ba={minHashLength:Number(bw.VITE_HASHER_MIN_LENGTH)||11,salt:bw.VITE_HASHER_SALT||"TGlnaHQgQ2hhcm1zLCBNaWRyYW5kQm9va3MgbWFrZSBsb3RzIG9mIG1vbmV5IGFuZCBhcmUgYSBzdWNjZXNzZnVsIHZpcmFsIHN0b3J5IGluIFNvdXRoIEFmcmljYQ=="};let Nc=new tS(ba.salt,ba.minHashLength);function nS(e,n){let r=!1;if(e&&typeof e=="string"&&e.trim()!==""&&(ba.salt=e.trim(),r=!0),n!=null&&n!==""){const a=Number(n);!isNaN(a)&&a>0&&(ba.minHashLength=a,r=!0)}r&&(Nc=new tS(ba.salt,ba.minHashLength))}function kA(e){if(typeof e!="string"||e.length<ba.minHashLength)return!1;try{const n=Nc.decode(e);return Array.isArray(n)&&n.length>0}catch{return!1}}function Pr(e){if(e==null||e==="")return"";if(typeof e=="number")return isNaN(e)||!isFinite(e)||e<0?"":Nc.encode(e);const n=String(e).trim();if(!n)return"";if(kA(n))return n;if(/^\d+$/.test(n))try{const r=parseInt(n,10);if(!isNaN(r)&&r>=0)return Nc.encode(r)}catch{}return n}function xw(e){if(!e)return"";const n=String(e).trim();if(!n)return"";try{const r=Nc.decode(n);if(Array.isArray(r)&&r.length>0)return Number(r[0])}catch{}return n}const Jn={encodeIdSync(e){return Pr(e)},decodeIdSync(e){return xw(e)},async encodeId(e,n="general"){return Pr(e)},async decodeId(e,n="general"){return xw(e)},async resolveProjectId(e){return Pr(e)},async resolveOrganisationId(e){return Pr(e)},async resolveProgrammeId(e){return Pr(e)},async resolvePortfolioId(e){return Pr(e)},async resolveAwardId(e){return Pr(e)},async resolveContractId(e){return Pr(e)},async resolveHashedParams(e,n){const r={...e};for(const a of n){const o=e[a];o!=null&&(r[a]=Pr(o))}return r},async primeCache(e){}},yw={VITE_API_BASE_URL:"https://api.ifri.khongisa.co.za/",VITE_HASHER_MIN_LENGTH:"11",VITE_HASHER_SALT:"TGlnaHQgQ2hhcm1zLCBNaWRyYW5kQm9va3MgbWFrZSBsb3RzIG9mIG1vbmV5IGFuZCBhcmUgYSBzdWNjZXNzZnVsIHZpcmFsIHN0b3J5IGluIFNvdXRoIEFmcmljYQ==",VITE_OIDC_AUDIENCE:"pfm-api-dev",VITE_OIDC_AUTHORITY:"https://sts.security.khongisa.co.za",VITE_OIDC_CLIENT_ID:"pfm-admin-dev",VITE_OIDC_CLIENT_SECRET:"secret_dcaeaa28097d9ba5b06ec324d9eac9d9c81de96e0a203cf2c6154c6dd7c89e94"},oc={Authority:"https://sts.security.khongisa.co.za",Audience:"pfm-api-dev",ClientId:"pfm-console-dev",ClientSecret:"secret_dcaeaa28097d9ba5b06ec324d9eac9d9c81de96e0a203cf2c6154c6dd7c89e94",Scope:"openid profile roles email address pfm-api-dev"},DA={BaseUrl:"https://api.ifri.khongisa.co.za/"},vw={Salt:"TGlnaHQgQ2hhcm1zLCBNaWRyYW5kQm9va3MgbWFrZSBsb3RzIG9mIG1vbmV5IGFuZCBhcmUgYSBzdWNjZXNzZnVsIHZpcmFsIHN0b3J5IGluIFNvdXRoIEFmcmljYQ==",MinHashLength:11};function qn(...e){for(const n of e)if(n!=null){const r=String(n).trim();if(r!==""&&r!=="undefined"&&r!=="null")return r}}function sS(e){const n=e.trim();return n.endsWith("/")?n:`${n}/`}function MA(){if(typeof window>"u")return{};const e=window;return e.__RUNTIME_CONFIG__||e.APP_CONFIG||e._env_||{}}function l0(e){var g,b,v,S,A,C,O,N;if(!e||typeof e!="object")return{};const n=qn(e.VITE_OIDC_AUTHORITY,e.OIDC_AUTHORITY,(g=e.SecuritySettings)==null?void 0:g.Authority,e.SecuritySettings__Authority,e.SecuritySettings_Authority,e.AUTHORITY,e.STS_AUTHORITY),r=qn(e.VITE_OIDC_AUDIENCE,e.OIDC_AUDIENCE,(b=e.SecuritySettings)==null?void 0:b.Audience,e.SecuritySettings__Audience,e.SecuritySettings_Audience,e.AUDIENCE),a=qn(e.VITE_OIDC_CLIENT_ID,e.OIDC_CLIENT_ID,(v=e.SecuritySettings)==null?void 0:v.ClientId,e.SecuritySettings__ClientId,e.SecuritySettings_ClientId,e.CLIENT_ID),o=qn(e.VITE_OIDC_CLIENT_SECRET,e.OIDC_CLIENT_SECRET,(S=e.SecuritySettings)==null?void 0:S.ClientSecret,e.SecuritySettings__ClientSecret,e.SecuritySettings_ClientSecret,e.CLIENT_SECRET),u=qn(e.VITE_OIDC_SCOPE,e.OIDC_SCOPE,(A=e.SecuritySettings)==null?void 0:A.Scope,e.SecuritySettings__Scope,e.SecuritySettings_Scope,e.SCOPE),f=qn(e.VITE_API_BASE_URL,e.API_BASE_URL,(C=e.ApiSettings)==null?void 0:C.BaseUrl,e.ApiSettings__BaseUrl,e.ApiSettings_BaseUrl,e.PFM_API_BASE_URL),m=qn(e.VITE_HASHER_SALT,e.HASHER_SALT,(O=e.HasherSettings)==null?void 0:O.Salt,e.HasherSettings__Salt,e.HasherSettings_Salt),p=qn(e.VITE_HASHER_MIN_LENGTH,e.HASHER_MIN_LENGTH,(N=e.HasherSettings)==null?void 0:N.MinHashLength,e.HasherSettings__MinLength,e.HasherSettings_MinLength),y=p?Number(p):void 0;return{authority:n,audience:r,clientId:a,clientSecret:o,scope:u,baseUrl:f?sS(f):void 0,hasherSalt:m,hasherMinLength:y&&!isNaN(y)&&y>0?y:void 0}}function rS(e){const n=l0(MA()),r=e?l0(e):{},a=l0(typeof import.meta<"u"&&yw?yw:{}),o=Object.values(n).some(O=>O!==void 0),u=Object.values(r).some(O=>O!==void 0),f=Object.values(a).some(O=>O!==void 0);let m="fallback-defaults";o?m="runtime-injected":u?m="runtime-fetched":f&&(m="build-env");const p=qn(n.authority,r.authority,a.authority,oc.Authority),y=qn(n.audience,r.audience,a.audience,oc.Audience),g=qn(n.clientId,r.clientId,a.clientId,oc.ClientId),b=qn(n.clientSecret,r.clientSecret,a.clientSecret,oc.ClientSecret),v=qn(n.scope,r.scope,a.scope,oc.Scope),S=qn(n.baseUrl,r.baseUrl,a.baseUrl,DA.BaseUrl),A=qn(n.hasherSalt,r.hasherSalt,a.hasherSalt,vw.Salt),C=n.hasherMinLength||r.hasherMinLength||a.hasherMinLength||vw.MinHashLength;return{SecuritySettings:{Authority:p,Audience:y,ClientId:g,ClientSecret:b,Scope:v},ApiSettings:{BaseUrl:sS(S)},HasherSettings:{Salt:A,MinHashLength:C},ConfigSource:m,LoadedAt:new Date().toISOString()}}let ds=rS();nS(ds.HasherSettings.Salt,ds.HasherSettings.MinHashLength);const Dd=[];function zA(e){return Dd.push(e),()=>{const n=Dd.indexOf(e);n!==-1&&Dd.splice(n,1)}}let yd=null;async function J0(){return yd||(yd=(async()=>{let e;if(typeof window<"u")try{const n=await fetch(`/config.json?_t=${Date.now()}`,{cache:"no-store",headers:{Accept:"application/json"}});if(n.ok){const r=await n.json();r&&typeof r=="object"&&(e=r)}}catch(n){console.debug("[Config] Note: Remote /config.json fetch bypassed:",n)}return ds=rS(e),nS(ds.HasherSettings.Salt,ds.HasherSettings.MinHashLength),console.info(`[Config] Active runtime configuration: source=${ds.ConfigSource}, API=${ds.ApiSettings.BaseUrl}, STS=${ds.SecuritySettings.Authority}`),Dd.forEach(n=>{try{n(ds)}catch(r){console.error("[Config] Listener error:",r)}}),ds})(),yd)}function os(){return ds}function UA(){return ds.SecuritySettings}function iS(){return ds.ApiSettings.BaseUrl}function ww(e){if(!e||typeof e!="string")return{};try{const n=e.split(".");if(n.length<2)return{};const a=n[1].replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(window.atob(a).split("").map(u=>"%"+("00"+u.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(o)}catch(n){return console.debug("Failed to decode JWT claims payload:",n),{}}}const IA={xs:20,sm:28,md:36,lg:44,xl:56},zl=({size:e="md",variant:n="icon-only",showGlow:r=!0,className:a="",animateOnHover:o=!0})=>{const u=T.useId().replace(/:/g,""),f=typeof e=="number"?e:IA[e]||36,m=`pfm-ambient-${u}`,p=`pfm-top-${u}`,y=`pfm-left-${u}`,g=`pfm-right-${u}`,b=`pfm-core-${u}`,v=`pfm-filter-${u}`;return c.jsxs("div",{className:`inline-flex items-center gap-3 select-none ${o?"group cursor-pointer":""} ${a}`,children:[c.jsxs("div",{style:{width:f,height:f},className:`relative shrink-0 flex items-center justify-center transition-transform duration-300 ${o?"group-hover:scale-105":""}`,children:[r&&c.jsx("div",{className:"absolute inset-0 rounded-2xl bg-blue-500/20 blur-md pointer-events-none transition-opacity duration-300 group-hover:opacity-100 opacity-60"}),c.jsxs("svg",{viewBox:"0 0 64 64",width:f,height:f,fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"relative z-10 w-full h-full drop-shadow-sm",children:[c.jsxs("defs",{children:[c.jsxs("radialGradient",{id:m,cx:"50%",cy:"50%",r:"50%",children:[c.jsx("stop",{offset:"0%",stopColor:"#38bdf8",stopOpacity:"0.4"}),c.jsx("stop",{offset:"70%",stopColor:"#2563eb",stopOpacity:"0.12"}),c.jsx("stop",{offset:"100%",stopColor:"#1e1b4b",stopOpacity:"0"})]}),c.jsxs("linearGradient",{id:p,x1:"12",y1:"8",x2:"52",y2:"26",gradientUnits:"userSpaceOnUse",children:[c.jsx("stop",{offset:"0%",stopColor:"#a5b4fc"}),c.jsx("stop",{offset:"35%",stopColor:"#6366f1"}),c.jsx("stop",{offset:"100%",stopColor:"#4338ca"})]}),c.jsxs("linearGradient",{id:y,x1:"10",y1:"22",x2:"30",y2:"56",gradientUnits:"userSpaceOnUse",children:[c.jsx("stop",{offset:"0%",stopColor:"#38bdf8"}),c.jsx("stop",{offset:"45%",stopColor:"#2563eb"}),c.jsx("stop",{offset:"100%",stopColor:"#1e40af"})]}),c.jsxs("linearGradient",{id:g,x1:"34",y1:"28",x2:"54",y2:"56",gradientUnits:"userSpaceOnUse",children:[c.jsx("stop",{offset:"0%",stopColor:"#22d3ee"}),c.jsx("stop",{offset:"50%",stopColor:"#06b6d4"}),c.jsx("stop",{offset:"100%",stopColor:"#10b981"})]}),c.jsxs("linearGradient",{id:b,x1:"27",y1:"27",x2:"37",y2:"37",gradientUnits:"userSpaceOnUse",children:[c.jsx("stop",{offset:"0%",stopColor:"#ffffff"}),c.jsx("stop",{offset:"40%",stopColor:"#e0f2fe"}),c.jsx("stop",{offset:"100%",stopColor:"#38bdf8"})]}),c.jsxs("filter",{id:v,x:"-20%",y:"-20%",width:"140%",height:"140%",children:[c.jsx("feGaussianBlur",{stdDeviation:"1.5",result:"blur"}),c.jsx("feComposite",{in:"SourceGraphic",in2:"blur",operator:"over"})]})]}),c.jsx("circle",{cx:"32",cy:"32",r:"31",fill:"#090d16"}),c.jsx("circle",{cx:"32",cy:"32",r:"30",stroke:"#1e293b",strokeWidth:"1"}),c.jsx("circle",{cx:"32",cy:"32",r:"28",fill:`url(#${m})`}),c.jsx("path",{d:"M32 6.5 L53.5 19 C55 19.8 56 21.5 56 23.2 L56 40.8 C56 42.5 55 44.2 53.5 45 L32 57.5 C30.5 58.3 28.5 58.3 27 57.5 L5.5 45 C4 44.2 3 42.5 3 40.8 L3 23.2 C3 21.5 4 19.8 5.5 19 L27 6.5 C28.5 5.7 30.5 5.7 32 6.5 Z",stroke:"#3b82f6",strokeOpacity:"0.35",strokeWidth:"1.2",fill:"none"}),c.jsx("path",{d:"M32 9 L51.5 20.2 L43 25.2 L32 18.8 L21 25.2 L12.5 20.2 Z",fill:`url(#${p})`}),c.jsx("path",{d:"M10 23 L19.2 28.4 L19.2 44.5 L30 50.8 L30 55.5 L10 43.8 Z",fill:`url(#${y})`}),c.jsx("path",{d:"M54 23 L54 43.8 L34 55.5 L34 50.8 L44.8 44.5 L44.8 28.4 Z",fill:`url(#${g})`}),c.jsx("path",{d:"M22 28.5 L32 22.8 L42 28.5 L42 35.5 L32 41.2 L22 35.5 Z",fill:"#0b1120",stroke:"#334155",strokeWidth:"1"}),c.jsx("path",{d:"M25 31.5 L32 27.5 L39 31.5 L32 35.5 Z",fill:`url(#${p})`,opacity:"0.9"}),c.jsx("path",{d:"M25 37 L32 41 L39 37 L32 33 L25 37 Z",fill:`url(#${g})`,opacity:"0.9"}),c.jsx("polygon",{points:"32,27 36.5,32 32,37 27.5,32",fill:`url(#${b})`,filter:`url(#${v})`}),c.jsx("circle",{cx:"32",cy:"32",r:"1.5",fill:"#ffffff"})]})]}),n==="full"&&c.jsxs("div",{className:"flex flex-col min-w-0",children:[c.jsx("span",{className:"font-bold text-sm tracking-tight text-white truncate group-hover:text-blue-400 transition",children:"PFM Console"}),c.jsx("span",{className:"text-[11px] text-blue-400 font-medium tracking-tight",children:"Post-Fund Governance"})]})]})},aS=T.createContext(void 0),o0="pfm_access_token",c0="pfm_auth_user",bc="pfm_user_sub",vd="pfm_user_claims";function Ht(){return typeof window<"u"&&localStorage.getItem(bc)||""}let Md=null;function lS(){Md=null}zA(()=>{lS()});function u0(){if(!Md&&typeof window<"u"){const e=UA(),n=window.location.origin;Md=new xA({authority:e.Authority,client_id:e.ClientId,client_secret:e.ClientSecret,redirect_uri:`${n}/dashboard`,post_logout_redirect_uri:`${n}/`,response_type:"code",scope:e.Scope||"openid profile roles email address pfm-api-dev",extraQueryParams:{audience:e.Audience},userStore:new Lp({store:window.localStorage}),automaticSilentRenew:!1})}return Md}const LA=({children:e})=>{const[n,r]=T.useState(null),[a,o]=T.useState(""),[u,f]=T.useState({}),[m,p]=T.useState(null),[y,g]=T.useState(!0),[b,v]=T.useState(null);T.useEffect(()=>{(async()=>{var O,N;try{await J0();const j=new URLSearchParams(window.location.search);if(j.has("code")&&j.has("state")){const X=await u0().signinCallback();if(X&&X.access_token){const se=X.access_token;p(se),localStorage.setItem(o0,se);const we={...ww(se),...X.profile},Ce=((O=X.profile)==null?void 0:O.sub)||we.sub||"";o(Ce),f(we),localStorage.setItem(bc,Ce),localStorage.setItem(vd,JSON.stringify(we));const Z=we.tenant||((N=X.profile)==null?void 0:N.tenant)||void 0,W={id:Ce||"user-1",sub:Ce,name:X.profile.name||X.profile.preferred_username||we.name||"Authorized User",email:X.profile.email||we.email||"",role:X.profile.role||we.role||(Array.isArray(we.roles)?we.roles[0]:"Programme Sponsor"),organisationName:we.organisation||we.org||void 0,tenant:Z};r(W),localStorage.setItem(c0,JSON.stringify(W)),window.history.replaceState({},document.title,window.location.pathname),g(!1);return}}const F=localStorage.getItem(o0),q=localStorage.getItem(c0);let B=localStorage.getItem(bc);const re=localStorage.getItem(vd);if(F){p(F);let Q={};if(re)try{Q=JSON.parse(re)}catch{}else Q=ww(F),localStorage.setItem(vd,JSON.stringify(Q));if(f(Q),!B&&Q.sub&&(B=String(Q.sub),localStorage.setItem(bc,B)),B&&o(B),q)try{const X=JSON.parse(q);!X.tenant&&Q.tenant&&(X.tenant=Q.tenant),r(X)}catch{}}}catch(j){console.warn("OIDC initialization notice:",j),v(j instanceof Error?j.message:"Auth initialization notice")}finally{g(!1)}})()},[]);const S=async()=>{try{v(null),await J0(),lS(),await u0().signinRedirect()}catch(C){console.warn("OIDC Redirect encountered:",C),typeof window<"u"&&window.self!==window.top?v("Identity Provider redirect was restricted inside this preview frame. To complete single sign-on authentication, open the application in a new browser tab."):v(C instanceof Error?C.message:"Identity Provider redirect error")}},A=async()=>{try{localStorage.removeItem(o0),localStorage.removeItem(c0),localStorage.removeItem(bc),localStorage.removeItem(vd),r(null),o(""),f({}),p(null);try{await u0().signoutRedirect()}catch{}}catch(C){console.error("Logout error:",C)}};return c.jsx(aS.Provider,{value:{user:n,sub:a,claims:u,accessToken:m,isAuthenticated:!!m,isLoading:y,login:S,logout:A,authError:b},children:e})},Uc=()=>{const e=T.useContext(aS);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},PA=({children:e})=>{const{isAuthenticated:n,isLoading:r}=Uc(),a=Ws();return r?c.jsx("div",{className:"flex h-screen w-full items-center justify-center bg-[#090d16]",children:c.jsxs("div",{className:"flex flex-col items-center gap-4",children:[c.jsxs("div",{className:"relative flex items-center justify-center",children:[c.jsx(zl,{size:52,showGlow:!0,animateOnHover:!1}),c.jsx("div",{className:"absolute -inset-2.5 rounded-full border-2 border-blue-500/20 border-t-blue-400 animate-spin"})]}),c.jsx("p",{className:"text-xs font-medium text-slate-400 tracking-wide",children:"Verifying PFM Console Session..."})]})}):n?c.jsx(c.Fragment,{children:e}):c.jsx(j_,{to:"/",state:{from:a},replace:!0})};/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const HA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,r,a)=>a?a.toUpperCase():r.toLowerCase()),_w=e=>{const n=qA(e);return n.charAt(0).toUpperCase()+n.slice(1)},oS=(...e)=>e.filter((n,r,a)=>!!n&&n.trim()!==""&&a.indexOf(n)===r).join(" ").trim(),BA=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var $A={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const FA=T.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:o="",children:u,iconNode:f,...m},p)=>T.createElement("svg",{ref:p,...$A,width:n,height:n,stroke:e,strokeWidth:a?Number(r)*24/Number(n):r,className:oS("lucide",o),...!u&&!BA(m)&&{"aria-hidden":"true"},...m},[...f.map(([y,g])=>T.createElement(y,g)),...Array.isArray(u)?u:[u]]));/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Le=(e,n)=>{const r=T.forwardRef(({className:a,...o},u)=>T.createElement(FA,{ref:u,iconNode:n,className:oS(`lucide-${HA(_w(e))}`,`lucide-${e}`,a),...o}));return r.displayName=_w(e),r};/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const VA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],d0=Le("arrow-right",VA);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ZA=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],wd=Le("arrow-up-right",ZA);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const GA=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]],QA=Le("banknote",GA);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const KA=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],YA=Le("bell",KA);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const JA=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],XA=Le("briefcase",JA);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const WA=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],cS=Le("building-2",WA);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eC=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],tC=Le("chart-column",eC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nC=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],sC=Le("chart-pie",nC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Sw=Le("chevron-right",rC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const iC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],uS=Le("circle-alert",iC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aC=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],X0=Le("circle-check-big",aC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],dS=Le("circle-check",lC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oC=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],cC=Le("clock",oC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uC=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],Ic=Le("coins",uC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dC=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],fC=Le("database",dC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hC=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],mC=Le("download",hC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pC=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],gC=Le("eye",pC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bC=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3 15 2 2 4-4",key:"1lhrkk"}]],xC=Le("file-check-2",bC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yC=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]],vC=Le("file-check",yC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const wC=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],_C=Le("file-spreadsheet",wC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const SC=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],fS=Le("file-text",SC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const NC=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],jC=Le("flag",NC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const EC=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],Pp=Le("folder-kanban",EC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const AC=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],CC=Le("funnel",AC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const OC=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],RC=Le("history",OC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const TC=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Nw=Le("house",TC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],DC=Le("info",kC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const MC=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],jw=Le("key-round",MC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zC=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],W0=Le("layers",zC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const UC=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],IC=Le("layout-dashboard",UC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const LC=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],hS=Le("link",LC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const PC=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],HC=Le("lock",PC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qC=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],ep=Le("log-out",qC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const BC=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],mS=Le("mail",BC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $C=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],FC=Le("menu",$C);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const VC=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],ZC=Le("paperclip",VC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const GC=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],f0=Le("pen",GC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const QC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rs=Le("plus",QC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const KC=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],tp=Le("refresh-cw",KC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const YC=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],pS=Le("search",YC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const JC=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Ew=Le("send",JC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const XC=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],WC=Le("settings",XC);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eO=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],gS=Le("shield-alert",eO);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tO=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Hp=Le("shield-check",tO);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nO=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],sO=Le("shield",nO);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rO=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],qp=Le("trending-up",rO);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const iO=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aO=Le("triangle-alert",iO);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lO=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],bS=Le("upload",lO);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oO=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],xS=Le("user-check",oO);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cO=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],yS=Le("users",cO);/**
* @license lucide-react v0.546.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uO=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Bp=Le("x",uO),vS=T.createContext(void 0),dO=({children:e})=>{const[n,r]=T.useState([]),a=p=>{r(y=>y.filter(g=>g.id!==p))},o=(p,y,g)=>{const b=Math.random().toString(36).substring(2,9);r(v=>[...v,{id:b,type:p,title:y,message:g}]),setTimeout(()=>a(b),5e3)},u=(p,y)=>o("success",p,y),f=(p,y)=>o("error",p,y),m=(p,y)=>o("info",p,y);return c.jsxs(vS.Provider,{value:{toast:o,success:u,error:f,info:m},children:[e,c.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-md w-full pointer-events-none p-2",children:n.map(p=>c.jsxs("div",{className:`pointer-events-auto flex items-start gap-3 p-4 rounded-xl border shadow-2xl transition-all duration-200 bg-[#141414] ${p.type==="success"?"border-green-500/30 text-gray-200":p.type==="error"?"border-rose-500/30 text-gray-200":"border-indigo-500/30 text-gray-200"}`,children:[p.type==="success"&&c.jsx(dS,{className:"w-5 h-5 text-green-400 shrink-0 mt-0.5"}),p.type==="error"&&c.jsx(uS,{className:"w-5 h-5 text-rose-400 shrink-0 mt-0.5"}),p.type==="info"&&c.jsx(DC,{className:"w-5 h-5 text-indigo-400 shrink-0 mt-0.5"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h4",{className:"text-sm font-semibold text-white",children:p.title}),p.message&&c.jsx("p",{className:"text-xs mt-0.5 text-gray-400 leading-relaxed",children:p.message})]}),c.jsx("button",{onClick:()=>a(p.id),className:"text-gray-400 hover:text-white p-0.5 rounded transition-colors",children:c.jsx(Bp,{className:"w-4 h-4"})})]},p.id))})]})},Lc=()=>{const e=T.useContext(vS);if(!e)throw new Error("useToast must be used within a ToastProvider");return e},fO=[{name:"Executive Dashboard",path:"/dashboard",icon:IC},{name:"Governance & Structure",path:"/governance",icon:cS},{name:"Projects & Milestones",path:"/projects",icon:Pp},{name:"Grant & Financials",path:"/grants",icon:Ic},{name:"M&E, Evidence & Risks",path:"/monitoring",icon:gS},{name:"Settings & Communications",path:"/settings",icon:WC}],hO=()=>{const{user:e,claims:n,sub:r,logout:a}=Uc(),[o,u]=T.useState(!0),[f,m]=T.useState(!1);rf();const p=async()=>{await a()},y=(e==null?void 0:e.name)||n.name||n.preferred_username||(n.given_name?`${n.given_name} ${n.family_name||""}`.trim():"")||"Authorized User",g=(e==null?void 0:e.email)||n.email||n["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"]||n.upn||(r?`sub:${r}`:""),b=(n==null?void 0:n.tenant)||(e==null?void 0:e.tenant)||(n==null?void 0:n.tenant)||(e==null?void 0:e.organisationName)||(n==null?void 0:n.organisation)||"Department of Science, Innovation & Technology (DSI)";return c.jsxs("div",{className:"flex h-screen w-full overflow-hidden bg-[#090d16] font-sans text-slate-100 selection:bg-blue-600 selection:text-white",children:[c.jsxs("aside",{className:`${o?"w-64":"w-20"} shrink-0 bg-[#0b101b]/95 text-slate-200 border-r border-slate-800/80 transition-all duration-300 flex flex-col z-30 shadow-2xl backdrop-blur-md`,children:[c.jsxs("div",{className:"h-16 px-4 flex items-center justify-between border-b border-slate-800/80 bg-[#0d121f]/90",children:[c.jsxs(Qs,{to:"/",id:"nav-brand-home-link",title:"Go to Home page",className:"flex items-center gap-3 overflow-hidden group cursor-pointer",children:[c.jsx(zl,{size:36,showGlow:!0,animateOnHover:!0}),o&&c.jsxs("div",{className:"flex flex-col min-w-0",children:[c.jsx("span",{className:"font-bold text-sm tracking-tight text-white truncate group-hover:text-blue-400 transition",children:"PFM Console"}),c.jsx("span",{className:"text-[11px] text-blue-400 font-medium tracking-tight",children:"Enterprise Management"})]})]}),c.jsx("button",{onClick:()=>u(!o),className:"rounded-lg p-1.5 text-slate-400 hover:text-white hover:bg-slate-800/60 transition cursor-pointer",title:o?"Collapse sidebar":"Expand sidebar",children:o?c.jsx(Bp,{className:"w-4 h-4"}):c.jsx(FC,{className:"w-4 h-4"})})]}),c.jsx("nav",{className:"flex-1 overflow-y-auto px-3 py-4 space-y-1.5",children:fO.map(v=>{const S=v.icon;return c.jsxs(A_,{to:v.path,className:({isActive:A})=>`flex items-center gap-3 px-3.5 py-2.5 rounded-xl text-xs font-medium transition-all ${A?"bg-gradient-to-r from-blue-600 to-indigo-600 text-white shadow-md shadow-blue-600/25 font-semibold":"text-slate-400 hover:text-slate-100 hover:bg-slate-800/60"}`,children:[c.jsx(S,{className:"w-4 h-4 shrink-0"}),o&&c.jsx("span",{className:"truncate",children:v.name})]},v.path)})}),c.jsx("div",{className:"p-3 border-t border-slate-800/80 bg-[#0d121f]/90",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"h-9 w-9 shrink-0 rounded-full bg-blue-600/20 border border-blue-500/40 flex items-center justify-center font-bold text-xs text-blue-400",children:y.slice(0,2).toUpperCase()}),o&&c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-xs font-semibold text-white truncate",title:y,children:y}),c.jsx("p",{className:"text-[11px] text-slate-400 truncate font-mono",title:g,children:g||"Authenticated User"})]}),c.jsx("button",{onClick:p,id:"sidebar-logout-btn",className:"rounded-lg p-1.5 text-slate-400 hover:text-rose-400 hover:bg-rose-950/30 transition cursor-pointer",title:"Sign Out of Session",children:c.jsx(ep,{className:"w-4 h-4"})})]})})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden relative",children:[c.jsxs("header",{className:"h-16 bg-[#0d121f]/90 border-b border-slate-800/80 backdrop-blur-md px-4 sm:px-6 md:px-8 flex items-center justify-between shrink-0 z-20",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs(Qs,{to:"/",id:"header-brand-logo-link",className:"flex items-center gap-2 group cursor-pointer",title:"PFM Console Home",children:[c.jsx(zl,{size:28,showGlow:!1,animateOnHover:!0}),c.jsx("span",{className:"font-bold text-xs tracking-tight text-white hidden md:inline-block group-hover:text-blue-400 transition",children:"PFM"})]}),c.jsx("span",{className:"h-4 w-px bg-slate-800 hidden md:block"}),c.jsxs(Qs,{to:"/",id:"header-home-link",className:"flex items-center gap-1.5 text-xs font-semibold text-slate-300 hover:text-white bg-slate-900/80 hover:bg-slate-800 px-3 py-1.5 rounded-lg border border-slate-800 transition cursor-pointer shadow-xs",title:"Return to Auth-Aware Home page",children:[c.jsx(Nw,{className:"w-3.5 h-3.5 text-blue-400"}),c.jsx("span",{children:"Home"})]}),c.jsx(Sw,{className:"w-4 h-4 text-slate-600"}),c.jsxs("div",{className:"hidden sm:flex items-center gap-2 text-xs font-medium text-slate-300",children:[c.jsx("span",{className:"text-slate-400",children:"Tenant:"}),c.jsxs("span",{className:"bg-slate-900/80 text-slate-200 px-2.5 py-1 rounded-lg border border-slate-800 flex items-center gap-1.5 font-medium shadow-xs max-w-[280px] truncate",title:b,children:[c.jsx(fC,{className:"w-3.5 h-3.5 text-blue-400 shrink-0"}),c.jsx("span",{className:"truncate",children:b})]})]}),c.jsx(Sw,{className:"w-4 h-4 text-slate-600 hidden sm:block"}),c.jsxs("span",{className:"text-xs font-medium text-emerald-400 bg-emerald-500/10 px-2.5 py-0.5 rounded-full border border-emerald-500/30 flex items-center gap-1.5 shadow-xs",children:[c.jsx(Hp,{className:"w-3.5 h-3.5 text-emerald-400"}),"Authenticated Session"]})]}),c.jsxs("div",{className:"relative flex items-center gap-3",children:[c.jsxs("div",{className:"text-right hidden sm:block",children:[c.jsx("p",{className:"text-xs font-semibold text-white truncate max-w-[200px]",title:y,children:y}),c.jsx("p",{className:"text-[11px] text-slate-400 font-mono truncate max-w-[200px]",title:g,children:g})]}),c.jsx("button",{onClick:()=>m(!f),id:"header-user-menu-btn",className:"h-9 w-9 rounded-full bg-blue-600/20 border border-blue-500/40 hover:border-blue-400 flex items-center justify-center font-bold text-xs text-blue-400 transition cursor-pointer shadow-md shadow-blue-500/10",title:"User Account",children:y.slice(0,2).toUpperCase()}),f&&c.jsxs("div",{className:"absolute right-0 top-12 w-64 bg-[#0f1523] border border-slate-800 rounded-2xl shadow-2xl p-3 z-50 space-y-2 animate-in fade-in slide-in-from-top-2 backdrop-blur-md",onMouseLeave:()=>m(!1),children:[c.jsxs("div",{className:"p-2.5 border-b border-slate-800",children:[c.jsx("p",{className:"text-xs font-semibold text-white",children:y}),c.jsx("p",{className:"text-[11px] text-slate-400 font-mono truncate",children:g}),r&&c.jsxs("p",{className:"text-[10px] text-slate-500 font-mono mt-1",children:["sub: ",r]})]}),c.jsxs(Qs,{to:"/",onClick:()=>m(!1),className:"flex items-center gap-2 px-3 py-2 text-xs text-slate-300 hover:text-white hover:bg-slate-800/60 rounded-xl transition",children:[c.jsx(Nw,{className:"w-3.5 h-3.5 text-blue-400"}),c.jsx("span",{children:"Go to Home Page"})]}),c.jsxs("button",{onClick:p,id:"dropdown-logout-btn",className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-rose-400 hover:bg-rose-950/30 rounded-xl transition cursor-pointer",children:[c.jsx(ep,{className:"w-3.5 h-3.5"}),c.jsx("span",{children:"Sign Out of Session"})]})]})]})]}),c.jsxs("main",{className:"flex-1 overflow-y-auto p-6 md:p-8 bg-[#090d16] relative text-slate-100",children:[c.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-15",style:{backgroundImage:"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0)",backgroundSize:"32px 32px"}}),c.jsx("div",{className:"absolute -top-24 -left-24 w-80 h-80 bg-blue-600/10 rounded-full blur-3xl pointer-events-none"}),c.jsx("div",{className:"absolute top-1/2 -right-24 w-80 h-80 bg-indigo-600/10 rounded-full blur-3xl pointer-events-none"}),c.jsx("div",{className:"relative z-10",children:c.jsx(x4,{})})]}),c.jsxs("footer",{className:"h-10 px-6 md:px-8 border-t border-slate-800/80 bg-[#0d121f]/90 flex items-center justify-between text-[11px] text-slate-400 shrink-0",children:[c.jsx("span",{children:"Project Financial Management (PFM) System"}),c.jsxs("span",{className:"text-slate-400 font-medium flex items-center gap-1.5",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 inline-block"}),"Enterprise Secure Session"]})]})]})]})},Aw=()=>{const{isAuthenticated:e,user:n,claims:r,sub:a,login:o,logout:u,authError:f,isLoading:m}=Uc(),p=rf(),y=async()=>{if(e){p("/dashboard");return}await o()},g=async()=>{await u()},b=(n==null?void 0:n.name)||r.name||r.preferred_username||"Authorized User",v=(n==null?void 0:n.email)||r.email||r["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"]||"";return c.jsxs("div",{className:"min-h-screen bg-[#090d16] text-slate-100 flex flex-col justify-between selection:bg-blue-600 selection:text-white font-sans relative overflow-hidden",children:[c.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-20",style:{backgroundImage:"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0)",backgroundSize:"32px 32px"}}),c.jsx("div",{className:"absolute -top-40 -left-40 w-96 h-96 bg-blue-600/20 rounded-full blur-3xl pointer-events-none"}),c.jsx("div",{className:"absolute top-1/3 -right-40 w-96 h-96 bg-indigo-600/15 rounded-full blur-3xl pointer-events-none"}),c.jsx("div",{className:"absolute -bottom-40 left-1/3 w-96 h-96 bg-emerald-600/10 rounded-full blur-3xl pointer-events-none"}),c.jsxs("header",{className:"relative z-10 border-b border-slate-800/80 bg-[#0d121f]/80 backdrop-blur-md px-6 py-4 flex items-center justify-between shadow-lg shadow-black/20",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(zl,{size:40,showGlow:!0,animateOnHover:!0}),c.jsxs("div",{children:[c.jsxs("h1",{className:"text-base font-bold tracking-tight text-white flex items-center gap-2",children:["PFM Console",c.jsx("span",{className:"text-[10px] font-semibold uppercase bg-blue-500/10 text-blue-400 border border-blue-500/30 px-2 py-0.5 rounded font-mono",children:"Enterprise SSO"})]}),c.jsx("p",{className:"text-xs text-slate-400",children:"Post-Fund Management, Performance & Impact System"})]})]}),c.jsx("div",{className:"flex items-center gap-3",children:e?c.jsxs("button",{onClick:()=>p("/dashboard"),id:"header-nav-console-btn",className:"flex items-center gap-2 text-xs font-semibold text-white bg-blue-600 hover:bg-blue-500 px-3.5 py-1.5 rounded-lg shadow-md shadow-blue-600/20 transition cursor-pointer",children:[c.jsx("span",{children:"Go to Console"}),c.jsx(d0,{className:"w-3.5 h-3.5"})]}):c.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-400 font-medium bg-slate-900/60 border border-slate-800 px-3 py-1.5 rounded-full",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-400 animate-pulse"}),c.jsx("span",{children:"Single Sign-On Ready"})]})})]}),c.jsx("main",{className:"relative z-10 flex-1 max-w-6xl mx-auto w-full px-6 py-12 flex flex-col justify-center",children:c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-12 items-center",children:[c.jsxs("div",{className:"lg:col-span-7 space-y-6",children:[c.jsxs("div",{className:"inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-blue-500/10 border border-blue-500/30 text-blue-300 text-xs font-semibold",children:[c.jsx(Hp,{className:"w-4 h-4 text-blue-400"}),"Controlled Post-Award to Portfolio Governance"]}),c.jsxs("h2",{className:"text-3xl sm:text-4xl lg:text-5xl font-extrabold text-white tracking-tight leading-tight",children:["Post Fund Management ",c.jsx("br",{}),c.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-blue-400 via-indigo-300 to-teal-300",children:"Executive Console"})]}),c.jsx("p",{className:"text-sm sm:text-base text-slate-300 leading-relaxed max-w-2xl font-normal",children:"Empowers Funders, Science Councils, and Development Agencies to enforce rigorous governance, milestone-linked disbursements, evidence verification, and real-time portfolio performance from award intake through final close-out."}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 pt-2 text-xs",children:[c.jsxs("div",{className:"p-4 rounded-xl bg-slate-900/70 border border-slate-800/80 shadow-md flex items-start gap-3 backdrop-blur-sm",children:[c.jsx(dS,{className:"w-4 h-4 text-emerald-400 shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("strong",{className:"text-white block font-semibold mb-0.5",children:"Award to Contract Enforcement"}),c.jsx("span",{className:"text-slate-400 leading-normal",children:"Legal agreements linked directly to approved awards."})]})]}),c.jsxs("div",{className:"p-4 rounded-xl bg-slate-900/70 border border-slate-800/80 shadow-md flex items-start gap-3 backdrop-blur-sm",children:[c.jsx(Ic,{className:"w-4 h-4 text-blue-400 shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("strong",{className:"text-white block font-semibold mb-0.5",children:"Controlled Tranche Release"}),c.jsx("span",{className:"text-slate-400 leading-normal",children:"Disbursements released only when milestone conditions are verified."})]})]}),c.jsxs("div",{className:"p-4 rounded-xl bg-slate-900/70 border border-slate-800/80 shadow-md flex items-start gap-3 backdrop-blur-sm",children:[c.jsx(_C,{className:"w-4 h-4 text-indigo-400 shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("strong",{className:"text-white block font-semibold mb-0.5",children:"Evidence Verification"}),c.jsx("span",{className:"text-slate-400 leading-normal",children:"Deliverables require tamper-evident verification."})]})]}),c.jsxs("div",{className:"p-4 rounded-xl bg-slate-900/70 border border-slate-800/80 shadow-md flex items-start gap-3 backdrop-blur-sm",children:[c.jsx(tC,{className:"w-4 h-4 text-teal-400 shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("strong",{className:"text-white block font-semibold mb-0.5",children:"Automated Portfolio Roll-Up"}),c.jsx("span",{className:"text-slate-400 leading-normal",children:"Project data aggregates automatically to Programmes and Portfolios."})]})]})]})]}),c.jsx("div",{className:"lg:col-span-5",children:e?c.jsxs("div",{className:"bg-[#0f1523]/95 border border-emerald-500/30 rounded-2xl p-8 shadow-2xl relative overflow-hidden space-y-6 backdrop-blur-md",children:[c.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-emerald-500 via-teal-400 to-blue-500"}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"h-3 w-3 rounded-full bg-emerald-400 animate-pulse"}),c.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-emerald-400",children:"Active Authenticated Session"})]}),c.jsx("span",{className:"text-[10px] font-mono bg-emerald-500/10 text-emerald-300 border border-emerald-500/30 px-2 py-0.5 rounded",children:"Session Active"})]}),c.jsxs("div",{className:"p-4 rounded-xl bg-slate-900/90 border border-slate-800 space-y-2.5",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"h-10 w-10 rounded-full bg-blue-600/20 border border-blue-500/40 flex items-center justify-center font-bold text-sm text-blue-400 shrink-0",children:c.jsx(xS,{className:"w-5 h-5 text-blue-400"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"text-sm font-bold text-white truncate",children:b}),c.jsx("p",{className:"text-xs text-slate-400 font-mono truncate",children:v||"No email in token claims"})]})]}),a&&c.jsxs("div",{className:"pt-2 border-t border-slate-800/80 text-[11px] flex items-center justify-between text-slate-400",children:[c.jsx("span",{children:"Token Subject (sub):"}),c.jsx("span",{className:"font-mono text-slate-300 truncate max-w-[200px]",children:a})]}),(r.tenant||(n==null?void 0:n.tenant))&&c.jsxs("div",{className:"pt-2 border-t border-slate-800/80 text-[11px] flex items-center justify-between text-slate-400",children:[c.jsx("span",{children:"Assigned Tenant:"}),c.jsx("span",{className:"font-semibold text-blue-300 truncate max-w-[200px]",children:r.tenant||(n==null?void 0:n.tenant)})]})]}),c.jsxs("div",{className:"p-4 rounded-xl bg-blue-950/30 border border-blue-800/40 text-xs text-blue-200 leading-relaxed",children:[c.jsx("p",{className:"font-semibold text-white mb-1",children:"Session Verified"}),"You are authenticated with validated enterprise security credentials. Your token claims are active and verified. You can proceed to the PFM Console to manage projects, reviews, and disbursements, or sign out of your session."]}),c.jsxs("div",{className:"space-y-3 pt-1",children:[c.jsxs("button",{onClick:()=>p("/dashboard"),id:"btn-return-to-console",className:"w-full py-3.5 px-5 rounded-xl bg-blue-600 hover:bg-blue-500 font-semibold text-sm text-white shadow-lg shadow-blue-600/25 flex items-center justify-center gap-2 transition cursor-pointer",children:[c.jsx("span",{children:"Return to PFM Console"}),c.jsx(d0,{className:"w-4 h-4"})]}),c.jsxs("button",{onClick:g,id:"btn-logout-identity-server",className:"w-full py-2.5 px-4 rounded-xl bg-slate-900 hover:bg-rose-950/40 hover:text-rose-300 text-slate-300 border border-slate-800 hover:border-rose-800/60 font-medium text-xs flex items-center justify-center gap-2 transition cursor-pointer",children:[c.jsx(ep,{className:"w-3.5 h-3.5"}),c.jsx("span",{children:"Sign Out of Session"})]})]}),c.jsxs("div",{className:"pt-2 border-t border-slate-800/80 text-[11px] text-slate-500 flex items-center justify-between",children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx(jw,{className:"w-3.5 h-3.5 text-blue-400"}),c.jsx("span",{children:"OAuth2 / OpenID Connect"})]}),c.jsxs("span",{className:"text-emerald-400 font-medium text-[11px] flex items-center gap-1",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 inline-block"}),"Verified Session"]})]})]}):c.jsxs("div",{className:"bg-[#0f1523]/90 border border-slate-800 rounded-2xl p-8 shadow-2xl relative overflow-hidden space-y-6 backdrop-blur-md",children:[c.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-blue-500 via-indigo-500 to-teal-400"}),c.jsxs("div",{className:"text-center space-y-3 pt-2",children:[c.jsx("div",{className:"flex justify-center",children:c.jsx(zl,{size:48,showGlow:!0,animateOnHover:!1})}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xl font-bold text-white tracking-tight",children:"Sign In"}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Enterprise Identity & Access Management"})]})]}),f&&c.jsx("div",{className:"p-3.5 rounded-xl bg-rose-950/40 border border-rose-800/60 text-rose-300 text-xs leading-relaxed",children:f}),c.jsx("div",{className:"space-y-4",children:c.jsxs("button",{onClick:y,disabled:m,id:"btn-enter-pfm-console",className:"w-full py-3.5 px-5 rounded-xl bg-blue-600 hover:bg-blue-500 font-semibold text-sm text-white shadow-lg shadow-blue-600/25 flex items-center justify-center gap-2 transition cursor-pointer disabled:opacity-50",children:[m?"Connecting to Identity Server...":"Enter PFM Console",c.jsx(d0,{className:"w-4 h-4"})]})}),c.jsxs("div",{className:"pt-2 border-t border-slate-800/80 text-[11px] text-slate-500 flex items-center justify-between",children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx(jw,{className:"w-3.5 h-3.5 text-slate-400"}),c.jsx("span",{children:"Single Sign-On (SSO)"})]}),c.jsx("span",{className:"text-slate-400 text-[11px]",children:"Enterprise Security"})]})]})})]})}),c.jsxs("footer",{className:"relative z-10 border-t border-slate-800/80 bg-[#0d121f]/80 backdrop-blur-md px-6 py-4 flex flex-col sm:flex-row items-center justify-between gap-3 text-xs text-slate-500",children:[c.jsxs("div",{className:"flex items-center gap-2.5",children:[c.jsx(zl,{size:20,showGlow:!1,animateOnHover:!1}),c.jsx("span",{className:"text-slate-400 font-medium",children:"Post-Fund Management, Performance & Impact System"})]}),c.jsx("p",{className:"text-slate-500",children:"Enterprise Governance & Audit Console"})]})]})};function wS(e,n){return function(){return e.apply(n,arguments)}}const{toString:mO}=Object.prototype,{getPrototypeOf:Ui}=Object,{iterator:Pc,toStringTag:_S}=Symbol,jc=(({hasOwnProperty:e})=>(n,r)=>e.call(n,r))(Object.prototype),SS=e=>typeof e=="string"&&(e==="__proto__"||e==="constructor"||e==="prototype"),NS=(e,n,r)=>e===Object.prototype||!r&&n===null,pO=e=>{if(!Object.isExtensible(e))return!1;const n=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&n.push(...Object.getOwnPropertySymbols(e)),n.every(r=>{if(SS(r))return!1;const a=Object.getOwnPropertyDescriptor(e,r);return!!a&&a.configurable&&a.writable===!0})},Ec=(e,n)=>{let r=e;const a=[];for(;r!=null;){if(a.indexOf(r)!==-1)return!1;a.push(r);const o=Ui(r);if(NS(r,o,r===e))return!1;if(jc(r,n))return!0;r=o}return!1},gO=(e,n)=>e!=null&&Ec(e,n)?e[n]:void 0,bO=e=>{if(e==null||typeof e!="object"&&typeof e!="function")return e;const n=Ui(e);if(n===null&&pO(e))return e;const r=Object.create(null),a=Object.create(null),o=[];let u=e;for(;u!=null&&o.indexOf(u)===-1;){o.push(u);const f=u===e?n:Ui(u);if(NS(u,f,u===e))break;const m=Object.getOwnPropertyNames(u);Object.getOwnPropertySymbols&&m.push(...Object.getOwnPropertySymbols(u));for(const p of m)SS(p)||jc(a,p)||(r[p]=e[p],a[p]=!0);u=f}return r},$p=(e=>n=>{const r=mO.call(n);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Ts=e=>(e=e.toLowerCase(),n=>$p(n)===e),of=e=>n=>typeof n===e,{isArray:Ma}=Array,za=of("undefined");function ao(e){return e!==null&&!za(e)&&e.constructor!==null&&!za(e.constructor)&&Yn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const jS=Ts("ArrayBuffer");function xO(e){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(e):n=e&&e.buffer&&jS(e.buffer),n}const yO=of("string"),Yn=of("function"),ES=of("number"),lo=e=>e!==null&&typeof e=="object",vO=e=>e===!0||e===!1,zd=e=>{if(!lo(e))return!1;const n=Ui(e);return(n===null||n===Object.prototype||Ui(n)===null)&&!Ec(e,_S)&&!Ec(e,Pc)},wO=e=>{if(!lo(e)||ao(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},_O=Ts("Date"),SO=Ts("File"),NO=e=>!!(e&&typeof e.uri<"u"),jO=e=>e&&typeof e.getParts<"u",EO=Ts("Blob"),AO=Ts("FileList"),CO=Ts("Set"),OO=e=>lo(e)&&Yn(e.pipe);function RO(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Cw=RO(),Ow=typeof Cw.FormData<"u"?Cw.FormData:void 0,TO=e=>{if(!e)return!1;if(Ow&&e instanceof Ow)return!0;const n=Ui(e);if(!n||n===Object.prototype||!Yn(e.append))return!1;const r=$p(e);return r==="formdata"||r==="object"&&Yn(e.toString)&&e.toString()==="[object FormData]"},kO=Ts("URLSearchParams"),[DO,MO,zO,UO]=["ReadableStream","Request","Response","Headers"].map(Ts),IO=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Hc(e,n,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let a,o;if(typeof e!="object"&&(e=[e]),Ma(e))for(a=0,o=e.length;a<o;a++)n.call(null,e[a],a,e);else{if(ao(e))return;const u=r?Object.getOwnPropertyNames(e):Object.keys(e),f=u.length;let m;for(a=0;a<f;a++)m=u[a],n.call(null,e[m],m,e)}}function AS(e,n){if(ao(e))return null;n=n.toLowerCase();const r=Object.keys(e);let a=r.length,o;for(;a-- >0;)if(o=r[a],n===o.toLowerCase())return o;return null}const xa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,CS=e=>!za(e)&&e!==xa;function np(...e){const{caseless:n,skipUndefined:r}=CS(this)&&this||{},a={},o=(u,f)=>{if(f==="__proto__"||f==="constructor"||f==="prototype")return;const m=n&&typeof f=="string"&&AS(a,f)||f,p=jc(a,m)?a[m]:void 0;zd(p)&&zd(u)?a[m]=np(p,u):zd(u)?a[m]=np({},u):Ma(u)?a[m]=u.slice():(!r||!za(u))&&(a[m]=u)};for(let u=0,f=e.length;u<f;u++){const m=e[u];if(!m||ao(m)||(Hc(m,o),typeof m!="object"||Ma(m)))continue;const p=Object.getOwnPropertySymbols(m);for(let y=0;y<p.length;y++){const g=p[y];KO.call(m,g)&&o(m[g],g)}}return a}const LO=(e,n,r,{allOwnKeys:a}={})=>(Hc(n,(o,u)=>{r&&Yn(o)?Object.defineProperty(e,u,{__proto__:null,value:wS(o,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,u,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:a}),e),PO=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),HO=(e,n,r,a)=>{e.prototype=Object.create(n.prototype,a),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:n.prototype}),r&&Object.assign(e.prototype,r)},qO=(e,n,r,a)=>{let o,u,f;const m={};if(n=n||{},e==null)return n;do{for(o=Object.getOwnPropertyNames(e),u=o.length;u-- >0;)f=o[u],(!a||a(f,e,n))&&!m[f]&&(n[f]=e[f],m[f]=!0);e=r!==!1&&Ui(e)}while(e&&(!r||r(e,n))&&e!==Object.prototype);return n},BO=(e,n,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=n.length;const a=e.indexOf(n,r);return a!==-1&&a===r},$O=e=>{if(!e)return null;if(Ma(e))return e;let n=e.length;if(!ES(n))return null;const r=new Array(n);for(;n-- >0;)r[n]=e[n];return r},FO=(e=>n=>e&&n instanceof e)(typeof Uint8Array<"u"&&Ui(Uint8Array)),VO=(e,n)=>{const a=(e&&e[Pc]).call(e);let o;for(;(o=a.next())&&!o.done;){const u=o.value;n.call(e,u[0],u[1])}},ZO=(e,n)=>{let r;const a=[];for(;(r=e.exec(n))!==null;)a.push(r);return a},GO=Ts("HTMLFormElement"),QO=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,a,o){return a.toUpperCase()+o}),{propertyIsEnumerable:KO}=Object.prototype,YO=Ts("RegExp"),OS=(e,n)=>{const r=Object.getOwnPropertyDescriptors(e),a={};Hc(r,(o,u)=>{let f;(f=n(o,u,e))!==!1&&(a[u]=f||o)}),Object.defineProperties(e,a)},JO=e=>{OS(e,(n,r)=>{if(Yn(e)&&["arguments","caller","callee"].includes(r))return!1;const a=e[r];if(Yn(a)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},XO=(e,n)=>{const r={},a=o=>{o.forEach(u=>{r[u]=!0})};return Ma(e)?a(e):a(String(e).split(n)),r},WO=()=>{},eR=(e,n)=>e!=null&&Number.isFinite(e=+e)?e:n;function tR(e){return!!(e&&Yn(e.append)&&e[_S]==="FormData"&&e[Pc])}const nR=e=>{const n=new WeakSet,r=a=>{if(lo(a)){if(n.has(a))return;if(ao(a))return a;if(!("toJSON"in a)){n.add(a);let o;if(CO(a)){o=[];for(const u of a){const f=r(u);!za(f)&&o.push(f)}}else o=Ma(a)?[]:{},Hc(a,(u,f)=>{const m=r(u);!za(m)&&(o[f]=m)});return n.delete(a),o}}return a};return r(e)},sR=Ts("AsyncFunction"),rR=e=>e&&(lo(e)||Yn(e))&&Yn(e.then)&&Yn(e.catch),RS=((e,n)=>e?setImmediate:n?((r,a)=>(xa.addEventListener("message",({source:o,data:u})=>{o===xa&&u===r&&a.length&&a.shift()()},!1),o=>{a.push(o),xa.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Yn(xa.postMessage)),iR=typeof queueMicrotask<"u"?queueMicrotask.bind(xa):typeof process<"u"&&process.nextTick||RS,TS=e=>e!=null&&Yn(e[Pc]),aR=e=>e!=null&&Ec(e,Pc)&&TS(e),M={isArray:Ma,isArrayBuffer:jS,isBuffer:ao,isFormData:TO,isArrayBufferView:xO,isString:yO,isNumber:ES,isBoolean:vO,isObject:lo,isPlainObject:zd,isEmptyObject:wO,isReadableStream:DO,isRequest:MO,isResponse:zO,isHeaders:UO,isUndefined:za,isDate:_O,isFile:SO,isReactNativeBlob:NO,isReactNative:jO,isBlob:EO,isRegExp:YO,isFunction:Yn,isStream:OO,isURLSearchParams:kO,isTypedArray:FO,isFileList:AO,forEach:Hc,merge:np,extend:LO,trim:IO,stripBOM:PO,inherits:HO,toFlatObject:qO,kindOf:$p,kindOfTest:Ts,endsWith:BO,toArray:$O,forEachEntry:VO,matchAll:ZO,isHTMLForm:GO,hasOwnProperty:jc,hasOwnProp:jc,hasOwnInPrototypeChain:Ec,getSafeProp:gO,toSafeFlatObject:bO,reduceDescriptors:OS,freezeMethods:JO,toObjectSet:XO,toCamelCase:QO,noop:WO,toFiniteNumber:eR,findKey:AS,global:xa,isContextDefined:CS,isSpecCompliantForm:tR,toJSONObject:nR,isAsyncFn:sR,isThenable:rR,setImmediate:RS,asap:iR,isIterable:TS,isSafeIterable:aR},lR=M.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oR=e=>{const n={};let r,a,o;return e&&e.split(`
`).forEach(function(f){o=f.indexOf(":"),r=f.substring(0,o).trim().toLowerCase(),a=f.substring(o+1).trim();const m=M.hasOwnProp(n,r);!r||m&&M.hasOwnProp(lR,r)||(r==="set-cookie"?m?n[r].push(a):n[r]=[a]:n[r]=m?n[r]+", "+a:a)}),n};function cR(e){let n=0,r=e.length;for(;n<r;){const a=e.charCodeAt(n);if(a!==9&&a!==32)break;n+=1}for(;r>n;){const a=e.charCodeAt(r-1);if(a!==9&&a!==32)break;r-=1}return n===0&&r===e.length?e:e.slice(n,r)}const uR=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),dR=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Fp(e,n){return M.isArray(e)?e.map(r=>Fp(r,n)):cR(String(e).replace(n,""))}const fR=e=>Fp(e,uR),hR=e=>Fp(e,dR);function kS(e){const n=Object.create(null);return M.forEach(e.toJSON(),(r,a)=>{n[a]=hR(r)}),n}const Rw=Symbol("internals");function cc(e){return e&&String(e).trim().toLowerCase()}function Ud(e){return e===!1||e==null?e:M.isArray(e)?e.map(Ud):fR(String(e))}function mR(e){const n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=r.exec(e);)n[a[1]]=a[2];return n}const pR=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function h0(e){let n=0,r=e.length;for(;n<r;){const a=e.charCodeAt(n);if(a!==9&&a!==32)break;n+=1}for(;r>n;){const a=e.charCodeAt(r-1);if(a!==9&&a!==32)break;r-=1}return n===0&&r===e.length?e:e.slice(n,r)}function gR(e){const n=e.length-1;if(n<1||e.charCodeAt(0)!==34||e.charCodeAt(n)!==34)return e;let r="";for(let a=1;a<n;a++){const o=e.charCodeAt(a);if(o===34||o===92&&(a+=1,a>=n))return e;r+=e[a]}return r}function bR(e){const n=Object.create(null),r=String(e);let a=0,o=!1,u=!1;function f(m){const p=h0(r.slice(a,m)),y=p.indexOf("=");if(y<1)return;const g=h0(p.slice(0,y));if(!pR.test(g))return;const b=g.toLowerCase();if(b==="__proto__"||b==="constructor"||b==="prototype")return;const v=h0(p.slice(y+1));n[b]=gR(v)}for(let m=0;m<r.length;m++){const p=r.charCodeAt(m);o?u?u=!1:p===92?u=!0:p===34&&(o=!1):p===34?o=!0:(p===44||p===59)&&(f(m),a=m+1)}return f(r.length),n}const xR=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function m0(e,n,r,a,o){if(M.isFunction(a))return a.call(this,n,r);if(o&&(n=r),!!M.isString(n)){if(M.isString(a))return n.indexOf(a)!==-1;if(M.isRegExp(a))return a.test(n)}}function yR(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(n,r,a)=>r.toUpperCase()+a)}function vR(e,n){const r=M.toCamelCase(" "+n);["get","set","has"].forEach(a=>{Object.defineProperty(e,a+r,{__proto__:null,value:function(o,u,f){return this[a].call(this,n,o,u,f)},configurable:!0})})}let On=class{constructor(n){n&&this.set(n)}set(n,r,a){const o=this;function u(m,p,y){const g=cc(p);if(!g)return;const b=M.findKey(o,g);(!b||o[b]===void 0||y===!0||y===void 0&&o[b]!==!1)&&(o[b||p]=Ud(m))}const f=(m,p)=>M.forEach(m,(y,g)=>u(y,g,p));if(M.isPlainObject(n)||n instanceof this.constructor)f(n,r);else if(M.isString(n)&&(n=n.trim())&&!xR(n))f(oR(n),r);else if(M.isObject(n)&&M.isSafeIterable(n)){let m=Object.create(null),p,y;for(const g of n){if(!M.isArray(g))throw new TypeError("Object iterator must return a key-value pair");y=g[0],M.hasOwnProp(m,y)?(p=m[y],m[y]=M.isArray(p)?[...p,g[1]]:[p,g[1]]):m[y]=g[1]}f(m,r)}else n!=null&&u(r,n,a);return this}get(n,r){if(n=cc(n),n){const a=M.findKey(this,n);if(a){const o=this[a];if(!r)return o;if(r===!0)return mR(o);if(M.isFunction(r))return r.call(this,o,a);if(M.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,r){if(n=cc(n),n){const a=M.findKey(this,n);return!!(a&&this[a]!==void 0&&(!r||m0(this,this[a],a,r)))}return!1}delete(n,r){const a=this;let o=!1;function u(f){if(f=cc(f),f){const m=M.findKey(a,f);m&&(!r||m0(a,a[m],m,r))&&(delete a[m],o=!0)}}return M.isArray(n)?n.forEach(u):u(n),o}clear(n){const r=Object.keys(this);let a=r.length,o=!1;for(;a--;){const u=r[a];(!n||m0(this,this[u],u,n,!0))&&(delete this[u],o=!0)}return o}normalize(n){const r=this,a={};return M.forEach(this,(o,u)=>{const f=M.findKey(a,u);if(f){r[f]=Ud(o),delete r[u];return}const m=n?yR(u):String(u).trim();m!==u&&delete r[u],r[m]=Ud(o),a[m]=!0}),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const r=Object.create(null);return M.forEach(this,(a,o)=>{a!=null&&a!==!1&&(r[o]=n&&M.isArray(a)?a.join(", "):a)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([n,r])=>n+": "+r).join(`
`)}getSetCookie(){const n=this.get("set-cookie");return M.isArray(n)?n:n==null||n===!1?[]:[n]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static parseParameters(n){return bR(n)}static concat(n,...r){const a=new this(n);return r.forEach(o=>a.set(o)),a}static accessor(n){const a=(this[Rw]=this[Rw]={accessors:{}}).accessors,o=this.prototype;function u(f){const m=cc(f);a[m]||(vR(o,f),a[m]=!0)}return M.isArray(n)?n.forEach(u):u(n),this}};On.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);M.reduceDescriptors(On.prototype,({value:e},n)=>{let r=n[0].toUpperCase()+n.slice(1);return{get:()=>e,set(a){this[r]=a}}});M.freezeMethods(On);const Gd="[REDACTED ****]";function wR(e){if(M.hasOwnProp(e,"toJSON"))return!0;let n=Object.getPrototypeOf(e);for(;n&&n!==Object.prototype;){if(M.hasOwnProp(n,"toJSON"))return!0;n=Object.getPrototypeOf(n)}return!1}function _R(e,n){const r=new Set(n.map(u=>String(u).toLowerCase())),a=[],o=u=>{if(u===null||typeof u!="object"||M.isBuffer(u))return u;if(a.indexOf(u)!==-1)return;u instanceof On&&(u=u.toJSON()),a.push(u);let f;if(M.isArray(u))f=[],u.forEach((m,p)=>{const y=o(m);M.isUndefined(y)||(f[p]=y)});else{if(!M.isPlainObject(u)&&wR(u))return a.pop(),u;f=Object.create(null);for(const[m,p]of Object.entries(u)){const y=r.has(m.toLowerCase())?Gd:o(p);M.isUndefined(y)||(f[m]=y)}}return a.pop(),f};return o(e)}function Tw(e){try{return String(e)}catch{return""}}function SR(e){return e.errors.map(r=>{try{return r&&r.message?Tw(r.message):Tw(r)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}let ye=class DS extends Error{static from(n,r,a,o,u,f){let m=n.message;!m&&M.isArray(n.errors)&&n.errors.length&&(m=SR(n));const p=new DS(m,r||n.code,a,o,u);return Object.defineProperty(p,"cause",{__proto__:null,value:n,writable:!0,enumerable:!1,configurable:!0}),p.name=n.name,n.status!=null&&p.status==null&&(p.status=n.status),f&&Object.assign(p,f),p}constructor(n,r,a,o,u){super(n),Object.defineProperty(this,"message",{__proto__:null,value:n,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),a&&(this.config=a),o&&(this.request=o),u&&(this.response=u,this.status=u.status)}toJSON(){const n=this.config,r=n&&M.hasOwnProp(n,"redact")?n.redact:void 0,a=M.isArray(r)&&r.length>0?_R(n,r):M.toJSONObject(n);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a,code:this.code,status:this.status}}};ye.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";ye.ERR_BAD_OPTION="ERR_BAD_OPTION";ye.ECONNABORTED="ECONNABORTED";ye.ETIMEDOUT="ETIMEDOUT";ye.ECONNREFUSED="ECONNREFUSED";ye.ERR_NETWORK="ERR_NETWORK";ye.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";ye.ERR_DEPRECATED="ERR_DEPRECATED";ye.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";ye.ERR_BAD_REQUEST="ERR_BAD_REQUEST";ye.ERR_CANCELED="ERR_CANCELED";ye.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";ye.ERR_INVALID_URL="ERR_INVALID_URL";ye.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const NR=null,MS=100;function sp(e){return M.isPlainObject(e)||M.isArray(e)}function zS(e){return M.endsWith(e,"[]")?e.slice(0,-2):e}function p0(e,n,r){return e?e.concat(n).map(function(o,u){return o=zS(o),!r&&u?"["+o+"]":o}).join(r?".":""):n}function jR(e){return M.isArray(e)&&!e.some(sp)}const ER=M.toFlatObject(M,{},null,function(n){return/^is[A-Z]/.test(n)});function cf(e,n,r){if(!M.isObject(e))throw new TypeError("target must be an object");n=n||new FormData;const a=(j,F)=>{const q=M.getSafeProp(r,j);return M.isUndefined(q)?F:q},o=a("metaTokens",!0),u=a("visitor")||C,f=a("dots",!1),m=a("indexes",!1),p=a("Blob")||typeof Blob<"u"&&Blob,y=a("maxDepth",MS),g=p&&M.isSpecCompliantForm(n),b=[];if(!M.isFunction(u))throw new TypeError("visitor must be a function");function v(j){if(j===null)return"";if(M.isDate(j))return j.toISOString();if(M.isBoolean(j))return j.toString();if(!g&&M.isBlob(j))throw new ye("Blob is not supported. Use a Buffer instead.");if(M.isArrayBuffer(j)||M.isTypedArray(j)){if(g&&typeof p=="function")return new p([j]);throw new ye("Blob is not supported. Use a Buffer instead.",ye.ERR_NOT_SUPPORT)}return j}function S(j){if(j>y)throw new ye("Object is too deeply nested ("+j+" levels). Max depth: "+y,ye.ERR_FORM_DATA_DEPTH_EXCEEDED)}function A(j,F){if(y===1/0)return JSON.stringify(j);const q=[];return JSON.stringify(j,function(re,Q){if(!M.isObject(Q))return Q;for(;q.length&&q[q.length-1]!==this;)q.pop();return q.push(Q),S(F+q.length-1),Q})}function C(j,F,q){let B=j;if(M.isReactNative(n)&&M.isReactNativeBlob(j))return n.append(p0(q,F,f),v(j)),!1;if(j&&!q&&typeof j=="object"){if(M.endsWith(F,"{}"))F=o?F:F.slice(0,-2),j=A(j,1);else if(M.isArray(j)&&jR(j)||(M.isFileList(j)||M.endsWith(F,"[]"))&&(B=M.toArray(j)))return F=zS(F),B.forEach(function(Q,X){!(M.isUndefined(Q)||Q===null)&&n.append(m===!0?p0([F],X,f):m===null?F:F+"[]",v(Q))}),!1}return sp(j)?!0:(n.append(p0(q,F,f),v(j)),!1)}const O=Object.assign(ER,{defaultVisitor:C,convertValue:v,isVisitable:sp});function N(j,F,q=0){if(!M.isUndefined(j)){if(S(q),b.indexOf(j)!==-1)throw new Error("Circular reference detected in "+F.join("."));b.push(j),M.forEach(j,function(re,Q){(!(M.isUndefined(re)||re===null)&&u.call(n,re,M.isString(Q)?Q.trim():Q,F,O))===!0&&N(re,F?F.concat(Q):[Q],q+1)}),b.pop()}}if(!M.isObject(e))throw new TypeError("data must be an object");return N(e),n}function kw(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(a){return n[a]})}function Vp(e,n){this._pairs=[],e&&cf(e,this,n)}const US=Vp.prototype;US.append=function(n,r){this._pairs.push([n,r])};US.toString=function(n){const r=n?a=>n.call(this,a,kw):kw;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function AR(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function IS(e,n,r){if(!n)return e;e=e||"";const a=M.isFunction(r)?{serialize:r}:r,o=M.getSafeProp(a,"encode")||AR,u=M.getSafeProp(a,"serialize");let f;if(u?f=u(n,a):f=M.isURLSearchParams(n)?n.toString():new Vp(n,a).toString(o),f){const m=e.indexOf("#");m!==-1&&(e=e.slice(0,m)),e+=(e.indexOf("?")===-1?"?":"&")+f}return e}const uc=Symbol("internals");function LS(e){return e?e.length:0}function Dw(e){if(e)for(;e.length&&e[e.length-1]===null;)e.pop()}function dc(e,n){const r=e.handlers,a=LS(r);r!==n.handlersRef?(n.handlersRef=r,n.handlerEntries.clear()):a!==n.handlersLength&&(a?n.handlerEntries.forEach(function(u,f){r[u.index]!==u.handler&&n.handlerEntries.delete(f)}):n.handlerEntries.clear()),n.handlersLength=a}class Mw{constructor(){this.handlers=[],this[uc]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(n,r,a){const o={fulfilled:n,rejected:r,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null},u=this[uc];this.handlers==null&&(this.handlers=[]),dc(this,u);const f=u.nextId++;return this.handlers.push(o),u.handlerEntries.set(f,{handler:o,index:this.handlers.length-1}),u.handlersLength=this.handlers.length,f}eject(n){const r=this[uc];dc(this,r);const a=r.handlerEntries.get(n);if(a){if(r.handlerEntries.delete(n),this.handlers[a.index]!==a.handler)return;this.handlers[a.index]=null,r.iterationDepth||(Dw(this.handlers),r.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],dc(this,this[uc]))}forEach(n){const r=this[uc];dc(this,r),r.iterationDepth++;try{M.forEach(this.handlers,function(o){o!==null&&n(o)})}finally{--r.iterationDepth||(dc(this,r),Dw(this.handlers),r.handlersLength=LS(this.handlers))}}}const Zp={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},CR=typeof URLSearchParams<"u"?URLSearchParams:Vp,OR=typeof FormData<"u"?FormData:null,RR=typeof Blob<"u"?Blob:null,TR={isBrowser:!0,classes:{URLSearchParams:CR,FormData:OR,Blob:RR},protocols:["http","https","file","blob","url","data"]},Gp=typeof window<"u"&&typeof document<"u",rp=typeof navigator=="object"&&navigator||void 0,kR=Gp&&(!rp||["ReactNative","NativeScript","NS"].indexOf(rp.product)<0),DR=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",MR=Gp&&window.location.href||"http://localhost",zR=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Gp,hasStandardBrowserEnv:kR,hasStandardBrowserWebWorkerEnv:DR,navigator:rp,origin:MR},Symbol.toStringTag,{value:"Module"})),fn={...zR,...TR};function UR(e,n){return cf(e,new fn.classes.URLSearchParams,{visitor:function(r,a,o,u){return fn.isNode&&M.isBuffer(r)?(this.append(a,r.toString("base64")),!1):u.defaultVisitor.apply(this,arguments)},...n})}const zw=MS;function PS(e){if(e>zw)throw new ye("FormData field is too deeply nested ("+e+" levels). Max depth: "+zw,ye.ERR_FORM_DATA_DEPTH_EXCEEDED)}function IR(e){const n=[],r=/[^.[\]]+|\[([^.[\]]*)]/g;let a;for(;(a=r.exec(e))!==null;)PS(n.length),n.push(a[0]==="[]"?"":a[1]||a[0]);return n}function LR(e){const n={},r=Object.keys(e);let a;const o=r.length;let u;for(a=0;a<o;a++)u=r[a],n[u]=e[u];return n}function HS(e){function n(r,a,o,u){PS(u);let f=r[u++];if(f==="__proto__")return!0;const m=Number.isFinite(+f),p=u>=r.length;return f=!f&&M.isArray(o)?o.length:f,p?(M.hasOwnProp(o,f)?o[f]=M.isArray(o[f])?o[f].concat(a):[o[f],a]:o[f]=a,!m):((!M.hasOwnProp(o,f)||!M.isObject(o[f]))&&(o[f]=[]),n(r,a,o[f],u)&&M.isArray(o[f])&&(o[f]=LR(o[f])),!m)}if(M.isFormData(e)&&M.isFunction(e.entries)){const r={};return M.forEachEntry(e,(a,o)=>{n(IR(a),o,r,0)}),r}return null}const qS=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Tl=(e,n)=>e!=null&&M.hasOwnProp(e,n)?e[n]:void 0;function PR(e,n,r){if(M.isString(e))try{return(n||JSON.parse)(e),M.trim(e)}catch(a){if(a.name!=="SyntaxError")throw a}return(r||JSON.stringify)(e)}const qc={transitional:Zp,adapter:["xhr","http","fetch"],transformRequest:[function(n,r){const a=r.getContentType()||"",o=a.indexOf("application/json")>-1,u=M.isObject(n);if(u&&M.isHTMLForm(n)&&(n=new FormData(n)),M.isFormData(n))return o?JSON.stringify(HS(n)):n;if(M.isArrayBuffer(n)||M.isBuffer(n)||M.isStream(n)||M.isFile(n)||M.isBlob(n)||M.isReadableStream(n))return n;if(M.isArrayBufferView(n))return n.buffer;if(M.isURLSearchParams(n))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let m;if(u){const p=Tl(this,"formSerializer");if(a.indexOf("application/x-www-form-urlencoded")>-1)return UR(n,p).toString();if((m=M.isFileList(n))||a.indexOf("multipart/form-data")>-1){const y=Tl(this,"env"),g=y&&y.FormData;return cf(m?{"files[]":n}:n,g&&new g,p)}}return u||o?(r.setContentType("application/json",!1),PR(n)):n}],transformResponse:[function(n){const r=Tl(this,"transitional")||qc.transitional,a=r&&r.forcedJSONParsing,o=Tl(this,"responseType"),u=o==="json";if(M.isResponse(n)||M.isReadableStream(n))return n;if(n&&M.isString(n)&&(a&&!o||u)){const m=!(r&&r.silentJSONParsing)&&u;try{return JSON.parse(n,Tl(this,"parseReviver"))}catch(p){if(m)throw p.name==="SyntaxError"?ye.from(p,ye.ERR_BAD_RESPONSE,this,null,Tl(this,"response")):p}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:fn.classes.FormData,Blob:fn.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};M.forEach(qS,e=>{qc.headers[e]={}});function g0(e,n){const r=this||qc,a=n||r,o=On.from(a.headers);let u=a.data;return M.forEach(e,function(m){u=m.call(r,u,o.normalize(),n?n.status:void 0)}),o.normalize(),u}function BS(e){return!!(e&&e.__CANCEL__)}let Bc=class extends ye{constructor(n,r,a){super(n??"canceled",ye.ERR_CANCELED,r,a),this.name="CanceledError",this.__CANCEL__=!0}};function $S(e,n,r){const a=r.config.validateStatus;!r.status||!a||a(r.status)?e(r):n(new ye("Request failed with status code "+r.status,r.status>=400&&r.status<500?ye.ERR_BAD_REQUEST:ye.ERR_BAD_RESPONSE,r.config,r.request,r))}const HR=/[\t\n\r]/g;function FS(e){if(typeof e!="string")return e;let n=0;for(;n<e.length&&e.charCodeAt(n)<=32;)n++;return e.slice(n).replace(HR,"")}function b0(e){const n=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return n&&n[1]||""}function qR(e,n){e=e||10;const r=new Array(e),a=new Array(e);let o=0,u=0,f;return n=n!==void 0?n:1e3,function(p){const y=Date.now(),g=a[u];f||(f=y),r[o]=p,a[o]=y;let b=u,v=0;for(;b!==o;)v+=r[b++],b=b%e;if(o=(o+1)%e,o===u&&(u=(u+1)%e),y-f<n)return;const S=g&&y-g;return S?Math.round(v*1e3/S):void 0}}function BR(e,n){let r=0,a=1e3/n,o,u;const f=(g,b=Date.now())=>{r=b,o=null,u&&(clearTimeout(u),u=null),e(...g)};return[(...g)=>{const b=Date.now(),v=b-r;v>=a?f(g,b):(o=g,u||(u=setTimeout(()=>{u=null,f(o)},a-v)))},()=>o&&f(o),(...g)=>f(g)]}const Qd=(e,n,r=3)=>{let a=0;const o=qR(50,250);return BR(u=>{if(!u||!M.isNumber(u.loaded))return;const f=u.loaded,m=u.lengthComputable?u.total:void 0,p=Math.max(0,m!=null?Math.min(f,m):f),y=Math.max(0,p-a),g=o(y);a=Math.max(a,p);const b={loaded:p,total:m,progress:m?p/m:void 0,bytes:y,rate:g||void 0,estimated:g&&m?(m-p)/g:void 0,event:u,lengthComputable:m!=null,[n?"download":"upload"]:!0};e(b)},r)},Uw=(e,n)=>{const r=e!=null;return[a=>n[0]({lengthComputable:r,total:e,loaded:a}),n[1]]},Iw=(e,n=M.asap)=>(...r)=>n(()=>e(...r)),$R=fn.hasStandardBrowserEnv?((e,n)=>r=>(r=new URL(r,fn.origin),e.protocol===r.protocol&&e.host===r.host&&(n||e.port===r.port)))(new URL(fn.origin),fn.navigator&&/(msie|trident)/i.test(fn.navigator.userAgent)):()=>!0,FR=fn.hasStandardBrowserEnv?{write(e,n,r,a,o,u,f){if(typeof document>"u")return;const m=[`${e}=${encodeURIComponent(n)}`];M.isNumber(r)&&m.push(`expires=${new Date(r).toUTCString()}`),M.isString(a)&&m.push(`path=${a}`),M.isString(o)&&m.push(`domain=${o}`),u===!0&&m.push("secure"),M.isString(f)&&m.push(`SameSite=${f}`),document.cookie=m.join("; ")},read(e){if(typeof document>"u")return null;const n=document.cookie.split(";");for(let r=0;r<n.length;r++){const a=n[r].replace(/^\s+/,""),o=a.indexOf("=");if(o!==-1&&a.slice(0,o)===e)try{return decodeURIComponent(a.slice(o+1))}catch{return a.slice(o+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function VR(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ZR(e,n){if(!n)return e;let r=e.length;for(;r>0&&e.charCodeAt(r-1)===47;)r--;return e.slice(0,r)+"/"+n.replace(/^\/+/,"")}const GR=/^https?:(?!\/\/)/i;function QR(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(n,r,a="")=>`${r}${a}${Gd}`)}function KR(e){const n=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Gd}@`),r=n.indexOf("#"),o=(r===-1?n:n.slice(0,r)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Gd}`);return r===-1?o:`${o}#${QR(n.slice(r+1))}`}function Lw(e,n){if(typeof e=="string"){const r=FS(e);if(GR.test(r))throw new ye(`Invalid URL ${JSON.stringify(KR(r))}: missing "//" after protocol`,ye.ERR_INVALID_URL,n)}}function VS(e,n,r,a){Lw(n,a);let o=!VR(n);return e&&(o||r===!1)?(Lw(e,a),ZR(e,n)):n}const Pw=e=>e instanceof On?{...e}:e,YR=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(n=>Object.getOwnPropertyDescriptor(e,n).enumerable)):Object.keys(e);function Ua(e,n){e=e||{},n=n||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function a(g,b,v,S){return M.isPlainObject(g)&&M.isPlainObject(b)?M.merge.call({caseless:S},g,b):M.isPlainObject(b)?M.merge({},b):M.isArray(b)?b.slice():b}function o(g,b,v,S){if(M.isUndefined(b)){if(!M.isUndefined(g))return a(void 0,g,v,S)}else return a(g,b,v,S)}function u(g,b){if(!M.isUndefined(b))return a(void 0,b)}function f(g,b){if(M.isUndefined(b)){if(!M.isUndefined(g))return a(void 0,g)}else return a(void 0,b)}function m(g){const b=M.hasOwnProp(n,"transitional")?n.transitional:void 0;if(!M.isUndefined(b))if(M.isPlainObject(b)){if(M.hasOwnProp(b,g))return b[g]}else return;const v=M.hasOwnProp(e,"transitional")?e.transitional:void 0;if(M.isPlainObject(v)&&M.hasOwnProp(v,g))return v[g]}function p(g,b,v){if(M.hasOwnProp(n,v))return a(g,b);if(M.hasOwnProp(e,v))return a(void 0,g)}const y={url:u,method:u,data:u,baseURL:f,transformRequest:f,transformResponse:f,paramsSerializer:f,timeout:f,timeoutErrorMessage:f,withCredentials:f,withXSRFToken:f,adapter:f,responseType:f,xsrfCookieName:f,xsrfHeaderName:f,onUploadProgress:f,onDownloadProgress:f,decompress:f,maxContentLength:f,maxBodyLength:f,beforeRedirect:f,transport:f,httpAgent:f,httpsAgent:f,cancelToken:f,socketPath:f,allowedSocketPaths:f,responseEncoding:f,validateStatus:p,headers:(g,b,v)=>o(Pw(g),Pw(b),v,!0)};return M.forEach(YR({...e,...n}),function(b){if(b==="__proto__"||b==="constructor"||b==="prototype")return;const v=M.hasOwnProp(y,b)?y[b]:o,S=M.hasOwnProp(e,b)?e[b]:void 0,A=M.hasOwnProp(n,b)?n[b]:void 0,C=v(S,A,b);M.isUndefined(C)&&v!==p||(r[b]=C)}),M.hasOwnProp(n,"validateStatus")&&M.isUndefined(n.validateStatus)&&m("validateStatusUndefinedResolves")===!1&&(M.hasOwnProp(e,"validateStatus")?r.validateStatus=a(void 0,e.validateStatus):delete r.validateStatus),r}const JR=["content-type","content-length"];function XR(e,n,r){if(r!=="content-only"){e.set(n);return}Object.entries(n||{}).forEach(([a,o])=>{JR.includes(a.toLowerCase())&&e.set(a,o)})}const WR=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(n,r)=>String.fromCharCode(parseInt(r,16)));function ZS(e){const n=Ua({},e),r=v=>M.hasOwnProp(n,v)?n[v]:void 0,a=r("data");let o=r("withXSRFToken");const u=r("xsrfHeaderName"),f=r("xsrfCookieName");let m=r("headers");const p=r("auth"),y=r("baseURL"),g=r("allowAbsoluteUrls"),b=r("url");if(n.headers=m=On.from(m),n.url=IS(VS(y,b,g,n),r("params"),r("paramsSerializer")),p){const v=M.getSafeProp(p,"username")||"",S=M.getSafeProp(p,"password")||"";try{m.set("Authorization","Basic "+btoa(v+":"+(S?WR(S):"")))}catch(A){throw ye.from(A,ye.ERR_BAD_OPTION_VALUE,e)}}if(M.isFormData(a)){const v=M.getSafeProp(a,"getHeaders");fn.hasStandardBrowserEnv||fn.hasStandardBrowserWebWorkerEnv||M.isReactNative(a)?m.setContentType(void 0):M.isFunction(v)&&XR(m,v.call(a),r("formDataHeaderPolicy"))}if(fn.hasStandardBrowserEnv&&(M.isFunction(o)&&(o=o(n)),o===!0||o==null&&$R(n.url))){const S=u&&f&&FR.read(f);S&&m.set(u,S)}return n}const eT=typeof XMLHttpRequest<"u",tT=eT&&function(e){return new Promise(function(r,a){const o=ZS(e);let u=o.data;const f=On.from(o.headers).normalize();let{responseType:m,onUploadProgress:p,onDownloadProgress:y}=o,g,b,v,S,A,C;function O(){S&&S(),A&&A(),o.cancelToken&&o.cancelToken.unsubscribe(g),o.signal&&o.signal.removeEventListener("abort",g)}let N=new XMLHttpRequest;N.open(o.method.toUpperCase(),o.url,!0),N.timeout=o.timeout;function j(q){if(!N)return;if(N.status===0&&(b0(FS(o.url))||b0(fn.origin))!=="file"&&!(N.responseURL&&N.responseURL.startsWith("file:"))){a(new ye("Request aborted",ye.ECONNABORTED,e,N)),O(),N=null;return}try{q?C&&C(q):A&&A()}catch(X){setTimeout(()=>{throw X})}if(!N)return;const B=On.from("getAllResponseHeaders"in N&&N.getAllResponseHeaders()),Q={data:!m||m==="text"||m==="json"?N.responseText:N.response,status:N.status,statusText:N.statusText,headers:B,config:e,request:N};$S(function(se){r(se),O()},function(se){a(se),O()},Q),N=null}"onloadend"in N?N.onloadend=j:N.onreadystatechange=function(){!N||N.readyState!==4||N.status===0&&!(N.responseURL&&N.responseURL.startsWith("file:"))||setTimeout(j)},N.onabort=function(){N&&(a(new ye("Request aborted",ye.ECONNABORTED,e,N)),O(),N=null)},N.onerror=function(B){const re=B&&B.message?B.message:"Network Error",Q=new ye(re,ye.ERR_NETWORK,e,N);Q.event=B||null,a(Q),O(),N=null},N.ontimeout=function(){let B=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const re=o.transitional||Zp;o.timeoutErrorMessage&&(B=o.timeoutErrorMessage),a(new ye(B,re.clarifyTimeoutError?ye.ETIMEDOUT:ye.ECONNABORTED,e,N)),O(),N=null},u===void 0&&f.setContentType(null),"setRequestHeader"in N&&M.forEach(kS(f),function(B,re){N.setRequestHeader(re,B)}),M.isUndefined(o.withCredentials)||(N.withCredentials=!!o.withCredentials),m&&m!=="json"&&(N.responseType=o.responseType),y&&([v,A,C]=Qd(y,!0),N.addEventListener("progress",v)),p&&N.upload&&([b,S]=Qd(p),N.upload.addEventListener("progress",b),N.upload.addEventListener("loadend",S)),(o.cancelToken||o.signal)&&(g=q=>{N&&(a(!q||q.type?new Bc(null,e,N):q),N.abort(),O(),N=null)},o.cancelToken&&o.cancelToken.subscribe(g),o.signal&&(o.signal.aborted?g():o.signal.addEventListener("abort",g)));const F=b0(o.url);if(F&&!fn.protocols.includes(F)){a(new ye("Unsupported protocol "+F+":",ye.ERR_BAD_REQUEST,e)),O();return}N.send(u||null)})},nT=(e,n)=>{if(e=e?e.filter(Boolean):[],!n&&!e.length)return;const r=new AbortController;let a=!1;const o=function(p){if(!a){a=!0,f();const y=p instanceof Error?p:this.reason;r.abort(y instanceof ye?y:new Bc(y instanceof Error?y.message:y))}};let u=n&&setTimeout(()=>{u=null,o(new ye(`timeout of ${n}ms exceeded`,ye.ETIMEDOUT))},n);const f=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(o):p.removeEventListener("abort",o)}),e=null)};e.forEach(p=>{if(!a){if(p.aborted){o.call(p);return}p.addEventListener("abort",o,{once:!0})}});const{signal:m}=r;return m.unsubscribe=()=>M.asap(f),m},sT=function*(e,n){let r=e.byteLength;if(r<n){yield e;return}let a=0,o;for(;a<r;)o=a+n,yield e.slice(a,o),a=o},rT=async function*(e,n){for await(const r of iT(e))yield*sT(r,n)},iT=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const n=e.getReader();try{for(;;){const{done:r,value:a}=await n.read();if(r)break;yield a}}finally{await n.cancel()}},Hw=(e,n,r,a)=>{const o=rT(e,n);let u=0,f,m=p=>{f||(f=!0,a&&a(p))};return new ReadableStream({async pull(p){try{const{done:y,value:g}=await o.next();if(y){m(),p.close();return}let b=g.byteLength;if(r){let v=u+=b;r(v)}p.enqueue(new Uint8Array(g))}catch(y){throw m(y),y}},cancel(p){return m(p),o.return()}},{highWaterMark:2})},qw=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,GS=(e,n,r)=>n+2<r&&qw(e.charCodeAt(n+1))&&qw(e.charCodeAt(n+2)),Bw=e=>e<=57?e-48:(e&223)-55,aT=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,lT=e=>e===9||e===10||e===12||e===13||e===32,oT=e=>{const n=Math.floor(e/4),r=e%4;return n*3+(r===2?1:r===3?2:0)},cT=e=>{const n=e.length;let r=0;return n>0&&e.charCodeAt(n-1)===61&&(r++,n>1&&e.charCodeAt(n-2)===61&&r++),Math.floor((n-r)*3/4)},uT=e=>{const n=e.length;let r=0,a=0,o=!1;for(let u=0;u<n;u++){let f=e.charCodeAt(u);if(f===37&&GS(e,u,n)&&(f=Bw(e.charCodeAt(u+1))*16+Bw(e.charCodeAt(u+2)),u+=2),!lT(f)){if(f===61){a++;continue}if(!aT(f)||a>0){o=!0;continue}r++}}return o||a>2||a>0&&(r+a)%4!==0||r%4===1?cT(e):oT(r)},dT=(e,n)=>{if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const r=e.indexOf(",");if(r<0)return 0;const a=e.slice(5,r),o=e.slice(r+1);if(/;base64/i.test(a))return n(o);let f=0;for(let m=0,p=o.length;m<p;m++){const y=o.charCodeAt(m);if(y===37&&GS(o,m,p))f+=1,m+=2;else if(y<128)f+=1;else if(y<2048)f+=2;else if(y>=55296&&y<=56319&&m+1<p){const g=o.charCodeAt(m+1);g>=56320&&g<=57343?(f+=4,m++):f+=3}else f+=3}return f};function fT(e){const n=typeof e=="string"?e.indexOf("#"):-1;return dT(n===-1?e:e.slice(0,n),uT)}const Qp="1.20.0",$w=64*1024,hT={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:_d}=M,mT=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(n,r)=>String.fromCharCode(parseInt(r,16))),Fw=e=>{if(!M.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Vw=(e,...n)=>{try{return!!e(...n)}catch{return!1}},pT=e=>{const n=e.indexOf("://");let r=e;return n!==-1&&(r=r.slice(n+3)),r.includes("@")||r.includes(":")},gT=e=>{const n=M.global!==void 0&&M.global!==null?M.global:globalThis,{ReadableStream:r,TextEncoder:a}=n;e=M.merge.call({skipUndefined:!0},{Request:n.Request,Response:n.Response},e);const{fetch:o,Request:u,Response:f}=e,m=o?_d(o):typeof fetch=="function",p=_d(u),y=_d(f);if(!m)return!1;const g=m&&_d(r),b=m&&(typeof a=="function"?(N=>j=>N.encode(j))(new a):async N=>new Uint8Array(await new u(N).arrayBuffer())),v=p&&g&&Vw(()=>{let N=!1;const j=new u(fn.origin,{body:new r,method:"POST",get duplex(){return N=!0,"half"}}),F=j.headers.has("Content-Type");return j.body!=null&&j.body.cancel(),N&&!F}),S=y&&g&&Vw(()=>M.isReadableStream(new f("").body)),A={stream:S&&(N=>N.body)};m&&["text","arrayBuffer","blob","formData","stream"].forEach(N=>{!A[N]&&(A[N]=(j,F)=>{let q=j&&j[N];if(q)return q.call(j);throw new ye(`Response type '${N}' is not supported`,ye.ERR_NOT_SUPPORT,F)})});const C=async N=>{if(N==null)return 0;if(M.isBlob(N))return N.size;if(M.isSpecCompliantForm(N))return(await new u(fn.origin,{method:"POST",body:N}).arrayBuffer()).byteLength;if(M.isArrayBufferView(N)||M.isArrayBuffer(N))return N.byteLength;if(M.isURLSearchParams(N)&&(N=N+""),M.isString(N))return(await b(N)).byteLength},O=async(N,j)=>{const F=M.toFiniteNumber(N.getContentLength());return F??C(j)};return async N=>{let{url:j,method:F,data:q,signal:B,cancelToken:re,timeout:Q,onDownloadProgress:X,onUploadProgress:se,responseType:fe,headers:we,withCredentials:Ce="same-origin",fetchOptions:Z,maxContentLength:W,maxBodyLength:oe,maxRedirects:ee}=ZS(N);const z=M.isNumber(W)&&W>-1,ue=M.isNumber(oe)&&oe>-1,Me=ce=>M.hasOwnProp(N,ce)?N[ce]:void 0;let Ae=o||fetch;fe=fe?(fe+"").toLowerCase():"text";let Ye=nT([B,re&&re.toAbortSignal()],Q),$e=null;const ut=Ye&&Ye.unsubscribe&&(()=>{Ye.unsubscribe()});let _,Y=null;const he=()=>new ye("Request body larger than maxBodyLength limit",ye.ERR_BAD_REQUEST,N,$e);try{let ce;const Oe=Me("auth");if(Oe){const pe=M.getSafeProp(Oe,"username")||"",$=M.getSafeProp(Oe,"password")||"";ce={username:pe,password:$}}if(pT(j)){const pe=new URL(j,fn.origin);if(!ce&&(pe.username||pe.password)){const $=Fw(pe.username),Ge=Fw(pe.password);ce={username:$,password:Ge}}(pe.username||pe.password)&&(pe.username="",pe.password="",j=pe.href)}if(ce&&(we.delete("authorization"),we.set("Authorization","Basic "+btoa(mT((ce.username||"")+":"+(ce.password||""))))),z&&typeof j=="string"&&j.startsWith("data:")&&fT(j)>W)throw new ye("maxContentLength size of "+W+" exceeded",ye.ERR_BAD_RESPONSE,N,$e);if(ue&&F!=="get"&&F!=="head"){const pe=await C(q);if(typeof pe=="number"&&isFinite(pe)&&(_=pe,pe>oe))throw he()}const Pe=ue&&(M.isReadableStream(q)||M.isStream(q)),qe=(pe,$,Ge)=>Hw(pe,$w,rt=>{if(ue&&rt>oe)throw Y=he();$&&$(rt)},Ge);if(v&&F!=="get"&&F!=="head"&&(se||Pe)){if(_=_??await O(we,q),_!==0||Pe){let pe=new u(j,{method:"POST",body:q,duplex:"half"}),$;if(M.isFormData(q)&&($=pe.headers.get("content-type"))&&we.setContentType($),pe.body){const[Ge,rt]=se&&Uw(_,Qd(Iw(se)))||[];q=qe(pe.body,Ge,rt)}}}else if(Pe&&!p&&g&&F!=="get"&&F!=="head")q=qe(q);else if(Pe&&p&&!v&&F!=="get"&&F!=="head")throw new ye("Stream request bodies are not supported by the current fetch implementation",ye.ERR_NOT_SUPPORT,N,$e);M.isString(Ce)||(Ce=Ce?"include":"omit");const _e=p&&"credentials"in u.prototype;if(M.isFormData(q)){const pe=we.getContentType();pe&&/^multipart\/form-data/i.test(pe)&&!/boundary=/i.test(pe)&&we.delete("content-type")}we.set("User-Agent","axios/"+Qp,!1);const je=Z==null?Z:Object.assign(Object.create(null),Z);je&&(delete je.body,delete je.headers,delete je.method,delete je.signal,delete je.duplex,delete je.credentials);const at=Object.assign(Object.create(null),je,{signal:Ye,method:F.toUpperCase(),headers:kS(we.normalize()),body:q,duplex:"half",credentials:_e?Ce:void 0});p&&(M.forEach(hT,(pe,$)=>{at[$]===void 0&&(at[$]=pe)}),at.signal===void 0&&(at.signal=null),at.body===void 0&&(at.body=null)),ee===0&&(at.redirect="manual",je&&(je.redirect="manual")),$e=p&&new u(j,at);let Tt=await(p?Ae($e,je):Ae(j,at));const Zt=On.from(Tt.headers);if(z){const pe=M.toFiniteNumber(Zt.getContentLength());if(pe!=null&&pe>W)throw new ye("maxContentLength size of "+W+" exceeded",ye.ERR_BAD_RESPONSE,N,$e)}const J=S&&(fe==="stream"||fe==="response");if(S&&Tt.body&&(X||z||J&&ut)){const pe={};["status","statusText","headers"].forEach(Sn=>{pe[Sn]=Tt[Sn]});const $=M.toFiniteNumber(Zt.getContentLength()),[Ge,rt]=X&&Uw($,Qd(Iw(X),!0))||[];let qt=0;const Sr=Sn=>{if(z&&(qt=Sn,qt>W))throw new ye("maxContentLength size of "+W+" exceeded",ye.ERR_BAD_RESPONSE,N,$e);Ge&&Ge(Sn)};Tt=new f(Hw(Tt.body,$w,Sr,()=>{rt&&rt(),ut&&ut()}),pe)}fe=fe||"text";let Re=await A[M.findKey(A,fe)||"text"](Tt,N);if(z&&!S&&!J){let pe;if(Re!=null&&(typeof Re.byteLength=="number"?pe=Re.byteLength:typeof Re.size=="number"?pe=Re.size:typeof Re=="string"&&(pe=typeof a=="function"?new a().encode(Re).byteLength:Re.length)),typeof pe=="number"&&pe>W)throw new ye("maxContentLength size of "+W+" exceeded",ye.ERR_BAD_RESPONSE,N,$e)}return!J&&ut&&ut(),await new Promise((pe,$)=>{$S(pe,$,{data:Re,headers:On.from(Tt.headers),status:Tt.status,statusText:Tt.statusText,config:N,request:$e})})}catch(ce){if(ut&&ut(),Ye&&Ye.aborted&&Ye.reason instanceof ye){const Oe=Ye.reason;throw Oe.config=N,$e&&(Oe.request=$e),ce!==Oe&&Object.defineProperty(Oe,"cause",{__proto__:null,value:ce,writable:!0,enumerable:!1,configurable:!0}),Oe}if(Y)throw $e&&!Y.request&&(Y.request=$e),Y;if(ce instanceof ye)throw $e&&!ce.request&&(ce.request=$e),ce;if(ce&&ce.name==="TypeError"&&/Load failed|fetch/i.test(ce.message)){const Oe=new ye("Network Error",ye.ERR_NETWORK,N,$e,ce&&ce.response);throw Object.defineProperty(Oe,"cause",{__proto__:null,value:ce.cause||ce,writable:!0,enumerable:!1,configurable:!0}),Oe}throw ye.from(ce,ce&&ce.code,N,$e,ce&&ce.response)}}},bT=new Map,QS=e=>{let n=e&&e.env||{};const{fetch:r,Request:a,Response:o}=n,u=[a,o,r];let f=u.length,m=f,p,y,g=bT;for(;m--;)p=u[m],y=g.get(p),y===void 0&&g.set(p,y=m?new Map:gT(n)),g=y;return y};QS();const Kp={http:NR,xhr:tT,fetch:{get:QS}};M.forEach(Kp,(e,n)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:n})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:n})}});const Zw=e=>`- ${e}`,xT=e=>M.isFunction(e)||e===null||e===!1;function yT(e,n){e=M.isArray(e)?e:[e];const{length:r}=e;let a,o;const u={};for(let f=0;f<r;f++){a=e[f];let m;if(o=a,!xT(a)&&(o=Kp[(m=String(a)).toLowerCase()],o===void 0))throw new ye(`Unknown adapter '${m}'`);if(o&&(M.isFunction(o)||(o=o.get(n))))break;u[m||"#"+f]=o}if(!o){const f=Object.entries(u).map(([p,y])=>`adapter ${p} `+(y===!1?"is not supported by the environment":"is not available in the build"));let m=r?f.length>1?`since :
`+f.map(Zw).join(`
`):" "+Zw(f[0]):"as no adapter specified";throw new ye("There is no suitable adapter to dispatch the request "+m,ye.ERR_NOT_SUPPORT)}return o}const KS={getAdapter:yT,adapters:Kp};function x0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Bc(null,e)}function y0(e){const n=M.toSafeFlatObject(e);return x0(n),n.headers=On.from(M.getSafeProp(n,"headers")),n.data=g0.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),KS.getAdapter(n.adapter||qc.adapter,n)(n).then(function(o){x0(n),n.response=o;try{o.data=g0.call(n,n.transformResponse,o)}finally{delete n.response}return o.headers=On.from(o.headers),o},function(o){if(!BS(o)&&(x0(n),o&&o.response)){n.response=o.response;try{o.response.data=g0.call(n,n.transformResponse,o.response)}finally{delete n.response}o.response.headers=On.from(o.response.headers)}return Promise.reject(o)})}const uf={};["object","boolean","number","function","string","symbol"].forEach((e,n)=>{uf[e]=function(a){return typeof a===e||"a"+(n<1?"n ":" ")+e}});const Gw={};uf.transitional=function(n,r,a){function o(u,f){return"[Axios v"+Qp+"] Transitional option '"+u+"'"+f+(a?". "+a:"")}return(u,f,m)=>{if(n===!1)throw new ye(o(f," has been removed"+(r?" in "+r:"")),ye.ERR_DEPRECATED);return r&&!Gw[f]&&(Gw[f]=!0,console.warn(o(f," has been deprecated since v"+r+" and will be removed in the near future"))),n?n(u,f,m):!0}};uf.spelling=function(n){return(r,a)=>(console.warn(`${a} is likely a misspelling of ${n}`),!0)};function vT(e,n,r){if(typeof e!="object"||e===null)throw new ye("options must be an object",ye.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let o=a.length;for(;o-- >0;){const u=a[o],f=Object.prototype.hasOwnProperty.call(n,u)?n[u]:void 0;if(f){const m=e[u],p=m===void 0||f(m,u,e);if(p!==!0)throw new ye("option "+u+" must be "+p,ye.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ye("Unknown option "+u,ye.ERR_BAD_OPTION)}}const Id={assertOptions:vT,validators:uf},jn=Id.validators;let Oa=class{constructor(n){this.defaults=n||{},this.interceptors={request:new Mw,response:new Mw}}async request(n,r){try{return await this._request(n,r)}catch(a){if(a instanceof Error)try{let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const u=o.stack;let f="";if(typeof u=="string"){const m=u.indexOf(`
`);f=m===-1?"":u.slice(m+1)}if(!a.stack)a.stack=f;else if(f){const m=f.indexOf(`
`),p=m===-1?-1:f.indexOf(`
`,m+1),y=p===-1?"":f.slice(p+1);String(a.stack).endsWith(y)||(a.stack+=`
`+f)}}catch{}throw a}}_request(n,r){typeof n=="string"?(r=r||{},r.url=n):r=n||{},r=Ua(this.defaults,r);const{transitional:a,paramsSerializer:o,headers:u}=r;a!==void 0&&Id.assertOptions(a,{silentJSONParsing:jn.transitional(jn.boolean),forcedJSONParsing:jn.transitional(jn.boolean),clarifyTimeoutError:jn.transitional(jn.boolean),legacyInterceptorReqResOrdering:jn.transitional(jn.boolean),advertiseZstdAcceptEncoding:jn.transitional(jn.boolean),validateStatusUndefinedResolves:jn.transitional(jn.boolean)},!1),o!=null&&(M.isFunction(o)?r.paramsSerializer={serialize:o}:Id.assertOptions(o,{encode:jn.function,serialize:jn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Id.assertOptions(r,{baseUrl:jn.spelling("baseURL"),withXsrfToken:jn.spelling("withXSRFToken")},!0),r.method=(M.getSafeProp(r,"method")||M.getSafeProp(this.defaults,"method")||"get").toLowerCase();let f=u&&M.merge(u.common,u[r.method]);u&&M.forEach(qS.concat("common"),A=>{delete u[A]}),r.headers=On.concat(f,u);const m=[];let p=!0;this.interceptors.request.forEach(function(C){if(typeof C.runWhen=="function"&&C.runWhen(r)===!1)return;p=p&&C.synchronous;const O=r.transitional||Zp;O&&O.legacyInterceptorReqResOrdering?m.unshift(C.fulfilled,C.rejected):m.push(C.fulfilled,C.rejected)});const y=[];this.interceptors.response.forEach(function(C){y.push(C.fulfilled,C.rejected)});let g,b=0,v;if(!p){const A=[y0.bind(this),void 0];for(A.unshift(...m),A.push(...y),v=A.length,g=Promise.resolve(r);b<v;)g=g.then(A[b++],A[b++]);return g}v=m.length;let S=r;for(;b<v;){const A=m[b++],C=m[b++];try{S=A?A(S):S}catch(O){if(!C){g=Promise.reject(O);break}try{const N=C.call(this,O);M.isThenable(N)&&(g=Promise.resolve(N).then(()=>y0.call(this,S)))}catch(N){g=Promise.reject(N)}break}}if(!g)try{g=y0.call(this,S)}catch(A){g=Promise.reject(A)}for(b=0,v=y.length;b<v;)g=g.then(y[b++],y[b++]);return g}getUri(n){n=Ua(this.defaults,n);const r=VS(n.baseURL,n.url,n.allowAbsoluteUrls,n);return IS(r,n.params,n.paramsSerializer)}};M.forEach(["delete","get","head","options"],function(n){Oa.prototype[n]=function(r,a){return this.request(Ua(a||{},{method:n,url:r,data:a&&M.hasOwnProp(a,"data")?a.data:void 0}))}});M.forEach(["post","put","patch","query"],function(n){function r(a){return function(u,f,m){return this.request(Ua(m||{},{method:n,headers:a?{"Content-Type":"multipart/form-data"}:{},url:u,data:f}))}}Oa.prototype[n]=r(),n!=="query"&&(Oa.prototype[n+"Form"]=r(!0))});let wT=class YS{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(u){r=u});const a=this;this.promise.then(o=>{if(!a._listeners)return;let u=a._listeners.length;for(;u-- >0;)a._listeners[u](o);a._listeners=null}),this.promise.then=o=>{let u;const f=new Promise(m=>{a.subscribe(m),u=m}).then(o);return f.cancel=function(){a.unsubscribe(u)},f},n(function(u,f,m){a.reason||(a.reason=new Bc(u,f,m),r(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const r=this._listeners.indexOf(n);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const n=new AbortController,r=a=>{n.abort(a)};return this.subscribe(r),n.signal.unsubscribe=()=>this.unsubscribe(r),n.signal}static source(){let n;return{token:new YS(function(o){n=o}),cancel:n}}};function _T(e){return function(r){return e.apply(null,r)}}function ST(e){return M.isObject(e)&&e.isAxiosError===!0}const Ld={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ld).forEach(([e,n])=>{Ld[n]===void 0&&(Ld[n]=e)});function JS(e){const n=new Oa(e),r=wS(Oa.prototype.request,n);return M.extend(r,Oa.prototype,n,{allOwnKeys:!0}),M.extend(r,n,null,{allOwnKeys:!0}),r.create=function(o){return JS(Ua(e,o))},r}const Vt=JS(qc);Vt.Axios=Oa;Vt.CanceledError=Bc;Vt.CancelToken=wT;Vt.isCancel=BS;Vt.VERSION=Qp;Vt.toFormData=cf;Vt.AxiosError=ye;Vt.Cancel=Vt.CanceledError;Vt.all=function(n){return Promise.all(n)};Vt.spread=_T;Vt.isAxiosError=ST;Vt.mergeConfig=Ua;Vt.AxiosHeaders=On;Vt.formToJSON=e=>HS(M.isHTMLForm(e)?new FormData(e):e);Vt.getAdapter=KS.getAdapter;Vt.HttpStatusCode=Ld;Vt.default=Vt;const{Axios:VU,AxiosError:ZU,CanceledError:GU,isCancel:QU,CancelToken:KU,VERSION:YU,all:JU,Cancel:XU,isAxiosError:WU,spread:eI,toFormData:tI,AxiosHeaders:nI,HttpStatusCode:sI,formToJSON:rI,getAdapter:iI,mergeConfig:aI,create:lI}=Vt,NT=iS(),ze=Vt.create({baseURL:NT,headers:{"Content-Type":"application/json; version=1",Accept:"application/json; version=1"},timeout:15e3});ze.interceptors.request.use(e=>{e.baseURL=iS();const n=localStorage.getItem("pfm_access_token");return n&&e.headers&&(e.headers.Authorization=`Bearer ${n}`),e},e=>Promise.reject(e));var fs=(e=>(e[e.GeneralError=0]="GeneralError",e[e.AuthenticationError=1]="AuthenticationError",e[e.ProtocolError=2]="ProtocolError",e[e.Connected=3]="Connected",e[e.Disconnected=4]="Disconnected",e[e.TooManyConnections=5]="TooManyConnections",e[e.ConnectionAborted=6]="ConnectionAborted",e[e.Success=7]="Success",e))(fs||{}),us=(e=>(e[e.Pending=1]="Pending",e[e.Queued=2]="Queued",e[e.Processing=3]="Processing",e[e.Sent=4]="Sent",e[e.Delivered=5]="Delivered",e[e.Read=6]="Read",e[e.Failed=7]="Failed",e[e.Cancelled=8]="Cancelled",e[e.Bounced=9]="Bounced",e))(us||{}),As=(e=>(e[e.Email=1]="Email",e[e.SMS=2]="SMS",e[e.WhatsApp=3]="WhatsApp",e[e.PushNotification=4]="PushNotification",e[e.InApp=5]="InApp",e[e.Teams=6]="Teams",e[e.Slack=7]="Slack",e[e.Webhook=8]="Webhook",e[e.Other=99]="Other",e))(As||{}),In=(e=>(e[e.AttendanceRegister=1]="AttendanceRegister",e[e.BankStatement=2]="BankStatement",e[e.CompletionCertificate=3]="CompletionCertificate",e[e.FinancialInvoiceOrReceipt=4]="FinancialInvoiceOrReceipt",e[e.GeotaggedPhoto=5]="GeotaggedPhoto",e[e.InspectionReport=6]="InspectionReport",e[e.MeetingMinutes=7]="MeetingMinutes",e[e.PayrollOrStipendRegister=8]="PayrollOrStipendRegister",e[e.ProcurementDocument=9]="ProcurementDocument",e[e.TechnicalSpecificationOrDesign=10]="TechnicalSpecificationOrDesign",e[e.VideoRecording=11]="VideoRecording",e[e.Other=99]="Other",e[e.ProgressReport=1]="ProgressReport",e[e.FinancialStatement=2]="FinancialStatement",e[e.Invoice=4]="Invoice",e[e.DeliverableProof=10]="DeliverableProof",e[e.Certification=3]="Certification",e[e.AuditReport=6]="AuditReport",e))(In||{}),cs=(e=>(e[e.CapacityBuildingAndTraining=1]="CapacityBuildingAndTraining",e[e.CapitalExpenditureAndInfrastructure=2]="CapitalExpenditureAndInfrastructure",e[e.CommercializationAndScaling=3]="CommercializationAndScaling",e[e.FeasibilityAndTechnicalAssistance=4]="FeasibilityAndTechnicalAssistance",e[e.OperationalGrantAndSubsidy=5]="OperationalGrantAndSubsidy",e[e.ProductDevelopmentAndPrototyping=6]="ProductDevelopmentAndPrototyping",e[e.ResearchAndDevelopment=7]="ResearchAndDevelopment",e[e.SocialImpactAndCommunityDevelopment=8]="SocialImpactAndCommunityDevelopment",e[e.TechnologyTransferAndAdoption=9]="TechnologyTransferAndAdoption",e[e.Innovation=10]="Innovation",e[e.Other=99]="Other",e[e.Grant=5]="Grant",e[e.BlendedFinance=3]="BlendedFinance",e[e.TechnicalAssistance=4]="TechnicalAssistance",e))(cs||{}),Jt=(e=>(e[e.AgricultureAndAgroProcessing=1]="AgricultureAndAgroProcessing",e[e.AutomotiveAndTransportEquipment=2]="AutomotiveAndTransportEquipment",e[e.ChemicalsAndPharmaceuticals=3]="ChemicalsAndPharmaceuticals",e[e.ConstructionAndInfrastructure=4]="ConstructionAndInfrastructure",e[e.CreativeIndustriesAndMedia=5]="CreativeIndustriesAndMedia",e[e.DefenseAndAerospace=6]="DefenseAndAerospace",e[e.EducationAndSkillsDevelopment=7]="EducationAndSkillsDevelopment",e[e.EnergyAndUtilities=8]="EnergyAndUtilities",e[e.FinancialServices=9]="FinancialServices",e[e.HealthcareAndLifeSciences=10]="HealthcareAndLifeSciences",e[e.InformationCommunicationTechnology=11]="InformationCommunicationTechnology",e[e.ManufacturingAndIndustrial=12]="ManufacturingAndIndustrial",e[e.MiningAndMetals=13]="MiningAndMetals",e[e.RealEstateAndHousing=14]="RealEstateAndHousing",e[e.RetailAndConsumerGoods=15]="RetailAndConsumerGoods",e[e.TourismAndHospitality=16]="TourismAndHospitality",e[e.WaterAndSanitation=17]="WaterAndSanitation",e[e.Other=99]="Other",e[e.AgriTech=1]="AgriTech",e[e.CleanEnergy=8]="CleanEnergy",e[e.HealthTech=10]="HealthTech",e[e.Education=7]="Education",e[e.ICTDigital=11]="ICTDigital",e[e.Manufacturing=12]="Manufacturing",e[e.SocialDevelopment=15]="SocialDevelopment",e))(Jt||{}),ot=(e=>(e[e.NonGovernmentalOrganisation=1]="NonGovernmentalOrganisation",e[e.CivilSocietyOrganisation=2]="CivilSocietyOrganisation",e[e.Trust=3]="Trust",e[e.FaithBasedOrganisation=4]="FaithBasedOrganisation",e[e.PrivateLimitedCompany=5]="PrivateLimitedCompany",e[e.PublicLimitedCompany=6]="PublicLimitedCompany",e[e.SoleProprietorship=7]="SoleProprietorship",e[e.Partnership=8]="Partnership",e[e.SocialEnterprise=9]="SocialEnterprise",e[e.NationalGovernmentMinistry=10]="NationalGovernmentMinistry",e[e.ProvincialGovernmentEntity=11]="ProvincialGovernmentEntity",e[e.LocalGovernmentMunicipality=12]="LocalGovernmentMunicipality",e[e.StateOwnedEnterprise=13]="StateOwnedEnterprise",e[e.PublicAgency=14]="PublicAgency",e[e.PublicUniversity=15]="PublicUniversity",e[e.PrivateUniversity=16]="PrivateUniversity",e[e.ResearchInstitute=17]="ResearchInstitute",e[e.TechnicalVocationalCollege=18]="TechnicalVocationalCollege",e[e.Cooperative=19]="Cooperative",e[e.MicrofinanceInstitution=20]="MicrofinanceInstitution",e[e.CommercialBank=21]="CommercialBank",e[e.DevelopmentFinanceInstitution=22]="DevelopmentFinanceInstitution",e[e.UnitedNationsAgency=23]="UnitedNationsAgency",e[e.IntergovernmentalOrganisation=24]="IntergovernmentalOrganisation",e[e.InternationalNGO=25]="InternationalNGO",e[e.Consortium=26]="Consortium",e[e.SpecialPurposeVehicle=27]="SpecialPurposeVehicle",e[e.GovernmentDepartment=10]="GovernmentDepartment",e[e.CorporateCSI=3]="CorporateCSI",e[e.Enterprise=5]="Enterprise",e))(ot||{}),yr=(e=>(e[e.Low=1]="Low",e[e.Medium=2]="Medium",e[e.High=3]="High",e[e.Critical=4]="Critical",e))(yr||{}),$s=(e=>(e[e.Count=1]="Count",e[e.Percentage=2]="Percentage",e[e.Currency=3]="Currency",e[e.Area=4]="Area",e[e.Weight=5]="Weight",e[e.Volume=6]="Volume",e[e.DurationDays=7]="DurationDays",e[e.DurationMonths=8]="DurationMonths",e[e.Ratio=9]="Ratio",e[e.CurrencyZAR=3]="CurrencyZAR",e))($s||{}),dn=(e=>(e[e.Draft=1]="Draft",e[e.PendingApproval=2]="PendingApproval",e[e.Active=3]="Active",e[e.Expired=4]="Expired",e[e.Terminated=5]="Terminated",e[e.Amended=6]="Amended",e[e.UnderReview=2]="UnderReview",e[e.Executed=3]="Executed",e))(dn||{}),ma=(e=>(e[e.Rare=1]="Rare",e[e.Unlikely=2]="Unlikely",e[e.Possible=3]="Possible",e[e.Likely=4]="Likely",e[e.AlmostCertain=5]="AlmostCertain",e[e.VeryLow=1]="VeryLow",e[e.Low=2]="Low",e[e.Medium=3]="Medium",e[e.High=4]="High",e[e.VeryHigh=5]="VeryHigh",e))(ma||{}),pa=(e=>(e[e.Minor=1]="Minor",e[e.Moderate=2]="Moderate",e[e.Major=3]="Major",e[e.Critical=4]="Critical",e[e.Severe=5]="Severe",e[e.Insignificant=1]="Insignificant",e))(pa||{}),xt=(e=>(e[e.Pending=1]="Pending",e[e.Review=2]="Review",e[e.Approved=3]="Approved",e[e.Rejected=4]="Rejected",e[e.Removed=5]="Removed",e[e.Draft=1]="Draft",e[e.PendingReview=2]="PendingReview",e))(xt||{}),Cn=(e=>(e[e.Active=1]="Active",e[e.Inactive=2]="Inactive",e[e.Disabled=3]="Disabled",e[e.Suspended=3]="Suspended",e))(Cn||{});const jT=async()=>(await ze.get("/v1/api/governance/dashboard")).data,df=async(e=1,n=100)=>(await ze.get("/v1/api/governance/organisations",{params:{page:e,pageSize:n}})).data||[],ET=async e=>{const n=Ht();return(await ze.post("/v1/api/governance/organisations",{...e,createdBy:n||void 0})).data},AT=async e=>{const n=Ht();return(await ze.put("/v1/api/governance/organisations",{...e,updatedBy:n||void 0})).data},CT=async e=>{const n=await Jn.resolveOrganisationId(e);return(await ze.get(`/v1/api/governance/organisations/${n}/portfolio`)).data||[]},XS=async()=>{try{const e=await df(1,10);if(e.length>0){const a=(await Promise.allSettled(e.map(o=>CT(o.id)))).filter(o=>o.status==="fulfilled").flatMap(o=>o.value);if(a.length>0)return a}return(await ze.get("/v1/api/governance/organisations/portfolio")).data||[]}catch{return[]}},OT=async e=>{const n=await Jn.resolvePortfolioId(e);return(await ze.get(`/v1/api/governance/portfolios/${n}/programmes`)).data||[]},RT=async e=>{const n=Ht();return(await ze.post("/v1/api/governance/organisations/portfolio",{...e,ownerId:e.ownerId||n||void 0,createdBy:n||void 0})).data},TT=async e=>{const n=Ht();return(await ze.put("/v1/api/governance/organisations/portfolio",{...e,ownerId:e.ownerId||n||void 0,updatedBy:n||void 0})).data},kT=async e=>{const n=await Jn.resolveProgrammeId(e);return(await ze.get(`/v1/api/governance/instruments/${n}`)).data||[]},ff=async(e=1,n=100)=>(await ze.get(`/v1/api/projects/programme/${e}/${n}`)).data||[],DT=async e=>{const n=await Jn.resolveProgrammeId(e);return(await ze.get(`/v1/api/projects/${n}/programme`)).data||[]},MT=async e=>{const n=Ht();return(await ze.post("/v1/api/projects/programme",{...e,ownerId:e.ownerId||n||void 0,createdBy:n||void 0})).data},zT=async e=>{const n=Ht();return(await ze.put("/v1/api/projects/programme",{...e,ownerId:e.ownerId||n||void 0,updatedBy:n||void 0})).data},hf=async(e=1,n=100)=>(await ze.get("/v1/api/projects",{params:{page:e,pageSize:n}})).data||[],UT=async e=>{const n=Ht();return(await ze.post("/v1/api/projects",{...e,createdBy:n||void 0})).data},IT=async e=>{const n=Ht();await ze.put("/v1/api/projects/status",{...e,updatedBy:n||void 0})},LT=async e=>{const n=await Jn.resolveProjectId(e);return(await ze.get(`/v1/api/projects/${n}/activities`)).data||[]},PT=async e=>{const n=Ht();return(await ze.post("/v1/api/projects/activities",{...e,createdBy:n||void 0})).data},HT=async e=>{const n=await Jn.resolveProjectId(e);return(await ze.get(`/v1/api/projects/${n}/milestones`)).data||[]},WS=async(e=1,n=100)=>(await ze.get(`/v1/api/projects/milestones/${e}/${n}`)).data||[],qT=async e=>{const n=Ht();return(await ze.post("/v1/api/evidence/milestones",{...e,createdBy:n||void 0})).data},BT=async e=>{const n=await Jn.resolveProjectId(e);return(await ze.get(`/v1/api/projects/indicators/project/${n}`)).data||[]},$T=async e=>{const n=await Jn.resolveProjectId(e);return(await ze.get(`/v1/api/projects/${n}/risks`)).data||[]},Yp=async(e=1,n=100)=>(await ze.get("/v1/api/grants/awards",{params:{page:e,pageSize:n}})).data||[],FT=async e=>{const n=Ht();return(await ze.post("/v1/api/grants/awards",{...e,createdBy:n||void 0})).data},eN=async(e=1,n=100)=>(await ze.get("/v1/api/grants/contracts",{params:{page:e,pageSize:n}})).data||[],VT=async e=>{const n=Ht();return(await ze.post("/v1/api/grants/contracts",{...e,createdBy:n||void 0})).data},ZT=async e=>{await ze.put("/v1/api/grants/contracts",e)},GT=async(e,n)=>{const r=await Jn.resolveContractId(e),a=n instanceof FormData?n:new FormData;n instanceof File&&a.append("file",n),await ze.post(`/v1/api/grants/contracts/${r}`,a,{headers:{"Content-Type":"multipart/form-data"}})},QT=async e=>{const n=await Jn.resolveContractId(e);return(await ze.get(`/v1/api/grants/contracts/${n}/securelink`)).data},KT=async e=>{const n=Ht();await ze.post("/v1/api/grants/contracts/execute",{...e,executedBy:n||void 0})},tN=async(e=1,n=100)=>(await ze.get("/v1/api/grants/budgets",{params:{page:e,pageSize:n}})).data||[],YT=async e=>{const n=Ht();return(await ze.post("/v1/api/grants/budgets",{...e,createdBy:n||void 0})).data},nN=async(e=1,n=100)=>(await ze.get("/v1/api/execution/disbursements",{params:{page:e,pageSize:n}})).data||[],JT=async e=>{const n=Ht();return(await ze.post("/v1/api/execution/disbursements",{...e,createdBy:n||void 0})).data},XT=async e=>{const n=await Jn.encodeId(e),r=Ht();await ze.post(`/v1/api/execution/disbursements/${n}/approve`,{approvedBy:r||void 0})},sN=async(e=1,n=100)=>(await ze.get("/v1/api/execution/risks",{params:{page:e,pageSize:n}})).data||[],WT=async e=>{const n=Ht();return(await ze.post("/v1/api/execution/risks",{...e,createdBy:n||void 0})).data},ek=async(e=1,n=100)=>(await ze.get(`/v1/api/evidence/indicators/${e}/${n}`)).data||[],tk=async e=>{const n=Ht();return(await ze.post("/v1/api/evidence/indicators",{...e,createdBy:n||void 0})).data},nk=async(e,n)=>{const r=await Jn.encodeId(e),a=Ht();await ze.post(`/v1/api/evidence/indicators/${r}/actuals/${n}`,{recordedBy:a||void 0})},sk=async(e=1,n=100)=>(await ze.get(`/v1/api/evidence/files/${e}/${n}`)).data||[],rk=async(e=1,n=100)=>sk(e,n),ik=async e=>{const n=await Jn.encodeId(e);return(await ze.get(`/v1/api/evidence/${n}/securelink`)).data},ak=async e=>{const n=await Jn.encodeId(e);return(await ze.get(`/v1/api/evidence/milestone/${n}`)).data||[]},lk=async e=>{const n=Ht();return n&&!e.get("userId")&&e.append("userId",n),(await ze.put("/v1/api/evidence/file",e,{headers:{"Content-Type":"multipart/form-data"}})).data},ok=async e=>{const n=Ht();await ze.put("/v1/api/evidence",{...e,updatedBy:n||void 0})},ck=async(e=1,n=100,r={})=>(await ze.post(`/v1/api/users/${e}/${n}`,r)).data||[],uk=async(e,n)=>{await ze.get(`/v1/api/users/${e}/status/${n}`)},dk=async()=>{await ze.post("/v1/api/integration/sync")},fk=async e=>{const n=Ht();return(await ze.post("/v1/api/communications/invite",{...e,createdBy:n||void 0})).data},hk=async(e=1,n=100)=>(await ze.get(`/v1/api/communications/invites/${e}/${n}`)).data||[],mk=async e=>(await ze.get(`/v1/api/communications/invites/${e}`)).data||[],pk=async()=>{try{return(await ze.get("/v1/api/governance/audit")).data||[]}catch{return[]}},ji=e=>new Intl.NumberFormat("en-ZA",{style:"currency",currency:"ZAR",maximumFractionDigits:0}).format(e),Ei=e=>e>=1e9?`R ${(e/1e9).toFixed(2)}bn`:e>=1e6?`R ${(e/1e6).toFixed(1)}m`:e>=1e3?`R ${(e/1e3).toFixed(0)}k`:ji(e),Kn=e=>{if(!e)return"—";try{return new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}catch{return e}},rN=[{value:fs.GeneralError,label:"General Error"},{value:fs.AuthenticationError,label:"Authentication Error"},{value:fs.ProtocolError,label:"Protocol Error"},{value:fs.Connected,label:"Connected"},{value:fs.Disconnected,label:"Disconnected"},{value:fs.TooManyConnections,label:"Too Many Connections"},{value:fs.ConnectionAborted,label:"Connection Aborted"},{value:fs.Success,label:"Success"}],gk=rN;us.Pending,us.Queued,us.Processing,us.Sent,us.Delivered,us.Read,us.Failed,us.Cancelled,us.Bounced;const iN=[{value:As.Email,label:"Email"},{value:As.SMS,label:"SMS"},{value:As.WhatsApp,label:"WhatsApp"},{value:As.PushNotification,label:"Push Notification"},{value:As.InApp,label:"In App"},{value:As.Teams,label:"Teams"},{value:As.Slack,label:"Slack"},{value:As.Webhook,label:"Webhook"},{value:As.Other,label:"Other"}],aN=[{value:In.AttendanceRegister,label:"Attendance Register"},{value:In.BankStatement,label:"Bank Statement"},{value:In.CompletionCertificate,label:"Completion Certificate"},{value:In.FinancialInvoiceOrReceipt,label:"Financial Invoice Or Receipt"},{value:In.GeotaggedPhoto,label:"Geotagged Photo"},{value:In.InspectionReport,label:"Inspection Report"},{value:In.MeetingMinutes,label:"Meeting Minutes"},{value:In.PayrollOrStipendRegister,label:"Payroll Or Stipend Register"},{value:In.ProcurementDocument,label:"Procurement Document"},{value:In.TechnicalSpecificationOrDesign,label:"Technical Specification Or Design"},{value:In.VideoRecording,label:"Video Recording"},{value:In.Other,label:"Other"}],lN=[{value:cs.CapacityBuildingAndTraining,label:"Capacity Building And Training"},{value:cs.CapitalExpenditureAndInfrastructure,label:"Capital Expenditure And Infrastructure"},{value:cs.CommercializationAndScaling,label:"Commercialization And Scaling"},{value:cs.FeasibilityAndTechnicalAssistance,label:"Feasibility And Technical Assistance"},{value:cs.OperationalGrantAndSubsidy,label:"Operational Grant And Subsidy"},{value:cs.ProductDevelopmentAndPrototyping,label:"Product Development And Prototyping"},{value:cs.ResearchAndDevelopment,label:"Research And Development"},{value:cs.SocialImpactAndCommunityDevelopment,label:"Social Impact And Community Development"},{value:cs.TechnologyTransferAndAdoption,label:"Technology Transfer And Adoption"},{value:cs.Innovation,label:"Innovation"},{value:cs.Other,label:"Other"}],oN=[{value:Jt.AgricultureAndAgroProcessing,label:"Agriculture And Agro Processing"},{value:Jt.AutomotiveAndTransportEquipment,label:"Automotive And Transport Equipment"},{value:Jt.ChemicalsAndPharmaceuticals,label:"Chemicals And Pharmaceuticals"},{value:Jt.ConstructionAndInfrastructure,label:"Construction And Infrastructure"},{value:Jt.CreativeIndustriesAndMedia,label:"Creative Industries And Media"},{value:Jt.DefenseAndAerospace,label:"Defense And Aerospace"},{value:Jt.EducationAndSkillsDevelopment,label:"Education And Skills Development"},{value:Jt.EnergyAndUtilities,label:"Energy And Utilities"},{value:Jt.FinancialServices,label:"Financial Services"},{value:Jt.HealthcareAndLifeSciences,label:"Healthcare And Life Sciences"},{value:Jt.InformationCommunicationTechnology,label:"Information Communication Technology"},{value:Jt.ManufacturingAndIndustrial,label:"Manufacturing And Industrial"},{value:Jt.MiningAndMetals,label:"Mining And Metals"},{value:Jt.RealEstateAndHousing,label:"Real Estate And Housing"},{value:Jt.RetailAndConsumerGoods,label:"Retail And Consumer Goods"},{value:Jt.TourismAndHospitality,label:"Tourism And Hospitality"},{value:Jt.WaterAndSanitation,label:"Water And Sanitation"},{value:Jt.Other,label:"Other"}],cN=[{value:ot.NonGovernmentalOrganisation,label:"Non-Governmental Organisation"},{value:ot.CivilSocietyOrganisation,label:"Civil Society Organisation"},{value:ot.Trust,label:"Trust"},{value:ot.FaithBasedOrganisation,label:"Faith-Based Organisation"},{value:ot.PrivateLimitedCompany,label:"Private Limited Company"},{value:ot.PublicLimitedCompany,label:"Public Limited Company"},{value:ot.SoleProprietorship,label:"Sole Proprietorship"},{value:ot.Partnership,label:"Partnership"},{value:ot.SocialEnterprise,label:"Social Enterprise"},{value:ot.NationalGovernmentMinistry,label:"National Government Ministry"},{value:ot.ProvincialGovernmentEntity,label:"Provincial Government Entity"},{value:ot.LocalGovernmentMunicipality,label:"Local Government Municipality"},{value:ot.StateOwnedEnterprise,label:"State-Owned Enterprise"},{value:ot.PublicAgency,label:"Public Agency"},{value:ot.PublicUniversity,label:"Public University"},{value:ot.PrivateUniversity,label:"Private University"},{value:ot.ResearchInstitute,label:"Research Institute"},{value:ot.TechnicalVocationalCollege,label:"Technical Vocational College"},{value:ot.Cooperative,label:"Cooperative"},{value:ot.MicrofinanceInstitution,label:"Microfinance Institution"},{value:ot.CommercialBank,label:"Commercial Bank"},{value:ot.DevelopmentFinanceInstitution,label:"Development Finance Institution"},{value:ot.UnitedNationsAgency,label:"United Nations Agency"},{value:ot.IntergovernmentalOrganisation,label:"Intergovernmental Organisation"},{value:ot.InternationalNGO,label:"International NGO"},{value:ot.Consortium,label:"Consortium"},{value:ot.SpecialPurposeVehicle,label:"Special Purpose Vehicle"}],bk=[{value:yr.Low,label:"Low"},{value:yr.Medium,label:"Medium"},{value:yr.High,label:"High"},{value:yr.Critical,label:"Critical"}],uN=[{value:$s.Count,label:"Count"},{value:$s.Percentage,label:"Percentage"},{value:$s.Currency,label:"Currency"},{value:$s.Area,label:"Area"},{value:$s.Weight,label:"Weight"},{value:$s.Volume,label:"Volume"},{value:$s.DurationDays,label:"Duration (Days)"},{value:$s.DurationMonths,label:"Duration (Months)"},{value:$s.Ratio,label:"Ratio"}];dn.Draft,dn.PendingApproval,dn.Active,dn.Expired,dn.Terminated,dn.Amended;const dN=[{value:xt.Pending,label:"Pending"},{value:xt.Review,label:"Review"},{value:xt.Approved,label:"Approved"},{value:xt.Rejected,label:"Rejected"},{value:xt.Removed,label:"Removed"}],xk=[{value:Cn.Active,label:"Active"},{value:Cn.Inactive,label:"Inactive"},{value:Cn.Disabled,label:"Disabled"}],yk=[{value:ma.Rare,label:"Rare"},{value:ma.Unlikely,label:"Unlikely"},{value:ma.Possible,label:"Possible"},{value:ma.Likely,label:"Likely"},{value:ma.AlmostCertain,label:"Almost Certain"}],vk=[{value:pa.Minor,label:"Minor"},{value:pa.Moderate,label:"Moderate"},{value:pa.Major,label:"Major"},{value:pa.Critical,label:"Critical"},{value:pa.Severe,label:"Severe"}],Xl=e=>{switch(Number(e)){case xt.Approved:return{label:"Approved",className:"bg-emerald-500/10 text-emerald-400 border-emerald-500/30 font-semibold",dot:"bg-emerald-500"};case xt.Review:return{label:"Review",className:"bg-amber-500/10 text-amber-400 border-amber-500/30 font-semibold",dot:"bg-amber-500"};case xt.Rejected:return{label:"Rejected",className:"bg-rose-500/10 text-rose-400 border-rose-500/30 font-semibold",dot:"bg-rose-500"};case xt.Removed:return{label:"Removed",className:"bg-slate-800/80 text-slate-400 border-slate-700/80 font-semibold",dot:"bg-slate-500"};case xt.Pending:default:return{label:"Pending",className:"bg-blue-500/10 text-blue-400 border-blue-500/30 font-semibold",dot:"bg-blue-500"}}},Qw=e=>{switch(Number(e)){case dn.Active:return{label:"Active",className:"bg-emerald-500/10 text-emerald-400 border-emerald-500/30 font-semibold"};case dn.PendingApproval:return{label:"Pending Approval",className:"bg-amber-500/10 text-amber-400 border-amber-500/30 font-semibold"};case dn.Amended:return{label:"Amended",className:"bg-indigo-500/10 text-indigo-400 border-indigo-500/30 font-semibold"};case dn.Expired:return{label:"Expired",className:"bg-slate-800/80 text-slate-400 border-slate-700/80 font-semibold"};case dn.Terminated:return{label:"Terminated",className:"bg-rose-500/10 text-rose-400 border-rose-500/30 font-semibold"};case dn.Draft:default:return{label:"Draft",className:"bg-slate-800/80 text-slate-300 border-slate-700/80 font-semibold"}}},Ml=e=>{switch(Number(e)){case Cn.Active:return{label:"Active",className:"bg-emerald-500/10 text-emerald-400 border-emerald-500/30 font-semibold"};case Cn.Inactive:return{label:"Inactive",className:"bg-slate-800/80 text-slate-400 border-slate-700/80 font-semibold"};case Cn.Disabled:default:return{label:"Disabled",className:"bg-rose-500/10 text-rose-400 border-rose-500/30 font-semibold"}}},wk=e=>{switch(Number(e)){case yr.Critical:return{label:"Critical",className:"bg-rose-500/10 text-rose-400 border-rose-500/30 font-semibold"};case yr.High:return{label:"High",className:"bg-amber-500/10 text-amber-400 border-amber-500/30 font-semibold"};case yr.Medium:return{label:"Medium",className:"bg-blue-500/10 text-blue-400 border-blue-500/30 font-semibold"};case yr.Low:default:return{label:"Low",className:"bg-slate-800/80 text-slate-400 border-slate-700/80 font-semibold"}}},_k=e=>{const n=cN.find(r=>r.value===Number(e));return n?n.label:"Organisation"},fN=e=>{const n=oN.find(r=>r.value===Number(e));return n?n.label:"Industry Sector"},Sk=e=>{const n=lN.find(r=>r.value===Number(e));return n?n.label:"Project Type"},Nk=e=>{const n=aN.find(r=>r.value===Number(e));return n?n.label:"Evidence"},jk=e=>{if(e==null)return"Qty";const n=uN.find(r=>r.value===Number(e));return n?n.label:"Qty"},Kw=e=>{const n=iN.find(r=>r.value===Number(e));return n?n.label:"Platform"},Pd=e=>{const n=rN.find(r=>r.value===Number(e));return n?n.label:"Status"},Yw=e=>{const n=Number(e);switch(n){case fs.Connected:case fs.Success:return{label:Pd(n),className:"bg-emerald-50 text-emerald-800 border-emerald-300 font-semibold"};case fs.Disconnected:return{label:Pd(n),className:"bg-slate-100 text-slate-700 border-slate-300 font-semibold"};default:return{label:Pd(n),className:"bg-rose-50 text-rose-800 border-rose-300 font-semibold"}}},Ek=(e,n)=>{const r=Number(e)*Number(n);return r>=15?{level:"High",color:"bg-rose-600 text-white",badge:"bg-rose-50 text-rose-800 border-rose-300 font-semibold"}:r>=8?{level:"Medium",color:"bg-amber-500 text-white",badge:"bg-amber-50 text-amber-900 border-amber-300 font-semibold"}:{level:"Low",color:"bg-emerald-600 text-white",badge:"bg-emerald-50 text-emerald-800 border-emerald-300 font-semibold"}},Jw={},ya=e=>e?e.includes("@")?e:Jw[e]?Jw[e]:e:"—",Ak=()=>{var Ce;const[e,n]=T.useState("All"),[r,a]=T.useState("All"),[o,u]=T.useState("FY 2026/27"),{data:f,isLoading:m,refetch:p,isFetching:y}=Ke({queryKey:["dashboard"],queryFn:jT}),{data:g=[]}=Ke({queryKey:["projects"],queryFn:()=>hf()}),{data:b=[]}=Ke({queryKey:["portfolios"],queryFn:()=>XS()}),{data:v=[]}=Ke({queryKey:["programmes"],queryFn:()=>ff()}),{data:S=[]}=Ke({queryKey:["awards"],queryFn:()=>Yp()}),{data:A=[]}=Ke({queryKey:["budgets"],queryFn:()=>tN()}),{data:C=[]}=Ke({queryKey:["disbursements"],queryFn:()=>nN()}),{data:O=[]}=Ke({queryKey:["risks"],queryFn:()=>sN()}),N=()=>{p()},j=T.useMemo(()=>{if(f!=null&&f.portfolioValue&&f.portfolioValue>0)return f.portfolioValue;const Z=A.reduce((oe,ee)=>oe+(ee.amount||0),0);return Z>0?Z:S.reduce((oe,ee)=>oe+(ee.amount||0),0)},[f,A,S]),F=(f==null?void 0:f.activeAwards)??(S.length||g.length),q=T.useMemo(()=>f!=null&&f.disbursed&&f.disbursed>0?f.disbursed:C.filter(Z=>Z.status===xt.Approved||Z.status===3).reduce((Z,W)=>Z+(W.amount||0),0),[f,C]),B=T.useMemo(()=>{if((f==null?void 0:f.onTrackPercentage)!==void 0&&f.onTrackPercentage>0)return f.onTrackPercentage;if(g.length===0)return 0;const Z=g.filter(W=>W.status===xt.Approved).length;return Math.round(Z/g.length*100)},[f,g]),re=T.useMemo(()=>(f==null?void 0:f.atRiskCount)!==void 0?f.atRiskCount:O.filter(Z=>Z.likelihood*Z.impact>=12).length,[f,O]),Q=(f==null?void 0:f.beneficiariesReached)??0,X=T.useMemo(()=>{if(!g||g.length===0)return[];const Z={};g.forEach(ee=>{const z=fN(ee.sector);Z[z]=(Z[z]||0)+1});const W=["bg-emerald-500","bg-teal-500","bg-blue-500","bg-indigo-500","bg-purple-500","bg-amber-500"],oe=g.length;return Object.entries(Z).map(([ee,z],ue)=>{const Me=Math.round(z/oe*100),Ae=j>0?Math.round(j/oe*z):0;return{name:ee,count:z,percentage:Me,amount:Ae,color:W[ue%W.length]}})},[g,j]),se=T.useMemo(()=>({highImpHighLik:O.filter(W=>W.impact>=4&&W.likelihood>=4).length,highImpMedLik:O.filter(W=>W.impact>=4&&W.likelihood===3).length,highImpLowLik:O.filter(W=>W.impact>=4&&W.likelihood<=2).length,medImpHighLik:O.filter(W=>W.impact===3&&W.likelihood>=4).length,medImpMedLik:O.filter(W=>W.impact===3&&W.likelihood===3).length,medImpLowLik:O.filter(W=>W.impact===3&&W.likelihood<=2).length,lowImpHighLik:O.filter(W=>W.impact<=2&&W.likelihood>=4).length,lowImpMedLik:O.filter(W=>W.impact<=2&&W.likelihood===3).length,lowImpLowLik:O.filter(W=>W.impact<=2&&W.likelihood<=2).length,flaggedCount:O.filter(W=>W.impact*W.likelihood>=12).length}),[O]),fe=T.useMemo(()=>{if(!C||C.length===0)return[{quarter:"Q1",amount:0,heightPct:15},{quarter:"Q2",amount:0,heightPct:15},{quarter:"Q3",amount:0,heightPct:15},{quarter:"Q4",amount:0,heightPct:15}];const Z={Q1:0,Q2:0,Q3:0,Q4:0};C.forEach(oe=>{const ee=oe.createdAt||oe.updatedAt;if(ee){const z=new Date(ee).getMonth();z<=2?Z.Q1+=oe.amount||0:z<=5?Z.Q2+=oe.amount||0:z<=8?Z.Q3+=oe.amount||0:Z.Q4+=oe.amount||0}else Z.Q1+=(oe.amount||0)*.25,Z.Q2+=(oe.amount||0)*.25,Z.Q3+=(oe.amount||0)*.25,Z.Q4+=(oe.amount||0)*.25});const W=Math.max(...Object.values(Z),1);return Object.entries(Z).map(([oe,ee])=>({quarter:oe,amount:ee,heightPct:Math.max(15,Math.min(100,Math.round(ee/W*100)))}))},[C]),we=T.useMemo(()=>!g||g.length===0?[]:g.filter(Z=>Z.status===xt.Rejected||Z.status===xt.Pending||Z.status===xt.Review).slice(0,5).map(Z=>{const W=Z.status===xt.Rejected,oe=Z.status===xt.Pending||Z.status===xt.Review;return{id:Z.id,name:Z.name,programme:Z.programmeName||`Programme ${Z.programmeId}`,status:W?"At Risk":oe?"Pending":"Active",risk:W?"RED":oe?"AMBER":"GREEN",financialVariance:W?"-15%":"0%",varianceType:W?"negative":"positive"}}),[g]);return c.jsxs("div",{className:"space-y-6 max-w-7xl mx-auto",children:[c.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 bg-[#0d121f]/90 p-5 rounded-2xl border border-slate-800/80 backdrop-blur-md shadow-xl",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h2",{className:"text-xl font-bold text-white tracking-tight",children:"Executive Portfolio Dashboard"}),c.jsx("span",{className:"text-[11px] font-semibold text-blue-400 bg-blue-500/10 px-2.5 py-0.5 rounded-full border border-blue-500/30",children:"Live Portfolio Feed"})]}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"Real-time portfolio overview, disbursement tracking, risk heatmap, and projects requiring governance action."})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-400",children:[c.jsx(CC,{className:"w-3.5 h-3.5 text-slate-500"}),c.jsx("span",{children:"Filter:"})]}),c.jsxs("select",{value:e,onChange:Z=>n(Z.target.value),className:"text-xs font-medium bg-[#090d16] border border-slate-700/80 rounded-xl px-3 py-1.5 text-slate-200 focus:outline-none focus:ring-1 focus:ring-blue-500 transition cursor-pointer",children:[c.jsx("option",{value:"All",children:"Programme: All"}),v.map(Z=>c.jsx("option",{value:Z.id,children:Z.name},Z.id))]}),c.jsxs("select",{value:r,onChange:Z=>a(Z.target.value),className:"text-xs font-medium bg-[#090d16] border border-slate-700/80 rounded-xl px-3 py-1.5 text-slate-200 focus:outline-none focus:ring-1 focus:ring-blue-500 transition cursor-pointer",children:[c.jsx("option",{value:"All",children:"Sector: All"}),X.map(Z=>c.jsx("option",{value:Z.name,children:Z.name},Z.name))]}),c.jsxs("select",{value:o,onChange:Z=>u(Z.target.value),className:"text-xs font-medium bg-[#090d16] border border-slate-700/80 rounded-xl px-3 py-1.5 text-slate-200 focus:outline-none focus:ring-1 focus:ring-blue-500 transition cursor-pointer",children:[c.jsx("option",{value:"FY 2026/27",children:"Period: FY 2026/27"}),c.jsx("option",{value:"FY 2025/26",children:"Period: FY 2025/26"}),c.jsx("option",{value:"All-Time",children:"All-Time Cumulative"})]}),c.jsx("button",{onClick:N,disabled:y,className:"p-2 text-slate-400 hover:text-white bg-slate-900/80 hover:bg-slate-800 border border-slate-700/80 rounded-xl transition cursor-pointer shadow-xs",title:"Refresh dashboard metrics",children:c.jsx(tp,{className:`w-4 h-4 ${y?"animate-spin text-blue-400":""}`})})]})]}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[c.jsxs("div",{className:"bg-[#0f1523]/80 p-5 rounded-2xl border border-slate-800/80 hover:border-blue-500/30 transition-all flex flex-col justify-between shadow-md group backdrop-blur-sm",children:[c.jsxs("div",{className:"flex items-center justify-between text-slate-400",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-400",children:"Portfolio Value"}),c.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/10 text-blue-400 border border-blue-500/20 group-hover:scale-110 transition",children:c.jsx(Ic,{className:"w-3.5 h-3.5"})})]}),c.jsxs("div",{className:"mt-3",children:[c.jsx("p",{className:"text-2xl font-bold text-white tracking-tight",children:Ei(j)}),c.jsx("p",{className:"text-[10px] text-slate-400 font-mono mt-1",children:ji(j)})]})]}),c.jsxs("div",{className:"bg-[#0f1523]/80 p-5 rounded-2xl border border-slate-800/80 hover:border-blue-500/30 transition-all flex flex-col justify-between shadow-md group backdrop-blur-sm",children:[c.jsxs("div",{className:"flex items-center justify-between text-slate-400",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-400",children:"Active Awards"}),c.jsx("div",{className:"p-1.5 rounded-lg bg-indigo-500/10 text-indigo-400 border border-indigo-500/20 group-hover:scale-110 transition",children:c.jsx(W0,{className:"w-3.5 h-3.5"})})]}),c.jsxs("div",{className:"mt-3",children:[c.jsx("p",{className:"text-2xl font-bold text-white tracking-tight",children:F}),c.jsxs("p",{className:"text-[10px] text-emerald-400 font-mono mt-1",children:["Across ",b.length," portfolio",b.length===1?"":"s"]})]})]}),c.jsxs("div",{className:"bg-[#0f1523]/80 p-5 rounded-2xl border border-slate-800/80 hover:border-teal-500/30 transition-all flex flex-col justify-between shadow-md group backdrop-blur-sm",children:[c.jsxs("div",{className:"flex items-center justify-between text-slate-400",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-400",children:"Disbursed"}),c.jsx("div",{className:"p-1.5 rounded-lg bg-teal-500/10 text-teal-400 border border-teal-500/20 group-hover:scale-110 transition",children:c.jsx(qp,{className:"w-3.5 h-3.5"})})]}),c.jsxs("div",{className:"mt-3",children:[c.jsx("p",{className:"text-2xl font-bold text-teal-400 tracking-tight",children:Ei(q)}),c.jsx("p",{className:"text-[10px] text-slate-400 font-mono mt-1",children:j>0?`${(q/j*100).toFixed(1)}% of commitments`:"0.0% of commitments"})]})]}),c.jsxs("div",{className:"bg-[#0f1523]/80 p-5 rounded-2xl border border-slate-800/80 hover:border-emerald-500/30 transition-all flex flex-col justify-between shadow-md group backdrop-blur-sm",children:[c.jsxs("div",{className:"flex items-center justify-between text-slate-400",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-400",children:"On Track"}),c.jsx("div",{className:"p-1.5 rounded-lg bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 group-hover:scale-110 transition",children:c.jsx(X0,{className:"w-3.5 h-3.5"})})]}),c.jsxs("div",{className:"mt-3",children:[c.jsxs("p",{className:"text-2xl font-bold text-emerald-400 tracking-tight",children:[B,"%"]}),c.jsx("p",{className:"text-[10px] text-slate-400 font-mono mt-1",children:"Milestones verified"})]})]}),c.jsxs("div",{className:"bg-[#0f1523]/80 p-5 rounded-2xl border border-slate-800/80 hover:border-amber-500/30 transition-all flex flex-col justify-between shadow-md group backdrop-blur-sm",children:[c.jsxs("div",{className:"flex items-center justify-between text-slate-400",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-400",children:"At Risk"}),c.jsx("div",{className:"p-1.5 rounded-lg bg-amber-500/10 text-amber-400 border border-amber-500/20 group-hover:scale-110 transition",children:c.jsx(aO,{className:"w-3.5 h-3.5"})})]}),c.jsxs("div",{className:"mt-3",children:[c.jsx("p",{className:"text-2xl font-bold text-amber-400 tracking-tight",children:re}),c.jsx("p",{className:"text-[10px] text-rose-400 font-mono mt-1",children:"Requires PM action"})]})]}),c.jsxs("div",{className:"bg-[#0f1523]/80 p-5 rounded-2xl border border-slate-800/80 hover:border-indigo-500/30 transition-all flex flex-col justify-between shadow-md group backdrop-blur-sm",children:[c.jsxs("div",{className:"flex items-center justify-between text-slate-400",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-slate-400",children:"Beneficiaries"}),c.jsx("div",{className:"p-1.5 rounded-lg bg-indigo-500/10 text-indigo-400 border border-indigo-500/20 group-hover:scale-110 transition",children:c.jsx(yS,{className:"w-3.5 h-3.5"})})]}),c.jsxs("div",{className:"mt-3",children:[c.jsx("p",{className:"text-2xl font-bold text-white tracking-tight",children:Q>=1e3?`${(Q/1e3).toFixed(0)}k`:Q}),c.jsx("p",{className:"text-[10px] text-slate-400 font-mono mt-1",children:"Directly impacted"})]})]})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[c.jsxs("div",{className:"bg-[#0f1523]/80 p-5 rounded-2xl border border-slate-800/80 flex flex-col justify-between shadow-lg backdrop-blur-sm",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-slate-800/80 pb-3",children:[c.jsx("h3",{className:"text-sm font-semibold text-white",children:"Funding by Sector"}),c.jsx("span",{className:"text-[11px] font-mono text-blue-400 bg-blue-500/10 px-2 py-0.5 rounded-md border border-blue-500/30",children:"API Calculated"})]}),c.jsx("div",{className:"py-6 flex items-center justify-center",children:c.jsx("div",{className:"relative w-36 h-36 rounded-full border-8 border-slate-800 flex items-center justify-center",children:c.jsxs("div",{className:"w-24 h-24 rounded-full border-4 border-blue-500 flex flex-col items-center justify-center bg-[#090d16] shadow-inner",children:[c.jsx("span",{className:"text-xl font-bold text-white",children:X.length}),c.jsx("span",{className:"text-[9px] uppercase tracking-wider text-slate-400",children:X.length===1?"Sector":"Sectors"})]})})}),c.jsx("div",{className:"space-y-2.5",children:X.length===0?c.jsx("p",{className:"text-xs text-center text-slate-500 py-3",children:"No active project sectors assigned yet."}):X.map(Z=>c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex justify-between text-xs",children:[c.jsxs("span",{className:"text-slate-300 font-medium truncate",children:[Z.name," (",Z.count,")"]}),c.jsxs("span",{className:"font-semibold text-white",children:[Z.percentage,"%"]})]}),c.jsx("div",{className:"w-full h-1.5 bg-slate-800 rounded-full overflow-hidden",children:c.jsx("div",{className:`h-full ${Z.color} rounded-full`,style:{width:`${Z.percentage}%`}})})]},Z.name))})]}),c.jsxs("div",{className:"pt-4 border-t border-slate-800/80 mt-4 text-[11px] text-slate-400 flex justify-between",children:[c.jsxs("span",{children:["Primary Focus: ",((Ce=X[0])==null?void 0:Ce.name)||"All Sectors"]}),c.jsxs(Qs,{to:"/governance",className:"text-blue-400 font-medium hover:underline flex items-center gap-1",children:["View Portfolios ",c.jsx(wd,{className:"w-3 h-3"})]})]})]}),c.jsxs("div",{className:"bg-[#0f1523]/80 p-5 rounded-2xl border border-slate-800/80 flex flex-col justify-between shadow-lg backdrop-blur-sm",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-slate-800/80 pb-3",children:[c.jsx("h3",{className:"text-sm font-semibold text-white",children:"Portfolio Risk Heatmap"}),c.jsxs("span",{className:"text-[11px] font-mono text-rose-400 bg-rose-500/10 px-2 py-0.5 rounded-md border border-rose-500/30 font-semibold",children:[se.flaggedCount," Flagged"]})]}),c.jsx("p",{className:"text-[11px] text-slate-400 my-2",children:"Matrix distribution of project risks by Likelihood (1–5) and Impact (1–5)."}),c.jsxs("div",{className:"grid grid-cols-3 gap-2 my-4",children:[c.jsxs("div",{className:"bg-amber-950/40 text-amber-200 p-2.5 rounded-xl text-center text-xs font-semibold border border-amber-800/40",children:[c.jsx("span",{className:"text-[10px] block text-amber-400 font-normal",children:"Moderate"}),se.highImpLowLik," ",se.highImpLowLik===1?"Risk":"Risks"]}),c.jsxs("div",{className:"bg-rose-950/50 text-rose-200 p-2.5 rounded-xl text-center text-xs font-semibold border border-rose-800/60",children:[c.jsx("span",{className:"text-[10px] block text-rose-400 font-normal",children:"High"}),se.highImpMedLik," ",se.highImpMedLik===1?"Risk":"Risks"]}),c.jsxs("div",{className:"bg-rose-900/80 text-rose-100 p-2.5 rounded-xl text-center text-xs font-bold border border-rose-500 shadow-md",children:[c.jsx("span",{className:"text-[10px] block text-rose-300 font-normal",children:"Critical"}),se.highImpHighLik," ",se.highImpHighLik===1?"Risk":"Risks"]}),c.jsxs("div",{className:"bg-emerald-950/40 text-emerald-200 p-2.5 rounded-xl text-center text-xs font-semibold border border-emerald-800/40",children:[c.jsx("span",{className:"text-[10px] block text-emerald-400 font-normal",children:"Low"}),se.medImpLowLik," ",se.medImpLowLik===1?"Risk":"Risks"]}),c.jsxs("div",{className:"bg-amber-950/40 text-amber-200 p-2.5 rounded-xl text-center text-xs font-semibold border border-amber-800/40",children:[c.jsx("span",{className:"text-[10px] block text-amber-400 font-normal",children:"Moderate"}),se.medImpMedLik," ",se.medImpMedLik===1?"Risk":"Risks"]}),c.jsxs("div",{className:"bg-rose-950/40 text-rose-200 p-2.5 rounded-xl text-center text-xs font-semibold border border-rose-800/50",children:[c.jsx("span",{className:"text-[10px] block text-rose-400 font-normal",children:"High"}),se.medImpHighLik," ",se.medImpHighLik===1?"Risk":"Risks"]}),c.jsxs("div",{className:"bg-slate-900/80 text-slate-300 p-2.5 rounded-xl text-center text-xs font-semibold border border-slate-800",children:[c.jsx("span",{className:"text-[10px] block text-slate-500 font-normal",children:"Trivial"}),se.lowImpLowLik," ",se.lowImpLowLik===1?"Risk":"Risks"]}),c.jsxs("div",{className:"bg-emerald-950/40 text-emerald-200 p-2.5 rounded-xl text-center text-xs font-semibold border border-emerald-800/40",children:[c.jsx("span",{className:"text-[10px] block text-emerald-400 font-normal",children:"Low"}),se.lowImpMedLik," ",se.lowImpMedLik===1?"Risk":"Risks"]}),c.jsxs("div",{className:"bg-amber-950/40 text-amber-200 p-2.5 rounded-xl text-center text-xs font-semibold border border-amber-800/40",children:[c.jsx("span",{className:"text-[10px] block text-amber-400 font-normal",children:"Moderate"}),se.lowImpHighLik," ",se.lowImpHighLik===1?"Risk":"Risks"]})]})]}),c.jsxs("div",{className:"pt-4 border-t border-slate-800/80 text-[11px] text-slate-400 flex justify-between items-center",children:[c.jsxs("span",{children:["Total Registered Risks: ",O.length]}),c.jsxs(Qs,{to:"/monitoring",className:"text-blue-400 font-medium hover:underline flex items-center gap-1",children:["Risk Register ",c.jsx(wd,{className:"w-3 h-3"})]})]})]}),c.jsxs("div",{className:"bg-[#0f1523]/80 p-5 rounded-2xl border border-slate-800/80 flex flex-col justify-between shadow-lg backdrop-blur-sm",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-slate-800/80 pb-3",children:[c.jsx("h3",{className:"text-sm font-semibold text-white",children:"Disbursement Distribution"}),c.jsxs("span",{className:"text-[11px] font-mono text-emerald-400 bg-emerald-500/10 px-2 py-0.5 rounded-md border border-emerald-500/30 font-semibold",children:[C.length," Tranche",C.length===1?"":"s"]})]}),c.jsx("p",{className:"text-[11px] text-slate-400 my-2",children:"Quarterly release distribution across active portfolios and milestone verifications."}),c.jsx("div",{className:"h-44 flex items-end gap-3 pt-6 pb-2 px-2 border-b border-slate-800/80",children:fe.map(Z=>c.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1.5 h-full justify-end",children:[c.jsx("span",{className:"text-[10px] font-mono text-slate-400",children:Z.quarter}),c.jsx("div",{className:"w-full bg-slate-800 rounded-t-md",style:{height:`${Math.max(10,Z.heightPct*.7)}%`},title:`Commitment: ${Ei(Z.amount)}`}),c.jsx("div",{className:"w-full bg-gradient-to-t from-blue-600 to-indigo-500 rounded-t-md shadow-xs shadow-blue-500/20",style:{height:`${Z.heightPct}%`},title:`Disbursed: ${Ei(Z.amount)}`})]},Z.quarter))}),c.jsxs("div",{className:"flex items-center justify-between text-[11px] text-slate-400 pt-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"h-2 w-3 bg-slate-800 rounded-xs"}),c.jsx("span",{children:"Commitment Allocation"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"h-2 w-3 bg-blue-500 rounded-xs"}),c.jsx("span",{children:"Actual Disbursed"})]})]})]}),c.jsxs("div",{className:"pt-4 border-t border-slate-800/80 text-[11px] text-slate-400 flex justify-between items-center",children:[c.jsxs("span",{children:["Total Disbursed: ",Ei(q)]}),c.jsxs(Qs,{to:"/grants",className:"text-blue-400 font-medium hover:underline flex items-center gap-1",children:["Financials ",c.jsx(wd,{className:"w-3 h-3"})]})]})]})]}),c.jsxs("div",{className:"bg-[#0f1523]/80 rounded-2xl border border-slate-800/80 overflow-hidden shadow-lg backdrop-blur-sm",children:[c.jsxs("div",{className:"p-5 border-b border-slate-800/80 flex flex-col sm:flex-row sm:items-center justify-between gap-2 bg-[#0d121f]/90",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-base font-semibold text-white",children:"Projects Requiring Attention"}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Prioritized by risk severity, delivery delay, or financial variance threshold breach."})]}),c.jsx(Qs,{to:"/projects",className:"text-xs font-semibold text-blue-400 bg-blue-500/10 hover:bg-blue-500/20 border border-blue-500/30 px-3.5 py-1.5 rounded-xl transition self-start sm:self-auto shadow-xs",children:"Open Project Directory →"})]}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-[#0d121f]/95 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold text-[11px]",children:[c.jsx("th",{className:"py-3.5 px-5",children:"Project"}),c.jsx("th",{className:"py-3.5 px-4",children:"Programme"}),c.jsx("th",{className:"py-3.5 px-4",children:"Status"}),c.jsx("th",{className:"py-3.5 px-4 text-center",children:"Risk"}),c.jsx("th",{className:"py-3.5 px-4 text-right",children:"Financial Variance"}),c.jsx("th",{className:"py-3.5 px-5 text-right",children:"Action"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-800/60",children:we.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:6,className:"py-8 text-center text-xs text-slate-500",children:"No active projects currently flagged for executive attention. All projects are operating within target thresholds."})}):we.map(Z=>c.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors",children:[c.jsxs("td",{className:"py-3.5 px-5",children:[c.jsx("span",{className:"font-semibold text-white block text-xs",children:Z.name}),c.jsxs("span",{className:"text-[10px] text-slate-400 font-mono",children:["ID: ",Z.id]})]}),c.jsx("td",{className:"py-3.5 px-4 text-slate-300 font-medium",children:Z.programme}),c.jsx("td",{className:"py-3.5 px-4",children:c.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-[10px] font-semibold border ${Z.status==="At Risk"?"bg-rose-500/10 text-rose-400 border-rose-500/30":Z.status==="Pending"?"bg-amber-500/10 text-amber-400 border-amber-500/30":"bg-emerald-500/10 text-emerald-400 border-emerald-500/30"}`,children:Z.status})}),c.jsx("td",{className:"py-3.5 px-4 text-center",children:c.jsx("span",{className:`inline-flex items-center justify-center font-bold px-2.5 py-0.5 rounded-md text-[10px] shadow-xs ${Z.risk==="RED"?"bg-rose-600 text-white":Z.risk==="AMBER"?"bg-amber-500 text-white":"bg-emerald-600 text-white"}`,children:Z.risk})}),c.jsx("td",{className:"py-3.5 px-4 text-right",children:c.jsx("span",{className:`font-mono font-bold text-xs ${Z.varianceType==="negative"?"text-rose-400":"text-emerald-400"}`,children:Z.financialVariance})}),c.jsx("td",{className:"py-3.5 px-5 text-right",children:c.jsxs(Qs,{to:"/projects",className:"inline-flex items-center gap-1 text-xs font-semibold text-slate-200 hover:text-white bg-slate-900/80 hover:bg-slate-800 border border-slate-700/80 px-3 py-1.5 rounded-lg transition shadow-xs",children:["Review",c.jsx(wd,{className:"w-3.5 h-3.5"})]})})]},Z.id))})]})})]})]})};var $c=e=>e.type==="checkbox",mf=e=>e.type==="file",zi=e=>e instanceof Date,cn=e=>e==null;const Jp=e=>typeof e=="object";var Pt=e=>!cn(e)&&!Array.isArray(e)&&Jp(e)&&!zi(e),Ck=e=>Pt(e)&&e.target?$c(e.target)?e.target.checked:mf(e.target)?e.target.files:e.target.value:e;const Ok=/[.[\]'"]/;var Wl=e=>e.split(Ok).filter(Boolean),Rk=(e,n)=>n.split(".").some((r,a,o)=>!isNaN(Number(r))&&e.has(o.slice(0,a).join("."))),pf=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ct(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);const n=typeof FileList<"u"&&e instanceof FileList;if(pf&&(e instanceof Blob||n))return e;const r=Array.isArray(e);if(!r&&e.constructor!==Object)return e;const a=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(a[o]=Ct(e[o]));return a}const kl={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Ks={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Fs={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},hN="root",Xp=["__proto__","constructor","prototype"],Tk=/^\w*$/;var Ia=e=>Tk.test(e),bt=e=>e===void 0,Se=(e,n,r)=>{if(!n||!Pt(e))return r;const a=Ia(n)?[n]:Wl(n);if(a.some(u=>Xp.includes(u)))return r;const o=a.reduce((u,f)=>cn(u)?void 0:u[f],e);return bt(o)||o===e?bt(e[n])?r:e[n]:o},pr=e=>typeof e=="boolean",Os=e=>typeof e=="function",gt=(e,n,r)=>{let a=-1;const o=Ia(n)?[n]:Wl(n),u=o.length,f=u-1;for(;++a<u;){const m=o[a];let p=r;if(a!==f){const y=e[m];p=Pt(y)||Array.isArray(y)?y:isNaN(+o[a+1])?{}:[]}if(Xp.includes(m))return;e[m]=p,e=e[m]}};const kk=It.createContext(null);kk.displayName="HookFormControlContext";var Dk=(e,n,r,a=!0)=>{const o={};for(const u in e)Object.defineProperty(o,u,{get:()=>{const f=u;return n._proxyFormState[f]!==Ks.all&&(n._proxyFormState[f]=!a||Ks.all),e[f]}});return o};const Mk=pf?It.useLayoutEffect:It.useEffect;var zk=e=>{const n=e.constructor&&e.constructor.prototype;return Pt(n)&&n.hasOwnProperty("isPrototypeOf")},ip=e=>cn(e)||!Jp(e);const Xw=(e,n)=>n.length===0&&!Array.isArray(e)&&!zk(e);function Gs(e,n,r=new WeakMap){if(e===n)return!0;if(ip(e)||ip(n))return Object.is(e,n);if(zi(e)&&zi(n))return Object.is(e.getTime(),n.getTime());const a=Object.keys(e),o=Object.keys(n);if(a.length!==o.length)return!1;if(Xw(e,a)||Xw(n,o))return Object.is(e,n);if(!a.length&&Array.isArray(e)!==Array.isArray(n))return!1;const u=r.get(e);if(u&&u.has(n))return!0;if(u)u.add(n);else{const f=new WeakSet;f.add(n),r.set(e,f)}for(const f of a){const m=e[f];if(!(f in n))return!1;if(f!=="ref"){const p=n[f];if(zi(m)&&zi(p)||(Pt(m)||Array.isArray(m))&&(Pt(p)||Array.isArray(p))?!Gs(m,p,r):!Object.is(m,p))return!1}}return!0}function Uk(e){const n=It.useRef(!1),r=It.useRef(!1),a=It.useRef(void 0),o=It.useRef(0);o.current++,r.current;const u=It.useCallback((m,p,y)=>{if(m&&(n.current||r.current&&o.current>1)){const g=p();Gs(a.current,g)||y(g)}n.current=!0},[]),f=It.useCallback((m,p)=>{m&&(a.current=Ct(p()))},[]);return{resyncIfNeeded:u,snapshot:f}}var un=e=>typeof e=="string",Ik=(e,n,r,a,o)=>un(e)?(a&&n.watch.add(e),Se(r,e,o)):Array.isArray(e)?e.map(u=>(a&&n.watch.add(u),Se(r,u,Se(o,u)))):(a&&(n.watchAll=!0),r),Sd=e=>({isOnSubmit:!e||e===Ks.onSubmit,isOnBlur:e===Ks.onBlur,isOnChange:e===Ks.onChange,isOnAll:e===Ks.all,isOnTouch:e===Ks.onTouched}),v0=(e,n,r)=>{if(r)return!1;if(n.watchAll||n.watch.has(e))return!0;for(const a of n.watch)if(e.startsWith(a)&&e.charAt(a.length)===".")return!0;return!1};const vc=(e,n,r,a)=>{for(const o of r||Object.keys(e)){if(o==="_f")continue;const u=r?Se(e,o):e[o];if(u){const{_f:f}=u;if(f){if(f.refs&&f.refs[0]&&n(f.refs[0],o)&&!a)return!0;if(f.ref&&n(f.ref,f.name)&&!a)return!0;if(vc(u,n))break}else if((Pt(u)||Array.isArray(u))&&vc(u,n))break}}};var Ww=(e,n,r)=>{const a=Se(e,r),o=Array.isArray(a)?a:[];return gt(o,hN,n[r]),gt(e,r,o),e},wn=e=>Pt(e)&&!Object.keys(e).length,Kd=e=>{if(!pf)return!1;const n=e?e.ownerDocument:0;return e instanceof(n&&n.defaultView?n.defaultView.HTMLElement:HTMLElement)},Wp=e=>e.type==="radio",Yd=e=>e instanceof RegExp,eg=(e,n,r,a,o)=>n?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[a]:o||!0}}:{};const e1={value:!1,isValid:!1},t1={value:!0,isValid:!0};var mN=e=>{if(!Array.isArray(e))return e1;if(e.length>1){const r=e.filter(a=>a&&a.checked&&!a.disabled).map(a=>a.value);return{value:r,isValid:!!r.length}}const n=e[0];return!n||!n.checked||n.disabled?e1:!n.attributes||!("value"in n.attributes)||bt(n.value)||n.value===""?t1:{value:n.value,isValid:!0}};const n1={isValid:!1,value:null};var pN=e=>Array.isArray(e)?e.reduce((n,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:n,n1):n1;function s1(e,n,r="validate"){if(un(e)||Array.isArray(e)&&e.every(un)||pr(e)&&!e)return{type:r,message:un(e)?e:"",ref:n}}var Dl=e=>Pt(e)&&!Yd(e)?e:{value:e,message:""},r1=async(e,n,r,a,o,u)=>{const{ref:f,refs:m,required:p,maxLength:y,minLength:g,min:b,max:v,pattern:S,validate:A,name:C,valueAsNumber:O,mount:N}=e._f,j=Se(r,C);if(!N||n.has(C))return{};const F=m?m[0]:f,q=Z=>{if(o&&F.reportValidity){const W=pr(Z)?"":Z||"";m?m.forEach(oe=>oe.setCustomValidity(W)):F.setCustomValidity(W),F.reportValidity()}},B={},re=Wp(f),Q=$c(f),X=re||Q,se=(O||mf(f))&&bt(f.value)&&bt(j)||Kd(f)&&f.value===""||j===""||Array.isArray(j)&&!j.length,fe=eg.bind(null,C,a,B),we=(Z,W,oe,ee=Fs.maxLength,z=Fs.minLength)=>{const ue=Z?W:oe;B[C]={type:Z?ee:z,message:ue,ref:f,...fe(Z?ee:z,ue)}};if(u?!Array.isArray(j)||!j.length:p&&(!X&&(se||cn(j))||pr(j)&&!j||Q&&!mN(m).isValid||re&&!pN(m).isValid)){const{value:Z,message:W}=un(p)?{value:!!p,message:p}:Dl(p);if(Z&&(B[C]={type:Fs.required,message:W,ref:F,...fe(Fs.required,W)},!a))return q(W),B}if(!se&&(!cn(b)||!cn(v))){let Z,W;const oe=Dl(v),ee=Dl(b);if(!cn(j)&&!zi(j)&&!isNaN(j)){const z=f.valueAsNumber||j&&+j;cn(oe.value)||(Z=z>oe.value),cn(ee.value)||(W=z<ee.value)}else{const z=f.valueAsDate||new Date(j),ue=Ye=>new Date(new Date().toDateString()+" "+Ye),Me=f.type=="time",Ae=f.type=="week";un(oe.value)&&j&&(Z=Me?ue(j)>ue(oe.value):Ae?j>oe.value:z>new Date(oe.value)),un(ee.value)&&j&&(W=Me?ue(j)<ue(ee.value):Ae?j<ee.value:z<new Date(ee.value))}if((Z||W)&&(we(!!Z,oe.message,ee.message,Fs.max,Fs.min),!a))return q(B[C].message),B}if((y||g)&&!se&&(un(j)||u&&Array.isArray(j))){const Z=Dl(y),W=Dl(g),oe=!cn(Z.value)&&j.length>+Z.value,ee=!cn(W.value)&&j.length<+W.value;if((oe||ee)&&(we(oe,Z.message,W.message),!a))return q(B[C].message),B}if(S&&!se&&un(j)){const{value:Z,message:W}=Dl(S);if(Yd(Z)&&!j.match(Z)&&(B[C]={type:Fs.pattern,message:W,ref:f,...fe(Fs.pattern,W)},!a))return q(W),B}if(A){if(Os(A)){const Z=await A(j,r),W=s1(Z,F);if(W&&(B[C]={...W,...fe(Fs.validate,W.message)},!a))return q(W.message),B}else if(Pt(A)){let Z={};for(const W in A){if(!wn(Z)&&!a)break;const oe=s1(await A[W](j,r),F,W);oe&&(Z={...oe,...fe(W,oe.message)},q(oe.message),a&&(B[C]=Z))}if(!wn(Z)&&(B[C]={ref:F,...Z},!a))return B}}const Ce=B[C];return q(Ce?Ce.message:!0),B},Hd=e=>Array.isArray(e)?e:[e],gN=e=>Array.isArray(e)?e.filter(Boolean):[];function Lk(e,n){const r=n.length-1;let a=0;for(;a<r;){if(cn(e)){e=void 0;break}e=e[n[a]],a++}return e}function Pk(e){for(const n in e)if(e.hasOwnProperty(n)&&!bt(e[n]))return!1;return!0}function $t(e,n){if(un(n)&&Object.prototype.hasOwnProperty.call(e,n))return delete e[n],e;const r=Array.isArray(n)?n:Ia(n)?[n]:Wl(n);if(r.some(f=>Xp.includes(String(f))))return e;const a=r.length===1?e:Lk(e,r),o=r.length-1,u=r[o];return a&&delete a[u],o!==0&&(Pt(a)&&wn(a)||Array.isArray(a)&&Pk(a))&&$t(e,r.slice(0,-1)),e}const Hk=It.createContext(null);Hk.displayName="HookFormContext";var i1=()=>{let e=[];return{get observers(){return e},next:o=>{for(const u of e)u.next&&u.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(u=>u!==o)}}),unsubscribe:()=>{e=[]}}};function bN(e,n){const r={};for(const a in e)if(e.hasOwnProperty(a)){const o=e[a],u=n[a];if(o&&Pt(o)&&u){const f=bN(o,u);Pt(f)&&(r[a]=f)}else e[a]&&(r[a]=u)}return r}const a1=(e,n)=>e!==null&&Jp(e)&&Object.prototype.hasOwnProperty.call(e,n);var qk=(e,n)=>{if(!n)return!1;let r=e;for(const a of Ia(n)?[n]:Wl(n)){if(!a1(r,a))return a1(e,n);r=r[a]}return!0},xN=e=>e.type==="select-multiple",Bk=e=>Wp(e)||$c(e),w0=e=>Kd(e)&&e.isConnected;function l1(e){return Array.isArray(e)||Pt(e)}function yN(e,n,r="",a=[]){for(const o in e){const u=r?`${r}.${o}`:o,f=e[o];l1(f)&&l1(Se(n,u))?yN(f,n,u,a):a.push(u)}return a}var $k=e=>{for(const n in e)if(Os(e[n]))return!0;return!1};function vN(e){return Array.isArray(e)||Pt(e)&&!$k(e)}function wN(e){return!!(e&&"_f"in e)}function _N(e){return Array.isArray(e)?!e.some(n=>!bt(n)):!Object.keys(e).length}function ap(e,n){Array.isArray(e)?e[n]=void 0:delete e[n]}function lp(e,n={},r){for(const a in e){const o=e[a],u=r&&r[a];vN(o)&&(!Array.isArray(o)||!wN(u))?(n[a]=Array.isArray(o)?[]:{},lp(o,n[a],u),_N(n[a])&&ap(n,a)):bt(o)||(n[a]=!0)}return n}function ha(e,n,r,a){r||(r=lp(n,{},a));for(const o in e){const u=e[o],f=a&&a[o];vN(u)&&(!Array.isArray(u)||!wN(f))?(bt(n)||ip(r[o])?r[o]=lp(u,Array.isArray(u)?[]:{},f):ha(u,cn(n)?{}:n[o],r[o],f),_N(r[o])&&ap(r,o)):Gs(u,n[o])?ap(r,o):r[o]=!0}return r}var Fk=(e,n)=>{const r=n.split("."),a=[];let o=r[0];for(let u=1;u<r.length;o+="."+r[u++])!isNaN(+r[u])&&e.has(o)&&a.push(`${o}.${r[u]}`);return a},SN=(e,{valueAsNumber:n,valueAsDate:r,setValueAs:a})=>bt(e)?e:n?e===""?NaN:e&&+e:r&&un(e)?new Date(e):a?a(e):e;function o1(e){const n=e.ref;return mf(n)?n.files:Wp(n)?pN(e.refs).value:xN(n)?[...n.selectedOptions].map(({value:r})=>r):$c(n)?mN(e.refs).value:SN(n.value,e)}var Vk=(e,n,r,a)=>{const o={};for(const u of e){const f=Se(n,u);f&&gt(o,u,f._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:a}},fc=e=>bt(e)?e:Yd(e)?e.source:Pt(e)?Yd(e.value)?e.value.source:e.value:e;const c1="AsyncFunction";var Zk=e=>{if(!e||!e.validate)return!1;if(Os(e.validate))return e.validate.constructor.name===c1;if(Pt(e.validate)){for(const n in e.validate)if(e.validate[n].constructor.name===c1)return!0}return!1},Gk=e=>e.mount&&(e.required||!bt(e.required)&&e.required!==!1||!bt(e.min)||!bt(e.max)||!bt(e.maxLength)||!bt(e.minLength)||e.pattern||e.validate);function u1(e,n,r){const a=Se(e,r);if(a||Ia(r))return{error:a,name:r};const o=r.split(".");for(;o.length;){const u=o.join("."),f=Se(n,u),m=Se(e,u);if(f&&!Array.isArray(f)&&r!==u)return{name:r};if(m&&m.type)return{name:u,error:m};if(m&&m.root&&m.root.type)return{name:`${u}.root`,error:m.root};o.pop()}return{name:r}}var Qk=(e,n,r,a)=>{r(e);const o=Object.keys(e).filter(u=>u!=="name");return!o.length||a&&o.length>=Object.keys(n).length||o.find(u=>n[u]===(!a||Ks.all))},Kk=(e,n,r)=>!e||!n||e===n||Hd(e).some(a=>a&&(r?a===n||a.startsWith(n+"."):a.startsWith(n)||n.startsWith(a))),Yk=(e,n,r,a,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(n||e):(r?a.isOnBlur:o.isOnBlur)?!e:(r?a.isOnChange:o.isOnChange)?e:!0,Jk=(e,n)=>{const r=Se(e,n);!gN(r).length&&!(r!=null&&r.root)&&$t(e,n)};const Xk={mode:Ks.onSubmit,reValidateMode:Ks.onChange,shouldFocusError:!0},_0="form",Wk=(e,n)=>{for(const r in e)r in n||delete e[r];Object.assign(e,n)},NN={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function e8(e={}){let n={...Xk,...e},r={...Ct(NN),isLoading:Os(n.defaultValues),errors:n.errors||{},disabled:n.disabled||!1},a={},o=Pt(n.defaultValues)||Pt(n.values)?Ct(n.defaultValues||n.values)||{}:{},u=n.shouldUnregister?{}:Ct(o),f={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},m={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const p={},y={};let g=0,b=Sd(n.mode),v=Sd(n.reValidateMode);const S={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},A={...S};let C={...A};const O={array:i1(),state:i1()};let N=0;const j=n.criteriaMode===Ks.all,F=(E,H)=>I=>{clearTimeout(y[E]),y[E]=setTimeout(H,I)},q=async E=>{if(!f.keepIsValid&&!n.disabled&&(A.isValid||C.isValid||E)){const H=++N;let I;n.resolver?(I=wn((await oe()).errors),H===N&&B()):I=await ue({fields:a,onlyCheckValid:!0,eventType:kl.VALID}),H===N&&I!==r.isValid&&O.state.next({isValid:I})}},B=(E,H)=>{!n.disabled&&(A.isValidating||A.validatingFields||C.isValidating||C.validatingFields)&&((E||m.mount).forEach(I=>{I&&(H?gt(r.validatingFields,I,H):$t(r.validatingFields,I))}),O.state.next({validatingFields:r.validatingFields,isValidating:!wn(r.validatingFields)}))},re=()=>{r.dirtyFields=ha(o,u,void 0,a)},Q=(E,H=[],I,le,de=!0,be=!0)=>{if(le&&I&&!n.disabled){f.action=!0;const me=Se(a,E);if(f.actionArrayLengths.has(E)||f.actionArrayLengths.set(E,Array.isArray(me)?me.length:0),be&&Array.isArray(me)){const Ue=I(me,le.argA,le.argB);de&&gt(a,E,Ue)}const xe=Se(r.errors,E);if(be&&Array.isArray(xe)){const Ue=xe.root,vt=I(xe,le.argA,le.argB)||xe;Ue&&(vt.root=Ue),de&&gt(r.errors,E,vt),Jk(r.errors,E)}const Te=Se(r.touchedFields,E);if((A.touchedFields||C.touchedFields)&&be&&Array.isArray(Te)){const Ue=I(Te,le.argA,le.argB);de&&gt(r.touchedFields,E,Ue)}(A.dirtyFields||C.dirtyFields)&&re(),O.state.next({name:E,isDirty:Ae(E,H),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else gt(u,E,H)},X=(E,H)=>{gt(r.errors,E,H),r.errors={...r.errors},O.state.next({errors:r.errors})},se=E=>{r.errors=E,O.state.next({errors:r.errors,isValid:!1})},fe=E=>{const H=Ia(E)?[E]:Wl(E);let I=u,le=o;for(let de=0;de<H.length-1;de++){const be=H[de];if(I=cn(I)?I:I[be],le=cn(le)?le:le[be],I===null&&le!==null)return!0}return!1},we=E=>{if(!f.actionArrayLengths.size)return!1;const H=Ia(E)?[E]:Wl(E);let I=u,le="",de=-1,be=0;for(let me=0;me<H.length;me++){if(cn(I))return!1;const xe=H[me];if(le=le?`${le}.${xe}`:xe,Array.isArray(I)&&+xe>=I.length)return de===-1?!1:me===de?+xe<be:!0;f.actionArrayLengths.has(le)&&(de=me+1,be=f.actionArrayLengths.get(le)),I=I[xe]}return!1},Ce=(E,H,I,le)=>{const de=Se(a,E);if(de){if(fe(E)||we(E))return;const be=bt(Se(u,E)),me=Se(u,E,bt(I)?Se(o,E):I);bt(me)||le&&le.defaultChecked||H?gt(u,E,H?me:o1(de._f)):ut(E,me),f.mount&&!f.action&&(q(),be&&r.isDirty&&(A.isDirty||C.isDirty)&&(Ae()||(r.isDirty=!1,O.state.next({...r}))),e.shouldUnregister&&be&&!bt(Se(u,E))&&v0(E,m)&&(f.watch=!0))}},Z=(E,H,I,le,de)=>{let be=!1,me=!1;const xe={name:E};if(!n.disabled||le===!0){if(!I||le){const Te=Gs(Se(o,E),H);(A.isDirty||C.isDirty)&&(me=r.isDirty,r.isDirty=xe.isDirty=!Te||Ae(),be=me!==xe.isDirty),me=!!Se(r.dirtyFields,E),Te!==r.isDirty?Wk(r.dirtyFields,ha(o,u,void 0,a)):Te?$t(r.dirtyFields,E):gt(r.dirtyFields,E,!0),xe.dirtyFields=r.dirtyFields,be=be||(A.dirtyFields||C.dirtyFields)&&me!==!Te}if(I){const Te=Se(r.touchedFields,E);Te||(gt(r.touchedFields,E,I),xe.touchedFields=r.touchedFields,be=be||(A.touchedFields||C.touchedFields)&&Te!==I)}be&&de&&O.state.next(xe)}return be?xe:{}},W=(E,H,I,le)=>{const de=Se(r.errors,E),be=(A.isValid||C.isValid)&&pr(H)&&r.isValid!==H;if(n.delayError&&I?(p[E]=F(E,()=>X(E,I)),p[E](n.delayError)):(clearTimeout(y[E]),delete p[E],I?gt(r.errors,E,I):$t(r.errors,E),r.errors={...r.errors}),(I?!Gs(de,I):de)||!wn(le)||be){const me={...le,...be&&pr(H)?{isValid:H}:{},errors:r.errors,name:E};O.state.next(me)}},oe=async E=>(B(E,!0),await n.resolver(u,n.context,Vk(E||m.mount,a,n.criteriaMode,n.shouldUseNativeValidation))),ee=async E=>{const{errors:H}=await oe(E);if(B(E),E){for(const I of E){const le=Se(H,I);le?m.array.has(I)&&Pt(le)&&!Object.keys(le).some(de=>!Number.isNaN(Number(de)))?Ww(r.errors,{[I]:le},I):gt(r.errors,I,le):$t(r.errors,I)}r.errors={...r.errors}}else r.errors=H;return H},z=async({name:E,eventType:H})=>{if(e.validate){const I=await e.validate({formValues:u,formState:r,name:E,eventType:H});if(Pt(I))for(const le in I){const de=I[le];de&&Zt(`${_0}.${le}`,{message:un(de.message)?de.message:"",type:de.type||Fs.validate})}else un(I)||!I?Zt(_0,{message:I||"",type:Fs.validate}):Tt(_0);return I}return!0},ue=async({fields:E,onlyCheckValid:H,name:I,eventType:le,context:de={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(de.runRootValidation=!0,!await z({name:I,eventType:le})&&(de.valid=!1,H)))return de.valid;for(const be in E){const me=E[be];if(me){const{_f:xe,...Te}=me;if(xe){const Ue=m.array.has(xe.name),vt=me._f&&Zk(me._f),Rn=A.validatingFields||A.isValidating||C.validatingFields||C.isValidating;vt&&Rn&&B([xe.name],!0);const Bn=await r1(me,m.disabled,u,j,n.shouldUseNativeValidation&&!H,Ue);if(vt&&Rn&&B([xe.name]),Bn[xe.name]&&(de.valid=!1,H)||(!H&&(Se(Bn,xe.name)?Ue?Ww(r.errors,Bn,xe.name):gt(r.errors,xe.name,Bn[xe.name]):$t(r.errors,xe.name)),e.shouldUseNativeValidation&&Bn[xe.name]))break}!wn(Te)&&await ue({context:de,onlyCheckValid:H,fields:Te,name:be,eventType:le})}}return de.valid},Me=()=>{for(const E of m.unMount){const H=Se(a,E);H&&(H._f.refs?H._f.refs.every(I=>!w0(I)):!w0(H._f.ref))&&$(E)}m.unMount=new Set},Ae=(E,H)=>(E&&H&&gt(u,E,H),!Gs(f.mount?u:o,o)),Ye=(E,H,I)=>Ik(E,m,{...f.mount?u:bt(H)||un(E)?o:H},I,H),$e=E=>gN(Se(f.mount?u:o,E,n.shouldUnregister?Se(o,E,[]):[])),ut=(E,H,I={},le=!1,de=!1,be=!1)=>{const me=Se(a,E);let xe=H;if(me){const Te=me._f;Te&&(!Te.disabled&&gt(u,E,SN(H,Te)),xe=Kd(Te.ref)&&cn(H)?"":H,xN(Te.ref)?[...Te.ref.options].forEach(Ue=>Ue.selected=xe.includes(Ue.value)):Te.refs?$c(Te.ref)?Te.refs.forEach(Ue=>{(!Ue.defaultChecked||!Ue.disabled)&&(Array.isArray(xe)?Ue.checked=!!xe.find(vt=>vt===Ue.value):Ue.checked=xe===Ue.value||!!xe)}):Te.refs.forEach(Ue=>Ue.checked=Ue.value===xe):mf(Te.ref)?Te.ref.value="":(Te.ref.value=xe,!Te.ref.type&&!de&&!be&&O.state.next({name:E,values:le?u:Ct(u)})))}(I.shouldDirty||I.shouldTouch)&&Z(E,xe,I.shouldTouch,I.shouldDirty,!de),I.shouldValidate&&qe(E,{delayError:I.delayError})},_=(E,H,I,le=!1,de=!1,be=!1)=>{m.array.has(E)&&O.array.next({name:E,values:le?u:Ct(u)});for(const me in H){if(!H.hasOwnProperty(me))continue;const xe=H[me],Te=E+"."+me,Ue=Se(a,Te);(m.array.has(E)||Pt(xe)||Ue&&!Ue._f)&&!zi(xe)?_(Te,xe,I,le,de,be):ut(Te,xe,I,le,de,be)}},Y=(E,H,I,le,de=!1)=>{const be=Se(a,E),me=m.array.has(E),xe=le?H:Ct(H),Te=Se(u,E),Ue=Gs(Te,xe);if(Ue||gt(u,E,xe),me)O.array.next({name:E,values:le?u:Ct(u)}),(A.isDirty||A.dirtyFields||C.isDirty||C.dirtyFields)&&I.shouldDirty&&(re(),de||O.state.next({name:E,dirtyFields:r.dirtyFields,isDirty:Ae(E,xe)}));else{const vt=Array.isArray(xe)&&!xe.length||wn(xe),Rn=!Ue&&!de;!be||be._f||cn(xe)||vt?ut(E,xe,I,le,de,Rn):_(E,xe,I,le,de,Rn)}if(!Ue&&!de){const vt=v0(E,m),Rn=le?u:Ct(u);if(O.state.next({...vt&&r,name:f.mount||vt?E:void 0,values:Rn}),!me)for(const Bn of Fk(m.array,E))O.state.next({name:Bn,values:Rn})}},he=(E,H,I={})=>Y(E,H,I,!1),ce=(E,H={})=>{const I=Os(E)?E(u):E;if(!Gs(u,I)){u={...u,...I};for(const le of m.mount)qk(I,le)&&Y(le,Se(I,le),H,!0,!0);O.state.next({...r,name:void 0,type:void 0,...g?{values:u}:{}}),H.shouldValidate&&q()}},Oe=async E=>{f.mount=!0;const H=E.target;let I=H.name,le=!0;const de=Se(a,I),be=me=>{le=Number.isNaN(me)||zi(me)&&isNaN(me.getTime())||Gs(me,Se(u,I,me))};if(de){let me,xe;const Te=H.type?o1(de._f):Ck(E),Ue=E.type===kl.BLUR||E.type===kl.FOCUS_OUT,vt=!Gk(de._f)&&!e.validate&&!n.resolver&&!Se(r.errors,I)&&!de._f.deps,Rn=vt||Yk(Ue,Se(r.touchedFields,I),r.isSubmitted,v,b),Bn=v0(I,m,Ue);if(gt(u,I,Ct(Te)),Ue){if(!H||!H.readOnly){de._f.onBlur&&de._f.onBlur(E);const Ds=p[I];Ds&&Ds(0)}}else de._f.onChange&&de._f.onChange(E);const $i=Z(I,Te,Ue),vf=!wn($i)||Bn;if(!Ue&&O.state.next({name:I,type:E.type,...g?{values:Ct(u)}:{}}),Rn)return(!vt||!r.isValid)&&(A.isValid||C.isValid)&&(n.mode==="onBlur"?Ue&&q():Ue||q()),vf&&O.state.next({name:I,...Bn?{}:$i});if(!n.resolver&&e.validate&&await z({name:I,eventType:E.type}),!Ue&&Bn&&O.state.next({...r}),n.resolver){const{errors:Ds}=await oe([I]);if(B([I]),be(Te),!le){!wn($i)&&O.state.next($i);return}const Tn=u1(r.errors,a,I),Ms=u1(Ds,a,Tn.name||I);me=Ms.error,I=Ms.name,xe=wn(Ds)}else B([I],!0),me=(await r1(de,m.disabled,u,j,n.shouldUseNativeValidation))[I],B([I]),be(Te),le&&(me?xe=!1:(A.isValid||C.isValid)&&(xe=await ue({fields:a,onlyCheckValid:!0,name:I,eventType:E.type})));le&&(de._f.deps&&(!Array.isArray(de._f.deps)||de._f.deps.length>0)&&qe(de._f.deps),W(I,xe,me,$i))}},Pe=(E,H)=>{if(Se(r.errors,H)&&E.focus)return E.focus(),1},qe=async(E,H={})=>{let I,le;const de=Hd(E);if(n.resolver){const be=await ee(bt(E)?E:de);I=wn(be),le=E?!de.some(me=>Se(be,me)):I}else E?(le=(await Promise.all(de.map(async be=>{const me=Se(a,be);return await ue({fields:me&&me._f?{[be]:me}:me,eventType:kl.TRIGGER})}))).every(Boolean),!(!le&&!r.isValid)&&q()):le=I=await ue({fields:a,name:E,eventType:kl.TRIGGER});if(H.delayError&&n.delayError&&un(E)){const be=Se(r.errors,E);be?($t(r.errors,E),p[E]=F(E,()=>X(E,be)),p[E](n.delayError)):(clearTimeout(y[E]),delete p[E])}if(H.shouldTouch)for(const be of E?de:m.mount)!m.array.has(be)&&gt(r.touchedFields,be,!0);return O.state.next({...!un(E)||(A.isValid||C.isValid)&&I!==r.isValid?{}:{name:E},...n.resolver||!E?{isValid:I}:{},...H.shouldTouch&&(A.touchedFields||C.touchedFields)?{touchedFields:r.touchedFields}:{},errors:r.errors}),H.shouldFocus&&!le&&vc(a,Pe,E?de:m.mount),le},_e=(E,H)=>{let I={...f.mount?u:o};return H&&(I=bN(H.dirtyFields?r.dirtyFields:r.touchedFields,I)),bt(E)?I:un(E)?Se(I,E):E.map(le=>Se(I,le))},je=E=>bt(E)?{...r.errors}:un(E)?Se(r.errors,E):E.map(H=>Se(r.errors,H)),at=(E,H)=>{const I=H||r,le=Se(I.errors,E);return{invalid:!!le,isDirty:!!Se(I.dirtyFields,E),error:le,isValidating:!!Se(r.validatingFields,E),isTouched:!!Se(I.touchedFields,E)}},Tt=E=>{const H=E?Hd(E):void 0;H==null||H.forEach(I=>$t(r.errors,I)),H?H.forEach(I=>{O.state.next({name:I,errors:r.errors})}):(r.errors={},O.state.next({errors:r.errors}))},Zt=(E,H,I)=>{const le=(Se(a,E,{_f:{}})._f||{}).ref,de=Se(r.errors,E)||{},{ref:be,message:me,type:xe,...Te}=de;gt(r.errors,E,{...Te,...H,ref:le}),O.state.next({name:E,errors:r.errors,isValid:!1}),I&&I.shouldFocus&&le&&le.focus&&le.focus()},J=(E,H)=>{if(Os(E)){g++;const{unsubscribe:I}=O.state.subscribe({next:de=>"values"in de&&E(de.values||Ye(void 0,H),de)});let le=!1;return{unsubscribe:()=>{le||(le=!0,g--,I())}}}return Ye(E,H,!0)},Re=E=>{var H;const I=!!(!((H=E.formState)===null||H===void 0)&&H.values);I&&g++;const{unsubscribe:le}=O.state.subscribe({next:be=>{if(Kk(E.name,be.name,E.exact)&&Qk(be,E.formState||A,ae,E.reRenderRoot)){const me={...u};E.callback({values:me,...r,...be,defaultValues:o})}}});if(!I)return le;let de=!1;return()=>{de||(de=!0,g--,le())}},pe=E=>(f.mount=!0,C={...C,...E.formState},Re({...E,formState:{...S,...E.formState}})),$=(E,H={})=>{for(const I of E?Hd(E):m.mount)m.mount.delete(I),m.array.delete(I),H.keepValue||($t(a,I),$t(u,I)),!H.keepError&&$t(r.errors,I),!H.keepDirty&&$t(r.dirtyFields,I),!H.keepTouched&&$t(r.touchedFields,I),!H.keepIsValidating&&$t(r.validatingFields,I),!n.shouldUnregister&&!H.keepDefaultValue&&$t(o,I);g&&O.state.next({values:Ct(u)}),O.state.next({...r,...H.keepDirty?{}:{isDirty:Ae()}}),!H.keepIsValid&&q()},Ge=({disabled:E,name:H})=>{if(pr(E)&&f.mount||E||m.disabled.has(H)){const de=m.disabled.has(H)!==!!E;E?m.disabled.add(H):m.disabled.delete(H),de&&f.mount&&!f.action&&q()}},rt=(E,H={})=>{let I=Se(a,E);const le=pr(H.disabled)||pr(n.disabled),de=!m.registerName.has(E)&&I&&I._f&&!I._f.mount;return gt(a,E,{...I||{},_f:{...I&&I._f?I._f:{ref:{name:E}},name:E,mount:!0,...H}}),m.mount.add(E),I&&!de?Ge({disabled:pr(H.disabled)?H.disabled:n.disabled,name:E}):Ce(E,!0,H.value),{...le?{disabled:H.disabled||n.disabled}:{},...n.progressive?{required:!!H.required,min:fc(H.min),max:fc(H.max),minLength:fc(H.minLength),maxLength:fc(H.maxLength),pattern:fc(H.pattern)}:{},name:E,onChange:Oe,onBlur:Oe,ref:be=>{if(be){m.registerName.add(E),rt(E,H),m.registerName.delete(E),I=Se(a,E);const me=bt(be.value)&&be.querySelectorAll&&be.querySelectorAll("input,select,textarea")[0]||be,xe=Bk(me),Te=I._f.refs||[];if(xe?Te.find(vt=>vt===me):me===I._f.ref)return;const Ue={...I._f};xe?(Ue.refs=[...Te.filter(w0),me,...Array.isArray(Se(o,E))?[{}]:[]],Ue.ref={type:me.type,name:E}):(Ue.ref=me,delete Ue.refs),gt(a,E,{_f:Ue}),Ce(E,!1,void 0,me)}else I=Se(a,E,{}),I._f&&(I._f.mount=!1),(n.shouldUnregister||H.shouldUnregister)&&!(Rk(m.array,E)&&f.action)&&m.unMount.add(E)}}},qt=()=>n.shouldFocusError&&!n.shouldUseNativeValidation&&vc(a,Pe,m.mount),Sr=E=>{pr(E)&&(O.state.next({disabled:E}),vc(a,(H,I)=>{const le=Se(a,I);le&&(H.disabled=le._f.disabled||E,Array.isArray(le._f.refs)&&le._f.refs.forEach(de=>{de.disabled=le._f.disabled||E}))},0,!1))},Sn=(E,H)=>async I=>{let le,de;I&&(I.preventDefault&&I.preventDefault(),I.persist&&I.persist());let be=Ct(u);if(O.state.next({isSubmitting:!0}),n.resolver){const{errors:me,values:xe}=await oe();B(),r.errors=me,be=Ct(xe)}else await ue({fields:a,eventType:kl.SUBMIT});if(m.disabled.size)for(const me of m.disabled)$t(be,me);if($t(r.errors,hN),wn(r.errors)){O.state.next({errors:{}});try{le=await E(be,I)}catch(me){de=me}}else H&&await H({...r.errors},I),qt(),setTimeout(qt);if(O.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:wn(r.errors)&&!de,submitCount:r.submitCount+1,errors:r.errors}),de)throw de;return le},Hi=(E,H={})=>{Se(a,E)&&(bt(H.defaultValue)?he(E,Ct(Se(o,E))):(he(E,H.defaultValue),gt(o,E,Ct(H.defaultValue))),H.keepTouched||$t(r.touchedFields,E),H.keepDirty||($t(r.dirtyFields,E),r.isDirty=H.defaultValue?Ae(E,Ct(Se(o,E))):Ae()),H.keepError||($t(r.errors,E),q()),O.state.next({...r}))},Kr=(E,H={})=>{const I=E?Ct(E):o,le=Ct(I),de=wn(E),be=le,me=a;if(H.keepDefaultValues||(o=I),!H.keepValues){if(H.keepDirtyValues){const xe=new Set([...m.mount,...yN(ha(o,u,void 0,me),r.dirtyFields)]);for(const Te of xe){const Ue=Se(r.dirtyFields,Te),vt=Se(u,Te),Rn=Se(be,Te);Ue&&!bt(vt)?gt(be,Te,vt):!Ue&&!bt(Rn)&&he(Te,Rn)}}else{if(pf&&bt(E))for(const xe of m.mount){const Te=Se(a,xe);if(Te&&Te._f){const Ue=Array.isArray(Te._f.refs)?Te._f.refs[0]:Te._f.ref;if(Kd(Ue)){const vt=Ue.closest("form");if(vt){vt.reset();break}}}}if(H.keepFieldsRef)for(const xe of m.mount)he(xe,Se(be,xe));else a={}}if(n.shouldUnregister){if(u=H.keepDefaultValues?Ct(o):{},H.keepFieldsRef)for(const xe of m.mount)gt(u,xe,Se(be,xe))}else u=Ct(be);O.array.next({values:{...be}}),O.state.next({name:void 0,type:void 0,values:{...be}})}m={mount:H.keepDirtyValues?m.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},f.mount=!A.isValid||!!H.keepIsValid||!!H.keepDirtyValues||!n.shouldUnregister&&!wn(be),f.watch=!!n.shouldUnregister,f.keepIsValid=!!H.keepIsValid,f.action=!1,f.actionArrayLengths.clear(),H.keepErrors||(r.errors={}),O.state.next({submitCount:H.keepSubmitCount?r.submitCount:0,isDirty:de?!1:H.keepDirty?r.isDirty:H.keepValues?Ae():!!(H.keepDefaultValues&&!Gs(E,o)),isSubmitted:H.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:de?{}:H.keepDirtyValues?H.keepDefaultValues&&u?ha(o,u,void 0,me):r.dirtyFields:H.keepDefaultValues&&E?ha(o,E,void 0,me):H.keepDirty?r.dirtyFields:{},touchedFields:H.keepTouched?r.touchedFields:{},errors:H.keepErrors?r.errors:{},isSubmitSuccessful:H.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},er=(E,H)=>Kr(Os(E)?E(u):E,{...n.resetOptions,...H}),qa=(E,H={})=>{const I=Se(a,E),le=I&&I._f;if(le){const de=le.refs?le.refs[0]:le.ref;de.focus&&setTimeout(()=>{de.focus(),H.shouldSelect&&Os(de.select)&&de.select()})}},ae=E=>{const{name:H,type:I,values:le,...de}=E;r={...r,...de}};O.state.subscribe({next:ae});const Bi={control:{register:rt,unregister:$,getFieldState:at,handleSubmit:Sn,setError:Zt,_subscribe:Re,_runSchema:oe,_updateIsValidating:B,_focusError:qt,_getWatch:Ye,_getDirty:Ae,_setValid:q,_setFieldArray:Q,_setDisabledField:Ge,_setErrors:se,_getFieldArray:$e,_reset:Kr,_resetDefaultValues:()=>Os(n.defaultValues)&&n.defaultValues().then(E=>{er(E,n.resetOptions),O.state.next({isLoading:!1})}),_removeUnmounted:Me,_disableForm:Sr,_subjects:O,_proxyFormState:A,get _fields(){return a},get _formValues(){return u},get _state(){return f},set _state(E){f=E},get _defaultValues(){return o},get _names(){return m},set _names(E){m=E},get _formState(){return r},get _options(){return n},set _options(E){n={...n,...E},b=Sd(n.mode),v=Sd(n.reValidateMode)}},subscribe:pe,trigger:qe,register:rt,handleSubmit:Sn,watch:J,setValue:he,setValues:ce,getValues:_e,getErrors:je,reset:er,resetField:Hi,resetDefaultValues:(E,H={})=>{if(o=Ct(E),!H.keepDirty){const I=ha(o,u,void 0,a);r.dirtyFields=I,r.isDirty=!wn(I)}H.keepIsValid||q(),O.state.next({...r,defaultValues:o})},clearErrors:Tt,unregister:$,setError:Zt,setFocus:qa,getFieldState:at};return{...Bi,formControl:Bi}}function hs(e={}){const n=It.useRef(void 0),r=It.useRef(void 0),a=It.useRef(e.formControl),[o,u]=It.useState(()=>({...Ct(NN),isLoading:Os(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Os(e.defaultValues)?void 0:e.defaultValues}));if(!n.current||e.formControl&&a.current!==e.formControl)if(a.current=e.formControl,e.formControl)n.current={...e.formControl,formState:o},e.defaultValues&&!Os(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:y,...g}=e8(e);n.current={...g,formState:o}}const f=n.current.control;f._options=e;const{resyncIfNeeded:m,snapshot:p}=Uk();return Mk(()=>{const y=()=>({...f._formState,defaultValues:f._defaultValues});m(!0,y,u);const g=f._subscribe({formState:f._proxyFormState,callback:()=>u({...f._formState,defaultValues:f._defaultValues}),reRenderRoot:!0});return u(b=>({...b,isReady:!0})),f._formState.isReady=!0,()=>{g(),p(!0,y)}},[f,m,p]),It.useEffect(()=>f._disableForm(e.disabled),[f,e.disabled]),It.useEffect(()=>{e.mode&&(f._options.mode=e.mode),e.reValidateMode&&(f._options.reValidateMode=e.reValidateMode)},[f,e.mode,e.reValidateMode]),It.useEffect(()=>{e.errors&&(f._setErrors(e.errors),f._focusError())},[f,e.errors]),It.useEffect(()=>{e.shouldUnregister&&f._subjects.state.next({values:f._getWatch()})},[f,e.shouldUnregister]),It.useEffect(()=>{if(f._proxyFormState.isDirty){const y=f._getDirty();y!==o.isDirty&&f._subjects.state.next({isDirty:y})}},[f,o.isDirty]),It.useEffect(()=>{var y;e.values&&!Gs(e.values,r.current)?(f._reset(e.values,{keepFieldsRef:!0,...f._options.resetOptions}),!((y=f._options.resetOptions)===null||y===void 0)&&y.keepIsValid||f._setValid(),r.current=e.values,u(g=>({...g}))):f._resetDefaultValues()},[f,e.values]),It.useEffect(()=>{f._state.mount||(f._setValid(),f._state.mount=!0),f._state.watch&&(f._state.watch=!1,f._subjects.state.next({...f._formState})),f._removeUnmounted()}),n.current.formState=It.useMemo(()=>Dk(o,f),[f,o]),n.current}const d1=(e,n,r)=>{if(e&&"reportValidity"in e){const a=Se(r,n);e.setCustomValidity(a&&a.message||""),e.reportValidity()}},op=(e,n)=>{for(const r in n.fields){const a=n.fields[r];a&&a.ref&&"reportValidity"in a.ref?d1(a.ref,r,e):a&&a.refs&&a.refs.forEach(o=>d1(o,r,e))}},f1=(e,n)=>{n.shouldUseNativeValidation&&op(e,n);const r={};for(const a in e){const o=Se(n.fields,a),u=Object.assign(e[a]||{},{ref:o&&o.refs?o.refs[0]:o&&o.ref});if(t8(n.names||Object.keys(e),a)){const f=Object.assign({},Se(r,a));gt(f,"root",u),gt(r,a,f)}else gt(r,a,u)}return r},t8=(e,n)=>{const r=h1(n).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(a=>h1(a).match(`^${r}\\.\\d+`))};function h1(e){return e.replace(/\[(\d+)]/g,".$1").replace(/[[\]]/g,"")}function cp(){return cp=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},cp.apply(null,arguments)}function m1(e,n){try{var r=e()}catch(a){return n(a)}return r&&r.then?r.then(void 0,n):r}function n8(e,n){for(var r=Object.create(null);e.length;){var a=e[0],o=a.code,u=a.message,f=a.path.join(".");if(!r[f])if("unionErrors"in a){var m,p,y=a.unionErrors.reduce(function(v,S){return S.errors.length<v.errors.length?S:v}).errors[0];r[f]={message:(m=y==null?void 0:y.message)!=null?m:u,type:(p=y==null?void 0:y.code)!=null?p:o}}else r[f]={message:u,type:o};if("unionErrors"in a&&a.unionErrors.forEach(function(v){return v.errors.forEach(function(S){return e.push(S)})}),n){var g=r[f].types,b=g&&g[a.code];r[f]=eg(f,n,r,o,b?[].concat(b,a.message):a.message)}e.shift()}return r}function s8(e,n){for(var r=Object.create(null),a=function(){var o=e[0],u=o.code,f=o.message,m=o.path.join(".");if(!r[m])if(o.code==="invalid_union"&&o.errors.length>0){var p,y,g=o.errors.reduce(function(S,A){return A.length<S.length?A:S})[0];r[m]={message:(p=g==null?void 0:g.message)!=null?p:f,type:(y=g==null?void 0:g.code)!=null?y:u}}else r[m]={message:f,type:u};if(o.code==="invalid_union"&&o.errors.forEach(function(S){return S.forEach(function(A){return e.push(cp({},A,{path:[].concat(o.path,A.path)}))})}),n){var b=r[m].types,v=b&&b[o.code];r[m]=eg(m,n,r,u,v?[].concat(v,o.message):o.message)}e.shift()};e.length;)a();return r}function ms(e,n,r){if(r===void 0&&(r={}),(function(a){return"_zod"in a&&typeof a._zod=="object"})(e))return function(a,o,u){try{return Promise.resolve(m1(function(){function f(p){return u.shouldUseNativeValidation&&op({},u),{errors:{},values:r.raw?Object.assign({},a):p}}var m=e;return r.mode==="sync"?f(m.parse(a,n)):Promise.resolve(m.parseAsync(a,n)).then(f)},function(f){if((function(m){var p;return!(m==null||(p=m._zod)==null||(p=p.traits)==null||!p.has("$ZodError"))})(f))return{values:{},errors:f1(s8(f.issues,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw f}))}catch(f){return Promise.reject(f)}};if((function(a){return"_def"in a&&typeof a._def=="object"})(e))return function(a,o,u){try{return Promise.resolve(m1(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](a,n)).then(function(f){return u.shouldUseNativeValidation&&op({},u),{errors:{},values:r.raw?Object.assign({},a):f}})},function(f){if((function(m){return Array.isArray(m==null?void 0:m.issues)})(f))return{values:{},errors:f1(n8(f.errors,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw f}))}catch(f){return Promise.reject(f)}};throw new Error("Invalid input: not a Zod schema")}function up(e){const n=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,o])=>n.indexOf(+a)===-1).map(([a,o])=>o)}function p1(e,n="|"){return e.map(r=>RN(r)).join(n)}function dp(e,n){return typeof n=="bigint"?n.toString():n}class r8{constructor(n){this._getter=n,this._value=void 0}get value(){const n=this._getter;return n!==void 0&&(this._value=n(),this._getter=void 0),this._value}}function tg(e){return new r8(e)}function i8(e){return e==null}function ng(e){const n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}function a8(e,n){const r=e/n,a=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-a)<o?0:r-a}function Ha(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}function jN(e){const n=Object.getOwnPropertyDescriptor(e,"shape");return n!=null&&n.get?n.get.raw:n==null?void 0:n.value}function Qr(e){return jN(e._zod.def)??e._zod.def.shape}function EN(e,n,r){Object.defineProperty(e,n,{get(){const a=r();return Ha(this,n,a),a},enumerable:!0,configurable:!0})}function AN(e,n,r){n in e?Ha(e,n,r):e[n]=r}function La(e,n,r,a){const o=Qr(n);for(const u of r){const f=Object.getOwnPropertyDescriptor(o,u);f.enumerable&&(f.get?EN(e,u,()=>{const m=n._zod.def.shape[u];return a?a(m,u):m}):AN(e,u,a?a(f.value,u):f.value))}}function l8(e,n){for(const r of Reflect.ownKeys(n)){const a=Object.getOwnPropertyDescriptor(n,r);a.enumerable&&(a.get?EN(e,r,()=>n[r]):AN(e,r,a.value))}}function ps(...e){const n={};for(const r of e){const a=Object.getOwnPropertyDescriptors(r);Object.assign(n,a)}return Object.defineProperties({},n)}function o8(e){return JSON.stringify(e)}function c8(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const CN="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Jd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const u8=tg(()=>{var e;if(_r.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function Ac(e){if(Jd(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const r=n.prototype;return!(Jd(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function ON(e){return Ac(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const d8=new Set(["string","number","symbol"]);function gf(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Li(e,n,r){const a=new e._zod.constr(n??e._zod.def);return(!n||r!=null&&r.parent)&&(a._zod.parent=e),a}function Ie(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if((n==null?void 0:n.message)!==void 0){if((n==null?void 0:n.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function RN(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function f8(e){return Object.keys(e).filter(n=>e[n]._zod.optin!==void 0&&e[n]._zod.optout==="optional")}const TN={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},h8={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function m8(e,n){const r=e._zod.def,a=r.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const u={};return La(u,e,bf(e,n)),Li(e,ps(r,{shape:u,checks:[]}))}function bf(e,n){var o;const r=Qr(e),a=[];for(const u of Reflect.ownKeys(n)){if(!((o=Object.getOwnPropertyDescriptor(r,u))!=null&&o.enumerable))throw new Error(`Unrecognized key: "${String(u)}"`);n[u]&&a.push(u)}return a}function p8(e,n){const r=e._zod.def,a=r.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const u=new Set(bf(e,n)),f={};return La(f,e,Reflect.ownKeys(Qr(e)).filter(m=>!u.has(m))),Li(e,ps(r,{shape:f,checks:[]}))}function g8(e,n){if(!Ac(n))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const o=Qr(e);for(const u of Reflect.ownKeys(n))if(Object.getOwnPropertyDescriptor(o,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Li(e,ps(e._zod.def,{shape:kN(e,n)}))}function kN(e,n){const r={};return La(r,e,Reflect.ownKeys(Qr(e))),l8(r,n),r}function b8(e,n){if(!Ac(n))throw new Error("Invalid input to safeExtend: expected a plain object");return Li(e,ps(e._zod.def,{shape:kN(e,n)}))}function x8(e,n){var o,u;if(!((o=n==null?void 0:n._zod)!=null&&o.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((u=e._zod.def.checks)!=null&&u.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r={};La(r,e,Reflect.ownKeys(Qr(e))),La(r,n,Reflect.ownKeys(Qr(n)));const a=ps(e._zod.def,{shape:r,get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return Li(e,a)}function g1(e,n,r,a="partial"){const u=n._zod.def.checks;if(u&&u.length>0)throw new Error(`.${a}() cannot be used on object schemas containing refinements`);const m=r?new Set(bf(n,r)):void 0,p={};return La(p,n,Reflect.ownKeys(Qr(n)),e&&((y,g)=>m&&!m.has(g)?y:new e({type:"optional",innerType:y}))),Li(n,ps(n._zod.def,{shape:p,checks:[]}))}function y8(e,n,r){const a=r?new Set(bf(n,r)):void 0,o={};return La(o,n,Reflect.ownKeys(Qr(n)),(u,f)=>a&&!a.has(f)?u:new e({type:"nonoptional",innerType:u})),Li(n,ps(n._zod.def,{shape:o}))}function Vr(e,n=0){var r;if(e.aborted===!0)return!0;for(let a=n;a<e.issues.length;a++)if(((r=e.issues[a])==null?void 0:r.continue)!==!0)return!0;return!1}function v8(e,n=0){var r;if(e.aborted===!0)return!0;for(let a=n;a<e.issues.length;a++)if(((r=e.issues[a])==null?void 0:r.continue)===!1)return!0;return!1}function DN(e,n){return n.map(r=>{var a;return(a=r).path??(a.path=[]),r.path.unshift(e),r})}function hc(e){return typeof e=="string"?e:e==null?void 0:e.message}function b1(e,n,r){var a;for(let o=n;o<e.length;o++)(a=e[o]).schema??(a.schema=r)}function oo(e,n,r){var p,y,g,b,v,S,A,C,O,N;var a;const o=(y=(p=e.inst)==null?void 0:p._zod)==null?void 0:y.traits;o!=null&&o.has("$ZodType")&&(o.has("$ZodCheck")?(a=e).schema??(a.schema=e.inst):e.schema=e.inst);const u=e.schema!==e.inst?(b=(g=e.schema)==null?void 0:g._zod.def)==null?void 0:b.error:void 0,f=e.message?e.message:hc((A=(S=(v=e.inst)==null?void 0:v._zod.def)==null?void 0:S.error)==null?void 0:A.call(S,e))??hc(u==null?void 0:u(e))??hc((C=n==null?void 0:n.error)==null?void 0:C.call(n,e))??hc((O=r.customError)==null?void 0:O.call(r,e))??hc((N=r.localeError)==null?void 0:N.call(r,e))??"Invalid input",m={};for(const j of Object.keys(e))j==="inst"||j==="schema"||j==="continue"||j==="input"||j==="__proto__"||(m[j]=e[j]);return m.path??(m.path=[]),m.message=f,n!=null&&n.reportInput&&(m.input=e.input),m}const w8=/[\uD800-\uDBFF]/;function sg(e){const n=e.length;if(!w8.test(e))return n;let r=n;for(let a=0;a<n-1;a++)(e.charCodeAt(a)&64512)===55296&&(e.charCodeAt(a+1)&64512)===56320&&(r--,a++);return r}function rg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function _8(e){const n=typeof e;switch(n){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return n}function Cc(...e){const[n,r,a]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:a}:{...n}}function S8(e,n){for(const r in n){const a=Object.getOwnPropertyDescriptor(n,r);a.get?Object.defineProperty(e,r,{...a,enumerable:!1}):x1(e,r,a.value)}for(const r of Object.getOwnPropertySymbols(n))x1(e,r,n[r])}function Ii(e,n,r,a=!0){return Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:a,value:r}),r}function MN(e,n,r){return Ii(e,n,r,!1)}function zN(e,n){for(const r in e){const a=e[r];Object.defineProperty(n,r,{configurable:!0,enumerable:!0,get(){return Ii(this,r,a(this))},set(o){Ii(this,r,o)}})}return n}function x1(e,n,r){Object.defineProperty(e,n,{configurable:!0,get(){return this==null?r:Ii(this,n,r.bind(this))},set(a){Ii(this,n,a)}})}function N8(e,n){const r=Object.getPrototypeOf(e);return n in r?void 0:r}let S0,Si=!1;const j8={configurable:!0,get(){Si=!0}};function yt(e,n,r){const a=Object.getPrototypeOf(e._zod);if(n in a&&S0!==e._zod){S0=void 0;return}S0=e._zod,Object.defineProperty(a,n,{configurable:!0,get(){Object.defineProperty(this,n,j8);const o=Si;Si=!1;try{const u=r(this);return Si?delete this[n]:Object.defineProperty(this,n,{configurable:!0,writable:!0,value:u}),Si=Si||o,u}catch(u){throw delete this[n],Si=Si||o,u}},set(o){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:o})}})}function E8(e,n,r,a){const o=N8(e,n);o&&Object.defineProperty(o,n,{configurable:!0,get(){const u={configurable:!0,writable:!0,enumerable:a,value:void 0};return Object.defineProperty(this,n,u),u.value=r(this),Object.defineProperty(this,n,u),u.value},set(u){Object.defineProperty(this,n,{configurable:!0,writable:!0,enumerable:a,value:u})}})}const A8="~constantCatch";function C8(e){const n=()=>e;return n[A8]=!0,n}var y1;const N0={value:void 0,enumerable:!1};let v1="captureStackTrace"in Error?Error:null;function O8(e){const n=v1;if(n){const r=n.stackTraceLimit;if(typeof r=="number"){try{n.stackTraceLimit=0}catch{return v1=null,new e}try{return new e}finally{n.stackTraceLimit=r}}}return new e}function ie(e,n,r,a){const o={};function u(v){this.def=v,this.constr=b,this.traits=new Set}u.prototype=o;const f=r,m=f&&new WeakSet;function p(v,S){if(!v._zod){N0.value=new u(S);try{Object.defineProperty(v,"_zod",N0)}finally{N0.value=void 0}}if(v._zod.traits.has(e))return;if(v._zod.traits.add(e),n(v,S),m){const C=Object.getPrototypeOf(v),O=v._zod.constr.prototype;let N=C;for(;N&&N!==O;)N=Object.getPrototypeOf(N);const j=N??C;m.has(j)||(m.add(j),S8(j,f))}const A=b.prototype;for(const C in A)Object.prototype.hasOwnProperty.call(A,C)&&(C in v||(v[C]=A[C].bind(v)))}const y=(a==null?void 0:a.Parent)??Object;class g extends y{}Object.defineProperty(g,"name",{value:e});function b(v){var O;const S=a!=null&&a.Parent?O8(g):this;p(S,v);const A=S._zod.deferred;if(A){for(const N of A)N();S._zod.deferred=void 0}const C=(O=globalThis.__zod_globalConfig)==null?void 0:O.postProcessor;return C&&C(S),S}return Object.defineProperty(b,"init",{value:p}),Object.defineProperty(b,Symbol.hasInstance,{value:v=>{var S,A;return a!=null&&a.Parent&&v instanceof a.Parent?!0:(A=(S=v==null?void 0:v._zod)==null?void 0:S.traits)==null?void 0:A.has(e)}}),Object.defineProperty(b,"name",{value:e}),b}class Ra extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class UN extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}(y1=globalThis).__zod_globalConfig??(y1.__zod_globalConfig={});const _r=globalThis.__zod_globalConfig;function Pi(e){return e&&Object.assign(_r,e),_r}function R8(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,dp,2)),e.message}function T8(e){this._zod.message=e}const k8={get:R8,set:T8,enumerable:!0,configurable:!0},j0={value:void 0,enumerable:!1},w1=new WeakSet([Object.prototype,Error.prototype]),D8=(e,n)=>{e.name="$ZodError",j0.value=n,Object.defineProperty(e,"issues",j0),j0.value=void 0,Object.defineProperty(e,"message",k8);const r=Object.getPrototypeOf(e);w1.has(r)||(w1.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){const a=()=>this.message;return Object.defineProperty(this,"toString",{value:a,configurable:!0,writable:!0}),a},set(a){Object.defineProperty(this,"toString",{value:a,configurable:!0,writable:!0})}}))},M8=ie("$ZodError",D8);function z8(e,n,r){return Object.prototype.hasOwnProperty.call(e,n)||(n==="__proto__"?Object.defineProperty(e,n,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[n]=r()),e[n]}function U8(e,n=r=>r.message){const r={},a=[];for(const o of e.issues)o.path.length>0?z8(r,o.path[0],()=>[]).push(n(o)):a.push(n(o));return{formErrors:a,fieldErrors:r}}function I8(e,n=r=>r.message){const r={_errors:[]},a=(o,u=[])=>{for(const f of o.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(m=>a({issues:m},[...u,...f.path]));else if(f.code==="invalid_key")a({issues:f.issues},[...u,...f.path]);else if(f.code==="invalid_element")a({issues:f.issues},[...u,...f.path]);else{const m=[...u,...f.path];if(m.length===0)r._errors.push(n(f));else{let p=r,y=0;for(;y<m.length;){const g=m[y],b=y===m.length-1;if(g==="_errors"){b&&p._errors.push(n(f)),y++;continue}Object.prototype.hasOwnProperty.call(p,g)||Object.defineProperty(p,g,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const v=p[g];b&&v._errors.push(n(f)),p=v,y++}}}};return a(e),r}function xf(e,n){return{callee:(n==null?void 0:n.callee)??e,Err:n==null?void 0:n.Err}}const ig=e=>{const n=(r,a,o,u)=>{const f=o?{...o,async:!1}:{async:!1},m=r._zod.run({value:a,issues:[]},f);if(m instanceof Promise)throw new Ra;if(m.issues.length){const p=new((u==null?void 0:u.Err)??e)(m.issues.map(y=>oo(y,f,Pi())));throw CN(p,(u==null?void 0:u.callee)??n),p}return m.value};return n},ag=e=>{const n=async(r,a,o,u)=>{const f=o?{...o,async:!0}:{async:!0};let m=r._zod.run({value:a,issues:[]},f);if(m instanceof Promise&&(m=await m),m.issues.length){const p=new((u==null?void 0:u.Err)??e)(m.issues.map(y=>oo(y,f,Pi())));throw CN(p,(u==null?void 0:u.callee)??n),p}return m.value};return n},lg=e=>(n,r,a)=>{const o=a?{...a,async:!1}:{async:!1},u=n._zod.run({value:r,issues:[]},o);if(u instanceof Promise)throw new Ra;return u.issues.length?IN(e,u.issues,o):{success:!0,data:u.value}};function IN(e,n,r){let a;return{success:!1,get error(){return a||(a=new e(n.map(o=>oo(o,r,Pi()))),n=void 0,r=void 0),a},set error(o){a=o,n=void 0,r=void 0}}}const og=e=>async(n,r,a)=>{const o=a?{...a,async:!0}:{async:!0};let u=n._zod.run({value:r,issues:[]},o);return u instanceof Promise&&(u=await u),u.issues.length?IN(e,u.issues,o):{success:!0,data:u.value}},L8=Symbol.for("zod.compile.invalid"),P8=Symbol.for("zod.compile.fallback"),H8=((e,n,r)=>{const a=e._zod.bag.validator;if(a!==void 0){if(a(n)!==L8)return!0;if(a.definite===!0&&r===void 0)return!1}return q8(e,n,r)});function q8(e,n,r){const a=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;let u;if(o?(a[P8]=!0,u=o({value:n,issues:[]},a)):u=e._zod.run({value:n,issues:[]},a),u instanceof Promise)throw new Ra;return u.issues.length===0}const B8=async(e,n,r)=>{const a=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let o=e._zod.run({value:n,issues:[]},a);return o instanceof Promise&&(o=await o),o.issues.length===0},$8=e=>{const n=ig(e),r=(a,o,u,f)=>{const m=u?{...u,direction:"backward"}:{direction:"backward"};return n(a,o,m,xf(r,f))};return r},F8=e=>{const n=ig(e),r=(a,o,u,f)=>n(a,o,u,xf(r,f));return r},V8=e=>{const n=ag(e),r=async(a,o,u,f)=>{const m=u?{...u,direction:"backward"}:{direction:"backward"};return await n(a,o,m,xf(r,f))};return r},Z8=e=>{const n=ag(e),r=async(a,o,u,f)=>await n(a,o,u,xf(r,f));return r},G8=e=>(n,r,a)=>{const o=a?{...a,direction:"backward"}:{direction:"backward"};return lg(e)(n,r,o)},Q8=e=>(n,r,a)=>lg(e)(n,r,a),K8=e=>async(n,r,a)=>{const o=a?{...a,direction:"backward"}:{direction:"backward"};return og(e)(n,r,o)},Y8=e=>async(n,r,a)=>og(e)(n,r,a),J8=/^[cC][0-9a-z]{6,}$/,X8=/^[0-9a-z]+$/,W8=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,eD=/^[0-9a-vA-V]{20}$/,tD=/^[A-Za-z0-9]{27}$/,nD=/^[a-zA-Z0-9_-]{21}$/;function sD(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const rD=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,iD=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,_1=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,aD=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lD="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function oD(){return new RegExp(lD,"u")}const cD=/^(?:(?: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])$/,uD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,dD=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,fD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hD=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mD=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,pD=/^https?$/,gD=/^\+[1-9]\d{6,14}$/,LN="(?:(?:\\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])))";function bD(e){return new RegExp(`^${e}$`)}const xD=bD(LN);function fp(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${n}:[0-5]\\d(?:\\.\\d+)?`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yD(e){return new RegExp(`^${fp(e)}$`)}function vD(e){const n=["Z"];e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${fp({precision:e.precision,seconds:!0})}(?:${n.join("|")})`,a=e.local?`${r}|${fp({precision:e.precision})}`:r;return new RegExp(`^${LN}T(?:${a})$`)}const wD=/^[\s\S]{0,}$/,_D=/^-?\d+(?:\.\d+)?$/,SD=/^[^A-Z]*$/,ND=/^[^a-z]*$/,Xn=ie("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),cg=e=>{const n=e.value;return!i8(n)&&n.length!==void 0},Xd={number:"number",bigint:"bigint",object:"date"},PN=ie("$ZodCheckLessThan",(e,n)=>{Xn.init(e,n);const r=Xd[typeof n.value];e._zod.check=a=>{(n.inclusive?a.value<=n.value:a.value<n.value)||a.issues.push({origin:Xd[typeof a.value]??r,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:a.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),HN=ie("$ZodCheckGreaterThan",(e,n)=>{Xn.init(e,n);const r=Xd[typeof n.value];e._zod.check=a=>{(n.inclusive?a.value>=n.value:a.value>n.value)||a.issues.push({origin:Xd[typeof a.value]??r,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:a.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),jD=ie("$ZodCheckMultipleOf",(e,n)=>{Xn.init(e,n),e._zod.check=r=>{if(typeof r.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?n.value!==BigInt(0)&&r.value%n.value===BigInt(0):a8(r.value,n.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:n.value,input:r.value,inst:e,continue:!n.abort})}}),ED=ie("$ZodCheckNumberFormat",(e,n)=>{var f;Xn.init(e,n),n.format=n.format||"float64";const r=(f=n.format)==null?void 0:f.includes("int"),a=r?"int":"number",[o,u]=TN[n.format];e._zod.check=m=>{const p=m.value;if(r){if(!Number.isInteger(p)){m.issues.push({expected:a,format:n.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?m.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!n.abort}):m.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!n.abort});return}}p<o&&m.issues.push({origin:"number",input:p,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!n.abort}),p>u&&m.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!n.abort})}}),AD=ie("$ZodCheckMaxLength",(e,n)=>{var r;Xn.init(e,n),(r=e._zod.def).when??(r.when=cg),e._zod.check=a=>{const o=a.value,u=o.length;if((typeof o=="string"&&u>n.maximum?sg(o):u)<=n.maximum)return;const m=rg(o);a.issues.push({origin:m,code:"too_big",maximum:n.maximum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),CD=ie("$ZodCheckMinLength",(e,n)=>{var r;Xn.init(e,n),(r=e._zod.def).when??(r.when=cg),e._zod.check=a=>{const o=a.value,u=o.length;if((typeof o=="string"&&u>=n.minimum&&u<n.minimum*2?sg(o):u)>=n.minimum)return;const m=rg(o);a.issues.push({origin:m,code:"too_small",minimum:n.minimum,inclusive:!0,input:o,inst:e,continue:!n.abort})}}),OD=ie("$ZodCheckLengthEquals",(e,n)=>{var r;Xn.init(e,n),(r=e._zod.def).when??(r.when=cg),e._zod.check=a=>{const o=a.value,u=o.length,f=typeof o=="string"&&u>=n.length&&u<=n.length*2?sg(o):u;if(f===n.length)return;const m=rg(o),p=f>n.length;a.issues.push({origin:m,...p?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!n.abort})}}),yf=ie("$ZodCheckStringFormat",(e,n)=>{var r,a;Xn.init(e,n),n.pattern?(r=e._zod).check??(r.check=o=>{n.pattern.lastIndex=0,!n.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:n.format,input:o.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(a=e._zod).check??(a.check=()=>{})}),RD=ie("$ZodCheckRegex",(e,n)=>{yf.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),TD=ie("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=SD),yf.init(e,n)}),kD=ie("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=ND),yf.init(e,n)}),DD=ie("$ZodCheckIncludes",(e,n)=>{Xn.init(e,n);const r=gf(n.includes),a=new RegExp(typeof n.position=="number"?`^.{${n.position},}${r}`:r);n.pattern=a,e._zod.check=o=>{o.value.includes(n.includes,n.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:o.value,inst:e,continue:!n.abort})}}),MD=ie("$ZodCheckStartsWith",(e,n)=>{Xn.init(e,n);const r=new RegExp(`^${gf(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.check=a=>{a.value.startsWith(n.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:a.value,inst:e,continue:!n.abort})}}),zD=ie("$ZodCheckEndsWith",(e,n)=>{Xn.init(e,n);const r=new RegExp(`.*${gf(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.check=a=>{a.value.endsWith(n.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:a.value,inst:e,continue:!n.abort})}}),UD=ie("$ZodCheckOverwrite",(e,n)=>{Xn.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class ID{constructor(n=[],r={}){this.content=[],this.indent=0,this.args=n,this.closed=r}indented(n){this.indent+=1;try{n(this)}finally{this.indent-=1}}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const a=n.split(`
`).filter(f=>f),o=Math.min(...a.map(f=>f.length-f.trimStart().length)),u=a.map(f=>f.slice(o)).map(f=>" ".repeat(this.indent*2)+f);for(const f of u)this.content.push(f)}compile(){const n=Function,r=(this==null?void 0:this.content)??[""];return new n(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
${r.join(`
`)}
};`)(...Object.values(this.closed))}}const LD={major:4,minor:6,patch:2},Wt=ie("$ZodType",(e,n)=>{var u;var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=LD;const a=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...a??[]]:a!=null&&a.length?[...a]:[];for(const f of o)for(const m of f._zod.onattach)m(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),(u=e._zod.deferred)==null||u.push(()=>{e._zod.run=e._zod.parse});else{const f=(p,y,g)=>{if(p.memo)return p;let b=Vr(p),v;for(const S of y){if(S._zod.def.when){if(v8(p)||!S._zod.def.when(p))continue}else if(b)continue;const A=p.issues.length,C=S._zod.check(p);if(C instanceof Promise&&(g==null?void 0:g.async)===!1)throw new Ra;if(v||C instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await C,p.issues.length!==A&&(b1(p.issues,A,e),b||(b=Vr(p,A)))});else{if(p.issues.length===A)continue;b1(p.issues,A,e),b||(b=Vr(p,A))}}return v?v.then(()=>p):p},m=(p,y,g)=>{if(Vr(p))return p.aborted=!0,p;const b=f(y,o,g);if(b instanceof Promise){if(g.async===!1)throw new Ra;return b.then(v=>e._zod.parse(v,g))}return e._zod.parse(b,g)};e._zod.run=(p,y)=>{if(y.skipChecks)return e._zod.parse(p,y);if(y.direction==="backward"){const b=e._zod.parse({value:p.value,issues:[]},{...y,skipChecks:!0});return b instanceof Promise?b.then(v=>m(v,p,y)):m(b,p,y)}const g=e._zod.parse(p,y);if(g instanceof Promise){if(y.async===!1)throw new Ra;return g.then(b=>f(b,o,y))}return f(g,o,y)}}},{get"~standard"(){return MN(this,"~standard",BN(this))},set"~standard"(e){Ii(this,"~standard",e)}}),qN=(e,n)=>e.issues.length?{issues:e.issues.map(r=>oo(r,n,Pi()))}:{value:e.value};async function PD(e,n){const r={async:!0};return qN(await e._zod.run({value:n,issues:[]},r),r)}function BN(e){return{validate:n=>{const r={async:!1};try{const a=e._zod.run({value:n,issues:[]},r);if(!(a instanceof Promise))return qN(a,r)}catch{}return PD(e,n)},vendor:"zod",version:1}}const ug=ie("$ZodString",(e,n)=>{Wt.init(e,n),e._zod.pattern=n.pattern??wD,e._zod.parse=(r,a)=>{if(n.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Rt=ie("$ZodStringFormat",(e,n)=>{yf.init(e,n),ug.init(e,n)}),HD=ie("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=iD),Rt.init(e,n)}),qD=ie("$ZodUUID",(e,n)=>{if(n.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(a===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=_1(a))}else n.pattern??(n.pattern=_1());Rt.init(e,n)}),BD=ie("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=aD),Rt.init(e,n)}),$N=1,FN=2;function $D(e,n){var r;if(!n.normalize&&((r=n.protocol)==null?void 0:r.source)===pD.source&&!/^https?:\/\//i.test(e))return $N;try{return new URL(e)}catch{return FN}}const FD=/[\t\n\r]/g;function VD(e){return e.replace(FD,"")}function ZD(e,n){return n.lastIndex=0,n.test(e.hostname)}function GD(e,n){return n.lastIndex=0,n.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const QD=ie("$ZodURL",(e,n)=>{Rt.init(e,n),e._zod.check=r=>{try{const a=r.value.trim(),o=$D(a,n);if(o===$N){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!n.abort});return}if(o===FN){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort});return}n.hostname&&!ZD(o,n.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:r.value,inst:e,continue:!n.abort}),n.protocol&&!GD(o,n.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort}),r.value=n.normalize?o.href:VD(a);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),KD=ie("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=oD()),Rt.init(e,n)}),YD=ie("$ZodNanoID",(e,n)=>{if(n.length!==void 0&&(!Number.isInteger(n.length)||n.length<1))throw new Error(`Invalid nanoid length: ${n.length}`);n.pattern??(n.pattern=n.length===void 0?nD:sD(n.length)),Rt.init(e,n)}),JD=ie("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=J8),Rt.init(e,n)}),XD=ie("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=X8),Rt.init(e,n)}),WD=ie("$ZodULID",(e,n)=>{n.pattern??(n.pattern=W8),Rt.init(e,n)}),eM=ie("$ZodXID",(e,n)=>{n.pattern??(n.pattern=eD),Rt.init(e,n)}),tM=ie("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=tD),Rt.init(e,n)}),nM=ie("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=vD(n)),Rt.init(e,n)}),sM=ie("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=xD),Rt.init(e,n)}),rM=ie("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=yD(n)),Rt.init(e,n)}),iM=ie("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=rD),Rt.init(e,n)}),aM=ie("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=cD),Rt.init(e,n)}),lM=/^[0-9a-fA-F:.]+$/;function VN(e){if(!lM.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}const oM=ie("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=uD),Rt.init(e,n),e._zod.check=r=>{VN(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}),cM=ie("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=dD),Rt.init(e,n)});function uM(e){const n=e.split("/");if(n.length!==2)return!1;const[r,a]=n;if(!a)return!1;const o=Number(a);return`${o}`!==a||o<0||o>128?!1:VN(r)}const dM=ie("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=fD),Rt.init(e,n),e._zod.check=r=>{uM(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}});function ZN(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const GN=/^[0-9a-zA-Z+/]*={0,2}$/,fM=ie("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=GN),Rt.init(e,n),e._zod.check=r=>{ZN(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}}),dg=/^[A-Za-z0-9_-]*$/;function hM(e){if(!dg.test(e))return!1;const n=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return ZN(r)}const mM=ie("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=dg),Rt.init(e,n),e._zod.check=r=>{hM(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),pM=ie("$ZodE164",(e,n)=>{n.pattern??(n.pattern=gD),Rt.init(e,n)});function gM(e,n=null){try{const r=e.split(".");if(r.length!==3)return!1;const[a]=r;if(!a)return!1;const o=JSON.parse(atob(a));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||n&&(!("alg"in o)||o.alg!==n))}catch{return!1}}const bM=ie("$ZodJWT",(e,n)=>{Rt.init(e,n),e._zod.check=r=>{gM(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),QN=ie("$ZodNumber",(e,n)=>{Wt.init(e,n),e._zod.pattern=_D,e._zod.parse=(r,a)=>{if(n.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const u=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...u?{received:u}:{}}),r}}),xM=ie("$ZodNumberFormat",(e,n)=>{ED.init(e,n),QN.init(e,n)}),yM=ie("$ZodUnknown",(e,n)=>{Wt.init(e,n),e._zod.parse=r=>r}),vM=ie("$ZodNever",(e,n)=>{Wt.init(e,n),e._zod.parse=(r,a)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function S1(e,n,r){e.issues.length&&n.issues.push(...DN(r,e.issues)),n.value[r]=e.value}const wM=ie("$ZodArray",(e,n)=>{Wt.init(e,n);const r=_r.memoizer;r==null||r.attach(e),e._zod.parse=(a,o)=>{const u=a.value;if(!Array.isArray(u))return a.issues.push({expected:"array",code:"invalid_type",input:u,inst:e}),a;a.value=r?r.alloc(e,a,Array(u.length),o):Array(u.length);const f=[],m=o==null?void 0:o.abortEarly;for(let p=0;p<u.length;p++){const y=u[p],g=n.element._zod.run({value:y,issues:[]},o);if(g instanceof Promise)f.push(g.then(b=>S1(b,a,p)));else if(S1(g,a,p),m&&g.issues.length!==0&&Vr(g))break}return f.length?Promise.all(f).then(()=>a):a}});function Wd(e,n,r,a,o,u){const f=r in a,m=u==="optional";if(!(!f&&m&&o==="optional")){if(e.issues.length){if(o!==void 0&&m&&!f)return;n.issues.push(...DN(r,e.issues))}if(!f&&o===void 0){e.issues.length||n.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(f||o==="defaulted"&&!m)&&(n.value[r]=void 0):n.value[r]=e.value}}const _M=[];function KN(e){var f,m,p,y;const n=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),a=r.length?r:_M,o=a.length?[...n,...a]:n;for(const g of o)if(!((y=(p=(m=(f=e.shape)==null?void 0:f[g])==null?void 0:m._zod)==null?void 0:p.traits)!=null&&y.has("$ZodType")))throw new Error(`Invalid element at key "${String(g)}": expected a Zod schema`);const u=f8(e.shape);return{...e,allKeys:o,symbolKeys:a,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(u)}}function YN(e,n,r,a,o,u,f){const m=[],p=o.keySet,y=o.catchall._zod,g=y.def.type,b=y.optin,v=y.optout;let S=0;for(const A in n){if(f&&r.issues.length!==S){if(Vr(r,S))break;S=r.issues.length}if(p.has(A))continue;if(A==="__proto__"){g==="never"&&m.push(A);continue}if(g==="never"){m.push(A);continue}const C=y.run({value:n[A],issues:[]},a);C instanceof Promise?e.push(C.then(O=>Wd(O,r,A,n,b,v))):Wd(C,r,A,n,b,v)}return m.length&&r.issues.push({code:"unrecognized_keys",keys:m,input:n,inst:u,continue:!0}),e.length?Promise.all(e).then(()=>r):r}const SM=ie("$ZodObject",(e,n)=>{Wt.init(e,n);const r=Object.getOwnPropertyDescriptor(n,"shape"),a=r!=null&&r.get?r.get.raw:n.shape??{};if(a){const y=()=>{const g={...a};return Object.defineProperty(n,"shape",{value:g}),y.raw=g,g};y.raw=a,Object.defineProperty(n,"shape",{get:y})}const o=tg(()=>KN(n));yt(e,"propValues",y=>{const g=y.def.shape,b={};for(const v in g){const S=g[v]._zod;if(S.values){Object.prototype.hasOwnProperty.call(b,v)||Ha(b,v,new Set);for(const A of S.values)b[v].add(A);S.optin!==void 0&&b[v].add(void 0)}}return b});const u=Jd,f=n.catchall;let m;const p=_r.memoizer;p==null||p.attach(e),e._zod.parse=(y,g)=>{m??(m=o.value);const b=y.value;if(!u(b))return y.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),y;y.value=p?p.alloc(e,y,{},g):{};const v=[],S=m.shape,A=g==null?void 0:g.abortEarly;let C=y.issues.length;for(const O of m.allKeys){if(A&&y.issues.length!==C){if(Vr(y,C))break;C=y.issues.length}if(O==="__proto__")continue;const N=S[O],j=N._zod.optin,F=N._zod.optout,q=N._zod.run({value:b[O],issues:[]},g);q instanceof Promise?v.push(q.then(B=>Wd(B,y,O,b,j,F))):Wd(q,y,O,b,j,F)}return f?YN(v,b,y,g,o.value,e,A===!0):v.length?Promise.all(v).then(()=>y):y}}),NM=ie("$ZodObjectJIT",(e,n)=>{SM.init(e,n);const r=e._zod.parse,a=tg(()=>KN(n)),o=_r.memoizer,u=S=>{var B,re;const A=a.value,C=A.symbolKeys,O=new ID(["payload","ctx"],{shape:S,inst:e,memo:o,syms:C}),N=Q=>`shape[${Q}]._zod.run({ value: input[${Q}], issues: [] }, ctx)`,j=(Q,X)=>`
let ${Q}_ab = false;
for (let i = 0; i < ${Q}.issues.length; i++) {
const iss = ${Q}.issues[i];
iss.path = iss.path ? [${X}, ...iss.path] : [${X}];
payload.issues.push(iss);
if (iss.continue !== true) ${Q}_ab = true;
}
if (${Q}_ab && ctx && ctx.abortEarly) {
payload.value = newResult;
return payload;
}`;O.write("const input = payload.value;");const F=Object.create(null);let q=0;for(const Q of A.allKeys)F[Q]=`key_${q++}`;O.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const Q of A.allKeys){if(Q==="__proto__")continue;const X=F[Q],se=typeof Q=="symbol"?`syms[${C.indexOf(Q)}]`:o8(Q),fe=`${se} in input`,we=S[Q],Ce=(B=we==null?void 0:we._zod)==null?void 0:B.optin,Z=Ce!==void 0,W=((re=we==null?void 0:we._zod)==null?void 0:re.optout)==="optional";if(O.write(`const ${X} = ${N(se)};`),Z&&W){const oe=Ce==="optional"?`${X}_present`:`${X}.value !== undefined || ${X}_present`;O.write(`
const ${X}_present = ${fe};
if (!${X}.issues.length || ${X}_present) {
if (${X}.issues.length) {${j(X,se)}
}
if (${oe}) {
newResult[${se}] = ${X}.value;
}
}
`)}else Z?(O.write(`
if (${X}.issues.length) {${j(X,se)}
}
`),Ce==="defaulted"?O.write(`newResult[${se}] = ${X}.value;`):O.write(`
if (${X}.value !== undefined || ${fe}) {
newResult[${se}] = ${X}.value;
}
`)):O.write(`
const ${X}_present = ${fe};
if (${X}.issues.length) {${j(X,se)}
}
if (!${X}_present && !${X}.issues.length) {
payload.issues.push({
code: "invalid_type",
expected: "nonoptional",
input: undefined,
path: [${se}]
});
if (ctx && ctx.abortEarly) {
payload.value = newResult;
return payload;
}
}
if (${X}_present) {
newResult[${se}] = ${X}.value;
}
`)}return O.write("payload.value = newResult;"),O.write("return payload;"),O.compile()};let f;const m=Jd,p=!_r.jitless,g=p&&u8.value,b=n.catchall;let v;e._zod.parse=(S,A)=>{v??(v=a.value);const C=S.value;return m(C)?p&&g&&(A==null?void 0:A.async)===!1&&A.jitless!==!0?(f||(f=u(n.shape)),S=f(S,A),b?YN([],C,S,A,v,e,(A==null?void 0:A.abortEarly)===!0):S):r(S,A):(S.issues.push({expected:"object",code:"invalid_type",input:C,inst:e}),S)}});function N1(e,n,r,a){for(const u of e)if(u.issues.length===0)return n.value=u.value,n;const o=e.filter(u=>!Vr(u));return o.length===1?(n.value=o[0].value,o[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(u=>u.issues.map(f=>oo(f,a,Pi())))}),n)}const jM=ie("$ZodUnion",(e,n)=>{Wt.init(e,n),yt(e,"optin",a=>a.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":a.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),yt(e,"optout",a=>a.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),yt(e,"values",a=>{if(a.def.options.every(o=>o._zod.values))return new Set(a.def.options.flatMap(o=>Array.from(o._zod.values)))}),yt(e,"pattern",a=>{if(a.def.options.every(o=>o._zod.pattern)){const o=a.def.options.map(u=>u._zod.pattern);return new RegExp(`^(${o.map(u=>ng(u.source)).join("|")})$`)}});const r=n.options.length===1?n.options[0]._zod.run:null;e._zod.parse=(a,o)=>{if(r)return r(a,o);let u=!1;const f=[];for(const m of n.options){const p=m._zod.run({value:a.value,issues:[]},o);if(p instanceof Promise)f.push(p),u=!0;else{if(p.issues.length===0)return p;f.push(p)}}return u?Promise.all(f).then(m=>N1(m,a,e,o)):N1(f,a,e,o)}}),EM=ie("$ZodIntersection",(e,n)=>{Wt.init(e,n),e._zod.parse=(r,a)=>{const o=r.value,u=n.left._zod.run({value:o,issues:[]},a),f=n.right._zod.run({value:o,issues:[]},a);return u instanceof Promise||f instanceof Promise?Promise.all([u,f]).then(([p,y])=>j1(r,p,y)):j1(r,u,f)}});function hp(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Ac(e)&&Ac(n)){const r=Object.keys(n),a=Object.keys(e).filter(u=>r.indexOf(u)!==-1),o={...e,...n};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const u of a){if(u==="__proto__")continue;const f=hp(e[u],n[u]);if(!f.valid)return{valid:!1,mergeErrorPath:[u,...f.mergeErrorPath]};o[u]=f.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let a=0;a<e.length;a++){const o=e[a],u=n[a],f=hp(o,u);if(!f.valid)return{valid:!1,mergeErrorPath:[a,...f.mergeErrorPath]};r.push(f.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function j1(e,n,r){const a=new Map;let o;const u=new Map,f=(y,g)=>{var v,S;let b;if(y.code==="unrecognized_keys"&&!((v=y.path)!=null&&v.length))o??(o=y),b=y.keys;else if(y.code==="invalid_key"&&y.origin==="record"&&((S=y.path)==null?void 0:S.length)===1){const A=String(y.path[0]);u.has(A)||u.set(A,y),b=[A]}else return!1;for(const A of b)a.has(A)||a.set(A,{}),a.get(A)[g]=!0;return!0};for(const y of n.issues)f(y,"l")||e.issues.push(y);for(const y of r.issues)f(y,"r")||e.issues.push(y);const m=[...a].filter(([,y])=>y.l&&y.r).map(([y])=>y);if(m.length){const y=o?m.filter(g=>o.keys.includes(g)):[];y.length&&e.issues.push({...o,keys:y});for(const g of m)!y.includes(g)&&u.has(g)&&e.issues.push(u.get(g))}const p=hp(n.value,r.value);if(!p.valid){if(Vr(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(p.mergeErrorPath)}`)}return e.value=p.data,e}const AM=ie("$ZodEnum",(e,n)=>{Wt.init(e,n);const r=up(n.entries),a=new Set(r);e._zod.values=a,yt(e,"pattern",o=>{const u=up(o.def.entries).filter(f=>d8.has(typeof f));return new RegExp(u.length?`^(${u.map(f=>gf(f.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,u)=>{const f=o.value;return a.has(f)||o.issues.push({code:"invalid_value",values:r,input:f,inst:e}),o}}),CM=ie("$ZodTransform",(e,n)=>{var r;Wt.init(e,n),e._zod.optin="optional",(r=_r.memoizer)==null||r.guard(e),e._zod.parse=(a,o)=>{if(o.direction==="backward")throw new UN(e.constructor.name);const u=n.transform(a.value,a);if(o.async)return(u instanceof Promise?u:Promise.resolve(u)).then(m=>(a.value=m,a));if(u instanceof Promise)throw new Ra;return a.value=u,a}});function E1(e,n){return e.value=n.issues.length?void 0:n.value,e}const JN=ie("$ZodOptional",(e,n)=>{Wt.init(e,n),yt(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",yt(e,"values",r=>{const a=r.def.innerType._zod.values;return a?new Set([...a,void 0]):void 0}),yt(e,"pattern",r=>{const a=r.def.innerType._zod.pattern;return a?new RegExp(`^(${ng(a.source)})?$`):void 0}),e._zod.parse=(r,a)=>{if(r.value===void 0){if(n.innerType._zod.optin!=="defaulted")return r;const o=n.innerType._zod.run({value:r.value,issues:[]},a);return o instanceof Promise?o.then(u=>E1(r,u)):E1(r,o)}return n.innerType._zod.run(r,a)}}),OM=ie("$ZodExactOptional",(e,n)=>{JN.init(e,n),yt(e,"values",r=>r.def.innerType._zod.values),yt(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,a)=>n.innerType._zod.run(r,a)}),RM=ie("$ZodNullable",(e,n)=>{Wt.init(e,n),yt(e,"optin",r=>r.def.innerType._zod.optin),yt(e,"optout",r=>r.def.innerType._zod.optout),yt(e,"pattern",r=>{const a=r.def.innerType._zod.pattern;return a?new RegExp(`^(${ng(a.source)}|null)$`):void 0}),yt(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,a)=>r.value===null?r:n.innerType._zod.run(r,a)}),TM=ie("$ZodDefault",(e,n)=>{Wt.init(e,n),e._zod.optin="defaulted",yt(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,a)=>{if(a.direction==="backward")return n.innerType._zod.run(r,a);if(r.value===void 0)return r.value=n.defaultValue,r;const o=n.innerType._zod.run(r,a);return o instanceof Promise?o.then(u=>A1(u,n)):A1(o,n)}});function A1(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const kM=ie("$ZodPrefault",(e,n)=>{Wt.init(e,n),e._zod.optin="defaulted",yt(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,a)=>(a.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,a))}),DM=ie("$ZodNonOptional",(e,n)=>{Wt.init(e,n),yt(e,"values",r=>{const a=r.def.innerType._zod.values;return a?new Set([...a].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,a)=>{const o=n.innerType._zod.run(r,a);return o instanceof Promise?o.then(u=>C1(u,e)):C1(o,e)}});function C1(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}function O1(e,n,r,a){return n.issues.length?(e.value=r.catchValue({...n,value:e.value,error:{issues:n.issues.map(o=>oo(o,a,Pi()))},input:e.value}),e):(e.value=n.value,n.memo&&(e.memo=!0),e)}const MM=ie("$ZodCatch",(e,n)=>{Wt.init(e,n),yt(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),yt(e,"optout",r=>r.def.innerType._zod.optout),yt(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,a)=>{if(a.direction==="backward")return n.innerType._zod.run(r,a);const o=n.innerType._zod.run({value:r.value,issues:[]},a);return o instanceof Promise?o.then(u=>O1(r,u,n,a)):O1(r,o,n,a)}}),zM=ie("$ZodPipe",(e,n)=>{Wt.init(e,n),yt(e,"values",r=>r.def.in._zod.values),yt(e,"optin",r=>r.def.in._zod.optin),yt(e,"optout",r=>r.def.out._zod.optout),yt(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,a)=>{if(a.direction==="backward"){const u=n.out._zod.run(r,a);return u instanceof Promise?u.then(f=>Nd(f,n.in,a)):Nd(u,n.in,a)}const o=n.in._zod.run(r,a);return o instanceof Promise?o.then(u=>Nd(u,n.out,a)):Nd(o,n.out,a)}});function Nd(e,n,r){return e.issues.some(a=>a.code!=="unrecognized_keys")?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},r)}const UM=ie("$ZodReadonly",(e,n)=>{Wt.init(e,n),yt(e,"propValues",r=>r.def.innerType._zod.propValues),yt(e,"values",r=>r.def.innerType._zod.values),yt(e,"optin",r=>{var a,o;return(o=(a=r.def.innerType)==null?void 0:a._zod)==null?void 0:o.optin}),yt(e,"optout",r=>{var a,o;return(o=(a=r.def.innerType)==null?void 0:a._zod)==null?void 0:o.optout}),e._zod.parse=(r,a)=>{if(a.direction==="backward")return n.innerType._zod.run(r,a);const o=n.innerType._zod.run(r,a);return o instanceof Promise?o.then(R1):R1(o)}});function R1(e){return e.memo||(e.value=Object.freeze(e.value)),e}const IM=ie("$ZodCustom",(e,n)=>{Xn.init(e,n),Wt.init(e,n),e._zod.parse=(r,a)=>r,e._zod.check=r=>{const a=r.value,o=n.fn(a);if(o instanceof Promise)return o.then(u=>T1(u,r,a,e));T1(o,r,a,e)}});function T1(e,n,r,a){if(!e){const o={code:"custom",input:r,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(o.params=a._zod.def.params),n.issues.push(Cc(o))}}class LM extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const mp="~memo",k1=[];function XN(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function E0(e){return e.map(n=>n.path?{...n,path:n.path.slice()}:{...n})}const WN=new WeakMap,xc=0,qd=1,wc=2;function Bd(e,n,r){const a=WN.get(e);if(a!==void 0)return a?wc:xc;if(n.has(e))return wc;n.add(e);let o=xc;const u=g=>{if(o!==wc&&(g!=null&&g._zod)){const b=Bd(g,n);b>o&&(o=b)}},f=(g,b)=>{var S;let v=xc;for(const A of Reflect.ownKeys(g)){const C=Object.getOwnPropertyDescriptor(g,A);if(b&&!C.enumerable)continue;const O=C.get?qd:(S=C.value)!=null&&S._zod?Bd(C.value,n):xc;O>v&&(v=O)}return v},m=g=>{g>o&&(o=g)},p=e._zod.def;switch(p.type){case"object":{const g=jN(p);m(g?f(g,!0):qd),u(p.catchall);break}case"properties":m(f(p.shape,!1));break;case"array":u(p.element);break;case"tuple":for(const g of p.items)u(g);u(p.rest);break;case"record":case"map":u(p.keyType),u(p.valueType);break;case"set":u(p.valueType);break;case"union":for(const g of p.options)u(g);break;case"intersection":u(p.left),u(p.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":u(p.innerType);break;case"pipe":u(p.in),u(p.out);break;case"function":u(p.input),u(p.output);break;case"lazy":{const g=p._cachedInner??void 0;m(g?Bd(g,n):qd);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const g in p){const b=Object.getOwnPropertyDescriptor(p,g);if(!b||b.get)continue;const v=b.value;if(!(!v||typeof v!="object")){if(v._zod)u(v);else if(Array.isArray(v))for(const S of v)u(S)}}}return n.delete(e),PM(e,o)}function PM(e,n){return n!==qd&&WN.set(e,n===wc),n}function HM(e,n){let r=e.buckets.get(n);return r||(r=new WeakMap,e.buckets.set(n,r)),r}let jd;const Ed=[],qM={alloc(e,n,r){const a=jd;if(!a)return r;jd=void 0;const o={value:r,issues:null};return a.set(n.value,o),Ed.push(o),r},guard(e){var n;(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred.push(()=>{const r=e._zod.parse,a=(o,u)=>{if(u.direction!=="backward"&&$M(u,o.value))throw new LM;return r(o,u)};e._zod.parse=a,e._zod.run===r&&(e._zod.run=a)})},attach(e){var n;let r,a=!1,o,u;(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred.push(()=>{const f=e._zod.parse,m=(p,y)=>{if(r===void 0){const N=Bd(e,new Set);if(N===xc)return e._zod.parse=f,e._zod.run===m&&(e._zod.run=f),f(p,y);N===wc||a?r=!0:a=!0}const g=p.value;if(!XN(g))return f(p,y);let b=y[mp];b||(b={buckets:new WeakMap,backEdges:void 0},y[mp]=b);let v;o===y?v=u:(v=HM(b,e),o=y,u=v);const S=v.get(g);if(S)return p.value=S.value,S.issues?S.issues.length&&p.issues.push(...E0(S.issues)):(p.memo=!0,b.backEdges??(b.backEdges=new WeakSet),b.backEdges.add(S.value)),p;jd=v;const A=Ed.length,C=f(p,y);jd=void 0;const O=Ed.length>A?Ed.pop():void 0;return C instanceof Promise?C.then(N=>(O&&(O.issues=N.issues.length?E0(N.issues):k1),N)):(O&&(O.issues=C.issues.length?E0(C.issues):k1),C)};e._zod.parse=m,e._zod.run===f&&(e._zod.run=m)})}};function BM(){return qM}function $M(e,n){var a;const r=(a=e[mp])==null?void 0:a.backEdges;return r!==void 0&&XN(n)&&r.has(n)}const FM=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function n(u){return e[u]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},a={nan:"NaN"};function o(u,f){return u==="number"&&typeof f=="number"&&!Number.isFinite(f)?String(f):a[u]??u}return u=>{switch(u.code){case"invalid_type":{const f=o(u.expected),m=_8(u.input),p=o(m,u.input);return`Invalid input: expected ${f}, received ${p}`}case"invalid_value":return u.values.length===1?`Invalid input: expected ${RN(u.values[0])}`:`Invalid option: expected one of ${p1(u.values,"|")}`;case"too_big":{const f=u.exact?"exactly ":u.inclusive?"<=":"<",m=n(u.origin);return m?`Too big: expected ${u.origin??"value"} to have ${f}${u.maximum.toString()} ${m.unit??"elements"}`:`Too big: expected ${u.origin??"value"} to be ${f}${u.maximum.toString()}`}case"too_small":{const f=u.exact?"exactly ":u.inclusive?">=":">",m=n(u.origin);return m?`Too small: expected ${u.origin} to have ${f}${u.minimum.toString()} ${m.unit}`:`Too small: expected ${u.origin} to be ${f}${u.minimum.toString()}`}case"invalid_format":{const f=u;return f.format==="starts_with"?`Invalid string: must start with "${f.prefix}"`:f.format==="ends_with"?`Invalid string: must end with "${f.suffix}"`:f.format==="includes"?`Invalid string: must include "${f.includes}"`:f.format==="regex"?`Invalid string: must match pattern ${f.pattern}`:`Invalid ${r[f.format]??u.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${u.divisor}`;case"unrecognized_keys":return`Unrecognized key${u.keys.length>1?"s":""}: ${p1(u.keys,", ")}`;case"invalid_key":return`Invalid key in ${u.origin}`;case"invalid_union":return u.options&&Array.isArray(u.options)&&u.options.length>0?`Invalid discriminator value. Expected ${u.options.map(m=>`'${m}'`).join(" | ")}`:u.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${u.origin}`;default:return"Invalid input"}}};function VM(){return{localeError:FM()}}var D1;class ZM{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){const a=r[0];return this._map.set(n,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){const r=n._zod.parent;if(r){const a={...this.get(r)??{}};delete a.id;const o={...a,...this._map.get(n)};return Object.keys(o).length?o:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function GM(){return new ZM}(D1=globalThis).__zod_globalRegistry??(D1.__zod_globalRegistry=GM());const yc=globalThis.__zod_globalRegistry;function QM(e,n){return new e({type:"string",...Ie(n)})}function KM(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ie(n)})}function YM(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ie(n)})}function JM(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ie(n)})}function XM(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ie(n)})}function WM(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ie(n)})}function e6(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ie(n)})}function t6(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ie(n)})}function n6(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ie(n)})}function s6(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ie(n)})}function r6(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ie(n)})}function i6(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ie(n)})}function a6(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ie(n)})}function l6(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ie(n)})}function o6(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ie(n)})}function c6(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ie(n)})}function u6(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ie(n)})}function d6(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ie(n)})}function f6(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ie(n)})}function h6(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ie(n)})}function m6(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ie(n)})}function p6(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ie(n)})}function g6(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ie(n)})}function b6(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ie(n)})}function x6(e,n){return new e({type:"string",format:"date",check:"string_format",...Ie(n)})}function y6(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ie(n)})}function v6(e,n){return new e({type:"string",format:"duration",check:"string_format",...Ie(n)})}function w6(e,n){return new e({type:"number",coerce:!0,checks:[],...Ie(n)})}function _6(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ie(n)})}function S6(e){return new e({type:"unknown"})}function N6(e,n){return new e({type:"never",...Ie(n)})}function M1(e,n){return new PN({check:"less_than",...Ie(n),value:e,inclusive:!1})}function A0(e,n){return new PN({check:"less_than",...Ie(n),value:e,inclusive:!0})}function z1(e,n){return new HN({check:"greater_than",...Ie(n),value:e,inclusive:!1})}function C0(e,n){return new HN({check:"greater_than",...Ie(n),value:e,inclusive:!0})}function U1(e,n){return new jD({check:"multiple_of",...Ie(n),value:e})}function ej(e,n){return new AD({check:"max_length",...Ie(n),maximum:e})}function ef(e,n){return new CD({check:"min_length",...Ie(n),minimum:e})}function tj(e,n){return new OD({check:"length_equals",...Ie(n),length:e})}function j6(e,n){return new RD({check:"string_format",format:"regex",...Ie(n),pattern:e})}function E6(e){return new TD({check:"string_format",format:"lowercase",...Ie(e)})}function A6(e){return new kD({check:"string_format",format:"uppercase",...Ie(e)})}function C6(e,n){return new DD({check:"string_format",format:"includes",...Ie(n),includes:e})}function O6(e,n){return new MD({check:"string_format",format:"starts_with",...Ie(n),prefix:e})}function R6(e,n){return new zD({check:"string_format",format:"ends_with",...Ie(n),suffix:e})}function co(e){return new UD({check:"overwrite",tx:e})}function T6(e){return co(n=>n.normalize(e))}function k6(){return co(e=>e.trim())}function D6(){return co(e=>e.toLowerCase())}function M6(){return co(e=>e.toUpperCase())}function z6(){return co(e=>c8(e))}function U6(e,n,r){return new e({type:"array",element:n,...Ie(r)})}function I6(e,n,r){return new e({type:"custom",check:"custom",fn:n,...Ie(r)})}function L6(e,n){const r=P6(a=>(a.addIssue=o=>{if(typeof o=="string")a.issues.push(Cc(o,a.value,r._zod.def));else{const u=o;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),"input"in u||(u.input=a.value),u.inst??(u.inst=r),u.continue??(u.continue=!r._zod.def.abort),a.issues.push(Cc(u))}},e(a.value,a)),n);return r}function P6(e,n){const r=new Xn({check:"custom",...Ie(n)});return r._zod.check=e,r}function _c(e,...n){for(const r of n)for(const a of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,a)&&Ha(e,a,r[a]);return e}function nj(e){let n=(e==null?void 0:e.target)??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??yc,target:n,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",intersections:[],deferred:[],external:(e==null?void 0:e.external)??void 0}}function uo(e,n,r,a,o){const u=typeof n.unrepresentable=="function"?n.unrepresentable({zodSchema:e,path:a.path,message:o}):n.unrepresentable;if(u==="any")return!1;if(u===void 0||u==="throw")throw new Error(o);return Object.assign(r,u),!0}function _n(e,n,r={path:[],schemaPath:[]}){var g,b;var a;const o=e._zod.def,u=n.seen.get(e);if(u)return u.count++,r.schemaPath.includes(e)&&(u.cycle=r.path),u.schema;const f={schema:{},count:1,cycle:void 0,path:r.path};n.seen.set(e,f),n.sharedDefsExtractedFor=void 0,n.sharedEmitDoneFor=void 0;const m=(b=(g=e._zod).toJSONSchema)==null?void 0:b.call(g);if(m)f.schema=m;else{const v={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,f.schema,v);else{const A=f.schema,C=n.processors[o.type];if(!C)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);C(e,n,A,v)}const S=e._zod.parent;S&&(f.ref||(f.ref=S),_n(S,n,v),n.seen.get(S).isParent=!0)}const p=n.metadataRegistry.get(e);return p&&_c(f.schema,p),n.io==="input"&&Un(e)&&(delete f.schema.examples,delete f.schema.default),n.io==="input"&&"_prefault"in f.schema&&((a=f.schema).default??(a.default=f.schema._prefault)),delete f.schema._prefault,n.seen.get(e).schema}function I1(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function sj(e,n){var f,m,p,y;const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const a=new Map;for(const g of e.seen.entries()){const b=(f=e.metadataRegistry.get(g[0]))==null?void 0:f.id;if(b){const v=a.get(b);if(v&&v!==g[0])throw new Error(`Duplicate schema id "${b}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(b,g[0])}}const o=g=>{var C;const b=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const O=(C=e.external.registry.get(g[0]))==null?void 0:C.id,N=e.external.uri??(F=>F);if(O)return{ref:N(O)};const j=g[1].defId??g[1].schema.id??`schema${e.counter++}`;return g[1].defId=j,{defId:j,ref:`${N("__shared")}#/${b}/${I1(j)}`}}const v="#",S=`${v}/${b}/`;if(g[1]===r&&!g[1].schema.id)return{ref:v};const A=g[1].schema.id??`__schema${e.counter++}`;return{defId:A,ref:S+I1(A)}},u=g=>{if(g[1].schema.$ref)return;const b=g[1],{ref:v,defId:S}=o(g);b.def={...b.schema},S&&(b.defId=S);const A=b.schema;for(const C in A)delete A[C];A.$ref=v};if(e.cycles==="throw")for(const g of e.seen.entries()){const b=g[1];if(b.cycle)throw new Error(`Cycle detected: #/${(m=b.cycle)==null?void 0:m.join("/")}/<root>
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const g of e.seen.entries()){const b=g[1];if(n===g[0]){u(g);continue}if(e.external){const S=(p=e.external.registry.get(g[0]))==null?void 0:p.id;if(n!==g[0]&&S){u(g);continue}}if((y=e.metadataRegistry.get(g[0]))==null?void 0:y.id){u(g);continue}if(b.cycle){u(g);continue}b.count>1&&e.reused==="ref"&&u(g)}e.external&&(e.sharedDefsExtractedFor=e.external)}function rj(e){const n=e.anyOf;if(!Array.isArray(n)||n.length===0||e.type!==void 0)return;const r=[];for(const a of n){if(!a||typeof a!="object")return;rj(a);const o=Object.keys(a);if(o.length!==1||o[0]!=="type")return;const u=a.type;for(const f of Array.isArray(u)?u:[u]){if(typeof f!="string")return;r.includes(f)||r.push(f)}}delete e.anyOf,e.type=r.length===1?r[0]:r}const ij=new Set(["type","properties","required","additionalProperties"]),L1=["oneOf","anyOf"];function P1(e){const n=e.additionalProperties;return n===void 0||n===!1||typeof n!="object"||n===null?null:Object.keys(n).length?n:null}function pp(e){var u;const n=[];for(const f of e){if(typeof f!="object"||f.type!=="object")return null;for(const m in f)if(!ij.has(m))return null;n.push(f)}const r={},a=new Set;for(const f of n){for(const m in f.properties){if(Object.prototype.hasOwnProperty.call(r,m))continue;const p=[];for(const g of n){const b=((u=g.properties)==null?void 0:u[m])??P1(g);b!=null&&(p.some(v=>JSON.stringify(v)===JSON.stringify(b))||p.push(b))}const y=p.length===1?p[0]:pp(p)??{allOf:p};Ha(r,m,y)}for(const m of f.required??[])a.add(m)}const o={type:"object",properties:r};if(a.size&&(o.required=[...a]),n.every(f=>f.additionalProperties===!1))o.additionalProperties=!1;else{const f=[];for(const m of n){const p=P1(m);p&&!f.some(y=>JSON.stringify(y)===JSON.stringify(p))&&f.push(p)}f.length===1?o.additionalProperties=f[0]:f.length>1&&(o.additionalProperties={allOf:f})}return o}function H6(e){const n=e.allOf;if(!Array.isArray(n)||n.length<2)return;for(const o of ij)if(o in e)return;const r=n.filter(o=>L1.some(u=>Array.isArray(o[u])));let a=null;if(!r.length)a=pp(n);else{const o=r[0],u=L1.find(p=>Array.isArray(o[p]));if(Object.keys(o).length!==1)return;const f=n.filter(p=>p!==o),m=o[u].map(p=>pp([...f,p]));if(m.some(p=>!p))return;a={[u]:m}}a&&(delete e.allOf,_c(e,a))}function aj(e,n){var m,p,y,g;const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=b=>{const v=e.seen.get(b);if(v.ref===null)return;const S=v.def??v.schema,A={...S},C=v.ref;if(v.ref=null,C){a(C);const N=e.seen.get(C),j=N.schema;if(j.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(S.allOf=S.allOf??[],S.allOf.push(j)):_c(S,j),_c(S,A),b._zod.parent===C)for(const q in S)q==="$ref"||q==="allOf"||q in A||delete S[q];if(j.$ref&&N.def)for(const q in S)q==="$ref"||q==="allOf"||q in N.def&&JSON.stringify(S[q])===JSON.stringify(N.def[q])&&delete S[q]}const O=b._zod.parent;if(O&&O!==C){a(O);const N=e.seen.get(O);if(N!=null&&N.schema.$ref&&(S.$ref=N.schema.$ref,N.def))for(const j in S)j==="$ref"||j==="allOf"||j in N.def&&JSON.stringify(S[j])===JSON.stringify(N.def[j])&&delete S[j]}e.override({zodSchema:b,jsonSchema:S,path:v.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const b of[...e.seen.entries()].reverse())a(b[0]);if(e.target!=="openapi-3.0")for(const b of e.seen.entries())rj(b[1].def??b[1].schema);for(const b of e.deferred)b();if(e.intersections.length){const b=new Map;for(const v of e.seen.values())for(const S of[v.schema,v.def]){const A=S==null?void 0:S.allOf;if(!Array.isArray(A))continue;const C=b.get(A);C?C.push(S):b.set(A,[S])}for(const v of e.intersections)for(const S of b.get(v)??[])H6(S)}}const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(m=e.external)!=null&&m.uri){const b=(p=e.external.registry.get(n))==null?void 0:p.id;if(!b)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(b)}_c(o,r.defId?r.schema:r.def??r.schema);const u=(y=e.metadataRegistry.get(n))==null?void 0:y.id;u!==void 0&&o.id===u&&delete o.id;const f=((g=e.external)==null?void 0:g.defs)??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const b of e.seen.entries()){const v=b[1];v.def&&v.defId&&(v.def.id===v.defId&&delete v.def.id,Ha(f,v.defId,v.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(f).length>0&&(e.target==="draft-2020-12"?o.$defs=f:o.definitions=f);try{const b=JSON.parse(JSON.stringify(o));return Object.defineProperty(b,"~standard",{value:{...n["~standard"],jsonSchema:{input:tf(n,"input",e.processors),output:tf(n,"output",e.processors)}},enumerable:!1,writable:!1}),b}catch{throw new Error("Error converting schema to JSON.")}}function Un(e,n){const r=n??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return Un(a.element,r);if(a.type==="set")return Un(a.valueType,r);if(a.type==="lazy")return Un(a.getter(),r);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault"||a.type==="catch")return Un(a.innerType,r);if(a.type==="intersection")return Un(a.left,r)||Un(a.right,r);if(a.type==="record"||a.type==="map")return Un(a.keyType,r)||Un(a.valueType,r);if(a.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Un(a.in,r)||Un(a.out,r);if(a.type==="object"){for(const o in a.shape)if(Un(a.shape[o],r))return!0;return!1}if(a.type==="union"){for(const o of a.options)if(Un(o,r))return!0;return!1}if(a.type==="tuple"){for(const o of a.items)if(Un(o,r))return!0;return!!(a.rest&&Un(a.rest,r))}return!1}const q6=(e,n={})=>r=>{const a=nj({...r,processors:n});return _n(e,a),sj(a,e),aj(a,e)},tf=(e,n,r={})=>a=>{const{libraryOptions:o,target:u}=a??{},f=nj({...o??{},target:u,io:n,processors:r});return _n(e,f),sj(f,e),aj(f,e)},eo=(e,n,r)=>{(e[n]===void 0||r>e[n])&&(e[n]=r)},to=(e,n,r)=>{(e[n]===void 0||r<e[n])&&(e[n]=r)},H1=(e,n)=>{eo(e,"minimum",n),to(e,"maximum",n)},lj=(e,n)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(n)||e.multipleOf.push(n)},oj=(e,n)=>{e.patterns??(e.patterns=new Set),e.patterns.add(n)},cj=(e,n)=>{e.mime=e.mime?e.mime.filter(r=>n.includes(r)):[...n]},uj=(e,n)=>{e.format=n,n.includes("int")&&(e.isInt=!0)},q1=(e,n)=>eo(e,"minimum",n.minimum),B1=(e,n)=>to(e,"maximum",n.maximum),$1=e=>(n,r)=>{uj(n,r.format);const[a,o]=e[r.format];eo(n,"minimum",a),to(n,"maximum",o)},O0={greater_than:(e,n)=>eo(e,n.inclusive?"minimum":"exclusiveMinimum",n.value),less_than:(e,n)=>to(e,n.inclusive?"maximum":"exclusiveMaximum",n.value),multiple_of:(e,n)=>lj(e,n.value),number_format:$1(TN),bigint_format:$1(h8),min_length:q1,max_length:B1,length_equals:(e,n)=>H1(e,n.length),min_size:q1,max_size:B1,size_equals:(e,n)=>H1(e,n.size),string_format:(e,n)=>{uj(e,n.format),n.pattern&&oj(e,n.pattern),(n.format==="base64"||n.format==="base64url")&&(e.contentEncoding=n.format),(n.local||n.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,n)=>cj(e,n.mime)};function vr(e){var u;const n={},r=e._zod.def,a=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(const f of a)(u=O0[f._zod.def.check])==null||u.call(O0,n,f._zod.def);const o=e._zod.bag;o.minimum!==void 0&&eo(n,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&eo(n,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&to(n,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&to(n,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&lj(n,o.multipleOf),o.format!==void 0&&(n.format??(n.format=o.format),o.format.includes("int")&&(n.isInt=!0)),o.mime&&cj(n,o.mime);for(const f of o.patterns??[])oj(n,f);return n}const B6={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},$6=new Map([[GN,hD],[dg,mD]]),F6=e=>$6.get(e)??e,V6=(e,n,r,a)=>{const o=r;o.type="string";const{minimum:u,maximum:f,format:m,patterns:p,contentEncoding:y,laxFormat:g}=vr(e);if(typeof u=="number"&&(o.minLength=u),typeof f=="number"&&(o.maxLength=f),m&&(o.format=B6[m]??m,o.format===""&&delete o.format,(m==="time"||g)&&delete o.format),y&&(o.contentEncoding=y),p&&p.size>0){const b=[...p].map(F6);b.length===1?o.pattern=b[0].source:b.length>1&&(o.allOf=[...b.map(v=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},Z6=(e,n,r,a)=>{const o=r,{minimum:u,maximum:f,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:y,isInt:g}=vr(e);o.type=g?"integer":"number";const b=typeof y=="number"&&y>=(u??Number.NEGATIVE_INFINITY),v=typeof p=="number"&&p<=(f??Number.POSITIVE_INFINITY),S=n.target==="draft-04"||n.target==="openapi-3.0";if(b?S?(o.minimum=y,o.exclusiveMinimum=!0):o.exclusiveMinimum=y:typeof u=="number"&&(o.minimum=u),v?S?(o.maximum=p,o.exclusiveMaximum=!0):o.exclusiveMaximum=p:typeof f=="number"&&(o.maximum=f),m){const A=new Set;for(const N of m)Number.isFinite(N)&&N!==0?A.add(Math.abs(N)):uo(e,n,o,a,`A multipleOf divisor of ${N} cannot be represented in JSON Schema`);const[C,...O]=A;C!==void 0&&(o.multipleOf=C),O.length&&(o.allOf=[...o.allOf??[],...O.map(N=>({multipleOf:N}))])}},G6=(e,n,r,a)=>{r.not={}},Q6=(e,n,r,a)=>{},K6=(e,n,r,a)=>{const o=e._zod.def,u=up(o.entries);if(u.length===0){r.not={};return}u.every(f=>typeof f=="number")&&(r.type="number"),u.every(f=>typeof f=="string")&&(r.type="string"),r.enum=u},Y6=(e,n,r,a)=>{uo(e,n,r,a,"Custom types cannot be represented in JSON Schema")},J6=(e,n,r,a)=>{uo(e,n,r,a,"Transforms cannot be represented in JSON Schema")},X6=(e,n,r,a)=>{const o=r,u=e._zod.def,{minimum:f,maximum:m}=vr(e);typeof f=="number"&&(o.minItems=f),typeof m=="number"&&(o.maxItems=m),o.type="array",o.items=_n(u.element,n,{...a,path:[...a.path,"items"]})};function gp(e){const n=e._zod.def;return n.type==="pipe"&&n.in._zod.traits.has("$ZodTransform")?gp(n.out):n.type==="catch"?gp(n.innerType):e._zod.optin}const W6=(e,n,r,a)=>{var g;const o=r,u=e._zod.def,f=u.shape;if(Object.getOwnPropertySymbols(f).length&&uo(e,n,o,a,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const b in f)Ha(o.properties,b,_n(f[b],n,{...a,path:[...a.path,"properties",b]}));const p=new Set(Object.keys(f)),y=new Set([...p].filter(b=>{const v=u.shape[b];return n.io==="input"?gp(v)===void 0:v._zod.optout===void 0}));y.size>0&&(o.required=Array.from(y)),((g=u.catchall)==null?void 0:g._zod.def.type)==="never"?o.additionalProperties=!1:u.catchall?u.catchall&&(o.additionalProperties=_n(u.catchall,n,{...a,path:[...a.path,"additionalProperties"]})):n.io==="output"&&(o.additionalProperties=!1)},ez=(e,n,r,a)=>{const o=e._zod.def,u=o.inclusive===!1,f=o.options.map((m,p)=>_n(m,n,{...a,path:[...a.path,u?"oneOf":"anyOf",p]}));u?r.oneOf=f:r.anyOf=f},tz=(e,n,r,a)=>{const o=e._zod.def,u=_n(o.left,n,{...a,path:[...a.path,"allOf",0]}),f=_n(o.right,n,{...a,path:[...a.path,"allOf",1]}),m=y=>"allOf"in y&&Object.keys(y).length===1,p=[...m(u)?u.allOf:[u],...m(f)?f.allOf:[f]];r.allOf=p,n.intersections.push(p)},nz=(e,n,r,a)=>{const o=e._zod.def,u=_n(o.innerType,n,a),f=n.seen.get(e);n.target==="openapi-3.0"?(f.ref=o.innerType,r.nullable=!0):r.anyOf=[u,{type:"null"}]},sz=(e,n,r,a)=>{const o=e._zod.def;_n(o.innerType,n,a);const u=n.seen.get(e);u.ref=o.innerType},fg=Symbol();function dj(e,n,r,a,o){let u=!1;const f=JSON.stringify(e,(m,p)=>typeof p!="bigint"?p:(u=!0,null));return u?(uo(n,r,a,o,"BigInt defaults cannot be represented in JSON Schema"),fg):JSON.parse(f)}const rz=(e,n,r,a)=>{const o=e._zod.def;_n(o.innerType,n,a);const u=n.seen.get(e);u.ref=o.innerType;const f=dj(o.defaultValue,e,n,r,a);f!==fg&&(r.default=f)},iz=(e,n,r,a)=>{const o=e._zod.def;_n(o.innerType,n,a);const u=n.seen.get(e);if(u.ref=o.innerType,n.io!=="input")return;const f=dj(o.defaultValue,e,n,r,a);f!==fg&&(r._prefault=f)},az=(e,n,r,a)=>{const o=e._zod.def;_n(o.innerType,n,a);const u=n.seen.get(e);u.ref=o.innerType;let f;try{f=o.catchValue(void 0)}catch{uo(e,n,r,a,"Dynamic catch values are not supported in JSON Schema");return}r.default=f},lz=(e,n,r,a)=>{const o=e._zod.def,u=o.in._zod.traits.has("$ZodTransform"),f=n.io==="input"?u?o.out:o.in:o.out;_n(f,n,a);const m=n.seen.get(e);m.ref=f},oz=(e,n,r,a)=>{const o=e._zod.def;_n(o.innerType,n,a);const u=n.seen.get(e);u.ref=o.innerType,r.readOnly=!0},fj=(e,n,r,a)=>{const o=e._zod.def;_n(o.innerType,n,a);const u=n.seen.get(e);u.ref=o.innerType},F1=new WeakSet([Object.prototype,Error.prototype]);function Ad(e,n,r){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get(){const a=r(this);return Object.defineProperty(this,n,{value:a,configurable:!0,writable:!0}),a},set(a){Object.defineProperty(this,n,{value:a,configurable:!0,writable:!0})}})}const cz=(e,n)=>{M8.init(e,n),e.name="ZodError";const r=Object.getPrototypeOf(e);F1.has(r)||(F1.add(r),Ad(r,"format",a=>o=>I8(a,o)),Ad(r,"flatten",a=>o=>U8(a,o)),Ad(r,"addIssue",a=>o=>{a.issues.push(o),a.message=JSON.stringify(a.issues,dp,2)}),Ad(r,"addIssues",a=>o=>{a.issues.push(...o),a.message=JSON.stringify(a.issues,dp,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},ks=ie("ZodError",cz,void 0,{Parent:Error}),uz=ig(ks),dz=ag(ks),fz=lg(ks),hz=og(ks),mz=$8(ks),pz=F8(ks),gz=V8(ks),bz=Z8(ks),xz=G8(ks),yz=Q8(ks),vz=K8(ks),wz=Y8(ks);function _z(){_r.localeError||Pi(VM())}function hg(){_r.memoizer||Pi({memoizer:BM()})}const en=ie("ZodType",(e,n)=>(_z(),Wt.init(e,n),e.def=n,e.type=n.type,e),{check(...e){const n=this.def;return this.clone(ps(n,{checks:[...n.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,n){return Li(this,e,n)},brand(){return this},register(e,n){return e.add(this,n),this},refine(e,n){return this.check(yU(e,n))},superRefine(e,n){return this.check(vU(e,n))},overwrite(e){return this.check(co(e))},optional(){return G1(this)},exactOptional(){return aU(this)},nullable(){return Q1(this)},nullish(){return G1(Q1(this))},nonoptional(e){return fU(this,e)},array(){return Jz(this)},or(e){return eU([this,e])},and(e){return nU(this,e)},transform(e){return K1(this,iU(e))},default(e){return cU(this,e)},prefault(e){return dU(this,e)},catch(e){return mU(this,e)},pipe(e){return K1(this,e)},readonly(){return bU(this)},describe(e){const n=this.clone();return yc.add(n,{description:e}),n},meta(...e){if(e.length===0)return yc.get(this);const n=this.clone();return yc.add(n,e[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...n){return n.length===0?e(this):e(this,...n)},get"~standard"(){return MN(this,"~standard",{...BN(this),jsonSchema:{input:tf(this,"input"),output:tf(this,"output")}})},set"~standard"(e){Ii(this,"~standard",e)},parse:function e(n,r){return uz(this,n,r,{callee:e})},parseAsync:async function e(n,r){return await dz(this,n,r,{callee:e})},safeParse(e,n){return fz(this,e,n)},async safeParseAsync(e,n){return hz(this,e,n)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(e){Ii(this,"spa",e)},validate(e,n){return H8(this,e,n)},validateAsync(e,n){return B8(this,e,n)},encode:function e(n,r){return mz(this,n,r,{callee:e})},decode:function e(n,r){return pz(this,n,r,{callee:e})},encodeAsync:async function e(n,r){return await gz(this,n,r,{callee:e})},decodeAsync:async function e(n,r){return await bz(this,n,r,{callee:e})},safeEncode(e,n){return xz(this,e,n)},safeDecode(e,n){return yz(this,e,n)},async safeEncodeAsync(e,n){return vz(this,e,n)},async safeDecodeAsync(e,n){return wz(this,e,n)},toJSONSchema(e){return q6(this,{})(e)},get description(){var e;return(e=yc.get(this))==null?void 0:e.description},get _def(){return this._zod.def}}),hj=ie("_ZodString",(e,n)=>{ug.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>V6(e,r,a)},zN({format:e=>vr(e).format??null,minLength:e=>vr(e).minimum??null,maxLength:e=>vr(e).maximum??null},{regex(...e){return this.check(j6(...e))},includes(...e){return this.check(C6(...e))},startsWith(...e){return this.check(O6(...e))},endsWith(...e){return this.check(R6(...e))},min(...e){return this.check(ef(...e))},max(...e){return this.check(ej(...e))},length(...e){return this.check(tj(...e))},nonempty(...e){return this.check(ef(1,...e))},lowercase(e){return this.check(E6(e))},uppercase(e){return this.check(A6(e))},trim(){return this.check(k6())},normalize(...e){return this.check(T6(...e))},toLowerCase(){return this.check(D6())},toUpperCase(){return this.check(M6())},slugify(){return this.check(z6())}})),Sz=ie("ZodString",(e,n)=>{ug.init(e,n),hj.init(e,n)},{email(e){return this.check(KM(Cz,e))},url(e){return this.check(t6(Rz,e))},jwt(e){return this.check(g6(Vz,e))},emoji(e){return this.check(n6(Tz,e))},guid(e){return this.check(YM(Oz,e))},uuid(e){return this.check(JM(Cd,e))},uuidv4(e){return this.check(XM(Cd,e))},uuidv6(e){return this.check(WM(Cd,e))},uuidv7(e){return this.check(e6(Cd,e))},nanoid(e){return this.check(s6(kz,e))},cuid(e){return this.check(r6(Dz,e))},cuid2(e){return this.check(i6(Mz,e))},ulid(e){return this.check(a6(zz,e))},base64(e){return this.check(h6(Bz,e))},base64url(e){return this.check(m6($z,e))},xid(e){return this.check(l6(Uz,e))},ksuid(e){return this.check(o6(Iz,e))},ipv4(e){return this.check(c6(Lz,e))},ipv6(e){return this.check(u6(Pz,e))},cidrv4(e){return this.check(d6(Hz,e))},cidrv6(e){return this.check(f6(qz,e))},e164(e){return this.check(p6(Fz,e))},datetime(e){return this.check(b6(Nz,e))},date(e){return this.check(x6(jz,e))},time(e){return this.check(y6(Ez,e))},duration(e){return this.check(v6(Az,e))}});function Et(e){return QM(Sz,e)}const Mt=ie("ZodStringFormat",(e,n)=>{Rt.init(e,n),hj.init(e,n)}),Nz=ie("ZodISODateTime",(e,n)=>{nM.init(e,n),Mt.init(e,n)}),jz=ie("ZodISODate",(e,n)=>{sM.init(e,n),Mt.init(e,n)}),Ez=ie("ZodISOTime",(e,n)=>{rM.init(e,n),Mt.init(e,n)}),Az=ie("ZodISODuration",(e,n)=>{iM.init(e,n),Mt.init(e,n)}),Cz=ie("ZodEmail",(e,n)=>{BD.init(e,n),Mt.init(e,n)}),Oz=ie("ZodGUID",(e,n)=>{HD.init(e,n),Mt.init(e,n)}),Cd=ie("ZodUUID",(e,n)=>{qD.init(e,n),Mt.init(e,n)}),Rz=ie("ZodURL",(e,n)=>{QD.init(e,n),Mt.init(e,n)}),Tz=ie("ZodEmoji",(e,n)=>{KD.init(e,n),Mt.init(e,n)}),kz=ie("ZodNanoID",(e,n)=>{YD.init(e,n),Mt.init(e,n)}),Dz=ie("ZodCUID",(e,n)=>{JD.init(e,n),Mt.init(e,n)}),Mz=ie("ZodCUID2",(e,n)=>{XD.init(e,n),Mt.init(e,n)}),zz=ie("ZodULID",(e,n)=>{WD.init(e,n),Mt.init(e,n)}),Uz=ie("ZodXID",(e,n)=>{eM.init(e,n),Mt.init(e,n)}),Iz=ie("ZodKSUID",(e,n)=>{tM.init(e,n),Mt.init(e,n)}),Lz=ie("ZodIPv4",(e,n)=>{aM.init(e,n),Mt.init(e,n)}),Pz=ie("ZodIPv6",(e,n)=>{oM.init(e,n),Mt.init(e,n)}),Hz=ie("ZodCIDRv4",(e,n)=>{cM.init(e,n),Mt.init(e,n)}),qz=ie("ZodCIDRv6",(e,n)=>{dM.init(e,n),Mt.init(e,n)}),Bz=ie("ZodBase64",(e,n)=>{fM.init(e,n),Mt.init(e,n)}),$z=ie("ZodBase64URL",(e,n)=>{mM.init(e,n),Mt.init(e,n)}),Fz=ie("ZodE164",(e,n)=>{pM.init(e,n),Mt.init(e,n)}),Vz=ie("ZodJWT",(e,n)=>{bM.init(e,n),Mt.init(e,n)}),mj=ie("ZodNumber",(e,n)=>{QN.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>Z6(e,r,a,o),e.isFinite=!0},zN({minValue:e=>{const{minimum:n,exclusiveMinimum:r}=vr(e);return Math.max(n??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:n,exclusiveMaximum:r}=vr(e);return Math.min(n??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:n,multipleOf:r}=vr(e);return!!n||!!(r!=null&&r.some(Number.isSafeInteger))},format:e=>vr(e).format??null},{gt(e,n){return this.check(z1(e,n))},gte(e,n){return this.check(C0(e,n))},min(e,n){return this.check(C0(e,n))},lt(e,n){return this.check(M1(e,n))},lte(e,n){return this.check(A0(e,n))},max(e,n){return this.check(A0(e,n))},int(e){return this.check(V1(e))},safe(e){return this.check(V1(e))},positive(e){return this.check(z1(0,e))},nonnegative(e){return this.check(C0(0,e))},negative(e){return this.check(M1(0,e))},nonpositive(e){return this.check(A0(0,e))},multipleOf(e,n){return this.check(U1(e,n))},step(e,n){return this.check(U1(e,n))},finite(){return this}})),Zz=ie("ZodNumberFormat",(e,n)=>{xM.init(e,n),mj.init(e,n)});function V1(e){return _6(Zz,e)}const Gz=ie("ZodUnknown",(e,n)=>{yM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>Q6()});function Z1(){return S6(Gz)}const Qz=ie("ZodNever",(e,n)=>{vM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>G6(e,r,a)});function Kz(e){return N6(Qz,e)}const Yz=ie("ZodArray",(e,n)=>{hg(),wM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>X6(e,r,a,o),e.element=n.element},{min(e,n){return this.check(ef(e,n))},nonempty(e){return this.check(ef(1,e))},max(e,n){return this.check(ej(e,n))},length(e,n){return this.check(tj(e,n))},unwrap(){return this.element}});function Jz(e,n){return U6(Yz,e,n)}const Xz=ie("ZodObject",(e,n)=>{hg(),NM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>W6(e,r,a,o),E8(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return sU(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ps(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ps(this._zod.def,{catchall:Z1()}))},loose(){return this.clone(ps(this._zod.def,{catchall:Z1()}))},strict(){return this.clone(ps(this._zod.def,{catchall:Kz()}))},strip(){return this.clone(ps(this._zod.def,{catchall:void 0}))},extend(e){return g8(this,e)},safeExtend(e){return b8(this,e)},merge(e){return x8(this,e)},pick(e){return m8(this,e)},omit(e){return p8(this,e)},partial(...e){return g1(pj,this,e[0])},exactPartial(...e){return g1(gj,this,e[0],"exactPartial")},required(...e){return y8(bj,this,e[0])}});function bs(e,n){const r={type:"object",shape:e??{},...Ie(n)};return new Xz(r)}const Wz=ie("ZodUnion",(e,n)=>{jM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>ez(e,r,a,o),e.options=n.options});function eU(e,n){return new Wz({type:"union",options:e,...Ie(n)})}const tU=ie("ZodIntersection",(e,n)=>{EM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>tz(e,r,a,o)});function nU(e,n){return new tU({type:"intersection",left:e,right:n})}const bp=ie("ZodEnum",(e,n)=>{AM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(a,o,u)=>K6(e,a,o),e.enum=n.entries,e.options=[...e._zod.values];const r=new Set(Object.keys(n.entries));e.extract=(a,o)=>{const u={};for(const f of a)if(r.has(f))u[f]=n.entries[f];else throw new Error(`Key ${f} not found in enum`);return new bp({...n,checks:[],...Ie(o),entries:u})},e.exclude=(a,o)=>{const u={...n.entries};for(const f of a)if(r.has(f))delete u[f];else throw new Error(`Key ${f} not found in enum`);return new bp({...n,checks:[],...Ie(o),entries:u})}});function sU(e,n){const r=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new bp({type:"enum",entries:r,...Ie(n)})}const rU=ie("ZodTransform",(e,n)=>{hg(),CM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>J6(e,r,a,o),e._zod.parse=(r,a)=>{if(a.direction==="backward")throw new UN(e.constructor.name);r.addIssue=u=>{if(typeof u=="string")r.issues.push(Cc(u,r.value,n));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),"input"in f||(f.input=r.value),f.inst??(f.inst=e),r.issues.push(Cc(f))}};const o=n.transform(r.value,r);return o instanceof Promise?o.then(u=>(r.value=u,r)):(r.value=o,r)}});function iU(e){return new rU({type:"transform",transform:e})}const pj=ie("ZodOptional",(e,n)=>{JN.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>fj(e,r,a,o),e.unwrap=()=>e._zod.def.innerType});function G1(e){return new pj({type:"optional",innerType:e})}const gj=ie("ZodExactOptional",(e,n)=>{OM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>fj(e,r,a,o),e.unwrap=()=>e._zod.def.innerType});function aU(e){return new gj({type:"optional",innerType:e})}const lU=ie("ZodNullable",(e,n)=>{RM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>nz(e,r,a,o),e.unwrap=()=>e._zod.def.innerType});function Q1(e){return new lU({type:"nullable",innerType:e})}const oU=ie("ZodDefault",(e,n)=>{TM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>rz(e,r,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function cU(e,n){return new oU({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():ON(n)}})}const uU=ie("ZodPrefault",(e,n)=>{kM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>iz(e,r,a,o),e.unwrap=()=>e._zod.def.innerType});function dU(e,n){return new uU({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():ON(n)}})}const bj=ie("ZodNonOptional",(e,n)=>{DM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>sz(e,r,a,o),e.unwrap=()=>e._zod.def.innerType});function fU(e,n){return new bj({type:"nonoptional",innerType:e,...Ie(n)})}const hU=ie("ZodCatch",(e,n)=>{MM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>az(e,r,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function mU(e,n){return new hU({type:"catch",innerType:e,catchValue:typeof n=="function"?n:C8(n)})}const pU=ie("ZodPipe",(e,n)=>{zM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>lz(e,r,a,o),e.in=n.in,e.out=n.out});function K1(e,n){return new pU({type:"pipe",in:e,out:n})}const gU=ie("ZodReadonly",(e,n)=>{UM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>oz(e,r,a,o),e.unwrap=()=>e._zod.def.innerType});function bU(e){return new gU({type:"readonly",innerType:e})}const xU=ie("ZodCustom",(e,n)=>{IM.init(e,n),en.init(e,n),e._zod.processJSONSchema=(r,a,o)=>Y6(e,r,a,o)});function yU(e,n={}){return I6(xU,e,n)}function vU(e,n){return L6(e,n)}function _t(e){return w6(mj,e)}const hn=({isOpen:e,onClose:n,title:r,subtitle:a,children:o,maxWidth:u="lg"})=>{if(T.useEffect(()=>{const m=p=>{p.key==="Escape"&&n()};return e&&(document.body.style.overflow="hidden",window.addEventListener("keydown",m)),()=>{document.body.style.overflow="unset",window.removeEventListener("keydown",m)}},[e,n]),!e)return null;const f={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl"}[u];return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-in fade-in duration-150",children:c.jsxs("div",{className:`relative w-full ${f} bg-[#0f1523] rounded-2xl shadow-2xl border border-slate-800/90 overflow-hidden flex flex-col max-h-[90vh] text-slate-200`,onClick:m=>m.stopPropagation(),children:[c.jsxs("div",{className:"flex items-start justify-between p-5 border-b border-slate-800/80 bg-[#0d121f]/90",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold text-white tracking-tight",children:r}),a&&c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:a})]}),c.jsx("button",{onClick:n,className:"rounded-xl p-1.5 text-slate-400 hover:text-white hover:bg-slate-800/60 transition cursor-pointer",children:c.jsx(Bp,{className:"w-5 h-5"})})]}),c.jsx("div",{className:"p-6 overflow-y-auto flex-1 bg-[#0f1523]",children:o})]})})},wU=bs({name:Et().min(3,"Name must be at least 3 characters"),registrationNo:Et().min(4,"Registration number is mandatory"),email:Et().email("Enter a valid email address"),type:_t().min(1).max(27),status:_t().optional()}),_U=bs({name:Et().min(3,"Portfolio name is required"),description:Et().min(5,"Description is required"),organisationId:_t().min(1,"Select a parent organisation"),ownerId:Et().min(1,"Owner ID is required")}),SU=bs({name:Et().min(3,"Programme name is required"),portfolioId:_t().min(1,"Select a parent portfolio"),status:_t().optional(),ownerId:Et().min(1,"Owner ID is required")}),NU=()=>{var Re,pe;const e=Pa(),{sub:n,user:r}=Uc(),a=n||(r==null?void 0:r.id)||"",{success:o,error:u}=Lc(),[f,m]=T.useState("organisations"),[p,y]=T.useState(""),[g,b]=T.useState(!1),[v,S]=T.useState(null),[A,C]=T.useState(!1),[O,N]=T.useState(null),[j,F]=T.useState(!1),[q,B]=T.useState(null),[re,Q]=T.useState(null),[X,se]=T.useState(!1),[fe,we]=T.useState(null),[Ce,Z]=T.useState(!1),{data:W=[],isLoading:oe}=Ke({queryKey:["organisations"],queryFn:()=>df()}),{data:ee=[],isLoading:z}=Ke({queryKey:["portfolios"],queryFn:()=>XS()}),{data:ue=[],isLoading:Me}=Ke({queryKey:["programmes"],queryFn:()=>ff()}),{data:Ae=[],isLoading:Ye}=Ke({queryKey:["instruments",re==null?void 0:re.id],queryFn:()=>re?kT(re.id):Promise.resolve([]),enabled:!!re&&X}),{data:$e=[],isLoading:ut}=Ke({queryKey:["portfolioProgrammes",fe==null?void 0:fe.id],queryFn:()=>fe?OT(fe.id):Promise.resolve([]),enabled:!!fe&&Ce}),_=hs({resolver:ms(wU),defaultValues:{name:"",registrationNo:"",email:"",type:ot.Enterprise,status:Cn.Active}}),Y=hs({resolver:ms(_U),defaultValues:{name:"",description:"",organisationId:(Re=W[0])!=null&&Re.id?Number(W[0].id):101,ownerId:a}}),he=hs({resolver:ms(SU),defaultValues:{name:"",portfolioId:(pe=ee[0])!=null&&pe.id?Number(ee[0].id):201,status:xt.Approved,ownerId:a}}),ce=Ft({mutationFn:$=>v?AT({organisationId:v.id,name:$.name,registrationNo:$.registrationNo,email:$.email,type:Number($.type),status:$.status!==void 0?Number($.status):void 0}):ET($),onSuccess:()=>{e.invalidateQueries({queryKey:["organisations"]}),o(v?"Organisation updated":"Organisation registered successfully"),b(!1),S(null),_.reset()},onError:$=>{u("Failed to save organisation",String($))}}),Oe=Ft({mutationFn:$=>O?TT({portfolioId:O.id,name:$.name,description:$.description,organisationId:Number($.organisationId),ownerId:$.ownerId}):RT($),onSuccess:()=>{e.invalidateQueries({queryKey:["portfolios"]}),o(O?"Portfolio updated successfully":"Portfolio created successfully"),C(!1),N(null),Y.reset()},onError:$=>{u("Failed to save portfolio",String($))}}),Pe=Ft({mutationFn:$=>q?zT({programmeId:q.id,name:$.name,portfolioId:Number($.portfolioId),status:$.status!==void 0?Number($.status):void 0,ownerId:$.ownerId}):MT($),onSuccess:()=>{e.invalidateQueries({queryKey:["programmes"]}),o(q?"Programme updated successfully":"Programme created successfully"),F(!1),B(null),he.reset()},onError:$=>{u("Failed to save programme",String($))}}),qe=()=>{S(null),_.reset({name:"",registrationNo:"",email:"",type:ot.Enterprise,status:Cn.Active}),b(!0)},_e=$=>{S($),_.reset({name:$.name||"",registrationNo:$.registrationNo||"",email:$.email||"",type:$.type||ot.Enterprise,status:$.status??Cn.Active}),b(!0)},je=()=>{var $;N(null),Y.reset({name:"",description:"",organisationId:($=W[0])!=null&&$.id?Number(W[0].id):101,ownerId:a}),C(!0)},at=$=>{N($),Y.reset({name:$.name||"",description:$.description||"",organisationId:Number($.organisationId)||101,ownerId:$.ownedBy||a}),C(!0)},Tt=()=>{var $;B(null),he.reset({name:"",portfolioId:($=ee[0])!=null&&$.id?Number(ee[0].id):201,status:xt.Approved,ownerId:a}),F(!0)},Zt=$=>{B($),he.reset({name:$.name||"",portfolioId:Number($.portfolioId)||201,status:$.status??xt.Approved,ownerId:$.ownedBy||a}),F(!0)},J=W.filter($=>{var Ge,rt,qt;return((Ge=$.name)==null?void 0:Ge.toLowerCase().includes(p.toLowerCase()))||((rt=$.registrationNo)==null?void 0:rt.toLowerCase().includes(p.toLowerCase()))||((qt=$.email)==null?void 0:qt.toLowerCase().includes(p.toLowerCase()))});return c.jsxs("div",{className:"space-y-6 max-w-7xl mx-auto",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 bg-[#0d121f]/90 p-5 rounded-2xl border border-slate-800/80 backdrop-blur-md shadow-xl",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h2",{className:"text-xl font-bold text-white tracking-tight",children:"Governance & Structure"}),c.jsx("span",{className:"text-[11px] font-semibold text-blue-400 bg-blue-500/10 px-2.5 py-0.5 rounded-full border border-blue-500/30",children:"Directory"})]}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"Maintain Master Organisation Registry, Funder Portfolios, and Strategic Programmes hierarchy."})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[f==="organisations"&&c.jsxs("button",{onClick:qe,className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-md shadow-blue-500/20 transition cursor-pointer",children:[c.jsx(Rs,{className:"w-4 h-4"}),"Register Organisation"]}),f==="portfolios"&&c.jsxs("button",{onClick:je,className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-md shadow-blue-500/20 transition cursor-pointer",children:[c.jsx(Rs,{className:"w-4 h-4"}),"Create Portfolio"]}),f==="programmes"&&c.jsxs("button",{onClick:Tt,className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-md shadow-blue-500/20 transition cursor-pointer",children:[c.jsx(Rs,{className:"w-4 h-4"}),"Create Programme"]})]})]}),c.jsxs("div",{className:"flex border-b border-slate-800/80 bg-[#0d121f]/80 px-4 rounded-2xl backdrop-blur-sm",children:[c.jsxs("button",{onClick:()=>m("organisations"),className:`py-3.5 px-4 text-xs font-semibold border-b-2 transition-colors flex items-center gap-2 cursor-pointer ${f==="organisations"?"border-blue-500 text-blue-400":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[c.jsx(cS,{className:"w-4 h-4"}),"Organisations Directory (",W.length,")"]}),c.jsxs("button",{onClick:()=>m("portfolios"),className:`py-3.5 px-4 text-xs font-semibold border-b-2 transition-colors flex items-center gap-2 cursor-pointer ${f==="portfolios"?"border-blue-500 text-blue-400":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[c.jsx(Pp,{className:"w-4 h-4"}),"Funder Portfolios (",ee.length,")"]}),c.jsxs("button",{onClick:()=>m("programmes"),className:`py-3.5 px-4 text-xs font-semibold border-b-2 transition-colors flex items-center gap-2 cursor-pointer ${f==="programmes"?"border-blue-500 text-blue-400":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[c.jsx(W0,{className:"w-4 h-4"}),"Programmes Hierarchy (",ue.length,")"]})]}),f==="organisations"&&c.jsxs("div",{className:"relative max-w-md",children:[c.jsx(pS,{className:"w-4 h-4 text-slate-500 absolute left-3 top-3"}),c.jsx("input",{type:"text",placeholder:"Search by organisation name, reg no, or email...",value:p,onChange:$=>y($.target.value),className:"w-full pl-9 pr-4 py-2.5 text-xs bg-[#090d16] border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-slate-200 placeholder:text-slate-500 transition shadow-xs"})]}),f==="organisations"&&c.jsx("div",{className:"bg-[#0f1523]/80 rounded-2xl border border-slate-800/80 shadow-lg backdrop-blur-sm overflow-hidden",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-[#0d121f]/95 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold text-[11px]",children:[c.jsx("th",{className:"py-3.5 px-5",children:"Organisation Name"}),c.jsx("th",{className:"py-3.5 px-4",children:"Registration No"}),c.jsx("th",{className:"py-3.5 px-4",children:"Entity Type"}),c.jsx("th",{className:"py-3.5 px-4",children:"Contact Email"}),c.jsx("th",{className:"py-3.5 px-4",children:"Status"}),c.jsx("th",{className:"py-3.5 px-5 text-right",children:"Actions"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-800/60",children:oe?c.jsx("tr",{children:c.jsx("td",{colSpan:6,className:"py-8 text-center text-slate-500",children:"Loading registered organisations..."})}):J.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:6,className:"py-8 text-center text-slate-500",children:"No organisations found matching query."})}):J.map($=>{const Ge=Ml($.status);return c.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors",children:[c.jsxs("td",{className:"py-3.5 px-5",children:[c.jsx("span",{className:"font-semibold text-white block text-xs",children:$.name}),c.jsxs("span",{className:"text-[10px] text-slate-500 font-mono",children:["ID: ",$.id]})]}),c.jsx("td",{className:"py-3.5 px-4 font-mono text-slate-300",children:$.registrationNo||"—"}),c.jsx("td",{className:"py-3.5 px-4",children:c.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-md text-[11px] font-medium bg-slate-900/80 text-slate-300 border border-slate-700/80",children:_k($.type)})}),c.jsx("td",{className:"py-3.5 px-4 text-slate-300",children:c.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px]",children:[c.jsx(mS,{className:"w-3.5 h-3.5 text-slate-500"}),$.email]})}),c.jsx("td",{className:"py-3.5 px-4",children:c.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-[10px] font-semibold border ${Ge.className}`,children:Ge.label})}),c.jsx("td",{className:"py-3.5 px-5 text-right",children:c.jsxs("button",{onClick:()=>_e($),className:"inline-flex items-center gap-1 text-xs font-semibold text-slate-200 hover:text-white bg-slate-900/80 hover:bg-slate-800 border border-slate-700/80 px-3 py-1.5 rounded-lg transition shadow-xs cursor-pointer",children:[c.jsx(f0,{className:"w-3 h-3"}),"Edit"]})})]},$.id)})})]})})}),f==="portfolios"&&c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:z?c.jsx("p",{className:"text-xs text-slate-500 col-span-3",children:"Loading portfolios..."}):ee.map($=>{const Ge=W.find(qt=>String(qt.id)===String($.organisationId)),rt=ue.filter(qt=>String(qt.portfolioId)===String($.id)).length;return c.jsxs("div",{className:"bg-[#0f1523]/80 p-5 rounded-2xl border border-slate-800/80 shadow-lg backdrop-blur-sm flex flex-col justify-between hover:border-slate-700/80 transition-all",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-[10px] font-mono uppercase tracking-wider text-blue-400 bg-blue-500/10 px-2.5 py-0.5 rounded-md border border-blue-500/30",children:["Portfolio #",$.id]}),c.jsxs("span",{className:"text-[11px] text-slate-400 font-medium",children:[rt," Programmes"]})]}),c.jsx("h3",{className:"text-base font-bold text-white leading-snug",children:$.name}),c.jsx("p",{className:"text-xs text-slate-400 leading-relaxed",children:$.description})]}),c.jsxs("div",{className:"mt-4 pt-3 border-t border-slate-800/80 space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-400",children:[c.jsx("span",{className:"truncate max-w-[170px] font-medium text-slate-300",children:Ge?Ge.name:`Org #${$.organisationId}`}),c.jsx("span",{className:"font-mono text-[11px] text-slate-500",children:Kn($.createdAt)})]}),c.jsxs("div",{className:"flex items-center justify-between pt-1 text-xs",children:[c.jsxs("span",{className:"text-slate-400 font-medium truncate max-w-[190px]",children:["Owner: ",c.jsx("span",{className:"text-slate-200 font-mono text-[11px]",children:ya($.ownedBy)})]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsxs("button",{type:"button",onClick:()=>{we($),Z(!0)},className:"inline-flex items-center gap-1 text-xs font-semibold text-blue-400 hover:text-white bg-blue-500/10 hover:bg-blue-500/20 border border-blue-500/30 px-2.5 py-1 rounded-lg transition shadow-xs cursor-pointer",children:[c.jsx(W0,{className:"w-3 h-3"}),"Programmes"]}),c.jsxs("button",{type:"button",onClick:()=>at($),className:"inline-flex items-center gap-1 text-xs font-semibold text-slate-200 hover:text-white bg-slate-900/80 hover:bg-slate-800 border border-slate-700/80 px-2.5 py-1 rounded-lg transition shadow-xs cursor-pointer",children:[c.jsx(f0,{className:"w-3 h-3"}),"Edit"]})]})]})]})]},$.id)})}),f==="programmes"&&c.jsx("div",{className:"bg-[#0f1523]/80 rounded-2xl border border-slate-800/80 shadow-lg backdrop-blur-sm overflow-hidden",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-[#0d121f]/95 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold text-[11px]",children:[c.jsx("th",{className:"py-3.5 px-5",children:"Programme Name"}),c.jsx("th",{className:"py-3.5 px-4",children:"Parent Portfolio"}),c.jsx("th",{className:"py-3.5 px-4",children:"Governance Status"}),c.jsx("th",{className:"py-3.5 px-4",children:"Creation Date"}),c.jsx("th",{className:"py-3.5 px-4",children:"Owner Email"}),c.jsx("th",{className:"py-3.5 px-5 text-right",children:"Actions"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-800/60",children:Me?c.jsx("tr",{children:c.jsx("td",{colSpan:6,className:"py-8 text-center text-slate-500",children:"Loading programmes..."})}):ue.map($=>{const Ge=ee.find(qt=>String(qt.id)===String($.portfolioId)),rt=Xl($.status);return c.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors",children:[c.jsxs("td",{className:"py-3.5 px-5",children:[c.jsx("span",{className:"font-semibold text-white block text-xs",children:$.name}),c.jsxs("span",{className:"text-[10px] text-slate-500 font-mono",children:["ID: ",$.id]})]}),c.jsx("td",{className:"py-3.5 px-4 text-slate-300 font-medium",children:Ge?Ge.name:`Portfolio #${$.portfolioId}`}),c.jsx("td",{className:"py-3.5 px-4",children:c.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-[10px] font-semibold border ${rt.className}`,children:rt.label})}),c.jsx("td",{className:"py-3.5 px-4 text-slate-400 font-mono text-[11px]",children:Kn($.createdAt)}),c.jsx("td",{className:"py-3.5 px-4 font-mono text-slate-300 font-medium text-[11px]",children:ya($.ownedBy)}),c.jsx("td",{className:"py-3.5 px-5 text-right",children:c.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[c.jsxs("button",{type:"button",onClick:()=>{Q($),se(!0)},className:"inline-flex items-center gap-1 text-xs font-semibold text-blue-400 hover:text-white bg-blue-500/10 hover:bg-blue-500/20 border border-blue-500/30 px-2.5 py-1 rounded-lg transition shadow-xs cursor-pointer",title:"View Funding Instruments",children:[c.jsx(Ic,{className:"w-3 h-3"}),"Instruments"]}),c.jsxs("button",{type:"button",onClick:()=>Zt($),className:"inline-flex items-center gap-1 text-xs font-semibold text-slate-200 hover:text-white bg-slate-900/80 hover:bg-slate-800 border border-slate-700/80 px-2.5 py-1 rounded-lg transition shadow-xs cursor-pointer",children:[c.jsx(f0,{className:"w-3 h-3"}),"Edit"]})]})})]},$.id)})})]})})}),c.jsx(hn,{isOpen:g,onClose:()=>b(!1),title:v?"Edit Organisation Profile":"Register New Organisation",subtitle:"Mandatory master data profile for Recipient or Funder entities (POPIA compliant)",children:c.jsxs("form",{onSubmit:_.handleSubmit($=>ce.mutate($)),className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Legal Organisation Name *"}),c.jsx("input",{type:"text",..._.register("name"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-white bg-[#090d16]",placeholder:"e.g. AgriBio Southern Solutions"}),_.formState.errors.name&&c.jsx("p",{className:"text-[10px] text-rose-500 mt-1",children:_.formState.errors.name.message})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Registration / CIPC Number *"}),c.jsx("input",{type:"text",..._.register("registrationNo"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 font-mono text-white bg-[#090d16]",placeholder:"2020/554129/08"}),_.formState.errors.registrationNo&&c.jsx("p",{className:"text-[10px] text-rose-500 mt-1",children:_.formState.errors.registrationNo.message})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Entity Classification *"}),c.jsx("select",{..._.register("type"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 bg-[#090d16] text-white font-medium",children:cN.map($=>c.jsx("option",{value:$.value,children:$.label},$.value))})]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Official Contact Email *"}),c.jsx("input",{type:"email",..._.register("email"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-white bg-[#090d16]",placeholder:"governance@organisation.org.za"}),_.formState.errors.email&&c.jsx("p",{className:"text-[10px] text-rose-500 mt-1",children:_.formState.errors.email.message})]}),v&&c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Operating Status *"}),c.jsx("select",{..._.register("status"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 bg-[#090d16] text-white font-medium",children:xk.map($=>c.jsx("option",{value:$.value,children:$.label},$.value))})]})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>b(!1),className:"px-3.5 py-2 text-xs font-semibold text-slate-300 bg-slate-800 hover:bg-slate-700 rounded-xl cursor-pointer",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:ce.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-md shadow-blue-500/20 cursor-pointer",children:ce.isPending?"Saving...":v?"Update Organisation":"Register Organisation"})]})]})}),c.jsx(hn,{isOpen:A,onClose:()=>{C(!1),N(null)},title:O?"Edit Funder Portfolio":"Create Funder Portfolio",subtitle:"Strategic allocation bucket grouping multiple programmatic initiatives",children:c.jsxs("form",{onSubmit:Y.handleSubmit($=>Oe.mutate($)),className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Portfolio Title *"}),c.jsx("input",{type:"text",...Y.register("name"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-white bg-[#090d16]",placeholder:"e.g. National Green Hydrogen & Climate Fund"}),Y.formState.errors.name&&c.jsx("p",{className:"text-[10px] text-rose-500 mt-1",children:Y.formState.errors.name.message})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Parent Organisation *"}),c.jsx("select",{...Y.register("organisationId"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 bg-[#090d16] text-white font-medium",children:W.map($=>c.jsx("option",{value:$.id,children:$.name},$.id))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Owner Email *"}),c.jsx("input",{type:"text",...Y.register("ownerId"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 font-mono text-white bg-[#090d16]",placeholder:"khwezim@gmail.com"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Strategic Objective *"}),c.jsx("textarea",{rows:3,...Y.register("description"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-white bg-[#090d16]",placeholder:"Define the overarching funding mandate and target impacts..."}),Y.formState.errors.description&&c.jsx("p",{className:"text-[10px] text-rose-500 mt-1",children:Y.formState.errors.description.message})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>{C(!1),N(null)},className:"px-3.5 py-2 text-xs font-semibold text-slate-300 bg-slate-800 hover:bg-slate-700 rounded-xl cursor-pointer",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:Oe.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-md shadow-blue-500/20 cursor-pointer",children:Oe.isPending?"Saving...":O?"Update Portfolio":"Create Portfolio"})]})]})}),c.jsx(hn,{isOpen:j,onClose:()=>{F(!1),B(null)},title:q?"Edit Strategic Programme":"Create Strategic Programme",subtitle:"Programmatic operational entity funding distinct projects and awards",children:c.jsxs("form",{onSubmit:he.handleSubmit($=>Pe.mutate($)),className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Programme Title *"}),c.jsx("input",{type:"text",...he.register("name"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-white bg-[#090d16]",placeholder:"e.g. DeepTech Venture Commercialisation"}),he.formState.errors.name&&c.jsx("p",{className:"text-[10px] text-rose-500 mt-1",children:he.formState.errors.name.message})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Assign to Portfolio *"}),c.jsx("select",{...he.register("portfolioId"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 bg-[#090d16] text-white font-medium",children:ee.map($=>c.jsx("option",{value:$.id,children:$.name},$.id))})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Governance Status *"}),c.jsx("select",{...he.register("status"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 bg-[#090d16] text-white font-medium",children:dN.map($=>c.jsx("option",{value:$.value,children:$.label},$.value))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Owner Email *"}),c.jsx("input",{type:"text",...he.register("ownerId"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 font-mono text-white bg-[#090d16]",placeholder:"khwezim@gmail.com"})]})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>{F(!1),B(null)},className:"px-3.5 py-2 text-xs font-semibold text-slate-300 bg-slate-800 hover:bg-slate-700 rounded-xl cursor-pointer",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:Pe.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-md shadow-blue-500/20 cursor-pointer",children:Pe.isPending?"Saving...":q?"Update Programme":"Create Programme"})]})]})}),c.jsx(hn,{isOpen:X,onClose:()=>{se(!1),Q(null)},title:`Funding Instruments: ${(re==null?void 0:re.name)||""}`,subtitle:`Authoritative funding instruments linked to Programme #${(re==null?void 0:re.id)||""}`,children:c.jsxs("div",{className:"space-y-4",children:[Ye?c.jsx("div",{className:"py-8 text-center text-xs text-slate-400",children:"Loading funding instruments..."}):Ae.length===0?c.jsx("div",{className:"py-8 text-center text-xs text-slate-500",children:"No funding instruments registered under this programme."}):c.jsx("div",{className:"space-y-2.5 max-h-[400px] overflow-y-auto",children:Ae.map($=>{const Ge=Ml($.status);return c.jsxs("div",{className:"p-3.5 rounded-xl border border-slate-800 bg-[#0d121f] flex flex-col gap-1.5",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-mono text-xs font-bold text-blue-400 bg-blue-500/10 px-2 py-0.5 rounded border border-blue-500/20",children:$.code||`INST-${$.id}`}),c.jsx("span",{className:"font-semibold text-xs text-white",children:$.name})]}),c.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold border ${Ge.className}`,children:Ge.label})]}),$.description&&c.jsx("p",{className:"text-xs text-slate-400 leading-relaxed",children:$.description}),c.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-slate-800/80 text-[10px] text-slate-500 font-mono",children:[c.jsxs("span",{children:["Created by: ",ya($.createdBy)]}),c.jsx("span",{children:Kn($.createdAt)})]})]},$.id)})}),c.jsx("div",{className:"pt-2 border-t border-slate-800 flex justify-end",children:c.jsx("button",{type:"button",onClick:()=>{se(!1),Q(null)},className:"px-4 py-2 text-xs font-semibold text-slate-300 bg-slate-800 hover:bg-slate-700 rounded-xl cursor-pointer",children:"Close"})})]})}),c.jsx(hn,{isOpen:Ce,onClose:()=>{Z(!1),we(null)},title:`Portfolio Programmes: ${(fe==null?void 0:fe.name)||""}`,subtitle:`Programmes allocated under Portfolio #${(fe==null?void 0:fe.id)||""}`,children:c.jsxs("div",{className:"space-y-4",children:[ut?c.jsx("div",{className:"py-8 text-center text-xs text-slate-400",children:"Loading portfolio programmes..."}):$e.length===0?c.jsx("div",{className:"py-8 text-center text-xs text-slate-500",children:"No programmes registered under this portfolio."}):c.jsx("div",{className:"space-y-2.5 max-h-[400px] overflow-y-auto",children:$e.map($=>{const Ge=Xl($.status);return c.jsxs("div",{className:"p-3.5 rounded-xl border border-slate-800 bg-[#0d121f] flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-semibold text-xs text-white block",children:$.name}),c.jsxs("span",{className:"text-[10px] text-slate-500 font-mono",children:["ID: ",$.id," • Owner: ",ya($.ownedBy)," • ",Kn($.createdAt)]})]}),c.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold border ${Ge.className}`,children:Ge.label})]},$.id)})}),c.jsx("div",{className:"pt-2 border-t border-slate-800 flex justify-end",children:c.jsx("button",{type:"button",onClick:()=>{Z(!1),we(null)},className:"px-4 py-2 text-xs font-semibold text-slate-300 bg-slate-800 hover:bg-slate-700 rounded-xl cursor-pointer",children:"Close"})})]})})]})},jU=bs({name:Et().min(4,"Project name must be at least 4 characters"),description:Et().min(10,"Provide a meaningful implementation description"),programmeId:_t().min(1,"Select a programme"),sector:_t().min(1),projectType:_t().min(1)}),EU=bs({title:Et().min(3,"Activity title required"),description:Et().min(5,"Description required"),category:Et().min(2,"Category required"),amount:_t().min(1,"Amount must be positive")}),AU=bs({name:Et().min(4,"Milestone deliverable required"),dueAt:Et().min(4,"Due date is mandatory"),priority:_t().min(1).max(4)}),CU=()=>{var ee;const e=Pa(),{success:n,error:r}=Lc(),[a,o]=T.useState(null),[u,f]=T.useState("activities"),[m,p]=T.useState("all"),[y,g]=T.useState(!1),[b,v]=T.useState(!1),[S,A]=T.useState(!1),{data:C=[]}=Ke({queryKey:["programmes"],queryFn:()=>ff()}),{data:O=[],isLoading:N}=Ke({queryKey:["projects",m],queryFn:()=>m!=="all"?DT(m):hf()}),j=a?a.id:null,{data:F=[]}=Ke({queryKey:["activities",j],queryFn:()=>j?LT(j):Promise.resolve([]),enabled:!!j}),{data:q=[]}=Ke({queryKey:["milestones",j],queryFn:()=>j?HT(j):Promise.resolve([]),enabled:!!j}),{data:B=[]}=Ke({queryKey:["indicators",j],queryFn:()=>j?BT(j):Promise.resolve([]),enabled:!!j}),{data:re=[]}=Ke({queryKey:["risks",j],queryFn:()=>j?$T(j):Promise.resolve([]),enabled:!!j}),Q=hs({resolver:ms(jU),defaultValues:{name:"",description:"",programmeId:(ee=C[0])!=null&&ee.id?Number(C[0].id):0,sector:Jt.AgriTech,projectType:cs.Innovation}}),X=hs({resolver:ms(EU),defaultValues:{title:"",description:"",category:"",amount:0}}),se=hs({resolver:ms(AU),defaultValues:{name:"",dueAt:new Date(Date.now()+2160*60*60*1e3).toISOString().slice(0,10),priority:yr.High}}),fe=Ft({mutationFn:z=>UT(z),onSuccess:z=>{e.invalidateQueries({queryKey:["projects"]}),n("Project registered",`Project "${z.name}" created successfully`),g(!1),Q.reset(),o(z)},onError:z=>{r("Failed to create project",String(z))}}),we=Ft({mutationFn:({projectId:z,status:ue})=>IT({projectId:z,status:ue}),onSuccess:(z,ue)=>{e.invalidateQueries({queryKey:["projects"]}),a&&o({...a,status:ue.status}),n("Status updated","Project governance status changed successfully")},onError:z=>{r("Failed to update status",String(z))}}),Ce=Ft({mutationFn:z=>PT(z),onSuccess:()=>{e.invalidateQueries({queryKey:["activities",j]}),n("Activity added","Activity registered to project work breakdown"),v(!1),X.reset()},onError:z=>{r("Failed to add activity",String(z))}}),Z=Ft({mutationFn:z=>qT(z),onSuccess:()=>{e.invalidateQueries({queryKey:["milestones",j]}),n("Milestone created","Contractual deliverable added to implementation schedule"),A(!1),se.reset()},onError:z=>{r("Failed to add milestone",String(z))}}),W=q.filter(z=>z.status===xt.Approved).length,oe=q.length>0?Math.round(W/q.length*100):0;return c.jsxs("div",{className:"space-y-6 max-w-7xl mx-auto",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 bg-[#0d121f]/90 p-5 rounded-2xl border border-slate-800/80 backdrop-blur-md shadow-xl",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h2",{className:"text-xl font-bold text-white tracking-tight flex items-center gap-2",children:"Project & Milestone Management"}),c.jsx("span",{className:"text-[11px] font-semibold text-blue-400 bg-blue-500/10 px-2.5 py-0.5 rounded-full border border-blue-500/30",children:"Work Breakdown"})]}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"Work breakdown structure, contractual deliverables, milestone evidence tracking, and progress calculation."})]}),c.jsxs("button",{onClick:()=>g(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-md shadow-blue-500/20 transition cursor-pointer self-start sm:self-auto",children:[c.jsx(Rs,{className:"w-4 h-4"}),"Create Project"]})]}),c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6",children:[c.jsxs("div",{className:"lg:col-span-5 space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 px-1",children:[c.jsxs("h3",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider",children:["Projects Directory (",O.length,")"]}),c.jsxs("select",{value:m,onChange:z=>p(z.target.value==="all"?"all":z.target.value),className:"text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl px-2.5 py-1 text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 max-w-[190px] [&>option]:bg-slate-900 [&>option]:text-white",children:[c.jsx("option",{value:"all",children:"All Programmes"}),C.map(z=>c.jsx("option",{value:z.id,children:z.name},z.id))]})]}),N?c.jsx("div",{className:"bg-[#0f1523]/80 p-6 rounded-2xl border border-slate-800/80 text-center text-xs text-slate-400",children:"Loading projects..."}):c.jsx("div",{className:"space-y-2.5",children:O.map(z=>{const ue=(a==null?void 0:a.id)===z.id,Me=Xl(z.status);return c.jsxs("div",{onClick:()=>o(z),className:`p-4 rounded-2xl border transition-all cursor-pointer bg-[#0f1523]/80 backdrop-blur-sm text-left ${ue?"border-blue-500 ring-2 ring-blue-500/20 shadow-lg shadow-blue-500/10":"border-slate-800/80 hover:border-slate-700 hover:shadow-md"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsx("span",{className:"font-bold text-sm text-white leading-snug",children:z.name}),c.jsx("span",{className:`shrink-0 inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold border ${Me.className}`,children:Me.label.split("/")[0]})]}),c.jsx("p",{className:"text-xs text-slate-400 mt-1 line-clamp-2 leading-relaxed",children:z.description}),c.jsxs("div",{className:"flex items-center gap-2 mt-3 pt-2.5 border-t border-slate-800/80 text-[11px] text-slate-400",children:[c.jsx("span",{className:"bg-slate-900/80 text-slate-300 border border-slate-700/80 px-2 py-0.5 rounded-md font-medium",children:fN(z.sector)}),c.jsx("span",{children:"•"}),c.jsx("span",{className:"text-slate-300",children:Sk(z.projectType)})]})]},z.id)})})]}),c.jsx("div",{className:"lg:col-span-7",children:a?c.jsxs("div",{className:"bg-[#0f1523]/80 rounded-2xl border border-slate-800/80 shadow-xl backdrop-blur-md overflow-hidden sticky top-6",children:[c.jsxs("div",{className:"p-6 border-b border-slate-800/80 bg-[#0d121f]/90",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsxs("span",{className:"text-[10px] font-mono uppercase tracking-wider text-blue-400 bg-blue-500/10 px-2.5 py-0.5 rounded-md border border-blue-500/30",children:["Project #",a.id]}),c.jsx("h3",{className:"text-lg font-bold text-white mt-1.5 leading-snug",children:a.name}),c.jsx("p",{className:"text-xs text-slate-400 mt-1 leading-relaxed",children:a.description})]}),c.jsxs("div",{className:"shrink-0 text-right",children:[c.jsx("label",{className:"text-[10px] uppercase font-bold text-slate-400 block mb-1",children:"Approval Status"}),c.jsx("select",{value:a.status,onChange:z=>we.mutate({projectId:a.id,status:Number(z.target.value)}),className:"text-xs font-semibold bg-[#090d16] border border-slate-700/80 rounded-xl px-2.5 py-1.5 text-slate-200 focus:outline-none focus:ring-1 focus:ring-blue-500 cursor-pointer",children:dN.map(z=>c.jsx("option",{value:z.value,children:z.label},z.value))})]})]}),c.jsxs("div",{className:"mt-5 pt-4 border-t border-slate-800/80",children:[c.jsxs("div",{className:"flex items-center justify-between text-xs mb-1.5",children:[c.jsxs("span",{className:"font-semibold text-slate-300 flex items-center gap-1.5",children:[c.jsx(qp,{className:"w-3.5 h-3.5 text-blue-400"}),"Calculated Progress (Milestone-based)"]}),c.jsxs("span",{className:"font-bold text-blue-400",children:[oe,"%"]})]}),c.jsx("div",{className:"w-full h-2 bg-slate-900 rounded-full overflow-hidden border border-slate-800",children:c.jsx("div",{className:"h-full bg-gradient-to-r from-blue-600 to-indigo-500 transition-all duration-300 rounded-full",style:{width:`${oe}%`}})}),c.jsxs("div",{className:"flex justify-between text-[10px] text-slate-500 mt-1",children:[c.jsxs("span",{children:[W," of ",q.length," milestones verified"]}),c.jsx("span",{children:"Target: 100% completion"})]})]})]}),c.jsxs("div",{className:"flex border-b border-slate-800/80 px-4 bg-[#0d121f]/60",children:[c.jsxs("button",{onClick:()=>f("activities"),className:`py-3 px-3 text-xs font-semibold border-b-2 transition flex items-center gap-1.5 cursor-pointer ${u==="activities"?"border-blue-500 text-blue-400":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[c.jsx(XA,{className:"w-3.5 h-3.5"}),"Work Activities (",F.length,")"]}),c.jsxs("button",{onClick:()=>f("milestones"),className:`py-3 px-3 text-xs font-semibold border-b-2 transition flex items-center gap-1.5 cursor-pointer ${u==="milestones"?"border-blue-500 text-blue-400":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[c.jsx(jC,{className:"w-3.5 h-3.5"}),"Milestones (",q.length,")"]}),c.jsxs("button",{onClick:()=>f("indicators"),className:`py-3 px-3 text-xs font-semibold border-b-2 transition flex items-center gap-1.5 cursor-pointer ${u==="indicators"?"border-blue-500 text-blue-400":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[c.jsx(vC,{className:"w-3.5 h-3.5"}),"Indicators (",B.length,")"]}),c.jsxs("button",{onClick:()=>f("risks"),className:`py-3 px-3 text-xs font-semibold border-b-2 transition flex items-center gap-1.5 cursor-pointer ${u==="risks"?"border-blue-500 text-blue-400":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[c.jsx(uS,{className:"w-3.5 h-3.5"}),"Risks (",re.length,")"]})]}),c.jsxs("div",{className:"p-5 max-h-[500px] overflow-y-auto",children:[u==="activities"&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-xs font-bold text-slate-300",children:"Project Work Breakdown"}),c.jsxs("button",{onClick:()=>v(!0),className:"inline-flex items-center gap-1 text-xs font-semibold text-blue-400 bg-blue-500/10 hover:bg-blue-500/20 border border-blue-500/30 px-3 py-1 rounded-xl transition cursor-pointer",children:[c.jsx(Rs,{className:"w-3.5 h-3.5"}),"Add Activity"]})]}),F.length===0?c.jsx("p",{className:"text-xs text-slate-500 py-4 text-center",children:"No activities recorded yet."}):c.jsx("div",{className:"space-y-2.5",children:F.map(z=>c.jsxs("div",{className:"p-3.5 rounded-xl border border-slate-800/80 bg-[#0d121f]/90",children:[c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsx("span",{className:"font-semibold text-xs text-white",children:z.title}),c.jsx("span",{className:"font-mono text-xs font-bold text-blue-400",children:ji(z.amount)})]}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:z.description}),c.jsxs("div",{className:"flex items-center justify-between mt-2 pt-2 border-t border-slate-800/80 text-[10px] text-slate-400",children:[c.jsx("span",{className:"bg-slate-900/80 px-2 py-0.5 rounded-md border border-slate-700/80 text-slate-300 font-medium",children:z.category}),c.jsxs("span",{children:["Date: ",Kn(z.performedAt)]})]})]},z.id))})]}),u==="milestones"&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-xs font-bold text-slate-300",children:"Contractual Milestones"}),c.jsxs("button",{onClick:()=>A(!0),className:"inline-flex items-center gap-1 text-xs font-semibold text-blue-400 bg-blue-500/10 hover:bg-blue-500/20 border border-blue-500/30 px-3 py-1 rounded-xl transition cursor-pointer",children:[c.jsx(Rs,{className:"w-3.5 h-3.5"}),"Add Milestone"]})]}),q.length===0?c.jsx("p",{className:"text-xs text-slate-500 py-4 text-center",children:"No milestones scheduled."}):c.jsx("div",{className:"space-y-2.5",children:q.map(z=>{const ue=Xl(z.status),Me=wk(z.priority);return c.jsxs("div",{className:"p-3.5 rounded-xl border border-slate-800/80 bg-[#0d121f]/90 space-y-2",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsx("span",{className:"font-semibold text-xs text-white",children:z.name}),c.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold border ${ue.className}`,children:ue.label})]}),c.jsxs("div",{className:"flex items-center justify-between text-[11px] text-slate-400",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(cC,{className:"w-3 h-3 text-slate-500"}),"Due: ",Kn(z.dueAt)]}),c.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-md font-medium border ${Me.className}`,children:Me.label})]})]},z.id)})})]}),u==="indicators"&&c.jsxs("div",{className:"space-y-3",children:[c.jsx("span",{className:"text-xs font-bold text-slate-300 block",children:"Assigned Project Indicators"}),B.length===0?c.jsx("p",{className:"text-xs text-slate-500 py-4 text-center",children:"No indicators attached."}):B.map(z=>{const ue=z.targetAmount>0?Math.round(z.actualAmount/z.targetAmount*100):0;return c.jsxs("div",{className:"p-3.5 rounded-xl border border-slate-800/80 bg-[#0d121f]/90 space-y-1.5",children:[c.jsxs("div",{className:"flex justify-between text-xs font-semibold",children:[c.jsx("span",{className:"text-white",children:z.name}),c.jsxs("span",{className:ue>=90?"text-emerald-400":"text-amber-400",children:[ue,"%"]})]}),c.jsxs("div",{className:"flex justify-between text-[11px] text-slate-400",children:[c.jsxs("span",{children:["Baseline: ",z.baselineAmount]}),c.jsxs("span",{children:["Target: ",z.targetAmount]}),c.jsxs("span",{className:"font-bold text-slate-200",children:["Actual: ",z.actualAmount]})]})]},z.id)})]}),u==="risks"&&c.jsxs("div",{className:"space-y-3",children:[c.jsx("span",{className:"text-xs font-bold text-slate-300 block",children:"Project Risk Register (M09)"}),re.length===0?c.jsx("p",{className:"text-xs text-slate-500 py-4 text-center",children:"No project risks logged."}):re.map(z=>c.jsxs("div",{className:"p-3.5 rounded-xl border border-slate-800/80 bg-[#0d121f]/90 space-y-1",children:[c.jsxs("div",{className:"flex justify-between text-xs font-semibold text-white",children:[c.jsx("span",{children:z.name}),c.jsxs("span",{className:"text-[10px] font-bold text-rose-400 bg-rose-500/10 px-2 py-0.5 rounded-md border border-rose-500/30 font-mono",children:["Score: ",z.likelihood*z.impact," / 25"]})]}),c.jsx("p",{className:"text-xs text-slate-400",children:z.description}),z.mitigationAction&&c.jsxs("p",{className:"text-[11px] text-emerald-400 bg-emerald-500/10 p-2 rounded-lg mt-1.5 border border-emerald-500/20",children:[c.jsx("strong",{className:"text-emerald-300",children:"Mitigation:"})," ",z.mitigationAction]})]},z.id))]})]})]}):c.jsxs("div",{className:"bg-[#0f1523]/80 rounded-2xl border border-dashed border-slate-800 p-12 text-center text-slate-400 flex flex-col items-center justify-center",children:[c.jsx(Pp,{className:"w-10 h-10 text-slate-600 mb-3"}),c.jsx("p",{className:"text-sm font-semibold text-slate-200",children:"Select a project to inspect implementation"}),c.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"View activities, milestones, indicators, and risk controls."})]})})]}),c.jsx(hn,{isOpen:y,onClose:()=>g(!1),title:"Create Funded Project",subtitle:"Operational entity under an approved Programme",children:c.jsxs("form",{onSubmit:Q.handleSubmit(z=>fe.mutate(z)),className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Project Name *"}),c.jsx("input",{type:"text",...Q.register("name"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-white bg-[#090d16]",placeholder:"e.g. Drone Precision Seed & Thermal Scouting"}),Q.formState.errors.name&&c.jsx("p",{className:"text-[10px] text-rose-500 mt-1",children:Q.formState.errors.name.message})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Parent Programme *"}),c.jsx("select",{...Q.register("programmeId"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 bg-[#090d16] text-white font-medium",children:C.map(z=>c.jsx("option",{value:z.id,children:z.name},z.id))})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Industry Sector *"}),c.jsx("select",{...Q.register("sector"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 bg-[#090d16] text-white font-medium",children:oN.map(z=>c.jsx("option",{value:z.value,children:z.label},z.value))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Project Type *"}),c.jsx("select",{...Q.register("projectType"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 bg-[#090d16] text-white font-medium",children:lN.map(z=>c.jsx("option",{value:z.value,children:z.label},z.value))})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Project Scope & Objectives *"}),c.jsx("textarea",{rows:3,...Q.register("description"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-white bg-[#090d16]",placeholder:"Outline the operational work, methodology, and key milestones..."})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>g(!1),className:"px-3.5 py-2 text-xs font-semibold text-slate-300 bg-slate-800 hover:bg-slate-700 rounded-xl cursor-pointer",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:fe.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-md shadow-blue-500/20 cursor-pointer",children:fe.isPending?"Creating...":"Register Project"})]})]})}),c.jsx(hn,{isOpen:b,onClose:()=>v(!1),title:"Add Activity to Implementation Plan",subtitle:`Registering activity under Project #${j}`,children:c.jsxs("form",{onSubmit:X.handleSubmit(z=>Ce.mutate({projectId:j,...z})),className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Activity Title *"}),c.jsx("input",{type:"text",...X.register("title"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-white bg-[#090d16]",placeholder:"e.g. Cleanroom Sensor Calibration"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Budget Allocation (ZAR) *"}),c.jsx("input",{type:"number",...X.register("amount"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 font-mono text-white bg-[#090d16]"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Cost Category *"}),c.jsx("input",{type:"text",...X.register("category"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-white bg-[#090d16]",placeholder:"Hardware / Field Testing"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Description *"}),c.jsx("textarea",{rows:2,...X.register("description"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-white bg-[#090d16]"})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>v(!1),className:"px-3.5 py-2 text-xs font-semibold text-slate-300 bg-slate-800 hover:bg-slate-700 rounded-xl cursor-pointer",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:Ce.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-md shadow-blue-500/20 cursor-pointer",children:Ce.isPending?"Saving...":"Add Activity"})]})]})}),c.jsx(hn,{isOpen:S,onClose:()=>A(!1),title:"Define Contractual Milestone",subtitle:`Deliverable schedule for Project #${j}`,children:c.jsxs("form",{onSubmit:se.handleSubmit(z=>Z.mutate({projectId:j,...z})),className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Milestone Deliverable Name *"}),c.jsx("input",{type:"text",...se.register("name"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-white bg-[#090d16]",placeholder:"e.g. Milestone 4: Prototype Pilot Validation Report"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Contractual Due Date *"}),c.jsx("input",{type:"date",...se.register("dueAt"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 text-white bg-[#090d16]"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Priority Level *"}),c.jsx("select",{...se.register("priority"),className:"w-full px-3 py-2 text-xs border border-slate-700/80 rounded-xl focus:outline-none focus:ring-1 focus:ring-blue-500 bg-[#090d16] text-white font-medium",children:bk.map(z=>c.jsx("option",{value:z.value,children:z.label},z.value))})]})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>A(!1),className:"px-3.5 py-2 text-xs font-semibold text-slate-300 bg-slate-800 hover:bg-slate-700 rounded-xl cursor-pointer",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:Z.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-md shadow-blue-500/20 cursor-pointer",children:Z.isPending?"Saving...":"Define Milestone"})]})]})})]})},OU=bs({referenceNo:Et().min(4,"Approval / Reference number is mandatory (FR-M01-002)"),amount:_t().min(1,"Approved funding amount must be > 0 (FR-M01-003)"),fundingPeriod:Et().min(3,"Funding period is mandatory (e.g. 24 Months)"),organisationId:_t().min(1,"Select recipient organisation (FR-M01-006)"),programmeId:_t().min(1,"Select funding programme (FR-M01-005)")}),RU=bs({awardId:_t().min(1,"Select approved award"),totalValue:_t().min(1,"Total value is required"),effectiveAt:Et().min(4,"Effective date is mandatory"),expiresAt:Et().min(4,"Expiry date is mandatory")}),TU=bs({contractId:_t().min(1),externalSignatureId:Et().min(4,"Digital signature ID is required"),signedDocumentUrl:Et().url("Must be a valid document URL")}),kU=bs({projectId:_t().min(1,"Select project"),name:Et().min(3,"Budget category name required"),amount:_t().min(1,"Amount must be greater than zero")}),DU=bs({projectId:_t().min(1,"Select project"),milestoneId:_t().optional(),amount:_t().min(1,"Disbursement tranche amount required")}),MU=()=>{var _e,je,at,Tt,Zt;const e=Pa(),{success:n,error:r}=Lc(),[a,o]=T.useState("awards"),[u,f]=T.useState(!1),[m,p]=T.useState(!1),[y,g]=T.useState(!1),[b,v]=T.useState(null),[S,A]=T.useState(!1),[C,O]=T.useState(!1),{data:N=[],isLoading:j}=Ke({queryKey:["awards"],queryFn:()=>Yp(1,100)}),{data:F=[],isLoading:q}=Ke({queryKey:["contracts"],queryFn:()=>eN(1,100)}),{data:B=[],isLoading:re}=Ke({queryKey:["budgets"],queryFn:()=>tN(1,100)}),{data:Q=[],isLoading:X}=Ke({queryKey:["disbursements"],queryFn:()=>nN(1,100)}),{data:se=[]}=Ke({queryKey:["organisations"],queryFn:()=>df()}),{data:fe=[]}=Ke({queryKey:["programmes"],queryFn:()=>ff()}),{data:we=[]}=Ke({queryKey:["projects"],queryFn:()=>hf()}),{data:Ce=[]}=Ke({queryKey:["milestones-all"],queryFn:()=>WS()}),Z=hs({resolver:ms(OU),defaultValues:{referenceNo:"",amount:1e7,fundingPeriod:"24 Months",organisationId:(_e=se[0])!=null&&_e.id?Number(se[0].id):101,programmeId:(je=fe[0])!=null&&je.id?Number(fe[0].id):301}}),W=hs({resolver:ms(RU),defaultValues:{awardId:(at=N[0])!=null&&at.id?Number(N[0].id):501,totalValue:1e7,effectiveAt:new Date().toISOString().slice(0,10),expiresAt:new Date(Date.now()+365*24*60*60*1e3).toISOString().slice(0,10)}}),oe=hs({resolver:ms(TU),defaultValues:{contractId:0,externalSignatureId:"",signedDocumentUrl:""}}),ee=hs({resolver:ms(kU),defaultValues:{projectId:(Tt=we[0])!=null&&Tt.id?Number(we[0].id):401,name:"",amount:1e6}}),z=hs({resolver:ms(DU),defaultValues:{projectId:(Zt=we[0])!=null&&Zt.id?Number(we[0].id):401,amount:25e5}}),ue=Ft({mutationFn:J=>FT(J),onSuccess:J=>{e.invalidateQueries({queryKey:["awards"]}),e.invalidateQueries({queryKey:["contracts"]}),e.invalidateQueries({queryKey:["dashboard"]}),n("Award Registered & Contract Initiated",`Award ${J.referenceNo} recorded. Automated Contract workflow initiated (BR-002).`),f(!1),Z.reset()},onError:J=>{r("Award registration failed",String(J))}}),Me=Ft({mutationFn:J=>VT(J),onSuccess:()=>{e.invalidateQueries({queryKey:["contracts"]}),n("Contract generated","New legal agreement created in Draft state"),p(!1),W.reset()},onError:J=>{r("Contract creation failed",String(J))}}),Ae=Ft({mutationFn:J=>KT(J),onSuccess:()=>{e.invalidateQueries({queryKey:["contracts"]}),n("Contract Executed & Locked","Agreement locked as authoritative version (AT-02). Downstream budgets and disbursements enabled."),g(!1),oe.reset()},onError:J=>{r("Execution trigger failed",String(J))}}),Ye=Ft({mutationFn:J=>YT(J),onSuccess:()=>{e.invalidateQueries({queryKey:["budgets"]}),n("Budget line established","Budget line created against project"),A(!1),ee.reset()},onError:J=>{r("Budget creation failed",String(J))}}),$e=Ft({mutationFn:J=>JT(J),onSuccess:()=>{e.invalidateQueries({queryKey:["disbursements"]}),n("Disbursement Scheduled","Payment tranche added in Pending Review state"),O(!1),z.reset()},onError:J=>{r("Disbursement creation failed",String(J))}}),ut=Ft({mutationFn:J=>XT(J),onSuccess:()=>{e.invalidateQueries({queryKey:["disbursements"]}),e.invalidateQueries({queryKey:["dashboard"]}),n("Payment Approved & Released","Conditions precedent verified. EFT reference generated and disbursement ledger updated (AT-05).")},onError:J=>{r("Disbursement approval failed",String(J))}}),_=J=>{v(J),oe.reset({contractId:Number(J.id),externalSignatureId:`SIG-DIGITAL-${Math.floor(1e5+Math.random()*9e5)}`,signedDocumentUrl:`https://documents.ifri.khongisa.co.za/contracts/CTR-${J.id}-Signed.pdf`}),g(!0)},Y=async J=>{try{const Re=await QT(J);Re?(window.open(Re,"_blank","noopener,noreferrer"),n("Secure URL Retrieved","Temporary signed download link opened.")):r("Download Error","No active secure download link generated.")}catch(Re){r("Link Error",(Re==null?void 0:Re.message)||"Failed to fetch contract secure link.")}},he=async(J,Re)=>{try{await GT(J,Re),n("Document Attached",`Contract #${J} document uploaded successfully.`),e.invalidateQueries({queryKey:["contracts"]})}catch(pe){r("Upload Failed",(pe==null?void 0:pe.message)||"Contract file upload failed.")}},ce=async(J,Re)=>{try{await ZT({contractId:J,status:Re}),n("Contract Updated",`Contract status updated to ${Qw(Re).label}.`),e.invalidateQueries({queryKey:["contracts"]})}catch(pe){r("Update Failed",(pe==null?void 0:pe.message)||"Failed to update contract status.")}},Oe=N.reduce((J,Re)=>J+(Number(Re.amount)||0),0),Pe=Q.filter(J=>J.status===xt.Approved).reduce((J,Re)=>J+(Number(Re.amount)||0),0),qe=Q.filter(J=>J.status===xt.PendingReview).reduce((J,Re)=>J+(Number(Re.amount)||0),0);return c.jsxs("div",{className:"space-y-6 max-w-7xl mx-auto",children:[c.jsxs("div",{className:"bg-[#0f1523]/80 backdrop-blur-md p-6 rounded-2xl border border-slate-800/80 shadow-xl space-y-5",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-2xl font-bold text-white tracking-tight flex items-center gap-2",children:"Grant & Financial Management"}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"End-to-end controlled execution thread: Funding Award Intake → Contracting → Budgeting → Condition-Checked Disbursement."})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[a==="awards"&&c.jsxs("button",{onClick:()=>f(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:[c.jsx(Rs,{className:"w-4 h-4"}),"Register Approved Award"]}),a==="contracts"&&c.jsxs("button",{onClick:()=>p(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:[c.jsx(Rs,{className:"w-4 h-4"}),"Draft Contract"]}),a==="budgets"&&c.jsxs("button",{onClick:()=>A(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:[c.jsx(Rs,{className:"w-4 h-4"}),"Add Budget Line"]}),a==="disbursements"&&c.jsxs("button",{onClick:()=>O(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:[c.jsx(Rs,{className:"w-4 h-4"}),"Schedule Disbursement"]})]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 pt-3 border-t border-slate-800/80 text-xs",children:[c.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-900/60 border border-slate-800/80 flex items-center justify-between",children:[c.jsx("span",{className:"text-slate-400 font-medium",children:"Total Awards Registered"}),c.jsx("span",{className:"font-bold text-white font-mono",children:Ei(Oe)})]}),c.jsxs("div",{className:"p-3.5 rounded-xl bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-between",children:[c.jsx("span",{className:"text-emerald-400 font-medium",children:"Disbursed (Verified & Paid)"}),c.jsx("span",{className:"font-bold text-emerald-300 font-mono",children:Ei(Pe)})]}),c.jsxs("div",{className:"p-3.5 rounded-xl bg-amber-500/10 border border-amber-500/20 flex items-center justify-between",children:[c.jsx("span",{className:"text-amber-400 font-medium",children:"Pending Release"}),c.jsx("span",{className:"font-bold text-amber-300 font-mono",children:Ei(qe)})]})]})]}),c.jsxs("div",{className:"flex gap-2 border-b border-slate-800/80 pb-3 overflow-x-auto",children:[c.jsxs("button",{onClick:()=>o("awards"),className:`px-4 py-2 text-xs font-medium rounded-xl transition flex items-center gap-2 ${a==="awards"?"bg-blue-600 text-white shadow-lg shadow-blue-600/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50"}`,children:[c.jsx(Ic,{className:"w-4 h-4"}),"Awards Intake (",N.length,")"]}),c.jsxs("button",{onClick:()=>o("contracts"),className:`px-4 py-2 text-xs font-medium rounded-xl transition flex items-center gap-2 ${a==="contracts"?"bg-blue-600 text-white shadow-lg shadow-blue-600/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50"}`,children:[c.jsx(fS,{className:"w-4 h-4"}),"Contracts & Agreements (",F.length,")"]}),c.jsxs("button",{onClick:()=>o("budgets"),className:`px-4 py-2 text-xs font-medium rounded-xl transition flex items-center gap-2 ${a==="budgets"?"bg-blue-600 text-white shadow-lg shadow-blue-600/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50"}`,children:[c.jsx(sC,{className:"w-4 h-4"}),"Budget Lines (",B.length,")"]}),c.jsxs("button",{onClick:()=>o("disbursements"),className:`px-4 py-2 text-xs font-medium rounded-xl transition flex items-center gap-2 ${a==="disbursements"?"bg-blue-600 text-white shadow-lg shadow-blue-600/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50"}`,children:[c.jsx(QA,{className:"w-4 h-4"}),"Disbursements & Approvals (",Q.length,")"]})]}),a==="awards"&&c.jsx("div",{className:"bg-[#0f1523]/80 backdrop-blur-md rounded-2xl border border-slate-800/80 shadow-xl overflow-hidden",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-slate-900/60 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold",children:[c.jsx("th",{className:"py-3.5 px-5",children:"Approval Reference #"}),c.jsx("th",{className:"py-3.5 px-4",children:"Recipient Organisation"}),c.jsx("th",{className:"py-3.5 px-4",children:"Funding Programme"}),c.jsx("th",{className:"py-3.5 px-4 text-right",children:"Approved Amount (ZAR)"}),c.jsx("th",{className:"py-3.5 px-4",children:"Status"}),c.jsx("th",{className:"py-3.5 px-5 text-right",children:"Date Registered"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-800/50",children:j?c.jsx("tr",{children:c.jsx("td",{colSpan:6,className:"py-8 text-center text-slate-500",children:"Loading registered awards..."})}):N.map(J=>{const Re=Xl(J.status);return c.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors",children:[c.jsxs("td",{className:"py-3.5 px-5",children:[c.jsx("span",{className:"font-mono font-bold text-white block",children:J.referenceNo}),c.jsxs("span",{className:"text-[10px] text-slate-500 font-mono",children:["System ID: #",J.id]})]}),c.jsx("td",{className:"py-3.5 px-4 text-slate-200 font-medium",children:J.organisationName||`Org #${J.organisationId}`}),c.jsx("td",{className:"py-3.5 px-4 text-slate-400",children:J.programmeName||`Programme #${J.programmeId}`}),c.jsx("td",{className:"py-3.5 px-4 text-right font-mono font-bold text-white text-xs",children:ji(J.amount)}),c.jsx("td",{className:"py-3.5 px-4",children:c.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold border ${Re.className}`,children:Re.label})}),c.jsx("td",{className:"py-3.5 px-5 text-right font-mono text-slate-400",children:Kn(J.createdAt)})]},J.id)})})]})})}),a==="contracts"&&c.jsx("div",{className:"bg-[#0f1523]/80 backdrop-blur-md rounded-2xl border border-slate-800/80 shadow-xl overflow-hidden",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-slate-900/60 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold",children:[c.jsx("th",{className:"py-3.5 px-5",children:"Contract ID"}),c.jsx("th",{className:"py-3.5 px-4",children:"Associated Award"}),c.jsx("th",{className:"py-3.5 px-4 text-right",children:"Total Contract Value"}),c.jsx("th",{className:"py-3.5 px-4",children:"Effective / Expiry"}),c.jsx("th",{className:"py-3.5 px-4",children:"Status"}),c.jsx("th",{className:"py-3.5 px-5 text-right",children:"Action"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-800/50",children:q?c.jsx("tr",{children:c.jsx("td",{colSpan:6,className:"py-8 text-center text-slate-500",children:"Loading contracts..."})}):F.map(J=>{const Re=Qw(J.status),pe=J.status===dn.Executed;return c.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors",children:[c.jsxs("td",{className:"py-3.5 px-5 font-mono font-bold text-white",children:["CTR-",J.id]}),c.jsxs("td",{className:"py-3.5 px-4 text-slate-300 font-medium",children:["Award #",J.awardId]}),c.jsx("td",{className:"py-3.5 px-4 text-right font-mono font-bold text-white",children:ji(J.totalValue)}),c.jsxs("td",{className:"py-3.5 px-4 text-slate-400 font-mono text-[11px]",children:[Kn(J.effectiveAt)," → ",Kn(J.expiresAt)]}),c.jsx("td",{className:"py-3.5 px-4",children:c.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-[10px] font-semibold border ${Re.className}`,children:Re.label})}),c.jsx("td",{className:"py-3.5 px-5 text-right",children:c.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[c.jsx("button",{type:"button",onClick:()=>Y(J.id),title:"Fetch Secure Download URL",className:"p-1.5 rounded-lg text-slate-400 hover:text-white bg-slate-900/60 hover:bg-slate-800 border border-slate-700/60 transition cursor-pointer",children:c.jsx(hS,{className:"w-3.5 h-3.5"})}),c.jsxs("label",{title:"Upload Executed Contract Document",className:"p-1.5 rounded-lg text-slate-400 hover:text-white bg-slate-900/60 hover:bg-slate-800 border border-slate-700/60 transition cursor-pointer inline-flex items-center",children:[c.jsx(bS,{className:"w-3.5 h-3.5"}),c.jsx("input",{type:"file",className:"hidden",onChange:$=>{var rt;const Ge=(rt=$.target.files)==null?void 0:rt[0];Ge&&he(J.id,Ge)}})]}),c.jsxs("select",{value:J.status,onChange:$=>ce(J.id,Number($.target.value)),className:"text-[10px] bg-slate-900/80 border border-slate-700/80 rounded-lg px-2 py-1 text-slate-200 focus:outline-none focus:ring-1 focus:ring-blue-500 [&>option]:bg-slate-900 [&>option]:text-white cursor-pointer",title:"Update Status",children:[c.jsx("option",{value:dn.Draft,children:"Draft"}),c.jsx("option",{value:dn.PendingApproval,children:"Pending Approval"}),c.jsx("option",{value:dn.Active,children:"Active / Executed"}),c.jsx("option",{value:dn.Terminated,children:"Terminated"})]}),pe?c.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] text-emerald-400 font-semibold bg-emerald-500/10 px-2 py-1 rounded-lg border border-emerald-500/20",children:[c.jsx(HC,{className:"w-3 h-3"}),"Locked"]}):c.jsxs("button",{type:"button",onClick:()=>_(J),className:"inline-flex items-center gap-1 px-2.5 py-1 text-[11px] font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-lg shadow-xs shadow-blue-500/20 transition cursor-pointer",children:[c.jsx(xC,{className:"w-3 h-3"}),"Execute"]})]})})]},J.id)})})]})})}),a==="budgets"&&c.jsx("div",{className:"bg-[#0f1523]/80 backdrop-blur-md rounded-2xl border border-slate-800/80 shadow-xl overflow-hidden",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-slate-900/60 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold",children:[c.jsx("th",{className:"py-3.5 px-5",children:"Budget Line Category"}),c.jsx("th",{className:"py-3.5 px-4",children:"Project ID"}),c.jsx("th",{className:"py-3.5 px-4 text-right",children:"Approved Amount (ZAR)"}),c.jsx("th",{className:"py-3.5 px-4",children:"Date Established"}),c.jsx("th",{className:"py-3.5 px-5 text-right",children:"Created By"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-800/50",children:re?c.jsx("tr",{children:c.jsx("td",{colSpan:5,className:"py-8 text-center text-slate-500",children:"Loading budget lines..."})}):B.map(J=>c.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors",children:[c.jsx("td",{className:"py-3.5 px-5 font-semibold text-white",children:J.name}),c.jsxs("td",{className:"py-3.5 px-4 text-slate-400 font-mono",children:["Project #",J.projectId]}),c.jsx("td",{className:"py-3.5 px-4 text-right font-mono font-bold text-white",children:ji(J.amount)}),c.jsx("td",{className:"py-3.5 px-4 font-mono text-slate-400",children:Kn(J.createdAt)}),c.jsx("td",{className:"py-3.5 px-5 text-right font-mono text-slate-400",children:ya(J.createdBy)})]},J.id))})]})})}),a==="disbursements"&&c.jsxs("div",{className:"bg-[#0f1523]/80 backdrop-blur-md rounded-2xl border border-slate-800/80 shadow-xl overflow-hidden",children:[c.jsx("div",{className:"p-4 border-b border-slate-800/80 bg-amber-500/10 flex items-center justify-between",children:c.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-300",children:[c.jsx(Hp,{className:"w-4 h-4 text-amber-400"}),c.jsx("span",{className:"font-semibold",children:"Disbursement Control:"}),c.jsx("span",{className:"text-amber-200/80",children:"Disbursement cannot be released unless contractual conditions are verified. Duplicate approvals blocked."})]})}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-slate-900/60 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold",children:[c.jsx("th",{className:"py-3.5 px-5",children:"Disbursement ID"}),c.jsx("th",{className:"py-3.5 px-4",children:"Project ID"}),c.jsx("th",{className:"py-3.5 px-4",children:"Milestone Association"}),c.jsx("th",{className:"py-3.5 px-4 text-right",children:"Tranche Amount"}),c.jsx("th",{className:"py-3.5 px-4",children:"Payment Reference"}),c.jsx("th",{className:"py-3.5 px-4",children:"Approval Status"}),c.jsx("th",{className:"py-3.5 px-5 text-right",children:"Approval Action"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-800/50",children:X?c.jsx("tr",{children:c.jsx("td",{colSpan:7,className:"py-8 text-center text-slate-500",children:"Loading disbursements..."})}):Q.map(J=>{const Re=Xl(J.status),pe=J.status===xt.Approved;return c.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors",children:[c.jsxs("td",{className:"py-3.5 px-5 font-mono font-bold text-white",children:["DSB-",J.id]}),c.jsxs("td",{className:"py-3.5 px-4 text-slate-300 font-mono",children:["Project #",J.projectId]}),c.jsx("td",{className:"py-3.5 px-4 text-slate-400 font-medium",children:J.milestoneId?`Milestone #${J.milestoneId}`:"Initial Advance Tranche"}),c.jsx("td",{className:"py-3.5 px-4 text-right font-mono font-bold text-white text-xs",children:ji(J.amount)}),c.jsx("td",{className:"py-3.5 px-4 font-mono text-slate-400 text-[11px]",children:J.paymentReference||c.jsx("span",{className:"text-slate-500 italic",children:"Pending Release"})}),c.jsx("td",{className:"py-3.5 px-4",children:c.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold border ${Re.className}`,children:Re.label})}),c.jsx("td",{className:"py-3.5 px-5 text-right",children:pe?c.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-emerald-400 font-semibold bg-emerald-500/10 px-2.5 py-1 rounded-lg border border-emerald-500/20",children:[c.jsx(X0,{className:"w-3.5 h-3.5"}),"Released"]}):c.jsxs("button",{onClick:()=>ut.mutate(J.id),disabled:ut.isPending,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-lg shadow-md shadow-blue-500/20 transition",children:[c.jsx(X0,{className:"w-3.5 h-3.5"}),"Approve Payment"]})})]},J.id)})})]})})]}),c.jsx(hn,{isOpen:u,onClose:()=>f(!1),title:"Register Approved Funding Award",subtitle:"Step 1 of 3 — Award Details",children:c.jsxs("form",{onSubmit:Z.handleSubmit(J=>ue.mutate(J)),className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Approval / Reference Number *"}),c.jsx("input",{type:"text",...Z.register("referenceNo"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 font-mono transition",placeholder:"AWD-2026-NSI-088"}),Z.formState.errors.referenceNo&&c.jsx("p",{className:"text-[10px] text-rose-400 mt-1",children:Z.formState.errors.referenceNo.message})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Approved Funding Amount (ZAR) *"}),c.jsx("input",{type:"number",...Z.register("amount"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 font-mono transition"}),Z.formState.errors.amount&&c.jsx("p",{className:"text-[10px] text-rose-400 mt-1",children:Z.formState.errors.amount.message})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Recipient Organisation [search] *"}),c.jsx("select",{...Z.register("organisationId"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition [&>option]:bg-slate-900 [&>option]:text-white",children:se.map(J=>c.jsx("option",{value:J.id,children:J.name},J.id))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Funding Programme / Instrument *"}),c.jsx("select",{...Z.register("programmeId"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition [&>option]:bg-slate-900 [&>option]:text-white",children:fe.map(J=>c.jsx("option",{value:J.id,children:J.name},J.id))})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Funding Period *"}),c.jsx("input",{type:"text",...Z.register("fundingPeriod"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition",placeholder:"e.g. 24 Months (1 Oct 2026 – 30 Sep 2028)"})]}),c.jsxs("div",{className:"p-3 rounded-xl bg-blue-500/10 border border-blue-500/20 text-[11px] text-blue-300 space-y-1",children:[c.jsx("span",{className:"font-bold block",children:"Workflow Automation:"}),c.jsx("span",{children:"Submitting this record will automatically initiate the Contract/Agreement workflow."})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>f(!1),className:"px-4 py-2 text-xs font-medium text-slate-300 bg-slate-800/80 hover:bg-slate-700 rounded-xl transition",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:ue.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:ue.isPending?"Submitting...":"Submit Award & Initiate Contract"})]})]})}),c.jsx(hn,{isOpen:m,onClose:()=>p(!1),title:"Draft Contract Agreement",subtitle:"Convert approved funding decision into legally enforceable terms",children:c.jsxs("form",{onSubmit:W.handleSubmit(J=>Me.mutate(J)),className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Select Award *"}),c.jsx("select",{...W.register("awardId"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition [&>option]:bg-slate-900 [&>option]:text-white",children:N.map(J=>c.jsxs("option",{value:J.id,children:[J.referenceNo," — ",ji(J.amount)]},J.id))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Contract Total Value (ZAR) *"}),c.jsx("input",{type:"number",...W.register("totalValue"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 font-mono transition"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Effective Date *"}),c.jsx("input",{type:"date",...W.register("effectiveAt"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Expiry Date *"}),c.jsx("input",{type:"date",...W.register("expiresAt"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition"})]})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>p(!1),className:"px-4 py-2 text-xs font-medium text-slate-300 bg-slate-800/80 hover:bg-slate-700 rounded-xl transition",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:Me.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:Me.isPending?"Generating...":"Create Contract"})]})]})}),c.jsx(hn,{isOpen:y,onClose:()=>g(!1),title:"Execute Contract & Lock Agreement",subtitle:`Locking Contract #${b==null?void 0:b.id} as Authoritative Version`,children:c.jsxs("form",{onSubmit:oe.handleSubmit(J=>Ae.mutate(J)),className:"space-y-4",children:[c.jsx("div",{className:"p-3.5 bg-slate-900/60 border border-slate-800/80 rounded-xl text-xs space-y-1 text-slate-300",children:c.jsxs("p",{children:[c.jsx("strong",{className:"text-white",children:"Obligation:"})," Once executed, the agreement is locked and downstream budget control and disbursement requests are enabled."]})}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"External Electronic Signature ID *"}),c.jsx("input",{type:"text",...oe.register("externalSignatureId"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 font-mono transition",placeholder:"e.g. SIG-DOCUSIGN-993821"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Signed Document URL / Vault *"}),c.jsx("input",{type:"url",...oe.register("signedDocumentUrl"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 font-mono transition"})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>g(!1),className:"px-4 py-2 text-xs font-medium text-slate-300 bg-slate-800/80 hover:bg-slate-700 rounded-xl transition",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:Ae.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:Ae.isPending?"Executing...":"Confirm Execution & Lock"})]})]})}),c.jsx(hn,{isOpen:S,onClose:()=>A(!1),title:"Add Project Budget Line",subtitle:"Maintain approved expenditure breakdown and commitments",children:c.jsxs("form",{onSubmit:ee.handleSubmit(J=>Ye.mutate(J)),className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Associated Project *"}),c.jsx("select",{...ee.register("projectId"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition [&>option]:bg-slate-900 [&>option]:text-white",children:we.map(J=>c.jsx("option",{value:J.id,children:J.name},J.id))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Budget Category Name *"}),c.jsx("input",{type:"text",...ee.register("name"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition",placeholder:"e.g. Specialized Equipment & Prototype Probes"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Approved Line Amount (ZAR) *"}),c.jsx("input",{type:"number",...ee.register("amount"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 font-mono transition"})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>A(!1),className:"px-4 py-2 text-xs font-medium text-slate-300 bg-slate-800/80 hover:bg-slate-700 rounded-xl transition",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:Ye.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:Ye.isPending?"Saving...":"Add Budget Line"})]})]})}),c.jsx(hn,{isOpen:C,onClose:()=>O(!1),title:"Schedule Disbursement Tranche",subtitle:"Link disbursement to milestone verification and conditions precedent",children:c.jsxs("form",{onSubmit:z.handleSubmit(J=>$e.mutate(J)),className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Select Project *"}),c.jsx("select",{...z.register("projectId"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition [&>option]:bg-slate-900 [&>option]:text-white",children:we.map(J=>c.jsx("option",{value:J.id,children:J.name},J.id))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Linked Milestone Deliverable"}),c.jsxs("select",{...z.register("milestoneId"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition [&>option]:bg-slate-900 [&>option]:text-white",children:[c.jsx("option",{value:"",children:"-- Advance Tranche (No linked milestone) --"}),Ce.map(J=>c.jsx("option",{value:J.id,children:J.name},J.id))]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Tranche Amount (ZAR) *"}),c.jsx("input",{type:"number",...z.register("amount"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 font-mono transition"})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>O(!1),className:"px-4 py-2 text-xs font-medium text-slate-300 bg-slate-800/80 hover:bg-slate-700 rounded-xl transition",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:$e.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:$e.isPending?"Scheduling...":"Schedule Disbursement"})]})]})})]})},zU=bs({projectId:_t().min(1,"Select project"),name:Et().min(5,"Indicator definition required"),unitOfMeasure:_t().min(1),baselineAmount:_t().min(0),targetAmount:_t().min(1,"Target must be > 0")}),UU=bs({projectId:_t().min(1,"Select project"),name:Et().min(5,"Risk title required"),description:Et().min(10,"Risk description required"),likelihood:_t().min(1).max(5),impact:_t().min(1).max(5)}),IU=()=>{var $e,ut;const e=Pa(),{success:n,error:r}=Lc(),[a,o]=T.useState("evidence"),u=T.useRef(null),[f,m]=T.useState(!1),[p,y]=T.useState(!1),[g,b]=T.useState(null),[v,S]=T.useState(0),[A,C]=T.useState(In.CompletionCertificate),[O,N]=T.useState(""),[j,F]=T.useState("all"),{data:q=[],isLoading:B}=Ke({queryKey:["indicators"],queryFn:()=>ek()}),{data:re=[],isLoading:Q}=Ke({queryKey:["evidence",j],queryFn:()=>j!=="all"?ak(j):rk()}),{data:X=[],isLoading:se}=Ke({queryKey:["risks"],queryFn:()=>sN()}),{data:fe=[]}=Ke({queryKey:["projects"],queryFn:()=>hf()}),{data:we=[]}=Ke({queryKey:["milestones-all"],queryFn:()=>WS()}),Ce=hs({resolver:ms(zU),defaultValues:{projectId:($e=fe[0])!=null&&$e.id?Number(fe[0].id):401,name:"",unitOfMeasure:$s.Count,baselineAmount:0,targetAmount:100}}),Z=hs({resolver:ms(UU),defaultValues:{projectId:(ut=fe[0])!=null&&ut.id?Number(fe[0].id):401,name:"",description:"",likelihood:ma.Medium,impact:pa.Moderate}}),W=Ft({mutationFn:_=>tk(_),onSuccess:()=>{e.invalidateQueries({queryKey:["indicators"]}),n("Indicator defined","Indicator added to project monitoring plan (M08)"),m(!1),Ce.reset()},onError:_=>{r("Failed to create indicator",String(_))}}),oe=Ft({mutationFn:({id:_,amount:Y})=>nk(_,Y),onSuccess:()=>{e.invalidateQueries({queryKey:["indicators"]}),n("Actual value recorded","M&E variance and indicator status recalculated (BR-009)"),b(null)},onError:_=>{r("Failed to record actual",String(_))}}),ee=Ft({mutationFn:_=>lk(_),onSuccess:()=>{e.invalidateQueries({queryKey:["evidence"]}),n("Evidence uploaded","Supporting file registered for reviewer inspection (Figure 10 / M14)")},onError:_=>{r("Upload failed",String(_))}}),z=Ft({mutationFn:({id:_,status:Y})=>ok({evidenceId:_,version:2,evidenceType:In.DeliverableProof,status:Y}),onSuccess:(_,Y)=>{e.invalidateQueries({queryKey:["evidence"]}),Y.status===xt.Approved?n("Evidence Approved & Verified","Approval recorded. Auto-triggers payment eligibility check in Disbursements."):n("Rework Requested","Evidence returned to recipient for correction."),N("")},onError:_=>{r("Review update failed",String(_))}}),ue=Ft({mutationFn:_=>WT(_),onSuccess:()=>{e.invalidateQueries({queryKey:["risks"]}),e.invalidateQueries({queryKey:["dashboard"]}),n("Risk registered","Risk item added to project register"),y(!1),Z.reset()},onError:_=>{r("Failed to log risk",String(_))}}),Me=_=>{var he;const Y=(he=_.target.files)==null?void 0:he[0];if(Y){const ce=new FormData;ce.append("file",Y),ce.append("projectId","401"),ce.append("milestoneId","803"),ce.append("evidenceType",String(A)),ee.mutate(ce)}},Ae=async _=>{try{const Y=await ik(_);Y?(window.open(Y,"_blank","noopener,noreferrer"),n("Secure URL Retrieved","Signed evidence download link opened.")):r("Download Error","No active secure download link generated.")}catch(Y){r("Link Error",(Y==null?void 0:Y.message)||"Failed to retrieve evidence secure link.")}},Ye=(_,Y)=>{if(!Y)return{label:"Pending",badge:"bg-slate-800/60 text-slate-400 border-slate-700/60"};const he=_/Y*100;return he>=90?{label:"Green (≥90%)",badge:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20"}:he>=70?{label:"Amber (70–89%)",badge:"bg-amber-500/10 text-amber-400 border-amber-500/20"}:{label:"Red (<70%)",badge:"bg-rose-500/10 text-rose-400 border-rose-500/20"}};return c.jsxs("div",{className:"space-y-6 max-w-7xl mx-auto",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 bg-[#0f1523]/80 backdrop-blur-md p-6 rounded-2xl border border-slate-800/80 shadow-xl",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-2xl font-bold text-white tracking-tight flex items-center gap-2",children:"M&E, Evidence & Risk Management"}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"Verification workflow: Evidence Upload & Review Queue, Indicator Actuals Recording, and Risk Register."})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[a==="indicators"&&c.jsxs("button",{onClick:()=>m(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:[c.jsx(Rs,{className:"w-4 h-4"}),"Define Indicator"]}),a==="risks"&&c.jsxs("button",{onClick:()=>y(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:[c.jsx(Rs,{className:"w-4 h-4"}),"Add Risk to Register"]})]})]}),c.jsxs("div",{className:"flex gap-2 border-b border-slate-800/80 pb-3 overflow-x-auto",children:[c.jsxs("button",{onClick:()=>o("evidence"),className:`px-4 py-2 text-xs font-medium rounded-xl transition flex items-center gap-2 ${a==="evidence"?"bg-blue-600 text-white shadow-lg shadow-blue-600/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50"}`,children:[c.jsx(ZC,{className:"w-4 h-4"}),"Milestone Evidence & Review Queue"]}),c.jsxs("button",{onClick:()=>o("indicators"),className:`px-4 py-2 text-xs font-medium rounded-xl transition flex items-center gap-2 ${a==="indicators"?"bg-blue-600 text-white shadow-lg shadow-blue-600/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50"}`,children:[c.jsx(qp,{className:"w-4 h-4"}),"Indicators & Actuals (",q.length,")"]}),c.jsxs("button",{onClick:()=>o("risks"),className:`px-4 py-2 text-xs font-medium rounded-xl transition flex items-center gap-2 ${a==="risks"?"bg-blue-600 text-white shadow-lg shadow-blue-600/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50"}`,children:[c.jsx(gS,{className:"w-4 h-4"}),"Risk Register & Heatmap (",X.length,")"]})]}),a==="evidence"&&c.jsx("div",{className:"space-y-6",children:c.jsxs("div",{className:"bg-[#0f1523]/80 backdrop-blur-md rounded-2xl border border-slate-800/80 shadow-xl overflow-hidden",children:[c.jsxs("div",{className:"bg-slate-900/90 text-white px-6 py-4 flex flex-col sm:flex-row sm:items-center justify-between gap-2 border-b border-slate-800/80",children:[c.jsx("span",{className:"text-xs font-mono font-semibold tracking-wider text-blue-400 uppercase",children:"RECIPIENT PORTAL • Project XYZ • Milestone 3: Prototype Delivery"}),c.jsx("span",{className:"text-[11px] text-slate-400 font-mono",children:"Milestone Evidence Submission"})]}),c.jsxs("div",{className:"p-6 border-b border-slate-800/80 bg-slate-900/40",children:[c.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-2 text-center text-xs font-semibold",children:[c.jsx("div",{className:"py-2.5 px-3 rounded-xl bg-slate-800/60 text-slate-400 border border-slate-700/50",children:"Planned"}),c.jsx("div",{className:"py-2.5 px-3 rounded-xl bg-slate-800/60 text-slate-400 border border-slate-700/50",children:"In Progress"}),c.jsx("div",{className:"py-2.5 px-3 rounded-xl bg-blue-600 text-white shadow-lg shadow-blue-600/30 ring-2 ring-blue-500/40",children:"Submitted"}),c.jsx("div",{className:"py-2.5 px-3 rounded-xl bg-amber-500/15 text-amber-300 border border-amber-500/30",children:"Under Review"}),c.jsx("div",{className:"py-2.5 px-3 rounded-xl bg-slate-900/40 text-slate-500 border border-dashed border-slate-800",children:"Verified & Paid"})]}),c.jsx("div",{className:"mt-4 flex items-center justify-between text-xs",children:c.jsxs("div",{className:"flex items-center gap-2 text-slate-300",children:[c.jsx("span",{className:"font-semibold",children:"Current status:"}),c.jsx("span",{className:"font-mono text-emerald-400 bg-emerald-500/10 px-2.5 py-1 rounded-lg border border-emerald-500/20 font-bold",children:"SUBMITTED — awaiting Programme Manager review"})]})})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 divide-y md:divide-y-0 md:divide-x divide-slate-800/80",children:[c.jsxs("div",{className:"p-6 space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h4",{className:"text-sm font-bold text-white",children:"Upload Evidence"}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("label",{className:"text-[11px] font-medium text-slate-400",children:"Type:"}),c.jsx("select",{value:A,onChange:_=>C(Number(_.target.value)),className:"text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl px-2.5 py-1.5 text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 max-w-[180px] [&>option]:bg-slate-900 [&>option]:text-white",children:aN.map(_=>c.jsx("option",{value:_.value,children:_.label},_.value))})]})]}),c.jsx("p",{className:"text-xs text-slate-400",children:"Drag & drop or browse files. Accepted formats: PDF, JPG, DOCX, XLSX (Max 25MB)."}),c.jsxs("div",{onClick:()=>{var _;return(_=u.current)==null?void 0:_.click()},className:"border-2 border-dashed border-slate-700/80 hover:border-blue-500/80 bg-slate-900/40 hover:bg-blue-500/5 rounded-2xl p-8 text-center cursor-pointer transition flex flex-col items-center justify-center space-y-3",children:[c.jsx(bS,{className:"w-8 h-8 text-slate-400"}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs font-bold text-white block",children:"Click to Browse or Drag Files Here"}),c.jsx("span",{className:"text-[10px] text-slate-500",children:"Automated SHA-256 hash stamp applied on intake"})]}),c.jsx("button",{type:"button",className:"px-4 py-1.5 text-xs font-semibold text-white bg-slate-800 hover:bg-slate-700 border border-slate-700 rounded-xl shadow-xs transition",children:"Browse Files"})]}),c.jsx("input",{type:"file",ref:u,onChange:Me,className:"hidden",accept:".pdf,.jpg,.jpeg,.png,.docx,.xlsx,.zip"})]}),c.jsxs("div",{className:"p-6 space-y-4",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-bold text-white",children:"Attached Evidence (v2)"}),c.jsxs("span",{className:"text-[11px] text-slate-400 font-mono",children:[re.length," files loaded"]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xs text-slate-400",children:"Milestone:"}),c.jsxs("select",{value:j,onChange:_=>F(_.target.value==="all"?"all":_.target.value),className:"text-xs bg-slate-900 border border-slate-700/80 rounded-xl px-2.5 py-1 text-white focus:outline-none focus:ring-1 focus:ring-blue-500 max-w-[200px] [&>option]:bg-slate-900 [&>option]:text-white",children:[c.jsx("option",{value:"all",children:"All Milestones"}),we.map(_=>c.jsx("option",{value:_.id,children:_.name||`Milestone #${_.id}`},_.id))]})]})]}),c.jsx("div",{className:"space-y-2.5",children:re.map(_=>c.jsxs("div",{className:"p-3 rounded-xl border border-slate-800/80 bg-slate-900/60 flex items-center justify-between gap-3 text-xs",children:[c.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[c.jsx(fS,{className:"w-4 h-4 text-blue-400 shrink-0"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"font-semibold text-slate-200 block truncate font-mono",children:_.fileName||`evidence_file_${_.id}.pdf`}),c.jsxs("span",{className:"text-[10px] text-slate-400 font-mono",children:[_.fileSize||"3.2 MB"," • v",_.version," • ",Nk(_.type)]})]})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-[10px] font-semibold bg-amber-500/10 text-amber-400 border border-amber-500/20",children:"Under Review"}),c.jsx("button",{type:"button",onClick:()=>Ae(_.id),className:"p-1 rounded text-slate-400 hover:text-white hover:bg-slate-800 transition cursor-pointer",title:"Fetch Secure Signed Link",children:c.jsx(hS,{className:"w-3.5 h-3.5"})}),_.documentUrl&&c.jsx("a",{href:_.documentUrl,target:"_blank",rel:"noopener noreferrer",className:"text-slate-400 hover:text-white p-1 transition",title:"Download evidence file",children:c.jsx(mC,{className:"w-3.5 h-3.5"})})]})]},_.id))})]})]}),c.jsxs("div",{className:"p-6 border-t border-slate-800/80 bg-slate-900/40 space-y-4",children:[c.jsx("h4",{className:"text-sm font-bold text-white",children:"Programme Manager Review"}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Reviewer comment / rejection reason"}),c.jsx("input",{type:"text",value:O,onChange:_=>N(_.target.value),placeholder:"Mandatory if requesting rework; optional for approvals...",className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition"})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pt-2",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{onClick:()=>{var _;return z.mutate({id:((_=re[0])==null?void 0:_.id)||1201,status:xt.Rejected})},disabled:z.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-rose-600/90 hover:bg-rose-600 rounded-xl shadow-lg shadow-rose-600/20 transition",children:"Reject / Rework"}),c.jsx("button",{onClick:()=>{var _;return z.mutate({id:((_=re[0])==null?void 0:_.id)||1201,status:xt.Approved})},disabled:z.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:"Approve & Verify"})]}),c.jsx("p",{className:"text-[11px] text-slate-400 italic",children:"Approval auto-triggers payment eligibility check."})]})]})]})}),a==="indicators"&&c.jsx("div",{className:"bg-[#0f1523]/80 backdrop-blur-md rounded-2xl border border-slate-800/80 shadow-xl overflow-hidden",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-slate-900/60 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold",children:[c.jsx("th",{className:"py-3.5 px-5",children:"Indicator Name"}),c.jsx("th",{className:"py-3.5 px-4",children:"Project ID"}),c.jsx("th",{className:"py-3.5 px-4",children:"Unit of Measure"}),c.jsx("th",{className:"py-3.5 px-4 text-right",children:"Baseline"}),c.jsx("th",{className:"py-3.5 px-4 text-right",children:"Target"}),c.jsx("th",{className:"py-3.5 px-4 text-right",children:"Actual Recorded"}),c.jsx("th",{className:"py-3.5 px-4",children:"Status"}),c.jsx("th",{className:"py-3.5 px-5 text-right",children:"Action"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-800/50",children:B?c.jsx("tr",{children:c.jsx("td",{colSpan:8,className:"py-8 text-center text-slate-500",children:"Loading indicators..."})}):q.map(_=>{const Y=Ye(_.actualAmount,_.targetAmount);return c.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors",children:[c.jsx("td",{className:"py-3.5 px-5 font-semibold text-white",children:_.name}),c.jsxs("td",{className:"py-3.5 px-4 text-slate-400 font-mono",children:["Project #",_.projectId]}),c.jsx("td",{className:"py-3.5 px-4 text-slate-300",children:jk(_.unitOfMeasure)}),c.jsx("td",{className:"py-3.5 px-4 text-right font-mono text-slate-400",children:_.baselineAmount}),c.jsx("td",{className:"py-3.5 px-4 text-right font-mono font-bold text-white",children:_.targetAmount}),c.jsx("td",{className:"py-3.5 px-4 text-right font-mono font-bold text-emerald-400 text-xs",children:_.actualAmount}),c.jsx("td",{className:"py-3.5 px-4",children:c.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold border ${Y.badge}`,children:Y.label})}),c.jsx("td",{className:"py-3.5 px-5 text-right",children:c.jsx("button",{onClick:()=>{b(_),S(_.actualAmount)},className:"inline-flex items-center gap-1 text-xs font-semibold text-slate-300 hover:text-white bg-slate-800/80 hover:bg-slate-700 px-3 py-1.5 rounded-lg border border-slate-700/60 transition",children:"Record Actual"})})]},_.id)})})]})})}),a==="risks"&&c.jsx("div",{className:"bg-[#0f1523]/80 backdrop-blur-md rounded-2xl border border-slate-800/80 shadow-xl overflow-hidden",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-slate-900/60 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold",children:[c.jsx("th",{className:"py-3.5 px-5",children:"Risk Title & Description"}),c.jsx("th",{className:"py-3.5 px-4",children:"Project ID"}),c.jsx("th",{className:"py-3.5 px-4 text-center",children:"Likelihood (1–5)"}),c.jsx("th",{className:"py-3.5 px-4 text-center",children:"Impact (1–5)"}),c.jsx("th",{className:"py-3.5 px-4 text-center",children:"Residual Score"}),c.jsx("th",{className:"py-3.5 px-4",children:"Risk Owner"}),c.jsx("th",{className:"py-3.5 px-5",children:"Mitigation Control"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-800/50",children:se?c.jsx("tr",{children:c.jsx("td",{colSpan:7,className:"py-8 text-center text-slate-500",children:"Loading risk register..."})}):X.map(_=>{const Y=_.likelihood*_.impact,he=Ek(_.likelihood,_.impact);return c.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors",children:[c.jsxs("td",{className:"py-3.5 px-5",children:[c.jsx("span",{className:"font-semibold text-white block text-xs",children:_.name}),c.jsx("span",{className:"text-[11px] text-slate-400 line-clamp-1",children:_.description})]}),c.jsxs("td",{className:"py-3.5 px-4 text-slate-400 font-mono",children:["Project #",_.projectId]}),c.jsx("td",{className:"py-3.5 px-4 text-center font-mono font-bold text-slate-200",children:_.likelihood}),c.jsx("td",{className:"py-3.5 px-4 text-center font-mono font-bold text-slate-200",children:_.impact}),c.jsx("td",{className:"py-3.5 px-4 text-center",children:c.jsxs("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-[10px] font-bold ${he.badge}`,children:[Y," / 25 (",he.level,")"]})}),c.jsx("td",{className:"py-3.5 px-4 text-slate-300 font-medium",children:ya(_.owner)}),c.jsx("td",{className:"py-3.5 px-5 text-slate-400 text-[11px]",children:_.mitigationAction||"Standard internal audit controls applied."})]},_.id)})})]})})}),c.jsx(hn,{isOpen:f,onClose:()=>m(!1),title:"Define M&E Indicator",subtitle:"Logical Framework & Theory of Change metric",children:c.jsxs("form",{onSubmit:Ce.handleSubmit(_=>W.mutate(_)),className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Project *"}),c.jsx("select",{...Ce.register("projectId"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition [&>option]:bg-slate-900 [&>option]:text-white",children:fe.map(_=>c.jsx("option",{value:_.id,children:_.name},_.id))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Indicator Statement *"}),c.jsx("input",{type:"text",...Ce.register("name"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition",placeholder:"e.g. Smallholder farmers adopting precision drone analytics"})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Unit of Measure *"}),c.jsx("select",{...Ce.register("unitOfMeasure"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition [&>option]:bg-slate-900 [&>option]:text-white",children:uN.map(_=>c.jsx("option",{value:_.value,children:_.label},_.value))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Baseline Value *"}),c.jsx("input",{type:"number",...Ce.register("baselineAmount"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 font-mono transition"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Target Value *"}),c.jsx("input",{type:"number",...Ce.register("targetAmount"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 font-mono transition"})]})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>m(!1),className:"px-4 py-2 text-xs font-medium text-slate-300 bg-slate-800/80 hover:bg-slate-700 rounded-xl transition",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:W.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:W.isPending?"Saving...":"Define Indicator"})]})]})}),c.jsx(hn,{isOpen:!!g,onClose:()=>b(null),title:"Record Indicator Actual Value",subtitle:(g==null?void 0:g.name)||"",children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"p-3.5 bg-slate-900/60 border border-slate-800/80 rounded-xl text-xs flex justify-between text-slate-300",children:[c.jsxs("span",{children:["Baseline: ",c.jsx("strong",{className:"text-white",children:g==null?void 0:g.baselineAmount})]}),c.jsxs("span",{children:["Target: ",c.jsx("strong",{className:"text-white",children:g==null?void 0:g.targetAmount})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Actual Value to Record *"}),c.jsx("input",{type:"number",value:v,onChange:_=>S(Number(_.target.value)),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 font-mono transition"})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>b(null),className:"px-4 py-2 text-xs font-medium text-slate-300 bg-slate-800/80 hover:bg-slate-700 rounded-xl transition",children:"Cancel"}),c.jsx("button",{type:"button",onClick:()=>g&&oe.mutate({id:g.id,amount:v}),disabled:oe.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:oe.isPending?"Recording...":"Submit Actual Value"})]})]})}),c.jsx(hn,{isOpen:p,onClose:()=>y(!1),title:"Add Risk to Risk Register",subtitle:"Identify and score project delivery risks",children:c.jsxs("form",{onSubmit:Z.handleSubmit(_=>ue.mutate(_)),className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Associated Project *"}),c.jsx("select",{...Z.register("projectId"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition [&>option]:bg-slate-900 [&>option]:text-white",children:fe.map(_=>c.jsx("option",{value:_.id,children:_.name},_.id))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Risk Title *"}),c.jsx("input",{type:"text",...Z.register("name"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition",placeholder:"e.g. Foreign Exchange Currency Volatility"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Likelihood (1–5) *"}),c.jsx("select",{...Z.register("likelihood"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition [&>option]:bg-slate-900 [&>option]:text-white",children:yk.map(_=>c.jsx("option",{value:_.value,children:_.label},_.value))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Impact (1–5) *"}),c.jsx("select",{...Z.register("impact"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition [&>option]:bg-slate-900 [&>option]:text-white",children:vk.map(_=>c.jsx("option",{value:_.value,children:_.label},_.value))})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Risk Description *"}),c.jsx("textarea",{rows:2,...Z.register("description"),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:border-blue-500 transition"})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>y(!1),className:"px-4 py-2 text-xs font-medium text-slate-300 bg-slate-800/80 hover:bg-slate-700 rounded-xl transition",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:ue.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition",children:ue.isPending?"Logging...":"Log Risk"})]})]})})]})},LU=()=>{const e=Pa(),{user:n}=Uc(),{success:r,error:a}=Lc(),[o,u]=T.useState("users"),[f,m]=T.useState(""),[p,y]=T.useState("all"),[g,b]=T.useState(null),[v,S]=T.useState(!1),A={email:f.trim()||void 0,status:p!=="all"?p:void 0},{data:C=[],isLoading:O,refetch:N}=Ke({queryKey:["users",p,f],queryFn:()=>ck(1,100,A)}),j=Ft({mutationFn:()=>dk(),onSuccess:()=>{r("Integration Sync Complete","Background user and tenant directory synchronized successfully."),e.invalidateQueries({queryKey:["users"]})},onError:ae=>{a("Sync Failed",(ae==null?void 0:ae.message)||"Failed to trigger background integration sync.")}}),F=Ft({mutationFn:({userId:ae,status:dt})=>uk(ae,dt),onSuccess:(ae,dt)=>{r("User Status Updated",`User status changed to ${Ml(dt.status).label}.`),e.invalidateQueries({queryKey:["users"]}),g&&g.id===dt.userId&&b({...g,status:dt.status})},onError:ae=>{a("Update Failed",(ae==null?void 0:ae.message)||"Could not update user status.")}}),[q,B]=T.useState(!1),[re,Q]=T.useState(""),[X,se]=T.useState(null),[fe,we]=T.useState(!1),[Ce,Z]=T.useState(""),[W,oe]=T.useState(""),[ee,z]=T.useState(""),[ue,Me]=T.useState(""),[Ae,Ye]=T.useState(""),[$e,ut]=T.useState(""),[_,Y]=T.useState(As.Email),{data:he=[],isLoading:ce}=Ke({queryKey:["invites"],queryFn:()=>hk(1,100)}),{data:Oe=[]}=Ke({queryKey:["organisations"],queryFn:()=>df(1,50)}),{data:Pe=[]}=Ke({queryKey:["awards"],queryFn:()=>Yp(1,50)}),{data:qe=[]}=Ke({queryKey:["contracts"],queryFn:()=>eN(1,50)}),_e=Ft({mutationFn:ae=>fk(ae),onSuccess:()=>{r("Invitation Dispatched","Statutory communications invitation sent successfully."),e.invalidateQueries({queryKey:["invites"]}),B(!1),Ye(""),ut("")},onError:ae=>{a("Dispatch Error",(ae==null?void 0:ae.message)||"Failed to dispatch invitation.")}}),je=async ae=>{if(ae.preventDefault(),!!re.trim())try{we(!0);const dt=await mk(re.trim());se(dt),r("Lookup Complete",`Retrieved ${dt.length} invitation records for applicant.`)}catch(dt){a("Lookup Error",(dt==null?void 0:dt.message)||"Applicant invitation lookup failed."),se([])}finally{we(!1)}},[at,Tt]=T.useState(fs.Connected),[Zt,J]=T.useState(!1),[Re,pe]=T.useState(As.Email),[$,Ge]=T.useState(us.Sent),[rt,qt]=T.useState(""),[Sr,Sn]=T.useState(""),[Hi,Kr]=T.useState([]),{data:er=[],isLoading:qa}=Ke({queryKey:["auditLogs"],queryFn:()=>pk()});return c.jsxs("div",{className:"space-y-6 max-w-7xl mx-auto",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 bg-[#0f1523]/80 backdrop-blur-md p-6 rounded-2xl border border-slate-800/80 shadow-xl",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-2xl font-bold text-white tracking-tight",children:"System Administration & Communications"}),c.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"User access directory, statutory invitations, background integration sync, and audit ledger."})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[o==="users"&&c.jsxs("button",{onClick:()=>j.mutate(),disabled:j.isPending,className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-slate-800 hover:bg-slate-700 border border-slate-700/80 rounded-xl shadow-md transition cursor-pointer disabled:opacity-50",children:[c.jsx(tp,{className:`w-3.5 h-3.5 ${j.isPending?"animate-spin":""}`}),j.isPending?"Syncing...":"Sync Integration"]}),o==="invites"&&c.jsxs("button",{onClick:()=>B(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition cursor-pointer",children:[c.jsx(Ew,{className:"w-4 h-4"}),"Dispatch Invitation"]}),o==="notifications"&&c.jsxs("button",{onClick:()=>J(!0),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition cursor-pointer",children:[c.jsx(Ew,{className:"w-4 h-4"}),"Dispatch Notification"]})]})]}),c.jsxs("div",{className:"flex gap-2 border-b border-slate-800/80 pb-3 overflow-x-auto",children:[c.jsxs("button",{onClick:()=>u("users"),className:`px-4 py-2 text-xs font-medium rounded-xl transition flex items-center gap-2 whitespace-nowrap cursor-pointer ${o==="users"?"bg-blue-600 text-white shadow-lg shadow-blue-600/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50"}`,children:[c.jsx(yS,{className:"w-4 h-4"}),"User Directory (",C.length,")"]}),c.jsxs("button",{onClick:()=>u("invites"),className:`px-4 py-2 text-xs font-medium rounded-xl transition flex items-center gap-2 whitespace-nowrap cursor-pointer ${o==="invites"?"bg-blue-600 text-white shadow-lg shadow-blue-600/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50"}`,children:[c.jsx(mS,{className:"w-4 h-4"}),"Communications & Invites (",he.length,")"]}),c.jsxs("button",{onClick:()=>u("notifications"),className:`px-4 py-2 text-xs font-medium rounded-xl transition flex items-center gap-2 whitespace-nowrap cursor-pointer ${o==="notifications"?"bg-blue-600 text-white shadow-lg shadow-blue-600/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50"}`,children:[c.jsx(YA,{className:"w-4 h-4"}),"Gateways & Notifications"]}),c.jsxs("button",{onClick:()=>u("audit"),className:`px-4 py-2 text-xs font-medium rounded-xl transition flex items-center gap-2 whitespace-nowrap cursor-pointer ${o==="audit"?"bg-blue-600 text-white shadow-lg shadow-blue-600/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50"}`,children:[c.jsx(RC,{className:"w-4 h-4"}),"Statutory Audit Trail (",er.length,")"]}),c.jsxs("button",{onClick:()=>u("profile"),className:`px-4 py-2 text-xs font-medium rounded-xl transition flex items-center gap-2 whitespace-nowrap cursor-pointer ${o==="profile"?"bg-blue-600 text-white shadow-lg shadow-blue-600/30":"text-slate-400 hover:text-slate-200 hover:bg-slate-800/50"}`,children:[c.jsx(xS,{className:"w-4 h-4"}),"Session & Claims"]})]}),o==="users"&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"bg-[#0f1523]/80 backdrop-blur-md p-4 rounded-2xl border border-slate-800/80 shadow-xl flex flex-col sm:flex-row items-center justify-between gap-3",children:[c.jsxs("div",{className:"relative w-full sm:w-80",children:[c.jsx(pS,{className:"w-4 h-4 text-slate-500 absolute left-3 top-2.5"}),c.jsx("input",{type:"text",value:f,onChange:ae=>m(ae.target.value),placeholder:"Search users by email...",className:"w-full pl-9 pr-3 py-1.5 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50"})]}),c.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[c.jsx("span",{className:"text-xs font-semibold text-slate-400 whitespace-nowrap",children:"Filter Status:"}),c.jsxs("select",{value:p,onChange:ae=>y(ae.target.value==="all"?"all":Number(ae.target.value)),className:"text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl px-3 py-1.5 text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 [&>option]:bg-slate-900 [&>option]:text-white",children:[c.jsx("option",{value:"all",children:"All Statuses"}),c.jsx("option",{value:Cn.Active,children:"Active"}),c.jsx("option",{value:Cn.Inactive,children:"Inactive"}),c.jsx("option",{value:Cn.Suspended,children:"Suspended"})]}),c.jsx("button",{onClick:()=>N(),className:"p-1.5 rounded-xl border border-slate-700 bg-slate-800/80 hover:bg-slate-700 text-slate-300 transition cursor-pointer",title:"Refresh user list",children:c.jsx(tp,{className:"w-4 h-4"})})]})]}),c.jsx("div",{className:"bg-[#0f1523]/80 backdrop-blur-md rounded-2xl border border-slate-800/80 shadow-xl overflow-hidden",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-slate-900/60 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold",children:[c.jsx("th",{className:"py-3.5 px-5",children:"User ID (UUID)"}),c.jsx("th",{className:"py-3.5 px-4",children:"Email"}),c.jsx("th",{className:"py-3.5 px-4",children:"Status"}),c.jsx("th",{className:"py-3.5 px-4",children:"Last Login"}),c.jsx("th",{className:"py-3.5 px-5 text-right",children:"Actions"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-800/50",children:O?c.jsx("tr",{children:c.jsx("td",{colSpan:5,className:"py-8 text-center text-slate-500",children:"Loading user directory..."})}):C.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:5,className:"py-8 text-center text-slate-500",children:"No users found matching current filters."})}):C.map(ae=>{const dt=Ml(ae.status);return c.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors",children:[c.jsx("td",{className:"py-3.5 px-5 font-mono text-slate-300 text-[11px]",children:ae.id}),c.jsx("td",{className:"py-3.5 px-4 text-white font-medium",children:ae.email||c.jsx("span",{className:"text-slate-500 italic",children:"No email recorded"})}),c.jsx("td",{className:"py-3.5 px-4",children:c.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-[10px] font-semibold border ${dt.className}`,children:dt.label})}),c.jsx("td",{className:"py-3.5 px-4 text-slate-400 font-mono text-[11px]",children:ae.lastLoginAt?Kn(ae.lastLoginAt):"Never"}),c.jsxs("td",{className:"py-3.5 px-5 text-right space-x-1.5 whitespace-nowrap",children:[c.jsxs("button",{onClick:()=>{b(ae),S(!0)},className:"inline-flex items-center gap-1 px-2.5 py-1 text-[11px] font-semibold text-slate-300 bg-slate-800 hover:bg-slate-700 border border-slate-700 rounded-lg transition cursor-pointer",children:[c.jsx(gC,{className:"w-3 h-3 text-blue-400"}),"Inspect"]}),ae.status===Cn.Active?c.jsx("button",{onClick:()=>F.mutate({userId:ae.id,status:Cn.Suspended}),disabled:F.isPending,className:"inline-flex items-center px-2.5 py-1 text-[11px] font-semibold text-amber-400 bg-amber-500/10 hover:bg-amber-500/20 border border-amber-500/20 rounded-lg transition cursor-pointer",children:"Suspend"}):c.jsx("button",{onClick:()=>F.mutate({userId:ae.id,status:Cn.Active}),disabled:F.isPending,className:"inline-flex items-center px-2.5 py-1 text-[11px] font-semibold text-emerald-400 bg-emerald-500/10 hover:bg-emerald-500/20 border border-emerald-500/20 rounded-lg transition cursor-pointer",children:"Activate"})]})]},ae.id)})})]})})})]}),o==="invites"&&c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"bg-[#0f1523]/80 backdrop-blur-md p-5 rounded-2xl border border-slate-800/80 shadow-xl",children:[c.jsx("h3",{className:"text-sm font-bold text-white mb-1",children:"Applicant Invitations Lookup"}),c.jsx("p",{className:"text-xs text-slate-400 mb-3",children:"Query invitations dispatched to a specific candidate or grantee using their unique Applicant User UUID."}),c.jsxs("form",{onSubmit:je,className:"flex gap-2",children:[c.jsx("input",{type:"text",value:re,onChange:ae=>Q(ae.target.value),placeholder:"Enter Applicant User ID (UUID)...",className:"flex-1 px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 font-mono focus:outline-none focus:ring-2 focus:ring-blue-500/50"}),c.jsx("button",{type:"submit",disabled:fe||!re.trim(),className:"px-4 py-2 text-xs font-semibold text-white bg-blue-600 hover:bg-blue-500 rounded-xl transition cursor-pointer disabled:opacity-50",children:fe?"Searching...":"Lookup Invites"})]}),X&&c.jsxs("div",{className:"mt-4 pt-4 border-t border-slate-800/80",children:[c.jsxs("span",{className:"text-xs font-semibold text-slate-300",children:["Lookup Results (",X.length," matches):"]}),X.length===0?c.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"No invitations found for this applicant UUID."}):c.jsx("div",{className:"mt-2 space-y-2",children:X.map((ae,dt)=>c.jsxs("div",{className:"p-3 bg-slate-900/60 rounded-xl border border-slate-800 text-xs flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-semibold text-white",children:ae.message}),c.jsxs("div",{className:"text-[11px] text-slate-400 mt-0.5",children:["Org #",ae.organisationId," • Award #",ae.awardId," • Contract #",ae.contractId]})]}),c.jsx("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20",children:Kw(ae.platform)})]},dt))})]})]}),c.jsxs("div",{className:"bg-[#0f1523]/80 backdrop-blur-md rounded-2xl border border-slate-800/80 shadow-xl overflow-hidden",children:[c.jsxs("div",{className:"px-5 py-3.5 border-b border-slate-800/80 bg-slate-900/40 flex items-center justify-between",children:[c.jsx("span",{className:"text-xs font-bold text-white uppercase tracking-wider",children:"Sent Invitations Ledger"}),c.jsxs("span",{className:"text-xs text-slate-400",children:[he.length," invitations dispatched"]})]}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-slate-900/60 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold",children:[c.jsx("th",{className:"py-3.5 px-5",children:"Recipient (UUID)"}),c.jsx("th",{className:"py-3.5 px-4",children:"Channel"}),c.jsx("th",{className:"py-3.5 px-4",children:"Message"}),c.jsx("th",{className:"py-3.5 px-4",children:"Target Org / Grant"}),c.jsx("th",{className:"py-3.5 px-5 text-right",children:"Created Date"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-800/50",children:ce?c.jsx("tr",{children:c.jsx("td",{colSpan:5,className:"py-8 text-center text-slate-500",children:"Loading invitations ledger..."})}):he.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:5,className:"py-8 text-center text-slate-500",children:"No invitations recorded yet. Use “Dispatch Invitation” to send one."})}):he.map((ae,dt)=>c.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors",children:[c.jsx("td",{className:"py-3.5 px-5 font-mono text-slate-300 text-[11px]",children:ae.recipient}),c.jsx("td",{className:"py-3.5 px-4",children:c.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold bg-blue-500/10 text-blue-400 border border-blue-500/20",children:Kw(ae.platform)})}),c.jsx("td",{className:"py-3.5 px-4 text-white font-medium max-w-xs truncate",children:ae.message}),c.jsxs("td",{className:"py-3.5 px-4 text-slate-400 text-[11px]",children:["Org #",ae.invitedOrganisationId||ae.organisationId," • Award #",ae.awardId]}),c.jsx("td",{className:"py-3.5 px-5 text-right font-mono text-slate-400 text-[11px]",children:ae.createdAt?Kn(ae.createdAt):"Recently"})]},dt))})]})})]})]}),o==="notifications"&&c.jsx("div",{className:"space-y-6",children:c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.jsxs("div",{className:"bg-[#0f1523]/80 backdrop-blur-md p-5 rounded-2xl border border-slate-800/80 shadow-xl space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-xs font-semibold text-slate-400",children:"Email Gateway Status"}),c.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-[10px] font-semibold border ${Yw(at).className}`,children:Yw(at).label})]}),c.jsxs("div",{className:"pt-1",children:[c.jsx("label",{className:"block text-[11px] font-medium text-slate-400 mb-1.5",children:"Update Gateway State:"}),c.jsx("select",{value:at,onChange:ae=>{const dt=Number(ae.target.value);Tt(dt),r("Gateway State Updated",`Email service transitioned to ${Pd(dt)}`)},className:"w-full text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl px-2.5 py-1.5 text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 [&>option]:bg-slate-900 [&>option]:text-white",children:gk.map(ae=>c.jsx("option",{value:ae.value,children:ae.label},ae.value))})]})]}),c.jsxs("div",{className:"bg-[#0f1523]/80 backdrop-blur-md p-5 rounded-2xl border border-slate-800/80 shadow-xl space-y-1",children:[c.jsx("span",{className:"text-xs font-semibold text-slate-400",children:"Queued / Active Pipeline"}),c.jsx("div",{className:"text-2xl font-bold font-mono text-white",children:Hi.filter(ae=>ae.status===us.Pending||ae.status===us.Queued).length}),c.jsx("span",{className:"text-[11px] text-slate-400",children:"Automated retry scheduler active"})]}),c.jsxs("div",{className:"bg-[#0f1523]/80 backdrop-blur-md p-5 rounded-2xl border border-slate-800/80 shadow-xl space-y-1",children:[c.jsx("span",{className:"text-xs font-semibold text-slate-400",children:"Delivery Success Ratio"}),c.jsx("div",{className:"text-2xl font-bold font-mono text-emerald-400",children:"97.4%"}),c.jsx("span",{className:"text-[11px] text-slate-400",children:"Cross-platform SLA target: ≥95.0%"})]})]})}),o==="audit"&&c.jsx("div",{className:"bg-[#0f1523]/80 backdrop-blur-md rounded-2xl border border-slate-800/80 shadow-xl overflow-hidden",children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-slate-900/60 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold",children:[c.jsx("th",{className:"py-3.5 px-5",children:"Audit ID"}),c.jsx("th",{className:"py-3.5 px-4",children:"Entity"}),c.jsx("th",{className:"py-3.5 px-4",children:"Action"}),c.jsx("th",{className:"py-3.5 px-4",children:"Performed By"}),c.jsx("th",{className:"py-3.5 px-5 text-right",children:"Timestamp"})]})}),c.jsx("tbody",{className:"divide-y divide-slate-800/50",children:qa?c.jsx("tr",{children:c.jsx("td",{colSpan:5,className:"py-8 text-center text-slate-500",children:"Loading audit logs..."})}):er.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:5,className:"py-8 text-center text-slate-500",children:"No audit events recorded."})}):er.map(ae=>c.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors",children:[c.jsxs("td",{className:"py-3.5 px-5 font-mono text-slate-300",children:["LOG-",ae.id]}),c.jsxs("td",{className:"py-3.5 px-4 text-white font-medium",children:[ae.entityType," #",ae.entityId]}),c.jsx("td",{className:"py-3.5 px-4 text-blue-400 font-mono",children:ae.action}),c.jsx("td",{className:"py-3.5 px-4 text-slate-300 font-mono text-[11px]",children:ae.userEmail}),c.jsx("td",{className:"py-3.5 px-5 text-right text-slate-400 font-mono text-[11px]",children:Kn(ae.createdAt)})]},ae.id))})]})})}),o==="profile"&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"bg-[#0f1523]/80 backdrop-blur-md p-6 rounded-2xl border border-slate-800/80 shadow-xl space-y-4",children:[c.jsx("h3",{className:"text-sm font-bold text-white",children:"Active Session & Identity Token Claims"}),c.jsx("p",{className:"text-xs text-slate-400",children:"Cryptographic claims and assigned multi-tenant boundaries parsed from your active session."}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 pt-2",children:[c.jsxs("div",{className:"p-4 bg-slate-900/60 rounded-xl border border-slate-800 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold text-slate-400 uppercase tracking-wider block",children:"User Identity & Tenant"}),c.jsxs("div",{className:"text-xs space-y-1.5 font-mono",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Subject (sub):"})," ",c.jsx("span",{className:"text-white",children:(n==null?void 0:n.id)||"Anonymous"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Tenant Claim:"})," ",c.jsx("span",{className:"text-emerald-400 font-bold",children:(n==null?void 0:n.tenant)||"Default Root Tenant"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Email:"})," ",c.jsx("span",{className:"text-white",children:ya(n)||"Not provided"})]})]})]}),c.jsxs("div",{className:"p-4 bg-slate-900/60 rounded-xl border border-slate-800 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold text-slate-400 uppercase tracking-wider block",children:"Deterministic Hasher Settings"}),c.jsxs("div",{className:"text-xs space-y-1.5 font-mono",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Min Hash Length:"})," ",c.jsx("span",{className:"text-white",children:os().HasherSettings.MinHashLength})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Encoding Algorithm:"})," ",c.jsx("span",{className:"text-blue-400",children:"Deterministic Base62 Salted"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Active Salt:"})," ",c.jsx("span",{className:"text-slate-300 truncate block max-w-xs",children:os().HasherSettings.Salt?`${os().HasherSettings.Salt.slice(0,16)}...`:"Default Preset"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Target NuGet Package:"})," ",c.jsx("span",{className:"text-white",children:"Hashids.net (C# Compatible)"})]})]})]})]})]}),c.jsxs("div",{className:"bg-[#0f1523]/80 backdrop-blur-md p-6 rounded-2xl border border-slate-800/80 shadow-xl space-y-4",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-sm font-bold text-white flex items-center gap-2",children:[c.jsx(sO,{className:"w-4 h-4 text-emerald-400"}),"Deployment & Runtime Environment Configuration"]}),c.jsx("p",{className:"text-xs text-slate-400",children:"Priority hierarchy: Container Runtime Injected → /config.json → Build-Time (.env) → Defaults."})]}),c.jsxs("span",{className:`inline-flex items-center px-2.5 py-1 rounded-full text-[11px] font-semibold tracking-wide border ${os().ConfigSource==="runtime-injected"?"bg-emerald-500/10 text-emerald-400 border-emerald-500/30":os().ConfigSource==="runtime-fetched"?"bg-blue-500/10 text-blue-400 border-blue-500/30":os().ConfigSource==="build-env"?"bg-amber-500/10 text-amber-400 border-amber-500/30":"bg-slate-500/10 text-slate-400 border-slate-500/30"}`,children:["● Active Source: ",os().ConfigSource]})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 pt-2",children:[c.jsxs("div",{className:"p-4 bg-slate-900/60 rounded-xl border border-slate-800 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold text-slate-400 uppercase tracking-wider block",children:"Backend API Base URL"}),c.jsx("div",{className:"text-xs font-mono text-emerald-400 break-all",children:os().ApiSettings.BaseUrl})]}),c.jsxs("div",{className:"p-4 bg-slate-900/60 rounded-xl border border-slate-800 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold text-slate-400 uppercase tracking-wider block",children:"OIDC Authority (STS)"}),c.jsx("div",{className:"text-xs font-mono text-cyan-400 break-all",children:os().SecuritySettings.Authority})]}),c.jsxs("div",{className:"p-4 bg-slate-900/60 rounded-xl border border-slate-800 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold text-slate-400 uppercase tracking-wider block",children:"OIDC Client ID & Audience"}),c.jsxs("div",{className:"text-xs space-y-1 font-mono",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Client ID:"})," ",c.jsx("span",{className:"text-white",children:os().SecuritySettings.ClientId})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Audience:"})," ",c.jsx("span",{className:"text-white",children:os().SecuritySettings.Audience})]})]})]}),c.jsxs("div",{className:"p-4 bg-slate-900/60 rounded-xl border border-slate-800 space-y-2",children:[c.jsx("span",{className:"text-[11px] font-semibold text-slate-400 uppercase tracking-wider block",children:"OIDC Scope & Secret"}),c.jsxs("div",{className:"text-xs space-y-1 font-mono",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Scope:"})," ",c.jsx("span",{className:"text-white",children:os().SecuritySettings.Scope||"Default"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-500",children:"Secret Configured:"})," ",c.jsx("span",{className:"text-emerald-400",children:os().SecuritySettings.ClientSecret?"Yes (Encrypted/Set)":"No"})]})]})]})]})]})]}),c.jsx(hn,{isOpen:q,onClose:()=>B(!1),title:"Dispatch Statutory Invitation",children:c.jsxs("form",{onSubmit:ae=>{var dt,qi,Bi,E;if(ae.preventDefault(),!Ae||!$e){a("Validation Error","Recipient UUID and message content are mandatory.");return}_e.mutate({organisationId:Ce||((dt=Oe[0])!=null&&dt.id?Number(Oe[0].id):101),invitedOrganisationId:W||((qi=Oe[1])!=null&&qi.id?Number(Oe[1].id):102),awardId:ee||((Bi=Pe[0])!=null&&Bi.id?Number(Pe[0].id):301),contractId:ue||((E=qe[0])!=null&&E.id?Number(qe[0].id):401),recipient:Ae,message:$e,platform:_})},className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Recipient User UUID *"}),c.jsx("input",{type:"text",value:Ae,onChange:ae=>Ye(ae.target.value),placeholder:"e.g. 550e8400-e29b-41d4-a716-446655440000",className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 font-mono focus:outline-none focus:ring-2 focus:ring-blue-500/50",required:!0})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Dispatch Platform *"}),c.jsx("select",{value:_,onChange:ae=>Y(Number(ae.target.value)),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 [&>option]:bg-slate-900 [&>option]:text-white",children:iN.map(ae=>c.jsx("option",{value:ae.value,children:ae.label},ae.value))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Originating Organisation"}),c.jsx("select",{value:Ce,onChange:ae=>Z(ae.target.value),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 [&>option]:bg-slate-900 [&>option]:text-white",children:Oe.map(ae=>c.jsxs("option",{value:ae.id,children:[ae.name," (#",ae.id,")"]},ae.id))})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Associated Award"}),c.jsx("select",{value:ee,onChange:ae=>z(ae.target.value),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 [&>option]:bg-slate-900 [&>option]:text-white",children:Pe.map(ae=>c.jsxs("option",{value:ae.id,children:["Award #",ae.id]},ae.id))})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Associated Contract"}),c.jsx("select",{value:ue,onChange:ae=>Me(ae.target.value),className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-blue-500/50 [&>option]:bg-slate-900 [&>option]:text-white",children:qe.map(ae=>c.jsxs("option",{value:ae.id,children:["Contract #",ae.id]},ae.id))})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1.5",children:"Invitation Message *"}),c.jsx("textarea",{rows:3,value:$e,onChange:ae=>ut(ae.target.value),placeholder:"State the purpose of the invite and recipient onboarding instructions...",className:"w-full px-3 py-2 text-xs bg-slate-900/80 border border-slate-700/80 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-blue-500/50",required:!0})]}),c.jsxs("div",{className:"pt-3 border-t border-slate-800/80 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:()=>B(!1),className:"px-4 py-2 text-xs font-medium text-slate-300 bg-slate-800/80 hover:bg-slate-700 rounded-xl transition",children:"Cancel"}),c.jsx("button",{type:"submit",disabled:_e.isPending,className:"px-4 py-2 text-xs font-semibold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 rounded-xl shadow-lg shadow-blue-500/20 transition disabled:opacity-50",children:_e.isPending?"Sending...":"Send Invitation"})]})]})}),c.jsx(hn,{isOpen:v,onClose:()=>S(!1),title:"User Access & Security Details",children:g&&c.jsxs("div",{className:"space-y-4 text-xs",children:[c.jsxs("div",{className:"p-4 bg-slate-900/60 rounded-xl border border-slate-800 space-y-2",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-400 font-semibold block text-[11px] uppercase",children:"User UUID:"}),c.jsx("span",{className:"font-mono text-white text-xs break-all",children:g.id})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-400 font-semibold block text-[11px] uppercase",children:"Email:"}),c.jsx("span",{className:"text-white",children:g.email||"Not specified"})]}),c.jsxs("div",{className:"flex items-center justify-between pt-1",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-400 font-semibold block text-[11px] uppercase",children:"Status:"}),c.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] font-semibold border ${Ml(g.status).className}`,children:Ml(g.status).label})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-slate-400 font-semibold block text-[11px] uppercase",children:"Last Login:"}),c.jsx("span",{className:"font-mono text-slate-300",children:g.lastLoginAt?Kn(g.lastLoginAt):"Never"})]})]})]}),c.jsx("div",{className:"pt-2 flex justify-end gap-2",children:c.jsx("button",{type:"button",onClick:()=>S(!1),className:"px-4 py-2 text-xs font-semibold text-white bg-slate-800 hover:bg-slate-700 rounded-xl transition",children:"Close"})})]})})]})};function PU(){return c.jsx(W4,{client:I3,children:c.jsx(F4,{children:c.jsx(LA,{children:c.jsx(dO,{children:c.jsxs(v4,{children:[c.jsx(qs,{path:"/",element:c.jsx(Aw,{})}),c.jsx(qs,{path:"/login",element:c.jsx(Aw,{})}),c.jsxs(qs,{element:c.jsx(PA,{children:c.jsx(hO,{})}),children:[c.jsx(qs,{path:"/dashboard",element:c.jsx(Ak,{})}),c.jsx(qs,{path:"/governance",element:c.jsx(NU,{})}),c.jsx(qs,{path:"/projects",element:c.jsx(CU,{})}),c.jsx(qs,{path:"/grants",element:c.jsx(MU,{})}),c.jsx(qs,{path:"/monitoring",element:c.jsx(IU,{})}),c.jsx(qs,{path:"/settings",element:c.jsx(LU,{})})]}),c.jsx(qs,{path:"*",element:c.jsx(j_,{to:"/dashboard",replace:!0})})]})})})})})}J0().finally(()=>{bE.createRoot(document.getElementById("root")).render(c.jsx(T.StrictMode,{children:c.jsx(PU,{})}))});