@knpkv/codecommit-web 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/client/assets/index-BYI4sUt8.js +370 -0
  2. package/dist/client/assets/index-YklnGGqZ.css +1 -0
  3. package/dist/client/index.html +2 -2
  4. package/dist/main.js +3 -6
  5. package/dist/main.js.map +1 -1
  6. package/dist/server/Api.d.ts +114 -20
  7. package/dist/server/Api.d.ts.map +1 -1
  8. package/dist/server/Api.js +111 -15
  9. package/dist/server/Api.js.map +1 -1
  10. package/dist/server/Server.d.ts +3 -2
  11. package/dist/server/Server.d.ts.map +1 -1
  12. package/dist/server/Server.js +76 -30
  13. package/dist/server/Server.js.map +1 -1
  14. package/dist/server/handlers/accounts-live.js +1 -1
  15. package/dist/server/handlers/accounts-live.js.map +1 -1
  16. package/dist/server/handlers/config-live.d.ts.map +1 -1
  17. package/dist/server/handlers/config-live.js +43 -22
  18. package/dist/server/handlers/config-live.js.map +1 -1
  19. package/dist/server/handlers/events-live.d.ts +2 -2
  20. package/dist/server/handlers/events-live.d.ts.map +1 -1
  21. package/dist/server/handlers/events-live.js +52 -29
  22. package/dist/server/handlers/events-live.js.map +1 -1
  23. package/dist/server/handlers/index.d.ts +1 -0
  24. package/dist/server/handlers/index.d.ts.map +1 -1
  25. package/dist/server/handlers/index.js +1 -0
  26. package/dist/server/handlers/index.js.map +1 -1
  27. package/dist/server/handlers/notifications-live.d.ts +2 -2
  28. package/dist/server/handlers/notifications-live.d.ts.map +1 -1
  29. package/dist/server/handlers/notifications-live.js +45 -34
  30. package/dist/server/handlers/notifications-live.js.map +1 -1
  31. package/dist/server/handlers/prs-live.d.ts +2 -2
  32. package/dist/server/handlers/prs-live.d.ts.map +1 -1
  33. package/dist/server/handlers/prs-live.js +16 -15
  34. package/dist/server/handlers/prs-live.js.map +1 -1
  35. package/dist/server/handlers/subscriptions-live.d.ts +3 -0
  36. package/dist/server/handlers/subscriptions-live.d.ts.map +1 -0
  37. package/dist/server/handlers/subscriptions-live.js +12 -0
  38. package/dist/server/handlers/subscriptions-live.js.map +1 -0
  39. package/package.json +7 -3
  40. package/dist/client/assets/index-B2Y18oI5.css +0 -1
  41. package/dist/client/assets/index-CuXt1AzC.js +0 -348
@@ -0,0 +1,370 @@
1
+ var rY=Object.defineProperty;var F2=e=>{throw TypeError(e)};var iY=(e,t,n)=>t in e?rY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var S=(e,t,n)=>iY(e,typeof t!="symbol"?t+"":t,n),U2=(e,t,n)=>t.has(e)||F2("Cannot "+n);var Sy=(e,t,n)=>(U2(e,t,"read from private field"),n?n.call(e):t.get(e)),ww=(e,t,n)=>t.has(e)?F2("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),xy=(e,t,n,r)=>(U2(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function aY(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var av=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kz={exports:{}},nS={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var oY=Symbol.for("react.transitional.element"),sY=Symbol.for("react.fragment");function Gz(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:oY,type:e,key:r,ref:t!==void 0?t:null,props:n}}nS.Fragment=sY;nS.jsx=Gz;nS.jsxs=Gz;Kz.exports=nS;var p=Kz.exports,Yz={exports:{}},Ve={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var BC=Symbol.for("react.transitional.element"),lY=Symbol.for("react.portal"),cY=Symbol.for("react.fragment"),uY=Symbol.for("react.strict_mode"),fY=Symbol.for("react.profiler"),dY=Symbol.for("react.consumer"),hY=Symbol.for("react.context"),mY=Symbol.for("react.forward_ref"),pY=Symbol.for("react.suspense"),gY=Symbol.for("react.memo"),Wz=Symbol.for("react.lazy"),yY=Symbol.for("react.activity"),B2=Symbol.iterator;function bY(e){return e===null||typeof e!="object"?null:(e=B2&&e[B2]||e["@@iterator"],typeof e=="function"?e:null)}var Jz={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Xz=Object.assign,Qz={};function Kd(e,t,n){this.props=e,this.context=t,this.refs=Qz,this.updater=n||Jz}Kd.prototype.isReactComponent={};Kd.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Kd.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zz(){}Zz.prototype=Kd.prototype;function HC(e,t,n){this.props=e,this.context=t,this.refs=Qz,this.updater=n||Jz}var qC=HC.prototype=new Zz;qC.constructor=HC;Xz(qC,Kd.prototype);qC.isPureReactComponent=!0;var H2=Array.isArray;function O_(){}var qt={H:null,A:null,T:null,S:null},eP=Object.prototype.hasOwnProperty;function VC(e,t,n){var r=n.ref;return{$$typeof:BC,type:e,key:t,ref:r!==void 0?r:null,props:n}}function vY(e,t){return VC(e.type,t,e.props)}function KC(e){return typeof e=="object"&&e!==null&&e.$$typeof===BC}function SY(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var q2=/\/+/g;function _w(e,t){return typeof e=="object"&&e!==null&&e.key!=null?SY(""+e.key):t.toString(36)}function xY(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(O_,O_):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function nf(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case BC:case lY:o=!0;break;case Wz:return o=e._init,nf(o(e._payload),t,n,r,i)}}if(o)return i=i(e),o=r===""?"."+_w(e,0):r,H2(i)?(n="",o!=null&&(n=o.replace(q2,"$&/")+"/"),nf(i,t,n,"",function(c){return c})):i!=null&&(KC(i)&&(i=vY(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(q2,"$&/")+"/")+o)),t.push(i)),1;o=0;var s=r===""?".":r+":";if(H2(e))for(var l=0;l<e.length;l++)r=e[l],a=s+_w(r,l),o+=nf(r,t,n,a,i);else if(l=bY(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,a=s+_w(r,l++),o+=nf(r,t,n,a,i);else if(a==="object"){if(typeof e.then=="function")return nf(xY(e),t,n,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function wy(e,t,n){if(e==null)return e;var r=[],i=0;return nf(e,r,"","",function(a){return t.call(n,a,i++)}),r}function wY(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var V2=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},_Y={map:wy,forEach:function(e,t,n){wy(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return wy(e,function(){t++}),t},toArray:function(e){return wy(e,function(t){return t})||[]},only:function(e){if(!KC(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ve.Activity=yY;Ve.Children=_Y;Ve.Component=Kd;Ve.Fragment=cY;Ve.Profiler=fY;Ve.PureComponent=HC;Ve.StrictMode=uY;Ve.Suspense=pY;Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=qt;Ve.__COMPILER_RUNTIME={__proto__:null,c:function(e){return qt.H.useMemoCache(e)}};Ve.cache=function(e){return function(){return e.apply(null,arguments)}};Ve.cacheSignal=function(){return null};Ve.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=Xz({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=""+t.key),t)!eP.call(t,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return VC(e.type,i,r)};Ve.createContext=function(e){return e={$$typeof:hY,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:dY,_context:e},e};Ve.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=""+t.key),t)eP.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return VC(e,a,i)};Ve.createRef=function(){return{current:null}};Ve.forwardRef=function(e){return{$$typeof:mY,render:e}};Ve.isValidElement=KC;Ve.lazy=function(e){return{$$typeof:Wz,_payload:{_status:-1,_result:e},_init:wY}};Ve.memo=function(e,t){return{$$typeof:gY,type:e,compare:t===void 0?null:t}};Ve.startTransition=function(e){var t=qt.T,n={};qt.T=n;try{var r=e(),i=qt.S;i!==null&&i(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(O_,V2)}catch(a){V2(a)}finally{t!==null&&n.types!==null&&(t.types=n.types),qt.T=t}};Ve.unstable_useCacheRefresh=function(){return qt.H.useCacheRefresh()};Ve.use=function(e){return qt.H.use(e)};Ve.useActionState=function(e,t,n){return qt.H.useActionState(e,t,n)};Ve.useCallback=function(e,t){return qt.H.useCallback(e,t)};Ve.useContext=function(e){return qt.H.useContext(e)};Ve.useDebugValue=function(){};Ve.useDeferredValue=function(e,t){return qt.H.useDeferredValue(e,t)};Ve.useEffect=function(e,t){return qt.H.useEffect(e,t)};Ve.useEffectEvent=function(e){return qt.H.useEffectEvent(e)};Ve.useId=function(){return qt.H.useId()};Ve.useImperativeHandle=function(e,t,n){return qt.H.useImperativeHandle(e,t,n)};Ve.useInsertionEffect=function(e,t){return qt.H.useInsertionEffect(e,t)};Ve.useLayoutEffect=function(e,t){return qt.H.useLayoutEffect(e,t)};Ve.useMemo=function(e,t){return qt.H.useMemo(e,t)};Ve.useOptimistic=function(e,t){return qt.H.useOptimistic(e,t)};Ve.useReducer=function(e,t,n){return qt.H.useReducer(e,t,n)};Ve.useRef=function(e){return qt.H.useRef(e)};Ve.useState=function(e){return qt.H.useState(e)};Ve.useSyncExternalStore=function(e,t,n){return qt.H.useSyncExternalStore(e,t,n)};Ve.useTransition=function(){return qt.H.useTransition()};Ve.version="19.2.4";Yz.exports=Ve;var y=Yz.exports;const ee=sg(y),rS=aY({__proto__:null,default:ee},[y]);var tP={exports:{}},iS={},nP={exports:{}},rP={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(D,P){var $=D.length;D.push(P);e:for(;0<$;){var q=$-1>>>1,M=D[q];if(0<i(M,P))D[q]=P,D[$]=M,$=q;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var P=D[0],$=D.pop();if($!==P){D[0]=$;e:for(var q=0,M=D.length,ue=M>>>1;q<ue;){var H=2*(q+1)-1,R=D[H],X=H+1,G=D[X];if(0>i(R,$))X<M&&0>i(G,R)?(D[q]=G,D[X]=$,q=X):(D[q]=R,D[H]=$,q=H);else if(X<M&&0>i(G,$))D[q]=G,D[X]=$,q=X;else break e}}return P}function i(D,P){var $=D.sortIndex-P.sortIndex;return $!==0?$:D.id-P.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],c=[],f=1,u=null,d=3,h=!1,m=!1,b=!1,w=!1,g=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function E(D){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=D)r(c),P.sortIndex=P.expirationTime,t(l,P);else break;P=n(c)}}function C(D){if(b=!1,E(D),!m)if(n(l)!==null)m=!0,k||(k=!0,U());else{var P=n(c);P!==null&&F(C,P.startTime-D)}}var k=!1,_=-1,A=5,I=-1;function O(){return w?!0:!(e.unstable_now()-I<A)}function z(){if(w=!1,k){var D=e.unstable_now();I=D;var P=!0;try{e:{m=!1,b&&(b=!1,v(_),_=-1),h=!0;var $=d;try{t:{for(E(D),u=n(l);u!==null&&!(u.expirationTime>D&&O());){var q=u.callback;if(typeof q=="function"){u.callback=null,d=u.priorityLevel;var M=q(u.expirationTime<=D);if(D=e.unstable_now(),typeof M=="function"){u.callback=M,E(D),P=!0;break t}u===n(l)&&r(l),E(D)}else r(l);u=n(l)}if(u!==null)P=!0;else{var ue=n(c);ue!==null&&F(C,ue.startTime-D),P=!1}}break e}finally{u=null,d=$,h=!1}P=void 0}}finally{P?U():k=!1}}}var U;if(typeof x=="function")U=function(){x(z)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,Y=J.port2;J.port1.onmessage=z,U=function(){Y.postMessage(null)}}else U=function(){g(z,0)};function F(D,P){_=g(function(){D(e.unstable_now())},P)}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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_next=function(D){switch(d){case 1:case 2:case 3:var P=3;break;default:P=d}var $=d;d=P;try{return D()}finally{d=$}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(D,P){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var $=d;d=D;try{return P()}finally{d=$}},e.unstable_scheduleCallback=function(D,P,$){var q=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?q+$:q):$=q,D){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=$+M,D={id:f++,callback:P,priorityLevel:D,startTime:$,expirationTime:M,sortIndex:-1},$>q?(D.sortIndex=$,t(c,D),n(l)===null&&D===n(c)&&(b?(v(_),_=-1):b=!0,F(C,$-q))):(D.sortIndex=M,t(l,D),m||h||(m=!0,k||(k=!0,U()))),D},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(D){var P=d;return function(){var $=d;d=P;try{return D.apply(this,arguments)}finally{d=$}}}})(rP);nP.exports=rP;var M_=nP.exports,iP={exports:{}},Br={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var EY=y;function aP(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function js(){}var Ir={d:{f:js,r:function(){throw Error(aP(522))},D:js,C:js,L:js,m:js,X:js,S:js,M:js},p:0,findDOMNode:null},kY=Symbol.for("react.portal");function CY(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:kY,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var Tm=EY.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function aS(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Br.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ir;Br.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(aP(299));return CY(e,t,null,n)};Br.flushSync=function(e){var t=Tm.T,n=Ir.p;try{if(Tm.T=null,Ir.p=2,e)return e()}finally{Tm.T=t,Ir.p=n,Ir.d.f()}};Br.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Ir.d.C(e,t))};Br.prefetchDNS=function(e){typeof e=="string"&&Ir.d.D(e)};Br.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=aS(n,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,a=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Ir.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:a}):n==="script"&&Ir.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:a,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Br.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=aS(t.as,t.crossOrigin);Ir.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Ir.d.M(e)};Br.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=aS(n,t.crossOrigin);Ir.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Br.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=aS(t.as,t.crossOrigin);Ir.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Ir.d.m(e)};Br.requestFormReset=function(e){Ir.d.r(e)};Br.unstable_batchedUpdates=function(e,t){return e(t)};Br.useFormState=function(e,t,n){return Tm.H.useFormState(e,t,n)};Br.useFormStatus=function(){return Tm.H.useHostTransitionStatus()};Br.version="19.2.4";function oP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oP)}catch(e){console.error(e)}}oP(),iP.exports=Br;var Gd=iP.exports;const sP=sg(Gd);/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var $n=M_,lP=y,TY=Gd;function W(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function cP(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function lg(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function uP(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function fP(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function K2(e){if(lg(e)!==e)throw Error(W(188))}function RY(e){var t=e.alternate;if(!t){if(t=lg(e),t===null)throw Error(W(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return K2(i),e;if(a===r)return K2(i),t;a=a.sibling}throw Error(W(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,s=i.child;s;){if(s===n){o=!0,n=i,r=a;break}if(s===r){o=!0,r=i,n=a;break}s=s.sibling}if(!o){for(s=a.child;s;){if(s===n){o=!0,n=a,r=i;break}if(s===r){o=!0,r=a,n=i;break}s=s.sibling}if(!o)throw Error(W(189))}}if(n.alternate!==r)throw Error(W(190))}if(n.tag!==3)throw Error(W(188));return n.stateNode.current===n?e:t}function dP(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=dP(e),t!==null)return t;e=e.sibling}return null}var Kt=Object.assign,AY=Symbol.for("react.element"),_y=Symbol.for("react.transitional.element"),sm=Symbol.for("react.portal"),yf=Symbol.for("react.fragment"),hP=Symbol.for("react.strict_mode"),N_=Symbol.for("react.profiler"),mP=Symbol.for("react.consumer"),Wo=Symbol.for("react.context"),GC=Symbol.for("react.forward_ref"),D_=Symbol.for("react.suspense"),j_=Symbol.for("react.suspense_list"),YC=Symbol.for("react.memo"),Us=Symbol.for("react.lazy"),I_=Symbol.for("react.activity"),OY=Symbol.for("react.memo_cache_sentinel"),G2=Symbol.iterator;function $h(e){return e===null||typeof e!="object"?null:(e=G2&&e[G2]||e["@@iterator"],typeof e=="function"?e:null)}var MY=Symbol.for("react.client.reference");function $_(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===MY?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case yf:return"Fragment";case N_:return"Profiler";case hP:return"StrictMode";case D_:return"Suspense";case j_:return"SuspenseList";case I_:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case sm:return"Portal";case Wo:return e.displayName||"Context";case mP:return(e._context.displayName||"Context")+".Consumer";case GC:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case YC:return t=e.displayName||null,t!==null?t:$_(e.type)||"Memo";case Us:t=e._payload,e=e._init;try{return $_(e(t))}catch{}}return null}var lm=Array.isArray,$e=lP.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pt=TY.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Nc={pending:!1,data:null,method:null,action:null},L_=[],bf=-1;function vo(e){return{current:e}}function Yn(e){0>bf||(e.current=L_[bf],L_[bf]=null,bf--)}function Lt(e,t){bf++,L_[bf]=e.current,e.current=t}var oo=vo(null),up=vo(null),ol=vo(null),ov=vo(null);function sv(e,t){switch(Lt(ol,t),Lt(up,e),Lt(oo,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ZM(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ZM(t),e=j3(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Yn(oo),Lt(oo,e)}function sd(){Yn(oo),Yn(up),Yn(ol)}function z_(e){e.memoizedState!==null&&Lt(ov,e);var t=oo.current,n=j3(t,e.type);t!==n&&(Lt(up,e),Lt(oo,n))}function lv(e){up.current===e&&(Yn(oo),Yn(up)),ov.current===e&&(Yn(ov),xp._currentValue=Nc)}var Ew,Y2;function yc(e){if(Ew===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ew=t&&t[1]||"",Y2=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Ew+e+Y2}var kw=!1;function Cw(e,t){if(!e||kw)return"";kw=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(h){var d=h}Reflect.construct(e,[],u)}else{try{u.call()}catch(h){d=h}e.call(u.prototype)}}else{try{throw Error()}catch(h){d=h}(u=e())&&typeof u.catch=="function"&&u.catch(function(){})}}catch(h){if(h&&d&&typeof h.stack=="string")return[h.stack,d.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var l=o.split(`
44
+ `),c=s.split(`
45
+ `);for(i=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;i<c.length&&!c[i].includes("DetermineComponentFrameRoot");)i++;if(r===l.length||i===c.length)for(r=l.length-1,i=c.length-1;1<=r&&0<=i&&l[r]!==c[i];)i--;for(;1<=r&&0<=i;r--,i--)if(l[r]!==c[i]){if(r!==1||i!==1)do if(r--,i--,0>i||l[r]!==c[i]){var f=`
46
+ `+l[r].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=r&&0<=i);break}}}finally{kw=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?yc(n):""}function NY(e,t){switch(e.tag){case 26:case 27:case 5:return yc(e.type);case 16:return yc("Lazy");case 13:return e.child!==t&&t!==null?yc("Suspense Fallback"):yc("Suspense");case 19:return yc("SuspenseList");case 0:case 15:return Cw(e.type,!1);case 11:return Cw(e.type.render,!1);case 1:return Cw(e.type,!0);case 31:return yc("Activity");default:return""}}function W2(e){try{var t="",n=null;do t+=NY(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
47
+ Error generating stack: `+r.message+`
48
+ `+r.stack}}var P_=Object.prototype.hasOwnProperty,WC=$n.unstable_scheduleCallback,Tw=$n.unstable_cancelCallback,DY=$n.unstable_shouldYield,jY=$n.unstable_requestPaint,Si=$n.unstable_now,IY=$n.unstable_getCurrentPriorityLevel,pP=$n.unstable_ImmediatePriority,gP=$n.unstable_UserBlockingPriority,cv=$n.unstable_NormalPriority,$Y=$n.unstable_LowPriority,yP=$n.unstable_IdlePriority,LY=$n.log,zY=$n.unstable_setDisableYieldValue,cg=null,xi=null;function Xs(e){if(typeof LY=="function"&&zY(e),xi&&typeof xi.setStrictMode=="function")try{xi.setStrictMode(cg,e)}catch{}}var wi=Math.clz32?Math.clz32:UY,PY=Math.log,FY=Math.LN2;function UY(e){return e>>>=0,e===0?32:31-(PY(e)/FY|0)|0}var Ey=256,ky=262144,Cy=4194304;function bc(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function oS(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s!==0?(r=s&~a,r!==0?i=bc(r):(o&=s,o!==0?i=bc(o):n||(n=s&~e,n!==0&&(i=bc(n))))):(s=r&~a,s!==0?i=bc(s):o!==0?i=bc(o):n||(n=r&~e,n!==0&&(i=bc(n)))),i===0?0:t!==0&&t!==i&&!(t&a)&&(a=i&-i,n=t&-t,a>=n||a===32&&(n&4194048)!==0)?t:i}function ug(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function BY(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 bP(){var e=Cy;return Cy<<=1,!(Cy&62914560)&&(Cy=4194304),e}function Rw(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function fg(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function HY(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=o&~n;0<n;){var f=31-wi(n),u=1<<f;s[f]=0,l[f]=-1;var d=c[f];if(d!==null)for(c[f]=null,f=0;f<d.length;f++){var h=d[f];h!==null&&(h.lane&=-536870913)}n&=~u}r!==0&&vP(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function vP(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-wi(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function SP(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wi(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function xP(e,t){var n=t&-t;return n=n&42?1:JC(n),n&(e.suspendedLanes|t)?0:n}function JC(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function XC(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function wP(){var e=pt.p;return e!==0?e:(e=window.event,e===void 0?32:V3(e.type))}function J2(e,t){var n=pt.p;try{return pt.p=e,t()}finally{pt.p=n}}var ql=Math.random().toString(36).slice(2),sr="__reactFiber$"+ql,ii="__reactProps$"+ql,Yd="__reactContainer$"+ql,F_="__reactEvents$"+ql,qY="__reactListeners$"+ql,VY="__reactHandles$"+ql,X2="__reactResources$"+ql,dg="__reactMarker$"+ql;function QC(e){delete e[sr],delete e[ii],delete e[F_],delete e[qY],delete e[VY]}function vf(e){var t=e[sr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Yd]||n[sr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=iN(e);e!==null;){if(n=e[sr])return n;e=iN(e)}return t}e=n,n=e.parentNode}return null}function Wd(e){if(e=e[sr]||e[Yd]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function cm(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(W(33))}function Lf(e){var t=e[X2];return t||(t=e[X2]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Gn(e){e[dg]=!0}var _P=new Set,EP={};function bu(e,t){ld(e,t),ld(e+"Capture",t)}function ld(e,t){for(EP[e]=t,e=0;e<t.length;e++)_P.add(t[e])}var KY=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]*$"),Q2={},Z2={};function GY(e){return P_.call(Z2,e)?!0:P_.call(Q2,e)?!1:KY.test(e)?Z2[e]=!0:(Q2[e]=!0,!1)}function db(e,t,n){if(GY(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Ty(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Oo(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function Pi(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function kP(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function YY(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function U_(e){if(!e._valueTracker){var t=kP(e)?"checked":"value";e._valueTracker=YY(e,t,""+e[t])}}function CP(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=kP(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function uv(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var WY=/[\n"\\]/g;function Vi(e){return e.replace(WY,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function B_(e,t,n,r,i,a,o,s){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Pi(t)):e.value!==""+Pi(t)&&(e.value=""+Pi(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?H_(e,o,Pi(t)):n!=null?H_(e,o,Pi(n)):r!=null&&e.removeAttribute("value"),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.name=""+Pi(s):e.removeAttribute("name")}function TP(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.type=a),t!=null||n!=null){if(!(a!=="submit"&&a!=="reset"||t!=null)){U_(e);return}n=n!=null?""+Pi(n):"",t=t!=null?""+Pi(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),U_(e)}function H_(e,t,n){t==="number"&&uv(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function zf(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Pi(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function RP(e,t,n){if(t!=null&&(t=""+Pi(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Pi(n):""}function AP(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(W(92));if(lm(r)){if(1<r.length)throw Error(W(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=Pi(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),U_(e)}function cd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var JY=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 eM(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||JY.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function OP(e,t,n){if(t!=null&&typeof t!="object")throw Error(W(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&eM(e,i,r)}else for(var a in t)t.hasOwnProperty(a)&&eM(e,a,t[a])}function ZC(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var XY=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"],["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"]]),QY=/^[\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 hb(e){return QY.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Jo(){}var q_=null;function eT(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sf=null,Pf=null;function tM(e){var t=Wd(e);if(t&&(e=t.stateNode)){var n=e[ii]||null;e:switch(e=t.stateNode,t.type){case"input":if(B_(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Vi(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[ii]||null;if(!i)throw Error(W(90));B_(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&CP(r)}break e;case"textarea":RP(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&zf(e,!!n.multiple,t,!1)}}}var Aw=!1;function MP(e,t,n){if(Aw)return e(t,n);Aw=!0;try{var r=e(t);return r}finally{if(Aw=!1,(Sf!==null||Pf!==null)&&(bS(),Sf&&(t=Sf,e=Pf,Pf=Sf=null,tM(t),e)))for(t=0;t<e.length;t++)tM(e[t])}}function fp(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ii]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(W(231,t,typeof n));return n}var us=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),V_=!1;if(us)try{var Lh={};Object.defineProperty(Lh,"passive",{get:function(){V_=!0}}),window.addEventListener("test",Lh,Lh),window.removeEventListener("test",Lh,Lh)}catch{V_=!1}var Qs=null,tT=null,mb=null;function NP(){if(mb)return mb;var e,t=tT,n=t.length,r,i="value"in Qs?Qs.value:Qs.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return mb=i.slice(e,1<r?1-r:void 0)}function pb(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ry(){return!0}function nM(){return!1}function oi(e){function t(n,r,i,a,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Ry:nM,this.isPropagationStopped=nM,this}return Kt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ry)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ry)},persist:function(){},isPersistent:Ry}),t}var vu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sS=oi(vu),hg=Kt({},vu,{view:0,detail:0}),ZY=oi(hg),Ow,Mw,zh,lS=Kt({},hg,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nT,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==zh&&(zh&&e.type==="mousemove"?(Ow=e.screenX-zh.screenX,Mw=e.screenY-zh.screenY):Mw=Ow=0,zh=e),Ow)},movementY:function(e){return"movementY"in e?e.movementY:Mw}}),rM=oi(lS),eW=Kt({},lS,{dataTransfer:0}),tW=oi(eW),nW=Kt({},hg,{relatedTarget:0}),Nw=oi(nW),rW=Kt({},vu,{animationName:0,elapsedTime:0,pseudoElement:0}),iW=oi(rW),aW=Kt({},vu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),oW=oi(aW),sW=Kt({},vu,{data:0}),iM=oi(sW),lW={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cW={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"},uW={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fW(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=uW[e])?!!t[e]:!1}function nT(){return fW}var dW=Kt({},hg,{key:function(e){if(e.key){var t=lW[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=pb(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cW[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nT,charCode:function(e){return e.type==="keypress"?pb(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?pb(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hW=oi(dW),mW=Kt({},lS,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aM=oi(mW),pW=Kt({},hg,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nT}),gW=oi(pW),yW=Kt({},vu,{propertyName:0,elapsedTime:0,pseudoElement:0}),bW=oi(yW),vW=Kt({},lS,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),SW=oi(vW),xW=Kt({},vu,{newState:0,oldState:0}),wW=oi(xW),_W=[9,13,27,32],rT=us&&"CompositionEvent"in window,Rm=null;us&&"documentMode"in document&&(Rm=document.documentMode);var EW=us&&"TextEvent"in window&&!Rm,DP=us&&(!rT||Rm&&8<Rm&&11>=Rm),oM=" ",sM=!1;function jP(e,t){switch(e){case"keyup":return _W.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function IP(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xf=!1;function kW(e,t){switch(e){case"compositionend":return IP(t);case"keypress":return t.which!==32?null:(sM=!0,oM);case"textInput":return e=t.data,e===oM&&sM?null:e;default:return null}}function CW(e,t){if(xf)return e==="compositionend"||!rT&&jP(e,t)?(e=NP(),mb=tT=Qs=null,xf=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return DP&&t.locale!=="ko"?null:t.data;default:return null}}var TW={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 lM(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!TW[e.type]:t==="textarea"}function $P(e,t,n,r){Sf?Pf?Pf.push(r):Pf=[r]:Sf=r,t=Rv(t,"onChange"),0<t.length&&(n=new sS("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Am=null,dp=null;function RW(e){M3(e,0)}function cS(e){var t=cm(e);if(CP(t))return e}function cM(e,t){if(e==="change")return t}var LP=!1;if(us){var Dw;if(us){var jw="oninput"in document;if(!jw){var uM=document.createElement("div");uM.setAttribute("oninput","return;"),jw=typeof uM.oninput=="function"}Dw=jw}else Dw=!1;LP=Dw&&(!document.documentMode||9<document.documentMode)}function fM(){Am&&(Am.detachEvent("onpropertychange",zP),dp=Am=null)}function zP(e){if(e.propertyName==="value"&&cS(dp)){var t=[];$P(t,dp,e,eT(e)),MP(RW,t)}}function AW(e,t,n){e==="focusin"?(fM(),Am=t,dp=n,Am.attachEvent("onpropertychange",zP)):e==="focusout"&&fM()}function OW(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return cS(dp)}function MW(e,t){if(e==="click")return cS(t)}function NW(e,t){if(e==="input"||e==="change")return cS(t)}function DW(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ri=typeof Object.is=="function"?Object.is:DW;function hp(e,t){if(Ri(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!P_.call(t,i)||!Ri(e[i],t[i]))return!1}return!0}function dM(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hM(e,t){var n=dM(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=dM(n)}}function PP(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?PP(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function FP(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=uv(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=uv(e.document)}return t}function iT(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var jW=us&&"documentMode"in document&&11>=document.documentMode,wf=null,K_=null,Om=null,G_=!1;function mM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;G_||wf==null||wf!==uv(r)||(r=wf,"selectionStart"in r&&iT(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Om&&hp(Om,r)||(Om=r,r=Rv(K_,"onSelect"),0<r.length&&(t=new sS("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=wf)))}function uc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _f={animationend:uc("Animation","AnimationEnd"),animationiteration:uc("Animation","AnimationIteration"),animationstart:uc("Animation","AnimationStart"),transitionrun:uc("Transition","TransitionRun"),transitionstart:uc("Transition","TransitionStart"),transitioncancel:uc("Transition","TransitionCancel"),transitionend:uc("Transition","TransitionEnd")},Iw={},UP={};us&&(UP=document.createElement("div").style,"AnimationEvent"in window||(delete _f.animationend.animation,delete _f.animationiteration.animation,delete _f.animationstart.animation),"TransitionEvent"in window||delete _f.transitionend.transition);function Su(e){if(Iw[e])return Iw[e];if(!_f[e])return e;var t=_f[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in UP)return Iw[e]=t[n];return e}var BP=Su("animationend"),HP=Su("animationiteration"),qP=Su("animationstart"),IW=Su("transitionrun"),$W=Su("transitionstart"),LW=Su("transitioncancel"),VP=Su("transitionend"),KP=new Map,Y_="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Y_.push("scrollEnd");function za(e,t){KP.set(e,t),bu(t,[e])}var fv=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Li=[],Ef=0,aT=0;function uS(){for(var e=Ef,t=aT=Ef=0;t<e;){var n=Li[t];Li[t++]=null;var r=Li[t];Li[t++]=null;var i=Li[t];Li[t++]=null;var a=Li[t];if(Li[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&GP(n,i,a)}}function fS(e,t,n,r){Li[Ef++]=e,Li[Ef++]=t,Li[Ef++]=n,Li[Ef++]=r,aT|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function oT(e,t,n,r){return fS(e,t,n,r),dv(e)}function xu(e,t){return fS(e,null,null,t),dv(e)}function GP(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-wi(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function dv(e){if(50<Pm)throw Pm=0,pE=null,Error(W(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var kf={};function zW(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(e,t,n,r){return new zW(e,t,n,r)}function sT(e){return e=e.prototype,!(!e||!e.isReactComponent)}function as(e,t){var n=e.alternate;return n===null?(n=yi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function YP(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function gb(e,t,n,r,i,a){var o=0;if(r=e,typeof e=="function")sT(e)&&(o=1);else if(typeof e=="string")o=HJ(e,n,oo.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case I_:return e=yi(31,n,t,i),e.elementType=I_,e.lanes=a,e;case yf:return Dc(n.children,i,a,t);case hP:o=8,i|=24;break;case N_:return e=yi(12,n,t,i|2),e.elementType=N_,e.lanes=a,e;case D_:return e=yi(13,n,t,i),e.elementType=D_,e.lanes=a,e;case j_:return e=yi(19,n,t,i),e.elementType=j_,e.lanes=a,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Wo:o=10;break e;case mP:o=9;break e;case GC:o=11;break e;case YC:o=14;break e;case Us:o=16,r=null;break e}o=29,n=Error(W(130,e===null?"null":typeof e,"")),r=null}return t=yi(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Dc(e,t,n,r){return e=yi(7,e,r,t),e.lanes=n,e}function $w(e,t,n){return e=yi(6,e,null,t),e.lanes=n,e}function WP(e){var t=yi(18,null,null,0);return t.stateNode=e,t}function Lw(e,t,n){return t=yi(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pM=new WeakMap;function Ki(e,t){if(typeof e=="object"&&e!==null){var n=pM.get(e);return n!==void 0?n:(t={value:e,source:t,stack:W2(t)},pM.set(e,t),t)}return{value:e,source:t,stack:W2(t)}}var Cf=[],Tf=0,hv=null,mp=0,Fi=[],Ui=0,Cl=null,Xa=1,Qa="";function qo(e,t){Cf[Tf++]=mp,Cf[Tf++]=hv,hv=e,mp=t}function JP(e,t,n){Fi[Ui++]=Xa,Fi[Ui++]=Qa,Fi[Ui++]=Cl,Cl=e;var r=Xa;e=Qa;var i=32-wi(r)-1;r&=~(1<<i),n+=1;var a=32-wi(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Xa=1<<32-wi(t)+i|n<<i|r,Qa=a+e}else Xa=1<<a|n<<i|r,Qa=e}function lT(e){e.return!==null&&(qo(e,1),JP(e,1,0))}function cT(e){for(;e===hv;)hv=Cf[--Tf],Cf[Tf]=null,mp=Cf[--Tf],Cf[Tf]=null;for(;e===Cl;)Cl=Fi[--Ui],Fi[Ui]=null,Qa=Fi[--Ui],Fi[Ui]=null,Xa=Fi[--Ui],Fi[Ui]=null}function XP(e,t){Fi[Ui++]=Xa,Fi[Ui++]=Qa,Fi[Ui++]=Cl,Xa=t.id,Qa=t.overflow,Cl=e}var lr=null,Ut=null,st=!1,sl=null,Gi=!1,W_=Error(W(519));function Tl(e){var t=Error(W(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pp(Ki(t,e)),W_}function gM(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[sr]=e,t[ii]=r,n){case"dialog":tt("cancel",t),tt("close",t);break;case"iframe":case"object":case"embed":tt("load",t);break;case"video":case"audio":for(n=0;n<vp.length;n++)tt(vp[n],t);break;case"source":tt("error",t);break;case"img":case"image":case"link":tt("error",t),tt("load",t);break;case"details":tt("toggle",t);break;case"input":tt("invalid",t),TP(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":tt("invalid",t);break;case"textarea":tt("invalid",t),AP(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||D3(t.textContent,n)?(r.popover!=null&&(tt("beforetoggle",t),tt("toggle",t)),r.onScroll!=null&&tt("scroll",t),r.onScrollEnd!=null&&tt("scrollend",t),r.onClick!=null&&(t.onclick=Jo),t=!0):t=!1,t||Tl(e,!0)}function yM(e){for(lr=e.return;lr;)switch(lr.tag){case 5:case 31:case 13:Gi=!1;return;case 27:case 3:Gi=!0;return;default:lr=lr.return}}function Hu(e){if(e!==lr)return!1;if(!st)return yM(e),st=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||SE(e.type,e.memoizedProps)),n=!n),n&&Ut&&Tl(e),yM(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));Ut=rN(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));Ut=rN(e)}else t===27?(t=Ut,Vl(e.type)?(e=EE,EE=null,Ut=e):Ut=t):Ut=lr?Xi(e.stateNode.nextSibling):null;return!0}function Vc(){Ut=lr=null,st=!1}function zw(){var e=sl;return e!==null&&(Jr===null?Jr=e:Jr.push.apply(Jr,e),sl=null),e}function pp(e){sl===null?sl=[e]:sl.push(e)}var J_=vo(null),wu=null,Xo=null;function Vs(e,t,n){Lt(J_,t._currentValue),t._currentValue=n}function os(e){e._currentValue=J_.current,Yn(J_)}function X_(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Q_(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var o=i.child;a=a.firstContext;e:for(;a!==null;){var s=a;a=i;for(var l=0;l<t.length;l++)if(s.context===t[l]){a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),X_(a.return,n,e),r||(o=null);break e}a=s.next}}else if(i.tag===18){if(o=i.return,o===null)throw Error(W(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),X_(o,n,e),o=null}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}}function Jd(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var o=i.alternate;if(o===null)throw Error(W(387));if(o=o.memoizedProps,o!==null){var s=i.type;Ri(i.pendingProps.value,o.value)||(e!==null?e.push(s):e=[s])}}else if(i===ov.current){if(o=i.alternate,o===null)throw Error(W(387));o.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(xp):e=[xp])}i=i.return}e!==null&&Q_(t,e,n,r),t.flags|=262144}function mv(e){for(e=e.firstContext;e!==null;){if(!Ri(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Kc(e){wu=e,Xo=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ur(e){return QP(wu,e)}function Ay(e,t){return wu===null&&Kc(e),QP(e,t)}function QP(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Xo===null){if(e===null)throw Error(W(308));Xo=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Xo=Xo.next=t;return n}var PW=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},FW=$n.unstable_scheduleCallback,UW=$n.unstable_NormalPriority,xn={$$typeof:Wo,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function uT(){return{controller:new PW,data:new Map,refCount:0}}function mg(e){e.refCount--,e.refCount===0&&FW(UW,function(){e.controller.abort()})}var Mm=null,Z_=0,ud=0,Ff=null;function BW(e,t){if(Mm===null){var n=Mm=[];Z_=0,ud=IT(),Ff={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Z_++,t.then(bM,bM),t}function bM(){if(--Z_===0&&Mm!==null){Ff!==null&&(Ff.status="fulfilled");var e=Mm;Mm=null,ud=0,Ff=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function HW(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),r}var vM=$e.S;$e.S=function(e,t){d3=Si(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&BW(e,t),vM!==null&&vM(e,t)};var jc=vo(null);function fT(){var e=jc.current;return e!==null?e:Nt.pooledCache}function yb(e,t){t===null?Lt(jc,jc.current):Lt(jc,t.pool)}function ZP(){var e=fT();return e===null?null:{parent:xn._currentValue,pool:e}}var Xd=Error(W(460)),dT=Error(W(474)),dS=Error(W(542)),pv={then:function(){}};function SM(e){return e=e.status,e==="fulfilled"||e==="rejected"}function eF(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jo,Jo),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,wM(e),e;default:if(typeof t.status=="string")t.then(Jo,Jo);else{if(e=Nt,e!==null&&100<e.shellSuspendCounter)throw Error(W(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,wM(e),e}throw Ic=t,Xd}}function vc(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ic=n,Xd):n}}var Ic=null;function xM(){if(Ic===null)throw Error(W(459));var e=Ic;return Ic=null,e}function wM(e){if(e===Xd||e===dS)throw Error(W(483))}var Uf=null,gp=0;function Oy(e){var t=gp;return gp+=1,Uf===null&&(Uf=[]),eF(Uf,e,t)}function Ph(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function My(e,t){throw t.$$typeof===AY?Error(W(525)):(e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function tF(e){function t(g,v){if(e){var x=g.deletions;x===null?(g.deletions=[v],g.flags|=16):x.push(v)}}function n(g,v){if(!e)return null;for(;v!==null;)t(g,v),v=v.sibling;return null}function r(g){for(var v=new Map;g!==null;)g.key!==null?v.set(g.key,g):v.set(g.index,g),g=g.sibling;return v}function i(g,v){return g=as(g,v),g.index=0,g.sibling=null,g}function a(g,v,x){return g.index=x,e?(x=g.alternate,x!==null?(x=x.index,x<v?(g.flags|=67108866,v):x):(g.flags|=67108866,v)):(g.flags|=1048576,v)}function o(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function s(g,v,x,E){return v===null||v.tag!==6?(v=$w(x,g.mode,E),v.return=g,v):(v=i(v,x),v.return=g,v)}function l(g,v,x,E){var C=x.type;return C===yf?f(g,v,x.props.children,E,x.key):v!==null&&(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Us&&vc(C)===v.type)?(v=i(v,x.props),Ph(v,x),v.return=g,v):(v=gb(x.type,x.key,x.props,null,g.mode,E),Ph(v,x),v.return=g,v)}function c(g,v,x,E){return v===null||v.tag!==4||v.stateNode.containerInfo!==x.containerInfo||v.stateNode.implementation!==x.implementation?(v=Lw(x,g.mode,E),v.return=g,v):(v=i(v,x.children||[]),v.return=g,v)}function f(g,v,x,E,C){return v===null||v.tag!==7?(v=Dc(x,g.mode,E,C),v.return=g,v):(v=i(v,x),v.return=g,v)}function u(g,v,x){if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return v=$w(""+v,g.mode,x),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case _y:return x=gb(v.type,v.key,v.props,null,g.mode,x),Ph(x,v),x.return=g,x;case sm:return v=Lw(v,g.mode,x),v.return=g,v;case Us:return v=vc(v),u(g,v,x)}if(lm(v)||$h(v))return v=Dc(v,g.mode,x,null),v.return=g,v;if(typeof v.then=="function")return u(g,Oy(v),x);if(v.$$typeof===Wo)return u(g,Ay(g,v),x);My(g,v)}return null}function d(g,v,x,E){var C=v!==null?v.key:null;if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return C!==null?null:s(g,v,""+x,E);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case _y:return x.key===C?l(g,v,x,E):null;case sm:return x.key===C?c(g,v,x,E):null;case Us:return x=vc(x),d(g,v,x,E)}if(lm(x)||$h(x))return C!==null?null:f(g,v,x,E,null);if(typeof x.then=="function")return d(g,v,Oy(x),E);if(x.$$typeof===Wo)return d(g,v,Ay(g,x),E);My(g,x)}return null}function h(g,v,x,E,C){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return g=g.get(x)||null,s(v,g,""+E,C);if(typeof E=="object"&&E!==null){switch(E.$$typeof){case _y:return g=g.get(E.key===null?x:E.key)||null,l(v,g,E,C);case sm:return g=g.get(E.key===null?x:E.key)||null,c(v,g,E,C);case Us:return E=vc(E),h(g,v,x,E,C)}if(lm(E)||$h(E))return g=g.get(x)||null,f(v,g,E,C,null);if(typeof E.then=="function")return h(g,v,x,Oy(E),C);if(E.$$typeof===Wo)return h(g,v,x,Ay(v,E),C);My(v,E)}return null}function m(g,v,x,E){for(var C=null,k=null,_=v,A=v=0,I=null;_!==null&&A<x.length;A++){_.index>A?(I=_,_=null):I=_.sibling;var O=d(g,_,x[A],E);if(O===null){_===null&&(_=I);break}e&&_&&O.alternate===null&&t(g,_),v=a(O,v,A),k===null?C=O:k.sibling=O,k=O,_=I}if(A===x.length)return n(g,_),st&&qo(g,A),C;if(_===null){for(;A<x.length;A++)_=u(g,x[A],E),_!==null&&(v=a(_,v,A),k===null?C=_:k.sibling=_,k=_);return st&&qo(g,A),C}for(_=r(_);A<x.length;A++)I=h(_,g,A,x[A],E),I!==null&&(e&&I.alternate!==null&&_.delete(I.key===null?A:I.key),v=a(I,v,A),k===null?C=I:k.sibling=I,k=I);return e&&_.forEach(function(z){return t(g,z)}),st&&qo(g,A),C}function b(g,v,x,E){if(x==null)throw Error(W(151));for(var C=null,k=null,_=v,A=v=0,I=null,O=x.next();_!==null&&!O.done;A++,O=x.next()){_.index>A?(I=_,_=null):I=_.sibling;var z=d(g,_,O.value,E);if(z===null){_===null&&(_=I);break}e&&_&&z.alternate===null&&t(g,_),v=a(z,v,A),k===null?C=z:k.sibling=z,k=z,_=I}if(O.done)return n(g,_),st&&qo(g,A),C;if(_===null){for(;!O.done;A++,O=x.next())O=u(g,O.value,E),O!==null&&(v=a(O,v,A),k===null?C=O:k.sibling=O,k=O);return st&&qo(g,A),C}for(_=r(_);!O.done;A++,O=x.next())O=h(_,g,A,O.value,E),O!==null&&(e&&O.alternate!==null&&_.delete(O.key===null?A:O.key),v=a(O,v,A),k===null?C=O:k.sibling=O,k=O);return e&&_.forEach(function(U){return t(g,U)}),st&&qo(g,A),C}function w(g,v,x,E){if(typeof x=="object"&&x!==null&&x.type===yf&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case _y:e:{for(var C=x.key;v!==null;){if(v.key===C){if(C=x.type,C===yf){if(v.tag===7){n(g,v.sibling),E=i(v,x.props.children),E.return=g,g=E;break e}}else if(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Us&&vc(C)===v.type){n(g,v.sibling),E=i(v,x.props),Ph(E,x),E.return=g,g=E;break e}n(g,v);break}else t(g,v);v=v.sibling}x.type===yf?(E=Dc(x.props.children,g.mode,E,x.key),E.return=g,g=E):(E=gb(x.type,x.key,x.props,null,g.mode,E),Ph(E,x),E.return=g,g=E)}return o(g);case sm:e:{for(C=x.key;v!==null;){if(v.key===C)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(g,v.sibling),E=i(v,x.children||[]),E.return=g,g=E;break e}else{n(g,v);break}else t(g,v);v=v.sibling}E=Lw(x,g.mode,E),E.return=g,g=E}return o(g);case Us:return x=vc(x),w(g,v,x,E)}if(lm(x))return m(g,v,x,E);if($h(x)){if(C=$h(x),typeof C!="function")throw Error(W(150));return x=C.call(x),b(g,v,x,E)}if(typeof x.then=="function")return w(g,v,Oy(x),E);if(x.$$typeof===Wo)return w(g,v,Ay(g,x),E);My(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,v!==null&&v.tag===6?(n(g,v.sibling),E=i(v,x),E.return=g,g=E):(n(g,v),E=$w(x,g.mode,E),E.return=g,g=E),o(g)):n(g,v)}return function(g,v,x,E){try{gp=0;var C=w(g,v,x,E);return Uf=null,C}catch(_){if(_===Xd||_===dS)throw _;var k=yi(29,_,null,g.mode);return k.lanes=E,k.return=g,k}finally{}}}var Gc=tF(!0),nF=tF(!1),Bs=!1;function hT(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function eE(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ll(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function cl(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,mt&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=dv(e),GP(e,null,n),t}return fS(e,r,t,n),dv(e)}function Nm(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,SP(e,n)}}function Pw(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var tE=!1;function Dm(){if(tE){var e=Ff;if(e!==null)throw e}}function jm(e,t,n,r){tE=!1;var i=e.updateQueue;Bs=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,c=l.next;l.next=null,o===null?a=c:o.next=c,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=c:s.next=c,f.lastBaseUpdate=l))}if(a!==null){var u=i.baseState;o=0,f=c=l=null,s=a;do{var d=s.lane&-536870913,h=d!==s.lane;if(h?(at&d)===d:(r&d)===d){d!==0&&d===ud&&(tE=!0),f!==null&&(f=f.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var m=e,b=s;d=t;var w=n;switch(b.tag){case 1:if(m=b.payload,typeof m=="function"){u=m.call(w,u,d);break e}u=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=b.payload,d=typeof m=="function"?m.call(w,u,d):m,d==null)break e;u=Kt({},u,d);break e;case 2:Bs=!0}}d=s.callback,d!==null&&(e.flags|=64,h&&(e.flags|=8192),h=i.callbacks,h===null?i.callbacks=[d]:h.push(d))}else h={lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(c=f=h,l=u):f=f.next=h,o|=d;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);f===null&&(l=u),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=f,a===null&&(i.shared.lanes=0),Al|=o,e.lanes=o,e.memoizedState=u}}function rF(e,t){if(typeof e!="function")throw Error(W(191,e));e.call(t)}function iF(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)rF(n[e],t)}var fd=vo(null),gv=vo(0);function _M(e,t){e=ms,Lt(gv,e),Lt(fd,t),ms=e|t.baseLanes}function nE(){Lt(gv,ms),Lt(fd,fd.current)}function mT(){ms=gv.current,Yn(fd),Yn(gv)}var Ai=vo(null),Ji=null;function Ks(e){var t=e.alternate;Lt(cn,cn.current&1),Lt(Ai,e),Ji===null&&(t===null||fd.current!==null||t.memoizedState!==null)&&(Ji=e)}function rE(e){Lt(cn,cn.current),Lt(Ai,e),Ji===null&&(Ji=e)}function aF(e){e.tag===22?(Lt(cn,cn.current),Lt(Ai,e),Ji===null&&(Ji=e)):Gs()}function Gs(){Lt(cn,cn.current),Lt(Ai,Ai.current)}function mi(e){Yn(Ai),Ji===e&&(Ji=null),Yn(cn)}var cn=vo(0);function yv(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||wE(n)||_E(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var fs=0,Ge=null,Tt=null,vn=null,bv=!1,Bf=!1,Yc=!1,vv=0,yp=0,Hf=null,qW=0;function Qt(){throw Error(W(321))}function pT(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ri(e[n],t[n]))return!1;return!0}function gT(e,t,n,r,i,a){return fs=a,Ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$e.H=e===null||e.memoizedState===null?$F:TT,Yc=!1,a=n(r,i),Yc=!1,Bf&&(a=sF(t,n,r,i)),oF(e),a}function oF(e){$e.H=bp;var t=Tt!==null&&Tt.next!==null;if(fs=0,vn=Tt=Ge=null,bv=!1,yp=0,Hf=null,t)throw Error(W(300));e===null||En||(e=e.dependencies,e!==null&&mv(e)&&(En=!0))}function sF(e,t,n,r){Ge=e;var i=0;do{if(Bf&&(Hf=null),yp=0,Bf=!1,25<=i)throw Error(W(301));if(i+=1,vn=Tt=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}$e.H=LF,a=t(n,r)}while(Bf);return a}function VW(){var e=$e.H,t=e.useState()[0];return t=typeof t.then=="function"?pg(t):t,e=e.useState()[0],(Tt!==null?Tt.memoizedState:null)!==e&&(Ge.flags|=1024),t}function yT(){var e=vv!==0;return vv=0,e}function bT(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function vT(e){if(bv){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}bv=!1}fs=0,vn=Tt=Ge=null,Bf=!1,yp=vv=0,Hf=null}function Or(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vn===null?Ge.memoizedState=vn=e:vn=vn.next=e,vn}function fn(){if(Tt===null){var e=Ge.alternate;e=e!==null?e.memoizedState:null}else e=Tt.next;var t=vn===null?Ge.memoizedState:vn.next;if(t!==null)vn=t,Tt=e;else{if(e===null)throw Ge.alternate===null?Error(W(467)):Error(W(310));Tt=e,e={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},vn===null?Ge.memoizedState=vn=e:vn=vn.next=e}return vn}function hS(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pg(e){var t=yp;return yp+=1,Hf===null&&(Hf=[]),e=eF(Hf,e,t),t=Ge,(vn===null?t.memoizedState:vn.next)===null&&(t=t.alternate,$e.H=t===null||t.memoizedState===null?$F:TT),e}function mS(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pg(e);if(e.$$typeof===Wo)return ur(e)}throw Error(W(438,String(e)))}function ST(e){var t=null,n=Ge.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ge.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=hS(),Ge.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=OY;return t.index++,n}function ds(e,t){return typeof t=="function"?t(e):t}function bb(e){var t=fn();return xT(t,Tt,e)}function xT(e,t,n){var r=e.queue;if(r===null)throw Error(W(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var o=i.next;i.next=a.next,a.next=o}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var s=o=null,l=null,c=t,f=!1;do{var u=c.lane&-536870913;if(u!==c.lane?(at&u)===u:(fs&u)===u){var d=c.revertLane;if(d===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),u===ud&&(f=!0);else if((fs&d)===d){c=c.next,d===ud&&(f=!0);continue}else u={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=u,o=a):l=l.next=u,Ge.lanes|=d,Al|=d;u=c.action,Yc&&n(a,u),a=c.hasEagerState?c.eagerState:n(a,u)}else d={lane:u,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(s=l=d,o=a):l=l.next=d,Ge.lanes|=u,Al|=u;c=c.next}while(c!==null&&c!==t);if(l===null?o=a:l.next=s,!Ri(a,e.memoizedState)&&(En=!0,f&&(n=Ff,n!==null)))throw n;e.memoizedState=a,e.baseState=o,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Fw(e){var t=fn(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do a=e(a,o.action),o=o.next;while(o!==i);Ri(a,t.memoizedState)||(En=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function lF(e,t,n){var r=Ge,i=fn(),a=st;if(a){if(n===void 0)throw Error(W(407));n=n()}else n=t();var o=!Ri((Tt||i).memoizedState,n);if(o&&(i.memoizedState=n,En=!0),i=i.queue,wT(fF.bind(null,r,i,e),[e]),i.getSnapshot!==t||o||vn!==null&&vn.memoizedState.tag&1){if(r.flags|=2048,dd(9,{destroy:void 0},uF.bind(null,r,i,n,t),null),Nt===null)throw Error(W(349));a||fs&127||cF(r,t,n)}return n}function cF(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ge.updateQueue,t===null?(t=hS(),Ge.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function uF(e,t,n,r){t.value=n,t.getSnapshot=r,dF(t)&&hF(e)}function fF(e,t,n){return n(function(){dF(t)&&hF(e)})}function dF(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ri(e,n)}catch{return!0}}function hF(e){var t=xu(e,2);t!==null&&ri(t,e,2)}function iE(e){var t=Or();if(typeof e=="function"){var n=e;if(e=n(),Yc){Xs(!0);try{n()}finally{Xs(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:e},t}function mF(e,t,n,r){return e.baseState=n,xT(e,Tt,typeof r=="function"?r:ds)}function KW(e,t,n,r,i){if(gS(e))throw Error(W(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){a.listeners.push(o)}};$e.T!==null?n(!0):a.isTransition=!1,r(a),n=t.pending,n===null?(a.next=t.pending=a,pF(t,a)):(a.next=n.next,t.pending=n.next=a)}}function pF(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=$e.T,o={};$e.T=o;try{var s=n(i,r),l=$e.S;l!==null&&l(o,s),EM(e,t,s)}catch(c){aE(e,t,c)}finally{a!==null&&o.types!==null&&(a.types=o.types),$e.T=a}}else try{a=n(i,r),EM(e,t,a)}catch(c){aE(e,t,c)}}function EM(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){kM(e,t,r)},function(r){return aE(e,t,r)}):kM(e,t,n)}function kM(e,t,n){t.status="fulfilled",t.value=n,gF(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,pF(e,n)))}function aE(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,gF(t),t=t.next;while(t!==r)}e.action=null}function gF(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function yF(e,t){return t}function CM(e,t){if(st){var n=Nt.formState;if(n!==null){e:{var r=Ge;if(st){if(Ut){t:{for(var i=Ut,a=Gi;i.nodeType!==8;){if(!a){i=null;break t}if(i=Xi(i.nextSibling),i===null){i=null;break t}}a=i.data,i=a==="F!"||a==="F"?i:null}if(i){Ut=Xi(i.nextSibling),r=i.data==="F!";break e}}Tl(r)}r=!1}r&&(t=n[0])}}return n=Or(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yF,lastRenderedState:t},n.queue=r,n=DF.bind(null,Ge,r),r.dispatch=n,r=iE(!1),a=CT.bind(null,Ge,!1,r.queue),r=Or(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=KW.bind(null,Ge,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function TM(e){var t=fn();return bF(t,Tt,e)}function bF(e,t,n){if(t=xT(e,t,yF)[0],e=bb(ds)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=pg(t)}catch(o){throw o===Xd?dS:o}else r=t;t=fn();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Ge.flags|=2048,dd(9,{destroy:void 0},GW.bind(null,i,n),null)),[r,a,e]}function GW(e,t){e.action=t}function RM(e){var t=fn(),n=Tt;if(n!==null)return bF(t,n,e);fn(),t=t.memoizedState,n=fn();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function dd(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ge.updateQueue,t===null&&(t=hS(),Ge.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function vF(){return fn().memoizedState}function vb(e,t,n,r){var i=Or();Ge.flags|=e,i.memoizedState=dd(1|t,{destroy:void 0},n,r===void 0?null:r)}function pS(e,t,n,r){var i=fn();r=r===void 0?null:r;var a=i.memoizedState.inst;Tt!==null&&r!==null&&pT(r,Tt.memoizedState.deps)?i.memoizedState=dd(t,a,n,r):(Ge.flags|=e,i.memoizedState=dd(1|t,a,n,r))}function AM(e,t){vb(8390656,8,e,t)}function wT(e,t){pS(2048,8,e,t)}function YW(e){Ge.flags|=4;var t=Ge.updateQueue;if(t===null)t=hS(),Ge.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function SF(e){var t=fn().memoizedState;return YW({ref:t,nextImpl:e}),function(){if(mt&2)throw Error(W(440));return t.impl.apply(void 0,arguments)}}function xF(e,t){return pS(4,2,e,t)}function wF(e,t){return pS(4,4,e,t)}function _F(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function EF(e,t,n){n=n!=null?n.concat([e]):null,pS(4,4,_F.bind(null,t,e),n)}function _T(){}function kF(e,t){var n=fn();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&pT(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function CF(e,t){var n=fn();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&pT(t,r[1]))return r[0];if(r=e(),Yc){Xs(!0);try{e()}finally{Xs(!1)}}return n.memoizedState=[r,t],r}function ET(e,t,n){return n===void 0||fs&1073741824&&!(at&261930)?e.memoizedState=t:(e.memoizedState=n,e=m3(),Ge.lanes|=e,Al|=e,n)}function TF(e,t,n,r){return Ri(n,t)?n:fd.current!==null?(e=ET(e,n,r),Ri(e,t)||(En=!0),e):!(fs&42)||fs&1073741824&&!(at&261930)?(En=!0,e.memoizedState=n):(e=m3(),Ge.lanes|=e,Al|=e,t)}function RF(e,t,n,r,i){var a=pt.p;pt.p=a!==0&&8>a?a:8;var o=$e.T,s={};$e.T=s,CT(e,!1,t,n);try{var l=i(),c=$e.S;if(c!==null&&c(s,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var f=HW(l,r);Im(e,t,f,_i(e))}else Im(e,t,r,_i(e))}catch(u){Im(e,t,{then:function(){},status:"rejected",reason:u},_i())}finally{pt.p=a,o!==null&&s.types!==null&&(o.types=s.types),$e.T=o}}function WW(){}function oE(e,t,n,r){if(e.tag!==5)throw Error(W(476));var i=AF(e).queue;RF(e,i,t,Nc,n===null?WW:function(){return OF(e),n(r)})}function AF(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Nc,baseState:Nc,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:Nc},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ds,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function OF(e){var t=AF(e);t.next===null&&(t=e.alternate.memoizedState),Im(e,t.next.queue,{},_i())}function kT(){return ur(xp)}function MF(){return fn().memoizedState}function NF(){return fn().memoizedState}function JW(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_i();e=ll(n);var r=cl(t,e,n);r!==null&&(ri(r,t,n),Nm(r,t,n)),t={cache:uT()},e.payload=t;return}t=t.return}}function XW(e,t,n){var r=_i();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},gS(e)?jF(t,n):(n=oT(e,t,n,r),n!==null&&(ri(n,e,r),IF(n,t,r)))}function DF(e,t,n){var r=_i();Im(e,t,n,r)}function Im(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(gS(e))jF(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ri(s,o))return fS(e,t,i,0),Nt===null&&uS(),!1}catch{}finally{}if(n=oT(e,t,i,r),n!==null)return ri(n,e,r),IF(n,t,r),!0}return!1}function CT(e,t,n,r){if(r={lane:2,revertLane:IT(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},gS(e)){if(t)throw Error(W(479))}else t=oT(e,n,r,2),t!==null&&ri(t,e,2)}function gS(e){var t=e.alternate;return e===Ge||t!==null&&t===Ge}function jF(e,t){Bf=bv=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function IF(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,SP(e,n)}}var bp={readContext:ur,use:mS,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt};bp.useEffectEvent=Qt;var $F={readContext:ur,use:mS,useCallback:function(e,t){return Or().memoizedState=[e,t===void 0?null:t],e},useContext:ur,useEffect:AM,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,vb(4194308,4,_F.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vb(4194308,4,e,t)},useInsertionEffect:function(e,t){vb(4,2,e,t)},useMemo:function(e,t){var n=Or();t=t===void 0?null:t;var r=e();if(Yc){Xs(!0);try{e()}finally{Xs(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Or();if(n!==void 0){var i=n(t);if(Yc){Xs(!0);try{n(t)}finally{Xs(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=XW.bind(null,Ge,e),[r.memoizedState,e]},useRef:function(e){var t=Or();return e={current:e},t.memoizedState=e},useState:function(e){e=iE(e);var t=e.queue,n=DF.bind(null,Ge,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:_T,useDeferredValue:function(e,t){var n=Or();return ET(n,e,t)},useTransition:function(){var e=iE(!1);return e=RF.bind(null,Ge,e.queue,!0,!1),Or().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ge,i=Or();if(st){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),Nt===null)throw Error(W(349));at&127||cF(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,AM(fF.bind(null,r,a,e),[e]),r.flags|=2048,dd(9,{destroy:void 0},uF.bind(null,r,a,n,t),null),n},useId:function(){var e=Or(),t=Nt.identifierPrefix;if(st){var n=Qa,r=Xa;n=(r&~(1<<32-wi(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=vv++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=qW++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:kT,useFormState:CM,useActionState:CM,useOptimistic:function(e){var t=Or();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=CT.bind(null,Ge,!0,n),n.dispatch=t,[e,t]},useMemoCache:ST,useCacheRefresh:function(){return Or().memoizedState=JW.bind(null,Ge)},useEffectEvent:function(e){var t=Or(),n={impl:e};return t.memoizedState=n,function(){if(mt&2)throw Error(W(440));return n.impl.apply(void 0,arguments)}}},TT={readContext:ur,use:mS,useCallback:kF,useContext:ur,useEffect:wT,useImperativeHandle:EF,useInsertionEffect:xF,useLayoutEffect:wF,useMemo:CF,useReducer:bb,useRef:vF,useState:function(){return bb(ds)},useDebugValue:_T,useDeferredValue:function(e,t){var n=fn();return TF(n,Tt.memoizedState,e,t)},useTransition:function(){var e=bb(ds)[0],t=fn().memoizedState;return[typeof e=="boolean"?e:pg(e),t]},useSyncExternalStore:lF,useId:MF,useHostTransitionStatus:kT,useFormState:TM,useActionState:TM,useOptimistic:function(e,t){var n=fn();return mF(n,Tt,e,t)},useMemoCache:ST,useCacheRefresh:NF};TT.useEffectEvent=SF;var LF={readContext:ur,use:mS,useCallback:kF,useContext:ur,useEffect:wT,useImperativeHandle:EF,useInsertionEffect:xF,useLayoutEffect:wF,useMemo:CF,useReducer:Fw,useRef:vF,useState:function(){return Fw(ds)},useDebugValue:_T,useDeferredValue:function(e,t){var n=fn();return Tt===null?ET(n,e,t):TF(n,Tt.memoizedState,e,t)},useTransition:function(){var e=Fw(ds)[0],t=fn().memoizedState;return[typeof e=="boolean"?e:pg(e),t]},useSyncExternalStore:lF,useId:MF,useHostTransitionStatus:kT,useFormState:RM,useActionState:RM,useOptimistic:function(e,t){var n=fn();return Tt!==null?mF(n,Tt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:ST,useCacheRefresh:NF};LF.useEffectEvent=SF;function Uw(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Kt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var sE={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_i(),i=ll(r);i.payload=t,n!=null&&(i.callback=n),t=cl(e,i,r),t!==null&&(ri(t,e,r),Nm(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_i(),i=ll(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=cl(e,i,r),t!==null&&(ri(t,e,r),Nm(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_i(),r=ll(n);r.tag=2,t!=null&&(r.callback=t),t=cl(e,r,n),t!==null&&(ri(t,e,n),Nm(t,e,n))}};function OM(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!hp(n,r)||!hp(i,a):!0}function MM(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&sE.enqueueReplaceState(t,t.state,null)}function Wc(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=Kt({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function zF(e){fv(e)}function PF(e){console.error(e)}function FF(e){fv(e)}function Sv(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function NM(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function lE(e,t,n){return n=ll(n),n.tag=3,n.payload={element:null},n.callback=function(){Sv(e,t)},n}function UF(e){return e=ll(e),e.tag=3,e}function BF(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){NM(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){NM(t,n,r),typeof i!="function"&&(ul===null?ul=new Set([this]):ul.add(this));var s=r.stack;this.componentDidCatch(r.value,{componentStack:s!==null?s:""})})}function QW(e,t,n,r,i){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&Jd(t,n,i,!0),n=Ai.current,n!==null){switch(n.tag){case 31:case 13:return Ji===null?kv():n.alternate===null&&tn===0&&(tn=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===pv?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Qw(e,r,i)),!1;case 22:return n.flags|=65536,r===pv?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Qw(e,r,i)),!1}throw Error(W(435,n.tag))}return Qw(e,r,i),kv(),!1}if(st)return t=Ai.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==W_&&(e=Error(W(422),{cause:r}),pp(Ki(e,n)))):(r!==W_&&(t=Error(W(423),{cause:r}),pp(Ki(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Ki(r,n),i=lE(e.stateNode,r,i),Pw(e,i),tn!==4&&(tn=2)),!1;var a=Error(W(520),{cause:r});if(a=Ki(a,n),zm===null?zm=[a]:zm.push(a),tn!==4&&(tn=2),t===null)return!0;r=Ki(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=lE(n.stateNode,r,e),Pw(n,e),!1;case 1:if(t=n.type,a=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||a!==null&&typeof a.componentDidCatch=="function"&&(ul===null||!ul.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=UF(i),BF(i,e,n,r),Pw(n,i),!1}n=n.return}while(n!==null);return!1}var RT=Error(W(461)),En=!1;function nr(e,t,n,r){t.child=e===null?nF(t,null,n,r):Gc(t,e.child,n,r)}function DM(e,t,n,r,i){n=n.render;var a=t.ref;if("ref"in r){var o={};for(var s in r)s!=="ref"&&(o[s]=r[s])}else o=r;return Kc(t),r=gT(e,t,n,o,a,i),s=yT(),e!==null&&!En?(bT(e,t,i),hs(e,t,i)):(st&&s&&lT(t),t.flags|=1,nr(e,t,r,i),t.child)}function jM(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!sT(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,HF(e,t,a,r,i)):(e=gb(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!AT(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:hp,n(o,r)&&e.ref===t.ref)return hs(e,t,i)}return t.flags|=1,e=as(a,r),e.ref=t.ref,e.return=t,t.child=e}function HF(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(hp(a,r)&&e.ref===t.ref)if(En=!1,t.pendingProps=r=a,AT(e,i))e.flags&131072&&(En=!0);else return t.lanes=e.lanes,hs(e,t,i)}return cE(e,t,n,r,i)}function qF(e,t,n,r){var i=r.children,a=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if(t.flags&128){if(a=a!==null?a.baseLanes|n:n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return IM(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&yb(t,a!==null?a.cachePool:null),a!==null?_M(t,a):nE(),aF(t);else return r=t.lanes=536870912,IM(e,t,a!==null?a.baseLanes|n:n,n,r)}else a!==null?(yb(t,a.cachePool),_M(t,a),Gs(),t.memoizedState=null):(e!==null&&yb(t,null),nE(),Gs());return nr(e,t,i,n),t.child}function um(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function IM(e,t,n,r,i){var a=fT();return a=a===null?null:{parent:xn._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&yb(t,null),nE(),aF(t),e!==null&&Jd(e,t,r,!0),t.childLanes=i,null}function Sb(e,t){return t=xv({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function $M(e,t,n){return Gc(t,e.child,null,n),e=Sb(t,t.pendingProps),e.flags|=2,mi(t),t.memoizedState=null,e}function ZW(e,t,n){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(st){if(r.mode==="hidden")return e=Sb(t,r),t.lanes=536870912,um(null,e);if(rE(t),(e=Ut)?(e=$3(e,Gi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Cl!==null?{id:Xa,overflow:Qa}:null,retryLane:536870912,hydrationErrors:null},n=WP(e),n.return=t,t.child=n,lr=t,Ut=null)):e=null,e===null)throw Tl(t);return t.lanes=536870912,null}return Sb(t,r)}var a=e.memoizedState;if(a!==null){var o=a.dehydrated;if(rE(t),i)if(t.flags&256)t.flags&=-257,t=$M(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(W(558));else if(En||Jd(e,t,n,!1),i=(n&e.childLanes)!==0,En||i){if(r=Nt,r!==null&&(o=xP(r,n),o!==0&&o!==a.retryLane))throw a.retryLane=o,xu(e,o),ri(r,e,o),RT;kv(),t=$M(e,t,n)}else e=a.treeContext,Ut=Xi(o.nextSibling),lr=t,st=!0,sl=null,Gi=!1,e!==null&&XP(t,e),t=Sb(t,r),t.flags|=4096;return t}return e=as(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xb(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(W(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function cE(e,t,n,r,i){return Kc(t),n=gT(e,t,n,r,void 0,i),r=yT(),e!==null&&!En?(bT(e,t,i),hs(e,t,i)):(st&&r&&lT(t),t.flags|=1,nr(e,t,n,i),t.child)}function LM(e,t,n,r,i,a){return Kc(t),t.updateQueue=null,n=sF(t,r,n,i),oF(e),r=yT(),e!==null&&!En?(bT(e,t,a),hs(e,t,a)):(st&&r&&lT(t),t.flags|=1,nr(e,t,n,a),t.child)}function zM(e,t,n,r,i){if(Kc(t),t.stateNode===null){var a=kf,o=n.contextType;typeof o=="object"&&o!==null&&(a=ur(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=sE,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},hT(t),o=n.contextType,a.context=typeof o=="object"&&o!==null?ur(o):kf,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(Uw(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(o=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),o!==a.state&&sE.enqueueReplaceState(a,a.state,null),jm(t,r,a,i),Dm(),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,l=Wc(n,s);a.props=l;var c=a.context,f=n.contextType;o=kf,typeof f=="object"&&f!==null&&(o=ur(f));var u=n.getDerivedStateFromProps;f=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function",s=t.pendingProps!==s,f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s||c!==o)&&MM(t,a,r,o),Bs=!1;var d=t.memoizedState;a.state=d,jm(t,r,a,i),Dm(),c=t.memoizedState,s||d!==c||Bs?(typeof u=="function"&&(Uw(t,n,u,r),c=t.memoizedState),(l=Bs||OM(t,n,l,r,d,c,o))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=o,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,eE(e,t),o=t.memoizedProps,f=Wc(n,o),a.props=f,u=t.pendingProps,d=a.context,c=n.contextType,l=kf,typeof c=="object"&&c!==null&&(l=ur(c)),s=n.getDerivedStateFromProps,(c=typeof s=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==u||d!==l)&&MM(t,a,r,l),Bs=!1,d=t.memoizedState,a.state=d,jm(t,r,a,i),Dm();var h=t.memoizedState;o!==u||d!==h||Bs||e!==null&&e.dependencies!==null&&mv(e.dependencies)?(typeof s=="function"&&(Uw(t,n,s,r),h=t.memoizedState),(f=Bs||OM(t,n,f,r,d,h,l)||e!==null&&e.dependencies!==null&&mv(e.dependencies))?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,h,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,h,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=l,r=f):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,xb(e,t),r=(t.flags&128)!==0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Gc(t,e.child,null,i),t.child=Gc(t,null,n,i)):nr(e,t,n,i),t.memoizedState=a.state,e=t.child):e=hs(e,t,i),e}function PM(e,t,n,r){return Vc(),t.flags|=256,nr(e,t,n,r),t.child}var Bw={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hw(e){return{baseLanes:e,cachePool:ZP()}}function qw(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=vi),e}function VF(e,t,n){var r=t.pendingProps,i=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(cn.current&2)!==0),o&&(i=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(st){if(i?Ks(t):Gs(),(e=Ut)?(e=$3(e,Gi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Cl!==null?{id:Xa,overflow:Qa}:null,retryLane:536870912,hydrationErrors:null},n=WP(e),n.return=t,t.child=n,lr=t,Ut=null)):e=null,e===null)throw Tl(t);return _E(e)?t.lanes=32:t.lanes=536870912,null}var s=r.children;return r=r.fallback,i?(Gs(),i=t.mode,s=xv({mode:"hidden",children:s},i),r=Dc(r,i,n,null),s.return=t,r.return=t,s.sibling=r,t.child=s,r=t.child,r.memoizedState=Hw(n),r.childLanes=qw(e,o,n),t.memoizedState=Bw,um(null,r)):(Ks(t),uE(t,s))}var l=e.memoizedState;if(l!==null&&(s=l.dehydrated,s!==null)){if(a)t.flags&256?(Ks(t),t.flags&=-257,t=Vw(e,t,n)):t.memoizedState!==null?(Gs(),t.child=e.child,t.flags|=128,t=null):(Gs(),s=r.fallback,i=t.mode,r=xv({mode:"visible",children:r.children},i),s=Dc(s,i,n,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,Gc(t,e.child,null,n),r=t.child,r.memoizedState=Hw(n),r.childLanes=qw(e,o,n),t.memoizedState=Bw,t=um(null,r));else if(Ks(t),_E(s)){if(o=s.nextSibling&&s.nextSibling.dataset,o)var c=o.dgst;o=c,r=Error(W(419)),r.stack="",r.digest=o,pp({value:r,source:null,stack:null}),t=Vw(e,t,n)}else if(En||Jd(e,t,n,!1),o=(n&e.childLanes)!==0,En||o){if(o=Nt,o!==null&&(r=xP(o,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,xu(e,r),ri(o,e,r),RT;wE(s)||kv(),t=Vw(e,t,n)}else wE(s)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ut=Xi(s.nextSibling),lr=t,st=!0,sl=null,Gi=!1,e!==null&&XP(t,e),t=uE(t,r.children),t.flags|=4096);return t}return i?(Gs(),s=r.fallback,i=t.mode,l=e.child,c=l.sibling,r=as(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,c!==null?s=as(c,s):(s=Dc(s,i,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,um(null,r),r=t.child,s=e.child.memoizedState,s===null?s=Hw(n):(i=s.cachePool,i!==null?(l=xn._currentValue,i=i.parent!==l?{parent:l,pool:l}:i):i=ZP(),s={baseLanes:s.baseLanes|n,cachePool:i}),r.memoizedState=s,r.childLanes=qw(e,o,n),t.memoizedState=Bw,um(e.child,r)):(Ks(t),n=e.child,e=n.sibling,n=as(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function uE(e,t){return t=xv({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function xv(e,t){return e=yi(22,e,null,t),e.lanes=0,e}function Vw(e,t,n){return Gc(t,e.child,null,n),e=uE(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function FM(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),X_(e.return,t,n)}function Kw(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function KF(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=cn.current,s=(o&2)!==0;if(s?(o=o&1|2,t.flags|=128):o&=1,Lt(cn,o),nr(e,t,r,n),r=st?mp:0,!s&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&FM(e,n,t);else if(e.tag===19)FM(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&yv(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Kw(t,!1,i,n,a,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&yv(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Kw(t,!0,n,null,a,r);break;case"together":Kw(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function hs(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Al|=t.lanes,!(n&t.childLanes))if(e!==null){if(Jd(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(W(153));if(t.child!==null){for(e=t.child,n=as(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=as(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function AT(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&mv(e)))}function eJ(e,t,n){switch(t.tag){case 3:sv(t,t.stateNode.containerInfo),Vs(t,xn,e.memoizedState.cache),Vc();break;case 27:case 5:z_(t);break;case 4:sv(t,t.stateNode.containerInfo);break;case 10:Vs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,rE(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Ks(t),t.flags|=128,null):n&t.child.childLanes?VF(e,t,n):(Ks(t),e=hs(e,t,n),e!==null?e.sibling:null);Ks(t);break;case 19:var i=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(Jd(e,t,n,!1),r=(n&t.childLanes)!==0),i){if(r)return KF(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Lt(cn,cn.current),r)break;return null;case 22:return t.lanes=0,qF(e,t,n,t.pendingProps);case 24:Vs(t,xn,e.memoizedState.cache)}return hs(e,t,n)}function GF(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)En=!0;else{if(!AT(e,n)&&!(t.flags&128))return En=!1,eJ(e,t,n);En=!!(e.flags&131072)}else En=!1,st&&t.flags&1048576&&JP(t,mp,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=vc(t.elementType),t.type=e,typeof e=="function")sT(e)?(r=Wc(e,r),t.tag=1,t=zM(null,t,e,r,n)):(t.tag=0,t=cE(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===GC){t.tag=11,t=DM(null,t,e,r,n);break e}else if(i===YC){t.tag=14,t=jM(null,t,e,r,n);break e}}throw t=$_(e)||e,Error(W(306,t,""))}}return t;case 0:return cE(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Wc(r,t.pendingProps),zM(e,t,r,i,n);case 3:e:{if(sv(t,t.stateNode.containerInfo),e===null)throw Error(W(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,eE(e,t),jm(t,r,null,n);var o=t.memoizedState;if(r=o.cache,Vs(t,xn,r),r!==a.cache&&Q_(t,[xn],n,!0),Dm(),r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=PM(e,t,r,n);break e}else if(r!==i){i=Ki(Error(W(424)),t),pp(i),t=PM(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ut=Xi(e.firstChild),lr=t,st=!0,sl=null,Gi=!0,n=nF(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Vc(),r===i){t=hs(e,t,n);break e}nr(e,t,r,n)}t=t.child}return t;case 26:return xb(e,t),e===null?(n=oN(t.type,null,t.pendingProps,null))?t.memoizedState=n:st||(n=t.type,e=t.pendingProps,r=Av(ol.current).createElement(n),r[sr]=t,r[ii]=e,dr(r,n,e),Gn(r),t.stateNode=r):t.memoizedState=oN(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return z_(t),e===null&&st&&(r=t.stateNode=L3(t.type,t.pendingProps,ol.current),lr=t,Gi=!0,i=Ut,Vl(t.type)?(EE=i,Ut=Xi(r.firstChild)):Ut=i),nr(e,t,t.pendingProps.children,n),xb(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&st&&((i=r=Ut)&&(r=OJ(r,t.type,t.pendingProps,Gi),r!==null?(t.stateNode=r,lr=t,Ut=Xi(r.firstChild),Gi=!1,i=!0):i=!1),i||Tl(t)),z_(t),i=t.type,a=t.pendingProps,o=e!==null?e.memoizedProps:null,r=a.children,SE(i,a)?r=null:o!==null&&SE(i,o)&&(t.flags|=32),t.memoizedState!==null&&(i=gT(e,t,VW,null,null,n),xp._currentValue=i),xb(e,t),nr(e,t,r,n),t.child;case 6:return e===null&&st&&((e=n=Ut)&&(n=MJ(n,t.pendingProps,Gi),n!==null?(t.stateNode=n,lr=t,Ut=null,e=!0):e=!1),e||Tl(t)),null;case 13:return VF(e,t,n);case 4:return sv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Gc(t,null,r,n):nr(e,t,r,n),t.child;case 11:return DM(e,t,t.type,t.pendingProps,n);case 7:return nr(e,t,t.pendingProps,n),t.child;case 8:return nr(e,t,t.pendingProps.children,n),t.child;case 12:return nr(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Vs(t,t.type,r.value),nr(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Kc(t),i=ur(i),r=r(i),t.flags|=1,nr(e,t,r,n),t.child;case 14:return jM(e,t,t.type,t.pendingProps,n);case 15:return HF(e,t,t.type,t.pendingProps,n);case 19:return KF(e,t,n);case 31:return ZW(e,t,n);case 22:return qF(e,t,n,t.pendingProps);case 24:return Kc(t),r=ur(xn),e===null?(i=fT(),i===null&&(i=Nt,a=uT(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},hT(t),Vs(t,xn,i)):(e.lanes&n&&(eE(e,t),jm(t,null,null,n),Dm()),i=e.memoizedState,a=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Vs(t,xn,r)):(r=a.cache,Vs(t,xn,r),r!==i.cache&&Q_(t,[xn],n,!0))),nr(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(W(156,t.tag))}function Mo(e){e.flags|=4}function Gw(e,t,n,r,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(y3())e.flags|=8192;else throw Ic=pv,dT}else e.flags&=-16777217}function UM(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!F3(t))if(y3())e.flags|=8192;else throw Ic=pv,dT}function Ny(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?bP():536870912,e.lanes|=t,hd|=t)}function Fh(e,t){if(!st)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function tJ(e,t,n){var r=t.pendingProps;switch(cT(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(t),null;case 1:return Ft(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),os(xn),sd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hu(t)?Mo(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zw())),Ft(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(Mo(t),a!==null?(Ft(t),UM(t,a)):(Ft(t),Gw(t,i,null,r,n))):a?a!==e.memoizedState?(Mo(t),Ft(t),UM(t,a)):(Ft(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Mo(t),Ft(t),Gw(t,i,e,r,n)),null;case 27:if(lv(t),n=ol.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mo(t);else{if(!r){if(t.stateNode===null)throw Error(W(166));return Ft(t),null}e=oo.current,Hu(t)?gM(t):(e=L3(i,r,n),t.stateNode=e,Mo(t))}return Ft(t),null;case 5:if(lv(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mo(t);else{if(!r){if(t.stateNode===null)throw Error(W(166));return Ft(t),null}if(a=oo.current,Hu(t))gM(t);else{var o=Av(ol.current);switch(a){case 1:a=o.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:a=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":a=o.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":a=o.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":a=o.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof r.is=="string"?o.createElement("select",{is:r.is}):o.createElement("select"),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is=="string"?o.createElement(i,{is:r.is}):o.createElement(i)}}a[sr]=t,a[ii]=r;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)a.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=a;e:switch(dr(a,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Mo(t)}}return Ft(t),Gw(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mo(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(W(166));if(e=ol.current,Hu(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=lr,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[sr]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||D3(e.nodeValue,n)),e||Tl(t,!0)}else e=Av(e).createTextNode(r),e[sr]=t,t.stateNode=e}return Ft(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hu(t),n!==null){if(e===null){if(!r)throw Error(W(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(557));e[sr]=t}else Vc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ft(t),e=!1}else n=zw(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(mi(t),t):(mi(t),null);if(t.flags&128)throw Error(W(558))}return Ft(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Hu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(W(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(W(317));i[sr]=t}else Vc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ft(t),i=!1}else i=zw(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(mi(t),t):(mi(t),null)}return mi(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ny(t,t.updateQueue),Ft(t),null);case 4:return sd(),e===null&&$T(t.stateNode.containerInfo),Ft(t),null;case 10:return os(t.type),Ft(t),null;case 19:if(Yn(cn),r=t.memoizedState,r===null)return Ft(t),null;if(i=(t.flags&128)!==0,a=r.rendering,a===null)if(i)Fh(r,!1);else{if(tn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=yv(e),a!==null){for(t.flags|=128,Fh(r,!1),e=a.updateQueue,t.updateQueue=e,Ny(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)YP(n,e),n=n.sibling;return Lt(cn,cn.current&1|2),st&&qo(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Si()>_v&&(t.flags|=128,i=!0,Fh(r,!1),t.lanes=4194304)}else{if(!i)if(e=yv(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Ny(t,e),Fh(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!st)return Ft(t),null}else 2*Si()-r.renderingStartTime>_v&&n!==536870912&&(t.flags|=128,i=!0,Fh(r,!1),t.lanes=4194304);r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e!==null?e.sibling=a:t.child=a,r.last=a)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Si(),e.sibling=null,n=cn.current,Lt(cn,i?n&1|2:n&1),st&&qo(t,r.treeForkCount),e):(Ft(t),null);case 22:case 23:return mi(t),mT(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ft(t),t.subtreeFlags&6&&(t.flags|=8192)):Ft(t),n=t.updateQueue,n!==null&&Ny(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Yn(jc),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),os(xn),Ft(t),null;case 25:return null;case 30:return null}throw Error(W(156,t.tag))}function nJ(e,t){switch(cT(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(xn),sd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return lv(t),null;case 31:if(t.memoizedState!==null){if(mi(t),t.alternate===null)throw Error(W(340));Vc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(mi(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));Vc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yn(cn),null;case 4:return sd(),null;case 10:return os(t.type),null;case 22:case 23:return mi(t),mT(),e!==null&&Yn(jc),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return os(xn),null;case 25:return null;default:return null}}function YF(e,t){switch(cT(t),t.tag){case 3:os(xn),sd();break;case 26:case 27:case 5:lv(t);break;case 4:sd();break;case 31:t.memoizedState!==null&&mi(t);break;case 13:mi(t);break;case 19:Yn(cn);break;case 10:os(t.type);break;case 22:case 23:mi(t),mT(),e!==null&&Yn(jc);break;case 24:os(xn)}}function gg(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(s){St(t,t.return,s)}}function Rl(e,t,n){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var l=n,c=s;try{c()}catch(f){St(i,l,f)}}}r=r.next}while(r!==a)}}catch(f){St(t,t.return,f)}}function WF(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{iF(t,n)}catch(r){St(e,e.return,r)}}}function JF(e,t,n){n.props=Wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){St(e,t,r)}}function $m(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(i){St(e,t,i)}}function Za(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(i){St(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){St(e,t,i)}else n.current=null}function XF(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){St(e,e.return,i)}}function Yw(e,t,n){try{var r=e.stateNode;EJ(r,e.type,n,t),r[ii]=t}catch(i){St(e,e.return,i)}}function QF(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vl(e.type)||e.tag===4}function Ww(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||QF(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Vl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fE(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jo));else if(r!==4&&(r===27&&Vl(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(fE(e,t,n),e=e.sibling;e!==null;)fE(e,t,n),e=e.sibling}function wv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Vl(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(wv(e,t,n),e=e.sibling;e!==null;)wv(e,t,n),e=e.sibling}function ZF(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);dr(t,r,n),t[sr]=e,t[ii]=n}catch(a){St(e,e.return,a)}}var Ko=!1,Sn=!1,Jw=!1,BM=typeof WeakSet=="function"?WeakSet:Set,Kn=null;function rJ(e,t){if(e=e.containerInfo,bE=Dv,e=FP(e),iT(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,s=-1,l=-1,c=0,f=0,u=e,d=null;t:for(;;){for(var h;u!==n||i!==0&&u.nodeType!==3||(s=o+i),u!==a||r!==0&&u.nodeType!==3||(l=o+r),u.nodeType===3&&(o+=u.nodeValue.length),(h=u.firstChild)!==null;)d=u,u=h;for(;;){if(u===e)break t;if(d===n&&++c===i&&(s=o),d===a&&++f===r&&(l=o),(h=u.nextSibling)!==null)break;u=d,d=u.parentNode}u=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(vE={focusedElem:e,selectionRange:n},Dv=!1,Kn=t;Kn!==null;)if(t=Kn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Kn=e;else for(;Kn!==null;){switch(t=Kn,a=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var m=Wc(n.type,i);e=r.getSnapshotBeforeUpdate(m,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(b){St(n,n.return,b)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)xE(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xE(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(W(163))}if(e=t.sibling,e!==null){e.return=t.return,Kn=e;break}Kn=t.return}}function e3(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Do(e,n),r&4&&gg(5,n);break;case 1:if(Do(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(o){St(n,n.return,o)}else{var i=Wc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){St(n,n.return,o)}}r&64&&WF(n),r&512&&$m(n,n.return);break;case 3:if(Do(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{iF(e,t)}catch(o){St(n,n.return,o)}}break;case 27:t===null&&r&4&&ZF(n);case 26:case 5:Do(e,n),t===null&&r&4&&XF(n),r&512&&$m(n,n.return);break;case 12:Do(e,n);break;case 31:Do(e,n),r&4&&r3(e,n);break;case 13:Do(e,n),r&4&&i3(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=dJ.bind(null,n),NJ(e,n))));break;case 22:if(r=n.memoizedState!==null||Ko,!r){t=t!==null&&t.memoizedState!==null||Sn,i=Ko;var a=Sn;Ko=r,(Sn=t)&&!a?zo(e,n,(n.subtreeFlags&8772)!==0):Do(e,n),Ko=i,Sn=a}break;case 30:break;default:Do(e,n)}}function t3(e){var t=e.alternate;t!==null&&(e.alternate=null,t3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&QC(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Wt=null,Wr=!1;function No(e,t,n){for(n=n.child;n!==null;)n3(e,t,n),n=n.sibling}function n3(e,t,n){if(xi&&typeof xi.onCommitFiberUnmount=="function")try{xi.onCommitFiberUnmount(cg,n)}catch{}switch(n.tag){case 26:Sn||Za(n,t),No(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Sn||Za(n,t);var r=Wt,i=Wr;Vl(n.type)&&(Wt=n.stateNode,Wr=!1),No(e,t,n),Fm(n.stateNode),Wt=r,Wr=i;break;case 5:Sn||Za(n,t);case 6:if(r=Wt,i=Wr,Wt=null,No(e,t,n),Wt=r,Wr=i,Wt!==null)if(Wr)try{(Wt.nodeType===9?Wt.body:Wt.nodeName==="HTML"?Wt.ownerDocument.body:Wt).removeChild(n.stateNode)}catch(a){St(n,t,a)}else try{Wt.removeChild(n.stateNode)}catch(a){St(n,t,a)}break;case 18:Wt!==null&&(Wr?(e=Wt,tN(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),yd(e)):tN(Wt,n.stateNode));break;case 4:r=Wt,i=Wr,Wt=n.stateNode.containerInfo,Wr=!0,No(e,t,n),Wt=r,Wr=i;break;case 0:case 11:case 14:case 15:Rl(2,n,t),Sn||Rl(4,n,t),No(e,t,n);break;case 1:Sn||(Za(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&JF(n,t,r)),No(e,t,n);break;case 21:No(e,t,n);break;case 22:Sn=(r=Sn)||n.memoizedState!==null,No(e,t,n),Sn=r;break;default:No(e,t,n)}}function r3(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{yd(e)}catch(n){St(t,t.return,n)}}}function i3(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{yd(e)}catch(n){St(t,t.return,n)}}function iJ(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new BM),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new BM),t;default:throw Error(W(435,e.tag))}}function Dy(e,t){var n=iJ(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var i=hJ.bind(null,e,r);r.then(i,i)}})}function Kr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],a=e,o=t,s=o;e:for(;s!==null;){switch(s.tag){case 27:if(Vl(s.type)){Wt=s.stateNode,Wr=!1;break e}break;case 5:Wt=s.stateNode,Wr=!1;break e;case 3:case 4:Wt=s.stateNode.containerInfo,Wr=!0;break e}s=s.return}if(Wt===null)throw Error(W(160));n3(a,o,i),Wt=null,Wr=!1,a=i.alternate,a!==null&&(a.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)a3(t,e),t=t.sibling}var pa=null;function a3(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Kr(t,e),Gr(e),r&4&&(Rl(3,e,e.return),gg(3,e),Rl(5,e,e.return));break;case 1:Kr(t,e),Gr(e),r&512&&(Sn||n===null||Za(n,n.return)),r&64&&Ko&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=pa;if(Kr(t,e),Gr(e),r&512&&(Sn||n===null||Za(n,n.return)),r&4){var a=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":a=i.getElementsByTagName("title")[0],(!a||a[dg]||a[sr]||a.namespaceURI==="http://www.w3.org/2000/svg"||a.hasAttribute("itemprop"))&&(a=i.createElement(r),i.head.insertBefore(a,i.querySelector("head > title"))),dr(a,r,n),a[sr]=e,Gn(a),r=a;break e;case"link":var o=lN("link","href",i).get(r+(n.href||""));if(o){for(var s=0;s<o.length;s++)if(a=o[s],a.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&a.getAttribute("rel")===(n.rel==null?null:n.rel)&&a.getAttribute("title")===(n.title==null?null:n.title)&&a.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break t}}a=i.createElement(r),dr(a,r,n),i.head.appendChild(a);break;case"meta":if(o=lN("meta","content",i).get(r+(n.content||""))){for(s=0;s<o.length;s++)if(a=o[s],a.getAttribute("content")===(n.content==null?null:""+n.content)&&a.getAttribute("name")===(n.name==null?null:n.name)&&a.getAttribute("property")===(n.property==null?null:n.property)&&a.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(s,1);break t}}a=i.createElement(r),dr(a,r,n),i.head.appendChild(a);break;default:throw Error(W(468,r))}a[sr]=e,Gn(a),r=a}e.stateNode=r}else cN(i,e.type,e.stateNode);else e.stateNode=sN(i,r,e.memoizedProps);else a!==r?(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?cN(i,e.type,e.stateNode):sN(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Yw(e,e.memoizedProps,n.memoizedProps)}break;case 27:Kr(t,e),Gr(e),r&512&&(Sn||n===null||Za(n,n.return)),n!==null&&r&4&&Yw(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Kr(t,e),Gr(e),r&512&&(Sn||n===null||Za(n,n.return)),e.flags&32){i=e.stateNode;try{cd(i,"")}catch(m){St(e,e.return,m)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,Yw(e,i,n!==null?n.memoizedProps:i)),r&1024&&(Jw=!0);break;case 6:if(Kr(t,e),Gr(e),r&4){if(e.stateNode===null)throw Error(W(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(m){St(e,e.return,m)}}break;case 3:if(Eb=null,i=pa,pa=Ov(t.containerInfo),Kr(t,e),pa=i,Gr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{yd(t.containerInfo)}catch(m){St(e,e.return,m)}Jw&&(Jw=!1,o3(e));break;case 4:r=pa,pa=Ov(e.stateNode.containerInfo),Kr(t,e),Gr(e),pa=r;break;case 12:Kr(t,e),Gr(e);break;case 31:Kr(t,e),Gr(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Dy(e,r)));break;case 13:Kr(t,e),Gr(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(yS=Si()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Dy(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=Ko,f=Sn;if(Ko=c||i,Sn=f||l,Kr(t,e),Sn=f,Ko=c,Gr(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Ko||Sn||Sc(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(a=l.stateNode,i)o=a.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{s=l.stateNode;var u=l.memoizedProps.style,d=u!=null&&u.hasOwnProperty("display")?u.display:null;s.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(m){St(l,l.return,m)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?"":l.memoizedProps}catch(m){St(l,l.return,m)}}}else if(t.tag===18){if(n===null){l=t;try{var h=l.stateNode;i?nN(h,!0):nN(l.stateNode,!1)}catch(m){St(l,l.return,m)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Dy(e,n))));break;case 19:Kr(t,e),Gr(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Dy(e,r)));break;case 30:break;case 21:break;default:Kr(t,e),Gr(e)}}function Gr(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(QF(r)){n=r;break}r=r.return}if(n==null)throw Error(W(160));switch(n.tag){case 27:var i=n.stateNode,a=Ww(e);wv(e,a,i);break;case 5:var o=n.stateNode;n.flags&32&&(cd(o,""),n.flags&=-33);var s=Ww(e);wv(e,s,o);break;case 3:case 4:var l=n.stateNode.containerInfo,c=Ww(e);fE(e,c,l);break;default:throw Error(W(161))}}catch(f){St(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function o3(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;o3(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Do(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)e3(e,t.alternate,t),t=t.sibling}function Sc(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Rl(4,t,t.return),Sc(t);break;case 1:Za(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&JF(t,t.return,n),Sc(t);break;case 27:Fm(t.stateNode);case 26:case 5:Za(t,t.return),Sc(t);break;case 22:t.memoizedState===null&&Sc(t);break;case 30:Sc(t);break;default:Sc(t)}e=e.sibling}}function zo(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:zo(i,a,n),gg(4,a);break;case 1:if(zo(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(c){St(r,r.return,c)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)rF(l[i],s)}catch(c){St(r,r.return,c)}}n&&o&64&&WF(a),$m(a,a.return);break;case 27:ZF(a);case 26:case 5:zo(i,a,n),n&&r===null&&o&4&&XF(a),$m(a,a.return);break;case 12:zo(i,a,n);break;case 31:zo(i,a,n),n&&o&4&&r3(i,a);break;case 13:zo(i,a,n),n&&o&4&&i3(i,a);break;case 22:a.memoizedState===null&&zo(i,a,n),$m(a,a.return);break;case 30:break;default:zo(i,a,n)}t=t.sibling}}function OT(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&mg(n))}function MT(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mg(e))}function fa(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)s3(e,t,n,r),t=t.sibling}function s3(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:fa(e,t,n,r),i&2048&&gg(9,t);break;case 1:fa(e,t,n,r);break;case 3:fa(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mg(e)));break;case 12:if(i&2048){fa(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s=="function"&&s(o,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){St(t,t.return,l)}}else fa(e,t,n,r);break;case 31:fa(e,t,n,r);break;case 13:fa(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState!==null?a._visibility&2?fa(e,t,n,r):Lm(e,t):a._visibility&2?fa(e,t,n,r):(a._visibility|=2,rf(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),i&2048&&OT(o,t);break;case 24:fa(e,t,n,r),i&2048&&MT(t.alternate,t);break;default:fa(e,t,n,r)}}function rf(e,t,n,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var a=e,o=t,s=n,l=r,c=o.flags;switch(o.tag){case 0:case 11:case 15:rf(a,o,s,l,i),gg(8,o);break;case 23:break;case 22:var f=o.stateNode;o.memoizedState!==null?f._visibility&2?rf(a,o,s,l,i):Lm(a,o):(f._visibility|=2,rf(a,o,s,l,i)),i&&c&2048&&OT(o.alternate,o);break;case 24:rf(a,o,s,l,i),i&&c&2048&&MT(o.alternate,o);break;default:rf(a,o,s,l,i)}t=t.sibling}}function Lm(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Lm(n,r),i&2048&&OT(r.alternate,r);break;case 24:Lm(n,r),i&2048&&MT(r.alternate,r);break;default:Lm(n,r)}t=t.sibling}}var fm=8192;function qu(e,t,n){if(e.subtreeFlags&fm)for(e=e.child;e!==null;)l3(e,t,n),e=e.sibling}function l3(e,t,n){switch(e.tag){case 26:qu(e,t,n),e.flags&fm&&e.memoizedState!==null&&qJ(n,pa,e.memoizedState,e.memoizedProps);break;case 5:qu(e,t,n);break;case 3:case 4:var r=pa;pa=Ov(e.stateNode.containerInfo),qu(e,t,n),pa=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=fm,fm=16777216,qu(e,t,n),fm=r):qu(e,t,n));break;default:qu(e,t,n)}}function c3(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Uh(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Kn=r,f3(r,e)}c3(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)u3(e),e=e.sibling}function u3(e){switch(e.tag){case 0:case 11:case 15:Uh(e),e.flags&2048&&Rl(9,e,e.return);break;case 3:Uh(e);break;case 12:Uh(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,wb(e)):Uh(e);break;default:Uh(e)}}function wb(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Kn=r,f3(r,e)}c3(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Rl(8,t,t.return),wb(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,wb(t));break;default:wb(t)}e=e.sibling}}function f3(e,t){for(;Kn!==null;){var n=Kn;switch(n.tag){case 0:case 11:case 15:Rl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:mg(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Kn=r;else e:for(n=e;Kn!==null;){r=Kn;var i=r.sibling,a=r.return;if(t3(r),r===n){Kn=null;break e}if(i!==null){i.return=a,Kn=i;break e}Kn=a}}}var aJ={getCacheForType:function(e){var t=ur(xn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ur(xn).controller.signal}},oJ=typeof WeakMap=="function"?WeakMap:Map,mt=0,Nt=null,nt=null,at=0,bt=0,di=null,Zs=!1,Qd=!1,NT=!1,ms=0,tn=0,Al=0,$c=0,DT=0,vi=0,hd=0,zm=null,Jr=null,dE=!1,yS=0,d3=0,_v=1/0,Ev=null,ul=null,In=0,fl=null,md=null,ss=0,hE=0,mE=null,h3=null,Pm=0,pE=null;function _i(){return mt&2&&at!==0?at&-at:$e.T!==null?IT():wP()}function m3(){if(vi===0)if(!(at&536870912)||st){var e=ky;ky<<=1,!(ky&3932160)&&(ky=262144),vi=e}else vi=536870912;return e=Ai.current,e!==null&&(e.flags|=32),vi}function ri(e,t,n){(e===Nt&&(bt===2||bt===9)||e.cancelPendingCommit!==null)&&(pd(e,0),el(e,at,vi,!1)),fg(e,n),(!(mt&2)||e!==Nt)&&(e===Nt&&(!(mt&2)&&($c|=n),tn===4&&el(e,at,vi,!1)),So(e))}function p3(e,t,n){if(mt&6)throw Error(W(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ug(e,t),i=r?cJ(e,t):Xw(e,t,!0),a=r;do{if(i===0){Qd&&!r&&el(e,t,0,!1);break}else{if(n=e.current.alternate,a&&!sJ(n)){i=Xw(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var s=e;i=zm;var l=s.current.memoizedState.isDehydrated;if(l&&(pd(s,o).flags|=256),o=Xw(s,o,!1),o!==2){if(NT&&!l){s.errorRecoveryDisabledLanes|=a,$c|=a,i=4;break e}a=Jr,Jr=i,a!==null&&(Jr===null?Jr=a:Jr.push.apply(Jr,a))}i=o}if(a=!1,i!==2)continue}}if(i===1){pd(e,0),el(e,t,0,!0);break}e:{switch(r=e,a=i,a){case 0:case 1:throw Error(W(345));case 4:if((t&4194048)!==t)break;case 6:el(r,t,vi,!Zs);break e;case 2:Jr=null;break;case 3:case 5:break;default:throw Error(W(329))}if((t&62914560)===t&&(i=yS+300-Si(),10<i)){if(el(r,t,vi,!Zs),oS(r,0,!0)!==0)break e;ss=t,r.timeoutHandle=I3(HM.bind(null,r,n,Jr,Ev,dE,t,vi,$c,hd,Zs,a,"Throttled",-0,0),i);break e}HM(r,n,Jr,Ev,dE,t,vi,$c,hd,Zs,a,null,-0,0)}}break}while(!0);So(e)}function HM(e,t,n,r,i,a,o,s,l,c,f,u,d,h){if(e.timeoutHandle=-1,u=t.subtreeFlags,u&8192||(u&16785408)===16785408){u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jo},l3(t,a,u);var m=(a&62914560)===a?yS-Si():(a&4194048)===a?d3-Si():0;if(m=VJ(u,m),m!==null){ss=a,e.cancelPendingCommit=m(VM.bind(null,e,t,a,n,r,i,o,s,l,f,u,null,d,h)),el(e,a,o,!c);return}}VM(e,t,a,n,r,i,o,s,l)}function sJ(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ri(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function el(e,t,n,r){t&=~DT,t&=~$c,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-wi(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&vP(e,n,t)}function bS(){return mt&6?!0:(yg(0),!1)}function jT(){if(nt!==null){if(bt===0)var e=nt.return;else e=nt,Xo=wu=null,vT(e),Uf=null,gp=0,e=nt;for(;e!==null;)YF(e.alternate,e),e=e.return;nt=null}}function pd(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,TJ(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ss=0,jT(),Nt=e,nt=n=as(e.current,null),at=t,bt=0,di=null,Zs=!1,Qd=ug(e,t),NT=!1,hd=vi=DT=$c=Al=tn=0,Jr=zm=null,dE=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-wi(r),a=1<<i;t|=e[i],r&=~a}return ms=t,uS(),n}function g3(e,t){Ge=null,$e.H=bp,t===Xd||t===dS?(t=xM(),bt=3):t===dT?(t=xM(),bt=4):bt=t===RT?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,di=t,nt===null&&(tn=1,Sv(e,Ki(t,e.current)))}function y3(){var e=Ai.current;return e===null?!0:(at&4194048)===at?Ji===null:(at&62914560)===at||at&536870912?e===Ji:!1}function b3(){var e=$e.H;return $e.H=bp,e===null?bp:e}function v3(){var e=$e.A;return $e.A=aJ,e}function kv(){tn=4,Zs||(at&4194048)!==at&&Ai.current!==null||(Qd=!0),!(Al&134217727)&&!($c&134217727)||Nt===null||el(Nt,at,vi,!1)}function Xw(e,t,n){var r=mt;mt|=2;var i=b3(),a=v3();(Nt!==e||at!==t)&&(Ev=null,pd(e,t)),t=!1;var o=tn;e:do try{if(bt!==0&&nt!==null){var s=nt,l=di;switch(bt){case 8:jT(),o=6;break e;case 3:case 2:case 9:case 6:Ai.current===null&&(t=!0);var c=bt;if(bt=0,di=null,Rf(e,s,l,c),n&&Qd){o=0;break e}break;default:c=bt,bt=0,di=null,Rf(e,s,l,c)}}lJ(),o=tn;break}catch(f){g3(e,f)}while(!0);return t&&e.shellSuspendCounter++,Xo=wu=null,mt=r,$e.H=i,$e.A=a,nt===null&&(Nt=null,at=0,uS()),o}function lJ(){for(;nt!==null;)S3(nt)}function cJ(e,t){var n=mt;mt|=2;var r=b3(),i=v3();Nt!==e||at!==t?(Ev=null,_v=Si()+500,pd(e,t)):Qd=ug(e,t);e:do try{if(bt!==0&&nt!==null){t=nt;var a=di;t:switch(bt){case 1:bt=0,di=null,Rf(e,t,a,1);break;case 2:case 9:if(SM(a)){bt=0,di=null,qM(t);break}t=function(){bt!==2&&bt!==9||Nt!==e||(bt=7),So(e)},a.then(t,t);break e;case 3:bt=7;break e;case 4:bt=5;break e;case 7:SM(a)?(bt=0,di=null,qM(t)):(bt=0,di=null,Rf(e,t,a,7));break;case 5:var o=null;switch(nt.tag){case 26:o=nt.memoizedState;case 5:case 27:var s=nt;if(o?F3(o):s.stateNode.complete){bt=0,di=null;var l=s.sibling;if(l!==null)nt=l;else{var c=s.return;c!==null?(nt=c,vS(c)):nt=null}break t}}bt=0,di=null,Rf(e,t,a,5);break;case 6:bt=0,di=null,Rf(e,t,a,6);break;case 8:jT(),tn=6;break e;default:throw Error(W(462))}}uJ();break}catch(f){g3(e,f)}while(!0);return Xo=wu=null,$e.H=r,$e.A=i,mt=n,nt!==null?0:(Nt=null,at=0,uS(),tn)}function uJ(){for(;nt!==null&&!DY();)S3(nt)}function S3(e){var t=GF(e.alternate,e,ms);e.memoizedProps=e.pendingProps,t===null?vS(e):nt=t}function qM(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=LM(n,t,t.pendingProps,t.type,void 0,at);break;case 11:t=LM(n,t,t.pendingProps,t.type.render,t.ref,at);break;case 5:vT(t);default:YF(n,t),t=nt=YP(t,ms),t=GF(n,t,ms)}e.memoizedProps=e.pendingProps,t===null?vS(e):nt=t}function Rf(e,t,n,r){Xo=wu=null,vT(t),Uf=null,gp=0;var i=t.return;try{if(QW(e,i,t,n,at)){tn=1,Sv(e,Ki(n,e.current)),nt=null;return}}catch(a){if(i!==null)throw nt=i,a;tn=1,Sv(e,Ki(n,e.current)),nt=null;return}t.flags&32768?(st||r===1?e=!0:Qd||at&536870912?e=!1:(Zs=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ai.current,r!==null&&r.tag===13&&(r.flags|=16384))),x3(t,e)):vS(t)}function vS(e){var t=e;do{if(t.flags&32768){x3(t,Zs);return}e=t.return;var n=tJ(t.alternate,t,ms);if(n!==null){nt=n;return}if(t=t.sibling,t!==null){nt=t;return}nt=t=e}while(t!==null);tn===0&&(tn=5)}function x3(e,t){do{var n=nJ(e.alternate,e);if(n!==null){n.flags&=32767,nt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){nt=e;return}nt=e=n}while(e!==null);tn=6,nt=null}function VM(e,t,n,r,i,a,o,s,l){e.cancelPendingCommit=null;do SS();while(In!==0);if(mt&6)throw Error(W(327));if(t!==null){if(t===e.current)throw Error(W(177));if(a=t.lanes|t.childLanes,a|=aT,HY(e,n,a,o,s,l),e===Nt&&(nt=Nt=null,at=0),md=t,fl=e,ss=n,hE=a,mE=i,h3=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,mJ(cv,function(){return C3(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=$e.T,$e.T=null,i=pt.p,pt.p=2,o=mt,mt|=4;try{rJ(e,t,n)}finally{mt=o,pt.p=i,$e.T=r}}In=1,w3(),_3(),E3()}}function w3(){if(In===1){In=0;var e=fl,t=md,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=$e.T,$e.T=null;var r=pt.p;pt.p=2;var i=mt;mt|=4;try{a3(t,e);var a=vE,o=FP(e.containerInfo),s=a.focusedElem,l=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&PP(s.ownerDocument.documentElement,s)){if(l!==null&&iT(s)){var c=l.start,f=l.end;if(f===void 0&&(f=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(f,s.value.length);else{var u=s.ownerDocument||document,d=u&&u.defaultView||window;if(d.getSelection){var h=d.getSelection(),m=s.textContent.length,b=Math.min(l.start,m),w=l.end===void 0?b:Math.min(l.end,m);!h.extend&&b>w&&(o=w,w=b,b=o);var g=hM(s,b),v=hM(s,w);if(g&&v&&(h.rangeCount!==1||h.anchorNode!==g.node||h.anchorOffset!==g.offset||h.focusNode!==v.node||h.focusOffset!==v.offset)){var x=u.createRange();x.setStart(g.node,g.offset),h.removeAllRanges(),b>w?(h.addRange(x),h.extend(v.node,v.offset)):(x.setEnd(v.node,v.offset),h.addRange(x))}}}}for(u=[],h=s;h=h.parentNode;)h.nodeType===1&&u.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<u.length;s++){var E=u[s];E.element.scrollLeft=E.left,E.element.scrollTop=E.top}}Dv=!!bE,vE=bE=null}finally{mt=i,pt.p=r,$e.T=n}}e.current=t,In=2}}function _3(){if(In===2){In=0;var e=fl,t=md,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=$e.T,$e.T=null;var r=pt.p;pt.p=2;var i=mt;mt|=4;try{e3(e,t.alternate,t)}finally{mt=i,pt.p=r,$e.T=n}}In=3}}function E3(){if(In===4||In===3){In=0,jY();var e=fl,t=md,n=ss,r=h3;t.subtreeFlags&10256||t.flags&10256?In=5:(In=0,md=fl=null,k3(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ul=null),XC(n),t=t.stateNode,xi&&typeof xi.onCommitFiberRoot=="function")try{xi.onCommitFiberRoot(cg,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=$e.T,i=pt.p,pt.p=2,$e.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{$e.T=t,pt.p=i}}ss&3&&SS(),So(e),i=e.pendingLanes,n&261930&&i&42?e===pE?Pm++:(Pm=0,pE=e):Pm=0,yg(0)}}function k3(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,mg(t)))}function SS(){return w3(),_3(),E3(),C3()}function C3(){if(In!==5)return!1;var e=fl,t=hE;hE=0;var n=XC(ss),r=$e.T,i=pt.p;try{pt.p=32>n?32:n,$e.T=null,n=mE,mE=null;var a=fl,o=ss;if(In=0,md=fl=null,ss=0,mt&6)throw Error(W(331));var s=mt;if(mt|=4,u3(a.current),s3(a,a.current,o,n),mt=s,yg(0,!1),xi&&typeof xi.onPostCommitFiberRoot=="function")try{xi.onPostCommitFiberRoot(cg,a)}catch{}return!0}finally{pt.p=i,$e.T=r,k3(e,t)}}function KM(e,t,n){t=Ki(n,t),t=lE(e.stateNode,t,2),e=cl(e,t,2),e!==null&&(fg(e,2),So(e))}function St(e,t,n){if(e.tag===3)KM(e,e,n);else for(;t!==null;){if(t.tag===3){KM(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ul===null||!ul.has(r))){e=Ki(n,e),n=UF(2),r=cl(t,n,2),r!==null&&(BF(n,r,t,e),fg(r,2),So(r));break}}t=t.return}}function Qw(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new oJ;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(NT=!0,i.add(n),e=fJ.bind(null,e,t,n),t.then(e,e))}function fJ(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Nt===e&&(at&n)===n&&(tn===4||tn===3&&(at&62914560)===at&&300>Si()-yS?!(mt&2)&&pd(e,0):DT|=n,hd===at&&(hd=0)),So(e)}function T3(e,t){t===0&&(t=bP()),e=xu(e,t),e!==null&&(fg(e,t),So(e))}function dJ(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),T3(e,n)}function hJ(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(W(314))}r!==null&&r.delete(t),T3(e,n)}function mJ(e,t){return WC(e,t)}var Cv=null,af=null,gE=!1,Tv=!1,Zw=!1,tl=0;function So(e){e!==af&&e.next===null&&(af===null?Cv=af=e:af=af.next=e),Tv=!0,gE||(gE=!0,gJ())}function yg(e,t){if(!Zw&&Tv){Zw=!0;do for(var n=!1,r=Cv;r!==null;){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-wi(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,GM(r,a))}else a=at,a=oS(r,r===Nt?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ug(r,a)||(n=!0,GM(r,a));r=r.next}while(n);Zw=!1}}function pJ(){R3()}function R3(){Tv=gE=!1;var e=0;tl!==0&&CJ()&&(e=tl);for(var t=Si(),n=null,r=Cv;r!==null;){var i=r.next,a=A3(r,t);a===0?(r.next=null,n===null?Cv=i:n.next=i,i===null&&(af=n)):(n=r,(e!==0||a&3)&&(Tv=!0)),r=i}In!==0&&In!==5||yg(e),tl!==0&&(tl=0)}function A3(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-wi(a),s=1<<o,l=i[o];l===-1?(!(s&n)||s&r)&&(i[o]=BY(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}if(t=Nt,n=at,n=oS(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(bt===2||bt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Tw(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ug(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Tw(r),XC(n)){case 2:case 8:n=gP;break;case 32:n=cv;break;case 268435456:n=yP;break;default:n=cv}return r=O3.bind(null,e),n=WC(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Tw(r),e.callbackPriority=2,e.callbackNode=null,2}function O3(e,t){if(In!==0&&In!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(SS()&&e.callbackNode!==n)return null;var r=at;return r=oS(e,e===Nt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(p3(e,r,t),A3(e,Si()),e.callbackNode!=null&&e.callbackNode===n?O3.bind(null,e):null)}function GM(e,t){if(SS())return null;p3(e,t,!0)}function gJ(){RJ(function(){mt&6?WC(pP,pJ):R3()})}function IT(){if(tl===0){var e=ud;e===0&&(e=Ey,Ey<<=1,!(Ey&261888)&&(Ey=256)),tl=e}return tl}function YM(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:hb(""+e)}function WM(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function yJ(e,t,n,r,i){if(t==="submit"&&n&&n.stateNode===i){var a=YM((i[ii]||null).action),o=r.submitter;o&&(t=(t=o[ii]||null)?YM(t.formAction):o.getAttribute("formAction"),t!==null&&(a=t,o=null));var s=new sS("action","action",null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(tl!==0){var l=o?WM(i,o):new FormData(i);oE(n,{pending:!0,data:l,method:i.method,action:a},null,l)}}else typeof a=="function"&&(s.preventDefault(),l=o?WM(i,o):new FormData(i),oE(n,{pending:!0,data:l,method:i.method,action:a},a,l))},currentTarget:i}]})}}for(var e1=0;e1<Y_.length;e1++){var t1=Y_[e1],bJ=t1.toLowerCase(),vJ=t1[0].toUpperCase()+t1.slice(1);za(bJ,"on"+vJ)}za(BP,"onAnimationEnd");za(HP,"onAnimationIteration");za(qP,"onAnimationStart");za("dblclick","onDoubleClick");za("focusin","onFocus");za("focusout","onBlur");za(IW,"onTransitionRun");za($W,"onTransitionStart");za(LW,"onTransitionCancel");za(VP,"onTransitionEnd");ld("onMouseEnter",["mouseout","mouseover"]);ld("onMouseLeave",["mouseout","mouseover"]);ld("onPointerEnter",["pointerout","pointerover"]);ld("onPointerLeave",["pointerout","pointerover"]);bu("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));bu("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));bu("onBeforeInput",["compositionend","keypress","textInput","paste"]);bu("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));bu("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));bu("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vp="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(" "),SJ=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vp));function M3(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break e;a=s,i.currentTarget=c;try{a(i)}catch(f){fv(f)}i.currentTarget=null,a=l}else for(o=0;o<r.length;o++){if(s=r[o],l=s.instance,c=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break e;a=s,i.currentTarget=c;try{a(i)}catch(f){fv(f)}i.currentTarget=null,a=l}}}}function tt(e,t){var n=t[F_];n===void 0&&(n=t[F_]=new Set);var r=e+"__bubble";n.has(r)||(N3(t,e,2,!1),n.add(r))}function n1(e,t,n){var r=0;t&&(r|=4),N3(n,e,r,t)}var jy="_reactListening"+Math.random().toString(36).slice(2);function $T(e){if(!e[jy]){e[jy]=!0,_P.forEach(function(n){n!=="selectionchange"&&(SJ.has(n)||n1(n,!1,e),n1(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[jy]||(t[jy]=!0,n1("selectionchange",!1,t))}}function N3(e,t,n,r){switch(V3(t)){case 2:var i=YJ;break;case 8:i=WJ;break;default:i=FT}n=i.bind(null,t,n,e),i=void 0,!V_||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function r1(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=vf(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue e}s=s.parentNode}}r=r.return}MP(function(){var c=a,f=eT(n),u=[];e:{var d=KP.get(e);if(d!==void 0){var h=sS,m=e;switch(e){case"keypress":if(pb(n)===0)break e;case"keydown":case"keyup":h=hW;break;case"focusin":m="focus",h=Nw;break;case"focusout":m="blur",h=Nw;break;case"beforeblur":case"afterblur":h=Nw;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=rM;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=tW;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=gW;break;case BP:case HP:case qP:h=iW;break;case VP:h=bW;break;case"scroll":case"scrollend":h=ZY;break;case"wheel":h=SW;break;case"copy":case"cut":case"paste":h=oW;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=aM;break;case"toggle":case"beforetoggle":h=wW}var b=(t&4)!==0,w=!b&&(e==="scroll"||e==="scrollend"),g=b?d!==null?d+"Capture":null:d;b=[];for(var v=c,x;v!==null;){var E=v;if(x=E.stateNode,E=E.tag,E!==5&&E!==26&&E!==27||x===null||g===null||(E=fp(v,g),E!=null&&b.push(Sp(v,E,x))),w)break;v=v.return}0<b.length&&(d=new h(d,m,null,n,f),u.push({event:d,listeners:b}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&n!==q_&&(m=n.relatedTarget||n.fromElement)&&(vf(m)||m[Yd]))break e;if((h||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=c,m=m?vf(m):null,m!==null&&(w=lg(m),b=m.tag,m!==w||b!==5&&b!==27&&b!==6)&&(m=null)):(h=null,m=c),h!==m)){if(b=rM,E="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(b=aM,E="onPointerLeave",g="onPointerEnter",v="pointer"),w=h==null?d:cm(h),x=m==null?d:cm(m),d=new b(E,v+"leave",h,n,f),d.target=w,d.relatedTarget=x,E=null,vf(f)===c&&(b=new b(g,v+"enter",m,n,f),b.target=x,b.relatedTarget=w,E=b),w=E,h&&m)t:{for(b=xJ,g=h,v=m,x=0,E=g;E;E=b(E))x++;E=0;for(var C=v;C;C=b(C))E++;for(;0<x-E;)g=b(g),x--;for(;0<E-x;)v=b(v),E--;for(;x--;){if(g===v||v!==null&&g===v.alternate){b=g;break t}g=b(g),v=b(v)}b=null}else b=null;h!==null&&JM(u,d,h,b,!1),m!==null&&w!==null&&JM(u,w,m,b,!0)}}e:{if(d=c?cm(c):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var k=cM;else if(lM(d))if(LP)k=NW;else{k=OW;var _=AW}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?c&&ZC(c.elementType)&&(k=cM):k=MW;if(k&&(k=k(e,c))){$P(u,k,n,f);break e}_&&_(e,d,c),e==="focusout"&&c&&d.type==="number"&&c.memoizedProps.value!=null&&H_(d,"number",d.value)}switch(_=c?cm(c):window,e){case"focusin":(lM(_)||_.contentEditable==="true")&&(wf=_,K_=c,Om=null);break;case"focusout":Om=K_=wf=null;break;case"mousedown":G_=!0;break;case"contextmenu":case"mouseup":case"dragend":G_=!1,mM(u,n,f);break;case"selectionchange":if(jW)break;case"keydown":case"keyup":mM(u,n,f)}var A;if(rT)e:{switch(e){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else xf?jP(e,n)&&(I="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(I="onCompositionStart");I&&(DP&&n.locale!=="ko"&&(xf||I!=="onCompositionStart"?I==="onCompositionEnd"&&xf&&(A=NP()):(Qs=f,tT="value"in Qs?Qs.value:Qs.textContent,xf=!0)),_=Rv(c,I),0<_.length&&(I=new iM(I,e,null,n,f),u.push({event:I,listeners:_}),A?I.data=A:(A=IP(n),A!==null&&(I.data=A)))),(A=EW?kW(e,n):CW(e,n))&&(I=Rv(c,"onBeforeInput"),0<I.length&&(_=new iM("onBeforeInput","beforeinput",null,n,f),u.push({event:_,listeners:I}),_.data=A)),yJ(u,e,c,n,f)}M3(u,t)})}function Sp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Rv(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=fp(e,n),i!=null&&r.unshift(Sp(e,i,a)),i=fp(e,t),i!=null&&r.push(Sp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function xJ(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function JM(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,l!==null&&l===r)break;s!==5&&s!==26&&s!==27||c===null||(l=c,i?(c=fp(n,a),c!=null&&o.unshift(Sp(n,c,l))):i||(c=fp(n,a),c!=null&&o.push(Sp(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var wJ=/\r\n?/g,_J=/\u0000|\uFFFD/g;function XM(e){return(typeof e=="string"?e:""+e).replace(wJ,`
49
+ `).replace(_J,"")}function D3(e,t){return t=XM(t),XM(e)===t}function kt(e,t,n,r,i,a){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||cd(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&cd(e,""+r);break;case"className":Ty(e,"class",r);break;case"tabIndex":Ty(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ty(e,n,r);break;case"style":OP(e,r,a);break;case"data":if(t!=="object"){Ty(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=hb(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"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 a=="function"&&(n==="formAction"?(t!=="input"&&kt(e,t,"name",i.name,i,null),kt(e,t,"formEncType",i.formEncType,i,null),kt(e,t,"formMethod",i.formMethod,i,null),kt(e,t,"formTarget",i.formTarget,i,null)):(kt(e,t,"encType",i.encType,i,null),kt(e,t,"method",i.method,i,null),kt(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=hb(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=Jo);break;case"onScroll":r!=null&&tt("scroll",e);break;case"onScrollEnd":r!=null&&tt("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(W(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(W(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=hb(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":tt("beforetoggle",e),tt("toggle",e),db(e,"popover",r);break;case"xlinkActuate":Oo(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Oo(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Oo(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Oo(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Oo(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Oo(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Oo(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Oo(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Oo(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":db(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=XY.get(n)||n,db(e,n,r))}}function yE(e,t,n,r,i,a){switch(n){case"style":OP(e,r,a);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(W(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(W(60));e.innerHTML=n}}break;case"children":typeof r=="string"?cd(e,r):(typeof r=="number"||typeof r=="bigint")&&cd(e,""+r);break;case"onScroll":r!=null&&tt("scroll",e);break;case"onScrollEnd":r!=null&&tt("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Jo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!EP.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),a=e[ii]||null,a=a!=null?a[n]:null,typeof a=="function"&&e.removeEventListener(t,a,i),typeof r=="function")){typeof a!="function"&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):db(e,n,r)}}}function dr(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tt("error",e),tt("load",e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var o=n[a];if(o!=null)switch(a){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(W(137,t));default:kt(e,t,a,o,n,null)}}i&&kt(e,t,"srcSet",n.srcSet,n,null),r&&kt(e,t,"src",n.src,n,null);return;case"input":tt("invalid",e);var s=a=o=i=null,l=null,c=null;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case"name":i=f;break;case"type":o=f;break;case"checked":l=f;break;case"defaultChecked":c=f;break;case"value":a=f;break;case"defaultValue":s=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(W(137,t));break;default:kt(e,t,r,f,n,null)}}TP(e,a,s,l,c,o,i,!1);return;case"select":tt("invalid",e),r=o=a=null;for(i in n)if(n.hasOwnProperty(i)&&(s=n[i],s!=null))switch(i){case"value":a=s;break;case"defaultValue":o=s;break;case"multiple":r=s;default:kt(e,t,i,s,n,null)}t=a,n=o,e.multiple=!!r,t!=null?zf(e,!!r,t,!1):n!=null&&zf(e,!!r,n,!0);return;case"textarea":tt("invalid",e),a=i=r=null;for(o in n)if(n.hasOwnProperty(o)&&(s=n[o],s!=null))switch(o){case"value":r=s;break;case"defaultValue":i=s;break;case"children":a=s;break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(W(91));break;default:kt(e,t,o,s,n,null)}AP(e,r,i,a);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:kt(e,t,l,r,n,null)}return;case"dialog":tt("beforetoggle",e),tt("toggle",e),tt("cancel",e),tt("close",e);break;case"iframe":case"object":tt("load",e);break;case"video":case"audio":for(r=0;r<vp.length;r++)tt(vp[r],e);break;case"image":tt("error",e),tt("load",e);break;case"details":tt("toggle",e);break;case"embed":case"source":case"link":tt("error",e),tt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(r=n[c],r!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(W(137,t));default:kt(e,t,c,r,n,null)}return;default:if(ZC(t)){for(f in n)n.hasOwnProperty(f)&&(r=n[f],r!==void 0&&yE(e,t,f,r,n,void 0));return}}for(s in n)n.hasOwnProperty(s)&&(r=n[s],r!=null&&kt(e,t,s,r,n,null))}function EJ(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,a=null,o=null,s=null,l=null,c=null,f=null;for(h in n){var u=n[h];if(n.hasOwnProperty(h)&&u!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":l=u;default:r.hasOwnProperty(h)||kt(e,t,h,null,r,u)}}for(var d in r){var h=r[d];if(u=n[d],r.hasOwnProperty(d)&&(h!=null||u!=null))switch(d){case"type":a=h;break;case"name":i=h;break;case"checked":c=h;break;case"defaultChecked":f=h;break;case"value":o=h;break;case"defaultValue":s=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(W(137,t));break;default:h!==u&&kt(e,t,d,h,r,u)}}B_(e,o,s,l,c,f,a,i);return;case"select":h=o=s=d=null;for(a in n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case"value":break;case"multiple":h=l;default:r.hasOwnProperty(a)||kt(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case"value":d=a;break;case"defaultValue":s=a;break;case"multiple":o=a;default:a!==l&&kt(e,t,i,a,r,l)}t=s,n=o,r=h,d!=null?zf(e,!!n,d,!1):!!r!=!!n&&(t!=null?zf(e,!!n,t,!0):zf(e,!!n,n?[]:"",!1));return;case"textarea":h=d=null;for(s in n)if(i=n[s],n.hasOwnProperty(s)&&i!=null&&!r.hasOwnProperty(s))switch(s){case"value":break;case"children":break;default:kt(e,t,s,null,r,i)}for(o in r)if(i=r[o],a=n[o],r.hasOwnProperty(o)&&(i!=null||a!=null))switch(o){case"value":d=i;break;case"defaultValue":h=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(W(91));break;default:i!==a&&kt(e,t,o,i,r,a)}RP(e,d,h);return;case"option":for(var m in n)if(d=n[m],n.hasOwnProperty(m)&&d!=null&&!r.hasOwnProperty(m))switch(m){case"selected":e.selected=!1;break;default:kt(e,t,m,null,r,d)}for(l in r)if(d=r[l],h=n[l],r.hasOwnProperty(l)&&d!==h&&(d!=null||h!=null))switch(l){case"selected":e.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:kt(e,t,l,d,r,h)}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 b in n)d=n[b],n.hasOwnProperty(b)&&d!=null&&!r.hasOwnProperty(b)&&kt(e,t,b,null,r,d);for(c in r)if(d=r[c],h=n[c],r.hasOwnProperty(c)&&d!==h&&(d!=null||h!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(W(137,t));break;default:kt(e,t,c,d,r,h)}return;default:if(ZC(t)){for(var w in n)d=n[w],n.hasOwnProperty(w)&&d!==void 0&&!r.hasOwnProperty(w)&&yE(e,t,w,void 0,r,d);for(f in r)d=r[f],h=n[f],!r.hasOwnProperty(f)||d===h||d===void 0&&h===void 0||yE(e,t,f,d,r,h);return}}for(var g in n)d=n[g],n.hasOwnProperty(g)&&d!=null&&!r.hasOwnProperty(g)&&kt(e,t,g,null,r,d);for(u in r)d=r[u],h=n[u],!r.hasOwnProperty(u)||d===h||d==null&&h==null||kt(e,t,u,d,r,h)}function QM(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kJ(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&QM(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var l=n[r],c=l.startTime;if(c>s)break;var f=l.transferSize,u=l.initiatorType;f&&QM(u)&&(l=l.responseEnd,o+=f*(l<s?1:(s-c)/(l-c)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var bE=null,vE=null;function Av(e){return e.nodeType===9?e:e.ownerDocument}function ZM(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function j3(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function SE(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var i1=null;function CJ(){var e=window.event;return e&&e.type==="popstate"?e===i1?!1:(i1=e,!0):(i1=null,!1)}var I3=typeof setTimeout=="function"?setTimeout:void 0,TJ=typeof clearTimeout=="function"?clearTimeout:void 0,eN=typeof Promise=="function"?Promise:void 0,RJ=typeof queueMicrotask=="function"?queueMicrotask:typeof eN<"u"?function(e){return eN.resolve(null).then(e).catch(AJ)}:I3;function AJ(e){setTimeout(function(){throw e})}function Vl(e){return e==="head"}function tN(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(i),yd(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")Fm(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Fm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[dg]||s==="SCRIPT"||s==="STYLE"||s==="LINK"&&a.rel.toLowerCase()==="stylesheet"||n.removeChild(a),a=o}}else n==="body"&&Fm(e.ownerDocument.body);n=i}while(n);yd(t)}function nN(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function xE(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":xE(n),QC(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function OJ(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[dg])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(a=e.getAttribute("rel"),a==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(a!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(a=e.getAttribute("src"),(a!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var a=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===a)return e}else return e;if(e=Xi(e.nextSibling),e===null)break}return null}function MJ(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Xi(e.nextSibling),e===null))return null;return e}function $3(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Xi(e.nextSibling),e===null))return null;return e}function wE(e){return e.data==="$?"||e.data==="$~"}function _E(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function NJ(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Xi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var EE=null;function rN(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Xi(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function iN(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function L3(e,t,n){switch(t=Av(n),e){case"html":if(e=t.documentElement,!e)throw Error(W(452));return e;case"head":if(e=t.head,!e)throw Error(W(453));return e;case"body":if(e=t.body,!e)throw Error(W(454));return e;default:throw Error(W(451))}}function Fm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);QC(e)}var ta=new Map,aN=new Set;function Ov(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _s=pt.d;pt.d={f:DJ,r:jJ,D:IJ,C:$J,L:LJ,m:zJ,X:FJ,S:PJ,M:UJ};function DJ(){var e=_s.f(),t=bS();return e||t}function jJ(e){var t=Wd(e);t!==null&&t.tag===5&&t.type==="form"?OF(t):_s.r(e)}var Zd=typeof document>"u"?null:document;function z3(e,t,n){var r=Zd;if(r&&typeof t=="string"&&t){var i=Vi(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),aN.has(i)||(aN.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),dr(t,"link",e),Gn(t),r.head.appendChild(t)))}}function IJ(e){_s.D(e),z3("dns-prefetch",e,null)}function $J(e,t){_s.C(e,t),z3("preconnect",e,t)}function LJ(e,t,n){_s.L(e,t,n);var r=Zd;if(r&&e&&t){var i='link[rel="preload"][as="'+Vi(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Vi(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Vi(n.imageSizes)+'"]')):i+='[href="'+Vi(e)+'"]';var a=i;switch(t){case"style":a=gd(e);break;case"script":a=eh(e)}ta.has(a)||(e=Kt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ta.set(a,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(bg(a))||t==="script"&&r.querySelector(vg(a))||(t=r.createElement("link"),dr(t,"link",e),Gn(t),r.head.appendChild(t)))}}function zJ(e,t){_s.m(e,t);var n=Zd;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Vi(r)+'"][href="'+Vi(e)+'"]',a=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=eh(e)}if(!ta.has(a)&&(e=Kt({rel:"modulepreload",href:e},t),ta.set(a,e),n.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(vg(a)))return}r=n.createElement("link"),dr(r,"link",e),Gn(r),n.head.appendChild(r)}}}function PJ(e,t,n){_s.S(e,t,n);var r=Zd;if(r&&e){var i=Lf(r).hoistableStyles,a=gd(e);t=t||"default";var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(bg(a)))s.loading=5;else{e=Kt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ta.get(a))&&LT(e,n);var l=o=r.createElement("link");Gn(l),dr(l,"link",e),l._p=new Promise(function(c,f){l.onload=c,l.onerror=f}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,_b(o,t,r)}o={type:"stylesheet",instance:o,count:1,state:s},i.set(a,o)}}}function FJ(e,t){_s.X(e,t);var n=Zd;if(n&&e){var r=Lf(n).hoistableScripts,i=eh(e),a=r.get(i);a||(a=n.querySelector(vg(i)),a||(e=Kt({src:e,async:!0},t),(t=ta.get(i))&&zT(e,t),a=n.createElement("script"),Gn(a),dr(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}function UJ(e,t){_s.M(e,t);var n=Zd;if(n&&e){var r=Lf(n).hoistableScripts,i=eh(e),a=r.get(i);a||(a=n.querySelector(vg(i)),a||(e=Kt({src:e,async:!0,type:"module"},t),(t=ta.get(i))&&zT(e,t),a=n.createElement("script"),Gn(a),dr(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(i,a))}}function oN(e,t,n,r){var i=(i=ol.current)?Ov(i):null;if(!i)throw Error(W(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=gd(n.href),n=Lf(i).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=gd(n.href);var a=Lf(i).hoistableStyles,o=a.get(e);if(o||(i=i.ownerDocument||i,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},a.set(e,o),(a=i.querySelector(bg(e)))&&!a._p&&(o.instance=a,o.state.loading=5),ta.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ta.set(e,n),a||BJ(i,e,n,o.state))),t&&r===null)throw Error(W(528,""));return o}if(t&&r!==null)throw Error(W(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=eh(n),n=Lf(i).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(W(444,e))}}function gd(e){return'href="'+Vi(e)+'"'}function bg(e){return'link[rel="stylesheet"]['+e+"]"}function P3(e){return Kt({},e,{"data-precedence":e.precedence,precedence:null})}function BJ(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),dr(t,"link",n),Gn(t),e.head.appendChild(t))}function eh(e){return'[src="'+Vi(e)+'"]'}function vg(e){return"script[async]"+e}function sN(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Vi(n.href)+'"]');if(r)return t.instance=r,Gn(r),r;var i=Kt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Gn(r),dr(r,"style",i),_b(r,n.precedence,e),t.instance=r;case"stylesheet":i=gd(n.href);var a=e.querySelector(bg(i));if(a)return t.state.loading|=4,t.instance=a,Gn(a),a;r=P3(n),(i=ta.get(i))&&LT(r,i),a=(e.ownerDocument||e).createElement("link"),Gn(a);var o=a;return o._p=new Promise(function(s,l){o.onload=s,o.onerror=l}),dr(a,"link",r),t.state.loading|=4,_b(a,n.precedence,e),t.instance=a;case"script":return a=eh(n.src),(i=e.querySelector(vg(a)))?(t.instance=i,Gn(i),i):(r=n,(i=ta.get(a))&&(r=Kt({},n),zT(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),Gn(i),dr(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(W(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,_b(r,n.precedence,e));return t.instance}function _b(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function LT(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function zT(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Eb=null;function lN(e,t,n){if(Eb===null){var r=new Map,i=Eb=new Map;i.set(n,r)}else i=Eb,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[dg]||a[sr]||e==="link"&&a.getAttribute("rel")==="stylesheet")&&a.namespaceURI!=="http://www.w3.org/2000/svg"){var o=a.getAttribute(t)||"";o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function cN(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function HJ(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function F3(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function qJ(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var i=gd(r.href),a=t.querySelector(bg(i));if(a){t=a._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Mv.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Gn(a);return}a=t.ownerDocument||t,r=P3(r),(i=ta.get(i))&&LT(r,i),a=a.createElement("link"),Gn(a);var o=a;o._p=new Promise(function(s,l){o.onload=s,o.onerror=l}),dr(a,"link",r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Mv.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var a1=0;function VJ(e,t){return e.stylesheets&&e.count===0&&kb(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&kb(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4+t);0<e.imgBytes&&a1===0&&(a1=62500*kJ());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&kb(e,e.stylesheets),e.unsuspend)){var a=e.unsuspend;e.unsuspend=null,a()}},(e.imgBytes>a1?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Mv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kb(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Nv=null;function kb(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Nv=new Map,t.forEach(KJ,e),Nv=null,Mv.call(e))}function KJ(e,t){if(!(t.state.loading&4)){var n=Nv.get(e);if(n)var r=n.get(null);else{n=new Map,Nv.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<i.length;a++){var o=i[a];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute("data-precedence"),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Mv.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var xp={$$typeof:Wo,Provider:null,Consumer:null,_currentValue:Nc,_currentValue2:Nc,_threadCount:0};function GJ(e,t,n,r,i,a,o,s,l){this.tag=1,this.containerInfo=e,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=Rw(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rw(0),this.hiddenUpdates=Rw(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function U3(e,t,n,r,i,a,o,s,l,c,f,u){return e=new GJ(e,t,n,o,l,c,f,u,s),t=1,a===!0&&(t|=24),a=yi(3,null,null,t),e.current=a,a.stateNode=e,t=uT(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},hT(a),e}function B3(e){return e?(e=kf,e):kf}function H3(e,t,n,r,i,a){i=B3(i),r.context===null?r.context=i:r.pendingContext=i,r=ll(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=cl(e,r,t),n!==null&&(ri(n,e,t),Nm(n,e,t))}function uN(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function PT(e,t){uN(e,t),(e=e.alternate)&&uN(e,t)}function q3(e){if(e.tag===13||e.tag===31){var t=xu(e,67108864);t!==null&&ri(t,e,67108864),PT(e,67108864)}}function fN(e){if(e.tag===13||e.tag===31){var t=_i();t=JC(t);var n=xu(e,t);n!==null&&ri(n,e,t),PT(e,t)}}var Dv=!0;function YJ(e,t,n,r){var i=$e.T;$e.T=null;var a=pt.p;try{pt.p=2,FT(e,t,n,r)}finally{pt.p=a,$e.T=i}}function WJ(e,t,n,r){var i=$e.T;$e.T=null;var a=pt.p;try{pt.p=8,FT(e,t,n,r)}finally{pt.p=a,$e.T=i}}function FT(e,t,n,r){if(Dv){var i=kE(r);if(i===null)r1(e,t,r,jv,n),dN(e,r);else if(XJ(i,e,t,n,r))r.stopPropagation();else if(dN(e,r),t&4&&-1<JJ.indexOf(e)){for(;i!==null;){var a=Wd(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=bc(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var l=1<<31-wi(o);s.entanglements[1]|=l,o&=~l}So(a),!(mt&6)&&(_v=Si()+500,yg(0))}}break;case 31:case 13:s=xu(a,2),s!==null&&ri(s,a,2),bS(),PT(a,2)}if(a=kE(r),a===null&&r1(e,t,r,jv,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else r1(e,t,r,null,n)}}function kE(e){return e=eT(e),UT(e)}var jv=null;function UT(e){if(jv=null,e=vf(e),e!==null){var t=lg(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=uP(t),e!==null)return e;e=null}else if(n===31){if(e=fP(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return jv=e,null}function V3(e){switch(e){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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(IY()){case pP:return 2;case gP:return 8;case cv:case $Y:return 32;case yP:return 268435456;default:return 32}default:return 32}}var CE=!1,dl=null,hl=null,ml=null,wp=new Map,_p=new Map,Ys=[],JJ="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 dN(e,t){switch(e){case"focusin":case"focusout":dl=null;break;case"dragenter":case"dragleave":hl=null;break;case"mouseover":case"mouseout":ml=null;break;case"pointerover":case"pointerout":wp.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_p.delete(t.pointerId)}}function Bh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Wd(t),t!==null&&q3(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function XJ(e,t,n,r,i){switch(t){case"focusin":return dl=Bh(dl,e,t,n,r,i),!0;case"dragenter":return hl=Bh(hl,e,t,n,r,i),!0;case"mouseover":return ml=Bh(ml,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return wp.set(a,Bh(wp.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,_p.set(a,Bh(_p.get(a)||null,e,t,n,r,i)),!0}return!1}function K3(e){var t=vf(e.target);if(t!==null){var n=lg(t);if(n!==null){if(t=n.tag,t===13){if(t=uP(n),t!==null){e.blockedOn=t,J2(e.priority,function(){fN(n)});return}}else if(t===31){if(t=fP(n),t!==null){e.blockedOn=t,J2(e.priority,function(){fN(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Cb(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=kE(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);q_=r,n.target.dispatchEvent(r),q_=null}else return t=Wd(n),t!==null&&q3(t),e.blockedOn=n,!1;t.shift()}return!0}function hN(e,t,n){Cb(e)&&n.delete(t)}function QJ(){CE=!1,dl!==null&&Cb(dl)&&(dl=null),hl!==null&&Cb(hl)&&(hl=null),ml!==null&&Cb(ml)&&(ml=null),wp.forEach(hN),_p.forEach(hN)}function Iy(e,t){e.blockedOn===t&&(e.blockedOn=null,CE||(CE=!0,$n.unstable_scheduleCallback($n.unstable_NormalPriority,QJ)))}var $y=null;function mN(e){$y!==e&&($y=e,$n.unstable_scheduleCallback($n.unstable_NormalPriority,function(){$y===e&&($y=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(UT(r||n)===null)continue;break}var a=Wd(n);a!==null&&(e.splice(t,3),t-=3,oE(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function yd(e){function t(l){return Iy(l,e)}dl!==null&&Iy(dl,e),hl!==null&&Iy(hl,e),ml!==null&&Iy(ml,e),wp.forEach(t),_p.forEach(t);for(var n=0;n<Ys.length;n++){var r=Ys[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ys.length&&(n=Ys[0],n.blockedOn===null);)K3(n),n.blockedOn===null&&Ys.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ii]||null;if(typeof a=="function")o||mN(n);else if(o){var s=null;if(a&&a.hasAttribute("formAction")){if(i=a,o=a[ii]||null)s=o.formAction;else if(UT(i)!==null)continue}else s=o.action;typeof s=="function"?n[r+1]=s:(n.splice(r,3),r-=3),mN(n)}}}function G3(){function e(a){a.canIntercept&&a.info==="react-transition"&&a.intercept({handler:function(){return new Promise(function(o){return i=o})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var a=navigation.currentEntry;a&&a.url!=null&&navigation.navigate(a.url,{state:a.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function BT(e){this._internalRoot=e}xS.prototype.render=BT.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));var n=t.current,r=_i();H3(n,r,e,t,null,null)};xS.prototype.unmount=BT.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;H3(e.current,2,null,e,null,null),bS(),t[Yd]=null}};function xS(e){this._internalRoot=e}xS.prototype.unstable_scheduleHydration=function(e){if(e){var t=wP();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ys.length&&t!==0&&t<Ys[n].priority;n++);Ys.splice(n,0,e),n===0&&K3(e)}};var pN=lP.version;if(pN!=="19.2.4")throw Error(W(527,pN,"19.2.4"));pt.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(W(188)):(e=Object.keys(e).join(","),Error(W(268,e)));return e=RY(t),e=e!==null?dP(e):null,e=e===null?null:e.stateNode,e};var ZJ={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$e,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ly=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ly.isDisabled&&Ly.supportsFiber)try{cg=Ly.inject(ZJ),xi=Ly}catch{}}iS.createRoot=function(e,t){if(!cP(e))throw Error(W(299));var n=!1,r="",i=zF,a=PF,o=FF;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=U3(e,1,!1,null,null,n,r,null,i,a,o,G3),e[Yd]=t.current,$T(e),new BT(t)};iS.hydrateRoot=function(e,t,n){if(!cP(e))throw Error(W(299));var r=!1,i="",a=zF,o=PF,s=FF,l=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(a=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(s=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),t=U3(e,1,!0,t,n??null,r,i,l,a,o,s,G3),t.context=B3(null),n=t.current,r=_i(),r=JC(r),i=ll(r),i.callback=null,cl(n,i,r),n=r,t.current.lanes=n,fg(t,n),So(t),e[Yd]=t.current,$T(e),new xS(t)};iS.version="19.2.4";function Y3(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Y3)}catch(e){console.error(e)}}Y3(),tP.exports=iS;var eX=tP.exports;const tX=sg(eX);/**
50
+ * react-router v7.13.0
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var W3=e=>{throw TypeError(e)},nX=(e,t,n)=>t.has(e)||W3("Cannot "+n),o1=(e,t,n)=>(nX(e,t,"read from private field"),n?n.call(e):t.get(e)),rX=(e,t,n)=>t.has(e)?W3("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),gN="popstate";function iX(e={}){function t(r,i){let{pathname:a,search:o,hash:s}=r.location;return Ep("",{pathname:a,search:o,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:ho(i)}return oX(t,n,null,e)}function Qe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function an(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function aX(){return Math.random().toString(36).substring(2,10)}function yN(e,t){return{usr:e.state,key:e.key,idx:t}}function Ep(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Kl(t):t,state:n,key:t&&t.key||r||aX()}}function ho({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Kl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function oX(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s="POP",l=null,c=f();c==null&&(c=0,o.replaceState({...o.state,idx:c},""));function f(){return(o.state||{idx:null}).idx}function u(){s="POP";let w=f(),g=w==null?null:w-c;c=w,l&&l({action:s,location:b.location,delta:g})}function d(w,g){s="PUSH";let v=Ep(b.location,w,g);c=f()+1;let x=yN(v,c),E=b.createHref(v);try{o.pushState(x,"",E)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;i.location.assign(E)}a&&l&&l({action:s,location:b.location,delta:1})}function h(w,g){s="REPLACE";let v=Ep(b.location,w,g);c=f();let x=yN(v,c),E=b.createHref(v);o.replaceState(x,"",E),a&&l&&l({action:s,location:b.location,delta:0})}function m(w){return J3(w)}let b={get action(){return s},get location(){return e(i,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(gN,u),l=w,()=>{i.removeEventListener(gN,u),l=null}},createHref(w){return t(i,w)},createURL:m,encodeLocation(w){let g=m(w);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:d,replace:h,go(w){return o.go(w)}};return b}function J3(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Qe(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:ho(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var dm,bN=class{constructor(e){if(rX(this,dm,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(o1(this,dm).has(e))return o1(this,dm).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){o1(this,dm).set(e,t)}};dm=new WeakMap;var sX=new Set(["lazy","caseSensitive","path","id","index","children"]);function lX(e){return sX.has(e)}var cX=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function uX(e){return cX.has(e)}function fX(e){return e.index===!0}function kp(e,t,n=[],r={},i=!1){return e.map((a,o)=>{let s=[...n,String(o)],l=typeof a.id=="string"?a.id:s.join("-");if(Qe(a.index!==!0||!a.children,"Cannot specify children on an index route"),Qe(i||!r[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),fX(a)){let c={...a,id:l};return r[l]=vN(c,t(c)),c}else{let c={...a,id:l,children:void 0};return r[l]=vN(c,t(c)),a.children&&(c.children=kp(a.children,t,s,r,i)),c}})}function vN(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ws(e,t,n="/"){return hm(e,t,n,!1)}function hm(e,t,n,r){let i=typeof t=="string"?Kl(t):t,a=na(i.pathname||"/",n);if(a==null)return null;let o=X3(e);hX(o);let s=null;for(let l=0;s==null&&l<o.length;++l){let c=EX(a);s=wX(o[l],c,r)}return s}function dX(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function X3(e,t=[],n=[],r="",i=!1){let a=(o,s,l=i,c)=>{let f={relativePath:c===void 0?o.path||"":c,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&l)return;Qe(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let u=so([r,f.relativePath]),d=n.concat(f);o.children&&o.children.length>0&&(Qe(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),X3(o.children,t,d,u,l)),!(o.path==null&&!o.index)&&t.push({path:u,score:SX(u,o.index),routesMeta:d})};return e.forEach((o,s)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))a(o,s);else for(let c of Q3(o.path))a(o,s,!0,c)}),t}function Q3(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=Q3(r.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function hX(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xX(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var mX=/^:[\w-]+$/,pX=3,gX=2,yX=1,bX=10,vX=-2,SN=e=>e==="*";function SX(e,t){let n=e.split("/"),r=n.length;return n.some(SN)&&(r+=vX),t&&(r+=gX),n.filter(i=>!SN(i)).reduce((i,a)=>i+(mX.test(a)?pX:a===""?yX:bX),r)}function xX(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function wX(e,t,n=!1){let{routesMeta:r}=e,i={},a="/",o=[];for(let s=0;s<r.length;++s){let l=r[s],c=s===r.length-1,f=a==="/"?t:t.slice(a.length)||"/",u=Iv({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},f),d=l.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Iv({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},f)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:so([a,u.pathname]),pathnameBase:TX(so([a,u.pathnameBase])),route:d}),u.pathnameBase!=="/"&&(a=so([a,u.pathnameBase]))}return o}function Iv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=_X(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((c,{paramName:f,isOptional:u},d)=>{if(f==="*"){let m=s[d]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const h=s[d];return u&&!h?c[f]=void 0:c[f]=(h||"").replace(/%2F/g,"/"),c},{}),pathname:a,pathnameBase:o,pattern:e}}function _X(e,t=!1,n=!0){an(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(r.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function EX(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return an(!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 (${t}).`),e}}function na(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function kX({basename:e,pathname:t}){return t==="/"?e:so([e,t])}var Z3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,HT=e=>Z3.test(e);function CX(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Kl(e):e,a;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?a=xN(n.substring(1),"/"):a=xN(n,t)):a=t,{pathname:a,search:RX(r),hash:AX(i)}}function xN(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function s1(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function e4(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wS(e){let t=e4(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function _S(e,t,n,r=!1){let i;typeof e=="string"?i=Kl(e):(i={...e},Qe(!i.pathname||!i.pathname.includes("?"),s1("?","pathname","search",i)),Qe(!i.pathname||!i.pathname.includes("#"),s1("#","pathname","hash",i)),Qe(!i.search||!i.search.includes("#"),s1("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=n;else{let u=t.length-1;if(!r&&o.startsWith("..")){let d=o.split("/");for(;d[0]==="..";)d.shift(),u-=1;i.pathname=d.join("/")}s=u>=0?t[u]:"/"}let l=CX(i,s),c=o&&o!=="/"&&o.endsWith("/"),f=(a||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||f)&&(l.pathname+="/"),l}var so=e=>e.join("/").replace(/\/\/+/g,"/"),TX=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),RX=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,AX=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Sg=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Cp(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function xg(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var t4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function n4(e,t){let n=e;if(typeof n!="string"||!Z3.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(t4)try{let a=new URL(window.location.href),o=n.startsWith("//")?new URL(a.protocol+n):new URL(n),s=na(o.pathname,t);o.origin===a.origin&&s!=null?n=s+o.search+o.hash:i=!0}catch{an(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var nl=Symbol("Uninstrumented");function OX(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(i=>i({id:t.id,index:t.index,path:t.path,instrument(a){let o=Object.keys(n);for(let s of o)a[s]&&n[s].push(a[s])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let i=Af(n.lazy,t.lazy,()=>{});i&&(r.lazy=i)}if(typeof t.lazy=="object"){let i=t.lazy;["middleware","loader","action"].forEach(a=>{let o=i[a],s=n[`lazy.${a}`];if(typeof o=="function"&&s.length>0){let l=Af(s,o,()=>{});l&&(r.lazy=Object.assign(r.lazy||{},{[a]:l}))}})}return["loader","action"].forEach(i=>{let a=t[i];if(typeof a=="function"&&n[i].length>0){let o=a[nl]??a,s=Af(n[i],o,(...l)=>wN(l[0]));s&&(i==="loader"&&o.hydrate===!0&&(s.hydrate=!0),s[nl]=o,r[i]=s)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(i=>{let a=i[nl]??i,o=Af(n.middleware,a,(...s)=>wN(s[0]));return o?(o[nl]=a,o):i})),r}function MX(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(i){let a=Object.keys(i);for(let o of a)i[o]&&n[o].push(i[o])}})),n.navigate.length>0){let r=e.navigate[nl]??e.navigate,i=Af(n.navigate,r,(...a)=>{let[o,s]=a;return{to:typeof o=="number"||typeof o=="string"?o:o?ho(o):".",..._N(e,s??{})}});i&&(i[nl]=r,e.navigate=i)}if(n.fetch.length>0){let r=e.fetch[nl]??e.fetch,i=Af(n.fetch,r,(...a)=>{let[o,,s,l]=a;return{href:s??".",fetcherKey:o,..._N(e,l??{})}});i&&(i[nl]=r,e.fetch=i)}return e}function Af(e,t,n){return e.length===0?null:async(...r)=>{let i=await r4(e,n(...r),()=>t(...r),e.length-1);if(i.type==="error")throw i.value;return i.value}}async function r4(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error("You cannot call instrumented handlers more than once"):o=r4(e,t,n,r-1),a=await o,Qe(a,"Expected a result"),a.type==="error"&&a.value instanceof Error?{status:"error",error:a.value}:{status:"success",error:void 0});try{await i(s,t)}catch(l){console.error("An instrumentation function threw an error:",l)}o||await s(),await o}else try{a={type:"success",value:await n()}}catch(o){a={type:"error",value:o}}return a||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function wN(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:NX(t),params:{...r},unstable_pattern:i,context:DX(n)}}function _N(e,t){return{currentUrl:ho(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function NX(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function DX(e){if(IX(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var jX=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function IX(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===jX}var i4=["POST","PUT","PATCH","DELETE"],$X=new Set(i4),LX=["GET",...i4],zX=new Set(LX),a4=new Set([301,302,303,307,308]),PX=new Set([307,308]),l1={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},FX={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Hh={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},UX=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),o4="remix-router-transitions",s4=Symbol("ResetLoaderData");function BX(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Qe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||UX,a=i;if(e.unstable_instrumentations){let j=e.unstable_instrumentations;a=L=>({...i(L),...OX(j.map(B=>B.route).filter(Boolean),L)})}let o={},s=kp(e.routes,a,void 0,o),l,c=e.basename||"/";c.startsWith("/")||(c=`/${c}`);let f=e.dataStrategy||GX,u={...e.future},d=null,h=new Set,m=null,b=null,w=null,g=e.hydrationData!=null,v=Ws(s,e.history.location,c),x=!1,E=null,C;if(v==null&&!e.patchRoutesOnNavigation){let j=zi(404,{pathname:e.history.location.pathname}),{matches:L,route:B}=zy(s);C=!0,v=L,E={[B.id]:j}}else if(v&&!e.hydrationData&&Un(v,s,e.history.location.pathname).active&&(v=null),v)if(v.some(j=>j.route.lazy))C=!1;else if(!v.some(j=>qT(j.route)))C=!0;else{let j=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null;if(L){let B=v.findIndex(Z=>L[Z.route.id]!==void 0);C=v.slice(0,B+1).every(Z=>!RE(Z.route,j,L))}else C=v.every(B=>!RE(B.route,j,L))}else{C=!1,v=[];let j=Un(null,s,e.history.location.pathname);j.active&&j.matches&&(x=!0,v=j.matches)}let k,_={historyAction:e.history.action,location:e.history.location,matches:v,initialized:C,navigation:l1,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},A="POP",I=null,O=!1,z,U=!1,J=new Map,Y=null,F=!1,D=!1,P=new Set,$=new Map,q=0,M=-1,ue=new Map,H=new Set,R=new Map,X=new Map,G=new Set,se=new Map,Q,oe=null;function ye(){if(d=e.history.listen(({action:j,location:L,delta:B})=>{if(Q){Q(),Q=void 0;return}an(se.size===0||B!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Z=py({currentLocation:_.location,nextLocation:L,historyAction:j});if(Z&&B!=null){let ce=new Promise(_e=>{Q=_e});e.history.go(B*-1),Pu(Z,{state:"blocked",location:L,proceed(){Pu(Z,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),ce.then(()=>e.history.go(B))},reset(){let _e=new Map(_.blockers);_e.set(Z,Hh),ve({blockers:_e})}}),I==null||I.resolve(),I=null;return}return An(j,L)}),n){fQ(t,J);let j=()=>dQ(t,J);t.addEventListener("pagehide",j),Y=()=>t.removeEventListener("pagehide",j)}return _.initialized||An("POP",_.location,{initialHydration:!0}),k}function Ae(){d&&d(),Y&&Y(),h.clear(),z&&z.abort(),_.fetchers.forEach((j,L)=>Fn(L)),_.blockers.forEach((j,L)=>ua(L))}function Fe(j){return h.add(j),()=>h.delete(j)}function ve(j,L={}){j.matches&&(j.matches=j.matches.map(ce=>{let _e=o[ce.route.id],Oe=ce.route;return Oe.element!==_e.element||Oe.errorElement!==_e.errorElement||Oe.hydrateFallbackElement!==_e.hydrateFallbackElement?{...ce,route:_e}:ce})),_={..._,...j};let B=[],Z=[];_.fetchers.forEach((ce,_e)=>{ce.state==="idle"&&(G.has(_e)?B.push(_e):Z.push(_e))}),G.forEach(ce=>{!_.fetchers.has(ce)&&!$.has(ce)&&B.push(ce)}),[...h].forEach(ce=>ce(_,{deletedFetchers:B,newErrors:j.errors??null,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),B.forEach(ce=>Fn(ce)),Z.forEach(ce=>_.fetchers.delete(ce))}function Yt(j,L,{flushSync:B}={}){var Ke,Ee;let Z=_.actionData!=null&&_.navigation.formMethod!=null&&yr(_.navigation.formMethod)&&_.navigation.state==="loading"&&((Ke=j.state)==null?void 0:Ke._isRedirect)!==!0,ce;L.actionData?Object.keys(L.actionData).length>0?ce=L.actionData:ce=null:Z?ce=_.actionData:ce=null;let _e=L.loaderData?DN(_.loaderData,L.loaderData,L.matches||[],L.errors):_.loaderData,Oe=_.blockers;Oe.size>0&&(Oe=new Map(Oe),Oe.forEach((Ye,ct)=>Oe.set(ct,Hh)));let me=F?!1:Mn(j,L.matches||_.matches),be=O===!0||_.navigation.formMethod!=null&&yr(_.navigation.formMethod)&&((Ee=j.state)==null?void 0:Ee._isRedirect)!==!0;l&&(s=l,l=void 0),F||A==="POP"||(A==="PUSH"?e.history.push(j,j.state):A==="REPLACE"&&e.history.replace(j,j.state));let Ce;if(A==="POP"){let Ye=J.get(_.location.pathname);Ye&&Ye.has(j.pathname)?Ce={currentLocation:_.location,nextLocation:j}:J.has(j.pathname)&&(Ce={currentLocation:j,nextLocation:_.location})}else if(U){let Ye=J.get(_.location.pathname);Ye?Ye.add(j.pathname):(Ye=new Set([j.pathname]),J.set(_.location.pathname,Ye)),Ce={currentLocation:_.location,nextLocation:j}}ve({...L,actionData:ce,loaderData:_e,historyAction:A,location:j,initialized:!0,navigation:l1,revalidation:"idle",restoreScrollPosition:me,preventScrollReset:be,blockers:Oe},{viewTransitionOpts:Ce,flushSync:B===!0}),A="POP",O=!1,U=!1,F=!1,D=!1,I==null||I.resolve(),I=null,oe==null||oe.resolve(),oe=null}async function Rn(j,L){if(I==null||I.resolve(),I=null,typeof j=="number"){I||(I=LN());let ct=I.promise;return e.history.go(j),ct}let B=TE(_.location,_.matches,c,j,L==null?void 0:L.fromRouteId,L==null?void 0:L.relative),{path:Z,submission:ce,error:_e}=EN(!1,B,L),Oe=_.location,me=Ep(_.location,Z,L&&L.state);me={...me,...e.history.encodeLocation(me)};let be=L&&L.replace!=null?L.replace:void 0,Ce="PUSH";be===!0?Ce="REPLACE":be===!1||ce!=null&&yr(ce.formMethod)&&ce.formAction===_.location.pathname+_.location.search&&(Ce="REPLACE");let Ke=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,Ee=(L&&L.flushSync)===!0,Ye=py({currentLocation:Oe,nextLocation:me,historyAction:Ce});if(Ye){Pu(Ye,{state:"blocked",location:me,proceed(){Pu(Ye,{state:"proceeding",proceed:void 0,reset:void 0,location:me}),Rn(j,L)},reset(){let ct=new Map(_.blockers);ct.set(Ye,Hh),ve({blockers:ct})}});return}await An(Ce,me,{submission:ce,pendingError:_e,preventScrollReset:Ke,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:Ee,callSiteDefaultShouldRevalidate:L&&L.unstable_defaultShouldRevalidate})}function Ni(){oe||(oe=LN()),le(),ve({revalidation:"loading"});let j=oe.promise;return _.navigation.state==="submitting"?j:_.navigation.state==="idle"?(An(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),j):(An(A||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:U===!0}),j)}async function An(j,L,B){z&&z.abort(),z=null,A=j,F=(B&&B.startUninterruptedRevalidation)===!0,mn(_.location,_.matches),O=(B&&B.preventScrollReset)===!0,U=(B&&B.enableViewTransition)===!0;let Z=l||s,ce=B&&B.overrideNavigation,_e=B!=null&&B.initialHydration&&_.matches&&_.matches.length>0&&!x?_.matches:Ws(Z,L,c),Oe=(B&&B.flushSync)===!0;if(_e&&_.initialized&&!D&&tQ(_.location,L)&&!(B&&B.submission&&yr(B.submission.formMethod))){Yt(L,{matches:_e},{flushSync:Oe});return}let me=Un(_e,Z,L.pathname);if(me.active&&me.matches&&(_e=me.matches),!_e){let{error:Bn,notFoundMatches:Rr,route:Et}=Fu(L.pathname);Yt(L,{matches:Rr,loaderData:{},errors:{[Et.id]:Bn}},{flushSync:Oe});return}z=new AbortController;let be=of(e.history,L,z.signal,B&&B.submission),Ce=e.getContext?await e.getContext():new bN,Ke;if(B&&B.pendingError)Ke=[Js(_e).route.id,{type:"error",error:B.pendingError}];else if(B&&B.submission&&yr(B.submission.formMethod)){let Bn=await mr(be,L,B.submission,_e,Ce,me.active,B&&B.initialHydration===!0,{replace:B.replace,flushSync:Oe});if(Bn.shortCircuited)return;if(Bn.pendingActionResult){let[Rr,Et]=Bn.pendingActionResult;if(hi(Et)&&Cp(Et.error)&&Et.error.status===404){z=null,Yt(L,{matches:Bn.matches,loaderData:{},errors:{[Rr]:Et.error}});return}}_e=Bn.matches||_e,Ke=Bn.pendingActionResult,ce=c1(L,B.submission),Oe=!1,me.active=!1,be=of(e.history,be.url,be.signal)}let{shortCircuited:Ee,matches:Ye,loaderData:ct,errors:Zn}=await Ns(be,L,_e,Ce,me.active,ce,B&&B.submission,B&&B.fetcherSubmission,B&&B.replace,B&&B.initialHydration===!0,Oe,Ke,B&&B.callSiteDefaultShouldRevalidate);Ee||(z=null,Yt(L,{matches:Ye||_e,...jN(Ke),loaderData:ct,errors:Zn}))}async function mr(j,L,B,Z,ce,_e,Oe,me={}){le();let be=cQ(L,B);if(ve({navigation:be},{flushSync:me.flushSync===!0}),_e){let Ee=await Ao(Z,L.pathname,j.signal);if(Ee.type==="aborted")return{shortCircuited:!0};if(Ee.type==="error"){if(Ee.partialMatches.length===0){let{matches:ct,route:Zn}=zy(s);return{matches:ct,pendingActionResult:[Zn.id,{type:"error",error:Ee.error}]}}let Ye=Js(Ee.partialMatches).route.id;return{matches:Ee.partialMatches,pendingActionResult:[Ye,{type:"error",error:Ee.error}]}}else if(Ee.matches)Z=Ee.matches;else{let{notFoundMatches:Ye,error:ct,route:Zn}=Fu(L.pathname);return{matches:Ye,pendingActionResult:[Zn.id,{type:"error",error:ct}]}}}let Ce,Ke=Tb(Z,L);if(!Ke.route.action&&!Ke.route.lazy)Ce={type:"error",error:zi(405,{method:j.method,pathname:L.pathname,routeId:Ke.route.id})};else{let Ee=qf(a,o,j,Z,Ke,Oe?[]:r,ce),Ye=await Ro(j,Ee,ce,null);if(Ce=Ye[Ke.route.id],!Ce){for(let ct of Z)if(Ye[ct.route.id]){Ce=Ye[ct.route.id];break}}if(j.signal.aborted)return{shortCircuited:!0}}if(Cc(Ce)){let Ee;return me&&me.replace!=null?Ee=me.replace:Ee=ON(Ce.response.headers.get("Location"),new URL(j.url),c,e.history)===_.location.pathname+_.location.search,await sa(j,Ce,!0,{submission:B,replace:Ee}),{shortCircuited:!0}}if(hi(Ce)){let Ee=Js(Z,Ke.route.id);return(me&&me.replace)!==!0&&(A="PUSH"),{matches:Z,pendingActionResult:[Ee.route.id,Ce,Ke.route.id]}}return{matches:Z,pendingActionResult:[Ke.route.id,Ce]}}async function Ns(j,L,B,Z,ce,_e,Oe,me,be,Ce,Ke,Ee,Ye){let ct=_e||c1(L,Oe),Zn=Oe||me||$N(ct),Bn=!F&&!Ce;if(ce){if(Bn){let gr=hn(Ee);ve({navigation:ct,...gr!==void 0?{actionData:gr}:{}},{flushSync:Ke})}let ht=await Ao(B,L.pathname,j.signal);if(ht.type==="aborted")return{shortCircuited:!0};if(ht.type==="error"){if(ht.partialMatches.length===0){let{matches:Bu,route:cc}=zy(s);return{matches:Bu,loaderData:{},errors:{[cc.id]:ht.error}}}let gr=Js(ht.partialMatches).route.id;return{matches:ht.partialMatches,loaderData:{},errors:{[gr]:ht.error}}}else if(ht.matches)B=ht.matches;else{let{error:gr,notFoundMatches:Bu,route:cc}=Fu(L.pathname);return{matches:Bu,loaderData:{},errors:{[cc.id]:gr}}}}let Rr=l||s,{dsMatches:Et,revalidatingFetchers:Di}=kN(j,Z,a,o,e.history,_,B,Zn,L,Ce?[]:r,Ce===!0,D,P,G,R,H,Rr,c,e.patchRoutesOnNavigation!=null,Ee,Ye);if(M=++q,!e.dataStrategy&&!Et.some(ht=>ht.shouldLoad)&&!Et.some(ht=>ht.route.middleware&&ht.route.middleware.length>0)&&Di.length===0){let ht=On();return Yt(L,{matches:B,loaderData:{},errors:Ee&&hi(Ee[1])?{[Ee[0]]:Ee[1].error}:null,...jN(Ee),...ht?{fetchers:new Map(_.fetchers)}:{}},{flushSync:Ke}),{shortCircuited:!0}}if(Bn){let ht={};if(!ce){ht.navigation=ct;let gr=hn(Ee);gr!==void 0&&(ht.actionData=gr)}Di.length>0&&(ht.fetchers=zu(Di)),ve(ht,{flushSync:Ke})}Di.forEach(ht=>{Qn(ht.key),ht.controller&&$.set(ht.key,ht.controller)});let sc=()=>Di.forEach(ht=>Qn(ht.key));z&&z.signal.addEventListener("abort",sc);let{loaderResults:jh,fetcherResults:Ds}=await K(Et,Di,j,Z);if(j.signal.aborted)return{shortCircuited:!0};z&&z.signal.removeEventListener("abort",sc),Di.forEach(ht=>$.delete(ht.key));let Ha=Py(jh);if(Ha)return await sa(j,Ha.result,!0,{replace:be}),{shortCircuited:!0};if(Ha=Py(Ds),Ha)return H.add(Ha.key),await sa(j,Ha.result,!0,{replace:be}),{shortCircuited:!0};let{loaderData:xw,errors:Ih}=NN(_,B,jh,Ee,Di,Ds);Ce&&_.errors&&(Ih={..._.errors,...Ih});let lc=On(),yy=ca(M),by=lc||yy||Di.length>0;return{matches:B,loaderData:xw,errors:Ih,...by?{fetchers:new Map(_.fetchers)}:{}}}function hn(j){if(j&&!hi(j[1]))return{[j[0]]:j[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function zu(j){return j.forEach(L=>{let B=_.fetchers.get(L.key),Z=qh(void 0,B?B.data:void 0);_.fetchers.set(L.key,Z)}),new Map(_.fetchers)}async function Dh(j,L,B,Z){Qn(j);let ce=(Z&&Z.flushSync)===!0,_e=l||s,Oe=TE(_.location,_.matches,c,B,L,Z==null?void 0:Z.relative),me=Ws(_e,Oe,c),be=Un(me,_e,Oe);if(be.active&&be.matches&&(me=be.matches),!me){Ie(j,L,zi(404,{pathname:Oe}),{flushSync:ce});return}let{path:Ce,submission:Ke,error:Ee}=EN(!0,Oe,Z);if(Ee){Ie(j,L,Ee,{flushSync:ce});return}let Ye=e.getContext?await e.getContext():new bN,ct=(Z&&Z.preventScrollReset)===!0;if(Ke&&yr(Ke.formMethod)){await Xn(j,L,Ce,me,Ye,be.active,ce,ct,Ke,Z&&Z.unstable_defaultShouldRevalidate);return}R.set(j,{routeId:L,path:Ce}),await Ba(j,L,Ce,me,Ye,be.active,ce,ct,Ke)}async function Xn(j,L,B,Z,ce,_e,Oe,me,be,Ce){le(),R.delete(j);let Ke=_.fetchers.get(j);we(j,uQ(be,Ke),{flushSync:Oe});let Ee=new AbortController,Ye=of(e.history,B,Ee.signal,be);if(_e){let Xt=await Ao(Z,new URL(Ye.url).pathname,Ye.signal,j);if(Xt.type==="aborted")return;if(Xt.type==="error"){Ie(j,L,Xt.error,{flushSync:Oe});return}else if(Xt.matches)Z=Xt.matches;else{Ie(j,L,zi(404,{pathname:B}),{flushSync:Oe});return}}let ct=Tb(Z,B);if(!ct.route.action&&!ct.route.lazy){let Xt=zi(405,{method:be.formMethod,pathname:B,routeId:L});Ie(j,L,Xt,{flushSync:Oe});return}$.set(j,Ee);let Zn=q,Bn=qf(a,o,Ye,Z,ct,r,ce),Rr=await Ro(Ye,Bn,ce,j),Et=Rr[ct.route.id];if(!Et){for(let Xt of Bn)if(Rr[Xt.route.id]){Et=Rr[Xt.route.id];break}}if(Ye.signal.aborted){$.get(j)===Ee&&$.delete(j);return}if(G.has(j)){if(Cc(Et)||hi(Et)){we(j,Po(void 0));return}}else{if(Cc(Et))if($.delete(j),M>Zn){we(j,Po(void 0));return}else return H.add(j),we(j,qh(be)),sa(Ye,Et,!1,{fetcherSubmission:be,preventScrollReset:me});if(hi(Et)){Ie(j,L,Et.error);return}}let Di=_.navigation.location||_.location,sc=of(e.history,Di,Ee.signal),jh=l||s,Ds=_.navigation.state!=="idle"?Ws(jh,_.navigation.location,c):_.matches;Qe(Ds,"Didn't find any matches after fetcher action");let Ha=++q;ue.set(j,Ha);let xw=qh(be,Et.data);_.fetchers.set(j,xw);let{dsMatches:Ih,revalidatingFetchers:lc}=kN(sc,ce,a,o,e.history,_,Ds,be,Di,r,!1,D,P,G,R,H,jh,c,e.patchRoutesOnNavigation!=null,[ct.route.id,Et],Ce);lc.filter(Xt=>Xt.key!==j).forEach(Xt=>{let vy=Xt.key,P2=_.fetchers.get(vy),nY=qh(void 0,P2?P2.data:void 0);_.fetchers.set(vy,nY),Qn(vy),Xt.controller&&$.set(vy,Xt.controller)}),ve({fetchers:new Map(_.fetchers)});let yy=()=>lc.forEach(Xt=>Qn(Xt.key));Ee.signal.addEventListener("abort",yy);let{loaderResults:by,fetcherResults:ht}=await K(Ih,lc,sc,ce);if(Ee.signal.aborted)return;if(Ee.signal.removeEventListener("abort",yy),ue.delete(j),$.delete(j),lc.forEach(Xt=>$.delete(Xt.key)),_.fetchers.has(j)){let Xt=Po(Et.data);_.fetchers.set(j,Xt)}let gr=Py(by);if(gr)return sa(sc,gr.result,!1,{preventScrollReset:me});if(gr=Py(ht),gr)return H.add(gr.key),sa(sc,gr.result,!1,{preventScrollReset:me});let{loaderData:Bu,errors:cc}=NN(_,Ds,by,void 0,lc,ht);ca(Ha),_.navigation.state==="loading"&&Ha>M?(Qe(A,"Expected pending action"),z&&z.abort(),Yt(_.navigation.location,{matches:Ds,loaderData:Bu,errors:cc,fetchers:new Map(_.fetchers)})):(ve({errors:cc,loaderData:DN(_.loaderData,Bu,Ds,cc),fetchers:new Map(_.fetchers)}),D=!1)}async function Ba(j,L,B,Z,ce,_e,Oe,me,be){let Ce=_.fetchers.get(j);we(j,qh(be,Ce?Ce.data:void 0),{flushSync:Oe});let Ke=new AbortController,Ee=of(e.history,B,Ke.signal);if(_e){let Et=await Ao(Z,new URL(Ee.url).pathname,Ee.signal,j);if(Et.type==="aborted")return;if(Et.type==="error"){Ie(j,L,Et.error,{flushSync:Oe});return}else if(Et.matches)Z=Et.matches;else{Ie(j,L,zi(404,{pathname:B}),{flushSync:Oe});return}}let Ye=Tb(Z,B);$.set(j,Ke);let ct=q,Zn=qf(a,o,Ee,Z,Ye,r,ce),Rr=(await Ro(Ee,Zn,ce,j))[Ye.route.id];if($.get(j)===Ke&&$.delete(j),!Ee.signal.aborted){if(G.has(j)){we(j,Po(void 0));return}if(Cc(Rr))if(M>ct){we(j,Po(void 0));return}else{H.add(j),await sa(Ee,Rr,!1,{preventScrollReset:me});return}if(hi(Rr)){Ie(j,L,Rr.error);return}we(j,Po(Rr.data))}}async function sa(j,L,B,{submission:Z,fetcherSubmission:ce,preventScrollReset:_e,replace:Oe}={}){B||(I==null||I.resolve(),I=null),L.response.headers.has("X-Remix-Revalidate")&&(D=!0);let me=L.response.headers.get("Location");Qe(me,"Expected a Location header on the redirect Response"),me=ON(me,new URL(j.url),c,e.history);let be=Ep(_.location,me,{_isRedirect:!0});if(n){let Zn=!1;if(L.response.headers.has("X-Remix-Reload-Document"))Zn=!0;else if(HT(me)){const Bn=J3(me,!0);Zn=Bn.origin!==t.location.origin||na(Bn.pathname,c)==null}if(Zn){Oe?t.location.replace(me):t.location.assign(me);return}}z=null;let Ce=Oe===!0||L.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ke,formAction:Ee,formEncType:Ye}=_.navigation;!Z&&!ce&&Ke&&Ee&&Ye&&(Z=$N(_.navigation));let ct=Z||ce;if(PX.has(L.response.status)&&ct&&yr(ct.formMethod))await An(Ce,be,{submission:{...ct,formAction:me},preventScrollReset:_e||O,enableViewTransition:B?U:void 0});else{let Zn=c1(be,Z);await An(Ce,be,{overrideNavigation:Zn,fetcherSubmission:ce,preventScrollReset:_e||O,enableViewTransition:B?U:void 0})}}async function Ro(j,L,B,Z){var Oe;let ce,_e={};try{ce=await WX(f,j,L,Z,B,!1)}catch(me){return L.filter(be=>be.shouldLoad).forEach(be=>{_e[be.route.id]={type:"error",error:me}}),_e}if(j.signal.aborted)return _e;if(!yr(j.method))for(let me of L){if(((Oe=ce[me.route.id])==null?void 0:Oe.type)==="error")break;!ce.hasOwnProperty(me.route.id)&&!_.loaderData.hasOwnProperty(me.route.id)&&(!_.errors||!_.errors.hasOwnProperty(me.route.id))&&me.shouldCallHandler()&&(ce[me.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${me.route.id}`)})}for(let[me,be]of Object.entries(ce))if(aQ(be)){let Ce=be.result;_e[me]={type:"redirect",response:ZX(Ce,j,me,L,c)}}else _e[me]=await QX(be);return _e}async function K(j,L,B,Z){let ce=Ro(B,j,Z,null),_e=Promise.all(L.map(async be=>{if(be.matches&&be.match&&be.request&&be.controller){let Ke=(await Ro(be.request,be.matches,Z,be.key))[be.match.route.id];return{[be.key]:Ke}}else return Promise.resolve({[be.key]:{type:"error",error:zi(404,{pathname:be.path})}})})),Oe=await ce,me=(await _e).reduce((be,Ce)=>Object.assign(be,Ce),{});return{loaderResults:Oe,fetcherResults:me}}function le(){D=!0,R.forEach((j,L)=>{$.has(L)&&P.add(L),Qn(L)})}function we(j,L,B={}){_.fetchers.set(j,L),ve({fetchers:new Map(_.fetchers)},{flushSync:(B&&B.flushSync)===!0})}function Ie(j,L,B,Z={}){let ce=Js(_.matches,L);Fn(j),ve({errors:{[ce.route.id]:B},fetchers:new Map(_.fetchers)},{flushSync:(Z&&Z.flushSync)===!0})}function et(j){return X.set(j,(X.get(j)||0)+1),G.has(j)&&G.delete(j),_.fetchers.get(j)||FX}function pr(j,L){Qn(j,L==null?void 0:L.reason),we(j,Po(null))}function Fn(j){let L=_.fetchers.get(j);$.has(j)&&!(L&&L.state==="loading"&&ue.has(j))&&Qn(j),R.delete(j),ue.delete(j),H.delete(j),G.delete(j),P.delete(j),_.fetchers.delete(j)}function ci(j){let L=(X.get(j)||0)-1;L<=0?(X.delete(j),G.add(j)):X.set(j,L),ve({fetchers:new Map(_.fetchers)})}function Qn(j,L){let B=$.get(j);B&&(B.abort(L),$.delete(j))}function la(j){for(let L of j){let B=et(L),Z=Po(B.data);_.fetchers.set(L,Z)}}function On(){let j=[],L=!1;for(let B of H){let Z=_.fetchers.get(B);Qe(Z,`Expected fetcher: ${B}`),Z.state==="loading"&&(H.delete(B),j.push(B),L=!0)}return la(j),L}function ca(j){let L=[];for(let[B,Z]of ue)if(Z<j){let ce=_.fetchers.get(B);Qe(ce,`Expected fetcher: ${B}`),ce.state==="loading"&&(Qn(B),ue.delete(B),L.push(B))}return la(L),L.length>0}function Tr(j,L){let B=_.blockers.get(j)||Hh;return se.get(j)!==L&&se.set(j,L),B}function ua(j){_.blockers.delete(j),se.delete(j)}function Pu(j,L){let B=_.blockers.get(j)||Hh;Qe(B.state==="unblocked"&&L.state==="blocked"||B.state==="blocked"&&L.state==="blocked"||B.state==="blocked"&&L.state==="proceeding"||B.state==="blocked"&&L.state==="unblocked"||B.state==="proceeding"&&L.state==="unblocked",`Invalid blocker state transition: ${B.state} -> ${L.state}`);let Z=new Map(_.blockers);Z.set(j,L),ve({blockers:Z})}function py({currentLocation:j,nextLocation:L,historyAction:B}){if(se.size===0)return;se.size>1&&an(!1,"A router only supports one blocker at a time");let Z=Array.from(se.entries()),[ce,_e]=Z[Z.length-1],Oe=_.blockers.get(ce);if(!(Oe&&Oe.state==="proceeding")&&_e({currentLocation:j,nextLocation:L,historyAction:B}))return ce}function Fu(j){let L=zi(404,{pathname:j}),B=l||s,{matches:Z,route:ce}=zy(B);return{notFoundMatches:Z,route:ce,error:L}}function gy(j,L,B){if(m=j,w=L,b=B||null,!g&&_.navigation===l1){g=!0;let Z=Mn(_.location,_.matches);Z!=null&&ve({restoreScrollPosition:Z})}return()=>{m=null,w=null,b=null}}function Ue(j,L){return b&&b(j,L.map(Z=>dX(Z,_.loaderData)))||j.key}function mn(j,L){if(m&&w){let B=Ue(j,L);m[B]=w()}}function Mn(j,L){if(m){let B=Ue(j,L),Z=m[B];if(typeof Z=="number")return Z}return null}function Un(j,L,B){if(e.patchRoutesOnNavigation)if(j){if(Object.keys(j[0].params).length>0)return{active:!0,matches:hm(L,B,c,!0)}}else return{active:!0,matches:hm(L,B,c,!0)||[]};return{active:!1,matches:null}}async function Ao(j,L,B,Z){if(!e.patchRoutesOnNavigation)return{type:"success",matches:j};let ce=j;for(;;){let _e=l==null,Oe=l||s,me=o;try{await e.patchRoutesOnNavigation({signal:B,path:L,matches:ce,fetcherKey:Z,patch:(Ke,Ee)=>{B.aborted||CN(Ke,Ee,Oe,me,a,!1)}})}catch(Ke){return{type:"error",error:Ke,partialMatches:ce}}finally{_e&&!B.aborted&&(s=[...s])}if(B.aborted)return{type:"aborted"};let be=Ws(Oe,L,c),Ce=null;if(be){if(Object.keys(be[0].params).length===0)return{type:"success",matches:be};if(Ce=hm(Oe,L,c,!0),!(Ce&&ce.length<Ce.length&&pn(ce,Ce.slice(0,ce.length))))return{type:"success",matches:be}}if(Ce||(Ce=hm(Oe,L,c,!0)),!Ce||pn(ce,Ce))return{type:"success",matches:null};ce=Ce}}function pn(j,L){return j.length===L.length&&j.every((B,Z)=>B.route.id===L[Z].route.id)}function Vr(j){o={},l=kp(j,a,void 0,o)}function Uu(j,L,B=!1){let Z=l==null;CN(j,L,l||s,o,a,B),Z&&(s=[...s],ve({}))}return k={get basename(){return c},get future(){return u},get state(){return _},get routes(){return s},get window(){return t},initialize:ye,subscribe:Fe,enableScrollRestoration:gy,navigate:Rn,fetch:Dh,revalidate:Ni,createHref:j=>e.history.createHref(j),encodeLocation:j=>e.history.encodeLocation(j),getFetcher:et,resetFetcher:pr,deleteFetcher:ci,dispose:Ae,getBlocker:Tr,deleteBlocker:ua,patchRoutes:Uu,_internalFetchControllers:$,_internalSetRoutes:Vr,_internalSetStateDoNotUseOrYouWillBreakYourApp(j){ve(j)}},e.unstable_instrumentations&&(k=MX(k,e.unstable_instrumentations.map(j=>j.router).filter(Boolean))),k}function HX(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function TE(e,t,n,r,i,a){let o,s;if(i){o=[];for(let c of t)if(o.push(c),c.route.id===i){s=c;break}}else o=t,s=t[t.length-1];let l=_S(r||".",wS(o),na(e.pathname,n)||e.pathname,a==="path");if(r==null&&(l.search=e.search,l.hash=e.hash),(r==null||r===""||r===".")&&s){let c=KT(l.search);if(s.route.index&&!c)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&c){let f=new URLSearchParams(l.search),u=f.getAll("index");f.delete("index"),u.filter(h=>h).forEach(h=>f.append("index",h));let d=f.toString();l.search=d?`?${d}`:""}}return n!=="/"&&(l.pathname=kX({basename:n,pathname:l.pathname})),ho(l)}function EN(e,t,n){if(!n||!HX(n))return{path:t};if(n.formMethod&&!lQ(n.formMethod))return{path:t,error:zi(405,{method:n.formMethod})};let r=()=>({path:t,error:zi(400,{type:"invalid-body"})}),a=(n.formMethod||"get").toUpperCase(),o=h4(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!yr(a))return r();let u=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((d,[h,m])=>`${d}${h}=${m}
59
+ `,""):String(n.body);return{path:t,submission:{formMethod:a,formAction:o,formEncType:n.formEncType,formData:void 0,json:void 0,text:u}}}else if(n.formEncType==="application/json"){if(!yr(a))return r();try{let u=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:a,formAction:o,formEncType:n.formEncType,formData:void 0,json:u,text:void 0}}}catch{return r()}}}Qe(typeof FormData=="function","FormData is not available in this environment");let s,l;if(n.formData)s=OE(n.formData),l=n.formData;else if(n.body instanceof FormData)s=OE(n.body),l=n.body;else if(n.body instanceof URLSearchParams)s=n.body,l=MN(s);else if(n.body==null)s=new URLSearchParams,l=new FormData;else try{s=new URLSearchParams(n.body),l=MN(s)}catch{return r()}let c={formMethod:a,formAction:o,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(yr(c.formMethod))return{path:t,submission:c};let f=Kl(t);return e&&f.search&&KT(f.search)&&s.append("index",""),f.search=`?${s}`,{path:ho(f),submission:c}}function kN(e,t,n,r,i,a,o,s,l,c,f,u,d,h,m,b,w,g,v,x,E){var F;let C=x?hi(x[1])?x[1].error:x[1].data:void 0,k=i.createURL(a.location),_=i.createURL(l),A;if(f&&a.errors){let D=Object.keys(a.errors)[0];A=o.findIndex(P=>P.route.id===D)}else if(x&&hi(x[1])){let D=x[0];A=o.findIndex(P=>P.route.id===D)-1}let I=x?x[1].statusCode:void 0,O=I&&I>=400,z={currentUrl:k,currentParams:((F=a.matches[0])==null?void 0:F.params)||{},nextUrl:_,nextParams:o[0].params,...s,actionResult:C,actionStatus:I},U=xg(o),J=o.map((D,P)=>{let{route:$}=D,q=null;if(A!=null&&P>A?q=!1:$.lazy?q=!0:qT($)?f?q=RE($,a.loaderData,a.errors):qX(a.loaderData,a.matches[P],D)&&(q=!0):q=!1,q!==null)return AE(n,r,e,U,D,c,t,q);let M=!1;typeof E=="boolean"?M=E:O?M=!1:(u||k.pathname+k.search===_.pathname+_.search||k.search!==_.search||VX(a.matches[P],D))&&(M=!0);let ue={...z,defaultShouldRevalidate:M},H=Um(D,ue);return AE(n,r,e,U,D,c,t,H,ue,E)}),Y=[];return m.forEach((D,P)=>{if(f||!o.some(G=>G.route.id===D.routeId)||h.has(P))return;let $=a.fetchers.get(P),q=$&&$.state!=="idle"&&$.data===void 0,M=Ws(w,D.path,g);if(!M){if(v&&q)return;Y.push({key:P,routeId:D.routeId,path:D.path,matches:null,match:null,request:null,controller:null});return}if(b.has(P))return;let ue=Tb(M,D.path),H=new AbortController,R=of(i,D.path,H.signal),X=null;if(d.has(P))d.delete(P),X=qf(n,r,R,M,ue,c,t);else if(q)u&&(X=qf(n,r,R,M,ue,c,t));else{let G;typeof E=="boolean"?G=E:O?G=!1:G=u;let se={...z,defaultShouldRevalidate:G};Um(ue,se)&&(X=qf(n,r,R,M,ue,c,t,se))}X&&Y.push({key:P,routeId:D.routeId,path:D.path,matches:X,match:ue,request:R,controller:H})}),{dsMatches:J,revalidatingFetchers:Y}}function qT(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function RE(e,t,n){if(e.lazy)return!0;if(!qT(e))return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function qX(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function VX(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Um(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function CN(e,t,n,r,i,a){let o;if(e){let c=r[e];Qe(c,`No route found to patch children into: routeId = ${e}`),c.children||(c.children=[]),o=c.children}else o=n;let s=[],l=[];if(t.forEach(c=>{let f=o.find(u=>l4(c,u));f?l.push({existingRoute:f,newRoute:c}):s.push(c)}),s.length>0){let c=kp(s,i,[e||"_","patch",String((o==null?void 0:o.length)||"0")],r);o.push(...c)}if(a&&l.length>0)for(let c=0;c<l.length;c++){let{existingRoute:f,newRoute:u}=l[c],d=f,[h]=kp([u],i,[],{},!0);Object.assign(d,{element:h.element?h.element:d.element,errorElement:h.errorElement?h.errorElement:d.errorElement,hydrateFallbackElement:h.hydrateFallbackElement?h.hydrateFallbackElement:d.hydrateFallbackElement})}}function l4(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(a=>l4(n,a))}):!1}var TN=new WeakMap,c4=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(Qe(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let a=i.lazy[e];if(!a)return;let o=TN.get(i);o||(o={},TN.set(i,o));let s=o[e];if(s)return s;let l=(async()=>{let c=lX(e),u=i[e]!==void 0&&e!=="hasErrorBoundary";if(c)an(!c,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),o[e]=Promise.resolve();else if(u)an(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let d=await a();d!=null&&(Object.assign(i,{[e]:d}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(d=>d===void 0)&&(i.lazy=void 0))})();return o[e]=l,l},RN=new WeakMap;function KX(e,t,n,r,i){let a=n[e.id];if(Qe(a,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let f=RN.get(a);if(f)return{lazyRoutePromise:f,lazyHandlerPromise:f};let u=(async()=>{Qe(typeof e.lazy=="function","No lazy route function found");let d=await e.lazy(),h={};for(let m in d){let b=d[m];if(b===void 0)continue;let w=uX(m),v=a[m]!==void 0&&m!=="hasErrorBoundary";w?an(!w,"Route property "+m+" is not a supported property to be returned from a lazy route function. This property will be ignored."):v?an(!v,`Route "${a.id}" has a static property "${m}" defined but its lazy function is also returning a value for this property. The lazy route property "${m}" will be ignored.`):h[m]=b}Object.assign(a,h),Object.assign(a,{...r(a),lazy:void 0})})();return RN.set(a,u),u.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:u}}let o=Object.keys(e.lazy),s=[],l;for(let f of o){if(i&&i.includes(f))continue;let u=c4({key:f,route:e,manifest:n,mapRouteProperties:r});u&&(s.push(u),f===t&&(l=u))}let c=s.length>0?Promise.all(s).then(()=>{}):void 0;return c==null||c.catch(()=>{}),l==null||l.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:l}}async function AN(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,a)=>{n[t[a].route.id]=i}),n}async function GX(e){return e.matches.some(t=>t.route.middleware)?u4(e,()=>AN(e)):AN(e)}function u4(e,t){return YX(e,t,r=>{if(sQ(r))throw r;return r},rQ,n);function n(r,i,a){if(a)return Promise.resolve(Object.assign(a.value,{[i]:{type:"error",result:r}}));{let{matches:o}=e,s=Math.min(Math.max(o.findIndex(c=>c.route.id===i),0),Math.max(o.findIndex(c=>c.shouldCallHandler()),0)),l=Js(o,o[s].route.id).route.id;return Promise.resolve({[l]:{type:"error",result:r}})}}}async function YX(e,t,n,r,i){let{matches:a,request:o,params:s,context:l,unstable_pattern:c}=e,f=a.flatMap(d=>d.route.middleware?d.route.middleware.map(h=>[d.route.id,h]):[]);return await f4({request:o,params:s,context:l,unstable_pattern:c},f,t,n,r,i)}async function f4(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let l=t[o];if(!l)return await n();let[c,f]=l,u,d=async()=>{if(u)throw new Error("You may only call `next()` once per middleware");try{return u={value:await f4(e,t,n,r,i,a,o+1)},u.value}catch(h){return u={value:await a(h,c,u)},u.value}};try{let h=await f(e,d),m=h!=null?r(h):void 0;return i(m)?m:u?m??u.value:(u={value:await d()},u.value)}catch(h){return await a(h,c,u)}}function d4(e,t,n,r,i){let a=c4({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),o=KX(r.route,yr(n.method)?"action":"loader",t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function AE(e,t,n,r,i,a,o,s,l=null,c){let f=!1,u=d4(e,t,n,i,a);return{...i,_lazyPromises:u,shouldLoad:s,shouldRevalidateArgs:l,shouldCallHandler(d){return f=!0,l?typeof c=="boolean"?Um(i,{...l,defaultShouldRevalidate:c}):typeof d=="boolean"?Um(i,{...l,defaultShouldRevalidate:d}):Um(i,l):s},resolve(d){let{lazy:h,loader:m,middleware:b}=i.route,w=f||s||d&&!yr(n.method)&&(h||m),g=b&&b.length>0&&!m&&!h;return w&&(yr(n.method)||!g)?JX({request:n,unstable_pattern:r,match:i,lazyHandlerPromise:u==null?void 0:u.handler,lazyRoutePromise:u==null?void 0:u.route,handlerOverride:d,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function qf(e,t,n,r,i,a,o,s=null){return r.map(l=>l.route.id!==i.route.id?{...l,shouldLoad:!1,shouldRevalidateArgs:s,shouldCallHandler:()=>!1,_lazyPromises:d4(e,t,n,l,a),resolve:()=>Promise.resolve({type:"data",result:void 0})}:AE(e,t,n,xg(r),l,a,o,!0,s))}async function WX(e,t,n,r,i,a){n.some(c=>{var f;return(f=c._lazyPromises)==null?void 0:f.middleware})&&await Promise.all(n.map(c=>{var f;return(f=c._lazyPromises)==null?void 0:f.middleware}));let o={request:t,unstable_pattern:xg(n),params:n[0].params,context:i,matches:n},l=await e({...o,fetcherKey:r,runClientMiddleware:c=>{let f=o;return u4(f,()=>c({...f,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(c=>{var f,u;return[(f=c._lazyPromises)==null?void 0:f.handler,(u=c._lazyPromises)==null?void 0:u.route]}))}catch{}return l}async function JX({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:i,handlerOverride:a,scopedContext:o}){let s,l,c=yr(e.method),f=c?"action":"loader",u=d=>{let h,m=new Promise((g,v)=>h=v);l=()=>h(),e.signal.addEventListener("abort",l);let b=g=>typeof d!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${f}" [routeId: ${n.route.id}]`)):d({request:e,unstable_pattern:t,params:n.params,context:o},...g!==void 0?[g]:[]),w=(async()=>{try{return{type:"data",result:await(a?a(v=>b(v)):b())}}catch(g){return{type:"error",result:g}}})();return Promise.race([w,m])};try{let d=c?n.route.action:n.route.loader;if(r||i)if(d){let h,[m]=await Promise.all([u(d).catch(b=>{h=b}),r,i]);if(h!==void 0)throw h;s=m}else{await r;let h=c?n.route.action:n.route.loader;if(h)[s]=await Promise.all([u(h),i]);else if(f==="action"){let m=new URL(e.url),b=m.pathname+m.search;throw zi(405,{method:e.method,pathname:b,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(d)s=await u(d);else{let h=new URL(e.url),m=h.pathname+h.search;throw zi(404,{pathname:m})}}catch(d){return{type:"error",result:d}}finally{l&&e.signal.removeEventListener("abort",l)}return s}async function XX(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function QX(e){var r,i,a,o,s;let{result:t,type:n}=e;if(VT(t)){let l;try{l=await XX(t)}catch(c){return{type:"error",error:c}}return n==="error"?{type:"error",error:new Sg(t.status,t.statusText,l),statusCode:t.status,headers:t.headers}:{type:"data",data:l,statusCode:t.status,headers:t.headers}}return n==="error"?IN(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:nQ(t),statusCode:Cp(t)?t.status:void 0,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Cp(t)?t.status:void 0}:IN(t)?{type:"data",data:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function ZX(e,t,n,r,i){let a=e.headers.get("Location");if(Qe(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!HT(a)){let o=r.slice(0,r.findIndex(s=>s.route.id===n)+1);a=TE(new URL(t.url),o,i,a),e.headers.set("Location",a)}return e}function ON(e,t,n,r){let i=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(HT(e)){let a=e,o=a.startsWith("//")?new URL(t.protocol+a):new URL(a);if(i.includes(o.protocol))throw new Error("Invalid redirect location");let s=na(o.pathname,n)!=null;if(o.origin===t.origin&&s)return o.pathname+o.search+o.hash}try{let a=r.createURL(e);if(i.includes(a.protocol))throw new Error("Invalid redirect location")}catch{}return e}function of(e,t,n,r){let i=e.createURL(h4(t)).toString(),a={signal:n};if(r&&yr(r.formMethod)){let{formMethod:o,formEncType:s}=r;a.method=o.toUpperCase(),s==="application/json"?(a.headers=new Headers({"Content-Type":s}),a.body=JSON.stringify(r.json)):s==="text/plain"?a.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?a.body=OE(r.formData):a.body=r.formData}return new Request(i,a)}function OE(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function MN(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function eQ(e,t,n,r=!1,i=!1){let a={},o=null,s,l=!1,c={},f=n&&hi(n[1])?n[1].error:void 0;return e.forEach(u=>{if(!(u.route.id in t))return;let d=u.route.id,h=t[d];if(Qe(!Cc(h),"Cannot handle redirect results in processLoaderData"),hi(h)){let m=h.error;if(f!==void 0&&(m=f,f=void 0),o=o||{},i)o[d]=m;else{let b=Js(e,d);o[b.route.id]==null&&(o[b.route.id]=m)}r||(a[d]=s4),l||(l=!0,s=Cp(h.error)?h.error.status:500),h.headers&&(c[d]=h.headers)}else a[d]=h.data,h.statusCode&&h.statusCode!==200&&!l&&(s=h.statusCode),h.headers&&(c[d]=h.headers)}),f!==void 0&&n&&(o={[n[0]]:f},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:c}}function NN(e,t,n,r,i,a){let{loaderData:o,errors:s}=eQ(t,n,r);return i.filter(l=>!l.matches||l.matches.some(c=>c.shouldLoad)).forEach(l=>{let{key:c,match:f,controller:u}=l;if(u&&u.signal.aborted)return;let d=a[c];if(Qe(d,"Did not find corresponding fetcher result"),hi(d)){let h=Js(e.matches,f==null?void 0:f.route.id);s&&s[h.route.id]||(s={...s,[h.route.id]:d.error}),e.fetchers.delete(c)}else if(Cc(d))Qe(!1,"Unhandled fetcher revalidation redirect");else{let h=Po(d.data);e.fetchers.set(c,h)}}),{loaderData:o,errors:s}}function DN(e,t,n,r){let i=Object.entries(t).filter(([,a])=>a!==s4).reduce((a,[o,s])=>(a[o]=s,a),{});for(let a of n){let o=a.route.id;if(!t.hasOwnProperty(o)&&e.hasOwnProperty(o)&&a.route.loader&&(i[o]=e[o]),r&&r.hasOwnProperty(o))break}return i}function jN(e){return e?hi(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Js(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function zy(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function zi(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(o="Bad Request",r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i==="invalid-body"&&(s="Unable to encode submission body")):e===403?(o="Forbidden",s=`Route "${n}" does not match URL "${t}"`):e===404?(o="Not Found",s=`No route matches URL "${t}"`):e===405&&(o="Method Not Allowed",r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Sg(e||500,o,new Error(s),!0)}function Py(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Cc(i))return{key:r,result:i}}}function h4(e){let t=typeof e=="string"?Kl(e):e;return ho({...t,hash:""})}function tQ(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function nQ(e){var t,n;return new Sg(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function rQ(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&iQ(n))}function iQ(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function aQ(e){return VT(e.result)&&a4.has(e.result.status)}function hi(e){return e.type==="error"}function Cc(e){return(e&&e.type)==="redirect"}function IN(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function VT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function oQ(e){return a4.has(e)}function sQ(e){return VT(e)&&oQ(e.status)&&e.headers.has("Location")}function lQ(e){return zX.has(e.toUpperCase())}function yr(e){return $X.has(e.toUpperCase())}function KT(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Tb(e,t){let n=typeof t=="string"?Kl(t).search:t.search;if(e[e.length-1].route.index&&KT(n||""))return e[e.length-1];let r=e4(e);return r[r.length-1]}function $N(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function c1(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function cQ(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function qh(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function uQ(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Po(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function fQ(e,t){try{let n=e.sessionStorage.getItem(o4);if(n){let r=JSON.parse(n);for(let[i,a]of Object.entries(r||{}))a&&Array.isArray(a)&&t.set(i,new Set(a||[]))}}catch{}}function dQ(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(o4,JSON.stringify(n))}catch(r){an(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function LN(){let e,t,n=new Promise((r,i)=>{e=async a=>{r(a);try{await n}catch{}},t=async a=>{i(a);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var _u=y.createContext(null);_u.displayName="DataRouter";var wg=y.createContext(null);wg.displayName="DataRouterState";var m4=y.createContext(!1);function hQ(){return y.useContext(m4)}var GT=y.createContext({isTransitioning:!1});GT.displayName="ViewTransition";var p4=y.createContext(new Map);p4.displayName="Fetchers";var mQ=y.createContext(null);mQ.displayName="Await";var Mi=y.createContext(null);Mi.displayName="Navigation";var ES=y.createContext(null);ES.displayName="Location";var aa=y.createContext({outlet:null,matches:[],isDataRoute:!1});aa.displayName="Route";var YT=y.createContext(null);YT.displayName="RouteError";var g4="REACT_ROUTER_ERROR",pQ="REDIRECT",gQ="ROUTE_ERROR_RESPONSE";function yQ(e){if(e.startsWith(`${g4}:${pQ}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function bQ(e){if(e.startsWith(`${g4}:${gQ}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Sg(t.status,t.statusText,t.data)}catch{}}function vQ(e,{relative:t}={}){Qe(th(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(Mi),{hash:i,pathname:a,search:o}=_g(e,{relative:t}),s=a;return n!=="/"&&(s=a==="/"?n:so([n,a])),r.createHref({pathname:s,search:o,hash:i})}function th(){return y.useContext(ES)!=null}function xo(){return Qe(th(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(ES).location}var y4="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function b4(e){y.useContext(Mi).static||y.useLayoutEffect(e)}function Es(){let{isDataRoute:e}=y.useContext(aa);return e?jQ():SQ()}function SQ(){Qe(th(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(_u),{basename:t,navigator:n}=y.useContext(Mi),{matches:r}=y.useContext(aa),{pathname:i}=xo(),a=JSON.stringify(wS(r)),o=y.useRef(!1);return b4(()=>{o.current=!0}),y.useCallback((l,c={})=>{if(an(o.current,y4),!o.current)return;if(typeof l=="number"){n.go(l);return}let f=_S(l,JSON.parse(a),i,c.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:so([t,f.pathname])),(c.replace?n.replace:n.push)(f,c.state,c)},[t,n,a,i,e])}var xQ=y.createContext(null);function wQ(e){let t=y.useContext(aa).outlet;return y.useMemo(()=>t&&y.createElement(xQ.Provider,{value:e},t),[t,e])}function v4(){let{matches:e}=y.useContext(aa),t=e[e.length-1];return t?t.params:{}}function _g(e,{relative:t}={}){let{matches:n}=y.useContext(aa),{pathname:r}=xo(),i=JSON.stringify(wS(n));return y.useMemo(()=>_S(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function _Q(e,t,n,r,i){Qe(th(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=y.useContext(Mi),{matches:o}=y.useContext(aa),s=o[o.length-1],l=s?s.params:{},c=s?s.pathname:"/",f=s?s.pathnameBase:"/",u=s&&s.route;{let v=u&&u.path||"";x4(c,!u||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${v}">) 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.
60
+
61
+ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let d=xo(),h;h=d;let m=h.pathname||"/",b=m;if(f!=="/"){let v=f.replace(/^\//,"").split("/");b="/"+m.replace(/^\//,"").split("/").slice(v.length).join("/")}let w=Ws(e,{pathname:b});return an(u||w!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),an(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.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.`),RQ(w&&w.map(v=>Object.assign({},v,{params:Object.assign({},l,v.params),pathname:so([f,a.encodeLocation?a.encodeLocation(v.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?f:so([f,a.encodeLocation?a.encodeLocation(v.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),o,n,r,i)}function EQ(){let e=DQ(),t=Cp(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:a},"ErrorBoundary")," or"," ",y.createElement("code",{style:a},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,o)}var kQ=y.createElement(EQ,null),S4=class extends y.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,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):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 n=bQ(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(aa.Provider,{value:this.props.routeContext},y.createElement(YT.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(CQ,{error:e},t):t}};S4.contextType=m4;var u1=new WeakMap;function CQ({children:e,error:t}){let{basename:n}=y.useContext(Mi);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=yQ(t.digest);if(r){let i=u1.get(t);if(i)throw i;let a=n4(r.location,n);if(t4&&!u1.get(t))if(a.isExternal||r.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw u1.set(t,o),o}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function TQ({routeContext:e,match:t,children:n}){let r=y.useContext(_u);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(aa.Provider,{value:e},n)}function RQ(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n==null?void 0:n.errors;if(o!=null){let f=a.findIndex(u=>u.route.id&&(o==null?void 0:o[u.route.id])!==void 0);Qe(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let s=!1,l=-1;if(n)for(let f=0;f<a.length;f++){let u=a[f];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(l=f),u.route.id){let{loaderData:d,errors:h}=n,m=u.route.loader&&!d.hasOwnProperty(u.route.id)&&(!h||h[u.route.id]===void 0);if(u.route.lazy||m){s=!0,l>=0?a=a.slice(0,l+1):a=[a[0]];break}}}let c=n&&r?(f,u)=>{var d,h;r(f,{location:n.location,params:((h=(d=n.matches)==null?void 0:d[0])==null?void 0:h.params)??{},unstable_pattern:xg(n.matches),errorInfo:u})}:void 0;return a.reduceRight((f,u,d)=>{let h,m=!1,b=null,w=null;n&&(h=o&&u.route.id?o[u.route.id]:void 0,b=u.route.errorElement||kQ,s&&(l<0&&d===0?(x4("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,w=null):l===d&&(m=!0,w=u.route.hydrateFallbackElement||null)));let g=t.concat(a.slice(0,d+1)),v=()=>{let x;return h?x=b:m?x=w:u.route.Component?x=y.createElement(u.route.Component,null):u.route.element?x=u.route.element:x=f,y.createElement(TQ,{match:u,routeContext:{outlet:f,matches:g,isDataRoute:n!=null},children:x})};return n&&(u.route.ErrorBoundary||u.route.errorElement||d===0)?y.createElement(S4,{location:n.location,revalidation:n.revalidation,component:b,error:h,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:c}):v()},null)}function WT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function AQ(e){let t=y.useContext(_u);return Qe(t,WT(e)),t}function OQ(e){let t=y.useContext(wg);return Qe(t,WT(e)),t}function MQ(e){let t=y.useContext(aa);return Qe(t,WT(e)),t}function JT(e){let t=MQ(e),n=t.matches[t.matches.length-1];return Qe(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function NQ(){return JT("useRouteId")}function DQ(){var r;let e=y.useContext(YT),t=OQ("useRouteError"),n=JT("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function jQ(){let{router:e}=AQ("useNavigate"),t=JT("useNavigate"),n=y.useRef(!1);return b4(()=>{n.current=!0}),y.useCallback(async(i,a={})=>{an(n.current,y4),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var zN={};function x4(e,t,n){!t&&!zN[e]&&(zN[e]=!0,an(!1,n))}var PN={};function FN(e,t){!e&&!PN[t]&&(PN[t]=!0,console.warn(t))}var IQ="useOptimistic",UN=rS[IQ],$Q=()=>{};function LQ(e){return UN?UN(e):[e,$Q]}function zQ(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&an(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:y.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&an(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&an(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var PQ=["HydrateFallback","hydrateFallbackElement"],FQ=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function UQ({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=hQ()||r;let[a,o]=y.useState(e.state),[s,l]=LQ(a),[c,f]=y.useState(),[u,d]=y.useState({isTransitioning:!1}),[h,m]=y.useState(),[b,w]=y.useState(),[g,v]=y.useState(),x=y.useRef(new Map),E=y.useCallback((A,{deletedFetchers:I,newErrors:O,flushSync:z,viewTransitionOpts:U})=>{O&&n&&Object.values(O).forEach(Y=>{var F;return n(Y,{location:A.location,params:((F=A.matches[0])==null?void 0:F.params)??{},unstable_pattern:xg(A.matches)})}),A.fetchers.forEach((Y,F)=>{Y.data!==void 0&&x.current.set(F,Y.data)}),I.forEach(Y=>x.current.delete(Y)),FN(z===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let J=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(FN(U==null||J,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!U||!J){t&&z?t(()=>o(A)):r===!1?o(A):y.startTransition(()=>{r===!0&&l(Y=>BN(Y,A)),o(A)});return}if(t&&z){t(()=>{b&&(h==null||h.resolve(),b.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let Y=e.window.document.startViewTransition(()=>{t(()=>o(A))});Y.finished.finally(()=>{t(()=>{m(void 0),w(void 0),f(void 0),d({isTransitioning:!1})})}),t(()=>w(Y));return}b?(h==null||h.resolve(),b.skipTransition(),v({state:A,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(f(A),d({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[e.window,t,b,h,r,l,n]);y.useLayoutEffect(()=>e.subscribe(E),[e,E]),y.useEffect(()=>{u.isTransitioning&&!u.flushSync&&m(new FQ)},[u]),y.useEffect(()=>{if(h&&c&&e.window){let A=c,I=h.promise,O=e.window.document.startViewTransition(async()=>{r===!1?o(A):y.startTransition(()=>{r===!0&&l(z=>BN(z,A)),o(A)}),await I});O.finished.finally(()=>{m(void 0),w(void 0),f(void 0),d({isTransitioning:!1})}),w(O)}},[c,h,e.window,r,l]),y.useEffect(()=>{h&&c&&s.location.key===c.location.key&&h.resolve()},[h,b,s.location,c]),y.useEffect(()=>{!u.isTransitioning&&g&&(f(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),v(void 0))},[u.isTransitioning,g]);let C=y.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:A=>e.navigate(A),push:(A,I,O)=>e.navigate(A,{state:I,preventScrollReset:O==null?void 0:O.preventScrollReset}),replace:(A,I,O)=>e.navigate(A,{replace:!0,state:I,preventScrollReset:O==null?void 0:O.preventScrollReset})}),[e]),k=e.basename||"/",_=y.useMemo(()=>({router:e,navigator:C,static:!1,basename:k,onError:n}),[e,C,k,n]);return y.createElement(y.Fragment,null,y.createElement(_u.Provider,{value:_},y.createElement(wg.Provider,{value:s},y.createElement(p4.Provider,{value:x.current},y.createElement(GT.Provider,{value:u},y.createElement(KQ,{basename:k,location:s.location,navigationType:s.historyAction,navigator:C,unstable_useTransitions:r},y.createElement(BQ,{routes:e.routes,future:e.future,state:s,onError:n})))))),null)}function BN(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var BQ=y.memo(HQ);function HQ({routes:e,future:t,state:n,onError:r}){return _Q(e,void 0,n,r,t)}function qQ({to:e,replace:t,state:n,relative:r}){Qe(th(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=y.useContext(Mi);an(!i,"<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:a}=y.useContext(aa),{pathname:o}=xo(),s=Es(),l=_S(e,wS(a),o,r==="path"),c=JSON.stringify(l);return y.useEffect(()=>{s(JSON.parse(c),{replace:t,state:n,relative:r})},[s,c,r,t,n]),null}function VQ(e){return wQ(e.context)}function KQ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,unstable_useTransitions:o}){Qe(!th(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=y.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n=="string"&&(n=Kl(n));let{pathname:c="/",search:f="",hash:u="",state:d=null,key:h="default"}=n,m=y.useMemo(()=>{let b=na(c,s);return b==null?null:{location:{pathname:b,search:f,hash:u,state:d,key:h},navigationType:r}},[s,c,f,u,d,h,r]);return an(m!=null,`<Router basename="${s}"> is not able to match the URL "${c}${f}${u}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:y.createElement(Mi.Provider,{value:l},y.createElement(ES.Provider,{children:t,value:m}))}var Rb="get",Ab="application/x-www-form-urlencoded";function kS(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function GQ(e){return kS(e)&&e.tagName.toLowerCase()==="button"}function YQ(e){return kS(e)&&e.tagName.toLowerCase()==="form"}function WQ(e){return kS(e)&&e.tagName.toLowerCase()==="input"}function JQ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function XQ(e,t){return e.button===0&&(!t||t==="_self")&&!JQ(e)}function ME(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function QQ(e,t){let n=ME(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}var Fy=null;function ZQ(){if(Fy===null)try{new FormData(document.createElement("form"),0),Fy=!1}catch{Fy=!0}return Fy}var eZ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function f1(e){return e!=null&&!eZ.has(e)?(an(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ab}"`),null):e}function tZ(e,t){let n,r,i,a,o;if(YQ(e)){let s=e.getAttribute("action");r=s?na(s,t):null,n=e.getAttribute("method")||Rb,i=f1(e.getAttribute("enctype"))||Ab,a=new FormData(e)}else if(GQ(e)||WQ(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(r=l?na(l,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||Rb,i=f1(e.getAttribute("formenctype"))||f1(s.getAttribute("enctype"))||Ab,a=new FormData(s,e),!ZQ()){let{name:c,type:f,value:u}=e;if(f==="image"){let d=c?`${c}.`:"";a.append(`${d}x`,"0"),a.append(`${d}y`,"0")}else c&&a.append(c,u)}}else{if(kS(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Rb,r=null,i=Ab,o=e}return a&&i==="text/plain"&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function XT(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nZ(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&na(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function rZ(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function iZ(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 aZ(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let o=await rZ(a,n);return o.links?o.links():[]}return[]}));return cZ(r.flat(1).filter(iZ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function HN(e,t,n,r,i,a){let o=(l,c)=>n[c]?l.route.id!==n[c].route.id:!0,s=(l,c)=>{var f;return n[c].pathname!==l.pathname||((f=n[c].route.path)==null?void 0:f.endsWith("*"))&&n[c].params["*"]!==l.params["*"]};return a==="assets"?t.filter((l,c)=>o(l,c)||s(l,c)):a==="data"?t.filter((l,c)=>{var u;let f=r.routes[l.route.id];if(!f||!f.hasLoader)return!1;if(o(l,c)||s(l,c))return!0;if(l.route.shouldRevalidate){let d=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((u=n[0])==null?void 0:u.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function oZ(e,t,{includeHydrateFallback:n}={}){return sZ(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let a=[i.module];return i.clientActionModule&&(a=a.concat(i.clientActionModule)),i.clientLoaderModule&&(a=a.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(a=a.concat(i.hydrateFallbackModule)),i.imports&&(a=a.concat(i.imports)),a}).flat(1))}function sZ(e){return[...new Set(e)]}function lZ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function cZ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(lZ(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function w4(){let e=y.useContext(_u);return XT(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function uZ(){let e=y.useContext(wg);return XT(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var QT=y.createContext(void 0);QT.displayName="FrameworkContext";function _4(){let e=y.useContext(QT);return XT(e,"You must render this element inside a <HydratedRouter> element"),e}function fZ(e,t){let n=y.useContext(QT),[r,i]=y.useState(!1),[a,o]=y.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:c,onMouseLeave:f,onTouchStart:u}=t,d=y.useRef(null);y.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let b=g=>{g.forEach(v=>{o(v.isIntersecting)})},w=new IntersectionObserver(b,{threshold:.5});return d.current&&w.observe(d.current),()=>{w.disconnect()}}},[e]),y.useEffect(()=>{if(r){let b=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(b)}}},[r]);let h=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e!=="intent"?[a,d,{}]:[a,d,{onFocus:Vh(s,h),onBlur:Vh(l,m),onMouseEnter:Vh(c,h),onMouseLeave:Vh(f,m),onTouchStart:Vh(u,h)}]:[!1,d,{}]}function Vh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function dZ({page:e,...t}){let{router:n}=w4(),r=y.useMemo(()=>Ws(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(mZ,{page:e,matches:r,...t}):null}function hZ(e){let{manifest:t,routeModules:n}=_4(),[r,i]=y.useState([]);return y.useEffect(()=>{let a=!1;return aZ(e,t,n).then(o=>{a||i(o)}),()=>{a=!0}},[e,t,n]),r}function mZ({page:e,matches:t,...n}){let r=xo(),{future:i,manifest:a,routeModules:o}=_4(),{basename:s}=w4(),{loaderData:l,matches:c}=uZ(),f=y.useMemo(()=>HN(e,t,c,a,r,"data"),[e,t,c,a,r]),u=y.useMemo(()=>HN(e,t,c,a,r,"assets"),[e,t,c,a,r]),d=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,w=!1;if(t.forEach(v=>{var E;let x=a.routes[v.route.id];!x||!x.hasLoader||(!f.some(C=>C.route.id===v.route.id)&&v.route.id in l&&((E=o[v.route.id])!=null&&E.shouldRevalidate)||x.hasClientLoader?w=!0:b.add(v.route.id))}),b.size===0)return[];let g=nZ(e,s,i.unstable_trailingSlashAwareDataRequests,"data");return w&&b.size>0&&g.searchParams.set("_routes",t.filter(v=>b.has(v.route.id)).map(v=>v.route.id).join(",")),[g.pathname+g.search]},[s,i.unstable_trailingSlashAwareDataRequests,l,r,a,f,t,e,o]),h=y.useMemo(()=>oZ(u,a),[u,a]),m=hZ(u);return y.createElement(y.Fragment,null,d.map(b=>y.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),h.map(b=>y.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),m.map(({key:b,link:w})=>y.createElement("link",{key:b,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function pZ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var gZ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{gZ&&(window.__reactRouterVersion="7.13.0")}catch{}function yZ(e,t){return BX({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:iX({window:t==null?void 0:t.window}),hydrationData:bZ(),routes:e,mapRouteProperties:zQ,hydrationRouteProperties:PQ,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function bZ(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:vZ(e.errors)}),e}function vZ(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Sg(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let a=window[i.__subType];if(typeof a=="function")try{let o=new a(i.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let a=new Error(i.message);a.stack="",n[r]=a}}else n[r]=i;return n}var E4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wa=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:a,replace:o,state:s,target:l,to:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:d,...h},m){let{basename:b,unstable_useTransitions:w}=y.useContext(Mi),g=typeof c=="string"&&E4.test(c),v=n4(c,b);c=v.to;let x=vQ(c,{relative:i}),[E,C,k]=fZ(r,h),_=_Z(c,{replace:o,state:s,target:l,preventScrollReset:f,relative:i,viewTransition:u,unstable_defaultShouldRevalidate:d,unstable_useTransitions:w});function A(O){t&&t(O),O.defaultPrevented||_(O)}let I=y.createElement("a",{...h,...k,href:v.absoluteURL||x,onClick:v.isExternal||a?t:A,ref:pZ(m,C),target:l,"data-discover":!g&&n==="render"?"true":void 0});return E&&!g?y.createElement(y.Fragment,null,I,y.createElement(dZ,{page:x})):I});Wa.displayName="Link";var SZ=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:a,to:o,viewTransition:s,children:l,...c},f){let u=_g(o,{relative:c.relative}),d=xo(),h=y.useContext(wg),{navigator:m,basename:b}=y.useContext(Mi),w=h!=null&&AZ(u)&&s===!0,g=m.encodeLocation?m.encodeLocation(u).pathname:u.pathname,v=d.pathname,x=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(v=v.toLowerCase(),x=x?x.toLowerCase():null,g=g.toLowerCase()),x&&b&&(x=na(x,b)||x);const E=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let C=v===g||!i&&v.startsWith(g)&&v.charAt(E)==="/",k=x!=null&&(x===g||!i&&x.startsWith(g)&&x.charAt(g.length)==="/"),_={isActive:C,isPending:k,isTransitioning:w},A=C?t:void 0,I;typeof r=="function"?I=r(_):I=[r,C?"active":null,k?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let O=typeof a=="function"?a(_):a;return y.createElement(Wa,{...c,"aria-current":A,className:I,ref:f,style:O,to:o,viewTransition:s},typeof l=="function"?l(_):l)});SZ.displayName="NavLink";var xZ=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Rb,action:s,onSubmit:l,relative:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:d,...h},m)=>{let{unstable_useTransitions:b}=y.useContext(Mi),w=TZ(),g=RZ(s,{relative:c}),v=o.toLowerCase()==="get"?"get":"post",x=typeof s=="string"&&E4.test(s),E=C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let k=C.nativeEvent.submitter,_=(k==null?void 0:k.getAttribute("formmethod"))||o,A=()=>w(k||C.currentTarget,{fetcherKey:t,method:_,navigate:n,replace:i,state:a,relative:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:d});b&&n!==!1?y.startTransition(()=>A()):A()};return y.createElement("form",{ref:m,method:v,action:g,onSubmit:r?l:E,...h,"data-discover":!x&&e==="render"?"true":void 0})});xZ.displayName="Form";function wZ(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function k4(e){let t=y.useContext(_u);return Qe(t,wZ(e)),t}function _Z(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:s,unstable_useTransitions:l}={}){let c=Es(),f=xo(),u=_g(e,{relative:a});return y.useCallback(d=>{if(XQ(d,t)){d.preventDefault();let h=n!==void 0?n:ho(f)===ho(u),m=()=>c(e,{replace:h,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:s});l?y.startTransition(()=>m()):m()}},[f,c,u,n,r,t,e,i,a,o,s,l])}function EZ(e){an(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(ME(e)),n=y.useRef(!1),r=xo(),i=y.useMemo(()=>QQ(r.search,n.current?null:t.current),[r.search]),a=Es(),o=y.useCallback((s,l)=>{const c=ME(typeof s=="function"?s(new URLSearchParams(i)):s);n.current=!0,a("?"+c,l)},[a,i]);return[i,o]}var kZ=0,CZ=()=>`__${String(++kZ)}__`;function TZ(){let{router:e}=k4("useSubmit"),{basename:t}=y.useContext(Mi),n=NQ(),r=e.fetch,i=e.navigate;return y.useCallback(async(a,o={})=>{let{action:s,method:l,encType:c,formData:f,body:u}=tZ(a,t);if(o.navigate===!1){let d=o.fetcherKey||CZ();await r(d,n,o.action||s,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:f,body:u,formMethod:o.method||l,formEncType:o.encType||c,flushSync:o.flushSync})}else await i(o.action||s,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:f,body:u,formMethod:o.method||l,formEncType:o.encType||c,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,i,t,n])}function RZ(e,{relative:t}={}){let{basename:n}=y.useContext(Mi),r=y.useContext(aa);Qe(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={..._g(e||".",{relative:t})},o=xo();if(e==null){a.search=o.search;let s=new URLSearchParams(a.search),l=s.getAll("index");if(l.some(f=>f==="")){s.delete("index"),l.filter(u=>u).forEach(u=>s.append("index",u));let f=s.toString();a.search=f?`?${f}`:""}}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:so([n,a.pathname])),ho(a)}function AZ(e,{relative:t}={}){let n=y.useContext(GT);Qe(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=k4("useViewTransitionState"),i=_g(e,{relative:t});if(!n.isTransitioning)return!1;let a=na(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=na(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Iv(i.pathname,o)!=null||Iv(i.pathname,a)!=null}const ZT={grantedDismissed:"codecommit-granted-dismissed",theme:"codecommit-theme"},C4=y.createContext({theme:"system",setTheme:()=>{}}),OZ=()=>{const e=localStorage.getItem(ZT.theme);return e==="dark"||e==="light"||e==="system"?e:"system"};function MZ({children:e}){const[t,n]=y.useState(OZ),r=y.useCallback(i=>{localStorage.setItem(ZT.theme,i),n(i)},[]);return y.useEffect(()=>{const i=document.documentElement,a=t==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t;i.classList.remove("dark","light"),i.classList.add(a)},[t]),y.useEffect(()=>{if(t!=="system")return;const i=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>{const o=document.documentElement;o.classList.remove("dark","light"),o.classList.add(i.matches?"dark":"light")};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)},[t]),p.jsx(C4,{value:{theme:t,setTheme:r},children:e})}function T4(){return y.useContext(C4)}const NZ=e=>typeof e=="function",T=function(e,t){if(typeof e=="function")return function(){return e(arguments)?t.apply(this,arguments):n=>t(n,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(n,r){return arguments.length>=2?t(n,r):function(i){return t(i,n)}};case 3:return function(n,r,i){return arguments.length>=3?t(n,r,i):function(a){return t(a,n,r)}};case 4:return function(n,r,i,a){return arguments.length>=4?t(n,r,i,a):function(o){return t(o,n,r,i)}};case 5:return function(n,r,i,a,o){return arguments.length>=5?t(n,r,i,a,o):function(s){return t(s,n,r,i,a)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);const n=arguments;return function(r){return t(r,...n)}}}},ke=e=>e,Eg=e=>()=>e,NE=Eg(!0),pl=Eg(!1),DZ=Eg(null),R4=Eg(void 0),bd=R4;function N(e,t,n,r,i,a,o,s,l){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return a(i(r(n(t(e)))));case 7:return o(a(i(r(n(t(e))))));case 8:return s(o(a(i(r(n(t(e)))))));case 9:return l(s(o(a(i(r(n(t(e))))))));default:{let c=arguments[0];for(let f=1;f<arguments.length;f++)c=arguments[f](c);return c}}}const Uy="effect/GlobalValue";let Kh;const je=(e,t)=>(Kh||(globalThis[Uy]??(globalThis[Uy]=new Map),Kh=globalThis[Uy]),Kh.has(e)||Kh.set(e,t()),Kh.get(e)),Oi=e=>typeof e=="string",ps=e=>typeof e=="number",vd=e=>typeof e=="boolean",CS=e=>typeof e=="bigint",DE=e=>typeof e=="symbol",nh=NZ,jZ=e=>e===void 0,IZ=e=>e!==void 0,d1=e=>e!==null,$Z=e=>!1,eR=e=>typeof e=="object"&&e!==null,Oa=e=>eR(e)||nh(e),Re=T(2,(e,t)=>Oa(e)&&t in e),tR=T(2,(e,t)=>Re(e,"_tag")&&e._tag===t),Vu=e=>e==null,LZ=e=>e!=null,zZ=e=>e instanceof Uint8Array,A4=e=>e instanceof Date,O4=e=>typeof e=="string"||Re(e,Symbol.iterator),PZ=e=>eR(e)&&!Array.isArray(e),FZ=e=>Re(e,"then")&&nh(e.then),TS=e=>`BUG: ${e} - please report an issue at https://github.com/Effect-TS/effect/issues`;let M4=class N4{constructor(t){S(this,"self");S(this,"called",!1);this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(t){return{value:t,done:!0}}throw(t){throw t}[Symbol.iterator](){return new N4(this.self)}};const UZ=335903614,BZ=4150755663,HZ=1481765933,qZ=1284865837,VZ=9007199254740992,KZ=134217728;class GZ{constructor(t,n,r,i){S(this,"_state");return Vu(n)&&Vu(t)?(n=Math.random()*4294967295>>>0,t=0):Vu(n)&&(n=t,t=0),Vu(i)&&Vu(r)?(i=this._state?this._state[3]:BZ,r=this._state?this._state[2]:UZ):Vu(i)&&(i=r,r=0),this._state=new Int32Array([0,0,r>>>0,((i||0)|1)>>>0]),this._next(),qN(this._state,this._state[0],this._state[1],t>>>0,n>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(t){this._state[0]=t[0],this._state[1]=t[1],this._state[2]=t[2],this._state[3]=t[3]|1}integer(t){return Math.round(this.number()*Number.MAX_SAFE_INTEGER)%t}number(){const t=(this._next()&67108863)*1,n=(this._next()&134217727)*1;return(t*KZ+n)/VZ}_next(){const t=this._state[0]>>>0,n=this._state[1]>>>0;YZ(this._state,t,n,HZ,qZ),qN(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let r=t>>>18,i=(n>>>18|t<<14)>>>0;r=(r^t)>>>0,i=(i^n)>>>0;const a=(i>>>27|r<<5)>>>0,o=t>>>27,s=(-o>>>0&31)>>>0;return(a>>>o|a<<s)>>>0}}function YZ(e,t,n,r,i){let a=(n>>>16)*(i&65535)>>>0,o=(n&65535)*(i>>>16)>>>0,s=(n&65535)*(i&65535)>>>0,l=(n>>>16)*(i>>>16)+((o>>>16)+(a>>>16))>>>0;o=o<<16>>>0,s=s+o>>>0,s>>>0<o>>>0&&(l=l+1>>>0),a=a<<16>>>0,s=s+a>>>0,s>>>0<a>>>0&&(l=l+1>>>0),l=l+Math.imul(n,r)>>>0,l=l+Math.imul(t,i)>>>0,e[0]=l,e[1]=s}function qN(e,t,n,r,i){let a=t+r>>>0;const o=n+i>>>0;o>>>0<n>>>0&&(a=a+1|0),e[0]=a,e[1]=o}const jE=Symbol.for("effect/Utils/YieldWrap");var og;class kg{constructor(t){ww(this,og);xy(this,og,t)}[jE](){return Sy(this,og)}}og=new WeakMap;function WZ(e){if(typeof e=="object"&&e!==null&&jE in e)return e[jE]();throw new Error(TS("yieldWrapGet"))}const ji=je("effect/Utils/isStructuralRegion",()=>({enabled:!1,tester:void 0})),D4={effect_internal_function:e=>e()},JZ={effect_internal_function:e=>{try{return e()}finally{}}};var _L;const XZ=((_L=D4.effect_internal_function(()=>new Error().stack))==null?void 0:_L.includes("effect_internal_function"))===!0,ar=XZ?D4.effect_internal_function:JZ.effect_internal_function,h1=je(Symbol.for("effect/Hash/randomHashCache"),()=>new WeakMap),Le=Symbol.for("effect/Hash"),de=e=>{if(ji.enabled===!0)return 0;switch(typeof e){case"number":return rR(e);case"bigint":return Bt(e.toString(10));case"boolean":return Bt(String(e));case"symbol":return Bt(String(e));case"string":return Bt(e);case"undefined":return Bt("undefined");case"function":case"object":return e===null?Bt("null"):e instanceof Date?Number.isNaN(e.getTime())?Bt("Invalid Date"):de(e.toISOString()):e instanceof URL?de(e.href):QZ(e)?e[Le]():nR(e);default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},nR=e=>(h1.has(e)||h1.set(e,rR(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),h1.get(e)),Pe=e=>t=>t*53^e,RS=e=>e&3221225471|e>>>1&1073741824,QZ=e=>Re(e,Le),rR=e=>{if(e!==e||e===1/0)return 0;let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return RS(t)},Bt=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return RS(t)},ZZ=(e,t)=>{let n=12289;for(let r=0;r<t.length;r++)n^=N(Bt(t[r]),Pe(de(e[t[r]])));return RS(n)},j4=e=>ZZ(e,Object.keys(e)),rh=e=>{let t=6151;for(let n=0;n<e.length;n++)t=N(t,Pe(de(e[n])));return RS(t)},_t=function(){if(arguments.length===1){const n=arguments[0];return function(r){return Object.defineProperty(n,Le,{value(){return r},enumerable:!1}),r}}const e=arguments[0],t=arguments[1];return Object.defineProperty(e,Le,{value(){return t},enumerable:!1}),t},ze=Symbol.for("effect/Equal");function Se(){return arguments.length===1?e=>$v(e,arguments[0]):$v(arguments[0],arguments[1])}function $v(e,t){if(e===t)return!0;const n=typeof e;if(n!==typeof t)return!1;if(n==="object"||n==="function"){if(e!==null&&t!==null){if(Tp(e)&&Tp(t))return de(e)===de(t)&&e[ze](t)?!0:ji.enabled&&ji.tester?ji.tester(e,t):!1;if(e instanceof Date&&t instanceof Date){const r=e.getTime(),i=t.getTime();return r===i||Number.isNaN(r)&&Number.isNaN(i)}else if(e instanceof URL&&t instanceof URL)return e.href===t.href}if(ji.enabled){if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((r,i)=>$v(r,t[i]));if(Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){const r=Object.keys(e),i=Object.keys(t);if(r.length===i.length){for(const a of r)if(!(a in t&&$v(e[a],t[a])))return ji.tester?ji.tester(e,t):!1;return!0}}return ji.tester?ji.tester(e,t):!1}}return ji.enabled&&ji.tester?ji.tester(e,t):!1}const Tp=e=>Re(e,ze),iR=()=>Se,lt=Symbol.for("nodejs.util.inspect.custom"),Jt=e=>{try{if(Re(e,"toJSON")&&nh(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(Jt)}catch{return{}}return aR(e)},m1="[Circular]";function I4(e){try{return e.toISOString()}catch{return"Invalid Date"}}function eee(e){try{const t=e.toString();return typeof t=="string"?t:String(t)}catch{return"[toString threw]"}}function AS(e){return Oi(e)?JSON.stringify(e):String(e)}function ks(e,t){const n=new WeakSet,r=(o,s)=>{const l=o==null?void 0:o.constructor;return l&&l!==Object.prototype.constructor&&l.name?`${l.name}(${s})`:s},i=o=>{try{return Reflect.ownKeys(o)}catch{return["[ownKeys threw]"]}};function a(o,s=0){if(Array.isArray(o))return n.has(o)?m1:(n.add(o),`[${o.map(l=>a(l,s)).join(",")}]`);if(A4(o))return I4(o);if(Re(o,"toString")&&nh(o.toString)&&o.toString!==Object.prototype.toString&&o.toString!==Array.prototype.toString){const l=eee(o);return o instanceof Error&&o.cause?`${l} (cause: ${a(o.cause,s)})`:l}if(Oi(o))return JSON.stringify(o);if(ps(o)||o==null||vd(o)||DE(o))return String(o);if(CS(o))return String(o)+"n";if(o instanceof Set||o instanceof Map)return n.has(o)?m1:(n.add(o),`${o.constructor.name}(${a(Array.from(o),s)})`);if(Oa(o)){if(n.has(o))return m1;n.add(o);const l=i(o);{const c=`{${l.map(f=>`${AS(f)}:${a(o[f],s)}`).join(",")}}`;return r(o,c)}}return String(o)}return a(e,0)}const Rt=e=>JSON.stringify(e,null,2),OS={toJSON(){return Jt(this)},[lt](){return this.toJSON()},toString(){return Rt(this.toJSON())}};let tee=class{[lt](){return this.toJSON()}toString(){return Rt(this.toJSON())}};const Sd=(e,t=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?$4(e,t):String(e)}catch{return String(e)}},$4=(e,t)=>{let n=[];const r=JSON.stringify(e,(i,a)=>typeof a=="object"&&a!==null?n.includes(a)?void 0:n.push(a)&&(Lc.fiberRefs!==void 0&&L4(a)?a[MS](Lc.fiberRefs):a):a,t);return n=void 0,r},MS=Symbol.for("effect/Inspectable/Redactable"),L4=e=>typeof e=="object"&&e!==null&&MS in e,Lc=je("effect/Inspectable/redactableState",()=>({fiberRefs:void 0})),nee=(e,t)=>{const n=Lc.fiberRefs;Lc.fiberRefs=e;try{return t()}finally{Lc.fiberRefs=n}},aR=e=>L4(e)&&Lc.fiberRefs!==void 0?e[MS](Lc.fiberRefs):e,he=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let r=0,i=t.length;r<i;r++)n=t[r](n);return n}}},Bm="Async",NS="Commit",Wn="Failure",Ob="OnFailure",Lv="OnSuccess",zv="OnSuccessAndFailure",Jn="Success",z4="Sync",ree="Tag",ih="UpdateRuntimeFlags",Pv="While",Hm="Iterator",P4="WithRuntime",Mb="Yield",oR="RevertFlags";let iee="3.19.19";const sR=()=>iee,aee=Symbol.for("effect/Effect"),oee=Symbol.for("effect/Stream"),see=Symbol.for("effect/Sink"),lee=Symbol.for("effect/Channel"),xd={_R:e=>e,_E:e=>e,_A:e=>e,_V:sR()},cee={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e},uee={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e},Cg={[aee]:xd,[oee]:xd,[see]:cee,[lee]:uee,[ze](e){return this===e},[Le](){return _t(this,nR(this))},[Symbol.iterator](){return new M4(new kg(this))},pipe(){return he(this,arguments)}},Tg={[Le](){return _t(this,j4(this))},[ze](e){const t=Object.keys(this),n=Object.keys(e);if(t.length!==n.length)return!1;for(const r of t)if(!(r in e&&Se(this[r],e[r])))return!1;return!0}},Rg={...Cg,_op:NS},fee={...Rg,...Tg},dee=function(){function e(){}return e.prototype=Rg,e}(),F4=Symbol.for("effect/Option"),U4={...Cg,[F4]:{_A:e=>e},[lt](){return this.toJSON()},toString(){return Rt(this.toJSON())}},hee=Object.assign(Object.create(U4),{_tag:"Some",_op:"Some",[ze](e){return lR(e)&&B4(e)&&Se(this.value,e.value)},[Le](){return _t(this,Pe(de(this._tag))(de(this.value)))},toJSON(){return{_id:"Option",_tag:this._tag,value:Jt(this.value)}}}),mee=de("None"),pee=Object.assign(Object.create(U4),{_tag:"None",_op:"None",[ze](e){return lR(e)&&cR(e)},[Le](){return mee},toJSON(){return{_id:"Option",_tag:this._tag}}}),lR=e=>Re(e,F4),cR=e=>e._tag==="None",B4=e=>e._tag==="Some",wd=Object.create(pee),Qo=e=>{const t=Object.create(hee);return t.value=e,t},H4=Symbol.for("effect/Context/Tag"),Fv=Symbol.for("effect/Context/Reference"),gee="effect/STM",yee=Symbol.for(gee),uR={...Cg,_op:"Tag",[yee]:xd,[H4]:{_Service:e=>e,_Identifier:e=>e},toString(){return Rt(this.toJSON())},toJSON(){return{_id:"Tag",key:this.key,stack:this.stack}},[lt](){return this.toJSON()},of(e){return e},context(e){return K4(this,e)}},bee={...uR,[Fv]:Fv},vee=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;Error.stackTraceLimit=t;const r=Object.create(uR);return Object.defineProperty(r,"stack",{get(){return n.stack}}),r.key=e,r},See=e=>()=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=2;const n=new Error;Error.stackTraceLimit=t;function r(){}return Object.setPrototypeOf(r,uR),r.key=e,Object.defineProperty(r,"stack",{get(){return n.stack}}),r},xee=()=>(e,t)=>{const n=Error.stackTraceLimit;Error.stackTraceLimit=2;const r=new Error;Error.stackTraceLimit=n;function i(){}return Object.setPrototypeOf(i,bee),i.key=e,i.defaultValue=t.defaultValue,Object.defineProperty(i,"stack",{get(){return r.stack}}),i},q4=Symbol.for("effect/Context"),wee={[q4]:{_Services:e=>e},[ze](e){if(V4(e)&&this.unsafeMap.size===e.unsafeMap.size){for(const t of this.unsafeMap.keys())if(!e.unsafeMap.has(t)||!Se(this.unsafeMap.get(t),e.unsafeMap.get(t)))return!1;return!0}return!1},[Le](){return _t(this,rR(this.unsafeMap.size))},pipe(){return he(this,arguments)},toString(){return Rt(this.toJSON())},toJSON(){return{_id:"Context",services:Array.from(this.unsafeMap).map(Jt)}},[lt](){return this.toJSON()}},Ol=e=>{const t=Object.create(wee);return t.unsafeMap=e,t},_ee=e=>{const t=new Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(e.stack){const n=e.stack.split(`
62
+ `);if(n.length>2){const r=n[2].match(/at (.*)/);r&&(t.message=t.message+` (defined at ${r[1]})`)}}if(t.stack){const n=t.stack.split(`
63
+ `);n.splice(1,3),t.stack=n.join(`
64
+ `)}return t},V4=e=>Re(e,q4),Eee=e=>Re(e,H4),kee=e=>Re(e,Fv),Cee=Ol(new Map),Tee=()=>Cee,K4=(e,t)=>Ol(new Map([[e.key,t]])),Ree=T(3,(e,t,n)=>{const r=new Map(e.unsafeMap);return r.set(t.key,n),Ol(r)}),p1=je("effect/Context/defaultValueCache",()=>new Map),fR=e=>{if(p1.has(e.key))return p1.get(e.key);const t=e.defaultValue();return p1.set(e.key,t),t},Aee=(e,t)=>e.unsafeMap.has(t.key)?e.unsafeMap.get(t.key):fR(t),G4=T(2,(e,t)=>{if(!e.unsafeMap.has(t.key)){if(Fv in t)return fR(t);throw _ee(t)}return e.unsafeMap.get(t.key)}),Oee=G4,Mee=T(2,(e,t)=>e.unsafeMap.has(t.key)?Qo(e.unsafeMap.get(t.key)):kee(t)?Qo(fR(t)):wd),Nee=T(2,(e,t)=>{const n=new Map(e.unsafeMap);for(const[r,i]of t.unsafeMap)n.set(r,i);return Ol(n)}),Dee=(...e)=>{const t=new Map;for(let n=0;n<e.length;n++)e[n].unsafeMap.forEach((r,i)=>{t.set(i,r)});return Ol(t)},Gl=vee,jee=Ol,Iee=V4,Y4=Eee,mo=Tee,dR=K4,Yi=Ree,ls=Oee,W4=G4,ah=Mee,ai=Nee,$ee=Dee,hR=See,oh=xee,DS=e=>(t,n)=>t===n||e(t,n),Lee=(e,t)=>e===t,zee=()=>Lee,Pee=zee(),J4=T(2,(e,t)=>DS((n,r)=>e(t(n),t(r)))),Fee=J4(Pee,e=>e.getTime()),Uee=e=>DS((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0}),mR=Symbol.for("effect/Either"),X4={...Cg,[mR]:{_R:e=>e},[lt](){return this.toJSON()},toString(){return Rt(this.toJSON())}},Bee=Object.assign(Object.create(X4),{_tag:"Right",_op:"Right",[ze](e){return pR(e)&&Q4(e)&&Se(this.right,e.right)},[Le](){return Pe(de(this._tag))(de(this.right))},toJSON(){return{_id:"Either",_tag:this._tag,right:Jt(this.right)}}}),Hee=Object.assign(Object.create(X4),{_tag:"Left",_op:"Left",[ze](e){return pR(e)&&gR(e)&&Se(this.left,e.left)},[Le](){return Pe(de(this._tag))(de(this.left))},toJSON(){return{_id:"Either",_tag:this._tag,left:Jt(this.left)}}}),pR=e=>Re(e,mR),gR=e=>e._tag==="Left",Q4=e=>e._tag==="Right",Z4=e=>{const t=Object.create(Hee);return t.left=e,t},e5=e=>{const t=Object.create(Bee);return t.right=e,t},qee=e=>gR(e)?wd:Qo(e.right),Vee=T(2,(e,t)=>cR(e)?Z4(t()):e5(e.value)),Kee=mR,Ne=e5,De=Z4,Gee=Vee,Yee=e=>{if(nh(e))try{return Ne(e())}catch(t){return De(t)}else try{return Ne(e.try())}catch(t){return De(e.catch(t))}},t5=pR,qn=gR,eo=Q4,Wee=T(2,(e,{onLeft:t,onRight:n})=>qn(e)?De(t(e.left)):Ne(n(e.right))),Jee=T(2,(e,t)=>qn(e)?De(t(e.left)):Ne(e.right)),Xee=T(2,(e,t)=>eo(e)?Ne(t(e.right)):De(e.left)),ti=T(2,(e,{onLeft:t,onRight:n})=>qn(e)?t(e.left):n(e.right)),Qee=ti({onLeft:ke,onRight:ke}),n5=T(2,(e,t)=>{if(eo(e))return e.right;throw t(e.left)}),r5=n5(()=>new Error("getOrThrow called on a Left")),i5=e=>e.length>0,a5=e=>(t,n)=>t===n?0:e(t,n),Zee=a5((e,t)=>e<t?-1:1),o5=T(2,(e,t)=>a5((n,r)=>e(t(n),t(r)))),ete=e=>T(2,(t,n)=>e(t,n)===1),tte=Symbol.for("effect/Option"),ne=()=>wd,ae=Qo,nte=lR,Vt=cR,Dt=B4,Mt=T(2,(e,{onNone:t,onSome:n})=>Vt(e)?t():n(e.value)),rte=qee,zt=T(2,(e,t)=>Vt(e)?t():e.value),ka=T(2,(e,t)=>Vt(e)?t():e),ite=T(2,(e,t)=>Vt(e)?ae(t()):e),sh=e=>e==null?ne():ae(e),ate=zt(DZ),Bi=zt(R4),ote=e=>(...t)=>{try{return ae(e(...t))}catch{return ne()}},s5=T(2,(e,t)=>{if(Dt(e))return e.value;throw t()}),ste=s5(()=>new Error("getOrThrow called on a None")),ni=T(2,(e,t)=>Vt(e)?ne():ae(t(e.value))),Cs=T(2,(e,t)=>Vt(e)?ne():t(e.value)),l5=T(2,(e,t)=>Vt(e)?ne():sh(t(e.value))),lte=Cs,sf=T(2,(e,t)=>lte(e,n=>t(n)?Qo(n):wd)),cte=e=>DS((t,n)=>Vt(t)?Vt(n):Vt(n)?!1:e(t.value,n.value)),ute=e=>T(2,(t,n)=>Vt(t)?!1:e(t.value,n)),fte=iR(),dte=ute(fte),hte=T(2,(e,t)=>Vt(e)?!1:t(e.value)),mte=(...e)=>e,pte=()=>({}),gte=e=>c5(e).length===0,Of=T(2,(e,t)=>{const n={...e};for(const r of c5(e))n[r]=t(e[r],r);return n}),c5=e=>Object.keys(e),yte=T(3,(e,t,n)=>({...e,[t]:n})),jS=e=>new Array(e),bte=T(2,(e,t)=>{const n=Math.max(1,Math.floor(e)),r=new Array(n);for(let i=0;i<n;i++)r[i]=t(i);return r}),gt=e=>Array.isArray(e)?e:Array.from(e),vte=e=>Array.isArray(e)?e:[e],Ste=T(2,(e,{onEmpty:t,onNonEmpty:n})=>on(e)?n($r(e),Jc(e)):t()),Uv=T(2,(e,t)=>[t,...e]),xte=T(2,(e,t)=>[...e,t]),yR=T(2,(e,t)=>gt(e).concat(gt(t))),wte=Array.isArray,_te=e=>e.length===0,Ete=_te,Vf=i5,on=i5,u5=(e,t)=>e<0||e>=t.length,kte=(e,t)=>Math.floor(Math.min(Math.max(0,e),t.length)),Cte=T(2,(e,t)=>{const n=Math.floor(t);return u5(n,e)?ne():ae(e[n])}),f5=T(2,(e,t)=>{const n=Math.floor(t);if(u5(n,e))throw new Error(`Index ${n} out of bounds`);return e[n]}),qm=Cte(0),$r=f5(0),Tte=e=>on(e)?ae(d5(e)):ne(),d5=e=>e[e.length-1],Jc=e=>e.slice(1),Rte=(e,t)=>{let n=0;for(const r of e){if(!t(r,n))break;n++}return n},Ate=T(2,(e,t)=>h5(e,Rte(e,t))),Ote=T(2,(e,t)=>{const n=gt(e);return n.slice(kte(t,n),n.length)}),VN=e=>Array.from(e).reverse(),Rp=T(2,(e,t)=>{const n=Array.from(e);return n.sort(t),n}),KN=T(2,(e,t)=>Mte(e,t,mte)),Mte=T(3,(e,t,n)=>{const r=gt(e),i=gt(t);if(on(r)&&on(i)){const a=[n($r(r),$r(i))],o=Math.min(r.length,i.length);for(let s=1;s<o;s++)a[s]=n(r[s],i[s]);return a}return[]}),Nte=iR(),h5=T(2,(e,t)=>{const n=Array.from(e),r=Math.floor(t);return on(n)?r>=1?Dte(n,r):[[],n]:[n,[]]}),Dte=T(2,(e,t)=>{const n=Math.max(1,Math.floor(t));return n>=e.length?[mm(e),[]]:[Uv(e.slice(1,n),$r(e)),e.slice(n)]}),mm=e=>e.slice(),jte=T(3,(e,t,n)=>{const r=gt(e),i=gt(t);return on(r)?on(i)?p5(n)(yR(r,i)):r:i}),Nb=T(2,(e,t)=>jte(e,t,Nte)),Ml=()=>[],ga=e=>[e],zc=T(2,(e,t)=>e.map(t)),Bv=T(2,(e,t)=>{if(Ete(e))return[];const n=[];for(let r=0;r<e.length;r++){const i=t(e[r],r);for(let a=0;a<i.length;a++)n.push(i[a])}return n}),m5=Bv(ke),Ite=T(2,(e,t)=>{const n=gt(e),r=[];for(let i=0;i<n.length;i++){const a=t(n[i],i);Dt(a)&&r.push(a.value)}return r}),$te=T(2,(e,t)=>{const n=gt(e),r=[];for(let i=0;i<n.length;i++)t(n[i],i)&&r.push(n[i]);return r}),bR=T(3,(e,t,n)=>gt(e).reduce((r,i,a)=>n(r,i,a),t)),GN=(e,t)=>{const n=[];let r=e,i;for(;Dt(i=t(r));){const[a,o]=i.value;n.push(a),r=o}return n},IS=Uee,p5=T(2,(e,t)=>{const n=gt(e);if(on(n)){const r=[$r(n)],i=Jc(n);for(const a of i)r.every(o=>!t(a,o))&&r.push(a);return r}return[]}),Lte=e=>p5(e,iR()),lh=T(2,(e,t)=>gt(e).join(t)),g5=Symbol.for("effect/Chunk");function zte(e,t,n,r,i){for(let a=t;a<Math.min(e.length,t+i);a++)n[r+a-t]=e[a];return n}const y5=[],b5=e=>DS((t,n)=>t.length===n.length&&Lr(t).every((r,i)=>e(r,gl(n,i)))),Pte=b5(Se),Fte={[g5]:{_A:e=>e},toString(){return Rt(this.toJSON())},toJSON(){return{_id:"Chunk",values:Lr(this).map(Jt)}},[lt](){return this.toJSON()},[ze](e){return $S(e)&&Pte(this,e)},[Le](){return _t(this,rh(Lr(this)))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return y5[Symbol.iterator]();default:return Lr(this)[Symbol.iterator]()}},pipe(){return he(this,arguments)}},en=e=>{const t=Object.create(Fte);switch(t.backing=e,e._tag){case"IEmpty":{t.length=0,t.depth=0,t.left=t,t.right=t;break}case"IConcat":{t.length=e.left.length+e.right.length,t.depth=1+Math.max(e.left.depth,e.right.depth),t.left=e.left,t.right=e.right;break}case"IArray":{t.length=e.array.length,t.depth=0,t.left=ya,t.right=ya;break}case"ISingleton":{t.length=1,t.depth=0,t.left=ya,t.right=ya;break}case"ISlice":{t.length=e.length,t.depth=e.chunk.depth+1,t.left=ya,t.right=ya;break}}return t},$S=e=>Re(e,g5),ya=en({_tag:"IEmpty"}),Ln=()=>ya,g1=(...e)=>Hte(e),Cn=e=>en({_tag:"ISingleton",a:e}),gs=e=>$S(e)?e:Mr(gt(e)),IE=(e,t,n)=>{switch(e.backing._tag){case"IArray":{zte(e.backing.array,0,t,n,e.length);break}case"IConcat":{IE(e.left,t,n),IE(e.right,t,n+e.left.length);break}case"ISingleton":{t[n]=e.backing.a;break}case"ISlice":{let r=0,i=n;for(;r<e.length;)t[i]=gl(e,r),r+=1,i+=1;break}}},Ute=e=>{switch(e.backing._tag){case"IEmpty":return y5;case"IArray":return e.backing.array;default:{const t=new Array(e.length);return IE(e,t,0),e.backing={_tag:"IArray",array:t},e.left=ya,e.right=ya,e.depth=0,t}}},Lr=Ute,Bte=e=>{switch(e.backing._tag){case"IEmpty":case"ISingleton":return e;case"IArray":return en({_tag:"IArray",array:VN(e.backing.array)});case"IConcat":return en({_tag:"IConcat",left:ys(e.backing.right),right:ys(e.backing.left)});case"ISlice":return Mr(VN(Lr(e)))}},ys=Bte,v5=T(2,(e,t)=>t<0||t>=e.length?ne():ae(gl(e,t))),Mr=e=>e.length===0?Ln():e.length===1?Cn(e[0]):en({_tag:"IArray",array:e}),Hte=e=>Mr(e),gl=T(2,(e,t)=>{switch(e.backing._tag){case"IEmpty":throw new Error("Index out of bounds");case"ISingleton":{if(t!==0)throw new Error("Index out of bounds");return e.backing.a}case"IArray":{if(t>=e.length||t<0)throw new Error("Index out of bounds");return e.backing.array[t]}case"IConcat":return t<e.left.length?gl(e.left,t):gl(e.right,t-e.left.length);case"ISlice":return gl(e.backing.chunk,t+e.backing.offset)}}),$E=T(2,(e,t)=>wn(e,Cn(t))),Er=T(2,(e,t)=>wn(Cn(t),e)),Hv=T(2,(e,t)=>{if(t<=0)return ya;if(t>=e.length)return e;switch(e.backing._tag){case"ISlice":return en({_tag:"ISlice",chunk:e.backing.chunk,length:t,offset:e.backing.offset});case"IConcat":return t>e.left.length?en({_tag:"IConcat",left:e.left,right:Hv(e.right,t-e.left.length)}):Hv(e.left,t);default:return en({_tag:"ISlice",chunk:e,offset:0,length:t})}}),rl=T(2,(e,t)=>{if(t<=0)return e;if(t>=e.length)return ya;switch(e.backing._tag){case"ISlice":return en({_tag:"ISlice",chunk:e.backing.chunk,offset:e.backing.offset+t,length:e.backing.length-t});case"IConcat":return t>e.left.length?rl(e.right,t-e.left.length):en({_tag:"IConcat",left:rl(e.left,t),right:e.right});default:return en({_tag:"ISlice",chunk:e,offset:t,length:e.length-t})}}),wn=T(2,(e,t)=>{if(e.backing._tag==="IEmpty")return t;if(t.backing._tag==="IEmpty")return e;const n=t.depth-e.depth;if(Math.abs(n)<=1)return en({_tag:"IConcat",left:e,right:t});if(n<-1)if(e.left.depth>=e.right.depth){const r=wn(e.right,t);return en({_tag:"IConcat",left:e.left,right:r})}else{const r=wn(e.right.right,t);if(r.depth===e.depth-3){const i=en({_tag:"IConcat",left:e.right.left,right:r});return en({_tag:"IConcat",left:e.left,right:i})}else{const i=en({_tag:"IConcat",left:e.left,right:e.right.left});return en({_tag:"IConcat",left:i,right:r})}}else if(t.right.depth>=t.left.depth){const r=wn(e,t.left);return en({_tag:"IConcat",left:r,right:t.right})}else{const r=wn(e,t.left.left);if(r.depth===t.depth-3){const i=en({_tag:"IConcat",left:r,right:t.left.right});return en({_tag:"IConcat",left:i,right:t.right})}else{const i=en({_tag:"IConcat",left:t.left.right,right:t.right});return en({_tag:"IConcat",left:r,right:i})}}}),vR=T(2,(e,t)=>Mr($te(e,t))),LS=e=>e.length===0,bs=e=>e.length>0,SR=v5(0),xR=e=>gl(e,0),to=xR,qte=e=>v5(e,e.length-1),Vte=T(2,(e,t)=>e.backing._tag==="ISingleton"?Cn(t(e.backing.a,0)):Mr(N(Lr(e),zc((n,r)=>t(n,r))))),Zo=e=>rl(e,1),Kte=T(2,(e,t)=>rl(e,e.length-t)),Gte=bR,Xc=5,wR=Math.pow(2,Xc),Yte=wR-1,Wte=wR/2,Jte=wR/4;function Xte(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function _d(e,t){return t>>>e&Yte}function Mf(e){return 1<<e}function S5(e,t){return Xte(e&t-1)}const Qte=(e,t)=>({value:e,previous:t});function Kf(e,t,n,r){let i=r;if(!e){const a=r.length;i=new Array(a);for(let o=0;o<a;++o)i[o]=r[o]}return i[t]=n,i}function x5(e,t,n){const r=n.length-1;let i=0,a=0,o=n;if(e)i=a=t;else for(o=new Array(r);i<t;)o[a++]=n[i++];for(++i;i<=r;)o[a++]=n[i++];return e&&(o.length=r),o}function Zte(e,t,n,r){const i=r.length;if(e){let l=i;for(;l>=t;)r[l--]=r[l];return r[t]=n,r}let a=0,o=0;const s=new Array(i+1);for(;a<t;)s[o++]=r[a++];for(s[t]=n;a<i;)s[++o]=r[a++];return s}class Nl{constructor(){S(this,"_tag","EmptyNode")}modify(t,n,r,i,a,o){const s=r(ne());return Vt(s)?new Nl:(++o.value,new Pc(t,i,a,s))}}function wa(e){return tR(e,"EmptyNode")}function ene(e){return wa(e)||e._tag==="LeafNode"||e._tag==="CollisionNode"}function zS(e,t){return wa(e)?!1:t===e.edit}class Pc{constructor(t,n,r,i){S(this,"edit");S(this,"hash");S(this,"key");S(this,"value");S(this,"_tag","LeafNode");this.edit=t,this.hash=n,this.key=r,this.value=i}modify(t,n,r,i,a,o){if(Se(a,this.key)){const l=r(this.value);return l===this.value?this:Vt(l)?(--o.value,new Nl):zS(this,t)?(this.value=l,this):new Pc(t,i,a,l)}const s=r(ne());return Vt(s)?this:(++o.value,w5(t,n,this.hash,this,i,new Pc(t,i,a,s)))}}class _R{constructor(t,n,r){S(this,"edit");S(this,"hash");S(this,"children");S(this,"_tag","CollisionNode");this.edit=t,this.hash=n,this.children=r}modify(t,n,r,i,a,o){if(i===this.hash){const l=zS(this,t),c=this.updateCollisionList(l,t,this.hash,this.children,r,a,o);return c===this.children?this:c.length>1?new _R(t,this.hash,c):c[0]}const s=r(ne());return Vt(s)?this:(++o.value,w5(t,n,this.hash,this,i,new Pc(t,i,a,s)))}updateCollisionList(t,n,r,i,a,o,s){const l=i.length;for(let f=0;f<l;++f){const u=i[f];if("key"in u&&Se(o,u.key)){const d=u.value,h=a(d);return h===d?i:Vt(h)?(--s.value,x5(t,f,i)):Kf(t,f,new Pc(n,r,o,h),i)}}const c=a(ne());return Vt(c)?i:(++s.value,Kf(t,l,new Pc(n,r,o,c),i))}}class Ed{constructor(t,n,r){S(this,"edit");S(this,"mask");S(this,"children");S(this,"_tag","IndexedNode");this.edit=t,this.mask=n,this.children=r}modify(t,n,r,i,a,o){const s=this.mask,l=this.children,c=_d(n,i),f=Mf(c),u=S5(s,f),d=s&f,h=zS(this,t);if(!d){const v=new Nl().modify(t,n+Xc,r,i,a,o);return v?l.length>=Wte?nne(t,c,v,s,l):new Ed(t,s|f,Zte(h,u,v,l)):this}const m=l[u],b=m.modify(t,n+Xc,r,i,a,o);if(m===b)return this;let w=s,g;if(wa(b)){if(w&=~f,!w)return new Nl;if(l.length<=2&&ene(l[u^1]))return l[u^1];g=x5(h,u,l)}else g=Kf(h,u,b,l);return h?(this.mask=w,this.children=g,this):new Ed(t,w,g)}}class ER{constructor(t,n,r){S(this,"edit");S(this,"size");S(this,"children");S(this,"_tag","ArrayNode");this.edit=t,this.size=n,this.children=r}modify(t,n,r,i,a,o){let s=this.size;const l=this.children,c=_d(n,i),f=l[c],u=(f||new Nl).modify(t,n+Xc,r,i,a,o);if(f===u)return this;const d=zS(this,t);let h;if(wa(f)&&!wa(u))++s,h=Kf(d,c,u,l);else if(!wa(f)&&wa(u)){if(--s,s<=Jte)return tne(t,s,c,l);h=Kf(d,c,new Nl,l)}else h=Kf(d,c,u,l);return d?(this.size=s,this.children=h,this):new ER(t,s,h)}}function tne(e,t,n,r){const i=new Array(t-1);let a=0,o=0;for(let s=0,l=r.length;s<l;++s)if(s!==n){const c=r[s];c&&!wa(c)&&(i[a++]=c,o|=1<<s)}return new Ed(e,o,i)}function nne(e,t,n,r,i){const a=[];let o=r,s=0;for(let l=0;o;++l)o&1&&(a[l]=i[s++]),o>>>=1;return a[t]=n,new ER(e,s+1,a)}function rne(e,t,n,r,i,a){if(n===i)return new _R(e,n,[a,r]);const o=_d(t,n),s=_d(t,i);if(o===s)return l=>new Ed(e,Mf(o)|Mf(s),[l]);{const l=o<s?[r,a]:[a,r];return new Ed(e,Mf(o)|Mf(s),l)}}function w5(e,t,n,r,i,a){let o,s=t;for(;;){const l=rne(e,s,n,r,i,a);if(typeof l=="function")o=Qte(l,o),s=s+Xc;else{let c=l;for(;o!=null;)c=o.value(c),o=o.previous;return c}}}const _5="effect/HashMap",LE=Symbol.for(_5),ine={[LE]:LE,[Symbol.iterator](){return new PS(this,(e,t)=>[e,t])},[Le](){let e=de(_5);for(const t of this)e^=N(de(t[0]),Pe(de(t[1])));return _t(this,e)},[ze](e){if(sne(e)){if(e._size!==this._size)return!1;for(const t of this){const n=N(e,CR(t[0],de(t[0])));if(Vt(n))return!1;if(!Se(t[1],n.value))return!1}return!0}return!1},toString(){return Rt(this.toJSON())},toJSON(){return{_id:"HashMap",values:Array.from(this).map(Jt)}},[lt](){return this.toJSON()},pipe(){return he(this,arguments)}},kR=(e,t,n,r)=>{const i=Object.create(ine);return i._editable=e,i._edit=t,i._root=n,i._size=r,i};class PS{constructor(t,n){S(this,"map");S(this,"f");S(this,"v");this.map=t,this.f=n,this.v=E5(this.map._root,this.f,void 0)}next(){if(Vt(this.v))return{done:!0,value:void 0};const t=this.v.value;return this.v=qv(t.cont),{done:!1,value:t.value}}[Symbol.iterator](){return new PS(this.map,this.f)}}const qv=e=>e?k5(e[0],e[1],e[2],e[3],e[4]):ne(),E5=(e,t,n=void 0)=>{switch(e._tag){case"LeafNode":return Dt(e.value)?ae({value:t(e.key,e.value.value),cont:n}):qv(n);case"CollisionNode":case"ArrayNode":case"IndexedNode":{const r=e.children;return k5(r.length,r,0,t,n)}default:return qv(n)}},k5=(e,t,n,r,i)=>{for(;n<e;){const a=t[n++];if(a&&!wa(a))return E5(a,r,[e,t,n,r,i])}return qv(i)},ane=kR(!1,0,new Nl,0),FS=()=>ane,one=e=>{const t=T5(FS());for(const n of e)Ap(t,n[0],n[1]);return dne(t)},sne=e=>Re(e,LE),lne=e=>e&&wa(e._root),cne=T(2,(e,t)=>CR(e,t,de(t))),CR=T(3,(e,t,n)=>{let r=e._root,i=0;for(;;)switch(r._tag){case"LeafNode":return Se(t,r.key)?r.value:ne();case"CollisionNode":{if(n===r.hash){const a=r.children;for(let o=0,s=a.length;o<s;++o){const l=a[o];if("key"in l&&Se(t,l.key))return l.value}}return ne()}case"IndexedNode":{const a=_d(i,n),o=Mf(a);if(r.mask&o){r=r.children[S5(r.mask,o)],i+=Xc;break}return ne()}case"ArrayNode":{if(r=r.children[_d(i,n)],r){i+=Xc;break}return ne()}default:return ne()}}),une=T(2,(e,t)=>Dt(CR(e,t,de(t)))),Ap=T(3,(e,t,n)=>TR(e,t,()=>ae(n))),fne=T(3,(e,t,n)=>e._editable?(e._root=t,e._size=n,e):t===e._root?e:kR(e._editable,e._edit,t,n)),C5=e=>new PS(e,t=>t),zE=e=>e._size,T5=e=>kR(!0,e._edit+1,e._root,e._size),dne=e=>(e._editable=!1,e),TR=T(3,(e,t,n)=>hne(e,t,de(t),n)),hne=T(4,(e,t,n,r)=>{const i={value:e._size},a=e._root.modify(e._editable?e._edit:NaN,0,r,n,t,i);return N(e,fne(a,i.value))}),YN=T(2,(e,t)=>TR(e,t,ne)),mne=T(2,(e,t)=>US(e,FS(),(n,r,i)=>Ap(n,i,t(r,i)))),R5=T(2,(e,t)=>US(e,void 0,(n,r,i)=>t(r,i))),US=T(3,(e,t,n)=>{const r=e._root;if(r._tag==="LeafNode")return Dt(r.value)?n(t,r.value.value,r.key):t;if(r._tag==="EmptyNode")return t;const i=[r.children];let a;for(;a=i.pop();)for(let o=0,s=a.length;o<s;){const l=a[o++];l&&!wa(l)&&(l._tag==="LeafNode"?Dt(l.value)&&(t=n(t,l.value.value,l.key)):i.push(l.children))}return t}),A5="effect/HashSet",PE=Symbol.for(A5),pne={[PE]:PE,[Symbol.iterator](){return C5(this._keyMap)},[Le](){return _t(this,Pe(de(this._keyMap))(de(A5)))},[ze](e){return gne(e)?zE(this._keyMap)===zE(e._keyMap)&&Se(this._keyMap,e._keyMap):!1},toString(){return Rt(this.toJSON())},toJSON(){return{_id:"HashSet",values:Array.from(this).map(Jt)}},[lt](){return this.toJSON()},pipe(){return he(this,arguments)}},BS=e=>{const t=Object.create(pne);return t._keyMap=e,t},gne=e=>Re(e,PE),yne=BS(FS()),HS=()=>yne,bne=e=>{const t=RR(HS());for(const n of e)Op(t,n);return AR(t)},vne=(...e)=>{const t=RR(HS());for(const n of e)Op(t,n);return AR(t)},Sne=T(2,(e,t)=>une(e._keyMap,t)),xne=e=>zE(e._keyMap),RR=e=>BS(T5(e._keyMap)),AR=e=>(e._keyMap._editable=!1,e),O5=T(2,(e,t)=>{const n=RR(e);return t(n),AR(n)}),Op=T(2,(e,t)=>e._keyMap._editable?(Ap(t,!0)(e._keyMap),e):BS(Ap(t,!0)(e._keyMap))),M5=T(2,(e,t)=>e._keyMap._editable?(YN(t)(e._keyMap),e):BS(YN(t)(e._keyMap))),wne=T(2,(e,t)=>O5(e,n=>{for(const r of t)M5(n,r)})),_ne=T(2,(e,t)=>O5(HS(),n=>{Ene(e,r=>Op(n,r));for(const r of t)Op(n,r)})),Ene=T(2,(e,t)=>R5(e._keyMap,(n,r)=>t(r))),kne=T(3,(e,t,n)=>US(e._keyMap,t,(r,i,a)=>n(r,a))),Qc=HS,Cne=bne,OR=vne,N5=Sne,MR=xne,Vm=Op,D5=M5,WN=wne,Mp=_ne,Np=kne,Eu="Die",Zc="Empty",ku="Fail",ch="Interrupt",kd="Parallel",Cd="Sequential",j5="effect/Cause",I5=Symbol.for(j5),Tne={_E:e=>e},uh={[I5]:Tne,[Le](){return N(de(j5),Pe(de(Pne(this))),_t(this))},[ze](e){return Rne(e)&&zne(this,e)},pipe(){return he(this,arguments)},toJSON(){switch(this._tag){case"Empty":return{_id:"Cause",_tag:this._tag};case"Die":return{_id:"Cause",_tag:this._tag,defect:Jt(this.defect)};case"Interrupt":return{_id:"Cause",_tag:this._tag,fiberId:this.fiberId.toJSON()};case"Fail":return{_id:"Cause",_tag:this._tag,failure:Jt(this.error)};case"Sequential":case"Parallel":return{_id:"Cause",_tag:this._tag,left:Jt(this.left),right:Jt(this.right)}}},toString(){return fh(this)},[lt](){return this.toJSON()}},Dl=(()=>{const e=Object.create(uh);return e._tag=Zc,e})(),eu=e=>{const t=Object.create(uh);return t._tag=ku,t.error=e,t},Qi=e=>{const t=Object.create(uh);return t._tag=Eu,t.defect=e,t},va=e=>{const t=Object.create(uh);return t._tag=ch,t.fiberId=e,t},jl=(e,t)=>{const n=Object.create(uh);return n._tag=kd,n.left=e,n.right=t,n},vr=(e,t)=>{const n=Object.create(uh);return n._tag=Cd,n.left=e,n.right=t,n},Rne=e=>Re(e,I5),Ane=e=>e._tag===Zc,One=e=>e._tag===ku,$5=e=>e._tag===Eu,Mne=e=>e._tag===Zc?!0:Td(e,!0,(t,n)=>{switch(n._tag){case Zc:return ae(t);case Eu:case ku:case ch:return ae(!1);default:return ne()}}),L5=e=>Dt(jne(e)),qS=e=>KS(void 0,Une)(e),Nne=e=>ys(Td(e,Ln(),(t,n)=>n._tag===ku?ae(N(t,Er(n.error))):ne())),z5=e=>ys(Td(e,Ln(),(t,n)=>n._tag===Eu?ae(N(t,Er(n.defect))):ne())),NR=e=>Td(e,Qc(),(t,n)=>n._tag===ch?ae(N(t,Vm(n.fiberId))):ne()),DR=e=>VS(e,t=>t._tag===ku?ae(t.error):ne()),P5=e=>{const t=DR(e);switch(t._tag){case"None":return Ne(e);case"Some":return De(t.value)}},Dne=e=>VS(e,t=>t._tag===Eu?ae(t.defect):ne()),jne=e=>VS(e,t=>t._tag===ch?ae(t.fiberId):ne()),JN=e=>jR(e,{onEmpty:Dl,onFail:()=>Dl,onDie:Qi,onInterrupt:va,onSequential:vr,onParallel:jl}),Ine=e=>jR(e,{onEmpty:Dl,onFail:Qi,onDie:Qi,onInterrupt:va,onSequential:vr,onParallel:jl}),$ne=T(2,(e,t)=>Lne(e,n=>eu(t(n)))),Lne=T(2,(e,t)=>jR(e,{onEmpty:Dl,onFail:n=>t(n),onDie:n=>Qi(n),onInterrupt:n=>va(n),onSequential:(n,r)=>vr(n,r),onParallel:(n,r)=>jl(n,r)})),zne=(e,t)=>{let n=Cn(e),r=Cn(t);for(;bs(n)&&bs(r);){const[i,a]=N(to(n),Td([Qc(),Ln()],([l,c],f)=>{const[u,d]=FE(f);return ae([N(l,Mp(u)),N(c,wn(d))])})),[o,s]=N(to(r),Td([Qc(),Ln()],([l,c],f)=>{const[u,d]=FE(f);return ae([N(l,Mp(u)),N(c,wn(d))])}));if(!Se(i,o))return!1;n=a,r=s}return!0},Pne=e=>Fne(Cn(e),Ln()),Fne=(e,t)=>{for(;;){const[n,r]=N(e,bR([Qc(),Ln()],([a,o],s)=>{const[l,c]=FE(s);return[N(a,Mp(l)),N(o,wn(c))]})),i=MR(n)>0?N(t,Er(n)):t;if(LS(r))return ys(i);e=r,t=i}throw new Error(TS("Cause.flattenCauseLoop"))},VS=T(2,(e,t)=>{const n=[e];for(;n.length>0;){const r=n.pop(),i=t(r);switch(i._tag){case"None":{switch(r._tag){case Cd:case kd:{n.push(r.right),n.push(r.left);break}}break}case"Some":return i}}return ne()}),FE=e=>{let t=e;const n=[];let r=Qc(),i=Ln();for(;t!==void 0;)switch(t._tag){case Zc:{if(n.length===0)return[r,i];t=n.pop();break}case ku:{if(r=Vm(r,g1(t._tag,t.error)),n.length===0)return[r,i];t=n.pop();break}case Eu:{if(r=Vm(r,g1(t._tag,t.defect)),n.length===0)return[r,i];t=n.pop();break}case ch:{if(r=Vm(r,g1(t._tag,t.fiberId)),n.length===0)return[r,i];t=n.pop();break}case Cd:{switch(t.left._tag){case Zc:{t=t.right;break}case Cd:{t=vr(t.left.left,vr(t.left.right,t.right));break}case kd:{t=jl(vr(t.left.left,t.right),vr(t.left.right,t.right));break}default:{i=Er(i,t.right),t=t.left;break}}break}case kd:{n.push(t.right),t=t.left;break}}throw new Error(TS("Cause.evaluateCauseLoop"))},Une={emptyCase:NE,failCase:pl,dieCase:pl,interruptCase:NE,sequentialCase:(e,t,n)=>t&&n,parallelCase:(e,t,n)=>t&&n},XN="SequentialCase",QN="ParallelCase",jR=T(2,(e,{onDie:t,onEmpty:n,onFail:r,onInterrupt:i,onParallel:a,onSequential:o})=>KS(e,void 0,{emptyCase:()=>n,failCase:(s,l)=>r(l),dieCase:(s,l)=>t(l),interruptCase:(s,l)=>i(l),sequentialCase:(s,l,c)=>o(l,c),parallelCase:(s,l,c)=>a(l,c)})),Td=T(3,(e,t,n)=>{let r=t,i=e;const a=[];for(;i!==void 0;){const o=n(r,i);switch(r=Dt(o)?o.value:r,i._tag){case Cd:{a.push(i.right),i=i.left;break}case kd:{a.push(i.right),i=i.left;break}default:{i=void 0;break}}i===void 0&&a.length>0&&(i=a.pop())}return r}),KS=T(3,(e,t,n)=>{const r=[e],i=[];for(;r.length>0;){const o=r.pop();switch(o._tag){case Zc:{i.push(Ne(n.emptyCase(t)));break}case ku:{i.push(Ne(n.failCase(t,o.error)));break}case Eu:{i.push(Ne(n.dieCase(t,o.defect)));break}case ch:{i.push(Ne(n.interruptCase(t,o.fiberId)));break}case Cd:{r.push(o.right),r.push(o.left),i.push(De({_tag:XN}));break}case kd:{r.push(o.right),r.push(o.left),i.push(De({_tag:QN}));break}}}const a=[];for(;i.length>0;){const o=i.pop();switch(o._tag){case"Left":{switch(o.left._tag){case XN:{const s=a.pop(),l=a.pop(),c=n.sequentialCase(t,s,l);a.push(c);break}case QN:{const s=a.pop(),l=a.pop(),c=n.parallelCase(t,s,l);a.push(c);break}}break}case"Right":{a.push(o.right);break}}}if(a.length===0)throw new Error("BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues");return a.pop()}),fh=(e,t)=>qS(e)?"All fibers interrupted without errors.":U5(e).map(function(n){return(t==null?void 0:t.renderErrorCause)!==!0||n.cause===void 0?n.stack:`${n.stack} {
65
+ ${F5(n.cause," ")}
66
+ }`}).join(`
67
+ `),F5=(e,t)=>{const n=e.stack.split(`
68
+ `);let r=`${t}[cause]: ${n[0]}`;for(let i=1,a=n.length;i<a;i++)r+=`
69
+ ${t}${n[i]}`;return e.cause&&(r+=` {
70
+ ${F5(e.cause,`${t} `)}
71
+ ${t}}`),r};class Vv extends globalThis.Error{constructor(n){const r=typeof n=="object"&&n!==null,i=Error.stackTraceLimit;Error.stackTraceLimit=1;super(Bne(n),r&&"cause"in n&&typeof n.cause<"u"?{cause:new Vv(n.cause)}:void 0);S(this,"span");this.message===""&&(this.message="An error has occurred"),Error.stackTraceLimit=i,this.name=n instanceof Error?n.name:"Error",r&&(Rd in n&&(this.span=n[Rd]),Object.keys(n).forEach(a=>{a in this||(this[a]=n[a])})),this.stack=qne(`${this.name}: ${this.message}`,n instanceof Error&&n.stack?n.stack:"",this.span)}}const Bne=e=>{if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&e instanceof Error)return e.message;try{if(Re(e,"toString")&&nh(e.toString)&&e.toString!==Object.prototype.toString&&e.toString!==globalThis.Array.prototype.toString)return e.toString()}catch{}return $4(e)},Hne=/\((.*)\)/g,Kv=je("effect/Tracer/spanToTrace",()=>new WeakMap),qne=(e,t,n)=>{const r=[e],i=t.startsWith(e)?t.slice(e.length).split(`
72
+ `):t.split(`
73
+ `);for(let a=1;a<i.length;a++){if(i[a].includes(" at new BaseEffectError")||i[a].includes(" at new YieldableError")){a++;continue}if(i[a].includes("Generator.next")||i[a].includes("effect_internal_function"))break;r.push(i[a].replace(/at .*effect_instruction_i.*\((.*)\)/,"at $1").replace(/EffectPrimitive\.\w+/,"<anonymous>"))}if(n){let a=n,o=0;for(;a&&a._tag==="Span"&&o<10;){const s=Kv.get(a);if(typeof s=="function"){const l=s();if(typeof l=="string"){const c=l.matchAll(Hne);let f=!1;for(const[,u]of c)f=!0,r.push(` at ${a.name} (${u})`);f||r.push(` at ${a.name} (${l.replace(/^at /,"")})`)}else r.push(` at ${a.name}`)}else r.push(` at ${a.name}`);a=Bi(a.parent),o++}}return r.join(`
74
+ `)},Rd=Symbol.for("effect/SpanAnnotation"),U5=e=>KS(e,void 0,{emptyCase:()=>[],dieCase:(t,n)=>[new Vv(n)],failCase:(t,n)=>[new Vv(n)],interruptCase:()=>[],parallelCase:(t,n,r)=>[...n,...r],sequentialCase:(t,n,r)=>[...n,...r]}),UE=Symbol.for("effect/Duration"),B5=BigInt(0),ZN=BigInt(24),By=BigInt(60),BE=BigInt(1e3),eD=BigInt(1e6),tD=BigInt(1e9),Vne=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,ra=e=>{if(H5(e))return e;if(ps(e))return Od(e);if(CS(e))return y1(e);if(Array.isArray(e)&&e.length===2&&e.every(ps))return e[0]===-1/0||e[1]===-1/0||Number.isNaN(e[0])||Number.isNaN(e[1])?Ad:e[0]===1/0||e[1]===1/0?Wne:y1(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])));if(Oi(e)){const t=Vne.exec(e);if(t){const[n,r,i]=t,a=Number(r);switch(i){case"nano":case"nanos":return y1(BigInt(r));case"micro":case"micros":return Jne(BigInt(r));case"milli":case"millis":return Od(a);case"second":case"seconds":return V5(a);case"minute":case"minutes":return Xne(a);case"hour":case"hours":return Qne(a);case"day":case"days":return Zne(a);case"week":case"weeks":return ere(a)}}}throw new Error("Invalid DurationInput")},nD={_tag:"Millis",millis:0},Kne={_tag:"Infinity"},Gne={[UE]:UE,[Le](){return _t(this,j4(this.value))},[ze](e){return H5(e)&&sre(this,e)},toString(){return`Duration(${cre(this)})`},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",hrtime:nre(this)};case"Infinity":return{_id:"Duration",_tag:"Infinity"}}},[lt](){return this.toJSON()},pipe(){return he(this,arguments)}},wo=e=>{const t=Object.create(Gne);return ps(e)?isNaN(e)||e<=0?t.value=nD:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:"Millis",millis:e}:t.value={_tag:"Nanos",nanos:BigInt(Math.round(e*1e6))}:t.value=Kne:e<=B5?t.value=nD:t.value={_tag:"Nanos",nanos:e},t},H5=e=>Re(e,UE),q5=e=>e.value._tag!=="Infinity",Yne=e=>{switch(e.value._tag){case"Millis":return e.value.millis===0;case"Nanos":return e.value.nanos===B5;case"Infinity":return!1}},Ad=wo(0),Wne=wo(1/0),y1=e=>wo(e),Jne=e=>wo(e*BE),Od=e=>wo(e),V5=e=>wo(e*1e3),Xne=e=>wo(e*6e4),Qne=e=>wo(e*36e5),Zne=e=>wo(e*864e5),ere=e=>wo(e*6048e5),Gv=e=>rre(e,{onMillis:t=>t,onNanos:t=>Number(t)/1e6}),tre=e=>{const t=ra(e);switch(t.value._tag){case"Infinity":throw new Error("Cannot convert infinite duration to nanos");case"Nanos":return t.value.nanos;case"Millis":return BigInt(Math.round(t.value.millis*1e6))}},nre=e=>{const t=ra(e);switch(t.value._tag){case"Infinity":return[1/0,0];case"Nanos":return[Number(t.value.nanos/tD),Number(t.value.nanos%tD)];case"Millis":return[Math.floor(t.value.millis/1e3),Math.round(t.value.millis%1e3*1e6)]}},rre=T(2,(e,t)=>{const n=ra(e);switch(n.value._tag){case"Nanos":return t.onNanos(n.value.nanos);case"Infinity":return t.onMillis(1/0);case"Millis":return t.onMillis(n.value.millis)}}),IR=T(3,(e,t,n)=>{const r=ra(e),i=ra(t);if(r.value._tag==="Infinity"||i.value._tag==="Infinity")return n.onMillis(Gv(r),Gv(i));if(r.value._tag==="Nanos"||i.value._tag==="Nanos"){const a=r.value._tag==="Nanos"?r.value.nanos:BigInt(Math.round(r.value.millis*1e6)),o=i.value._tag==="Nanos"?i.value.nanos:BigInt(Math.round(i.value.millis*1e6));return n.onNanos(a,o)}return n.onMillis(r.value.millis,i.value.millis)}),ire=(e,t)=>IR(e,t,{onMillis:(n,r)=>n===r,onNanos:(n,r)=>n===r}),are=T(2,(e,t)=>IR(e,t,{onMillis:(n,r)=>n<=r,onNanos:(n,r)=>n<=r})),ore=T(2,(e,t)=>IR(e,t,{onMillis:(n,r)=>n>=r,onNanos:(n,r)=>n>=r})),sre=T(2,(e,t)=>ire(ra(e),ra(t))),lre=e=>{const t=ra(e);if(t.value._tag==="Infinity")return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};const n=tre(t),r=n/eD,i=r/BE,a=i/By,o=a/By,s=o/ZN;return{days:Number(s),hours:Number(o%ZN),minutes:Number(a%By),seconds:Number(i%By),millis:Number(r%BE),nanos:Number(n%eD)}},cre=e=>{const t=ra(e);if(t.value._tag==="Infinity")return"Infinity";if(Yne(t))return"0";const n=lre(t),r=[];return n.days!==0&&r.push(`${n.days}d`),n.hours!==0&&r.push(`${n.hours}h`),n.minutes!==0&&r.push(`${n.minutes}m`),n.seconds!==0&&r.push(`${n.seconds}s`),n.millis!==0&&r.push(`${n.millis}ms`),n.nanos!==0&&r.push(`${n.nanos}ns`),r.join(" ")},rD=Symbol.for("effect/MutableRef"),ure={[rD]:rD,toString(){return Rt(this.toJSON())},toJSON(){return{_id:"MutableRef",current:Jt(this.current)}},[lt](){return this.toJSON()},pipe(){return he(this,arguments)}},Ag=e=>{const t=Object.create(ure);return t.current=e,t},fre=T(3,(e,t,n)=>Se(t,e.current)?(e.current=n,!0):!1),Dn=e=>e.current,Og=T(2,(e,t)=>(e.current=t,e)),GS="effect/FiberId",tu=Symbol.for(GS),Md="None",HE="Runtime",qE="Composite",dre=Bt(`${GS}-${Md}`);var EL;let hre=class{constructor(){S(this,EL,tu);S(this,"_tag",Md);S(this,"id",-1);S(this,"startTimeMillis",-1)}[(EL=tu,Le)](){return dre}[ze](t){return $R(t)&&t._tag===Md}toString(){return Rt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag}}[lt](){return this.toJSON()}};var kL;class K5{constructor(t,n){S(this,"id");S(this,"startTimeMillis");S(this,kL,tu);S(this,"_tag",HE);this.id=t,this.startTimeMillis=n}[(kL=tu,Le)](){return _t(this,Bt(`${GS}-${this._tag}-${this.id}-${this.startTimeMillis}`))}[ze](t){return $R(t)&&t._tag===HE&&this.id===t.id&&this.startTimeMillis===t.startTimeMillis}toString(){return Rt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,id:this.id,startTimeMillis:this.startTimeMillis}}[lt](){return this.toJSON()}}var CL;let mre=class{constructor(t,n){S(this,"left");S(this,"right");S(this,CL,tu);S(this,"_tag",qE);S(this,"_hash");this.left=t,this.right=n}[(CL=tu,Le)](){return N(Bt(`${GS}-${this._tag}`),Pe(de(this.left)),Pe(de(this.right)),_t(this))}[ze](t){return $R(t)&&t._tag===qE&&Se(this.left,t.left)&&Se(this.right,t.right)}toString(){return Rt(this.toJSON())}toJSON(){return{_id:"FiberId",_tag:this._tag,left:Jt(this.left),right:Jt(this.right)}}[lt](){return this.toJSON()}};const G5=new hre,$R=e=>Re(e,tu),Y5=T(2,(e,t)=>e._tag===Md?t:t._tag===Md?e:new mre(e,t)),pre=e=>N(e,Np(G5,(t,n)=>Y5(n)(t))),Yv=e=>{switch(e._tag){case Md:return Qc();case HE:return OR(e.id);case qE:return N(Yv(e.left),Mp(Yv(e.right)))}},iD=je(Symbol.for("effect/Fiber/Id/_fiberCounter"),()=>Ag(0)),gre=(e,t)=>new K5(e,t),W5=e=>Array.from(Yv(e)).map(n=>`#${n}`).join(","),yre=()=>{const e=Dn(iD);return N(iD,Og(e+1)),new K5(e,Date.now())},Ei=G5,Km=Y5,bre=pre,J5=Yv,vre=gre,Sre=W5,X5=yre,YS=FS,xre=one,wre=lne,Q5=cne,Z5=Ap,eU=C5,_re=TR,Ere=mne,kre=R5,tU=US,Dp=Symbol.for("effect/List"),VE=e=>gt(e),Cre=e=>J4(IS(e),VE),Tre=Cre(Se),Rre={[Dp]:Dp,_tag:"Cons",toString(){return Rt(this.toJSON())},toJSON(){return{_id:"List",_tag:"Cons",values:VE(this).map(Jt)}},[lt](){return this.toJSON()},[ze](e){return rU(e)&&this._tag===e._tag&&Tre(this,e)},[Le](){return _t(this,rh(VE(this)))},[Symbol.iterator](){let e=!1,t=this;return{next(){if(e)return this.return();if(t._tag==="Nil")return e=!0,this.return();const n=t.head;return t=t.tail,{done:e,value:n}},return(n){return e||(e=!0),{done:!0,value:n}}}},pipe(){return he(this,arguments)}},Wv=(e,t)=>{const n=Object.create(Rre);return n.head=e,n.tail=t,n},Are=Bt("Nil"),Ore={[Dp]:Dp,_tag:"Nil",toString(){return Rt(this.toJSON())},toJSON(){return{_id:"List",_tag:"Nil"}},[lt](){return this.toJSON()},[Le](){return Are},[ze](e){return rU(e)&&this._tag===e._tag},[Symbol.iterator](){return{next(){return{done:!0,value:void 0}}}},pipe(){return he(this,arguments)}},nU=Object.create(Ore),rU=e=>Re(e,Dp),cs=e=>e._tag==="Nil",Mre=e=>e._tag==="Cons",Nre=()=>nU,nu=(e,t)=>Wv(e,t),Nd=Nre,LR=e=>Wv(e,nU),Dre=T(2,(e,t)=>Ire(t,e)),jre=T(2,(e,t)=>nu(t,e)),Ire=T(2,(e,t)=>{if(cs(e))return t;if(cs(t))return e;{const n=Wv(t.head,e);let r=n,i=t.tail;for(;!cs(i);){const a=Wv(i.head,e);r.tail=a,r=a,i=i.tail}return n}}),$re=T(3,(e,t,n)=>{let r=t,i=e;for(;!cs(i);)r=n(r,i.head),i=i.tail;return r}),Lre=e=>{let t=Nd(),n=e;for(;!cs(n);)t=jre(t,n.head),n=n.tail;return t},zre=Object.assign(Object.create(Array.prototype),{[Le](){return _t(this,rh(this))},[ze](e){return Array.isArray(e)&&this.length===e.length?this.every((t,n)=>Se(t,e[n])):!1}}),Mg=function(){function e(t){t&&Object.assign(this,t)}return e.prototype=Tg,e}(),Pre=e=>Object.assign(Object.create(Tg),e),Fre=Symbol.for("effect/DifferContextPatch");function aD(e){return e}const Ng={...Mg.prototype,[Fre]:{_Value:aD,_Patch:aD}},Ure=Object.assign(Object.create(Ng),{_tag:"Empty"}),Bre=Object.create(Ure),iU=()=>Bre,Hre=Object.assign(Object.create(Ng),{_tag:"AndThen"}),qre=(e,t)=>{const n=Object.create(Hre);return n.first=e,n.second=t,n},Vre=Object.assign(Object.create(Ng),{_tag:"AddService"}),Kre=(e,t)=>{const n=Object.create(Vre);return n.key=e,n.service=t,n},Gre=Object.assign(Object.create(Ng),{_tag:"RemoveService"}),Yre=e=>{const t=Object.create(Gre);return t.key=e,t},Wre=Object.assign(Object.create(Ng),{_tag:"UpdateService"}),Jre=(e,t)=>{const n=Object.create(Wre);return n.key=e,n.update=t,n},Xre=(e,t)=>{const n=new Map(e.unsafeMap);let r=iU();for(const[i,a]of t.unsafeMap.entries())if(n.has(i)){const o=n.get(i);n.delete(i),Se(o,a)||(r=Db(Jre(i,()=>a))(r))}else n.delete(i),r=Db(Kre(i,a))(r);for(const[i]of n.entries())r=Db(Yre(i))(r);return r},Db=T(2,(e,t)=>qre(e,t)),Qre=T(2,(e,t)=>{if(e._tag==="Empty")return t;let n=!1,r=Cn(e);const i=new Map(t.unsafeMap);for(;bs(r);){const o=to(r),s=Zo(r);switch(o._tag){case"Empty":{r=s;break}case"AddService":{i.set(o.key,o.service),r=s;break}case"AndThen":{r=Er(Er(s,o.second),o.first);break}case"RemoveService":{i.delete(o.key),r=s;break}case"UpdateService":{i.set(o.key,o.update(i.get(o.key))),n=!0,r=s;break}}}if(!n)return Ol(i);const a=new Map;for(const[o]of t.unsafeMap)i.has(o)&&(a.set(o,i.get(o)),i.delete(o));for(const[o,s]of i)a.set(o,s);return Ol(a)}),Zre=Symbol.for("effect/DifferHashSetPatch");function b1(e){return e}const WS={...Mg.prototype,[Zre]:{_Value:b1,_Key:b1,_Patch:b1}},eie=Object.assign(Object.create(WS),{_tag:"Empty"}),tie=Object.create(eie),aU=()=>tie,nie=Object.assign(Object.create(WS),{_tag:"AndThen"}),rie=(e,t)=>{const n=Object.create(nie);return n.first=e,n.second=t,n},iie=Object.assign(Object.create(WS),{_tag:"Add"}),aie=e=>{const t=Object.create(iie);return t.value=e,t},oie=Object.assign(Object.create(WS),{_tag:"Remove"}),sie=e=>{const t=Object.create(oie);return t.value=e,t},lie=(e,t)=>{const[n,r]=Np([e,aU()],([i,a],o)=>N5(o)(i)?[D5(o)(i),a]:[i,KE(aie(o))(a)])(t);return Np(r,(i,a)=>KE(sie(a))(i))(n)},KE=T(2,(e,t)=>rie(e,t)),cie=T(2,(e,t)=>{if(e._tag==="Empty")return t;let n=t,r=Cn(e);for(;bs(r);){const i=to(r),a=Zo(r);switch(i._tag){case"Empty":{r=a;break}case"AndThen":{r=Er(i.first)(Er(i.second)(a));break}case"Add":{n=Vm(i.value)(n),r=a;break}case"Remove":n=D5(i.value)(n),r=a}}return n}),uie=Symbol.for("effect/DifferReadonlyArrayPatch");function oD(e){return e}const Dg={...Mg.prototype,[uie]:{_Value:oD,_Patch:oD}},fie=Object.assign(Object.create(Dg),{_tag:"Empty"}),die=Object.create(fie),oU=()=>die,hie=Object.assign(Object.create(Dg),{_tag:"AndThen"}),mie=(e,t)=>{const n=Object.create(hie);return n.first=e,n.second=t,n},pie=Object.assign(Object.create(Dg),{_tag:"Append"}),gie=e=>{const t=Object.create(pie);return t.values=e,t},yie=Object.assign(Object.create(Dg),{_tag:"Slice"}),bie=(e,t)=>{const n=Object.create(yie);return n.from=e,n.until=t,n},vie=Object.assign(Object.create(Dg),{_tag:"Update"}),Sie=(e,t)=>{const n=Object.create(vie);return n.index=e,n.patch=t,n},xie=e=>{let t=0,n=oU();for(;t<e.oldValue.length&&t<e.newValue.length;){const r=e.oldValue[t],i=e.newValue[t],a=e.differ.diff(r,i);Se(a,e.differ.empty)||(n=jb(n,Sie(t,a))),t=t+1}return t<e.oldValue.length&&(n=jb(n,bie(0,t))),t<e.newValue.length&&(n=jb(n,gie(Ote(t)(e.newValue)))),n},jb=T(2,(e,t)=>mie(e,t)),wie=T(3,(e,t,n)=>{if(e._tag==="Empty")return t;let r=t.slice(),i=ga(e);for(;Vf(i);){const a=$r(i),o=Jc(i);switch(a._tag){case"Empty":{i=o;break}case"AndThen":{o.unshift(a.first,a.second),i=o;break}case"Append":{for(const s of a.values)r.push(s);i=o;break}case"Slice":{r=r.slice(a.from,a.until),i=o;break}case"Update":{r[a.index]=n.patch(a.patch,r[a.index]),i=o;break}}}return r}),_ie=Symbol.for("effect/Differ"),Eie={[_ie]:{_P:ke,_V:ke},pipe(){return he(this,arguments)}},dh=e=>{const t=Object.create(Eie);return t.empty=e.empty,t.diff=e.diff,t.combine=e.combine,t.patch=e.patch,t},kie=()=>dh({empty:iU(),combine:(e,t)=>Db(t)(e),diff:(e,t)=>Xre(e,t),patch:(e,t)=>Qre(t)(e)}),Cie=()=>dh({empty:aU(),combine:(e,t)=>KE(t)(e),diff:(e,t)=>lie(e,t),patch:(e,t)=>cie(t)(e)}),Tie=e=>dh({empty:oU(),combine:(t,n)=>jb(t,n),diff:(t,n)=>xie({oldValue:t,newValue:n,differ:e}),patch:(t,n)=>wie(t,n,e)}),sU=()=>Rie((e,t)=>t),Rie=e=>dh({empty:ke,combine:(t,n)=>t===ke?n:n===ke?t:r=>n(t(r)),diff:(t,n)=>Se(t,n)?ke:Eg(n),patch:(t,n)=>e(n,t(n))}),jp=255,lU=8,GE=e=>e&jp,YE=e=>e>>lU&jp,jg=(e,t)=>(e&jp)+((t&e&jp)<<lU),Aie=jg(0,0),Oie=e=>jg(e,e),Mie=e=>jg(e,0),Nie=T(2,(e,t)=>jg(GE(e)&~t,YE(e))),Die=T(2,(e,t)=>e|t),jie=e=>~e>>>0&jp,Iie=0,Cu=1,$ie=2,cU=4,WE=16,uU=32,Lie=e=>JS(e,uU),zie=T(2,(e,t)=>e&~t),Pie=T(2,(e,t)=>e|t),Hs=e=>fU(e)&&!Uie(e),fU=e=>JS(e,Cu),JS=T(2,(e,t)=>(e&t)!==0),dU=(...e)=>e.reduce((t,n)=>t|n,0),Fie=dU(Iie),sD=e=>JS(e,cU),Uie=e=>JS(e,WE),yl=T(2,(e,t)=>jg(e^t,t)),Gf=T(2,(e,t)=>e&(jie(GE(t))|YE(t))|GE(t)&YE(t)),lD=dh({empty:Aie,diff:(e,t)=>yl(e,t),combine:(e,t)=>Die(t)(e),patch:(e,t)=>Gf(t,e)}),Bie=Oie,hU=Mie,cD=Nie,mU=(e,t)=>({_tag:"Par",left:e,right:t}),Hy=(e,t)=>({_tag:"Seq",left:e,right:t}),Hie=e=>{let t=LR(e),n=Nd();for(;;){const[r,i]=$re(t,[pU(),Nd()],([a,o],s)=>{const[l,c]=qie(s);return[Wie(a,l),Dre(o,c)]});if(n=Vie(n,r),cs(i))return Lre(n);t=i}throw new Error("BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues")},qie=e=>{let t=e,n=pU(),r=Nd(),i=Nd();for(;;)switch(t._tag){case"Empty":{if(cs(r))return[n,i];t=r.head,r=r.tail;break}case"Par":{r=nu(t.right,r),t=t.left;break}case"Seq":{const a=t.left,o=t.right;switch(a._tag){case"Empty":{t=o;break}case"Par":{const s=a.left,l=a.right;t=mU(Hy(s,o),Hy(l,o));break}case"Seq":{const s=a.left,l=a.right;t=Hy(s,Hy(l,o));break}case"Single":{t=a,i=nu(o,i);break}}break}case"Single":{if(n=Yie(n,t),cs(r))return[n,i];t=r.head,r=r.tail;break}}throw new Error("BUG: BlockedRequests.step - please report an issue at https://github.com/Effect-TS/effect/issues")},Vie=(e,t)=>{if(cs(e))return LR(v1(t));if(Jie(t))return e;const n=nae(e.head),r=Xie(t);return n.length===1&&r.length===1&&Se(n[0],r[0])?nu(tae(e.head,v1(t)),e.tail):nu(v1(t),e)},Kie=Symbol.for("effect/RequestBlock/RequestBlockParallel"),Gie={_R:e=>e};var TL;TL=Kie;class zR{constructor(t){S(this,"map");S(this,TL,Gie);this.map=t}}const pU=()=>new zR(YS()),Yie=(e,t)=>new zR(_re(e.map,t.dataSource,n=>ite(ni(n,$E(t.blockedRequest)),()=>Cn(t.blockedRequest)))),Wie=(e,t)=>new zR(tU(e.map,t.map,(n,r,i)=>Z5(n,i,Mt(Q5(n,i),{onNone:()=>r,onSome:a=>wn(r,a)})))),Jie=e=>wre(e.map),Xie=e=>Array.from(eU(e.map)),v1=e=>eae(Ere(e.map,t=>Cn(t))),Qie=Symbol.for("effect/RequestBlock/RequestBlockSequential"),Zie={_R:e=>e};var RL;RL=Qie;class gU{constructor(t){S(this,"map");S(this,RL,Zie);this.map=t}}const eae=e=>new gU(e),tae=(e,t)=>new gU(tU(t.map,e.map,(n,r,i)=>Z5(n,i,Mt(Q5(n,i),{onNone:()=>Ln(),onSome:a=>wn(a,r)})))),nae=e=>Array.from(eU(e.map)),rae=e=>Array.from(e.map),Ig="Pending",XS="Done",iae="effect/Deferred",aae=Symbol.for(iae),oae={_E:e=>e,_A:e=>e},sae=e=>({_tag:Ig,joiners:e}),yU=e=>({_tag:XS,effect:e});class $g{constructor(t){S(this,"self");S(this,"called",!1);this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(t){return{value:t,done:!0}}throw(t){throw t}[Symbol.iterator](){return new $g(this.self)}}const bU=(e,t)=>{const n=new Tn("Blocked");return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n},lae=e=>{const t=new Tn("RunBlocked");return t.effect_instruction_i0=e,t},ru=Symbol.for("effect/Effect");class cae{constructor(t,n){S(this,"patch");S(this,"op");S(this,"_op",oR);this.patch=t,this.op=n}}var AL;class Tn{constructor(t){S(this,"_op");S(this,"effect_instruction_i0");S(this,"effect_instruction_i1");S(this,"effect_instruction_i2");S(this,"trace");S(this,AL,xd);this._op=t}[(AL=ru,ze)](t){return this===t}[Le](){return _t(this,nR(this))}pipe(){return he(this,arguments)}toJSON(){return{_id:"Effect",_op:this._op,effect_instruction_i0:Jt(this.effect_instruction_i0),effect_instruction_i1:Jt(this.effect_instruction_i1),effect_instruction_i2:Jt(this.effect_instruction_i2)}}toString(){return Rt(this.toJSON())}[lt](){return this.toJSON()}[Symbol.iterator](){return new $g(new kg(this))}}var OL;class vU{constructor(t){S(this,"_op");S(this,"effect_instruction_i0");S(this,"effect_instruction_i1");S(this,"effect_instruction_i2");S(this,"trace");S(this,OL,xd);this._op=t,this._tag=t}[(OL=ru,ze)](t){return sx(t)&&t._op==="Failure"&&Se(this.effect_instruction_i0,t.effect_instruction_i0)}[Le](){return N(Bt(this._tag),Pe(de(this.effect_instruction_i0)),_t(this))}get cause(){return this.effect_instruction_i0}pipe(){return he(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,cause:this.cause.toJSON()}}toString(){return Rt(this.toJSON())}[lt](){return this.toJSON()}[Symbol.iterator](){return new $g(new kg(this))}}var ML;class SU{constructor(t){S(this,"_op");S(this,"effect_instruction_i0");S(this,"effect_instruction_i1");S(this,"effect_instruction_i2");S(this,"trace");S(this,ML,xd);this._op=t,this._tag=t}[(ML=ru,ze)](t){return sx(t)&&t._op==="Success"&&Se(this.effect_instruction_i0,t.effect_instruction_i0)}[Le](){return N(Bt(this._tag),Pe(de(this.effect_instruction_i0)),_t(this))}get value(){return this.effect_instruction_i0}pipe(){return he(this,arguments)}toJSON(){return{_id:"Exit",_tag:this._op,value:Jt(this.value)}}toString(){return Rt(this.toJSON())}[lt](){return this.toJSON()}[Symbol.iterator](){return new $g(new kg(this))}}const Ts=e=>Re(e,ru),ft=e=>{const t=new Tn(P4);return t.effect_instruction_i0=e,t},xU=T(3,(e,t,n)=>Na(r=>te(e,i=>te(bl(qe(()=>r(t(i)))),a=>qe(()=>n(i,a)).pipe(ia({onFailure:o=>{switch(a._tag){case Wn:return zn(vr(a.effect_instruction_i0,o));case Jn:return zn(o)}},onSuccess:()=>a})))))),Ur=T(2,(e,t)=>te(e,()=>fe(t))),oa=e=>Ur(e,void 0),wU=function(){const e=new Tn(NS);switch(arguments.length){case 2:{e.effect_instruction_i0=arguments[0],e.commit=arguments[1];break}case 3:{e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.commit=arguments[2];break}case 4:{e.effect_instruction_i0=arguments[0],e.effect_instruction_i1=arguments[1],e.effect_instruction_i2=arguments[2],e.commit=arguments[3];break}default:throw new Error(TS("you're not supposed to end up here"))}return e},Jv=(e,t=Ei)=>{const n=new Tn(Bm);let r;return n.effect_instruction_i0=i=>{r=e(i)},n.effect_instruction_i1=t,zg(n,i=>Ts(r)?r:wt)},il=(e,t=Ei)=>qe(()=>Jv(e,t)),Ma=(e,t=Ei)=>wU(e,function(){let n,r;function i(l){n?n(l):r===void 0&&(r=l)}const a=new Tn(Bm);a.effect_instruction_i0=l=>{n=l,r&&l(r)},a.effect_instruction_i1=t;let o,s;return this.effect_instruction_i0.length!==1?(s=new AbortController,o=ar(()=>this.effect_instruction_i0(i,s.signal))):o=ar(()=>this.effect_instruction_i0(i)),o||s?zg(a,l=>(s&&s.abort(),o??wt)):a}),_U=T(2,(e,t)=>{const n=new Tn(Ob);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),Ip=T(2,(e,t)=>Il(e,{onFailure:t,onSuccess:fe})),uD=Symbol.for("effect/OriginalAnnotation"),PR=(e,t)=>Dt(t)?new Proxy(e,{has(n,r){return r===Rd||r===uD||r in n},get(n,r){return r===Rd?t.value:r===uD?e:n[r]}}):e,al=e=>Oa(e)&&!(Rd in e)?ft(t=>zn(Qi(PR(e,tA(t))))):zn(Qi(e)),EU=e=>kU(()=>Qi(new Bae(e))),Dd=e=>Il(e,{onFailure:t=>fe(De(t)),onSuccess:t=>fe(Ne(t))}),bl=e=>CU(e,{onFailure:vt,onSuccess:xt}),sn=e=>Oa(e)&&!(Rd in e)?ft(t=>zn(eu(PR(e,tA(t))))):zn(eu(e)),QS=e=>te(ie(e),sn),zn=e=>{const t=new vU(Wn);return t.effect_instruction_i0=e,t},kU=e=>te(ie(e),zn),ZS=ft(e=>fe(e.id())),Lg=e=>ft(t=>e(t.id())),te=T(2,(e,t)=>{const n=new Tn(Lv);return n.effect_instruction_i0=e,n.effect_instruction_i1=t,n}),uae=e=>{const t=new Tn("OnStep");return t.effect_instruction_i0=e,t},ex=e=>te(e,ke),CU=T(2,(e,t)=>ia(e,{onFailure:n=>fe(t.onFailure(n)),onSuccess:n=>fe(t.onSuccess(n))})),ia=T(2,(e,t)=>{const n=new Tn(zv);return n.effect_instruction_i0=e,n.effect_instruction_i1=t.onFailure,n.effect_instruction_i2=t.onSuccess,n}),Il=T(2,(e,t)=>ia(e,{onFailure:n=>{if(z5(n).length>0)return zn(Ine(n));const i=Nne(n);return i.length>0?t.onFailure(xR(i)):zn(n)},onSuccess:t.onSuccess})),es=T(2,(e,t)=>qe(()=>{const n=gt(e),r=jS(n.length);let i=0;return Ur(qR({while:()=>i<n.length,body:()=>t(n[i],i),step:a=>{r[i++]=a}}),r)})),tx=T(2,(e,t)=>qe(()=>{const n=gt(e);let r=0;return qR({while:()=>r<n.length,body:()=>t(n[r],r),step:()=>{r++}})})),Uo=te(ZS,e=>TU(e)),TU=e=>zn(va(e)),FR=e=>{const t=new Tn(ih);return t.effect_instruction_i0=Bie(Cu),t.effect_instruction_i1=()=>e,t},RU=T(2,(e,t)=>Na(n=>te(bl(n(e)),r=>qU(t,r)))),Je=T(2,(e,t)=>te(e,n=>ie(()=>t(n)))),UR=T(2,(e,t)=>Il(e,{onFailure:n=>QS(()=>t.onFailure(n)),onSuccess:n=>ie(()=>t.onSuccess(n))})),nx=T(2,(e,t)=>ia(e,{onFailure:n=>{const r=P5(n);switch(r._tag){case"Left":return QS(()=>t(r.left));case"Right":return zn(r.right)}},onSuccess:fe})),iu=T(2,(e,t)=>Na(n=>ia(n(e),{onFailure:r=>{const i=vt(r);return ia(t(i),{onFailure:a=>vt(vr(r,a)),onSuccess:()=>i})},onSuccess:r=>{const i=xt(r);return nn(t(i),i)}}))),zg=T(2,(e,t)=>iu(e,lx({onFailure:n=>qS(n)?oa(t(NR(n))):wt,onSuccess:()=>wt}))),fae=e=>dae(e,ke),dae=T(2,(e,t)=>Il(e,{onFailure:n=>al(t(n)),onSuccess:fe})),hae=ft((e,t)=>fe(t.runtimeFlags)),fe=e=>{const t=new SU(Jn);return t.effect_instruction_i0=e,t},qe=e=>{const t=new Tn(NS);return t.commit=e,t},ie=e=>{const t=new Tn(z4);return t.effect_instruction_i0=e,t},BR=T(e=>e.length===3||e.length===2&&!(Oa(e[1])&&"onlyEffect"in e[1]),(e,t)=>te(e,n=>{const r=typeof t=="function"?t(n):t;return Ts(r)?Ur(r,n):FZ(r)?Jv(i=>{r.then(a=>i(fe(n)),a=>i(sn(new JR(a,"An unknown error occurred in Effect.tap"))))}):fe(n)})),mae=e=>ft(t=>{const n=t.getFiberRef(QE),r=N(n,zt(()=>t.scope()));return e(hh(QE,ae(r)))}),Pg=e=>{const t=new Tn(ih);return t.effect_instruction_i0=hU(Cu),t.effect_instruction_i1=()=>e,t},Na=e=>wU(e,function(){const t=new Tn(ih);return t.effect_instruction_i0=hU(Cu),t.effect_instruction_i1=n=>fU(n)?ar(()=>this.effect_instruction_i0(FR)):ar(()=>this.effect_instruction_i0(Pg)),t}),wt=fe(void 0),AU=e=>{const t=new Tn(ih);return t.effect_instruction_i0=e,t.effect_instruction_i1=void 0,t},HR=T(2,(e,t)=>te(t,n=>n?N(e,Je(ae)):fe(ne()))),qR=e=>{const t=new Tn(Pv);return t.effect_instruction_i0=e.while,t.effect_instruction_i1=e.body,t.effect_instruction_i2=e.step,t},JE=e=>qe(()=>{const t=new Tn(Hm);return t.effect_instruction_i0=e(),t}),OU=function(){const e=arguments.length===1?arguments[0]:arguments[1].bind(arguments[0]);return JE(()=>e(N))},MU=(e,...t)=>Object.defineProperty(t.length===0?function(...n){return JE(()=>e.apply(this,n))}:function(...n){let r=JE(()=>e.apply(this,n));for(const i of t)r=i(r,...n);return r},"length",{value:e.length,configurable:!0}),pae=T(2,(e,t)=>{const n=new Tn(ih);return n.effect_instruction_i0=t,n.effect_instruction_i1=()=>e,n}),VR=e=>{const t=new Tn(Mb);return typeof(e==null?void 0:e.priority)<"u"?Dae(t,e.priority):t},rx=T(2,(e,t)=>te(e,n=>Je(t,r=>[n,r]))),ix=T(2,(e,t)=>te(e,n=>Ur(t,n))),nn=T(2,(e,t)=>te(e,()=>t)),NU=T(3,(e,t,n)=>te(e,r=>Je(t,i=>n(r,i)))),gae=il(()=>{const e=setInterval(()=>{},2147483647);return ie(()=>clearInterval(e))}),KR=e=>te(ZS,t=>N(e,$p(t))),$p=T(2,(e,t)=>te(e.interruptAsFork(t),()=>e.await)),yae={_tag:"All",syslog:0,label:"ALL",ordinal:Number.MIN_SAFE_INTEGER,pipe(){return he(this,arguments)}},bae={_tag:"Fatal",syslog:2,label:"FATAL",ordinal:5e4,pipe(){return he(this,arguments)}},vae={_tag:"Error",syslog:3,label:"ERROR",ordinal:4e4,pipe(){return he(this,arguments)}},DU={_tag:"Warning",syslog:4,label:"WARN",ordinal:3e4,pipe(){return he(this,arguments)}},jU={_tag:"Info",syslog:6,label:"INFO",ordinal:2e4,pipe(){return he(this,arguments)}},IU={_tag:"Debug",syslog:7,label:"DEBUG",ordinal:1e4,pipe(){return he(this,arguments)}},Sae={_tag:"Trace",syslog:7,label:"TRACE",ordinal:0,pipe(){return he(this,arguments)}},xae={_tag:"None",syslog:7,label:"OFF",ordinal:Number.MAX_SAFE_INTEGER,pipe(){return he(this,arguments)}},wae="effect/FiberRef",_ae=Symbol.for(wae),Eae={_A:e=>e},GR=e=>ft(t=>xt(t.getFiberRef(e))),ax=T(2,(e,t)=>te(GR(e),t)),fD=T(2,(e,t)=>kae(e,()=>[void 0,t])),kae=T(2,(e,t)=>ft(n=>{const[r,i]=t(n.getFiberRef(e));return n.setFiberRef(e,i),fe(r)})),hh=T(3,(e,t,n)=>xU(ix(GR(t),fD(t,n)),()=>e,r=>fD(t,r))),Cae=T(3,(e,t,n)=>ax(t,r=>hh(e,t,n(r)))),Pn=(e,t)=>mh(e,{differ:sU(),fork:(t==null?void 0:t.fork)??ke,join:t==null?void 0:t.join}),Tae=e=>{const t=Cie();return mh(e,{differ:t,fork:t.empty})},Rae=e=>{const t=Tie(sU());return mh(e,{differ:t,fork:t.empty})},$U=e=>{const t=kie();return mh(e,{differ:t,fork:t.empty})},mh=(e,t)=>({...Rg,[_ae]:Eae,initial:e,commit(){return GR(this)},diff:(r,i)=>t.differ.diff(r,i),combine:(r,i)=>t.differ.combine(r,i),patch:r=>i=>t.differ.patch(r,i),fork:t.fork,join:t.join??((r,i)=>i)}),Aae=e=>mh(e,{differ:lD,fork:lD.empty}),_o=je(Symbol.for("effect/FiberRef/currentContext"),()=>$U(mo())),ph=je(Symbol.for("effect/FiberRef/currentSchedulingPriority"),()=>Pn(0)),LU=je(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"),()=>Pn(2048)),Oae=je(Symbol.for("effect/FiberRef/currentLogAnnotation"),()=>Pn(YS())),Mae=je(Symbol.for("effect/FiberRef/currentLogLevel"),()=>Pn(jU)),Nae=je(Symbol.for("effect/FiberRef/currentLogSpan"),()=>Pn(Nd())),Dae=T(2,(e,t)=>hh(e,ph,t)),jae=je(Symbol.for("effect/FiberRef/currentConcurrency"),()=>Pn("unbounded")),Iae=je(Symbol.for("effect/FiberRef/currentRequestBatching"),()=>Pn(!0)),$ae=je(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"),()=>Pn(ae(IU))),Lae=je(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"),()=>Pn(ae(DU))),XE=je(Symbol.for("effect/FiberRef/currentMetricLabels"),()=>Rae(Ml())),QE=je(Symbol.for("effect/FiberRef/currentForkScopeOverride"),()=>Pn(ne(),{fork:()=>ne(),join:(e,t)=>e})),qy=je(Symbol.for("effect/FiberRef/currentInterruptedCause"),()=>Pn(Dl,{fork:()=>Dl,join:(e,t)=>e})),zU=je(Symbol.for("effect/FiberRef/currentTracerEnabled"),()=>Pn(!0)),PU=je(Symbol.for("effect/FiberRef/currentTracerTiming"),()=>Pn(!0)),zae=je(Symbol.for("effect/FiberRef/currentTracerSpanAnnotations"),()=>Pn(YS())),Pae=je(Symbol.for("effect/FiberRef/currentTracerSpanLinks"),()=>Pn(Ln())),dD=Symbol.for("effect/Scope"),hD=Symbol.for("effect/CloseableScope"),FU=(e,t)=>e.addFinalizer(()=>oa(t)),Xv=(e,t)=>e.addFinalizer(t),ZE=(e,t)=>e.close(t),Go=(e,t)=>e.fork(t),Fae=e=>Uae(ke)(e),Uae=T(2,(e,t)=>{const n=N(e,DR,ni(t));switch(n._tag){case"None":return N(z5(e),SR,Mt({onNone:()=>{const r=gt(NR(e)).flatMap(i=>gt(J5(i)).map(a=>`#${a}`));return new Hae(r?`Interrupted by fibers: ${r.join(", ")}`:void 0)},onSome:ke}));case"Some":return n.value}}),YR=function(){class e extends globalThis.Error{commit(){return sn(this)}toJSON(){const n={...this};return this.message&&(n.message=this.message),this.cause&&(n.cause=this.cause),n}[lt](){return this.toString!==globalThis.Error.prototype.toString?this.stack?`${this.toString()}
75
+ ${this.stack.split(`
76
+ `).slice(1).join(`
77
+ `)}`:this.toString():"Bun"in globalThis?fh(eu(this),{renderErrorCause:!0}):this}}return Object.assign(e.prototype,fee),e}(),WR=(e,t)=>{class n extends YR{constructor(){super(...arguments);S(this,"_tag",t)}}return Object.assign(n.prototype,e),n.prototype.name=t,n},mD=Symbol.for("effect/Cause/errors/RuntimeException"),Bae=WR({[mD]:mD},"RuntimeException"),ek=Symbol.for("effect/Cause/errors/InterruptedException"),Hae=WR({[ek]:ek},"InterruptedException"),qae=e=>Re(e,ek),pD=Symbol.for("effect/Cause/errors/NoSuchElement"),ox=WR({[pD]:pD},"NoSuchElementException"),gD=Symbol.for("effect/Cause/errors/UnknownException"),JR=function(){class e extends YR{constructor(r,i){super(i??"An unknown error occurred",{cause:r});S(this,"_tag","UnknownException");S(this,"error");this.error=r}}return Object.assign(e.prototype,{[gD]:gD,name:"UnknownException"}),e}(),sx=e=>Ts(e)&&"_tag"in e&&(e._tag==="Success"||e._tag==="Failure"),UU=e=>e._tag==="Failure",Vae=e=>e._tag==="Success",Ib=T(2,(e,t)=>{switch(e._tag){case Wn:return vt(e.effect_instruction_i0);case Jn:return xt(t)}}),S1=e=>Ib(e,void 0),Yf=(e,t)=>Jae(e,t!=null&&t.parallel?jl:vr),BU=e=>vt(Qi(e)),Lp=e=>vt(eu(e)),vt=e=>{const t=new vU(Wn);return t.effect_instruction_i0=e,t},Kae=T(2,(e,t)=>{switch(e._tag){case Wn:return vt(e.effect_instruction_i0);case Jn:return t(e.effect_instruction_i0)}}),Gae=e=>N(e,Kae(ke)),Yae=e=>vt(va(e)),$b=T(2,(e,t)=>{switch(e._tag){case Wn:return vt(e.effect_instruction_i0);case Jn:return xt(t(e.effect_instruction_i0))}}),lx=T(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case Wn:return t(e.effect_instruction_i0);case Jn:return n(e.effect_instruction_i0)}}),tk=T(2,(e,{onFailure:t,onSuccess:n})=>{switch(e._tag){case Wn:return t(e.effect_instruction_i0);case Jn:return n(e.effect_instruction_i0)}}),xt=e=>{const t=new SU(Jn);return t.effect_instruction_i0=e,t},Sr=xt(void 0),Wae=T(2,(e,t)=>XR(e,t,{onSuccess:(n,r)=>[n,r],onFailure:vr})),HU=T(2,(e,t)=>XR(e,t,{onSuccess:(n,r)=>r,onFailure:vr})),XR=T(3,(e,t,{onFailure:n,onSuccess:r})=>{switch(e._tag){case Wn:switch(t._tag){case Jn:return vt(e.effect_instruction_i0);case Wn:return vt(n(e.effect_instruction_i0,t.effect_instruction_i0))}case Jn:switch(t._tag){case Jn:return xt(r(e.effect_instruction_i0,t.effect_instruction_i0));case Wn:return vt(t.effect_instruction_i0)}}}),Jae=(e,t)=>{const n=gs(e);return bs(n)?N(Zo(n),bR(N(to(n),$b(Cn)),(r,i)=>N(r,XR(i,{onSuccess:(a,o)=>N(a,Er(o)),onFailure:t}))),$b(ys),$b(r=>Lr(r)),ae):ne()},cx=e=>({...Rg,[aae]:oae,state:Ag(sae([])),commit(){return $l(this)},blockingOn:e}),ux=()=>te(ZS,e=>Xae(e)),Xae=e=>ie(()=>cx(e)),$l=e=>il(t=>{const n=Dn(e.state);switch(n._tag){case XS:return t(n.effect);case Ig:return n.joiners.push(t),Zae(e,t)}},e.blockingOn),fx=T(2,(e,t)=>ie(()=>{const n=Dn(e.state);switch(n._tag){case XS:return!1;case Ig:{Og(e.state,yU(t));for(let r=0,i=n.joiners.length;r<i;r++)n.joiners[r](t);return!0}}})),qU=T(2,(e,t)=>fx(e,t)),VU=T(2,(e,t)=>fx(e,zn(t))),KU=T(2,(e,t)=>fx(e,TU(t))),Qae=e=>ie(()=>Dn(e.state)._tag===XS),QR=T(2,(e,t)=>fx(e,fe(t))),dx=(e,t)=>{const n=Dn(e.state);if(n._tag===Ig){Og(e.state,yU(t));for(let r=0,i=n.joiners.length;r<i;r++)n.joiners[r](t)}},Zae=(e,t)=>ie(()=>{const n=Dn(e.state);if(n._tag===Ig){const r=n.joiners.indexOf(t);r>=0&&n.joiners.splice(r,1)}}),eoe=ft(e=>xt(e.currentContext)),ZR=()=>eoe,Tu=e=>te(ZR(),e),hx=T(2,(e,t)=>hh(_o,t)(e)),eA=T(2,(e,t)=>Cae(_o,n=>ai(n,t))(e)),GU=T(2,(e,t)=>Tu(n=>hx(e,t(n)))),tA=e=>{const t=e.currentSpan;return t!==void 0&&t._tag==="Span"?ae(t):ne()},toe={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:BigInt(0),endTime:BigInt(0),exit:Sr},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},noe=e=>Object.assign(Object.create(toe),e),roe="effect/Clock",yD=Symbol.for(roe),gh=Gl("effect/Clock"),ioe=2**31-1,bD={unsafeSchedule(e,t){const n=Gv(t);if(n>ioe)return pl;let r=!1;const i=setTimeout(()=>{r=!0,e()},n);return()=>(clearTimeout(i),!r)}},vD=function(){const e=BigInt(1e6);if(typeof performance>"u"||typeof performance.now!="function")return()=>BigInt(Date.now())*e;let t;return()=>(t===void 0&&(t=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6))),t+BigInt(Math.round(performance.now()*1e6)))}(),aoe=function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return vD;const t=vD()-e.bigint();return()=>t+e.bigint()}();var NL;NL=yD;class ooe{constructor(){S(this,NL,yD);S(this,"currentTimeMillis",ie(()=>this.unsafeCurrentTimeMillis()));S(this,"currentTimeNanos",ie(()=>this.unsafeCurrentTimeNanos()))}unsafeCurrentTimeMillis(){return Date.now()}unsafeCurrentTimeNanos(){return aoe()}scheduler(){return fe(bD)}sleep(t){return Ma(n=>{const r=bD.unsafeSchedule(()=>n(wt),t);return oa(ie(r))})}}const soe=()=>new ooe,jd=Zee,loe=e=>{if(e==="NaN")return Qo(NaN);if(e==="Infinity")return Qo(1/0);if(e==="-Infinity")return Qo(-1/0);if(e.trim()==="")return wd;const t=Number(e);return Number.isNaN(t)?wd:Qo(t)},Qv=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"),YU="And",WU="Or",JU="InvalidData",XU="MissingData",QU="SourceUnavailable",ZU="Unsupported",coe="effect/ConfigError",SD=Symbol.for(coe),yh={_tag:"ConfigError",[SD]:SD},eB=(e,t)=>{const n=Object.create(yh);return n._op=YU,n.left=e,n.right=t,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`${this.left} and ${this.right}`}}),Object.defineProperty(n,"message",{enumerable:!1,get(){return this.toString()}}),n},tB=(e,t)=>{const n=Object.create(yh);return n._op=WU,n.left=e,n.right=t,Object.defineProperty(n,"toString",{enumerable:!1,value(){return`${this.left} or ${this.right}`}}),Object.defineProperty(n,"message",{enumerable:!1,get(){return this.toString()}}),n},uoe=(e,t,n={pathDelim:"."})=>{const r=Object.create(yh);return r._op=JU,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Invalid data at ${N(this.path,lh(n.pathDelim))}: "${this.message}")`}}),r},au=(e,t,n={pathDelim:"."})=>{const r=Object.create(yh);return r._op=XU,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Missing data at ${N(this.path,lh(n.pathDelim))}: "${this.message}")`}}),r},foe=(e,t,n,r={pathDelim:"."})=>{const i=Object.create(yh);return i._op=QU,i.path=e,i.message=t,i.cause=n,Object.defineProperty(i,"toString",{enumerable:!1,value(){return`(Source unavailable at ${N(this.path,lh(r.pathDelim))}: "${this.message}")`}}),i},doe=(e,t,n={pathDelim:"."})=>{const r=Object.create(yh);return r._op=ZU,r.path=e,r.message=t,Object.defineProperty(r,"toString",{enumerable:!1,value(){return`(Unsupported operation at ${N(this.path,lh(n.pathDelim))}: "${this.message}")`}}),r},Tc=T(2,(e,t)=>{switch(e._op){case YU:return eB(Tc(e.left,t),Tc(e.right,t));case WU:return tB(Tc(e.left,t),Tc(e.right,t));case JU:return uoe([...t,...e.path],e.message);case XU:return au([...t,...e.path],e.message);case QU:return foe([...t,...e.path],e.message,e.cause);case ZU:return doe([...t,...e.path],e.message)}}),hoe={_tag:"Empty"},x1=T(2,(e,t)=>{let n=LR(t),r=e;for(;Mre(n);){const i=n.head;switch(i._tag){case"Empty":{n=n.tail;break}case"AndThen":{n=nu(i.first,nu(i.second,n.tail));break}case"MapName":{r=zc(r,i.f),n=n.tail;break}case"Nested":{r=Uv(r,i.name),n=n.tail;break}case"Unnested":{if(N(qm(r),dte(i.name)))r=Jc(r),n=n.tail;else return De(au(r,`Expected ${i.name} to be in path in ConfigProvider#unnested`));break}}}return Ne(r)}),moe="Constant",poe="Fail",goe="Fallback",yoe="Described",boe="Lazy",voe="MapOrFail",Soe="Nested",xoe="Primitive",woe="Sequence",_oe="HashMap",Eoe="ZipWith";var xD={};const Zv=(e,t)=>[...e,...t],koe="effect/ConfigProvider",wD=Symbol.for(koe),Coe=Gl("effect/ConfigProvider"),Toe="effect/ConfigProviderFlat",_D=Symbol.for(Toe),Roe=e=>({[wD]:wD,pipe(){return he(this,arguments)},...e}),Aoe=e=>({[_D]:_D,patch:e.patch,load:(t,n,r=!0)=>e.load(t,n,r),enumerateChildren:e.enumerateChildren}),Ooe=e=>Roe({load:t=>te(Ii(e,Ml(),t,!1),n=>Mt(qm(n),{onNone:()=>sn(au(Ml(),`Expected a single value having structure: ${t}`)),onSome:fe})),flattened:e}),Moe=e=>{const{pathDelim:t,seqDelim:n}=Object.assign({},{pathDelim:"_",seqDelim:","},e),r=l=>N(l,lh(t)),i=l=>l.split(t),a=()=>typeof process<"u"&&"env"in process&&typeof xD=="object"?xD:{};return Ooe(Aoe({load:(l,c,f=!0)=>{const u=r(l),d=a(),h=u in d?ae(d[u]):ne();return N(h,nx(()=>au(l,`Expected ${u} to exist in the process context`)),te(m=>$oe(m,l,c,n,f)))},enumerateChildren:l=>ie(()=>{const c=a(),d=Object.keys(c).map(h=>i(h.toUpperCase())).filter(h=>{for(let m=0;m<l.length;m++){const b=N(l,f5(m)),w=h[m];if(w===void 0||b!==w)return!1}return!0}).flatMap(h=>h.slice(l.length,l.length+1));return Cne(d)}),patch:hoe}))},Noe=(e,t,n,r)=>{const i=GN(n.length,l=>l>=r.length?ne():ae([e(l),l+1])),a=GN(r.length,l=>l>=n.length?ne():ae([t(l),l+1])),o=Zv(n,i),s=Zv(r,a);return[o,s]},Doe=(e,t)=>{let n=t;if(n._tag==="Nested"){const r=e.slice();for(;n._tag==="Nested";)r.push(n.name),n=n.config;return r}return e},Ii=(e,t,n,r)=>{const i=n;switch(i._tag){case moe:return fe(ga(i.value));case yoe:return qe(()=>Ii(e,t,i.config,r));case poe:return sn(au(t,i.message));case goe:return N(qe(()=>Ii(e,t,i.first,r)),Ip(a=>i.condition(a)?N(Ii(e,t,i.second,r),Ip(o=>sn(tB(a,o)))):sn(a)));case boe:return qe(()=>Ii(e,t,i.config(),r));case voe:return qe(()=>N(Ii(e,t,i.original,r),te(es(a=>N(i.mapOrFail(a),nx(Tc(Doe(t,i.original))))))));case Soe:return qe(()=>Ii(e,Zv(t,ga(i.name)),i.config,r));case xoe:return N(x1(t,e.patch),te(a=>N(e.load(a,i,r),te(o=>{if(o.length===0){const s=N(Tte(a),zt(()=>"<n/a>"));return sn(au([],`Expected ${i.description} with name ${s}`))}return fe(o)}))));case woe:return N(x1(t,e.patch),te(a=>N(e.enumerateChildren(a),te(zoe),te(o=>o.length===0?qe(()=>Je(Ii(e,t,i.config,!0),ga)):N(es(o,s=>Ii(e,xte(t,`[${s}]`),i.config,!0)),Je(s=>{const l=m5(s);return l.length===0?ga(Ml()):ga(l)}))))));case _oe:return qe(()=>N(x1(t,e.patch),te(a=>N(e.enumerateChildren(a),te(o=>N(o,es(s=>Ii(e,Zv(a,ga(s)),i.valueConfig,r)),Je(s=>s.length===0?ga(YS()):N(Loe(s),zc(l=>xre(KN(gt(o),l)))))))))));case Eoe:return qe(()=>N(Ii(e,t,i.left,r),Dd,te(a=>N(Ii(e,t,i.right,r),Dd,te(o=>{if(qn(a)&&qn(o))return sn(eB(a.left,o.left));if(qn(a)&&eo(o))return sn(a.left);if(eo(a)&&qn(o))return sn(o.left);if(eo(a)&&eo(o)){const s=N(t,lh(".")),l=joe(t,s),[c,f]=Noe(l,l,N(a.right,zc(Ne)),N(o.right,zc(Ne)));return N(c,KN(f),es(([u,d])=>N(rx(u,d),Je(([h,m])=>i.zip(h,m)))))}throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues")})))))}},joe=(e,t)=>n=>De(au(e,`The element at index ${n} in a sequence at path "${t}" was missing`)),Ioe=(e,t)=>e.split(new RegExp(`\\s*${Qv(t)}\\s*`)),$oe=(e,t,n,r,i)=>i?N(Ioe(e,r),es(a=>n.parse(a.trim())),nx(Tc(t))):N(n.parse(e),UR({onFailure:Tc(t),onSuccess:ga})),Loe=e=>Object.keys(e[0]).map(t=>e.map(n=>n[t])),zoe=e=>N(es(e,Foe),UR({onFailure:()=>Ml(),onSuccess:Rp(jd)}),Dd,Je(Qee)),Poe=/^(\[(\d+)\])$/,Foe=e=>{const t=e.match(Poe);if(t!==null){const n=t[2];return N(n!==void 0&&n.length>0?ae(n):ne(),Cs(Uoe))}return ne()},Uoe=e=>{const t=Number.parseInt(e);return Number.isNaN(t)?ne():ae(t)},ED=Symbol.for("effect/Console"),nB=Gl("effect/Console"),Boe={[ED]:ED,assert(e,...t){return ie(()=>{console.assert(e,...t)})},clear:ie(()=>{console.clear()}),count(e){return ie(()=>{console.count(e)})},countReset(e){return ie(()=>{console.countReset(e)})},debug(...e){return ie(()=>{console.debug(...e)})},dir(e,t){return ie(()=>{console.dir(e,t)})},dirxml(...e){return ie(()=>{console.dirxml(...e)})},error(...e){return ie(()=>{console.error(...e)})},group(e){return e!=null&&e.collapsed?ie(()=>console.groupCollapsed(e==null?void 0:e.label)):ie(()=>console.group(e==null?void 0:e.label))},groupEnd:ie(()=>{console.groupEnd()}),info(...e){return ie(()=>{console.info(...e)})},log(...e){return ie(()=>{console.log(...e)})},table(e,t){return ie(()=>{console.table(e,t)})},time(e){return ie(()=>console.time(e))},timeEnd(e){return ie(()=>console.timeEnd(e))},timeLog(e,...t){return ie(()=>{console.timeLog(e,...t)})},trace(...e){return ie(()=>{console.trace(...e)})},warn(...e){return ie(()=>{console.warn(...e)})},unsafe:console},Hoe="effect/Random",kD=Symbol.for(Hoe),qoe=Gl("effect/Random");var DL;DL=kD;class Voe{constructor(t){S(this,"seed");S(this,DL,kD);S(this,"PRNG");this.seed=t,this.PRNG=new GZ(t)}get next(){return ie(()=>this.PRNG.number())}get nextBoolean(){return Je(this.next,t=>t>.5)}get nextInt(){return ie(()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER))}nextRange(t,n){return Je(this.next,r=>(n-t)*r+t)}nextIntBetween(t,n){return ie(()=>this.PRNG.integer(n-t)+t)}shuffle(t){return Koe(t,n=>this.nextIntBetween(0,n))}}const Koe=(e,t)=>qe(()=>N(ie(()=>Array.from(e)),te(n=>{const r=[];for(let i=n.length;i>=2;i=i-1)r.push(i);return N(r,tx(i=>N(t(i),Je(a=>Goe(n,i-1,a)))),Ur(gs(n)))}))),Goe=(e,t,n)=>{const r=e[t];return e[t]=e[n],e[n]=r,e},Yoe=e=>new Voe(de(e)),CD=Symbol.for("effect/Tracer"),Woe=e=>({[CD]:CD,...e}),nA=Gl("effect/Tracer"),mx=Gl("effect/ParentSpan"),TD=function(){const e="abcdef0123456789",t=e.length;return function(n){let r="";for(let i=0;i<n;i++)r+=e.charAt(Math.floor(Math.random()*t));return r}}();class Joe{constructor(t,n,r,i,a,o){S(this,"name");S(this,"parent");S(this,"context");S(this,"startTime");S(this,"kind");S(this,"_tag","Span");S(this,"spanId");S(this,"traceId","native");S(this,"sampled",!0);S(this,"status");S(this,"attributes");S(this,"events",[]);S(this,"links");this.name=t,this.parent=n,this.context=r,this.startTime=a,this.kind=o,this.status={_tag:"Started",startTime:a},this.attributes=new Map,this.traceId=n._tag==="Some"?n.value.traceId:TD(32),this.spanId=TD(16),this.links=Array.from(i)}end(t,n){this.status={_tag:"Ended",endTime:t,exit:n,startTime:this.status.startTime}}attribute(t,n){this.attributes.set(t,n)}event(t,n,r){this.events.push([t,n,r??{}])}addLinks(t){this.links.push(...t)}}const Xoe=Woe({span:(e,t,n,r,i,a)=>new Joe(e,t,n,r,i,a),context:e=>e()}),Qoe=e=>{if((e==null?void 0:e.captureStackTrace)===!1)return e;if((e==null?void 0:e.captureStackTrace)!==void 0&&typeof e.captureStackTrace!="boolean")return e;const t=Error.stackTraceLimit;Error.stackTraceLimit=3;const n=new Error;Error.stackTraceLimit=t;let r=!1;return{...e,captureStackTrace:()=>{if(r!==!1)return r;if(n.stack!==void 0){const i=n.stack.split(`
78
+ `);if(i[3]!==void 0)return r=i[3].trim(),r}}}},nk=oh()("effect/Tracer/DisablePropagation",{defaultValue:pl}),Zoe=N(mo(),Yi(gh,soe()),Yi(nB,Boe),Yi(qoe,Yoe(Math.random())),Yi(Coe,Moe()),Yi(nA,Xoe)),Id=je(Symbol.for("effect/DefaultServices/currentServices"),()=>$U(Zoe)),ese=e=>{const t=ra(e);return rB(n=>n.sleep(t))},tse=e=>ft(t=>e(t.currentDefaultServices)),rB=e=>tse(t=>e(t.unsafeMap.get(gh.key))),nse=rB(e=>e.currentTimeMillis),rse=Cg,ise=dee;let bh=class extends ise{};const iB="Sequential",aB="Parallel",ase="ParallelN",Fc={_tag:iB},rk={_tag:aB},ose=e=>({_tag:ase,parallelism:e}),sse=e=>e._tag===iB,lse=e=>e._tag===aB,e0=Fc,ik=rk,ak=ose;function cse(e){return new Ll(e)}function use(){return cse(new Map)}const RD=Symbol.for("effect/FiberRefs");var jL;jL=RD;class Ll{constructor(t){S(this,"locals");S(this,jL,RD);this.locals=t}pipe(){return he(this,arguments)}}const fse=(e,t,n,r=!1)=>{const i=e;let a=t,o=n,s=r,l;for(;l===void 0;)if(on(a)&&on(o)){const c=$r(a)[0],f=Jc(a),u=$r(o)[0],d=$r(o)[1],h=Jc(o);c.startTimeMillis<u.startTimeMillis?(o=h,s=!0):c.startTimeMillis>u.startTimeMillis?a=f:c.id<u.id?(o=h,s=!0):c.id>u.id?a=f:l=[d,s]}else l=[i.initial,!0];return l},dse=T(3,(e,t,n)=>{const r=new Map(e.locals);return n.locals.forEach((i,a)=>{const o=i[0][1];if(!i[0][0][ze](t)){if(!r.has(a)){if(Se(o,a.initial))return;r.set(a,[[t,a.join(a.initial,o)]]);return}const s=r.get(a),[l,c]=fse(a,s,i);if(c){const f=a.diff(l,o),u=s[0][1],d=a.join(u,a.patch(f)(u));if(!Se(u,d)){let h;const m=s[0][0];m[ze](t)?h=[[m,d],...s.slice(1)]:h=[[t,d],...s],r.set(a,h)}}}}),new Ll(r)}),hse=T(2,(e,t)=>{const n=new Map;return oB(e,n,t),new Ll(n)}),oB=(e,t,n)=>{e.locals.forEach((r,i)=>{const a=r[0][1],o=i.patch(i.fork)(a);Se(a,o)?t.set(i,r):t.set(i,[[n,o],...r])})},sB=T(2,(e,t)=>{const n=new Map(e.locals);return n.delete(t),new Ll(n)}),lB=T(2,(e,t)=>e.locals.has(t)?ae($r(e.locals.get(t))[1]):ne()),zp=T(2,(e,t)=>N(lB(e,t),zt(()=>t.initial))),ok=T(2,(e,{fiberId:t,fiberRef:n,value:r})=>{if(e.locals.size===0)return new Ll(new Map([[n,[[t,r]]]]));const i=new Map(e.locals);return sk(i,t,n,r),new Ll(i)}),sk=(e,t,n,r)=>{const i=e.get(n)??[];let a;if(on(i)){const[o,s]=$r(i);if(o[ze](t)){if(Se(s,r))return;a=[[t,r],...i.slice(1)]}else a=[[t,r],...i]}else a=[[t,r]];e.set(n,a)},mse=T(2,(e,{entries:t,forkAs:n})=>{if(e.locals.size===0)return new Ll(new Map(t));const r=new Map(e.locals);return n!==void 0&&oB(e,r,n),t.forEach(([i,a])=>{a.length===1?sk(r,a[0][0],i,a[0][1]):a.forEach(([o,s])=>{sk(r,o,i,s)})}),new Ll(r)}),AD=lB,cB=zp,pse=mse,gse=use,uB="Empty",fB="Add",dB="Remove",hB="Update",mB="AndThen",yse={_tag:uB},rA=(e,t)=>{const n=new Map(e.locals);let r=yse;for(const[i,a]of t.locals.entries()){const o=$r(a)[1],s=n.get(i);if(s!==void 0){const l=$r(s)[1];Se(l,o)||(r=w1({_tag:hB,fiberRef:i,patch:i.diff(l,o)})(r))}else r=w1({_tag:fB,fiberRef:i,value:o})(r);n.delete(i)}for(const[i]of n.entries())r=w1({_tag:dB,fiberRef:i})(r);return r},w1=T(2,(e,t)=>({_tag:mB,first:e,second:t})),pB=T(3,(e,t,n)=>{let r=n,i=ga(e);for(;on(i);){const a=$r(i),o=Jc(i);switch(a._tag){case uB:{i=o;break}case fB:{r=ok(r,{fiberId:t,fiberRef:a.fiberRef,value:a.value}),i=o;break}case dB:{r=sB(r,a.fiberRef),i=o;break}case hB:{const s=zp(r,a.fiberRef);r=ok(r,{fiberId:t,fiberRef:a.fiberRef,value:a.fiberRef.patch(a.patch)(s)}),i=o;break}case mB:{i=Uv(a.first)(Uv(a.second)(o));break}}}return r}),Pp=rA,Fp=pB,px="effect/FiberStatus",ou=Symbol.for(px),t0="Done",OD="Running",MD="Suspended",bse=Bt(`${px}-${t0}`);var IL;let vse=class{constructor(){S(this,IL,ou);S(this,"_tag",t0)}[(IL=ou,Le)](){return bse}[ze](t){return iA(t)&&t._tag===t0}};var $L;class Sse{constructor(t){S(this,"runtimeFlags");S(this,$L,ou);S(this,"_tag",OD);this.runtimeFlags=t}[($L=ou,Le)](){return N(de(px),Pe(de(this._tag)),Pe(de(this.runtimeFlags)),_t(this))}[ze](t){return iA(t)&&t._tag===OD&&this.runtimeFlags===t.runtimeFlags}}var LL;class xse{constructor(t,n){S(this,"runtimeFlags");S(this,"blockingOn");S(this,LL,ou);S(this,"_tag",MD);this.runtimeFlags=t,this.blockingOn=n}[(LL=ou,Le)](){return N(de(px),Pe(de(this._tag)),Pe(de(this.runtimeFlags)),Pe(de(this.blockingOn)),_t(this))}[ze](t){return iA(t)&&t._tag===MD&&this.runtimeFlags===t.runtimeFlags&&Se(this.blockingOn,t.blockingOn)}}const wse=new vse,_se=e=>new Sse(e),Ese=(e,t)=>new xse(e,t),iA=e=>Re(e,ou),kse=e=>e._tag===t0,Cse=wse,gB=_se,Tse=Ese,Rse=kse,Ase=yae,Ose=bae,Mse=vae,Nse=DU,Dse=jU,jse=IU,Ise=Sae,$se=xae,Lse=N(jd,o5(e=>e.ordinal)),zse=ete(Lse),Pse=e=>{switch(e){case"All":return Ase;case"Debug":return jse;case"Error":return Mse;case"Fatal":return Ose;case"Info":return Dse;case"Trace":return Ise;case"None":return $se;case"Warning":return Nse}},Fse=Symbol.for("effect/Micro"),n0=Symbol.for("effect/Micro/MicroExit"),ND=Symbol.for("effect/Micro/MicroCause"),Use={_E:ke};var zL;class yB extends globalThis.Error{constructor(n,r,i){const a=`MicroCause.${n}`;let o,s,l;if(r instanceof globalThis.Error){o=`(${a}) ${r.name}`,s=r.message;const c=s.split(`
79
+ `).length;l=r.stack?`(${a}) ${r.stack.split(`
80
+ `).slice(0,c+3).join(`
81
+ `)}`:`${o}: ${s}`}else o=a,s=Sd(r,0),l=`${o}: ${s}`;i.length>0&&(l+=`
82
+ ${i.join(`
83
+ `)}`);super(s);S(this,"_tag");S(this,"traces");S(this,zL);this._tag=n,this.traces=i,this[ND]=Use,this.name=o,this.stack=l}pipe(){return he(this,arguments)}toString(){return this.stack}[(zL=ND,lt)](){return this.stack}}class Bse extends yB{constructor(n,r=[]){super("Die",n,r);S(this,"defect");this.defect=n}}const Hse=(e,t=[])=>new Bse(e,t);let qse=class extends yB{constructor(t=[]){super("Interrupt","interrupted",t)}};const Vse=(e=[])=>new qse(e),Kse=e=>e._tag==="Interrupt",DD=Symbol.for("effect/Micro/MicroFiber"),Gse={_A:ke,_E:ke};var PL;PL=DD;class Yse{constructor(t,n=!0){S(this,"context");S(this,"interruptible");S(this,PL);S(this,"_stack",[]);S(this,"_observers",[]);S(this,"_exit");S(this,"_children");S(this,"currentOpCount",0);S(this,"_interrupted",!1);S(this,"_yielded");this.context=t,this.interruptible=n,this[DD]=Gse}getRef(t){return Aee(this.context,t)}addObserver(t){return this._exit?(t(this._exit),bd):(this._observers.push(t),()=>{const n=this._observers.indexOf(t);n>=0&&this._observers.splice(n,1)})}unsafeInterrupt(){this._exit||(this._interrupted=!0,this.interruptible&&this.evaluate(cA))}unsafePoll(){return this._exit}evaluate(t){if(this._exit)return;if(this._yielded!==void 0){const i=this._yielded;this._yielded=void 0,i()}const n=this.runLoop(t);if(n===Vy)return;const r=jD.interruptChildren&&jD.interruptChildren(this);if(r!==void 0)return this.evaluate(i0(r,()=>n));this._exit=n;for(let i=0;i<this._observers.length;i++)this._observers[i](n);this._observers.length=0}runLoop(t){let n=!1,r=t;this.currentOpCount=0;try{for(;;){if(this.currentOpCount++,!n&&this.getRef(uA).shouldYield(this)){n=!0;const i=r;r=i0(Zse,()=>i)}if(r=r[lk](this),r===Vy){const i=this._yielded;return n0 in i?(this._yielded=void 0,i):Vy}}}catch(i){return Re(r,lk)?ck(i):ck(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`)}}getCont(t){for(;;){const n=this._stack.pop();if(!n)return;const r=n[r0]&&n[r0](this);if(r)return{[t]:r};if(n[t])return n}}yieldWith(t){return this._yielded=t,Vy}children(){return this._children??(this._children=new Set)}}const jD=je("effect/Micro/fiberMiddleware",()=>({interruptChildren:void 0})),bB=Symbol.for("effect/Micro/identifier"),jn=Symbol.for("effect/Micro/args"),lk=Symbol.for("effect/Micro/evaluate"),$d=Symbol.for("effect/Micro/successCont"),Wf=Symbol.for("effect/Micro/failureCont"),r0=Symbol.for("effect/Micro/ensureCont"),Vy=Symbol.for("effect/Micro/Yield"),Wse={_A:ke,_E:ke,_R:ke},Jse={...rse,_op:"Micro",[Fse]:Wse,pipe(){return he(this,arguments)},[Symbol.iterator](){return new M4(new kg(this))},toJSON(){return{_id:"Micro",op:this[bB],...jn in this?{args:this[jn]}:void 0}},toString(){return Rt(this)},[lt](){return Rt(this)}};function Xse(e){return ck("Micro.evaluate: Not implemented")}const gx=e=>({...Jse,[bB]:e.op,[lk]:e.eval??Xse,[$d]:e.contA,[Wf]:e.contE,[r0]:e.ensure}),aA=e=>{const t=gx(e);return function(){const n=Object.create(t);return n[jn]=e.single===!1?arguments:arguments[0],n}},vB=e=>{const t={...gx(e),[n0]:n0,_tag:e.op,get[e.prop](){return this[jn]},toJSON(){return{_id:"MicroExit",_tag:e.op,[e.prop]:this[jn]}},[ze](n){return nle(n)&&n._tag===e.op&&Se(this[jn],n[jn])},[Le](){return _t(this,Pe(Bt(e.op))(de(this[jn])))}};return function(n){const r=Object.create(t);return r[jn]=n,r[$d]=void 0,r[Wf]=void 0,r[r0]=void 0,r}},oA=vB({op:"Success",prop:"value",eval(e){const t=e.getCont($d);return t?t[$d](this[jn],e):e.yieldWith(this)}}),SB=vB({op:"Failure",prop:"cause",eval(e){let t=e.getCont(Wf);for(;Kse(this[jn])&&t&&e.interruptible;)t=e.getCont(Wf);return t?t[Wf](this[jn],e):e.yieldWith(this)}}),Qse=aA({op:"Yield",eval(e){let t=!1;return e.getRef(uA).scheduleTask(()=>{t||e.evaluate(rle)},this[jn]??0),e.yieldWith(()=>{t=!0})}}),Zse=Qse(0),ele=oA(void 0),sA=aA({op:"WithMicroFiber",eval(e){return this[jn](e)}}),i0=T(2,(e,t)=>{const n=Object.create(tle);return n[jn]=e,n[$d]=t,n}),tle=gx({op:"OnSuccess",eval(e){return e._stack.push(this),this[jn]}}),nle=e=>Re(e,n0),xB=oA,lA=SB,cA=lA(Vse()),ck=e=>lA(Hse(e)),rle=xB(void 0),ile="setImmediate"in globalThis?globalThis.setImmediate:e=>setTimeout(e,0);class wB{constructor(){S(this,"tasks",[]);S(this,"running",!1);S(this,"afterScheduled",()=>{this.running=!1,this.runTasks()})}scheduleTask(t,n){this.tasks.push(t),this.running||(this.running=!0,ile(this.afterScheduled))}runTasks(){const t=this.tasks;this.tasks=[];for(let n=0,r=t.length;n<r;n++)t[n]()}shouldYield(t){return t.currentOpCount>=t.getRef(sle)}flush(){for(;this.tasks.length>0;)this.runTasks()}}const ale=T(2,(e,t)=>sA(n=>{const r=n.context;return n.context=t(r),ule(e,()=>(n.context=r,ele))})),ole=T(2,(e,t)=>ale(e,ai(t)));class sle extends oh()("effect/Micro/currentMaxOpsBeforeYield",{defaultValue:()=>2048}){}class uA extends oh()("effect/Micro/currentScheduler",{defaultValue:()=>new wB}){}const lle=T(2,(e,t)=>{const n=Object.create(cle);return n[jn]=e,n[$d]=t.onSuccess,n[Wf]=t.onFailure,n}),cle=gx({op:"OnSuccessAndFailure",eval(e){return e._stack.push(this),this[jn]}}),ule=T(2,(e,t)=>dle(n=>lle(n(e),{onFailure:r=>i0(t(lA(r)),()=>SB(r)),onSuccess:r=>i0(t(xB(r)),()=>oA(r))}))),_B=aA({op:"SetInterruptible",ensure(e){if(e.interruptible=this[jn],e._interrupted&&e.interruptible)return()=>cA}}),fle=e=>sA(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push(_B(!1)),t._interrupted?cA:e)),dle=e=>sA(t=>t.interruptible?(t.interruptible=!1,t._stack.push(_B(!0)),e(fle)):e(ke)),hle=(e,t)=>{const n=new Yse(uA.context(new wB));return n.evaluate(e),n},a0=Symbol.for("effect/Readable"),EB=Symbol.for("effect/Ref"),kB={_A:e=>e};var FL,UL,BL;class mle extends(BL=bh,UL=EB,FL=a0,BL){constructor(n){super();S(this,"ref");S(this,UL,kB);S(this,FL,a0);S(this,"get");this.ref=n,this.get=ie(()=>Dn(this.ref))}commit(){return this.get}modify(n){return ie(()=>{const r=Dn(this.ref),[i,a]=n(r);return r!==a&&Og(a)(this.ref),i})}}const fA=e=>new mle(Ag(e)),o0=e=>ie(()=>fA(e)),lo=e=>e.get,Jf=T(2,(e,t)=>e.modify(()=>[void 0,t])),ple=T(2,(e,t)=>e.modify(n=>[n,t])),CB=T(2,(e,t)=>e.modify(t)),s0=T(2,(e,t)=>e.modify(n=>[void 0,t(n)])),dA=o0,gle=lo,yle=ple,Gh=CB,ble=Jf,vle=s0;class TB{constructor(){S(this,"buckets",[])}scheduleTask(t,n){const r=this.buckets.length;let i,a=0;for(;a<r&&this.buckets[a][0]<=n;a++)i=this.buckets[a];i&&i[0]===n?i[1].push(t):a===r?this.buckets.push([n,[t]]):this.buckets.splice(a,0,[n,[t]])}}class Sle{constructor(t){S(this,"maxNextTickBeforeTimer");S(this,"running",!1);S(this,"tasks",new TB);this.maxNextTickBeforeTimer=t}starveInternal(t){const n=this.tasks.buckets;this.tasks.buckets=[];for(const[r,i]of n)for(let a=0;a<i.length;a++)i[a]();this.tasks.buckets.length===0?this.running=!1:this.starve(t)}starve(t=0){t>=this.maxNextTickBeforeTimer?setTimeout(()=>this.starveInternal(0),0):Promise.resolve(void 0).then(()=>this.starveInternal(t+1))}shouldYield(t){return t.currentOpCount>t.getFiberRef(LU)?t.getFiberRef(ph):!1}scheduleTask(t,n){this.tasks.scheduleTask(t,n),this.running||(this.running=!0,this.starve())}}const RB=je(Symbol.for("effect/Scheduler/defaultScheduler"),()=>new Sle(2048));class hA{constructor(){S(this,"tasks",new TB);S(this,"deferred",!1)}scheduleTask(t,n){this.deferred?RB.scheduleTask(t,n):this.tasks.scheduleTask(t,n)}shouldYield(t){return t.currentOpCount>t.getFiberRef(LU)?t.getFiberRef(ph):!1}flush(){for(;this.tasks.buckets.length>0;){const t=this.tasks.buckets;this.tasks.buckets=[];for(const[n,r]of t)for(let i=0;i<r.length;i++)r[i]()}this.deferred=!0}}const mA=je(Symbol.for("effect/FiberRef/currentScheduler"),()=>Pn(RB)),AB=je(Symbol.for("effect/FiberRef/currentRequestMap"),()=>Pn(new Map)),ID=(e,t,n,r)=>{switch(e){case void 0:return t();case"unbounded":return n();case"inherit":return ax(jae,i=>i==="unbounded"?n():i>1?r(i):t());default:return e>1?r(e):t()}},xle=ese,wle=nse,_le=gh,OB=e=>e.replace(/[\s="]/g,"_"),Ele=e=>t=>`${OB(t.label)}=${e-t.startTime}ms`,MB="effect/MetricLabel",uk=Symbol.for(MB);var HL;class kle{constructor(t,n){S(this,"key");S(this,"value");S(this,HL,uk);S(this,"_hash");this.key=t,this.value=n,this._hash=Bt(MB+this.key+this.value)}[(HL=uk,Le)](){return this._hash}[ze](t){return Tle(t)&&this.key===t.key&&this.value===t.value}pipe(){return he(this,arguments)}}const Cle=(e,t)=>new kle(e,t),Tle=e=>Re(e,uk),Rle=e=>Je(e,ae),NB=e=>{let t,n;return typeof e=="function"?t=e:(t=e.try,n=e.catch),qe(()=>{try{return fe(ar(t))}catch(r){return sn(n?ar(()=>n(r)):new JR(r,"An unknown error occurred in Effect.try"))}})},Ale=e=>LB(e,jB,rA),Ole=e=>LB(e,rx(jB,hae),([t,n],[r,i])=>[rA(t,r),yl(n,i)]),DB=T(2,(e,t)=>Il(e,{onFailure:n=>fe(t.onFailure(n)),onSuccess:n=>fe(t.onSuccess(n))})),jB=ft(e=>fe(e.getFiberRefs())),Mle=e=>DB(e,{onFailure:bd,onSuccess:bd}),$D=T(2,(e,t)=>ia(e,{onFailure:n=>kU(()=>t(n)),onSuccess:fe})),Nle=e=>N(ux(),te(t=>N(Ole(e),RU(t),jle,Je(n=>nn(n,N($l(t),te(([r,i])=>Ur(rx(IB(r[0]),AU(r[1])),i)))))))),Dle=e=>Je(e,t=>!t),jle=e=>Je(dA(!0),t=>oa(HR(e,yle(t,!1)))),IB=e=>Ule((t,n)=>N(e,pB(t,n))),Ile=e=>e.length>=1?Ma((t,n)=>{try{e(n).then(r=>t(fe(r)),r=>t(al(r)))}catch(r){t(al(r))}}):Ma(t=>{try{e().then(n=>t(fe(n)),n=>t(al(n)))}catch(n){t(al(n))}}),$B=T(3,(e,t,n)=>Tu(r=>hx(e,Yi(r,t,n)))),LD=T(3,(e,t,n)=>Tu(r=>te(n,i=>hx(e,N(r,Yi(t,i)))))),$le=xle,Lle=fe(ne()),LB=T(3,(e,t,n)=>te(t,r=>te(e,i=>Je(t,a=>[n(r,a),i])))),zle=T(2,(e,t)=>ia(e,{onFailure:n=>nn(t(n),zn(n)),onSuccess:fe})),Ple=e=>{let t,n;typeof e=="function"?t=e:(t=e.try,n=e.catch);const r=i=>n?QS(()=>n(i)):sn(new JR(i,"An unknown error occurred in Effect.tryPromise"));return t.length>=1?Ma((i,a)=>{try{t(a).then(o=>i(fe(o)),o=>i(r(o)))}catch(o){i(r(o))}}):Ma(i=>{try{t().then(a=>i(fe(a)),a=>i(r(a)))}catch(a){i(r(a))}})},Fle=T(2,(e,t)=>te(e,n=>NB({try:()=>t.try(n),catch:t.catch}))),Ule=e=>ft(t=>(t.setFiberRefs(e(t.id(),t.getFiberRefs())),wt)),Ble=T(2,(e,t)=>qe(()=>t()?Je(e,ae):fe(ne()))),Hle=e=>new Proxy({},{get(t,n,r){return(...i)=>te(e,a=>a[n](...i))}}),zB=BigInt(0),PB=Cs(e=>ls(e.context,nk)?e._tag==="Span"?PB(e.parent):ne():ae(e)),qle=(e,t,n)=>{const r=!e.getFiberRef(zU)||n.context&&ls(n.context,nk),i=e.getFiberRef(_o),a=n.parent?ae(n.parent):n.root?ne():PB(ah(i,mx));let o;if(r)o=noe({name:t,parent:a,context:Yi(n.context??mo(),nk,!0)});else{const s=e.getFiberRef(Id),l=ls(s,nA),c=ls(s,_le),f=e.getFiberRef(PU),u=e.getFiberRefs(),d=AD(u,zae),h=AD(u,Pae),m=h._tag==="Some"?n.links!==void 0?[...Lr(h.value),...n.links??[]]:Lr(h.value):n.links??Ml();o=l.span(t,a,n.context??mo(),m,f?c.unsafeCurrentTimeNanos():zB,n.kind??"internal",n),d._tag==="Some"&&kre(d.value,(b,w)=>o.attribute(w,b)),n.attributes!==void 0&&Object.entries(n.attributes).forEach(([b,w])=>o.attribute(b,w))}return typeof n.captureStackTrace=="function"&&Kv.set(o,n.captureStackTrace),o},Vle=(e,t,n,r)=>ie(()=>{e.status._tag!=="Ended"&&(UU(t)&&Kv.has(e)&&e.attribute("code.stacktrace",Kv.get(e)()),e.end(r?n.unsafeCurrentTimeNanos():zB,t))}),Kle=(e,...t)=>{const n=Qoe(t.length===1?void 0:t[0]),r=t[t.length-1];return ft(i=>{const a=qle(i,e,n),o=i.getFiberRef(PU),s=ls(i.getFiberRef(Id),gh);return iu(r(a),l=>Vle(a,l,s,o))})},Gle=T(2,(e,t)=>$B(e,mx,t)),pA=UU,FB=Vae,Yle=Yf,Wle=BU,l0=Lp,xr=vt,Jle=Gae,Xle=$b,ts=lx,bi=xt,gA=Sr,zD=Wae,Up=HU,yA="InterruptSignal",bA="Stateful",vA="Resume",SA="YieldNow",_1=e=>({_tag:yA,cause:e}),Lb=e=>({_tag:bA,onFiber:e}),Ku=e=>({_tag:vA,effect:e}),Qle=()=>({_tag:SA}),Zle="effect/FiberScope",c0=Symbol.for(Zle);var qL;qL=c0;class ece{constructor(){S(this,qL,c0);S(this,"fiberId",Ei);S(this,"roots",new Set)}add(t,n){this.roots.add(n),n.addObserver(()=>{this.roots.delete(n)})}}var VL;VL=c0;class tce{constructor(t,n){S(this,"fiberId");S(this,"parent");S(this,VL,c0);this.fiberId=t,this.parent=n}add(t,n){this.parent.tell(Lb(r=>{r.addChild(n),n.addObserver(()=>{r.removeChild(n)})}))}}const nce=e=>new tce(e.id(),e),yx=je(Symbol.for("effect/FiberScope/Global"),()=>new ece),rce="effect/Fiber",ice=Symbol.for(rce),ace={_E:e=>e,_A:e=>e},oce="effect/Fiber",sce=Symbol.for(oce),lce=e=>e.await,cce=e=>e.inheritAll,Bp=e=>ix(ex(e.await),e.inheritAll);({...Rg});const zs="effect/FiberCurrent",uce=()=>sh(globalThis[zs]),fce="effect/Logger",dce=Symbol.for(fce),hce={_Message:e=>e,_Output:e=>e},xA=e=>({[dce]:hce,log:e,pipe(){return he(this,arguments)}}),mce=/^[^\s"=]*$/,pce=(e,t)=>({annotations:n,cause:r,date:i,fiberId:a,logLevel:o,message:s,spans:l})=>{const c=m=>m.match(mce)?m:e(m),f=(m,b)=>`${OB(m)}=${c(b)}`,u=(m,b)=>" "+f(m,b);let d=f("timestamp",i.toISOString());d+=u("level",o.label),d+=u("fiber",W5(a));const h=vte(s);for(let m=0;m<h.length;m++)d+=u("message",Sd(h[m],t));Ane(r)||(d+=u("cause",fh(r,{renderErrorCause:!0})));for(const m of l)d+=" "+Ele(i.getTime())(m);for(const[m,b]of n)d+=u(m,Sd(b,t));return d},gce=e=>`"${e.replace(/\\([\s\S])|(")/g,"\\$1$2")}"`,yce=xA(pce(gce)),bce=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;bce&&process.stdout.isTTY;const UB="effect/MetricBoundaries",fk=Symbol.for(UB);var KL;class vce{constructor(t){S(this,"values");S(this,KL,fk);S(this,"_hash");this.values=t,this._hash=N(Bt(UB),Pe(rh(this.values)))}[(KL=fk,Le)](){return this._hash}[ze](t){return Sce(t)&&Se(this.values,t.values)}pipe(){return he(this,arguments)}}const Sce=e=>Re(e,fk),xce=e=>{const t=N(e,yR(Cn(Number.POSITIVE_INFINITY)),Lte);return new vce(t)},wce=e=>N(bte(e.count-1,t=>e.start*Math.pow(e.factor,t)),Mr,xce),_ce="effect/MetricKeyType",BB=Symbol.for(_ce),HB="effect/MetricKeyType/Counter",dk=Symbol.for(HB),Ece="effect/MetricKeyType/Frequency",kce=Symbol.for(Ece),Cce="effect/MetricKeyType/Gauge",Tce=Symbol.for(Cce),qB="effect/MetricKeyType/Histogram",hk=Symbol.for(qB),Rce="effect/MetricKeyType/Summary",Ace=Symbol.for(Rce),VB={_In:e=>e,_Out:e=>e};var GL,YL;class Oce{constructor(t,n){S(this,"incremental");S(this,"bigint");S(this,YL,VB);S(this,GL,dk);S(this,"_hash");this.incremental=t,this.bigint=n,this._hash=Bt(HB)}[(YL=BB,GL=dk,Le)](){return this._hash}[ze](t){return KB(t)}pipe(){return he(this,arguments)}}var WL,JL;class Mce{constructor(t){S(this,"boundaries");S(this,JL,VB);S(this,WL,hk);S(this,"_hash");this.boundaries=t,this._hash=N(Bt(qB),Pe(de(this.boundaries)))}[(JL=BB,WL=hk,Le)](){return this._hash}[ze](t){return GB(t)&&Se(this.boundaries,t.boundaries)}pipe(){return he(this,arguments)}}const Nce=e=>new Oce((e==null?void 0:e.incremental)??!1,(e==null?void 0:e.bigint)??!1),Dce=e=>new Mce(e),KB=e=>Re(e,dk),jce=e=>Re(e,kce),Ice=e=>Re(e,Tce),GB=e=>Re(e,hk),$ce=e=>Re(e,Ace),Lce="effect/MetricKey",YB=Symbol.for(Lce),zce={_Type:e=>e},Pce=IS(Se);var XL;class wA{constructor(t,n,r,i=[]){S(this,"name");S(this,"keyType");S(this,"description");S(this,"tags");S(this,XL,zce);S(this,"_hash");this.name=t,this.keyType=n,this.description=r,this.tags=i,this._hash=N(Bt(this.name+this.description),Pe(de(this.keyType)),Pe(rh(this.tags)))}[(XL=YB,Le)](){return this._hash}[ze](t){return Fce(t)&&this.name===t.name&&Se(this.keyType,t.keyType)&&Se(this.description,t.description)&&Pce(this.tags,t.tags)}pipe(){return he(this,arguments)}}const Fce=e=>Re(e,YB),Uce=(e,t)=>new wA(e,Nce(t),sh(t==null?void 0:t.description)),Bce=(e,t,n)=>new wA(e,Dce(t),sh(n)),Hce=T(2,(e,t)=>t.length===0?e:new wA(e.name,e.keyType,e.description,Nb(e.tags,t))),PD=Symbol.for("effect/MutableHashMap"),qce={[PD]:PD,[Symbol.iterator](){return new _A(this)},toString(){return Rt(this.toJSON())},toJSON(){return{_id:"MutableHashMap",values:Array.from(this).map(Jt)}},[lt](){return this.toJSON()},pipe(){return he(this,arguments)}};class _A{constructor(t){S(this,"self");S(this,"referentialIterator");S(this,"bucketIterator");this.self=t,this.referentialIterator=t.referential[Symbol.iterator]()}next(){if(this.bucketIterator!==void 0)return this.bucketIterator.next();const t=this.referentialIterator.next();return t.done?(this.bucketIterator=new Vce(this.self.buckets.values()),this.next()):t}[Symbol.iterator](){return new _A(this.self)}}class Vce{constructor(t){S(this,"backing");S(this,"currentBucket");this.backing=t}next(){if(this.currentBucket===void 0){const n=this.backing.next();if(n.done)return n;this.currentBucket=n.value[Symbol.iterator]()}const t=this.currentBucket.next();return t.done?(this.currentBucket=void 0,this.next()):t}}const mk=()=>{const e=Object.create(qce);return e.referential=new Map,e.buckets=new Map,e.bucketsSize=0,e},Vo=T(2,(e,t)=>{if(Tp(t)===!1)return e.referential.has(t)?ae(e.referential.get(t)):ne();const n=t[Le](),r=e.buckets.get(n);return r===void 0?ne():Kce(e,r,t)}),Kce=(e,t,n,r=!1)=>{for(let i=0,a=t.length;i<a;i++)if(n[ze](t[i][0])){const o=t[i][1];return r&&(t.splice(i,1),e.bucketsSize--),ae(o)}return ne()},Yh=T(2,(e,t)=>Dt(Vo(e,t))),wc=T(3,(e,t,n)=>{if(Tp(t)===!1)return e.referential.set(t,n),e;const r=t[Le](),i=e.buckets.get(r);return i===void 0?(e.buckets.set(r,[[t,n]]),e.bucketsSize++,e):(WB(e,i,t),i.push([t,n]),e.bucketsSize++,e)}),WB=(e,t,n)=>{for(let r=0,i=t.length;r<i;r++)if(n[ze](t[r][0])){t.splice(r,1),e.bucketsSize--;return}},Gce=T(2,(e,t)=>{if(Tp(t)===!1)return e.referential.delete(t),e;const n=t[Le](),r=e.buckets.get(n);return r===void 0||(WB(e,r,t),r.length===0&&e.buckets.delete(n)),e}),Yce="effect/MetricState",Fg=Symbol.for(Yce),JB="effect/MetricState/Counter",pk=Symbol.for(JB),XB="effect/MetricState/Frequency",gk=Symbol.for(XB),QB="effect/MetricState/Gauge",yk=Symbol.for(QB),ZB="effect/MetricState/Histogram",bk=Symbol.for(ZB),e6="effect/MetricState/Summary",vk=Symbol.for(e6),Ug={_A:e=>e};var QL,ZL;class Wce{constructor(t){S(this,"count");S(this,ZL,Ug);S(this,QL,pk);this.count=t}[(ZL=Fg,QL=pk,Le)](){return N(de(JB),Pe(de(this.count)),_t(this))}[ze](t){return oue(t)&&this.count===t.count}pipe(){return he(this,arguments)}}const Jce=IS(Se);var ez,tz;class Xce{constructor(t){S(this,"occurrences");S(this,tz,Ug);S(this,ez,gk);S(this,"_hash");this.occurrences=t}[(tz=Fg,ez=gk,Le)](){return N(Bt(XB),Pe(rh(gt(this.occurrences.entries()))),_t(this))}[ze](t){return sue(t)&&Jce(gt(this.occurrences.entries()),gt(t.occurrences.entries()))}pipe(){return he(this,arguments)}}var nz,rz;class Qce{constructor(t){S(this,"value");S(this,rz,Ug);S(this,nz,yk);this.value=t}[(rz=Fg,nz=yk,Le)](){return N(de(QB),Pe(de(this.value)),_t(this))}[ze](t){return lue(t)&&this.value===t.value}pipe(){return he(this,arguments)}}var iz,az;class Zce{constructor(t,n,r,i,a){S(this,"buckets");S(this,"count");S(this,"min");S(this,"max");S(this,"sum");S(this,az,Ug);S(this,iz,bk);this.buckets=t,this.count=n,this.min=r,this.max=i,this.sum=a}[(az=Fg,iz=bk,Le)](){return N(de(ZB),Pe(de(this.buckets)),Pe(de(this.count)),Pe(de(this.min)),Pe(de(this.max)),Pe(de(this.sum)),_t(this))}[ze](t){return cue(t)&&Se(this.buckets,t.buckets)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return he(this,arguments)}}var oz,sz;class eue{constructor(t,n,r,i,a,o){S(this,"error");S(this,"quantiles");S(this,"count");S(this,"min");S(this,"max");S(this,"sum");S(this,sz,Ug);S(this,oz,vk);this.error=t,this.quantiles=n,this.count=r,this.min=i,this.max=a,this.sum=o}[(sz=Fg,oz=vk,Le)](){return N(de(e6),Pe(de(this.error)),Pe(de(this.quantiles)),Pe(de(this.count)),Pe(de(this.min)),Pe(de(this.max)),Pe(de(this.sum)),_t(this))}[ze](t){return uue(t)&&this.error===t.error&&Se(this.quantiles,t.quantiles)&&this.count===t.count&&this.min===t.min&&this.max===t.max&&this.sum===t.sum}pipe(){return he(this,arguments)}}const tue=e=>new Wce(e),nue=e=>new Xce(e),rue=e=>new Qce(e),iue=e=>new Zce(e.buckets,e.count,e.min,e.max,e.sum),aue=e=>new eue(e.error,e.quantiles,e.count,e.min,e.max,e.sum),oue=e=>Re(e,pk),sue=e=>Re(e,gk),lue=e=>Re(e,yk),cue=e=>Re(e,bk),uue=e=>Re(e,vk),fue="effect/MetricHook",due=Symbol.for(fue),hue={_In:e=>e,_Out:e=>e},Bg=e=>({[due]:hue,pipe(){return he(this,arguments)},...e}),FD=BigInt(0),mue=e=>{let t=e.keyType.bigint?FD:0;const n=e.keyType.incremental?e.keyType.bigint?i=>i>=FD:i=>i>=0:i=>!0,r=i=>{n(i)&&(t=t+i)};return Bg({get:()=>tue(t),update:r,modify:r})},pue=e=>{const t=new Map;for(const r of e.keyType.preregisteredWords)t.set(r,0);const n=r=>{const i=t.get(r)??0;t.set(r,i+1)};return Bg({get:()=>nue(t),update:n,modify:n})},gue=(e,t)=>{let n=t;return Bg({get:()=>rue(n),update:r=>{n=r},modify:r=>{n=n+r}})},yue=e=>{const t=e.keyType.boundaries.values,n=t.length,r=new Uint32Array(n+1),i=new Float64Array(n);let a=0,o=0,s=Number.MAX_VALUE,l=Number.MIN_VALUE;N(t,Rp(jd),zc((u,d)=>{i[d]=u}));const c=u=>{let d=0,h=n;for(;d!==h;){const m=Math.floor(d+(h-d)/2),b=i[m];u<=b?h=m:d=m,h===d+1&&(u<=i[d]?h=d:d=h)}r[d]=r[d]+1,a=a+1,o=o+u,u<s&&(s=u),u>l&&(l=u)},f=()=>{const u=jS(n);let d=0;for(let h=0;h<n;h++){const m=i[h],b=r[h];d=d+b,u[h]=[m,d]}return u};return Bg({get:()=>iue({buckets:f(),count:a,min:s,max:l,sum:o}),update:c,modify:c})},bue=e=>{const{error:t,maxAge:n,maxSize:r,quantiles:i}=e.keyType,a=N(i,Rp(jd)),o=jS(r);let s=0,l=0,c=0,f=0,u=0;const d=m=>{const b=[];let w=0;for(;w!==r-1;){const g=o[w];if(g!=null){const[v,x]=g,E=Od(m-v);ore(E,Ad)&&are(E,n)&&b.push(x)}w=w+1}return vue(t,a,Rp(b,jd))},h=(m,b)=>{if(r>0){s=s+1;const w=s%r;o[w]=[b,m]}f=l===0?m:Math.min(f,m),u=l===0?m:Math.max(u,m),l=l+1,c=c+m};return Bg({get:()=>aue({error:t,quantiles:d(Date.now()),count:l,min:f,max:u,sum:c}),update:([m,b])=>h(m,b),modify:([m,b])=>h(m,b)})},vue=(e,t,n)=>{const r=n.length;if(!on(t))return Ml();const i=t[0],a=t.slice(1),o=UD(e,r,ne(),0,i,n),s=ga(o);return a.forEach(l=>{s.push(UD(e,r,o.value,o.consumed,l,o.rest))}),zc(s,l=>[l.quantile,l.value])},UD=(e,t,n,r,i,a)=>{let o=e,s=t,l=n,c=r,f=i,u=a,d=e,h=t,m=n,b=r,w=i,g=a;for(;;){if(!on(u))return{quantile:f,value:ne(),consumed:c,rest:[]};if(f===1)return{quantile:f,value:ae(d5(u)),consumed:c+u.length,rest:[]};const v=$r(u),x=Ate(u,A=>A===v),E=f*s,C=o/2*E,k=c+x[0].length,_=Math.abs(k-E);if(k<E-C){d=o,h=s,m=qm(u),b=k,w=f,g=x[1],o=d,s=h,l=m,c=b,f=w,u=g;continue}if(k>E+C){const A=Vt(l)?ae(v):l;return{quantile:f,value:A,consumed:c,rest:u}}switch(l._tag){case"None":{d=o,h=s,m=qm(u),b=k,w=f,g=x[1],o=d,s=h,l=m,c=b,f=w,u=g;continue}case"Some":{const A=Math.abs(E-l.value);if(_<A){d=o,h=s,m=qm(u),b=k,w=f,g=x[1],o=d,s=h,l=m,c=b,f=w,u=g;continue}return{quantile:f,value:ae(l.value),consumed:c,rest:u}}}}throw new Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues")},Sue="effect/MetricPair",xue=Symbol.for(Sue),wue={_Type:e=>e},_ue=(e,t)=>({[xue]:wue,metricKey:e,metricState:t,pipe(){return he(this,arguments)}}),Eue="effect/MetricRegistry",BD=Symbol.for(Eue);var lz;lz=BD;class kue{constructor(){S(this,lz,BD);S(this,"map",mk())}snapshot(){const t=[];for(const[n,r]of this.map)t.push(_ue(n,r.get()));return t}get(t){const n=N(this.map,Vo(t),Bi);if(n==null){if(KB(t.keyType))return this.getCounter(t);if(Ice(t.keyType))return this.getGauge(t);if(jce(t.keyType))return this.getFrequency(t);if(GB(t.keyType))return this.getHistogram(t);if($ce(t.keyType))return this.getSummary(t);throw new Error("BUG: MetricRegistry.get - unknown MetricKeyType - please report an issue at https://github.com/Effect-TS/effect/issues")}else return n}getCounter(t){let n=N(this.map,Vo(t),Bi);if(n==null){const r=mue(t);N(this.map,Yh(t))||N(this.map,wc(t,r)),n=r}return n}getFrequency(t){let n=N(this.map,Vo(t),Bi);if(n==null){const r=pue(t);N(this.map,Yh(t))||N(this.map,wc(t,r)),n=r}return n}getGauge(t){let n=N(this.map,Vo(t),Bi);if(n==null){const r=gue(t,t.keyType.bigint?BigInt(0):0);N(this.map,Yh(t))||N(this.map,wc(t,r)),n=r}return n}getHistogram(t){let n=N(this.map,Vo(t),Bi);if(n==null){const r=yue(t);N(this.map,Yh(t))||N(this.map,wc(t,r)),n=r}return n}getSummary(t){let n=N(this.map,Vo(t),Bi);if(n==null){const r=bue(t);N(this.map,Yh(t))||N(this.map,wc(t,r)),n=r}return n}}const Cue=()=>new kue,Tue="effect/Metric",Rue=Symbol.for(Tue),Aue={_Type:e=>e,_In:e=>e,_Out:e=>e},HD=je(Symbol.for("effect/Metric/globalMetricRegistry"),()=>Cue()),t6=function(e,t,n,r){const i=Object.assign(a=>BR(a,o=>Due(i,o)),{[Rue]:Aue,keyType:e,unsafeUpdate:t,unsafeValue:n,unsafeModify:r,register(){return this.unsafeValue([]),this},pipe(){return he(this,arguments)}});return i},bx=(e,t)=>n6(Uce(e,t)),n6=e=>{let t;const n=new WeakMap,r=i=>{if(i.length===0)return t!==void 0||(t=HD.get(e)),t;let a=n.get(i);return a!==void 0||(a=HD.get(Hce(e,i)),n.set(i,a)),a};return t6(e.keyType,(i,a)=>r(a).update(i),i=>r(i).get(),(i,a)=>r(a).modify(i))},Oue=(e,t,n)=>n6(Bce(e,t,n)),Mue=T(3,(e,t,n)=>Nue(e,[Cle(t,n)])),Nue=T(2,(e,t)=>t6(e.keyType,(n,r)=>e.unsafeUpdate(n,Nb(t,r)),n=>e.unsafeValue(Nb(t,n)),(n,r)=>e.unsafeModify(n,Nb(t,r)))),Due=T(2,(e,t)=>ax(XE,n=>ie(()=>e.unsafeUpdate(t,n))));({...Tg});const jue=T(2,(e,t)=>ax(AB,n=>ie(()=>{if(n.has(e)){const r=n.get(e);r.state.completed||(r.state.completed=!0,dx(r.result,t))}}))),Iue="effect/Supervisor",vx=Symbol.for(Iue),EA={_T:e=>e};var cz;cz=vx;const $2=class $2{constructor(t,n){S(this,"underlying");S(this,"value0");S(this,cz,EA);this.underlying=t,this.value0=n}get value(){return this.value0}onStart(t,n,r,i){this.underlying.onStart(t,n,r,i)}onEnd(t,n){this.underlying.onEnd(t,n)}onEffect(t,n){this.underlying.onEffect(t,n)}onSuspend(t){this.underlying.onSuspend(t)}onResume(t){this.underlying.onResume(t)}map(t){return new $2(this,N(this.value,Je(t)))}zip(t){return new f0(this,t)}};let u0=$2;var uz;uz=vx;const L2=class L2{constructor(t,n){S(this,"left");S(this,"right");S(this,"_tag","Zip");S(this,uz,EA);this.left=t,this.right=n}get value(){return rx(this.left.value,this.right.value)}onStart(t,n,r,i){this.left.onStart(t,n,r,i),this.right.onStart(t,n,r,i)}onEnd(t,n){this.left.onEnd(t,n),this.right.onEnd(t,n)}onEffect(t,n){this.left.onEffect(t,n),this.right.onEffect(t,n)}onSuspend(t){this.left.onSuspend(t),this.right.onSuspend(t)}onResume(t){this.left.onResume(t),this.right.onResume(t)}map(t){return new u0(this,N(this.value,Je(t)))}zip(t){return new L2(this,t)}};let f0=L2;const r6=e=>Re(e,vx)&&tR(e,"Zip");var fz;fz=vx;class $ue{constructor(t){S(this,"effect");S(this,fz,EA);this.effect=t}get value(){return this.effect}onStart(t,n,r,i){}onEnd(t,n){}onEffect(t,n){}onSuspend(t){}onResume(t){}map(t){return new u0(this,N(this.value,Je(t)))}zip(t){return new f0(this,t)}onRun(t,n){return t()}}const Lue=e=>new $ue(e),Sx=je("effect/Supervisor/none",()=>Lue(wt)),zue=dh,i6="Empty",a6="AddSupervisor",o6="RemoveSupervisor",s6="AndThen",Gm={_tag:i6},zb=(e,t)=>({_tag:s6,first:e,second:t}),Pue=(e,t)=>Fue(t,Cn(e)),Fue=(e,t)=>{let n=e,r=t;for(;bs(r);){const i=to(r);switch(i._tag){case i6:{r=Zo(r);break}case a6:{n=n.zip(i.supervisor),r=Zo(r);break}case o6:{n=Sk(n,i.supervisor),r=Zo(r);break}case s6:{r=Er(i.first)(Er(i.second)(Zo(r)));break}}}return n},Sk=(e,t)=>Se(e,t)?Sx:r6(e)?Sk(e.left,t).zip(Sk(e.right,t)):e,d0=e=>Se(e,Sx)?Qc():r6(e)?N(d0(e.left),Mp(d0(e.right))):OR(e),Uue=(e,t)=>{if(Se(e,t))return Gm;const n=d0(e),r=d0(t),i=N(r,WN(n),Np(Gm,(o,s)=>zb(o,{_tag:a6,supervisor:s}))),a=N(n,WN(r),Np(Gm,(o,s)=>zb(o,{_tag:o6,supervisor:s})));return zb(i,a)},Bue=zue({empty:Gm,patch:Pue,combine:zb,diff:Uue}),Hue=bx("effect_fiber_started",{incremental:!0}),qD=bx("effect_fiber_active"),que=bx("effect_fiber_successes",{incremental:!0}),Vue=bx("effect_fiber_failures",{incremental:!0}),Kue=Mue(Oue("effect_fiber_lifetimes",wce({start:.5,factor:2,count:35})),"time_unit","milliseconds"),Wh="Continue",Gue="Done",VD="Yield",Yue={_E:e=>e,_A:e=>e},Ky=e=>{throw new Error(`BUG: FiberRuntime - ${Sd(e)} - please report an issue at https://github.com/Effect-TS/effect/issues`)},jo=Symbol.for("effect/internal/fiberRuntime/YieldedOp"),Io=je("effect/internal/fiberRuntime/yieldedOpChannel",()=>({currentOp:null})),Jh={[Lv]:(e,t,n)=>ar(()=>t.effect_instruction_i1(n)),OnStep:(e,t,n)=>xt(xt(n)),[zv]:(e,t,n)=>ar(()=>t.effect_instruction_i2(n)),[oR]:(e,t,n)=>(e.patchRuntimeFlags(e.currentRuntimeFlags,t.patch),Hs(e.currentRuntimeFlags)&&e.isInterrupted()?vt(e.getInterruptedCause()):xt(n)),[Pv]:(e,t,n)=>(ar(()=>t.effect_instruction_i2(n)),ar(()=>t.effect_instruction_i0())?(e.pushStack(t),ar(()=>t.effect_instruction_i1())):wt),[Hm]:(e,t,n)=>{for(;;){const r=ar(()=>t.effect_instruction_i0.next(n));if(r.done)return xt(r.value);const i=WZ(r.value);if(sx(i)){if(i._tag==="Failure")return i}else return e.pushStack(t),i;n=i.value}}},Wue={[yA]:(e,t,n,r)=>(e.processNewInterruptSignal(r.cause),Hs(t)?vt(r.cause):n),[vA]:(e,t,n,r)=>{throw new Error("It is illegal to have multiple concurrent run loops in a single fiber")},[bA]:(e,t,n,r)=>(r.onFiber(e,gB(t)),n),[SA]:(e,t,n,r)=>te(VR(),()=>n)},Jue=e=>tx(Hie(e),t=>co(rae(t),([n,r])=>{const i=new Map,a=[];for(const s of r){a.push(Lr(s));for(const l of s)i.set(l.request,l)}const o=a.flat();return hh(vfe(n.runAll(a),o,()=>o.forEach(s=>{s.listeners.interrupted=!0})),AB,i)},!1,!1)),Xue=sR();var dz,hz;class l6 extends bh{constructor(n,r,i){super();S(this,hz,ace);S(this,dz,Yue);S(this,"_fiberRefs");S(this,"_fiberId");S(this,"_queue",new Array);S(this,"_children",null);S(this,"_observers",new Array);S(this,"_running",!1);S(this,"_stack",[]);S(this,"_asyncInterruptor",null);S(this,"_asyncBlockingOn",null);S(this,"_exitValue",null);S(this,"_steps",[]);S(this,"_isYielding",!1);S(this,"currentRuntimeFlags");S(this,"currentOpCount",0);S(this,"currentSupervisor");S(this,"currentScheduler");S(this,"currentTracer");S(this,"currentSpan");S(this,"currentContext");S(this,"currentDefaultServices");S(this,"run",()=>{this.drainQueueOnCurrentThread()});if(this.currentRuntimeFlags=i,this._fiberId=n,this._fiberRefs=r,sD(i)){const a=this.getFiberRef(XE);Hue.unsafeUpdate(1,a),qD.unsafeUpdate(1,a)}this.refreshRefCache()}commit(){return Bp(this)}id(){return this._fiberId}resume(n){this.tell(Ku(n))}get status(){return this.ask((n,r)=>r)}get runtimeFlags(){return this.ask((n,r)=>Rse(r)?n.currentRuntimeFlags:r.runtimeFlags)}scope(){return nce(this)}get children(){return this.ask(n=>Array.from(n.getChildren()))}getChildren(){return this._children===null&&(this._children=new Set),this._children}getInterruptedCause(){return this.getFiberRef(qy)}fiberRefs(){return this.ask(n=>n.getFiberRefs())}ask(n){return qe(()=>{const r=cx(this._fiberId);return this.tell(Lb((i,a)=>{dx(r,ie(()=>n(i,a)))})),$l(r)})}tell(n){this._queue.push(n),this._running||(this._running=!0,this.drainQueueLaterOnExecutor())}get await(){return Ma(n=>{const r=i=>n(fe(i));if(this._exitValue!==null){r(this._exitValue);return}return this.tell(Lb((i,a)=>{i._exitValue!==null?r(this._exitValue):i.addObserver(r)})),ie(()=>this.tell(Lb((i,a)=>{i.removeObserver(r)})))},this.id())}get inheritAll(){return ft((n,r)=>{const i=n.id(),a=n.getFiberRefs(),o=r.runtimeFlags,s=this.getFiberRefs(),l=dse(a,i,s);n.setFiberRefs(l);const c=n.getFiberRef(WD),f=N(yl(o,c),cD(Cu),cD(WE));return AU(f)})}get poll(){return ie(()=>sh(this._exitValue))}unsafePoll(){return this._exitValue}interruptAsFork(n){return ie(()=>this.tell(_1(va(n))))}unsafeInterruptAsFork(n){this.tell(_1(va(n)))}addObserver(n){this._exitValue!==null?n(this._exitValue):this._observers.push(n)}removeObserver(n){this._observers=this._observers.filter(r=>r!==n)}getFiberRefs(){return this.setFiberRef(WD,this.currentRuntimeFlags),this._fiberRefs}unsafeDeleteFiberRef(n){this._fiberRefs=sB(this._fiberRefs,n)}getFiberRef(n){return this._fiberRefs.locals.has(n)?this._fiberRefs.locals.get(n)[0][1]:n.initial}setFiberRef(n,r){this._fiberRefs=ok(this._fiberRefs,{fiberId:this._fiberId,fiberRef:n,value:r}),this.refreshRefCache()}refreshRefCache(){this.currentDefaultServices=this.getFiberRef(Id),this.currentTracer=this.currentDefaultServices.unsafeMap.get(nA.key),this.currentSupervisor=this.getFiberRef(gfe),this.currentScheduler=this.getFiberRef(mA),this.currentContext=this.getFiberRef(_o),this.currentSpan=this.currentContext.unsafeMap.get(mx.key)}setFiberRefs(n){this._fiberRefs=n,this.refreshRefCache()}addChild(n){this.getChildren().add(n)}removeChild(n){this.getChildren().delete(n)}transferChildren(n){const r=this._children;if(this._children=null,r!==null&&r.size>0)for(const i of r)i._exitValue===null&&n.add(this.currentRuntimeFlags,i)}drainQueueOnCurrentThread(){let n=!0;for(;n;){let r=Wh;const i=globalThis[zs];globalThis[zs]=this;try{for(;r===Wh;)r=this._queue.length===0?Gue:this.evaluateMessageWhileSuspended(this._queue.splice(0,1)[0])}finally{this._running=!1,globalThis[zs]=i}this._queue.length>0&&!this._running?(this._running=!0,r===VD?(this.drainQueueLaterOnExecutor(),n=!1):n=!0):n=!1}}drainQueueLaterOnExecutor(){this.currentScheduler.scheduleTask(this.run,this.getFiberRef(ph))}drainQueueWhileRunning(n,r){let i=r;for(;this._queue.length>0;){const a=this._queue.splice(0,1)[0];i=Wue[a._tag](this,n,i,a)}return i}isInterrupted(){return!Mne(this.getFiberRef(qy))}addInterruptedCause(n){const r=this.getFiberRef(qy);this.setFiberRef(qy,vr(r,n))}processNewInterruptSignal(n){this.addInterruptedCause(n),this.sendInterruptSignalToAllChildren()}sendInterruptSignalToAllChildren(){if(this._children===null||this._children.size===0)return!1;let n=!1;for(const r of this._children)r.tell(_1(va(this.id()))),n=!0;return n}interruptAllChildren(){if(this.sendInterruptSignalToAllChildren()){const n=this._children.values();this._children=null;let r=!1;return qR({while:()=>!r,body:()=>{const a=n.next();return a.done?ie(()=>{r=!0}):oa(a.value.await)},step:()=>{}})}return null}reportExitValue(n){if(sD(this.currentRuntimeFlags)){const r=this.getFiberRef(XE),i=this.id().startTimeMillis,a=Date.now();switch(Kue.unsafeUpdate(a-i,r),qD.unsafeUpdate(-1,r),n._tag){case Jn:{que.unsafeUpdate(1,r);break}case Wn:{Vue.unsafeUpdate(1,r);break}}}if(n._tag==="Failure"){const r=this.getFiberRef($ae);!qS(n.cause)&&r._tag==="Some"&&this.log("Fiber terminated with an unhandled error",n.cause,r)}}setExitValue(n){this._exitValue=n,this.reportExitValue(n);for(let r=this._observers.length-1;r>=0;r--)this._observers[r](n);this._observers=[]}getLoggers(){return this.getFiberRef(nfe)}log(n,r,i){const a=Dt(i)?i.value:this.getFiberRef(Mae),o=this.getFiberRef(Que);if(zse(o,a))return;const s=this.getFiberRef(Nae),l=this.getFiberRef(Oae),c=this.getLoggers(),f=this.getFiberRefs();if(MR(c)>0){const u=ls(this.getFiberRef(Id),gh),d=new Date(u.unsafeCurrentTimeMillis());nee(f,()=>{for(const h of c)h.log({fiberId:this.id(),logLevel:a,message:n,cause:r,context:f,spans:s,annotations:l,date:d})})}}evaluateMessageWhileSuspended(n){switch(n._tag){case SA:return VD;case yA:return this.processNewInterruptSignal(n.cause),this._asyncInterruptor!==null&&(this._asyncInterruptor(vt(n.cause)),this._asyncInterruptor=null),Wh;case vA:return this._asyncInterruptor=null,this._asyncBlockingOn=null,this.evaluateEffect(n.effect),Wh;case bA:return n.onFiber(this,this._exitValue!==null?Cse:Tse(this.currentRuntimeFlags,this._asyncBlockingOn)),Wh;default:return Ky(n)}}evaluateEffect(n){this.currentSupervisor.onResume(this);try{let r=Hs(this.currentRuntimeFlags)&&this.isInterrupted()?vt(this.getInterruptedCause()):n;for(;r!==null;){const i=r,a=this.runLoop(i);if(a===jo){const o=Io.currentOp;Io.currentOp=null,o._op===Mb?Lie(this.currentRuntimeFlags)?(this.tell(Qle()),this.tell(Ku(Sr)),r=null):r=Sr:o._op===Bm&&(r=null)}else{this.currentRuntimeFlags=N(this.currentRuntimeFlags,Pie(WE));const o=this.interruptAllChildren();o!==null?r=te(o,()=>a):(this._queue.length===0?this.setExitValue(a):this.tell(Ku(a)),r=null)}}}finally{this.currentSupervisor.onSuspend(this)}}start(n){if(this._running)this.tell(Ku(n));else{this._running=!0;const r=globalThis[zs];globalThis[zs]=this;try{this.evaluateEffect(n)}finally{this._running=!1,globalThis[zs]=r,this._queue.length>0&&this.drainQueueLaterOnExecutor()}}}startFork(n){this.tell(Ku(n))}patchRuntimeFlags(n,r){const i=Gf(n,r);return globalThis[zs]=this,this.currentRuntimeFlags=i,i}initiateAsync(n,r){let i=!1;const a=o=>{i||(i=!0,this.tell(Ku(o)))};Hs(n)&&(this._asyncInterruptor=a);try{r(a)}catch(o){a(zn(Qi(o)))}}pushStack(n){this._stack.push(n),n._op==="OnStep"&&this._steps.push({refs:this.getFiberRefs(),flags:this.currentRuntimeFlags})}popStack(){const n=this._stack.pop();if(n)return n._op==="OnStep"&&this._steps.pop(),n}getNextSuccessCont(){let n=this.popStack();for(;n;){if(n._op!==Ob)return n;n=this.popStack()}}getNextFailCont(){let n=this.popStack();for(;n;){if(n._op!==Lv&&n._op!==Pv&&n._op!==Hm)return n;n=this.popStack()}}[(hz=ice,dz=sce,ree)](n){return ie(()=>W4(this.currentContext,n))}Left(n){return sn(n.left)}None(n){return sn(new ox)}Right(n){return xt(n.right)}Some(n){return xt(n.value)}Micro(n){return Jv(r=>{let i=r;const a=hle(ole(n,this.currentContext));return a.addObserver(o=>{if(o._tag==="Success")return i(xt(o.value));switch(o.cause._tag){case"Interrupt":return i(vt(va(Ei)));case"Fail":return i(sn(o.cause.error));case"Die":return i(al(o.cause.defect))}}),Jv(o=>{i=s=>{o(wt)},a.unsafeInterrupt()})})}[z4](n){const r=ar(()=>n.effect_instruction_i0()),i=this.getNextSuccessCont();return i!==void 0?(i._op in Jh||Ky(i),Jh[i._op](this,i,r)):(Io.currentOp=xt(r),jo)}[Jn](n){const r=n,i=this.getNextSuccessCont();return i!==void 0?(i._op in Jh||Ky(i),Jh[i._op](this,i,r.effect_instruction_i0)):(Io.currentOp=r,jo)}[Wn](n){const r=n.effect_instruction_i0,i=this.getNextFailCont();if(i!==void 0)switch(i._op){case Ob:case zv:return Hs(this.currentRuntimeFlags)&&this.isInterrupted()?vt(JN(r)):ar(()=>i.effect_instruction_i1(r));case"OnStep":return Hs(this.currentRuntimeFlags)&&this.isInterrupted()?vt(JN(r)):xt(vt(r));case oR:return this.patchRuntimeFlags(this.currentRuntimeFlags,i.patch),Hs(this.currentRuntimeFlags)&&this.isInterrupted()?vt(vr(r,this.getInterruptedCause())):vt(r);default:Ky(i)}else return Io.currentOp=vt(r),jo}[P4](n){return ar(()=>n.effect_instruction_i0(this,gB(this.currentRuntimeFlags)))}Blocked(n){const r=this.getFiberRefs(),i=this.currentRuntimeFlags;if(this._steps.length>0){const a=[],o=this._steps[this._steps.length-1];let s=this.popStack();for(;s&&s._op!=="OnStep";)a.push(s),s=this.popStack();this.setFiberRefs(o.refs),this.currentRuntimeFlags=o.flags;const l=Pp(o.refs,r),c=yl(o.flags,i);return xt(bU(n.effect_instruction_i0,ft(f=>{for(;a.length>0;)f.pushStack(a.pop());return f.setFiberRefs(Fp(f.id(),f.getFiberRefs())(l)),f.currentRuntimeFlags=Gf(c)(f.currentRuntimeFlags),n.effect_instruction_i1})))}return Na(a=>te(kA(lae(n.effect_instruction_i0)),()=>a(n.effect_instruction_i1)))}RunBlocked(n){return Jue(n.effect_instruction_i0)}[ih](n){const r=n.effect_instruction_i0,i=this.currentRuntimeFlags,a=Gf(i,r);if(Hs(a)&&this.isInterrupted())return vt(this.getInterruptedCause());if(this.patchRuntimeFlags(this.currentRuntimeFlags,r),n.effect_instruction_i1){const o=yl(a,i);return this.pushStack(new cae(o,n)),ar(()=>n.effect_instruction_i1(i))}else return Sr}[Lv](n){return this.pushStack(n),n.effect_instruction_i0}OnStep(n){return this.pushStack(n),n.effect_instruction_i0}[Ob](n){return this.pushStack(n),n.effect_instruction_i0}[zv](n){return this.pushStack(n),n.effect_instruction_i0}[Bm](n){return this._asyncBlockingOn=n.effect_instruction_i1,this.initiateAsync(this.currentRuntimeFlags,n.effect_instruction_i0),Io.currentOp=n,jo}[Mb](n){return this._isYielding=!1,Io.currentOp=n,jo}[Pv](n){const r=n.effect_instruction_i0,i=n.effect_instruction_i1;return r()?(this.pushStack(n),i()):Sr}[Hm](n){return Jh[Hm](this,n,void 0)}[NS](n){return ar(()=>n.commit())}runLoop(n){let r=n;for(this.currentOpCount=0;;){if(this.currentRuntimeFlags&$ie&&this.currentSupervisor.onEffect(this,r),this._queue.length>0&&(r=this.drainQueueWhileRunning(this.currentRuntimeFlags,r)),!this._isYielding){this.currentOpCount+=1;const i=this.currentScheduler.shouldYield(this);if(i!==!1){this._isYielding=!0,this.currentOpCount=0;const a=r;r=te(VR({priority:i}),()=>a)}}try{if(r=this.currentTracer.context(()=>{if(Xue!==r[ru]._V){const i=this.getFiberRef(Lae);if(i._tag==="Some"){const a=r[ru]._V;this.log(`Executing an Effect versioned ${a} with a Runtime of version ${sR()}, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`,Dl,i)}}return this[r._op](r)},this),r===jo){const i=Io.currentOp;return i._op===Mb||i._op===Bm?jo:(Io.currentOp=null,i._op===Jn||i._op===Wn?i:vt(Qi(i)))}}catch(i){r!==jo&&!Re(r,"_op")||!(r._op in this)?r=EU(`Not a valid effect: ${Sd(r)}`):qae(i)?r=vt(vr(Qi(i),va(Ei))):r=al(i)}}}}const Que=je("effect/FiberRef/currentMinimumLogLevel",()=>Pn(Pse("Info"))),Zue=e=>xA(t=>{const n=cB(t.context,Id);ls(n,nB).unsafe.log(e.log(t))}),efe=je(Symbol.for("effect/Logger/defaultLogger"),()=>Zue(yce)),tfe=je(Symbol.for("effect/Logger/tracerLogger"),()=>xA(({annotations:e,cause:t,context:n,fiberId:r,logLevel:i,message:a})=>{const o=ah(zp(n,_o),mx);if(o._tag==="None"||o.value._tag==="ExternalSpan")return;const s=W4(zp(n,Id),gh),l={};for(const[c,f]of e)l[c]=f;l["effect.fiberId"]=Sre(r),l["effect.logLevel"]=i.label,t!==null&&t._tag!=="Empty"&&(l["effect.cause"]=fh(t,{renderErrorCause:!0})),o.value.event(Sd(Array.isArray(a)&&a.length===1?a[0]:a),s.unsafeCurrentTimeNanos(),l)})),nfe=je(Symbol.for("effect/FiberRef/currentLoggers"),()=>Tae(OR(efe,tfe))),rfe=T(e=>Ts(e[0]),(e,t)=>Pg(BR(e,n=>ife(r=>t(n,r))))),ife=e=>ft(t=>{const n=t.getFiberRefs(),r=zie(t.currentRuntimeFlags,Cu);return te(m6,i=>Xv(i,a=>ft(o=>{const s=o.getFiberRefs(),l=o.currentRuntimeFlags,c=Pp(s,n),f=yl(l,r),u=Pp(n,s);return o.setFiberRefs(Fp(c,o.id(),n)),Hp(pae(e(a),f),ie(()=>{o.setFiberRefs(Fp(u,o.id(),o.getFiberRefs()))}))})))}),afe=e=>{if(Array.isArray(e)||O4(e))return[e,ne()];const t=Object.keys(e),n=t.length;return[t.map(r=>e[r]),ae(r=>{const i={};for(let a=0;a<n;a++)i[t[a]]=r[a];return i})]},ofe=(e,t,n)=>{const r=[];for(const i of e)r.push(Dd(i));return te(Ld(r,ke,{concurrency:n==null?void 0:n.concurrency,batching:n==null?void 0:n.batching,concurrentFinalizers:n==null?void 0:n.concurrentFinalizers}),i=>{const a=ne(),o=i.length,s=new Array(o),l=new Array(o);let c=!1;for(let f=0;f<o;f++){const u=i[f];u._tag==="Left"?(s[f]=ae(u.left),c=!0):(l[f]=u.right,s[f]=a)}return c?t._tag==="Some"?sn(t.value(s)):sn(s):n!=null&&n.discard?wt:t._tag==="Some"?fe(t.value(l)):fe(l)})},sfe=(e,t,n)=>{const r=[];for(const i of e)r.push(Dd(i));return n!=null&&n.discard?Ld(r,ke,{concurrency:n==null?void 0:n.concurrency,batching:n==null?void 0:n.batching,discard:!0,concurrentFinalizers:n==null?void 0:n.concurrentFinalizers}):Je(Ld(r,ke,{concurrency:n==null?void 0:n.concurrency,batching:n==null?void 0:n.batching,concurrentFinalizers:n==null?void 0:n.concurrentFinalizers}),i=>t._tag==="Some"?t.value(i):i)},c6=(e,t)=>{const[n,r]=afe(e);return(t==null?void 0:t.mode)==="validate"?ofe(n,r,t):(t==null?void 0:t.mode)==="either"?sfe(n,r,t):(t==null?void 0:t.discard)!==!0&&r._tag==="Some"?Je(Ld(n,ke,t),r.value):Ld(n,ke,t)},Ld=T(e=>O4(e[0]),(e,t,n)=>ft(r=>{const i=(n==null?void 0:n.batching)===!0||(n==null?void 0:n.batching)==="inherit"&&r.getFiberRef(Iae);return n!=null&&n.discard?ID(n.concurrency,()=>Gu(e0,n==null?void 0:n.concurrentFinalizers)(a=>i?co(e,(o,s)=>a(t(o,s)),!0,!1,1):tx(e,(o,s)=>a(t(o,s)))),()=>Gu(ik,n==null?void 0:n.concurrentFinalizers)(a=>co(e,(o,s)=>a(t(o,s)),i,!1)),a=>Gu(ak(a),n==null?void 0:n.concurrentFinalizers)(o=>co(e,(s,l)=>o(t(s,l)),i,!1,a))):ID(n==null?void 0:n.concurrency,()=>Gu(e0,n==null?void 0:n.concurrentFinalizers)(a=>i?xk(e,1,(o,s)=>a(t(o,s)),!0):es(e,(o,s)=>a(t(o,s)))),()=>Gu(ik,n==null?void 0:n.concurrentFinalizers)(a=>u6(e,(o,s)=>a(t(o,s)),i)),a=>Gu(ak(a),n==null?void 0:n.concurrentFinalizers)(o=>xk(e,a,(s,l)=>o(t(s,l)),i)))})),u6=(e,t,n)=>qe(()=>{const r=gt(e),i=new Array(r.length);return nn(co(r,(o,s)=>te(t(o,s),l=>ie(()=>i[s]=l)),n,!1),fe(i))}),co=(e,t,n,r,i)=>Na(a=>mae(o=>ft(s=>{let l=Array.from(e).reverse(),c=l.length;if(c===0)return wt;let f=0,u=!1;const d=i?Math.min(l.length,i):l.length,h=new Set,m=new Array,b=()=>h.forEach(A=>{A.currentScheduler.scheduleTask(()=>{A.unsafeInterruptAsFork(s.id())},0)}),w=new Array,g=new Array,v=new Array,x=()=>{const A=m.filter(({exit:I})=>I._tag==="Failure").sort((I,O)=>I.index<O.index?-1:I.index===O.index?0:1).map(({exit:I})=>I);return A.length===0&&A.push(Sr),A},E=(A,I=!1)=>{const O=Pg(o(A)),z=lfe(O,s,s.currentRuntimeFlags,yx);return s.currentScheduler.scheduleTask(()=>{I&&z.unsafeInterruptAsFork(s.id()),z.resume(O)},0),z},C=()=>{r||(c-=l.length,l=[]),u=!0,b()},k=n?uae:bl,_=E(Ma(A=>{const I=(z,U)=>{z._op==="Blocked"?v.push(z):(m.push({index:U,exit:z}),z._op==="Failure"&&!u&&C())},O=()=>{if(l.length>0){const z=l.pop();let U=f++;const J=()=>{const P=l.pop();return U=f++,te(VR(),()=>te(k(a(t(P,U))),Y))},Y=P=>l.length>0&&(I(P,U),l.length>0)?J():fe(P),F=te(k(a(t(z,U))),Y),D=E(F);w.push(D),h.add(D),u&&D.currentScheduler.scheduleTask(()=>{D.unsafeInterruptAsFork(s.id())},0),D.addObserver(P=>{let $;if(P._op==="Failure"?$=P:$=P.effect_instruction_i0,g.push(D),h.delete(D),I($,U),m.length===c)A(fe(zt(Yf(x(),{parallel:!0}),()=>Sr)));else if(v.length+m.length===c){const q=x(),M=v.map(ue=>ue.effect_instruction_i0).reduce(mU);A(fe(bU(M,co([zt(Yf(q,{parallel:!0}),()=>Sr),...v.map(ue=>ue.effect_instruction_i1)],ue=>ue,n,!0,i))))}else O()})}};for(let z=0;z<d;z++)O()}));return oa(iu(ex(a(Bp(_))),lx({onFailure:A=>{C();const I=v.length+1,O=Math.min(typeof i=="number"?i:v.length,v.length),z=Array.from(v);return Ma(U=>{let J=0,Y=0;const F=(P,$)=>q=>{J++,J===I&&U(xt(vt(A))),z.length>0&&$&&D()},D=()=>{E(z.pop(),!0).addObserver(F(Y,!0)),Y++};_.addObserver(F(Y,!1)),Y++;for(let P=0;P<O;P++)D()})},onSuccess:()=>es(g,A=>A.inheritAll)})))}))),xk=(e,t,n,r)=>qe(()=>{const i=gt(e),a=new Array(i.length);return nn(co(i,(s,l)=>Je(n(s,l),c=>a[l]=c),r,!1,t),fe(a))}),kA=e=>cfe(e,yx),f6=(e,t,n,r=null)=>{const i=h0(e,t,n,r);return i.resume(e),i},lfe=(e,t,n,r=null)=>h0(e,t,n,r),h0=(e,t,n,r=null)=>{const i=X5(),a=t.getFiberRefs(),o=hse(a,i),s=new l6(i,o,n),l=zp(o,_o),c=s.currentSupervisor;return c.onStart(l,e,ae(t),s),s.addObserver(u=>c.onEnd(u,s)),(r!==null?r:N(t.getFiberRef(QE),zt(()=>t.scope()))).add(n,s),s},cfe=(e,t)=>ft((n,r)=>fe(f6(e,n,r.runtimeFlags,t))),KD=e=>Tu(t=>Mt(ah(t,Yl),{onNone:()=>e,onSome:n=>{switch(n.strategy._tag){case"Parallel":return e;case"Sequential":case"ParallelN":return te(Go(n,ik),r=>qg(e,r))}}})),GD=e=>t=>Tu(n=>Mt(ah(n,Yl),{onNone:()=>t,onSome:r=>r.strategy._tag==="ParallelN"&&r.strategy.parallelism===e?t:te(Go(r,ak(e)),i=>qg(t,i))})),Gu=(e,t)=>n=>Tu(r=>Mt(ah(r,Yl),{onNone:()=>n(ke),onSome:i=>{if(t===!0){const a=e._tag==="Parallel"?KD:e._tag==="Sequential"?YD:GD(e.parallelism);switch(i.strategy._tag){case"Parallel":return a(n(KD));case"Sequential":return a(n(YD));case"ParallelN":return a(n(GD(i.strategy.parallelism)))}}else return n(ke)}})),d6=e=>te(Yl,e),h6=e=>te(CA(),t=>iu(e(t),n=>t.close(n))),YD=e=>Tu(t=>Mt(ah(t,Yl),{onNone:()=>e,onSome:n=>{switch(n.strategy._tag){case"Sequential":return e;case"Parallel":case"ParallelN":return te(Go(n,e0),r=>qg(e,r))}}})),ufe=T(e=>Ts(e[1]),(e,t,n)=>Hg(e,t,(r,i)=>[r,i],n)),ffe=T(e=>Ts(e[1]),(e,t,n)=>(n==null?void 0:n.concurrent)!==!0&&((n==null?void 0:n.batching)===void 0||n.batching===!1)?ix(e,t):Hg(e,t,(r,i)=>r,n)),dfe=T(e=>Ts(e[1]),(e,t,n)=>(n==null?void 0:n.concurrent)!==!0&&((n==null?void 0:n.batching)===void 0||n.batching===!1)?nn(e,t):Hg(e,t,(r,i)=>i,n)),Hg=T(e=>Ts(e[1]),(e,t,n,r)=>Je(c6([e,t],{concurrency:r!=null&&r.concurrent?2:1,batching:r==null?void 0:r.batching,concurrentFinalizers:r==null?void 0:r.concurrentFinalizers}),([i,a])=>n(i,a))),Yl=Gl("effect/Scope"),m6=Yl,hfe=(e,t)=>{e.state._tag==="Open"&&e.state.finalizers.set({},t)},mfe={[dD]:dD,[hD]:hD,pipe(){return he(this,arguments)},fork(e){return ie(()=>{const t=p6(e);if(this.state._tag==="Closed")return t.state=this.state,t;const n={},r=i=>t.close(i);return this.state.finalizers.set(n,r),hfe(t,i=>ie(()=>{this.state._tag==="Open"&&this.state.finalizers.delete(n)})),t})},close(e){return qe(()=>{if(this.state._tag==="Closed")return wt;const t=Array.from(this.state.finalizers.values()).reverse();return this.state={_tag:"Closed",exit:e},t.length===0?wt:sse(this.strategy)?N(es(t,n=>bl(n(e))),te(n=>N(Yf(n),ni(S1),zt(()=>Sr)))):lse(this.strategy)?N(u6(t,n=>bl(n(e)),!1),te(n=>N(Yf(n,{parallel:!0}),ni(S1),zt(()=>Sr)))):N(xk(t,this.strategy.parallelism,n=>bl(n(e)),!1),te(n=>N(Yf(n,{parallel:!0}),ni(S1),zt(()=>Sr))))})},addFinalizer(e){return qe(()=>this.state._tag==="Closed"?e(this.state.exit):(this.state.finalizers.set({},e),wt))}},p6=(e=Fc)=>{const t=Object.create(mfe);return t.strategy=e,t.state={_tag:"Open",finalizers:new Map},t},CA=(e=Fc)=>ie(()=>p6(e)),qg=T(2,(e,t)=>GU(e,ai(dR(Yl,t)))),pfe=e=>mh(e,{differ:Bue,fork:Gm}),WD=Aae(Fie),gfe=pfe(Sx),g6=T(3,(e,t,n)=>bfe(e,t,{onSelfWin:(r,i)=>te(r.await,a=>{switch(a._tag){case Jn:return te(r.inheritAll,()=>n.onSelfDone(a,i));case Wn:return n.onSelfDone(a,i)}}),onOtherWin:(r,i)=>te(r.await,a=>{switch(a._tag){case Jn:return te(r.inheritAll,()=>n.onOtherDone(a,i));case Wn:return n.onOtherDone(a,i)}})})),yfe=T(2,(e,t)=>Lg(n=>g6(e,t,{onSelfDone:(r,i)=>tk(r,{onFailure:a=>N(Bp(i),$D(o=>jl(a,o))),onSuccess:a=>N(i,$p(n),Ur(a))}),onOtherDone:(r,i)=>tk(r,{onFailure:a=>N(Bp(i),$D(o=>jl(o,a))),onSuccess:a=>N(i,$p(n),Ur(a))})}))),bfe=T(3,(e,t,n)=>ft((r,i)=>{const a=i.runtimeFlags,o=Ag(!0),s=h0(e,r,a,n.selfScope),l=h0(t,r,a,n.otherScope);return Ma(c=>{s.addObserver(()=>JD(s,l,n.onSelfWin,o,c)),l.addObserver(()=>JD(l,s,n.onOtherWin,o,c)),s.startFork(e),l.startFork(t)},Km(s.id(),l.id()))})),JD=(e,t,n,r,i)=>{fre(!0,!1)(r)&&i(n(e,t))},Hp=T(2,(e,t)=>Na(n=>ia(n(e),{onFailure:r=>ia(t,{onFailure:i=>zn(vr(r,i)),onSuccess:()=>zn(r)}),onSuccess:r=>Ur(t,r)}))),vfe=(e,t,n)=>Lg(r=>te(te(kA(FR(e)),i=>Ma(a=>{const o=t.map(c=>c.listeners.count),s=()=>{o.every(c=>c===0)&&t.every(c=>c.result.state.current._tag==="Pending"?!0:!!(c.result.state.current._tag==="Done"&&sx(c.result.state.current.effect)&&c.result.state.current.effect._tag==="Failure"&&L5(c.result.state.current.effect.cause)))&&(l.forEach(c=>c()),n==null||n(),a(KR(i)))};i.addObserver(c=>{l.forEach(f=>f()),a(c)});const l=t.map((c,f)=>{const u=d=>{o[f]=d,s()};return c.listeners.addObserver(u),()=>c.listeners.removeObserver(u)});return s(),ie(()=>{l.forEach(c=>c())})})),()=>qe(()=>{const i=t.flatMap(a=>a.state.completed?[]:[a]);return tx(i,a=>jue(a.request,Yae(r)))}))),Sfe=Dl,y6=eu,wk=Qi,b6=va,xfe=jl,wfe=One,_fe=$5,m0=L5,Efe=qS,kfe=NR,Cfe=DR,Tfe=P5,Rfe=Dne,Afe=$ne,TA=Fae,Ofe=KS,vh=ox,Mfe=fh,Nfe="effect/ScheduleInterval",p0=Symbol.for(Nfe),v6={[p0]:p0,startMillis:0,endMillis:0},S6=(e,t)=>e>t?v6:{[p0]:p0,startMillis:e,endMillis:t},Dfe=T(2,(e,t)=>jfe(e,t)===e),jfe=T(2,(e,t)=>e.endMillis<=t.startMillis?e:t.endMillis<=e.startMillis?t:e.startMillis<t.startMillis?e:t.startMillis<e.startMillis?t:e.endMillis<=t.endMillis?e:t),Ife=e=>e.startMillis>=e.endMillis,$fe=T(2,(e,t)=>{const n=Math.max(e.startMillis,t.startMillis),r=Math.min(e.endMillis,t.endMillis);return S6(n,r)}),Lfe=e=>S6(e,Number.POSITIVE_INFINITY),x6=v6,zfe=Dfe,Pfe=Ife,Ffe=$fe,Ufe=Lfe,Bfe="effect/ScheduleIntervals",XD=Symbol.for(Bfe),w6=e=>({[XD]:XD,intervals:e}),Hfe=T(2,(e,t)=>qfe(e.intervals,t.intervals,Ln())),qfe=(e,t,n)=>{let r=e,i=t,a=n;for(;bs(r)&&bs(i);){const o=N(to(r),Ffe(to(i))),s=Pfe(o)?a:N(a,Er(o));N(to(r),zfe(to(i)))?r=Zo(r):i=Zo(i),a=s}return w6(ys(a))},_k=e=>N(e.intervals,SR,zt(()=>x6)).startMillis,Vfe=e=>N(e.intervals,SR,zt(()=>x6)).endMillis,Kfe=T(2,(e,t)=>_k(e)<_k(t)),Gfe=e=>bs(e.intervals),Yfe=w6,Wfe=Hfe,Jfe=_k,QD=Vfe,Xfe=Kfe,Qfe=Gfe,RA="Continue",_6="Done",Zfe=e=>({_tag:RA,intervals:e}),ede=e=>({_tag:RA,intervals:Yfe(Cn(e))}),tde={_tag:_6},nde=e=>e._tag===RA,rde=e=>e._tag===_6,ide=Zfe,ade=ede,qp=tde,ZD=nde,g0=rde,ode=Yl,y0=FU,sde=Xv,b0=ZE,lde=qg,E6=Go,k6=CA;class cde{constructor(t){S(this,"permits");S(this,"waiters",new Set);S(this,"taken",0);S(this,"take",t=>il(n=>{if(this.free<t){const r=()=>{this.free<t||(this.waiters.delete(r),n(qe(()=>this.free<t?this.take(t):(this.taken+=t,fe(t)))))};return this.waiters.add(r),ie(()=>{this.waiters.delete(r)})}n(qe(()=>this.free<t?this.take(t):(this.taken+=t,fe(t))))}));S(this,"resize",t=>oa(ft(n=>(this.permits=t,this.free<0?wt:this.updateTakenUnsafe(n,r=>r)))));S(this,"release",t=>this.updateTaken(n=>n-t));S(this,"releaseAll",this.updateTaken(t=>0));S(this,"withPermits",t=>n=>Na(r=>te(r(this.take(t)),i=>Hp(r(n),this.release(i)))));S(this,"withPermitsIfAvailable",t=>n=>Na(r=>qe(()=>this.free<t?Lle:(this.taken+=t,Hp(r(Rle(n)),this.release(t))))));this.permits=t}get free(){return this.permits-this.taken}updateTakenUnsafe(t,n){return this.taken=n(this.taken),this.waiters.size>0&&t.getFiberRef(mA).scheduleTask(()=>{const r=this.waiters.values();let i=r.next();for(;i.done===!1&&this.free>0;)i.value(),i=r.next()},t.getFiberRef(ph)),fe(this.free)}updateTaken(t){return ft(n=>this.updateTakenUnsafe(n,t))}}const AA=e=>new cde(e),ude=e=>ie(()=>AA(e));class fde extends bh{constructor(n){super();S(this,"isOpen");S(this,"waiters",[]);S(this,"scheduled",!1);S(this,"flushWaiters",()=>{this.scheduled=!1;const n=this.waiters;this.waiters=[];for(let r=0;r<n.length;r++)n[r](Sr)});S(this,"open",ft(n=>this.isOpen?wt:(this.isOpen=!0,this.unsafeSchedule(n))));S(this,"release",ft(n=>this.isOpen?wt:this.unsafeSchedule(n)));S(this,"await",il(n=>this.isOpen?n(wt):(this.waiters.push(n),ie(()=>{const r=this.waiters.indexOf(n);r!==-1&&this.waiters.splice(r,1)}))));S(this,"close",ie(()=>{this.isOpen=!1}));S(this,"whenOpen",n=>nn(this.await,n));this.isOpen=n}commit(){return this.await}unsafeSchedule(n){return this.scheduled||this.waiters.length===0||(this.scheduled=!0,n.currentScheduler.scheduleTask(this.flushWaiters,n.getFiberRef(ph))),wt}unsafeOpen(){this.isOpen||(this.isOpen=!0,this.flushWaiters())}unsafeClose(){this.isOpen=!1}}const dde=e=>new fde(e??!1),hde=T(2,(e,t)=>ft((n,r)=>{const i=t,a=f6(e,n,r.runtimeFlags,yx);if(i.state._tag==="Open"){const o=()=>Lg(l=>Se(l,a.id())?wt:oa(KR(a))),s={};i.state.finalizers.set(s,o),a.addObserver(()=>{i.state._tag!=="Closed"&&i.state.finalizers.delete(s)})}else a.unsafeInterruptAsFork(n.id());return fe(a)})),mde="effect/Ref/SynchronizedRef",pde=Symbol.for(mde),gde={_A:e=>e};var mz,pz,gz,yz;class yde extends(yz=bh,gz=pde,pz=EB,mz=a0,yz){constructor(n,r){super();S(this,"ref");S(this,"withLock");S(this,gz,gde);S(this,pz,kB);S(this,mz,a0);S(this,"get");this.ref=n,this.withLock=r,this.get=lo(this.ref)}commit(){return this.get}modify(n){return this.modifyEffect(r=>fe(n(r)))}modifyEffect(n){return this.withLock(N(te(lo(this.ref),n),te(([r,i])=>Ur(Jf(this.ref,i),r))))}}const bde=e=>ie(()=>C6(e)),C6=e=>{const t=fA(e),n=AA(1);return new yde(t,n.withPermits(1))},vde=Symbol.for("effect/ManagedRuntime"),Sde="Fresh",xde="FromEffect",wde="Scoped",_de="Suspend",Ede="Provide",T6="ProvideMerge",kde="MergeAll",R6=lce,Cde=uce,ej=cce,vl=KR,OA=$p,tj=Bp,Sh=e=>function(){if(arguments.length===1){const t=arguments[0];return(n,...r)=>e(t,n,...r)}return e.apply(this,arguments)},Vg=Sh((e,t,n)=>{const r=X5(),i=[[_o,[[r,e.context]]]];n!=null&&n.scheduler&&i.push([mA,[[r,n.scheduler]]]);let a=pse(e.fiberRefs,{entries:i,forkAs:r});n!=null&&n.updateRefs&&(a=n.updateRefs(a,r));const o=new l6(r,a,e.runtimeFlags);let s=t;n!=null&&n.scope&&(s=te(E6(n.scope,Fc),c=>nn(FU(c,Lg(f=>Se(f,o.id())?wt:$p(o,f))),iu(t,f=>b0(c,f)))));const l=o.currentSupervisor;return l!==Sx&&(l.onStart(e.context,s,ne(),o),o.addObserver(c=>l.onEnd(c,o))),yx.add(e.runtimeFlags,o),(n==null?void 0:n.immediate)===!1?o.resume(s):o.start(s),o}),A6=Sh((e,t,n={})=>{const r=Vg(e,t,n);return n.onExit&&r.addObserver(i=>{n.onExit(i)}),(i,a)=>A6(e)(N(r,OA(i??Ei)),{...a,onExit:a!=null&&a.onExit?o=>a.onExit(Jle(o)):void 0})}),O6=Sh((e,t)=>{const n=Ode(e)(t);if(n._tag==="Failure")throw M6(n.effect_instruction_i0);return n.effect_instruction_i0});class Tde extends Error{constructor(n){super(`Fiber #${n.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`);S(this,"fiber");S(this,"_tag","AsyncFiberException");this.fiber=n,this.name=this._tag,this.stack=this.message}}const Rde=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=0;const n=new Tde(e);return Error.stackTraceLimit=t,n},E1=Symbol.for("effect/Runtime/FiberFailure"),Gy=Symbol.for("effect/Runtime/FiberFailure/Cause");var bz,vz;class Ade extends Error{constructor(n){const r=U5(n)[0];super((r==null?void 0:r.message)||"An error has occurred");S(this,vz);S(this,bz);this[E1]=E1,this[Gy]=n,this.name=r?`(FiberFailure) ${r.name}`:"FiberFailure",r!=null&&r.stack&&(this.stack=r.stack)}toJSON(){return{_id:"FiberFailure",cause:this[Gy].toJSON()}}toString(){return"(FiberFailure) "+fh(this[Gy],{renderErrorCause:!0})}[(vz=E1,bz=Gy,lt)](){return this.toString()}}const M6=e=>{const t=Error.stackTraceLimit;Error.stackTraceLimit=0;const n=new Ade(e);return Error.stackTraceLimit=t,n},N6=e=>{const t=e;switch(t._op){case"Failure":case"Success":return t;case"Left":return Lp(t.left);case"Right":return xt(t.right);case"Some":return xt(t.value);case"None":return Lp(new ox)}},Ode=Sh((e,t)=>{const n=N6(t);if(n)return n;const r=new hA,i=Vg(e)(t,{scheduler:r});r.flush();const a=i.unsafePoll();return a||BU(PR(Rde(i),tA(i)))}),Mde=Sh((e,t,n)=>D6(e,t,n).then(r=>{switch(r._tag){case Jn:return r.effect_instruction_i0;case Wn:throw M6(r.effect_instruction_i0)}})),D6=Sh((e,t,n)=>new Promise(r=>{const i=N6(t);i&&r(i);const a=Vg(e)(t);a.addObserver(o=>{r(o)}),(n==null?void 0:n.signal)!==void 0&&(n.signal.aborted?a.unsafeInterruptAsFork(a.id()):n.signal.addEventListener("abort",()=>{a.unsafeInterruptAsFork(a.id())},{once:!0}))}));class j6{constructor(t,n,r){S(this,"context");S(this,"runtimeFlags");S(this,"fiberRefs");this.context=t,this.runtimeFlags=n,this.fiberRefs=r}pipe(){return he(this,arguments)}}const I6=e=>new j6(e.context,e.runtimeFlags,e.fiberRefs),Nde=()=>ft((e,t)=>fe(new j6(e.getFiberRef(_o),t.runtimeFlags,e.getFiberRefs()))),Dde=dU(Cu,uU,cU),su=I6({context:mo(),runtimeFlags:Dde,fiberRefs:gse()}),jde=Vg(su),Ide=Mde(su),$de=D6(su),Lde=O6(su),zde=T(2,(e,t)=>e.modifyEffect(t)),Pde="effect/Layer",$6=Symbol.for(Pde),Fde={_RIn:e=>e,_E:e=>e,_ROut:e=>e},lu={[$6]:Fde,pipe(){return he(this,arguments)}},Ude="effect/Layer/MemoMap",k1=Symbol.for(Ude),Bde=oh()("effect/Layer/CurrentMemoMap",{defaultValue:()=>Vde()}),Hde=e=>Re(e,$6),qde=e=>e._op_layer===Sde;var Sz;Sz=k1;class L6{constructor(t){S(this,"ref");S(this,Sz);this.ref=t,this[k1]=k1}getOrElseMemoize(t,n){return N(zde(this.ref,r=>{const i=r.get(t);if(i!==void 0){const[a,o]=i,s=N(a,te(([l,c])=>N(IB(l),Ur(c))),iu(lx({onFailure:()=>wt,onSuccess:()=>Xv(n,o)})));return fe([s,r])}return N(o0(0),te(a=>N(ux(),te(o=>N(o0(()=>wt),Je(s=>{const l=Na(f=>N(CA(),te(u=>N(f(te(U6(t,u,!0),d=>Ale(d(this)))),bl,te(d=>{switch(d._tag){case Wn:return N(VU(o,d.effect_instruction_i0),nn(ZE(u,d)),nn(zn(d.effect_instruction_i0)));case Jn:return N(Jf(s,h=>N(ZE(u,h),HR(CB(a,m=>[m===1,m-1])),oa)),nn(s0(a,h=>h+1)),nn(Xv(n,h=>N(ie(()=>r.delete(t)),nn(lo(s)),te(m=>m(h))))),nn(QR(o,d.effect_instruction_i0)),Ur(d.effect_instruction_i0[1]))}}))))),c=[N($l(o),iu(tk({onFailure:()=>wt,onSuccess:()=>s0(a,f=>f+1)}))),f=>N(lo(s),te(u=>u(f)))];return[l,qde(t)?r:r.set(t,c)]}))))))}),ex)}}const z6=qe(()=>Je(bde(new Map),e=>new L6(e))),Vde=()=>new L6(C6(new Map)),P6=T(2,(e,t)=>te(z6,n=>F6(e,n,t))),F6=T(3,(e,t,n)=>te(U6(e,n),r=>$B(r(t),Bde,t))),U6=(e,t,n=!1)=>{const r=e;switch(r._op_layer){case"Locally":return ie(()=>i=>r.f(i.getOrElseMemoize(r.self,t)));case"ExtendScope":return ie(()=>i=>d6(a=>i.getOrElseMemoize(r.layer,a)));case"Fold":return ie(()=>i=>N(i.getOrElseMemoize(r.layer,t),ia({onFailure:a=>i.getOrElseMemoize(r.failureK(a),t),onSuccess:a=>i.getOrElseMemoize(r.successK(a),t)})));case"Fresh":return ie(()=>i=>N(r.layer,P6(t)));case"FromEffect":return ie(n?()=>i=>r.effect:()=>i=>i.getOrElseMemoize(e,t));case"Provide":return ie(()=>i=>N(i.getOrElseMemoize(r.first,t),te(a=>N(i.getOrElseMemoize(r.second,t),hx(a)))));case"Scoped":return ie(n?()=>i=>qg(r.effect,t):()=>i=>i.getOrElseMemoize(e,t));case"Suspend":return ie(()=>i=>i.getOrElseMemoize(r.evaluate(),t));case"ProvideMerge":return ie(()=>i=>N(i.getOrElseMemoize(r.first,t),NU(i.getOrElseMemoize(r.second,t),r.zipK)));case"ZipWith":return OU(function*(){const i=yield*Go(t,rk),a=yield*Go(i,Fc),o=yield*Go(i,Fc);return s=>N(s.getOrElseMemoize(r.first,a),Hg(s.getOrElseMemoize(r.second,o),r.zipK,{concurrent:!0}))});case"MergeAll":{const i=r.layers;return Je(Go(t,rk),a=>o=>{const s=new Array(i.length);return Je(co(i,MU(function*(l,c){const f=yield*Go(a,Fc),u=yield*o.getOrElseMemoize(l,f);s[c]=u}),!1,!1),()=>$ee(...s))})}}},Kde=()=>B6(ZR()),Gde=T(2,(e,t)=>{const n=Y4(e),r=n?e:t;return B6(Je(n?t:e,a=>dR(r,a)))});function B6(e){const t=Object.create(lu);return t._op_layer=xde,t.effect=e,t}const H6=(...e)=>{const t=Object.create(lu);return t._op_layer=kde,t.layers=e,t},Yde=T(2,(e,t)=>{const n=Y4(e),r=n?e:t;return Wde(Je(n?t:e,a=>dR(r,a)))}),Wde=e=>{const t=Object.create(lu);return t._op_layer=wde,t.effect=e,t},Jde=e=>{const t=Object.create(lu);return t._op_layer=_de,t.evaluate=e,t},q6=T(2,(e,t)=>Jde(()=>{const n=Object.create(lu);return n._op_layer=Ede,n.first=Object.create(lu,{_op_layer:{value:T6,enumerable:!0},first:{value:Kde(),enumerable:!0},second:{value:Array.isArray(t)?H6(...t):t},zipK:{value:(r,i)=>N(r,ai(i))}}),n.second=e,n})),Xde=T(2,(e,t)=>{const n=Object.create(lu);return n._op_layer=T6,n.first=t,n.second=q6(e,t),n.zipK=(r,i)=>N(r,ai(i)),n}),nj=T(2,(e,t)=>h6(n=>te(P6(t,n),r=>eA(e,r)))),rj=T(2,(e,t)=>{const n=Pp(su.fiberRefs,t.fiberRefs),r=yl(su.runtimeFlags,t.runtimeFlags);return Na(i=>ft(a=>{const o=a.getFiberRef(_o),s=a.getFiberRefs(),l=Fp(a.id(),s)(n),c=a.currentRuntimeFlags,f=Gf(r)(c),u=Pp(l,s),d=yl(f,c);return a.setFiberRefs(l),a.currentRuntimeFlags=f,Hp(eA(i(e),ai(o,t.context)),ft(h=>(h.setFiberRefs(Fp(h.id(),h.getFiberRefs())(u)),h.currentRuntimeFlags=Gf(d)(h.currentRuntimeFlags),wt)))}))}),Qde=T(2,(e,t)=>Array.isArray(t)?nj(e,H6(...t)):Hde(t)?nj(e,t):Iee(t)?eA(e,t):vde in t?te(t.runtimeEffect,n=>rj(e,n)):rj(e,t)),pm=Pre,ij=e=>Zde(e.slice(0)),Zde=e=>Object.setPrototypeOf(e,zre),ehe=e=>t=>{const n=t===void 0?Object.create(Tg):pm(t);return n._tag=e,n},MA=Mg,the=Mg,nhe=()=>new Proxy({},{get(e,t,n){return t==="$is"?tR:t==="$match"?rhe:ehe(t)}});function rhe(){if(arguments.length===1){const n=arguments[0];return function(r){return n[r._tag](r)}}const e=arguments[0];return arguments[1][e._tag](e)}const NA=function(){const e=Symbol.for("effect/Data/Error/plainArgs");return{BaseEffectError:class extends YR{constructor(n){super(n==null?void 0:n.message,n!=null&&n.cause?{cause:n.cause}:void 0),n&&(Object.assign(this,n),Object.defineProperty(this,e,{value:n,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}.BaseEffectError}(),ihe=e=>{const t={BaseEffectError:class extends NA{constructor(){super(...arguments);S(this,"_tag",e)}}};return t.BaseEffectError.prototype.name=e,t.BaseEffectError},ahe="effect/Schedule",V6=Symbol.for(ahe),ohe=e=>Re(e,V6),she="effect/ScheduleDriver",lhe=Symbol.for(she),Ek={start:0,now:0,input:void 0,output:void 0,elapsed:Ad,elapsedSincePrevious:Ad,recurrence:0},aj=oh()("effect/Schedule/CurrentIterationMetadata",{defaultValue:()=>Ek}),che={_Out:e=>e,_In:e=>e,_R:e=>e},uhe={_Out:e=>e,_In:e=>e,_R:e=>e};var xz;xz=V6;class fhe{constructor(t,n){S(this,"initial");S(this,"step");S(this,xz,che);this.initial=t,this.step=n}pipe(){return he(this,arguments)}}const oj=(e,t,n,r)=>s0(e,i=>i.recurrence===0?{now:t,input:n,output:r,recurrence:i.recurrence+1,elapsed:Ad,elapsedSincePrevious:Ad,start:t}:{now:t,input:n,output:r,recurrence:i.recurrence+1,elapsed:Od(t-i.start),elapsedSincePrevious:Od(t-i.now),start:i.start});var wz;wz=lhe;class dhe{constructor(t,n){S(this,"schedule");S(this,"ref");S(this,wz,uhe);S(this,"iterationMeta",fA(Ek));this.schedule=t,this.ref=n}get state(){return Je(lo(this.ref),t=>t[1])}get last(){return te(lo(this.ref),([t,n])=>{switch(t._tag){case"None":return QS(()=>new ox);case"Some":return fe(t.value)}})}get reset(){return Jf(this.ref,[ne(),this.schedule.initial]).pipe(ix(Jf(this.iterationMeta,Ek)))}next(t){return N(Je(lo(this.ref),n=>n[1]),te(n=>N(wle,te(r=>N(qe(()=>this.schedule.step(r,t,n)),te(([i,a,o])=>{const s=Jf(this.ref,[ae(a),i]);if(g0(o))return s.pipe(nn(sn(ne())));const l=Jfe(o.intervals)-r;if(l<=0)return s.pipe(nn(oj(this.iterationMeta,r,t,a)),Ur(a));const c=Od(l);return N(s,nn(oj(this.iterationMeta,r,t,a)),nn($le(c)),Ur(a))}))))))}}const Kg=(e,t)=>new fhe(e,t),hhe=T(2,(e,t)=>DA(e,(n,r)=>ie(()=>t(n,r)))),DA=T(2,(e,t)=>Kg(e.initial,(n,r,i)=>te(e.step(n,r,i),([a,o,s])=>g0(s)?fe([a,o,qp]):Je(t(r,o),l=>l?[a,o,s]:[a,o,qp])))),mhe=e=>N(o0([ne(),e.initial]),Je(t=>new dhe(e,t))),phe=T(2,(e,t)=>ghe(e,t,Wfe)),ghe=T(3,(e,t,n)=>Kg([e.initial,t.initial],(r,i,a)=>N(NU(e.step(r,i,a[0]),t.step(r,i,a[1]),(o,s)=>[o,s]),te(([[o,s,l],[c,f,u]])=>ZD(l)&&ZD(u)?kk(e,t,i,o,s,l.intervals,c,f,u.intervals,n):fe([[o,c],[s,f],qp]))))),kk=(e,t,n,r,i,a,o,s,l,c)=>{const f=c(a,l);return Qfe(f)?fe([[r,o],[i,s],ide(f)]):N(a,Xfe(l))?te(e.step(QD(a),n,r),([u,d,h])=>g0(h)?fe([[u,o],[d,s],qp]):kk(e,t,n,u,d,h.intervals,o,s,l,c)):te(t.step(QD(l),n,o),([u,d,h])=>g0(h)?fe([[r,u],[i,d],qp]):kk(e,t,n,r,i,a,u,d,h.intervals,c))},yhe=T(2,(e,t)=>bhe(e,n=>ie(()=>t(n)))),bhe=T(2,(e,t)=>Kg(e.initial,(n,r,i)=>te(e.step(n,r,i),([a,o,s])=>Je(t(o),l=>[a,l,s])))),vhe=e=>Kg(e.initial,(t,n,r)=>N(e.step(t,n,r),Je(([i,a,o])=>[i,n,o]))),She=e=>Ehe(G6,t=>t<e),xhe=(e,t)=>Kg(e,(n,r,i)=>ie(()=>[t(i),i,ade(Ufe(n))])),whe=T(2,(e,t)=>DA(e,(n,r)=>Dle(t(n)))),_he=T(2,(e,t)=>DA(e,(n,r)=>t(n))),Ehe=T(2,(e,t)=>hhe(e,(n,r)=>t(r))),Pb=Symbol.for("effect/Schedule/ScheduleDefect");var _z;_z=Pb;class khe{constructor(t){S(this,"error");S(this,_z);this.error=t,this[Pb]=Pb}}const Che=e=>Re(e,Pb),sj=e=>Ip(e,t=>al(new khe(t))),The=e=>Mt(VS(e,t=>$5(t)&&Che(t.defect)?ae(t.defect):ne()),{onNone:()=>e,onSome:t=>eu(t.error)}),Rhe=e=>_U(e,t=>zn(The(t))),lj=T(2,(e,t)=>Ohe(e,t,(n,r)=>sn(n))),Ahe=T(2,(e,t)=>{if(ohe(t))return lj(e,t);const n=t.schedule??vhe(G6),r=t.while?_he(n,o=>{const s=t.while(o);return typeof s=="boolean"?fe(s):sj(s)}):n,i=t.until?whe(r,o=>{const s=t.until(o);return typeof s=="boolean"?fe(s):sj(s)}):r,a=t.times?phe(i,She(t.times)).pipe(yhe(o=>o[0])):i;return Rhe(lj(e,a))}),Ohe=T(3,(e,t,n)=>te(mhe(t),r=>Il(e,{onFailure:i=>n(i,ne()),onSuccess:i=>K6(LD(e,aj,lo(r.iterationMeta)),r,(a,o)=>LD(n(a,o),aj,lo(r.iterationMeta)),i)}))),K6=(e,t,n,r)=>Il(t.next(r),{onFailure:()=>fae(t.last),onSuccess:i=>Il(e,{onFailure:a=>n(a,ae(i)),onSuccess:a=>K6(e,t,n,a)})}),G6=xhe(0,e=>e+1),no=ux,Dr=$l,Mhe=qU,Nhe=VU,Ck=Qae,ns=QR,Dhe=dx,cj=Symbol.for("effect/MutableList"),jhe={[cj]:cj,[Symbol.iterator](){let e=!1,t=this.head;return{next(){if(e)return this.return();if(t==null)return e=!0,this.return();const n=t.value;return t=t.next,{done:e,value:n}},return(n){return e||(e=!0),{done:!0,value:n}}}},toString(){return Rt(this.toJSON())},toJSON(){return{_id:"MutableList",values:Array.from(this).map(Jt)}},[lt](){return this.toJSON()},pipe(){return he(this,arguments)}},Ihe=e=>({value:e,removed:!1,prev:void 0,next:void 0}),$he=()=>{const e=Object.create(jhe);return e.head=void 0,e.tail=void 0,e._length=0,e},Y6=e=>jA(e)===0,jA=e=>e._length,Lhe=T(2,(e,t)=>{const n=Ihe(t);return e.head===void 0&&(e.head=n),e.tail===void 0||(e.tail.next=n,n.prev=e.tail),e.tail=n,e._length+=1,e}),zhe=e=>{const t=e.head;if(t!==void 0)return Phe(e,t),t.value},Phe=(e,t)=>{t.removed||(t.removed=!0,t.prev!==void 0&&t.next!==void 0?(t.prev.next=t.next,t.next.prev=t.prev):t.prev!==void 0?(e.tail=t.prev,t.prev.next=void 0):t.next!==void 0?(e.head=t.next,t.next.prev=void 0):(e.tail=void 0,e.head=void 0),e._length>0&&(e._length-=1))},uj=Symbol.for("effect/MutableQueue"),Qr=Symbol.for("effect/mutable/MutableQueue/Empty"),Fhe={[uj]:uj,[Symbol.iterator](){return Array.from(this.queue)[Symbol.iterator]()},toString(){return Rt(this.toJSON())},toJSON(){return{_id:"MutableQueue",values:Array.from(this).map(Jt)}},[lt](){return this.toJSON()},pipe(){return he(this,arguments)}},W6=e=>{const t=Object.create(Fhe);return t.queue=$he(),t.capacity=e,t},Uhe=e=>W6(e),IA=()=>W6(void 0),$A=e=>jA(e.queue),Tk=e=>Y6(e.queue),Bhe=e=>e.capacity===void 0?1/0:e.capacity,Vp=T(2,(e,t)=>{const n=jA(e.queue);return e.capacity!==void 0&&n===e.capacity?!1:(Lhe(t)(e.queue),!0)}),J6=T(2,(e,t)=>{const n=t[Symbol.iterator]();let r,i=Ln(),a=!0;for(;a&&(r=n.next())&&!r.done;)a=Vp(r.value)(e);for(;r!=null&&!r.done;)i=Er(r.value)(i),r=n.next();return ys(i)}),Sl=T(2,(e,t)=>Y6(e.queue)?t:zhe(e.queue)),LA=T(2,(e,t)=>{let n=Ln(),r=0;for(;r<t;){const i=Sl(Qr)(e);if(i===Qr)break;n=Er(i)(n),r+=1}return ys(n)}),Rk=ru,Wl=Ts,C1=Nle,Hhe=c6,uo=Ld,v0=Ma,S0=ft,Eo=sn,Ca=zn,qhe=EU,Xf=OU,T1=gae,Vhe=Ile,Ht=fe,ln=qe,Ct=ie,ot=wt,X6=Ip,zA=_U,Khe=Mle,Ghe=NB,Yhe=Fle,Ym=Ple,xc=Uo,Sa=FR,Whe=zg,gm=Pg,x0=Na,R1=Ur,PA=oa,yt=Je,Jhe=UR,FA=nx,w0=rfe,Xhe=xU,Nf=Hp,xx=m6,Qhe=d6,Ak=h6,Zhe=Lg,eme=kA,Uc=hde,Q6=ZR,Z6=GU,_0=Qde,tme=Hle,Yu=Dd,cr=bl,eH=RU,nme=Ble,Te=te,lf=ex,A1=yfe,tH=g6,nH=BR,rH=zle,fj=Ahe,rme=hh,ime=DB,Ok=CU,xa=ia,Gg=Nde,ame=AA,ome=ude,sme=dde,UA=jde,lme=Ide,cme=$de,Zi=Lde,E0=ufe,BA=ffe,or=dfe,wx=Hg,ume=Kle,fme=Gle,iH=MU,_x=Vg,dme=O6,hme=A6,Ex=su,HA=I6,Mk=Symbol.for("effect/FiberHandle"),mme=e=>Re(e,Mk),pme={[Mk]:Mk,toString(){return Rt(this.toJSON())},toJSON(){return{_id:"FiberHandle",state:this.state}},[lt](){return this.toJSON()},pipe(){return he(this,arguments)}},gme=e=>{const t=Object.create(pme);return t.state={_tag:"Open",fiber:void 0},t.deferred=e,t},yme=()=>w0(yt(no(),e=>gme(e)),e=>S0(t=>{const n=e.state;return n._tag==="Closed"?ot:(e.state={_tag:"Closed"},n.fiber?eH(PA(OA(n.fiber,Km(t.id(),Fb))),e.deferred):Mhe(e.deferred,gA))})),bme=()=>Te(yme(),e=>xme(e)()),aH=-1,Fb=vre(aH,0),vme=Ofe(void 0,{emptyCase:pl,failCase:pl,dieCase:pl,interruptCase:(e,t)=>N5(J5(t),aH),sequentialCase:(e,t,n)=>t||n,parallelCase:(e,t,n)=>t||n}),Sme=T(e=>mme(e[0]),(e,t,n)=>{if(e.state._tag==="Closed"){t.unsafeInterruptAsFork(Km((n==null?void 0:n.interruptAs)??Ei,Fb));return}else if(e.state.fiber!==void 0){if((n==null?void 0:n.onlyIfMissing)===!0){t.unsafeInterruptAsFork(Km((n==null?void 0:n.interruptAs)??Ei,Fb));return}else if(e.state.fiber===t)return;e.state.fiber.unsafeInterruptAsFork(Km((n==null?void 0:n.interruptAs)??Ei,Fb)),e.state.fiber=void 0}e.state.fiber=t,t.addObserver(r=>{e.state._tag==="Open"&&t===e.state.fiber&&(e.state.fiber=void 0),pA(r)&&((n==null?void 0:n.propagateInterruption)===!0?!vme(r.cause):!Efe(r.cause))&&Dhe(e.deferred,r)})}),dj=function(){let e;return()=>(e===void 0&&(e=UA(xc)),e)}(),xme=e=>()=>yt(Gg(),t=>{const n=_x(t);return(r,i)=>{if(e.state._tag==="Closed")return dj();if(e.state.fiber!==void 0&&(i==null?void 0:i.onlyIfMissing)===!0)return dj();const a=n(r,i);return Sme(e,a,i),a}}),wme=Gde,oH=Yde,sH=q6,O1=Xde,_me=z6,hj=F6,qA=Pn,lH=_o,Eme=zU,kme="effect/QueueEnqueue",Cme=Symbol.for(kme),Tme="effect/QueueDequeue",Rme=Symbol.for(Tme),Ame="effect/QueueStrategy",cH=Symbol.for(Ame),Ome="effect/BackingQueue",Mme=Symbol.for(Ome),uH={_A:e=>e},Nme={_A:e=>e},Dme={_In:e=>e},jme={_Out:e=>e};var Ez,kz,Cz;class Ime extends(Cz=bh,kz=Cme,Ez=Rme,Cz){constructor(n,r,i,a,o){super();S(this,"queue");S(this,"takers");S(this,"shutdownHook");S(this,"shutdownFlag");S(this,"strategy");S(this,kz,Dme);S(this,Ez,jme);this.queue=n,this.takers=r,this.shutdownHook=i,this.shutdownFlag=a,this.strategy=o}pipe(){return he(this,arguments)}commit(){return this.take}capacity(){return this.queue.capacity()}get size(){return qe(()=>Ip(this.unsafeSize(),()=>Uo))}unsafeSize(){return Dn(this.shutdownFlag)?ne():ae(this.queue.length()-$A(this.takers)+this.strategy.surplusSize())}get isEmpty(){return Je(this.size,n=>n<=0)}get isFull(){return Je(this.size,n=>n>=this.capacity())}get shutdown(){return Pg(ft(n=>(N(this.shutdownFlag,Og(!0)),N(co(Qf(this.takers),r=>KU(r,n.id()),!1,!1),nn(this.strategy.shutdown),HR(QR(this.shutdownHook,void 0)),oa))))}get isShutdown(){return ie(()=>Dn(this.shutdownFlag))}get awaitShutdown(){return $l(this.shutdownHook)}isActive(){return!Dn(this.shutdownFlag)}unsafeOffer(n){if(Dn(this.shutdownFlag))return!1;let r;if(this.queue.length()===0){const a=N(this.takers,Sl(Qr));a!==Qr?(Bc(a,n),r=!0):r=!1}else r=!1;if(r)return!0;const i=this.queue.offer(n);return Df(this.strategy,this.queue,this.takers),i}offer(n){return qe(()=>{if(Dn(this.shutdownFlag))return Uo;let r;if(this.queue.length()===0){const a=N(this.takers,Sl(Qr));a!==Qr?(Bc(a,n),r=!0):r=!1}else r=!1;if(r)return fe(!0);const i=this.queue.offer(n);return Df(this.strategy,this.queue,this.takers),i?fe(!0):this.strategy.handleSurplus([n],this.queue,this.takers,this.shutdownFlag)})}offerAll(n){return qe(()=>{if(Dn(this.shutdownFlag))return Uo;const r=gt(n),i=this.queue.length()===0?gt(Xme(this.takers,r.length)):Ml,[a,o]=N(r,h5(i.length));for(let l=0;l<i.length;l++){const c=i[l],f=a[l];Bc(c,f)}if(o.length===0)return fe(!0);const s=this.queue.offerAll(o);return Df(this.strategy,this.queue,this.takers),LS(s)?fe(!0):this.strategy.handleSurplus(s,this.queue,this.takers,this.shutdownFlag)})}get take(){return ft(n=>{if(Dn(this.shutdownFlag))return Uo;const r=this.queue.poll(Qr);if(r!==Qr)return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),fe(r);{const i=cx(n.id());return N(qe(()=>(N(this.takers,Vp(i)),Df(this.strategy,this.queue,this.takers),Dn(this.shutdownFlag)?Uo:$l(i))),zg(()=>ie(()=>Qme(this.takers,i))))}})}get takeAll(){return qe(()=>Dn(this.shutdownFlag)?Uo:ie(()=>{const n=this.queue.pollUpTo(Number.POSITIVE_INFINITY);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),gs(n)}))}takeUpTo(n){return qe(()=>Dn(this.shutdownFlag)?Uo:ie(()=>{const r=this.queue.pollUpTo(n);return this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers),gs(r)}))}takeBetween(n,r){return qe(()=>fH(this,n,r,Ln()))}}const fH=(e,t,n,r)=>n<t?fe(r):N(Vme(e,n),te(i=>{const a=t-i.length;return a===1?N(Nk(e),Je(o=>N(r,wn(i),$E(o)))):a>1?N(Nk(e),te(o=>fH(e,a-1,n-i.length-1,N(r,wn(i),$E(o))))):fe(N(r,wn(i)))})),$me=e=>N(ie(()=>Uhe(e)),te(t=>dH(hH(t),Gme()))),Lme=()=>N(ie(()=>IA()),te(e=>dH(hH(e),Yme()))),zme=(e,t,n,r,i)=>new Ime(e,t,n,r,i),dH=(e,t)=>N(ux(),Je(n=>zme(e,IA(),n,Ag(!1),t)));var Tz;Tz=Mme;class Pme{constructor(t){S(this,"mutable");S(this,Tz,Nme);this.mutable=t}poll(t){return Sl(this.mutable,t)}pollUpTo(t){return LA(this.mutable,t)}offerAll(t){return J6(this.mutable,t)}offer(t){return Vp(this.mutable,t)}capacity(){return Bhe(this.mutable)}length(){return $A(this.mutable)}}const hH=e=>new Pme(e),Fme=e=>e.size,Ume=e=>e.isShutdown,Bme=e=>e.shutdown,Hme=T(2,(e,t)=>e.offer(t)),qme=T(2,(e,t)=>e.unsafeOffer(t)),Nk=e=>e.take,Vme=T(2,(e,t)=>e.takeUpTo(t)),Kme=T(3,(e,t,n)=>e.takeBetween(t,n)),Gme=()=>new Wme,Yme=()=>new Jme;var Rz;Rz=cH;class Wme{constructor(){S(this,Rz,uH);S(this,"putters",IA())}surplusSize(){return $A(this.putters)}onCompleteTakersWithEmptyQueue(t){for(;!Tk(this.putters)&&!Tk(t);){const n=Sl(t,void 0),r=Sl(this.putters,void 0);r[2]&&Bc(r[1],!0),Bc(n,r[0])}}get shutdown(){return N(ZS,te(t=>N(ie(()=>Qf(this.putters)),te(n=>co(n,([r,i,a])=>a?N(KU(i,t),oa):wt,!1,!1)))))}handleSurplus(t,n,r,i){return ft(a=>{const o=cx(a.id());return N(qe(()=>(this.unsafeOffer(t,o),this.unsafeOnQueueEmptySpace(n,r),Df(this,n,r),Dn(i)?Uo:$l(o))),zg(()=>ie(()=>this.unsafeRemove(o))))})}unsafeOnQueueEmptySpace(t,n){let r=!0;for(;r&&(t.capacity()===Number.POSITIVE_INFINITY||t.length()<t.capacity());){const i=N(this.putters,Sl(Qr));if(i===Qr)r=!1;else{const a=t.offer(i[0]);a&&i[2]?Bc(i[1],!0):a||k0(this.putters,N(Qf(this.putters),Er(i))),Df(this,t,n)}}}unsafeOffer(t,n){const r=gt(t);for(let i=0;i<r.length;i++){const a=r[i];i===r.length-1?N(this.putters,Vp([a,n,!0])):N(this.putters,Vp([a,n,!1]))}}unsafeRemove(t){k0(this.putters,N(Qf(this.putters),vR(([,n])=>n!==t)))}}var Az;Az=cH;class Jme{constructor(){S(this,Az,uH)}surplusSize(){return 0}get shutdown(){return wt}onCompleteTakersWithEmptyQueue(){}handleSurplus(t,n,r,i){return fe(!1)}unsafeOnQueueEmptySpace(t,n){}}const Bc=(e,t)=>dx(e,fe(t)),k0=(e,t)=>N(e,J6(t)),Qf=e=>N(e,LA(Number.POSITIVE_INFINITY)),Xme=(e,t)=>N(e,LA(t)),Qme=(e,t)=>{k0(e,N(Qf(e),vR(n=>t!==n)))},Df=(e,t,n)=>{let r=!0;for(;r&&t.length()!==0;){const i=N(n,Sl(Qr));if(i!==Qr){const a=t.poll(Qr);a!==Qr?(Bc(i,a),e.unsafeOnQueueEmptySpace(t,n)):k0(n,N(Qf(n),Er(i))),r=!0}else r=!1}r&&t.length()===0&&!Tk(n)&&e.onCompleteTakersWithEmptyQueue(n)},Zme=T(2,(e,t)=>e.publish(t)),epe=Zme,mH=$me,tpe=Lme,npe=Fme,rpe=Ume,C0=Bme,Wu=Hme,ipe=qme,mj=Nk,ape=Kme,pH="Continue",ope="Close",spe="Yield",lpe="effect/ChannelChildExecutorDecision",pj=Symbol.for(lpe),cpe={[pj]:pj},gH=e=>{const t=Object.create(cpe);return t._tag=pH,t},Ub="ContinuationK",upe="ContinuationFinalizer",yH=Symbol.for("effect/ChannelContinuation"),bH={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutDone:e=>e,_OutErr2:e=>e,_OutElem:e=>e,_OutDone2:e=>e};var Oz;Oz=yH;class vH{constructor(t,n){S(this,"onSuccess");S(this,"onHalt");S(this,"_tag",Ub);S(this,Oz,bH);this.onSuccess=t,this.onHalt=n}onExit(t){return pA(t)?this.onHalt(t.cause):this.onSuccess(t.value)}}var Mz;Mz=yH;class fpe{constructor(t){S(this,"finalizer");S(this,"_tag",upe);S(this,Mz,bH);this.finalizer=t}}const SH="PullAfterNext",dpe="PullAfterAllEnqueued",hpe="effect/ChannelUpstreamPullStrategy",mpe=Symbol.for(hpe),ppe={_A:e=>e},gpe={[mpe]:ppe},xH=e=>{const t=Object.create(gpe);return t._tag=SH,t.emitSeparator=e,t},wH="BracketOut",_H="Bridge",VA="ConcatAll",EH="Emit",kH="Ensuring",CH="Fail",TH="Fold",RH="FromEffect",AH="PipeTo",ype="Provide",OH="Read",MH="Succeed",NH="SucceedNow",DH="Suspend",bpe="effect/Channel",jH=Symbol.for(bpe),vpe={_Env:e=>e,_InErr:e=>e,_InElem:e=>e,_InDone:e=>e,_OutErr:e=>e,_OutElem:e=>e,_OutDone:e=>e},si={[jH]:vpe,pipe(){return he(this,arguments)}},IH=e=>Re(e,jH)||Wl(e),Spe=T(2,(e,t)=>{const n=Object.create(si);return n._tag=wH,n.acquire=()=>e,n.finalizer=t,n}),$H=(e,t,n)=>{const r=Object.create(si);return r._tag=VA,r.combineInners=t,r.combineAll=n,r.onPull=()=>xH(ne()),r.onEmit=()=>gH,r.value=()=>e,r.k=ke,r},xpe=T(4,(e,t,n,r)=>{const i=Object.create(si);return i._tag=VA,i.combineInners=n,i.combineAll=r,i.onPull=()=>xH(ne()),i.onEmit=()=>gH,i.value=()=>e,i.k=t,i}),LH=T(2,(e,t)=>{const n=Object.create(si);return n._tag=_H,n.input=t,n.channel=e,n}),wpe=T(2,(e,t)=>{const n=Object.create(si);return n._tag=kH,n.channel=e,n.finalizer=t,n}),KA=e=>ki(y6(e)),ki=e=>_pe(()=>e),_pe=e=>{const t=Object.create(si);return t._tag=CH,t.error=e,t},_n=T(2,(e,t)=>{const n=Object.create(si);return n._tag=TH,n.channel=e,n.k=new vH(t,ki),n}),Nr=e=>{const t=Object.create(si);return t._tag=RH,t.effect=()=>e,t},Ta=T(2,(e,t)=>{const n=Object.create(si);return n._tag=AH,n.left=()=>e,n.right=()=>t,n}),zH=e=>xh({onInput:e.onInput,onFailure:t=>ti(Tfe(t),{onLeft:e.onFailure,onRight:ki}),onDone:e.onDone}),xh=e=>{const t=Object.create(si);return t._tag=OH,t.more=e.onInput,t.done=new vH(e.onDone,e.onFailure),t},PH=e=>YA(()=>e),Kp=e=>{const t=Object.create(si);return t._tag=NH,t.terminal=e,t},GA=e=>{const t=Object.create(si);return t._tag=DH,t.channel=e,t},YA=e=>{const t=Object.create(si);return t._tag=MH,t.evaluate=e,t},Rs=Kp(void 0),fr=e=>{const t=Object.create(si);return t._tag=EH,t.out=e,t},Yg="Done",Wg="Emit",wh="FromEffect",Jg="Read",Epe=Symbol.for("effect/ChannelState"),kpe={_E:e=>e,_R:e=>e},kx={[Epe]:kpe},Ju=()=>{const e=Object.create(kx);return e._tag=Yg,e},M1=()=>{const e=Object.create(kx);return e._tag=Wg,e},Xh=e=>{const t=Object.create(kx);return t._tag=wh,t.effect=e,t},N1=(e,t,n,r)=>{const i=Object.create(kx);return i._tag=Jg,i.upstream=e,i.onEffect=t,i.onEmit=n,i.onDone=r,i},T0=e=>e._tag===wh,Cpe=e=>T0(e)?e.effect:ot,gj=e=>T0(e)?Khe(e.effect):void 0,FH="PullFromChild",Dk="PullFromUpstream",jk="DrainChildExecutors",UH="Emit";class Yy{constructor(t,n,r){S(this,"childExecutor");S(this,"parentSubexecutor");S(this,"onEmit");S(this,"_tag",FH);this.childExecutor=t,this.parentSubexecutor=n,this.onEmit=r}close(t){const n=this.childExecutor.close(t),r=this.parentSubexecutor.close(t);return n!==void 0&&r!==void 0?wx(cr(n),cr(r),(i,a)=>N(i,Up(a))):n!==void 0?n:r!==void 0?r:void 0}enqueuePullFromChild(t){return this}}class _c{constructor(t,n,r,i,a,o,s,l){S(this,"upstreamExecutor");S(this,"createChild");S(this,"lastDone");S(this,"activeChildExecutors");S(this,"combineChildResults");S(this,"combineWithChildResult");S(this,"onPull");S(this,"onEmit");S(this,"_tag",Dk);this.upstreamExecutor=t,this.createChild=n,this.lastDone=r,this.activeChildExecutors=i,this.combineChildResults=a,this.combineWithChildResult=o,this.onPull=s,this.onEmit=l}close(t){const n=this.upstreamExecutor.close(t),i=[...this.activeChildExecutors.map(a=>a!==void 0?a.childExecutor.close(t):void 0),n].reduce((a,o)=>a!==void 0&&o!==void 0?wx(a,cr(o),(s,l)=>Up(s,l)):a!==void 0?a:o!==void 0?cr(o):void 0,void 0);return i}enqueuePullFromChild(t){return new _c(this.upstreamExecutor,this.createChild,this.lastDone,[...this.activeChildExecutors,t],this.combineChildResults,this.combineWithChildResult,this.onPull,this.onEmit)}}class jf{constructor(t,n,r,i,a,o,s){S(this,"upstreamExecutor");S(this,"lastDone");S(this,"activeChildExecutors");S(this,"upstreamDone");S(this,"combineChildResults");S(this,"combineWithChildResult");S(this,"onPull");S(this,"_tag",jk);this.upstreamExecutor=t,this.lastDone=n,this.activeChildExecutors=r,this.upstreamDone=i,this.combineChildResults=a,this.combineWithChildResult=o,this.onPull=s}close(t){const n=this.upstreamExecutor.close(t),i=[...this.activeChildExecutors.map(a=>a!==void 0?a.childExecutor.close(t):void 0),n].reduce((a,o)=>a!==void 0&&o!==void 0?wx(a,cr(o),(s,l)=>Up(s,l)):a!==void 0?a:o!==void 0?cr(o):void 0,void 0);return i}enqueuePullFromChild(t){return new jf(this.upstreamExecutor,this.lastDone,[...this.activeChildExecutors,t],this.upstreamDone,this.combineChildResults,this.combineWithChildResult,this.onPull)}}class D1{constructor(t,n){S(this,"value");S(this,"next");S(this,"_tag",UH);this.value=t,this.next=n}close(t){const n=this.next.close(t);return n}enqueuePullFromChild(t){return this}}const Tpe="Pulled",Rpe="NoUpstream",Ape="effect/ChannelUpstreamPullRequest",Ope=Symbol.for(Ape),Mpe={_A:e=>e},BH={[Ope]:Mpe},yj=e=>{const t=Object.create(BH);return t._tag=Tpe,t.value=e,t},Npe=e=>{const t=Object.create(BH);return t._tag=Rpe,t.activeDownstreamCount=e,t};class Rc{constructor(t,n,r){S(this,"_activeSubexecutor");S(this,"_cancelled");S(this,"_closeLastSubstream");S(this,"_currentChannel");S(this,"_done");S(this,"_doneStack",[]);S(this,"_emitted");S(this,"_executeCloseLastSubstream");S(this,"_input");S(this,"_inProgressFinalizer");S(this,"_providedEnv");this._currentChannel=t,this._executeCloseLastSubstream=r,this._providedEnv=n}run(){let t;for(;t===void 0;)if(this._cancelled!==void 0)t=this.processCancellation();else if(this._activeSubexecutor!==void 0)t=this.runSubexecutor();else try{if(this._currentChannel===void 0)t=Ju();else switch(Wl(this._currentChannel)&&(this._currentChannel=Nr(this._currentChannel)),this._currentChannel._tag){case wH:{t=this.runBracketOut(this._currentChannel);break}case _H:{const n=this._currentChannel.input;if(this._currentChannel=this._currentChannel.channel,this._input!==void 0){const r=this._input;this._input=void 0;const i=()=>Te(n.awaitRead(),()=>ln(()=>{const a=r.run();switch(a._tag){case Yg:return ts(r.getDone(),{onFailure:o=>n.error(o),onSuccess:o=>n.done(o)});case Wg:return Te(n.emit(r.getEmit()),()=>i());case wh:return xa(a.effect,{onFailure:o=>n.error(o),onSuccess:()=>i()});case Jg:return WA(a,()=>i(),o=>n.error(o))}}));t=Xh(Te(eme(Sa(i())),a=>Ct(()=>this.addFinalizer(o=>Te(vl(a),()=>ln(()=>{const s=this.restorePipe(o,r);return s!==void 0?s:ot}))))))}break}case VA:{const n=new Rc(this._currentChannel.value(),this._providedEnv,i=>Ct(()=>{const a=this._closeLastSubstream===void 0?ot:this._closeLastSubstream;this._closeLastSubstream=N(a,or(i))}));n._input=this._input;const r=this._currentChannel;this._activeSubexecutor=new _c(n,i=>r.k(i),void 0,[],(i,a)=>r.combineInners(i,a),(i,a)=>r.combineAll(i,a),i=>r.onPull(i),i=>r.onEmit(i)),this._closeLastSubstream=void 0,this._currentChannel=void 0;break}case EH:{this._emitted=this._currentChannel.out,this._currentChannel=this._activeSubexecutor!==void 0?void 0:Rs,t=M1();break}case kH:{this.runEnsuring(this._currentChannel);break}case CH:{t=this.doneHalt(this._currentChannel.error());break}case TH:{this._doneStack.push(this._currentChannel.k),this._currentChannel=this._currentChannel.channel;break}case RH:{const n=this._providedEnv===void 0?this._currentChannel.effect():N(this._currentChannel.effect(),_0(this._providedEnv));t=Xh(xa(n,{onFailure:r=>{const i=this.doneHalt(r);return i!==void 0&&T0(i)?i.effect:ot},onSuccess:r=>{const i=this.doneSucceed(r);return i!==void 0&&T0(i)?i.effect:ot}}));break}case AH:{const n=this._input,r=new Rc(this._currentChannel.left(),this._providedEnv,i=>this._executeCloseLastSubstream(i));r._input=n,this._input=r,this.addFinalizer(i=>{const a=this.restorePipe(i,n);return a!==void 0?a:ot}),this._currentChannel=this._currentChannel.right();break}case ype:{const n=this._providedEnv;this._providedEnv=this._currentChannel.context(),this._currentChannel=this._currentChannel.inner,this.addFinalizer(()=>Ct(()=>{this._providedEnv=n}));break}case OH:{const n=this._currentChannel;t=N1(this._input,ke,r=>{try{this._currentChannel=n.more(r)}catch(i){this._currentChannel=n.done.onExit(Wle(i))}},r=>{const i=a=>n.done.onExit(a);this._currentChannel=i(r)});break}case MH:{t=this.doneSucceed(this._currentChannel.evaluate());break}case NH:{t=this.doneSucceed(this._currentChannel.terminal);break}case DH:{this._currentChannel=this._currentChannel.channel();break}}}catch(n){this._currentChannel=ki(wk(n))}return t}getDone(){return this._done}getEmit(){return this._emitted}cancelWith(t){this._cancelled=t}clearInProgressFinalizer(){this._inProgressFinalizer=void 0}storeInProgressFinalizer(t){this._inProgressFinalizer=t}popAllFinalizers(t){const n=[];let r=this._doneStack.pop();for(;r;)r._tag==="ContinuationFinalizer"&&n.push(r.finalizer),r=this._doneStack.pop();const i=n.length===0?ot:I1(n,t);return this.storeInProgressFinalizer(i),i}popNextFinalizers(){const t=[];for(;this._doneStack.length!==0;){const n=this._doneStack[this._doneStack.length-1];if(n._tag===Ub)return t;t.push(n),this._doneStack.pop()}return t}restorePipe(t,n){const r=this._input;return this._input=n,r!==void 0?r.close(t):ot}close(t){let n;const r=this._inProgressFinalizer;r!==void 0&&(n=N(r,Nf(Ct(()=>this.clearInProgressFinalizer()))));let i;const a=this.popAllFinalizers(t);a!==void 0&&(i=N(a,Nf(Ct(()=>this.clearInProgressFinalizer()))));const o=this._activeSubexecutor===void 0?void 0:this._activeSubexecutor.close(t);if(!(o===void 0&&n===void 0&&i===void 0))return N(cr(j1(o)),E0(cr(j1(n))),E0(cr(j1(i))),yt(([[s,l],c])=>N(s,Up(l),Up(c))),gm,Te(s=>ln(()=>s)))}doneSucceed(t){if(this._doneStack.length===0)return this._done=bi(t),this._currentChannel=void 0,Ju();const n=this._doneStack[this._doneStack.length-1];if(n._tag===Ub){this._doneStack.pop(),this._currentChannel=n.onSuccess(t);return}const r=this.popNextFinalizers();if(this._doneStack.length===0)return this._doneStack=r.reverse(),this._done=bi(t),this._currentChannel=void 0,Ju();const i=I1(r.map(o=>o.finalizer),bi(t));this.storeInProgressFinalizer(i);const a=N(i,Nf(Ct(()=>this.clearInProgressFinalizer())),gm,Te(()=>Ct(()=>this.doneSucceed(t))));return Xh(a)}doneHalt(t){if(this._doneStack.length===0)return this._done=xr(t),this._currentChannel=void 0,Ju();const n=this._doneStack[this._doneStack.length-1];if(n._tag===Ub){this._doneStack.pop();try{this._currentChannel=n.onHalt(t)}catch(o){this._currentChannel=ki(wk(o))}return}const r=this.popNextFinalizers();if(this._doneStack.length===0)return this._doneStack=r.reverse(),this._done=xr(t),this._currentChannel=void 0,Ju();const i=I1(r.map(o=>o.finalizer),xr(t));this.storeInProgressFinalizer(i);const a=N(i,Nf(Ct(()=>this.clearInProgressFinalizer())),gm,Te(()=>Ct(()=>this.doneHalt(t))));return Xh(a)}processCancellation(){return this._currentChannel=void 0,this._done=this._cancelled,this._cancelled=void 0,Ju()}runBracketOut(t){const n=gm(xa(this.provide(t.acquire()),{onFailure:r=>Ct(()=>{this._currentChannel=ki(r)}),onSuccess:r=>Ct(()=>{this.addFinalizer(i=>this.provide(t.finalizer(r,i))),this._currentChannel=fr(r)})}));return Xh(n)}provide(t){return this._providedEnv===void 0?t:N(t,_0(this._providedEnv))}runEnsuring(t){this.addFinalizer(t.finalizer),this._currentChannel=t.channel}addFinalizer(t){this._doneStack.push(new fpe(t))}runSubexecutor(){const t=this._activeSubexecutor;switch(t._tag){case FH:return this.pullFromChild(t.childExecutor,t.parentSubexecutor,t.onEmit,t);case Dk:return this.pullFromUpstream(t);case jk:return this.drainChildExecutors(t);case UH:return this._emitted=t.value,this._activeSubexecutor=t.next,M1()}}replaceSubexecutor(t){this._currentChannel=void 0,this._activeSubexecutor=t}finishWithExit(t){const n=ts(t,{onFailure:r=>this.doneHalt(r),onSuccess:r=>this.doneSucceed(r)});return this._activeSubexecutor=void 0,n===void 0?ot:Cpe(n)}finishSubexecutorWithCloseEffect(t,...n){this.addFinalizer(()=>N(n,uo(i=>N(Ct(()=>i(t)),Te(a=>a!==void 0?a:ot)),{discard:!0})));const r=N(t,ts({onFailure:i=>this.doneHalt(i),onSuccess:i=>this.doneSucceed(i)}));return this._activeSubexecutor=void 0,r}applyUpstreamPullStrategy(t,n,r){switch(r._tag){case SH:{const i=!t||n.some(a=>a!==void 0);return[r.emitSeparator,i?[void 0,...n]:n]}case dpe:{const i=!t||n.some(a=>a!==void 0);return[r.emitSeparator,i?[...n,void 0]:n]}}}pullFromChild(t,n,r,i){return N1(t,ke,a=>{const o=r(a);switch(o._tag){case pH:break;case ope:{this.finishWithDoneValue(t,n,o.value);break}case spe:{const s=n.enqueuePullFromChild(i);this.replaceSubexecutor(s);break}}this._activeSubexecutor=new D1(a,this._activeSubexecutor)},ts({onFailure:a=>{const o=this.handleSubexecutorFailure(t,n,a);return o===void 0?void 0:gj(o)},onSuccess:a=>{this.finishWithDoneValue(t,n,a)}}))}finishWithDoneValue(t,n,r){const i=n;switch(i._tag){case Dk:{const a=new _c(i.upstreamExecutor,i.createChild,i.lastDone!==void 0?i.combineChildResults(i.lastDone,r):r,i.activeChildExecutors,i.combineChildResults,i.combineWithChildResult,i.onPull,i.onEmit);this._closeLastSubstream=t.close(bi(r)),this.replaceSubexecutor(a);break}case jk:{const a=new jf(i.upstreamExecutor,i.lastDone!==void 0?i.combineChildResults(i.lastDone,r):r,i.activeChildExecutors,i.upstreamDone,i.combineChildResults,i.combineWithChildResult,i.onPull);this._closeLastSubstream=t.close(bi(r)),this.replaceSubexecutor(a);break}}}handleSubexecutorFailure(t,n,r){return this.finishSubexecutorWithCloseEffect(xr(r),i=>n.close(i),i=>t.close(i))}pullFromUpstream(t){if(t.activeChildExecutors.length===0)return this.performPullFromUpstream(t);const n=t.activeChildExecutors[0],r=new _c(t.upstreamExecutor,t.createChild,t.lastDone,t.activeChildExecutors.slice(1),t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit);if(n===void 0)return this.performPullFromUpstream(r);this.replaceSubexecutor(new Yy(n.childExecutor,r,n.onEmit))}performPullFromUpstream(t){return N1(t.upstreamExecutor,n=>{const r=this._closeLastSubstream===void 0?ot:this._closeLastSubstream;return this._closeLastSubstream=void 0,N(this._executeCloseLastSubstream(r),or(n))},n=>{if(this._closeLastSubstream!==void 0){const o=this._closeLastSubstream;return this._closeLastSubstream=void 0,N(this._executeCloseLastSubstream(o),yt(()=>{const s=new Rc(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);s._input=this._input;const[l,c]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(yj(n)));this._activeSubexecutor=new Yy(s,new _c(t.upstreamExecutor,t.createChild,t.lastDone,c,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),Dt(l)&&(this._activeSubexecutor=new D1(l.value,this._activeSubexecutor))}))}const r=new Rc(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);r._input=this._input;const[i,a]=this.applyUpstreamPullStrategy(!1,t.activeChildExecutors,t.onPull(yj(n)));this._activeSubexecutor=new Yy(r,new _c(t.upstreamExecutor,t.createChild,t.lastDone,a,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit),Dt(i)&&(this._activeSubexecutor=new D1(i.value,this._activeSubexecutor))},n=>{if(t.activeChildExecutors.some(a=>a!==void 0)){const a=new jf(t.upstreamExecutor,t.lastDone,[void 0,...t.activeChildExecutors],t.upstreamExecutor.getDone(),t.combineChildResults,t.combineWithChildResult,t.onPull);if(this._closeLastSubstream!==void 0){const o=this._closeLastSubstream;return this._closeLastSubstream=void 0,N(this._executeCloseLastSubstream(o),yt(()=>this.replaceSubexecutor(a)))}this.replaceSubexecutor(a);return}const r=this._closeLastSubstream,i=this.finishSubexecutorWithCloseEffect(N(n,Xle(a=>t.combineWithChildResult(t.lastDone,a))),()=>r,a=>t.upstreamExecutor.close(a));return i===void 0?void 0:gj(i)})}drainChildExecutors(t){if(t.activeChildExecutors.length===0){const a=this._closeLastSubstream;return a!==void 0&&this.addFinalizer(()=>Ht(a)),this.finishSubexecutorWithCloseEffect(t.upstreamDone,()=>a,o=>t.upstreamExecutor.close(o))}const n=t.activeChildExecutors[0],r=t.activeChildExecutors.slice(1);if(n===void 0){const[a,o]=this.applyUpstreamPullStrategy(!0,r,t.onPull(Npe(r.reduce((s,l)=>l!==void 0?s+1:s,0))));return this.replaceSubexecutor(new jf(t.upstreamExecutor,t.lastDone,o,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull)),Dt(a)?(this._emitted=a.value,M1()):void 0}const i=new jf(t.upstreamExecutor,t.lastDone,r,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull);this.replaceSubexecutor(new Yy(n.childExecutor,i,n.onEmit))}}const j1=e=>e!==void 0?e:ot,I1=(e,t)=>N(uo(e,n=>cr(n(t))),yt(n=>N(Yle(n),zt(()=>gA))),Te(n=>ln(()=>n))),WA=(e,t,n)=>{const r=[e],i=()=>{const a=r.pop();if(a===void 0||a.upstream===void 0)return qhe("Unexpected end of input for channel execution");const o=a.upstream.run();switch(o._tag){case Wg:{const s=a.onEmit(a.upstream.getEmit());return r.length===0?s===void 0?ln(t):N(s,xa({onFailure:n,onSuccess:t})):s===void 0?ln(()=>i()):N(s,xa({onFailure:n,onSuccess:()=>i()}))}case Yg:{const s=a.onDone(a.upstream.getDone());return r.length===0?s===void 0?ln(t):N(s,xa({onFailure:n,onSuccess:t})):s===void 0?ln(()=>i()):N(s,xa({onFailure:n,onSuccess:()=>i()}))}case wh:return r.push(a),N(a.onEffect(o.effect),zA(s=>ln(()=>{const l=a.onDone(xr(s));return l===void 0?ot:l})),xa({onFailure:n,onSuccess:()=>i()}));case Jg:return r.push(a),r.push(o),ln(()=>i())}};return i()},Dpe=T(2,(e,t)=>{const n=(r,i,a)=>Xhe(Ct(()=>new Rc(e,void 0,ke)),o=>ln(()=>Bb(o.run(),o).pipe(eH(r),or(Dr(r)),BA(Dr(i)))),(o,s)=>{const l=o.close(s);return l===void 0?ot:rH(l,c=>y0(a,Ca(c)))});return x0(r=>Hhe([E6(t,e0),no(),no()]).pipe(Te(([i,a,o])=>r(n(a,o,i)).pipe(Uc(t),Te(s=>t.addFinalizer(l=>{const c=pA(l)?kfe(l.cause):void 0;return Ck(a).pipe(Te(f=>f?ns(o,void 0).pipe(or(R6(s)),or(ej(s))):ns(o,void 0).pipe(or(c&&MR(c)>0?OA(s,bre(c)):vl(s)),or(ej(s)))))}).pipe(or(r(Dr(a)))))))))}),Bb=(e,t)=>{const n=e;switch(n._tag){case wh:return N(n.effect,Te(()=>Bb(t.run(),t)));case Wg:return Bb(t.run(),t);case Yg:return ln(()=>t.getDone());case Jg:return WA(n,()=>Bb(t.run(),t),Ca)}},jpe="Done",Ipe="Await",$pe="effect/ChannelMergeDecision",Lpe=Symbol.for($pe),zpe={[Lpe]:{_R:e=>e,_E0:e=>e,_Z0:e=>e,_E:e=>e,_Z:e=>e}},bj=e=>{const t=Object.create(zpe);return t._tag=Ipe,t.f=e,t},HH="BothRunning",qH="LeftDone",VH="RightDone",Ppe="effect/ChannelMergeState",vj=Symbol.for(Ppe),JA={[vj]:vj},$1=(e,t)=>{const n=Object.create(JA);return n._tag=HH,n.left=e,n.right=t,n},Sj=e=>{const t=Object.create(JA);return t._tag=qH,t.f=e,t},xj=e=>{const t=Object.create(JA);return t._tag=VH,t.f=e,t},KH="BackPressure",GH="BufferSliding",Fpe="effect/ChannelMergeStrategy",wj=Symbol.for(Fpe),YH={[wj]:wj},Upe=e=>{const t=Object.create(YH);return t._tag=KH,t},Bpe=e=>{const t=Object.create(YH);return t._tag=GH,t},Hpe=T(2,(e,{onBackPressure:t,onBufferSliding:n})=>{switch(e._tag){case KH:return t();case GH:return n()}}),cf="Empty",ym="Emit",bm="Error",vm="Done",WH=e=>({_tag:cf,notifyProducer:e}),L1=e=>({_tag:ym,notifyConsumers:e}),qpe=e=>({_tag:bm,cause:e}),Vpe=e=>({_tag:vm,done:e});class Kpe{constructor(t){S(this,"ref");this.ref=t}awaitRead(){return lf(Gh(this.ref,t=>t._tag===cf?[Dr(t.notifyProducer),t]:[ot,t]))}get close(){return Zhe(t=>this.error(b6(t)))}done(t){return lf(Gh(this.ref,n=>{switch(n._tag){case cf:return[Dr(n.notifyProducer),n];case ym:return[uo(n.notifyConsumers,r=>ns(r,De(t)),{discard:!0}),Vpe(t)];case bm:return[xc,n];case vm:return[xc,n]}}))}emit(t){return Te(no(),n=>lf(Gh(this.ref,r=>{switch(r._tag){case cf:return[Dr(r.notifyProducer),r];case ym:{const i=r.notifyConsumers[0],a=r.notifyConsumers.slice(1);if(i!==void 0)return[ns(i,Ne(t)),a.length===0?WH(n):L1(a)];throw new Error("Bug: Channel.SingleProducerAsyncInput.emit - Queue was empty! please report an issue at https://github.com/Effect-TS/effect/issues")}case bm:return[xc,r];case vm:return[xc,r]}})))}error(t){return lf(Gh(this.ref,n=>{switch(n._tag){case cf:return[Dr(n.notifyProducer),n];case ym:return[uo(n.notifyConsumers,r=>Nhe(r,t),{discard:!0}),qpe(t)];case bm:return[xc,n];case vm:return[xc,n]}}))}get take(){return this.takeWith(t=>xr(Afe(t,De)),t=>bi(t),t=>l0(Ne(t)))}takeWith(t,n,r){return Te(no(),i=>lf(Gh(this.ref,a=>{switch(a._tag){case cf:return[or(ns(a.notifyProducer,void 0),Ok(Dr(i),{onFailure:t,onSuccess:ti({onLeft:r,onRight:n})})),L1([i])];case ym:return[Ok(Dr(i),{onFailure:t,onSuccess:ti({onLeft:r,onRight:n})}),L1([...a.notifyConsumers,i])];case bm:return[Ht(t(a.cause)),a];case vm:return[Ht(r(a.done)),a]}})))}}const JH=()=>N(no(),Te(e=>dA(WH(e))),yt(e=>new Kpe(e))),Ik=T(2,(e,t)=>xpe(e,t,()=>{},()=>{})),Gpe=e=>{const t=xh({onInput:()=>t,onFailure:ki,onDone:PH});return Ta(e,t)},XH=T(2,(e,t)=>wpe(e,()=>t)),Ype=e=>_n(e,ke),XA=e=>xl(e.takeWith(ki,t=>_n(fr(t),()=>XA(e)),PH)),QH=T(2,(e,t)=>_n(e,n=>YA(()=>t(n)))),ZH=T(2,(e,t)=>{const n=zH({onInput:r=>_n(fr(t(r)),()=>n),onFailure:KA,onDone:Kp});return Ta(e,n)}),Wpe=e=>t=>Jpe(e)(t,bd),Jpe=({bufferSize:e=16,concurrency:t,mergeStrategy:n=Upe()})=>(r,i)=>r8(a=>Xf(function*(){const o=t==="unbounded"?Number.MAX_SAFE_INTEGER:t,s=yield*JH(),l=XA(s),c=yield*mH(e);yield*y0(a,C0(c));const f=yield*tpe();yield*y0(a,C0(f));const u=yield*dA(ne()),d=yield*no(),h=(yield*ome(o)).withPermits,m=yield*Zf(Ta(l,r),a);function b(g){return g.pipe(Te(ti({onLeft:v=>Ht(ae(v)),onRight:v=>R1(Wu(c,Ht(Ne(v))),ne())})),fj({until:v=>Dt(v)}),Te(v=>vle(u,Mt({onNone:()=>ae(v.value),onSome:x=>ae(i(x,v.value))}))),zA(v=>m0(v)?Ca(v):Wu(c,Ca(v)).pipe(or(ns(d,void 0)),PA)))}yield*m.pipe(xa({onFailure:g=>Wu(c,Ca(g)).pipe(or(Ht(!1))),onSuccess:ti({onLeft:g=>tH(Sa(Dr(d)),Sa(h(o)(ot)),{onSelfDone:(v,x)=>R1(vl(x),!1),onOtherDone:(v,x)=>or(vl(x),gle(u).pipe(Te(Mt({onNone:()=>Wu(c,Ht(De(g))),onSome:E=>Wu(c,Ht(De(i(E,g))))})),R1(!1)))}),onRight:g=>Hpe(n,{onBackPressure:()=>Xf(function*(){const v=yield*no(),x=Ak(C=>Zf(Ta(l,g),C).pipe(Te(k=>A1(cr(b(k)),cr(Sa(Dr(d))))),Te(ke)));return yield*ns(v,void 0).pipe(or(x),h(1),Uc(a)),yield*Dr(v),!(yield*Ck(d))}),onBufferSliding:()=>Xf(function*(){const v=yield*no(),x=yield*no(),E=yield*npe(f);yield*mj(f).pipe(Te(_=>ns(_,void 0)),nme(()=>E>=o)),yield*Wu(f,v);const C=Ak(_=>Zf(Ta(l,g),_).pipe(Te(A=>cr(b(A)).pipe(A1(cr(Sa(Dr(d)))),A1(cr(Sa(Dr(v)))))),Te(ke)));return yield*ns(x,void 0).pipe(or(C),h(1),Uc(a)),yield*Dr(x),!(yield*Ck(d))})})})}),fj({while:g=>g}),Uc(a));const w=N(mj(c),lf,Ok({onFailure:ki,onSuccess:ti({onLeft:Kp,onRight:g=>_n(fr(g),()=>w)})}),xl);return LH(w,s)})),e8=T(3,(e,t,n)=>Wpe(n)(ZH(e,t))),Xpe=T(2,(e,t)=>{function n(r){return Xf(function*(){const i=yield*JH(),a=XA(i),o=yield*Zf(Ta(a,e),r),s=yield*Zf(Ta(a,t.other),r);function l(f,u,d){return(h,m,b)=>{function w(g){const v=g;return v._tag===jpe?Ht(Nr(or(vl(u),v.effect))):yt(R6(u),ts({onFailure:x=>Nr(v.f(xr(x))),onSuccess:ti({onLeft:x=>Nr(v.f(bi(x))),onRight:x=>QA(fr(x),c(b(v.f)))})}))}return ts(f,{onFailure:g=>w(h(xr(g))),onSuccess:ti({onLeft:g=>w(h(bi(g))),onRight:g=>Ht(_n(fr(g),()=>_n(Nr(Uc(Sa(d),r)),v=>c(m(v,u)))))})})}}function c(f){switch(f._tag){case HH:{const u=Sa(tj(f.left)),d=Sa(tj(f.right));return xl(tH(u,d,{onSelfDone:(h,m)=>or(vl(m),l(h,f.right,o)(t.onSelfDone,$1,b=>Sj(b))),onOtherDone:(h,m)=>or(vl(m),l(h,f.left,s)(t.onOtherDone,(b,w)=>$1(w,b),b=>xj(b)))}))}case qH:return xl(yt(cr(s),ts({onFailure:u=>Nr(f.f(xr(u))),onSuccess:ti({onLeft:u=>Nr(f.f(bi(u))),onRight:u=>_n(fr(u),()=>c(Sj(f.f)))})})));case VH:return xl(yt(cr(o),ts({onFailure:u=>Nr(f.f(xr(u))),onSuccess:ti({onLeft:u=>Nr(f.f(bi(u))),onRight:u=>_n(fr(u),()=>c(xj(f.f)))})})))}}return Nr(S0(f=>{const u=S0(m=>(m.transferChildren(f.scope()),ot)),d=Sa(o).pipe(Nf(u),Uc(r)),h=Sa(s).pipe(Nf(u),Uc(r));return wx(d,h,(m,b)=>$1(m,b))})).pipe(_n(c),LH(i))})}return r8(n)}),Qpe=T(2,(e,t)=>GA(()=>{let n;const r=zH({onInput:a=>_n(fr(a),()=>r),onFailure:a=>(n=ige(a),ki(wk(n))),onDone:Kp}),i=xh({onInput:a=>N(fr(a),_n(()=>i)),onFailure:a=>_fe(a)&&age(a.defect)&&Se(a.defect,n)?KA(a.defect.error):ki(a),onDone:Kp});return Ta(Ta(Ta(e,r),t),i)})),Zpe=e=>Ak(t=>Dpe(e,t)),t8=e=>Zpe(Gpe(e)),n8=e=>xl(x0(t=>yt(k6(),n=>Spe(rH(t(lde(e,n)),r=>b0(n,xr(r))),(r,i)=>b0(n,i))))),ege=e=>nge(yt(xx,t=>_n(Nr(e(t)),fr))),tge=e=>Te(xx,t=>Zf(e,t)),Zf=T(2,(e,t)=>E0(Ct(()=>new Rc(e,void 0,ke)),Gg()).pipe(nH(([n,r])=>sde(t,i=>{const a=n.close(i);return a!==void 0?_0(a,r):ot})),gm,yt(([n])=>ln(()=>$k(n.run(),n))))),$k=(e,t)=>{const n=e;switch(n._tag){case Yg:return ts(t.getDone(),{onFailure:Ca,onSuccess:r=>Ht(De(r))});case Wg:return Ht(Ne(t.getEmit()));case wh:return N(n.effect,Te(()=>$k(t.run(),t)));case Jg:return WA(n,()=>$k(t.run(),t),r=>Ca(r))}},xl=e=>Ype(Nr(e)),nge=e=>$H(n8(e),(t,n)=>t,(t,n)=>t),r8=e=>$H(ege(e),(t,n)=>t,(t,n)=>t),i8=e=>a8(0,e.length,e),a8=(e,t,n)=>e===t?Rs:N(fr(N(n,gl(e))),_n(()=>a8(e+1,t,n))),rge=T(e=>IH(e[1]),(e,t,n)=>n!=null&&n.concurrent?Xpe(e,{other:t,onSelfDone:r=>bj(i=>ln(()=>zD(r,i))),onOtherDone:r=>bj(i=>ln(()=>zD(i,r)))}):_n(e,r=>QH(t,i=>[r,i]))),QA=T(e=>IH(e[1]),(e,t,n)=>n!=null&&n.concurrent?QH(rge(e,t,{concurrent:!0}),r=>r[1]):_n(e,()=>t)),Lk=Symbol.for("effect/Channel/ChannelException"),ige=e=>({_tag:"ChannelException",[Lk]:Lk,error:e}),age=e=>Re(e,Lk),oge=Symbol.for("effect/Sink"),sge={_A:e=>e,_In:e=>e,_L:e=>e,_E:e=>e,_R:e=>e};var Nz;Nz=oge;class ZA{constructor(t){S(this,"channel");S(this,Nz,sge);this.channel=t}pipe(){return he(this,arguments)}}const lge=e=>{const t=xh({onInput:n=>N(Nr(uo(n,r=>e(r),{discard:!0})),_n(()=>t)),onFailure:ki,onDone:()=>Rs});return new ZA(t)},cge=e=>{const t=xh({onInput:n=>N(Nr(e(n)),_n(()=>t)),onFailure:ki,onDone:()=>Rs});return new ZA(t)},uge=e=>new ZA(Nr(e)),o8=e=>Wl(e)?o8(uge(e)):e.channel,fge=()=>Eo(ne()),dge=e=>FA(Ca(e),ae),hge="effect/Stream",eO=Symbol.for(hge),mge={_R:e=>e,_E:e=>e,_A:e=>e};var Dz;Dz=eO;class Da{constructor(t){S(this,"channel");S(this,Dz,mge);this.channel=t}pipe(){return he(this,arguments)}}const Cx=e=>Re(e,eO)||Wl(e),pge=4096,s8=T(2,(e,t)=>new Da(N(Wi(e),XH(t)))),gge=e=>u8(Eo(ae(e))),yge=e=>c8(Ca(e)),bge=T(2,(e,t)=>Ege(e,vR(t))),l8=T(e=>Cx(e[0]),(e,t,n)=>{const r=(n==null?void 0:n.bufferSize)??16;return n!=null&&n.switch?_j(n==null?void 0:n.concurrency,()=>Ej(e,1,r,t),i=>Ej(e,i,r,t)):_j(n==null?void 0:n.concurrency,()=>new Da(Ik(Wi(e),i=>N(i,Vte(a=>Wi(t(a))),Gte(Rs,(a,o)=>N(a,QA(o)))))),i=>new Da(N(Wi(e),Ik(i8),e8(a=>Wi(t(a)),n))))}),_j=(e,t,n)=>{switch(e){case void 0:return t();case"unbounded":return n(Number.MAX_SAFE_INTEGER);default:return e>1?n(e):t()}},Ej=T(4,(e,t,n,r)=>new Da(N(Wi(e),Ik(i8),e8(i=>Wi(r(i)),{concurrency:t,mergeStrategy:Bpe(),bufferSize:n})))),vge=T(e=>Cx(e[0]),(e,t)=>l8(e,ke,t)),Sge=e=>new Da(e),Wi=e=>{if("channel"in e)return e.channel;if(Wl(e))return Wi(c8(e));throw new TypeError("Expected a Stream.")},xge=e=>new Da(LS(e)?Rs:fr(e)),c8=e=>N(e,FA(ae),u8),u8=e=>new Da(xl(ime(e,{onFailure:Mt({onNone:()=>Rs,onSome:KA}),onSuccess:t=>fr(Cn(t))}))),wge=(e,t)=>N(ape(e,1,(t==null?void 0:t.maxChunkSize)??pge),zA(n=>N(rpe(e),Te(r=>r&&m0(n)?fge():dge(n)))),f8,t!=null&&t.shutdown?s8(C0(e)):ke),_ge=(...e)=>{const t=e.length===1?e[0].evaluate:e[0],n=e.length===1?e[0].onError:e[1],r=e.length===1?e[0].releaseLockOnEnd===!0:!1;return m8(yt(w0(Ct(()=>t().getReader()),i=>r?Ct(()=>i.releaseLock()):Vhe(()=>i.cancel())),i=>kge(Te(Ym({try:()=>i.read(),catch:a=>ae(n(a))}),({done:a,value:o})=>a?Eo(ne()):Ht(o)))))},Ege=T(2,(e,t)=>new Da(N(Wi(e),ZH(t)))),f8=e=>Nge(e,t=>N(yt(t,n=>ae([n,t])),X6(Mt({onNone:()=>Ht(ne()),onSome:Eo})))),kge=e=>f8(N(e,yt(Cn))),d8=T(2,(e,t)=>Wi(e).pipe(Qpe(o8(t)),t8)),Cge=T(2,(e,t)=>d8(e,lge(t))),Tge=T(2,(e,t)=>d8(e,cge(t))),Rge=e=>new Da(XH(n8(N(e,yt(Cn))),ot)),Age=e=>xge(Cn(e)),h8=e=>new Da(GA(()=>Wi(e()))),Oge=T(e=>Cx(e[0]),(e,t)=>yt(Gg(),n=>Mge(e,n,t))),Mge=T(e=>Cx(e[0]),(e,t,n)=>{const r=_x(t);let i,a;const o=sme(!1);return new ReadableStream({start(s){a=r(Tge(e,l=>l.length===0?ot:o.whenOpen(Ct(()=>{o.unsafeClose();for(const c of l)s.enqueue(c);i(),i=void 0})))),a.addObserver(l=>{try{l._tag==="Failure"?s.error(TA(l.cause)):s.close()}catch{}})},pull(){return new Promise(s=>{i=s,Zi(o.open)})},cancel(){if(a)return lme(PA(vl(a)))}},n==null?void 0:n.strategy)}),Nge=(e,t)=>h8(()=>{const n=r=>xl(yt(t(r),Mt({onNone:()=>Rs,onSome:([i,a])=>_n(fr(i),()=>n(a))})));return new Da(n(e))}),m8=e=>vge(Rge(e)),kj=Symbol.for("effect/Mailbox"),Cj=Symbol.for("effect/Mailbox/ReadonlyMailbox"),Ec=Ln(),Tj=xt(Ec),Wy=xt(!1),Jy=xt(!0),Rj=[Ec,!0];var jz,Iz;class Dge extends bh{constructor(n,r,i){super();S(this,"scheduler");S(this,"capacity");S(this,"strategy");S(this,Iz,kj);S(this,jz,Cj);S(this,"state",{_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set});S(this,"messages",[]);S(this,"messagesChunk",Ln());S(this,"shutdown",ie(()=>{if(this.state._tag==="Done")return!0;this.messages=[],this.messagesChunk=Ec;const n=this.state.offers;if(this.finalize(this.state._tag==="Open"?Sr:this.state.exit),n.size>0){for(const r of n)r._tag==="Single"?r.resume(Wy):r.resume(xt(Mr(r.remaining.slice(r.offset))));n.clear()}return!0}));S(this,"end",this.done(Sr));S(this,"clear",qe(()=>{if(this.state._tag==="Done")return Ib(this.state.exit,Ec);const n=this.unsafeTakeAll();return this.releaseCapacity(),fe(n)}));S(this,"takeAll",qe(()=>{if(this.state._tag==="Done")return Ib(this.state.exit,Rj);const n=this.unsafeTakeAll();return n.length===0?nn(this.awaitTake,this.takeAll):fe([n,this.releaseCapacity()])}));S(this,"take",qe(()=>this.unsafeTake()??nn(this.awaitTake,this.take)));S(this,"await",il(n=>this.state._tag==="Done"?n(this.state.exit):(this.state.awaiters.add(n),ie(()=>{this.state._tag!=="Done"&&this.state.awaiters.delete(n)}))));S(this,"size",ie(()=>this.unsafeSize()));S(this,"awaitTake",il(n=>this.state._tag==="Done"?n(this.state.exit):(this.state.takers.add(n),ie(()=>{this.state._tag!=="Done"&&this.state.takers.delete(n)}))));S(this,"scheduleRunning",!1);S(this,"releaseTaker",()=>{if(this.scheduleRunning=!1,this.state._tag!=="Done"&&this.state.takers.size!==0){for(const n of this.state.takers)if(this.state.takers.delete(n),n(Sr),this.messages.length+this.messagesChunk.length===0)break}});this.scheduler=n,this.capacity=r,this.strategy=i}offer(n){return qe(()=>{if(this.state._tag!=="Open")return Wy;if(this.messages.length+this.messagesChunk.length>=this.capacity)switch(this.strategy){case"dropping":return Wy;case"suspend":return this.capacity<=0&&this.state.takers.size>0?(this.messages.push(n),this.releaseTaker(),Jy):this.offerRemainingSingle(n);case"sliding":return this.unsafeTake(),this.messages.push(n),Jy}return this.messages.push(n),this.scheduleReleaseTaker(),Jy})}unsafeOffer(n){return this.state._tag!=="Open"?!1:this.messages.length+this.messagesChunk.length>=this.capacity?this.strategy==="sliding"?(this.unsafeTake(),this.messages.push(n),!0):this.capacity<=0&&this.state.takers.size>0?(this.messages.push(n),this.releaseTaker(),!0):!1:(this.messages.push(n),this.scheduleReleaseTaker(),!0)}offerAll(n){return qe(()=>{if(this.state._tag!=="Open")return fe(gs(n));const r=this.unsafeOfferAllArray(n);return r.length===0?Tj:this.strategy==="dropping"?fe(Mr(r)):this.offerRemainingArray(r)})}unsafeOfferAll(n){return Mr(this.unsafeOfferAllArray(n))}unsafeOfferAllArray(n){if(this.state._tag!=="Open")return gt(n);if(this.capacity===Number.POSITIVE_INFINITY||this.strategy==="sliding")return this.messages.length>0&&(this.messagesChunk=wn(this.messagesChunk,Mr(this.messages))),this.strategy==="sliding"?this.messagesChunk=this.messagesChunk.pipe(wn(gs(n)),Kte(this.capacity)):$S(n)?this.messagesChunk=wn(this.messagesChunk,n):this.messages=gt(n),this.scheduleReleaseTaker(),[];const r=this.capacity<=0?this.state.takers.size:this.capacity-this.messages.length-this.messagesChunk.length;if(r===0)return gt(n);const i=[];let a=0;for(const o of n)a<r?this.messages.push(o):i.push(o),a++;return this.scheduleReleaseTaker(),i}fail(n){return this.done(Lp(n))}failCause(n){return this.done(vt(n))}unsafeDone(n){return this.state._tag!=="Open"?!1:this.state.offers.size===0&&this.messages.length===0&&this.messagesChunk.length===0?(this.finalize(n),!0):(this.state={...this.state,_tag:"Closing",exit:n},!0)}done(n){return ie(()=>this.unsafeDone(n))}takeN(n){return qe(()=>{if(this.state._tag==="Done")return Ib(this.state.exit,Rj);if(n<=0)return fe([Ec,!1]);n=Math.min(n,this.capacity);let r;if(n<=this.messagesChunk.length)r=Hv(this.messagesChunk,n),this.messagesChunk=rl(this.messagesChunk,n);else if(n<=this.messages.length+this.messagesChunk.length)this.messagesChunk=wn(this.messagesChunk,Mr(this.messages)),this.messages=[],r=Hv(this.messagesChunk,n),this.messagesChunk=rl(this.messagesChunk,n);else return nn(this.awaitTake,this.takeN(n));return fe([r,this.releaseCapacity()])})}unsafeTake(){if(this.state._tag==="Done")return HU(this.state.exit,Lp(new vh));let n;if(this.messagesChunk.length>0)n=xR(this.messagesChunk),this.messagesChunk=rl(this.messagesChunk,1);else if(this.messages.length>0)n=this.messages[0],this.messagesChunk=rl(Mr(this.messages),1),this.messages=[];else return this.capacity<=0&&this.state.offers.size>0?(this.capacity=1,this.releaseCapacity(),this.capacity=0,this.messages.length>0?xt(this.messages.pop()):void 0):void 0;return this.releaseCapacity(),xt(n)}unsafeSize(){const n=this.messages.length+this.messagesChunk.length;return this.state._tag==="Done"?ne():ae(n)}commit(){return this.takeAll}pipe(){return he(this,arguments)}toJSON(){return{_id:"effect/Mailbox",state:this.state._tag,size:this.unsafeSize().toJSON()}}toString(){return Rt(this)}[(Iz=kj,jz=Cj,lt)](){return Rt(this)}offerRemainingSingle(n){return il(r=>{if(this.state._tag!=="Open")return r(Wy);const i={_tag:"Single",message:n,resume:r};return this.state.offers.add(i),ie(()=>{this.state._tag==="Open"&&this.state.offers.delete(i)})})}offerRemainingArray(n){return il(r=>{if(this.state._tag!=="Open")return r(xt(Mr(n)));const i={_tag:"Array",remaining:n,offset:0,resume:r};return this.state.offers.add(i),ie(()=>{this.state._tag==="Open"&&this.state.offers.delete(i)})})}releaseCapacity(){if(this.state._tag==="Done")return this.state.exit._tag==="Success";if(this.state.offers.size===0)return this.state._tag==="Closing"&&this.messages.length===0&&this.messagesChunk.length===0?(this.finalize(this.state.exit),this.state.exit._tag==="Success"):!1;let n=this.capacity-this.messages.length-this.messagesChunk.length;for(const r of this.state.offers){if(n===0)return!1;if(r._tag==="Single")this.messages.push(r.message),n--,r.resume(Jy),this.state.offers.delete(r);else{for(;r.offset<r.remaining.length;r.offset++){if(n===0)return!1;this.messages.push(r.remaining[r.offset]),n--}r.resume(Tj),this.state.offers.delete(r)}}return!1}scheduleReleaseTaker(){this.scheduleRunning||(this.scheduleRunning=!0,this.scheduler.scheduleTask(this.releaseTaker,0))}unsafeTakeAll(){if(this.messagesChunk.length>0){const n=this.messages.length>0?wn(this.messagesChunk,Mr(this.messages)):this.messagesChunk;return this.messagesChunk=Ec,this.messages=[],n}else if(this.messages.length>0){const n=Mr(this.messages);return this.messages=[],n}else if(this.state._tag!=="Done"&&this.state.offers.size>0)return this.capacity=1,this.releaseCapacity(),this.capacity=0,Cn(this.messages.pop());return Ec}finalize(n){if(this.state._tag==="Done")return;const r=this.state;this.state={_tag:"Done",exit:n};for(const i of r.takers)i(n);r.takers.clear();for(const i of r.awaiters)i(n);r.awaiters.clear()}}const jge=e=>ft(t=>fe(new Dge(t.currentScheduler,typeof e=="number"?e:(e==null?void 0:e.capacity)??Number.POSITIVE_INFINITY,typeof e=="number"?"suspend":(e==null?void 0:e.strategy)??"suspend"))),Ige=e=>{const t=_n(e.takeAll,([n,r])=>r?n.length===0?Rs:fr(n):QA(fr(n),t));return t},$ge=e=>Sge(Ige(e)),Lge=jge,zge=$ge,z1=eO,p8=s8,Pge=gge,Fge=yge,Uge=bge,Bge=l8,g8=Wi,Hge=wge,qge=_ge,Vge=Cge,Kge=Age,Gge=h8,Yge=Oge,y8=m8;class Xg extends hR("@effect/experimental/Reactivity")(){}const Wge=Ct(()=>{const e=new Map,t=s=>{if(Array.isArray(s))for(let l=0;l<s.length;l++){const c=e.get(zk(s[l]));if(c!==void 0)for(const f of c)f()}else{const l=s;for(const c in l){const f=v8(c,l[c]);for(let d=0;d<f.length;d++){const h=e.get(f[d]);if(h!==void 0)for(const m of h)m()}const u=e.get(c);if(u!==void 0)for(const d of u)d()}}},n=s=>Ct(()=>t(s)),r=(s,l)=>BA(l,n(s)),i=(s,l)=>{const c=Array.isArray(s)?s.map(zk):Xge(s);for(let f=0;f<c.length;f++){let u=e.get(c[f]);u===void 0&&(u=new Set,e.set(c[f],u)),u.add(l)}return()=>{for(let f=0;f<c.length;f++){const u=e.get(c[f]);u.delete(l),u.size===0&&e.delete(c[f])}}},a=(s,l)=>Xf(function*(){const c=yield*xx,f=yield*Lge(),u=yield*bme();let d=!1,h=!1;const m=g=>{g._tag==="Failure"?f.unsafeDone(xr(g.cause)):f.unsafeOffer(g.value),h?(h=!1,u(l).addObserver(m)):d=!1};function b(){if(d){h=!0;return}d=!0,u(l).addObserver(m)}const w=i(s,b);return yield*y0(c,Ct(w)),b(),f}),o=(s,l)=>a(s,l).pipe(yt(zge),y8);return Xg.of({mutation:r,query:a,stream:o,unsafeInvalidate:t,invalidate:n,unsafeRegister:i})}),b8=T(2,(e,t)=>Te(Xg,n=>n.mutation(t,e))),Jge=e=>Te(Xg,t=>t.invalidate(e)),P1=oH(Xg,Wge);function zk(e){return typeof e=="string"?e:de(e)}const v8=(e,t)=>{const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=`${e}:${zk(t[r])}`;return n},Xge=e=>{const t=[];for(const n in e){t.push(n);for(const r of v8(n,e[n]))t.push(r)}return t},S8="effect/Redacted",Hb=je("effect/Redacted/redactedRegistry",()=>new WeakMap),x8=Symbol.for(S8),Qge={[x8]:{_A:e=>e},pipe(){return he(this,arguments)},toString(){return"<redacted>"},toJSON(){return"<redacted>"},[lt](){return"<redacted>"},[Le](){return N(de(S8),Pe(de(Hb.get(this))),_t(this))},[ze](e){return Zge(e)&&Se(Hb.get(this),Hb.get(e))}},Zge=e=>Re(e,x8),eye=e=>{const t=Object.create(Qge);return Hb.set(t,e),t},w8=(e,t)=>{switch(t._tag){case"StringKeyword":case"TemplateLiteral":return Object.keys(e);case"SymbolKeyword":return Object.getOwnPropertySymbols(e);case"Refinement":return w8(e,t.from)}},_8=e=>{let t=!1,n;return()=>(t||(n=e(),t=!0),n)},tO=e=>Array.isArray(e),tye=e=>!Array.isArray(e),Aj=e=>`[${AS(e)}]`,E8=e=>tO(e)?e.map(Aj).join(""):Aj(e),Jl=(e,t,n,r)=>{let i=e;return n&&on(n)&&(i+=`
84
+ at path: ${E8(n)}`),t!==void 0&&(i+=`
85
+ details: ${t}`),r&&(i+=`
86
+ schema (${r._tag}): ${r}`),i},k8=(e,t,n)=>Jl("Unsupported schema or overlapping types",`cannot extend ${e} with ${t}`,n),nye=e=>Jl("Unsupported key schema",void 0,void 0,e),rye=e=>Jl("Unsupported literal",`literal value: ${ks(e)}`),Oj=e=>Jl("Duplicate index signature",`${e} index signature`),iye=Jl("Unsupported index signature parameter","An index signature parameter type must be `string`, `symbol`, a template literal type or a refinement of the previous types"),aye=Jl("Invalid element","A required element cannot follow an optional element. ts(1257)"),Mj=e=>Jl("Duplicate property signature transformation",`Duplicate key ${ks(e)}`),C8=e=>Jl("Duplicate property signature",`Duplicate key ${ks(e)}`),oye=Symbol.for("effect/SchemaId/DateFromSelf"),sye=Symbol.for("effect/SchemaId/GreaterThanOrEqualTo"),lye=Symbol.for("effect/SchemaId/Between"),cye=Symbol.for("effect/annotation/TypeConstructor"),T8=Symbol.for("effect/annotation/Brand"),uye=Symbol.for("effect/annotation/SchemaId"),R8=Symbol.for("effect/annotation/Message"),nO=Symbol.for("effect/annotation/MissingMessage"),Qg=Symbol.for("effect/annotation/Identifier"),Pa=Symbol.for("effect/annotation/Title"),ed=Symbol.for("effect/annotation/AutoTitle"),Ru=Symbol.for("effect/annotation/Description"),A8=Symbol.for("effect/annotation/Examples"),O8=Symbol.for("effect/annotation/Default"),M8=Symbol.for("effect/annotation/JSONSchema"),N8=Symbol.for("effect/annotation/Arbitrary"),D8=Symbol.for("effect/annotation/Pretty"),j8=Symbol.for("effect/annotation/Equivalence"),fye=Symbol.for("effect/annotation/Documentation"),I8=Symbol.for("effect/annotation/Concurrency"),$8=Symbol.for("effect/annotation/Batching"),L8=Symbol.for("effect/annotation/ParseIssueTitle"),z8=Symbol.for("effect/annotation/ParseOptions"),P8=Symbol.for("effect/annotation/DecodingFallback"),R0=Symbol.for("effect/annotation/Surrogate"),dye=Symbol.for("effect/annotation/StableFilter"),Hr=T(2,(e,t)=>Object.prototype.hasOwnProperty.call(e.annotations,t)?ae(e.annotations[t]):ne()),F8=Hr(T8),hye=Hr(R8),mye=Hr(nO),U8=Hr(Pa),B8=Hr(ed),Tx=Hr(Qg),H8=Hr(Ru),pye=Hr(I8),gye=Hr($8),yye=Hr(L8),bye=Hr(z8),vye=Hr(P8),q8=Hr(R0),Sye=Hr(dye),xye=e=>hte(Sye(e),t=>t===!0),V8=Symbol.for("effect/annotation/JSONIdentifier"),wye=Hr(V8),_ye=e=>ka(wye(e),()=>Tx(e)),Eye=Symbol.for("effect/schema/ParseJson");class Rx{constructor(t,n,r,i={}){S(this,"typeParameters");S(this,"decodeUnknown");S(this,"encodeUnknown");S(this,"annotations");S(this,"_tag","Declaration");this.typeParameters=t,this.decodeUnknown=n,this.encodeUnknown=r,this.annotations=i}toString(){return zt(po(this),()=>"<declaration schema>")}toJSON(){return{_tag:this._tag,typeParameters:this.typeParameters.map(t=>t.toJSON()),annotations:dn(this.annotations)}}}const Fa=e=>t=>t._tag===e;let A0=class{constructor(t,n={}){S(this,"literal");S(this,"annotations");S(this,"_tag","Literal");this.literal=t,this.annotations=n}toString(){return zt(po(this),()=>ks(this.literal))}toJSON(){return{_tag:this._tag,literal:CS(this.literal)?String(this.literal):this.literal,annotations:dn(this.annotations)}}};const Wm=Fa("Literal"),kye=new A0(null);class Cye{constructor(t,n={}){S(this,"symbol");S(this,"annotations");S(this,"_tag","UniqueSymbol");this.symbol=t,this.annotations=n}toString(){return zt(po(this),()=>ks(this.symbol))}toJSON(){return{_tag:this._tag,symbol:String(this.symbol),annotations:dn(this.annotations)}}}class Tye{constructor(t={}){S(this,"annotations");S(this,"_tag","UndefinedKeyword");this.annotations=t}toString(){return As(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const Pk=new Tye({[Pa]:"undefined"});class Rye{constructor(t={}){S(this,"annotations");S(this,"_tag","VoidKeyword");this.annotations=t}toString(){return As(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const Aye=new Rye({[Pa]:"void"}),Oye=Fa("VoidKeyword");class Mye{constructor(t={}){S(this,"annotations");S(this,"_tag","NeverKeyword");this.annotations=t}toString(){return As(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const rO=new Mye({[Pa]:"never"}),Nye=Fa("NeverKeyword");class Dye{constructor(t={}){S(this,"annotations");S(this,"_tag","UnknownKeyword");this.annotations=t}toString(){return As(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const K8=new Dye({[Pa]:"unknown"});class jye{constructor(t={}){S(this,"annotations");S(this,"_tag","AnyKeyword");this.annotations=t}toString(){return As(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const Iye=new jye({[Pa]:"any"});class $ye{constructor(t={}){S(this,"annotations");S(this,"_tag","StringKeyword");this.annotations=t}toString(){return As(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const Fk=new $ye({[Pa]:"string",[Ru]:"a string"}),Uk=Fa("StringKeyword");class Lye{constructor(t={}){S(this,"annotations");S(this,"_tag","NumberKeyword");this.annotations=t}toString(){return As(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const Bk=new Lye({[Pa]:"number",[Ru]:"a number"}),Nj=Fa("NumberKeyword");class zye{constructor(t={}){S(this,"annotations");S(this,"_tag","BooleanKeyword");this.annotations=t}toString(){return As(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const Hk=new zye({[Pa]:"boolean",[Ru]:"a boolean"}),Dj=Fa("BooleanKeyword");class Pye{constructor(t={}){S(this,"annotations");S(this,"_tag","SymbolKeyword");this.annotations=t}toString(){return As(this)}toJSON(){return{_tag:this._tag,annotations:dn(this.annotations)}}}const Fye=new Pye({[Pa]:"symbol",[Ru]:"a symbol"}),Uye=Fa("SymbolKeyword");let Ax=class{constructor(t,n={}){S(this,"type");S(this,"annotations");this.type=t,this.annotations=n}toJSON(){return{type:this.type.toJSON(),annotations:dn(this.annotations)}}toString(){return String(this.type)}};class Au extends Ax{constructor(n,r,i={}){super(n,i);S(this,"isOptional");this.isOptional=r}toJSON(){return{type:this.type.toJSON(),isOptional:this.isOptional,annotations:dn(this.annotations)}}toString(){return String(this.type)+(this.isOptional?"?":"")}}const G8=e=>e.map(t=>t.type);class iO{constructor(t,n,r,i={}){S(this,"elements");S(this,"rest");S(this,"isReadonly");S(this,"annotations");S(this,"_tag","TupleType");this.elements=t,this.rest=n,this.isReadonly=r,this.annotations=i;let a=!1,o=!1;for(const s of t)if(s.isOptional)a=!0;else if(a){o=!0;break}if(o||a&&n.length>1)throw new Error(aye)}toString(){return zt(po(this),()=>Bye(this))}toJSON(){return{_tag:this._tag,elements:this.elements.map(t=>t.toJSON()),rest:this.rest.map(t=>t.toJSON()),isReadonly:this.isReadonly,annotations:dn(this.annotations)}}}const Bye=e=>{const t=e.elements.map(String).join(", ");return Ste(e.rest,{onEmpty:()=>`readonly [${t}]`,onNonEmpty:(n,r)=>{const i=String(n),a=i.includes(" | ")?`(${i})`:i;if(r.length>0){const o=r.map(String).join(", ");return e.elements.length>0?`readonly [${t}, ...${a}[], ${o}]`:`readonly [...${a}[], ${o}]`}else return e.elements.length>0?`readonly [${t}, ...${a}[]]`:`ReadonlyArray<${i}>`}})};class rr extends Au{constructor(n,r,i,a,o){super(r,i,o);S(this,"name");S(this,"isReadonly");this.name=n,this.isReadonly=a}toString(){return(this.isReadonly?"readonly ":"")+String(this.name)+(this.isOptional?"?":"")+": "+this.type}toJSON(){return{name:String(this.name),type:this.type.toJSON(),isOptional:this.isOptional,isReadonly:this.isReadonly,annotations:dn(this.annotations)}}}const Y8=e=>{switch(e._tag){case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":return!0;case"Refinement":return Y8(e.from)}return!1};class Ox{constructor(t,n,r){S(this,"type");S(this,"isReadonly");S(this,"parameter");if(this.type=n,this.isReadonly=r,Y8(t))this.parameter=t;else throw new Error(iye)}toString(){return(this.isReadonly?"readonly ":"")+`[x: ${this.parameter}]: ${this.type}`}toJSON(){return{parameter:this.parameter.toJSON(),type:this.type.toJSON(),isReadonly:this.isReadonly}}}class wl{constructor(t,n,r={}){S(this,"annotations");S(this,"_tag","TypeLiteral");S(this,"propertySignatures");S(this,"indexSignatures");this.annotations=r;const i={};for(let o=0;o<t.length;o++){const s=t[o].name;if(Object.prototype.hasOwnProperty.call(i,s))throw new Error(C8(s));i[s]=null}const a={string:!1,symbol:!1};for(let o=0;o<n.length;o++){const s=t9(n[o].parameter);if(Uk(s)){if(a.string)throw new Error(Oj("string"));a.string=!0}else if(Uye(s)){if(a.symbol)throw new Error(Oj("symbol"));a.symbol=!0}}this.propertySignatures=t,this.indexSignatures=n}toString(){return zt(po(this),()=>Hye(this))}toJSON(){return{_tag:this._tag,propertySignatures:this.propertySignatures.map(t=>t.toJSON()),indexSignatures:this.indexSignatures.map(t=>t.toJSON()),annotations:dn(this.annotations)}}}const jj=e=>e.map(String).join("; "),Hye=e=>{if(e.propertySignatures.length>0){const t=e.propertySignatures.map(String).join("; ");return e.indexSignatures.length>0?`{ ${t}; ${jj(e.indexSignatures)} }`:`{ ${t} }`}else return e.indexSignatures.length>0?`{ ${jj(e.indexSignatures)} }`:"{}"},Ij=Fa("TypeLiteral"),qye=Rp(o5(jd,e=>{switch(e._tag){case"AnyKeyword":return 0;case"UnknownKeyword":return 1;case"ObjectKeyword":return 2;case"StringKeyword":case"NumberKeyword":case"BooleanKeyword":case"BigIntKeyword":case"SymbolKeyword":return 3}return 4})),Vye={string:"StringKeyword",number:"NumberKeyword",boolean:"BooleanKeyword",bigint:"BigIntKeyword"},W8=e=>Bv(e,t=>Mx(t)?W8(t.types):[t]),Kye=e=>{const t=qye(e),n=[],r={},i=[];for(const a of t)switch(a._tag){case"NeverKeyword":break;case"AnyKeyword":return[Iye];case"UnknownKeyword":return[K8];case"ObjectKeyword":case"UndefinedKeyword":case"VoidKeyword":case"StringKeyword":case"NumberKeyword":case"BooleanKeyword":case"BigIntKeyword":case"SymbolKeyword":{r[a._tag]||(r[a._tag]=a,n.push(a));break}case"Literal":{const o=typeof a.literal;switch(o){case"string":case"number":case"bigint":case"boolean":{const s=Vye[o];!r[s]&&!i.includes(a.literal)&&(i.push(a.literal),n.push(a));break}case"object":{i.includes(a.literal)||(i.push(a.literal),n.push(a));break}}break}case"UniqueSymbol":{!r.SymbolKeyword&&!i.includes(a.symbol)&&(i.push(a.symbol),n.push(a));break}case"TupleType":{r.ObjectKeyword||n.push(a);break}case"TypeLiteral":{a.propertySignatures.length===0&&a.indexSignatures.length===0?r["{}"]||(r["{}"]=a,n.push(a)):r.ObjectKeyword||n.push(a);break}default:n.push(a)}return n};var Yo;let pi=(Yo=class{constructor(t,n={}){S(this,"types");S(this,"annotations");S(this,"_tag","Union");this.types=t,this.annotations=n}toString(){return zt(po(this),()=>this.types.map(String).join(" | "))}toJSON(){return{_tag:this._tag,types:this.types.map(t=>t.toJSON()),annotations:dn(this.annotations)}}},S(Yo,"make",(t,n)=>aO(t)?new Yo(t,n):t.length===1?t[0]:rO),S(Yo,"unify",(t,n)=>Yo.make(Kye(W8(t)),n)),Yo);const Gye=(e,t)=>e.map(t),aO=e=>e.length>1,Mx=Fa("Union"),F1=je(Symbol.for("effect/Schema/AST/toJSONMemoMap"),()=>new WeakMap);class Gp{constructor(t,n={}){S(this,"f");S(this,"annotations");S(this,"_tag","Suspend");this.f=t,this.annotations=n,this.f=_8(t)}toString(){return po(this).pipe(ka(()=>Cs(ote(this.f)(),t=>po(t))),zt(()=>"<suspended schema>"))}toJSON(){const t=this.f();let n=F1.get(t);return n||(F1.set(t,{_tag:this._tag}),n={_tag:this._tag,ast:t.toJSON(),annotations:dn(this.annotations)},F1.set(t,n),n)}}let oO=class{constructor(t,n,r={}){S(this,"from");S(this,"filter");S(this,"annotations");S(this,"_tag","Refinement");this.from=t,this.filter=n,this.annotations=r}toString(){return Tx(this).pipe(zt(()=>Mt(n9(this),{onNone:()=>`{ ${this.from} | filter }`,onSome:t=>td(this.from)?String(this.from)+" & "+t:t})))}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),annotations:dn(this.annotations)}}};const td=Fa("Refinement"),U1={};let Ac=class{constructor(t,n,r,i={}){S(this,"from");S(this,"to");S(this,"transformation");S(this,"annotations");S(this,"_tag","Transformation");this.from=t,this.to=n,this.transformation=r,this.annotations=i}toString(){return zt(po(this),()=>`(${String(this.from)} <-> ${String(this.to)})`)}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),to:this.to.toJSON(),annotations:dn(this.annotations)}}};const Yye=Fa("Transformation");class J8{constructor(t,n){S(this,"decode");S(this,"encode");S(this,"_tag","FinalTransformation");this.decode=t,this.encode=n}}const Wye=e=>t=>t._tag===e;class Jye{constructor(){S(this,"_tag","ComposeTransformation")}}const X8=new Jye;let Xye=class{constructor(t,n,r,i){S(this,"from");S(this,"to");S(this,"decode");S(this,"encode");this.from=t,this.to=n,this.decode=r,this.encode=i}};class qk{constructor(t){S(this,"propertySignatureTransformations");S(this,"_tag","TypeLiteralTransformation");this.propertySignatureTransformations=t;const n={},r={};for(const i of t){const a=i.from;if(n[a])throw new Error(Mj(a));n[a]=!0;const o=i.to;if(r[o])throw new Error(Mj(o));r[o]=!0}}}const $j=Wye("TypeLiteralTransformation"),_h=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={...e.annotations};delete r[Qg];const i={...r,...t},a=q8(e);return Dt(a)&&(i[R0]=_h(a.value,t)),n.annotations.value=i,Object.create(Object.getPrototypeOf(e),n)},Qye="[\\s\\S]*?",Zye="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",Q8=(e,t)=>{switch(e._tag){case"Literal":return Qv(String(e.literal));case"StringKeyword":return Qye;case"NumberKeyword":return Zye;case"TemplateLiteral":return Z8(e);case"Union":return e.types.map(n=>Q8(n)).join("|")}},ebe=(e,t,n,r)=>Mx(e)?`(${t})`:t,Z8=(e,t,n)=>{let r="";if(e.head!==""){const i=Qv(e.head);r+=i}for(const i of e.spans){const a=Q8(i.type);if(r+=ebe(i.type,a),i.literal!==""){const o=Qv(i.literal);r+=o}}return r},tbe=e=>new RegExp(`^${Z8(e)}$`),Lj=(e,t)=>{const n=[],r=[],i=a=>{switch(a._tag){case"NeverKeyword":break;case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":case"Refinement":r.push(new Ox(a,t,!0));break;case"Literal":if(Oi(a.literal)||ps(a.literal))n.push(new rr(a.literal,t,!1,!0));else throw new Error(rye(a.literal));break;case"Enums":{for(const[o,s]of a.enums)n.push(new rr(s,t,!1,!0));break}case"UniqueSymbol":n.push(new rr(a.symbol,t,!1,!0));break;case"Union":a.types.forEach(i);break;default:throw new Error(nye(a))}};return i(e),{propertySignatures:n,indexSignatures:r}},e9=e=>t=>{let n;for(const r of e)Object.prototype.hasOwnProperty.call(t.annotations,r)&&(n===void 0&&(n={}),n[r]=t.annotations[r]);return n},nbe=e=>t=>{const n={...t.annotations};for(const r of e)delete n[r];return n},rbe=e9([A8,O8,M8,N8,D8,j8]),bn=e=>{switch(e._tag){case"Declaration":{const t=Hi(e.typeParameters,bn);return t===e.typeParameters?e:new Rx(t,e.decodeUnknown,e.encodeUnknown,e.annotations)}case"TupleType":{const t=Hi(e.elements,i=>{const a=bn(i.type);return a===i.type?i:new Au(a,i.isOptional)}),n=G8(e.rest),r=Hi(n,bn);return t===e.elements&&r===n?e:new iO(t,r.map(i=>new Ax(i)),e.isReadonly,e.annotations)}case"TypeLiteral":{const t=Hi(e.propertySignatures,r=>{const i=bn(r.type);return i===r.type?r:new rr(r.name,i,r.isOptional,r.isReadonly)}),n=Hi(e.indexSignatures,r=>{const i=bn(r.type);return i===r.type?r:new Ox(r.parameter,i,r.isReadonly)});return t===e.propertySignatures&&n===e.indexSignatures?e:new wl(t,n,e.annotations)}case"Union":{const t=Hi(e.types,bn);return t===e.types?e:pi.make(t,e.annotations)}case"Suspend":return new Gp(()=>bn(e.f()),e.annotations);case"Refinement":{const t=bn(e.from);return t===e.from?e:new oO(t,e.filter,e.annotations)}case"Transformation":{const t=rbe(e);return bn(t!==void 0?_h(e.to,t):e.to)}}return e};function Hi(e,t){let n=!1;const r=jS(e.length);for(let i=0;i<e.length;i++){const a=e[i],o=t(a);o!==a&&(n=!0),r[i]=o}return n?r:e}const Va=(e,t)=>{switch(e._tag){case"Declaration":{const n=Hi(e.typeParameters,r=>Va(r));return n===e.typeParameters?e:new Rx(n,e.decodeUnknown,e.encodeUnknown)}case"TupleType":{const n=Hi(e.elements,a=>{const o=Va(a.type);return o===a.type?a:new Au(o,a.isOptional)}),r=G8(e.rest),i=Hi(r,a=>Va(a));return n===e.elements&&i===r?e:new iO(n,i.map(a=>new Ax(a)),e.isReadonly)}case"TypeLiteral":{const n=Hi(e.propertySignatures,i=>{const a=Va(i.type);return a===i.type?i:new rr(i.name,a,i.isOptional,i.isReadonly)}),r=Hi(e.indexSignatures,i=>{const a=Va(i.type);return a===i.type?i:new Ox(i.parameter,a,i.isReadonly)});return n===e.propertySignatures&&r===e.indexSignatures?e:new wl(n,r)}case"Union":{const n=Hi(e.types,r=>Va(r));return n===e.types?e:pi.make(n)}case"Suspend":{let n;const r=_ye(e);if(Dt(r)){const i="";n={[V8]:`${r.value}Encoded${i}`}}return new Gp(()=>Va(e.f()),n)}case"Refinement":return Va(e.from);case"Transformation":return Va(e.from)}return e},O0=e=>Va(e),dn=e=>{const t={};for(const n of Object.getOwnPropertySymbols(e))t[String(n)]=e[n];return t},t9=e=>{switch(e._tag){case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":return e;case"Refinement":return t9(e.from)}},ibe=(e,t)=>new Ac(e,t,X8),As=e=>zt(po(e),()=>e._tag);function abe(e){return Mt(F8(e),{onNone:()=>"",onSome:t=>t.map(n=>` & Brand<${ks(n)}>`).join("")})}const n9=e=>U8(e).pipe(ka(()=>H8(e)),ka(()=>B8(e)),ni(t=>t+abe(e))),po=e=>ka(Tx(e),()=>n9(e));class er{constructor(t,n,r){S(this,"path");S(this,"actual");S(this,"issue");S(this,"_tag","Pointer");this.path=t,this.actual=n,this.issue=r}}class zj{constructor(t,n){S(this,"actual");S(this,"message");S(this,"_tag","Unexpected");this.actual=t,this.message=n}}class Qh{constructor(t,n){S(this,"ast");S(this,"message");S(this,"_tag","Missing");S(this,"actual");this.ast=t,this.message=n}}class Zt{constructor(t,n,r,i){S(this,"ast");S(this,"actual");S(this,"issues");S(this,"output");S(this,"_tag","Composite");this.ast=t,this.actual=n,this.issues=r,this.output=i}}class B1{constructor(t,n,r,i){S(this,"ast");S(this,"actual");S(this,"kind");S(this,"issue");S(this,"_tag","Refinement");this.ast=t,this.actual=n,this.kind=r,this.issue=i}}class H1{constructor(t,n,r,i){S(this,"ast");S(this,"actual");S(this,"kind");S(this,"issue");S(this,"_tag","Transformation");this.ast=t,this.actual=n,this.kind=r,this.issue=i}}class rn{constructor(t,n,r){S(this,"ast");S(this,"actual");S(this,"message");S(this,"_tag","Type");this.ast=t,this.actual=n,this.message=r}}class Vk{constructor(t,n,r){S(this,"ast");S(this,"actual");S(this,"message");S(this,"_tag","Forbidden");this.ast=t,this.actual=n,this.message=r}}const Pj=Symbol.for("effect/Schema/ParseErrorTypeId");var $z;class obe extends ihe("ParseError"){constructor(){super(...arguments);S(this,$z,Pj)}get message(){return this.toString()}toString(){return Xm.formatIssueSync(this.issue)}toJSON(){return{_id:"ParseError",message:this.toString()}}[($z=Pj,lt)](){return this.toJSON()}}const sO=e=>new obe({issue:e}),wr=Ne,rs=De,M0=Yee,sbe=Gee,br=t5,_a=T(2,(e,t)=>br(e)?ti(e,{onLeft:De,onRight:t}):Te(e,t)),ir=T(2,(e,t)=>br(e)?Xee(e,t):yt(e,t)),Jm=T(2,(e,t)=>br(e)?Jee(e,t):FA(e,t)),lbe=T(2,(e,t)=>br(e)?Wee(e,{onLeft:t.onFailure,onRight:t.onSuccess}):Jhe(e,t)),r9=T(2,(e,t)=>br(e)?ti(e,{onLeft:t,onRight:Ne}):X6(e,t)),Nx=(e,t)=>t===void 0||ps(t)?e:e===void 0?t:{...e,...t},i9=(e,t,n)=>{const r=Hn(e,t);return(i,a)=>r(i,Nx(n,a))},a9=(e,t,n)=>{const r=i9(e,t,n);return(i,a)=>n5(r(i,a),sO)},cbe=(e,t,n)=>{const r=i9(e,t,n);return(i,a)=>rte(r(i,a))},o9=(e,t,n)=>{const r=Hn(e,t);return(i,a)=>r(i,{...Nx(n,a),isEffectAllowed:!0})},s9=(e,t)=>a9(e.ast,!0,t),ube=(e,t)=>cbe(e.ast,!0,t),lO=(e,t)=>o9(e.ast,!0,t),Dx=(e,t)=>o9(e.ast,!1,t),l9=s9,fbe=ube,jx=(e,t)=>a9(bn(e.ast),!0,t),dbe=(e,t)=>{const n=Hn(bn(e.ast),!0);return(r,i)=>eo(n(r,{exact:!0,...Nx(t,i)}))},hbe=je(Symbol.for("effect/ParseResult/decodeMemoMap"),()=>new WeakMap),mbe=je(Symbol.for("effect/ParseResult/encodeMemoMap"),()=>new WeakMap),Hn=(e,t)=>{const n=t?hbe:mbe,r=n.get(e);if(r)return r;const i=pbe(e,t),a=bye(e),o=Dt(a)?(c,f)=>i(c,Nx(f,a.value)):i,s=vye(e),l=t&&Dt(s)?(c,f)=>xm(r9(o(c,f),s.value),e,c,f):o;return n.set(e,l),l},q1=e=>Bi(pye(e)),V1=e=>Bi(gye(e)),pbe=(e,t)=>{switch(e._tag){case"Refinement":if(t){const n=Hn(e.from,!0);return(r,i)=>{i=i??U1;const a=(i==null?void 0:i.errors)==="all",o=_a(r9(n(r,i),s=>{const l=new B1(e,r,"From",s);return a&&xye(e)&&d9(s)?Mt(e.filter(r,i,e),{onNone:()=>De(l),onSome:c=>De(new Zt(e,r,[l,new B1(e,r,"Predicate",c)]))}):De(l)}),s=>Mt(e.filter(s,i,e),{onNone:()=>Ne(s),onSome:l=>De(new B1(e,r,"Predicate",l))}));return xm(o,e,r,i)}}else{const n=Hn(bn(e),!0),r=Hn(c9(e.from),!1);return(i,a)=>xm(_a(n(i,a),o=>r(o,a)),e,i,a)}case"Transformation":{const n=bbe(e.transformation,t),r=t?Hn(e.from,!0):Hn(e.to,!1),i=t?Hn(e.to,!0):Hn(e.from,!1);return(a,o)=>xm(_a(Jm(r(a,o),s=>new H1(e,a,t?"Encoded":"Type",s)),s=>_a(Jm(n(s,o??U1,e,a),l=>new H1(e,a,"Transformation",l)),l=>Jm(i(l,o),c=>new H1(e,a,t?"Type":"Encoded",c)))),e,a,o)}case"Declaration":{const n=t?e.decodeUnknown(...e.typeParameters):e.encodeUnknown(...e.typeParameters);return(r,i)=>xm(n(r,i??U1,e),e,r,i)}case"Literal":return ui(e,n=>n===e.literal);case"UniqueSymbol":return ui(e,n=>n===e.symbol);case"UndefinedKeyword":return ui(e,jZ);case"NeverKeyword":return ui(e,$Z);case"UnknownKeyword":case"AnyKeyword":case"VoidKeyword":return Ne;case"StringKeyword":return ui(e,Oi);case"NumberKeyword":return ui(e,ps);case"BooleanKeyword":return ui(e,vd);case"BigIntKeyword":return ui(e,CS);case"SymbolKeyword":return ui(e,DE);case"ObjectKeyword":return ui(e,Oa);case"Enums":return ui(e,n=>e.enums.some(([r,i])=>i===n));case"TemplateLiteral":{const n=tbe(e);return ui(e,r=>Oi(r)&&n.test(r))}case"TupleType":{const n=e.elements.map(c=>Hn(c.type,t)),r=e.rest.map(c=>Hn(c.type,t));let i=e.elements.filter(c=>!c.isOptional);e.rest.length>0&&(i=i.concat(e.rest.slice(1)));const a=i.length,o=e.elements.length>0?e.elements.map((c,f)=>f).join(" | "):"never",s=q1(e),l=V1(e);return(c,f)=>{if(!wte(c))return De(new rn(e,c));const u=(f==null?void 0:f.errors)==="all",d=[];let h=0;const m=[],b=c.length;for(let x=b;x<=a-1;x++){const E=new er(x,c,new Qh(i[x-b]));if(u){d.push([h++,E]);continue}else return De(new Zt(e,c,E,m))}if(e.rest.length===0)for(let x=e.elements.length;x<=b-1;x++){const E=new er(x,c,new zj(c[x],`is unexpected, expected: ${o}`));if(u){d.push([h++,E]);continue}else return De(new Zt(e,c,E,m))}let w=0,g;for(;w<n.length;w++)if(b<w+1){if(e.elements[w].isOptional)continue}else{const x=n[w],E=x(c[w],f);if(br(E)){if(qn(E)){const C=new er(w,c,E.left);if(u){d.push([h++,C]);continue}else return De(new Zt(e,c,C,da(m)))}m.push([h++,E.right])}else{const C=h++,k=w;g||(g=[]),g.push(({es:_,output:A})=>Te(Yu(E),I=>{if(qn(I)){const O=new er(k,c,I.left);return u?(_.push([C,O]),ot):De(new Zt(e,c,O,da(A)))}return A.push([C,I.right]),ot}))}}if(on(r)){const[x,...E]=r;for(;w<b-E.length;w++){const C=x(c[w],f);if(br(C))if(qn(C)){const k=new er(w,c,C.left);if(u){d.push([h++,k]);continue}else return De(new Zt(e,c,k,da(m)))}else m.push([h++,C.right]);else{const k=h++,_=w;g||(g=[]),g.push(({es:A,output:I})=>Te(Yu(C),O=>{if(qn(O)){const z=new er(_,c,O.left);return u?(A.push([k,z]),ot):De(new Zt(e,c,z,da(I)))}else return I.push([k,O.right]),ot}))}}for(let C=0;C<E.length;C++)if(w+=C,!(b<w+1)){const k=E[C](c[w],f);if(br(k)){if(qn(k)){const _=new er(w,c,k.left);if(u){d.push([h++,_]);continue}else return De(new Zt(e,c,_,da(m)))}m.push([h++,k.right])}else{const _=h++,A=w;g||(g=[]),g.push(({es:I,output:O})=>Te(Yu(k),z=>{if(qn(z)){const U=new er(A,c,z.left);return u?(I.push([_,U]),ot):De(new Zt(e,c,U,da(O)))}return O.push([_,z.right]),ot}))}}}const v=({es:x,output:E})=>Vf(x)?De(new Zt(e,c,da(x),da(E))):Ne(da(E));if(g&&g.length>0){const x=g;return ln(()=>{const E={es:mm(d),output:mm(m)};return Te(uo(x,C=>C(E),{concurrency:s,batching:l,discard:!0}),()=>v(E))})}return v({output:m,es:d})}}case"TypeLiteral":{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return ui(e,LZ);const n=[],r={},i=[];for(const f of e.propertySignatures)n.push([Hn(f.type,t),f]),r[f.name]=null,i.push(f.name);const a=e.indexSignatures.map(f=>[Hn(f.parameter,t),Hn(f.type,t),f.parameter]),o=pi.make(e.indexSignatures.map(f=>f.parameter).concat(i.map(f=>DE(f)?new Cye(f):new A0(f)))),s=Hn(o,t),l=q1(e),c=V1(e);return(f,u)=>{if(!PZ(f))return De(new rn(e,f));const d=(u==null?void 0:u.errors)==="all",h=[];let m=0;const b=(u==null?void 0:u.onExcessProperty)==="error",w=(u==null?void 0:u.onExcessProperty)==="preserve",g={};let v;if(b||w){v=Reflect.ownKeys(f);for(const k of v){const _=s(k,u);if(br(_)&&qn(_))if(b){const A=new er(k,f,new zj(f[k],`is unexpected, expected: ${String(o)}`));if(d){h.push([m++,A]);continue}else return De(new Zt(e,f,A,g))}else g[k]=f[k]}}let x;const E=(u==null?void 0:u.exact)===!0;for(let k=0;k<n.length;k++){const _=n[k][1],A=_.name,I=Object.prototype.hasOwnProperty.call(f,A);if(!I){if(_.isOptional)continue;if(E){const U=new er(A,f,new Qh(_));if(d){h.push([m++,U]);continue}else return De(new Zt(e,f,U,g))}}const O=n[k][0],z=O(f[A],u);if(br(z)){if(qn(z)){const U=new er(A,f,I?z.left:new Qh(_));if(d){h.push([m++,U]);continue}else return De(new Zt(e,f,U,g))}g[A]=z.right}else{const U=m++,J=A;x||(x=[]),x.push(({es:Y,output:F})=>Te(Yu(z),D=>{if(qn(D)){const P=new er(J,f,I?D.left:new Qh(_));return d?(Y.push([U,P]),ot):De(new Zt(e,f,P,F))}return F[J]=D.right,ot}))}}for(let k=0;k<a.length;k++){const _=a[k],A=_[0],I=_[1],O=w8(f,_[2]);for(const z of O){const U=A(z,u);if(br(U)&&eo(U)){const J=I(f[z],u);if(br(J))if(qn(J)){const Y=new er(z,f,J.left);if(d){h.push([m++,Y]);continue}else return De(new Zt(e,f,Y,g))}else Object.prototype.hasOwnProperty.call(r,z)||(g[z]=J.right);else{const Y=m++,F=z;x||(x=[]),x.push(({es:D,output:P})=>Te(Yu(J),$=>{if(qn($)){const q=new er(F,f,$.left);return d?(D.push([Y,q]),ot):De(new Zt(e,f,q,P))}else return Object.prototype.hasOwnProperty.call(r,z)||(P[z]=$.right),ot}))}}}}const C=({es:k,output:_})=>{if(Vf(k))return De(new Zt(e,f,da(k),_));if((u==null?void 0:u.propertyOrder)==="original"){const A=v||Reflect.ownKeys(f);for(const O of i)A.indexOf(O)===-1&&A.push(O);const I={};for(const O of A)Object.prototype.hasOwnProperty.call(_,O)&&(I[O]=_[O]);return Ne(I)}return Ne(_)};if(x&&x.length>0){const k=x;return ln(()=>{const _={es:mm(h),output:Object.assign({},g)};return Te(uo(k,A=>A(_),{concurrency:l,batching:c,discard:!0}),()=>C(_))})}return C({es:h,output:g})}}case"Union":{const n=gbe(e.types,t),r=Reflect.ownKeys(n.keys),i=r.length,a=e.types.length,o=new Map;for(let c=0;c<a;c++)o.set(e.types[c],Hn(e.types[c],t));const s=q1(e)??1,l=V1(e);return(c,f)=>{const u=[];let d=0,h=[];if(i>0)if(eR(c))for(let w=0;w<i;w++){const g=r[w],v=n.keys[g].buckets;if(Object.prototype.hasOwnProperty.call(c,g)){const x=String(c[g]);if(Object.prototype.hasOwnProperty.call(v,x))h=h.concat(v[x]);else{const{candidates:E,literals:C}=n.keys[g],k=pi.make(C),_=E.length===a?new wl([new rr(g,k,!1,!0)],[]):pi.make(E);u.push([d++,new Zt(_,c,new er(g,c,new rn(k,c[g])))])}}else{const{candidates:x,literals:E}=n.keys[g],C=new rr(g,pi.make(E),!1,!0),k=x.length===a?new wl([C],[]):pi.make(x);u.push([d++,new Zt(k,c,new er(g,c,new Qh(C)))])}}else{const w=n.candidates.length===a?e:pi.make(n.candidates);u.push([d++,new rn(w,c)])}n.otherwise.length>0&&(h=h.concat(n.otherwise));let m;for(let w=0;w<h.length;w++){const g=h[w],v=o.get(g)(c,f);if(br(v)&&(!m||m.length===0)){if(eo(v))return v;u.push([d++,v.left])}else{const x=d++;m||(m=[]),m.push(E=>ln(()=>"finalResult"in E?ot:Te(Yu(v),C=>(eo(C)?E.finalResult=C:E.es.push([x,C.left]),ot))))}}const b=w=>Vf(w)?w.length===1&&w[0][1]._tag==="Type"?De(w[0][1]):De(new Zt(e,c,da(w))):De(new rn(e,c));if(m&&m.length>0){const w=m;return ln(()=>{const g={es:mm(u)};return Te(uo(w,v=>v(g),{concurrency:s,batching:l,discard:!0}),()=>"finalResult"in g?g.finalResult:b(g.es))})}return b(u)}}case"Suspend":{const n=_8(()=>Hn(e.f(),t));return(r,i)=>n()(r,i)}}},ui=(e,t)=>n=>t(n)?Ne(n):De(new rn(e,n)),Sm=(e,t)=>{switch(e._tag){case"Declaration":{const n=q8(e);if(Dt(n))return Sm(n.value,t);break}case"TypeLiteral":{const n=[];for(let r=0;r<e.propertySignatures.length;r++){const i=e.propertySignatures[r],a=t?O0(i.type):bn(i.type);Wm(a)&&!i.isOptional&&n.push([i.name,a])}return n}case"TupleType":{const n=[];for(let r=0;r<e.elements.length;r++){const i=e.elements[r],a=t?O0(i.type):bn(i.type);Wm(a)&&!i.isOptional&&n.push([r,a])}return n}case"Refinement":return Sm(e.from,t);case"Suspend":return Sm(e.f(),t);case"Transformation":return Sm(t?e.from:e.to,t)}return[]},gbe=(e,t)=>{const n={},r=[],i=[];for(let a=0;a<e.length;a++){const o=e[a],s=Sm(o,t);if(s.length>0){i.push(o);for(let l=0;l<s.length;l++){const[c,f]=s[l],u=String(f.literal);n[c]=n[c]||{buckets:{},literals:[],candidates:[]};const d=n[c].buckets;if(Object.prototype.hasOwnProperty.call(d,u)){if(l<s.length-1)continue;d[u].push(o),n[c].literals.push(f),n[c].candidates.push(o)}else{d[u]=[o],n[c].literals.push(f),n[c].candidates.push(o);break}}}else r.push(o)}return{keys:n,otherwise:r,candidates:i}},c9=e=>td(e)?c9(e.from):e,xm=(e,t,n,r)=>{if((r==null?void 0:r.isEffectAllowed)===!0||br(e))return e;const i=new hA,a=UA(e,{scheduler:i});i.flush();const o=a.unsafePoll();if(o){if(FB(o))return Ne(o.value);const s=o.cause;return wfe(s)?De(s.error):De(new Vk(t,n,Mfe(s)))}return De(new Vk(t,n,"cannot be be resolved synchronously, this is caused by using runSync on an effect that performs async work"))},ybe=([e],[t])=>e>t?1:e<t?-1:0;function da(e){return e.sort(ybe).map(t=>t[1])}const bbe=(e,t)=>{switch(e._tag){case"FinalTransformation":return t?e.decode:e.encode;case"ComposeTransformation":return Ne;case"TypeLiteralTransformation":return n=>{let r=Ne(n);for(const i of e.propertySignatureTransformations){const[a,o]=t?[i.from,i.to]:[i.to,i.from],s=t?i.decode:i.encode;r=ir(r,c=>{const f=s(Object.prototype.hasOwnProperty.call(c,a)?ae(c[a]):ne());return delete c[a],Dt(f)&&(c[o]=f.value),c})}return r}}},Ar=(e,t=[])=>({value:e,forest:t}),Xm={formatIssue:e=>ir(uf(e),vbe),formatIssueSync:e=>{const t=Xm.formatIssue(e);return br(t)?r5(t):Zi(t)},formatError:e=>Xm.formatIssue(e.issue),formatErrorSync:e=>Xm.formatIssueSync(e.issue)},vbe=e=>e.value+u9(`
87
+ `,e.forest),u9=(e,t)=>{let n="";const r=t.length;let i;for(let a=0;a<r;a++){i=t[a];const o=a===r-1;n+=e+(o?"└":"├")+"─ "+i.value,n+=u9(e+(r>1&&!o?"│ ":" "),i.forest)}return n},Sbe=e=>{switch(e){case"Encoded":return"Encoded side transformation failure";case"Transformation":return"Transformation process failure";case"Type":return"Type side transformation failure"}},xbe=e=>{switch(e){case"From":return"From side refinement failure";case"Predicate":return"Predicate refinement failure"}},f9=e=>"ast"in e?ae(e.ast):ne(),Kk=Ne(void 0),wbe=e=>f9(e).pipe(Cs(hye),Mt({onNone:()=>Kk,onSome:t=>{const n=t(e);return Oi(n)?Ne({message:n,override:!1}):Wl(n)?yt(n,r=>({message:r,override:!1})):Oi(n.message)?Ne({message:n.message,override:n.override}):yt(n.message,r=>({message:r,override:n.override}))}})),cO=e=>t=>t._tag===e,d9=cO("Composite"),Fj=cO("Refinement"),Uj=cO("Transformation"),_l=e=>_a(wbe(e),t=>t!==void 0?!t.override&&(d9(e)||Fj(e)&&e.kind==="From"||Uj(e)&&e.kind!=="Transformation")?Uj(e)||Fj(e)?_l(e.issue):Kk:Ne(t.message):Kk),h9=e=>f9(e).pipe(Cs(yye),l5(t=>t(e)),Bi);function _be(e){return H8(e).pipe(ka(()=>U8(e)),ka(()=>B8(e)),ka(()=>Tx(e)),zt(()=>`{ ${e.from} | filter }`))}function Ebe(e){return e.message!==void 0?e.message:`Expected ${td(e.ast)?_be(e.ast):String(e.ast)}, actual ${ks(e.actual)}`}const m9=e=>ir(_l(e),t=>t??h9(e)??Ebe(e)),Xy=e=>h9(e)??String(e.ast),p9=e=>e.message??"is forbidden",g9=e=>e.message??"is unexpected",y9=e=>{const t=mye(e.ast);if(Dt(t)){const n=t.value();return Oi(n)?Ne(n):n}return Ne(e.message??"is missing")},uf=e=>{switch(e._tag){case"Type":return ir(m9(e),Ar);case"Forbidden":return Ne(Ar(Xy(e),[Ar(p9(e))]));case"Unexpected":return Ne(Ar(g9(e)));case"Missing":return ir(y9(e),Ar);case"Transformation":return _a(_l(e),t=>t!==void 0?Ne(Ar(t)):ir(uf(e.issue),n=>Ar(Xy(e),[Ar(Sbe(e.kind),[n])])));case"Refinement":return _a(_l(e),t=>t!==void 0?Ne(Ar(t)):ir(uf(e.issue),n=>Ar(Xy(e),[Ar(xbe(e.kind),[n])])));case"Pointer":return ir(uf(e.issue),t=>Ar(E8(e.path),[t]));case"Composite":return _a(_l(e),t=>{if(t!==void 0)return Ne(Ar(t));const n=Xy(e);return tO(e.issues)?ir(uo(e.issues,uf),r=>Ar(n,r)):ir(uf(e.issues),r=>Ar(n,[r]))})}},fc=(e,t,n)=>({_tag:e,path:t,message:n}),qb={formatIssue:e=>ff(e,void 0,[]),formatIssueSync:e=>{const t=qb.formatIssue(e);return br(t)?r5(t):Zi(t)},formatError:e=>qb.formatIssue(e.issue),formatErrorSync:e=>qb.formatIssueSync(e.issue)},ff=(e,t,n)=>{const r=e._tag;switch(r){case"Type":return ir(m9(e),i=>[fc(t??r,n,i)]);case"Forbidden":return Ne([fc(r,n,p9(e))]);case"Unexpected":return Ne([fc(r,n,g9(e))]);case"Missing":return ir(y9(e),i=>[fc(r,n,i)]);case"Pointer":return ff(e.issue,void 0,n.concat(e.path));case"Composite":return _a(_l(e),i=>i!==void 0?Ne([fc(r,n,i)]):tO(e.issues)?ir(uo(e.issues,a=>ff(a,void 0,n)),m5):ff(e.issues,void 0,n));case"Refinement":return _a(_l(e),i=>i!==void 0?Ne([fc(r,n,i)]):ff(e.issue,e.kind==="Predicate"?r:void 0,n));case"Transformation":return _a(_l(e),i=>i!==void 0?Ne([fc(r,n,i)]):ff(e.issue,e.kind==="Transformation"?r:void 0,n))}},Bj=eye,kbe=T(e=>Oa(e[0]),(e,...t)=>{const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}),b9=T(e=>Oa(e[0]),(e,...t)=>{const n={...e};for(const r of t)delete n[r];return n}),zd=Symbol.for("effect/Schema");function At(e){var t,n,r;return n=zd,t=zd,r=class{constructor(){S(this,n,Gk)}static annotations(a){return At(ko(this.ast,a))}static pipe(){return he(this,arguments)}static toString(){return String(e)}},S(r,"ast",e),S(r,"Type"),S(r,"Encoded"),S(r,"Context"),S(r,t,Gk),r}const Gk={_A:e=>e,_I:e=>e,_R:e=>e},Hj={typeConstructor:cye,schemaId:uye,message:R8,missingMessage:nO,identifier:Qg,title:Pa,description:Ru,examples:A8,default:O8,documentation:fye,jsonSchema:M8,arbitrary:N8,pretty:D8,equivalence:j8,concurrency:I8,batching:$8,parseIssueTitle:L8,parseOptions:z8,decodingFallback:P8},Ou=e=>{if(!e)return{};const t={...e};for(const n in Hj)if(n in e){const r=Hj[n];t[r]=e[n],delete t[n]}return t},ko=(e,t)=>_h(e,Ou(t));const Cbe=e=>String(e.ast),Tbe=e=>At(O0(e.ast)),ma=e=>At(bn(e.ast)),Zh=(e,t)=>{const n=Dx(e,t);return(r,i)=>Jm(n(r,i),sO)},Rbe=(e,t)=>{const n=lO(e,t);return(r,i)=>Jm(n(r,i),sO)},Abe=Rbe,ja=e=>Re(e,zd)&&Oa(e[zd]);function Obe(e){return aO(e)?pi.make(Gye(e,t=>new A0(t))):new A0(e[0])}function v9(e,t=Obe(e)){var n;return n=class extends At(t){static annotations(i){return v9(this.literals,ko(this.ast,i))}},S(n,"literals",[...e]),n}function Os(...e){return on(e)?v9(e):Yp}const Mbe=(e,t,n)=>uO(e,new Rx(e.map(r=>r.ast),(...r)=>t.decode(...r.map(At)),(...r)=>t.encode(...r.map(At)),Ou(n))),Nbe=(e,t)=>{const n=()=>(i,a,o)=>e(i)?wr(i):rs(new rn(o,i)),r=n;return uO([],new Rx([],n,r,Ou(t)))};function uO(e,t){var n;return n=class extends At(t){static annotations(i){return uO(this.typeParameters,ko(this.ast,i))}},S(n,"typeParameters",[...e]),n}const Eh=function(){if(Array.isArray(arguments[0])){const n=arguments[0],r=arguments[1],i=arguments[2];return Mbe(n,r,i)}const e=arguments[0],t=arguments[1];return Nbe(e,t)};class S9 extends At(Pk){}class Dbe extends At(Aye){}class x9 extends At(kye){}class Yp extends At(rO){}class Ix extends At(K8){}class jbe extends At(Fye){}class V extends At(Fk){}class Pt extends At(Bk){}class hr extends At(Hk){}const Ibe=e=>pi.make(e.map(t=>t.ast));function w9(e,t=Ibe(e)){var n;return n=class extends At(t){static annotations(i){return w9(this.members,ko(this.ast,i))}},S(n,"members",[...e]),n}function Mu(...e){return aO(e)?w9(e):on(e)?e[0]:Yp}const Qm=e=>Mu(e,x9),wm=e=>Mu(e,S9),K1=e=>Mu(e,x9,S9),$be=(e,t)=>new iO(e.map(n=>ja(n)?new Au(n.ast,!1):n.ast),t.map(n=>ja(n)?new Ax(n.ast):n.ast),!0);function N0(e,t,n=$be(e,t)){var r;return r=class extends At(n){static annotations(a){return N0(this.elements,this.rest,ko(this.ast,a))}},S(r,"elements",[...e]),S(r,"rest",[...t]),r}function Lbe(...e){return Array.isArray(e[0])?N0(e[0],e.slice(1)):N0(e,[])}function _9(e,t){var n;return n=class extends N0([],[e],t){static annotations(i){return _9(this.value,ko(this.ast,i))}},S(n,"value",e),n}const kn=e=>_9(e),Yk=e=>e?'"?:"':'":"';class Pd extends Au{constructor(n,r,i,a,o){super(n,r,a);S(this,"isReadonly");S(this,"defaultValue");S(this,"_tag","PropertySignatureDeclaration");this.isReadonly=i,this.defaultValue=o}toString(){const n=Yk(this.isOptional),r=String(this.type);return`PropertySignature<${n}, ${r}, never, ${n}, ${r}>`}}class E9 extends Au{constructor(n,r,i,a,o){super(n,r,a);S(this,"isReadonly");S(this,"fromKey");this.isReadonly=i,this.fromKey=o}}class $x extends Au{constructor(n,r,i,a,o){super(n,r,a);S(this,"isReadonly");S(this,"defaultValue");this.isReadonly=i,this.defaultValue=o}}const zbe=e=>e===void 0?"never":Oi(e)?JSON.stringify(e):String(e);class Lx{constructor(t,n,r,i){S(this,"from");S(this,"to");S(this,"decode");S(this,"encode");S(this,"_tag","PropertySignatureTransformation");this.from=t,this.to=n,this.decode=r,this.encode=i}toString(){return`PropertySignature<${Yk(this.to.isOptional)}, ${this.to.type}, ${zbe(this.from.fromKey)}, ${Yk(this.from.isOptional)}, ${this.from.type}>`}}const k9=(e,t)=>{switch(e._tag){case"PropertySignatureDeclaration":return new Pd(e.type,e.isOptional,e.isReadonly,{...e.annotations,...t},e.defaultValue);case"PropertySignatureTransformation":return new Lx(e.from,new $x(e.to.type,e.to.isOptional,e.to.isReadonly,{...e.to.annotations,...t},e.to.defaultValue),e.decode,e.encode)}},C9=Symbol.for("effect/PropertySignature"),fO=e=>Re(e,C9);var Lz,zz;zz=zd,Lz=C9;const z2=class z2{constructor(t){S(this,"ast");S(this,zz);S(this,Lz,null);S(this,"_TypeToken");S(this,"_Key");S(this,"_EncodedToken");S(this,"_HasDefault");this.ast=t}pipe(){return he(this,arguments)}annotations(t){return new z2(k9(this.ast,Ou(t)))}toString(){return String(this.ast)}};let D0=z2;const j0=e=>new D0(e);class Zg extends D0{constructor(n,r){super(n);S(this,"from");this.from=r}annotations(n){return new Zg(k9(this.ast,Ou(n)),this.from)}}const Zm=e=>new Zg(new Pd(e.ast,!1,!0,{},void 0),e),If=T(2,(e,t)=>{const n=e.ast;switch(n._tag){case"PropertySignatureDeclaration":return j0(new Pd(n.type,n.isOptional,n.isReadonly,n.annotations,t));case"PropertySignatureTransformation":return j0(new Lx(n.from,new $x(n.to.type,n.to.isOptional,n.to.isReadonly,n.to.annotations,t),n.decode,n.encode))}}),Is=(e,t,n)=>j0(new Lx(new E9(e.ast,!0,!0,{},void 0),new $x(t.ast,!1,!0,{},void 0),r=>ae(n.decode(r)),Cs(n.encode))),qj=(e,t,n)=>j0(new Lx(new E9(e.ast,!0,!0,{},void 0),new $x(t.ast,!0,!0,{},void 0),n.decode,n.encode)),Pbe=(e,t)=>{const n=t==null?void 0:t.exact,r=t==null?void 0:t.default,i=t==null?void 0:t.nullable,a=(t==null?void 0:t.as)=="Option",o=t!=null&&t.onNoneEncoding?ka(t.onNoneEncoding):ke;if(n){if(r)return i?If(Is(Qm(e),ma(e),{decode:Mt({onNone:r,onSome:s=>s===null?r():s}),encode:ae}),r).ast:If(Is(e,ma(e),{decode:Mt({onNone:r,onSome:ke}),encode:ae}),r).ast;if(a){const s=Wj(ma(e));return i?Is(Qm(e),s,{decode:sf(d1),encode:o}).ast:Is(e,s,{decode:ke,encode:ke}).ast}else return i?qj(Qm(e),ma(e),{decode:sf(d1),encode:ke}).ast:new Pd(e.ast,!0,!0,{},void 0)}else{if(r)return i?If(Is(K1(e),ma(e),{decode:Mt({onNone:r,onSome:s=>s??r()}),encode:ae}),r).ast:If(Is(wm(e),ma(e),{decode:Mt({onNone:r,onSome:s=>s===void 0?r():s}),encode:ae}),r).ast;if(a){const s=Wj(ma(e));return i?Is(K1(e),s,{decode:sf(l=>l!=null),encode:o}).ast:Is(wm(e),s,{decode:sf(IZ),encode:o}).ast}else return i?qj(K1(e),wm(ma(e)),{decode:sf(d1),encode:ke}).ast:new Pd(wm(e).ast,!0,!0,{},void 0)}},Be=e=>{const t=e.ast===Pk||e.ast===rO?Pk:wm(e).ast;return new Zg(new Pd(t,!0,!0,{},void 0),e)},Fbe=T(e=>ja(e[0]),(e,t)=>new Zg(Pbe(e,t),e)),Ube=e9([nO]),Bbe=(e,t)=>{const n=Reflect.ownKeys(e),r=[];if(n.length>0){const a=[],o=[],s=[];for(let l=0;l<n.length;l++){const c=n[l],f=e[c];if(fO(f)){const u=f.ast;switch(u._tag){case"PropertySignatureDeclaration":{const d=u.type,h=u.isOptional,m=u.annotations;a.push(new rr(c,d,h,!0,Ube(u))),o.push(new rr(c,bn(d),h,!0,m)),r.push(new rr(c,d,h,!0,m));break}case"PropertySignatureTransformation":{const d=u.from.fromKey??c;a.push(new rr(d,u.from.type,u.from.isOptional,!0,u.from.annotations)),o.push(new rr(c,u.to.type,u.to.isOptional,!0,u.to.annotations)),s.push(new Xye(d,c,u.decode,u.encode));break}}}else a.push(new rr(c,f.ast,!1,!0)),o.push(new rr(c,bn(f.ast),!1,!0)),r.push(new rr(c,f.ast,!1,!0))}if(on(s)){const l=[],c=[];for(const f of t){const{indexSignatures:u,propertySignatures:d}=Lj(f.key.ast,f.value.ast);d.forEach(h=>{a.push(h),o.push(new rr(h.name,bn(h.type),h.isOptional,h.isReadonly,h.annotations))}),u.forEach(h=>{l.push(h),c.push(new Ox(h.parameter,bn(h.type),h.isReadonly))})}return new Ac(new wl(a,l,{[ed]:"Struct (Encoded side)"}),new wl(o,c,{[ed]:"Struct (Type side)"}),new qk(s))}}const i=[];for(const a of t){const{indexSignatures:o,propertySignatures:s}=Lj(a.key.ast,a.value.ast);s.forEach(l=>r.push(l)),o.forEach(l=>i.push(l))}return new wl(r,i)},T9=(e,t)=>{const n=Reflect.ownKeys(e);for(const r of n){const i=e[r];if(t[r]===void 0&&fO(i)){const a=i.ast,o=a._tag==="PropertySignatureDeclaration"?a.defaultValue:a.to.defaultValue;o!==void 0&&(t[r]=o())}}return t};function R9(e,t,n=Bbe(e,t)){var r;return r=class extends At(n){static annotations(a){return R9(this.fields,this.records,ko(this.ast,a))}static pick(...a){return He(kbe(e,...a))}static omit(...a){return He(b9(e,...a))}},S(r,"fields",{...e}),S(r,"records",[...t]),S(r,"make",(a,o)=>{const s=T9(e,{...a});return zx(o)?s:jx(r)(s)}),r}function He(e,...t){return R9(e,t)}const Hbe=e=>Os(e).pipe(Zm,If(()=>e)),qbe=(e,t)=>He({_tag:Hbe(e),...t});function A9(e,t){var n;return n=class extends At(t){static annotations(i){return A9(this.from,ko(this.ast,i))}},S(n,"make",(i,a)=>zx(a)?i:jx(n)(i)),S(n,"from",e),n}const ey=(e,t)=>n=>{const r=Mt(F8(n.ast),{onNone:()=>[e],onSome:a=>[...a,e]}),i=_h(n.ast,Ou({[T8]:r,...t}));return A9(n,i)},em=(e,t,n)=>{if(Ij(e)&&Ij(t)){const r=[...e.propertySignatures];for(const i of t.propertySignatures){const a=i.name,o=r.findIndex(s=>s.name===a);if(o===-1)r.push(i);else{const{isOptional:s,type:l}=r[o];r[o]=new rr(a,I0(l,i.type,n.concat(a)),s,!0)}}return new wl(r,e.indexSignatures.concat(t.indexSignatures))}throw new Error(k8(e,t,n))},Vbe=nbe([Qg]),tm=(e,t)=>t.map(n=>new oO(n,e.filter,Vbe(e))),I0=(e,t,n)=>pi.make(Fo([e],[t],n)),dc=e=>Mx(e)?e.types:[e],Fo=(e,t,n)=>Bv(e,r=>Bv(t,i=>{switch(i._tag){case"Literal":{if(Oi(i.literal)&&Uk(r)||ps(i.literal)&&Nj(r)||vd(i.literal)&&Dj(r))return[i];break}case"StringKeyword":{if(i===Fk){if(Uk(r)||Wm(r)&&Oi(r.literal))return[r];if(td(r))return tm(r,Fo(dc(r.from),[i],n))}else if(r===Fk)return[i];break}case"NumberKeyword":{if(i===Bk){if(Nj(r)||Wm(r)&&ps(r.literal))return[r];if(td(r))return tm(r,Fo(dc(r.from),[i],n))}else if(r===Bk)return[i];break}case"BooleanKeyword":{if(i===Hk){if(Dj(r)||Wm(r)&&vd(r.literal))return[r];if(td(r))return tm(r,Fo(dc(r.from),[i],n))}else if(r===Hk)return[i];break}case"Union":return Fo(dc(r),i.types,n);case"Suspend":return[new Gp(()=>I0(r,i.f(),n))];case"Refinement":return tm(i,Fo(dc(r),dc(i.from),n));case"TypeLiteral":{switch(r._tag){case"Union":return Fo(r.types,[i],n);case"Suspend":return[new Gp(()=>I0(r.f(),i,n))];case"Refinement":return tm(r,Fo(dc(r.from),[i],n));case"TypeLiteral":return[em(r,i,n)];case"Transformation":{const a=r.transformation,o=em(r.from,i,n),s=em(r.to,bn(i),n);switch(a._tag){case"TypeLiteralTransformation":return[new Ac(o,s,new qk(a.propertySignatureTransformations))];case"ComposeTransformation":return[new Ac(o,s,X8)];case"FinalTransformation":return[new Ac(o,s,new J8((l,c,f,u)=>ir(a.decode(l,c,f,u),d=>({...l,...d})),(l,c,f,u)=>ir(a.encode(l,c,f,u),d=>({...l,...d}))))]}}}break}case"Transformation":{if(Yye(r)){if($j(i.transformation)&&$j(r.transformation))return[new Ac(em(r.from,i.from,n),em(r.to,i.to,n),new qk(i.transformation.propertySignatureTransformations.concat(r.transformation.propertySignatureTransformations)))]}else return Fo([i],[r],n);break}}throw new Error(k8(r,i,n))})),O9=T(2,(e,t)=>At(I0(e.ast,t.ast,[]))),Oc=T(e=>ja(e[1]),(e,t)=>hO(e,t,ibe(e.ast,t.ast))),Kbe=e=>At(new Gp(()=>e().ast)),M9=Symbol.for("effect/SchemaId/Refine");function N9(e,t,n){var r,i,a;return a=class extends(i=At(n),r=M9,i){static annotations(s){return N9(this.from,this.filter,ko(this.ast,s))}},S(a,r,e),S(a,"from",e),S(a,"filter",t),S(a,"make",(s,l)=>zx(l)?s:jx(a)(s)),a}const Vj=(e,t,n)=>{if(vd(e))return e?ne():ae(new rn(t,n));if(Oi(e))return ae(new rn(t,n,e));if(e!==void 0){if("_tag"in e)return ae(e);const r=new rn(t,n,e.message);return ae(on(e.path)?new er(e.path,n,r):r)}return ne()},Gbe=(e,t,n)=>{if(tye(e))return Vj(e,t,n);if(on(e)){const r=Ite(e,i=>Vj(i,t,n));if(on(r))return ae(r.length===1?r[0]:new Zt(t,n,r))}return ne()};function dO(e,t){return n=>{function r(a,o,s){return Gbe(e(a,o,s),s,a)}const i=new oO(n.ast,r,Ou(t));return N9(n,r,i)}}function hO(e,t,n){var r;return r=class extends At(n){static annotations(a){return hO(this.from,this.to,ko(this.ast,a))}},S(r,"from",e),S(r,"to",t),r}const zl=T(e=>ja(e[0])&&ja(e[1]),(e,t,n)=>hO(e,t,new Ac(e.ast,t.ast,new J8(n.decode,n.encode)))),Xl=T(e=>ja(e[0])&&ja(e[1]),(e,t,n)=>zl(e,t,{strict:!0,decode:(r,i,a,o)=>wr(n.decode(r,o)),encode:(r,i,a,o)=>wr(n.encode(r,o))})),Kj=e=>e instanceof Error?e.message:String(e),Ybe=e=>zl(V.annotations({description:"a string to be decoded into JSON"}),Ix,{strict:!0,decode:(t,n,r)=>M0({try:()=>JSON.parse(t,e==null?void 0:e.reviver),catch:i=>new rn(r,t,Kj(i))}),encode:(t,n,r)=>M0({try:()=>JSON.stringify(t,e==null?void 0:e.replacer,e==null?void 0:e.space),catch:i=>new rn(r,t,Kj(i))})}).annotations({title:"parseJson",schemaId:Eye}),mO=(e,t)=>ja(e)?Oc(mO(t),e):Ybe(e),Wbe=sye,Jbe=(e,t)=>n=>n.pipe(dO(r=>r>=e,{schemaId:Wbe,title:`greaterThanOrEqualTo(${e})`,description:"a non-negative number",jsonSchema:{minimum:e},...t})),Xbe=lye,D9=(e,t,n)=>r=>r.pipe(dO(i=>i>=e&&i<=t,{schemaId:Xbe,title:`between(${e}, ${t})`,description:`a number between ${e} and ${t}`,jsonSchema:{minimum:e,maximum:t},...n}));function Qbe(e){return zl(e,Pt,{strict:!1,decode:(t,n,r)=>sbe(loe(t),()=>new rn(r,t,`Unable to decode ${JSON.stringify(t)} into a number`)),encode:t=>wr(String(t))})}class ep extends Qbe(V.annotations({description:"a string to be decoded into a number"})).annotations({identifier:"NumberFromString"}){}const Zbe=(e,t)=>{const n=Symbol.keyFor(e);return n===void 0?rs(new rn(t,e,`Unable to encode a unique symbol ${String(e)} into a string`)):wr(n)},eve=e=>wr(Symbol.for(e)),j9=(e,t,n,r)=>lbe(e,{onFailure:i=>new Zt(n,r,i),onSuccess:t});class tve extends Eh(zZ,{typeConstructor:{_tag:"Uint8Array"},identifier:"Uint8ArrayFromSelf",pretty:()=>t=>`new Uint8Array(${JSON.stringify(Array.from(t))})`,arbitrary:()=>t=>t.uint8Array(),equivalence:()=>IS(Se)}){}const Gj=oye;class Hc extends Eh(A4,{typeConstructor:{_tag:"Date"},identifier:"DateFromSelf",schemaId:Gj,[Gj]:{noInvalidDate:!1},description:"a potentially invalid Date instance",pretty:()=>t=>`new Date(${JSON.stringify(t)})`,arbitrary:()=>t=>t.date({noInvalidDate:!1}),equivalence:()=>Fee}){}class Vb extends Xl(V.annotations({description:"a string to be decoded into a Date"}),Hc,{strict:!0,decode:t=>new Date(t),encode:t=>I4(t)}).annotations({identifier:"DateFromString"}){}const nve=e=>e._tag==="None"?ne():ae(e.value),rve=(e,t)=>n=>n.oneof(t,n.record({_tag:n.constant("None")}),n.record({_tag:n.constant("Some"),value:e(n)})).map(nve),ive=e=>Mt({onNone:()=>"none()",onSome:t=>`some(${e(t)})`}),Yj=e=>(t,n,r)=>nte(t)?Vt(t)?wr(ne()):j9(e(t.value,n),ae,r,t):rs(new rn(r,t)),Wj=e=>Eh([e],{decode:t=>Yj(lO(t)),encode:t=>Yj(Dx(t))},{typeConstructor:{_tag:"effect/Option"},pretty:ive,arbitrary:rve,equivalence:cte}),ave=(e,t)=>n=>{const r=n.array(e(n));return(t.depthIdentifier!==void 0?n.oneof(t,n.constant([]),r):r).map(gs)},ove=e=>t=>`Chunk(${Lr(t).map(e).join(", ")})`,Jj=e=>(t,n,r)=>$S(t)?LS(t)?wr(Ln()):j9(e(Lr(t),n),gs,r,t):rs(new rn(r,t)),sve=e=>Eh([e],{decode:t=>Jj(lO(kn(t))),encode:t=>Jj(Dx(kn(t)))},{typeConstructor:{_tag:"effect/Chunk"},description:`Chunk<${Cbe(e)}>`,pretty:ove,arbitrary:ave,equivalence:b5});function I9(e){return Xl(kn(e),sve(ma(e)),{strict:!0,decode:t=>t.length===0?Ln():gs(t),encode:t=>Lr(t)})}const lve=e=>ja(e)||fO(e),$9=e=>Reflect.ownKeys(e).every(t=>lve(e[t])),pO=e=>"fields"in e?e.fields:pO(e[M9]),gO=e=>$9(e)?He(e):ja(e)?e:He(pO(e)),yO=e=>$9(e)?e:pO(e),ty=e=>(t,n)=>tp({kind:"Class",identifier:e,schema:gO(t),fields:yO(t),Base:MA,annotations:n}),cve=e=>If(Zm(Os(e)),()=>e),L9=e=>(t,n,r)=>{class i extends NA{}i.prototype.name=t;const a=yO(n),o=gO(n),s={_tag:cve(t)},l=Kb(s,a),c="message"in l;class f extends tp({kind:"TaggedError",identifier:t,schema:O9(o,He(s)),fields:l,Base:i,annotations:r,disableToString:!0}){}return S(f,"_tag",t),c||Object.defineProperty(f.prototype,"message",{get(){return`{ ${Reflect.ownKeys(a).map(u=>`${AS(u)}: ${ks(this[u])}`).join(", ")} }`},enumerable:!1,configurable:!0}),f},Kb=(e,t)=>{const n={...e};for(const r of Reflect.ownKeys(t)){if(r in e)throw new Error(C8(r));n[r]=t[r]}return n};function zx(e){return vd(e)?e:(e==null?void 0:e.disableValidation)??!1}const Xj=je("effect/Schema/astCache",()=>new WeakMap),uve=e=>e===void 0?[]:Array.isArray(e)?e:[e],tp=({Base:e,annotations:t,disableToString:n,fields:r,identifier:i,kind:a,schema:o})=>{var x,E;const s=Symbol.for(`effect/Schema/${a}/${i}`),[l,c,f]=uve(t),u=ma(o),d=u.annotations({identifier:i,...l}),h=u.annotations({[ed]:`${i} (Type side)`,...l}),m=o.annotations({[ed]:`${i} (Constructor)`,...l}),b=o.annotations({[ed]:`${i} (Encoded side)`,...f}),w=o.annotations({...f,...l,...c}),g=C=>Re(C,s)&&dbe(h)(C),v=(E=class extends e{constructor(C={},k=!1){C={...C},a!=="Class"&&delete C._tag,C=T9(r,C),zx(k)||(C=jx(m)(C)),super(C,!0)}static get ast(){let C=Xj.get(this);if(C)return C;const k=Eh([o],{decode:()=>(_,A,I)=>_ instanceof this||g(_)?wr(_):rs(new rn(I,_)),encode:()=>(_,A)=>_ instanceof this?wr(_):ir(Dx(h)(_,A),I=>new this(I,!0))},{identifier:i,pretty:_=>A=>`${i}(${_(A)})`,arbitrary:_=>A=>_(A).map(I=>new this(I)),equivalence:ke,[R0]:d.ast,...l});return C=Xl(b,k,{strict:!0,decode:_=>new this(_,!0),encode:ke}).annotations({[R0]:w.ast,...c}).ast,Xj.set(this,C),C}static pipe(){return he(this,arguments)}static annotations(C){return At(this.ast).annotations(C)}static toString(){return`(${String(b)} <-> ${i})`}static make(...C){return new this(...C)}static extend(C){return(k,_)=>{const A=yO(k),I=gO(k),O=Kb(r,A);return tp({kind:a,identifier:C,schema:O9(o,I),fields:O,Base:this,annotations:_})}}static transformOrFail(C){return(k,_,A)=>{const I=Kb(r,k);return tp({kind:a,identifier:C,schema:zl(o,ma(He(I)),_),fields:I,Base:this,annotations:A})}}static transformOrFailFrom(C){return(k,_,A)=>{const I=Kb(r,k);return tp({kind:a,identifier:C,schema:zl(Tbe(o),He(I),_),fields:I,Base:this,annotations:A})}}get[(x=zd,s)](){return s}},S(E,x,Gk),S(E,"fields",{...r}),S(E,"identifier",i),E);return n!==!0&&Object.defineProperty(v.prototype,"toString",{value(){return`${i}({ ${Reflect.ownKeys(r).map(C=>`${AS(C)}: ${ks(this[C])}`).join(", ")} })`},configurable:!0,writable:!0}),v},Qj=qbe("symbol",{key:V}).annotations({description:"an object to be decoded into a globally shared symbol"}),fve=zl(Qj,jbe,{strict:!0,decode:e=>eve(e.key),encode:(e,t,n)=>ir(Zbe(e,n),r=>Qj.make({key:r}))});class dve extends Mu(V,Pt,fve).annotations({identifier:"PropertyKey"}){}class hve extends He({_tag:Zm(Os("Pointer","Unexpected","Missing","Composite","Refinement","Transformation","Type","Forbidden")).annotations({description:"The tag identifying the type of parse issue"}),path:Zm(kn(dve)).annotations({description:"The path to the property where the issue occurred"}),message:Zm(V).annotations({description:"A descriptive message explaining the issue"})}).annotations({identifier:"ArrayFormatterIssue",description:"Represents an issue returned by the ArrayFormatter formatter"}){}const z9=(e,t)=>{class n extends NA{constructor(){super(...arguments);S(this,"_tag",t)}}return n.prototype[e]=e,n.prototype.name=t,n},mve=Ta,pve=xh,gve=t8,yve=GA,Zj=YA,bve=tge,P9=Symbol.for("effect/Subscribable"),F9=e=>Re(e,P9),vve="effect/SubscriptionRef",Sve=Symbol.for(vve),xve=T(2,(e,t)=>N(ble(e.ref,t),BA(epe(e.pubsub,t)),e.semaphore.withPermits(1))),Wk=Sve,eI=xve,wve="~effect-atom/atom/Result",Px={[wve]:{E:ke,A:ke},pipe(){return he(this,arguments)},[ze](e){if(this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case"Initial":return!0;case"Success":return Se(this.value,e.value);case"Failure":return Se(this.cause,e.cause)}},[Le](){const e=Bt(`${this._tag}:${this.waiting}`);return this._tag==="Initial"?_t(this,e):_t(this,Pe(e)(this._tag==="Success"?de(this.value):de(this.cause)))}},U9=(e,t)=>e._tag==="Success"?cu(e.value):ny(e.cause,{previous:t}),bO=e=>e._tag==="None"?El(!0):Fx(e.value),tI=e=>e._tag==="Initial",_ve=e=>e._tag!=="Initial",El=(e=!1)=>{const t=Object.create(Px);return t._tag="Initial",t.waiting=e,t},vs=e=>e._tag==="Success",cu=(e,t)=>{const n=Object.create(Px);return n._tag="Success",n.value=e,n.waiting=(t==null?void 0:t.waiting)??!1,n.timestamp=(t==null?void 0:t.timestamp)??Date.now(),n},_m=e=>e._tag==="Failure",Eve=(e,t)=>{const n=Object.create(Px);return n._tag="Failure",n.cause=e,n.previousSuccess=(t==null?void 0:t.previousSuccess)??ne(),n.waiting=(t==null?void 0:t.waiting)??!1,n},ny=(e,t)=>Eve(e,{previousSuccess:Cs(t.previous,n=>vs(n)?ae(n):_m(n)?n.previousSuccess:ne()),waiting:t.waiting}),kve=(e,t)=>ny(y6(e),t),Fx=(e,t)=>{if(e.waiting)return t!=null&&t.touch?Cve(e):e;const n=Object.assign(Object.create(Px),e);return n.waiting=!0,n},Cve=e=>vs(e)?cu(e.value,{waiting:e.waiting}):e,Em=(e,t)=>e._tag==="Failure"?ny(e.cause,{previous:t,waiting:e.waiting}):e,B9=e=>e._tag==="Success"?ae(e.value):e._tag==="Failure"?ni(e.previousSuccess,t=>t.value):ne(),Jk=e=>s5(B9(e),()=>new vh("Result.getOrThrow: no value found")),$0=e=>{switch(e._tag){case"Success":return bi(e.value);case"Failure":return xr(e.cause);default:return l0(new vh)}},nd=e=>new Tve(e);class Tve{constructor(t){S(this,"result");S(this,"output",ne());this.result=t}when(t,n){if(Vt(this.output)&&t(this.result)){const r=n(this.result);Dt(r)&&(this.output=r)}return this}pipe(){return he(this,arguments)}onWaiting(t){return this.when(n=>n.waiting,n=>ae(t(n)))}onInitialOrWaiting(t){return this.when(n=>tI(n)||n.waiting,n=>ae(t(n)))}onInitial(t){return this.when(tI,n=>ae(t(n)))}onSuccess(t){return this.when(vs,n=>ae(t(n.value,n)))}onFailure(t){return this.when(_m,n=>ae(t(n.cause,n)))}onError(t){return this.onErrorIf(NE,t)}onErrorIf(t,n){return this.when(_m,r=>Cfe(r.cause).pipe(sf(t),ni(i=>n(i,r))))}onErrorTag(t,n){return this.onErrorIf(r=>Re(r,"_tag")&&(Array.isArray(t)?t.includes(r._tag):r._tag===t),n)}onDefect(t){return this.when(_m,n=>Rfe(n.cause).pipe(ni(r=>t(r,n))))}orElse(t){return zt(this.output,t)}orNull(){return ate(this.output)}render(){if(Dt(this.output))return this.output.value;if(_m(this.result))throw TA(this.result.cause);return null}}const Rve={immediate:!0},Ave=e=>{e()},G1="~effect-atom/atom/Registry",Ove=e=>new Mve(e==null?void 0:e.initialValues,e==null?void 0:e.scheduleTask,e==null?void 0:e.timeoutResolution,e==null?void 0:e.defaultIdleTTL),Xk="~effect-atom/atom/Atom/Serializable",nm=e=>Xk in e?e[Xk].key:e;var Pz,Mc;Pz=G1;class Mve{constructor(t,n=a=>queueMicrotask(a),r,i){S(this,"scheduleTask");S(this,"defaultIdleTTL");S(this,Pz);S(this,"timeoutResolution");S(this,"nodes",new Map);S(this,"preloadedSerializable",new Map);S(this,"timeoutBuckets",new Map);S(this,"nodeTimeoutBucket",new Map);S(this,"disposed",!1);S(this,"refresh",t=>{t.refresh!==void 0?t.refresh(this.refresh):this.invalidateAtom(t)});S(this,"invalidateAtom",t=>{this.ensureNode(t).invalidate()});ww(this,Mc,null);if(this.scheduleTask=n,this.defaultIdleTTL=i,this[G1]=G1,r===void 0&&i!==void 0?this.timeoutResolution=Math.round(i/2):this.timeoutResolution=r??1e3,t!==void 0)for(const[a,o]of t)this.ensureNode(a).setValue(o)}getNodes(){return this.nodes}get(t){return this.ensureNode(t).value()}set(t,n){t.write(this.ensureNode(t).writeContext,n)}setSerializable(t,n){this.preloadedSerializable.set(t,n)}modify(t,n){const r=this.ensureNode(t),i=n(r.value());return t.write(r.writeContext,i[1]),i[0]}update(t,n){const r=this.ensureNode(t);t.write(r.writeContext,n(r.value()))}subscribe(t,n,r){const i=this.ensureNode(t);r!=null&&r.immediate&&n(i.value());const a=i.subscribe(function(){n(i._value)});return()=>{a(),i.canBeRemoved&&this.scheduleNodeRemoval(i)}}mount(t){return this.subscribe(t,bd,Rve)}atomHasTtl(t){return!t.keepAlive&&t.idleTTL!==0&&(t.idleTTL!==void 0||this.defaultIdleTTL!==void 0)}ensureNode(t){const n=nm(t);let r=this.nodes.get(n);if(r===void 0?(r=this.createNode(t),this.nodes.set(n,r)):this.atomHasTtl(t)&&this.removeNodeTimeout(r),typeof n=="string"&&this.preloadedSerializable.has(n)){const i=this.preloadedSerializable.get(n);this.preloadedSerializable.delete(n);const a=t[Xk].decode(i);r.setValue(a)}return r}createNode(t){if(this.disposed)throw new Error(`Cannot access Atom ${t}: registry is disposed`);return t.keepAlive||this.scheduleAtomRemoval(t),new Nve(this,t)}scheduleAtomRemoval(t){this.scheduleTask(()=>{const n=this.nodes.get(nm(t));n!==void 0&&n.canBeRemoved&&this.removeNode(n)})}scheduleNodeRemoval(t){this.scheduleTask(()=>{t.canBeRemoved&&this.removeNode(t)})}removeNode(t){this.atomHasTtl(t.atom)?this.setNodeTimeout(t):(this.nodes.delete(nm(t.atom)),t.remove())}setNodeTimeout(t){if(this.nodeTimeoutBucket.has(t))return;let n=t.atom.idleTTL??this.defaultIdleTTL;if(Sy(this,Mc)!==null&&(n-=Sy(this,Mc),n<=0)){this.nodes.delete(nm(t.atom)),t.remove();return}const r=Math.ceil(n/this.timeoutResolution)*this.timeoutResolution,i=Date.now()+r,a=i-i%this.timeoutResolution+this.timeoutResolution;let o=this.timeoutBuckets.get(a);o===void 0&&(o=[new Set,setTimeout(()=>this.sweepBucket(a),a-Date.now())],this.timeoutBuckets.set(a,o)),o[0].add(t),this.nodeTimeoutBucket.set(t,a)}removeNodeTimeout(t){const n=this.nodeTimeoutBucket.get(t);if(n===void 0)return;this.nodeTimeoutBucket.delete(t),this.scheduleNodeRemoval(t);const[r,i]=this.timeoutBuckets.get(n);r.delete(t),r.size===0&&(clearTimeout(i),this.timeoutBuckets.delete(n))}sweepBucket(t){const n=this.timeoutBuckets.get(t)[0];this.timeoutBuckets.delete(t),n.forEach(r=>{this.nodeTimeoutBucket.delete(r),r.canBeRemoved&&(this.nodes.delete(nm(r.atom)),xy(this,Mc,r.atom.idleTTL??this.defaultIdleTTL),r.remove(),xy(this,Mc,null))})}reset(){this.timeoutBuckets.forEach(([,t])=>clearTimeout(t)),this.timeoutBuckets.clear(),this.nodeTimeoutBucket.clear(),this.nodes.forEach(t=>t.remove()),this.nodes.clear()}dispose(){this.disposed=!0,this.reset()}}Mc=new WeakMap;var $f;(function(e){e[e.alive=1]="alive",e[e.initialized=2]="initialized",e[e.waitingForValue=4]="waitingForValue"})($f||($f={}));var ba;(function(e){e[e.uninitialized=5]="uninitialized",e[e.stale=7]="stale",e[e.valid=3]="valid",e[e.removed=0]="removed"})(ba||(ba={}));let Nve=class{constructor(t,n){S(this,"registry");S(this,"atom");S(this,"state",ba.uninitialized);S(this,"lifetime");S(this,"writeContext");S(this,"parents",[]);S(this,"previousParents");S(this,"children",[]);S(this,"listeners",new Set);S(this,"skipInvalidation",!1);S(this,"_value");this.registry=t,this.atom=n,this.writeContext=new $ve(t,this)}get canBeRemoved(){return!this.atom.keepAlive&&this.listeners.size===0&&this.children.length===0&&this.state!==0}value(){if(this.state&$f.waitingForValue){this.lifetime=Ive(this);const t=this.atom.read(this.lifetime);if(this.state&$f.waitingForValue&&this.setValue(t),this.previousParents){const n=this.previousParents;this.previousParents=void 0;for(let r=0;r<n.length;r++)n[r].removeChild(this),n[r].canBeRemoved&&this.registry.scheduleNodeRemoval(n[r])}}return this._value}valueOption(){return this.state&$f.initialized?ae(this._value):ne()}setValue(t){if(!(this.state&$f.initialized)){this.state=ba.valid,this._value=t,yn.phase===ro.collect?yn.notify.add(this):this.notify();return}this.state=ba.valid,!Se(this._value,t)&&(this._value=t,this.skipInvalidation?this.skipInvalidation=!1:this.invalidateChildren(),this.listeners.size>0&&(yn.phase===ro.collect?yn.notify.add(this):this.notify()))}addParent(t){if(this.parents.push(t),this.previousParents!==void 0){const n=this.previousParents.indexOf(t);n!==-1&&(this.previousParents[n]=this.previousParents[this.previousParents.length-1],this.previousParents.pop()===void 0&&(this.previousParents=void 0))}t.children.indexOf(this)===-1&&(t.children.push(this),t.skipInvalidation&&(t.skipInvalidation=!1))}removeChild(t){const n=this.children.indexOf(t);n!==-1&&(this.children[n]=this.children[this.children.length-1],this.children.pop())}invalidate(){this.state===ba.valid&&(this.state=ba.stale,this.disposeLifetime()),yn.phase===ro.collect?yn.stale.push(this):this.atom.lazy&&this.listeners.size===0&&!Dve(this.children)?(this.invalidateChildren(),this.skipInvalidation=!0):this.value()}invalidateChildren(){if(this.children.length===0)return;const t=this.children;this.children=[];for(let n=0;n<t.length;n++)t[n].invalidate()}notify(){this.listeners.forEach(Ave),yn.phase===ro.commit&&yn.notify.delete(this)}disposeLifetime(){this.lifetime!==void 0&&(this.lifetime.dispose(),this.lifetime=void 0),this.parents.length!==0&&(this.previousParents=this.parents,this.parents=[])}remove(){if(this.state=ba.removed,this.listeners.clear(),this.lifetime===void 0||(this.disposeLifetime(),this.previousParents===void 0))return;const t=this.previousParents;this.previousParents=void 0;for(let n=0;n<t.length;n++)t[n].removeChild(this),t[n].canBeRemoved&&this.registry.removeNode(t[n])}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}};function Dve(e){if(e.length===0)return!1;let t=e,n,r=0;for(;t!==void 0;){for(let i=0,a=t.length;i<a;i++){const o=t[i];if(!o.atom.lazy||o.listeners.size>0)return!0;o.children.length>0&&(n===void 0?n=[o.children]:n.push(o.children))}t=n==null?void 0:n[r++]}return!1}const tr=e=>new Error(`Cannot use context of disposed Atom: ${e}`),jve={get registry(){return this.node.registry},addFinalizer(e){if(this.disposed)throw tr(this.node.atom);this.finalizers??(this.finalizers=[]),this.finalizers.push(e)},get(e){if(this.disposed)throw tr(this.node.atom);const t=this.node.registry.ensureNode(e);return this.node.addParent(t),t.value()},result(e,t){if(this.disposed)throw tr(this.node.atom);if(this.isFn)return this.resultOnce(e,t);const n=this.get(e);if(t!=null&&t.suspendOnWaiting&&n.waiting)return T1;switch(n._tag){case"Initial":return T1;case"Failure":return xr(n.cause);case"Success":return Ht(n.value)}},resultOnce(e,t){if(this.disposed)throw tr(this.node.atom);return v0(n=>{const r=this.once(e);if(r._tag!=="Initial"&&!(t!=null&&t.suspendOnWaiting&&r.waiting))return n($0(r));const i=this.node.registry.subscribe(e,a=>{a._tag==="Initial"||t!=null&&t.suspendOnWaiting&&a.waiting||(i(),n($0(a)))},{immediate:!1});return Ct(i)})},setResult(e,t){if(this.disposed)throw tr(this.node.atom);return this.node.registry.set(e,t),this.resultOnce(e,{suspendOnWaiting:!0})},some(e){if(this.disposed)throw tr(this.node.atom);if(this.isFn)return this.someOnce(e);const t=this.get(e);return t._tag==="None"?T1:Ht(t.value)},someOnce(e){if(this.disposed)throw tr(this.node.atom);return v0(t=>{const n=this.once(e);if(Dt(n))return t(Ht(n.value));const r=this.node.registry.subscribe(e,i=>{Vt(i)||(r(),t(Ht(i.value)))},{immediate:!1});return Ct(r)})},once(e){if(this.disposed)throw tr(this.node.atom);return this.node.registry.get(e)},self(){if(this.disposed)throw tr(this.node.atom);return this.node.valueOption()},refresh(e){if(this.disposed)throw tr(this.node.atom);this.node.registry.refresh(e)},refreshSelf(){if(this.disposed)throw tr(this.node.atom);this.node.invalidate()},mount(e){if(this.disposed)throw tr(this.node.atom);this.addFinalizer(this.node.registry.mount(e))},subscribe(e,t,n){if(this.disposed)throw tr(this.node.atom);this.addFinalizer(this.node.registry.subscribe(e,t,n))},setSelf(e){if(this.disposed)throw tr(this.node.atom);this.node.setValue(e)},set(e,t){if(this.disposed)throw tr(this.node.atom);this.node.registry.set(e,t)},stream(e,t){if(this.disposed)throw tr(this.node.atom);return N(w0(mH((t==null?void 0:t.bufferSize)??16),C0),nH(n=>w0(Ct(()=>this.node.registry.subscribe(e,r=>{ipe(n,r)},{immediate:(t==null?void 0:t.withoutInitialValue)!==!0})),r=>Ct(r))),yt(n=>Hge(n)),y8)},streamResult(e,t){return N(this.stream(e,t),Uge(_ve),Bge(n=>n._tag==="Success"?Kge(n.value):Fge(n.cause)))},dispose(){if(this.disposed=!0,this.finalizers===void 0)return;const e=this.finalizers;this.finalizers=void 0;for(let t=e.length-1;t>=0;t--)e[t]()}},Ive=e=>{function t(n){if(t.disposed)throw tr(n);if(t.isFn)return e.registry.get(n);const r=e.registry.ensureNode(n),i=r.value();return e.addParent(r),i}return Object.setPrototypeOf(t,jve),t.isFn=!1,t.disposed=!1,t.finalizers=void 0,t.node=e,t};class $ve{constructor(t,n){S(this,"registry");S(this,"node");this.registry=t,this.node=n}get(t){return this.registry.get(t)}set(t,n){return this.registry.set(t,n)}setSelf(t){return this.node.setValue(t)}refreshSelf(){return this.node.invalidate()}}var ro;(function(e){e[e.disabled=0]="disabled",e[e.collect=1]="collect",e[e.commit=2]="commit"})(ro||(ro={}));const yn=je("@effect-atom/atom/Registry/batchState",()=>({phase:ro.disabled,depth:0,stale:[],notify:new Set}));function Lve(e){yn.phase=ro.collect,yn.depth++;try{if(e(),yn.depth===1){for(let t=0;t<yn.stale.length;t++)H9(yn.stale[t]);yn.phase=ro.commit;for(const t of yn.notify)t.notify();yn.notify.clear()}}finally{yn.depth--,yn.depth===0&&(yn.phase=ro.disabled,yn.stale=[])}}function H9(e){if(e.state!==ba.valid){for(let t=0;t<e.parents.length;t++){const n=e.parents[t];n.state!==ba.valid&&H9(n)}e.state!==ba.valid&&e.value()}}const zve=e=>{const t=e;switch(t._tag){case"Failure":case"Success":return t;case"Left":return l0(t.left);case"Right":return bi(t.right);case"Some":return bi(t.value);case"None":return l0(new vh)}},vO=e=>{const t=_x(e);return(n,r,i=!1)=>{const a=zve(n);if(a){r(a);return}const o=new hA,s=t(n,{scheduler:o});o.flush();const l=s.unsafePoll();if(l){r(l);return}s.addObserver(r);function c(){s.removeObserver(r),i||s.unsafeInterruptAsFork(Ei)}return c}},Pve="~effect-atom/atom/Registry",Fve=e=>Re(e,Pve),Uve=Ove;class q9 extends hR("@effect/atom/Registry/CurrentRegistry")(){}const Bve=T(e=>Fve(e[0]),(e,t,n)=>{const r=(n==null?void 0:n.suspendOnWaiting)??!1;return v0(i=>{const a=e.get(t);if(a._tag!=="Initial"&&!(r&&a.waiting))return i($0(a));const o=e.subscribe(t,s=>{s._tag!=="Initial"&&!(r&&s.waiting)&&(i($0(s)),o())});return Ct(o)})}),Qk="~effect-atom/atom/Atom",Zk="~effect-atom/atom/Atom/Writable",V9=T(2,(e,t)=>{const n=ra(t),r=q5(n);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!r,idleTTL:r?Gv(n):void 0})}),Wp=V9(0),SO={[Qk]:Qk,pipe(){return he(this,arguments)},toJSON(){return{_id:"Atom",keepAlive:this.keepAlive,lazy:this.lazy,label:this.label}},toString(){return Rt(this)},[lt](){return this.toJSON()}},Hve={...SO,atom(e,t){const n=K9(e,t);return io(r=>{const i=r.self(),a=r(this);return a._tag!=="Success"?Em(a,i):n(r,a.value)})},fn(e,t){return arguments.length===0?(n,r)=>nI(this,n,r):nI(this,e,t)},pull(e,t){const n=Wp(L0(0)),r=io(i=>{const a=i.self(),o=i(this);return o._tag!=="Success"?Em(o,a):np(i,e0e(i,n,e,t),El(!0),o.value)});return t0e(n,r)},subscriptionRef(e){return Wve(Wp(io(t=>{const n=t.self(),r=t(this);if(r._tag!=="Success")return Em(r,n);const i=typeof e=="function"?e(t):e;return Wk in i?i:np(t,i,El(!0),r.value)})),(t,n)=>{const r=Jk(t(this));return aI(t,n,r)})},subscribable(e){return Jve(io(t=>{const n=t.self(),r=t(this);if(r._tag!=="Success")return Em(r,n);const i=typeof e=="function"?e(t):e;return F9(i)?i:np(t,i,El(!0),r.value)}),(t,n)=>{const r=Jk(t(this));return aI(t,n,r)})}},nI=(e,t,n)=>{const[r,i,a]=Qve(n!=null&&n.reactivityKeys?(o,s)=>{const l=t(o,s);return Wl(l)?b8(l,n.reactivityKeys):p8(l,Jge(n.reactivityKeys))}:t,n);return ry(o=>{o.get(a);const s=o.self(),l=o.get(e);return l._tag!=="Success"?Em(l,s):r(o,l.value)},i)},qve={...SO,[Zk]:Zk},Vve=e=>Zk in e,io=(e,t)=>{const n=Object.create(SO);return n.keepAlive=!1,n.lazy=!0,n.read=e,n.refresh=t,n},ry=(e,t,n)=>{const r=Object.create(qve);return r.keepAlive=!1,r.lazy=!0,r.read=e,r.write=t,r.refresh=n,r};function Kve(e,t){e.setSelf(t)}const xO=(e,t)=>{const n=K9(e,t);return Qk in n?n:io(n)},rI=e=>tte in e||Kee in e,K9=(e,t)=>{if(typeof e=="function"&&!Wl(e)&&!(z1 in e)){const n=e;return function(r,i){const a=n(r);if(Oa(a)){if(rI(a))return a;if(Rk in a)return eC(r,a,t,i);if(z1 in a)return iI(r,a,t,i)}return a}}else if(Oa(e)){if(rI(e))return L0(e);if(Rk in e)return function(n,r){return eC(n,e,t,r)};if(z1 in e)return function(n,r){return iI(n,e,t,r)}}return L0(e)},L0=e=>ry(function(t){return e},Kve),eC=(e,t,n,r)=>{const i=(n==null?void 0:n.initialValue)!==void 0?cu(n.initialValue):El();return np(e,t,i,r,n==null?void 0:n.uninterruptible)};function np(e,t,n,r=Ex,i=!1){const a=e.self(),o=Zi(k6());e.addFinalizer(()=>{UA(b0(o,gA))});const s=new Map(r.context.unsafeMap);s.set(ode.key,o),s.set(q9.key,e.registry);const l=HA({context:jee(s),fiberRefs:r.fiberRefs,runtimeFlags:r.runtimeFlags});let c,f=!1;const u=vO(l)(t,function(d){c=U9(d,a),f&&e.setSelf(c)},i);return f=!0,u!==void 0&&e.addFinalizer(u),c!==void 0?c:a._tag==="Some"?bO(a):Fx(n)}const Gve=e=>{let t=P1;function n(i){const a=Object.create(Hve);a.keepAlive=!1,a.lazy=!0,a.refresh=void 0,a.factory=n;const o=Ux(io(typeof i=="function"?s=>O1(i(s),t):()=>O1(i,t)));return a.layer=o,a.read=function(l){const c=l(o),f=Te(Te(xx,u=>hj(c,e.memoMap,u)),u=>_0(Gg(),u));return eC(l,f,{uninterruptible:!0})},a}n.memoMap=e.memoMap,n.addGlobalLayer=i=>{t=O1(t,sH(i,P1))};const r=Wp(xO(Qhe(i=>hj(P1,e.memoMap,i)).pipe(yt(ls(Xg)))));return n.withReactivity=i=>a=>n0e(a,o=>{const s=Jk(o(r));return o.addFinalizer(s.unsafeRegister(i,()=>{o.refresh(a)})),o.subscribe(a,l=>o.setSelf(l)),o.once(a)}),n},Yve=je("@effect-atom/atom/Atom/defaultMemoMap",()=>Zi(_me)),wO=je("@effect-atom/atom/Atom/defaultContext",()=>Gve({memoMap:Yve}));wO.withReactivity;const iI=(e,t,n,r)=>{const i=(n==null?void 0:n.initialValue)!==void 0?cu(n.initialValue):El();return _O(e,t,i,r)};function _O(e,t,n,r=Ex){const i=e.self(),a=pve({onInput(l){return yve(()=>{const c=qte(l);return c._tag==="Some"&&e.setSelf(cu(c.value,{waiting:!0})),a})},onFailure(l){return Zj(()=>{e.setSelf(ny(l,{previous:e.self()}))})},onDone(l){return Zj(()=>{N(e.self(),Cs(B9),Mt({onNone:()=>e.setSelf(kve(new vh,{previous:e.self()})),onSome:c=>e.setSelf(cu(c))}))})}}),o=HA({context:Yi(r.context,q9,e.registry),fiberRefs:r.fiberRefs,runtimeFlags:r.runtimeFlags}),s=vO(o)(gve(mve(g8(t),a)),bd,!1);return s!==void 0&&e.addFinalizer(s),i._tag==="Some"?bO(i):Fx(n)}const aI=(e,t,n=Ex)=>P9 in t?(e.addFinalizer(t.changes.pipe(Vge(r=>(e.setSelf(r),ot)),hme(n))),dme(n)(t.get)):t._tag!=="Success"?t:_O(e,t.value.changes,El(!0),n),Wve=(e,t)=>{function n(r,i){const a=r.get(e);Wk in a?Zi(eI(a,i)):vs(a)&&Zi(eI(a.value,i))}return ry(r=>{const i=r(e);return Wk in i||vs(i)?t(r,i):i},n)},Jve=(e,t)=>io(n=>{const r=n(e);return F9(r)||vs(r)?t(n,r):r}),Xve=Symbol.for("@effect-atom/atom/Atom/Reset"),Y1=Symbol.for("@effect-atom/atom/Atom/Interrupt");function Qve(e,t){const n=Wp(L0([0,void 0])),r=(t==null?void 0:t.initialValue)!==void 0?cu(t.initialValue):El(),i=t!=null&&t.concurrent?Wp(io(s=>{const l=new Set;return s.addFinalizer(()=>l.forEach(c=>c.unsafeInterruptAsFork(Ei))),l})):void 0;function a(s,l){const c=i?s(i):void 0;s.isFn=!0;const[f,u]=s.get(n);if(f===0)return r;if(u===Y1)return ny(b6(Ei),{previous:s.self()});let d=e(u,s);if(Rk in d){if(c){const h=d;d=Te(Gg(),m=>{const b=_x(m,h);c.add(b);const w=Array.from(c);return b.addObserver(()=>c.delete(b)),Zve(w)})}return np(s,d,r,l,!1)}return _O(s,d,r,l)}function o(s,l){r0e(()=>{l===Xve?s.set(n,[0,void 0]):l===Y1?s.set(n,[s.get(n)[0]+1,Y1]):s.set(n,[s.get(n)[0]+1,l]),s.refreshSelf()})}return[a,o,n]}const Zve=e=>v0(t=>{let n=0,r,i;function a(s,l=!1){s._tag==="Failure"?r=r?xfe(s.cause,r):s.cause:r||(i=s),n++,l||o()}function o(){for(;n<e.length;){const s=e[n],l=s.unsafePoll();if(!l)return s.addObserver(a);a(l,!0)}t(r?xr(r):i||xr(Sfe))}return o(),Ct(()=>{n<e.length&&e[n].removeObserver(a)})}),e0e=(e,t,n,r)=>Te(bve(g8(typeof n=="function"?n(e):n)),i=>{const a=ame(1),o=ste(Cde()),s=o.currentContext;let l=Ln();const c=Te(rme(ln(()=>i),lH,s),ti({onLeft:()=>{const h=Lr(l);return Vf(h)?Ht({done:!0,items:h}):Eo(new vh("Atom.pull: no items"))},onRight(h){let m;r!=null&&r.disableAccumulation?m=h:(m=wn(l,h),l=m);const b=Lr(m);return Vf(b)?Ht({done:!1,items:b}):c}})),f=a.withPermits(1)(c),u=vO(HA({context:s,fiberRefs:o.getFiberRefs(),runtimeFlags:Ex.runtimeFlags})),d=new Set;return e.addFinalizer(()=>{for(const h of d)h()}),e.once(t),e.subscribe(t,()=>{e.setSelf(bO(e.self()));let h;h=u(f,m=>{h&&d.delete(h);const b=U9(m,e.self()),w=d.size>0;e.setSelf(w?Fx(b):b)}),h&&d.add(h)}),c}),t0e=(e,t)=>ry(t.read,function(n,r){n.set(e,n.get(e)+1)}),oI=typeof WeakRef>"u"||typeof FinalizationRegistry>"u"?e=>{const t=mk();return function(n){const r=Vo(t,n);if(r._tag==="Some")return r.value;const i=e(n);return wc(t,n,i),i}}:e=>{const t=mk(),n=new FinalizationRegistry(r=>{Gce(t,r)});return function(r){const i=Vo(t,r).pipe(l5(o=>o.deref()));if(i._tag==="Some")return i.value;const a=e(r);return wc(t,r,new WeakRef(a)),n.register(a,r),a}},Ux=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!0}),n0e=T(2,(e,t)=>Vve(e)?ry(t,function(n,r){n.set(e,r)},e.refresh??function(n){n(e)}):io(t,e.refresh??function(n){n(e)})),r0e=Lve,sI="~effect-atom/atom/Atom/ServerValue",i0e=T(2,(e,t)=>sI in e?e[sI](n=>t.get(n)):t.get(e)),Gb=Symbol.for("@effect/platform/HttpApiSchema/AnnotationMultipart"),Yb=Symbol.for("@effect/platform/HttpApiSchema/AnnotationMultipartStream"),rp=Symbol.for("@effect/platform/HttpApiSchema/AnnotationStatus"),Wb=Symbol.for("@effect/platform/HttpApiSchema/AnnotationEmptyDecodeable"),Jb=Symbol.for("@effect/platform/HttpApiSchema/AnnotationEncoding"),Xb=Symbol.for("@effect/platform/HttpApiSchema/AnnotationParam"),G9=e=>{const t={};return rp in e&&(t[rp]=e[rp]),Wb in e&&(t[Wb]=e[Wb]),Jb in e&&(t[Jb]=e[Jb]),Xb in e&&(t[Xb]=e[Xb]),Gb in e&&(t[Gb]=e[Gb]),Yb in e&&(t[Yb]=e[Yb]),t},a0e=e=>e._tag==="Transformation"?{...e.to.annotations,...e.annotations}:e.annotations,iy=(e,t)=>a0e(e)[t],Y9=(e,t)=>iy(e,rp)??t,o0e=e=>iy(e,Wb)??!1,s0e=e=>iy(e,Gb),l0e=e=>iy(e,Yb),c0e={kind:"Json",contentType:"application/json"},Bx=(e,t=c0e)=>iy(e,Jb)??t,u0e=e=>{var n;return(n=(e._tag==="PropertySignatureTransformation"?e.to.annotations:e.annotations)[Xb])==null?void 0:n.name},Fd=e=>{const t=b9(e,"status");return e.status!==void 0&&(t[rp]=e.status),t},tC=e=>{switch(e._tag){case"VoidKeyword":return!0;case"Transformation":return tC(e.from);case"Suspend":return tC(e.f());default:return!1}},f0e=e=>Y9(e,tC(e)?204:200),W1=e=>Y9(e,500),nC=e=>{function t(r){if(Mx(r))for(const i of r.types)t(i);else n.push(r)}const n=[];return t(e),n},W9=(e,t)=>pi.make(Array.from(new Set([...nC(e),...nC(t)]))),kl=(e,t)=>At(W9(e.ast,t.ast)),d0e=e=>Dbe.annotations(Fd({status:e})),rC=d0e(204);class h0e extends hve.annotations({identifier:"Issue",description:"Represents an error encountered while parsing a value to match the schema"}){}class z0 extends L9()("HttpApiDecodeError",{issues:kn(h0e),message:V},Fd({status:400,description:"The request did not match the expected schema"})){static fromParseError(t){return qb.formatError(t).pipe(E0(Xm.formatError(t)),yt(([n,r])=>new z0({issues:n,message:r})))}static refailParseError(t){return Te(z0.fromParseError(t),Eo)}}const lI=Symbol.for("@effect/platform/HttpApi"),m0e={[lI]:lI,pipe(){return he(this,arguments)},add(e){return Ps({identifier:this.identifier,groups:yte(this.groups,e.identifier,e),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},addHttpApi(e){const t={...this.groups};for(const n in e.groups){const r=e.groups[n].annotateContext(mo());r.annotations=ai(e.annotations,r.annotations),r.middlewares=new Set([...e.middlewares,...r.middlewares]),t[n]=r}return Ps({identifier:this.identifier,groups:t,errorSchema:kl(this.errorSchema,e.errorSchema),annotations:this.annotations,middlewares:this.middlewares})},addError(e,t){return Ps({identifier:this.identifier,groups:this.groups,errorSchema:kl(this.errorSchema,t!=null&&t.status?e.annotations(Fd({status:t.status})):e),annotations:this.annotations,middlewares:this.middlewares})},prefix(e){return Ps({identifier:this.identifier,groups:Of(this.groups,t=>t.prefix(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return Ps({identifier:this.identifier,groups:this.groups,errorSchema:kl(this.errorSchema,e.failure),annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return Ps({identifier:this.identifier,groups:this.groups,errorSchema:this.errorSchema,annotations:Yi(this.annotations,e,t),middlewares:this.middlewares})},annotateContext(e){return Ps({identifier:this.identifier,groups:this.groups,errorSchema:this.errorSchema,annotations:ai(this.annotations,e),middlewares:this.middlewares})}},Ps=e=>{function t(){}return Object.setPrototypeOf(t,m0e),t.groups=e.groups,t.errorSchema=e.errorSchema,t.annotations=e.annotations,t.middlewares=e.middlewares,t},p0e=e=>Ps({groups:new Map,errorSchema:z0,annotations:mo(),middlewares:new Set}),g0e=(e,t)=>{const n=Qy(e.errorSchema.ast,new Map,W1),r=Object.values(e.groups);for(const i of r){const a=Qy(i.errorSchema.ast,n,W1),o=ai(e.annotations,i.annotations);t.onGroup({group:i,mergedAnnotations:o});const s=Object.values(i.endpoints);for(const l of s){if(t.predicate&&!t.predicate({endpoint:l,group:i}))continue;const c=Qy(l.errorSchema.ast,a,W1);t.onEndpoint({group:i,endpoint:l,middleware:new Set([...i.middlewares,...l.middlewares]),mergedAnnotations:ai(o,l.annotations),payloads:l.payloadSchema._tag==="Some"?b0e(l.payloadSchema.value.ast):y0e,successes:Qy(l.successSchema.ast,new Map,f0e),errors:c})}}},y0e=new Map,Qy=(e,t,n)=>{const r=new Map(t);function i(a){if(Nye(a))return;const o=G9(e.annotations);gte(o)||(a=_h(a,{...o,...a.annotations}));const s=n(a),l=o0e(a),c=r.get(s);r.set(s,{description:(c?c.description:ne()).pipe(ka(()=>v0e(a))),ast:(c?c.ast:ne()).pipe(ni(f=>W9(f,a)),ka(()=>!l&&Oye(O0(a))?ne():ae(a)))})}return nC(e).forEach(i),r},b0e=e=>{const t=new Map;function n(r){if(r._tag==="NeverKeyword")return;r=_h(r,{...G9(e.annotations),...r.annotations});const i=Bx(r),a=s0e(r)||l0e(r)?"multipart/form-data":i.contentType,o=t.get(a);o===void 0?t.set(a,{encoding:i,ast:r}):o.ast=pi.make([o.ast,r])}if(e._tag==="Union")for(const r of e.types)n(r);else n(e);return t},v0e=e=>{const t="to"in e?{...e.to.annotations,...e.annotations}:e.annotations;return sh(t[Ru]??t[Qg])},Nu=e=>{const t=J9(e),n=[];for(let r=0;r<t.length;r++)if(Array.isArray(t[r][0])){const[i,a]=t[r];n.push([`${i[0]}[${i.slice(1).join("][")}]`,a])}else n.push(t[r]);return n},J9=e=>{const t=Symbol.iterator in e?gt(e):Object.entries(e),n=[];for(const[r,i]of t)if(Array.isArray(i))for(let a=0;a<i.length;a++)i[a]!==void 0&&n.push([r,String(i[a])]);else if(typeof i=="object"){const a=J9(i);for(const[o,s]of a)n.push([[r,...typeof o=="string"?[o]:o],s])}else i!==void 0&&n.push([r,String(i)]);return n},X9=kn(Lbe(V,V)).annotations({identifier:"UrlParams"}),S0e=[],x0e=T(2,(e,t)=>{const n=Nu(t),r=new Set;for(let i=0;i<n.length;i++)r.add(n[i][0]);for(let i=0;i<e.length;i++)r.has(e[i][0])||n.push(e[i]);return n}),w0e=T(2,(e,t)=>yR(e,Nu(t))),_0e=(e,t,n)=>{try{const r=new URL(e,E0e());for(let i=0;i<t.length;i++){const[a,o]=t[i];o!==void 0&&r.searchParams.append(a,o)}return n._tag==="Some"&&(r.hash=n.value),Ne(r)}catch(r){return De(r)}},Q9=e=>new URLSearchParams(e).toString(),E0e=()=>{if("location"in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname},k0e=e=>{const t=Object.create(null);for(const[n,r]of e){const i=t[n];i===void 0?t[n]=r:typeof i=="string"?t[n]=[i,r]:i.push(r)}return{...t}},C0e=Xl(V,X9,{decode(e){return Nu(new URLSearchParams(e))},encode(e){return Q9(e)}}),T0e=e=>Xl(X9,e,{decode(t){return k0e(t)},encode(t){return Nu(t)}}),R0e=e=>Oc(C0e,T0e(e)),Qb=Symbol.for("@effect/platform/HttpBody");var Fz;class EO{constructor(){S(this,Fz);this[Qb]=Qb}[(Fz=Qb,lt)](){return this.toJSON()}toString(){return Rt(this)}}class A0e extends EO{constructor(){super(...arguments);S(this,"_tag","Empty")}toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"Empty"}}}const O0e=new A0e;class M0e extends EO{constructor(n,r){super();S(this,"body");S(this,"contentType");S(this,"_tag","Uint8Array");this.body=n,this.contentType=r}get contentLength(){return this.body.length}toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"Uint8Array",body:this.contentType.startsWith("text/")||this.contentType.endsWith("json")?new TextDecoder().decode(this.body):`Uint8Array(${this.body.length})`,contentType:this.contentType,contentLength:this.contentLength}}}const Z9=(e,t)=>new M0e(e,t??"application/octet-stream"),N0e=new TextEncoder,e7=(e,t)=>Z9(N0e.encode(e),t??"text/plain"),D0e=(e,t)=>e7(Q9(e),t??"application/x-www-form-urlencoded");class j0e extends EO{constructor(n){super();S(this,"formData");S(this,"_tag","FormData");this.formData=n}toJSON(){return{_id:"@effect/platform/HttpBody",_tag:"FormData",formData:this.formData}}}const I0e=e=>new j0e(e),$0e=Qb,L0e=e=>Re(e,$0e),z0e=Z9,cI=e7,P0e=D0e,uI=Symbol.for("@effect/platform/Cookies"),fI=Symbol.for("@effect/platform/Cookies/Cookie"),F0e={[uI]:uI,...OS,toJSON(){return{_id:"@effect/platform/Cookies",cookies:Of(this.cookies,e=>e.toJSON())}},pipe(){return he(this,arguments)}},U0e=e=>{const t=Object.create(F0e);return t.cookies=e,t},B0e=e=>{const t={};for(const n of e)t[n.name]=n;return U0e(t)},H0e=e=>{const t=typeof e=="string"?[e]:e,n=[];for(const r of t){const i=q0e(r.trim());Dt(i)&&n.push(i.value)}return B0e(n)};function q0e(e){const t=e.split(";").map(s=>s.trim()).filter(s=>s!=="");if(t.length===0)return ne();const n=t[0].indexOf("=");if(n===-1)return ne();const r=t[0].slice(0,n);if(!V0e.test(r))return ne();const i=t[0].slice(n+1),a=K0e(i);if(t.length===1)return ae(Object.assign(Object.create(dI),{name:r,value:a,valueEncoded:i}));const o={};for(let s=1;s<t.length;s++){const l=t[s],c=l.indexOf("="),f=c===-1?l:l.slice(0,c).trim(),u=c===-1?void 0:l.slice(c+1).trim();switch(f.toLowerCase()){case"domain":{if(u===void 0)break;const d=u.trim().replace(/^\./,"");d&&(o.domain=d);break}case"expires":{if(u===void 0)break;const d=new Date(u);isNaN(d.getTime())||(o.expires=d);break}case"max-age":{if(u===void 0)break;const d=parseInt(u,10);isNaN(d)||(o.maxAge=V5(d));break}case"path":{if(u===void 0)break;u[0]==="/"&&(o.path=u);break}case"priority":{if(u===void 0)break;switch(u.toLowerCase()){case"low":o.priority="low";break;case"medium":o.priority="medium";break;case"high":o.priority="high";break}break}case"httponly":{o.httpOnly=!0;break}case"secure":{o.secure=!0;break}case"partitioned":{o.partitioned=!0;break}case"samesite":{if(u===void 0)break;switch(u.toLowerCase()){case"lax":o.sameSite="lax";break;case"strict":o.sameSite="strict";break;case"none":o.sameSite="none";break}break}}}return ae(Object.assign(Object.create(dI),{name:r,value:a,valueEncoded:i,options:Object.keys(o).length>0?o:void 0}))}const V0e=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,dI={[fI]:fI,...OS,toJSON(){return{_id:"@effect/platform/Cookies/Cookie",name:this.name,value:this.value,options:this.options}}},K0e=e=>{try{return decodeURIComponent(e)}catch{return e}},hI=Symbol.for("@effect/platform/Headers"),Jp=Object.assign(Object.create(null),{[hI]:hI,[MS](e){return aC(this,cB(e,n7))}}),Hx=e=>Object.assign(Object.create(Jp),e),t7=Object.create(Jp),kO=e=>{if(e===void 0)return t7;if(Symbol.iterator in e){const n=Object.create(Jp);for(const[r,i]of e)n[r.toLowerCase()]=i;return n}const t=Object.create(Jp);for(const[n,r]of Object.entries(e))Array.isArray(r)?t[n.toLowerCase()]=r.join(", "):r!==void 0&&(t[n.toLowerCase()]=r);return t},G0e=e=>Object.setPrototypeOf(e,Jp),iC=T(3,(e,t,n)=>{const r=Hx(e);return r[t.toLowerCase()]=n,r}),Y0e=T(2,(e,t)=>Hx({...e,...kO(t)})),W0e=T(2,(e,t)=>{const n=Hx(e);return Object.assign(n,t),n}),J0e=T(2,(e,t)=>{const n=Hx(e),r=i=>{if(typeof i=="string"){const a=i.toLowerCase();a in e&&delete n[a]}else for(const a in e)i.test(a)&&delete n[a]};if(Array.isArray(t))for(let i=0;i<t.length;i++)r(t[i]);else r(t);return n}),aC=T(2,(e,t)=>{const n={...e},r=i=>{if(typeof i=="string"){const a=i.toLowerCase();a in e&&(n[a]=Bj(e[a]))}else for(const a in e)i.test(a)&&(n[a]=Bj(e[a]))};if(Array.isArray(t))for(let i=0;i<t.length;i++)r(t[i]);else r(t);return n}),n7=je("@effect/platform/Headers/currentRedactedNames",()=>qA(["authorization","cookie","set-cookie","x-api-key"])),X0e=Symbol.for("@effect/platform/HttpClientError"),r7=X0e;class i7 extends z9(r7,"RequestError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return this.description?`${this.reason}: ${this.description} (${this.methodAndUrl})`:`${this.reason} error (${this.methodAndUrl})`}}class Bo extends z9(r7,"ResponseError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){const t=`${this.response.status} ${this.methodAndUrl}`;return this.description?`${this.reason}: ${this.description} (${t})`:`${this.reason} error (${t})`}}const ip=Symbol.for("@effect/platform/HttpIncomingMessage"),Q0e=(e,t)=>{const n=e.headers["content-type"]??"";let r;if(n.includes("application/json"))try{r=Zi(e.json)}catch{}else if(n.includes("text/")||n.includes("urlencoded"))try{r=Zi(e.text)}catch{}const i={...t,headers:aR(e.headers),remoteAddress:e.remoteAddress.toJSON()};return r!==void 0&&(i.body=r),i},Z0e=e=>G0e({b3:`${e.traceId}-${e.spanId}-${e.sampled?"1":"0"}${e.parent._tag==="Some"?`-${e.parent.value.spanId}`:""}`,traceparent:`00-${e.traceId}-${e.spanId}-${e.sampled?"01":"00"}`}),mI=Symbol.for("@effect/platform/HttpClientRequest"),eSe={[mI]:mI,...OS,toJSON(){return{_id:"@effect/platform/HttpClientRequest",method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:aR(this.headers),body:this.body.toJSON()}},pipe(){return he(this,arguments)}};function Ia(e,t,n,r,i,a){const o=Object.create(eSe);return o.method=e,o.url=t,o.urlParams=n,o.hash=r,o.headers=i,o.body=a,o}const tSe=Ia("GET","",S0e,ne(),t7,O0e),Ql=e=>(t,n)=>cSe(tSe,{method:e,url:t,...n??void 0}),nSe=Ql("GET"),rSe=Ql("POST"),iSe=Ql("PUT"),aSe=Ql("PATCH"),oSe=Ql("DELETE"),sSe=Ql("HEAD"),lSe=Ql("OPTIONS"),cSe=T(2,(e,t)=>{let n=e;return t.method&&(n=dSe(n,t.method)),t.url&&(n=o7(n,t.url)),t.headers&&(n=CO(n,t.headers)),t.urlParams&&(n=s7(n,t.urlParams)),t.hash&&(n=pSe(n,t.hash)),t.body&&(n=TO(n,t.body)),t.accept&&(n=a7(n,t.accept)),t.acceptJson&&(n=fSe(n)),n}),uSe=T(3,(e,t,n)=>Ia(e.method,e.url,e.urlParams,e.hash,iC(e.headers,t,n),e.body)),CO=T(2,(e,t)=>Ia(e.method,e.url,e.urlParams,e.hash,Y0e(e.headers,t),e.body)),a7=T(2,(e,t)=>uSe(e,"Accept",t)),fSe=a7("application/json"),dSe=T(2,(e,t)=>Ia(t,e.url,e.urlParams,e.hash,e.headers,e.body)),o7=T(2,(e,t)=>{if(typeof t=="string")return Ia(e.method,t,e.urlParams,e.hash,e.headers,e.body);const n=new URL(t.toString()),r=Nu(n.searchParams),i=n.hash?ae(n.hash.slice(1)):ne();return n.search="",n.hash="",Ia(e.method,n.toString(),r,i,e.headers,e.body)}),hSe=T(2,(e,t)=>Ia(e.method,t.endsWith("/")&&e.url.startsWith("/")?t+e.url.slice(1):t+e.url,e.urlParams,e.hash,e.headers,e.body)),mSe=T(2,(e,t)=>Ia(e.method,e.url,w0e(e.urlParams,t),e.hash,e.headers,e.body)),s7=T(2,(e,t)=>Ia(e.method,e.url,x0e(e.urlParams,t),e.hash,e.headers,e.body)),pSe=T(2,(e,t)=>Ia(e.method,e.url,e.urlParams,ae(t),e.headers,e.body)),TO=T(2,(e,t)=>{let n=e.headers;if(t._tag==="Empty"||t._tag==="FormData")n=J0e(n,["Content-type","Content-length"]);else{const r=t.contentType;r&&(n=iC(n,"content-type",r));const i=t.contentLength;i&&(n=iC(n,"content-length",i.toString()))}return Ia(e.method,e.url,e.urlParams,e.hash,n,t)}),gSe=T(2,(e,t)=>TO(e,I0e(t))),ap=Symbol.for("@effect/platform/HttpClientResponse"),ySe=(e,t)=>new bSe(e,t);var Uz,Bz,Hz;class bSe extends(Hz=tee,Bz=ip,Uz=ap,Hz){constructor(n,r){super();S(this,"request");S(this,"source");S(this,Bz);S(this,Uz);S(this,"cachedCookies");S(this,"textBody");S(this,"formDataBody");S(this,"arrayBufferBody");this.request=n,this.source=r,this[ip]=ip,this[ap]=ap}toJSON(){return Q0e(this,{_id:"@effect/platform/HttpClientResponse",request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get headers(){return kO(this.source.headers)}get cookies(){return this.cachedCookies?this.cachedCookies:this.cachedCookies=H0e(this.source.headers.getSetCookie())}get remoteAddress(){return ne()}get stream(){return this.source.body?qge(()=>this.source.body,n=>new Bo({request:this.request,response:this,reason:"Decode",cause:n})):Pge(new Bo({request:this.request,response:this,reason:"EmptyBody",description:"can not create stream from empty body"}))}get json(){return Yhe(this.text,{try:n=>n===""?null:JSON.parse(n),catch:n=>new Bo({request:this.request,response:this,reason:"Decode",cause:n})})}get text(){return this.textBody??(this.textBody=Ym({try:()=>this.source.text(),catch:n=>new Bo({request:this.request,response:this,reason:"Decode",cause:n})}).pipe(C1,Zi))}get urlParamsBody(){return Te(this.text,n=>Ghe({try:()=>Nu(new URLSearchParams(n)),catch:r=>new Bo({request:this.request,response:this,reason:"Decode",cause:r})}))}get formData(){return this.formDataBody??(this.formDataBody=Ym({try:()=>this.source.formData(),catch:n=>new Bo({request:this.request,response:this,reason:"Decode",cause:n})}).pipe(C1,Zi))}get arrayBuffer(){return this.arrayBufferBody??(this.arrayBufferBody=Ym({try:()=>this.source.arrayBuffer(),catch:n=>new Bo({request:this.request,response:this,reason:"Decode",cause:n})}).pipe(C1,Zi))}}const vSe=T(2,(e,t)=>{const n=e.status;return t[n]?t[n](e):n>=200&&n<300&&t["2xx"]?t["2xx"](e):n>=300&&n<400&&t["3xx"]?t["3xx"](e):n>=400&&n<500&&t["4xx"]?t["4xx"](e):n>=500&&n<600&&t["5xx"]?t["5xx"](e):t.orElse(e)}),SSe=e=>`http.request.header.${e}`,xSe="http.request.method",wSe=e=>`http.response.header.${e}`,_Se="http.response.status_code",ESe="server.address",kSe="server.port",CSe="url.full",TSe="url.path",RSe="url.scheme",ASe="url.query",pI=Symbol.for("@effect/platform/HttpClient"),RO=Gl("@effect/platform/HttpClient"),OSe=je(Symbol.for("@effect/platform/HttpClient/tracerDisabledWhen"),()=>qA(pl)),MSe=je(Symbol.for("@effect/platform/HttpClient/currentTracerPropagation"),()=>qA(!0)),NSe=oh()("@effect/platform/HttpClient/SpanNameGenerator",{defaultValue:()=>e=>`http.client ${e.method}`}),DSe={[pI]:pI,pipe(){return he(this,arguments)},...OS,toJSON(){return{_id:"@effect/platform/HttpClient"}},get(e,t){return this.execute(nSe(e,t))},head(e,t){return this.execute(sSe(e,t))},post(e,t){return this.execute(rSe(e,t))},put(e,t){return this.execute(iSe(e,t))},patch(e,t){return this.execute(aSe(e,t))},del(e,t){return this.execute(oSe(e,t))},options(e,t){return this.execute(lSe(e,t))}},AO=(e,t)=>{const n=Object.create(DSe);return n.preprocess=t,n.postprocess=e,n.execute=function(r){return e(t(r))},n},P0=je("@effect/platform/HttpClient/responseRegistry",()=>{if("FinalizationRegistry"in globalThis&&globalThis.FinalizationRegistry){const t=new FinalizationRegistry(n=>{n.abort()});return{register(n,r){t.register(n,r,n)},unregister(n){t.unregister(n)}}}const e=new Map;return{register(t,n){e.set(t,setTimeout(()=>n.abort(),5e3))},unregister(t){const n=e.get(t);n!==void 0&&(clearTimeout(n),e.delete(t))}}}),jSe=je("@effect/platform/HttpClient/scopedRequests",()=>new WeakMap),ISe=e=>AO(t=>Te(t,n=>S0(r=>{const i=jSe.get(n),a=i??new AbortController,o=_0e(n.url,n.urlParams,n.hash);if(o._tag==="Left")return Eo(new i7({request:n,reason:"InvalidUrl",cause:o.left}));const s=o.right;if(!r.getFiberRef(Eme)||r.getFiberRef(OSe)(n)){const f=e(n,s,a.signal,r);return i?f:x0(u=>xa(u(f),{onSuccess(d){return P0.register(d,a),Ht(new gI(d,a))},onFailure(d){return m0(d)&&a.abort(),Ca(d)}}))}const c=ls(r.currentContext,NSe);return ume(c(n),{kind:"client",captureStackTrace:!1},f=>{f.attribute(xSe,n.method),f.attribute(ESe,s.origin),s.port!==""&&f.attribute(kSe,+s.port),f.attribute(CSe,s.toString()),f.attribute(TSe,s.pathname),f.attribute(RSe,s.protocol.slice(0,-1));const u=s.search.slice(1);u!==""&&f.attribute(ASe,u);const d=r.getFiberRef(n7),h=aC(n.headers,d);for(const m in h)f.attribute(SSe(m),String(h[m]));return n=r.getFiberRef(MSe)?CO(n,Z0e(f)):n,x0(m=>m(e(n,s,a.signal,r)).pipe(fme(f),xa({onSuccess:b=>{f.attribute(_Se,b.status);const w=aC(b.headers,d);for(const g in w)f.attribute(wSe(g),String(w[g]));return i?Ht(b):(P0.register(b,a),Ht(new gI(b,a)))},onFailure(b){return!i&&m0(b)&&a.abort(),Ca(b)}})))})})),Ht);var qz,Vz;class gI{constructor(t,n){S(this,"original");S(this,"controller");S(this,Vz,ap);S(this,qz,ip);this.original=t,this.controller=n}applyInterrupt(t){return ln(()=>(P0.unregister(this.original),Whe(t,()=>Ct(()=>{this.controller.abort()}))))}get request(){return this.original.request}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get stream(){return Gge(()=>(P0.unregister(this.original),p8(this.original.stream,Ct(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[(Vz=ap,qz=ip,lt)](){return this.original[lt]()}}const{del:MLe,execute:NLe,get:DLe,head:jLe,options:ILe,patch:$Le,post:LLe,put:zLe}=tme(RO),$Se=T(2,(e,t)=>{const n=e;return AO(r=>t(n.postprocess(r)),n.preprocess)}),LSe=T(2,(e,t)=>{const n=e;return AO(n.postprocess,r=>yt(n.preprocess(r),t))}),zSe=e=>wme(RO,Te(Q6(),t=>yt(e,n=>$Se(n,Z6(r=>ai(t,r)))))),PSe=RO,FSe=LSe,USe=Ql,BSe=CO,HSe=o7,qSe=hSe,VSe=s7,KSe=mSe,GSe=TO,YSe=gSe,WSe=vSe,yI=e=>e!=="GET"&&e!=="HEAD"&&e!=="OPTIONS",JSe=(e,t)=>Xf(function*(){const n=yield*Q6(),r=t.httpClient.pipe((t==null?void 0:t.baseUrl)===void 0?ke:FSe(qSe(t.baseUrl.toString())));g0e(e,{predicate:t==null?void 0:t.predicate,onGroup(i){var a;(a=t.onGroup)==null||a.call(t,i)},onEndpoint(i){const{endpoint:a,errors:o,successes:s}=i,l=exe(a.path),c={orElse:ixe},f=WSe(c);o.forEach(({ast:w},g)=>{if(w._tag==="None"){c[g]=axe;return}const v=bI(w.value);c[g]=x=>Te(v(x),Eo)}),s.forEach(({ast:w},g)=>{c[g]=w._tag==="None"?oxe:bI(w.value)});const u=a.pathSchema.pipe(ni(Zh)),d=a.payloadSchema.pipe(ni(w=>yI(a.method)?Zh(lxe(w)):Zh(w))),h=a.headersSchema.pipe(ni(Zh)),m=a.urlParamsSchema.pipe(ni(Zh)),b=iH(function*(w){let g=USe(a.method)(a.path);if(w&&w.path){const E=u._tag==="Some"?yield*u.value(w.path):w.path;g=HSe(g,l(E))}if(w&&w.payload instanceof FormData)g=YSe(g,w.payload);else if(d._tag==="Some")if(yI(a.method)){const E=yield*d.value(w.payload);g=GSe(g,E)}else{const E=yield*d.value(w.payload);g=VSe(g,E)}h._tag==="Some"&&(g=BSe(g,yield*h.value(w.headers))),m._tag==="Some"&&(g=KSe(g,yield*m.value(w.urlParams)));const v=yield*r.execute(g),x=yield*t.transformResponse===void 0?f(v):t.transformResponse(f(v));return(w==null?void 0:w.withResponse)===!0?[x,v]:x},Z6(w=>ai(n,w)));t.onEndpoint({...i,endpointFn:b})}})}),XSe=(e,t)=>Te(PSe,n=>QSe(e,{...t,httpClient:t!=null&&t.transformClient?t.transformClient(n):n})),QSe=(e,t)=>{const n={};return JSe(e,{...t,onGroup({group:r}){r.topLevel||(n[r.identifier]={})},onEndpoint({endpoint:r,endpointFn:i,group:a}){(a.topLevel?n:n[a.identifier])[r.name]=i}}).pipe(yt(()=>n))},ZSe=/:(\w+)\??/g,exe=e=>{const t=e.split(ZSe),n=t.length;return n===1?r=>e:r=>{let i=t[0];for(let a=1;a<n;a++)a%2===0?i+=t[a]:i+=r[t[a]];return i}},bI=e=>{const t=Bx(e),n=Abe(l7(e,t));return r=>Te(r.arrayBuffer,n)},txe=Xl(Ix,tve,{decode(e){return new Uint8Array(e)},encode(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}}),oC=Xl(Ix,V,{decode(e){return new TextDecoder().decode(e)},encode(e){const t=new TextEncoder().encode(e);return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}}),nxe=zl(V,Ix,{strict:!0,decode:(e,t,n)=>e===""?wr(void 0):M0({try:()=>JSON.parse(e),catch:()=>new rn(n,e,"Could not parse JSON")}),encode:(e,t,n)=>e===void 0?wr(""):M0({try:()=>JSON.stringify(e),catch:()=>new rn(n,e,"Could not encode as JSON")})}),rxe=Oc(oC,nxe),l7=(e,t)=>{if(e._tag==="Union")return Mu(...e.types.map(r=>l7(r,Bx(r,t))));const n=At(e);switch(t.kind){case"Json":return Oc(rxe,n);case"UrlParams":return Oc(oC,R0e(n));case"Uint8Array":return Oc(txe,n);case"Text":return Oc(oC,n)}},ixe=e=>Eo(new Bo({reason:"Decode",request:e.request,response:e})),axe=e=>Eo(new Bo({reason:"StatusCode",request:e.request,response:e})),oxe=e=>ot,sxe=Eh(L0e),lxe=e=>{const t=e.ast._tag==="Union"?e.ast.types:[e.ast];return Mu(...t.map(cxe))},J1=je("@effect/platform/HttpApiClient/bodyFromPayloadCache",()=>new WeakMap),cxe=e=>{if(J1.has(e))return J1.get(e);const t=At(e),n=Bx(e),r=zl(sxe,t,{decode(i,a,o){return rs(new Vk(o,i,"encode only schema"))},encode(i,a,o){switch(n.kind){case"Json":try{return wr(cI(JSON.stringify(i),n.contentType))}catch{return rs(new rn(o,i,"Could not encode as JSON"))}case"Text":return typeof i!="string"?rs(new rn(o,i,"Expected a string")):wr(cI(i,n.contentType));case"UrlParams":return wr(P0e(Nu(i)));case"Uint8Array":return i instanceof Uint8Array?wr(z0e(i,n.contentType)):rs(new rn(o,i,"Expected a Uint8Array"))}}});return J1.set(e,r),r},uxe=e=>{if(Array.isArray(e))return ij(e);const t=Object.create(the.prototype);for(const n in e){const r=e[n];Array.isArray(r)&&(t[n]=ij(r))}return t},fxe=()=>(e,t)=>{const n=hR(e)();n.layer=oH(n,XSe(t.api,t)).pipe(sH(t.httpClient));const r=t.runtime??wO;n.runtime=r(n.layer);const i=oI(({endpoint:o,group:s,withResponse:l})=>n.runtime.fn()(iH(function*(c){const u=(yield*n)[s][o]({...c,withResponse:l});return yield*c.reactivityKeys?b8(u,c.reactivityKeys):u})));n.mutation=(o,s,l)=>i(new dxe({group:o,endpoint:s,withResponse:(l==null?void 0:l.withResponse)??!1}));const a=oI(o=>{let s=n.runtime.atom(Te(n,l=>l[o.group][o.endpoint](o)));return o.timeToLive&&(s=q5(o.timeToLive)?V9(s,o.timeToLive):Ux(s)),o.reactivityKeys?n.runtime.factory.withReactivity(o.reactivityKeys)(s):s});return n.query=(o,s,l)=>a(new hxe({group:o,endpoint:s,path:l.path&&pm(l.path),urlParams:l.urlParams&&pm(l.urlParams),payload:l.payload&&pm(l.payload),headers:l.headers&&pm(l.headers),withResponse:l.withResponse??!1,reactivityKeys:l.reactivityKeys?uxe(l.reactivityKeys):void 0,timeToLive:l.timeToLive?ra(l.timeToLive):void 0})),n};class dxe extends MA{[ze](t){return this.group===t.group&&this.endpoint===t.endpoint&&this.withResponse===t.withResponse}[Le](){return N(Bt(`${this.group}/${this.endpoint}/${this.withResponse}`),_t(this))}}class hxe extends MA{[ze](t){return this.group===t.group&&this.endpoint===t.endpoint&&Se(this.path,t.path)&&Se(this.urlParams,t.urlParams)&&Se(this.payload,t.payload)&&Se(this.headers,t.headers)&&Se(this.withResponse,t.withResponse)&&Se(this.reactivityKeys,t.reactivityKeys)&&Se(this.timeToLive,t.timeToLive)}[Le](){return N(Bt(`${this.group}/${this.endpoint}`),Pe(de(this.path)),Pe(de(this.urlParams)),Pe(de(this.payload)),Pe(de(this.headers)),Pe(de(this.withResponse)),Pe(de(this.reactivityKeys)),Pe(de(this.timeToLive)),_t(this))}}const mxe=Symbol.for("@effect/matcher/Matcher"),pxe={[mxe]:{_input:ke,_filters:ke,_remaining:ke,_result:ke,_provided:ke,_return:ke},_tag:"ValueMatcher",add(e){return this.value._tag==="Right"?this:e._tag==="When"&&e.guard(this.provided)===!0?sC(this.provided,Ne(e.evaluate(this.provided))):e._tag==="Not"&&e.guard(this.provided)===!1?sC(this.provided,Ne(e.evaluate(this.provided))):this},pipe(){return he(this,arguments)}};function sC(e,t){const n=Object.create(pxe);return n.provided=e,n.value=t,n}const gxe=(e,t)=>({_tag:"When",guard:e,evaluate:t}),lC=e=>{if(typeof e=="function")return e;if(Array.isArray(e)){const t=e.map(lC),n=t.length;return r=>{if(!Array.isArray(r))return!1;for(let i=0;i<n;i++)if(t[i](r[i])===!1)return!1;return!0}}else if(e!==null&&typeof e=="object"){const t=Object.entries(e).map(([r,i])=>[r,lC(i)]),n=t.length;return r=>{if(typeof r!="object"||r===null)return!1;for(let i=0;i<n;i++){const[a,o]=t[i];if(!(a in r)||o(r[a])===!1)return!1}return!0}}return t=>t===e},yxe=e=>sC(e,De(e)),bxe=(e,t)=>n=>n.add(gxe(lC(e),t)),vxe=e=>t=>{const n=Sxe(t);return t5(n)?n._tag==="Right"?n.right:e(n.left):r=>{const i=n(r);return i._tag==="Right"?i.right:e(i.left)}},Sxe=e=>{if(e._tag==="ValueMatcher")return e.value;const t=e.cases.length;if(t===1){const n=e.cases[0];return r=>n._tag==="When"&&n.guard(r)===!0||n._tag==="Not"&&n.guard(r)===!1?Ne(n.evaluate(r)):De(r)}return n=>{for(let r=0;r<t;r++){const i=e.cases[r];if(i._tag==="When"&&i.guard(n)===!0)return Ne(i.evaluate(n));if(i._tag==="Not"&&i.guard(n)===!1)return Ne(i.evaluate(n))}return De(n)}},c7=yxe,op=bxe,u7=vxe;function xxe(e){M_.unstable_scheduleCallback(M_.unstable_LowPriority,e)}const OO=y.createContext(Uve({scheduleTask:xxe,defaultIdleTTL:400})),vI=je("@effect-atom/atom-react/storeRegistry",()=>new WeakMap);function wxe(e,t){let n=vI.get(e);n===void 0&&(n=new WeakMap,vI.set(e,n));const r=n.get(t);if(r!==void 0)return r;const i={subscribe(a){return e.subscribe(t,a)},snapshot(){return e.get(t)},getServerSnapshot(){return i0e(t,e)}};return n.set(t,i),i}function f7(e,t){const n=wxe(e,t);return y.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}const zr=(e,t)=>{const n=y.useContext(OO);return f7(n,e)};function _xe(e,t){y.useEffect(()=>e.mount(t),[t,e])}function d7(e,t,n){return(n==null?void 0:n.mode)==="promise"||(n==null?void 0:n.mode)==="promiseExit"?y.useCallback(r=>{e.set(t,r);const i=cme(Bve(e,t,{suspendOnWaiting:!0}));return n.mode==="promise"?i.then(Exe):i},[e,t,n.mode]):y.useCallback(r=>{e.set(t,typeof r=="function"?r(e.get(t)):r)},[e,t])}const Exe=e=>{if(FB(e))return e.value;throw TA(e.cause)},un=(e,t)=>{const n=y.useContext(OO);return _xe(n,e),d7(n,e,t)},kxe=(e,t)=>{const n=y.useContext(OO);return[f7(n,e),d7(n,e,t)]};function Cxe(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Txe=e=>{switch(e){case"success":return Oxe;case"info":return Nxe;case"warning":return Mxe;case"error":return Dxe;default:return null}},Rxe=Array(12).fill(0),Axe=({visible:e,className:t})=>ee.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ee.createElement("div",{className:"sonner-spinner"},Rxe.map((n,r)=>ee.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Oxe=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Mxe=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Nxe=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Dxe=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ee.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),jxe=ee.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ee.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ee.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ixe=()=>{const[e,t]=ee.useState(document.hidden);return ee.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let cC=1;class $xe{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,a=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:cC++,o=this.toasts.find(l=>l.id===a),s=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...t,id:a,title:r}),{...l,...t,id:a,dismissible:s,title:r}):l):this.addToast({title:r,...i,dismissible:s,id:a}),a},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let a=r!==void 0,o;const s=i.then(async c=>{if(o=["resolve",c],ee.isValidElement(c))a=!1,this.create({id:r,type:"default",message:c});else if(zxe(c)&&!c.ok){a=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,d=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,m=typeof u=="object"&&!ee.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:d,...m})}else if(c instanceof Error){a=!1;const u=typeof n.error=="function"?await n.error(c):n.error,d=typeof n.description=="function"?await n.description(c):n.description,m=typeof u=="object"&&!ee.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:d,...m})}else if(n.success!==void 0){a=!1;const u=typeof n.success=="function"?await n.success(c):n.success,d=typeof n.description=="function"?await n.description(c):n.description,m=typeof u=="object"&&!ee.isValidElement(u)?u:{message:u};this.create({id:r,type:"success",description:d,...m})}}).catch(async c=>{if(o=["reject",c],n.error!==void 0){a=!1;const f=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,h=typeof f=="object"&&!ee.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:u,...h})}}).finally(()=>{a&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,f)=>s.then(()=>o[0]==="reject"?f(o[1]):c(o[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||cC++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Xr=new $xe,Lxe=(e,t)=>{const n=(t==null?void 0:t.id)||cC++;return Xr.addToast({title:e,...t,id:n}),n},zxe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Pxe=Lxe,Fxe=()=>Xr.toasts,Uxe=()=>Xr.getActiveToasts(),Bxe=Object.assign(Pxe,{success:Xr.success,info:Xr.info,warning:Xr.warning,error:Xr.error,custom:Xr.custom,message:Xr.message,promise:Xr.promise,dismiss:Xr.dismiss,loading:Xr.loading},{getHistory:Fxe,getToasts:Uxe});Cxe("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Zy(e){return e.label!==void 0}const Hxe=3,qxe="24px",Vxe="16px",SI=4e3,Kxe=356,Gxe=14,Yxe=45,Wxe=200;function qa(...e){return e.filter(Boolean).join(" ")}function Jxe(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Xxe=e=>{var t,n,r,i,a,o,s,l,c;const{invert:f,toast:u,unstyled:d,interacting:h,setHeights:m,visibleToasts:b,heights:w,index:g,toasts:v,expanded:x,removeToast:E,defaultRichColors:C,closeButton:k,style:_,cancelButtonStyle:A,actionButtonStyle:I,className:O="",descriptionClassName:z="",duration:U,position:J,gap:Y,expandByDefault:F,classNames:D,icons:P,closeButtonAriaLabel:$="Close toast"}=e,[q,M]=ee.useState(null),[ue,H]=ee.useState(null),[R,X]=ee.useState(!1),[G,se]=ee.useState(!1),[Q,oe]=ee.useState(!1),[ye,Ae]=ee.useState(!1),[Fe,ve]=ee.useState(!1),[Yt,Rn]=ee.useState(0),[Ni,An]=ee.useState(0),mr=ee.useRef(u.duration||U||SI),Ns=ee.useRef(null),hn=ee.useRef(null),zu=g===0,Dh=g+1<=b,Xn=u.type,Ba=u.dismissible!==!1,sa=u.className||"",Ro=u.descriptionClassName||"",K=ee.useMemo(()=>w.findIndex(Ue=>Ue.toastId===u.id)||0,[w,u.id]),le=ee.useMemo(()=>{var Ue;return(Ue=u.closeButton)!=null?Ue:k},[u.closeButton,k]),we=ee.useMemo(()=>u.duration||U||SI,[u.duration,U]),Ie=ee.useRef(0),et=ee.useRef(0),pr=ee.useRef(0),Fn=ee.useRef(null),[ci,Qn]=J.split("-"),la=ee.useMemo(()=>w.reduce((Ue,mn,Mn)=>Mn>=K?Ue:Ue+mn.height,0),[w,K]),On=Ixe(),ca=u.invert||f,Tr=Xn==="loading";et.current=ee.useMemo(()=>K*Y+la,[K,la]),ee.useEffect(()=>{mr.current=we},[we]),ee.useEffect(()=>{X(!0)},[]),ee.useEffect(()=>{const Ue=hn.current;if(Ue){const mn=Ue.getBoundingClientRect().height;return An(mn),m(Mn=>[{toastId:u.id,height:mn,position:u.position},...Mn]),()=>m(Mn=>Mn.filter(Un=>Un.toastId!==u.id))}},[m,u.id]),ee.useLayoutEffect(()=>{if(!R)return;const Ue=hn.current,mn=Ue.style.height;Ue.style.height="auto";const Mn=Ue.getBoundingClientRect().height;Ue.style.height=mn,An(Mn),m(Un=>Un.find(pn=>pn.toastId===u.id)?Un.map(pn=>pn.toastId===u.id?{...pn,height:Mn}:pn):[{toastId:u.id,height:Mn,position:u.position},...Un])},[R,u.title,u.description,m,u.id,u.jsx,u.action,u.cancel]);const ua=ee.useCallback(()=>{se(!0),Rn(et.current),m(Ue=>Ue.filter(mn=>mn.toastId!==u.id)),setTimeout(()=>{E(u)},Wxe)},[u,E,m,et]);ee.useEffect(()=>{if(u.promise&&Xn==="loading"||u.duration===1/0||u.type==="loading")return;let Ue;return x||h||On?(()=>{if(pr.current<Ie.current){const Un=new Date().getTime()-Ie.current;mr.current=mr.current-Un}pr.current=new Date().getTime()})():(()=>{mr.current!==1/0&&(Ie.current=new Date().getTime(),Ue=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),ua()},mr.current))})(),()=>clearTimeout(Ue)},[x,h,u,Xn,On,ua]),ee.useEffect(()=>{u.delete&&(ua(),u.onDismiss==null||u.onDismiss.call(u,u))},[ua,u.delete]);function Pu(){var Ue;if(P!=null&&P.loading){var mn;return ee.createElement("div",{className:qa(D==null?void 0:D.loader,u==null||(mn=u.classNames)==null?void 0:mn.loader,"sonner-loader"),"data-visible":Xn==="loading"},P.loading)}return ee.createElement(Axe,{className:qa(D==null?void 0:D.loader,u==null||(Ue=u.classNames)==null?void 0:Ue.loader),visible:Xn==="loading"})}const py=u.icon||(P==null?void 0:P[Xn])||Txe(Xn);var Fu,gy;return ee.createElement("li",{tabIndex:0,ref:hn,className:qa(O,sa,D==null?void 0:D.toast,u==null||(t=u.classNames)==null?void 0:t.toast,D==null?void 0:D.default,D==null?void 0:D[Xn],u==null||(n=u.classNames)==null?void 0:n[Xn]),"data-sonner-toast":"","data-rich-colors":(Fu=u.richColors)!=null?Fu:C,"data-styled":!(u.jsx||u.unstyled||d),"data-mounted":R,"data-promise":!!u.promise,"data-swiped":Fe,"data-removed":G,"data-visible":Dh,"data-y-position":ci,"data-x-position":Qn,"data-index":g,"data-front":zu,"data-swiping":Q,"data-dismissible":Ba,"data-type":Xn,"data-invert":ca,"data-swipe-out":ye,"data-swipe-direction":ue,"data-expanded":!!(x||F&&R),"data-testid":u.testId,style:{"--index":g,"--toasts-before":g,"--z-index":v.length-g,"--offset":`${G?Yt:et.current}px`,"--initial-height":F?"auto":`${Ni}px`,..._,...u.style},onDragEnd:()=>{oe(!1),M(null),Fn.current=null},onPointerDown:Ue=>{Ue.button!==2&&(Tr||!Ba||(Ns.current=new Date,Rn(et.current),Ue.target.setPointerCapture(Ue.pointerId),Ue.target.tagName!=="BUTTON"&&(oe(!0),Fn.current={x:Ue.clientX,y:Ue.clientY})))},onPointerUp:()=>{var Ue,mn,Mn;if(ye||!Ba)return;Fn.current=null;const Un=Number(((Ue=hn.current)==null?void 0:Ue.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ao=Number(((mn=hn.current)==null?void 0:mn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),pn=new Date().getTime()-((Mn=Ns.current)==null?void 0:Mn.getTime()),Vr=q==="x"?Un:Ao,Uu=Math.abs(Vr)/pn;if(Math.abs(Vr)>=Yxe||Uu>.11){Rn(et.current),u.onDismiss==null||u.onDismiss.call(u,u),H(q==="x"?Un>0?"right":"left":Ao>0?"down":"up"),ua(),Ae(!0);return}else{var j,L;(j=hn.current)==null||j.style.setProperty("--swipe-amount-x","0px"),(L=hn.current)==null||L.style.setProperty("--swipe-amount-y","0px")}ve(!1),oe(!1),M(null)},onPointerMove:Ue=>{var mn,Mn,Un;if(!Fn.current||!Ba||((mn=window.getSelection())==null?void 0:mn.toString().length)>0)return;const pn=Ue.clientY-Fn.current.y,Vr=Ue.clientX-Fn.current.x;var Uu;const j=(Uu=e.swipeDirections)!=null?Uu:Jxe(J);!q&&(Math.abs(Vr)>1||Math.abs(pn)>1)&&M(Math.abs(Vr)>Math.abs(pn)?"x":"y");let L={x:0,y:0};const B=Z=>1/(1.5+Math.abs(Z)/20);if(q==="y"){if(j.includes("top")||j.includes("bottom"))if(j.includes("top")&&pn<0||j.includes("bottom")&&pn>0)L.y=pn;else{const Z=pn*B(pn);L.y=Math.abs(Z)<Math.abs(pn)?Z:pn}}else if(q==="x"&&(j.includes("left")||j.includes("right")))if(j.includes("left")&&Vr<0||j.includes("right")&&Vr>0)L.x=Vr;else{const Z=Vr*B(Vr);L.x=Math.abs(Z)<Math.abs(Vr)?Z:Vr}(Math.abs(L.x)>0||Math.abs(L.y)>0)&&ve(!0),(Mn=hn.current)==null||Mn.style.setProperty("--swipe-amount-x",`${L.x}px`),(Un=hn.current)==null||Un.style.setProperty("--swipe-amount-y",`${L.y}px`)}},le&&!u.jsx&&Xn!=="loading"?ee.createElement("button",{"aria-label":$,"data-disabled":Tr,"data-close-button":!0,onClick:Tr||!Ba?()=>{}:()=>{ua(),u.onDismiss==null||u.onDismiss.call(u,u)},className:qa(D==null?void 0:D.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(gy=P==null?void 0:P.close)!=null?gy:jxe):null,(Xn||u.icon||u.promise)&&u.icon!==null&&((P==null?void 0:P[Xn])!==null||u.icon)?ee.createElement("div",{"data-icon":"",className:qa(D==null?void 0:D.icon,u==null||(i=u.classNames)==null?void 0:i.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||Pu():null,u.type!=="loading"?py:null):null,ee.createElement("div",{"data-content":"",className:qa(D==null?void 0:D.content,u==null||(a=u.classNames)==null?void 0:a.content)},ee.createElement("div",{"data-title":"",className:qa(D==null?void 0:D.title,u==null||(o=u.classNames)==null?void 0:o.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?ee.createElement("div",{"data-description":"",className:qa(z,Ro,D==null?void 0:D.description,u==null||(s=u.classNames)==null?void 0:s.description)},typeof u.description=="function"?u.description():u.description):null),ee.isValidElement(u.cancel)?u.cancel:u.cancel&&Zy(u.cancel)?ee.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||A,onClick:Ue=>{Zy(u.cancel)&&Ba&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,Ue),ua())},className:qa(D==null?void 0:D.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,ee.isValidElement(u.action)?u.action:u.action&&Zy(u.action)?ee.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||I,onClick:Ue=>{Zy(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,Ue),!Ue.defaultPrevented&&ua())},className:qa(D==null?void 0:D.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function xI(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Qxe(e,t){const n={};return[e,t].forEach((r,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",s=a?Vxe:qxe;function l(c){["top","right","bottom","left"].forEach(f=>{n[`${o}-${f}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${o}-${c}`]=s:n[`${o}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(s)}),n}const Zxe=ee.forwardRef(function(t,n){const{id:r,invert:i,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:s,closeButton:l,className:c,offset:f,mobileOffset:u,theme:d="light",richColors:h,duration:m,style:b,visibleToasts:w=Hxe,toastOptions:g,dir:v=xI(),gap:x=Gxe,icons:E,containerAriaLabel:C="Notifications"}=t,[k,_]=ee.useState([]),A=ee.useMemo(()=>r?k.filter(R=>R.toasterId===r):k.filter(R=>!R.toasterId),[k,r]),I=ee.useMemo(()=>Array.from(new Set([a].concat(A.filter(R=>R.position).map(R=>R.position)))),[A,a]),[O,z]=ee.useState([]),[U,J]=ee.useState(!1),[Y,F]=ee.useState(!1),[D,P]=ee.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ee.useRef(null),q=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=ee.useRef(null),ue=ee.useRef(!1),H=ee.useCallback(R=>{_(X=>{var G;return(G=X.find(se=>se.id===R.id))!=null&&G.delete||Xr.dismiss(R.id),X.filter(({id:se})=>se!==R.id)})},[]);return ee.useEffect(()=>Xr.subscribe(R=>{if(R.dismiss){requestAnimationFrame(()=>{_(X=>X.map(G=>G.id===R.id?{...G,delete:!0}:G))});return}setTimeout(()=>{sP.flushSync(()=>{_(X=>{const G=X.findIndex(se=>se.id===R.id);return G!==-1?[...X.slice(0,G),{...X[G],...R},...X.slice(G+1)]:[R,...X]})})})}),[k]),ee.useEffect(()=>{if(d!=="system"){P(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;const R=window.matchMedia("(prefers-color-scheme: dark)");try{R.addEventListener("change",({matches:X})=>{P(X?"dark":"light")})}catch{R.addListener(({matches:G})=>{try{P(G?"dark":"light")}catch(se){console.error(se)}})}},[d]),ee.useEffect(()=>{k.length<=1&&J(!1)},[k]),ee.useEffect(()=>{const R=X=>{var G;if(o.every(oe=>X[oe]||X.code===oe)){var Q;J(!0),(Q=$.current)==null||Q.focus()}X.code==="Escape"&&(document.activeElement===$.current||(G=$.current)!=null&&G.contains(document.activeElement))&&J(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[o]),ee.useEffect(()=>{if($.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,ue.current=!1)}},[$.current]),ee.createElement("section",{ref:n,"aria-label":`${C} ${q}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((R,X)=>{var G;const[se,Q]=R.split("-");return A.length?ee.createElement("ol",{key:R,dir:v==="auto"?xI():v,tabIndex:-1,ref:$,className:c,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":se,"data-x-position":Q,style:{"--front-toast-height":`${((G=O[0])==null?void 0:G.height)||0}px`,"--width":`${Kxe}px`,"--gap":`${x}px`,...b,...Qxe(f,u)},onBlur:oe=>{ue.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(ue.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||ue.current||(ue.current=!0,M.current=oe.relatedTarget)},onMouseEnter:()=>J(!0),onMouseMove:()=>J(!0),onMouseLeave:()=>{Y||J(!1)},onDragEnd:()=>J(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},A.filter(oe=>!oe.position&&X===0||oe.position===R).map((oe,ye)=>{var Ae,Fe;return ee.createElement(Xxe,{key:oe.id,icons:E,index:ye,toast:oe,defaultRichColors:h,duration:(Ae=g==null?void 0:g.duration)!=null?Ae:m,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:i,visibleToasts:w,closeButton:(Fe=g==null?void 0:g.closeButton)!=null?Fe:l,interacting:Y,position:R,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,closeButtonAriaLabel:g==null?void 0:g.closeButtonAriaLabel,removeToast:H,toasts:A.filter(ve=>ve.position==oe.position),heights:O.filter(ve=>ve.position==oe.position),setHeights:z,expandByDefault:s,gap:x,expanded:U,swipeDirections:t.swipeDirections})})):null}))}),ewe="@effect/platform/FetchHttpClient/Fetch",twe="@effect/platform/FetchHttpClient/FetchOptions",nwe=ISe((e,t,n,r)=>{const i=r.getFiberRef(lH),a=i.unsafeMap.get(ewe)??globalThis.fetch,o=i.unsafeMap.get(twe)??{},s=o.headers?W0e(kO(o.headers),e.headers):e.headers,l=c=>yt(Ym({try:()=>a(t,{...o,method:e.method,headers:s,body:c,duplex:e.body._tag==="Stream"?"half":void 0,signal:n}),catch:f=>new i7({request:e,reason:"Transport",cause:f})}),f=>ySe(e,f));switch(e.body._tag){case"Raw":case"Uint8Array":return l(e.body.body);case"FormData":return l(e.body.formData);case"Stream":return Te(Yge(e.body.stream),l)}return l(void 0)}),rwe=zSe(Ht(nwe)),iwe=rwe,awe=e=>e.endsWith("/")?e.slice(0,-1):e,owe=T(2,(e,t)=>(t=awe(t),e==="/"?t:t+e)),swe=owe,wI=Symbol.for("@effect/platform/HttpApiEndpoint"),lwe={[wI]:wI,pipe(){return he(this,arguments)},addSuccess(e,t){return e=t!=null&&t.status?e.annotations(Fd({status:t.status})):e,$i({...this,successSchema:this.successSchema===rC?e:kl(this.successSchema,e)})},addError(e,t){return $i({...this,errorSchema:kl(this.errorSchema,t!=null&&t.status?e.annotations(Fd({status:t.status})):e)})},setPayload(e){return $i({...this,payloadSchema:ae(e)})},setPath(e){return $i({...this,pathSchema:ae(e)})},setUrlParams(e){return $i({...this,urlParamsSchema:ae(e)})},setHeaders(e){return $i({...this,headersSchema:ae(e)})},prefix(e){return $i({...this,path:swe(this.path,e)})},middleware(e){return $i({...this,errorSchema:kl(this.errorSchema,e.failure),middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return $i({...this,annotations:Yi(this.annotations,e,t)})},annotateContext(e){return $i({...this,annotations:ai(this.annotations,e)})}},$i=e=>Object.assign(Object.create(lwe),e),h7=e=>(t,...n)=>n.length===1?$i({name:t,path:n[0],method:e,pathSchema:ne(),urlParamsSchema:ne(),payloadSchema:ne(),headersSchema:ne(),successSchema:rC,errorSchema:Yp,annotations:mo(),middlewares:new Set}):(r,...i)=>{let a=r[0].replace(":","::"),o=ne();if(i.length>0){const s={};for(let l=0;l<i.length;l++){const c=i[l],f=u0e(c.ast)??String(l),u=c.ast._tag==="PropertySignatureTransformation"&&c.ast.from.isOptional||c.ast._tag==="PropertySignatureDeclaration"&&c.ast.isOptional;s[f]=c,a+=`:${f}${u?"?":""}${r[l+1].replace(":","::")}`}o=ae(He(s))}return $i({name:t,path:a,method:e,pathSchema:o,urlParamsSchema:ne(),payloadSchema:ne(),headersSchema:ne(),successSchema:rC,errorSchema:Yp,annotations:mo(),middlewares:new Set})},Ea=h7("GET"),Zr=h7("POST"),_I=Symbol.for("@effect/platform/HttpApiGroup"),cwe={[_I]:_I,add(e){return Ka({identifier:this.identifier,topLevel:this.topLevel,endpoints:{...this.endpoints,[e.name]:e},errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},addError(e,t){return Ka({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:kl(this.errorSchema,t!=null&&t.status?e.annotations(Fd({status:t.status})):e),annotations:this.annotations,middlewares:this.middlewares})},prefix(e){return Ka({identifier:this.identifier,topLevel:this.topLevel,endpoints:Of(this.endpoints,t=>t.prefix(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return Ka({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:kl(this.errorSchema,e.failure),annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},middlewareEndpoints(e){return Ka({identifier:this.identifier,topLevel:this.topLevel,endpoints:Of(this.endpoints,t=>t.middleware(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},annotateContext(e){return Ka({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:this.errorSchema,annotations:ai(this.annotations,e),middlewares:this.middlewares})},annotate(e,t){return Ka({identifier:this.identifier,topLevel:this.topLevel,endpoints:this.endpoints,errorSchema:this.errorSchema,annotations:Yi(this.annotations,e,t),middlewares:this.middlewares})},annotateEndpointsContext(e){return Ka({identifier:this.identifier,topLevel:this.topLevel,endpoints:Of(this.endpoints,t=>t.annotateContext(e)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},annotateEndpoints(e,t){return Ka({identifier:this.identifier,topLevel:this.topLevel,endpoints:Of(this.endpoints,n=>n.annotate(e,t)),errorSchema:this.errorSchema,annotations:this.annotations,middlewares:this.middlewares})},pipe(){return he(this,arguments)}},Ka=e=>{function t(){}return Object.setPrototypeOf(t,cwe),Object.assign(t,e)},kh=(e,t)=>Ka({identifier:e,topLevel:!1,endpoints:pte(),errorSchema:Yp,annotations:mo(),middlewares:new Set}),Ud=V.pipe(ey("PullRequestId")),uwe=V.pipe(ey("RepositoryName")),qx=V.pipe(ey("AwsProfileName")),fwe=V.pipe(ey("AwsRegion")),EI=V.pipe(ey("CommentId")),m7=Os("OPEN","CLOSED","MERGED"),dwe=Os("error","info","warning","success"),hwe=Os("idle","loading","error");class F0 extends ty("Account")({profile:qx,region:fwe,awsAccountId:Be(V)}){}class mwe extends ty("PullRequest")({id:Ud,title:V,description:Be(V),author:V,repositoryName:uwe,creationDate:Hc,lastModifiedDate:Hc,link:V,account:F0,status:m7,sourceBranch:V,destinationBranch:V,isMergeable:hr,isApproved:hr,commentCount:Be(Pt),healthScore:Be(Pt),fetchedAt:Be(Hc)}){get consoleUrl(){return`https://${this.account.region}.console.aws.amazon.com/codesuite/codecommit/repositories/${this.repositoryName}/pull-requests/${this.id}?region=${this.account.region}`}}class PLe extends ty("PRComment")({id:EI,content:V,author:V,creationDate:Hc,inReplyTo:Be(EI),deleted:hr,filePath:Be(V),lineNumber:Be(Pt)}){}const pwe=He({id:V,content:V,author:V,creationDate:V,inReplyTo:Be(V),deleted:hr,filePath:Be(V),lineNumber:Be(Pt)}),p7=He({root:pwe,replies:kn(Kbe(()=>p7))}),gwe=He({filePath:Be(V),beforeCommitId:Be(V),afterCommitId:Be(V),comments:kn(p7)}),ywe=Os("new_comment","comment_edited","comment_deleted","approval_changed","merge_changed","title_changed","description_changed","pr_merged","pr_closed","pr_reopened");class FLe extends ty("PersistentNotification")({id:Pt,pullRequestId:Ud,awsAccountId:V,type:ywe,message:V,createdAt:Hc,read:hr}){}nhe();class ULe extends ty("NotificationItem")({type:dwe,title:V,message:V,timestamp:Hc,profile:Fbe(V,{exact:!0})}){}class ei extends L9()("ApiError",{message:V}){}const bwe=He({id:V,awsAccountId:V,accountProfile:V,accountRegion:V,title:V,description:Qm(V),author:V,repositoryName:V,creationDate:V,lastModifiedDate:V,status:V,sourceBranch:V,destinationBranch:V,isMergeable:Pt,isApproved:Pt,commentCount:Qm(Pt),link:V,fetchedAt:V}),vwe=He({id:Pt,pullRequestId:V,awsAccountId:V,type:V,title:V,profile:V,message:V,createdAt:V,read:Pt});class Swe extends kh("prs").add(Ea("list","/").addSuccess(I9(mwe))).add(Zr("refresh","/refresh").addSuccess(V)).add(Ea("search","/search").setUrlParams(He({q:V,limit:Be(ep.pipe(D9(1,50))),offset:Be(ep.pipe(Jbe(0)))})).addSuccess(He({items:kn(bwe),total:Pt,hasMore:hr})).addError(ei)).add(Zr("refreshSingle","/:awsAccountId/:prId/refresh").setPath(He({awsAccountId:V,prId:Ud})).addSuccess(V).addError(ei)).add(Zr("create","/").setPayload(He({repositoryName:V,title:V,description:Be(V),sourceBranch:V,destinationBranch:V,account:F0})).addSuccess(V).addError(ei)).add(Zr("open","/open").setPayload(He({profile:V,link:V.pipe(dO(t=>/^https:\/\/[\w-]+\.console\.aws\.amazon\.com\//.test(t)))})).addSuccess(V).addError(ei)).add(Zr("comments","/comments").setPayload(He({pullRequestId:V,repositoryName:V,account:F0})).addSuccess(kn(gwe)).addError(ei)).prefix("/api/prs"){}class xwe extends kh("events").add(Ea("stream","/").addSuccess(V)).prefix("/api/events"){}const g7=He({accounts:kn(He({profile:V,regions:kn(V),enabled:hr})),autoDetect:hr,autoRefresh:hr,refreshIntervalSeconds:Pt,currentUser:Be(V)}),wwe=He({path:V,exists:hr,modifiedAt:Be(V)}),_we=He({path:V,sizeBytes:Pt,exists:hr,modifiedAt:Be(V)}),Ewe=He({status:Os("valid","missing","corrupted"),path:V,errors:kn(V)}),kwe=He({accounts:kn(He({profile:V,regions:kn(V),enabled:hr})),autoDetect:hr,autoRefresh:hr,refreshIntervalSeconds:Pt}),Cwe=He({backupPath:Be(V),config:g7});class Twe extends kh("config").add(Ea("list","/").addSuccess(g7)).add(Ea("path","/path").addSuccess(wwe).addError(ei)).add(Ea("database","/database").addSuccess(_we).addError(ei)).add(Ea("validate","/validate").addSuccess(Ewe).addError(ei)).add(Zr("save","/save").setPayload(kwe).addSuccess(V).addError(ei)).add(Zr("reset","/reset").addSuccess(Cwe).addError(ei)).prefix("/api/config"){}class Rwe extends kh("accounts").add(Ea("list","/").addSuccess(I9(F0))).prefix("/api/accounts"){}const kI=He({awsAccountId:V,pullRequestId:Ud}),Awe=He({awsAccountId:V,pullRequestId:V});class Owe extends kh("subscriptions").add(Zr("subscribe","/subscribe").setPayload(kI).addSuccess(V).addError(ei)).add(Zr("unsubscribe","/unsubscribe").setPayload(kI).addSuccess(V).addError(ei)).add(Ea("list","/").addSuccess(kn(Awe))).prefix("/api/subscriptions"){}const Mwe=He({items:kn(vwe),nextCursor:Be(Pt)});class Nwe extends kh("notifications").add(Ea("list","/").setUrlParams(He({limit:Be(ep.pipe(D9(1,100))),cursor:Be(ep),filter:Be(Os("system","prs")),unreadOnly:Be(ep)})).addSuccess(Mwe)).add(Ea("count","/count").addSuccess(He({unread:Pt}))).add(Zr("markRead","/read").setPayload(He({id:Pt})).addSuccess(V)).add(Zr("markUnread","/unread").setPayload(He({id:Pt})).addSuccess(V)).add(Zr("markAllRead","/read-all").addSuccess(V)).add(Zr("ssoLogin","/sso-login").setPayload(He({profile:qx})).addSuccess(V).addError(ei)).add(Zr("ssoLogout","/sso-logout").addSuccess(V).addError(ei)).prefix("/api/notifications"){}class Dwe extends p0e().add(Swe).add(xwe).add(Twe).add(Rwe).add(Nwe).add(Owe){}class Gt extends fxe()("ApiClient",{api:Dwe,baseUrl:"/",httpClient:iwe}){}wO(Gt.layer);const jwe={pullRequests:[],accounts:[],status:"idle"};Gt.query("prs","list",{reactivityKeys:["prs"],timeToLive:"30 seconds"});const y7=Gt.query("config","list",{reactivityKeys:["config"],timeToLive:"30 seconds"});Gt.query("accounts","list",{reactivityKeys:["accounts"],timeToLive:"60 seconds"});const b7=Gt.mutation("prs","refresh"),Iwe=Gt.mutation("prs","open"),CI=Gt.mutation("prs","comments"),$we=Gt.query("config","path",{reactivityKeys:["config"],timeToLive:"60 seconds"}),Lwe=Gt.query("config","database",{reactivityKeys:["config"],timeToLive:"60 seconds"}),zwe=Gt.query("config","validate",{reactivityKeys:["config"],timeToLive:"60 seconds"}),v7=Gt.mutation("config","save"),Pwe=Gt.mutation("config","reset"),MO=Gt.mutation("notifications","ssoLogin"),NO=Gt.mutation("notifications","ssoLogout"),Fwe=Gt.query("subscriptions","list",{reactivityKeys:["subscriptions"],timeToLive:"5 seconds"}),Uwe=Gt.mutation("subscriptions","subscribe"),Bwe=Gt.mutation("subscriptions","unsubscribe");Gt.query("notifications","list",{urlParams:{},reactivityKeys:["notifications"],timeToLive:"10 seconds"});Gt.query("notifications","count",{reactivityKeys:["notifications"],timeToLive:"10 seconds"});const Hwe=Gt.mutation("notifications","list"),qwe=Gt.mutation("notifications","markRead"),Vwe=Gt.mutation("notifications","markUnread"),Kwe=Gt.mutation("notifications","markAllRead");Gt.mutation("prs","search");const Gwe=Gt.mutation("prs","refreshSingle"),Zl=xO(jwe).pipe(Ux),Ywe=He({id:V,title:V,description:Be(V),author:V,repositoryName:V,creationDate:Vb,lastModifiedDate:Vb,link:V,account:He({profile:V,region:V,awsAccountId:Be(V)}),status:m7,sourceBranch:V,destinationBranch:V,isMergeable:hr,isApproved:hr,commentCount:Be(Pt),healthScore:Be(Pt),fetchedAt:Be(Vb)}),Wwe=He({id:Pt,pullRequestId:V,awsAccountId:V,type:V,title:V,profile:V,message:V,createdAt:V,read:Pt}),Jwe=He({pullRequests:kn(Ywe),accounts:kn(He({profile:V,region:V,enabled:hr})),status:hwe,statusDetail:Be(V),error:Be(V),lastUpdated:Be(Vb),currentUser:Be(V),unreadNotificationCount:Be(Pt),notifications:Be(He({items:kn(Wwe),nextCursor:Be(Pt)}))}),Xwe=s9(mO(Jwe));function Qwe(e,t){const n=y.useRef(e);n.current=e;const r=y.useRef(t);r.current=t;const[i,a]=y.useState("disconnected"),o=y.useRef(0);return y.useEffect(()=>{let s=null,l=0,c=null;const f=()=>{s=new EventSource("/api/events/"),s.onopen=()=>{l=0,a("connected")},s.onmessage=u=>{var d;try{const h=Xwe(u.data),m=((d=h.notifications)==null?void 0:d.items)??[];if(o.current>0)for(const b of m)b.id>o.current&&Bxe(b.title||"New notification",{description:b.message,action:{label:"View",onClick:()=>{var w;return(w=r.current)==null?void 0:w.call(r)}}});if(m.length>0){const b=Math.max(...m.map(w=>w.id));b>o.current&&(o.current=b)}n.current(h)}catch{}},s.onerror=()=>{if(s==null||s.close(),l>=50){a("disconnected");return}a("reconnecting");const u=Math.min(1e3*2**l,3e4);c=setTimeout(()=>{l++,f()},u)}};return f(),()=>{s==null||s.close(),c&&clearTimeout(c)}},[]),i}/**
88
+ * @license lucide-react v0.563.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const S7=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
93
+ * @license lucide-react v0.563.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const Zwe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
98
+ * @license lucide-react v0.563.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const e1e=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
103
+ * @license lucide-react v0.563.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const TI=e=>{const t=e1e(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
108
+ * @license lucide-react v0.563.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */var t1e={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"};/**
113
+ * @license lucide-react v0.563.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const n1e=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
118
+ * @license lucide-react v0.563.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const r1e=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...s},l)=>y.createElement("svg",{ref:l,...t1e,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:S7("lucide",i),...!a&&!n1e(s)&&{"aria-hidden":"true"},...s},[...o.map(([c,f])=>y.createElement(c,f)),...Array.isArray(a)?a:[a]]));/**
123
+ * @license lucide-react v0.563.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const dt=(e,t)=>{const n=y.forwardRef(({className:r,...i},a)=>y.createElement(r1e,{ref:a,iconNode:t,className:S7(`lucide-${Zwe(TI(e))}`,`lucide-${e}`,r),...i}));return n.displayName=TI(e),n};/**
128
+ * @license lucide-react v0.563.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const i1e=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],x7=dt("arrow-left",i1e);/**
133
+ * @license lucide-react v0.563.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const a1e=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],o1e=dt("arrow-right",a1e);/**
138
+ * @license lucide-react v0.563.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const s1e=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],l1e=dt("bell-off",s1e);/**
143
+ * @license lucide-react v0.563.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const c1e=[["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"}]],DO=dt("bell",c1e);/**
148
+ * @license lucide-react v0.563.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const u1e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jO=dt("check",u1e);/**
153
+ * @license lucide-react v0.563.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const f1e=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],IO=dt("chevron-down",f1e);/**
158
+ * @license lucide-react v0.563.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const d1e=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],h1e=dt("chevron-right",d1e);/**
163
+ * @license lucide-react v0.563.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const m1e=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],p1e=dt("chevron-up",m1e);/**
168
+ * @license lucide-react v0.563.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const g1e=[["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"}]],y1e=dt("circle-alert",g1e);/**
173
+ * @license lucide-react v0.563.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const b1e=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],w7=dt("circle-check-big",b1e);/**
178
+ * @license lucide-react v0.563.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const v1e=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],_7=dt("copy",v1e);/**
183
+ * @license lucide-react v0.563.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const S1e=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],x1e=dt("external-link",S1e);/**
188
+ * @license lucide-react v0.563.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const w1e=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],_1e=dt("file",w1e);/**
193
+ * @license lucide-react v0.563.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const E1e=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],k1e=dt("flame",E1e);/**
198
+ * @license lucide-react v0.563.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const C1e=[["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"}]],RI=dt("funnel",C1e);/**
203
+ * @license lucide-react v0.563.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const T1e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],$O=dt("info",T1e);/**
208
+ * @license lucide-react v0.563.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const R1e=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],Vx=dt("loader",R1e);/**
213
+ * @license lucide-react v0.563.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const A1e=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],E7=dt("log-in",A1e);/**
218
+ * @license lucide-react v0.563.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const O1e=[["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"}]],k7=dt("log-out",O1e);/**
223
+ * @license lucide-react v0.563.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const M1e=[["path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",key:"1jhwl8"}],["path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10",key:"1qfld7"}]],N1e=dt("mail-open",M1e);/**
228
+ * @license lucide-react v0.563.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const D1e=[["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"}]],j1e=dt("mail",D1e);/**
233
+ * @license lucide-react v0.563.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const I1e=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],$1e=dt("message-square",I1e);/**
238
+ * @license lucide-react v0.563.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const L1e=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],z1e=dt("monitor",L1e);/**
243
+ * @license lucide-react v0.563.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const P1e=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],C7=dt("moon",P1e);/**
248
+ * @license lucide-react v0.563.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const F1e=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],U1e=dt("palette",F1e);/**
253
+ * @license lucide-react v0.563.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const B1e=[["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"}]],ay=dt("refresh-cw",B1e);/**
258
+ * @license lucide-react v0.563.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const H1e=[["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"}]],q1e=dt("rotate-ccw",H1e);/**
263
+ * @license lucide-react v0.563.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const V1e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],LO=dt("search",V1e);/**
268
+ * @license lucide-react v0.563.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const K1e=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],G1e=dt("server",K1e);/**
273
+ * @license lucide-react v0.563.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const Y1e=[["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"}]],df=dt("settings",Y1e);/**
278
+ * @license lucide-react v0.563.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const W1e=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],T7=dt("sun",W1e);/**
283
+ * @license lucide-react v0.563.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const J1e=[["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"}]],X1e=dt("triangle-alert",J1e);/**
288
+ * @license lucide-react v0.563.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const Q1e=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],zO=dt("user",Q1e);/**
293
+ * @license lucide-react v0.563.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const Z1e=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],R7=dt("x",Z1e),AI=xO(!1).pipe(Ux),A7=["accounts","refresh","theme","config","about"];var OI=1,e_e=.9,t_e=.8,n_e=.17,X1=.1,Q1=.999,r_e=.9999,i_e=.99,a_e=/[\\\/_+.#"@\[\(\{&]/,o_e=/[\\\/_+.#"@\[\(\{&]/g,s_e=/[\s-]/,O7=/[\s-]/g;function uC(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?OI:i_e;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var l=r.charAt(a),c=n.indexOf(l,i),f=0,u,d,h,m;c>=0;)u=uC(e,t,n,r,c+1,a+1,o),u>f&&(c===i?u*=OI:a_e.test(e.charAt(c-1))?(u*=t_e,h=e.slice(i,c-1).match(o_e),h&&i>0&&(u*=Math.pow(Q1,h.length))):s_e.test(e.charAt(c-1))?(u*=e_e,m=e.slice(i,c-1).match(O7),m&&i>0&&(u*=Math.pow(Q1,m.length))):(u*=n_e,i>0&&(u*=Math.pow(Q1,c-i))),e.charAt(c)!==t.charAt(a)&&(u*=r_e)),(u<X1&&n.charAt(c-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(c-1)!==r.charAt(a))&&(d=uC(e,t,n,r,c+1,a+2,o),d*X1>u&&(u=d*X1)),u>f&&(f=u),c=n.indexOf(l,c+1);return o[s]=f,f}function MI(e){return e.toLowerCase().replace(O7," ")}function l_e(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,uC(e,t,MI(e),MI(t),0,0,{})}function xe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function NI(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function go(...e){return t=>{let n=!1;const r=e.map(i=>{const a=NI(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():NI(e[i],null)}}}}function It(...e){return y.useCallback(go(...e),e)}function c_e(e,t){const n=y.createContext(t),r=a=>{const{children:o,...s}=a,l=y.useMemo(()=>s,Object.values(s));return p.jsx(n.Provider,{value:l,children:o})};r.displayName=e+"Provider";function i(a){const o=y.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function ec(e,t=[]){let n=[];function r(a,o){const s=y.createContext(o),l=n.length;n=[...n,o];const c=u=>{var g;const{scope:d,children:h,...m}=u,b=((g=d==null?void 0:d[e])==null?void 0:g[l])||s,w=y.useMemo(()=>m,Object.values(m));return p.jsx(b.Provider,{value:w,children:h})};c.displayName=a+"Provider";function f(u,d){var b;const h=((b=d==null?void 0:d[e])==null?void 0:b[l])||s,m=y.useContext(h);if(m)return m;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${a}\``)}return[c,f]}const i=()=>{const a=n.map(o=>y.createContext(o));return function(s){const l=(s==null?void 0:s[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,u_e(i,...t)]}function u_e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((s,{useScope:l,scopeName:c})=>{const u=l(a)[`__scope${c}`];return{...s,...u}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var kr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},f_e=rS[" useId ".trim().toString()]||(()=>{}),d_e=0;function Pr(e){const[t,n]=y.useState(f_e());return kr(()=>{n(r=>r??String(d_e++))},[e]),e||(t?`radix-${t}`:"")}var h_e=rS[" useInsertionEffect ".trim().toString()]||kr;function Pl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=m_e({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{const f=y.useRef(e!==void 0);y.useEffect(()=>{const u=f.current;u!==s&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const c=y.useCallback(f=>{var u;if(s){const d=p_e(f)?f(e):f;d!==e&&((u=o.current)==null||u.call(o,d))}else a(f)},[s,e,a,o]);return[l,c]}function m_e({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),i=y.useRef(n),a=y.useRef(t);return h_e(()=>{a.current=t},[t]),y.useEffect(()=>{var o;i.current!==n&&((o=a.current)==null||o.call(a,n),i.current=n)},[n,i]),[n,r,a]}function p_e(e){return typeof e=="function"}function uu(e){const t=g_e(e),n=y.forwardRef((r,i)=>{const{children:a,...o}=r,s=y.Children.toArray(a),l=s.find(b_e);if(l){const c=l.props.children,f=s.map(u=>u===l?y.Children.count(c)>1?y.Children.only(null):y.isValidElement(c)?c.props.children:null:u);return p.jsx(t,{...o,ref:i,children:y.isValidElement(c)?y.cloneElement(c,void 0,f):null})}return p.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var M7=uu("Slot");function g_e(e){const t=y.forwardRef((n,r)=>{const{children:i,...a}=n;if(y.isValidElement(i)){const o=S_e(i),s=v_e(a,i.props);return i.type!==y.Fragment&&(s.ref=r?go(r,o):o),y.cloneElement(i,s)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var y_e=Symbol("radix.slottable");function b_e(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===y_e}function v_e(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{const l=a(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function S_e(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var x_e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ze=x_e.reduce((e,t)=>{const n=uu(`Primitive.${t}`),r=y.forwardRef((i,a)=>{const{asChild:o,...s}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function N7(e,t){e&&Gd.flushSync(()=>e.dispatchEvent(t))}function yo(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function w_e(e,t=globalThis==null?void 0:globalThis.document){const n=yo(e);y.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var __e="DismissableLayer",fC="dismissableLayer.update",E_e="dismissableLayer.pointerDownOutside",k_e="dismissableLayer.focusOutside",DI,D7=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kx=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...l}=e,c=y.useContext(D7),[f,u]=y.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=y.useState({}),m=It(t,_=>u(_)),b=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=b.indexOf(w),v=f?b.indexOf(f):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,E=v>=g,C=R_e(_=>{const A=_.target,I=[...c.branches].some(O=>O.contains(A));!E||I||(i==null||i(_),o==null||o(_),_.defaultPrevented||s==null||s())},d),k=A_e(_=>{const A=_.target;[...c.branches].some(O=>O.contains(A))||(a==null||a(_),o==null||o(_),_.defaultPrevented||s==null||s())},d);return w_e(_=>{v===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&s&&(_.preventDefault(),s()))},d),y.useEffect(()=>{if(f)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(DI=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),jI(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=DI)}},[f,d,n,c]),y.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),jI())},[f,c]),y.useEffect(()=>{const _=()=>h({});return document.addEventListener(fC,_),()=>document.removeEventListener(fC,_)},[]),p.jsx(Ze.div,{...l,ref:m,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:xe(e.onFocusCapture,k.onFocusCapture),onBlurCapture:xe(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:xe(e.onPointerDownCapture,C.onPointerDownCapture)})});Kx.displayName=__e;var C_e="DismissableLayerBranch",T_e=y.forwardRef((e,t)=>{const n=y.useContext(D7),r=y.useRef(null),i=It(t,r);return y.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),p.jsx(Ze.div,{...e,ref:i})});T_e.displayName=C_e;function R_e(e,t=globalThis==null?void 0:globalThis.document){const n=yo(e),r=y.useRef(!1),i=y.useRef(()=>{});return y.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let l=function(){j7(E_e,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function A_e(e,t=globalThis==null?void 0:globalThis.document){const n=yo(e),r=y.useRef(!1);return y.useEffect(()=>{const i=a=>{a.target&&!r.current&&j7(k_e,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function jI(){const e=new CustomEvent(fC);document.dispatchEvent(e)}function j7(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?N7(i,a):i.dispatchEvent(a)}var Z1="focusScope.autoFocusOnMount",e_="focusScope.autoFocusOnUnmount",II={bubbles:!1,cancelable:!0},O_e="FocusScope",Gx=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,l]=y.useState(null),c=yo(i),f=yo(a),u=y.useRef(null),d=It(t,b=>l(b)),h=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let b=function(x){if(h.paused||!s)return;const E=x.target;s.contains(E)?u.current=E:Fs(u.current,{select:!0})},w=function(x){if(h.paused||!s)return;const E=x.relatedTarget;E!==null&&(s.contains(E)||Fs(u.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&Fs(s)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const v=new MutationObserver(g);return s&&v.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),v.disconnect()}}},[r,s,h.paused]),y.useEffect(()=>{if(s){LI.add(h);const b=document.activeElement;if(!s.contains(b)){const g=new CustomEvent(Z1,II);s.addEventListener(Z1,c),s.dispatchEvent(g),g.defaultPrevented||(M_e($_e(I7(s)),{select:!0}),document.activeElement===b&&Fs(s))}return()=>{s.removeEventListener(Z1,c),setTimeout(()=>{const g=new CustomEvent(e_,II);s.addEventListener(e_,f),s.dispatchEvent(g),g.defaultPrevented||Fs(b??document.body,{select:!0}),s.removeEventListener(e_,f),LI.remove(h)},0)}}},[s,c,f,h]);const m=y.useCallback(b=>{if(!n&&!r||h.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,g=document.activeElement;if(w&&g){const v=b.currentTarget,[x,E]=N_e(v);x&&E?!b.shiftKey&&g===E?(b.preventDefault(),n&&Fs(x,{select:!0})):b.shiftKey&&g===x&&(b.preventDefault(),n&&Fs(E,{select:!0})):g===v&&b.preventDefault()}},[n,r,h.paused]);return p.jsx(Ze.div,{tabIndex:-1,...o,ref:d,onKeyDown:m})});Gx.displayName=O_e;function M_e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Fs(r,{select:t}),document.activeElement!==n)return}function N_e(e){const t=I7(e),n=$I(t,e),r=$I(t.reverse(),e);return[n,r]}function I7(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $I(e,t){for(const n of e)if(!D_e(n,{upTo:t}))return n}function D_e(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function j_e(e){return e instanceof HTMLInputElement&&"select"in e}function Fs(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&j_e(e)&&t&&e.select()}}var LI=I_e();function I_e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=zI(e,t),e.unshift(t)},remove(t){var n;e=zI(e,t),(n=e[0])==null||n.resume()}}}function zI(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $_e(e){return e.filter(t=>t.tagName!=="A")}var L_e="Portal",Yx=y.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[i,a]=y.useState(!1);kr(()=>a(!0),[]);const o=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return o?sP.createPortal(p.jsx(Ze.div,{...r,ref:t}),o):null});Yx.displayName=L_e;function z_e(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var tc=e=>{const{present:t,children:n}=e,r=P_e(t),i=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),a=It(r.ref,F_e(i));return typeof n=="function"||r.isPresent?y.cloneElement(i,{ref:a}):null};tc.displayName="Presence";function P_e(e){const[t,n]=y.useState(),r=y.useRef(null),i=y.useRef(e),a=y.useRef("none"),o=e?"mounted":"unmounted",[s,l]=z_e(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=eb(r.current);a.current=s==="mounted"?c:"none"},[s]),kr(()=>{const c=r.current,f=i.current;if(f!==e){const d=a.current,h=eb(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(f&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),kr(()=>{if(t){let c;const f=t.ownerDocument.defaultView??window,u=h=>{const b=eb(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&b&&(l("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",c=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},d=h=>{h.target===t&&(a.current=eb(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(c),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function eb(e){return(e==null?void 0:e.animationName)||"none"}function F_e(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var t_=0;function PO(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??PI()),document.body.insertAdjacentElement("beforeend",e[1]??PI()),t_++,()=>{t_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),t_--}},[])}function PI(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ja=function(){return Ja=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ja.apply(this,arguments)};function $7(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function U_e(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Zb="right-scroll-bar-position",ev="width-before-scroll-bar",B_e="with-scroll-bars-hidden",H_e="--removed-body-scroll-bar-size";function n_(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function q_e(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var V_e=typeof window<"u"?y.useLayoutEffect:y.useEffect,FI=new WeakMap;function K_e(e,t){var n=q_e(null,function(r){return e.forEach(function(i){return n_(i,r)})});return V_e(function(){var r=FI.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(s){a.has(s)||n_(s,null)}),a.forEach(function(s){i.has(s)||n_(s,o)})}FI.set(n,e)},[e]),n}function G_e(e){return e}function Y_e(e,t){t===void 0&&(t=G_e);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(s){return s!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var s=n;n=[],s.forEach(a),o=n}var l=function(){var f=o;o=[],f.forEach(a)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(f){o.push(f),c()},filter:function(f){return o=o.filter(f),n}}}};return i}function W_e(e){e===void 0&&(e={});var t=Y_e(null);return t.options=Ja({async:!0,ssr:!1},e),t}var L7=function(e){var t=e.sideCar,n=$7(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Ja({},n))};L7.isSideCarExport=!0;function J_e(e,t){return e.useMedium(t),L7}var z7=W_e(),r_=function(){},Wx=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:r_,onWheelCapture:r_,onTouchMoveCapture:r_}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,f=e.enabled,u=e.shards,d=e.sideCar,h=e.noRelative,m=e.noIsolation,b=e.inert,w=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,x=e.gapMode,E=$7(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=d,k=K_e([n,t]),_=Ja(Ja({},E),i);return y.createElement(y.Fragment,null,f&&y.createElement(C,{sideCar:z7,removeScrollBar:c,shards:u,noRelative:h,noIsolation:m,inert:b,setCallbacks:a,allowPinchZoom:!!w,lockRef:n,gapMode:x}),o?y.cloneElement(y.Children.only(s),Ja(Ja({},_),{ref:k})):y.createElement(v,Ja({},_,{className:l,ref:k}),s))});Wx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Wx.classNames={fullWidth:ev,zeroRight:Zb};var X_e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Q_e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=X_e();return t&&e.setAttribute("nonce",t),e}function Z_e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eEe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tEe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Q_e())&&(Z_e(t,n),eEe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nEe=function(){var e=tEe();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},P7=function(){var e=nEe(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},rEe={left:0,top:0,right:0,gap:0},i_=function(e){return parseInt(e||"",10)||0},iEe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[i_(n),i_(r),i_(i)]},aEe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rEe;var t=iEe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},oEe=P7(),rd="data-scroll-locked",sEe=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n="margin"),`
298
+ .`.concat(B_e,` {
299
+ overflow: hidden `).concat(r,`;
300
+ padding-right: `).concat(s,"px ").concat(r,`;
301
+ }
302
+ body[`).concat(rd,`] {
303
+ overflow: hidden `).concat(r,`;
304
+ overscroll-behavior: contain;
305
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
306
+ padding-left: `.concat(i,`px;
307
+ padding-top: `).concat(a,`px;
308
+ padding-right: `).concat(o,`px;
309
+ margin-left:0;
310
+ margin-top:0;
311
+ margin-right: `).concat(s,"px ").concat(r,`;
312
+ `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
313
+ }
314
+
315
+ .`).concat(Zb,` {
316
+ right: `).concat(s,"px ").concat(r,`;
317
+ }
318
+
319
+ .`).concat(ev,` {
320
+ margin-right: `).concat(s,"px ").concat(r,`;
321
+ }
322
+
323
+ .`).concat(Zb," .").concat(Zb,` {
324
+ right: 0 `).concat(r,`;
325
+ }
326
+
327
+ .`).concat(ev," .").concat(ev,` {
328
+ margin-right: 0 `).concat(r,`;
329
+ }
330
+
331
+ body[`).concat(rd,`] {
332
+ `).concat(H_e,": ").concat(s,`px;
333
+ }
334
+ `)},UI=function(){var e=parseInt(document.body.getAttribute(rd)||"0",10);return isFinite(e)?e:0},lEe=function(){y.useEffect(function(){return document.body.setAttribute(rd,(UI()+1).toString()),function(){var e=UI()-1;e<=0?document.body.removeAttribute(rd):document.body.setAttribute(rd,e.toString())}},[])},cEe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;lEe();var a=y.useMemo(function(){return aEe(i)},[i]);return y.createElement(oEe,{styles:sEe(a,!t,i,n?"":"!important")})},dC=!1;if(typeof window<"u")try{var tb=Object.defineProperty({},"passive",{get:function(){return dC=!0,!0}});window.addEventListener("test",tb,tb),window.removeEventListener("test",tb,tb)}catch{dC=!1}var Xu=dC?{passive:!1}:!1,uEe=function(e){return e.tagName==="TEXTAREA"},F7=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!uEe(e)&&n[t]==="visible")},fEe=function(e){return F7(e,"overflowY")},dEe=function(e){return F7(e,"overflowX")},BI=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=U7(e,r);if(i){var a=B7(e,r),o=a[1],s=a[2];if(o>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hEe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},mEe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},U7=function(e,t){return e==="v"?fEe(t):dEe(t)},B7=function(e,t){return e==="v"?hEe(t):mEe(t)},pEe=function(e,t){return e==="h"&&t==="rtl"?-1:1},gEe=function(e,t,n,r,i){var a=pEe(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,l=t.contains(s),c=!1,f=o>0,u=0,d=0;do{if(!s)break;var h=B7(e,s),m=h[0],b=h[1],w=h[2],g=b-w-a*m;(m||g)&&U7(e,s)&&(u+=g,d+=m);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(f&&Math.abs(u)<1||!f&&Math.abs(d)<1)&&(c=!0),c},nb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},HI=function(e){return[e.deltaX,e.deltaY]},qI=function(e){return e&&"current"in e?e.current:e},yEe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bEe=function(e){return`
335
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
336
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
337
+ `)},vEe=0,Qu=[];function SEe(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(vEe++)[0],a=y.useState(P7)[0],o=y.useRef(e);y.useEffect(function(){o.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=U_e([e.lockRef.current],(e.shards||[]).map(qI),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=y.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var g=nb(b),v=n.current,x="deltaX"in b?b.deltaX:v[0]-g[0],E="deltaY"in b?b.deltaY:v[1]-g[1],C,k=b.target,_=Math.abs(x)>Math.abs(E)?"h":"v";if("touches"in b&&_==="h"&&k.type==="range")return!1;var A=window.getSelection(),I=A&&A.anchorNode,O=I?I===k||I.contains(k):!1;if(O)return!1;var z=BI(_,k);if(!z)return!0;if(z?C=_:(C=_==="v"?"h":"v",z=BI(_,k)),!z)return!1;if(!r.current&&"changedTouches"in b&&(x||E)&&(r.current=C),!C)return!0;var U=r.current||C;return gEe(U,w,b,U==="h"?x:E)},[]),l=y.useCallback(function(b){var w=b;if(!(!Qu.length||Qu[Qu.length-1]!==a)){var g="deltaY"in w?HI(w):nb(w),v=t.current.filter(function(C){return C.name===w.type&&(C.target===w.target||w.target===C.shadowParent)&&yEe(C.delta,g)})[0];if(v&&v.should){w.cancelable&&w.preventDefault();return}if(!v){var x=(o.current.shards||[]).map(qI).filter(Boolean).filter(function(C){return C.contains(w.target)}),E=x.length>0?s(w,x[0]):!o.current.noIsolation;E&&w.cancelable&&w.preventDefault()}}},[]),c=y.useCallback(function(b,w,g,v){var x={name:b,delta:w,target:g,should:v,shadowParent:xEe(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(E){return E!==x})},1)},[]),f=y.useCallback(function(b){n.current=nb(b),r.current=void 0},[]),u=y.useCallback(function(b){c(b.type,HI(b),b.target,s(b,e.lockRef.current))},[]),d=y.useCallback(function(b){c(b.type,nb(b),b.target,s(b,e.lockRef.current))},[]);y.useEffect(function(){return Qu.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:d}),document.addEventListener("wheel",l,Xu),document.addEventListener("touchmove",l,Xu),document.addEventListener("touchstart",f,Xu),function(){Qu=Qu.filter(function(b){return b!==a}),document.removeEventListener("wheel",l,Xu),document.removeEventListener("touchmove",l,Xu),document.removeEventListener("touchstart",f,Xu)}},[]);var h=e.removeScrollBar,m=e.inert;return y.createElement(y.Fragment,null,m?y.createElement(a,{styles:bEe(i)}):null,h?y.createElement(cEe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xEe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wEe=J_e(z7,SEe);var Jx=y.forwardRef(function(e,t){return y.createElement(Wx,Ja({},e,{ref:t,sideCar:wEe}))});Jx.classNames=Wx.classNames;var _Ee=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zu=new WeakMap,rb=new WeakMap,ib={},a_=0,H7=function(e){return e&&(e.host||H7(e.parentNode))},EEe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=H7(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kEe=function(e,t,n,r){var i=EEe(t,Array.isArray(e)?e:[e]);ib[n]||(ib[n]=new WeakMap);var a=ib[n],o=[],s=new Set,l=new Set(i),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};i.forEach(c);var f=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(d){if(s.has(d))f(d);else try{var h=d.getAttribute(r),m=h!==null&&h!=="false",b=(Zu.get(d)||0)+1,w=(a.get(d)||0)+1;Zu.set(d,b),a.set(d,w),o.push(d),b===1&&m&&rb.set(d,!0),w===1&&d.setAttribute(n,"true"),m||d.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",d,g)}})};return f(t),s.clear(),a_++,function(){o.forEach(function(u){var d=Zu.get(u)-1,h=a.get(u)-1;Zu.set(u,d),a.set(u,h),d||(rb.has(u)||u.removeAttribute(r),rb.delete(u)),h||u.removeAttribute(n)}),a_--,a_||(Zu=new WeakMap,Zu=new WeakMap,rb=new WeakMap,ib={})}},FO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=_Ee(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),kEe(r,i,n,"aria-hidden")):function(){return null}},Xx="Dialog",[q7]=ec(Xx),[CEe,Ua]=q7(Xx),V7=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=y.useRef(null),l=y.useRef(null),[c,f]=Pl({prop:r,defaultProp:i??!1,onChange:a,caller:Xx});return p.jsx(CEe,{scope:t,triggerRef:s,contentRef:l,contentId:Pr(),titleId:Pr(),descriptionId:Pr(),open:c,onOpenChange:f,onOpenToggle:y.useCallback(()=>f(u=>!u),[f]),modal:o,children:n})};V7.displayName=Xx;var K7="DialogTrigger",TEe=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ua(K7,n),a=It(t,i.triggerRef);return p.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":HO(i.open),...r,ref:a,onClick:xe(e.onClick,i.onOpenToggle)})});TEe.displayName=K7;var UO="DialogPortal",[REe,G7]=q7(UO,{forceMount:void 0}),Y7=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ua(UO,t);return p.jsx(REe,{scope:t,forceMount:n,children:y.Children.map(r,o=>p.jsx(tc,{present:n||a.open,children:p.jsx(Yx,{asChild:!0,container:i,children:o})}))})};Y7.displayName=UO;var U0="DialogOverlay",W7=y.forwardRef((e,t)=>{const n=G7(U0,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ua(U0,e.__scopeDialog);return a.modal?p.jsx(tc,{present:r||a.open,children:p.jsx(OEe,{...i,ref:t})}):null});W7.displayName=U0;var AEe=uu("DialogOverlay.RemoveScroll"),OEe=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ua(U0,n);return p.jsx(Jx,{as:AEe,allowPinchZoom:!0,shards:[i.contentRef],children:p.jsx(Ze.div,{"data-state":HO(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),fu="DialogContent",J7=y.forwardRef((e,t)=>{const n=G7(fu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ua(fu,e.__scopeDialog);return p.jsx(tc,{present:r||a.open,children:a.modal?p.jsx(MEe,{...i,ref:t}):p.jsx(NEe,{...i,ref:t})})});J7.displayName=fu;var MEe=y.forwardRef((e,t)=>{const n=Ua(fu,e.__scopeDialog),r=y.useRef(null),i=It(t,n.contentRef,r);return y.useEffect(()=>{const a=r.current;if(a)return FO(a)},[]),p.jsx(X7,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xe(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:xe(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&a.preventDefault()}),onFocusOutside:xe(e.onFocusOutside,a=>a.preventDefault())})}),NEe=y.forwardRef((e,t)=>{const n=Ua(fu,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return p.jsx(X7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,s;(o=e.onCloseAutoFocus)==null||o.call(e,a),a.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;((c=n.triggerRef.current)==null?void 0:c.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),X7=y.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Ua(fu,n),l=y.useRef(null),c=It(t,l);return PO(),p.jsxs(p.Fragment,{children:[p.jsx(Gx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:p.jsx(Kx,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":HO(s.open),...o,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(DEe,{titleId:s.titleId}),p.jsx(IEe,{contentRef:l,descriptionId:s.descriptionId})]})]})}),BO="DialogTitle",Q7=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ua(BO,n);return p.jsx(Ze.h2,{id:i.titleId,...r,ref:t})});Q7.displayName=BO;var Z7="DialogDescription",eq=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ua(Z7,n);return p.jsx(Ze.p,{id:i.descriptionId,...r,ref:t})});eq.displayName=Z7;var tq="DialogClose",nq=y.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ua(tq,n);return p.jsx(Ze.button,{type:"button",...r,ref:t,onClick:xe(e.onClick,()=>i.onOpenChange(!1))})});nq.displayName=tq;function HO(e){return e?"open":"closed"}var rq="DialogTitleWarning",[BLe,iq]=c_e(rq,{contentName:fu,titleName:BO,docsSlug:"dialog"}),DEe=({titleId:e})=>{const t=iq(rq),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
338
+
339
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
340
+
341
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jEe="DialogDescriptionWarning",IEe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${iq(jEe).contentName}}.`;return y.useEffect(()=>{var a;const i=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},aq=V7,oq=Y7,sq=W7,lq=J7,$Ee=Q7,LEe=eq,zEe=nq,PEe=Symbol.for("react.lazy"),B0=rS[" use ".trim().toString()];function FEe(e){return typeof e=="object"&&e!==null&&"then"in e}function cq(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===PEe&&"_payload"in e&&FEe(e._payload)}function UEe(e){const t=BEe(e),n=y.forwardRef((r,i)=>{let{children:a,...o}=r;cq(a)&&typeof B0=="function"&&(a=B0(a._payload));const s=y.Children.toArray(a),l=s.find(qEe);if(l){const c=l.props.children,f=s.map(u=>u===l?y.Children.count(c)>1?y.Children.only(null):y.isValidElement(c)?c.props.children:null:u);return p.jsx(t,{...o,ref:i,children:y.isValidElement(c)?y.cloneElement(c,void 0,f):null})}return p.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function BEe(e){const t=y.forwardRef((n,r)=>{let{children:i,...a}=n;if(cq(i)&&typeof B0=="function"&&(i=B0(i._payload)),y.isValidElement(i)){const o=KEe(i),s=VEe(a,i.props);return i.type!==y.Fragment&&(s.ref=r?go(r,o):o),y.cloneElement(i,s)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var HEe=Symbol("radix.slottable");function qEe(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===HEe}function VEe(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...s)=>{const l=a(...s);return i(...s),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function KEe(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var GEe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],nc=GEe.reduce((e,t)=>{const n=UEe(`Primitive.${t}`),r=y.forwardRef((i,a)=>{const{asChild:o,...s}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),rm='[cmdk-group=""]',o_='[cmdk-group-items=""]',YEe='[cmdk-group-heading=""]',uq='[cmdk-item=""]',VI=`${uq}:not([aria-disabled="true"])`,hC="cmdk-item-select",hf="data-value",WEe=(e,t,n)=>l_e(e,t,n),fq=y.createContext(void 0),oy=()=>y.useContext(fq),dq=y.createContext(void 0),qO=()=>y.useContext(dq),hq=y.createContext(void 0),mq=y.forwardRef((e,t)=>{let n=mf(()=>{var H,R;return{search:"",value:(R=(H=e.value)!=null?H:e.defaultValue)!=null?R:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=mf(()=>new Set),i=mf(()=>new Map),a=mf(()=>new Map),o=mf(()=>new Set),s=pq(e),{label:l,children:c,value:f,onValueChange:u,filter:d,shouldFilter:h,loop:m,disablePointerSelection:b=!1,vimBindings:w=!0,...g}=e,v=Pr(),x=Pr(),E=Pr(),C=y.useRef(null),k=oke();du(()=>{if(f!==void 0){let H=f.trim();n.current.value=H,_.emit()}},[f]),du(()=>{k(6,J)},[]);let _=y.useMemo(()=>({subscribe:H=>(o.current.add(H),()=>o.current.delete(H)),snapshot:()=>n.current,setState:(H,R,X)=>{var G,se,Q,oe;if(!Object.is(n.current[H],R)){if(n.current[H]=R,H==="search")U(),O(),k(1,z);else if(H==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ye=document.getElementById(E);ye?ye.focus():(G=document.getElementById(v))==null||G.focus()}if(k(7,()=>{var ye;n.current.selectedItemId=(ye=Y())==null?void 0:ye.id,_.emit()}),X||k(5,J),((se=s.current)==null?void 0:se.value)!==void 0){let ye=R??"";(oe=(Q=s.current).onValueChange)==null||oe.call(Q,ye);return}}_.emit()}},emit:()=>{o.current.forEach(H=>H())}}),[]),A=y.useMemo(()=>({value:(H,R,X)=>{var G;R!==((G=a.current.get(H))==null?void 0:G.value)&&(a.current.set(H,{value:R,keywords:X}),n.current.filtered.items.set(H,I(R,X)),k(2,()=>{O(),_.emit()}))},item:(H,R)=>(r.current.add(H),R&&(i.current.has(R)?i.current.get(R).add(H):i.current.set(R,new Set([H]))),k(3,()=>{U(),O(),n.current.value||z(),_.emit()}),()=>{a.current.delete(H),r.current.delete(H),n.current.filtered.items.delete(H);let X=Y();k(4,()=>{U(),(X==null?void 0:X.getAttribute("id"))===H&&z(),_.emit()})}),group:H=>(i.current.has(H)||i.current.set(H,new Set),()=>{a.current.delete(H),i.current.delete(H)}),filter:()=>s.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:E,labelId:x,listInnerRef:C}),[]);function I(H,R){var X,G;let se=(G=(X=s.current)==null?void 0:X.filter)!=null?G:WEe;return H?se(H,n.current.search,R):0}function O(){if(!n.current.search||s.current.shouldFilter===!1)return;let H=n.current.filtered.items,R=[];n.current.filtered.groups.forEach(G=>{let se=i.current.get(G),Q=0;se.forEach(oe=>{let ye=H.get(oe);Q=Math.max(ye,Q)}),R.push([G,Q])});let X=C.current;F().sort((G,se)=>{var Q,oe;let ye=G.getAttribute("id"),Ae=se.getAttribute("id");return((Q=H.get(Ae))!=null?Q:0)-((oe=H.get(ye))!=null?oe:0)}).forEach(G=>{let se=G.closest(o_);se?se.appendChild(G.parentElement===se?G:G.closest(`${o_} > *`)):X.appendChild(G.parentElement===X?G:G.closest(`${o_} > *`))}),R.sort((G,se)=>se[1]-G[1]).forEach(G=>{var se;let Q=(se=C.current)==null?void 0:se.querySelector(`${rm}[${hf}="${encodeURIComponent(G[0])}"]`);Q==null||Q.parentElement.appendChild(Q)})}function z(){let H=F().find(X=>X.getAttribute("aria-disabled")!=="true"),R=H==null?void 0:H.getAttribute(hf);_.setState("value",R||void 0)}function U(){var H,R,X,G;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let se=0;for(let Q of r.current){let oe=(R=(H=a.current.get(Q))==null?void 0:H.value)!=null?R:"",ye=(G=(X=a.current.get(Q))==null?void 0:X.keywords)!=null?G:[],Ae=I(oe,ye);n.current.filtered.items.set(Q,Ae),Ae>0&&se++}for(let[Q,oe]of i.current)for(let ye of oe)if(n.current.filtered.items.get(ye)>0){n.current.filtered.groups.add(Q);break}n.current.filtered.count=se}function J(){var H,R,X;let G=Y();G&&(((H=G.parentElement)==null?void 0:H.firstChild)===G&&((X=(R=G.closest(rm))==null?void 0:R.querySelector(YEe))==null||X.scrollIntoView({block:"nearest"})),G.scrollIntoView({block:"nearest"}))}function Y(){var H;return(H=C.current)==null?void 0:H.querySelector(`${uq}[aria-selected="true"]`)}function F(){var H;return Array.from(((H=C.current)==null?void 0:H.querySelectorAll(VI))||[])}function D(H){let R=F()[H];R&&_.setState("value",R.getAttribute(hf))}function P(H){var R;let X=Y(),G=F(),se=G.findIndex(oe=>oe===X),Q=G[se+H];(R=s.current)!=null&&R.loop&&(Q=se+H<0?G[G.length-1]:se+H===G.length?G[0]:G[se+H]),Q&&_.setState("value",Q.getAttribute(hf))}function $(H){let R=Y(),X=R==null?void 0:R.closest(rm),G;for(;X&&!G;)X=H>0?ike(X,rm):ake(X,rm),G=X==null?void 0:X.querySelector(VI);G?_.setState("value",G.getAttribute(hf)):P(H)}let q=()=>D(F().length-1),M=H=>{H.preventDefault(),H.metaKey?q():H.altKey?$(1):P(1)},ue=H=>{H.preventDefault(),H.metaKey?D(0):H.altKey?$(-1):P(-1)};return y.createElement(nc.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:H=>{var R;(R=g.onKeyDown)==null||R.call(g,H);let X=H.nativeEvent.isComposing||H.keyCode===229;if(!(H.defaultPrevented||X))switch(H.key){case"n":case"j":{w&&H.ctrlKey&&M(H);break}case"ArrowDown":{M(H);break}case"p":case"k":{w&&H.ctrlKey&&ue(H);break}case"ArrowUp":{ue(H);break}case"Home":{H.preventDefault(),D(0);break}case"End":{H.preventDefault(),q();break}case"Enter":{H.preventDefault();let G=Y();if(G){let se=new Event(hC);G.dispatchEvent(se)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:lke},l),Qx(e,H=>y.createElement(dq.Provider,{value:_},y.createElement(fq.Provider,{value:A},H))))}),JEe=y.forwardRef((e,t)=>{var n,r;let i=Pr(),a=y.useRef(null),o=y.useContext(hq),s=oy(),l=pq(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:o==null?void 0:o.forceMount;du(()=>{if(!c)return s.item(i,o==null?void 0:o.id)},[c]);let f=gq(i,a,[e.value,e.children,a],e.keywords),u=qO(),d=Fl(k=>k.value&&k.value===f.current),h=Fl(k=>c||s.filter()===!1?!0:k.search?k.filtered.items.get(i)>0:!0);y.useEffect(()=>{let k=a.current;if(!(!k||e.disabled))return k.addEventListener(hC,m),()=>k.removeEventListener(hC,m)},[h,e.onSelect,e.disabled]);function m(){var k,_;b(),(_=(k=l.current).onSelect)==null||_.call(k,f.current)}function b(){u.setState("value",f.current,!0)}if(!h)return null;let{disabled:w,value:g,onSelect:v,forceMount:x,keywords:E,...C}=e;return y.createElement(nc.div,{ref:go(a,t),...C,id:i,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!d,"data-disabled":!!w,"data-selected":!!d,onPointerMove:w||s.getDisablePointerSelection()?void 0:b,onClick:w?void 0:m},e.children)}),XEe=y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Pr(),s=y.useRef(null),l=y.useRef(null),c=Pr(),f=oy(),u=Fl(h=>i||f.filter()===!1?!0:h.search?h.filtered.groups.has(o):!0);du(()=>f.group(o),[]),gq(o,s,[e.value,e.heading,l]);let d=y.useMemo(()=>({id:o,forceMount:i}),[i]);return y.createElement(nc.div,{ref:go(s,t),...a,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&y.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Qx(e,h=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},y.createElement(hq.Provider,{value:d},h))))}),QEe=y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=y.useRef(null),a=Fl(o=>!o.search);return!n&&!a?null:y.createElement(nc.div,{ref:go(i,t),...r,"cmdk-separator":"",role:"separator"})}),ZEe=y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=qO(),o=Fl(c=>c.search),s=Fl(c=>c.selectedItemId),l=oy();return y.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),y.createElement(nc.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":s,id:l.inputId,type:"text",value:i?e.value:o,onChange:c=>{i||a.setState("search",c.target.value),n==null||n(c.target.value)}})}),eke=y.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=y.useRef(null),o=y.useRef(null),s=Fl(c=>c.selectedItemId),l=oy();return y.useEffect(()=>{if(o.current&&a.current){let c=o.current,f=a.current,u,d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let h=c.offsetHeight;f.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return d.observe(c),()=>{cancelAnimationFrame(u),d.unobserve(c)}}},[]),y.createElement(nc.div,{ref:go(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:l.listId},Qx(e,c=>y.createElement("div",{ref:go(o,l.listInnerRef),"cmdk-list-sizer":""},c)))}),tke=y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return y.createElement(aq,{open:n,onOpenChange:r},y.createElement(oq,{container:o},y.createElement(sq,{"cmdk-overlay":"",className:i}),y.createElement(lq,{"aria-label":e.label,"cmdk-dialog":"",className:a},y.createElement(mq,{ref:t,...s}))))}),nke=y.forwardRef((e,t)=>Fl(n=>n.filtered.count===0)?y.createElement(nc.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),rke=y.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...a}=e;return y.createElement(nc.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Qx(e,o=>y.createElement("div",{"aria-hidden":!0},o)))}),Du=Object.assign(mq,{List:eke,Item:JEe,Input:ZEe,Group:XEe,Separator:QEe,Dialog:tke,Empty:nke,Loading:rke});function ike(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ake(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function pq(e){let t=y.useRef(e);return du(()=>{t.current=e}),t}var du=typeof window>"u"?y.useEffect:y.useLayoutEffect;function mf(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function Fl(e){let t=qO(),n=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,n,n)}function gq(e,t,n,r=[]){let i=y.useRef(),a=oy();return du(()=>{var o;let s=(()=>{var c;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(c=f.current.textContent)==null?void 0:c.trim():i.current}})(),l=r.map(c=>c.trim());a.value(e,s,l),(o=t.current)==null||o.setAttribute(hf,s),i.current=s}),i}var oke=()=>{let[e,t]=y.useState(),n=mf(()=>new Map);return du(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function ske(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Qx({asChild:e,children:t},n){return e&&y.isValidElement(t)?y.cloneElement(ske(t),{ref:t.ref},n(t.props.children)):n(t)}var lke={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},yq=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cke="VisuallyHidden",uke=y.forwardRef((e,t)=>p.jsx(Ze.span,{...e,ref:t,style:{...yq,...e.style}}));uke.displayName=cke;function VO(e){const t=e+"CollectionProvider",[n,r]=ec(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=b=>{const{scope:w,children:g}=b,v=ee.useRef(null),x=ee.useRef(new Map).current;return p.jsx(i,{scope:w,itemMap:x,collectionRef:v,children:g})};o.displayName=t;const s=e+"CollectionSlot",l=uu(s),c=ee.forwardRef((b,w)=>{const{scope:g,children:v}=b,x=a(s,g),E=It(w,x.collectionRef);return p.jsx(l,{ref:E,children:v})});c.displayName=s;const f=e+"CollectionItemSlot",u="data-radix-collection-item",d=uu(f),h=ee.forwardRef((b,w)=>{const{scope:g,children:v,...x}=b,E=ee.useRef(null),C=It(w,E),k=a(f,g);return ee.useEffect(()=>(k.itemMap.set(E,{ref:E,...x}),()=>void k.itemMap.delete(E))),p.jsx(d,{[u]:"",ref:C,children:v})});h.displayName=f;function m(b){const w=a(e+"CollectionConsumer",b);return ee.useCallback(()=>{const v=w.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(w.itemMap.values()).sort((k,_)=>x.indexOf(k.ref.current)-x.indexOf(_.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:o,Slot:c,ItemSlot:h},m,r]}var fke=y.createContext(void 0);function Zx(e){const t=y.useContext(fke);return e||t||"ltr"}function dke(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function hke(e){const[t,n]=y.useState(void 0);return kr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const a=i[0];let o,s;if("borderBoxSize"in a){const l=a.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,s=c.blockSize}else o=e.offsetWidth,s=e.offsetHeight;n({width:o,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const mke=["top","right","bottom","left"],Ul=Math.min,gi=Math.max,H0=Math.round,ab=Math.floor,fo=e=>({x:e,y:e}),pke={left:"right",right:"left",bottom:"top",top:"bottom"},gke={start:"end",end:"start"};function mC(e,t,n){return gi(e,Ul(t,n))}function Ss(e,t){return typeof e=="function"?e(t):e}function xs(e){return e.split("-")[0]}function Ch(e){return e.split("-")[1]}function KO(e){return e==="x"?"y":"x"}function GO(e){return e==="y"?"height":"width"}const yke=new Set(["top","bottom"]);function ao(e){return yke.has(xs(e))?"y":"x"}function YO(e){return KO(ao(e))}function bke(e,t,n){n===void 0&&(n=!1);const r=Ch(e),i=YO(e),a=GO(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=q0(o)),[o,q0(o)]}function vke(e){const t=q0(e);return[pC(e),t,pC(t)]}function pC(e){return e.replace(/start|end/g,t=>gke[t])}const KI=["left","right"],GI=["right","left"],Ske=["top","bottom"],xke=["bottom","top"];function wke(e,t,n){switch(e){case"top":case"bottom":return n?t?GI:KI:t?KI:GI;case"left":case"right":return t?Ske:xke;default:return[]}}function _ke(e,t,n,r){const i=Ch(e);let a=wke(xs(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(pC)))),a}function q0(e){return e.replace(/left|right|bottom|top/g,t=>pke[t])}function Eke(e){return{top:0,right:0,bottom:0,left:0,...e}}function bq(e){return typeof e!="number"?Eke(e):{top:e,right:e,bottom:e,left:e}}function V0(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function YI(e,t,n){let{reference:r,floating:i}=e;const a=ao(t),o=YO(t),s=GO(o),l=xs(t),c=a==="y",f=r.x+r.width/2-i.width/2,u=r.y+r.height/2-i.height/2,d=r[s]/2-i[s]/2;let h;switch(l){case"top":h={x:f,y:r.y-i.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:u};break;case"left":h={x:r.x-i.width,y:u};break;default:h={x:r.x,y:r.y}}switch(Ch(t)){case"start":h[o]-=d*(n&&c?-1:1);break;case"end":h[o]+=d*(n&&c?-1:1);break}return h}async function kke(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:h=0}=Ss(t,e),m=bq(h),w=s[d?u==="floating"?"reference":"floating":u],g=V0(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(w)))==null||n?w:w.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:l})),v=u==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),E=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},C=V0(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:x,strategy:l}):v);return{top:(g.top-C.top+m.top)/E.y,bottom:(C.bottom-g.bottom+m.bottom)/E.y,left:(g.left-C.left+m.left)/E.x,right:(C.right-g.right+m.right)/E.x}}const Cke=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:u}=YI(c,r,l),d=r,h={},m=0;for(let w=0;w<s.length;w++){var b;const{name:g,fn:v}=s[w],{x,y:E,data:C,reset:k}=await v({x:f,y:u,initialPlacement:r,placement:d,strategy:i,middlewareData:h,rects:c,platform:{...o,detectOverflow:(b=o.detectOverflow)!=null?b:kke},elements:{reference:e,floating:t}});f=x??f,u=E??u,h={...h,[g]:{...h[g],...C}},k&&m<=50&&(m++,typeof k=="object"&&(k.placement&&(d=k.placement),k.rects&&(c=k.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:f,y:u}=YI(c,d,l)),w=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:h}},Tke=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:c,padding:f=0}=Ss(e,t)||{};if(c==null)return{};const u=bq(f),d={x:n,y:r},h=YO(i),m=GO(h),b=await o.getDimensions(c),w=h==="y",g=w?"top":"left",v=w?"bottom":"right",x=w?"clientHeight":"clientWidth",E=a.reference[m]+a.reference[h]-d[h]-a.floating[m],C=d[h]-a.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let _=k?k[x]:0;(!_||!await(o.isElement==null?void 0:o.isElement(k)))&&(_=s.floating[x]||a.floating[m]);const A=E/2-C/2,I=_/2-b[m]/2-1,O=Ul(u[g],I),z=Ul(u[v],I),U=O,J=_-b[m]-z,Y=_/2-b[m]/2+A,F=mC(U,Y,J),D=!l.arrow&&Ch(i)!=null&&Y!==F&&a.reference[m]/2-(Y<U?O:z)-b[m]/2<0,P=D?Y<U?Y-U:Y-J:0;return{[h]:d[h]+P,data:{[h]:F,centerOffset:Y-F-P,...D&&{alignmentOffset:P}},reset:D}}}),Rke=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:b=!0,...w}=Ss(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const g=xs(i),v=ao(s),x=xs(s)===s,E=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=d||(x||!b?[q0(s)]:vke(s)),k=m!=="none";!d&&k&&C.push(..._ke(s,b,m,E));const _=[s,...C],A=await l.detectOverflow(t,w),I=[];let O=((r=a.flip)==null?void 0:r.overflows)||[];if(f&&I.push(A[g]),u){const Y=bke(i,o,E);I.push(A[Y[0]],A[Y[1]])}if(O=[...O,{placement:i,overflows:I}],!I.every(Y=>Y<=0)){var z,U;const Y=(((z=a.flip)==null?void 0:z.index)||0)+1,F=_[Y];if(F&&(!(u==="alignment"?v!==ao(F):!1)||O.every($=>ao($.placement)===v?$.overflows[0]>0:!0)))return{data:{index:Y,overflows:O},reset:{placement:F}};let D=(U=O.filter(P=>P.overflows[0]<=0).sort((P,$)=>P.overflows[1]-$.overflows[1])[0])==null?void 0:U.placement;if(!D)switch(h){case"bestFit":{var J;const P=(J=O.filter($=>{if(k){const q=ao($.placement);return q===v||q==="y"}return!0}).map($=>[$.placement,$.overflows.filter(q=>q>0).reduce((q,M)=>q+M,0)]).sort(($,q)=>$[1]-q[1])[0])==null?void 0:J[0];P&&(D=P);break}case"initialPlacement":D=s;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function WI(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function JI(e){return mke.some(t=>e[t]>=0)}const Ake=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=Ss(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),s=WI(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:JI(s)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),s=WI(o,n.floating);return{data:{escapedOffsets:s,escaped:JI(s)}}}default:return{}}}}},vq=new Set(["left","top"]);async function Oke(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=xs(n),s=Ch(n),l=ao(n)==="y",c=vq.has(o)?-1:1,f=a&&l?-1:1,u=Ss(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof m=="number"&&(h=s==="end"?m*-1:m),l?{x:h*f,y:d*c}:{x:d*c,y:h*f}}const Mke=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await Oke(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},Nke=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:g=>{let{x:v,y:x}=g;return{x:v,y:x}}},...c}=Ss(e,t),f={x:n,y:r},u=await a.detectOverflow(t,c),d=ao(xs(i)),h=KO(d);let m=f[h],b=f[d];if(o){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",x=m+u[g],E=m-u[v];m=mC(x,m,E)}if(s){const g=d==="y"?"top":"left",v=d==="y"?"bottom":"right",x=b+u[g],E=b-u[v];b=mC(x,b,E)}const w=l.fn({...t,[h]:m,[d]:b});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[h]:o,[d]:s}}}}}},Dke=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Ss(e,t),f={x:n,y:r},u=ao(i),d=KO(u);let h=f[d],m=f[u];const b=Ss(s,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const x=d==="y"?"height":"width",E=a.reference[d]-a.floating[x]+w.mainAxis,C=a.reference[d]+a.reference[x]-w.mainAxis;h<E?h=E:h>C&&(h=C)}if(c){var g,v;const x=d==="y"?"width":"height",E=vq.has(xs(i)),C=a.reference[u]-a.floating[x]+(E&&((g=o.offset)==null?void 0:g[u])||0)+(E?0:w.crossAxis),k=a.reference[u]+a.reference[x]+(E?0:((v=o.offset)==null?void 0:v[u])||0)-(E?w.crossAxis:0);m<C?m=C:m>k&&(m=k)}return{[d]:h,[u]:m}}}},jke=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:l=()=>{},...c}=Ss(e,t),f=await o.detectOverflow(t,c),u=xs(i),d=Ch(i),h=ao(i)==="y",{width:m,height:b}=a.floating;let w,g;u==="top"||u==="bottom"?(w=u,g=d===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(g=u,w=d==="end"?"top":"bottom");const v=b-f.top-f.bottom,x=m-f.left-f.right,E=Ul(b-f[w],v),C=Ul(m-f[g],x),k=!t.middlewareData.shift;let _=E,A=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=v),k&&!d){const O=gi(f.left,0),z=gi(f.right,0),U=gi(f.top,0),J=gi(f.bottom,0);h?A=m-2*(O!==0||z!==0?O+z:gi(f.left,f.right)):_=b-2*(U!==0||J!==0?U+J:gi(f.top,f.bottom))}await l({...t,availableWidth:A,availableHeight:_});const I=await o.getDimensions(s.floating);return m!==I.width||b!==I.height?{reset:{rects:!0}}:{}}}};function ew(){return typeof window<"u"}function Th(e){return Sq(e)?(e.nodeName||"").toLowerCase():"#document"}function Ci(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Co(e){var t;return(t=(Sq(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Sq(e){return ew()?e instanceof Node||e instanceof Ci(e).Node:!1}function $a(e){return ew()?e instanceof Element||e instanceof Ci(e).Element:!1}function bo(e){return ew()?e instanceof HTMLElement||e instanceof Ci(e).HTMLElement:!1}function XI(e){return!ew()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ci(e).ShadowRoot}const Ike=new Set(["inline","contents"]);function sy(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=La(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ike.has(i)}const $ke=new Set(["table","td","th"]);function Lke(e){return $ke.has(Th(e))}const zke=[":popover-open",":modal"];function tw(e){return zke.some(t=>{try{return e.matches(t)}catch{return!1}})}const Pke=["transform","translate","scale","rotate","perspective"],Fke=["transform","translate","scale","rotate","perspective","filter"],Uke=["paint","layout","strict","content"];function WO(e){const t=JO(),n=$a(e)?La(e):e;return Pke.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Fke.some(r=>(n.willChange||"").includes(r))||Uke.some(r=>(n.contain||"").includes(r))}function Bke(e){let t=Bl(e);for(;bo(t)&&!Bd(t);){if(WO(t))return t;if(tw(t))return null;t=Bl(t)}return null}function JO(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Hke=new Set(["html","body","#document"]);function Bd(e){return Hke.has(Th(e))}function La(e){return Ci(e).getComputedStyle(e)}function nw(e){return $a(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bl(e){if(Th(e)==="html")return e;const t=e.assignedSlot||e.parentNode||XI(e)&&e.host||Co(e);return XI(t)?t.host:t}function xq(e){const t=Bl(e);return Bd(t)?e.ownerDocument?e.ownerDocument.body:e.body:bo(t)&&sy(t)?t:xq(t)}function Xp(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=xq(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=Ci(i);if(a){const s=gC(o);return t.concat(o,o.visualViewport||[],sy(i)?i:[],s&&n?Xp(s):[])}return t.concat(i,Xp(i,[],n))}function gC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wq(e){const t=La(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=bo(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=H0(n)!==a||H0(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function XO(e){return $a(e)?e:e.contextElement}function id(e){const t=XO(e);if(!bo(t))return fo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=wq(t);let o=(a?H0(n.width):n.width)/r,s=(a?H0(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const qke=fo(0);function _q(e){const t=Ci(e);return!JO()||!t.visualViewport?qke:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vke(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ci(e)?!1:t}function hu(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=XO(e);let o=fo(1);t&&(r?$a(r)&&(o=id(r)):o=id(e));const s=Vke(a,n,r)?_q(a):fo(0);let l=(i.left+s.x)/o.x,c=(i.top+s.y)/o.y,f=i.width/o.x,u=i.height/o.y;if(a){const d=Ci(a),h=r&&$a(r)?Ci(r):r;let m=d,b=gC(m);for(;b&&r&&h!==m;){const w=id(b),g=b.getBoundingClientRect(),v=La(b),x=g.left+(b.clientLeft+parseFloat(v.paddingLeft))*w.x,E=g.top+(b.clientTop+parseFloat(v.paddingTop))*w.y;l*=w.x,c*=w.y,f*=w.x,u*=w.y,l+=x,c+=E,m=Ci(b),b=gC(m)}}return V0({width:f,height:u,x:l,y:c})}function rw(e,t){const n=nw(e).scrollLeft;return t?t.left+n:hu(Co(e)).left+n}function Eq(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-rw(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Kke(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Co(r),s=t?tw(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=fo(1);const f=fo(0),u=bo(r);if((u||!u&&!a)&&((Th(r)!=="body"||sy(o))&&(l=nw(r)),bo(r))){const h=hu(r);c=id(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const d=o&&!u&&!a?Eq(o,l):fo(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-l.scrollTop*c.y+f.y+d.y}}function Gke(e){return Array.from(e.getClientRects())}function Yke(e){const t=Co(e),n=nw(e),r=e.ownerDocument.body,i=gi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=gi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+rw(e);const s=-n.scrollTop;return La(r).direction==="rtl"&&(o+=gi(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}const QI=25;function Wke(e,t){const n=Ci(e),r=Co(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const f=JO();(!f||f&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=rw(r);if(c<=0){const f=r.ownerDocument,u=f.body,d=getComputedStyle(u),h=f.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,m=Math.abs(r.clientWidth-u.clientWidth-h);m<=QI&&(a-=m)}else c<=QI&&(a+=c);return{width:a,height:o,x:s,y:l}}const Jke=new Set(["absolute","fixed"]);function Xke(e,t){const n=hu(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=bo(e)?id(e):fo(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,c=r*a.y;return{width:o,height:s,x:l,y:c}}function ZI(e,t,n){let r;if(t==="viewport")r=Wke(e,n);else if(t==="document")r=Yke(Co(e));else if($a(t))r=Xke(t,n);else{const i=_q(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return V0(r)}function kq(e,t){const n=Bl(e);return n===t||!$a(n)||Bd(n)?!1:La(n).position==="fixed"||kq(n,t)}function Qke(e,t){const n=t.get(e);if(n)return n;let r=Xp(e,[],!1).filter(s=>$a(s)&&Th(s)!=="body"),i=null;const a=La(e).position==="fixed";let o=a?Bl(e):e;for(;$a(o)&&!Bd(o);){const s=La(o),l=WO(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&Jke.has(i.position)||sy(o)&&!l&&kq(e,o))?r=r.filter(f=>f!==o):i=s,o=Bl(o)}return t.set(e,r),r}function Zke(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?tw(t)?[]:Qke(t,this._c):[].concat(n),r],s=o[0],l=o.reduce((c,f)=>{const u=ZI(t,f,i);return c.top=gi(u.top,c.top),c.right=Ul(u.right,c.right),c.bottom=Ul(u.bottom,c.bottom),c.left=gi(u.left,c.left),c},ZI(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function eCe(e){const{width:t,height:n}=wq(e);return{width:t,height:n}}function tCe(e,t,n){const r=bo(t),i=Co(t),a=n==="fixed",o=hu(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=fo(0);function c(){l.x=rw(i)}if(r||!r&&!a)if((Th(t)!=="body"||sy(i))&&(s=nw(t)),r){const h=hu(t,!0,a,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else i&&c();a&&!r&&i&&c();const f=i&&!r&&!a?Eq(i,s):fo(0),u=o.left+s.scrollLeft-l.x-f.x,d=o.top+s.scrollTop-l.y-f.y;return{x:u,y:d,width:o.width,height:o.height}}function s_(e){return La(e).position==="static"}function e$(e,t){if(!bo(e)||La(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Co(e)===n&&(n=n.ownerDocument.body),n}function Cq(e,t){const n=Ci(e);if(tw(e))return n;if(!bo(e)){let i=Bl(e);for(;i&&!Bd(i);){if($a(i)&&!s_(i))return i;i=Bl(i)}return n}let r=e$(e,t);for(;r&&Lke(r)&&s_(r);)r=e$(r,t);return r&&Bd(r)&&s_(r)&&!WO(r)?n:r||Bke(e)||n}const nCe=async function(e){const t=this.getOffsetParent||Cq,n=this.getDimensions,r=await n(e.floating);return{reference:tCe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rCe(e){return La(e).direction==="rtl"}const iCe={convertOffsetParentRelativeRectToViewportRelativeRect:Kke,getDocumentElement:Co,getClippingRect:Zke,getOffsetParent:Cq,getElementRects:nCe,getClientRects:Gke,getDimensions:eCe,getScale:id,isElement:$a,isRTL:rCe};function Tq(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function aCe(e,t){let n=null,r;const i=Co(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const c=e.getBoundingClientRect(),{left:f,top:u,width:d,height:h}=c;if(s||t(),!d||!h)return;const m=ab(u),b=ab(i.clientWidth-(f+d)),w=ab(i.clientHeight-(u+h)),g=ab(f),x={rootMargin:-m+"px "+-b+"px "+-w+"px "+-g+"px",threshold:gi(0,Ul(1,l))||1};let E=!0;function C(k){const _=k[0].intersectionRatio;if(_!==l){if(!E)return o();_?o(!1,_):r=setTimeout(()=>{o(!1,1e-7)},1e3)}_===1&&!Tq(c,e.getBoundingClientRect())&&o(),E=!1}try{n=new IntersectionObserver(C,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return o(!0),a}function oCe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=XO(e),f=i||a?[...c?Xp(c):[],...Xp(t)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),a&&g.addEventListener("resize",n)});const u=c&&s?aCe(c,n):null;let d=-1,h=null;o&&(h=new ResizeObserver(g=>{let[v]=g;v&&v.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m,b=l?hu(e):null;l&&w();function w(){const g=hu(e);b&&!Tq(b,g)&&n(),b=g,m=requestAnimationFrame(w)}return n(),()=>{var g;f.forEach(v=>{i&&v.removeEventListener("scroll",n),a&&v.removeEventListener("resize",n)}),u==null||u(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const sCe=Mke,lCe=Nke,cCe=Rke,uCe=jke,fCe=Ake,t$=Tke,dCe=Dke,hCe=(e,t,n)=>{const r=new Map,i={platform:iCe,...n},a={...i.platform,_c:r};return Cke(e,t,{...i,platform:a})};var mCe=typeof document<"u",pCe=function(){},tv=mCe?y.useLayoutEffect:pCe;function K0(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!K0(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const a=i[r];if(!(a==="_owner"&&e.$$typeof)&&!K0(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Rq(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function n$(e,t){const n=Rq(e);return Math.round(t*n)/n}function l_(e){const t=y.useRef(e);return tv(()=>{t.current=e}),t}function gCe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[f,u]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=y.useState(r);K0(d,r)||h(r);const[m,b]=y.useState(null),[w,g]=y.useState(null),v=y.useCallback($=>{$!==k.current&&(k.current=$,b($))},[]),x=y.useCallback($=>{$!==_.current&&(_.current=$,g($))},[]),E=a||m,C=o||w,k=y.useRef(null),_=y.useRef(null),A=y.useRef(f),I=l!=null,O=l_(l),z=l_(i),U=l_(c),J=y.useCallback(()=>{if(!k.current||!_.current)return;const $={placement:t,strategy:n,middleware:d};z.current&&($.platform=z.current),hCe(k.current,_.current,$).then(q=>{const M={...q,isPositioned:U.current!==!1};Y.current&&!K0(A.current,M)&&(A.current=M,Gd.flushSync(()=>{u(M)}))})},[d,t,n,z,U]);tv(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,u($=>({...$,isPositioned:!1})))},[c]);const Y=y.useRef(!1);tv(()=>(Y.current=!0,()=>{Y.current=!1}),[]),tv(()=>{if(E&&(k.current=E),C&&(_.current=C),E&&C){if(O.current)return O.current(E,C,J);J()}},[E,C,J,O,I]);const F=y.useMemo(()=>({reference:k,floating:_,setReference:v,setFloating:x}),[v,x]),D=y.useMemo(()=>({reference:E,floating:C}),[E,C]),P=y.useMemo(()=>{const $={position:n,left:0,top:0};if(!D.floating)return $;const q=n$(D.floating,f.x),M=n$(D.floating,f.y);return s?{...$,transform:"translate("+q+"px, "+M+"px)",...Rq(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:M}},[n,s,D.floating,f.x,f.y]);return y.useMemo(()=>({...f,update:J,refs:F,elements:D,floatingStyles:P}),[f,J,F,D,P])}const yCe=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?t$({element:r.current,padding:i}).fn(n):{}:r?t$({element:r,padding:i}).fn(n):{}}}},bCe=(e,t)=>({...sCe(e),options:[e,t]}),vCe=(e,t)=>({...lCe(e),options:[e,t]}),SCe=(e,t)=>({...dCe(e),options:[e,t]}),xCe=(e,t)=>({...cCe(e),options:[e,t]}),wCe=(e,t)=>({...uCe(e),options:[e,t]}),_Ce=(e,t)=>({...fCe(e),options:[e,t]}),ECe=(e,t)=>({...yCe(e),options:[e,t]});var kCe="Arrow",Aq=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...a}=e;return p.jsx(Ze.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Aq.displayName=kCe;var CCe=Aq,QO="Popper",[Oq,iw]=ec(QO),[TCe,Mq]=Oq(QO),Nq=e=>{const{__scopePopper:t,children:n}=e,[r,i]=y.useState(null);return p.jsx(TCe,{scope:t,anchor:r,onAnchorChange:i,children:n})};Nq.displayName=QO;var Dq="PopperAnchor",jq=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=Mq(Dq,n),o=y.useRef(null),s=It(t,o),l=y.useRef(null);return y.useEffect(()=>{const c=l.current;l.current=(r==null?void 0:r.current)||o.current,c!==l.current&&a.onAnchorChange(l.current)}),r?null:p.jsx(Ze.div,{...i,ref:s})});jq.displayName=Dq;var ZO="PopperContent",[RCe,ACe]=Oq(ZO),Iq=y.forwardRef((e,t)=>{var Q,oe,ye,Ae,Fe,ve;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:a="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:u="partial",hideWhenDetached:d=!1,updatePositionStrategy:h="optimized",onPlaced:m,...b}=e,w=Mq(ZO,n),[g,v]=y.useState(null),x=It(t,Yt=>v(Yt)),[E,C]=y.useState(null),k=hke(E),_=(k==null?void 0:k.width)??0,A=(k==null?void 0:k.height)??0,I=r+(a!=="center"?"-"+a:""),O=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},z=Array.isArray(c)?c:[c],U=z.length>0,J={padding:O,boundary:z.filter(MCe),altBoundary:U},{refs:Y,floatingStyles:F,placement:D,isPositioned:P,middlewareData:$}=gCe({strategy:"fixed",placement:I,whileElementsMounted:(...Yt)=>oCe(...Yt,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[bCe({mainAxis:i+A,alignmentAxis:o}),l&&vCe({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?SCe():void 0,...J}),l&&xCe({...J}),wCe({...J,apply:({elements:Yt,rects:Rn,availableWidth:Ni,availableHeight:An})=>{const{width:mr,height:Ns}=Rn.reference,hn=Yt.floating.style;hn.setProperty("--radix-popper-available-width",`${Ni}px`),hn.setProperty("--radix-popper-available-height",`${An}px`),hn.setProperty("--radix-popper-anchor-width",`${mr}px`),hn.setProperty("--radix-popper-anchor-height",`${Ns}px`)}}),E&&ECe({element:E,padding:s}),NCe({arrowWidth:_,arrowHeight:A}),d&&_Ce({strategy:"referenceHidden",...J})]}),[q,M]=zq(D),ue=yo(m);kr(()=>{P&&(ue==null||ue())},[P,ue]);const H=(Q=$.arrow)==null?void 0:Q.x,R=(oe=$.arrow)==null?void 0:oe.y,X=((ye=$.arrow)==null?void 0:ye.centerOffset)!==0,[G,se]=y.useState();return kr(()=>{g&&se(window.getComputedStyle(g).zIndex)},[g]),p.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:P?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[(Ae=$.transformOrigin)==null?void 0:Ae.x,(Fe=$.transformOrigin)==null?void 0:Fe.y].join(" "),...((ve=$.hide)==null?void 0:ve.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(RCe,{scope:n,placedSide:q,onArrowChange:C,arrowX:H,arrowY:R,shouldHideArrow:X,children:p.jsx(Ze.div,{"data-side":q,"data-align":M,...b,ref:x,style:{...b.style,animation:P?void 0:"none"}})})})});Iq.displayName=ZO;var $q="PopperArrow",OCe={top:"bottom",right:"left",bottom:"top",left:"right"},Lq=y.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,a=ACe($q,r),o=OCe[a.placedSide];return p.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:p.jsx(CCe,{...i,ref:n,style:{...i.style,display:"block"}})})});Lq.displayName=$q;function MCe(e){return e!==null}var NCe=e=>({name:"transformOrigin",options:e,fn(t){var w,g,v;const{placement:n,rects:r,middlewareData:i}=t,o=((w=i.arrow)==null?void 0:w.centerOffset)!==0,s=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[c,f]=zq(n),u={start:"0%",center:"50%",end:"100%"}[f],d=(((g=i.arrow)==null?void 0:g.x)??0)+s/2,h=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let m="",b="";return c==="bottom"?(m=o?u:`${d}px`,b=`${-l}px`):c==="top"?(m=o?u:`${d}px`,b=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,b=o?u:`${h}px`):c==="left"&&(m=`${r.floating.width+l}px`,b=o?u:`${h}px`),{data:{x:m,y:b}}}});function zq(e){const[t,n="center"]=e.split("-");return[t,n]}var Pq=Nq,Fq=jq,Uq=Iq,Bq=Lq,c_="rovingFocusGroup.onEntryFocus",DCe={bubbles:!1,cancelable:!0},ly="RovingFocusGroup",[yC,Hq,jCe]=VO(ly),[ICe,aw]=ec(ly,[jCe]),[$Ce,LCe]=ICe(ly),qq=y.forwardRef((e,t)=>p.jsx(yC.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(yC.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(zCe,{...e,ref:t})})}));qq.displayName=ly;var zCe=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...u}=e,d=y.useRef(null),h=It(t,d),m=Zx(a),[b,w]=Pl({prop:o,defaultProp:s??null,onChange:l,caller:ly}),[g,v]=y.useState(!1),x=yo(c),E=Hq(n),C=y.useRef(!1),[k,_]=y.useState(0);return y.useEffect(()=>{const A=d.current;if(A)return A.addEventListener(c_,x),()=>A.removeEventListener(c_,x)},[x]),p.jsx($Ce,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:b,onItemFocus:y.useCallback(A=>w(A),[w]),onItemShiftTab:y.useCallback(()=>v(!0),[]),onFocusableItemAdd:y.useCallback(()=>_(A=>A+1),[]),onFocusableItemRemove:y.useCallback(()=>_(A=>A-1),[]),children:p.jsx(Ze.div,{tabIndex:g||k===0?-1:0,"data-orientation":r,...u,ref:h,style:{outline:"none",...e.style},onMouseDown:xe(e.onMouseDown,()=>{C.current=!0}),onFocus:xe(e.onFocus,A=>{const I=!C.current;if(A.target===A.currentTarget&&I&&!g){const O=new CustomEvent(c_,DCe);if(A.currentTarget.dispatchEvent(O),!O.defaultPrevented){const z=E().filter(D=>D.focusable),U=z.find(D=>D.active),J=z.find(D=>D.id===b),F=[U,J,...z].filter(Boolean).map(D=>D.ref.current);Gq(F,f)}}C.current=!1}),onBlur:xe(e.onBlur,()=>v(!1))})})}),Vq="RovingFocusGroupItem",Kq=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,l=Pr(),c=a||l,f=LCe(Vq,n),u=f.currentTabStopId===c,d=Hq(n),{onFocusableItemAdd:h,onFocusableItemRemove:m,currentTabStopId:b}=f;return y.useEffect(()=>{if(r)return h(),()=>m()},[r,h,m]),p.jsx(yC.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:p.jsx(Ze.span,{tabIndex:u?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:xe(e.onMouseDown,w=>{r?f.onItemFocus(c):w.preventDefault()}),onFocus:xe(e.onFocus,()=>f.onItemFocus(c)),onKeyDown:xe(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){f.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const g=UCe(w,f.orientation,f.dir);if(g!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let x=d().filter(E=>E.focusable).map(E=>E.ref.current);if(g==="last")x.reverse();else if(g==="prev"||g==="next"){g==="prev"&&x.reverse();const E=x.indexOf(w.currentTarget);x=f.loop?BCe(x,E+1):x.slice(E+1)}setTimeout(()=>Gq(x))}}),children:typeof o=="function"?o({isCurrentTabStop:u,hasTabStop:b!=null}):o})})});Kq.displayName=Vq;var PCe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function FCe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function UCe(e,t,n){const r=FCe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return PCe[r]}function Gq(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function BCe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Yq=qq,Wq=Kq,bC=["Enter"," "],HCe=["ArrowDown","PageUp","Home"],Jq=["ArrowUp","PageDown","End"],qCe=[...HCe,...Jq],VCe={ltr:[...bC,"ArrowRight"],rtl:[...bC,"ArrowLeft"]},KCe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},cy="Menu",[Qp,GCe,YCe]=VO(cy),[ju,Xq]=ec(cy,[YCe,iw,aw]),ow=iw(),Qq=aw(),[WCe,Iu]=ju(cy),[JCe,uy]=ju(cy),Zq=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ow(t),[l,c]=y.useState(null),f=y.useRef(!1),u=yo(a),d=Zx(i);return y.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),p.jsx(Pq,{...s,children:p.jsx(WCe,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:c,children:p.jsx(JCe,{scope:t,onClose:y.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:d,modal:o,children:r})})})};Zq.displayName=cy;var XCe="MenuAnchor",e2=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=ow(n);return p.jsx(Fq,{...i,...r,ref:t})});e2.displayName=XCe;var t2="MenuPortal",[QCe,eV]=ju(t2,{forceMount:void 0}),tV=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Iu(t2,t);return p.jsx(QCe,{scope:t,forceMount:n,children:p.jsx(tc,{present:n||a.open,children:p.jsx(Yx,{asChild:!0,container:i,children:r})})})};tV.displayName=t2;var ea="MenuContent",[ZCe,n2]=ju(ea),nV=y.forwardRef((e,t)=>{const n=eV(ea,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Iu(ea,e.__scopeMenu),o=uy(ea,e.__scopeMenu);return p.jsx(Qp.Provider,{scope:e.__scopeMenu,children:p.jsx(tc,{present:r||a.open,children:p.jsx(Qp.Slot,{scope:e.__scopeMenu,children:o.modal?p.jsx(eTe,{...i,ref:t}):p.jsx(tTe,{...i,ref:t})})})})}),eTe=y.forwardRef((e,t)=>{const n=Iu(ea,e.__scopeMenu),r=y.useRef(null),i=It(t,r);return y.useEffect(()=>{const a=r.current;if(a)return FO(a)},[]),p.jsx(r2,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:xe(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),tTe=y.forwardRef((e,t)=>{const n=Iu(ea,e.__scopeMenu);return p.jsx(r2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),nTe=uu("MenuContent.ScrollLock"),r2=y.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:d,onDismiss:h,disableOutsideScroll:m,...b}=e,w=Iu(ea,n),g=uy(ea,n),v=ow(n),x=Qq(n),E=GCe(n),[C,k]=y.useState(null),_=y.useRef(null),A=It(t,_,w.onContentChange),I=y.useRef(0),O=y.useRef(""),z=y.useRef(0),U=y.useRef(null),J=y.useRef("right"),Y=y.useRef(0),F=m?Jx:y.Fragment,D=m?{as:nTe,allowPinchZoom:!0}:void 0,P=q=>{var Q,oe;const M=O.current+q,ue=E().filter(ye=>!ye.disabled),H=document.activeElement,R=(Q=ue.find(ye=>ye.ref.current===H))==null?void 0:Q.textValue,X=ue.map(ye=>ye.textValue),G=mTe(X,M,R),se=(oe=ue.find(ye=>ye.textValue===G))==null?void 0:oe.ref.current;(function ye(Ae){O.current=Ae,window.clearTimeout(I.current),Ae!==""&&(I.current=window.setTimeout(()=>ye(""),1e3))})(M),se&&setTimeout(()=>se.focus())};y.useEffect(()=>()=>window.clearTimeout(I.current),[]),PO();const $=y.useCallback(q=>{var ue,H;return J.current===((ue=U.current)==null?void 0:ue.side)&&gTe(q,(H=U.current)==null?void 0:H.area)},[]);return p.jsx(ZCe,{scope:n,searchRef:O,onItemEnter:y.useCallback(q=>{$(q)&&q.preventDefault()},[$]),onItemLeave:y.useCallback(q=>{var M;$(q)||((M=_.current)==null||M.focus(),k(null))},[$]),onTriggerLeave:y.useCallback(q=>{$(q)&&q.preventDefault()},[$]),pointerGraceTimerRef:z,onPointerGraceIntentChange:y.useCallback(q=>{U.current=q},[]),children:p.jsx(F,{...D,children:p.jsx(Gx,{asChild:!0,trapped:i,onMountAutoFocus:xe(a,q=>{var M;q.preventDefault(),(M=_.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:p.jsx(Kx,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:d,onDismiss:h,children:p.jsx(Yq,{asChild:!0,...x,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:xe(l,q=>{g.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(Uq,{role:"menu","aria-orientation":"vertical","data-state":bV(w.open),"data-radix-menu-content":"",dir:g.dir,...v,...b,ref:A,style:{outline:"none",...b.style},onKeyDown:xe(b.onKeyDown,q=>{const ue=q.target.closest("[data-radix-menu-content]")===q.currentTarget,H=q.ctrlKey||q.altKey||q.metaKey,R=q.key.length===1;ue&&(q.key==="Tab"&&q.preventDefault(),!H&&R&&P(q.key));const X=_.current;if(q.target!==X||!qCe.includes(q.key))return;q.preventDefault();const se=E().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);Jq.includes(q.key)&&se.reverse(),dTe(se)}),onBlur:xe(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(I.current),O.current="")}),onPointerMove:xe(e.onPointerMove,Zp(q=>{const M=q.target,ue=Y.current!==q.clientX;if(q.currentTarget.contains(M)&&ue){const H=q.clientX>Y.current?"right":"left";J.current=H,Y.current=q.clientX}}))})})})})})})});nV.displayName=ea;var rTe="MenuGroup",i2=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ze.div,{role:"group",...r,ref:t})});i2.displayName=rTe;var iTe="MenuLabel",rV=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ze.div,{...r,ref:t})});rV.displayName=iTe;var G0="MenuItem",r$="menu.itemSelect",sw=y.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=y.useRef(null),o=uy(G0,e.__scopeMenu),s=n2(G0,e.__scopeMenu),l=It(t,a),c=y.useRef(!1),f=()=>{const u=a.current;if(!n&&u){const d=new CustomEvent(r$,{bubbles:!0,cancelable:!0});u.addEventListener(r$,h=>r==null?void 0:r(h),{once:!0}),N7(u,d),d.defaultPrevented?c.current=!1:o.onClose()}};return p.jsx(iV,{...i,ref:l,disabled:n,onClick:xe(e.onClick,f),onPointerDown:u=>{var d;(d=e.onPointerDown)==null||d.call(e,u),c.current=!0},onPointerUp:xe(e.onPointerUp,u=>{var d;c.current||(d=u.currentTarget)==null||d.click()}),onKeyDown:xe(e.onKeyDown,u=>{const d=s.searchRef.current!=="";n||d&&u.key===" "||bC.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});sw.displayName=G0;var iV=y.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=n2(G0,n),s=Qq(n),l=y.useRef(null),c=It(t,l),[f,u]=y.useState(!1),[d,h]=y.useState("");return y.useEffect(()=>{const m=l.current;m&&h((m.textContent??"").trim())},[a.children]),p.jsx(Qp.ItemSlot,{scope:n,disabled:r,textValue:i??d,children:p.jsx(Wq,{asChild:!0,...s,focusable:!r,children:p.jsx(Ze.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:c,onPointerMove:xe(e.onPointerMove,Zp(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:xe(e.onPointerLeave,Zp(m=>o.onItemLeave(m))),onFocus:xe(e.onFocus,()=>u(!0)),onBlur:xe(e.onBlur,()=>u(!1))})})})}),aTe="MenuCheckboxItem",aV=y.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return p.jsx(uV,{scope:e.__scopeMenu,checked:n,children:p.jsx(sw,{role:"menuitemcheckbox","aria-checked":Y0(n)?"mixed":n,...i,ref:t,"data-state":o2(n),onSelect:xe(i.onSelect,()=>r==null?void 0:r(Y0(n)?!0:!n),{checkForDefaultPrevented:!1})})})});aV.displayName=aTe;var oV="MenuRadioGroup",[oTe,sTe]=ju(oV,{value:void 0,onValueChange:()=>{}}),sV=y.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,a=yo(r);return p.jsx(oTe,{scope:e.__scopeMenu,value:n,onValueChange:a,children:p.jsx(i2,{...i,ref:t})})});sV.displayName=oV;var lV="MenuRadioItem",cV=y.forwardRef((e,t)=>{const{value:n,...r}=e,i=sTe(lV,e.__scopeMenu),a=n===i.value;return p.jsx(uV,{scope:e.__scopeMenu,checked:a,children:p.jsx(sw,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":o2(a),onSelect:xe(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});cV.displayName=lV;var a2="MenuItemIndicator",[uV,lTe]=ju(a2,{checked:!1}),fV=y.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,a=lTe(a2,n);return p.jsx(tc,{present:r||Y0(a.checked)||a.checked===!0,children:p.jsx(Ze.span,{...i,ref:t,"data-state":o2(a.checked)})})});fV.displayName=a2;var cTe="MenuSeparator",dV=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});dV.displayName=cTe;var uTe="MenuArrow",hV=y.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=ow(n);return p.jsx(Bq,{...i,...r,ref:t})});hV.displayName=uTe;var fTe="MenuSub",[HLe,mV]=ju(fTe),km="MenuSubTrigger",pV=y.forwardRef((e,t)=>{const n=Iu(km,e.__scopeMenu),r=uy(km,e.__scopeMenu),i=mV(km,e.__scopeMenu),a=n2(km,e.__scopeMenu),o=y.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=a,c={__scopeMenu:e.__scopeMenu},f=y.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return y.useEffect(()=>f,[f]),y.useEffect(()=>{const u=s.current;return()=>{window.clearTimeout(u),l(null)}},[s,l]),p.jsx(e2,{asChild:!0,...c,children:p.jsx(iV,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":bV(n.open),...e,ref:go(t,i.onTriggerChange),onClick:u=>{var d;(d=e.onClick)==null||d.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:xe(e.onPointerMove,Zp(u=>{a.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:xe(e.onPointerLeave,Zp(u=>{var h,m;f();const d=(h=n.content)==null?void 0:h.getBoundingClientRect();if(d){const b=(m=n.content)==null?void 0:m.dataset.side,w=b==="right",g=w?-5:5,v=d[w?"left":"right"],x=d[w?"right":"left"];a.onPointerGraceIntentChange({area:[{x:u.clientX+g,y:u.clientY},{x:v,y:d.top},{x,y:d.top},{x,y:d.bottom},{x:v,y:d.bottom}],side:b}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(u),u.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:xe(e.onKeyDown,u=>{var h;const d=a.searchRef.current!=="";e.disabled||d&&u.key===" "||VCe[r.dir].includes(u.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),u.preventDefault())})})})});pV.displayName=km;var gV="MenuSubContent",yV=y.forwardRef((e,t)=>{const n=eV(ea,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Iu(ea,e.__scopeMenu),o=uy(ea,e.__scopeMenu),s=mV(gV,e.__scopeMenu),l=y.useRef(null),c=It(t,l);return p.jsx(Qp.Provider,{scope:e.__scopeMenu,children:p.jsx(tc,{present:r||a.open,children:p.jsx(Qp.Slot,{scope:e.__scopeMenu,children:p.jsx(r2,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:c,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var u;o.isUsingKeyboardRef.current&&((u=l.current)==null||u.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:xe(e.onFocusOutside,f=>{f.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:xe(e.onEscapeKeyDown,f=>{o.onClose(),f.preventDefault()}),onKeyDown:xe(e.onKeyDown,f=>{var h;const u=f.currentTarget.contains(f.target),d=KCe[o.dir].includes(f.key);u&&d&&(a.onOpenChange(!1),(h=s.trigger)==null||h.focus(),f.preventDefault())})})})})})});yV.displayName=gV;function bV(e){return e?"open":"closed"}function Y0(e){return e==="indeterminate"}function o2(e){return Y0(e)?"indeterminate":e?"checked":"unchecked"}function dTe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function hTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function mTe(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=hTe(e,Math.max(a,0));i.length===1&&(o=o.filter(c=>c!==n));const l=o.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function pTe(e,t){const{x:n,y:r}=e;let i=!1;for(let a=0,o=t.length-1;a<t.length;o=a++){const s=t[a],l=t[o],c=s.x,f=s.y,u=l.x,d=l.y;f>r!=d>r&&n<(u-c)*(r-f)/(d-f)+c&&(i=!i)}return i}function gTe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return pTe(n,t)}function Zp(e){return t=>t.pointerType==="mouse"?e(t):void 0}var yTe=Zq,bTe=e2,vTe=tV,STe=nV,xTe=i2,wTe=rV,_Te=sw,ETe=aV,kTe=sV,CTe=cV,TTe=fV,RTe=dV,ATe=hV,OTe=pV,MTe=yV,lw="DropdownMenu",[NTe]=ec(lw,[Xq]),qr=Xq(),[DTe,vV]=NTe(lw),SV=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,l=qr(t),c=y.useRef(null),[f,u]=Pl({prop:i,defaultProp:a??!1,onChange:o,caller:lw});return p.jsx(DTe,{scope:t,triggerId:Pr(),triggerRef:c,contentId:Pr(),open:f,onOpenChange:u,onOpenToggle:y.useCallback(()=>u(d=>!d),[u]),modal:s,children:p.jsx(yTe,{...l,open:f,onOpenChange:u,dir:r,modal:s,children:n})})};SV.displayName=lw;var xV="DropdownMenuTrigger",wV=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=vV(xV,n),o=qr(n);return p.jsx(bTe,{asChild:!0,...o,children:p.jsx(Ze.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:go(t,a.triggerRef),onPointerDown:xe(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:xe(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});wV.displayName=xV;var jTe="DropdownMenuPortal",_V=e=>{const{__scopeDropdownMenu:t,...n}=e,r=qr(t);return p.jsx(vTe,{...r,...n})};_V.displayName=jTe;var EV="DropdownMenuContent",kV=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=vV(EV,n),a=qr(n),o=y.useRef(!1);return p.jsx(STe,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:xe(e.onCloseAutoFocus,s=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,s.preventDefault()}),onInteractOutside:xe(e.onInteractOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,f=l.button===2||c;(!i.modal||f)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kV.displayName=EV;var ITe="DropdownMenuGroup",$Te=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qr(n);return p.jsx(xTe,{...i,...r,ref:t})});$Te.displayName=ITe;var LTe="DropdownMenuLabel",zTe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qr(n);return p.jsx(wTe,{...i,...r,ref:t})});zTe.displayName=LTe;var PTe="DropdownMenuItem",CV=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qr(n);return p.jsx(_Te,{...i,...r,ref:t})});CV.displayName=PTe;var FTe="DropdownMenuCheckboxItem",UTe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qr(n);return p.jsx(ETe,{...i,...r,ref:t})});UTe.displayName=FTe;var BTe="DropdownMenuRadioGroup",HTe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qr(n);return p.jsx(kTe,{...i,...r,ref:t})});HTe.displayName=BTe;var qTe="DropdownMenuRadioItem",VTe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qr(n);return p.jsx(CTe,{...i,...r,ref:t})});VTe.displayName=qTe;var KTe="DropdownMenuItemIndicator",GTe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qr(n);return p.jsx(TTe,{...i,...r,ref:t})});GTe.displayName=KTe;var YTe="DropdownMenuSeparator",WTe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qr(n);return p.jsx(RTe,{...i,...r,ref:t})});WTe.displayName=YTe;var JTe="DropdownMenuArrow",XTe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qr(n);return p.jsx(ATe,{...i,...r,ref:t})});XTe.displayName=JTe;var QTe="DropdownMenuSubTrigger",ZTe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qr(n);return p.jsx(OTe,{...i,...r,ref:t})});ZTe.displayName=QTe;var eRe="DropdownMenuSubContent",tRe=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=qr(n);return p.jsx(MTe,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tRe.displayName=eRe;var nRe=SV,rRe=wV,iRe=_V,aRe=kV,oRe=CV;function i$(e,[t,n]){return Math.min(n,Math.max(t,e))}var sRe=[" ","Enter","ArrowUp","ArrowDown"],lRe=[" ","Enter"],mu="Select",[cw,uw,cRe]=VO(mu),[Rh]=ec(mu,[cRe,iw]),fw=iw(),[uRe,rc]=Rh(mu),[fRe,dRe]=Rh(mu),TV=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:l,dir:c,name:f,autoComplete:u,disabled:d,required:h,form:m}=e,b=fw(t),[w,g]=y.useState(null),[v,x]=y.useState(null),[E,C]=y.useState(!1),k=Zx(c),[_,A]=Pl({prop:r,defaultProp:i??!1,onChange:a,caller:mu}),[I,O]=Pl({prop:o,defaultProp:s,onChange:l,caller:mu}),z=y.useRef(null),U=w?m||!!w.closest("form"):!0,[J,Y]=y.useState(new Set),F=Array.from(J).map(D=>D.props.value).join(";");return p.jsx(Pq,{...b,children:p.jsxs(uRe,{required:h,scope:t,trigger:w,onTriggerChange:g,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:C,contentId:Pr(),value:I,onValueChange:O,open:_,onOpenChange:A,dir:k,triggerPointerDownPosRef:z,disabled:d,children:[p.jsx(cw.Provider,{scope:t,children:p.jsx(fRe,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(D=>{Y(P=>new Set(P).add(D))},[]),onNativeOptionRemove:y.useCallback(D=>{Y(P=>{const $=new Set(P);return $.delete(D),$})},[]),children:n})}),U?p.jsxs(WV,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:u,value:I,onChange:D=>O(D.target.value),disabled:d,form:m,children:[I===void 0?p.jsx("option",{value:""}):null,Array.from(J)]},F):null]})})};TV.displayName=mu;var RV="SelectTrigger",AV=y.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,a=fw(n),o=rc(RV,n),s=o.disabled||r,l=It(t,o.onTriggerChange),c=uw(n),f=y.useRef("touch"),[u,d,h]=XV(b=>{const w=c().filter(x=>!x.disabled),g=w.find(x=>x.value===o.value),v=QV(w,b,g);v!==void 0&&o.onValueChange(v.value)}),m=b=>{s||(o.onOpenChange(!0),h()),b&&(o.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return p.jsx(Fq,{asChild:!0,...a,children:p.jsx(Ze.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":JV(o.value)?"":void 0,...i,ref:l,onClick:xe(i.onClick,b=>{b.currentTarget.focus(),f.current!=="mouse"&&m(b)}),onPointerDown:xe(i.onPointerDown,b=>{f.current=b.pointerType;const w=b.target;w.hasPointerCapture(b.pointerId)&&w.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(m(b),b.preventDefault())}),onKeyDown:xe(i.onKeyDown,b=>{const w=u.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&d(b.key),!(w&&b.key===" ")&&sRe.includes(b.key)&&(m(),b.preventDefault())})})})});AV.displayName=RV;var OV="SelectValue",MV=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:a,placeholder:o="",...s}=e,l=rc(OV,n),{onValueNodeHasChildrenChange:c}=l,f=a!==void 0,u=It(t,l.onValueNodeChange);return kr(()=>{c(f)},[c,f]),p.jsx(Ze.span,{...s,ref:u,style:{pointerEvents:"none"},children:JV(l.value)?p.jsx(p.Fragment,{children:o}):a})});MV.displayName=OV;var hRe="SelectIcon",NV=y.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return p.jsx(Ze.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});NV.displayName=hRe;var mRe="SelectPortal",DV=e=>p.jsx(Yx,{asChild:!0,...e});DV.displayName=mRe;var pu="SelectContent",jV=y.forwardRef((e,t)=>{const n=rc(pu,e.__scopeSelect),[r,i]=y.useState();if(kr(()=>{i(new DocumentFragment)},[]),!n.open){const a=r;return a?Gd.createPortal(p.jsx(IV,{scope:e.__scopeSelect,children:p.jsx(cw.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),a):null}return p.jsx($V,{...e,ref:t})});jV.displayName=pu;var ha=10,[IV,ic]=Rh(pu),pRe="SelectContentImpl",gRe=uu("SelectContent.RemoveScroll"),$V=y.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:w,...g}=e,v=rc(pu,n),[x,E]=y.useState(null),[C,k]=y.useState(null),_=It(t,Q=>E(Q)),[A,I]=y.useState(null),[O,z]=y.useState(null),U=uw(n),[J,Y]=y.useState(!1),F=y.useRef(!1);y.useEffect(()=>{if(x)return FO(x)},[x]),PO();const D=y.useCallback(Q=>{const[oe,...ye]=U().map(ve=>ve.ref.current),[Ae]=ye.slice(-1),Fe=document.activeElement;for(const ve of Q)if(ve===Fe||(ve==null||ve.scrollIntoView({block:"nearest"}),ve===oe&&C&&(C.scrollTop=0),ve===Ae&&C&&(C.scrollTop=C.scrollHeight),ve==null||ve.focus(),document.activeElement!==Fe))return},[U,C]),P=y.useCallback(()=>D([A,x]),[D,A,x]);y.useEffect(()=>{J&&P()},[J,P]);const{onOpenChange:$,triggerPointerDownPosRef:q}=v;y.useEffect(()=>{if(x){let Q={x:0,y:0};const oe=Ae=>{var Fe,ve;Q={x:Math.abs(Math.round(Ae.pageX)-(((Fe=q.current)==null?void 0:Fe.x)??0)),y:Math.abs(Math.round(Ae.pageY)-(((ve=q.current)==null?void 0:ve.y)??0))}},ye=Ae=>{Q.x<=10&&Q.y<=10?Ae.preventDefault():x.contains(Ae.target)||$(!1),document.removeEventListener("pointermove",oe),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ye,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ye,{capture:!0})}}},[x,$,q]),y.useEffect(()=>{const Q=()=>$(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[$]);const[M,ue]=XV(Q=>{const oe=U().filter(Fe=>!Fe.disabled),ye=oe.find(Fe=>Fe.ref.current===document.activeElement),Ae=QV(oe,Q,ye);Ae&&setTimeout(()=>Ae.ref.current.focus())}),H=y.useCallback((Q,oe,ye)=>{const Ae=!F.current&&!ye;(v.value!==void 0&&v.value===oe||Ae)&&(I(Q),Ae&&(F.current=!0))},[v.value]),R=y.useCallback(()=>x==null?void 0:x.focus(),[x]),X=y.useCallback((Q,oe,ye)=>{const Ae=!F.current&&!ye;(v.value!==void 0&&v.value===oe||Ae)&&z(Q)},[v.value]),G=r==="popper"?vC:LV,se=G===vC?{side:s,sideOffset:l,align:c,alignOffset:f,arrowPadding:u,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:w}:{};return p.jsx(IV,{scope:n,content:x,viewport:C,onViewportChange:k,itemRefCallback:H,selectedItem:A,onItemLeave:R,itemTextRefCallback:X,focusSelectedItem:P,selectedItemText:O,position:r,isPositioned:J,searchRef:M,children:p.jsx(Jx,{as:gRe,allowPinchZoom:!0,children:p.jsx(Gx,{asChild:!0,trapped:v.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:xe(i,Q=>{var oe;(oe=v.trigger)==null||oe.focus({preventScroll:!0}),Q.preventDefault()}),children:p.jsx(Kx,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:p.jsx(G,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:Q=>Q.preventDefault(),...g,...se,onPlaced:()=>Y(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:xe(g.onKeyDown,Q=>{const oe=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!oe&&Q.key.length===1&&ue(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let Ae=U().filter(Fe=>!Fe.disabled).map(Fe=>Fe.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(Ae=Ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const Fe=Q.target,ve=Ae.indexOf(Fe);Ae=Ae.slice(ve+1)}setTimeout(()=>D(Ae)),Q.preventDefault()}})})})})})})});$V.displayName=pRe;var yRe="SelectItemAlignedPosition",LV=y.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,a=rc(pu,n),o=ic(pu,n),[s,l]=y.useState(null),[c,f]=y.useState(null),u=It(t,_=>f(_)),d=uw(n),h=y.useRef(!1),m=y.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:g,focusSelectedItem:v}=o,x=y.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&c&&b&&w&&g){const _=a.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),I=a.valueNode.getBoundingClientRect(),O=g.getBoundingClientRect();if(a.dir!=="rtl"){const Fe=O.left-A.left,ve=I.left-Fe,Yt=_.left-ve,Rn=_.width+Yt,Ni=Math.max(Rn,A.width),An=window.innerWidth-ha,mr=i$(ve,[ha,Math.max(ha,An-Ni)]);s.style.minWidth=Rn+"px",s.style.left=mr+"px"}else{const Fe=A.right-O.right,ve=window.innerWidth-I.right-Fe,Yt=window.innerWidth-_.right-ve,Rn=_.width+Yt,Ni=Math.max(Rn,A.width),An=window.innerWidth-ha,mr=i$(ve,[ha,Math.max(ha,An-Ni)]);s.style.minWidth=Rn+"px",s.style.right=mr+"px"}const z=d(),U=window.innerHeight-ha*2,J=b.scrollHeight,Y=window.getComputedStyle(c),F=parseInt(Y.borderTopWidth,10),D=parseInt(Y.paddingTop,10),P=parseInt(Y.borderBottomWidth,10),$=parseInt(Y.paddingBottom,10),q=F+D+J+$+P,M=Math.min(w.offsetHeight*5,q),ue=window.getComputedStyle(b),H=parseInt(ue.paddingTop,10),R=parseInt(ue.paddingBottom,10),X=_.top+_.height/2-ha,G=U-X,se=w.offsetHeight/2,Q=w.offsetTop+se,oe=F+D+Q,ye=q-oe;if(oe<=X){const Fe=z.length>0&&w===z[z.length-1].ref.current;s.style.bottom="0px";const ve=c.clientHeight-b.offsetTop-b.offsetHeight,Yt=Math.max(G,se+(Fe?R:0)+ve+P),Rn=oe+Yt;s.style.height=Rn+"px"}else{const Fe=z.length>0&&w===z[0].ref.current;s.style.top="0px";const Yt=Math.max(X,F+b.offsetTop+(Fe?H:0)+se)+ye;s.style.height=Yt+"px",b.scrollTop=oe-X+b.offsetTop}s.style.margin=`${ha}px 0`,s.style.minHeight=M+"px",s.style.maxHeight=U+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[d,a.trigger,a.valueNode,s,c,b,w,g,a.dir,r]);kr(()=>x(),[x]);const[E,C]=y.useState();kr(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const k=y.useCallback(_=>{_&&m.current===!0&&(x(),v==null||v(),m.current=!1)},[x,v]);return p.jsx(vRe,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:k,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:p.jsx(Ze.div,{...i,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});LV.displayName=yRe;var bRe="SelectPopperPosition",vC=y.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ha,...a}=e,o=fw(n);return p.jsx(Uq,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});vC.displayName=bRe;var[vRe,s2]=Rh(pu,{}),SC="SelectViewport",zV=y.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,a=ic(SC,n),o=s2(SC,n),s=It(t,a.onViewportChange),l=y.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),p.jsx(cw.Slot,{scope:n,children:p.jsx(Ze.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:xe(i.onScroll,c=>{const f=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:d}=o;if(d!=null&&d.current&&u){const h=Math.abs(l.current-f.scrollTop);if(h>0){const m=window.innerHeight-ha*2,b=parseFloat(u.style.minHeight),w=parseFloat(u.style.height),g=Math.max(b,w);if(g<m){const v=g+h,x=Math.min(m,v),E=v-x;u.style.height=x+"px",u.style.bottom==="0px"&&(f.scrollTop=E>0?E:0,u.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});zV.displayName=SC;var PV="SelectGroup",[SRe,xRe]=Rh(PV),wRe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Pr();return p.jsx(SRe,{scope:n,id:i,children:p.jsx(Ze.div,{role:"group","aria-labelledby":i,...r,ref:t})})});wRe.displayName=PV;var FV="SelectLabel",_Re=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=xRe(FV,n);return p.jsx(Ze.div,{id:i.id,...r,ref:t})});_Re.displayName=FV;var W0="SelectItem",[ERe,UV]=Rh(W0),BV=y.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=rc(W0,n),l=ic(W0,n),c=s.value===r,[f,u]=y.useState(a??""),[d,h]=y.useState(!1),m=It(t,v=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,v,r,i)}),b=Pr(),w=y.useRef("touch"),g=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(ERe,{scope:n,value:r,disabled:i,textId:b,isSelected:c,onItemTextChange:y.useCallback(v=>{u(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:p.jsx(cw.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:p.jsx(Ze.div,{role:"option","aria-labelledby":b,"data-highlighted":d?"":void 0,"aria-selected":c&&d,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:xe(o.onFocus,()=>h(!0)),onBlur:xe(o.onBlur,()=>h(!1)),onClick:xe(o.onClick,()=>{w.current!=="mouse"&&g()}),onPointerUp:xe(o.onPointerUp,()=>{w.current==="mouse"&&g()}),onPointerDown:xe(o.onPointerDown,v=>{w.current=v.pointerType}),onPointerMove:xe(o.onPointerMove,v=>{var x;w.current=v.pointerType,i?(x=l.onItemLeave)==null||x.call(l):w.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:xe(o.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:xe(o.onKeyDown,v=>{var E;((E=l.searchRef)==null?void 0:E.current)!==""&&v.key===" "||(lRe.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})})})})});BV.displayName=W0;var Cm="SelectItemText",HV=y.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...a}=e,o=rc(Cm,n),s=ic(Cm,n),l=UV(Cm,n),c=dRe(Cm,n),[f,u]=y.useState(null),d=It(t,g=>u(g),l.onItemTextChange,g=>{var v;return(v=s.itemTextRefCallback)==null?void 0:v.call(s,g,l.value,l.disabled)}),h=f==null?void 0:f.textContent,m=y.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=c;return kr(()=>(b(m),()=>w(m)),[b,w,m]),p.jsxs(p.Fragment,{children:[p.jsx(Ze.span,{id:l.textId,...a,ref:d}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Gd.createPortal(a.children,o.valueNode):null]})});HV.displayName=Cm;var qV="SelectItemIndicator",VV=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return UV(qV,n).isSelected?p.jsx(Ze.span,{"aria-hidden":!0,...r,ref:t}):null});VV.displayName=qV;var xC="SelectScrollUpButton",KV=y.forwardRef((e,t)=>{const n=ic(xC,e.__scopeSelect),r=s2(xC,e.__scopeSelect),[i,a]=y.useState(!1),o=It(t,r.onScrollButtonChange);return kr(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollTop>0;a(c)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?p.jsx(YV,{...e,ref:o,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});KV.displayName=xC;var wC="SelectScrollDownButton",GV=y.forwardRef((e,t)=>{const n=ic(wC,e.__scopeSelect),r=s2(wC,e.__scopeSelect),[i,a]=y.useState(!1),o=It(t,r.onScrollButtonChange);return kr(()=>{if(n.viewport&&n.isPositioned){let s=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<c;a(f)};const l=n.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[n.viewport,n.isPositioned]),i?p.jsx(YV,{...e,ref:o,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=n;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});GV.displayName=wC;var YV=y.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,a=ic("SelectScrollButton",n),o=y.useRef(null),s=uw(n),l=y.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return y.useEffect(()=>()=>l(),[l]),kr(()=>{var f;const c=s().find(u=>u.ref.current===document.activeElement);(f=c==null?void 0:c.ref.current)==null||f.scrollIntoView({block:"nearest"})},[s]),p.jsx(Ze.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:xe(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:xe(i.onPointerMove,()=>{var c;(c=a.onItemLeave)==null||c.call(a),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:xe(i.onPointerLeave,()=>{l()})})}),kRe="SelectSeparator",CRe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(Ze.div,{"aria-hidden":!0,...r,ref:t})});CRe.displayName=kRe;var _C="SelectArrow",TRe=y.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=fw(n),a=rc(_C,n),o=ic(_C,n);return a.open&&o.position==="popper"?p.jsx(Bq,{...i,...r,ref:t}):null});TRe.displayName=_C;var RRe="SelectBubbleInput",WV=y.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=y.useRef(null),a=It(r,i),o=dke(t);return y.useEffect(()=>{const s=i.current;if(!s)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==t&&f){const u=new Event("change",{bubbles:!0});f.call(s,t),s.dispatchEvent(u)}},[o,t]),p.jsx(Ze.select,{...n,style:{...yq,...n.style},ref:a,defaultValue:t})});WV.displayName=RRe;function JV(e){return e===""||e===void 0}function XV(e){const t=yo(e),n=y.useRef(""),r=y.useRef(0),i=y.useCallback(o=>{const s=n.current+o;t(s),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),a=y.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function QV(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let o=ARe(e,Math.max(a,0));i.length===1&&(o=o.filter(c=>c!==n));const l=o.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function ARe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ORe=TV,MRe=AV,NRe=MV,DRe=NV,jRe=DV,IRe=jV,$Re=zV,LRe=BV,zRe=HV,PRe=VV,FRe=KV,URe=GV,BRe="Separator",a$="horizontal",HRe=["horizontal","vertical"],ZV=y.forwardRef((e,t)=>{const{decorative:n,orientation:r=a$,...i}=e,a=qRe(r)?r:a$,s=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return p.jsx(Ze.div,{"data-orientation":a,...s,...i,ref:t})});ZV.displayName=BRe;function qRe(e){return HRe.includes(e)}var VRe=ZV,eK="Toggle",tK=y.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=Pl({prop:n,onChange:i,defaultProp:r??!1,caller:eK});return p.jsx(Ze.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:xe(e.onClick,()=>{e.disabled||s(!o)})})});tK.displayName=eK;var ac="ToggleGroup",[nK]=ec(ac,[aw]),rK=aw(),l2=ee.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const i=r;return p.jsx(KRe,{...i,ref:t})}if(n==="multiple"){const i=r;return p.jsx(GRe,{...i,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${ac}\``)});l2.displayName=ac;var[iK,aK]=nK(ac),KRe=ee.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=Pl({prop:n,defaultProp:r??"",onChange:i,caller:ac});return p.jsx(iK,{scope:e.__scopeToggleGroup,type:"single",value:ee.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:ee.useCallback(()=>s(""),[s]),children:p.jsx(oK,{...a,ref:t})})}),GRe=ee.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=Pl({prop:n,defaultProp:r??[],onChange:i,caller:ac}),l=ee.useCallback(f=>s((u=[])=>[...u,f]),[s]),c=ee.useCallback(f=>s((u=[])=>u.filter(d=>d!==f)),[s]);return p.jsx(iK,{scope:e.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:l,onItemDeactivate:c,children:p.jsx(oK,{...a,ref:t})})});l2.displayName=ac;var[YRe,WRe]=nK(ac),oK=ee.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...l}=e,c=rK(n),f=Zx(o),u={role:"group",dir:f,...l};return p.jsx(YRe,{scope:n,rovingFocus:i,disabled:r,children:i?p.jsx(Yq,{asChild:!0,...c,orientation:a,dir:f,loop:s,children:p.jsx(Ze.div,{...u,ref:t})}):p.jsx(Ze.div,{...u,ref:t})})}),J0="ToggleGroupItem",sK=ee.forwardRef((e,t)=>{const n=aK(J0,e.__scopeToggleGroup),r=WRe(J0,e.__scopeToggleGroup),i=rK(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},l=ee.useRef(null);return r.rovingFocus?p.jsx(Wq,{asChild:!0,...i,focusable:!o,active:a,ref:l,children:p.jsx(o$,{...s,ref:t})}):p.jsx(o$,{...s,ref:t})});sK.displayName=J0;var o$=ee.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...i}=e,a=aK(J0,n),o={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},s=a.type==="single"?o:void 0;return p.jsx(tK,{...s,...i,ref:t,onPressedChange:l=>{l?a.onItemActivate(r):a.onItemDeactivate(r)}})}),JRe=l2,XRe=sK;function lK(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=lK(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function cK(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=lK(e))&&(r&&(r+=" "),r+=t);return r}const QRe=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},ZRe=(e,t)=>({classGroupId:e,validator:t}),uK=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),X0="-",s$=[],eAe="arbitrary..",tAe=e=>{const t=rAe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return nAe(o);const s=o.split(X0),l=s[0]===""&&s.length>1?1:0;return fK(s,l,t)},getConflictingClassGroupIds:(o,s)=>{if(s){const l=r[o],c=n[o];return l?c?QRe(c,l):l:c||s$}return n[o]||s$}}},fK=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const c=fK(e,t+1,a);if(c)return c}const o=n.validators;if(o===null)return;const s=t===0?e.join(X0):e.slice(t).join(X0),l=o.length;for(let c=0;c<l;c++){const f=o[c];if(f.validator(s))return f.classGroupId}},nAe=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?eAe+r:void 0})(),rAe=e=>{const{theme:t,classGroups:n}=e;return iAe(n,t)},iAe=(e,t)=>{const n=uK();for(const r in e){const i=e[r];c2(i,n,r,t)}return n},c2=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];aAe(o,t,n,r)}},aAe=(e,t,n,r)=>{if(typeof e=="string"){oAe(e,t,n);return}if(typeof e=="function"){sAe(e,t,n,r);return}lAe(e,t,n,r)},oAe=(e,t,n)=>{const r=e===""?t:dK(t,e);r.classGroupId=n},sAe=(e,t,n,r)=>{if(cAe(e)){c2(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ZRe(n,e))},lAe=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[s,l]=i[o];c2(l,dK(t,s),n,r)}},dK=(e,t)=>{let n=e;const r=t.split(X0),i=r.length;for(let a=0;a<i;a++){const o=r[a];let s=n.nextPart.get(o);s||(s=uK(),n.nextPart.set(o,s)),n=s}return n},cAe=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,uAe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},EC="!",l$=":",fAe=[],c$=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),dAe=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,s=0,l=0,c;const f=i.length;for(let b=0;b<f;b++){const w=i[b];if(o===0&&s===0){if(w===l$){a.push(i.slice(l,b)),l=b+1;continue}if(w==="/"){c=b;continue}}w==="["?o++:w==="]"?o--:w==="("?s++:w===")"&&s--}const u=a.length===0?i:i.slice(l);let d=u,h=!1;u.endsWith(EC)?(d=u.slice(0,-1),h=!0):u.startsWith(EC)&&(d=u.slice(1),h=!0);const m=c&&c>l?c-l:void 0;return c$(a,h,d,m)};if(t){const i=t+l$,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):c$(fAe,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},hAe=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],s=o[0]==="[",l=t.has(o);s||l?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},mAe=e=>({cache:uAe(e.cacheSize),parseClassName:dAe(e),sortModifiers:hAe(e),...tAe(e)}),pAe=/\s+/,gAe=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(pAe);let l="";for(let c=s.length-1;c>=0;c-=1){const f=s[c],{isExternal:u,modifiers:d,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:b}=n(f);if(u){l=f+(l.length>0?" "+l:l);continue}let w=!!b,g=r(w?m.substring(0,b):m);if(!g){if(!w){l=f+(l.length>0?" "+l:l);continue}if(g=r(m),!g){l=f+(l.length>0?" "+l:l);continue}w=!1}const v=d.length===0?"":d.length===1?d[0]:a(d).join(":"),x=h?v+EC:v,E=x+g;if(o.indexOf(E)>-1)continue;o.push(E);const C=i(g,w);for(let k=0;k<C.length;++k){const _=C[k];o.push(x+_)}l=f+(l.length>0?" "+l:l)}return l},yAe=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=hK(n))&&(i&&(i+=" "),i+=r);return i},hK=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=hK(e[r]))&&(n&&(n+=" "),n+=t);return n},bAe=(e,...t)=>{let n,r,i,a;const o=l=>{const c=t.reduce((f,u)=>u(f),e());return n=mAe(c),r=n.cache.get,i=n.cache.set,a=s,s(l)},s=l=>{const c=r(l);if(c)return c;const f=gAe(l,n);return i(l,f),f};return a=o,(...l)=>a(yAe(...l))},vAe=[],Nn=e=>{const t=n=>n[e]||vAe;return t.isThemeGetter=!0,t},mK=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,pK=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SAe=/^\d+\/\d+$/,xAe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wAe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_Ae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,EAe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kAe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ef=e=>SAe.test(e),Xe=e=>!!e&&!Number.isNaN(Number(e)),$s=e=>!!e&&Number.isInteger(Number(e)),u_=e=>e.endsWith("%")&&Xe(e.slice(0,-1)),$o=e=>xAe.test(e),CAe=()=>!0,TAe=e=>wAe.test(e)&&!_Ae.test(e),gK=()=>!1,RAe=e=>EAe.test(e),AAe=e=>kAe.test(e),OAe=e=>!pe(e)&&!ge(e),MAe=e=>Ah(e,vK,gK),pe=e=>mK.test(e),hc=e=>Ah(e,SK,TAe),f_=e=>Ah(e,$Ae,Xe),u$=e=>Ah(e,yK,gK),NAe=e=>Ah(e,bK,AAe),ob=e=>Ah(e,xK,RAe),ge=e=>pK.test(e),im=e=>Oh(e,SK),DAe=e=>Oh(e,LAe),f$=e=>Oh(e,yK),jAe=e=>Oh(e,vK),IAe=e=>Oh(e,bK),sb=e=>Oh(e,xK,!0),Ah=(e,t,n)=>{const r=mK.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Oh=(e,t,n=!1)=>{const r=pK.exec(e);return r?r[1]?t(r[1]):n:!1},yK=e=>e==="position"||e==="percentage",bK=e=>e==="image"||e==="url",vK=e=>e==="length"||e==="size"||e==="bg-size",SK=e=>e==="length",$Ae=e=>e==="number",LAe=e=>e==="family-name",xK=e=>e==="shadow",zAe=()=>{const e=Nn("color"),t=Nn("font"),n=Nn("text"),r=Nn("font-weight"),i=Nn("tracking"),a=Nn("leading"),o=Nn("breakpoint"),s=Nn("container"),l=Nn("spacing"),c=Nn("radius"),f=Nn("shadow"),u=Nn("inset-shadow"),d=Nn("text-shadow"),h=Nn("drop-shadow"),m=Nn("blur"),b=Nn("perspective"),w=Nn("aspect"),g=Nn("ease"),v=Nn("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...E(),ge,pe],k=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],A=()=>[ge,pe,l],I=()=>[ef,"full","auto",...A()],O=()=>[$s,"none","subgrid",ge,pe],z=()=>["auto",{span:["full",$s,ge,pe]},$s,ge,pe],U=()=>[$s,"auto",ge,pe],J=()=>["auto","min","max","fr",ge,pe],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...A()],P=()=>[ef,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[e,ge,pe],q=()=>[...E(),f$,u$,{position:[ge,pe]}],M=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",jAe,MAe,{size:[ge,pe]}],H=()=>[u_,im,hc],R=()=>["","none","full",c,ge,pe],X=()=>["",Xe,im,hc],G=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[Xe,u_,f$,u$],oe=()=>["","none",m,ge,pe],ye=()=>["none",Xe,ge,pe],Ae=()=>["none",Xe,ge,pe],Fe=()=>[Xe,ge,pe],ve=()=>[ef,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$o],breakpoint:[$o],color:[CAe],container:[$o],"drop-shadow":[$o],ease:["in","out","in-out"],font:[OAe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$o],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$o],shadow:[$o],spacing:["px",Xe],text:[$o],"text-shadow":[$o],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ef,pe,ge,w]}],container:["container"],columns:[{columns:[Xe,pe,ge,s]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[$s,"auto",ge,pe]}],basis:[{basis:[ef,"full","auto",s,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,ef,"auto","initial","none",pe]}],grow:[{grow:["",Xe,ge,pe]}],shrink:[{shrink:["",Xe,ge,pe]}],order:[{order:[$s,"first","last","none",ge,pe]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:P()}],w:[{w:[s,"screen",...P()]}],"min-w":[{"min-w":[s,"screen","none",...P()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...P()]}],h:[{h:["screen","lh",...P()]}],"min-h":[{"min-h":["screen","lh","none",...P()]}],"max-h":[{"max-h":["screen","lh",...P()]}],"font-size":[{text:["base",n,im,hc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ge,f_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",u_,pe]}],"font-family":[{font:[DAe,pe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ge,pe]}],"line-clamp":[{"line-clamp":[Xe,"none",ge,f_]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",ge,pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",ge,hc]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Xe,"auto",ge,pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge,pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:M()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$s,ge,pe],radial:["",ge,pe],conic:[$s,ge,pe]},IAe,NAe]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,ge,pe]}],"outline-w":[{outline:["",Xe,im,hc]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",f,sb,ob]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",u,sb,ob]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Xe,hc]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",d,sb,ob]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Xe,ge,pe]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[ge,pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:M()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,pe]}],filter:[{filter:["","none",ge,pe]}],blur:[{blur:oe()}],brightness:[{brightness:[Xe,ge,pe]}],contrast:[{contrast:[Xe,ge,pe]}],"drop-shadow":[{"drop-shadow":["","none",h,sb,ob]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Xe,ge,pe]}],"hue-rotate":[{"hue-rotate":[Xe,ge,pe]}],invert:[{invert:["",Xe,ge,pe]}],saturate:[{saturate:[Xe,ge,pe]}],sepia:[{sepia:["",Xe,ge,pe]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,pe]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,ge,pe]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,ge,pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,ge,pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,ge,pe]}],"backdrop-invert":[{"backdrop-invert":["",Xe,ge,pe]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,ge,pe]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,ge,pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,ge,pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",ge,pe]}],ease:[{ease:["linear","initial",g,ge,pe]}],delay:[{delay:[Xe,ge,pe]}],animate:[{animate:["none",v,ge,pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ge,pe]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:Ae()}],"scale-x":[{"scale-x":Ae()}],"scale-y":[{"scale-y":Ae()}],"scale-z":[{"scale-z":Ae()}],"scale-3d":["scale-3d"],skew:[{skew:Fe()}],"skew-x":[{"skew-x":Fe()}],"skew-y":[{"skew-y":Fe()}],transform:[{transform:[ge,pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge,pe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge,pe]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Xe,im,hc,f_]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},PAe=bAe(zAe);function it(...e){return PAe(cK(e))}function wK({...e}){return p.jsx(aq,{"data-slot":"dialog",...e})}function FAe({...e}){return p.jsx(oq,{"data-slot":"dialog-portal",...e})}function UAe({className:e,...t}){return p.jsx(sq,{"data-slot":"dialog-overlay",className:it("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function _K({children:e,className:t,showCloseButton:n=!0,...r}){return p.jsxs(FAe,{"data-slot":"dialog-portal",children:[p.jsx(UAe,{}),p.jsxs(lq,{"data-slot":"dialog-content",className:it("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",t),...r,children:[e,n&&p.jsxs(zEe,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[p.jsx(R7,{}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function EK({className:e,...t}){return p.jsx("div",{"data-slot":"dialog-header",className:it("flex flex-col gap-2 text-center sm:text-left",e),...t})}function BAe({className:e,...t}){return p.jsx("div",{"data-slot":"dialog-footer",className:it("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function kK({className:e,...t}){return p.jsx($Ee,{"data-slot":"dialog-title",className:it("text-lg leading-none font-semibold",e),...t})}function CK({className:e,...t}){return p.jsx(LEe,{"data-slot":"dialog-description",className:it("text-muted-foreground text-sm",e),...t})}function HAe({className:e,...t}){return p.jsx(Du,{"data-slot":"command",className:it("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function qAe({children:e,className:t,description:n="Search for a command to run...",showCloseButton:r=!0,title:i="Command Palette",...a}){return p.jsxs(wK,{...a,children:[p.jsxs(EK,{className:"sr-only",children:[p.jsx(kK,{children:i}),p.jsx(CK,{children:n})]}),p.jsx(_K,{className:it("overflow-hidden p-0",t),showCloseButton:r,children:p.jsx(HAe,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})]})}function VAe({className:e,...t}){return p.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[p.jsx(LO,{className:"size-4 shrink-0 opacity-50"}),p.jsx(Du.Input,{"data-slot":"command-input",className:it("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function KAe({className:e,...t}){return p.jsx(Du.List,{"data-slot":"command-list",className:it("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function GAe({...e}){return p.jsx(Du.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function d_({className:e,...t}){return p.jsx(Du.Group,{"data-slot":"command-group",className:it("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function d$({className:e,...t}){return p.jsx(Du.Separator,{"data-slot":"command-separator",className:it("bg-border -mx-1 h-px",e),...t})}function Lo({className:e,...t}){return p.jsx(Du.Item,{"data-slot":"command-item",className:it("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}const YAe=[{key:"all",label:"All"},{key:"mine",label:"Mine"},{key:"account",label:"Account"},{key:"author",label:"Author"},{key:"scope",label:"Scope"},{key:"repo",label:"Repo"},{key:"status",label:"Status"}];function WAe(){const e=zr(AI),t=un(AI),n=Es(),r=un(b7),i=a=>{n(a?`/settings/${a}`:"/settings"),t(!1)};return y.useEffect(()=>{const a=o=>{o.key==="p"&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),t(s=>!s))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t]),p.jsxs(qAe,{open:e,onOpenChange:t,showCloseButton:!1,children:[p.jsx(VAe,{placeholder:"Type a command..."}),p.jsxs(KAe,{children:[p.jsx(GAe,{children:"No results found."}),p.jsxs(d_,{heading:"Actions",children:[p.jsxs(Lo,{onSelect:()=>{r({}),t(!1)},children:[p.jsx(ay,{}),"Refresh PRs"]}),p.jsxs(Lo,{onSelect:()=>{n("/"),t(!1)},children:[p.jsx(RI,{}),"View: PR List"]}),p.jsxs(Lo,{onSelect:()=>{n("/notifications"),t(!1)},children:[p.jsx(DO,{}),"View: Notifications"]})]}),p.jsx(d$,{}),p.jsxs(d_,{heading:"Settings",children:[p.jsxs(Lo,{onSelect:()=>i(),children:[p.jsx(df,{}),"Open Settings"]}),p.jsxs(Lo,{onSelect:()=>i("accounts"),children:[p.jsx(df,{}),"Settings: Accounts"]}),p.jsxs(Lo,{onSelect:()=>i("theme"),children:[p.jsx(df,{}),"Settings: Theme"]}),p.jsxs(Lo,{onSelect:()=>i("config"),children:[p.jsx(df,{}),"Settings: Config"]}),p.jsxs(Lo,{onSelect:()=>i("about"),children:[p.jsx(df,{}),"Settings: About"]})]}),p.jsx(d$,{}),p.jsx(d_,{heading:"Filters",children:YAe.map(a=>p.jsxs(Lo,{onSelect:()=>{n(a.key==="all"?"/":`/?filter=${a.key}`),t(!1)},children:[p.jsx(RI,{}),"Filter: ",a.label]},a.key))})]})]})}const JAe=["all","mine","account","author","scope","repo","status","hot"],XAe=e=>e!==null&&JAe.includes(e);function TK(){const[e,t]=EZ(),n=y.useMemo(()=>{const o=e.get("filter"),s=e.get("value")??void 0;return!XAe(o)||o==="all"?{type:"all"}:s?{type:o,value:s}:{type:o}},[e]),r=e.get("q")??"",i=y.useCallback(o=>{t(s=>(o.type==="all"?(s.delete("filter"),s.delete("value")):(s.set("filter",o.type),o.value?s.set("value",o.value):s.delete("value")),s),{replace:!0})},[t]),a=y.useCallback(o=>{t(s=>(o?s.set("q",o):s.delete("q"),s),{replace:!0})},[t]);return{quickFilter:n,filterText:r,setQuickFilter:i,setFilterText:a}}const ad=e=>{const t=e.match(/^\w+\(([^)]+)\):/);if(t!=null&&t[1])return t[1];const n=e.match(/^([A-Z]+-\d+):/);return n!=null&&n[1]?n[1]:null},h$=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,m$=cK,u2=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return m$(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(c=>{const f=n==null?void 0:n[c],u=a==null?void 0:a[c];if(f===null)return null;const d=h$(f)||h$(u);return i[c][d]}),s=n&&Object.entries(n).reduce((c,f)=>{let[u,d]=f;return d===void 0||(c[u]=d),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,f)=>{let{class:u,className:d,...h}=f;return Object.entries(h).every(m=>{let[b,w]=m;return Array.isArray(w)?w.includes({...a,...s}[b]):{...a,...s}[b]===w})?[...c,u,d]:c},[]);return m$(e,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},QAe=u2("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ot({asChild:e=!1,className:t,size:n="default",variant:r="default",...i}){const a=e?M7:"button";return p.jsx(a,{"data-slot":"button","data-variant":r,"data-size":n,className:it(QAe({variant:r,size:n,className:t})),...i})}function dw({className:e,...t}){return p.jsx("div",{"data-slot":"button-group",className:it("inline-flex items-stretch rounded-md border overflow-hidden [&>*]:rounded-none [&>*]:border-0 [&>*]:shadow-none [&>*:not(:last-child)]:border-r",e),...t})}function RK({className:e,type:t,...n}){return p.jsx("input",{type:t,"data-slot":"input",className:it("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}function ZAe({...e}){return p.jsx(ORe,{"data-slot":"select",...e})}function eOe({...e}){return p.jsx(NRe,{"data-slot":"select-value",...e})}function tOe({children:e,className:t,size:n="default",...r}){return p.jsxs(MRe,{"data-slot":"select-trigger","data-size":n,className:it("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[e,p.jsx(DRe,{asChild:!0,children:p.jsx(IO,{className:"size-4 opacity-50"})})]})}function nOe({align:e="center",children:t,className:n,position:r="item-aligned",...i}){return p.jsx(jRe,{children:p.jsxs(IRe,{"data-slot":"select-content",className:it("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n),position:r,align:e,...i,children:[p.jsx(rOe,{}),p.jsx($Re,{className:it("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),p.jsx(iOe,{})]})})}function p$({children:e,className:t,...n}){return p.jsxs(LRe,{"data-slot":"select-item",className:it("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...n,children:[p.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:p.jsx(PRe,{children:p.jsx(jO,{className:"size-4"})})}),p.jsx(zRe,{children:e})]})}function rOe({className:e,...t}){return p.jsx(FRe,{"data-slot":"select-scroll-up-button",className:it("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(p1e,{className:"size-4"})})}function iOe({className:e,...t}){return p.jsx(URe,{"data-slot":"select-scroll-down-button",className:it("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(IO,{className:"size-4"})})}const aOe=u2("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),AK=y.createContext({size:"default",variant:"default",spacing:0});function OK({children:e,className:t,size:n,spacing:r=0,variant:i,...a}){return p.jsx(JRe,{"data-slot":"toggle-group","data-variant":i,"data-size":n,"data-spacing":r,className:it("group/toggle-group flex w-fit items-center rounded-md",t),...a,children:p.jsx(AK,{value:{variant:i,size:n,spacing:r},children:e})})}function nv({children:e,className:t,size:n,variant:r,...i}){const a=y.useContext(AK);return p.jsx(XRe,{"data-slot":"toggle-group-item","data-variant":a.variant||r,"data-size":a.size||n,"data-spacing":a.spacing,className:it(aOe({variant:a.variant||r,size:a.size||n}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",t),...i,children:e})}const oOe=[{key:"all",label:"All"},{key:"hot",label:"Hot",icon:!0},{key:"mine",label:"Mine"},{key:"account",label:"Account"},{key:"author",label:"Author"},{key:"scope",label:"Scope"},{key:"repo",label:"Repo"},{key:"status",label:"Status"}];function sOe(){const e=zr(Zl),{quickFilter:t,filterText:n,setQuickFilter:r,setFilterText:i}=TK(),a=e.pullRequests,o=e.currentUser,s=y.useMemo(()=>{var w;const u=new Set,d=new Set,h=new Set,m=new Set,b=new Set;for(const g of a){u.add(g.author),d.add(((w=g.account)==null?void 0:w.profile)??"unknown"),b.add(g.repositoryName);const v=ad(g.title);v&&(h.add(v),o&&g.author===o&&m.add(v))}return{authors:Array.from(u).sort(),accounts:Array.from(d).sort(),scopes:Array.from(h).sort(),myScopes:Array.from(m).sort(),repos:Array.from(b).sort()}},[a,o]),l=u=>{const d=u;if(!d||d==="all"){r({type:"all"});return}if(d==="hot"){r({type:"hot"});return}if(d==="mine"){r({type:"mine"});return}const h=d==="author"?s.authors:d==="account"?s.accounts:d==="scope"?s.scopes:d==="repo"?s.repos:d==="status"?["approved","pending","mergeable","conflicts"]:[];h.length>0&&h[0]!==void 0&&r({type:d,value:h[0]})},c=u=>{t.type!=="all"&&r(u?{type:t.type,value:u}:{type:t.type})},f=t.type==="mine"?s.myScopes:t.type==="author"?s.authors:t.type==="account"?s.accounts:t.type==="scope"?s.scopes:t.type==="repo"?s.repos:t.type==="status"?["approved","pending","mergeable","conflicts"]:[];return p.jsx("div",{className:"border-b bg-background",children:p.jsxs("div",{className:"mx-auto flex max-w-5xl items-center gap-3 px-4 py-2",children:[p.jsx(OK,{type:"single",variant:"outline",size:"sm",value:t.type,onValueChange:l,children:oOe.map(u=>p.jsxs(nv,{value:u.key,className:u.icon?"gap-1":void 0,children:[u.icon&&p.jsx(k1e,{className:"size-3.5"}),u.label]},u.key))}),f.length>0&&t.type!=="all"&&t.type!=="hot"&&p.jsxs(ZAe,{value:t.value??"_all",onValueChange:u=>c(u==="_all"?"":u),children:[p.jsx(tOe,{size:"sm",className:"w-[180px]",children:p.jsx(eOe,{})}),p.jsxs(nOe,{children:[p.jsx(p$,{value:"_all",children:"All"}),f.map(u=>p.jsx(p$,{value:u,children:u},u))]})]}),p.jsxs("div",{className:"relative ml-auto w-64",children:[p.jsx(LO,{className:"absolute left-2.5 top-2.5 size-4 text-muted-foreground"}),p.jsx(RK,{placeholder:"Search...",className:"h-8 pl-8",value:n,onChange:u=>i(u.target.value)}),n&&p.jsx(Ot,{variant:"ghost",size:"icon-xs",className:"absolute right-1 top-1",onClick:()=>i(""),children:p.jsx(R7,{className:"size-3"})})]})]})})}const f2=e=>{const t=e.getDate().toString().padStart(2,"0"),n=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getFullYear();return`${t}.${n}.${r}`},hw=(e,t,n="Updated")=>{const r=Math.max(0,Math.floor((t.getTime()-e.getTime())/1e3));return c7(r).pipe(op(i=>i<60,i=>`${n} ${i}s ago`),op(i=>i<3600,i=>`${n} ${Math.floor(i/60)}m ago`),op(i=>i<86400,i=>`${n} ${Math.floor(i/3600)}h ago`),u7(()=>`${n} on ${f2(e)}`))};function lOe({...e}){return p.jsx(nRe,{"data-slot":"dropdown-menu",...e})}function cOe({...e}){return p.jsx(rRe,{"data-slot":"dropdown-menu-trigger",...e})}function uOe({align:e="end",className:t,sideOffset:n=4,...r}){return p.jsx(iRe,{children:p.jsx(aRe,{"data-slot":"dropdown-menu-content",align:e,sideOffset:n,className:it("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",t),...r})})}function fOe({className:e,...t}){return p.jsx(oRe,{"data-slot":"dropdown-menu-item",className:it("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function dOe({className:e,...t}){return p.jsx("kbd",{"data-slot":"kbd",className:it("bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none","[&_svg:not([class*='size-'])]:size-3",e),...t})}function Ra({className:e,decorative:t=!0,orientation:n="horizontal",...r}){return p.jsx(VRe,{"data-slot":"separator",decorative:t,orientation:n,className:it("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function hOe(){const e=zr(Zl),t=un(b7),n=un(NO),r=Es(),{setTheme:i,theme:a}=T4(),o=e.status==="loading",s=e.status==="error",l=e.unreadNotificationCount??0;return p.jsx("header",{className:"sticky top-0 z-40 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:p.jsxs("div",{className:"mx-auto flex h-14 max-w-5xl items-center gap-4 px-4",children:[p.jsx("button",{className:"text-sm font-semibold tracking-tight hover:text-foreground/80",onClick:()=>r("/"),children:"codecommit"}),p.jsx(Ra,{orientation:"vertical",className:"h-4"}),s&&p.jsx("span",{className:"text-sm text-destructive",children:e.error??"Error loading PRs"}),o&&p.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[p.jsx(Vx,{className:"size-3 animate-spin"}),e.statusDetail&&p.jsx("span",{className:"font-mono opacity-60",children:e.statusDetail})]}),e.lastUpdated&&!s&&!o&&p.jsx("span",{className:"text-xs text-muted-foreground",children:hw(e.lastUpdated,new Date)}),p.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.currentUser&&p.jsxs(lOe,{children:[p.jsx(cOe,{asChild:!0,children:p.jsxs("button",{className:"flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground",children:[p.jsx(zO,{className:"size-3"}),e.currentUser]})}),p.jsx(uOe,{children:p.jsxs(fOe,{onClick:()=>n({}),children:[p.jsx(k7,{className:"size-3"}),"Logout"]})})]}),p.jsx(Ot,{variant:"ghost",size:"icon-sm",onClick:()=>t({}),disabled:o,children:p.jsx(ay,{className:it("size-4",o&&"animate-spin")})}),p.jsxs(Ot,{variant:"ghost",size:"icon-sm",className:"relative",onClick:()=>r("/notifications"),children:[p.jsx(DO,{className:"size-4"}),l>0&&p.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex size-4 items-center justify-center rounded-full bg-destructive text-[10px] font-medium text-destructive-foreground",children:l>9?"9+":l}),p.jsx("span",{className:"sr-only",children:"Notifications"})]}),p.jsxs(Ot,{variant:"ghost",size:"icon-sm",onClick:()=>r("/settings"),children:[p.jsx(df,{className:"size-4"}),p.jsx("span",{className:"sr-only",children:"Settings"})]}),p.jsx(dOe,{children:"⌘P"}),p.jsxs(Ot,{variant:"ghost",size:"icon-sm",onClick:()=>i(a==="dark"?"light":a==="light"?"system":"dark"),children:[p.jsx(T7,{className:"size-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),p.jsx(C7,{className:"absolute size-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),p.jsx("span",{className:"sr-only",children:"Toggle theme"})]})]})]})})}function mOe(){const e=un(Zl),t=Es(),n=y.useCallback(()=>t("/notifications"),[t]);Qwe(i=>e(i),n);const r=xo().pathname==="/";return p.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[p.jsx(hOe,{}),r&&p.jsx(sOe,{}),p.jsx("main",{className:"mx-auto w-full max-w-5xl flex-1 px-4 py-6",children:p.jsx(VQ,{})}),p.jsx(WAe,{}),p.jsx(Zxe,{})]})}function pOe(e={}){var _;const{filter:t,unreadOnly:n}=e,r=t!==void 0||n===!0,a=zr(Zl).notifications,[o,s]=y.useState([]),[l,c]=y.useState(null),[f,u]=kxe(Hwe,{mode:"promise"}),d=y.useRef(`${t}:${n}`),h=`${t}:${n}`;d.current!==h&&(d.current=h,s([]),c(null));const m=(_=a==null?void 0:a.items[0])==null?void 0:_.id,b=y.useRef(m);!r&&b.current!==m&&(b.current=m,o.length>0&&s([]));const w=y.useMemo(()=>({limit:20,...t?{filter:t}:{},...n?{unreadOnly:1}:{}}),[t,n]);y.useEffect(()=>{if(!r)return;let A=!1;return u({urlParams:w}).then(I=>{A||c({items:I.items,...I.nextCursor!==void 0?{nextCursor:I.nextCursor}:{}})}).catch(()=>{}),()=>{A=!0}},[r,w,u]);const g=r?l:a,v=o.length>0?o[o.length-1].nextCursor:g==null?void 0:g.nextCursor,x=v!==void 0,E=f.waiting,C=y.useCallback(async()=>{if(!(!x||E||v===void 0))try{const A=await u({urlParams:{...w,cursor:v}}),I={items:A.items,...A.nextCursor!==void 0?{nextCursor:A.nextCursor}:{}};s(O=>[...O,I])}catch{}},[x,E,v,u,w]);return{items:y.useMemo(()=>{const A=(g==null?void 0:g.items)??[];return o.length===0?A:[...A,...o.flatMap(I=>I.items)]},[g==null?void 0:g.items,o]),hasMore:x,isLoading:E,loadMore:C}}function gOe(e,t){const n=y.useRef(null),r=y.useRef(e);return r.current=e,y.useCallback(a=>{var o;(o=n.current)==null||o.disconnect(),n.current=null,a&&(n.current=new IntersectionObserver(s=>{var l;(l=s[0])!=null&&l.isIntersecting&&r.current()},t),n.current.observe(a))},[JSON.stringify(t)])}function yOe(e){const[t,n]=y.useState(null),r=y.useRef(e);return r.current!==e&&(r.current=e,t!==null&&n(null)),[t??e,n]}function g$(e){const[t,n]=y.useState(new Set),r=y.useRef(e);r.current!==e&&(r.current=e,t.size>0&&n(new Set));const i=y.useCallback(s=>{n(l=>new Set(l).add(s))},[]),a=y.useCallback(s=>{n(new Set(s))},[]),o=y.useCallback(s=>{n(l=>{const c=new Set(l);return c.delete(s),c})},[]);return[t,i,a,o]}const bOe=u2("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function Vn({asChild:e=!1,className:t,variant:n="default",...r}){const i=e?M7:"span";return p.jsx(i,{"data-slot":"badge","data-variant":n,className:it(bOe({variant:n}),t),...r})}const vOe=e=>/ExpiredToken|Unauthorized|AuthFailure|SSO|token|credentials|expired/i.test(e),SOe=e=>{switch(e){case"error":return p.jsx(y1e,{className:"size-4 text-destructive shrink-0"});case"warning":return p.jsx(X1e,{className:"size-4 text-yellow-500 shrink-0"});case"success":return p.jsx(w7,{className:"size-4 text-green-500 shrink-0"});default:return p.jsx($O,{className:"size-4 text-blue-500 shrink-0"})}},MK=He({operation:Be(V),profile:Be(V),region:Be(V),cause:Be(V),error:Be(V),message:Be(V)}),xOe=mO(MK),wOe=Xl(V,MK,{decode:e=>({cause:e}),encode:e=>e.cause??""}),_Oe=fbe(Mu(xOe,wOe)),NK=e=>_Oe(e),EOe=e=>{const t=NK(e);if(Vt(t))return e;const{cause:n,error:r,message:i,operation:a}=t.value,o=n??r??i,s=[];return a&&s.push(a),o&&s.push(o),s.length>0?s.join(" — "):e},kOe=e=>{const t=new Date(e),r=new Date().getTime()-t.getTime();return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:t.toLocaleDateString()};function COe(){var J,Y;const[e,t]=y.useState(void 0),[n,r]=y.useState(!0),[i,a]=y.useState(new Set),o=F=>a(D=>{const P=new Set(D);return P.has(F)?P.delete(F):P.add(F),P}),s=zr(Zl),l=Es(),{items:c,hasMore:f,isLoading:u,loadMore:d}=pOe({filter:e,unreadOnly:n}),h=un(qwe),m=un(Vwe),b=un(Kwe),w=un(MO),g=un(NO),[v,x,E]=g$((J=c[0])==null?void 0:J.id),[C,k,,_]=g$((Y=c[0])==null?void 0:Y.id),A=gOe(()=>{f&&!u&&d()}),I=c.map(F=>C.has(F.id)?{...F,read:0}:v.has(F.id)?{...F,read:1}:F),O=s.unreadNotificationCount??0,z=F=>F.pullRequestId==="",U=F=>{F.read===0&&(x(F.id),_(F.id),h({payload:{id:F.id}})),z(F)?o(F.id):l(`/accounts/${encodeURIComponent(F.awsAccountId)}/prs/${F.pullRequestId}`)};return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("h1",{className:"text-lg font-semibold",children:"Notifications"}),p.jsx(Ot,{variant:"ghost",size:"sm",onClick:()=>l("/"),children:"Back"})]}),p.jsx(Ra,{}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs(OK,{type:"single",value:e??"all",onValueChange:F=>t(F==="all"||F===""?void 0:F),variant:"outline",size:"sm",children:[p.jsx(nv,{value:"all",children:"All"}),p.jsx(nv,{value:"system",children:"System"}),p.jsx(nv,{value:"prs",children:"PRs"})]}),p.jsx(Ot,{variant:n?"secondary":"ghost",size:"sm",onClick:()=>r(F=>!F),children:"Unread only"})]}),p.jsxs("div",{className:"space-y-3",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("div",{className:"flex items-center gap-2",children:O>0&&p.jsxs(Vn,{variant:"destructive",children:[O," unread"]})}),O>0&&p.jsxs(Ot,{variant:"ghost",size:"sm",onClick:()=>{E(I.map(F=>F.id)),b({})},children:[p.jsx(jO,{className:"size-3.5 mr-1"}),"Mark all read"]})]}),I.length===0?p.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No notifications"}):p.jsx("div",{className:"divide-y rounded-md border",children:I.map(F=>{const D=EOe(F.message),P=i.has(F.id);return p.jsxs("div",{className:`flex ${F.read===0?"border-l-2 border-l-blue-500":""}`,children:[p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-start gap-3 px-3 py-2.5 cursor-pointer hover:bg-accent/50 transition-colors",role:"button",tabIndex:0,onClick:()=>U(F),onKeyDown:$=>{$.key==="Enter"&&U(F)},children:[SOe(F.type),p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("div",{className:"flex items-baseline gap-2",children:[p.jsx("span",{className:`text-sm truncate ${F.read===0?"font-medium":"text-muted-foreground"}`,children:F.title||(z(F)?F.type:`PR #${F.pullRequestId}`)}),p.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:kOe(F.createdAt)})]}),!P&&p.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground line-clamp-1",children:D})]})]}),P&&p.jsxs("div",{className:"px-3 pb-2.5 ml-7 space-y-2 min-w-0 overflow-hidden",children:[Mt(NK(F.message),{onNone:()=>p.jsx("p",{className:"text-xs text-muted-foreground break-words",children:F.message}),onSome:$=>p.jsxs("div",{className:"text-xs text-muted-foreground space-y-0.5",children:[$.operation&&p.jsxs("div",{children:[p.jsx("span",{className:"font-medium",children:"operation:"})," ",$.operation]}),$.profile&&p.jsxs("div",{children:[p.jsx("span",{className:"font-medium",children:"profile:"})," ",$.profile]}),$.region&&p.jsxs("div",{children:[p.jsx("span",{className:"font-medium",children:"region:"})," ",$.region]}),$.cause&&p.jsxs("div",{children:[p.jsx("span",{className:"font-medium",children:"cause:"})," ",$.cause]}),$.error&&p.jsxs("div",{children:[p.jsx("span",{className:"font-medium",children:"error:"})," ",$.error]}),$.message&&p.jsxs("div",{children:[p.jsx("span",{className:"font-medium",children:"message:"})," ",$.message]})]})}),p.jsxs(dw,{children:[p.jsx(Ot,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>{F.read===0?(x(F.id),_(F.id),h({payload:{id:F.id}})):(k(F.id),m({payload:{id:F.id}}))},children:F.read===0?p.jsxs(p.Fragment,{children:[p.jsx(N1e,{className:"size-3"})," Mark as read"]}):p.jsxs(p.Fragment,{children:[p.jsx(j1e,{className:"size-3"})," Mark as unread"]})}),z(F)&&vOe(F.message)&&p.jsxs(p.Fragment,{children:[p.jsx(Ot,{variant:"default",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{try{const $=l9(qx)(F.profile||F.title);w({payload:{profile:$}})}catch{}},children:"Login"}),p.jsx(Ot,{variant:"ghost",size:"sm",className:"h-7 px-2.5 text-xs",onClick:()=>{g({})},children:"Logout"})]})]})]})]}),p.jsx("button",{className:"shrink-0 px-3 flex items-center hover:bg-accent/50 transition-colors border-l border-border",onClick:()=>o(F.id),title:P?"Collapse":"Expand",children:p.jsx(h1e,{className:`size-4 text-muted-foreground transition-transform ${P?"rotate-90":""}`})})]},F.id)})}),p.jsx("div",{ref:A,className:"h-1"}),u&&p.jsx("div",{className:"flex justify-center py-2",children:p.jsx(Vx,{className:"size-4 animate-spin text-muted-foreground"})})]})]})}const TOe=864e5,mc=e=>Math.round(e*10)/10,ROe=(e,t,n)=>Math.min(t,Math.max(e,n)),y$=(e,t)=>Math.max(0,(t.getTime()-e.getTime())/TOe),AOe=e=>/^\w+(\([^)]+\))?:/.test(e)||/^[A-Z]+-\d+:/.test(e),DK=(e,t)=>{const n=y$(e.lastModifiedDate,t),r=y$(e.creationDate,t),i=e.commentCount??0,a=AOe(e.title),o=!!e.description&&e.description.trim().length>0,s=-(n*1),l=-(r*.5),c=i*1,f=e.isApproved?2:0,u=e.isMergeable?0:-3,d=a?.5:0,h=o?.5:0,m=10+s+l+c+f+u+d+h,b=mc(ROe(0,10,m)),w=[{label:"Base",value:10},{label:"Time decay",value:mc(s)},{label:"Age",value:mc(l)},{label:"Comments",value:mc(c)},{label:"Approval",value:f},{label:"Conflicts",value:u},{label:"Scope",value:d},{label:"Description",value:h}],g=[{label:"Activity",description:`-1 per day since last update (${Math.round(n)}d ago)`,value:mc(s),...n<2?{status:"positive",statusLabel:"ACTIVE"}:n<=7?{status:"neutral",statusLabel:"SLOWING"}:{status:"negative",statusLabel:"STALE"}},{label:"Age",description:`-0.5 per day since creation (${Math.round(r)}d old)`,value:mc(l),...r<3?{status:"positive",statusLabel:"FRESH"}:r<=14?{status:"neutral",statusLabel:"AGING"}:{status:"negative",statusLabel:"OLD"}},{label:"Engagement",description:`+1 per comment (${i} comments)`,value:mc(c),...i>=3?{status:"positive",statusLabel:"ACTIVE"}:i>=1?{status:"neutral",statusLabel:"QUIET"}:{status:"negative",statusLabel:"SILENT"}},{label:"Approval",description:e.isApproved?"+2 bonus for approval":"No approval yet (+2 when approved)",value:f,...e.isApproved?{status:"positive",statusLabel:"APPROVED"}:{status:"neutral",statusLabel:"PENDING"}},{label:"Mergeable",description:e.isMergeable?"No merge conflicts":"-3 penalty for merge conflicts",value:u,...e.isMergeable?{status:"positive",statusLabel:"CLEAN"}:{status:"negative",statusLabel:"CONFLICT"}},{label:"Scope",description:a?"+0.5 bonus — conventional commit or ticket prefix detected":"No scope prefix found (e.g. feat(auth): or JIRA-123:)",value:d,...a?{status:"positive",statusLabel:"DETECTED"}:{status:"negative",statusLabel:"MISSING"}},{label:"Description",description:o?"+0.5 bonus — PR description provided":"No PR description provided",value:h,...o?{status:"positive",statusLabel:"PROVIDED"}:{status:"negative",statusLabel:"MISSING"}}];return ae({total:b,breakdown:w,categories:g})},d2=e=>c7(e).pipe(op(t=>t>=7,()=>"green"),op(t=>t>=4,()=>"yellow"),u7(()=>"red"));function OOe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const MOe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NOe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,DOe={};function b$(e,t){return(DOe.jsx?NOe:MOe).test(e)}const jOe=/[ \t\n\f\r]/g;function IOe(e){return typeof e=="object"?e.type==="text"?v$(e.value):!1:v$(e)}function v$(e){return e.replace(jOe,"")===""}class fy{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}fy.prototype.normal={};fy.prototype.property={};fy.prototype.space=void 0;function jK(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new fy(n,r,t)}function kC(e){return e.toLowerCase()}class li{constructor(t,n){this.attribute=n,this.property=t}}li.prototype.attribute="";li.prototype.booleanish=!1;li.prototype.boolean=!1;li.prototype.commaOrSpaceSeparated=!1;li.prototype.commaSeparated=!1;li.prototype.defined=!1;li.prototype.mustUseProperty=!1;li.prototype.number=!1;li.prototype.overloadedBoolean=!1;li.prototype.property="";li.prototype.spaceSeparated=!1;li.prototype.space=void 0;let $Oe=0;const We=$u(),gn=$u(),CC=$u(),re=$u(),$t=$u(),od=$u(),fi=$u();function $u(){return 2**++$Oe}const TC=Object.freeze(Object.defineProperty({__proto__:null,boolean:We,booleanish:gn,commaOrSpaceSeparated:fi,commaSeparated:od,number:re,overloadedBoolean:CC,spaceSeparated:$t},Symbol.toStringTag,{value:"Module"})),h_=Object.keys(TC);class h2 extends li{constructor(t,n,r,i){let a=-1;if(super(t,n),S$(this,"space",i),typeof r=="number")for(;++a<h_.length;){const o=h_[a];S$(this,h_[a],(r&TC[o])===TC[o])}}}h2.prototype.defined=!0;function S$(e,t,n){n&&(e[t]=n)}function Mh(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new h2(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[kC(r)]=r,n[kC(a.attribute)]=r}return new fy(t,n,e.space)}const IK=Mh({properties:{ariaActiveDescendant:null,ariaAtomic:gn,ariaAutoComplete:null,ariaBusy:gn,ariaChecked:gn,ariaColCount:re,ariaColIndex:re,ariaColSpan:re,ariaControls:$t,ariaCurrent:null,ariaDescribedBy:$t,ariaDetails:null,ariaDisabled:gn,ariaDropEffect:$t,ariaErrorMessage:null,ariaExpanded:gn,ariaFlowTo:$t,ariaGrabbed:gn,ariaHasPopup:null,ariaHidden:gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$t,ariaLevel:re,ariaLive:null,ariaModal:gn,ariaMultiLine:gn,ariaMultiSelectable:gn,ariaOrientation:null,ariaOwns:$t,ariaPlaceholder:null,ariaPosInSet:re,ariaPressed:gn,ariaReadOnly:gn,ariaRelevant:null,ariaRequired:gn,ariaRoleDescription:$t,ariaRowCount:re,ariaRowIndex:re,ariaRowSpan:re,ariaSelected:gn,ariaSetSize:re,ariaSort:null,ariaValueMax:re,ariaValueMin:re,ariaValueNow:re,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $K(e,t){return t in e?e[t]:t}function LK(e,t){return $K(e,t.toLowerCase())}const LOe=Mh({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:od,acceptCharset:$t,accessKey:$t,action:null,allow:null,allowFullScreen:We,allowPaymentRequest:We,allowUserMedia:We,alt:null,as:null,async:We,autoCapitalize:null,autoComplete:$t,autoFocus:We,autoPlay:We,blocking:$t,capture:null,charSet:null,checked:We,cite:null,className:$t,cols:re,colSpan:null,content:null,contentEditable:gn,controls:We,controlsList:$t,coords:re|od,crossOrigin:null,data:null,dateTime:null,decoding:null,default:We,defer:We,dir:null,dirName:null,disabled:We,download:CC,draggable:gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:We,formTarget:null,headers:$t,height:re,hidden:CC,high:re,href:null,hrefLang:null,htmlFor:$t,httpEquiv:$t,id:null,imageSizes:null,imageSrcSet:null,inert:We,inputMode:null,integrity:null,is:null,isMap:We,itemId:null,itemProp:$t,itemRef:$t,itemScope:We,itemType:$t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:We,low:re,manifest:null,max:null,maxLength:re,media:null,method:null,min:null,minLength:re,multiple:We,muted:We,name:null,nonce:null,noModule:We,noValidate:We,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:We,optimum:re,pattern:null,ping:$t,placeholder:null,playsInline:We,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:We,referrerPolicy:null,rel:$t,required:We,reversed:We,rows:re,rowSpan:re,sandbox:$t,scope:null,scoped:We,seamless:We,selected:We,shadowRootClonable:We,shadowRootDelegatesFocus:We,shadowRootMode:null,shape:null,size:re,sizes:null,slot:null,span:re,spellCheck:gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:re,step:null,style:null,tabIndex:re,target:null,title:null,translate:null,type:null,typeMustMatch:We,useMap:null,value:gn,width:re,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$t,axis:null,background:null,bgColor:null,border:re,borderColor:null,bottomMargin:re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:We,declare:We,event:null,face:null,frame:null,frameBorder:null,hSpace:re,leftMargin:re,link:null,longDesc:null,lowSrc:null,marginHeight:re,marginWidth:re,noResize:We,noHref:We,noShade:We,noWrap:We,object:null,profile:null,prompt:null,rev:null,rightMargin:re,rules:null,scheme:null,scrolling:gn,standby:null,summary:null,text:null,topMargin:re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:We,disableRemotePlayback:We,prefix:null,property:null,results:re,security:null,unselectable:null},space:"html",transform:LK}),zOe=Mh({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:fi,accentHeight:re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:re,amplitude:re,arabicForm:null,ascent:re,attributeName:null,attributeType:null,azimuth:re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:re,by:null,calcMode:null,capHeight:re,className:$t,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:re,diffuseConstant:re,direction:null,display:null,dur:null,divisor:re,dominantBaseline:null,download:We,dx:null,dy:null,edgeMode:null,editable:null,elevation:re,enableBackground:null,end:null,event:null,exponent:re,externalResourcesRequired:null,fill:null,fillOpacity:re,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:od,g2:od,glyphName:od,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:re,horizOriginX:re,horizOriginY:re,id:null,ideographic:re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:re,k:re,k1:re,k2:re,k3:re,k4:re,kernelMatrix:fi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:re,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:re,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:re,overlineThickness:re,paintOrder:null,panose1:null,path:null,pathLength:re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:re,pointsAtY:re,pointsAtZ:re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fi,rev:fi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fi,requiredFeatures:fi,requiredFonts:fi,requiredFormats:fi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:re,specularExponent:re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:re,strikethroughThickness:re,string:null,stroke:null,strokeDashArray:fi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:re,strokeOpacity:re,strokeWidth:null,style:null,surfaceScale:re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fi,tabIndex:re,tableValues:null,target:null,targetX:re,targetY:re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:re,underlineThickness:re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:re,values:null,vAlphabetic:re,vMathematical:re,vectorEffect:null,vHanging:re,vIdeographic:re,version:null,vertAdvY:re,vertOriginX:re,vertOriginY:re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$K}),zK=Mh({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),PK=Mh({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:LK}),FK=Mh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),POe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},FOe=/[A-Z]/g,x$=/-[a-z]/g,UOe=/^data[-\w.:]+$/i;function BOe(e,t){const n=kC(t);let r=t,i=li;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&UOe.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(x$,qOe);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!x$.test(a)){let o=a.replace(FOe,HOe);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=h2}return new i(r,t)}function HOe(e){return"-"+e.toLowerCase()}function qOe(e){return e.charAt(1).toUpperCase()}const VOe=jK([IK,LOe,zK,PK,FK],"html"),m2=jK([IK,zOe,zK,PK,FK],"svg");function KOe(e){return e.join(" ").trim()}var p2={},w$=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,GOe=/\n/g,YOe=/^\s*/,WOe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,JOe=/^:\s*/,XOe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,QOe=/^[;\s]*/,ZOe=/^\s+|\s+$/g,e2e=`
342
+ `,_$="/",E$="*",kc="",t2e="comment",n2e="declaration";function r2e(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var b=m.match(GOe);b&&(n+=b.length);var w=m.lastIndexOf(e2e);r=~w?m.length-w:r+m.length}function a(){var m={line:n,column:r};return function(b){return b.position=new o(m),c(),b}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(m){var b=new Error(t.source+":"+n+":"+r+": "+m);if(b.reason=m,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function l(m){var b=m.exec(e);if(b){var w=b[0];return i(w),e=e.slice(w.length),b}}function c(){l(YOe)}function f(m){var b;for(m=m||[];b=u();)b!==!1&&m.push(b);return m}function u(){var m=a();if(!(_$!=e.charAt(0)||E$!=e.charAt(1))){for(var b=2;kc!=e.charAt(b)&&(E$!=e.charAt(b)||_$!=e.charAt(b+1));)++b;if(b+=2,kc===e.charAt(b-1))return s("End of comment missing");var w=e.slice(2,b-2);return r+=2,i(w),e=e.slice(b),r+=2,m({type:t2e,comment:w})}}function d(){var m=a(),b=l(WOe);if(b){if(u(),!l(JOe))return s("property missing ':'");var w=l(XOe),g=m({type:n2e,property:k$(b[0].replace(w$,kc)),value:w?k$(w[0].replace(w$,kc)):kc});return l(QOe),g}}function h(){var m=[];f(m);for(var b;b=d();)b!==!1&&(m.push(b),f(m));return m}return c(),h()}function k$(e){return e?e.replace(ZOe,kc):kc}var i2e=r2e,a2e=av&&av.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p2,"__esModule",{value:!0});p2.default=s2e;const o2e=a2e(i2e);function s2e(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,o2e.default)(e),i=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:o,value:s}=a;i?t(o,s,a):s&&(n=n||{},n[o]=s)}),n}var mw={};Object.defineProperty(mw,"__esModule",{value:!0});mw.camelCase=void 0;var l2e=/^--[a-zA-Z0-9_-]+$/,c2e=/-([a-z])/g,u2e=/^[^-]+$/,f2e=/^-(webkit|moz|ms|o|khtml)-/,d2e=/^-(ms)-/,h2e=function(e){return!e||u2e.test(e)||l2e.test(e)},m2e=function(e,t){return t.toUpperCase()},C$=function(e,t){return"".concat(t,"-")},p2e=function(e,t){return t===void 0&&(t={}),h2e(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(d2e,C$):e=e.replace(f2e,C$),e.replace(c2e,m2e))};mw.camelCase=p2e;var g2e=av&&av.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},y2e=g2e(p2),b2e=mw;function RC(e,t){var n={};return!e||typeof e!="string"||(0,y2e.default)(e,function(r,i){r&&i&&(n[(0,b2e.camelCase)(r,t)]=i)}),n}RC.default=RC;var v2e=RC;const S2e=sg(v2e),UK=BK("end"),g2=BK("start");function BK(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function HK(e){const t=g2(e),n=UK(e);if(t&&n)return{start:t,end:n}}function sp(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?T$(e.position):"start"in e||"end"in e?T$(e):"line"in e||"column"in e?AC(e):""}function AC(e){return R$(e&&e.line)+":"+R$(e&&e.column)}function T$(e){return AC(e&&e.start)+"-"+AC(e&&e.end)}function R$(e){return e&&typeof e=="number"?e:1}class Cr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?a.ruleId=r:(a.source=r.slice(0,l),a.ruleId=r.slice(l+1))}if(!a.place&&a.ancestors&&a.ancestors){const l=a.ancestors[a.ancestors.length-1];l&&(a.place=l.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=sp(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Cr.prototype.file="";Cr.prototype.name="";Cr.prototype.reason="";Cr.prototype.message="";Cr.prototype.stack="";Cr.prototype.column=void 0;Cr.prototype.line=void 0;Cr.prototype.ancestors=void 0;Cr.prototype.cause=void 0;Cr.prototype.fatal=void 0;Cr.prototype.place=void 0;Cr.prototype.ruleId=void 0;Cr.prototype.source=void 0;const y2={}.hasOwnProperty,x2e=new Map,w2e=/[A-Z]/g,_2e=new Set(["table","tbody","thead","tfoot","tr"]),E2e=new Set(["td","th"]),qK="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function k2e(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=D2e(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=N2e(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?m2:VOe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=VK(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function VK(e,t,n){if(t.type==="element")return C2e(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return T2e(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return A2e(e,t,n);if(t.type==="mdxjsEsm")return R2e(e,t);if(t.type==="root")return O2e(e,t,n);if(t.type==="text")return M2e(e,t)}function C2e(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=m2,e.schema=i),e.ancestors.push(t);const a=GK(e,t.tagName,!1),o=j2e(e,t);let s=v2(e,t);return _2e.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!IOe(l):!0})),KK(e,o,a,t),b2(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function T2e(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}eg(e,t.position)}function R2e(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);eg(e,t.position)}function A2e(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=m2,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:GK(e,t.name,!0),o=I2e(e,t),s=v2(e,t);return KK(e,o,a,t),b2(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function O2e(e,t,n){const r={};return b2(r,v2(e,t)),e.create(t,e.Fragment,r,n)}function M2e(e,t){return t.value}function KK(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function b2(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function N2e(e,t,n){return r;function r(i,a,o,s){const c=Array.isArray(o.children)?n:t;return s?c(a,o,s):c(a,o)}}function D2e(e,t){return n;function n(r,i,a,o){const s=Array.isArray(a.children),l=g2(r);return t(i,a,o,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function j2e(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&y2.call(t.properties,i)){const a=$2e(e,i,t.properties[i]);if(a){const[o,s]=a;e.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&E2e.has(t.tagName)?r=s:n[o]=s}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function I2e(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const s=o.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else eg(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,a=e.evaluater.evaluateExpression(s.expression)}else eg(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function v2(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:x2e;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const l=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const s=VK(e,a,o);s!==void 0&&n.push(s)}return n}function $2e(e,t,n){const r=BOe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?OOe(n):KOe(n)),r.property==="style"){let i=typeof n=="object"?n:L2e(e,String(n));return e.stylePropertyNameCase==="css"&&(i=z2e(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?POe[r.property]||r.property:r.attribute,n]}}function L2e(e,t){try{return S2e(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Cr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=qK+"#cannot-parse-style-attribute",i}}function GK(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const s=b$(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:s,computed:!!(a&&s.type==="Literal"),optional:!1}:s}r=o}else r=b$(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return y2.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);eg(e)}function eg(e,t){const n=new Cr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=qK+"#cannot-handle-mdx-estrees-without-createevaluater",n}function z2e(e){const t={};let n;for(n in e)y2.call(e,n)&&(t[P2e(n)]=e[n]);return t}function P2e(e){let t=e.replace(w2e,F2e);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function F2e(e){return"-"+e.toLowerCase()}const m_={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},U2e={};function S2(e,t){const n=U2e,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return YK(e,r,i)}function YK(e,t,n){if(B2e(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return A$(e.children,t,n)}return Array.isArray(e)?A$(e,t,n):""}function A$(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=YK(e[i],t,n);return r.join("")}function B2e(e){return!!(e&&typeof e=="object")}const O$=document.createElement("i");function x2(e){const t="&"+e+";";O$.innerHTML=t;const n=O$.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ti(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function qi(e,t){return e.length>0?(Ti(e,e.length,0,t),e):t}const M$={}.hasOwnProperty;function WK(e){const t={};let n=-1;for(;++n<e.length;)H2e(t,e[n]);return t}function H2e(e,t){let n;for(n in t){const i=(M$.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){M$.call(i,o)||(i[o]=[]);const s=a[o];q2e(i[o],Array.isArray(s)?s:s?[s]:[])}}}function q2e(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ti(e,0,0,r)}function JK(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Aa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const jr=oc(/[A-Za-z]/),_r=oc(/[\dA-Za-z]/),V2e=oc(/[#-'*+\--9=?A-Z^-~]/);function Q0(e){return e!==null&&(e<32||e===127)}const OC=oc(/\d/),K2e=oc(/[\dA-Fa-f]/),G2e=oc(/[!-/:-@[-`{-~]/);function Me(e){return e!==null&&e<-2}function jt(e){return e!==null&&(e<0||e===32)}function rt(e){return e===-2||e===-1||e===32}const pw=oc(new RegExp("\\p{P}|\\p{S}","u")),gu=oc(/\s/);function oc(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Nh(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&_r(e.charCodeAt(n+1))&&_r(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const s=e.charCodeAt(n+1);a<56320&&s>56319&&s<57344?(o=String.fromCharCode(a,s),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ut(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(l){return rt(l)?(e.enter(n),s(l)):t(l)}function s(l){return rt(l)&&a++<i?(e.consume(l),s):(e.exit(n),t(l))}}const Y2e={tokenize:W2e};function W2e(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ut(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),a(s)}function a(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(s)}function o(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return Me(s)?(e.consume(s),e.exit("chunkText"),a):(e.consume(s),o)}}const J2e={tokenize:X2e},N$={tokenize:Q2e};function X2e(e){const t=this,n=[];let r=0,i,a,o;return s;function s(x){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,l,c)(x)}return c(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const E=t.events.length;let C=E,k;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){k=t.events[C][1].end;break}g(r);let _=E;for(;_<t.events.length;)t.events[_][1].end={...k},_++;return Ti(t.events,C+1,0,t.events.slice(E)),t.events.length=_,c(x)}return s(x)}function c(x){if(r===n.length){if(!i)return d(x);if(i.currentConstruct&&i.currentConstruct.concrete)return m(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(N$,f,u)(x)}function f(x){return i&&v(),g(r),d(x)}function u(x){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(x)}function d(x){return t.containerState={},e.attempt(N$,h,m)(x)}function h(x){return r++,n.push([t.currentConstruct,t.containerState]),d(x)}function m(x){if(x===null){i&&v(),g(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),b(x)}function b(x){if(x===null){w(e.exit("chunkFlow"),!0),g(0),e.consume(x);return}return Me(x)?(e.consume(x),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(x),b)}function w(x,E){const C=t.sliceStream(x);if(E&&C.push(null),x.previous=a,a&&(a.next=x),a=x,i.defineSkip(x.start),i.write(C),t.parser.lazy[x.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<o&&(!i.events[k][1].end||i.events[k][1].end.offset>o))return;const _=t.events.length;let A=_,I,O;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){if(I){O=t.events[A][1].end;break}I=!0}for(g(r),k=_;k<t.events.length;)t.events[k][1].end={...O},k++;Ti(t.events,A+1,0,t.events.slice(_)),t.events.length=k}}function g(x){let E=n.length;for(;E-- >x;){const C=n[E];t.containerState=C[1],C[0].exit.call(t,e)}n.length=x}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Q2e(e,t,n){return ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Hd(e){if(e===null||jt(e)||gu(e))return 1;if(pw(e))return 2}function gw(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const MC={name:"attention",resolveAll:Z2e,tokenize:eMe};function Z2e(e,t){let n=-1,r,i,a,o,s,l,c,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const u={...e[r][1].end},d={...e[n][1].start};D$(u,-l),D$(d,l),o={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:d},a={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=qi(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=qi(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),c=qi(c,gw(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=qi(c,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=qi(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Ti(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function eMe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Hd(r);let a;return o;function o(l){return a=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===a)return e.consume(l),s;const c=e.exit("attentionSequence"),f=Hd(l),u=!f||f===2&&i||n.includes(l),d=!i||i===2&&f||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(f||!u)),t(l)}}function D$(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const tMe={name:"autolink",tokenize:nMe};function nMe(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(h){return jr(h)?(e.consume(h),o):h===64?n(h):c(h)}function o(h){return h===43||h===45||h===46||_r(h)?(r=1,s(h)):c(h)}function s(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||_r(h))&&r++<32?(e.consume(h),s):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||Q0(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),f):V2e(h)?(e.consume(h),c):n(h)}function f(h){return _r(h)?u(h):n(h)}function u(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):d(h)}function d(h){if((h===45||_r(h))&&r++<63){const m=h===45?d:u;return e.consume(h),m}return n(h)}}const dy={partial:!0,tokenize:rMe};function rMe(e,t,n){return r;function r(a){return rt(a)?ut(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Me(a)?t(a):n(a)}}const XK={continuation:{tokenize:aMe},exit:oMe,name:"blockQuote",tokenize:iMe};function iMe(e,t,n){const r=this;return i;function i(o){if(o===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return rt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function aMe(e,t,n){const r=this;return i;function i(o){return rt(o)?ut(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(XK,t,n)(o)}}function oMe(e){e.exit("blockQuote")}const QK={name:"characterEscape",tokenize:sMe};function sMe(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return G2e(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const ZK={name:"characterReference",tokenize:lMe};function lMe(e,t,n){const r=this;let i=0,a,o;return s;function s(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),a=31,o=_r,f(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=K2e,f):(e.enter("characterReferenceValue"),a=7,o=OC,f(u))}function f(u){if(u===59&&i){const d=e.exit("characterReferenceValue");return o===_r&&!x2(r.sliceSerialize(d))?n(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(u)&&i++<a?(e.consume(u),f):n(u)}}const j$={partial:!0,tokenize:uMe},I$={concrete:!0,name:"codeFenced",tokenize:cMe};function cMe(e,t,n){const r=this,i={partial:!0,tokenize:C};let a=0,o=0,s;return l;function l(k){return c(k)}function c(k){const _=r.events[r.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,s=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(k)}function f(k){return k===s?(o++,e.consume(k),f):o<3?n(k):(e.exit("codeFencedFenceSequence"),rt(k)?ut(e,u,"whitespace")(k):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(j$,b,E)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===null||Me(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(k)):rt(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ut(e,h,"whitespace")(k)):k===96&&k===s?n(k):(e.consume(k),d)}function h(k){return k===null||Me(k)?u(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===null||Me(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(k)):k===96&&k===s?n(k):(e.consume(k),m)}function b(k){return e.attempt(i,E,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),g}function g(k){return a>0&&rt(k)?ut(e,v,"linePrefix",a+1)(k):v(k)}function v(k){return k===null||Me(k)?e.check(j$,b,E)(k):(e.enter("codeFlowValue"),x(k))}function x(k){return k===null||Me(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),x)}function E(k){return e.exit("codeFenced"),t(k)}function C(k,_,A){let I=0;return O;function O(F){return k.enter("lineEnding"),k.consume(F),k.exit("lineEnding"),z}function z(F){return k.enter("codeFencedFence"),rt(F)?ut(k,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):U(F)}function U(F){return F===s?(k.enter("codeFencedFenceSequence"),J(F)):A(F)}function J(F){return F===s?(I++,k.consume(F),J):I>=o?(k.exit("codeFencedFenceSequence"),rt(F)?ut(k,Y,"whitespace")(F):Y(F)):A(F)}function Y(F){return F===null||Me(F)?(k.exit("codeFencedFence"),_(F)):A(F)}}}function uMe(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const p_={name:"codeIndented",tokenize:dMe},fMe={partial:!0,tokenize:hMe};function dMe(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ut(e,a,"linePrefix",5)(c)}function a(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):Me(c)?e.attempt(fMe,o,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||Me(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function hMe(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Me(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):ut(e,a,"linePrefix",5)(o)}function a(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):Me(o)?i(o):n(o)}}const mMe={name:"codeText",previous:gMe,resolve:pMe,tokenize:yMe};function pMe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function gMe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function yMe(e,t,n){let r=0,i,a;return o;function o(u){return e.enter("codeText"),e.enter("codeTextSequence"),s(u)}function s(u){return u===96?(e.consume(u),r++,s):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?n(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(a=e.enter("codeTextSequence"),i=0,f(u)):Me(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||Me(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function f(u){return u===96?(e.consume(u),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(u)):(a.type="codeTextData",c(u))}}class bMe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&am(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),am(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),am(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);am(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);am(this.left,n.reverse())}}}function am(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function eG(e){const t={};let n=-1,r,i,a,o,s,l,c;const f=new bMe(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,a=0,a<l.length&&l[a][1].type==="lineEndingBlank"&&(a+=2),a<l.length&&l[a][1].type==="content"))for(;++a<l.length&&l[a][1].type!=="content";)l[a][1].type==="chunkText"&&(l[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,vMe(f,n)),n=t[n],c=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=f.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},s=f.slice(i,n),s.unshift(r),f.splice(i,n-i+1,s))}}return Ti(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!c}function vMe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const s=o.events,l=[],c={};let f,u,d=-1,h=n,m=0,b=0;const w=[b];for(;h;){for(;e.get(++i)[1]!==h;);a.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),u&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(f),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),u=h,h=h.next}for(h=n;++d<s.length;)s[d][0]==="exit"&&s[d-1][0]==="enter"&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(b=d+1,w.push(b),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):w.pop(),d=w.length;d--;){const g=s.slice(w[d],w[d+1]),v=a.pop();l.push([v,v+g.length-1]),e.splice(v,2,g)}for(l.reverse(),d=-1;++d<l.length;)c[m+l[d][0]]=m+l[d][1],m+=l[d][1]-l[d][0]-1;return c}const SMe={resolve:wMe,tokenize:_Me},xMe={partial:!0,tokenize:EMe};function wMe(e){return eG(e),e}function _Me(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?a(s):Me(s)?e.check(xMe,o,a)(s):(e.consume(s),i)}function a(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function o(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function EMe(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ut(e,a,"linePrefix")}function a(o){if(o===null||Me(o))return n(o);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function tG(e,t,n,r,i,a,o,s,l){const c=l||Number.POSITIVE_INFINITY;let f=0;return u;function u(g){return g===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(g),e.exit(a),d):g===null||g===32||g===41||Q0(g)?n(g):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),b(g))}function d(g){return g===62?(e.enter(a),e.consume(g),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===62?(e.exit("chunkString"),e.exit(s),d(g)):g===null||g===60||Me(g)?n(g):(e.consume(g),g===92?m:h)}function m(g){return g===60||g===62||g===92?(e.consume(g),h):h(g)}function b(g){return!f&&(g===null||g===41||jt(g))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(g)):f<c&&g===40?(e.consume(g),f++,b):g===41?(e.consume(g),f--,b):g===null||g===32||g===40||Q0(g)?n(g):(e.consume(g),g===92?w:b)}function w(g){return g===40||g===41||g===92?(e.consume(g),b):b(g)}}function nG(e,t,n,r,i,a){const o=this;let s=0,l;return c;function c(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(a),f}function f(h){return s>999||h===null||h===91||h===93&&!l||h===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):h===93?(e.exit(a),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):Me(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===null||h===91||h===93||Me(h)||s++>999?(e.exit("chunkString"),f(h)):(e.consume(h),l||(l=!rt(h)),h===92?d:u)}function d(h){return h===91||h===92||h===93?(e.consume(h),s++,u):u(h)}}function rG(e,t,n,r,i,a){let o;return s;function s(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),o=d===40?41:d,l):n(d)}function l(d){return d===o?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(e.enter(a),c(d))}function c(d){return d===o?(e.exit(a),l(o)):d===null?n(d):Me(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ut(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===o||d===null||Me(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?u:f)}function u(d){return d===o||d===92?(e.consume(d),f):f(d)}}function lp(e,t){let n;return r;function r(i){return Me(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):rt(i)?ut(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const kMe={name:"definition",tokenize:TMe},CMe={partial:!0,tokenize:RMe};function TMe(e,t,n){const r=this;let i;return a;function a(h){return e.enter("definition"),o(h)}function o(h){return nG.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=Aa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return jt(h)?lp(e,c)(h):c(h)}function c(h){return tG(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(CMe,u,u)(h)}function u(h){return rt(h)?ut(e,d,"whitespace")(h):d(h)}function d(h){return h===null||Me(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function RMe(e,t,n){return r;function r(s){return jt(s)?lp(e,i)(s):n(s)}function i(s){return rG(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return rt(s)?ut(e,o,"whitespace")(s):o(s)}function o(s){return s===null||Me(s)?t(s):n(s)}}const AMe={name:"hardBreakEscape",tokenize:OMe};function OMe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Me(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const MMe={name:"headingAtx",resolve:NMe,tokenize:DMe};function NMe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ti(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function DMe(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),a(f)}function a(f){return e.enter("atxHeadingSequence"),o(f)}function o(f){return f===35&&r++<6?(e.consume(f),o):f===null||jt(f)?(e.exit("atxHeadingSequence"),s(f)):n(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||Me(f)?(e.exit("atxHeading"),t(f)):rt(f)?ut(e,s,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),s(f))}function c(f){return f===null||f===35||jt(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),c)}}const jMe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],$$=["pre","script","style","textarea"],IMe={concrete:!0,name:"htmlFlow",resolveTo:zMe,tokenize:PMe},$Me={partial:!0,tokenize:UMe},LMe={partial:!0,tokenize:FMe};function zMe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function PMe(e,t,n){const r=this;let i,a,o,s,l;return c;function c(R){return f(R)}function f(R){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(R),u}function u(R){return R===33?(e.consume(R),d):R===47?(e.consume(R),a=!0,b):R===63?(e.consume(R),i=3,r.interrupt?t:M):jr(R)?(e.consume(R),o=String.fromCharCode(R),w):n(R)}function d(R){return R===45?(e.consume(R),i=2,h):R===91?(e.consume(R),i=5,s=0,m):jr(R)?(e.consume(R),i=4,r.interrupt?t:M):n(R)}function h(R){return R===45?(e.consume(R),r.interrupt?t:M):n(R)}function m(R){const X="CDATA[";return R===X.charCodeAt(s++)?(e.consume(R),s===X.length?r.interrupt?t:U:m):n(R)}function b(R){return jr(R)?(e.consume(R),o=String.fromCharCode(R),w):n(R)}function w(R){if(R===null||R===47||R===62||jt(R)){const X=R===47,G=o.toLowerCase();return!X&&!a&&$$.includes(G)?(i=1,r.interrupt?t(R):U(R)):jMe.includes(o.toLowerCase())?(i=6,X?(e.consume(R),g):r.interrupt?t(R):U(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):a?v(R):x(R))}return R===45||_r(R)?(e.consume(R),o+=String.fromCharCode(R),w):n(R)}function g(R){return R===62?(e.consume(R),r.interrupt?t:U):n(R)}function v(R){return rt(R)?(e.consume(R),v):O(R)}function x(R){return R===47?(e.consume(R),O):R===58||R===95||jr(R)?(e.consume(R),E):rt(R)?(e.consume(R),x):O(R)}function E(R){return R===45||R===46||R===58||R===95||_r(R)?(e.consume(R),E):C(R)}function C(R){return R===61?(e.consume(R),k):rt(R)?(e.consume(R),C):x(R)}function k(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),l=R,_):rt(R)?(e.consume(R),k):A(R)}function _(R){return R===l?(e.consume(R),l=null,I):R===null||Me(R)?n(R):(e.consume(R),_)}function A(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||jt(R)?C(R):(e.consume(R),A)}function I(R){return R===47||R===62||rt(R)?x(R):n(R)}function O(R){return R===62?(e.consume(R),z):n(R)}function z(R){return R===null||Me(R)?U(R):rt(R)?(e.consume(R),z):n(R)}function U(R){return R===45&&i===2?(e.consume(R),D):R===60&&i===1?(e.consume(R),P):R===62&&i===4?(e.consume(R),ue):R===63&&i===3?(e.consume(R),M):R===93&&i===5?(e.consume(R),q):Me(R)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check($Me,H,J)(R)):R===null||Me(R)?(e.exit("htmlFlowData"),J(R)):(e.consume(R),U)}function J(R){return e.check(LMe,Y,H)(R)}function Y(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),F}function F(R){return R===null||Me(R)?J(R):(e.enter("htmlFlowData"),U(R))}function D(R){return R===45?(e.consume(R),M):U(R)}function P(R){return R===47?(e.consume(R),o="",$):U(R)}function $(R){if(R===62){const X=o.toLowerCase();return $$.includes(X)?(e.consume(R),ue):U(R)}return jr(R)&&o.length<8?(e.consume(R),o+=String.fromCharCode(R),$):U(R)}function q(R){return R===93?(e.consume(R),M):U(R)}function M(R){return R===62?(e.consume(R),ue):R===45&&i===2?(e.consume(R),M):U(R)}function ue(R){return R===null||Me(R)?(e.exit("htmlFlowData"),H(R)):(e.consume(R),ue)}function H(R){return e.exit("htmlFlow"),t(R)}}function FMe(e,t,n){const r=this;return i;function i(o){return Me(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function UMe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(dy,t,n)}}const BMe={name:"htmlText",tokenize:HMe};function HMe(e,t,n){const r=this;let i,a,o;return s;function s(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),l}function l(M){return M===33?(e.consume(M),c):M===47?(e.consume(M),C):M===63?(e.consume(M),x):jr(M)?(e.consume(M),A):n(M)}function c(M){return M===45?(e.consume(M),f):M===91?(e.consume(M),a=0,m):jr(M)?(e.consume(M),v):n(M)}function f(M){return M===45?(e.consume(M),h):n(M)}function u(M){return M===null?n(M):M===45?(e.consume(M),d):Me(M)?(o=u,P(M)):(e.consume(M),u)}function d(M){return M===45?(e.consume(M),h):u(M)}function h(M){return M===62?D(M):M===45?d(M):u(M)}function m(M){const ue="CDATA[";return M===ue.charCodeAt(a++)?(e.consume(M),a===ue.length?b:m):n(M)}function b(M){return M===null?n(M):M===93?(e.consume(M),w):Me(M)?(o=b,P(M)):(e.consume(M),b)}function w(M){return M===93?(e.consume(M),g):b(M)}function g(M){return M===62?D(M):M===93?(e.consume(M),g):b(M)}function v(M){return M===null||M===62?D(M):Me(M)?(o=v,P(M)):(e.consume(M),v)}function x(M){return M===null?n(M):M===63?(e.consume(M),E):Me(M)?(o=x,P(M)):(e.consume(M),x)}function E(M){return M===62?D(M):x(M)}function C(M){return jr(M)?(e.consume(M),k):n(M)}function k(M){return M===45||_r(M)?(e.consume(M),k):_(M)}function _(M){return Me(M)?(o=_,P(M)):rt(M)?(e.consume(M),_):D(M)}function A(M){return M===45||_r(M)?(e.consume(M),A):M===47||M===62||jt(M)?I(M):n(M)}function I(M){return M===47?(e.consume(M),D):M===58||M===95||jr(M)?(e.consume(M),O):Me(M)?(o=I,P(M)):rt(M)?(e.consume(M),I):D(M)}function O(M){return M===45||M===46||M===58||M===95||_r(M)?(e.consume(M),O):z(M)}function z(M){return M===61?(e.consume(M),U):Me(M)?(o=z,P(M)):rt(M)?(e.consume(M),z):I(M)}function U(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),i=M,J):Me(M)?(o=U,P(M)):rt(M)?(e.consume(M),U):(e.consume(M),Y)}function J(M){return M===i?(e.consume(M),i=void 0,F):M===null?n(M):Me(M)?(o=J,P(M)):(e.consume(M),J)}function Y(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||jt(M)?I(M):(e.consume(M),Y)}function F(M){return M===47||M===62||jt(M)?I(M):n(M)}function D(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function P(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),$}function $(M){return rt(M)?ut(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):q(M)}function q(M){return e.enter("htmlTextData"),o(M)}}const w2={name:"labelEnd",resolveAll:GMe,resolveTo:YMe,tokenize:WMe},qMe={tokenize:JMe},VMe={tokenize:XMe},KMe={tokenize:QMe};function GMe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ti(e,0,e.length,n),e}function YMe(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},f={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[["enter",l,t],["enter",c,t]],s=qi(s,e.slice(a+1,a+r+3)),s=qi(s,[["enter",f,t]]),s=qi(s,gw(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=qi(s,[["exit",f,t],e[o-2],e[o-1],["exit",c,t]]),s=qi(s,e.slice(o+1)),s=qi(s,[["exit",l,t]]),Ti(e,a,e.length,s),e}function WMe(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(d){return a?a._inactive?u(d):(o=r.parser.defined.includes(Aa(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),l):n(d)}function l(d){return d===40?e.attempt(qMe,f,o?f:u)(d):d===91?e.attempt(VMe,f,o?c:u)(d):o?f(d):u(d)}function c(d){return e.attempt(KMe,f,u)(d)}function f(d){return t(d)}function u(d){return a._balanced=!0,n(d)}}function JMe(e,t,n){return r;function r(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),i}function i(u){return jt(u)?lp(e,a)(u):a(u)}function a(u){return u===41?f(u):tG(e,o,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function o(u){return jt(u)?lp(e,l)(u):f(u)}function s(u){return n(u)}function l(u){return u===34||u===39||u===40?rG(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):f(u)}function c(u){return jt(u)?lp(e,f)(u):f(u)}function f(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),t):n(u)}}function XMe(e,t,n){const r=this;return i;function i(s){return nG.call(r,e,a,o,"reference","referenceMarker","referenceString")(s)}function a(s){return r.parser.defined.includes(Aa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function o(s){return n(s)}}function QMe(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const ZMe={name:"labelStartImage",resolveAll:w2.resolveAll,tokenize:eNe};function eNe(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),a}function a(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),o):n(s)}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const tNe={name:"labelStartLink",resolveAll:w2.resolveAll,tokenize:nNe};function nNe(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const g_={name:"lineEnding",tokenize:rNe};function rNe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ut(e,t,"linePrefix")}}const rv={name:"thematicBreak",tokenize:iNe};function iNe(e,t,n){let r=0,i;return a;function a(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Me(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),rt(c)?ut(e,s,"whitespace")(c):s(c))}}const Yr={continuation:{tokenize:lNe},exit:uNe,name:"list",tokenize:sNe},aNe={partial:!0,tokenize:fNe},oNe={partial:!0,tokenize:cNe};function sNe(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:OC(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(rv,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return OC(h)&&++o<10?(e.consume(h),l):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(dy,r.interrupt?n:f,e.attempt(aNe,d,u))}function f(h){return r.containerState.initialBlankLine=!0,a++,d(h)}function u(h){return rt(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function lNe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(dy,i,a);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ut(e,t,"listItemIndent",r.containerState.size+1)(s)}function a(s){return r.containerState.furtherBlankLines||!rt(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(oNe,t,o)(s))}function o(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ut(e,e.attempt(Yr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function cNe(e,t,n){const r=this;return ut(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function uNe(e){e.exit(this.containerState.type)}function fNe(e,t,n){const r=this;return ut(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!rt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const L$={name:"setextUnderline",resolveTo:dNe,tokenize:hNe};function dNe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function hNe(e,t,n){const r=this;let i;return a;function a(c){let f=r.events.length,u;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){u=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||u)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),rt(c)?ut(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Me(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const mNe={tokenize:pNe};function pNe(e){const t=this,n=e.attempt(dy,r,e.attempt(this.parser.constructs.flowInitial,i,ut(e,e.attempt(this.parser.constructs.flow,i,e.attempt(SMe,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const gNe={resolveAll:aG()},yNe=iG("string"),bNe=iG("text");function iG(e){return{resolveAll:aG(e==="text"?vNe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,s);return o;function o(f){return c(f)?a(f):s(f)}function s(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return c(f)?(n.exit("data"),a(f)):(n.consume(f),l)}function c(f){if(f===null)return!0;const u=i[f];let d=-1;if(u)for(;++d<u.length;){const h=u[d];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function aG(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function vNe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,s=0,l;for(;a--;){const c=i[a];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(c===-2)l=!0,s++;else if(c!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const SNe={42:Yr,43:Yr,45:Yr,48:Yr,49:Yr,50:Yr,51:Yr,52:Yr,53:Yr,54:Yr,55:Yr,56:Yr,57:Yr,62:XK},xNe={91:kMe},wNe={[-2]:p_,[-1]:p_,32:p_},_Ne={35:MMe,42:rv,45:[L$,rv],60:IMe,61:L$,95:rv,96:I$,126:I$},ENe={38:ZK,92:QK},kNe={[-5]:g_,[-4]:g_,[-3]:g_,33:ZMe,38:ZK,42:MC,60:[tMe,BMe],91:tNe,92:[AMe,QK],93:w2,95:MC,96:mMe},CNe={null:[MC,gNe]},TNe={null:[42,95]},RNe={null:[]},ANe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:TNe,contentInitial:xNe,disable:RNe,document:SNe,flow:_Ne,flowInitial:wNe,insideSpan:CNe,string:ENe,text:kNe},Symbol.toStringTag,{value:"Module"}));function ONe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],s=[];const l={attempt:_(C),check:_(k),consume:v,enter:x,exit:E,interrupt:_(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:m,parser:e,previous:null,sliceSerialize:d,sliceStream:h,write:u};let f=t.tokenize.call(c,l);return t.resolveAll&&a.push(t),c;function u(z){return o=qi(o,z),w(),o[o.length-1]!==null?[]:(A(t,0),c.events=gw(a,c.events,c),c.events)}function d(z,U){return NNe(h(z),U)}function h(z){return MNe(o,z)}function m(){const{_bufferIndex:z,_index:U,line:J,column:Y,offset:F}=r;return{_bufferIndex:z,_index:U,line:J,column:Y,offset:F}}function b(z){i[z.line]=z.column,O()}function w(){let z;for(;r._index<o.length;){const U=o[r._index];if(typeof U=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<U.length;)g(U.charCodeAt(r._bufferIndex));else g(U)}}function g(z){f=f(z)}function v(z){Me(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,O()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=z}function x(z,U){const J=U||{};return J.type=z,J.start=m(),c.events.push(["enter",J,c]),s.push(J),J}function E(z){const U=s.pop();return U.end=m(),c.events.push(["exit",U,c]),U}function C(z,U){A(z,U.from)}function k(z,U){U.restore()}function _(z,U){return J;function J(Y,F,D){let P,$,q,M;return Array.isArray(Y)?H(Y):"tokenize"in Y?H([Y]):ue(Y);function ue(se){return Q;function Q(oe){const ye=oe!==null&&se[oe],Ae=oe!==null&&se.null,Fe=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(Ae)?Ae:Ae?[Ae]:[]];return H(Fe)(oe)}}function H(se){return P=se,$=0,se.length===0?D:R(se[$])}function R(se){return Q;function Q(oe){return M=I(),q=se,se.partial||(c.currentConstruct=se),se.name&&c.parser.constructs.disable.null.includes(se.name)?G():se.tokenize.call(U?Object.assign(Object.create(c),U):c,l,X,G)(oe)}}function X(se){return z(q,M),F}function G(se){return M.restore(),++$<P.length?R(P[$]):D}}}function A(z,U){z.resolveAll&&!a.includes(z)&&a.push(z),z.resolve&&Ti(c.events,U,c.events.length-U,z.resolve(c.events.slice(U),c)),z.resolveTo&&(c.events=z.resolveTo(c.events,c))}function I(){const z=m(),U=c.previous,J=c.currentConstruct,Y=c.events.length,F=Array.from(s);return{from:Y,restore:D};function D(){r=z,c.previous=U,c.currentConstruct=J,c.events.length=Y,s=F,O()}}function O(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function MNe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const s=o[0];typeof s=="string"?o[0]=s.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function NNe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
343
+ `;break}case-3:{o=`\r
344
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function DNe(e){const r={constructs:WK([ANe,...(e||{}).extensions||[]]),content:i(Y2e),defined:[],document:i(J2e),flow:i(mNe),lazy:{},string:i(yNe),text:i(bNe)};return r;function i(a){return o;function o(s){return ONe(r,a,s)}}}function jNe(e){for(;!eG(e););return e}const z$=/[\0\t\n\r]/g;function INe(){let e=1,t="",n=!0,r;return i;function i(a,o,s){const l=[];let c,f,u,d,h;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),u=0,t="",n&&(a.charCodeAt(0)===65279&&u++,n=void 0);u<a.length;){if(z$.lastIndex=u,c=z$.exec(a),d=c&&c.index!==void 0?c.index:a.length,h=a.charCodeAt(d),!c){t=a.slice(u);break}if(h===10&&u===d&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),u<d&&(l.push(a.slice(u,d)),e+=d-u),h){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}u=d+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const $Ne=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function LNe(e){return e.replace($Ne,zNe)}function zNe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return JK(n.slice(a?2:1),a?16:10)}return x2(n)||e}const oG={}.hasOwnProperty;function PNe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),FNe(n)(jNe(DNe(n).document().write(INe()(e,t,!0))))}function FNe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(hn),autolinkProtocol:I,autolinkEmail:I,atxHeading:a(Ni),blockQuote:a(Ae),characterEscape:I,characterReference:I,codeFenced:a(Fe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Fe,o),codeText:a(ve,o),codeTextData:I,data:I,codeFlowValue:I,definition:a(Yt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Rn),hardBreakEscape:a(An),hardBreakTrailing:a(An),htmlFlow:a(mr,o),htmlFlowData:I,htmlText:a(mr,o),htmlTextData:I,image:a(Ns),label:o,link:a(hn),listItem:a(Dh),listItemValue:d,listOrdered:a(zu,u),listUnordered:a(zu),paragraph:a(Xn),reference:R,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Ni),strong:a(Ba),thematicBreak:a(Ro)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:ye,autolinkProtocol:oe,blockQuote:l(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:G,characterReferenceMarkerNumeric:G,characterReferenceValue:se,characterReference:Q,codeFenced:l(w),codeFencedFence:b,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:O,codeIndented:l(g),codeText:l(F),codeTextData:O,data:O,definition:l(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(J),htmlFlowData:O,htmlText:l(Y),htmlTextData:O,image:l(P),label:q,labelText:$,lineEnding:z,link:l(D),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:X,resourceDestinationString:M,resourceTitleString:ue,resource:H,setextHeading:l(A),setextHeadingLineSequence:_,setextHeadingText:k,strong:l(),thematicBreak:l()}};sG(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let le={type:"root",children:[]};const we={stack:[le],tokenStack:[],config:t,enter:s,exit:c,buffer:o,resume:f,data:n},Ie=[];let et=-1;for(;++et<K.length;)if(K[et][1].type==="listOrdered"||K[et][1].type==="listUnordered")if(K[et][0]==="enter")Ie.push(et);else{const pr=Ie.pop();et=i(K,pr,et)}for(et=-1;++et<K.length;){const pr=t[K[et][0]];oG.call(pr,K[et][1].type)&&pr[K[et][1].type].call(Object.assign({sliceSerialize:K[et][2].sliceSerialize},we),K[et][1])}if(we.tokenStack.length>0){const pr=we.tokenStack[we.tokenStack.length-1];(pr[1]||P$).call(we,void 0,pr[0])}for(le.position={start:Ls(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:Ls(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},et=-1;++et<t.transforms.length;)le=t.transforms[et](le)||le;return le}function i(K,le,we){let Ie=le-1,et=-1,pr=!1,Fn,ci,Qn,la;for(;++Ie<=we;){const On=K[Ie];switch(On[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{On[0]==="enter"?et++:et--,la=void 0;break}case"lineEndingBlank":{On[0]==="enter"&&(Fn&&!la&&!et&&!Qn&&(Qn=Ie),la=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:la=void 0}if(!et&&On[0]==="enter"&&On[1].type==="listItemPrefix"||et===-1&&On[0]==="exit"&&(On[1].type==="listUnordered"||On[1].type==="listOrdered")){if(Fn){let ca=Ie;for(ci=void 0;ca--;){const Tr=K[ca];if(Tr[1].type==="lineEnding"||Tr[1].type==="lineEndingBlank"){if(Tr[0]==="exit")continue;ci&&(K[ci][1].type="lineEndingBlank",pr=!0),Tr[1].type="lineEnding",ci=ca}else if(!(Tr[1].type==="linePrefix"||Tr[1].type==="blockQuotePrefix"||Tr[1].type==="blockQuotePrefixWhitespace"||Tr[1].type==="blockQuoteMarker"||Tr[1].type==="listItemIndent"))break}Qn&&(!ci||Qn<ci)&&(Fn._spread=!0),Fn.end=Object.assign({},ci?K[ci][1].start:On[1].end),K.splice(ci||Ie,0,["exit",Fn,On[2]]),Ie++,we++}if(On[1].type==="listItemPrefix"){const ca={type:"listItem",_spread:!1,start:Object.assign({},On[1].start),end:void 0};Fn=ca,K.splice(Ie,0,["enter",ca,On[2]]),Ie++,we++,Qn=void 0,la=!0}}}return K[le][1]._spread=pr,we}function a(K,le){return we;function we(Ie){s.call(this,K(Ie),Ie),le&&le.call(this,Ie)}}function o(){this.stack.push({type:"fragment",children:[]})}function s(K,le,we){this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([le,we||void 0]),K.position={start:Ls(le.start),end:void 0}}function l(K){return le;function le(we){K&&K.call(this,we),c.call(this,we)}}function c(K,le){const we=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==K.type&&(le?le.call(this,K,Ie[0]):(Ie[1]||P$).call(this,K,Ie[0]));else throw new Error("Cannot close `"+K.type+"` ("+sp({start:K.start,end:K.end})+"): it’s not open");we.position.end=Ls(K.end)}function f(){return S2(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(K){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(K),10),this.data.expectingFirstListItemValue=void 0}}function h(){const K=this.resume(),le=this.stack[this.stack.length-1];le.lang=K}function m(){const K=this.resume(),le=this.stack[this.stack.length-1];le.meta=K}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const K=this.resume(),le=this.stack[this.stack.length-1];le.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const K=this.resume(),le=this.stack[this.stack.length-1];le.value=K.replace(/(\r?\n|\r)$/g,"")}function v(K){const le=this.resume(),we=this.stack[this.stack.length-1];we.label=le,we.identifier=Aa(this.sliceSerialize(K)).toLowerCase()}function x(){const K=this.resume(),le=this.stack[this.stack.length-1];le.title=K}function E(){const K=this.resume(),le=this.stack[this.stack.length-1];le.url=K}function C(K){const le=this.stack[this.stack.length-1];if(!le.depth){const we=this.sliceSerialize(K).length;le.depth=we}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function _(K){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(K).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function I(K){const we=this.stack[this.stack.length-1].children;let Ie=we[we.length-1];(!Ie||Ie.type!=="text")&&(Ie=sa(),Ie.position={start:Ls(K.start),end:void 0},we.push(Ie)),this.stack.push(Ie)}function O(K){const le=this.stack.pop();le.value+=this.sliceSerialize(K),le.position.end=Ls(K.end)}function z(K){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const we=le.children[le.children.length-1];we.position.end=Ls(K.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(le.type)&&(I.call(this,K),O.call(this,K))}function U(){this.data.atHardBreak=!0}function J(){const K=this.resume(),le=this.stack[this.stack.length-1];le.value=K}function Y(){const K=this.resume(),le=this.stack[this.stack.length-1];le.value=K}function F(){const K=this.resume(),le=this.stack[this.stack.length-1];le.value=K}function D(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=le,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function P(){const K=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";K.type+="Reference",K.referenceType=le,delete K.url,delete K.title}else delete K.identifier,delete K.label;this.data.referenceType=void 0}function $(K){const le=this.sliceSerialize(K),we=this.stack[this.stack.length-2];we.label=LNe(le),we.identifier=Aa(le).toLowerCase()}function q(){const K=this.stack[this.stack.length-1],le=this.resume(),we=this.stack[this.stack.length-1];if(this.data.inReference=!0,we.type==="link"){const Ie=K.children;we.children=Ie}else we.alt=le}function M(){const K=this.resume(),le=this.stack[this.stack.length-1];le.url=K}function ue(){const K=this.resume(),le=this.stack[this.stack.length-1];le.title=K}function H(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function X(K){const le=this.resume(),we=this.stack[this.stack.length-1];we.label=le,we.identifier=Aa(this.sliceSerialize(K)).toLowerCase(),this.data.referenceType="full"}function G(K){this.data.characterReferenceType=K.type}function se(K){const le=this.sliceSerialize(K),we=this.data.characterReferenceType;let Ie;we?(Ie=JK(le,we==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=x2(le);const et=this.stack[this.stack.length-1];et.value+=Ie}function Q(K){const le=this.stack.pop();le.position.end=Ls(K.end)}function oe(K){O.call(this,K);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(K)}function ye(K){O.call(this,K);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(K)}function Ae(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function Yt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Rn(){return{type:"emphasis",children:[]}}function Ni(){return{type:"heading",depth:0,children:[]}}function An(){return{type:"break"}}function mr(){return{type:"html",value:""}}function Ns(){return{type:"image",title:null,url:"",alt:null}}function hn(){return{type:"link",title:null,url:"",children:[]}}function zu(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function Dh(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Xn(){return{type:"paragraph",children:[]}}function Ba(){return{type:"strong",children:[]}}function sa(){return{type:"text",value:""}}function Ro(){return{type:"thematicBreak"}}}function Ls(e){return{line:e.line,column:e.column,offset:e.offset}}function sG(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?sG(e,r):UNe(e,r)}}function UNe(e,t){let n;for(n in t)if(oG.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function P$(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+sp({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sp({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+sp({start:t.start,end:t.end})+") is still open")}function BNe(e){const t=this;t.parser=n;function n(r){return PNe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function HNe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function qNe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
345
+ `}]}function VNe(e,t){const n=t.value?t.value+`
346
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function KNe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GNe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YNe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Nh(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function WNe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function JNe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function lG(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function XNe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lG(e,t);const i={src:Nh(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function QNe(e,t){const n={src:Nh(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ZNe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function eDe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lG(e,t);const i={href:Nh(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function tDe(e,t){const n={href:Nh(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function nDe(e,t,n){const r=e.all(t),i=n?rDe(n):cG(t),a={},o=[];if(typeof t.checked=="boolean"){const f=r[0];let u;f&&f.type==="element"&&f.tagName==="p"?u=f:(u={type:"element",tagName:"p",properties:{},children:[]},r.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const f=r[s];(i||s!==0||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
347
+ `}),f.type==="element"&&f.tagName==="p"&&!i?o.push(...f.children):o.push(f)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
348
+ `});const c={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,c),e.applyData(t,c)}function rDe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=cG(n[r])}return t}function cG(e){const t=e.spread;return t??e.children.length>1}function iDe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function aDe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oDe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function sDe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lDe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=g2(t.children[1]),l=UK(t.children[t.children.length-1]);s&&l&&(o.position={start:s,end:l}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function cDe(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,s=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<s;){const u=t.children[l],d={},h=o?o[l]:void 0;h&&(d.align=h);let m={type:"element",tagName:a,properties:d,children:[]};u&&(m.children=e.all(u),e.patch(u,m),m=e.applyData(u,m)),c.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,f),e.applyData(t,f)}function uDe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const F$=9,U$=32;function fDe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(B$(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(B$(t.slice(i),i>0,!1)),a.join("")}function B$(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===F$||a===U$;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===F$||a===U$;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function dDe(e,t){const n={type:"text",value:fDe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function hDe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const mDe={blockquote:HNe,break:qNe,code:VNe,delete:KNe,emphasis:GNe,footnoteReference:YNe,heading:WNe,html:JNe,imageReference:XNe,image:QNe,inlineCode:ZNe,linkReference:eDe,link:tDe,listItem:nDe,list:iDe,paragraph:aDe,root:oDe,strong:sDe,table:lDe,tableCell:uDe,tableRow:cDe,text:dDe,thematicBreak:hDe,toml:lb,yaml:lb,definition:lb,footnoteDefinition:lb};function lb(){}const uG=-1,yw=0,cp=1,Z0=2,_2=3,E2=4,k2=5,C2=6,fG=7,dG=8,H$=typeof self=="object"?self:globalThis,pDe=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case yw:case uG:return n(o,i);case cp:{const s=n([],i);for(const l of o)s.push(r(l));return s}case Z0:{const s=n({},i);for(const[l,c]of o)s[r(l)]=r(c);return s}case _2:return n(new Date(o),i);case E2:{const{source:s,flags:l}=o;return n(new RegExp(s,l),i)}case k2:{const s=n(new Map,i);for(const[l,c]of o)s.set(r(l),r(c));return s}case C2:{const s=n(new Set,i);for(const l of o)s.add(r(l));return s}case fG:{const{name:s,message:l}=o;return n(new H$[s](l),i)}case dG:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:s}=new Uint8Array(o);return n(new DataView(s),o)}}return n(new H$[a](o),i)};return r},q$=e=>pDe(new Map,e)(0),tf="",{toString:gDe}={},{keys:yDe}=Object,om=e=>{const t=typeof e;if(t!=="object"||!e)return[yw,t];const n=gDe.call(e).slice(8,-1);switch(n){case"Array":return[cp,tf];case"Object":return[Z0,tf];case"Date":return[_2,tf];case"RegExp":return[E2,tf];case"Map":return[k2,tf];case"Set":return[C2,tf];case"DataView":return[cp,n]}return n.includes("Array")?[cp,n]:n.includes("Error")?[fG,n]:[Z0,n]},cb=([e,t])=>e===yw&&(t==="function"||t==="symbol"),bDe=(e,t,n,r)=>{const i=(o,s)=>{const l=r.push(o)-1;return n.set(s,l),l},a=o=>{if(n.has(o))return n.get(o);let[s,l]=om(o);switch(s){case yw:{let f=o;switch(l){case"bigint":s=dG,f=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([uG],o)}return i([s,f],o)}case cp:{if(l){let d=o;return l==="DataView"?d=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(d=new Uint8Array(o)),i([l,[...d]],o)}const f=[],u=i([s,f],o);for(const d of o)f.push(a(d));return u}case Z0:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const f=[],u=i([s,f],o);for(const d of yDe(o))(e||!cb(om(o[d])))&&f.push([a(d),a(o[d])]);return u}case _2:return i([s,o.toISOString()],o);case E2:{const{source:f,flags:u}=o;return i([s,{source:f,flags:u}],o)}case k2:{const f=[],u=i([s,f],o);for(const[d,h]of o)(e||!(cb(om(d))||cb(om(h))))&&f.push([a(d),a(h)]);return u}case C2:{const f=[],u=i([s,f],o);for(const d of o)(e||!cb(om(d)))&&f.push(a(d));return u}}const{message:c}=o;return i([s,{name:l,message:c}],o)};return a},V$=(e,{json:t,lossy:n}={})=>{const r=[];return bDe(!(t||n),!!t,new Map,r)(e),r},tg=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?q$(V$(e,t)):structuredClone(e):(e,t)=>q$(V$(e,t));function vDe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function SDe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function xDe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||vDe,r=e.options.footnoteBackLabel||SDe,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const f=e.all(c),u=String(c.identifier).toUpperCase(),d=Nh(u.toLowerCase());let h=0;const m=[],b=e.footnoteCounts.get(u);for(;b!==void 0&&++h<=b;){m.length>0&&m.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,h);typeof v=="string"&&(v={type:"text",value:v}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const w=f[f.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const v=w.children[w.children.length-1];v&&v.type==="text"?v.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...m)}else f.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(f,!0)};e.patch(c,g),s.push(g)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...tg(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
349
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
350
+ `}]}}const bw=function(e){if(e==null)return kDe;if(typeof e=="function")return vw(e);if(typeof e=="object")return Array.isArray(e)?wDe(e):_De(e);if(typeof e=="string")return EDe(e);throw new Error("Expected function, string, or object as test")};function wDe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=bw(e[n]);return vw(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function _De(e){const t=e;return vw(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function EDe(e){return vw(t);function t(n){return n&&n.type===e}}function vw(e){return t;function t(n,r,i){return!!(CDe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function kDe(){return!0}function CDe(e){return e!==null&&typeof e=="object"&&"type"in e}const hG=[],TDe=!0,NC=!1,RDe="skip";function mG(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=bw(i),o=r?-1:1;s(e,void 0,[])();function s(l,c,f){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const h=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return d;function d(){let h=hG,m,b,w;if((!t||a(l,c,f[f.length-1]||void 0))&&(h=ADe(n(l,f)),h[0]===NC))return h;if("children"in l&&l.children){const g=l;if(g.children&&h[0]!==RDe)for(b=(r?g.children.length:-1)+o,w=f.concat(g);b>-1&&b<g.children.length;){const v=g.children[b];if(m=s(v,b,w)(),m[0]===NC)return m;b=typeof m[1]=="number"?m[1]:b+o}}return h}}}function ADe(e){return Array.isArray(e)?e:typeof e=="number"?[TDe,e]:e==null?hG:[e]}function T2(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),mG(e,a,s,i);function s(l,c){const f=c[c.length-1],u=f?f.children.indexOf(l):void 0;return o(l,u,f)}}const DC={}.hasOwnProperty,ODe={};function MDe(e,t){const n=t||ODe,r=new Map,i=new Map,a=new Map,o={...mDe,...n.handlers},s={all:c,applyData:DDe,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:l,options:n,patch:NDe,wrap:IDe};return T2(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const u=f.type==="definition"?r:i,d=String(f.identifier).toUpperCase();u.has(d)||u.set(d,f)}}),s;function l(f,u){const d=f.type,h=s.handlers[d];if(DC.call(s.handlers,d)&&h)return h(s,f,u);if(s.options.passThrough&&s.options.passThrough.includes(d)){if("children"in f){const{children:b,...w}=f,g=tg(w);return g.children=s.all(f),g}return tg(f)}return(s.options.unknownHandler||jDe)(s,f,u)}function c(f){const u=[];if("children"in f){const d=f.children;let h=-1;for(;++h<d.length;){const m=s.one(d[h],f);if(m){if(h&&d[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=K$(m.value)),!Array.isArray(m)&&m.type==="element")){const b=m.children[0];b&&b.type==="text"&&(b.value=K$(b.value))}Array.isArray(m)?u.push(...m):u.push(m)}}}return u}}function NDe(e,t){e.position&&(t.position=HK(e))}function DDe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,tg(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function jDe(e,t){const n=t.data||{},r="value"in t&&!(DC.call(n,"hProperties")||DC.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function IDe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
351
+ `});++r<e.length;)r&&n.push({type:"text",value:`
352
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
353
+ `}),n}function K$(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function G$(e,t){const n=MDe(e,t),r=n.one(e,void 0),i=xDe(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
354
+ `},i),a}function $De(e,t){return e&&"run"in e?async function(n,r){const i=G$(n,{file:r,...t});await e.run(i,r)}:function(n,r){return G$(n,{file:r,...e||t})}}function Y$(e){if(e)throw e}var iv=Object.prototype.hasOwnProperty,pG=Object.prototype.toString,W$=Object.defineProperty,J$=Object.getOwnPropertyDescriptor,X$=function(t){return typeof Array.isArray=="function"?Array.isArray(t):pG.call(t)==="[object Array]"},Q$=function(t){if(!t||pG.call(t)!=="[object Object]")return!1;var n=iv.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&iv.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||iv.call(t,i)},Z$=function(t,n){W$&&n.name==="__proto__"?W$(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},eL=function(t,n){if(n==="__proto__")if(iv.call(t,n)){if(J$)return J$(t,n).value}else return;return t[n]},LDe=function e(){var t,n,r,i,a,o,s=arguments[0],l=1,c=arguments.length,f=!1;for(typeof s=="boolean"&&(f=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=eL(s,n),i=eL(t,n),s!==i&&(f&&i&&(Q$(i)||(a=X$(i)))?(a?(a=!1,o=r&&X$(r)?r:[]):o=r&&Q$(r)?r:{},Z$(s,{name:n,newValue:e(f,o,i)})):typeof i<"u"&&Z$(s,{name:n,newValue:i}));return s};const y_=sg(LDe);function jC(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function zDe(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);s(null,...i);function s(l,...c){const f=e[++a];let u=-1;if(l){o(l);return}for(;++u<i.length;)(c[u]===null||c[u]===void 0)&&(c[u]=i[u]);i=c,f?PDe(f,s)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function PDe(e,t){let n;return r;function r(...o){const s=e.length>o.length;let l;s&&o.push(i);try{l=e.apply(this,o)}catch(c){const f=c;if(s&&n)throw f;return i(f)}s||(l&&l.then&&typeof l.then=="function"?l.then(a,i):l instanceof Error?i(l):a(l))}function i(o,...s){n||(n=!0,t(o,...s))}function a(o){i(null,o)}}const Ga={basename:FDe,dirname:UDe,extname:BDe,join:HDe,sep:"/"};function FDe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');hy(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function UDe(e){if(hy(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function BDe(e){hy(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function HDe(...e){let t=-1,n;for(;++t<e.length;)hy(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":qDe(n)}function qDe(e){hy(e);const t=e.codePointAt(0)===47;let n=VDe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function VDe(e,t){let n="",r=0,i=-1,a=0,o=-1,s,l;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else{if(s===47)break;s=47}if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function hy(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const KDe={cwd:GDe};function GDe(){return"/"}function IC(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function YDe(e){if(typeof e=="string")e=new URL(e);else if(!IC(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return WDe(e)}function WDe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const b_=["history","path","basename","stem","extname","dirname"];class gG{constructor(t){let n;t?IC(t)?n={path:t}:typeof t=="string"||JDe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":KDe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<b_.length;){const a=b_[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)b_.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ga.basename(this.path):void 0}set basename(t){S_(t,"basename"),v_(t,"basename"),this.path=Ga.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ga.dirname(this.path):void 0}set dirname(t){tL(this.basename,"dirname"),this.path=Ga.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ga.extname(this.path):void 0}set extname(t){if(v_(t,"extname"),tL(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ga.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){IC(t)&&(t=YDe(t)),S_(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ga.basename(this.path,this.extname):void 0}set stem(t){S_(t,"stem"),v_(t,"stem"),this.path=Ga.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Cr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function v_(e,t){if(e&&e.includes(Ga.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ga.sep+"`")}function S_(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function tL(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function JDe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const XDe=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},QDe={}.hasOwnProperty;class R2 extends XDe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=zDe()}copy(){const t=new R2;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(y_(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(__("data",this.frozen),this.namespace[t]=n,this):QDe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(__("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=ub(t),r=this.parser||this.Parser;return x_("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),x_("process",this.parser||this.Parser),w_("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const s=ub(t),l=r.parse(s);r.run(l,s,function(f,u,d){if(f||!u||!d)return c(f);const h=u,m=r.stringify(h,d);tje(m)?d.value=m:d.result=m,c(f,d)});function c(f,u){f||!u?o(f):a?a(u):n(void 0,u)}}}processSync(t){let n=!1,r;return this.freeze(),x_("processSync",this.parser||this.Parser),w_("processSync",this.compiler||this.Compiler),this.process(t,i),rL("processSync","process",n),r;function i(a,o){n=!0,Y$(a),r=o}}run(t,n,r){nL(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,s){const l=ub(n);i.run(t,l,c);function c(f,u,d){const h=u||t;f?s(f):o?o(h):r(void 0,h,d)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),rL("runSync","run",r),i;function a(o,s){Y$(o),i=s,r=!0}}stringify(t,n){this.freeze();const r=ub(n),i=this.compiler||this.Compiler;return w_("stringify",i),nL(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(__("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[f,...u]=c;l(f,u)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(i.settings=y_(!0,i.settings,c.settings))}function s(c){let f=-1;if(c!=null)if(Array.isArray(c))for(;++f<c.length;){const u=c[f];a(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,f){let u=-1,d=-1;for(;++u<r.length;)if(r[u][0]===c){d=u;break}if(d===-1)r.push([c,...f]);else if(f.length>0){let[h,...m]=f;const b=r[d][1];jC(b)&&jC(h)&&(h=y_(!0,b,h)),r[d]=[c,h,...m]}}}}const ZDe=new R2().freeze();function x_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function w_(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function __(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function nL(e){if(!jC(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function rL(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ub(e){return eje(e)?e:new gG(e)}function eje(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function tje(e){return typeof e=="string"||nje(e)}function nje(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rje="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",iL=[],aL={allowDangerousHtml:!0},ije=/^(https?|ircs?|mailto|xmpp)$/i,aje=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function yG(e){const t=oje(e),n=sje(e);return lje(t.runSync(t.parse(n),n),e)}function oje(e){const t=e.rehypePlugins||iL,n=e.remarkPlugins||iL,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...aL}:aL;return ZDe().use(BNe).use(n).use($De,r).use(t)}function sje(e){const t=e.children||"",n=new gG;return typeof t=="string"&&(n.value=t),n}function lje(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||cje;for(const f of aje)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+rje+f.id,void 0);return T2(e,c),k2e(e,{Fragment:p.Fragment,components:i,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function c(f,u,d){if(f.type==="raw"&&d&&typeof u=="number")return o?d.children.splice(u,1):d.children[u]={type:"text",value:f.value},u;if(f.type==="element"){let h;for(h in m_)if(Object.hasOwn(m_,h)&&Object.hasOwn(f.properties,h)){const m=f.properties[h],b=m_[h];(b===null||b.includes(f.tagName))&&(f.properties[h]=l(String(m||""),h,f))}}if(f.type==="element"){let h=n?!n.includes(f.tagName):a?a.includes(f.tagName):!1;if(!h&&r&&typeof u=="number"&&(h=!r(f,u,d)),h&&d&&typeof u=="number")return s&&f.children?d.children.splice(u,1,...f.children):d.children.splice(u,1),u}}}function cje(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||ije.test(e.slice(0,t))?e:""}const pc=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],oL={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...pc,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...pc],h2:[["className","sr-only"]],img:[...pc,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...pc,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...pc],table:[...pc],ul:[...pc,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},qs={}.hasOwnProperty;function uje(e,t){let n={type:"root",children:[]};const r={schema:t?{...oL,...t}:oL,stack:[]},i=bG(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function bG(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return fje(e,n);case"doctype":return dje(e,n);case"element":return hje(e,n);case"root":return mje(e,n);case"text":return pje(e,n)}}}function fje(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return my(a,t),a}}function dje(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return my(n,t),n}}function hje(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=vG(e,t.children),i=gje(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&qs.call(e.schema.ancestors,n))){const s=e.schema.ancestors[n];let l=-1;for(a=!1;++l<s.length;)e.stack.includes(s[l])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const o={type:"element",tagName:n,properties:i,children:r};return my(o,t),o}function mje(e,t){const r={type:"root",children:vG(e,t.children)};return my(r,t),r}function pje(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return my(r,t),r}function vG(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const a=bG(e,r[i]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function gje(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&qs.call(r,n)?r[n]:void 0,o=r&&qs.call(r,"*")?r["*"]:void 0,s=t&&typeof t=="object"?t:{},l={};let c;for(c in s)if(qs.call(s,c)){const f=s[c];let u=sL(e,lL(a,c),c,f);u==null&&(u=sL(e,lL(o,c),c,f)),u!=null&&(l[c]=u)}if(i&&qs.call(i,n)){const f=i[n];for(c in f)qs.call(f,c)&&!qs.call(l,c)&&(l[c]=f[c])}return l}function sL(e,t,n,r){return t?Array.isArray(r)?yje(e,t,n,r):SG(e,t,n,r):void 0}function yje(e,t,n,r){let i=-1;const a=[];for(;++i<r.length;){const o=SG(e,t,n,r[i]);(typeof o=="number"||typeof o=="string")&&a.push(o)}return a}function SG(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&bje(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,a=0;for(;++a<t.length;){const o=t[a];if(o&&typeof o=="object"&&"flags"in o){if(o.test(String(r))){i=!0;break}}else if(o===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function bje(e,t,n){const r=e.schema.protocols&&qs.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),a=i.indexOf(":"),o=i.indexOf("?"),s=i.indexOf("#"),l=i.indexOf("/");if(a<0||l>-1&&a>l||o>-1&&a>o||s>-1&&a>s)return!0;let c=-1;for(;++c<r.length;){const f=r[c];if(a===f.length&&i.slice(0,f.length)===f)return!0}return!1}function my(e,t){const n=HK(t);t.data&&(e.data=tg(t.data)),n&&(e.position=n)}function lL(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],a=typeof i=="string"?i:i[0];if(a===t)return i;a==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function xG(e){return function(t){return uje(t,e)}}function cL(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function vje(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Sje(e,t,n){const i=bw((n||{}).ignore||[]),a=xje(t);let o=-1;for(;++o<a.length;)mG(e,"text",s);function s(c,f){let u=-1,d;for(;++u<f.length;){const h=f[u],m=d?d.children:void 0;if(i(h,m?m.indexOf(h):void 0,d))return;d=h}if(d)return l(c,f)}function l(c,f){const u=f[f.length-1],d=a[o][0],h=a[o][1];let m=0;const w=u.children.indexOf(c);let g=!1,v=[];d.lastIndex=0;let x=d.exec(c.value);for(;x;){const E=x.index,C={index:x.index,input:x.input,stack:[...f,c]};let k=h(...x,C);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?d.lastIndex=E+1:(m!==E&&v.push({type:"text",value:c.value.slice(m,E)}),Array.isArray(k)?v.push(...k):k&&v.push(k),m=E+x[0].length,g=!0),!d.global)break;x=d.exec(c.value)}return g?(m<c.value.length&&v.push({type:"text",value:c.value.slice(m)}),u.children.splice(w,1,...v)):v=[c],w+v.length}}function xje(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([wje(i[0]),_je(i[1])])}return t}function wje(e){return typeof e=="string"?new RegExp(vje(e),"g"):e}function _je(e){return typeof e=="function"?e:function(){return e}}const E_="phrasing",k_=["autolink","link","image","label"];function Eje(){return{transforms:[Mje],enter:{literalAutolink:Cje,literalAutolinkEmail:C_,literalAutolinkHttp:C_,literalAutolinkWww:C_},exit:{literalAutolink:Oje,literalAutolinkEmail:Aje,literalAutolinkHttp:Tje,literalAutolinkWww:Rje}}}function kje(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:E_,notInConstruct:k_},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:E_,notInConstruct:k_},{character:":",before:"[ps]",after:"\\/",inConstruct:E_,notInConstruct:k_}]}}function Cje(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function C_(e){this.config.enter.autolinkProtocol.call(this,e)}function Tje(e){this.config.exit.autolinkProtocol.call(this,e)}function Rje(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Aje(e){this.config.exit.autolinkEmail.call(this,e)}function Oje(e){this.exit(e)}function Mje(e){Sje(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Nje],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Dje]],{ignore:["link","linkReference"]})}function Nje(e,t,n,r,i){let a="";if(!wG(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!jje(n)))return!1;const o=Ije(n+r);if(!o[0])return!1;const s={type:"link",title:null,url:a+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[s,{type:"text",value:o[1]}]:s}function Dje(e,t,n,r){return!wG(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function jje(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Ije(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=cL(e,"(");let a=cL(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function wG(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||gu(n)||pw(n))&&(!t||n!==47)}_G.peek=qje;function $je(){this.buffer()}function Lje(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function zje(){this.buffer()}function Pje(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Fje(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Aa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Uje(e){this.exit(e)}function Bje(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Aa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Hje(e){this.exit(e)}function qje(){return"["}function _G(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const o=n.enter("footnoteReference"),s=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),s(),o(),a+=i.move("]"),a}function Vje(){return{enter:{gfmFootnoteCallString:$je,gfmFootnoteCall:Lje,gfmFootnoteDefinitionLabelString:zje,gfmFootnoteDefinition:Pje},exit:{gfmFootnoteCallString:Fje,gfmFootnoteCall:Uje,gfmFootnoteDefinitionLabelString:Bje,gfmFootnoteDefinition:Hje}}}function Kje(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_G},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,o){const s=a.createTracker(o);let l=s.move("[^");const c=a.enter("footnoteDefinition"),f=a.enter("label");return l+=s.move(a.safe(a.associationId(r),{before:l,after:"]"})),f(),l+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),l+=s.move((t?`
355
+ `:" ")+a.indentLines(a.containerFlow(r,s.current()),t?EG:Gje))),c(),l}}function Gje(e,t,n){return t===0?e:EG(e,t,n)}function EG(e,t,n){return(n?"":" ")+e}const Yje=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];kG.peek=Zje;function Wje(){return{canContainEols:["delete"],enter:{strikethrough:Xje},exit:{strikethrough:Qje}}}function Jje(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Yje}],handlers:{delete:kG}}}function Xje(e){this.enter({type:"delete",children:[]},e)}function Qje(e){this.exit(e)}function kG(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),a(),o}function Zje(){return"~"}function eIe(e){return e.length}function tIe(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||eIe,a=[],o=[],s=[],l=[];let c=0,f=-1;for(;++f<e.length;){const b=[],w=[];let g=-1;for(e[f].length>c&&(c=e[f].length);++g<e[f].length;){const v=nIe(e[f][g]);if(n.alignDelimiters!==!1){const x=i(v);w[g]=x,(l[g]===void 0||x>l[g])&&(l[g]=x)}b.push(v)}o[f]=b,s[f]=w}let u=-1;if(typeof r=="object"&&"length"in r)for(;++u<c;)a[u]=uL(r[u]);else{const b=uL(r);for(;++u<c;)a[u]=b}u=-1;const d=[],h=[];for(;++u<c;){const b=a[u];let w="",g="";b===99?(w=":",g=":"):b===108?w=":":b===114&&(g=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[u]-w.length-g.length);const x=w+"-".repeat(v)+g;n.alignDelimiters!==!1&&(v=w.length+v+g.length,v>l[u]&&(l[u]=v),h[u]=v),d[u]=x}o.splice(1,0,d),s.splice(1,0,h),f=-1;const m=[];for(;++f<o.length;){const b=o[f],w=s[f];u=-1;const g=[];for(;++u<c;){const v=b[u]||"";let x="",E="";if(n.alignDelimiters!==!1){const C=l[u]-(w[u]||0),k=a[u];k===114?x=" ".repeat(C):k===99?C%2?(x=" ".repeat(C/2+.5),E=" ".repeat(C/2-.5)):(x=" ".repeat(C/2),E=x):E=" ".repeat(C)}n.delimiterStart!==!1&&!u&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||u)&&g.push(" "),n.alignDelimiters!==!1&&g.push(x),g.push(v),n.alignDelimiters!==!1&&g.push(E),n.padding!==!1&&g.push(" "),(n.delimiterEnd!==!1||u!==c-1)&&g.push("|")}m.push(n.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return m.join(`
356
+ `)}function nIe(e){return e==null?"":String(e)}function uL(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function rIe(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),iIe);return i(),o}function iIe(e,t,n){return">"+(n?"":" ")+e}function aIe(e,t){return fL(e,t.inConstruct,!0)&&!fL(e,t.notInConstruct,!1)}function fL(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function dL(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
357
+ `&&aIe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
358
+ `}function oIe(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function sIe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function lIe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function cIe(e,t,n,r){const i=lIe(n),a=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(sIe(e,n)){const u=n.enter("codeIndented"),d=n.indentLines(a,uIe);return u(),d}const s=n.createTracker(r),l=i.repeat(Math.max(oIe(a,i)+1,3)),c=n.enter("codeFenced");let f=s.move(l);if(e.lang){const u=n.enter(`codeFencedLang${o}`);f+=s.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...s.current()})),u()}if(e.lang&&e.meta){const u=n.enter(`codeFencedMeta${o}`);f+=s.move(" "),f+=s.move(n.safe(e.meta,{before:f,after:`
359
+ `,encode:["`"],...s.current()})),u()}return f+=s.move(`
360
+ `),a&&(f+=s.move(a+`
361
+ `)),f+=s.move(l),c(),f}function uIe(e,t,n){return(n?"":" ")+e}function A2(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function fIe(e,t,n,r){const i=A2(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
362
+ `,...l.current()}))),s(),e.title&&(s=n.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),o(),c}function dIe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function ng(e){return"&#x"+e.toString(16).toUpperCase()+";"}function eS(e,t,n){const r=Hd(e),i=Hd(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}CG.peek=hIe;function CG(e,t,n,r){const i=dIe(n),a=n.enter("emphasis"),o=n.createTracker(r),s=o.move(i);let l=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()}));const c=l.charCodeAt(0),f=eS(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(l=ng(c)+l.slice(1));const u=l.charCodeAt(l.length-1),d=eS(r.after.charCodeAt(0),u,i);d.inside&&(l=l.slice(0,-1)+ng(u));const h=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:d.outside,before:f.outside},s+l+h}function hIe(e,t,n){return n.options.emphasis||"*"}function mIe(e,t){let n=!1;return T2(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,NC}),!!((!e.depth||e.depth<3)&&S2(e)&&(t.options.setext||n))}function pIe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(mIe(e,n)){const f=n.enter("headingSetext"),u=n.enter("phrasing"),d=n.containerPhrasing(e,{...a.current(),before:`
363
+ `,after:`
364
+ `});return u(),f(),d+`
365
+ `+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
366
+ `))+1))}const o="#".repeat(i),s=n.enter("headingAtx"),l=n.enter("phrasing");a.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
367
+ `,...a.current()});return/^[\t ]/.test(c)&&(c=ng(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),s(),c}TG.peek=gIe;function TG(e){return e.value||""}function gIe(){return"<"}RG.peek=yIe;function RG(e,t,n,r){const i=A2(n),a=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${a}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),s()),c+=l.move(")"),o(),c}function yIe(){return"!"}AG.peek=bIe;function AG(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),o();const f=n.stack;n.stack=[],o=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return o(),n.stack=f,a(),i==="full"||!c||c!==u?l+=s.move(u+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function bIe(){return"!"}OG.peek=vIe;function OG(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const o=n.unsafe[a],s=n.compilePattern(o);let l;if(o.atBreak)for(;l=s.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function vIe(){return"`"}function MG(e,t){const n=S2(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}NG.peek=SIe;function NG(e,t,n,r){const i=A2(n),a=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let s,l;if(MG(e,n)){const f=n.stack;n.stack=[],s=n.enter("autolink");let u=o.move("<");return u+=o.move(n.containerPhrasing(e,{before:u,after:">",...o.current()})),u+=o.move(">"),s(),n.stack=f,u}s=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${a}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),s(),c}function SIe(e,t,n){return MG(e,n)?"<":"["}DG.peek=xIe;function DG(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),o();const f=n.stack;n.stack=[],o=n.enter("reference");const u=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return o(),n.stack=f,a(),i==="full"||!c||c!==u?l+=s.move(u+"]"):i==="shortcut"?l=l.slice(0,-1):l+=s.move("]"),l}function xIe(){return"["}function O2(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function wIe(e){const t=O2(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function _Ie(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function jG(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function EIe(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?_Ie(n):O2(n);const s=e.ordered?o==="."?")":".":wIe(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),jG(n)===o&&f){let u=-1;for(;++u<e.children.length;){const d=e.children[u];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=s),n.bulletCurrent=o;const c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),c}function kIe(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function CIe(e,t,n,r){const i=kIe(n);let a=n.bulletCurrent||O2(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const s=n.createTracker(r);s.move(a+" ".repeat(o-a.length)),s.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),f);return l(),c;function f(u,d,h){return d?(h?"":" ".repeat(o))+u:(h?a:a+" ".repeat(o-a.length))+u}}function TIe(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),i(),o}const RIe=bw(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function AIe(e,t,n,r){return(e.children.some(function(o){return RIe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function OIe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}IG.peek=MIe;function IG(e,t,n,r){const i=OIe(n),a=n.enter("strong"),o=n.createTracker(r),s=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()}));const c=l.charCodeAt(0),f=eS(r.before.charCodeAt(r.before.length-1),c,i);f.inside&&(l=ng(c)+l.slice(1));const u=l.charCodeAt(l.length-1),d=eS(r.after.charCodeAt(0),u,i);d.inside&&(l=l.slice(0,-1)+ng(u));const h=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:d.outside,before:f.outside},s+l+h}function MIe(e,t,n){return n.options.strong||"*"}function NIe(e,t,n,r){return n.safe(e.value,r)}function DIe(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function jIe(e,t,n){const r=(jG(n)+(n.options.ruleSpaces?" ":"")).repeat(DIe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const $G={blockquote:rIe,break:dL,code:cIe,definition:fIe,emphasis:CG,hardBreak:dL,heading:pIe,html:TG,image:RG,imageReference:AG,inlineCode:OG,link:NG,linkReference:DG,list:EIe,listItem:CIe,paragraph:TIe,root:AIe,strong:IG,text:NIe,thematicBreak:jIe};function IIe(){return{enter:{table:$Ie,tableData:hL,tableHeader:hL,tableRow:zIe},exit:{codeText:PIe,table:LIe,tableData:T_,tableHeader:T_,tableRow:T_}}}function $Ie(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function LIe(e){this.exit(e),this.data.inTable=void 0}function zIe(e){this.enter({type:"tableRow",children:[]},e)}function T_(e){this.exit(e)}function hL(e){this.enter({type:"tableCell",children:[]},e)}function PIe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,FIe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function FIe(e,t){return t==="|"?t:e}function UIe(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
368
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:o,tableCell:l,tableRow:s}};function o(h,m,b,w){return c(f(h,b,w),h.align)}function s(h,m,b,w){const g=u(h,b,w),v=c([g]);return v.slice(0,v.indexOf(`
369
+ `))}function l(h,m,b,w){const g=b.enter("tableCell"),v=b.enter("phrasing"),x=b.containerPhrasing(h,{...w,before:a,after:a});return v(),g(),x}function c(h,m){return tIe(h,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(h,m,b){const w=h.children;let g=-1;const v=[],x=m.enter("table");for(;++g<w.length;)v[g]=u(w[g],m,b);return x(),v}function u(h,m,b){const w=h.children;let g=-1;const v=[],x=m.enter("tableRow");for(;++g<w.length;)v[g]=l(w[g],h,m,b);return x(),v}function d(h,m,b){let w=$G.inlineCode(h,m,b);return b.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function BIe(){return{exit:{taskListCheckValueChecked:mL,taskListCheckValueUnchecked:mL,paragraph:qIe}}}function HIe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:VIe}}}function mL(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function qIe(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,o;for(;++a<i.length;){const s=i[a];if(s.type==="paragraph"){o=s;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function VIe(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);a&&s.move(o);let l=$G.listItem(e,t,n,{...r,...s.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(f){return f+o}}function KIe(){return[Eje(),Vje(),Wje(),IIe(),BIe()]}function GIe(e){return{extensions:[kje(),Kje(e),Jje(),UIe(e),HIe()]}}const YIe={tokenize:e$e,partial:!0},LG={tokenize:t$e,partial:!0},zG={tokenize:n$e,partial:!0},PG={tokenize:r$e,partial:!0},WIe={tokenize:i$e,partial:!0},FG={name:"wwwAutolink",tokenize:QIe,previous:BG},UG={name:"protocolAutolink",tokenize:ZIe,previous:HG},Ms={name:"emailAutolink",tokenize:XIe,previous:qG},To={};function JIe(){return{text:To}}let gc=48;for(;gc<123;)To[gc]=Ms,gc++,gc===58?gc=65:gc===91&&(gc=97);To[43]=Ms;To[45]=Ms;To[46]=Ms;To[95]=Ms;To[72]=[Ms,UG];To[104]=[Ms,UG];To[87]=[Ms,FG];To[119]=[Ms,FG];function XIe(e,t,n){const r=this;let i,a;return o;function o(u){return!$C(u)||!qG.call(r,r.previous)||M2(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(u))}function s(u){return $C(u)?(e.consume(u),s):u===64?(e.consume(u),l):n(u)}function l(u){return u===46?e.check(WIe,f,c)(u):u===45||u===95||_r(u)?(a=!0,e.consume(u),l):f(u)}function c(u){return e.consume(u),i=!0,l}function f(u){return a&&i&&jr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(u)):n(u)}}function QIe(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!BG.call(r,r.previous)||M2(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(YIe,e.attempt(LG,e.attempt(zG,a),n),n)(o))}function a(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function ZIe(e,t,n){const r=this;let i="",a=!1;return o;function o(u){return(u===72||u===104)&&HG.call(r,r.previous)&&!M2(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(u),e.consume(u),s):n(u)}function s(u){if(jr(u)&&i.length<5)return i+=String.fromCodePoint(u),e.consume(u),s;if(u===58){const d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(u),l}return n(u)}function l(u){return u===47?(e.consume(u),a?c:(a=!0,l)):n(u)}function c(u){return u===null||Q0(u)||jt(u)||gu(u)||pw(u)?n(u):e.attempt(LG,e.attempt(zG,f),n)(u)}function f(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(u)}}function e$e(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),a):n(o)}function a(o){return o===null?n(o):t(o)}}function t$e(e,t,n){let r,i,a;return o;function o(c){return c===46||c===95?e.check(PG,l,s)(c):c===null||jt(c)||gu(c)||c!==45&&pw(c)?l(c):(a=!0,e.consume(c),o)}function s(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function l(c){return i||r||!a?n(c):t(c)}}function n$e(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(PG,t,a)(o):o===null||jt(o)||gu(o)?t(o):(e.consume(o),i)}function a(o){return o===41&&r++,e.consume(o),i}}function r$e(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),a):s===93?(e.consume(s),i):s===60||s===null||jt(s)||gu(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||jt(s)||gu(s)?t(s):r(s)}function a(s){return jr(s)?o(s):n(s)}function o(s){return s===59?(e.consume(s),r):jr(s)?(e.consume(s),o):n(s)}}function i$e(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return _r(a)?n(a):t(a)}}function BG(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||jt(e)}function HG(e){return!jr(e)}function qG(e){return!(e===47||$C(e))}function $C(e){return e===43||e===45||e===46||e===95||_r(e)}function M2(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const a$e={tokenize:h$e,partial:!0};function o$e(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:u$e,continuation:{tokenize:f$e},exit:d$e}},text:{91:{name:"gfmFootnoteCall",tokenize:c$e},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:s$e,resolveTo:l$e}}}}function s$e(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return s;function s(l){if(!o||!o._balanced)return n(l);const c=Aa(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!a.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function l$e(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function c$e(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return s;function s(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),l}function l(u){return u!==94?n(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(a>999||u===93&&!o||u===null||u===91||jt(u))return n(u);if(u===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return i.includes(Aa(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(u)}return jt(u)||(o=!0),a++,e.consume(u),u===92?f:c}function f(u){return u===91||u===92||u===93?(e.consume(u),a++,c):c(u)}}function u$e(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,s;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(o>999||m===93&&!s||m===null||m===91||jt(m))return n(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return a=Aa(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return jt(m)||(s=!0),o++,e.consume(m),m===92?u:f}function u(m){return m===91||m===92||m===93?(e.consume(m),o++,f):f(m)}function d(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(a)||i.push(a),ut(e,h,"gfmFootnoteDefinitionWhitespace")):n(m)}function h(m){return t(m)}}function f$e(e,t,n){return e.check(dy,t,e.attempt(a$e,t,n))}function d$e(e){e.exit("gfmFootnoteDefinition")}function h$e(e,t,n){const r=this;return ut(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function m$e(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,s){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},u={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},d=[["enter",f,s],["enter",o[c][1],s],["exit",o[c][1],s],["enter",u,s]],h=s.parser.constructs.insideSpan.null;h&&Ti(d,d.length,0,gw(h,o.slice(c+1,l),s)),Ti(d,d.length,0,[["exit",u,s],["enter",o[l][1],s],["exit",o[l][1],s],["exit",f,s]]),Ti(o,c-1,l-c+3,d),l=c+d.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function a(o,s,l){const c=this.previous,f=this.events;let u=0;return d;function d(m){return c===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(o.enter("strikethroughSequenceTemporary"),h(m))}function h(m){const b=Hd(c);if(m===126)return u>1?l(m):(o.consume(m),u++,h);if(u<2&&!n)return l(m);const w=o.exit("strikethroughSequenceTemporary"),g=Hd(m);return w._open=!g||g===2&&!!b,w._close=!b||b===2&&!!g,s(m)}}}class p$e{constructor(){this.map=[]}add(t,n,r){g$e(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function g$e(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function y$e(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function b$e(){return{flow:{null:{name:"table",tokenize:v$e,resolveAll:S$e}}}}function v$e(e,t,n){const r=this;let i=0,a=0,o;return s;function s(O){let z=r.events.length-1;for(;z>-1;){const Y=r.events[z][1].type;if(Y==="lineEnding"||Y==="linePrefix")z--;else break}const U=z>-1?r.events[z][1].type:null,J=U==="tableHead"||U==="tableRow"?k:l;return J===k&&r.parser.lazy[r.now().line]?n(O):J(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),c(O)}function c(O){return O===124||(o=!0,a+=1),f(O)}function f(O){return O===null?n(O):Me(O)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),h):n(O):rt(O)?ut(e,f,"whitespace")(O):(a+=1,o&&(o=!1,i+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),o=!0,f):(e.enter("data"),u(O)))}function u(O){return O===null||O===124||jt(O)?(e.exit("data"),f(O)):(e.consume(O),O===92?d:u)}function d(O){return O===92||O===124?(e.consume(O),u):u(O)}function h(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(e.enter("tableDelimiterRow"),o=!1,rt(O)?ut(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):m(O))}function m(O){return O===45||O===58?w(O):O===124?(o=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),b):C(O)}function b(O){return rt(O)?ut(e,w,"whitespace")(O):w(O)}function w(O){return O===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),g):O===45?(a+=1,g(O)):O===null||Me(O)?E(O):C(O)}function g(O){return O===45?(e.enter("tableDelimiterFiller"),v(O)):C(O)}function v(O){return O===45?(e.consume(O),v):O===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(O))}function x(O){return rt(O)?ut(e,E,"whitespace")(O):E(O)}function E(O){return O===124?m(O):O===null||Me(O)?!o||i!==a?C(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(O)):C(O)}function C(O){return n(O)}function k(O){return e.enter("tableRow"),_(O)}function _(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),_):O===null||Me(O)?(e.exit("tableRow"),t(O)):rt(O)?ut(e,_,"whitespace")(O):(e.enter("data"),A(O))}function A(O){return O===null||O===124||jt(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?I:A)}function I(O){return O===92||O===124?(e.consume(O),A):A(O)}}function S$e(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,l=0,c,f,u;const d=new p$e;for(;++n<e.length;){const h=e[n],m=h[1];h[0]==="enter"?m.type==="tableHead"?(s=!1,l!==0&&(pL(d,t,l,c,f),f=void 0,l=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},d.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,u=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},d.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],u=fb(d,t,a,i,void 0,u),a=[0,0,0,0]),o[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],u=fb(d,t,a,i,void 0,u)),a=o,o=[a[1],n,0,0])):m.type==="tableHead"?(s=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,a[1]!==0?(o[0]=o[1],u=fb(d,t,a,i,n,u)):o[1]!==0&&(u=fb(d,t,o,i,n,u)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&pL(d,t,l,c,f),d.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=y$e(t.events,n))}return e}function fb(e,t,n,r,i,a){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(a.end=Object.assign({},pf(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const l=pf(t.events,n[1]);if(a={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const c=pf(t.events,n[2]),f=pf(t.events,n[3]),u={type:s,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",u,t]]),r!==2){const d=t.events[n[2]],h=t.events[n[3]];if(d[1].end=Object.assign({},h[1].end),d[1].type="chunkText",d[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,b=n[3]-n[2]-1;e.add(m,b,[])}}e.add(n[3]+1,0,[["exit",u,t]])}return i!==void 0&&(a.end=Object.assign({},pf(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function pL(e,t,n,r,i){const a=[],o=pf(t.events,n);i&&(i.end=Object.assign({},o),a.push(["exit",i,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function pf(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const x$e={name:"tasklistCheck",tokenize:_$e};function w$e(){return{text:{91:x$e}}}function _$e(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),a)}function a(l){return jt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(l)}function s(l){return Me(l)?t(l):rt(l)?e.check({tokenize:E$e},t,n)(l):n(l)}}function E$e(e,t,n){return ut(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function k$e(e){return WK([JIe(),o$e(),m$e(e),b$e(),w$e()])}const C$e={};function VG(e){const t=this,n=e||C$e,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(k$e(n)),a.push(KIe()),o.push(GIe(n))}function T$e(e){const[t,n]=y.useState(!1),[r,i]=y.useState(!1),a=()=>localStorage.getItem(e)==="true",o=y.useCallback(()=>a()?!1:(n(!0),!0),[e]),s=y.useCallback(()=>{r&&localStorage.setItem(e,"true"),n(!1)},[r,e]);return{cancel:y.useCallback(()=>{n(!1)},[]),dismiss:s,dontRemind:r,isDismissed:a,setDontRemind:i,show:o,visible:t}}function LC({className:e,...t}){return p.jsx("div",{"data-slot":"card",className:it("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function KG({className:e,...t}){return p.jsx("div",{"data-slot":"card-header",className:it("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function GG({className:e,...t}){return p.jsx("div",{"data-slot":"card-title",className:it("leading-none font-semibold",e),...t})}function zC({className:e,...t}){return p.jsx("div",{"data-slot":"card-content",className:it("px-6",e),...t})}const YG=e=>e==="green"?"text-green-600 dark:text-green-400":e==="yellow"?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400",R$e=e=>e==="green"?"border-green-500/30":e==="yellow"?"border-yellow-500/30":"border-red-500/30",A$e=e=>e==="positive"?"outline":e==="neutral"?"secondary":"destructive",O$e=e=>e==="positive"?"border-green-500/30 text-green-600 dark:text-green-400":"",M$e=e=>{const t=new Date(e),n=t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),r=Date.now()-t.getTime(),i=Math.floor(r/6e4);if(i<1)return`${n} · just now`;if(i<60)return`${n} · ${i}m ago`;const a=Math.floor(i/60);if(a<24)return`${n} · ${a}h ago`;const o=Math.floor(a/24);return`${n} · ${o}d ago`},gL=e=>e.comments.length===0?0:Math.min(...e.comments.map(t=>new Date(t.root.creationDate).getTime())),WG=e=>1+e.replies.reduce((t,n)=>t+WG(n),0);function N$e({score:e}){if(!e)return null;const t=d2(e.total);return p.jsx(Vn,{variant:"outline",className:`${R$e(t)} ${YG(t)} tabular-nums font-semibold`,children:e.total.toFixed(1)})}function D$e({score:e}){if(!e)return p.jsx("p",{className:"text-xs text-muted-foreground pt-2",children:"Waiting for comment count..."});const t=d2(e.total);return p.jsxs("div",{className:"space-y-3 pt-2",children:[p.jsxs("div",{className:"flex items-baseline gap-2",children:[p.jsx("span",{className:`text-lg font-bold tabular-nums ${YG(t)}`,children:e.total.toFixed(1)}),p.jsx("span",{className:"text-xs text-muted-foreground",children:"/ 10"}),p.jsx("div",{className:"ml-2 h-1.5 flex-1 overflow-hidden rounded-full bg-muted",children:p.jsx("div",{className:`h-full rounded-full ${t==="green"?"bg-green-500":t==="yellow"?"bg-yellow-500":"bg-red-500"}`,style:{width:`${e.total*10}%`}})})]}),p.jsx("div",{className:"space-y-2",children:e.categories.map(n=>p.jsxs("div",{className:"flex items-start gap-3 rounded border px-3 py-2",children:[p.jsx("span",{className:`w-8 text-right text-xs font-semibold tabular-nums ${n.value>0?"text-green-600 dark:text-green-400":n.value<0?"text-red-600 dark:text-red-400":"text-muted-foreground"}`,children:n.value>0?`+${n.value}`:n.value}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-xs font-medium",children:n.label}),p.jsx(Vn,{variant:A$e(n.status),className:`text-[10px] px-1.5 py-0 ${O$e(n.status)}`,children:n.statusLabel})]}),p.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:n.description})]})]},n.label))})]})}function JG({depth:e,thread:t}){return t.root.deleted?null:p.jsxs("div",{className:e>0?"ml-4 border-l-2 border-muted pl-3":"",children:[p.jsxs("div",{className:"space-y-1 py-2",children:[p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[p.jsx("span",{className:"font-medium",children:t.root.author}),p.jsx("span",{children:"·"}),p.jsx("span",{children:M$e(t.root.creationDate)})]}),p.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none break-words [&_a]:text-primary [&_img]:inline [&_img]:h-5 [&_img]:w-auto",children:p.jsx(yG,{remarkPlugins:[VG],rehypePlugins:[xG],children:t.root.content})})]}),t.replies.map(n=>p.jsx(JG,{thread:n,depth:e+1},n.root.id))]})}function j$e({pr:e}){const t=un(CI),n=zr(CI),r=y.useRef(null);return y.useEffect(()=>{r.current!==e.id&&(r.current=e.id,t({payload:{pullRequestId:e.id,repositoryName:e.repositoryName,account:{profile:e.account.profile,region:e.account.region}}}))},[e.id,e.repositoryName,e.account.profile,e.account.region,t]),nd(n).onInitialOrWaiting(()=>p.jsx("div",{className:"pt-2",children:p.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading comments..."})})).onError(()=>p.jsx("div",{className:"pt-2",children:p.jsx("p",{className:"text-xs text-destructive",children:"Failed to load comments"})})).onDefect(()=>p.jsx("div",{className:"pt-2",children:p.jsx("p",{className:"text-xs text-destructive",children:"Failed to load comments"})})).onSuccess(i=>{const a=i.reduce((o,s)=>o+s.comments.reduce((l,c)=>l+WG(c),0),0);return p.jsxs("div",{className:"pt-2",children:[i.length===0&&p.jsx("p",{className:"text-xs text-muted-foreground",children:"No comments"}),a>0&&p.jsx("div",{className:"space-y-1",children:[...i].sort((o,s)=>gL(s)-gL(o)).map((o,s)=>p.jsxs("div",{children:[o.filePath&&p.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:o.filePath}),o.comments.map(l=>p.jsx(JG,{thread:l,depth:0},l.root.id)),s<i.length-1&&p.jsx(Ra,{className:"my-2"})]},s))})]})}).render()}function yL({children:e,count:t,title:n}){const[r,i]=y.useState(!1);return p.jsxs("div",{className:"rounded-lg border bg-card",children:[p.jsxs("button",{className:"flex w-full items-center gap-2 px-4 py-2.5 text-left text-sm font-medium hover:bg-accent/50",onClick:()=>i(!r),children:[p.jsx(IO,{className:`size-4 text-muted-foreground transition-transform ${r?"":"-rotate-90"}`}),n,t!==void 0&&p.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t,")"]})]}),r&&p.jsx("div",{className:"border-t px-4 pb-3",children:e})]})}function I$e(){const{accountId:e,prId:t}=v4(),n=zr(Zl),r=un(Gwe),i=y.useRef(null),a=y.useMemo(()=>t?n.pullRequests.find(D=>D.id===t&&(D.account.awsAccountId===e||D.account.profile===e))??null:null,[e,t,n.pullRequests]);y.useEffect(()=>{if(a||!e||!t)return;const D=`${e}:${t}`;i.current!==D&&(i.current=D,r({path:{awsAccountId:e,prId:Ud.make(t)}}))},[a,e,t,r]);const o=y.useMemo(()=>a?Bi(DK(a,new Date)):void 0,[a]),s=Es(),l=un(Iwe),c=T$e(ZT.grantedDismissed),f=zr(Fwe),u=un(Uwe),d=un(Bwe),h=(a==null?void 0:a.account.awsAccountId)??(a==null?void 0:a.account.profile),m=y.useMemo(()=>vs(f)&&h?f.value.some(D=>D.awsAccountId===h&&D.pullRequestId===t):!1,[f,h,t]),[b,w]=yOe(m),g=y.useCallback(()=>{if(!h||!a)return;const D={awsAccountId:h,pullRequestId:a.id};w(!b),b?d({payload:D}):u({payload:D})},[h,b,a,u,d]),[v,x]=y.useState(!1),E=y.useRef(a==null?void 0:a.fetchedAt);y.useEffect(()=>{v&&(a!=null&&a.fetchedAt)&&a.fetchedAt!==E.current&&x(!1),E.current=a==null?void 0:a.fetchedAt},[v,a==null?void 0:a.fetchedAt]);const C=y.useCallback(()=>{!h||!t||v||(x(!0),r({path:{awsAccountId:h,prId:Ud.make(t)}}))},[h,v,t,r]),k=a?a.link||`https://${a.account.region}.console.aws.amazon.com/codesuite/codecommit/repositories/${a.repositoryName}/pull-requests/${a.id}?region=${a.account.region}`:"",[_,A]=y.useState(!1),I=y.useCallback(()=>{k&&navigator.clipboard.writeText(k).then(()=>{A(!0),setTimeout(()=>A(!1),2e3)},()=>{})},[k]),O=y.useCallback(()=>{!a||!k||l({payload:{profile:a.account.profile,link:k}})},[k,l,a]),z=y.useCallback(()=>{a&&(c.show()||O())},[c,a,O]),U=()=>{c.dismiss(),O()};if(y.useEffect(()=>{const D=P=>{P.target instanceof HTMLInputElement||P.target instanceof HTMLTextAreaElement||(P.key==="Escape"?(P.preventDefault(),s("/")):(P.key==="Enter"||P.key==="o")&&(a!=null&&a.link)&&z())};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[z,s,a]),!a)return p.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[p.jsx(Vx,{className:"size-6 animate-spin opacity-40"}),p.jsx("p",{className:"text-sm",children:"Loading pull request..."})]});const J=a.status==="OPEN",Y=J?a.isMergeable?p.jsx(Vn,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Mergeable"}):p.jsx(Vn,{variant:"destructive",children:"Conflict"}):null,F=J?a.isApproved?p.jsx(Vn,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Approved"}):p.jsx(Vn,{variant:"secondary",children:"Pending"}):null;return p.jsxs("div",{className:"space-y-6",children:[p.jsxs("div",{className:"flex items-center gap-4",children:[p.jsxs(Ot,{variant:"ghost",size:"sm",onClick:()=>s("/"),children:[p.jsx(x7,{className:"size-4"}),"Back"]}),p.jsxs(dw,{className:"ml-auto",children:[p.jsxs(Ot,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:C,disabled:v,children:[p.jsx(ay,{className:`size-3.5 ${v?"animate-spin":""}`}),"Refresh"]}),p.jsxs(Ot,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:g,children:[b?p.jsx(l1e,{className:"size-3.5"}):p.jsx(DO,{className:"size-3.5"}),b?"Unsubscribe":"Subscribe"]}),p.jsxs(Ot,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:I,children:[_?p.jsx(jO,{className:"size-3.5"}):p.jsx(_7,{className:"size-3.5"}),_?"Copied":"Copy Link"]}),p.jsxs(Ot,{variant:"default",size:"sm",className:"h-7 text-xs",onClick:z,children:[p.jsx(x1e,{className:"size-3.5"}),"Open in Console"]})]})]}),p.jsxs("div",{children:[p.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:a.title}),p.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[Y,F,p.jsx(Vn,{variant:"outline",children:a.status}),p.jsx(N$e,{score:o}),p.jsx(Wa,{to:`/?filter=author&value=${encodeURIComponent(a.author)}`,className:"text-sm text-muted-foreground hover:underline",children:a.author}),p.jsx("span",{className:"text-sm text-muted-foreground",children:"·"}),p.jsx("span",{className:"text-sm text-muted-foreground",children:f2(a.creationDate)}),a.fetchedAt&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-sm text-muted-foreground",children:"·"}),p.jsx("span",{className:"text-xs text-muted-foreground",children:hw(a.fetchedAt,new Date,"Fetched")})]})]})]}),p.jsx(Ra,{}),p.jsx(LC,{children:p.jsxs(zC,{className:"grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 py-4 text-sm",children:[p.jsx("span",{className:"text-muted-foreground",children:"Account"}),p.jsx(Wa,{to:`/?filter=account&value=${encodeURIComponent(a.account.profile)}`,className:"font-mono text-xs hover:underline",children:a.account.profile}),p.jsx("span",{className:"text-muted-foreground",children:"Repository"}),p.jsx(Wa,{to:`/?filter=repo&value=${encodeURIComponent(a.repositoryName)}`,className:"font-mono text-xs hover:underline",children:a.repositoryName}),p.jsx("span",{className:"text-muted-foreground",children:"Branch"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Vn,{variant:"outline",className:"font-mono text-xs",children:a.sourceBranch}),p.jsx(o1e,{className:"size-3 text-muted-foreground"}),p.jsx(Vn,{variant:"outline",className:"font-mono text-xs",children:a.destinationBranch})]}),p.jsx("span",{className:"text-muted-foreground",children:"Author"}),p.jsx(Wa,{to:`/?filter=author&value=${encodeURIComponent(a.author)}`,className:"text-xs hover:underline",children:a.author}),ad(a.title)&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted-foreground",children:"Scope"}),p.jsx(Wa,{to:`/?filter=scope&value=${encodeURIComponent(ad(a.title))}`,className:"text-xs hover:underline",children:ad(a.title)})]}),p.jsx("span",{className:"text-muted-foreground",children:"Status"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Wa,{to:`/?filter=status&value=${a.isApproved?"approved":"pending"}`,className:"hover:underline",children:a.isApproved?p.jsx(Vn,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Approved"}):p.jsx(Vn,{variant:"secondary",children:"Pending"})}),p.jsx(Wa,{to:`/?filter=status&value=${a.isMergeable?"mergeable":"conflicts"}`,className:"hover:underline",children:a.isMergeable?p.jsx(Vn,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Mergeable"}):p.jsx(Vn,{variant:"destructive",children:"Conflict"})})]}),p.jsx("span",{className:"text-muted-foreground",children:"ID"}),p.jsx("span",{className:"font-mono text-xs",children:a.id})]})}),p.jsx(yL,{title:"Health Score Breakdown",children:p.jsx(D$e,{score:o})}),a.description&&p.jsxs(LC,{children:[p.jsx(KG,{children:p.jsx(GG,{className:"text-sm",children:"Description"})}),p.jsx(zC,{children:p.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:p.jsx(yG,{remarkPlugins:[VG],rehypePlugins:[xG],children:a.description})})})]}),p.jsx(yL,{title:"Comments",...a.commentCount!==void 0?{count:a.commentCount}:{},children:p.jsx(j$e,{pr:a},a.id)}),p.jsx(wK,{open:c.visible,onOpenChange:c.cancel,children:p.jsxs(_K,{children:[p.jsxs(EK,{children:[p.jsx(kK,{children:"Granted CLI Required"}),p.jsxs(CK,{children:['"Open in Console" uses'," ",p.jsx("a",{href:"https://docs.commonfate.io/granted/introduction",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Granted"})," ","to assume the AWS role for this account. Make sure the"," ",p.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-xs",children:"assume"})," CLI is installed and configured before continuing."]})]}),p.jsxs(BAe,{children:[p.jsxs("label",{className:"flex items-center gap-2 text-sm text-muted-foreground mr-auto",children:[p.jsx("input",{type:"checkbox",checked:c.dontRemind,onChange:D=>c.setDontRemind(D.target.checked),className:"accent-primary"}),"Don't remind again"]}),p.jsx(Ot,{variant:"ghost",onClick:c.cancel,children:"Cancel"}),p.jsx(Ot,{onClick:U,children:"Continue"})]})]})})]})}const PC=new Set,Fr=new WeakMap,yu=new WeakMap,ws=new WeakMap,rg=new WeakMap,R_=new WeakMap,FC=new WeakMap,qc=new WeakMap,qd=new WeakMap,gf=new WeakSet;let Hl,N2=0,D2=0;const is="__aa_tgt",ig="__aa_del",tS="__aa_new",XG=e=>{const t=F$e(e);t&&t.forEach(n=>U$e(n))},$$e=e=>{e.forEach(t=>{t.target===Hl&&z$e(),Fr.has(t.target)&&Lu(t.target)})};function L$e(e){const t=rg.get(e);t==null||t.disconnect();let n=Fr.get(e),r=0;const i=5;n||(n=Vd(e),Fr.set(e,n));const{offsetWidth:a,offsetHeight:o}=Hl,l=[n.top-i,a-(n.left+i+n.width),o-(n.top+i+n.height),n.left-i].map(f=>`${-1*Math.floor(f)}px`).join(" "),c=new IntersectionObserver(()=>{++r>1&&Lu(e)},{root:Hl,threshold:1,rootMargin:l});c.observe(e),rg.set(e,c)}function Lu(e){clearTimeout(qd.get(e));const t=Sw(e),n=ag(t)?500:t.duration;qd.set(e,setTimeout(async()=>{const r=ws.get(e);try{await(r==null?void 0:r.finished),Fr.set(e,Vd(e)),L$e(e)}catch{}},n))}function z$e(){clearTimeout(qd.get(Hl)),qd.set(Hl,setTimeout(()=>{PC.forEach(e=>UC(e,t=>QG(()=>Lu(t))))},100))}function P$e(e){setTimeout(()=>{FC.set(e,setInterval(()=>QG(Lu.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function QG(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let Ho;const ZG=typeof window<"u"&&"ResizeObserver"in window;ZG&&(Hl=document.documentElement,new MutationObserver(XG),Ho=new ResizeObserver($$e),window.addEventListener("scroll",()=>{D2=window.scrollY,N2=window.scrollX}),Ho.observe(Hl));function F$e(e){return e.reduce((r,i)=>[...r,...Array.from(i.addedNodes),...Array.from(i.removedNodes)],[]).every(r=>r.nodeName==="#comment")?!1:e.reduce((r,i)=>{if(r===!1)return!1;if(i.target instanceof Element){if(A_(i.target),!r.has(i.target)){r.add(i.target);for(let a=0;a<i.target.children.length;a++){const o=i.target.children.item(a);if(o){if(ig in o)return!1;A_(i.target,o),r.add(o)}}}if(i.removedNodes.length)for(let a=0;a<i.removedNodes.length;a++){const o=i.removedNodes[a];if(ig in o)return!1;o instanceof Element&&(r.add(o),A_(i.target,o),yu.set(o,[i.previousSibling,i.nextSibling]))}}return r},new Set)}function A_(e,t){!t&&!(is in e)?Object.defineProperty(e,is,{value:e}):t&&!(is in t)&&Object.defineProperty(t,is,{value:e})}function U$e(e){var t;const n=e.isConnected,r=Fr.has(e);n&&yu.has(e)&&yu.delete(e),ws.has(e)&&((t=ws.get(e))===null||t===void 0||t.cancel()),tS in e?bL(e):r&&n?H$e(e):r&&!n?q$e(e):bL(e)}function Ya(e){return Number(e.replace(/[^0-9.\-]/g,""))}function B$e(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}function Vd(e){const t=e.getBoundingClientRect(),{x:n,y:r}=B$e(e);return{top:t.top+r,left:t.left+n,width:t.width,height:t.height}}function eY(e,t,n){let r=t.width,i=t.height,a=n.width,o=n.height;const s=getComputedStyle(e);if(s.getPropertyValue("box-sizing")==="content-box"){const c=Ya(s.paddingTop)+Ya(s.paddingBottom)+Ya(s.borderTopWidth)+Ya(s.borderBottomWidth),f=Ya(s.paddingLeft)+Ya(s.paddingRight)+Ya(s.borderRightWidth)+Ya(s.borderLeftWidth);r-=f,a-=f,i-=c,o-=c}return[r,a,i,o].map(Math.round)}function Sw(e){return is in e&&qc.has(e[is])?qc.get(e[is]):{duration:250,easing:"ease-in-out"}}function tY(e){if(is in e)return e[is]}function j2(e){const t=tY(e);return t?gf.has(t):!1}function UC(e,...t){t.forEach(n=>n(e,qc.has(e)));for(let n=0;n<e.children.length;n++){const r=e.children.item(n);r&&t.forEach(i=>i(r,qc.has(r)))}}function I2(e){return Array.isArray(e)?e:[e]}function ag(e){return typeof e=="function"}function H$e(e){const t=Fr.get(e),n=Vd(e);if(!j2(e))return Fr.set(e,n);let r;if(!t)return;const i=Sw(e);if(typeof i!="function"){const a=t.left-n.left,o=t.top-n.top,[s,l,c,f]=eY(e,t,n),u={transform:`translate(${a}px, ${o}px)`},d={transform:"translate(0, 0)"};s!==l&&(u.width=`${s}px`,d.width=`${l}px`),c!==f&&(u.height=`${c}px`,d.height=`${f}px`),r=e.animate([u,d],{duration:i.duration,easing:i.easing})}else{const[a]=I2(i(e,"remain",t,n));r=new Animation(a),r.play()}ws.set(e,r),Fr.set(e,n),r.addEventListener("finish",()=>Lu(e),{once:!0})}function bL(e){tS in e&&delete e[tS];const t=Vd(e);Fr.set(e,t);const n=Sw(e);if(!j2(e))return;let r;if(typeof n!="function")r=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"});else{const[i]=I2(n(e,"add",t));r=new Animation(i),r.play()}ws.set(e,r),r.addEventListener("finish",()=>Lu(e),{once:!0})}function vL(e,t){var n;e.remove(),Fr.delete(e),yu.delete(e),ws.delete(e),(n=rg.get(e))===null||n===void 0||n.disconnect(),setTimeout(()=>{if(ig in e&&delete e[ig],Object.defineProperty(e,tS,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const r in t)e.style[r]=""},0)}function q$e(e){var t;if(!yu.has(e)||!Fr.has(e))return;const[n,r]=yu.get(e);Object.defineProperty(e,ig,{value:!0,configurable:!0});const i=window.scrollX,a=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):n&&n.parentNode?n.parentNode.appendChild(e):(t=tY(e))===null||t===void 0||t.appendChild(e),!j2(e))return vL(e);const[o,s,l,c]=K$e(e),f=Sw(e),u=Fr.get(e);(i!==N2||a!==D2)&&V$e(e,i,a,f);let d,h={position:"absolute",top:`${o}px`,left:`${s}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!ag(f))Object.assign(e.style,h),d=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:f.duration,easing:"ease-out"});else{const[m,b]=I2(f(e,"remove",u));(b==null?void 0:b.styleReset)!==!1&&(h=(b==null?void 0:b.styleReset)||h,Object.assign(e.style,h)),d=new Animation(m),d.play()}ws.set(e,d),d.addEventListener("finish",()=>vL(e,h),{once:!0})}function V$e(e,t,n,r){const i=N2-t,a=D2-n,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(Hl).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+i,window.scrollY+a),!e.parentElement)return;const l=e.parentElement;let c=l.clientHeight,f=l.clientWidth;const u=performance.now();function d(){requestAnimationFrame(()=>{if(!ag(r)){const h=c-l.clientHeight,m=f-l.clientWidth;u+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-m,top:window.scrollY-h}),c=l.clientHeight,f=l.clientWidth,d()):document.documentElement.style.scrollBehavior=o}})}d()}function K$e(e){const t=Fr.get(e),[n,,r]=eY(e,t,Vd(e));let i=e.parentElement;for(;i&&(getComputedStyle(i).position==="static"||i instanceof HTMLBodyElement);)i=i.parentElement;i||(i=document.body);const a=getComputedStyle(i),o=Fr.get(i)||Vd(i),s=Math.round(t.top-o.top)-Ya(a.borderTopWidth),l=Math.round(t.left-o.left)-Ya(a.borderLeftWidth);return[s,l,n,r]}function G$e(e,t={}){if(ZG&&Ho&&!(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!ag(t)&&!t.disrespectUserMotionPreference)){gf.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),UC(e,Lu,P$e,o=>Ho==null?void 0:Ho.observe(o)),ag(t)?qc.set(e,t):qc.set(e,{duration:250,easing:"ease-in-out",...t});const a=new MutationObserver(XG);a.observe(e,{childList:!0}),R_.set(e,a),PC.add(e)}return Object.freeze({parent:e,enable:()=>{gf.add(e)},disable:()=>{gf.delete(e)},isEnabled:()=>gf.has(e),destroy:()=>{gf.delete(e),PC.delete(e),qc.delete(e);const r=R_.get(e);r==null||r.disconnect(),R_.delete(e),UC(e,i=>{Ho==null||Ho.unobserve(i);const a=ws.get(i);try{a==null||a.cancel()}catch{}ws.delete(i);const o=rg.get(i);o==null||o.disconnect(),rg.delete(i);const s=FC.get(i);s&&clearInterval(s),FC.delete(i);const l=qd.get(i);l&&clearTimeout(l),qd.delete(i),Fr.delete(i),yu.delete(i)})}})}function Y$e(e){const[t,n]=y.useState(),r=y.useMemo(()=>e,[]),i=y.useCallback(o=>{o instanceof HTMLElement?n(G$e(o,r)):n(void 0)},[r]),a=y.useCallback(o=>{t&&(o?t.enable():t.disable())},[t]);return y.useEffect(()=>()=>{var o;(o=t==null?void 0:t.destroy)===null||o===void 0||o.call(t)},[t]),[i,a]}function SL({pr:e,to:t,showUpdated:n}){const r=y.useMemo(()=>Bi(DK(e,new Date)),[e]),i=r?d2(r.total):void 0,a=i==="green"?"text-green-600 dark:text-green-400":i==="yellow"?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400",o=e.isMergeable?e.isApproved?p.jsx(Vn,{variant:"outline",className:"border-green-500/30 text-green-600 dark:text-green-400",children:"Approved"}):p.jsx(Vn,{variant:"secondary",children:"Pending"}):p.jsx(Vn,{variant:"destructive",children:"Conflict"});return p.jsxs(Wa,{to:t,className:"group flex cursor-pointer flex-col gap-1.5 px-4 py-3 transition-colors hover:bg-accent/50 no-underline text-inherit",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[o,r&&p.jsx("span",{className:`text-xs font-semibold tabular-nums ${a}`,children:r.total.toFixed(1)}),p.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.author," ·"," ",n?hw(e.lastModifiedDate,new Date):f2(e.creationDate)]}),e.commentCount!==void 0&&e.commentCount>0&&p.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-muted-foreground",children:[p.jsx($1e,{className:"size-3"}),e.commentCount]})]}),p.jsxs("div",{className:"flex items-baseline gap-1.5",children:[p.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:e.repositoryName}),p.jsx("span",{className:"text-muted-foreground/50",children:"›"}),p.jsx("span",{className:"text-sm font-medium",children:e.title})]}),e.description&&p.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:e.description.split(`
370
+ `).slice(0,2).join(" ")})]})}function W$e(){const e=zr(Zl),t=un(MO),{filterText:n,quickFilter:r}=TK(),[i,a]=Y$e(),o=e.status==="loading",s=e.pullRequests,l=e.currentUser,c=r.type==="hot";y.useEffect(()=>{a(c)},[c,a]);const{flat:f,grouped:u}=y.useMemo(()=>{var E;if(s.length===0)return{flat:[],grouped:[]};const m=n.toLowerCase(),b=C=>{var k;return n?C.repositoryName.toLowerCase().includes(m)||C.title.toLowerCase().includes(m)||C.author.toLowerCase().includes(m)||C.sourceBranch.toLowerCase().includes(m)||(((k=C.description)==null?void 0:k.toLowerCase().includes(m))??!1):!0},w=C=>{var k;if(r.type==="all"||r.type==="hot")return!0;if(r.type==="mine")return l&&C.author!==l?!1:r.value===void 0?!0:ad(C.title)===r.value;if(r.type==="account")return((k=C.account)==null?void 0:k.profile)===r.value;if(r.type==="author")return C.author===r.value;if(r.type==="scope")return ad(C.title)===r.value;if(r.type==="repo")return C.repositoryName===r.value;if(r.type==="status")switch(r.value){case"approved":return C.isApproved;case"pending":return!C.isApproved;case"mergeable":return C.isMergeable;case"conflicts":return!C.isMergeable;default:return!0}return!0},g=s.filter(C=>C.status!=="MERGED"&&b(C)&&w(C));if(r.type==="hot")return{flat:[...g].sort((k,_)=>_.lastModifiedDate.getTime()-k.lastModifiedDate.getTime()),grouped:[]};const v=new Map;for(const C of g){const k=((E=C.account)==null?void 0:E.profile)??"unknown";v.has(k)||v.set(k,[]),v.get(k).push(C)}const x=[];for(const[C,k]of v)k.length>0&&x.push([C,k]);return{flat:[],grouped:x}},[s,l,n,r]),d=m=>{const b=m.account.awsAccountId??m.account.profile;return`/accounts/${encodeURIComponent(b)}/prs/${m.id}`};if(f.length===0&&u.length===0){if(o)return p.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[p.jsx(Vx,{className:"size-8 animate-spin opacity-40"}),p.jsx("p",{className:"text-sm font-medium",children:"Loading pull requests..."}),s.length>0&&p.jsxs("p",{className:"text-xs opacity-50",children:[s.length," PRs fetched (filter hides all)"]})]});const m=[...new Set(e.accounts.filter(w=>w.enabled).map(w=>w.profile))],b=s.length===0&&m.length>0;return p.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-20 text-muted-foreground",children:[p.jsxs("svg",{className:"size-16 opacity-30",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p.jsx("rect",{x:"8",y:"12",width:"48",height:"40",rx:"4",stroke:"currentColor",strokeWidth:"2"}),p.jsx("path",{d:"M8 24h48",stroke:"currentColor",strokeWidth:"2"}),p.jsx("circle",{cx:"16",cy:"18",r:"2",fill:"currentColor"}),p.jsx("circle",{cx:"22",cy:"18",r:"2",fill:"currentColor"}),p.jsx("circle",{cx:"28",cy:"18",r:"2",fill:"currentColor"}),p.jsx("path",{d:"M24 36h16M28 42h8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),p.jsx("p",{className:"text-sm",children:"No pull requests found"}),s.length>0&&p.jsxs("p",{className:"text-xs opacity-50",children:[s.length," PRs loaded — try a different filter"]}),b&&p.jsxs(LC,{className:"mt-4 w-full max-w-sm",children:[p.jsx(KG,{className:"pb-2",children:p.jsx(GG,{className:"text-sm",children:"SSO Login"})}),p.jsxs(zC,{className:"flex flex-col gap-2",children:[p.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Session may have expired. Log in to fetch PRs."}),m.map(w=>p.jsxs(Ot,{variant:"outline",size:"sm",className:"justify-start gap-2",onClick:()=>t({payload:{profile:w}}),children:[p.jsx(E7,{className:"size-3.5"}),w]},w))]})]})]})}return c?p.jsx("div",{ref:i,className:"divide-y rounded-lg border bg-card",children:f.map(m=>p.jsx(SL,{pr:m,to:d(m),showUpdated:!0},m.id))},"hot"):p.jsx("div",{className:"space-y-6",children:u.map(([m,b])=>p.jsxs("section",{children:[p.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[p.jsx("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:m}),p.jsx(Vn,{variant:"secondary",children:b.length})]}),p.jsx("div",{className:"divide-y rounded-lg border bg-card",children:b.map(w=>p.jsx(SL,{pr:w,to:d(w)},w.id))})]},m))},"grouped")}const J$e=[{key:"Esc",desc:"Back / Close"},{key:"R",desc:"Refresh PRs"},{key:"/",desc:"Filter PRs"},{key:"1-7",desc:"Quick filters"},{key:"Enter",desc:"Open PR details"},{key:"Cmd+P",desc:"Command palette"}];function X$e(){return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-semibold",children:"About"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"Keyboard shortcuts and info"})]}),p.jsx(Ra,{}),p.jsxs("div",{className:"space-y-1.5",children:[p.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Keyboard Shortcuts"}),J$e.map(e=>p.jsxs("div",{className:"flex items-center justify-between py-0.5",children:[p.jsx("span",{className:"text-sm text-muted-foreground",children:e.desc}),p.jsx("kbd",{className:"rounded border bg-muted px-1.5 py-0.5 font-mono text-xs",children:e.key})]},e.key))]})]})}function Q$e(){const e=zr(y7),t=zr(Zl),n=un(v7),r=un(MO),i=un(NO),[a,o]=y.useState(""),[s,l]=y.useState("all"),[c,f]=y.useState({}),u=y.useRef(null);y.useEffect(()=>()=>{u.current&&clearTimeout(u.current)},[]);const d=y.useCallback(m=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{n({payload:m})},500)},[n]),h=y.useCallback((m,b)=>{var x;const g=!(c[m]??((x=b.accounts.find(E=>E.profile===m))==null?void 0:x.enabled)??!0),v={...c,[m]:g};f(v),d({accounts:b.accounts.map(E=>({profile:E.profile,regions:[...E.regions],enabled:E.profile===m?g:v[E.profile]??E.enabled})),autoDetect:b.autoDetect,autoRefresh:b.autoRefresh,refreshIntervalSeconds:b.refreshIntervalSeconds})},[d,c]);return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-semibold",children:"Accounts"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"AWS profiles configured for CodeCommit"})]}),p.jsx(Ra,{}),nd(e).onInitialOrWaiting(()=>p.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})).onError(()=>p.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onDefect(()=>p.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onSuccess(m=>p.jsx(Z$e,{currentUser:t.currentUser,data:m,overrides:c,search:a,setSearch:o,statusFilter:s,setStatusFilter:l,toggleAccount:h,onSsoLogin:b=>{try{r({payload:{profile:l9(qx)(b)}})}catch{}},onSsoLogout:()=>i({})})).render()]})}function Z$e({currentUser:e,data:t,onSsoLogin:n,onSsoLogout:r,overrides:i,search:a,setSearch:o,setStatusFilter:s,statusFilter:l,toggleAccount:c}){const f=y.useMemo(()=>t.accounts.map(m=>({...m,enabled:i[m.profile]??m.enabled})),[t.accounts,i]),u=y.useMemo(()=>{const m=a.toLowerCase();return f.filter(b=>!(l==="on"&&!b.enabled||l==="off"&&b.enabled||m&&!b.profile.toLowerCase().includes(m)&&!b.regions.some(w=>w.toLowerCase().includes(m))))},[f,a,l]),d=f.filter(m=>m.enabled),h=d.length;return p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[p.jsx(zO,{className:"size-4 text-muted-foreground"}),e?p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted-foreground",children:"Current user:"}),p.jsx("span",{className:"font-medium",children:e}),p.jsx(Ot,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs",title:"SSO Logout",onClick:()=>r(),children:p.jsx(k7,{className:"size-3"})})]}):p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted-foreground",children:"Not logged in"}),d[0]&&(()=>{const m=d[0].profile;return p.jsx(Ot,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs",title:"SSO Login",onClick:()=>n(m),children:p.jsx(E7,{className:"size-3"})})})()]})]}),f.length===0?p.jsx("p",{className:"text-sm text-muted-foreground py-4",children:"No accounts configured. Edit the config file to add AWS profiles."}):p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsxs("div",{className:"relative flex-1",children:[p.jsx(LO,{className:"absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),p.jsx(RK,{placeholder:"Search profiles...",value:a,onChange:m=>o(m.target.value),className:"h-8 pl-8 text-sm"})]}),p.jsx(dw,{children:["all","on","off"].map(m=>p.jsx(Ot,{variant:l===m?"default":"outline",size:"sm",className:"h-8 px-2.5 text-xs capitalize",onClick:()=>s(m),children:m},m))})]}),p.jsxs("div",{className:"text-xs text-muted-foreground",children:[h,"/",f.length," enabled",u.length!==f.length&&` · ${u.length} shown`]}),p.jsxs("div",{className:"divide-y rounded-md border",children:[u.map(m=>p.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx(G1e,{className:"size-3.5 text-muted-foreground shrink-0"}),p.jsx("span",{className:"text-sm font-medium truncate",children:m.profile}),p.jsx("span",{className:"text-xs text-muted-foreground truncate",children:m.regions.join(", ")||"default"})]}),p.jsx(Ot,{variant:m.enabled?"default":"outline",size:"sm",className:"ml-2 h-6 px-2 text-xs shrink-0",onClick:()=>c(m.profile,t),children:m.enabled?"On":"Off"})]},m.profile)),u.length===0&&p.jsx("p",{className:"px-3 py-4 text-center text-sm text-muted-foreground",children:"No matching accounts"})]})]}),p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[p.jsx($O,{className:"size-3"}),"Auto-detect: ",t.autoDetect?"enabled":"disabled"]})]})}const eLe=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`;function xL({copyKey:e,copied:t,label:n,onCopy:r,path:i,detail:a}){return p.jsxs("div",{className:"flex items-baseline gap-3 py-1.5",children:[p.jsx("span",{className:"shrink-0 text-xs text-muted-foreground w-24",children:n}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("code",{className:"truncate text-xs font-mono",children:i}),p.jsx("button",{onClick:()=>r(i,e),className:"shrink-0 rounded p-0.5 hover:bg-muted",children:t===e?p.jsx(w7,{className:"size-3 text-green-500"}):p.jsx(_7,{className:"size-3 text-muted-foreground"})})]}),p.jsx("p",{className:"text-[11px] text-muted-foreground",children:a})]})]})}function tLe(){const e=zr($we),t=zr(zwe),n=zr(Lwe),r=un(Pwe),[i,a]=y.useState(null),[o,s]=y.useState(!1),l=y.useCallback((u,d)=>{navigator.clipboard.writeText(u).then(()=>{a(d),setTimeout(()=>a(null),2e3)},()=>{})},[]),c=y.useCallback(async()=>{s(!0);try{await r({})}finally{s(!1)}},[r]),f=u=>u?`Modified ${hw(new Date(u),new Date,"").trim()}`:"";return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-semibold",children:"Configuration"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"File locations, validation, and storage"})]}),p.jsx(Ra,{}),p.jsxs("div",{className:"space-y-1",children:[nd(e).onInitialOrWaiting(()=>p.jsx("p",{className:"text-xs text-muted-foreground py-1",children:"Loading config path..."})).onError(()=>p.jsx("p",{className:"text-xs text-destructive py-1",children:"Failed to load config path"})).onDefect(()=>p.jsx("p",{className:"text-xs text-destructive py-1",children:"Failed to load config path"})).onSuccess(u=>{const d=vs(t)?` · ${t.value.status}`:"",h=u.exists?`${f(u.modifiedAt)}${d}`:`Not created yet${d}`;return p.jsx(xL,{label:"Config file",path:u.path,detail:h,copyKey:"config",copied:i,onCopy:l})}).render(),nd(t).onInitialOrWaiting(()=>null).onError(()=>null).onDefect(()=>null).onSuccess(u=>u.errors.length>0?p.jsx("div",{className:"ml-27 rounded bg-destructive/10 px-2 py-1 text-[11px] text-destructive",children:u.errors.map((d,h)=>p.jsx("p",{children:d},h))}):null).render(),p.jsx(Ra,{}),nd(n).onInitialOrWaiting(()=>p.jsx("p",{className:"text-xs text-muted-foreground py-1",children:"Loading database info..."})).onError(()=>p.jsx("p",{className:"text-xs text-destructive py-1",children:"Failed to load database info"})).onDefect(()=>p.jsx("p",{className:"text-xs text-destructive py-1",children:"Failed to load database info"})).onSuccess(u=>{const d=u.exists?`${eLe(u.sizeBytes)} · ${f(u.modifiedAt)}`:"Not created yet";return p.jsx(xL,{label:"Cache database",path:u.path,detail:d,copyKey:"db",copied:i,onCopy:l})}).render()]}),p.jsx(Ra,{}),p.jsxs("div",{className:"flex items-center gap-3",children:[p.jsxs("div",{className:"flex-1",children:[p.jsx("p",{className:"text-sm font-medium",children:"Reset to Defaults"}),p.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Backs up current config, then re-detects AWS profiles"})]}),p.jsxs(Ot,{variant:"outline",size:"sm",onClick:c,disabled:o,className:"shrink-0 gap-2",children:[p.jsx(q1e,{className:it("size-3.5",o&&"animate-spin")}),o?"Resetting...":"Reset"]})]})]})}const nLe=[{label:"1 min",value:60},{label:"5 min",value:300},{label:"10 min",value:600},{label:"15 min",value:900},{label:"30 min",value:1800}];function rLe(){const e=zr(y7),t=un(v7),n=y.useRef(null),r=y.useRef(null),[i,a]=y.useState({});y.useEffect(()=>{vs(e)&&(r.current=e.value)},[e]),y.useEffect(()=>{const s=new BroadcastChannel("codecommit-config");return n.current=s,s.onmessage=l=>{a(c=>({...c,...l.data}))},()=>s.close()},[]);const o=y.useCallback(s=>{var c;const l=r.current;l&&(a(f=>({...f,...s})),(c=n.current)==null||c.postMessage(s),t({payload:{accounts:l.accounts.map(f=>({profile:f.profile,regions:[...f.regions],enabled:f.enabled})),autoDetect:l.autoDetect,autoRefresh:s.autoRefresh??l.autoRefresh,refreshIntervalSeconds:s.refreshIntervalSeconds??l.refreshIntervalSeconds}}))},[t]);return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-semibold",children:"Auto-refresh"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"Periodically fetch PR updates from AWS"})]}),p.jsx(Ra,{}),nd(e).onInitialOrWaiting(()=>p.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})).onError(()=>p.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onDefect(()=>p.jsx("p",{className:"text-sm text-destructive",children:"Failed to load config"})).onSuccess(s=>{const l=i.autoRefresh??s.autoRefresh,c=i.refreshIntervalSeconds??s.refreshIntervalSeconds;return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[p.jsx(ay,{className:"size-4 text-muted-foreground"}),p.jsx("span",{children:"Auto-refresh"})]}),p.jsx(Ot,{variant:l?"default":"outline",size:"sm",className:"h-7 px-3 text-xs",onClick:()=>o({autoRefresh:!l}),children:l?"On":"Off"})]}),l&&p.jsxs("div",{className:"space-y-2",children:[p.jsx("span",{className:"text-sm text-muted-foreground",children:"Refresh interval"}),p.jsx(dw,{children:nLe.map(f=>p.jsx(Ot,{variant:c===f.value?"default":"outline",size:"sm",className:"h-7 px-3 text-xs",onClick:()=>o({refreshIntervalSeconds:f.value}),children:f.label},f.value))})]})]})}).render()]})}function iLe(){const{setTheme:e,theme:t}=T4(),n=[{id:"light",label:"Light",icon:p.jsx(T7,{className:"size-5"})},{id:"dark",label:"Dark",icon:p.jsx(C7,{className:"size-5"})},{id:"system",label:"System",icon:p.jsx(z1e,{className:"size-5"})}];return p.jsxs("div",{className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("h2",{className:"text-lg font-semibold",children:"Theme"}),p.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose your preferred appearance"})]}),p.jsx(Ra,{}),p.jsx("div",{className:"grid grid-cols-3 gap-3",children:n.map(r=>p.jsxs("button",{onClick:()=>e(r.id),className:it("flex flex-col items-center gap-2 rounded-lg border p-4 transition-colors",t===r.id?"border-primary bg-primary/5":"border-border hover:border-primary/50"),children:[r.icon,p.jsx("span",{className:"text-sm font-medium",children:r.label})]},r.id))})]})}const aLe={accounts:p.jsx(zO,{className:"size-4"}),refresh:p.jsx(ay,{className:"size-4"}),theme:p.jsx(U1e,{className:"size-4"}),config:p.jsx(_1e,{className:"size-4"}),about:p.jsx($O,{className:"size-4"})},oLe={accounts:"Accounts",refresh:"Refresh",theme:"Theme",config:"Config",about:"About"},sLe=e=>A7.includes(e);function lLe(){const{tab:e}=v4(),t=sLe(e)?e:"accounts",n=Es();return p.jsxs("div",{className:"flex gap-6",children:[p.jsxs("nav",{className:"w-48 shrink-0",children:[p.jsxs(Ot,{variant:"ghost",size:"sm",className:"mb-4 gap-2",onClick:()=>n("/"),children:[p.jsx(x7,{className:"size-4"}),"Back to PRs"]}),p.jsx("div",{className:"flex flex-col gap-1",role:"tablist",children:A7.map(r=>p.jsxs("button",{role:"tab","aria-selected":t===r,onClick:()=>n(`/settings/${r}`,{replace:!0}),className:it("flex items-center gap-2 rounded-md px-3 py-2 text-sm text-left transition-colors",t===r?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:[aLe[r],oLe[r]]},r))})]}),p.jsxs("div",{className:"flex-1 min-w-0",children:[t==="accounts"&&p.jsx(Q$e,{}),t==="refresh"&&p.jsx(rLe,{}),t==="theme"&&p.jsx(iLe,{}),t==="config"&&p.jsx(tLe,{}),t==="about"&&p.jsx(X$e,{})]})]})}const cLe=yZ([{element:p.jsx(mOe,{}),children:[{index:!0,element:p.jsx(W$e,{})},{path:"accounts/:accountId/prs/:prId",element:p.jsx(I$e,{})},{path:"settings/:tab?",element:p.jsx(lLe,{})},{path:"notifications",element:p.jsx(COe,{})},{path:"*",element:p.jsx(qQ,{to:"/",replace:!0})}]}]);class uLe extends ee.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?p.jsxs("div",{style:{padding:"2rem",textAlign:"center"},children:[p.jsx("h1",{children:"Something went wrong"}),p.jsx("button",{onClick:()=>window.location.reload(),style:{marginTop:"1rem"},children:"Reload"})]}):this.props.children}}const wL=document.getElementById("root");wL&&tX.createRoot(wL).render(p.jsx(ee.StrictMode,{children:p.jsx(uLe,{children:p.jsx(MZ,{children:p.jsx(UQ,{router:cLe})})})}));