@usine/server 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -0
  3. package/dist/backend.d.ts +26 -0
  4. package/dist/backend.d.ts.map +1 -0
  5. package/dist/backend.js +39 -0
  6. package/dist/backend.js.map +1 -0
  7. package/dist/cli.d.ts +58 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/cli.js +117 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/http.d.ts +7 -0
  12. package/dist/http.d.ts.map +1 -0
  13. package/dist/http.js +205 -0
  14. package/dist/http.js.map +1 -0
  15. package/dist/index.d.ts +9 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +9 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/main.d.ts +3 -0
  20. package/dist/main.d.ts.map +1 -0
  21. package/dist/main.js +21 -0
  22. package/dist/main.js.map +1 -0
  23. package/dist/up.d.ts +4 -0
  24. package/dist/up.d.ts.map +1 -0
  25. package/dist/up.js +68 -0
  26. package/dist/up.js.map +1 -0
  27. package/dist/web/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  28. package/dist/web/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  29. package/dist/web/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  30. package/dist/web/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  31. package/dist/web/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  32. package/dist/web/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  33. package/dist/web/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  34. package/dist/web/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  35. package/dist/web/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  36. package/dist/web/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  37. package/dist/web/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  38. package/dist/web/assets/index-CjRDHHWF.css +2 -0
  39. package/dist/web/assets/index-DmN0SkGf.js +295 -0
  40. package/dist/web/index.html +14 -0
  41. package/package.json +45 -0
@@ -0,0 +1,295 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,j(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=j(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=j(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return j(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=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&&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)},ne={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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 E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.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),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=l(d(),1),p=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),m=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z`}))]]),h=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),g=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),_=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M232,128A104,104,0,1,1,128,24,104.13,104.13,0,0,1,232,128Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Z`}))]]),v=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,44H40A12,12,0,0,0,28,56V208a20,20,0,0,0,20,20H88a20,20,0,0,0,20-20V164h40v12a20,20,0,0,0,20,20h40a20,20,0,0,0,20-20V56A12,12,0,0,0,216,44Zm-12,64H172V68h32ZM84,68v40H52V68Zm0,136H52V132H84Zm24-64V68h40v72Zm64,32V132h32v40Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,56v64H160V56ZM40,208a8,8,0,0,0,8,8H88a8,8,0,0,0,8-8V120H40Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M216,48H40a8,8,0,0,0-8,8V208a16,16,0,0,0,16,16H88a16,16,0,0,0,16-16V160h48v16a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V56A8,8,0,0,0,216,48Zm-8,64H168V64h40ZM88,64v48H48V64Zm0,144H48V128H88Zm16-64V64h48v80Zm64,32V128h40v48Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M160,56v96a8,8,0,0,1-8,8H112a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h40A8,8,0,0,1,160,56Zm64-8H184a8,8,0,0,0-8,8v52a4,4,0,0,0,4,4h48a4,4,0,0,0,4-4V56A8,8,0,0,0,224,48Zm4,80H180a4,4,0,0,0-4,4v44a16,16,0,0,0,16,16h24a16,16,0,0,0,16-16V132A4,4,0,0,0,228,128ZM80,48H40a8,8,0,0,0-8,8v52a4,4,0,0,0,4,4H84a4,4,0,0,0,4-4V56A8,8,0,0,0,80,48Zm4,80H36a4,4,0,0,0-4,4v76a16,16,0,0,0,16,16H72a16,16,0,0,0,16-16V132A4,4,0,0,0,84,128Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,50H40a6,6,0,0,0-6,6V208a14,14,0,0,0,14,14H88a14,14,0,0,0,14-14V158h52v18a14,14,0,0,0,14,14h40a14,14,0,0,0,14-14V56A6,6,0,0,0,216,50Zm-6,64H166V62h44ZM90,62v52H46V62Zm0,146a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V126H90Zm12-62V62h52v84Zm106,32H168a2,2,0,0,1-2-2V126h44v50A2,2,0,0,1,208,178Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,48H40a8,8,0,0,0-8,8V208a16,16,0,0,0,16,16H88a16,16,0,0,0,16-16V160h48v16a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V56A8,8,0,0,0,216,48ZM88,208H48V128H88Zm0-96H48V64H88Zm64,32H104V64h48Zm56,32H168V128h40Zm0-64H168V64h40Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,52H40a4,4,0,0,0-4,4V208a12,12,0,0,0,12,12H88a12,12,0,0,0,12-12V156h56v20a12,12,0,0,0,12,12h40a12,12,0,0,0,12-12V56A4,4,0,0,0,216,52ZM92,208a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V124H92Zm0-92H44V60H92Zm64,32H100V60h56Zm56,28a4,4,0,0,1-4,4H168a4,4,0,0,1-4-4V124h48Zm0-60H164V60h48Z`}))]]),y=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M200,28H160a20,20,0,0,0-20,20V208a20,20,0,0,0,20,20h40a20,20,0,0,0,20-20V48A20,20,0,0,0,200,28Zm-4,176H164V52h32ZM96,28H56A20,20,0,0,0,36,48V208a20,20,0,0,0,20,20H96a20,20,0,0,0,20-20V48A20,20,0,0,0,96,28ZM92,204H60V52H92Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M208,48V208a8,8,0,0,1-8,8H160a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8h40A8,8,0,0,1,208,48ZM96,40H56a8,8,0,0,0-8,8V208a8,8,0,0,0,8,8H96a8,8,0,0,0,8-8V48A8,8,0,0,0,96,40Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M200,32H160a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm0,176H160V48h40ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Zm0,176H56V48H96Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,48V208a16,16,0,0,1-16,16H160a16,16,0,0,1-16-16V48a16,16,0,0,1,16-16h40A16,16,0,0,1,216,48ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M200,34H160a14,14,0,0,0-14,14V208a14,14,0,0,0,14,14h40a14,14,0,0,0,14-14V48A14,14,0,0,0,200,34Zm2,174a2,2,0,0,1-2,2H160a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2h40a2,2,0,0,1,2,2ZM96,34H56A14,14,0,0,0,42,48V208a14,14,0,0,0,14,14H96a14,14,0,0,0,14-14V48A14,14,0,0,0,96,34Zm2,174a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2H96a2,2,0,0,1,2,2Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M200,32H160a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm0,176H160V48h40ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Zm0,176H56V48H96Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M200,36H160a12,12,0,0,0-12,12V208a12,12,0,0,0,12,12h40a12,12,0,0,0,12-12V48A12,12,0,0,0,200,36Zm4,172a4,4,0,0,1-4,4H160a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4h40a4,4,0,0,1,4,4ZM96,36H56A12,12,0,0,0,44,48V208a12,12,0,0,0,12,12H96a12,12,0,0,0,12-12V48A12,12,0,0,0,96,36Zm4,172a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4H96a4,4,0,0,1,4,4Z`}))]]),b=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M234.49,111.07,90.41,22.94A20,20,0,0,0,60,39.87V216.13a20,20,0,0,0,30.41,16.93l144.08-88.13a19.82,19.82,0,0,0,0-33.86ZM84,208.85V47.15L216.16,128Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M228.23,134.69,84.15,222.81A8,8,0,0,1,72,216.12V39.88a8,8,0,0,1,12.15-6.69l144.08,88.12A7.82,7.82,0,0,1,228.23,134.69Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M231.36,116.19,87.28,28.06a14,14,0,0,0-14.18-.27A13.69,13.69,0,0,0,66,39.87V216.13a13.69,13.69,0,0,0,7.1,12.08,14,14,0,0,0,14.18-.27l144.08-88.13a13.82,13.82,0,0,0,0-23.62Zm-6.26,13.38L81,217.7a2,2,0,0,1-2.06,0,1.78,1.78,0,0,1-1-1.61V39.87a1.78,1.78,0,0,1,1-1.61A2.06,2.06,0,0,1,80,38a2,2,0,0,1,1,.31L225.1,126.43a1.82,1.82,0,0,1,0,3.14Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M230.32,117.9,86.24,29.79a11.91,11.91,0,0,0-12.17-.23A11.71,11.71,0,0,0,68,39.89V216.11a11.71,11.71,0,0,0,6.07,10.33,11.91,11.91,0,0,0,12.17-.23L230.32,138.1a11.82,11.82,0,0,0,0-20.2Zm-4.18,13.37L82.06,219.39a4,4,0,0,1-4.07.07,3.77,3.77,0,0,1-2-3.35V39.89a3.77,3.77,0,0,1,2-3.35,4,4,0,0,1,4.07.07l144.08,88.12a3.8,3.8,0,0,1,0,6.54Z`}))]]),x=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,104H72v20H44ZM72,60V80H44V60ZM44,148H72v48H44Zm168,48H96V60H212Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,152H56a8,8,0,0,0,0-16H40V120H56a8,8,0,0,0,0-16H40V88H56a8,8,0,0,0,0-16H40V56H80V200H40Zm176,48H96V56H216V200Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM64,152H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16ZM216,200H88V56H216V200Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM38,200V150H56a6,6,0,0,0,0-12H38V118H56a6,6,0,0,0,0-12H38V86H56a6,6,0,0,0,0-12H38V56a2,2,0,0,1,2-2H82V202H40A2,2,0,0,1,38,200Zm180,0a2,2,0,0,1-2,2H94V54H216a2,2,0,0,1,2,2Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,152H56a8,8,0,0,0,0-16H40V120H56a8,8,0,0,0,0-16H40V88H56a8,8,0,0,0,0-16H40V56H80V200H40Zm176,48H96V56H216V200Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM36,200V148H56a4,4,0,0,0,0-8H36V116H56a4,4,0,0,0,0-8H36V84H56a4,4,0,0,0,0-8H36V56a4,4,0,0,1,4-4H84V204H40A4,4,0,0,1,36,200Zm184,0a4,4,0,0,1-4,4H92V52H216a4,4,0,0,1,4,4Z`}))]]),S=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M40,92H70.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24H137.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24Zm64-24A12,12,0,1,1,92,80,12,12,0,0,1,104,68Zm112,96H201.94a36,36,0,0,0-67.88,0H40a12,12,0,0,0,0,24h94.06a36,36,0,0,0,67.88,0H216a12,12,0,0,0,0-24Zm-48,24a12,12,0,1,1,12-12A12,12,0,0,1,168,188Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M128,80a24,24,0,1,1-24-24A24,24,0,0,1,128,80Zm40,72a24,24,0,1,0,24,24A24,24,0,0,0,168,152Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M32,80a8,8,0,0,1,8-8H77.17a28,28,0,0,1,53.66,0H216a8,8,0,0,1,0,16H130.83a28,28,0,0,1-53.66,0H40A8,8,0,0,1,32,80Zm184,88H194.83a28,28,0,0,0-53.66,0H40a8,8,0,0,0,0,16H141.17a28,28,0,0,0,53.66,0H216a8,8,0,0,0,0-16Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M40,86H74.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12H133.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12Zm64-24A18,18,0,1,1,86,80,18,18,0,0,1,104,62ZM216,170H197.4a30,30,0,0,0-58.8,0H40a6,6,0,0,0,0,12h98.6a30,30,0,0,0,58.8,0H216a6,6,0,0,0,0-12Zm-48,24a18,18,0,1,1,18-18A18,18,0,0,1,168,194Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M40,88H73a32,32,0,0,0,62,0h81a8,8,0,0,0,0-16H135a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16Zm64-24A16,16,0,1,1,88,80,16,16,0,0,1,104,64ZM216,168H199a32,32,0,0,0-62,0H40a8,8,0,0,0,0,16h97a32,32,0,0,0,62,0h17a8,8,0,0,0,0-16Zm-48,24a16,16,0,1,1,16-16A16,16,0,0,1,168,192Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M40,84H76.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8H131.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8Zm64-24A20,20,0,1,1,84,80,20,20,0,0,1,104,60ZM216,172H195.71a28,28,0,0,0-55.42,0H40a4,4,0,0,0,0,8H140.29a28,28,0,0,0,55.42,0H216a4,4,0,0,0,0-8Zm-48,24a20,20,0,1,1,20-20A20,20,0,0,1,168,196Z`}))]]),C=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M140,32V64a12,12,0,0,1-24,0V32a12,12,0,0,1,24,0Zm33.25,62.75a12,12,0,0,0,8.49-3.52L204.37,68.6a12,12,0,0,0-17-17L164.77,74.26a12,12,0,0,0,8.48,20.49ZM224,116H192a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24Zm-42.26,48.77a12,12,0,1,0-17,17l22.63,22.63a12,12,0,0,0,17-17ZM128,180a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V192A12,12,0,0,0,128,180ZM74.26,164.77,51.63,187.4a12,12,0,0,0,17,17l22.63-22.63a12,12,0,1,0-17-17ZM76,128a12,12,0,0,0-12-12H32a12,12,0,0,0,0,24H64A12,12,0,0,0,76,128ZM68.6,51.63a12,12,0,1,0-17,17L74.26,91.23a12,12,0,0,0,17-17Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm33.94,58.75,17-17a8,8,0,0,1,11.32,11.32l-17,17a8,8,0,0,1-11.31-11.31ZM48,136a8,8,0,0,1,0-16H72a8,8,0,0,1,0,16Zm46.06,37.25-17,17a8,8,0,0,1-11.32-11.32l17-17a8,8,0,0,1,11.31,11.31Zm0-79.19a8,8,0,0,1-11.31,0l-17-17A8,8,0,0,1,77.09,65.77l17,17A8,8,0,0,1,94.06,94.06ZM136,208a8,8,0,0,1-16,0V184a8,8,0,0,1,16,0Zm0-136a8,8,0,0,1-16,0V48a8,8,0,0,1,16,0Zm54.23,118.23a8,8,0,0,1-11.32,0l-17-17a8,8,0,0,1,11.31-11.31l17,17A8,8,0,0,1,190.23,190.23ZM208,136H184a8,8,0,0,1,0-16h24a8,8,0,0,1,0,16Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M134,32V64a6,6,0,0,1-12,0V32a6,6,0,0,1,12,0Zm39.25,56.75A6,6,0,0,0,177.5,87l22.62-22.63a6,6,0,0,0-8.48-8.48L169,78.5a6,6,0,0,0,4.24,10.25ZM224,122H192a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12Zm-46.5,47A6,6,0,0,0,169,177.5l22.63,22.62a6,6,0,0,0,8.48-8.48ZM128,186a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V192A6,6,0,0,0,128,186ZM78.5,169,55.88,191.64a6,6,0,1,0,8.48,8.48L87,177.5A6,6,0,1,0,78.5,169ZM70,128a6,6,0,0,0-6-6H32a6,6,0,0,0,0,12H64A6,6,0,0,0,70,128ZM64.36,55.88a6,6,0,0,0-8.48,8.48L78.5,87A6,6,0,1,0,87,78.5Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M132,32V64a4,4,0,0,1-8,0V32a4,4,0,0,1,8,0Zm41.25,54.75a4,4,0,0,0,2.83-1.18L198.71,63a4,4,0,0,0-5.66-5.66L170.43,79.92a4,4,0,0,0,2.82,6.83ZM224,124H192a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8Zm-47.92,46.43a4,4,0,1,0-5.65,5.65l22.62,22.63a4,4,0,0,0,5.66-5.66ZM128,188a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V192A4,4,0,0,0,128,188ZM79.92,170.43,57.29,193.05A4,4,0,0,0,63,198.71l22.62-22.63a4,4,0,1,0-5.65-5.65ZM68,128a4,4,0,0,0-4-4H32a4,4,0,0,0,0,8H64A4,4,0,0,0,68,128ZM63,57.29A4,4,0,0,0,57.29,63L79.92,85.57a4,4,0,1,0,5.65-5.65Z`}))]]),w=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z`}))]]),T=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z`}))]]),E=new Map([[`bold`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),f.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,f.createElement(f.Fragment,null,f.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),ee=(0,f.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),D=f.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:o,children:s,weights:c,...l}=e,{color:u=`currentColor`,size:d,weight:p=`regular`,mirrored:m=!1,...h}=f.useContext(ee);return f.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:i??d,height:i??d,fill:r??u,viewBox:`0 0 256 256`,transform:o||m?`scale(-1, 1)`:void 0,...h,...l},!!n&&f.createElement(`title`,null,n),s,c.get(a??p))});D.displayName=`IconBase`;var O=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:p}));O.displayName=`ArrowRightIcon`;var k=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:m}));k.displayName=`ArrowSquareOutIcon`;var A=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:h}));A.displayName=`ArrowUpRightIcon`;var te=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:g}));te.displayName=`CaretRightIcon`;var j=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:_}));j.displayName=`CircleIcon`;var M=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:v}));M.displayName=`KanbanIcon`;var N=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:y}));N.displayName=`PauseIcon`;var P=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:b}));P.displayName=`PlayIcon`;var ne=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:x}));ne.displayName=`SidebarIcon`;var re=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:S}));re.displayName=`SlidersHorizontalIcon`;var ie=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:C}));ie.displayName=`SpinnerIcon`;var ae=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:w}));ae.displayName=`WarningIcon`;var oe=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:T}));oe.displayName=`WarningCircleIcon`;var se=f.forwardRef((e,t)=>f.createElement(D,{ref:t,...e,weights:E}));se.displayName=`XIcon`;var ce=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),F=o(((e,t)=>{t.exports=ce()}))(),le=f.createContext(void 0),ue=e=>{let t=f.useContext(le);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},de=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,F.jsx)(le.Provider,{value:e,children:t})),fe={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},pe=new class{#e=fe;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function me(e){setTimeout(e,0)}var he=typeof window>`u`||`Deno`in globalThis;function ge(){}function _e(e,t){return typeof e==`function`?e(t):e}function ve(e){return typeof e==`number`&&e>=0&&e!==1/0}function ye(e,t){return Math.max(e+(t||0)-Date.now(),0)}function be(e,t){return typeof e==`function`?e(t):e}function xe(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Ce(o,t.options))return!1}else if(!Te(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Se(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(we(t.options.mutationKey)!==we(a))return!1}else if(!Te(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ce(e,t){return(t?.queryKeyHashFn||we)(e)}function we(e){return JSON.stringify(e,(e,t)=>Ae(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Te(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!Te(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Te(e[r],t[r]))return!1;return!0}return!1}var Ee=Object.prototype.hasOwnProperty;function De(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ke(e)&&ke(t);if(!r&&!(Ae(e)&&Ae(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=De(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Oe(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ke(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ae(e){if(!je(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!je(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function je(e){return Object.prototype.toString.call(e)===`[object Object]`}function Me(e){return new Promise(t=>{pe.setTimeout(t,e)})}function Ne(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:De(e,t)}function Pe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Fe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ie=Symbol();function Le(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ie?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Re(e,t){return typeof e==`function`?e(...t):!!e}function ze(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Be=()=>he,Ve=()=>Be(),He=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ue=new class extends He{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},We=me;function Ge(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=We,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Ke=Ge(),qe=new class extends He{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Je(e){return Math.min(1e3*2**e,3e4)}function Ye(e){return(e??`online`)!==`online`||qe.isOnline()}var Xe=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ze(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(ge);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Xe(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ue.isFocused()&&(e.networkMode===`always`||qe.isOnline())&&e.canRun(),p=()=>Ye(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Ve()?0:3),a=e.retryDelay??Je,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),Me(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Qe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ve(this.gcTime)&&(this.#e=pe.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ve()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(pe.clearTimeout(this.#e),this.#e=void 0)}};function $e(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ze(e,()=>t.signal,()=>n=!0)},u=Le(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Fe:Pe;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?tt:et,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:et(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function et(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function tt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var nt=class extends Qe{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=at(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=at(this.options);e.data!==void 0&&(this.setState(it(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ne(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(ge).catch(ge):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>be(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ie||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>be(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!ye(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=Le(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?$e(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Ze({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Xe&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Xe){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...rt(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...it(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Ke.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function rt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ye(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function it(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function at(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var ot=class extends He{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ct(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof be(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Oe(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&ut(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||be(this.options.enabled,this.#t)!==be(t.enabled,this.#t)||be(this.options.staleTime,this.#t)!==be(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||be(this.options.enabled,this.#t)!==be(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Oe(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ge)),t}#h(e){return!Ve()&&be(this.options.enabled,this.#t)!==!1&&ve(e)}#g(){this.#b();let e=be(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=ye(this.#r.dataUpdatedAt,e)+1;this.#u=pe.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=pe.setInterval(()=>{(this.options.refetchIntervalInBackground||Ue.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(pe.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(pe.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ct(e,t),o=i&&ut(e,n,t,r);(a||o)&&(l={...l,...rt(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Ne(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Ne(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:dt(e,t),refetch:this.refetch,isEnabled:be(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),Oe(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();Ke.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function st(e,t){return be(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||be(t.retryOnMount,e)!==!1)}function ct(e,t){return st(e,t)||e.state.data!==void 0&&lt(e,t,t.refetchOnMount)}function lt(e,t,n){if(be(t.enabled,e)!==!1&&be(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&dt(e,t)}return!1}function ut(e,t,n,r){return(e!==t||be(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&dt(e,n)}function dt(e,t){return be(t.enabled,e)!==!1&&e.isStaleByTime(be(t.staleTime,e))}var ft=class extends Qe{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||pt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Ze({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Ke.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function pt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var mt=class extends He{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new ft({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=ht(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=ht(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=ht(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=ht(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Ke.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Se(t,e))}findAll(e={}){return this.getAll().filter(t=>Se(e,t))}notify(e){Ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Ke.batch(()=>Promise.all(e.map(e=>e.continue().catch(ge))))}};function ht(e){return e.options.scope?.id}var gt=class extends He{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Oe(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&we(t.mutationKey)!==we(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??pt();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Ke.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},_t=class extends He{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Ce(r,t),a=this.get(i);return a||(a=new nt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Ke.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>xe(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>xe(e,t)):t}notify(e){Ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ke.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ke.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},vt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new _t,this.#t=e.mutationCache||new mt,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ue.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=qe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(be(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=_e(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Ke.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Ke.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Ke.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=Ke.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(ge).catch(ge)}invalidateQueries(e,t={}){return Ke.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ke.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(ge)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(ge)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(be(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(be(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ge).catch(ge)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ge).catch(ge)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return qe.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(we(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Te(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(we(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Te(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Ce(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Ie&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},yt=f.createContext(!1),bt=()=>f.useContext(yt);yt.Provider;function xt(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var St=f.createContext(xt()),Ct=()=>f.useContext(St),wt=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Re(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Tt=e=>{f.useEffect(()=>{e.clearReset()},[e])},Et=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Re(n,[e.error,r])),Dt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Ot=(e,t)=>e?.suspense&&t.isPending,kt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function At(e,t,n){let r=bt(),i=Ct(),a=ue(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Dt(o),wt(o,i,s),Tt(i);let[l]=f.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(f.useSyncExternalStore(f.useCallback(e=>{let t=d?l.subscribe(Ke.batchCalls(e)):ge;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),f.useEffect(()=>{l.setOptions(o)},[o,l]),Ot(o,u))throw kt(o,l,i);if(Et({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function jt(e,t){return At(e,ot,t)}function Mt(e,t){let n=ue(t),[r]=f.useState(()=>new gt(n,e));f.useEffect(()=>{r.setOptions(e)},[r,e]);let i=f.useSyncExternalStore(f.useCallback(e=>r.subscribe(Ke.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=f.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(ge)},[r]);if(i.error&&Re(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Nt=f.useLayoutEffect;function Pt(e,t,n){f.useEffect(()=>{if(!e.current||n||typeof IntersectionObserver!=`function`)return()=>t();let r=new IntersectionObserver(e=>{t(e.pop())},{rootMargin:`100px`});return r.observe(e.current),()=>{r.disconnect(),t()}},[t,n,e])}function Ft(e){let t=f.useRef(null);return f.useImperativeHandle(e,()=>t.current,[]),t}function It(e){return e[e.length-1]}function Lt(e,t){return typeof e==`function`?e(t):e}var Rt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable;function Bt(e){for(let t in e)if(Rt.call(e,t))return!0;return!1}var Vt=()=>Object.create(null),Ht=(e,t)=>Ut(e,t,Vt);function Ut(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=qt(e)&&qt(i);if(!a&&!(Gt(e)&&Gt(i)))return i;let o=a?e:Wt(e);if(!o)return i;let s=a?i:Wt(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:Rt.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=Ut(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function Wt(e){let t=Object.keys(e);if(t.length!==Object.getOwnPropertyNames(e).length)return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n){if(!zt.call(e,r))return!1;t.push(r)}return t}function Gt(e){if(!Kt(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Kt(n)||!n.hasOwnProperty(`isPrototypeOf`))}function Kt(e){return Object.prototype.toString.call(e)===`[object Object]`}function qt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Jt(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Jt(e[r],t[r],n))return!1;return!0}if(Gt(e)&&Gt(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!Jt(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!Jt(e[o],t[o],n)))return!1;return i===a}return!1}var Yt=/[\x00-\x1f\x7f"<>`{}]/g;function Xt(e){return e.replace(Yt,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function Zt(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Xt(t)}var Qt=[`http:`,`https:`,`mailto:`,`tel:`];function $t(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function en(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=Zt(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=Zt(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function tn(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function nn(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function rn(){throw Error(`Invariant failed`)}function an(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var on=4,sn=5;function cn(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.indexOf(`{`),s;if(o!==-1&&o+1<a.length&&(s=a.indexOf(`}`,o))!==-1){let r=a.charCodeAt(o+1);if(r===45){if(o+2<a.length&&a.charCodeAt(o+2)===36){let e=o+3,r=s;if(e<r)return n[0]=3,n[1]=t+o,n[2]=t+e,n[3]=t+r,n[4]=t+s+1,n[5]=i,n}}else if(r===36){let r=o+1,a=o+2;return a===s?(n[0]=2,n[1]=t+o,n[2]=t+r,n[3]=t+a,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+o,n[2]=t+a,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function ln(e,t,n,r,i,a,o,s){s?.(n);let c=r;{let r=n.fullPath??n.from,s=n.options,l=r.length,u=s?.caseSensitive??e,d=s?.params?.parse??s?.parseParams;for(;c<l;){let e=cn(r,c,t),n,s=c,l=e[5];c=l+1,a++;let f=e[0];switch(f){case 0:{let t=r.substring(e[2],e[3]),o=t,s;u?s=i.static??=new Map:(o=t.toLowerCase(),s=i.staticInsensitive??=new Map);let c=s.get(o);if(c)n=c;else{let e=dn(r);e.parent=i,e.depth=a,n=e,s.set(o,e)}break}case 1:case 3:case 2:{let t=r.substring(s,e[1]),c=r.substring(e[4],l),p=u&&!!(t||c);u||(t=t.toLowerCase(),c=c.toLowerCase());let m=f===1?i.dynamic:f===3?i.optional:i.wildcard,h=f!==2&&!d&&m?.find(e=>!e.parse&&e.caseSensitive===p&&e.prefix===t&&e.suffix===c);if(h)n=h;else{let e=fn(f,r,p,t,c);n=e,e.parent=i,e.depth=a;let s;s=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],s.push(e),s.length===2&&o?.push(s)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=dn(r);e.kind=sn,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=dn(r);e.kind=on,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)ln(e,t,r,c,i,a,o,s)}function un(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function dn(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function fn(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function pn(e,t){let n=dn(`/`),r=new Uint16Array(6),i=[];for(let t of e)ln(!1,r,t,1,n,0,i);for(let e of i)e.sort(un);t.masksTree=n,t.flatCache=an(1e3)}function mn(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=yn(e,t.masksTree);return t.flatCache.set(e,r),r}function hn(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=dn(`/`),ln(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),yn(r,o,n)}function gn(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=yn(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=xn(a.route)),t.matchCache.set(r,a),a}function _n(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function vn(e,t=!1,n){let r=dn(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;ln(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&&rn(),o[e.id]=e,c!==0&&e.path){let t=_n(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(un);return{processedTree:{segmentTree:r,singleCache:an(1e3),matchCache:an(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function yn(e,t,n=!1){let r=e.split(`/`),i=Cn(e,r,t,n);if(!i)return null;let[a]=bn(e,r,i);return{route:i.node.route,rawParams:a}}function bn(e,t,n){let r=Sn(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===on)break;if(u.kind===sn){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length;if(e.charCodeAt(t)===123){let n=u.suffix.length,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix.length,r=u.suffix.length,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function xn(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Sn(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Cn(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!It(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Dn(l,n))continue;if(i.parse){if(!En(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==on&&Dn(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===on||i.kind===2)&&Dn(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(En(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Tn(f,o))return n;Dn(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(_||!(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)))){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+wn(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+wn(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+wn(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+wn(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function wn(e,t){return 2**(e-t-1)}function Tn(e,t){return e===2**(t-1)-1}function En(e,t,n){let r,i;try{[r,i]=bn(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Dn(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===on)>(e.node.kind===on)||t.node.kind===on==(e.node.kind===on)&&t.node.depth>e.node.depth)))}function On(e){return kn(e.filter(e=>e!==void 0).join(`/`))}function kn(e){return e.replace(/\/{2,}/g,`/`)}function An(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function jn(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Mn(e){return jn(An(e))}function Nn(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Pn(e,t,n){return Nn(e,n)===Nn(t,n)}function Fn({base:e,to:t,trailingSlash:n=`never`,cache:r}){if(t.includes(`//`)&&(t=kn(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=kn(e)),o=e.split(`/`);o.length>1&&It(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(It(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?kn(s):s)||`/`;return a&&r&&r.set(a,c),c}function In(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Ln(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>zn(e,n)).join(`/`):zn(r,n):r}function Rn({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=cn(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Ln(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ln(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Ln(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function zn(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Bn(e){return e?.isNotFound===!0}function Vn(){try{return sessionStorage}catch{return}}var Hn=`tsr-scroll-restoration-v1_3`,Un=Vn();function Wn(){try{return JSON.parse(Un?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Gn(){try{Un?.setItem(Hn,JSON.stringify(Kn))}catch{}}var Kn=Wn(),qn=`data-scroll-restoration-id`,Jn=e=>e.state.__TSR_key||e.href;function Yn(e){let t=e.getAttribute(qn);if(t)return`[${qn}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Xn=!1,Zn=`window`;function Qn(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function $n(e){let t=new Set;for(let n of e){if(n===Zn)continue;let e=Qn(n);e&&t.add(e)}return t}function er(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Jn,a=new Set,o=e=>{let t=Kn[e]||={};for(let e of a)e===document?t[Zn]={scrollX,scrollY}:e.isConnected&&(t[Yn(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Xn=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Xn||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Gn()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=Kn[d];if(e){let t=Kn[u];for(let n in e){if(n===Zn){if(s)continue}else{let e=Qn(n);if(!e||s&&o&&(l??=$n(o),l.has(e)))continue}t||=Kn[u]={},t[n]??=e[n]}}}Xn=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=$n(o));let t=e&&i&&c,s=r.restoring?Kn[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Zn){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Qn(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Xn=!1}}))}function tr(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function nr(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function rr(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=nr(r):Array.isArray(t)?t.push(nr(r)):n[e]=[t,nr(r)]}return n}var ir=/^(?:\s|["[{\d-]|fa|nu|tr)/,ar=sr(JSON.parse),or=cr(JSON.stringify,JSON.parse);function sr(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=rr(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function cr(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!ir.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=tr(e,r);return t?`?${t}`:``}}var lr=`__root__`;function ur(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function dr(e){return e instanceof Response&&!!e.options}function fr(e){return{input:({url:t})=>{for(let n of e)t=mr(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=hr(e[n],t);return t}}}function pr(e){let t=Mn(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=On([`/`,t,e.pathname]),e)}}function mr(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function hr(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function gr(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{nn(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var _r=`__TSR_index`,vr=`popstate`,yr=`beforeunload`;function br(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=wr(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[_r];i=xr(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[_r];i=xr(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[_r]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function xr(e,t){t||={};let n=Tr();return{...t,key:n,__TSR_key:n,[_r]:e}}function Sr(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>wr(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Tr();t.history.replaceState({[_r]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=wr(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[_r]-l.state[_r],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=br({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(yr,x,{capture:!0}),t.removeEventListener(vr,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(yr,x,{capture:!0}),t.addEventListener(vr,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function Cr(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function wr(e,t){let n=Cr(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Tr();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[_r]:0,key:a,__TSR_key:a}}}function Tr(){return(Math.random()+1).toString(36).substring(7)}function Er(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Dr(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Or({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function kr(e,t,n,r){for(let i of t){if(r&&e._tx!==r)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r&&e._tx!==r)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var Ar=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=In(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Sr()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=an(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=gr(this.latestLocation,e),er(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=Mn(a);t&&t!==`/`&&e.push(pr({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:fr(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=vn(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&pn(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:en(e).path,external:!1,searchStr:o,search:Ht(t?.search,i),hash:en(r.slice(1)).path,state:Ut(t?.state,a)}}let o=new URL(i,this.origin),s=mr(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:en(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:Ht(t?.search,c),hash:en(s.hash.slice(1)).path,state:Ut(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Fn({base:e,to:t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=gn(jn(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{if(t.href){let e=wr(t.href,{});t={...t,to:mr(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=r[2],o=r[3],s=this.resolvePathWithBase(i,t.to?`${t.to}`:`.`),c=Ir(t.params,o),l=this.routesByPath[jn(s)],u;if(l)u=this.getRouteBranch(l);else if(s.includes(`$`))u=[];else{let[e,t,n]=this.getMatchedRoutes(s);u=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(u=[...u,this.options.notFoundRoute])}if(u.length&&Bt(c))for(let e of u){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){c===o&&(c=Object.assign(Object.create(null),c));try{Object.assign(c,t(c))}catch{}}}let d=e.leaveParams?s:en(Rn({path:s,params:c,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,f=a;if(e._includeValidateSearch&&this.options.search?.strict){let e={};u.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Nr(t.options.validateSearch,{...e,...f}))}catch{}}),f=e}f=Pr(f,t,u,e._includeValidateSearch),f=Ht(a,f);let p=this.options.stringifySearch(f),m=t.hash===!0?n.hash:t.hash?Lt(t.hash,n.hash):void 0,h=m?`#${m}`:``,g=t.state===!0?n.state:t.state?Lt(t.state,n.state):{};t.state&&(g=Ut(n.state,g));let _=`${d}${p}${h}`,v,y,b=!1;if(this.rewrite){let e=new URL(_,this.origin),t=hr(this.rewrite,e);v=e.href.replace(e.origin,``),t.origin===this.origin?y=t.pathname+t.search+t.hash:(y=t.href,b=!0)}else v=tn(_),y=v;return{publicHref:y,href:v,pathname:d,search:f,searchStr:p,state:g,hash:m??``,external:b,unmaskOnReload:t.unmaskOnReload}},n=t(e);if(e.mask)n.maskedLocation=t({from:e.from,...e.mask});else if(this.options.routeMasks){let r=mn(n.pathname,this.processedTree);if(r){let i=Object.assign(Object.create(null),r.rawParams),{from:a,params:o,...s}=r.route,c=Ir(o,i);n.maskedLocation=t({from:e.from,...s,params:c})}}return n},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=jn(this.latestLocation.href)===jn(n.href)&&Jt(Or(n.state),Or(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if($t(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Di(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Dr(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Er(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href){let t=this.buildLocation(e.options).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&$t(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Br,this.preloadRoute=e=>Oi(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=hn(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!Jt(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?Jt(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??or,parseSearch:e.parseSearch??ar,protocolAllowlist:e.protocolAllowlist??Qt}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=xn(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:jn(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Fr(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Nr(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof jr||(r=new jr(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let{interpolatedPath:g,usedParams:_}=Rn({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),v=i.id+g+h,y=u(i,n),b=this._cache.get(v)??(y?.id===v?y:void 0);d=b?._strictParams??Object.assign(_,d);let x;if(!b)try{Lr(i,d)}catch(e){if(x=Bn(e)||dr(e)?e:new Mr(e.message,{cause:e}),t?.throwOnError)throw x}let S=y?`stay`:`enter`,C;if(b)C={...b,cause:S,search:Ht(y?y.search:b.search,l),_strictSearch:f,searchError:p};else{let e=Er(i)?`pending`:`success`;C={id:v,ssr:i.options.ssr,index:n,routeId:i.id,params:y?.params??d,_strictParams:d,pathname:g,updatedAt:Date.now(),search:y?Ht(y.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:x,context:{},abortController:t?._controller??new AbortController,cause:S,loaderDeps:y?Ut(y.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let w=s===i.id;C._notFound&&!w&&(C.error=void 0),C._notFound=w,c[n]=C}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?Ht(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=It(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=It(a),c={...e.search};for(let e of a)try{Object.assign(c,Nr(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{Lr(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},jr=class extends Error{},Mr=class extends Error{};function Nr(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new jr(`Async validation not supported`);if(n.issues)throw new jr(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Pr(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=Nr(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=Lt(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function Fr(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return lr}function Ir(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,Lt(e,n))}function Lr(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Rr(e,t){return e.options[t]?.preload?.()}function zr(e,t){let n=Rr(e,`component`),r=Rr(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Br(e,t,n){let r=()=>t===!1?void 0:t?Rr(e,t):zr(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Vr(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var Hr=0,Ur=1,Wr=2,Gr=3,Kr=[4];function qr(e){return typeof e[0]==`number`}function Jr(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).finally(()=>t.removeEventListener(`abort`,i))})}function Yr(e,t){return e.routesById[t.routeId]}function Xr(e,t,n){return dr(e)?[Gr,e]:Bn(e)?(e.routeId||=n,[Wr,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[Ur,e]):[Hr,e]}function Zr(e,t){let n=Xr(t,!0,e.id);if(n[0]!==Ur)return n;try{e.options.onError?.(n[1])}catch(t){n=Xr(t,!0,e.id)}return n}function Qr(e,t,n,r,i){return i[0].signal.aborted?Kr:mi(e,t,n,Zr(n,r),i)}async function $r(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=Yr(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return ti(e,r),[i,Qr(e,t,u,a,n)]}if(c.aborted)return[i,Kr];let p=r.paramsError??r.searchError;if(p!==void 0)return ti(e,r),[i,Qr(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{ii(e,r,`beforeLoad`,n[0]);let a=await Jr(m({...f,search:r.search,context:r.context,...e.options.additionalContext}),c);if(c.aborted)return[i,Kr];let o=mi(e,t,u,Xr(a,!1,u.id),n);if(o[0]!==Hr)return ti(e,r),[i,o];r.context={...r.context,...a}}catch(a){return ti(e,r),[i,Qr(e,t,u,a,n)]}finally{r.status=h,ii(e,r,!1,n[0])}}i()}function ei(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function ti(e,t){let n=t._flight;t._flight=void 0,ei(e,t,n)?.abort()}function ni(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=ei(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function ri(e){for(let t of e){let e=t._flight;e&&e[2]++}}function ii(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function ai(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function oi(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Kr;if(!i)return[Hr,void 0];let l=n._flight;ii(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(ai(e,t,n,r,s,a,!!o[3]))).then(e=>Xr(e,!1,r.id),e=>Xr(e,!0,r.id)).then(t=>(t[0]!==Hr&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===Ur&&l[2]?Zr(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],mi(e,t,r,await Jr(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return ti(e,n),Kr}finally{ii(e,n,!1,s)}}function si(e,t,n){t[0]!==Gr&&(e.status=`success`,e.error=void 0,t[0]===Hr?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function ci(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&ti(e,r)}function li(e,t){return t[0]===Ur||t[0]===Wr?{...e,status:t[0]===Ur?`error`:`notFound`,error:t[1],_flight:void 0}:e}function ui(e,t,n,r,i,a,o){let s=t[1][n],c=Yr(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(ai(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Kr)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,ti(e,s),p=Qr(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!!(m&&f&&s.status===`success`&&!l&&!a[4]&&((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)!==`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,ei(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=(p?Promise.resolve(p):x?oi(e,t,s,c,g,i,a):Promise.resolve([Hr,s.loaderData])).then(t=>(x&&(si(s,t,l),t[0]===Hr&&(m&&!a[0].signal.aborted&&ci(e,s,u),n>=o&&(s.status=`pending`))),t)),T=Jr(Promise.resolve().then(()=>Br(c,void 0,C)),a[0].signal).then(()=>void 0,r=>t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound))?void 0:[n,Qr(e,t,c,r,a)]).then(e=>w.then(t=>(x&&!e&&t[0]===Hr&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.()),e)));if(r.push([n,w,T]),!y)return w.then(e=>li(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let ee=oi(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,si(E,e,!1),e));return(t[2]??=[]).push([n,ee,T,E]),ee.then(e=>li(E,e))}async function di(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=Yr(e,t[n]);try{let e=Br(i,!1);e&&await Jr(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function fi(e,t){t[2]&&=(ni(e,t[2].map(e=>e[3])),void 0)}async function pi(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Gr)throw[a,t];!i&&t[0]!==Hr&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Gr)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function mi(e,t,n,r,i,a){for(;r[0]===Gr;){let o=r[1],s=o.options;if(s.reloadDocument?i[3]:i[1]>=20)return r;try{return s.href&&s.reloadDocument?(e.resolveRedirect(o),r):[Gr,o,e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0})]}catch(e){r=a?[Ur,e]:Zr(n,e),a=!0}}return r}async function hi(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Wr?di(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Gr)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Hr&&t[0]<Gr&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Gr){let n=s[1];if(n[0]!==Gr||n[1].options.reloadDocument||n[2])return fi(e,t),n;c=!0,s=[0,[Ur,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===Ur?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=Yr(e,u);try{await Jr(i?Promise.resolve().then(()=>Br(m,l===Ur?`errorComponent`:`notFoundComponent`)):Promise.all([Br(m),Br(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return fi(e,t),Kr}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),fi(e,t),ni(e,o),p()):u.status=`success`}return t}async function gi(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=Yr(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await Jr(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function _i(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await di(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||i._notFound||e.preload||a?.id!==e.id||a.status!==`success`||a._notFound)break;l++}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=ui(e,i,t,u,f,r,l)},m=await $r(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Wr){let t=await di(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=Gr&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=hi(e,i,u,r[0],pi(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=pi(i[2],void 0,void 0,h.then(e=>qr(e)?0:Vr(n).length,()=>0))),o=await h}catch(t){if(fi(e,i),t===a&&a.aborted)return Kr;throw t}return qr(o)?o:gi(e,o,a,r[6]===n.length?r[6]:0)}function vi(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=Yr(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>vi(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function yi(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function bi(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Vr(t[3]).some(e=>e.id===n[1]))return;let i;try{await Jr(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function xi(e,t){e._committed=t,e.stores.setMatches(t)}function Si(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=Vr(n).length,s=new Map;{let t=Date.now();for(let r of[...i,...a.values()]){if(r.status!==`success`||n.some((e,t)=>e.id===r.id&&(t<o||e.status===`success`)))continue;let i=Yr(e,r);!i.options.loader||t-r.updatedAt>=(r.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||s.set(r.id,a.get(r.id)===r?r:{...r,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=s,xi(e,n),ni(e,[...a.values(),...i],[...n,...s.values()]),kr(e,i,n,t)}async function Ci(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}function wi(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:i.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function Ti(e,t,n,r,i){let a=n.map(e=>({...e}));ri(a);for(let t of r)ti(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await hi(e,o,r,t[0],i)}catch(t){throw ni(e,a),t}if(qr(s)){ni(e,a),s[0]===Gr&&e._tx===t&&e._committed===n&&await wi(e,t,s);return}if(await gi(e,s,t[0].signal),e._tx!==t||e._committed!==n){ni(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),ti(e,n))}xi(e,a),ni(e,n,a)}async function Ei(e,t,n,r,i,a){let o=await _i(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(qr(o)){let n=o[0]===Gr&&e._tx===t;if((!n||o[1].options.reloadDocument)&&yi(e,t),ni(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){yi(e,t);return}await wi(e,t,o);return}let s=o[1];if(e._tx===t&&await bi(e,t),e._tx!==t){yi(e,t),ni(e,s),fi(e,o);return}let c=t[2],l=Dr(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await bi(e,t),e._tx!==t){yi(e,t),ni(e,s),fi(e,o);return}let n=await e.startTransition(()=>{yi(e,t),Si(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){fi(e,o);return}u?.length&&Ti(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function Di(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Dr(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Ci(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});ri(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){ni(e,m),await Ci(e,n);return}e._preflight=void 0;let g,_=()=>Ei(e,y,f,()=>vi(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_).then(),y=[p,s,a,m,Date.now(),v];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&ii(e,t,!1)}n[0].abort(),ni(e,n[3],y[3],!0)}if(e._tx!==y){ni(e,y[3]),y[3]=[],g?.(),await Ci(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&vi(e,y),g?.(_()),await v,await Ci(e,y)}async function Oi(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),ri(a),o=(e._preloads??=new Map).set(i,a),s=await _i(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),ni(e,a)),i.abort()}if(!qr(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Bn(e)||console.error(e);return}}}var ki=`Error preloading route! ☝️`,Ai=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=lr:this.parentRoute||rn();let r=n?lr:t?.path;r&&r!==`/`&&(r=An(r));let i=t?.id||r,a=n?lr:On([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=On([`/`,a]));let o=a===`__root__`?`/`:On([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=jn(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>ur({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ji=class extends Ai{constructor(e){super(e)}},Mi=class extends f.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?f.createElement(this.props.errorComponent??Ni,{error:e,reset:this.reset}):this.props.children}};function Ni({error:e}){let[t,n]=f.useState(!1);return(0,F.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,F.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,F.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,F.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,F.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,F.jsx)(`div`,{children:(0,F.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,F.jsx)(`code`,{children:e.message}):null})}):null]})}function Pi({children:e,fallback:t=null}){return(0,F.jsx)(f.Fragment,{children:Fi()?e:t})}function Fi(){return f.useSyncExternalStore(Ii,()=>!0,()=>!1)}function Ii(){return()=>{}}var Li=f.createContext(null);function Ri(e){return f.useContext(Li)}var zi=f.createContext(void 0),Bi=f.createContext(void 0),Vi=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Vi||{});function Hi({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Ui(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Wi=[],Gi=0,{link:Ki,unlink:qi,propagate:Ji,checkDirty:Yi,shallowPropagate:Xi}=Hi({update(e){return e._update()},notify(e){Wi[Qi++]=e,e.flags&=~Vi.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Vi.Mutable|Vi.Dirty,na(e))}}),Zi=0,Qi=0,$i,ea=0;function ta(e){try{++ea,e()}finally{--ea||ra()}}function na(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=qi(n,e)}function ra(){if(!(ea>0)){for(;Zi<Qi;){let e=Wi[Zi];Wi[Zi++]=void 0,e.notify()}Zi=0,Qi=0}}function ia(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Vi.None:Vi.Mutable,get(){return $i!==void 0&&Ki(i,$i,Gi),i._snapshot},subscribe(e){let t=Ui(e),n={current:!1},r=aa(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=$i,o=t?.compare??Object.is;if(n)$i=i,++Gi,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Vi.Mutable|Vi.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{$i=a,n&&(i.flags&=~Vi.RecursedCheck),na(i)}}};return n?(i.flags=Vi.Mutable|Vi.Dirty,i.get=function(){let e=i.flags;if(e&Vi.Dirty||e&Vi.Pending&&Yi(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Xi(e)}}else e&Vi.Pending&&(i.flags=e&~Vi.Pending);return $i!==void 0&&Ki(i,$i,Gi),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Ji(e),Xi(e),ra())}},i}function aa(e){let t=()=>{let t=$i;$i=n,++Gi,n.depsTail=void 0,n.flags=Vi.Watching|Vi.RecursedCheck;try{return e()}finally{$i=t,n.flags&=~Vi.RecursedCheck,na(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Vi.Watching|Vi.RecursedCheck,notify(){let e=this.flags;e&Vi.Dirty||e&Vi.Pending&&Yi(this.deps,this)?t():this.flags=Vi.Watching},stop(){this.flags=Vi.None,this.depsTail=void 0,na(this)}};return t(),n}var oa=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),sa=o(((e,t)=>{t.exports=oa()})),ca=o((e=>{var t=d(),n=sa();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),la=o(((e,t)=>{t.exports=ca()}))();function ua(e,t){return e===t}function da(e,t,n=ua){let r=(0,f.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,f.useCallback)(()=>e?.get(),[e]);return(0,la.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var fa={};function pa(e,t){let n=f.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=Ut(n.current,i):i}}function ma(e){let t=Ri(),n=f.useContext(e.from?Bi:zi),r=e.from??n,i=t.stores.getMatchStore(r),a=pa(e,t),o=da(i,e=>e?a(e):fa);if(o!==fa)return o;(e.shouldThrow??!0)&&rn()}function ha(e){return ma({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ga(e){let{select:t,...n}=e;return ma({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function _a(e){return ma({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function va(e){return ma({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ya(e){let t=Ri();return f.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function ba(e){return ma({...e,select:t=>e.select?e.select(t.context):t.context})}function xa(e){let t=f.useRef(e);return Jt(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function Sa(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ca(e,t,n){if(e?.external)return $t(e.href,n)?void 0:e.href;if(!Pa(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),$t(t,n)?void 0:t}catch{}}function wa(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!Pn(e.pathname,t.pathname,r))return!1}else{let n=Nn(e.pathname,r),i=Nn(t.pathname,r);if(!(n.startsWith(i)&&(n.length===i.length||n[i.length]===`/`)))return!1}return(n?.includeSearch??!0)&&!Jt(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function Ta(e,t){let n=Ri(),r=Ft(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:h,viewTransition:g,children:_,target:v,disabled:y,style:b,className:x,onClick:S,onBlur:C,onFocus:w,onMouseEnter:T,onMouseLeave:E,onTouchStart:ee,ignoreBlocker:D,params:O,search:k,hash:A,state:te,mask:j,reloadDocument:M,unsafeRelative:N,from:P,_fromLocation:ne,...re}=e,ie=Fi(),ae=xa(e.search),oe=xa(e.params),se=xa(o),ce=f.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,ae,oe,e.state,e.mask,e.unsafeRelative]),F=f.useCallback(e=>{let t=n.buildLocation({_fromLocation:e,...ce}),r=Na(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,n.history,y),i=Ca(r,s,n.protocolAllowlist);return[r?.href,i,wa(e,t,se,n.basepath,ie,i!==void 0)]},[se,y,ie,ce,n,s]),[le,ue,de]=da(n.stores.location,F,Sa),fe=de?Lt(i,{})??Da:Ea,pe=de?Ea:Lt(a,{})??Ea,me=[x,fe.className,pe.className].filter(Boolean).join(` `),he=(b||fe.style||pe.style)&&{...b,...fe.style,...pe.style},ge=f.useRef(!1),_e=e.reloadDocument||ue||y?!1:c??n.options.defaultPreload,ve=l??n.options.defaultPreloadDelay??0,ye=f.useCallback(()=>{n.preloadRoute(ce).catch(e=>{console.warn(e),console.warn(ki)})},[n,ce]),be=f.useCallback(e=>{if(!e){ja(r);return}if(!(e.isIntersecting??_e===`intent`)){e.isIntersecting===!1&&ja(r);return}if(!ve){ye();return}Aa.has(r)||Aa.set(r,setTimeout(()=>{Aa.delete(r),ye()},ve))},[ye,r,_e,ve]);Pt(r,be,_e!==`viewport`),f.useEffect(()=>{ge.current||_e===`render`&&(ye(),ge.current=!0)},[ye,_e]);let xe=e=>{let t=e.currentTarget.getAttribute(`target`),r=v===void 0?t:v;!y&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0&&(e.preventDefault(),n.navigate({...ce,replace:p,resetScroll:h,hashScrollIntoView:d,startTransition:m,viewTransition:g,ignoreBlocker:D}))};if(ue)return{...re,ref:r,href:ue,..._&&{children:_},...v&&{target:v},...y&&{disabled:y},...b&&{style:b},...x&&{className:x},...S&&{onClick:S},...C&&{onBlur:C},...w&&{onFocus:w},...T&&{onMouseEnter:T},...E&&{onMouseLeave:E},...ee&&{onTouchStart:ee}};let Se=()=>{_e===`intent`&&ye()},Ce=()=>{_e===`intent`&&ja(r)};return{...re,...fe,...pe,href:le,ref:r,onClick:Ma([S,xe]),onBlur:Ma([C,Ce]),onFocus:Ma([w,be]),onMouseEnter:Ma([T,be]),onMouseLeave:Ma([E,Ce]),onTouchStart:Ma([ee,Se]),disabled:!!y,target:v,...he&&{style:he},...me&&{className:me},...y&&Oa,...de&&ka}}var Ea={},Da={className:`active`},Oa={role:`link`,"aria-disabled":!0},ka={"data-status":`active`,"aria-current":`page`},Aa=new WeakMap,ja=e=>{clearTimeout(Aa.get(e)),Aa.delete(e)},Ma=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Na(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Pa(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Fa=f.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Ta(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return f.createElement(`a`,t,o)}return f.createElement(n,a,o)}),Ia=class extends Ai{constructor(e){super(e),this.useMatch=e=>ma({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ba({...e,from:this.id}),this.useSearch=e=>va({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>_a({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ga({...e,from:this.id}),this.useLoaderData=e=>ha({...e,from:this.id}),this.useNavigate=()=>ya({from:this.fullPath}),this.Link=f.forwardRef((e,t)=>(0,F.jsx)(Fa,{ref:t,from:this.fullPath,...e}))}};function La(e){return new Ia(e)}var Ra=class extends ji{constructor(e){super(e),this.useMatch=e=>ma({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ba({...e,from:this.id}),this.useSearch=e=>va({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>_a({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ga({...e,from:this.id}),this.useLoaderData=e=>ha({...e,from:this.id}),this.useNavigate=()=>ya({from:this.fullPath}),this.Link=f.forwardRef((e,t)=>(0,F.jsx)(Fa,{ref:t,from:this.fullPath,...e}))}};function za(e){return new Ra(e)}function Ba(e){let t=Ri(),n=`not-found-${da(t.stores.location,e=>e.pathname)}-${da(t.stores.status,e=>e)}`;return(0,F.jsx)(Mi,{getResetKey:()=>n,onCatch:(t,n)=>{if(Bn(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Bn(t))return e.fallback?.(t);throw t},children:e.children})}function Va(){return(0,F.jsx)(`p`,{children:`Not Found`})}function Ha(e){return(0,F.jsx)(F.Fragment,{children:e.children})}function Ua(e,t,n){return t.options.notFoundComponent?(0,F.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,F.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,F.jsx)(Va,{})}function Wa(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,F.jsx)(n,{}):null}var Ga=(e,t)=>e[0]===t[0]&&e[1]===t[1],Ka=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,qa=f.memo(function({routeId:e}){let t=Ri();return(0,F.jsx)(Ja,{router:t,match:da(t.stores.getMatchStore(e),e=>e)})});function Ja({router:e,match:t}){let n=e.routesById[t.routeId],r=Wa(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=Ka(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?f.Suspense:Ha,l=i?Mi:Ha,u=o?Ba:Ha;return(0,F.jsxs)(n.isRoot?n.options.shellComponent??Ha:Ha,{children:[(0,F.jsx)(zi.Provider,{value:t.routeId,children:(0,F.jsx)(c,{fallback:r,children:(0,F.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Bn(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,F.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return f.createElement(o,e)},children:s?(0,F.jsx)(Pi,{fallback:r,children:(0,F.jsx)(Ya,{match:t})}):(0,F.jsx)(Ya,{match:t})})})})}),null]})}var Ya=f.memo(function({match:e}){let t=Ri(),n=e.routeId,r=t.routesById[n],i=f.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=f.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,F.jsx)(e,{},i):(0,F.jsx)(Xa,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!Ka(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Wa(t,r)}if(e.status===`notFound`)return Ua(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Xa=f.memo(function(){let e=Ri(),t=f.useContext(zi),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=da(a,e=>[!!e._notFound,e.error],Ga),i=da(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Ua(e,e.routesById[t],r);if(!i)return null;let a=(0,F.jsx)(qa,{routeId:i});return t===`__root__`?(0,F.jsx)(f.Suspense,{fallback:Wa(e),children:a}):a});function Za(e,t){let n=e[1];e.length=0,n?.(t)}function Qa({t:e}){let t=Ri(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Za(n,!1),n.push(i,a),e(t),f.startTransition(r)}),Nt(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(jn(r.publicHref)!==jn(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Dr(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function $a(){let e=Ri(),t=e.routesById[lr],n=Wa(e,t),r=e.ssr?Ha:f.Suspense,i=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Qa,{t:f.useState()[1]}),(0,F.jsx)(r,{fallback:n,children:(0,F.jsx)(eo,{})})]});return e.options.InnerWrap?(0,F.jsx)(e.options.InnerWrap,{children:i}):i}function eo(){let e=Ri(),t=e._rendered,n=da(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;Nt(()=>{t[0]===n&&Za(t,!0)},[t,n]);let a=i?(0,F.jsx)(qa,{routeId:i}):null;return(0,F.jsx)(zi.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:(0,F.jsx)(Mi,{getResetKey:()=>r,onCatch:void 0,children:a})})}var to=e=>({createMutableStore:ia,createReadonlyStore:ia,batch:ta}),no=e=>new ro(e),ro=class extends Ar{constructor(e){super(e,to)}};function io({router:e,children:t,...n}){Bt(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,F.jsx)(Li.Provider,{value:e,children:t});return e.options.Wrap?(0,F.jsx)(e.options.Wrap,{children:r}):r}function ao({router:e,...t}){return(0,F.jsx)(io,{router:e,...t,children:(0,F.jsx)($a,{})})}var oo=(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 e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},so={pipe(){return oo(this,arguments)}},co=function(){function e(){}return e.prototype=so,e}(),I=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},lo=e=>e,uo=e=>()=>e,fo=uo(!0),po=uo(!1),mo=uo(null),ho=uo(void 0),go=ho;function _o(e,...t){return oo(e,t)}function vo(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function yo(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),t.set(i,i),i}}var bo=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},xo=new WeakSet;function So(e){return typeof e==`string`}function Co(e){return typeof e==`number`}function wo(e){return typeof e==`boolean`}function To(e){return typeof e==`bigint`}function Eo(e){return typeof e==`symbol`}function Do(e){return So(e)||Co(e)||Eo(e)}function Oo(e){return typeof e==`function`}function ko(e){return e!==void 0}function Ao(e){return e!=null}function jo(e){return!1}function Mo(e){return!0}function No(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Po(e){return typeof e==`object`&&!!e||Oo(e)}var Fo=I(2,(e,t)=>Po(e)&&t in e);function Io(e){return e instanceof Error}function Lo(e){return Fo(e,Symbol.iterator)||So(e)}var Ro=`~effect/interfaces/Hash`,zo=e=>{switch(typeof e){case`number`:return Wo(e);case`bigint`:return Go(e.toString(10));case`boolean`:return Go(String(e));case`symbol`:return Go(String(e));case`string`:return Go(e);case`undefined`:return Go(`undefined`);case`function`:case`object`:if(e===null)return Go(`null`);if(e instanceof Date)return Number.isNaN(e.getTime())?Go(`Invalid Date`):Go(e.toISOString());if(e instanceof RegExp)return Go(e.toString());{if(xo.has(e))return Bo(e);if($o.has(e))return $o.get(e);let t=ts(e,()=>Uo(e)?e[Ro]():typeof e==`function`?Bo(e):e instanceof DataView?Yo(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):Array.isArray(e)||ArrayBuffer.isView(e)?Yo(e):e instanceof Map?Xo(e):e instanceof Set?Zo(e):qo(e));return $o.set(e,t),t}default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},Bo=e=>(Qo.has(e)||Qo.set(e,Wo(Math.floor(Math.random()*(2**53-1)))),Qo.get(e)),Vo=I(2,(e,t)=>e*53^t),Ho=e=>e&3221225471|e>>>1&1073741824,Uo=e=>Fo(e,Ro),Wo=e=>{if(e!==e)return Go(`NaN`);if(e===1/0)return Go(`Infinity`);if(e===-1/0)return Go(`-Infinity`);let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Ho(t)},Go=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Ho(t)},Ko=(e,t)=>{let n=12289;for(let r of t)n^=Vo(zo(r),zo(e[r]));return Ho(n)},qo=e=>Ko(e,bo(e)),Jo=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return Ho(r)},Yo=Jo(6151,zo),Xo=Jo(Go(`Map`),([e,t])=>Vo(zo(e),zo(t))),Zo=Jo(Go(`Set`),zo),Qo=new WeakMap,$o=new WeakMap,es=new WeakSet;function ts(e,t){if(es.has(e))return Go(`[Circular]`);es.add(e);let n=t();return es.delete(e),n}var ns=`~effect/interfaces/Equal`;function rs(){return arguments.length===1?e=>is(e,arguments[0]):is(arguments[0],arguments[1])}function is(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||xo.has(e)||xo.has(t)?!1:ls(e,t,cs):!1}function as(e,t,n){let r=os.has(e),i=ss.has(t);if(r&&i)return!0;if(r||i)return!1;os.add(e),ss.add(t);let a=n();return os.delete(e),ss.delete(t),a}var os=new WeakSet,ss=new WeakSet;function cs(e,t){if(zo(e)!==zo(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=vs(e),r=vs(t);if(n!==r)return!1;let i=n&&r;return typeof e==`function`&&!i?!1:as(e,t,()=>{if(i)return e[ns](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:ds(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;if(!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView)return!1;if(n){let n=t;return fs(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}return fs(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:hs(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:_s(e,t):ps(e,t)})}function ls(e,t,n){let r=us.get(e);if(!r)r=new WeakMap,us.set(e,r);else if(r.has(t))return r.get(t);let i=n(e,t);r.set(t,i);let a=us.get(t);return a||(a=new WeakMap,us.set(t,a)),a.set(e,i),i}var us=new WeakMap;function ds(e,t){for(let n=0;n<e.length;n++)if(!is(e[n],t[n]))return!1;return!0}function fs(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ps(e,t){let n=bo(e),r=bo(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!is(e[i],t[i]))return!1;return!0}function ms(e,t){return function(n,r){let i=Array.from(r);for(let[r,a]of n){let n=!1;for(let o=0;o<i.length;o++){let[s,c]=i[o];if(e(r,s)&&t(a,c)){i[o]=i[i.length-1],i.pop(),n=!0;break}}if(!n)return!1}return!0}}var hs=ms(is,is);function gs(e){return function(t,n){let r=Array.from(n);for(let n of t){let t=!1;for(let i=0;i<r.length;i++){let a=r[i];if(e(n,a)){r[i]=r[r.length-1],r.pop(),t=!0;break}}if(!t)return!1}return!0}}var _s=gs(is),vs=e=>Fo(e,ns),ys=e=>(t,n)=>t===n||e(t,n),bs=(e,t)=>e===t,xs=()=>bs;function Ss(e){return ys((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e[r](t[r],n[r]))return!1;return!0})}function Cs(e){return ys((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})}var ws=e=>e.length>0;function Ts(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function Es(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&Ts(e,n,t[n])}var Ds=Symbol.for(`~effect/Redactable`),Os=e=>Fo(e,Ds);function ks(e){return Os(e)?As(e):e}function As(e){return e[Ds](globalThis[`~effect/Fiber/currentFiber`]?.context??Ns)}var js=`~effect/Fiber/currentFiber`,Ms=new Map,Ns={"~effect/Context":{},base:Ms,depth:0,mapUnsafe:Ms,pipe(){return oo(this,arguments)}};function Ps(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return Fs;r.add(e);let l;if(Ds in e)l=c(As(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
2
+ `+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=Rs(e);else if(!t?.ignoreToString&&Fo(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=zs(e);l=e instanceof Error&&e.cause?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${Is(t)}:${c(e[t],n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${Is(t)}: ${c(e[t],n+1)}`).join(`,
3
+ `)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var Fs=`[Circular]`;function Is(e){return typeof e==`string`?JSON.stringify(e):String(e)}function Ls(e){return e.map(e=>`[${Is(e)}]`).join(``)}function Rs(e){try{return e.toISOString()}catch{return`Invalid Date`}}function zs(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function Bs(e,t){let n=[];return JSON.stringify(e,function(e,t){let r=Object.getOwnPropertyDescriptor(this,e)?.value,i=Fo(r,Ds)?ks(r):ks(t);if(typeof i==`bigint`)return Ps(i);if(typeof i!=`object`||!i)return i;for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(!n.includes(i))return n.push(i),i},t?.space)??`null`}var Vs=Symbol.for(`nodejs.util.inspect.custom`),Hs=e=>{try{return e=ks(e),Fo(e,`toJSON`)&&Oo(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(Hs):e}catch{return`[toJSON threw]`}},Us=(e,t=2)=>{if(typeof e==`string`)return e;try{return typeof e==`object`?Bs(e,{space:t}):Ps(e,{space:t})}catch{return String(e)}},Ws={toJSON(){return Hs(this)},[Vs](){return this.toJSON()},toString(){return Ps(this.toJSON())}},Gs=class e{called=!1;self;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new e(this.self)}},Ks=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),qs=`~effect/Effect`,Js=`~effect/Exit`,Ys={_A:lo,_E:lo,_R:lo},Xs=`${qs}/identifier`,Zs=`${qs}/args`,Qs=`${qs}/evaluate`,$s=`${qs}/successCont`,ec=`${qs}/failureCont`,tc=`${qs}/ensureCont`,nc=Symbol.for(`effect/Effect/Yield`),rc={pipe(){return oo(this,arguments)},toJSON(){return{...this}},toString(){return Ps(this.toJSON(),{ignoreToString:!0,space:2})},[Vs](){return this.toJSON()}},ic={[qs]:Ys,...rc,[Symbol.iterator](){return new Gs(this)},toJSON(){return{_id:`Effect`,op:this[Xs],...Zs in this?{args:this[Zs]}:void 0}}},ac=e=>Fo(e,qs),oc=e=>Fo(e,Js),sc=`~effect/Cause`,cc=`~effect/Cause/Reason`,lc=e=>Fo(e,sc),uc=e=>Fo(e,cc),dc=class{[sc];reasons;constructor(e){this[sc]=sc,this.reasons=e}pipe(){return oo(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${Ps(this.reasons)})`}[Vs](){return this.toJSON()}[ns](e){return lc(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>rs(t,e.reasons[n]))}[Ro](){return Yo(this.reasons)}},fc=new WeakMap,pc=class{[cc];annotations;_tag;constructor(e,t,n){if(this[cc]=cc,this._tag=e,t!==mc&&typeof n==`object`&&n&&t.size>0){let e=fc.get(n);e&&(t=new Map([...e,...t])),fc.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return oo(this,arguments)}toString(){return Ps(this)}[Vs](){return this.toString()}},mc=new Map,hc=class extends pc{error;constructor(e,t=mc){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${Ps(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[ns](e){return Sc(e)&&rs(this.error,e.error)&&rs(this.annotations,e.annotations)}[Ro](){return Vo(Go(this._tag))(Vo(zo(this.error))(zo(this.annotations)))}},gc=e=>new dc(e),_c=new dc([]),vc=e=>new dc([new hc(e)]),yc=class extends pc{defect;constructor(e,t=mc){super(`Die`,t,e),this.defect=e}toString(){return`Die(${Ps(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[ns](e){return Cc(e)&&rs(this.defect,e.defect)&&rs(this.annotations,e.annotations)}[Ro](){return Vo(Go(this._tag))(Vo(zo(this.defect))(zo(this.annotations)))}},bc=e=>new dc([new yc(e)]),xc=I(e=>lc(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new dc(e.reasons.map(e=>e.annotate(t,n)))),Sc=e=>e._tag===`Fail`,Cc=e=>e._tag===`Die`,wc=e=>e._tag===`Interrupt`;function Tc(e){return Pc(`Effect.evaluate: Not implemented`)}var Ec=e=>({...ic,[Xs]:e.op,[Qs]:e[Qs]??Tc,[$s]:e[$s],[ec]:e[ec],[tc]:e[tc]}),Dc=e=>{let t=Ec(e);return function(){let n=Object.create(t);return n[Zs]=e.single===!1?arguments:arguments[0],n}},Oc=e=>{let t={[Js]:Js,_tag:e.op,get[e.prop](){return this[Zs]},...Ec(e),toString(){return`${e.op}(${Ps(this[Zs])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[Zs]}},[ns](e){return oc(e)&&e._tag===this._tag&&rs(this[Zs],e[Zs])},[Ro](){return Vo(Go(e.op),zo(this[Zs]))}};return function(e){let n=Object.create(t);return n[Zs]=e,n}},kc=Oc({op:`Success`,prop:`value`,[Qs](e){let t=e.getCont($s);return t?t[$s](this[Zs],e,this):e.yieldWith(this)}}),Ac={key:`effect/Cause/StackTrace`},jc={key:`effect/Cause/InterruptorStackTrace`},Mc=Oc({op:`Failure`,prop:`cause`,[Qs](e){let t=this[Zs],n=!1;e.currentStackFrame&&(t=xc(t,{mapUnsafe:new Map([[Ac.key,e.currentStackFrame]])}),n=!0);let r=e.getCont(ec);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(ec);return r?r[ec](t,e,n?void 0:this):e.yieldWith(n?Mc(t):this)}}),Nc=e=>Mc(vc(e)),Pc=e=>Mc(bc(e)),Fc=Dc({op:`WithFiber`,[Qs](e){return this[Zs](e)}}),Ic=function(){class e extends globalThis.Error{}let t=Ec({op:`YieldableError`,[Qs](){return Nc(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),Lc=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends Ic{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(Es(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),Rc=e=>{class t extends Lc{_tag=e}return t.prototype.name=e,t};Rc(`NoSuchElementError`);var zc=`~effect/data/Option`,Bc={[zc]:{_A:e=>e},...rc,[Symbol.iterator](){return new Gs(this)}},Vc=Object.defineProperty(Object.assign(Object.create(Bc),{_tag:`Some`,_op:`Some`,[ns](e){return Wc(e)&&Kc(e)&&rs(this.value,e.value)},[Ro](){return Vo(zo(this._tag))(zo(this.value))},toString(){return`some(${Ps(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:Hs(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),Hc=zo(`None`),Uc=Object.assign(Object.create(Bc),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[ns](e){return Wc(e)&&Gc(e)},[Ro](){return Hc},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),Wc=e=>Fo(e,zc),Gc=e=>e._tag===`None`,Kc=e=>e._tag===`Some`,qc=Object.create(Uc),Jc=e=>{let t=Object.create(Vc);return t.value=e,t},Yc=`~effect/data/Result`,Xc={[Yc]:{_A:e=>e,_E:e=>e},...rc,[Symbol.iterator](){return new Gs(this)}},Zc=Object.assign(Object.create(Xc),{_tag:`Success`,_op:`Success`,[ns](e){return $c(e)&&tl(e)&&rs(this.success,e.success)},[Ro](){return Vo(zo(this._tag))(zo(this.success))},toString(){return`success(${Ps(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:Hs(this.success)}}}),Qc=Object.assign(Object.create(Xc),{_tag:`Failure`,_op:`Failure`,[ns](e){return $c(e)&&el(e)&&rs(this.failure,e.failure)},[Ro](){return Vo(zo(this._tag))(zo(this.failure))},toString(){return`failure(${Ps(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:Hs(this.failure)}}}),$c=e=>Fo(e,Yc),el=e=>e._tag===`Failure`,tl=e=>e._tag===`Success`,nl=e=>{let t=Object.create(Qc);return t.failure=e,t},rl=e=>{let t=Object.create(Zc);return t.success=e,t},il=I(2,(e,t)=>Gc(e)?nl(t()):rl(e.value));function al(e){return(t,n)=>t===n?0:e(t,n)}var ol=al((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),sl=I(2,(e,t)=>al((n,r)=>e(t(n),t(r)))),cl=e=>I(2,(t,n)=>e(t,n)===1),ll=e=>I(2,(t,n)=>e(t,n)!==-1),L=()=>qc,ul=Jc,dl=Wc,fl=Gc,R=Kc,pl=I(2,(e,{onNone:t,onSome:n})=>fl(e)?t():n(e.value)),ml=I(2,(e,t)=>fl(e)?t():e.value),hl=e=>{let t=L();for(t of e)if(R(t))return t;return t},gl=e=>e==null?L():ul(e),_l=e=>e===void 0?L():ul(e),vl=e=>e===null?L():ul(e),yl=ml(mo),bl=ml(ho),xl=e=>(...t)=>{try{return ul(e(...t))}catch{return L()}},Sl=I(2,(e,t)=>fl(e)?L():ul(t(e.value))),Cl=I(2,(e,t)=>fl(e)?L():t(e.value)),wl=Cl(lo),Tl=I(2,(e,t)=>fl(e)?L():t(e.value)?ul(e.value):L()),El=e=>ys((t,n)=>fl(t)?fl(n):!fl(n)&&e(t.value,n.value)),Dl=rl,Ol=nl,kl=il,Al=$c,jl=el,Ml=tl,Nl=I(2,(e,t)=>Ml(e)?Dl(t(e.success)):e),Pl=I(2,(e,{onFailure:t,onSuccess:n})=>jl(e)?t(e.failure):n(e.success)),Fl=I(2,(e,t)=>{if(Ml(e))return e.success;throw t(e.failure)})(lo),Il=e=>{if(Symbol.iterator in e){let t=[];for(let n of e){if(jl(n))return n;t.push(n.success)}return Dl(t)}let t={};for(let n of Object.keys(e)){let r=e[n];if(jl(r))return r;Ts(t,n,r.success)}return Dl(t)},Ll=Ss,Rl=I(2,(e,t)=>Object.hasOwn(e,t)),zl=e=>Object.keys(e),Bl=e=>I(2,(t,n)=>{for(let r of zl(t))if(!Rl(n,r)||!e(t[r],n[r]))return!1;return!0}),Vl=e=>{let t=Bl(e);return(e,n)=>t(e,n)&&t(n,e)},Hl=globalThis.Array,Ul=e=>Hl.isArray(e)?e:Hl.from(e),Wl=I(2,(e,t)=>[...e,t]),Gl=I(2,(e,t)=>Ul(e).concat(Ul(t)));Hl.isArray;var Kl=ws,ql=ws,Jl=I(2,(e,t)=>{let n=Hl.from(e);return n.sort(t),n}),Yl=(e,t)=>{let n=zo(t),r=e.get(n);if(r===void 0)return e.set(n,[t]),!0;for(let e of r)if(rs(e,t))return!1;return r.push(t),!0},Xl=I(2,(e,t)=>{let n=Ul(e),r=Ul(t);return ql(n)?ql(r)?eu(Gl(n,r)):n:r}),Zl=()=>[],Ql=I(2,(e,t)=>e.map(t)),$l=Cs,eu=e=>{let t=Ul(e);if(t.length<2)return[...t];let n=new Map,r=[];for(let e of t)Yl(n,e)&&r.push(e);return r},tu=`~effect/BigDecimal`,nu={[tu]:tu,[Ro](){let e=lu(this);return Vo(zo(e.value),Wo(e.scale))},[ns](e){return ru(e)&&pu(this,e)},toString(){return`BigDecimal(${mu(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[Vs](){return this.toJSON()},pipe(){return oo(this,arguments)}},ru=e=>Fo(e,tu),iu=(e,t)=>{let n=Object.create(nu);return n.value=e,n.scale=t,n},au=(e,t)=>{if(e!==ou&&e%su===ou)throw RangeError(`Value must be normalized`);let n=iu(e,t);return n.normalized=n,n},ou=BigInt(0),su=BigInt(10),cu=au(ou,0),lu=e=>{if(e.normalized===void 0){if(e.value===ou)e.normalized=cu;else{let t=`${e.value}`,n=0;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)n++;n===0&&(e.normalized=e),e.normalized=au(BigInt(t.substring(0,t.length-n)),e.scale-n)}}return e.normalized},uu=I(2,(e,t)=>t>e.scale?iu(e.value*su**BigInt(t-e.scale),t):t<e.scale?iu(e.value/su**BigInt(e.scale-t),t):e),du=e=>e.value<ou?iu(-e.value,e.scale):e,fu=ys((e,t)=>e.scale>t.scale?uu(t,e.scale).value===e.value:e.scale<t.scale?uu(e,t.scale).value===t.value:e.value===t.value),pu=I(2,(e,t)=>fu(e,t)),mu=e=>{let t=lu(e);if(Math.abs(t.scale)>=16)return hu(t);let n=t.value<ou,r=n?`${t.value}`.substring(1):`${t.value}`,i,a;if(t.scale>=r.length)i=`0`,a=`0`.repeat(t.scale-r.length)+r;else{let e=r.length-t.scale;if(e>r.length){let t=e-r.length;i=`${r}${`0`.repeat(t)}`,a=``}else a=r.slice(e),i=r.slice(0,e)}let o=a===``?i:`${i}.${a}`;return n?`-${o}`:o},hu=e=>{if(gu(e))return`0e+0`;let t=lu(e),n=`${du(t).value}`,r=n.slice(0,1),i=n.slice(1),a=`${_u(t)?`-`:``}${r}`;i!==``&&(a+=`.${i}`);let o=i.length-t.scale;return`${a}e${o>=0?`+`:``}${o}`},gu=e=>e.value===ou,_u=e=>e.value<ou,vu=e=>Ec({op:e.label,[Qs]:e.evaluate}),yu=`~effect/Context/Service`,bu=function(){function e(){}let t=e;Object.setPrototypeOf(t,xu);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[Cu]=Cu,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&Su.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},xu={[yu]:yu,...vu({label:`Service`,evaluate(e){return kc(Gu(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return Bu(this,e)},use(e){return Fc(t=>e(Gu(t.context,this)))},useSync(e){return Fc(t=>kc(e(Gu(t.context,this))))}},Su=new Set,Cu=`~effect/Context/Reference`,wu=`~effect/Context`,Tu=8,Eu=8,Du=(e,t,n,r)=>{let i=Object.create(Pu);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},Ou=(e,t)=>{t&&(Ou(e,t.parent),e.set(t.key,t.value))},ku=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return Ou(t,e.overlay),e._flat=t},Au=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),Nu(n)},ju=Symbol(),Mu=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?ju:(n.overlay&&++n.baseHits>=Eu&&(n.base=ku(n),n.overlay=void 0,n.depth=0),r)},Nu=e=>Du(void 0,e,void 0,0),Pu={get mapUnsafe(){return ku(this)},...rc,[wu]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[ns](e){if(!Iu(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!rs(r,n.get(e)))return!1;return!0},[Ro](){return Wo(this.mapUnsafe.size)}},Fu=(e,t)=>e.cacheRoot===t.cacheRoot,Iu=e=>Fo(e,wu),Lu=e=>!!e[Cu],Ru=()=>zu,zu=Nu(new Map),Bu=(e,t)=>Nu(new Map([[e.key,t]])),Vu=I(3,(e,t,n)=>Hu(e,t.key,n)),Hu=(e,t,n)=>{let r=e,i=Su.has(t)?void 0:r.cacheRoot;if(r.depth>=Tu){let e=new Map(r.mapUnsafe);return e.set(t,n),Du(i,e,void 0,0)}return Du(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},Uu=(e,t)=>{let n=Mu(e,t);return n===ju?void 0:n},Wu=I(2,(e,t)=>{let n=Mu(e,t.key);if(n===ju){if(Lu(t))return qu(t);throw Ju(t)}return n}),Gu=Wu,Ku=`~effect/Context/defaultValue`,qu=e=>Ku in e?e[Ku]:e[Ku]=e.defaultValue(),Ju=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
4
+ `);e.splice(1,3),t.stack=e.join(`
5
+ `)}return t},Yu=I(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:Au(e,e=>t.mapUnsafe.forEach((t,n)=>e.set(n,t)))),Xu=bu,Zu=`~effect/time/Duration`,Qu=BigInt(0),$u=BigInt(1),ed=BigInt(2),td=BigInt(10),nd=BigInt(1e3),rd=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),id=e=>rd(e*1e6),ad=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=td**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t,s=o/a+(o%a*ed>=a?$u:Qu);return r?-s:s},od=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,sd=e=>{switch(typeof e){case`number`:return yd(e);case`bigint`:return vd(e);case`string`:{if(e===`Infinity`)return gd;if(e===`-Infinity`)return _d;let t=od.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return vd(ad(r,$u));if(i===`micro`||i===`micros`)return vd(ad(r,nd));let a=Number(r);switch(i){case`milli`:case`millis`:return yd(a);case`second`:case`seconds`:return bd(a);case`minute`:case`minutes`:return xd(a);case`hour`:case`hours`:return Sd(a);case`day`:case`days`:return Cd(a);case`week`:case`weeks`:return wd(a)}break}case`object`:{if(e===null)break;if(Zu in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(Co)?cd(e):Number.isNaN(e[0])||Number.isNaN(e[1])?hd:e[0]===-1/0||e[1]===-1/0?_d:e[0]===1/0||e[1]===1/0?gd:pd(rd(e[0]*1e9+e[1]));let t=e,n=0;return t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds?pd(n):pd(rd(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return cd(e)},cd=e=>{throw Error(`Invalid Input: ${e}`)},ld={_tag:`Millis`,millis:0},ud={_tag:`Infinity`},dd={_tag:`NegativeInfinity`},fd={[Zu]:Zu,[Ro](){switch(this.value._tag){case`Millis`:{let e=this.value.millis*1e6;return Number.isFinite(e)?zo(rd(e)):Wo(this.value.millis)}case`Nanos`:return zo(this.value.nanos);default:return qo(this.value)}},[ns](e){return md(e)&&Ad(this,e)},toString(){switch(this.value._tag){case`Infinity`:return`Infinity`;case`NegativeInfinity`:return`-Infinity`;case`Nanos`:return`${this.value.nanos} nanos`;case`Millis`:return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case`Millis`:return{_id:`Duration`,_tag:`Millis`,millis:this.value.millis};case`Nanos`:return{_id:`Duration`,_tag:`Nanos`,nanos:String(this.value.nanos)};case`Infinity`:return{_id:`Duration`,_tag:`Infinity`};case`NegativeInfinity`:return{_id:`Duration`,_tag:`NegativeInfinity`}}},[Vs](){return this.toJSON()},pipe(){return oo(this,arguments)}},pd=e=>{let t=Object.create(fd);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?ld:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:id(e)}:e>0?ud:dd:e===Qu?ld:{_tag:`Nanos`,nanos:e},t},md=e=>Fo(e,Zu),hd=pd(0),gd=pd(1/0),_d=pd(-1/0),vd=e=>pd(e),yd=e=>pd(e),bd=e=>pd(e*1e3),xd=e=>pd(e*6e4),Sd=e=>pd(e*36e5),Cd=e=>pd(e*864e5),wd=e=>pd(e*6048e5),Td=e=>Dd(sd(e),{onMillis:lo,onNanos:e=>Number(e)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),Ed=e=>{let t=sd(e);switch(t.value._tag){case`Infinity`:case`NegativeInfinity`:throw Error(`Cannot convert infinite duration to nanos`);case`Nanos`:return t.value.nanos;case`Millis`:return id(t.value.millis)}},Dd=I(2,(e,t)=>{switch(e.value._tag){case`Millis`:return t.onMillis(e.value.millis);case`Nanos`:return t.onNanos(e.value.nanos);case`Infinity`:return t.onInfinity();case`NegativeInfinity`:return(t.onNegativeInfinity??t.onInfinity)()}}),Od=I(3,(e,t,n)=>e.value._tag===`Infinity`||e.value._tag===`NegativeInfinity`||t.value._tag===`Infinity`||t.value._tag===`NegativeInfinity`?n.onInfinity(e,t):e.value._tag===`Millis`?t.value._tag===`Millis`?n.onMillis(e.value.millis,t.value.millis):n.onNanos(Ed(e),t.value.nanos):n.onNanos(e.value.nanos,Ed(t))),kd=(e,t)=>Od(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),Ad=I(2,(e,t)=>kd(e,t)),jd=e=>t=>{let n=e(t);return jl(n)?L():ul(n.success)},Md=Xu(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new Id}),Nd=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},Pd=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Fd=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},Id=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?Pd:Nd)}shouldYield(e){return e.currentOpCount>=e.maxOpsBeforeYield}makeDispatcher(){return new Ld(this.setImmediate)}},Ld=class{tasks=new Fd;running=void 0;setImmediate;constructor(e=Nd){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},Rd=Xu(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),zd=Xu(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),Bd=class extends co{constructor(e){super(),e&&Es(this,e)}},Vd=Rc,Hd=`~effect/encoding/EncodingError`,Ud=class extends Vd(`EncodingError`){[Hd]=Hd},Wd=e=>{let t=Zd(e),n=t.length;if(n%4!=0)return Ol(new Ud({kind:`Decode`,module:`Base64`,input:t,message:`Length must be a multiple of 4, but is ${n}`}));let r=t.indexOf(`=`);if(r!==-1&&(r<n-2||r===n-2&&t[n-1]!==`=`))return Ol(new Ud({kind:`Decode`,module:`Base64`,input:t,message:`Found a '=' character, but it is not at the end`}));try{let e=t.endsWith(`==`)?2:+!!t.endsWith(`=`),r=new Uint8Array(n/4*3-e);for(let e=0,i=0;e<n;e+=4,i+=3){let n=$d(t.charCodeAt(e))<<18|$d(t.charCodeAt(e+1))<<12|$d(t.charCodeAt(e+2))<<6|$d(t.charCodeAt(e+3));r[i]=n>>16,r[i+1]=n>>8&255,r[i+2]=n&255}return Dl(r)}catch(e){return Ol(new Ud({kind:`Decode`,module:`Base64`,input:t,message:e instanceof Error?e.message:`Invalid input`}))}},Gd=e=>nf(typeof e==`string`?Yd.encode(e):e),Kd=e=>{let t=Zd(e),n=t.length;if(n%4==1)return Ol(new Ud({module:`Base64Url`,kind:`Decode`,input:t,message:`Length should be a multiple of 4, but is ${n}`}));if(!/^[-_A-Z0-9]*?={0,2}$/i.test(t))return Ol(new Ud({module:`Base64Url`,kind:`Decode`,input:t,message:`Invalid input`}));let r=n%4==2?`${t}==`:n%4==3?`${t}=`:t;return r=r.replace(/-/g,`+`).replace(/_/g,`/`),Wd(r)},qd=e=>Nl(Kd(e),e=>Xd.decode(e)),Jd=e=>{let t=``;for(let n=e>>>3;n>0;n--){let e=Math.random()*4294967296>>>0;t+=rf[e>>>24]+rf[e>>>16&255]+rf[e>>>8&255]+rf[e&255]}return t},Yd=new TextEncoder,Xd=new TextDecoder,Zd=e=>e.replace(/[\n\r]/g,``),Qd=e=>{let t=e.length,n=``,r;for(r=2;r<t;r+=3)n+=ef[e[r-2]>>2],n+=ef[(e[r-2]&3)<<4|e[r-1]>>4],n+=ef[(e[r-1]&15)<<2|e[r]>>6],n+=ef[e[r]&63];return r===t+1&&(n+=ef[e[r-2]>>2],n+=ef[(e[r-2]&3)<<4],n+=`==`),r===t&&(n+=ef[e[r-2]>>2],n+=ef[(e[r-2]&3)<<4|e[r-1]>>4],n+=ef[(e[r-1]&15)<<2],n+=`=`),n};function $d(e){if(e>=tf.length)throw TypeError(`Invalid character ${String.fromCharCode(e)}`);let t=tf[e];if(t===255)throw TypeError(`Invalid character ${String.fromCharCode(e)}`);return t}var ef=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``),tf=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],nf=e=>Qd(e).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`),rf=[];for(let e=0;e<256;e++)rf.push(e.toString(16).padStart(2,`0`));var af=`effect/Tracer/ParentSpan`,of=class extends bu()(af,{fiberCached:!0}){},sf=e=>e,cf=Xu(`effect/Tracer/DisablePropagation`,{defaultValue:po}),lf=Xu(`effect/Tracer/CurrentTraceLevel`,{defaultValue:()=>`Info`}),uf=Xu(`effect/Tracer/MinimumTraceLevel`,{defaultValue:()=>`All`}),df=`effect/Tracer`,ff=Xu(df,{fiberCached:!0,defaultValue:()=>sf({span:e=>new pf(e)})}),pf=class{_tag=`Span`;spanId;traceId=`native`;sampled;name;parent;annotations;links;startTime;kind;status;attributes;events=[];constructor(e){this.name=e.name,this.parent=e.parent,this.annotations=e.annotations,this.links=e.links,this.startTime=e.startTime,this.kind=e.kind,this.sampled=e.sampled,this.status={_tag:`Started`,startTime:e.startTime},this.attributes=new Map,this.traceId=bl(e.parent)?.traceId??Jd(32),this.spanId=Jd(16)}end(e,t){this.status={_tag:`Ended`,endTime:e,exit:t,startTime:this.status.startTime}}attribute(e,t){this.attributes.set(e,t)}event(e,t,n){this.events.push([e,t,n??{}])}addLinks(e){this.links.push(...e)}},mf=`effect/observability/Metric/FiberRuntimeMetricsKey`,hf=Xu(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:ho}),gf=Xu(`effect/References/TracerEnabled`,{defaultValue:fo}),_f=Xu(`effect/References/TracerTimingEnabled`,{defaultValue:fo}),vf=Xu(`effect/References/TracerSpanAnnotations`,{defaultValue:()=>({})}),yf=Xu(`effect/References/TracerSpanLinks`,{defaultValue:()=>[]}),bf=Xu(`effect/References/CurrentLogAnnotations`,{defaultValue:()=>({})}),xf=Xu(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Sf=Xu(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Cf=Xu(`effect/References/CurrentLogSpans`,{defaultValue:()=>[]}),wf=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),Tf=()=>Error.stackTraceLimit,Ef=e=>{wf&&(Error.stackTraceLimit=e)},Df=e=>{if(e?.captureStackTrace===!1||e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!=`boolean`)return e;let t=Tf();Ef(3);let n=Error();return Ef(t),{...e,captureStackTrace:kf(()=>n.stack)}},Of=e=>t=>{let n;return()=>{if(n!==void 0)return n;let r=t();if(!r)return;let i=r.split(`
6
+ `);if(i[e]!==void 0)return n=i[e].trim(),n}},kf=Of(3),Af=class extends pc{fiberId;constructor(e,t=mc){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[ns](e){return wc(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[Ro](){return Vo(Go(`${this._tag}:${this.fiberId}`))(Bo(this.annotations))}},jf=e=>new Af(e),Mf=e=>new dc([new Af(e)]),Nf=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return Dl(n.error)}return Ol(e)},Pf=jd(Nf),Ff=e=>{let t=e.reasons.find(Cc);return t?Dl(t.defect):Ol(e)},If=e=>e.reasons.some(wc),Lf=I(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new dc(Xl(e.reasons,t.reasons));return rs(e,n)?e:n}),Rf=I(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>Sc(e)?(n=!0,new hc(t(e.error),e.annotations)):e);return n?gc(r):e}),zf=(e,t)=>{let n=[],r=[];if(e.reasons.length===0)return n;let i=Tf();Ef(1);for(let i of e.reasons){if(i._tag===`Interrupt`){r.push(i);continue}n.push(Bf(i._tag===`Die`?i.defect:i.error,i.annotations,t))}if(n.length===0){let e=Error(`The fiber was interrupted by:`);e.name=`InterruptCause`,e.stack=Gf(e,r);let i=new globalThis.Error(`All fibers interrupted without error`,{cause:e});i.name=`InterruptError`,i.stack=`${i.name}: ${i.message}`,n.push(Bf(i,r[0].annotations,t))}return Ef(i),n},Bf=(e,t,n)=>{let r=typeof e,i;if(e&&r===`object`){if(i=new globalThis.Error(Vf(e),{cause:e.cause?Bf(e.cause):void 0}),typeof e.name==`string`&&(i.name=e.name),typeof e.stack==`string`)i.stack=Uf(e.stack,i,t);else{let e=`${i.name}: ${i.message}`;i.stack=t?Wf(e,t):e}n?.includeCauseInStack&&(i.stack=Jf(i));for(let t of Object.keys(e))t in i||(i[t]=e[t])}else i=new globalThis.Error(e?r===`string`?e:Bs(e):`Unknown error: ${e}`);return i},Vf=e=>{if(typeof e.message==`string`)return e.message;if(typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return Bs(e)},Hf=/\((.*)\)/g,Uf=(e,t,n)=>{let r=`${t.name}: ${t.message}`,i=(e.startsWith(r)?e.slice(r.length):e).split(`
7
+ `),a=[r];for(let e=1;e<i.length&&!/(?:Generator\.next|~effect\/Effect)/.test(i[e]);e++)a.push(i[e]);return n?Wf(a.join(`
8
+ `),n):a.join(`
9
+ `)},Wf=(e,t)=>{let n=t?.get(Ac.key);return n&&(e=`${e}\n${Kf(n)}`),e},Gf=(e,t)=>{let n=[`${e.name}: ${e.message}`];for(let e of t){let t=e.fiberId===void 0?`unknown`:`#${e.fiberId}`,r=e.annotations.get(jc.key);n.push(` at fiber (${t})`),r&&n.push(Kf(r))}return n.join(`
10
+ `)},Kf=e=>{let t=[],n=e,r=0;for(;n&&r<10;){let e=n.stack();if(e){let r=e.matchAll(Hf),i=!1;for(let[,e]of r)i=!0,t.push(` at ${n.name} (${e})`);i||t.push(` at ${n.name} (${e.replace(/^at /,``)})`)}else t.push(` at ${n.name}`);n=n.parent,r++}return t.join(`
11
+ `)},qf=e=>zf(e).map(Jf).join(`
12
+ `),Jf=e=>e.cause?`${e.stack} {\n${Yf(e.cause,` `)}\n}`:e.stack,Yf=(e,t)=>{let n=e.stack.split(`
13
+ `),r=`${t}[cause]: ${n[0]}`;for(let e=1,i=n.length;e<i;e++)r+=`\n${t}${n[e]}`;return e.cause&&(r+=` {\n${Yf(e.cause,`${t} `)}\n${t}}`),r},Xf=`~effect/Fiber`,Zf={_A:lo,_E:lo},Qf={id:0},$f=()=>globalThis[js],ep=class{constructor(e,t=!0){this[Xf]=Zf,this.setContext(e),this.id=++Qf.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this.runtimeMetrics?.recordFiberStart(this.context)}[Xf];id;interruptible;currentOpCount;_stack;_observers;_exit;_children;_interruptedCause;_yielded;_running;_deferredInterrupt;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(e){return Gu(this.context,e)}addObserver(e){return this._exit?(e(this._exit),go):(this._observers.push(e),()=>{if(this._exit)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)})}interruptUnsafe(e,t){if(this._exit)return;let n=Mf(e);this.currentStackFrame&&(n=xc(n,Bu(Ac,this.currentStackFrame))),t&&(n=xc(n,t)),this._interruptedCause=this._interruptedCause?Lf(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(sp(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===nc)return;let n=np.interruptChildren&&np.interruptChildren(this);if(n!==void 0)return this.evaluate(Rp(n,()=>t));this._exit=t,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let e=0;e<this._observers.length;e++)this._observers[e](t);this._observers.length=0,this._stack.length=0,this._children=void 0,this.context=Ru()}runLoop(e){let t=globalThis[js];globalThis[js]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;){if(this._deferredInterrupt&&(this._deferredInterrupt=!1,i=sp(this._interruptedCause)),this.currentOpCount++,!r&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){r=!0;let e=i;i=Rp(dp,()=>e)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[Qs](this),i===nc){let e=this._yielded;if(Js in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return nc}}}catch(e){return Fo(i,Qs)?this.runLoop(Pc(e)):Pc(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[js]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,tp;for(;;){let t=this._stack.pop();if(!t)return;let n=t[tc]&&t[tc](this);if(n)return n[e]=n,n;if(t[e])return t}}yieldWith(e){return this._yielded=e,nc}children(){return this._children??=new Set}pipe(){return oo(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&Fu(t,e))return;let n=this.getRef(Md);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=Uu(e,af),this.currentLogLevel=this.getRef(xf),this.minimumLogLevel=this.getRef(Sf),this.currentStackFrame=this.getRef(hf),this.maxOpsBeforeYield=this.getRef(Rd),this.currentPreventYield=this.getRef(zd),this.runtimeMetrics=Uu(e,mf);let r=Uu(e,df);this.currentTracerContext=r?r.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag===`Span`?this.currentSpan:void 0}},tp={[$s](e,t){return sp(t._interruptedCause)},[ec](e,t){return sp(t._interruptedCause)}},np={interruptChildren:void 0},rp=e=>{if(!e.currentStackFrame)return;let t=new Map;return t.set(jc.key,e.currentStackFrame),Nu(t)},ip=e=>Sp(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(op(r))}return a(),lp(()=>i?.())}),ap=e=>Fc(t=>{let n=rp(t),r=Zl();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return Lp(ip(r))}),op=kc,sp=Mc,cp=Nc,lp=Dc({op:`Sync`,[Qs](e){let t=this[Zs](),n=e.getCont($s);return n?n[$s](t,e):e.yieldWith(kc(t))}}),up=Dc({op:`Suspend`,[Qs](e){return this[Zs]()}}),dp=Dc({op:`Yield`,[Qs](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(qp)},this[Zs]??0),e.yieldWith(()=>{t=!0})}})(0),fp=op(L()),pp=e=>up(()=>sp(Ks(e))),mp=e=>Pc(e),hp=e=>up(()=>cp(Ks(e))),gp=op(void 0),_p=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new Mh(e,`An error occurred in Effect.try`):e.catch;return up(()=>{try{return op(Ks(t))}catch(e){return cp(Ks(()=>n(e)))}})},vp=e=>bp(function(t,n){Ks(()=>e(n)).then(e=>t(op(e)),e=>t(mp(e)))},e.length!==0),yp=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new Mh(e,`An error occurred in Effect.tryPromise`):e.catch;return bp(function(e,r){let i=t=>{try{e(cp(Ks(()=>n(t))))}catch(t){e(mp(t))}};try{Ks(()=>t(r)).then(t=>e(op(t)),i)}catch(e){i(e)}},t.length!==0)},bp=Dc({op:`Async`,single:!1,[Qs](e){let t=Ks(()=>this[Zs][0].bind(e.currentScheduler)),n=!1,r=!1,i=this[Zs][1]?new AbortController:void 0,a=t(t=>{n||(n=!0,r?e.evaluate(t):r=t)},i?.signal);return r===!1?(r=!0,e._yielded=()=>{n=!0},i===void 0&&a===void 0||e._stack.push(xp(()=>(n=!0,i?.abort(),a??qp))),nc):r}}),xp=Dc({op:`AsyncFinalizer`,[tc](e){e.interruptible&&(e.interruptible=!1,e._stack.push(Wm))},[ec](e,t){return If(e)?Rp(this[Zs](),()=>sp(e)):sp(e)}}),Sp=e=>bp(e,e.length>=2),Cp=Sp(go),wp=(...e)=>up(()=>Mp(e.length===1?e[0]():e[1].call(e[0].self))),Tp=(e,...t)=>{let n=t.length===0?function(){return up(()=>Mp(e.apply(this,arguments)))}:function(){let n=up(()=>Mp(e.apply(this,arguments)));for(let e=0;e<t.length;e++)n=t[e](n,...arguments);return n};return Ep(e.length,n)},Ep=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Dp=Of(2),Op=function(){let e=typeof arguments[0]==`string`,t=e?arguments[0]:`Effect.fn`,n=e?arguments[1]:void 0,r=Tf();Ef(2);let i=new globalThis.Error;return Ef(r),e?(r,...a)=>kp(t,r,i,a,e,n):kp(t,arguments[0],i,Array.prototype.slice.call(arguments,1),e,n)},kp=(e,t,n,r,i,a)=>{let o=typeof t==`function`?t:r.shift().bind(t.self);return Ep(o.length,function(...t){let s=up(()=>{let e=o.apply(this,arguments);return ac(e)?e:Mp(e)});for(let e=0;e<r.length;e++)s=r[e](s,...t);if(!ac(s))return s;let c=Tf();Ef(2);let l=new globalThis.Error;return Ef(c),$p(i?ph(e,a,e=>mh(s,e)):s,hf,t=>({name:e,stack:Dp(()=>l.stack),parent:{name:`${e} (definition)`,stack:Dp(()=>n.stack),parent:t}}))})},Ap=(e,...t)=>Ep(e.length,t.length===0?function(){return jp(()=>e.apply(this,arguments))}:function(){let n=jp(()=>e.apply(this,arguments));for(let e of t)n=e(n);return n}),jp=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return op(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return up(()=>n?(n=!1,Rp(r.value,e=>Mp(t,e))):up(()=>Mp(e())))}}}catch(e){return mp(e)}},Mp=Dc({op:`Iterator`,single:!1,[$s](e,t){let n=this[Zs][0];for(;;){let r=n.next(e);if(r.done)return op(r.value);if(!Bp(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[Qs](e){return this[$s](this[Zs][1],e)}}),Np=I(2,(e,t)=>{let n=op(t);return Rp(e,e=>n)}),Pp=e=>Hp(e,ul),Fp=I(2,(e,t)=>Rp(e,e=>ac(t)?t:Ks(()=>t(e)))),Ip=I(2,(e,t)=>Rp(e,e=>Np(ac(t)?t:Ks(()=>t(e)),e))),Lp=e=>Rp(e,e=>qp),Rp=I(2,(e,t)=>{let n=Object.create(zp);return n[Zs]=e,n[$s]=t.length===1?t:e=>t(e),n}),zp=Ec({op:`OnSuccess`,[Qs](e){return e._stack.push(this),this[Zs]}}),Bp=e=>Js in e,Vp=I(2,(e,t)=>Bp(e)?e._tag===`Success`?t(e.value):e:Rp(e,t)),Hp=I(2,(e,t)=>Rp(e,e=>op(Ks(()=>t(e))))),Up=I(2,(e,t)=>Bp(e)?Jp(e,t):Hp(e,t)),Wp=I(2,(e,t)=>Bp(e)?Yp(e,t):mm(e,t)),Gp=I(2,(e,t)=>Bp(e)?Xp(e,t):hm(e,t)),Kp=e=>e._tag===`Success`,qp=kc(void 0),Jp=I(2,(e,t)=>e._tag===`Success`?kc(t(e.value)):e),Yp=I(2,(e,t)=>{if(e._tag===`Success`)return e;let n=Nf(e.cause);return jl(n)?e:Nc(t(n.success))}),Xp=I(2,(e,t)=>{if(e._tag===`Success`)return kc(t.onSuccess(e.value));let n=Nf(e.cause);return jl(n)?e:Nc(t.onFailure(n.success))}),Zp=e=>{let t=[];for(let n of e)n._tag===`Failure`&&t.push(...n.cause.reasons);return t.length===0?qp:Mc(gc(t))},Qp=I(2,(e,t)=>Fc(n=>{let r=n.context,i=t(r);return r===i?e:(n.setContext(i),zm(e,()=>{n.setContext(r)}))})),$p=I(3,(e,t,n)=>Qp(e,e=>{let r=Wu(e,t),i=n(r);return r===i?e:Vu(e,t,i)})),em=()=>tm,tm=Fc(e=>op(e.context)),nm=e=>Fc(t=>e(t.context)),rm=I(2,(e,t)=>Bp(e)?e:Qp(e,Yu(t))),im=function(){return arguments.length===1?I(2,(e,t)=>am(e,arguments[0],t)):I(3,(e,t,n)=>am(e,t,n)).apply(this,arguments)},am=(e,t,n)=>Qp(e,Vu(t,n)),om=I(e=>ac(e[0]),(e,t)=>Xm({while:fo,body:uo(t?.disableYield?e:Rp(e,e=>dp)),step:go})),sm=I(2,(e,t)=>{let n=Object.create(cm);return n[Zs]=e,n[ec]=t.length===1?t:e=>t(e),n}),cm=Ec({op:`OnFailure`,[Qs](e){return e._stack.push(this),this[Zs]}}),lm=I(3,(e,t,n)=>sm(e,e=>{let r=t(e);return jl(r)?sp(r.failure):Ks(()=>n(r.success,e))})),um=I(2,(e,t)=>lm(e,Nf,e=>t(e))),dm=I(2,(e,t)=>lm(e,Ff,t)),fm=I(e=>ac(e[0]),(e,t,n,r)=>sm(e,e=>{let i=Nf(e);if(jl(i))return sp(i.failure);let a=t(i.success);return jl(a)?r?Ks(()=>r(a.failure)):sp(e):Ks(()=>n(a.success))})),pm=I(e=>ac(e[0]),(e,t,n)=>{let r;return fm(e,e=>(r??=Object.keys(t),Fo(e,`_tag`)&&So(e._tag)&&r.includes(e._tag)?Dl(e):Ol(e)),e=>Ks(()=>t[e._tag](e)),n)}),mm=I(2,(e,t)=>um(e,e=>hp(()=>t(e)))),hm=I(2,(e,t)=>bm(e,{onFailure:e=>hp(()=>t.onFailure(e)),onSuccess:e=>lp(()=>t.onSuccess(e))})),gm=e=>um(e,mp),_m=e=>Sm(e,{onFailure:Ol,onSuccess:Dl}),vm=I(2,(e,t)=>{let n=Object.create(ym);return n[Zs]=e,n[$s]=t.onSuccess.length===1?t.onSuccess:e=>t.onSuccess(e),n[ec]=t.onFailure.length===1?t.onFailure:e=>t.onFailure(e),n}),ym=Ec({op:`OnSuccessAndFailure`,[Qs](e){return e._stack.push(this),this[Zs]}}),bm=I(2,(e,t)=>vm(e,{onFailure:e=>{let n=e.reasons.find(Sc);return n?Ks(()=>t.onFailure(n.error)):sp(e)},onSuccess:t.onSuccess})),xm=I(2,(e,t)=>bm(e,{onFailure:e=>lp(()=>t.onFailure(e)),onSuccess:e=>lp(()=>t.onSuccess(e))})),Sm=I(2,(e,t)=>{if(Bp(e)){if(e._tag===`Success`)return kc(t.onSuccess(e.value));let n=Nf(e.cause);return jl(n)?e:kc(t.onFailure(n.success))}return xm(e,t)}),Cm=e=>Bp(e)?kc(e):wm(e),wm=Dc({op:`Exit`,[Qs](e){return e._stack.push(this),this[Zs]},[$s](e,t,n){return op(n??kc(e))},[ec](e,t,n){return op(n??Mc(e))}}),Tm=`~effect/Scope`,Em=`~effect/Scope/Closeable`,Dm=bu(`effect/Scope`),Om=(e,t)=>up(()=>km(e,t)??gp),km=(e,t)=>{if(e.state._tag===`Closed`)return;let n={_tag:`Closed`,exit:t};if(e.state._tag===`Empty`){e.state=n;return}let{finalizers:r}=e.state;if(e.state=n,r.size!==0)return r.size===1?r.values().next().value(t):jm(e,r,t)},Am=(e,t)=>Kp(e)?t:sm(t,t=>sp(Lf(e.cause,t))),jm=Tp(function*(e,t,n){let r=[],i=[],a=Array.from(t.values()),o=$f();for(let t=a.length-1;t>=0;t--){let s=a[t];e.strategy===`sequential`?r.push(yield*Cm(s(n))):i.push(th(o,s(n),!0,!0,`inherit`))}return i.length>0&&(r=yield*ip(i)),yield*Zp(r)}),Mm=(e,t)=>{let n=Im(t);if(e.state._tag===`Closed`)return n.state=e.state,n;let r={};return Pm(e,r,e=>Om(n,e)),Pm(n,r,t=>lp(()=>Fm(e,r))),n},Nm=(e,t)=>up(()=>e.state._tag===`Closed`?t(e.state.exit):(Pm(e,{},t),gp)),Pm=(e,t,n)=>{e.state._tag===`Empty`?e.state={_tag:`Open`,finalizers:new Map([[t,n]])}:e.state._tag===`Open`&&e.state.finalizers.set(t,n)},Fm=(e,t)=>{e.state._tag===`Open`&&e.state.finalizers.delete(t)},Im=(e=`sequential`)=>({[Em]:Em,[Tm]:Tm,strategy:e,state:Lm}),Lm={_tag:`Empty`},Rm=im(Dm),zm=Dc({op:`OnExit`,single:!1,[Qs](e){return e._stack.push(this),this[Zs][0]},[tc](e){e.interruptible&&this[Zs][2]!==!0&&(e._stack.push(Wm),e.interruptible=!1)},[$s](e,t,n){n??=kc(e);let r=this[Zs][1](n);return r?Rp(r,e=>n):n},[ec](e,t,n){n??=Mc(e);let r=this[Zs][1](n);return r?Rp(Am(n,r),e=>n):n}}),Bm=I(2,zm),Vm=I(2,(e,t)=>Bm(e,e=>t)),Hm=e=>Fc(t=>t.interruptible?(t.interruptible=!1,t._stack.push(Wm),e):e),Um=Dc({op:`SetInterruptible`,[tc](e){if(e.interruptible=this[Zs],e._interruptedCause&&e.interruptible)return()=>sp(e._interruptedCause)}}),Wm=Um(!0),Gm=Um(!1),Km=e=>{if(e.interruptible=!0,e._stack.push(Gm),e._interruptedCause)return sp(e._interruptedCause)},qm=e=>Fc(t=>t.interruptible?e:Km(t)??e),Jm=e=>Fc(t=>t.interruptible?(t.interruptible=!1,t._stack.push(Wm),e(qm)):e(lo)),Ym=(e,t)=>Lo(e)?t?.mode===`result`?Zm(e,_m,t):Zm(e,lo,t):t?.discard?t.mode===`result`?Zm(Object.values(e),_m,t):Zm(Object.values(e),lo,t):up(()=>{let n={};return Np(Zm(Object.entries(e),([e,r])=>Hp(t?.mode===`result`?_m(r):r,t=>{Ts(n,e,t)}),{discard:!0,concurrency:t?.concurrency}),n)}),Xm=Dc({op:`While`,[$s](e,t){return this[Zs].step(e),this[Zs].while()?(t._stack.push(this),this[Zs].body()):qp},[Qs](e){return this[Zs].while()?(e._stack.push(this),this[Zs].body()):qp}}),Zm=I(e=>typeof e[1]==`function`,(e,t,n)=>up(()=>{let r=n?.concurrency??1,i=r===`unbounded`?1/0:Math.max(1,r);if(i===1)return Qm(e,t,n);let a=Ul(e),o=a.length;if(o===0)return n?.discard?gp:op([]);let s=n?.discard?void 0:Array(o),c=eee({f:t,out:s},a,{concurrency:i});return c?Np(c,s):op(s)})),Qm=(e,t,n)=>up(()=>{let r=n?.discard?void 0:[],i=e[Symbol.iterator](),a=i.next(),o=0;return Np(Xm({while:()=>!a.done,body:()=>t(a.value,o++),step:e=>{r&&r.push(e),a=i.next()}}),r)}),$m=e=>{let t=e.onItem,n=e.step,r=(e,i,a,o)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!Bp(c))return Rp(Cm(c),t=>n(e,s,t,a)??r(e,i,a+1,o)??gp);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return(e,i,a)=>{let o=0,s=a?.end??i.length,c=a?.concurrency??1;if(c===1)return r(e,i,0,s);let l=a?.orderedStep===!0&&c>1,u=!1,d,f,p,m=!1,h,g,_=o,v=l?Array(s):void 0,y=e=>{let t=Pc(e);return h=t,u=!0,m=!0,f&&f.size>0?Rp(Hm(ap(Array.from(f))),()=>t):t},b=(t,r,a)=>{if(!l)return n(e,t,r,a);if(h)return h;for(v[a]=r;_<s;){let t=v[_];if(t===void 0)return;v[_]=void 0;let r=_++,a=n(e,i[r],t,r);if(a)return a}},x=()=>{let n=!1;for(;!h&&o<s;o++){let r=i[o],a=g??t(e,r,o);if(Bp(a)){if(h=b(r,a,o),h)break}else if(d){g=void 0;let e=th(d,a,!0,!0,`inherit`);if(e._exit){if(h=b(r,e._exit,o),h)break;continue}f.add(e);let t=o;if(e.addObserver(i=>{f.delete(e);try{if(h){if(!m&&i._tag===`Failure`)for(let e of i.cause.reasons)if(e._tag===`Interrupt`)continue;else h._tag===`Failure`?h.cause.reasons.push(e):h=Mc(gc([e]))}else{let e=b(r,i,t);e&&(h=e._tag===`Failure`?Mc(gc(e.cause.reasons.slice())):e,x())}if(n){let e=x();e&&p(e)}else u&&f.size===0&&p(h??gp)}catch(e){p(y(e))}}),f.size<c)continue;n=!0,o++;return}else return Sp(e=>{d=$f(),f=new Set,g=a,p=e;let t;try{t=x()}catch(t){return e(y(t))}return t?e(t):up(()=>(h=qp,m=!0,f?ap(f):gp))})}if(u=!0,h){if(f&&f.size>0){let e=rp(d);f.forEach(t=>t.interruptUnsafe(d.id,e));return}if(p||h._tag===`Failure`)return h}else if(p){if(f)f.size===0&&p(gp);else return qp}};return x()}},eh=()=>$m,eee=$m({onItem(e,t,n){return e.f(t,n)},step(e,t,n,r){if(n._tag===`Failure`)return n;e.out&&(e.out[r]=n.value)}}),th=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new ep(a.context,o);return n?s.evaluate(t):a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0),!r&&!s._exit&&(a.children().add(s),s.addObserver(()=>a._children.delete(s))),s},nh=e=>(t,n)=>{let r=new ep(n?.scheduler?Vu(e,Md,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},rh=nh(Ru()),ih=(e=>{let t=nh(e);return(e,n)=>{let r=t(e,n);return new Promise(e=>{r.addObserver(t=>e(t))})}})(Ru()),ah=(e=>{let t=nh(e);return e=>{if(Bp(e))return e;let n=new Id(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??Pc(new Ah(r))}})(Ru()),oh=BigInt(0),sh={_tag:`Span`,spanId:`noop`,traceId:`noop`,sampled:!1,status:{_tag:`Ended`,startTime:oh,endTime:oh,exit:qp},attributes:new Map,links:[],kind:`internal`,attribute(){},event(){},end(){},addLinks(){}},ch=e=>Object.assign(Object.create(sh),e),lh=e=>e?Gu(e.annotations,cf)?e._tag===`Span`?lh(bl(e.parent)):L():ul(e):L(),uh=(e,t,n)=>{let r=!e.getRef(gf)||n?.annotations&&Gu(n.annotations,cf),i=n?.parent===void 0?n?.root?L():lh(e.currentSpan):ul(n.parent),a;if(r)a=ch({name:t,parent:i,annotations:Vu(n?.annotations??Ru(),cf,!0)});else{let r=e.getRef(ff),o=e.getRef(vh),s=e.getRef(_f),c=e.getRef(vf),l=e.getRef(yf),u=n?.level??e.getRef(lf),d=n?.links===void 0?l.length===0?[]:l.slice():[...l,...n.links];a=r.span({name:t,parent:i,annotations:n?.annotations??Ru(),links:d,startTime:s?o.currentTimeNanosUnsafe():BigInt(0),kind:n?.kind??`internal`,root:n?.root??fl(i),sampled:n?.sampled??(R(i)&&i.value.sampled===!1?!1:!Ph(e.getRef(uf),u))});for(let e in c)a.attribute(e,c[e]);if(n?.attributes!==void 0)for(let e in n.attributes)a.attribute(e,n.attributes[e])}return a},dh=(e,t)=>(t=typeof t==`function`?t:ho,$p(hf,n=>({name:e,stack:t,parent:n}))),fh=(e,t,n,r)=>lp(()=>{e.status._tag!==`Ended`&&e.end(r?n.currentTimeNanosUnsafe():oh,t)}),ph=(e,...t)=>{let n=t.length===1?void 0:t[0],r=t[t.length-1];return Fc(t=>{let i=uh(t,e,n),a=t.getRef(vh),o=t.getRef(_f);return Bm(Ks(()=>r(i)),e=>fh(i,e,a,o))})},mh=im(of),hh=function(){let e=ac(arguments[0]),t=e?arguments[1]:arguments[0],n=e?arguments[2]:arguments[1],r=lo;return t._tag===`Span`&&(n=Df(n),r=dh(t.name,n?.captureStackTrace)),e?mh(r(arguments[0]),t):e=>mh(r(e),t)},gh=function(){let e=typeof arguments[0]!=`string`,t=e?arguments[1]:arguments[0],n=Df(arguments[2]);if(e){let e=arguments[0];return ph(t,arguments[2],t=>hh(e,t,n))}let r=typeof arguments[1]==`function`?arguments[1]:void 0,i=r?void 0:arguments[1];return(e,...a)=>ph(t,r?r(...a):i,t=>hh(e,t,n))},_h=(...e)=>Fc(t=>{let n=t.currentSpanLocal;if(n){if(e.length===1)for(let[t,r]of Object.entries(e[0]))n.attribute(t,r);else n.attribute(e[0],e[1])}return gp}),vh=Xu(`effect/Clock`,{defaultValue:()=>new bh}),yh=2**31-1,bh=class{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=lp(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return Ch()}currentTimeNanos=lp(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return Sh()}monotonicTimeNanos=lp(()=>this.monotonicTimeNanosUnsafe());sleep(e){return this.sleepMillis(Td(e))}sleepMillis(e){return e<=0?dp:Number.isFinite(e)?Sp(t=>{let n=e>yh?this.sleepMillis(e-yh):gp,r=setTimeout(()=>t(n),Math.min(e,yh));return lp(()=>clearTimeout(r))}):Cp}},xh=BigInt(1e6),Sh=function(){let e=globalThis.process?.hrtime;if(typeof e?.bigint==`function`)return()=>e.bigint();if(typeof performance<`u`&&typeof performance.now==`function`)return()=>BigInt(Math.round(performance.now()*1e6));let t=BigInt(0);return()=>{let e=BigInt(Date.now())*xh;return e>t&&(t=e),t}}(),Ch=function(){let e=BigInt(1e9),t;return()=>{let n=Sh(),r=BigInt(Date.now())*xh;if(t===void 0)t=r-n;else{let i=t+n;(r>i?r-i:i-r)>e&&(t=r-n)}return t+n}}(),wh=e=>Fc(t=>e(t.getRef(vh))),Th=e=>wh(t=>t.sleep(sd(e))),Eh=wh(e=>e.currentTimeMillis);Rc(`TimeoutError`);var Dh=`~effect/Cause/IllegalArgumentError`,Oh=class extends Rc(`IllegalArgumentError`){[Dh]=Dh;constructor(e){super({message:e})}};Rc(`ExceededCapacityError`);var kh=`~effect/Cause/AsyncFiberError`,Ah=class extends Rc(`AsyncFiberError`){[kh]=kh;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},jh=`~effect/Cause/UnknownError`,Mh=class extends Rc(`UnknownError`){[jh]=jh;constructor(e,t){super({message:t,cause:e})}},Nh=Xu(`effect/Console/CurrentConsole`,{defaultValue:()=>globalThis.console}),Ph=cl(sl(ol,e=>{switch(e){case`All`:return-(2**53-1);case`Fatal`:return 5e4;case`Error`:return 4e4;case`Warn`:return 3e4;case`Info`:return 2e4;case`Debug`:return 1e4;case`Trace`:return 0;case`None`:return 2**53-1}})),Fh=Xu(`effect/Loggers/CurrentLoggers`,{defaultValue:()=>new Set([Wh,Gh])}),Ih=Xu(`effect/Logger/LogToStderr`,{defaultValue:po}),Lh={"~effect/Logger":{_Message:lo,_Output:lo},pipe(){return oo(this,arguments)}},Rh=e=>{let t=Object.create(Lh);return t.log=e,t},zh=e=>e.replace(/[\s="]/g,`_`),Bh=(e,t)=>`${zh(e[0])}=${t-e[1]}ms`,Vh=e=>(...t)=>{let n;for(let e=0,r=t.length;e<r;e++){let r=t[e];lc(r)&&(n?t.splice(e,1):t=t.slice(0,e).concat(t.slice(e+1)),n=n?gc(n.reasons.concat(r.reasons)):r,e--)}return n===void 0&&(n=_c),Fc(r=>{let i=e??r.currentLogLevel;if(Ph(r.minimumLogLevel,i))return gp;let a=r.getRef(vh),o=r.getRef(Fh);if(o.size>0){let e=new Date(a.currentTimeMillisUnsafe());for(let a of o)a.log({cause:n,fiber:r,date:e,logLevel:i,message:t})}return gp})},Hh={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Hh.gray,Hh.blue,Hh.green,Hh.yellow,Hh.red,Hh.bgBrightRed,Hh.black;var Uh=e=>`${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}:${e.getSeconds().toString().padStart(2,`0`)}.${e.getMilliseconds().toString().padStart(3,`0`)}`,Wh=Rh(({cause:e,date:t,fiber:n,logLevel:r,message:i})=>{let a=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&a.push(qf(e));let o=t.getTime(),s=n.getRef(Cf),c=``;for(let e of s)c+=` ${Bh(e,o)}`;let l=n.getRef(bf);Object.keys(l).length>0&&a.push(l);let u=n.getRef(Nh);(n.getRef(Ih)?u.error:u.log)(`[${Uh(t)}] ${r.toUpperCase()} (#${n.id})${c}:`,...a)}),Gh=Rh(({cause:e,fiber:t,logLevel:n,message:r})=>{let i=t.getRef(vh),a=t.getRef(bf),o=t.currentSpan;if(o===void 0||o._tag===`ExternalSpan`)return;let s={};for(let[e,t]of Object.entries(a))Ts(s,e,t);s[`effect.fiberId`]=t.id,s[`effect.logLevel`]=n.toUpperCase(),e.reasons.length>0&&(s[`effect.cause`]=qf(e)),o.event(Us(Array.isArray(r)&&r.length===1?r[0]:r),i.currentTimeNanosUnsafe(),s)}),Kh=lc,qh=uc,Jh=Sc,Yh=gc,Xh=_c,Zh=e=>new hc(e),Qh=e=>new yc(e),$h=jf,eg=Rf,tee=Lf,nee=Pf,ree=qf,tg=Oh;bu()(`effect/Cause/StackTrace`),bu()(`effect/Cause/InterruptorStackTrace`);var ng=oc,rg=kc,ig=Mc,ag=Nc,og=qp,sg=Kp,cg=Rm,lg=Nm,ug=Mm,dg=Om,fg={"~effect/Layer":{_ROut:lo,_E:lo,_RIn:lo},pipe(){return oo(this,arguments)}},pg=e=>{let t=Object.create(fg);return t.build=e,t},mg=e=>pg((t,n)=>{let r=ug(n);return Bm(e(t,r),e=>e._tag===`Failure`?dg(r,e):gp)}),hg=e=>{let t=mg((n,r)=>n.getOrElseMemoize(t,r,e));return t};bu()(`effect/Layer/CurrentMemoMap`);var gg=function(){return arguments.length===1?e=>_g(Bu(arguments[0],e)):_g(Bu(arguments[0],arguments[1]))},_g=e=>pg(uo(op(e))),vg=function(){return arguments.length===1?e=>yg(arguments[0],e):yg(arguments[0],arguments[1])},yg=(e,t)=>bg(Hp(t,t=>Bu(e,t))),bg=e=>hg((t,n)=>cg(e,n)),xg=e=>bg(Np(e,Ru())),Sg=Eh,Cg=`~effect/time/DateTime`,wg=`~effect/time/DateTime/TimeZone`,Tg={[Cg]:Cg,pipe(){return oo(this,arguments)},[Vs](){return this.toString()},toJSON(){return o_(this).toJSON()}},Eg={...Tg,_tag:`Utc`,[Ro](){return Wo(this.epochMilliseconds)},[ns](e){return Mg(e)&&e._tag===`Utc`&&this.epochMilliseconds===e.epochMilliseconds},toString(){return`DateTime.Utc(${o_(this).toJSON()})`}},Dg={...Tg,_tag:`Zoned`,[Ro](){return Vo(Wo(this.epochMilliseconds))(zo(this.zone))},[ns](e){return Mg(e)&&e._tag===`Zoned`&&this.epochMilliseconds===e.epochMilliseconds&&rs(this.zone,e.zone)},toString(){return`DateTime.Zoned(${E_(this)})`}},Og={[wg]:wg,[Vs](){return this.toString()}},kg={...Og,_tag:`Named`,[Ro](){return Go(`Named:${this.id}`)},[ns](e){return Pg(e)&&e._tag===`Named`&&this.id===e.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:`TimeZone`,_tag:`Named`,id:this.id}}},Ag={...Og,_tag:`Offset`,[Ro](){return Go(`Offset:${this.offset}`)},[ns](e){return Pg(e)&&e._tag===`Offset`&&this.offset===e.offset},toString(){return`TimeZone.Offset(${l_(this.offset)})`},toJSON(){return{_id:`TimeZone`,_tag:`Offset`,offset:this.offset}}},jg=(e,t,n)=>{let r=Object.create(Dg);return r.epochMilliseconds=e,r.zone=t,Object.defineProperty(r,"partsUtc",{value:n,enumerable:!1,writable:!0}),Object.defineProperty(r,"adjustedEpochMillis",{value:void 0,enumerable:!1,writable:!0}),Object.defineProperty(r,"partsAdjusted",{value:void 0,enumerable:!1,writable:!0}),r},Mg=e=>Fo(e,Cg),Ng=e=>Mg(e[0]),Pg=e=>Fo(e,wg),Fg=e=>Pg(e)&&e._tag===`Named`,Ig=e=>e._tag===`Utc`,Lg=e=>e._tag===`Zoned`,Rg=ys((e,t)=>e.epochMilliseconds===t.epochMilliseconds),zg=al((e,t)=>e.epochMilliseconds<t.epochMilliseconds?-1:+(e.epochMilliseconds>t.epochMilliseconds)),Bg=e=>{let t=Object.create(Eg);return t.epochMilliseconds=e,Object.defineProperty(t,"partsUtc",{value:void 0,enumerable:!1,writable:!0}),t},Vg=e=>{let t=e.getTime();if(Number.isNaN(t))throw new tg(`Invalid date`);return Bg(t)},Hg=e=>{if(Mg(e))return e;if(e instanceof Date)return Vg(e);if(typeof e==`object`){if(`epochMilliseconds`in e)return Vg(new Date(e.epochMilliseconds));let t=new Date(0);return h_(t,e),Vg(t)}return typeof e==`string`&&!Ug(e)?Vg(new Date(e+`Z`)):Vg(new Date(e))},Ug=e=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(e),Wg=-864e13+432e5,Gg=864e13-504e5,Kg=(e,t)=>{let n=t?.timeZone;if(n===void 0&&Mg(e)&&Lg(e))return e;let r=Hg(e);if(r.epochMilliseconds<Wg||r.epochMilliseconds>Gg)throw RangeError(`Epoch millis out of range: ${r.epochMilliseconds}`);n===void 0&&typeof e==`object`&&`timeZoneId`in e&&(n=e.timeZoneId);let i;if(n===void 0)i=t_(new Date(r.epochMilliseconds).getTimezoneOffset()*-60*1e3);else if(Pg(n))i=n;else if(typeof n==`number`)i=t_(n);else{let e=i_(n);if(fl(e))throw new tg(`Invalid time zone: ${n}`);i=e.value}return t?.adjustForTimeZone===!0?__(r.epochMilliseconds,i,t?.disambiguation??`compatible`):jg(r.epochMilliseconds,i,r.partsUtc)},qg=xl(Hg),Jg=Hp(Sg,Bg),Yg=e=>Bg(e.epochMilliseconds),Xg=I(Ng,(e,t,n)=>n?.adjustForTimeZone===!0?__(e.epochMilliseconds,t,n?.disambiguation??`compatible`):jg(e.epochMilliseconds,t,e.partsUtc)),Zg=new Map,Qg={day:`numeric`,month:`numeric`,year:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`longOffset`,fractionalSecondDigits:3,hourCycle:`h23`},$g=e=>{let t=e.resolvedOptions().timeZone;if(Zg.has(t))return Zg.get(t);let n=Object.create(kg);return n.id=t,n.format=e,Zg.set(t,n),n},e_=e=>{if(Zg.has(e))return Zg.get(e);try{return $g(new Intl.DateTimeFormat(`en-US`,{...Qg,timeZone:e}))}catch{throw new tg(`Invalid time zone: ${e}`)}},t_=e=>{let t=Object.create(Ag);return t.offset=e,t},n_=xl(e_),r_=/^(?:GMT|[+-])/,i_=e=>{if(r_.test(e)){let t=y_(e);return t===null?L():ul(t_(t))}return n_(e)},a_=I(Ng,(e,t,n)=>Sl(n_(t),t=>Xg(e,t,n))),o_=e=>new Date(e.epochMilliseconds),s_=e=>{if(e._tag===`Utc`)return new Date(e.epochMilliseconds);if(e.zone._tag===`Offset`)return new Date(e.epochMilliseconds+e.zone.offset);if(e.adjustedEpochMilliseconds!==void 0)return new Date(e.adjustedEpochMilliseconds);let t=e.zone.format.formatToParts(e.epochMilliseconds).filter(e=>e.type!==`literal`),n=new Date(0);return n.setUTCFullYear(Number(t[2].value),Number(t[0].value)-1,Number(t[1].value)),n.setUTCHours(Number(t[3].value),Number(t[4].value),Number(t[5].value),Number(t[6].value)),e.adjustedEpochMilliseconds=n.getTime(),n},c_=e=>s_(e).getTime()-d_(e),l_=e=>{let t=Math.abs(e),n=Math.floor(t/36e5),r=Math.round(t%36e5/6e4);return r===60&&(n+=1,r=0),`${e<0?`-`:`+`}${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`},u_=e=>l_(c_(e)),d_=e=>e.epochMilliseconds,f_=e=>({millisecond:e.getUTCMilliseconds(),second:e.getUTCSeconds(),minute:e.getUTCMinutes(),hour:e.getUTCHours(),day:e.getUTCDate(),weekDay:e.getUTCDay(),month:e.getUTCMonth()+1,year:e.getUTCFullYear()}),p_=e=>e._tag===`Utc`?m_(e):(e.partsAdjusted===void 0&&(e.partsAdjusted=S_(e,f_)),e.partsAdjusted),m_=e=>(e.partsUtc===void 0&&(e.partsUtc=C_(e,f_)),e.partsUtc),h_=(e,t)=>{if(t.year!==void 0&&e.setUTCFullYear(t.year),t.month!==void 0&&e.setUTCMonth(t.month-1),t.day!==void 0&&e.setUTCDate(t.day),t.weekDay!==void 0){let n=t.weekDay-e.getUTCDay();e.setUTCDate(e.getUTCDate()+n)}t.hour!==void 0&&e.setUTCHours(t.hour),t.minute!==void 0&&e.setUTCMinutes(t.minute),t.second!==void 0&&e.setUTCSeconds(t.second),t.millisecond!==void 0&&e.setUTCMilliseconds(t.millisecond)},g_=864e5,__=(e,t,n)=>{if(t._tag===`Offset`)return jg(e-t.offset,t);let r=b_(e-g_,e,t),i=b_(e+g_,e,t);if(r===i)return jg(e-r,t);let a=r<i,o=r-i;if(a){if(b_(e-i,e,t)===i)return jg(e-i,t);let a=jg(e-r,t);if(e!==s_(a).getTime())switch(n){case`reject`:{let n=new Date(e).toISOString();throw RangeError(`Gap time: ${n} does not exist in time zone ${t.id}`)}case`earlier`:return jg(e-i,t);case`compatible`:case`later`:return a}return a}if(b_(e-r,e,t)===r){if(n===`earlier`||n===`compatible`||b_(e-r+o,e+o,t)===r)return jg(e-r,t);if(n===`reject`){let n=new Date(e).toISOString();throw RangeError(`Ambiguous time: ${n} occurs twice in time zone ${t.id}`)}}return jg(e-i,t)},v_=/([+-])(\d{2}):(\d{2})$/,y_=e=>{let t=v_.exec(e);if(t===null)return null;let[,n,r,i]=t;return(n===`+`?1:-1)*(Number(r)*60+Number(i))*60*1e3},b_=(e,t,n)=>{let r=n.format.formatToParts(e).find(e=>e.type===`timeZoneName`)?.value??``;if(r===`GMT`)return 0;let i=y_(r);return i===null?c_(jg(t,n)):i},x_=I(Ng,(e,t,n)=>{if(e._tag===`Utc`){let n=o_(e);return t(n),Bg(n.getTime())}let r=s_(e),i=new Date(r.getTime());return t(i),__(i.getTime(),e.zone,n?.disambiguation??`compatible`)}),S_=I(2,(e,t)=>t(s_(e))),C_=I(2,(e,t)=>t(o_(e))),w_=e=>o_(e).toISOString(),T_=e=>{let t=s_(e);return e._tag===`Utc`?t.toISOString():`${t.toISOString().slice(0,-1)}${u_(e)}`},E_=e=>e.zone._tag===`Offset`?T_(e):`${T_(e)}[${e.zone.id}]`;globalThis.Number;var D_=ol;globalThis.String;var O_=e=>e.toLowerCase(),k_=e=>e.length>0,A_=`~effect/time/Cron`;function j_(e){return{tz:e.tz,and:e.and,seconds:Ul(e.seconds),minutes:Ul(e.minutes),hours:Ul(e.hours),days:Ul(e.days),months:Ul(e.months),weekdays:Ul(e.weekdays)}}var M_={[A_]:A_,[ns](e){return N_(e)&&Z_(this,e)},[Ro](){return _o(zo(this.tz),Vo(zo(this.and)),Vo(Yo(Ul(this.seconds))),Vo(Yo(Ul(this.minutes))),Vo(Yo(Ul(this.hours))),Vo(Yo(Ul(this.days))),Vo(Yo(Ul(this.months))),Vo(Yo(Ul(this.weekdays))))},toObject(){return j_(this)},toString(){return`Cron(${Ps(j_(this))})`},toJSON(){let e=j_(this);return e._id=`Cron`,e},[Vs](){return this.toJSON()},pipe(){return oo(this,arguments)}},N_=e=>Fo(e,A_),P_=e=>{let t=Object.create(M_);t.seconds=I_.seconds(e.seconds??[0]),t.minutes=I_.minutes(e.minutes),t.hours=I_.hours(e.hours),t.days=I_.days(e.days),t.months=I_.months(e.months),t.weekdays=I_.weekdays(e.weekdays),t.and=e.and===!0,t.tz=_l(e.tz);let n=Array.from(t.seconds),r=Array.from(t.minutes),i=Array.from(t.hours),a=Array.from(t.days),o=Array.from(t.months),s=Array.from(t.weekdays);return t.first={second:n[0]??0,minute:r[0]??0,hour:i[0]??0,day:a[0]??1,month:(o[0]??1)-1,weekday:s[0]??0},t.last={second:n[n.length-1]??59,minute:r[r.length-1]??59,hour:i[i.length-1]??23,day:a[a.length-1]??31,month:(o[o.length-1]??12)-1,weekday:s[s.length-1]??6},t.next={second:R_.next.second(n),minute:R_.next.minute(r),hour:R_.next.hour(i),day:R_.next.day(a),month:R_.next.month(o),weekday:R_.next.weekday(s)},t.prev={second:R_.prev.second(n),minute:R_.prev.minute(r),hour:R_.prev.hour(i),day:R_.prev.day(a),month:R_.prev.month(o),weekday:R_.prev.weekday(s)},t},F_=(e,t,n,r=e=>e)=>i=>{let a=[];for(let o of i){if(!Number.isInteger(o)||o<t||o>n)throw RangeError(`${e} must contain only integers between ${t} and ${n}`);a.push(r(o))}return new Set(Jl(a,D_))},I_={seconds:F_(`seconds`,0,59),minutes:F_(`minutes`,0,59),hours:F_(`hours`,0,23),days:F_(`days`,1,31),months:F_(`months`,1,12),weekdays:F_(`weekdays`,0,7,e=>e===7?0:e)},L_=(e,t)=>n=>{let r=Array(e).fill(void 0);if(n.length===0)return r;let i;if(t===`next`){let t=n.length-1;for(let a=e-1;a>=0;a--){for(;t>=0&&n[t]>=a;)i=n[t--];r[a]=i}}else{let t=0;for(let a=0;a<e;a++){for(;t<n.length&&n[t]<=a;)i=n[t++];r[a]=i}}return r},R_={prev:{second:L_(60,`prev`),minute:L_(60,`prev`),hour:L_(24,`prev`),day:L_(32,`prev`),month:L_(13,`prev`),weekday:L_(7,`prev`)},next:{second:L_(60,`next`),minute:L_(60,`next`),hour:L_(24,`next`),day:L_(32,`next`),month:L_(13,`next`),weekday:L_(7,`next`)}},z_=`~effect/time/Cron/CronParseError`,B_=class extends Vd(`CronParseError`){[z_]=z_},V_=(e,t)=>{let n=e.trim().split(/\s+/).filter(k_);if(n.length!==5&&n.length!==6)return Ol(new B_({message:`Invalid number of segments in cron expression`,input:e}));n.length===5&&n.unshift(`0`);let[r,i,a,o,s,c]=n;return Il({tz:t===void 0||Pg(t)?Dl(t):kl(i_(t),()=>new B_({message:`Invalid time zone in cron expression`,input:t})),seconds:iv(r,Q_),minutes:iv(i,$_),hours:iv(a,ev),days:iv(o,tv),months:iv(s,nv),weekdays:iv(c,rv)}).pipe(Nl(({tz:e,seconds:t,minutes:n,hours:r,days:i,months:a,weekdays:o})=>P_({tz:e,seconds:t.values,minutes:n.values,hours:r.values,days:i.values,months:a.values,weekdays:o.values,and:(i.wildcard||o.wildcard)&&i.values.size!==0&&o.values.size!==0})))},H_=(e,t)=>Fl(V_(e,t)),U_=(e,t)=>{let n=Kg(t,{timeZone:bl(e.tz)}).pipe(p_);return e.seconds.size!==0&&!e.seconds.has(n.second)||e.minutes.size!==0&&!e.minutes.has(n.minute)||e.hours.size!==0&&!e.hours.has(n.hour)||e.months.size!==0&&!e.months.has(n.month)?!1:e.days.size===0&&e.weekdays.size===0?!0:e.and?(e.days.size===0||e.days.has(n.day))&&(e.weekdays.size===0||e.weekdays.has(n.weekDay)):e.weekdays.size===0?e.days.has(n.day):e.days.size===0?e.weekdays.has(n.weekDay):e.days.has(n.day)||e.weekdays.has(n.weekDay)},W_=e=>new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth()+1,0)).getUTCDate(),G_=(e,t)=>q_(e,t,`next`),K_=(e,t)=>q_(e,t,`prev`),q_=(e,t,n)=>{let r=bl(e.tz),i=Kg(t??new Date,{timeZone:r}),a=n===`prev`,o=a?-1:1,s=e[n],c=a?e.last:e.first,l=a?(e,t)=>e<t:(e,t)=>e>t,u=r!==void 0&&Fg(r)&&r.id===`UTC`?go:e=>{let t=Kg(e,{timeZone:i.zone,adjustForTimeZone:!0,disambiguation:a?`later`:void 0}).pipe(s_),n=e.getTime()-t.getTime();(a?n!==0:n>0)&&e.setTime(a?t.getTime():e.getTime()+n)};return o_(x_(i,t=>{t.setUTCSeconds(t.getUTCSeconds()+o,0);for(let n=0;n<1e4;n++){if(e.seconds.size!==0){let e=t.getUTCSeconds(),n=s.second[e];if(n===void 0){t.setUTCMinutes(t.getUTCMinutes()+o,c.second),u(t);continue}if(l(n,e)){t.setUTCSeconds(n),u(t);continue}}if(e.minutes.size!==0){let e=t.getUTCMinutes(),n=s.minute[e];if(n===void 0){t.setUTCHours(t.getUTCHours()+o,c.minute,c.second),u(t);continue}if(l(n,e)){t.setUTCMinutes(n,c.second),u(t);continue}}if(e.hours.size!==0){let e=t.getUTCHours(),n=s.hour[e];if(n===void 0){t.setUTCDate(t.getUTCDate()+o),t.setUTCHours(c.hour,c.minute,c.second),u(t);continue}if(l(n,e)){t.setUTCHours(n,c.minute,c.second),u(t);continue}}if(e.weekdays.size!==0||e.days.size!==0){if(e.and){let n=e.days.size===0||e.days.has(t.getUTCDate()),r=e.weekdays.size===0||e.weekdays.has(t.getUTCDay());if(!n||!r){t.setUTCDate(t.getUTCDate()+o),t.setUTCHours(c.hour,c.minute,c.second),u(t);continue}}else{let n=a?-1/0:1/0,r=a?-1/0:1/0;if(e.weekdays.size!==0){let e=t.getUTCDay(),r=s.weekday[e];n=r===void 0?a?c.weekday-7-e:7-e+c.weekday:r-e}if(e.days.size!==0&&n!==0){let e=t.getUTCDate(),n=s.day[e];if(n===void 0){if(a){let e=new Date(t);e.setUTCDate(0);let n=s.day[e.getUTCDate()];if(n===void 0&&(e.setUTCDate(0),n=s.day[e.getUTCDate()]),n===void 0)throw Error(`Unable to find cron date`);e.setUTCDate(n),r=(e.getTime()-t.getTime())/864e5}else r=W_(t)-e+c.day}else r=!a&&n>W_(t)?W_(t)-e+c.day:n-e}let i=a?Math.max(n,r):Math.min(n,r);if(i!==0){t.setUTCDate(t.getUTCDate()+i),t.setUTCHours(c.hour,c.minute,c.second),u(t);continue}}}if(e.months.size!==0){let n=t.getUTCMonth()+1,r=s.month[n],i=n=>{let r=W_(new Date(Date.UTC(t.getUTCFullYear(),n+1,0)));return e.days.size!==0&&e.weekdays.size===0?a?s.day[r]??r:c.day:a?r:1};if(r===void 0){t.setUTCFullYear(t.getUTCFullYear()+o),t.setUTCMonth(c.month,i(c.month)),t.setUTCHours(c.hour,c.minute,c.second),u(t);continue}if(l(r,n)){let e=r-1;t.setUTCMonth(e,i(e)),t.setUTCHours(c.hour,c.minute,c.second),u(t);continue}}return}throw Error(`Unable to find cron date`)}))},J_=ys((e,t)=>rs(e.tz,t.tz)&&e.and===t.and&&X_(e.seconds,t.seconds)&&X_(e.minutes,t.minutes)&&X_(e.hours,t.hours)&&X_(e.days,t.days)&&X_(e.months,t.months)&&X_(e.weekdays,t.weekdays)),Y_=Cs(xs()),X_=(e,t)=>Y_(Ul(e),Ul(t)),Z_=I(2,(e,t)=>J_(e,t)),Q_={min:0,max:59},$_={min:0,max:59},ev={min:0,max:23},tv={min:1,max:31},nv={min:1,max:12,aliases:{jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12}},rv={min:0,max:7,normalize:e=>e===7?0:e,aliases:{sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6}},iv=(e,t)=>{let n=new Set,r=e.split(`,`),i=av(r[0]),a=i[0]===`*`,o=t.normalize??(e=>e),s=a&&(i[1]===void 0||i[1]===1)?go:e=>{n.add(o(e))};for(let n=0;n<r.length;n++){let a=r[n],[o,c]=n===0?i:av(a);if(c!==void 0){if(!Number.isInteger(c))return Ol(new B_({message:`Expected step value to be a positive integer`,input:e}));if(c<1)return Ol(new B_({message:`Expected step value to be greater than 0`,input:e}));if(c>t.max)return Ol(new B_({message:`Expected step value to be less than or equal to ${t.max}`,input:e}))}if(o===`*`){if(n===0&&(c===void 0||c===1))continue;for(let e=t.min;e<=t.max;e+=c??1)s(e)}else{let[n,r]=ov(o,t.aliases);if(!Number.isInteger(n))return Ol(new B_({message:`Expected a positive integer`,input:e}));if(n<t.min||n>t.max)return Ol(new B_({message:`Expected a value between ${t.min} and ${t.max}`,input:e}));if(r===void 0)for(let e=n;e<=(c===void 0?n:t.max);e+=c??1)s(e);else{if(!Number.isInteger(r))return Ol(new B_({message:`Expected a positive integer`,input:e}));if(r<t.min||r>t.max)return Ol(new B_({message:`Expected a value between ${t.min} and ${t.max}`,input:e}));if(n>r)return Ol(new B_({message:`Invalid value range`,input:e}));for(let e=n;e<=r;e+=c??1)s(e)}}}return Dl({values:n,wildcard:a})},av=e=>{let t=e.indexOf(`/`);if(t!==-1){let n=e.slice(t+1);return[e.slice(0,t),cv.test(n)?Number(n):NaN]}return[e,void 0]},ov=(e,t)=>{let n=e.indexOf(`-`);return n===-1?[sv(e,t),void 0]:[sv(e.slice(0,n),t),sv(e.slice(n+1),t)]};function sv(e,t){return t?.[O_(e)]??(cv.test(e)?Number(e):NaN)}var cv=/^\d+$/,lv=Ym,uv=Zm,dv=vp,fv=yp,pv=op,mv=fp,hv=up,gv=lp,_v=gp,vv=Sp,yv=wp,bv=cp,xv=pp,Sv=mp,Cv=_p,wv=dp,Tv=Rp,Ev=Fp,Dv=Ip,Ov=_m,kv=Cm,Av=Hp,jv=Np,Mv=Lp,Nv=um,Pv=pm,Fv=sm,Iv=dm,Lv=mm,Rv=gm,zv=Th,Bv=xm,Vv=em,Hv=nm,Uv=rm,Wv=im,Gv=Vm,Kv=Bm,qv=qm,Jv=Jm,Yv=om,Xv=_h,Zv=gh,Qv=rh,$v=ih,ey=ah,ty=Tp,z=Op,ny=Vh(`Warn`),ry=Vh(`Error`),iy=Vh(`Info`),ay=Vh(`Debug`);bu()(`effect/Effect/Transaction`);var oy=Up,sy=Wp,cy=Gp,ly=Vp,uy=Ap;function dy(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function fy(e){return t=>dy(t)?.[e]}var py=`~structural`,my=`~sentinels`,hy=`~constructor`,gy=fy(`brands`),_y=vo(e=>{let t=dy(e)?.identifier;return typeof t==`string`?t:e.getExpected(_y)}),vy=Symbol(),yy=rg,by=yy(vy),xy=yy(vy),Sy=e=>e===vy?L():ul(e),Cy=e=>e._tag===`None`?by:yy(e.value),wy=`~effect/SchemaIssue/Issue`;function Ty(e){return Fo(e,wy)&&e[wy]===wy}function Ey(e){return Object.hasOwn(e,`input`)}var Dy=class{[wy]=wy;constructor(e,t){t?.reportInput===!0&&e!==vy&&(this.input=e)}},Oy=class extends Dy{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},ky=class extends Dy{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},Ay=class extends Dy{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},jy=class extends Dy{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},My=class extends Dy{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Ny=class extends Dy{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Py=class extends Dy{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Fy=class extends Dy{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}};function Iy(e,t,n,r,i){return new Ny(e,[new Ay([t],n)],r,i)}var Ly=class extends Dy{_tag=`Forbidden`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},Ry=class extends Dy{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},zy=class extends Dy{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function By(e,t,n){if(Ty(e))return e;if(typeof e==`string`)return new Fy({message:e},t,n);let r=typeof e.issue==`string`?new Fy({message:e.issue},t,n):e.issue;return new Ay(e.path,r)}function iee(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new Fy(void 0,t,n):By(e,t,n)}function aee(e,t,n,r){return Array.isArray(t)?ql(t)?t.length===1?By(t[0],n,r):new Ny(e,Ql(t,e=>By(e,n,r)),n,r):void 0:iee(t,n,r)}var Vy=e=>{let t=Zy(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return Gy(_y(e.ast),e);case`InvalidValue`:{let t=Wy(e);if(t!==void 0)return Gy(t,e);let n=Uy(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=Uy(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=Uy(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},Hy=e=>Zy(e.issue)??Zy(e);function oee(e){return t=>({issues:Ky(t,[],e?.leafHook??Vy,e?.checkHook??Hy)})}function Uy(e){return Ey(e)?Ps(e.input):void 0}function Wy(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function Gy(e,t){let n=Uy(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function Ky(e,t,n,r){switch(e._tag){case`Filter`:{let i=r(e);if(i!==void 0)return[{path:t,message:i}];if(e.issue._tag!==`InvalidValue`)return Ky(e.issue,t,n,r);let a=Wy(e.issue);return[{path:t,message:a===void 0?Gy(qy(e.filter),e):Gy(a,e.issue)}]}case`Encoding`:return Ky(e.issue,t,n,r);case`Pointer`:return Ky(e.issue,[...t,...e.path],n,r);case`Composite`:return e.issues.flatMap(e=>Ky(e,t,n,r));case`AnyOf`:return e.issues.length===0?[{path:t,message:Zy(e)??Gy(_y(e.ast),e)}]:e.issues.flatMap(e=>Ky(e,t,n,r));default:return[{path:t,message:n(e)}]}}function qy(e){let t=e.annotations?.expected;if(typeof t==`string`)return t;switch(e._tag){case`Filter`:return`<filter>`;case`FilterGroup`:return e.checks.map(e=>qy(e)).join(` & `)}}function Jy(){return e=>Xy(e,``)}var Yy=Jy();function Xy(e,t){let n;switch(e._tag){case`Filter`:{let r=Hy(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return Xy(e.issue,t);let r=Wy(e.issue);n=r===void 0?Gy(qy(e.filter),e):Gy(r,e.issue)}break}case`Encoding`:return Xy(e.issue,t);case`Pointer`:return Xy(e.issue,t+Ls(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>Xy(e,t)).join(`
14
+ `);n=Zy(e)??Gy(_y(e.ast),e);break;default:n=Vy(e)}return t?`${n}\n at ${t}`:n}function Zy(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return Zy(e.issue);let t=(e._tag===`Filter`?e.filter.annotations:`annotations`in e?e.annotations:e.ast.annotations)?.[e._tag===`MissingKey`?`messageMissingKey`:e._tag===`UnexpectedKey`?`messageUnexpectedKey`:`message`];if(typeof t==`string`)return t}function Qy(e){let t;for(let n of e.reasons){if(!Jh(n)||!Ty(n.error))return;t??=n.error}return t}function $y(e,t){let n=Qy(e);if(n===void 0)throw Error(t,{cause:e});return n}var eb=Mg,tb=Ig,nb=Rg,rb=zg,ib=Vg,ab=Hg,ob=qg,sb=Jg,cb=Yg,lb=n_,ub=a_,db=o_,fb=d_;bu()(`effect/DateTime/CurrentTimeZone`);var pb=w_,mb=E_,hb=class e extends co{run;constructor(e){super(),this.run=e}map(t){return new e((e,n)=>this.run(e,n).pipe(oy(Sl(t))))}compose(t){return yb(this)?t:yb(t)?this:new e((e,n)=>this.run(e,n).pipe(ly(e=>t.run(e,n))))}};function gb(e){return new hb((t,n)=>bv(e(t,n)))}function _b(e){return gb((t,n)=>{let r={message:e(t)};return R(t)?new Ly(r,t.value,n):new Ly(r)})}var vb=new hb(pv);function yb(e){return e.run===vb.run}function bb(){return vb}function xb(e){return new hb((t,n)=>fl(t)?mv:e(t.value,n))}function Sb(e){return wb(Sl(e))}function Cb(e){return xb((t,n)=>e(t,n).pipe(oy(ul)))}function wb(e){return new hb(t=>pv(e(t)))}function Tb(){return new hb(()=>mv)}function Eb(e){return new hb(t=>{let n=Tl(t,ko);return R(n)?pv(n):oy(e,ul)})}function Db(){return Sb(globalThis.String)}function Ob(){return Sb(globalThis.Number)}function kb(){return Sb(globalThis.BigInt)}function Ab(e){return xb((t,n)=>Cv({try:()=>ul(JSON.parse(t,e?.reviver)),catch:()=>new Fy({expected:`a valid JSON string`},t,n)}))}function jb(e){return xb((t,n)=>Cv({try:()=>{let n=JSON.stringify(t,e?.replacer,e?.space);if(n===void 0)throw TypeError(`Value cannot be represented as JSON`);return ul(n)},catch:()=>new Fy({expected:`a JSON-serializable value`},t,n)}))}function Mb(){return Sb(Gd)}function Nb(){return Cb((e,t)=>Pl(qd(e),{onFailure:()=>bv(new Fy({expected:`a valid Base64Url string`},e,t)),onSuccess:pv}))}var Pb=`~effect/SchemaTransformation/Transformation`,Fb=class e{[Pb]=Pb;_tag=`Transformation`;decode;encode;constructor(e,t){this.decode=e,this.encode=t}flip(){return new e(this.encode,this.decode)}compose(t){return new e(this.decode.compose(t.decode),t.encode.compose(this.encode))}};function Ib(e){return Fo(e,Pb)&&e[Pb]===Pb}var Lb=e=>Ib(e)?e:new Fb(e.decode,e.encode);function Rb(e){return new Fb(Cb(e.decode),Cb(e.encode))}function zb(e){return new Fb(Sb(e.decode),Sb(e.encode))}function Bb(e){return new Fb(wb(e.decode),wb(e.encode))}var Vb=new Fb(bb(),bb());function Hb(){return Vb}var Ub=new Fb(Ob(),Db()),Wb=new Fb(kb(),Db()),Gb=e=>No(e)&&typeof e.message==`string`,Kb=e=>{let t=Object.hasOwn(e,`cause`)?Error(e.message,{cause:Xb(e.cause)}):Error(e.message);return typeof e.name==`string`&&e.name!==`Error`&&(t.name=e.name),typeof e.stack==`string`&&(t.stack=e.stack),t},qb=e=>{try{let t=Bs(e);return t===void 0?Ps(e):JSON.parse(t)}catch{return Ps(e)}},Jb=(e,t,n)=>{let r={name:e.name,message:typeof e.message==`string`?e.message:``};return t?.includeStack&&typeof e.stack==`string`&&(r.stack=e.stack),!t?.excludeCause&&e.cause!==void 0&&(r.cause=n(e.cause)),r},Yb=e=>{let t=new WeakSet,n=r=>{if(Io(r)){if(t.has(r))return`[Circular]`;t.add(r);let i=Jb(r,e,n);return t.delete(r),i}return qb(r)};return n},Xb=e=>Gb(e)?Kb(e):e,Zb=e=>zb({decode:Xb,encode:Yb(e)});function Qb(){return zb({decode:vl,encode:yl})}function $b(){return Bb({decode:ul,encode:wl})}var ex=Rb({decode:(e,t)=>URL.canParse(e)?pv(new URL(e)):bv(new Fy({expected:`a valid URL string`},e,t)),encode:e=>pv(e.href)});function tx(e){return new Fb(Ab(e??{}),jb(e))}var nx=Rb({decode:(e,t)=>pl(ob(e),{onNone:()=>bv(new Fy({expected:`a valid UTC DateTime string`},e,t)),onSome:e=>pv(cb(e))}),encode:e=>pv(pb(e))});function rx(e){return t=>t._tag===e}var ix=rx(`Declaration`),ax=rx(`Never`),ox=rx(`Literal`),sx=rx(`UniqueSymbol`),cx=rx(`Arrays`),lx=rx(`Objects`),ux=rx(`Suspend`),dx=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},fx={},px=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},mx=`~effect/Schema`,hx=class{[mx]=mx;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},gx=class e extends hx{_tag=`Declaration`;typeParameters;run;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o}getParser(){let e;return(t,n)=>t===vy?by:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(t,n,r){let i=OS(this.typeParameters,t);return i===this.typeParameters&&n===this.checks&&r===this.encodingChecks?this:new e(i,this.run,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}},_x=new class extends hx{_tag=`Null`;getParser(){return GS(this,null)}getExpected(){return`null`}},vx=class extends hx{_tag=`Undefined`;getParser(){return GS(this,void 0)}toCodecJson(){return yS(this,[yx])}getExpected(){return`undefined`}},yx=new dx(_x,new Fb(Sb(()=>void 0),Sb(()=>null))),bx=new vx,xx=new class extends hx{_tag=`Void`;getParser(){let e=yy(void 0);return t=>t===vy?by:e}toCodecJson(){return yS(this,[yx])}getExpected(){return`void`}},Sx=new class extends hx{_tag=`Never`;getParser(){return KS(this,jo)}getExpected(){return`never`}},Cx=new class extends hx{_tag=`Unknown`;getParser(){return KS(this,Mo)}getExpected(){return`unknown`}},wx=class extends hx{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${Ps(e)}`);this.literal=e}getParser(){return GS(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?Tx(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:Tx(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function Tx(e){let t=globalThis.String(e.literal);return yS(e,[new dx(new wx(t),new Fb(Sb(()=>e.literal),Sb(()=>t)))])}var Ex=new class extends hx{_tag=`String`;getParser(){return KS(this,So)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&iC(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},Dx=class extends hx{_tag=`Number`;getParser(){return KS(this,Co)}matchKey(e,t){return this._match(XS,e,t)}matchPart(e,t){return this._match(YS,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:iC(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(Ox(this.checks,`effect/schema/isFinite`)||Ox(this.checks,`effect/schema/isInt`))?this:yS(this,[mS])}toCodecStringTree(){return this.toCodecJson()===this?yS(this,[$S]):yS(this,[eC])}getExpected(){return`number`}};function Ox(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&Ox(e.checks,t))}var kx=new Dx,Ax=new class extends hx{_tag=`Boolean`;getParser(){return KS(this,wo)}getExpected(){return`boolean`}},jx=new class extends hx{_tag=`BigInt`;getParser(){return KS(this,To)}matchPart(e,t){if(!tC.test(e))return;let n=globalThis.BigInt(e);return t.disableChecks||!this.checks?n:iC(this.checks,n,void 0,this,t)?void 0:n}toCodecStringTree(){return yS(this,[rC])}getExpected(){return`bigint`}},Mx=class e extends hx{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(LS(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(LS(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}return uy(function*(e,c){if(e===vy)return vy;if(!Array.isArray(e))return yield*bv(new Py(n,e,c));r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)})));let l=e.length,u={ast:n,getParser:s,input:e,len:l,tailThreshold:Math.max(a,l-o),output:new globalThis.Array(l),issues:void 0,options:c},d=Nx(u,e,{concurrency:Px(c?.concurrency)?.concurrency,end:n.rest.length===0?a:Math.max(l,a+o)});if(d&&(yield*d),n.rest.length===0&&l>a)for(let t=a;t<=l-1;t++){let r=new My(n,e[t],c),i=new Ay([t],r);if(c.errors===`all`)u.issues?u.issues.push(i):u.issues=[i];else return yield*bv(new Ny(n,[i],e,c))}return u.issues?yield*bv(new Ny(n,u.issues,e,c)):u.output})}_rebuild(t,n,r){let i=OS(this.elements,t),a=OS(this.rest,t);return i===this.elements&&a===this.rest&&n===this.checks&&r===this.encodingChecks?this:new e(this.isMutable,i,a,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}},Nx=eh()({onItem(e,t,n){let r=n<e.len?t:vy;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step(e,t,n,r){if(n._tag===`Failure`)return Fx(e,e.ast,r,n);let i=n===xy?t:n[Zs];if(i!==vy)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(LS(t.ast))return;let n=new Ay([r],new jy(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return ag(new Ny(e.ast,[n],e.input,e.options))}}}),Px=e=>(e=e===`unbounded`?1/0:e??1,e>1?{concurrency:e}:void 0),Fx=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=Qy(r.cause);if(i===void 0)return ig(eg(r.cause,r=>new Ny(t,[new Ay([n],r)],e.input,e.options)));let a=new Ay([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return ag(new Ny(t,[a],e.input,e.options))},Ix=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function Lx(e,t,n=fx){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(qS(VS(t)))}var Rx=class{name;type;constructor(e,t){this.name=e,this.type=t}};function zx(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(zx);default:return!1}}function Bx(e){return zx(e)&&zx(VS(e))}var Vx=class{parameter;type;constructor(e,t){if(!Bx(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,LS(t)&&!WS(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},Hx=class e extends hx{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o;let s=e.map(e=>e.name).filter((e,t,n)=>n.indexOf(e)!==t);if(s.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(s)}. ts(2300)`)}getParser(e,t=e){let n=this,r=[];for(let e of n.propertySignatures)r.push(e.name);let i=r.length,a=n.indexSignatures.length,o=i&&a?new Set(r):void 0;if(!i&&!a)return KS(n,Ao);let s,c,l=(e,t,r,a,s)=>{if(s._tag===`Failure`)return Fx(e,n,t,s)??og;let c=s===xy?a:s[Zs];if(r!==vy&&c!==vy){if(i&&(o.has(t)||o.has(r)))return og;Ts(e.out,r,c)}return og},u=(e,t,r,i)=>{if(!i){let n=r.parserKey(t,e.options);if(!Bp(n))return Tv(kv(n),n=>u(e,t,r,n));i=n}if(i._tag===`Failure`)return Fx(e,n,t,i)??og;let a=i===xy?t:i[Zs],o=e.input[t],s=r.parserValue(o,e.options);return Bp(s)?l(e,t,a,o,s):Tv(kv(s),n=>l(e,t,a,o,n))},d=(e,t,n)=>{let r=e.input[t],i=n.parserValue(r,e.options);return Bp(i)?l(e,t,t,r,i):Tv(kv(i),n=>l(e,t,t,r,n))},f=a?eh()({onItem:(e,[t,n])=>u(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return uy(function*(l,p){if(l===vy)return vy;if(!(typeof l==`object`&&l&&!Array.isArray(l)))return yield*bv(new Py(n,l,p));s||(s=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),c=a?n.indexSignatures.map(n=>({is:n,parserKey:e(qS(n.parameter)),parserValue:t(n.type)})):void 0);let m=l,h={},g={ast:n,input:m,out:h,issues:void 0,options:p},_=p.errors===`all`,v=p.onExcessProperty===`error`,y=p.onExcessProperty===`preserve`,b;if(!a&&(v||y)){o??=new Set(r),b=Reflect.ownKeys(m);for(let e=0;e<b.length;e++){let t=b[e];if(!o.has(t)){if(v){let e=new My(n,m[t],p),r=new Ay([t],e);if(_){g.issues?g.issues.push(r):g.issues=[r];continue}return yield*bv(new Ny(n,[r],l,p))}Ts(h,t,m[t])}}}let x=Px(p?.concurrency);if(i){let e=Ux(g,s,x);e&&(yield*e)}if(a&&!x)for(let e=0;e<a;e++){let t=c[e],n=t.is.parameter===Ex?d:u,r=t.is.parameter===Ex?Object.keys(m):Lx(m,t.is.parameter,p);for(let e=0;e<r.length;e++){let i=n(g,r[e],t);if(!Bp(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(f){let e=Zl();for(let t=0;t<a;t++){let n=c[t],r=Lx(m,n.is.parameter,p);for(let t=0;t<r.length;t++)e.push([r[t],n])}let t=f(g,e,x);t&&(yield*t)}if(g.issues)return yield*bv(new Ny(n,g.issues,l,p));if(p.propertyOrder===`original`){let e=(b??Reflect.ownKeys(m)).concat(r),t={};for(let n of e)Object.hasOwn(h,n)&&Ts(t,n,h[n]);return t}return h})}_rebuild(t,n,r,i){let a=OS(this.propertySignatures,e=>{let n=t(e.type);return n===e.type?e:new Rx(e.name,n)}),o=OS(this.indexSignatures,e=>{let r=n(e.parameter),i=t(e.type);return r===e.parameter&&i===e.type?e:new Vx(r,i)});return a===this.propertySignatures&&o===this.indexSignatures&&r===this.checks&&i===this.encodingChecks?this:new e(a,o,this.annotations,r,void 0,this.context,i)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}},Ux=eh()({onItem(e,t){if(!Object.hasOwn(e.input,t.name))return t.parser(vy,e.options);let n=e.input[t.name];return Ts(e.out,t.name,n),t.parser(n,e.options)},step(e,t,n){if(n._tag===`Failure`)return Fx(e,e.ast,t.name,n);if(n===xy)return;let r=n[Zs];if(r!==vy){Ts(e.out,t.name,r);return}if(delete e.out[t.name],!LS(t.type)){let n=new Ay([t.name],new jy(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return ag(new Ny(e.ast,[n],e.input,e.options))}}});function Wx(e,t){return e?t?[...e,...t]:e:t}function Gx(e,t,n){return new Hx(Reflect.ownKeys(e).map(t=>new Rx(t,e[t].ast)),[],n,t)}function Kx(e){return e.ast}function qx(e,t=void 0){return new Mx(!1,e.map(e=>e.ast),[],void 0,t)}function Jx(e,t,n){return new rS(e.map(Kx),t,void 0,n)}var Yx=yo(e=>{for(;;){if(ux(e))return Cx;let t=e.encoding;if(!t)return e.recur?.(Yx,lo)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==lo))return Cx;e=t[t.length-1].to}});function Xx(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(Xx)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Zx(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[my];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!LS(t)){if(ox(t))return[{key:e.name,literal:t.literal}];if(sx(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!LS(e)){if(ox(e))return[{key:t,literal:e.literal}];if(sx(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Zx(Yx(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Zx(e.thunk())}}var Qx=new WeakMap,$x=Object.freeze([]);function eS(e){let t=Qx.get(e);if(t)return t;let n,r=0,i,a,o=!0;for(let t=0;t<e.length;t++){let s=e[t],c=Yx(s);if(ax(c))continue;if(o){if(ox(c)||sx(c)){a??=new Map;let e=ox(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1}let l=Zx(c);if(l.length){n??=new Map,r++;for(let{key:e,literal:r}of l){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=Xx(c);for(let n of e)(i[n]??=[]).push(t)}}if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??$x;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=i;for(let[t,n]of i)a.set(t,Object.freeze(Array.from(n,t=>e[t])));t=(t,n)=>{if(Po(t)){let i=Object.hasOwn(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??$x;if(n)return e}return $x}}else if(n){let a;for(let e of n)(!a||e[1][0].size>a[1][0].size)&&e[1][1].size===r&&(a=e);t=(t,r)=>{let o=i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??$x;if(!Po(t))return o.map(t=>e[t]);let s=new Set(o),c;if(a){let[n,[i]]=a,l=Object.hasOwn(t,n),u=l?t[n]:void 0;if(l&&(!r||u!==void 0)){let t=i.get(u);if(!t)return o.map(t=>e[t]);for(let e of t)s.add(e);c=n}}if(c===void 0)for(let[e,[i,a]]of n){let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);if(e)for(let t of e)s.add(t)}else if(r)for(let e of a)s.add(e)}for(let[e,[i,a]]of n){if(e===c)continue;let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);for(let t of s)a.has(t)&&!e?.has(t)&&s.delete(t)}}return Array.from(s).sort((e,t)=>e-t).map(t=>e[t])}}else t=t=>(i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??$x).map(t=>e[t]).filter(tS(t));return Qx.set(e,t),t}function tS(e){return t=>{let n=Yx(t);return n._tag===`Literal`?n.literal===e:n._tag!==`UniqueSymbol`||n.symbol===e}}function nS(e,t,n=!1){return eS(t)(e,n)}var rS=class e extends hx{_tag=`Union`;types;mode;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.mode=t,this.encodingChecks=o}getParser(e,t){let n=this;return(r,i)=>{if(r===vy)return by;let a=nS(r,n.types,t!==void 0);if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:Bp(t)?iS(n,t.cause,r,i):Fv(t,e=>iS(n,e,r,i))}let o={ast:n,compile:e,input:r,out:void 0,successes:n.mode===`oneOf`?[]:void 0,issues:void 0,options:i},s=Px(i?.concurrency),c=aS(o,a,s?{...s,orderedStep:!0}:void 0);return c?ly(c,e=>o.out===xy?pv(r):o.out?o.out:bv(new Ry(n,o.issues??[],r,i))):o.out?o.out:bv(new Ry(n,o.issues??[],r,i))}}_rebuild(t,n,r){let i=OS(this.types,t);return i===this.types&&n===this.checks&&r===this.encodingChecks?this:new e(i,this.mode,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=VS(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(ox);if(t.length>0)return`${sS(n.isMutable)}[ ${t.map(t=>e(t)+cS(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>ox(e.type));if(t.length>0)return`{ ${t.map(t=>`${sS(t.type.context?.isMutable)}${Is(t.name)}${cS(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function iS(e,t,n,r){let i=Qy(t);return i?ag(new Ry(e,[i],n,r)):ig(t)}var aS=eh()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=Qy(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(t),ag(new zy(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return og}}}),oS=new rS([new wx(`Infinity`),new wx(`-Infinity`),new wx(`NaN`)],`anyOf`);function sS(e){return e?``:`readonly `}function cS(e){return e?`?`:``}var lS=class e extends co{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(t){return new e(this.run,{...this.annotations,...t},this.aborted)}abort(){return new e(this.run,this.annotations,!0)}and(e,t){return new uS([this,e],t)}},uS=class e extends co{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(t){return new e(this.checks,{...this.annotations,...t})}and(t,n){return new e([this,t],n)}};function dS(e,t,n=!1){return new lS((t,n,r)=>aee(n,e(t,n,r),t,r),t,n)}function fS(e){return dS(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitrary:{constraint:{noInfinity:!0,noNaN:!0}},...e})}var pS=CS(kx,[fS()]),mS=new dx(new rS([pS,oS],`anyOf`),new Fb(Ob(),Sb(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function hS(e,t){let n=e.source,r=new globalThis.RegExp(n,e.flags);return dS(e=>(r.lastIndex=0,r.test(e)),{expected:`a string matching the RegExp ${n}`,representation:{id:`effect/schema/isPattern`,payload:{source:n,flags:e.flags}},toJsonSchema:()=>({pattern:n}),arbitrary:{constraint:{patterns:[e.source]}},...t})}function gS(e,t){let n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}var _S=new WeakMap;function vS(e){return _S.get(e)??e}function yS(e,t){return e.encoding===t?e:gS(e,e=>{e.encoding.value=t})}function bS(e,t){if(e.context===t)return e;let n=vS(e);if(n.context===t)return n;let r=gS(e,e=>{e.context.value=t});return _S.set(r,n),r}function xS(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return SS(e,Wl(e.checks.slice(0,-1),n.annotate(t)))}return gS(e,e=>{e.annotations.value={...e.annotations.value,...t}})}function SS(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:gS(e,e=>{e.checks.value=t})}function CS(e,t){return SS(e,Wx(e.checks,t))}function wS(e,t){let n=t(e.to);return n===e.to?e:new dx(n,e.transformation)}function TS(e,t){let n=e,r=n[n.length-1],i=wS(r,t);return i===r?e:Wl(e.slice(0,e.length-1),i)}function ES(e){return t=>t.encoding?yS(t,TS(t.encoding,e)):t}function see(e,t){return ES(e=>bS(e,t))(e)}function DS(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:yS(r,TS(r.encoding,n))}return e(r)}return yo(n)}function cee(e,t,n){let r=new dx(e,t);return yS(n,n.encoding?[...n.encoding,r]:[r])}function lee(e,t){let n=gy(e);return xS(e,{brands:n?[...n,t]:[t]})}function OS(e,t){let n=!1,r=Array(e.length);for(let i=0;i<e.length;i++){let a=e[i],o=t(a);o!==a&&(n=!0),r[i]=o}return n?r:e}function kS(e,t){return bS(e,e.context?new px(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new px(!1,!1,void 0,t))}var AS=yo(e=>jS(bS(e,e.context?e.context.isOptional===!1?new px(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new px(!0,!1)))),jS=ES(AS),MS=vo(e=>AS(new rS([e,bx],`anyOf`)));function NS(e,t){let n=new dx(Cx,new Fb(Eb(t),bb()));return bS(e,e.context?new px(e.context.isOptional,e.context.isMutable,n,e.context.annotations):new px(!1,!1,n))}function PS(e,t,n){return cee(e,n,t)}function FS(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:Do(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function IS(e,t){let{literals:n,parameters:r}=FS(e);return new Hx(n.map(e=>new Rx(e,t)),r.map(e=>new Vx(e,t)))}function LS(e){return e.context?.isOptional??!1}function RS(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(RS)}function zS(e){function t(e){return RS(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return Kl(n)?n:void 0}var BS=yo(e=>{if(e.encoding)return BS(yS(e,void 0));let t=e,n=t.recur?.(BS)??t,r=n.encodingChecks;if(r){let t=n===e?r:cx(n)||lx(n)||ix(n)&&n.typeParameters.length>0?zS(r):void 0;return gS(n,e=>{e.encodingChecks.value=void 0,e.checks.value=Wx(n.checks,t)})}return n}),VS=yo(e=>BS(US(e)));function HS(e,t){let n=t,r=n.length,i=n[r-1],a=[new dx(US(yS(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new dx(US(n[e-1].to),n[e].transformation.flip()));let o=US(i.to);return o.encoding?yS(o,[...o.encoding,...a]):yS(o,a)}var US=vo(e=>{if(e.encoding)return HS(e,e.encoding);let t=e;return t.flip?.(US)??t.recur?.(US)??t});function WS(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(WS);default:return!1}}function GS(e,t){let n=yy(t);return(r,i)=>r===vy?by:r===t?n:bv(new Py(e,r,i))}function KS(e,t){return(n,r)=>n===vy?by:t(n)?xy:bv(new Py(e,n,r))}var qS=DS(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(qS)}}),JS=DS(e=>{switch(e._tag){default:return e;case`Symbol`:case`UniqueSymbol`:return e.toCodecStringTree();case`Union`:return e.recur(JS)}}),YS=new globalThis.RegExp(`^${Ix}$`),XS=new globalThis.RegExp(`^(?:${Ix}|Infinity|-Infinity|NaN)$`);function ZS(e){return hS(YS,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:YS.source}),...e})}var QS=CS(Ex,[ZS()]),$S=new dx(QS,Ub),eC=new dx(new rS([QS,oS],`anyOf`),Ub),tC=new globalThis.RegExp(`^-?\\d+$`);function nC(e){return hS(tC,{expected:`a string representing a bigint`,representation:{id:`effect/schema/isStringBigInt`,payload:null},toJsonSchema:()=>({pattern:tC.source}),...e})}var rC=new dx(CS(Ex,[nC({expected:`a string representing a bigint`})]),Wb);function iC(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=iC(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new Oy(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function aC(e){if(!ix(e))return;let t=e.annotations?.[hy];return Oo(t)?t(e.typeParameters):void 0}function oC(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&globalThis.Number.isFinite(e)}function sC(e){return e===void 0||typeof e==`string`}function cC(e,t){let n=new WeakMap,r=[];outer:for(;;){if(typeof e!=`object`||!e){if(!t(e))return!1}else{let t=e,i=n.get(t);if(i===!1)return!1;if(i===void 0){let e=Array.isArray(t);if(!e){let e=Object.getPrototypeOf(t);if(e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null)return!1}n.set(t,!1),r.push({value:t,keys:e?t.length:Object.keys(t),index:0})}}for(;r.length>0;){let t=r[r.length-1],i=t.keys;if(typeof i==`number`){if(t.index<i){e=t.value[t.index++];continue outer}}else if(t.index<i.length){e=t.value[i[t.index++]];continue outer}n.set(t.value,!0),r.pop()}return!0}}function lC(e){return cC(e,oC)}var uC=new gx([],()=>(e,t,n)=>lC(e)?xy:bv(new Py(t,e,n)),{representation:{id:`effect/schema/Json`,payload:null},expected:`JSON value`,toCodecJson:()=>void 0,toCodecStringTree:()=>mC,toArbitrary:()=>e=>e.jsonValue()}),dC=new dx(uC,Hb()),fC=new dx(new rS([new Mx(!1,[],[uC]),new Hx([],[new Vx(Ex,uC)])],`anyOf`),Hb());function pC(e){return cC(e,sC)}var mC=new dx(new gx([],()=>(e,t,n)=>pC(e)?xy:bv(new Py(t,e,n)),{expected:`StringTree`,toCodecStringTree:()=>void 0}),Hb()),hC=$f,gC=`~effect/MutableRef`,_C={[gC]:gC,...rc,toJSON(){return{_id:`MutableRef`,current:Hs(this.current)}}},vC=e=>{let t=Object.create(_C);return t.current=e,t},yC=I(2,(e,t)=>(e.current=t,e)),bC=e=>new SC(e),xC=(e,t,n)=>Sp(r=>{if(e.free>=t)return r(n);let i=()=>{e.free<t||(e.waiters.delete(i),r(n))};return e.waiters.add(i),lp(()=>{e.waiters.delete(i)})}),SC=class{waiters=new Set;taken=0;permits;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take(e){let t=up(()=>this.free<e?xC(this,e,t):(this.taken+=e,op(e)));return t}takeIfAvailable(e){return up(()=>this.free<e?op(!1):(this.taken+=e,op(!0)))}releaseUnsafe(e,t){return this.taken-=t,this.waiters.size>0&&e.currentDispatcher.scheduleTask(()=>{for(let e of this.waiters){if(this.free<=0)break;e()}},0),this.free}resize(e){return Fc(t=>(this.permits=e,this.free<0||this.releaseUnsafe(t,0),gp))}release(e){return Fc(t=>op(this.releaseUnsafe(t,e)))}get releaseAll(){return Fc(e=>op(this.releaseUnsafe(e,this.taken)))}withPermits(e){return t=>Jm(n=>{let r=up(()=>this.free<e?Rp(n(xC(this,e,gp)),()=>r):(this.taken+=e,zm(n(t),()=>{this.releaseUnsafe($f(),e)},!0)));return r})}withPermit=this.withPermits(1);withPermitsIfAvailable(e){return t=>Jm(n=>this.free<e?fp:(this.taken+=e,zm(n(Pp(t)),()=>{this.releaseUnsafe($f(),e)},!0)))}};function CC(e){let t=PC(RC,BS(e.ast));return(e,n)=>t(e,n?.disableChecks?n?.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions)}function wC(e){let t=CC(e);return(e,n)=>{let r=ey(t(e,n));return sg(r)?ul(r.value):($y(r.cause,`Option adapter can only return none for schema issues`),L())}}function TC(e){let t=CC(e);return(e,n)=>{let r=ey(t(e,n));if(sg(r))return r.value;let i=$y(r.cause,`Constructor adapter can only throw schema issues`);throw Error(`Schema validation failed`,{cause:i})}}function EC(e){return DC(e.ast)}function DC(e){let t=FC(NC(BS(e)));return e=>{let n=t(e,fx);return sg(n)?!0:($y(n.cause,`Type guard adapter can only return false for schema issues`),!1)}}function OC(e,t){let n=NC(e.ast);return t===void 0?n:(e,r)=>n(e,jC(t,r))}function kC(e,t){return IC(OC(e,t))}function AC(e,t){let n=NC(US(e.ast));return t===void 0?n:(e,r)=>n(e,jC(t,r))}var jC=(e,t)=>t?{...e,...t}:e,MC=e=>e===vy?bv(new Fy):pv(e);function NC(e){return PC(LC,e)}function PC(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??fx);return a===xy?pv(r):Bp(a)?a[Zs]===vy?MC(vy):a:ly(a,MC)}}function FC(e){return(t,n)=>ey(e(t,n))}function IC(e){let t=FC(e);return(e,n)=>{let r=t(e,n);return sg(r)?ul(r.value):($y(r.cause,`Option adapter can only return none for schema issues`),L())}}var LC=vo(e=>UC(e,LC)),RC=vo(e=>UC(e,RC,BC)),zC=vo(e=>UC(e,RC,BC,e.context?.constructorDefault));function BC(e){return e.context?.constructorDefault?zC(e):RC(e)}function VC(e,t,n,r){let i;if(Bp(e)&&e._tag===`Success`){let a=Sy(e===xy?t:e[Zs]);i=n._tag===`Transformation`?n.decode.run(a,r):n.decode(yy(a),r)}else i=n._tag===`Transformation`?ly(e,e=>n.decode.run(Sy(e),r)):n.decode(oy(e,Sy),r);return Bp(i)&&i._tag===`Success`?Cy(i[Zs]):ly(i,Cy)}function HC(e,t){let n;return(r,i)=>r===vy?by:e.isConstructed(r)?xy:VC((n??=t(e.link.to))(r,i),r,e.link.transformation,i)}function UC(e,t,n,r){let i=n?aC(e):void 0,a=i?HC(i,t):e.getParser(t,n),o=e.checks,s=r?e.encoding?[...e.encoding,r]:[r]:e.encoding,c=e.encodingChecks,l=(o?o[o.length-1].annotations:e.annotations)?.parseOptions;if(!s&&!o&&!c)return l?(e,t)=>a(e,jC(t,l)):a;let u,d=(t,n)=>{let r=a(t,n);if(c&&!n.disableChecks){if(Bp(r)){if(r._tag===`Success`){let i=r===xy?t:r[Zs];if(t!==vy&&i!==vy){let i=iC(c,t,void 0,e,n);i&&(r=bv(new Ny(e,i,t,n)))}}}else r=Tv(r,r=>{if(t!==vy&&r!==vy){let r=iC(c,t,void 0,e,n);if(r)return bv(new Ny(e,r,t,n))}return pv(r)})}if(o&&!n.disableChecks){if(Bp(r)){if(r._tag===`Success`){let i=r===xy?t:r[Zs];if(i===vy)return r;let a=iC(o,i,void 0,e,n);a&&(r=bv(new Ny(e,a,i,n)))}}else r=Tv(r,t=>{if(t!==vy){let r=iC(o,t,void 0,e,n);if(r)return bv(new Ny(e,r,t,n))}return pv(t)})}return r};return s?(n,r)=>{l&&(r=jC(r,l));let i=u??=s.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=s.length-1;e>=0;e--)if(o=VC(o,a,s[e].transformation,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[Zs],o=t(a,r)):o=ly(o,e=>{let n=t(e,r);return n===xy?yy(e):n})}if(o._tag===`Success`){let e=o[Zs],t=d(e,r);return t===xy?o:t}return o=Fv(o,t=>xv(()=>eg(t,t=>new ky(e,t,n,r)))),ly(o,e=>{let t=d(e,r);return t===xy?yy(e):t})}:l?(e,t)=>d(e,jC(t,l)):d}var WC=`~effect/Schema/Schema`,GC={[WC]:WC,pipe(){return oo(this,arguments)},annotate(e){return this.rebuild(xS(this.ast,e))},annotateKey(e){return this.rebuild(kS(this.ast,e))},check(...e){return this.rebuild(CS(this.ast,e))}};function KC(e,t){function n(){}let r=Object.defineProperties(Object.setPrototypeOf(n,GC),Object.getOwnPropertyDescriptors({...t}));return r.ast=e,r.rebuild=e=>KC(e,t),r.makeEffect=CC(r),r.make=TC(r),r.makeOption=wC(r),r}var qC=I(2,(e,t)=>YC(e,(e,n)=>[Object.hasOwn(t,e)?t[e]:e,n])),JC=e=>e;function YC(e,t){let n={};for(let r of Reflect.ownKeys(e)){if(!Object.prototype.propertyIsEnumerable.call(e,r))continue;let i=t(r,e[r]);if(i){let[e,t]=i;Ts(n,e,t)}}return n}var XC=new WeakMap,ZC=e=>{if(XC.has(e))return XC.get(e);throw Error(`Unable to get redacted value`+(e.label?` with label: "${e.label}"`:``))},QC=`~effect/data/Redacted`,$C=e=>Fo(e,QC),ew=(e,t)=>{let n=Object.create(tw);return t?.label&&(n.label=t.label),XC.set(n,e),n},tw={[QC]:{_A:e=>e},label:void 0,...rc,toJSON(){return this.toString()},toString(){return`<redacted${So(this.label)?`:`+this.label:``}>`},[Ro](){return zo(XC.get(this))},[ns](e){return $C(e)&&rs(XC.get(this),XC.get(e))}},nw=ZC,rw=e=>ys((t,n)=>e(nw(t),nw(n))),iw=WC;function aw(){return(e,t,n)=>Dw(new gx(e.map(Kx),e=>t(e.map(e=>Dw(e))),n))}function ow(e,t){return aw()([],()=>(t,n,r)=>e(t)?pv(t):bv(new Py(n,t,r)),t)}var sw=`~effect/SchemaError/SchemaError`,cw=class extends Vd(`SchemaError`){[sw]=sw;constructor(e){super({issue:e})}get message(){return Yy(this.issue)}toString(){return`SchemaError(${this.message})`}};function lw(e){return Fo(e,sw)&&e[sw]===sw}function uw(e){return sg(e)?e.value:{issues:[{message:ree(e.cause)}]}}function dw(e,t){let n=OC(e),r={errors:`all`,...t?.parseOptions},i=oee(t),a=e=>{let t=new Id(`sync`),a=Qv(Bv(n(e,r),{onFailure:i,onSuccess:e=>({value:e})}),{scheduler:t});a.currentDispatcher?.flush();let o=a.pollUnsafe();return o?uw(o):new Promise(e=>{a.addObserver(t=>{e(uw(t))})})};if(`~standard`in e){let t=e;return`validate`in t[`~standard`]||Object.assign(t[`~standard`],{validate:a}),t}return Object.assign(e,{"~standard":{version:1,vendor:`effect`,validate:a}})}var fw=EC;function pw(e,t){let n=OC(e,t);return(e,t)=>mw(n(e,t))}function mw(e){return Fv(e,e=>xv(()=>eg(e,e=>new cw(e))))}var hw=pw;function gw(e,t){let n;for(let r of e.reasons){if(!Jh(r)||!lw(r.error))throw new globalThis.Error(t,{cause:e});n??=r.error}if(n===void 0)throw new globalThis.Error(t,{cause:e});return n}function _w(e){return $v(e).then(e=>{if(sg(e))return e.value;throw gw(e.cause,`Promise adapter can only reject schema errors`)})}function vw(e){let t=ey(e);if(sg(t))return t.value;throw gw(t.cause,`Sync adapter can only throw schema errors`)}var yw=kC;function bw(e,t){let n=pw(e,t);return(e,t)=>_w(n(e,t))}function xw(e,t){let n=pw(e,t);return(e,t)=>vw(n(e,t))}var Sw=xw;function Cw(e,t){let n=AC(e,t);return(e,t)=>mw(n(e,t))}var ww=Cw;function Tw(e,t){let n=Cw(e,t);return(e,t)=>vw(n(e,t))}var Ew=Tw,Dw=KC;function Ow(e){return Fo(e,iw)&&e[iw]===iw}var kw=JC(e=>Dw(AS(e.ast),{schema:e})),Aw=JC(e=>{let t=Qw(e);return Dw(MS(e.ast),{schema:t})}),jw=JC(e=>Dw(BS(e.ast),{schema:e})),Mw=JC(e=>Dw(VS(e.ast),{schema:e}));function Nw(e){let t=Dw(new wx(e),{literal:e,transform(n){return t.pipe(eT(Nw(n),{decode:Sb(()=>n),encode:Sb(()=>e)}))}});return t}var Pw=Dw(Sx),Fw=Dw(Cx),Iw=Dw(_x),Lw=Dw(bx),B=Dw(Ex),Rw=Dw(kx),zw=Dw(Ax),Bw=Dw(jx),Vw=Dw(xx);function Hw(e,t){return Dw(e,{fields:t,mapFields(e,t){let n=e(this.fields);return Hw(Gx(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function V(e){return Hw(Gx(e,void 0),e)}var Uw=e=>typeof e==`symbol`?e:globalThis.String(e);function Ww(e){return function(t){let n={},r=Object.create(null),i=Object.create(null),a=new Set;for(let o of Reflect.ownKeys(t.fields)){let s=Mw(t.fields[o]),c=Object.hasOwn(e,o),l=c?e[o]:o,u=Uw(l);if(a.has(u))throw new globalThis.Error(`Duplicate encoded keys: ${Is(l)}`);a.add(u),Ts(n,l,s),c&&(r[o]=l,i[l]=o)}return V(n).pipe(eT(t,zb({decode:qC(i),encode:qC(r)})))}}function Gw(e,t){return Dw(IS(e.ast,t.ast),{key:e,value:t})}function Kw(e,t){return Dw(e,{elements:t,mapElements(e,t){let n=e(this.elements);return Kw(qx(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function qw(e){return Kw(qx(e),e)}var H=JC(e=>Dw(new Mx(!1,[],[e.ast]),{value:e}));function Jw(e,t){return Dw(e,{members:t,mapMembers(e,t){let n=e(this.members);return Jw(Jx(n,this.ast.mode,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function Yw(e,t){return Jw(Jx(e,t?.mode??`anyOf`,void 0),e)}function Xw(e){let t=e.map(Nw);return Dw(Jx(t,`anyOf`,void 0),{literals:e,members:t,mapMembers(e){return Yw(e(this.members))},pick(e){return Xw(e)},transform(e){return Yw(t.map((t,n)=>t.transform(e[n])))}})}var Zw=JC(e=>Yw([e,Iw])),Qw=JC(e=>Yw([e,Lw]));function $w(e){return t=>Dw(lee(t.ast,e),{schema:t,identifier:e})}function eT(e,t){return n=>Dw(PS(n.ast,e.ast,t?Lb(t):Hb()),{from:n,to:e})}function tT(e){return t=>Dw(NS(t.ast,e),{schema:t})}function nT(e){return Fv(e,e=>xv(()=>eg(e,e=>e.issue)))}function rT(e,t){let n=t?.encodingStrategy===`omit`?Tb():bb();return t=>kw(Mw(t)).pipe(eT(t,{decode:Eb(nT(e)),encode:n}))}function iT(e){return Nw(e).pipe(tT(pv(e)))}function aT(e,t){return V({_tag:iT(e),...t})}function oT(e,t){return ow(t=>t instanceof e,t)}function sT(){return(e,t)=>new dx(e.ast,Lb(t))}var cT=dS;function lT(e,t){let n=e.source,r=e.flags,i=r===``?`new RegExp(${Ps(n)})`:`new RegExp(${Ps(n)}, ${Ps(r)})`;return hS(e,{toCode:()=>({runtime:`Schema.isPattern(${i})`}),...t})}var uT=Dw(pS);function dT(e){let t=ll(e.order),n=e.formatter??Ps;return(r,i)=>cT(e=>t(e,r),{expected:`a value greater than or equal to ${n(r)}`,arbitrary:{constraint:{ordered:{order:e.order,minimum:r}}},...e.annotate?.(r),...i})}function fT(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${Ps(e)}`);return e}var pT=dT({order:ol,annotate:e=>({representation:{id:`effect/schema/isGreaterThanOrEqualTo`,payload:{minimum:fT(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${Ps(e)})`})})});function mT(e){return cT(e=>globalThis.Number.isSafeInteger(e),{expected:`an integer`,representation:{id:`effect/schema/isInt`,payload:null},toJsonSchema:()=>({type:`integer`}),toCode:()=>({runtime:`Schema.isInt()`}),arbitrary:{constraint:{integer:!0}},...e})}var hT=Rw.check(mT());function gT(e,t){return e=Math.max(0,Math.floor(e)),cT(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:t})=>t===`array`?{minItems:e}:{minLength:e},toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[py]:!0,arbitrary:{constraint:{minLength:e}},...t})}function _T(e){return gT(1,e)}function vT(e){return cT(e=>eu(e).length===e.length,{expected:`an array with unique items`,representation:{id:`effect/schema/isUnique`,payload:null},toJsonSchema:()=>({uniqueItems:!0}),toCode:()=>({runtime:`Schema.isUnique()`}),arbitrary:{constraint:{unique:!0}},...e})}var U=B.check(_T());function yT(e){return Dw(aw()([e],([e])=>(t,n,r)=>dl(t)?fl(t)?mv:cy(OC(e)(t.value,r),{onSuccess:ul,onFailure:e=>Iy(n,`value`,e,t,r)}):bv(new Py(n,t,r)),{representation:{id:`effect/schema/Option`,payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.Option(${e[0].runtime})`,Type:`Option.Option<${e[0].Type}>`,importDeclarations:[`import * as Option from "effect/Option"`]}),expected:`Option`,toCodec:([e])=>sT()(Yw([V({_tag:Nw(`Some`),value:e}),V({_tag:Nw(`None`)})]),zb({decode:e=>e._tag===`None`?L():ul(e.value),encode:e=>R(e)?{_tag:`Some`,value:e.value}:{_tag:`None`}})),toArbitrary:([e])=>(t,n)=>{let r=t.constant(L());return RT(t,n,r,t.oneof(r,e.arbitrary.map(ul)))},toEquivalence:([e])=>El(e),toFormatter:([e])=>pl({onNone:()=>`none()`,onSome:t=>`some(${e(t)})`})}).ast,{value:e})}function bT(e){return Zw(e).pipe(eT(yT(jw(e)),Qb()))}function xT(e){return kw(e).pipe(eT(yT(jw(e)),$b()))}function ST(e,t){let n=typeof t?.label==`string`?t.label:void 0,r=t?.disallowJsonEncode===!0,i=n===void 0?r?{disallowJsonEncode:!0}:void 0:r?{label:n,disallowJsonEncode:!0}:{label:n},a=n===void 0?void 0:OC(Nw(n));return Dw(aw()([e],([e])=>(t,n,r)=>$C(t)?ly(a===void 0?_v:sy(a(t.label,r),e=>new Ay([`label`],e)),()=>cy(OC(e)(nw(t),r),{onSuccess:()=>t,onFailure:()=>new Ny(n,[new Ay([`value`],new Fy(void 0,t,r))],t,r)})):bv(new Py(n,t,r)),{representation:{id:`effect/schema/Redacted`,payload:i??null},toCode:({typeParameters:e})=>({runtime:i===void 0?`Schema.Redacted(${e[0].runtime})`:`Schema.Redacted(${e[0].runtime}, ${Ps(i)})`,Type:`Redacted.Redacted<${e[0].Type}>`,importDeclarations:[`import * as Redacted from "effect/Redacted"`]}),expected:`Redacted`,toCodecJson:([e])=>sT()(e,{decode:Sb(e=>ew(e,{label:n})),encode:r?_b(e=>`Cannot serialize Redacted`+(R(e)&&typeof e.value.label==`string`?` with label: "${e.value.label}"`:``)):Sb(nw)}),toArbitrary:([e])=>()=>({arbitrary:e.arbitrary.map(e=>ew(e,{label:n})),terminal:e.terminal?.map(e=>ew(e,{label:n}))}),toFormatter:()=>globalThis.String,toEquivalence:([e])=>rw(e)}).ast,{value:e})}function CT(e,t){return eT(ST(jw(e),{label:t?.label,disallowJsonEncode:t?.disallowEncode}),{decode:Sb(e=>ew(e,{label:t?.label})),encode:t?.disallowEncode?_b(e=>`Cannot encode Redacted`+(R(e)&&typeof e.value.label==`string`?` with label: "${e.value.label}"`:``)):Sb(nw)})(e)}function wT(e,t){return Dw(aw()([e,t],([e,t])=>(n,r,i)=>{if(!qh(n))return bv(new Py(r,n,i));switch(n._tag){case`Fail`:return cy(OC(e)(n.error,i),{onSuccess:Zh,onFailure:e=>Iy(r,`error`,e,n,i)});case`Die`:return cy(OC(t)(n.defect,i),{onSuccess:Qh,onFailure:e=>Iy(r,`defect`,e,n,i)});case`Interrupt`:return pv(n)}},{representation:{id:`effect/schema/CauseReason`,payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.CauseReason(${e[0].runtime}, ${e[1].runtime})`,Type:`Cause.Failure<${e[0].Type}, ${e[1].Type}>`,importDeclarations:[`import * as Cause from "effect/Cause"`]}),expected:`Cause.Failure`,toCodec:([e,t])=>sT()(Yw([V({_tag:Nw(`Fail`),error:e}),V({_tag:Nw(`Die`),defect:t}),V({_tag:Nw(`Interrupt`),fiberId:Qw(uT)})]),zb({decode:e=>{switch(e._tag){case`Fail`:return Zh(e.error);case`Die`:return Qh(e.defect);case`Interrupt`:return $h(e.fiberId)}},encode:lo})),toArbitrary:([e,t])=>TT(e,t),toEquivalence:([e,t])=>ET(e,t),toFormatter:([e,t])=>DT(e,t)}).ast,{error:e,defect:t})}function TT(e,t){return(n,r)=>{let i=n.constant($h());return RT(n,r,i,n.oneof(i,n.integer({min:1}).map($h),e.arbitrary.map(e=>Zh(e)),t.arbitrary.map(e=>Qh(e))))}}function ET(e,t){return(n,r)=>{if(n._tag!==r._tag)return!1;switch(n._tag){case`Fail`:return e(n.error,r.error);case`Die`:return t(n.defect,r.defect);case`Interrupt`:return n.fiberId===r.fiberId}}}function DT(e,t){return n=>{switch(n._tag){case`Fail`:return`Fail(${e(n.error)})`;case`Die`:return`Die(${t(n.defect)})`;case`Interrupt`:return`Interrupt`}}}function OT(e,t){return Dw(aw()([e,t],([e,t])=>{let n=H(wT(e,t));return(e,t,r)=>Kh(e)?cy(OC(n)(e.reasons,r),{onSuccess:Yh,onFailure:n=>Iy(t,`failures`,n,e,r)}):bv(new Py(t,e,r))},{representation:{id:`effect/schema/Cause`,payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.Cause(${e[0].runtime}, ${e[1].runtime})`,Type:`Cause.Cause<${e[0].Type}, ${e[1].Type}>`,importDeclarations:[`import * as Cause from "effect/Cause"`]}),expected:`Cause`,toCodec:([e,t])=>sT()(H(wT(e,t)),zb({decode:Yh,encode:({reasons:e})=>e})),toArbitrary:([e,t])=>kT(e,t),toEquivalence:([e,t])=>AT(e,t),toFormatter:([e,t])=>jT(e,t)}).ast,{error:e,defect:t})}function kT(e,t){return(n,r)=>{let i=TT(e,t)(n,r);return RT(n,r,n.constant(Xh),n.array(i.arbitrary).map(Yh))}}function AT(e,t){let n=Cs(ET(e,t));return(e,t)=>n(e.reasons,t.reasons)}function jT(e,t){let n=DT(e,t);return e=>`Cause([${e.reasons.map(n).join(`, `)}])`}var MT=e=>e?.includeStack===!0|(e?.excludeCause===!0?2:0),NT=e=>{switch(e){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},PT=[];function FT(e){let t=MT(e),n=PT[t];if(n!==void 0)return n;let r=lE.pipe(eT(Fw,Zb(NT(t))));return PT[t]=r,r}function IT(e,t,n){return Dw(aw()([e,t,n],([e,t,n])=>{let r=OT(t,n);return(t,n,i)=>{if(!ng(t))return bv(new Py(n,t,i));switch(t._tag){case`Success`:return cy(OC(e)(t.value,i),{onSuccess:rg,onFailure:e=>Iy(n,`value`,e,t,i)});case`Failure`:return cy(OC(r)(t.cause,i),{onSuccess:ig,onFailure:e=>Iy(n,`cause`,e,t,i)})}}},{representation:{id:`effect/schema/Exit`,payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.Exit(${e[0].runtime}, ${e[1].runtime}, ${e[2].runtime})`,Type:`Exit.Exit<${e[0].Type}, ${e[1].Type}, ${e[2].Type}>`,importDeclarations:[`import * as Exit from "effect/Exit"`]}),expected:`Exit`,toCodec:([e,t,n])=>sT()(Yw([V({_tag:Nw(`Success`),value:e}),V({_tag:Nw(`Failure`),cause:OT(t,n)})]),zb({decode:e=>e._tag===`Success`?rg(e.value):ig(e.cause),encode:e=>sg(e)?{_tag:`Success`,value:e.value}:{_tag:`Failure`,cause:e.cause}})),toArbitrary:([e,t,n])=>(r,i)=>{let a=kT(t,n)(r,i);return RT(r,i,LT(r,e.terminal?.map(e=>rg(e)),a.terminal?.map(e=>ig(e))),r.oneof(e.arbitrary.map(e=>rg(e)),a.arbitrary.map(e=>ig(e))))},toEquivalence:([e,t,n])=>{let r=AT(t,n);return(t,n)=>{if(t._tag!==n._tag)return!1;switch(t._tag){case`Success`:return e(t.value,n.value);case`Failure`:return r(t.cause,n.cause)}}},toFormatter:([e,t,n])=>{let r=jT(t,n);return t=>{switch(t._tag){case`Success`:return`Exit.Success(${e(t.value)})`;case`Failure`:return`Exit.Failure(${r(t.cause)})`}}}}).ast,{value:e,error:t,defect:n})}function LT(e,t,n){return t===void 0?n:n===void 0?t:e.oneof(t,n)}function RT(e,t,n,r){return{arbitrary:n===void 0||t.recursion===void 0?r:e.oneof(t.recursion,n,r),terminal:n}}globalThis.RegExp;var zT=B.annotate({expected:`a string that will be decoded as a URL`}),BT=oT(globalThis.URL,{representation:{id:`effect/schema/URL`,payload:null},toCode:()=>({runtime:`Schema.URL`,Type:`globalThis.URL`}),expected:`URL`,toCodecJson:()=>sT()(zT,ex),toArbitrary:()=>e=>e.webUrl().map(e=>new globalThis.URL(e)),toEquivalence:()=>(e,t)=>e.toString()===t.toString()}),VT=zT.pipe(eT(BT,ex));function HT(e,t,n){let r={...t};if(e?.minimum!==void 0){let t=n===void 0?e.minimum:n(e.minimum),i=e.exclusiveMinimum?new globalThis.Date(t.getTime()+1):t;(r.min===void 0||i.getTime()>r.min.getTime())&&(r.min=i)}if(e?.maximum!==void 0){let t=n===void 0?e.maximum:n(e.maximum),i=e.exclusiveMaximum?new globalThis.Date(t.getTime()-1):t;(r.max===void 0||i.getTime()<r.max.getTime())&&(r.max=i)}return r}var UT=B.annotate({expected:`a string that will be decoded as JSON`,contentMediaType:`application/json`});function WT(e,t){return UT.pipe(eT(e,tx(t)))}globalThis.File,globalThis.FormData,globalThis.URLSearchParams,globalThis.Uint8Array;var GT=ow(e=>eb(e)&&tb(e),{representation:{id:`effect/schema/DateTimeUtc`,payload:null},toCode:()=>({runtime:`Schema.DateTimeUtc`,Type:`DateTime.Utc`,importDeclarations:[`import * as DateTime from "effect/DateTime"`]}),expected:`DateTime.Utc`,toCodecJson:()=>sT()(B,nx),toArbitrary:()=>(e,t)=>e.date(HT(t?.constraint?.ordered?.order===rb?t.constraint.ordered:void 0,{noInvalidDate:!0},db)).map(e=>ib(e)),toFormatter:()=>e=>e.toString(),toEquivalence:()=>nb}),KT=B.annotate({expected:`a string that will be decoded as a DateTime.Utc`}).pipe(eT(GT,nx)),qT=globalThis.Symbol.for(`immer-draftable`),JT={};function YT(e,t,n,r,i){let a=QT(n,t,r),o=ZT(t),s=class extends e{constructor(...[e,t]){let r=t?.[`~payload`],i=r?.token===JT?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:JT,value:i}})}static[iw]=iw;get[o](){return o}static[qT]=!0;static identifier=t;static fields=n.fields;static get ast(){return a(this).ast}static pipe(){return oo(this,arguments)}static rebuild(e){return a(this).rebuild(e)}static make(e,t){return new this(e,t)}static makeOption(e,t){return wC(a(this))(e??{},t)}static makeEffect(e,t){return a(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(xS(this.ast,e))}static annotateKey(e){return this.rebuild(kS(this.ast,e))}static check(...e){return this.rebuild(CS(this.ast,e))}static extend(e){return(t,r)=>{let a=$T(t)?t:V(t),o={...n.fields,...a.fields},s=Gx(o,n.ast.checks,{identifier:e});return YT(this,e,Hw(CS(s,a.ast.checks),o),r,i)}}static mapFields(e,t){return n.mapFields(e,t)}};return i!==void 0&&Object.assign(s.prototype,i(t)),s}function XT(e){return new Fb(Sb(t=>new e(t,{"~payload":{token:JT,value:t}})),bb())}function ZT(e){return`~effect/Schema/Class/${e}`}function QT(e,t,n){let r;return i=>{if(r!==void 0)return r;let a=ZT(t),o=e=>e instanceof i||Fo(e,a),s=XT(i);return r=eT(Dw(new gx([e.ast],()=>(e,t,n)=>o(e)?pv(e):bv(new Py(t,e,n)),{identifier:t,[hy]:([e])=>({isConstructed:o,link:new dx(e,s)}),toCodec:([e])=>new dx(e.ast,s),toArbitrary:([e])=>()=>({arbitrary:e.arbitrary.map(e=>new i(e)),terminal:e.terminal?.map(e=>new i(e))}),toFormatter:([e])=>t=>`${i.identifier}(${e(t)})`,[my]:Zx(e.ast),...n})),s)(e)}}function $T(e){return Ow(e)}var W=e=>(t,n)=>YT(Bd,e,$T(t)?t:V(t),n,e=>({toString(){return`${e}(${Ps({...this})})`}})),G=e=>(t,n,r)=>{let i=$T(n)?n.mapFields(e=>({_tag:iT(t),...e}),{unsafePreserveChecks:!0}):aT(t,n);return W(e??t)(i,r)},eE=e=>(t,n)=>YT(Lc,e,$T(t)?t:V(t),n,e=>({name:e})),tE=e=>(t,n,r)=>{let i=$T(n)?n.mapFields(e=>({_tag:iT(t),...e}),{unsafePreserveChecks:!0}):aT(t,n);return eE(e??t)(i,r)};function nE(e){return Dw(rE(e.ast),{schema:e})}var rE=DS(e=>{let t=cE(e,rE),n=e.context;return t===e||n===void 0?t:see(t,iE(n))});function iE(e){return e.constructorDefault===void 0?e:new px(e.isOptional,e.isMutable,void 0,e.annotations)}function aE(e){if(e.propertySignatures.some(e=>typeof e.name!=`string`))throw new globalThis.Error(`Objects property names must be strings`,{cause:e})}function oE(e){return t=>{let n=new Map;for(let e=0;e<t.length;e++)n.set(VS(t[e]),e);let r=[...t].sort((t,r)=>{t=VS(t),r=VS(r);let i=e(t),a=e(r);return i===a?n.get(t)-n.get(r):i-a});return r.some((e,n)=>e!==t[n])?r:t}}var sE=oE(e=>{switch(e._tag){case`BigInt`:case`Symbol`:case`UniqueSymbol`:return 0;default:return 1}});function cE(e,t){switch(e._tag){case`Declaration`:{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!Oo(n))return yS(e,[dC]);let r=n(e.typeParameters.map(e=>KC(VS(e))));return r===void 0?e:yS(e,[wS(r,t)])}case`Unknown`:return yS(e,[dC]);case`ObjectKeyword`:return yS(e,[fC]);case`Undefined`:case`Void`:case`Literal`:case`Number`:return e.toCodecJson();case`UniqueSymbol`:case`Symbol`:case`BigInt`:return e.toCodecStringTree();case`Objects`:return aE(e),e.recur(t,JS);case`Union`:{let n=sE(e.types);return n===e.types?e.recur(t):new rS(n,e.mode,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t)}case`Arrays`:case`Suspend`:return e.recur(t)}return e}var lE=Dw(xS(uC,{toCode:()=>({runtime:`Schema.Json`,Type:`Schema.Json`})})),uE=Gw(B,lE),dE=bu(`effect/Crypto`),fE={"~effect/match/Match/Matcher":{_input:lo,_filters:lo,_remaining:lo,_result:lo,_return:lo,_args:lo},_tag:`TypeMatcher`,add(e){return pE(this.select,[...this.cases,e])},pipe(){return oo(this,arguments)}};function pE(e,t){let n=Object.create(fE);return n.select=e,n.cases=t,n}var mE=(e,t)=>({_tag:`When`,guard:e,evaluate:t}),hE=I(2,(e,t)=>_E(t)(pE(lo,[]))(e)),gE=e=>t=>{let n=mE(n=>n!=null&&Object.hasOwn(t,n[e]),n=>t[n[e]](n));return e=>e.add(n)},_E=(e=>t=>{let n=gE(e)(t);return e=>bE(n(e))})(`_tag`),vE=e=>{if(e._tag===`ValueMatcher`)return e.value;let t=e.cases.length;if(t===1){let t=e.cases[0];return(...n)=>{let r=e.select(...n);return t._tag===`When`&&t.guard(r)===!0||t._tag===`Not`&&t.guard(r)===!1?Dl(t.evaluate(r,...n)):Ol(r)}}return(...n)=>{let r=e.select(...n);for(let i=0;i<t;i++){let t=e.cases[i];if(t._tag===`When`&&t.guard(r)===!0||t._tag===`Not`&&t.guard(r)===!1)return Dl(t.evaluate(r,...n))}return Ol(r)}},yE=`effect/match/Match/exhaustive: absurd`,bE=e=>{let t=vE(e);if(Al(t)){if(Ml(t))return t.success;throw Error(yE)}return(...e)=>{let n=t(...e);if(Ml(n))return n.success;throw Error(yE)}},xE=hE,SE={"~effect/Ref":{_A:lo},...rc,toJSON(){return{_id:`Ref`,ref:this.ref}}},CE=e=>{let t=Object.create(SE);return t.ref=vC(e),t},wE=e=>gv(()=>CE(e)),TE=e=>gv(()=>e.ref.current),EE=I(2,(e,t)=>gv(()=>yC(e.ref,t))),DE=I(2,(e,t)=>gv(()=>{e.ref.current=t(e.ref.current)})),OE=`~effect/SynchronizedRef`,kE={...rc,[OE]:OE,toJSON(){return{_id:`SynchronizedRef`,value:this.backing.ref.current}}},AE=e=>{let t=Object.create(kE);return t.semaphore=bC(1),t.backing=CE(e),t},jE=e=>gv(()=>AE(e)),ME=e=>e.backing.ref.current,NE=I(2,(e,t)=>e.semaphore.withPermit(hv(()=>Av(t(ME(e)),([t,n])=>(e.backing.ref.current=n,t)))));U.pipe($w(`InstanceDirectory`));var PE=e=>B.check(lT(/\S/u,{message:e})),FE=B.check(lT(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,{message:`Expected a kebab-case Agent name`})).pipe($w(`AgentName`)),IE=PE(`Expected a non-blank model id`).pipe($w(`ModelId`)),LE=PE(`Expected a non-blank Agent persona`).pipe($w(`AgentPersona`)),RE=Xw([`claude`,`codex`,`pi`]),zE=Xw([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`]),BE=class extends W(`Agent/BrainSpec`)({harness:RE,model:IE,effort:zE}){},VE=class extends W(`Agent`)({name:FE,brain:BE,parentModel:bT(IE),persona:LE}){},HE=U.pipe($w(`AgentSessionId`)),UE=Yw([class extends G(`Agent/ParentSession`)(`ParentSession`,{id:HE,agent:FE,brain:BE}){},class extends G(`Agent/ChildSession`)(`ChildSession`,{id:HE,parentId:HE,agent:FE,brain:BE}){}]),WE=class extends G(`Agent/SessionStarted`)(`SessionStarted`,{session:UE}){},GE=class extends G(`Agent/TextOutput`)(`TextOutput`,{session:UE,text:U}){},KE=class extends G(`Agent/ToolStarted`)(`ToolStarted`,{session:UE,callId:U,tool:U,input:lE}){},qE=class extends G(`Agent/ToolFinished`)(`ToolFinished`,{session:UE,callId:U,tool:U,output:lE,isError:zw}){},JE=class extends G(`Agent/SessionFinished`)(`SessionFinished`,{session:UE}){},YE=Xw([`apiKeys`,`claudePlan`,`chatgptPlan`]),XE=class extends W(`Agent/RateLimitWindow`)({usedPercent:Rw,windowDurationMinutes:bT(Rw),resetsAt:bT(KT)}){},ZE=class extends W(`Agent/RateLimitsSnapshot`)({limitId:bT(B),limitName:bT(B),primary:bT(XE),secondary:bT(XE)}){},QE=Yw([WE,GE,KE,qE,class extends G(`Agent/PoolRateLimitsUpdated`)(`PoolRateLimitsUpdated`,{session:UE,pool:YE,rateLimits:ZE}){},JE]),$E=(e,t)=>hl([e.parentModel,t]),eD=B.check(lT(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u,{message:`Expected a full GitHub repo name (owner/name)`})).pipe($w(`RepoName`)),tD=B.check(lT(/^[^\s-]\S*$/u,{message:`Expected a git revision without whitespace or a leading dash`})).pipe($w(`RepositoryRevision`)),nD=B.check(lT(/^[0-9a-f]{40}(?:[0-9a-f]{24})?$/u,{message:`Expected a 40- or 64-character lowercase git object id`})).pipe($w(`CommitSha`)),rD=e=>{let t=e.indexOf(`/`);return{owner:e.slice(0,t),name:e.slice(t+1)}},iD=e=>e.toLowerCase(),aD=class extends tE(`AttemptFailure/InfraFailure`)(`InfraFailure`,{message:B,cause:FT()}){},oD=class extends tE(`AttemptFailure/AgentFailure`)(`AgentFailure`,{message:B}){},sD=Xw([`wall-clock`,`tokens`]),cD=Yw([aD,oD,class extends tE(`AttemptFailure/RunawayFailure`)(`RunawayFailure`,{ceiling:sD}){}]),lD=fw(aD),uD=U.pipe($w(`EventId`)),dD=U.pipe($w(`DedupKey`)),fD=class extends W(`Event`)({id:uD,dedupKey:dD,payload:lE,receivedAt:GT}){},pD=U.pipe($w(`LoopName`)),mD=[`none`,`required`],hD=Xw(mD),gD=class extends G(`CancelReason/OperatorCanceled`)(`OperatorCanceled`,{}){},_D=class extends G(`CancelReason/Superseded`)(`Superseded`,{by:uD}){},vD=class extends G(`CancelReason/Revoked`)(`Revoked`,{}){},yD=Yw([gD,_D,vD]),bD=class extends G(`RunState/Pending`)(`Pending`,{}){},xD=class extends G(`RunState/Waiting`)(`Waiting`,{}){},SD=class extends G(`RunState/Running`)(`Running`,{}){},CD=class extends G(`RunState/Succeeded`)(`Succeeded`,{}){},wD=class extends G(`RunState/Failed`)(`Failed`,{}){},TD=class extends G(`RunState/Canceled`)(`Canceled`,{reason:yD}){},ED=Yw([bD,xD,SD]),DD=Yw([...ED.members,CD,wD,TD]),OD=fw(ED),kD=()=>(...e)=>e,AD=kD()(`Pending`,`Waiting`,`Running`),jD=kD()(`Pending`,`Waiting`,`Running`,`Succeeded`,`Failed`,`Canceled`),MD=kD()(`Pending`,`Waiting`),ND=e=>new xD,PD=e=>new SD,FD=e=>new CD,ID=e=>new wD,LD=e=>new SD,RD=e=>new TD({reason:new gD}),zD=(e,t)=>new TD({reason:new _D({by:t})}),BD=e=>new TD({reason:new vD}),VD=U.pipe($w(`RunId`)),HD=class extends W(`Run`)({id:VD,eventId:uD,loop:pD,state:DD,openedAt:GT}){},UD=Yw([class extends G(`StepResult/Commit`)(`Commit`,{sha:nD,summary:U}){},class extends G(`StepResult/PullRequest`)(`PullRequest`,{number:hT.check(pT(1)),url:BT}){},class extends G(`StepResult/Comment`)(`Comment`,{url:BT}){}]),WD=class extends W(`StepResult`)({message:U,facts:H(UD)}){},GD=U.pipe($w(`StepName`)),KD=class extends W(`Step`)({runId:VD,name:GD,result:yT(WD)}){},qD=Xw([`local`,`exe.dev`]),JD=B.check(lT(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,{message:`Expected a kebab-case Worker name`})).pipe($w(`WorkerName`)),YD=U.pipe($w(`AttemptId`)),XD=hT.check(pT(1)).pipe($w(`AttemptNumber`)),ZD=class extends G(`AttemptOutcome/Succeeded`)(`Succeeded`,{}){},QD=class extends G(`AttemptOutcome/Failed`)(`Failed`,{failure:cD}){},$D=class extends G(`AttemptOutcome/Canceled`)(`Canceled`,{}){},eO=Yw([ZD,QD,$D]),tO=class extends W(`Attempt`)({id:YD,runId:VD,stepName:GD,worker:JD,number:XD,brain:BE,parentModel:bT(IE),startedAt:GT,outcome:yT(eO)}){},nO=e=>lD(e.failure)&&e.number<e.maxAutoAttempts,uee=hT.check(pT(1)).pipe($w(`AttemptChannelSequence`)),rO=[`inbound`,`outbound`],iO=Xw(rO),aO=B.check(lT(/\S/u,{message:`Expected non-blank task text`})).pipe($w(`AttemptTask`)),dee=class extends W(`AttemptChannel/RunSpec`)({attemptId:YD,repository:eD,revision:tD,baseCommit:nD,payload:lE,task:aO,agent:VE,parentModel:bT(IE)}){},oO=class extends G(`AttemptChannel/Started`)(`Started`,{parentModel:IE}){},sO=class extends G(`AttemptChannel/SessionEvent`)(`SessionEvent`,{event:QE}){},cO=class extends G(`AttemptChannel/Final`)(`Final`,{result:WD}){},fee=class extends G(`AttemptChannel/Failed`)(`Failed`,{failure:cD}){},lO=class extends G(`AttemptChannel/Interrupted`)(`Interrupted`,{}){},pee=Yw([oO,sO,cO,fee,lO]),uO=class extends G(`AttemptChannel/Steer`)(`Steer`,{message:U}){},dO=class extends G(`AttemptChannel/Interrupt`)(`Interrupt`,{}){},mee=Yw([uO,dO]),fO={version:Nw(3),attemptId:YD,sequence:uee,sentAt:KT},pO=class extends G(`AttemptChannel/OutboundEnvelope`)(`OutboundEnvelope`,{...fO,payload:pee}){},mO=class extends G(`AttemptChannel/InboundEnvelope`)(`InboundEnvelope`,{...fO,payload:mee}){},hO=Yw([pO,mO]),gO=Yw([class extends G(`AttemptChannel/Start`)(`Start`,{version:Nw(3),spec:dee}){},mO]);WT(hO),WT(gO),WT(pO);var _O=U.pipe($w(`ItemKey`)),vO=hT.check(pT(1)).pipe($w(`ItemNumber`)),yO=class extends bu()(`@usine/expression/ExpressionEngine`){},bO=B.check(lT(/\S/u,{message:`Expected a non-blank CEL expression`})).pipe($w(`ExpressionSource`)),xO=B.check(lT(/^(?:[A-Za-z_][A-Za-z0-9_.]*|list<[A-Za-z_][A-Za-z0-9_.]*>|map<[A-Za-z_][A-Za-z0-9_.]*,[A-Za-z_][A-Za-z0-9_.]*>)$/u,{message:`Expected a CEL type reference`})).pipe($w(`CelTypeReference`)),SO=B.check(lT(/^[A-Za-z_][A-Za-z0-9_]*$/u,{message:`Expected a CEL identifier`})),CO=B.check(lT(/^[A-Za-z_][A-Za-z0-9_.]*$/u,{message:`Expected a CEL object-type name`})),wO=e=>cT(e=>new Set(e.map(({name:e})=>e)).size===e.length,{message:e}),TO=class extends W(`@usine/expression/ObjectField`)({name:SO,type:xO}){},EO=class extends W(`@usine/expression/ObjectType`)({name:CO,fields:H(TO).check(wO(`Expected unique CEL object-field names`))}){},DO=class extends W(`@usine/expression/Variable`)({name:SO,type:xO}){},OO=class extends W(`@usine/expression/Environment`)({types:H(EO).check(wO(`Expected unique CEL object-type names`)),variables:H(DO).check(wO(`Expected unique CEL variable names`))}){},kO=hT.check(pT(0)),AO=Xw([`check_failed`,`parse_error`,`type_error`,`unexpected_result_type`]);Yw([class extends tE(`@usine/expression/ExpressionCheckError`)(`ExpressionCheckError`,{source:bO,code:AO,message:U,position:yT(kO)}){},class extends tE(`@usine/expression/ExpressionEvaluationError`)(`ExpressionEvaluationError`,{source:bO,message:U}){}]),Yw([B,Rw,Bw,zw,Iw]);var jO=U.pipe($w(`InstancePath`)),MO=Xw([`expression`,`frontmatter`,`read`,`reference`,`schema`,`yaml`]),NO=class extends tE(`@usine/config/ConfigFileError`)(`ConfigFileError`,{file:jO,stage:MO,expression:xT(bO),message:U}){};Yw([NO,class extends tE(`@usine/config/FactoryConfigError`)(`FactoryConfigError`,{file:jO,stage:MO,message:U}){}]);var PO=lT(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,{message:`Expected a kebab-case filename identity`}),FO=e=>B.check(lT(/\S/u,{message:e})),IO=FE,LO=pD.check(PO),RO=JD,zO=eD,BO=FO(`Expected a non-blank registry tag`).pipe($w(`RegistryTag`)),VO=FO(`Expected a non-blank lane name`).pipe($w(`LaneName`)),HO=FO(`Expected a non-blank GitHub label name`).pipe($w(`GitHubLabelName`)),UO=Xw([`issue-open`,`issue-closed`,`pr-open`,`pr-closed`,`pr-merged`]),WO=Yw([class extends W(`@usine/config/LabelLaneSource`)({label:HO}){},class extends W(`@usine/config/StateLaneSource`)({state:UO}){}]),GO=class extends W(`@usine/config/Lane`)({name:VO,sources:H(WO).check(_T())}){},KO=IE,qO=B.check(lT(/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/u,{message:`Expected a GitHub login`})).pipe($w(`OperatorLogin`)),JO=FO(`Expected a non-blank Markdown prompt`).pipe($w(`PromptTemplate`)),YO=LE,XO=hT.check(pT(1)),ZO=cT(e=>new Set(e.map(({name:e})=>e)).size===e.length,{message:`Expected unique names`}),QO=e=>`label`in e?`label:${e.label}`:`state:${e.state}`,$O=cT(e=>{let t=e.flatMap(({sources:e})=>e.map(QO));return new Set(t).size===t.length},{message:`Expected every lane source to be mapped once`}),ek=H(GO).check(ZO,$O),tk=class extends W(`@usine/config/ManagedRepo`)({name:zO,tags:H(BO).check(vT()).pipe(rT(pv([]))),lanes:ek.pipe(rT(pv([])))}){},nk=qD,rk=class extends W(`@usine/config/Worker`)({name:RO,kind:nk,maxConcurrentAttempts:XO.pipe(rT(pv(1)))}){},ik=class extends W(`@usine/config/Settings`)({pollInterval:XO.pipe(rT(pv(60))),maxChildren:XO.pipe(rT(pv(4))),maxAttemptMinutes:XO.pipe(rT(pv(60))),maxAttemptTokens:XO.pipe(rT(pv(1e7))),parentModel:xT(KO)}){},ak=Yw([V({mode:Nw(`off`)}),V({mode:Nw(`deliveries`)}),V({mode:Nw(`endpoint`),publicUrl:VT}).pipe(Ww({publicUrl:`public_url`}))]),ok=ik.pipe(Ww({pollInterval:`poll_interval`,maxChildren:`max_children`,maxAttemptMinutes:`max_attempt_minutes`,maxAttemptTokens:`max_attempt_tokens`,parentModel:`parent_model`})),sk=rk.pipe(Ww({maxConcurrentAttempts:`max_concurrent_attempts`})),ck=H(tk).check(ZO),lk=H(sk).check(_T(),ZO),uk=class extends W(`@usine/config/UsineConfig`)({version:Nw(1),repos:ck,settings:ok.pipe(rT(pv({}))),workers:lk.pipe(rT(pv([{name:`local`,kind:`local`}]))),webhooks:ak.pipe(rT(pv({mode:`off`}))),operator:xT(qO)}){},dk=class extends W(`@usine/config/Selector`)({repos:xT(H(zO).check(_T(),vT())),tags:xT(H(BO).check(_T(),vT()))}){}.check(cT(e=>R(e.repos)||R(e.tags),{message:`Expected selector.repos, selector.tags, or both`})),fk=B.check(cT(e=>e.trim().split(/\s+/u).length===5&&Ml(V_(e)),{message:`Expected a valid five-field cron expression`})).pipe($w(`Cron`)),pk=B.check(cT(e=>R(lb(e)),{message:`Expected an IANA time-zone name`})).pipe($w(`TimeZone`)),mk=Yw([class extends W(`@usine/config/IssueTrigger`)({on:Nw(`issue`),if:bO}){},class extends W(`@usine/config/PullRequestTrigger`)({on:Nw(`pr`),if:bO}){},class extends W(`@usine/config/ScheduleTrigger`)({on:Nw(`schedule`),if:bO,cron:fk,tz:pk.pipe(rT(pv(`UTC`)))}){}]),hk=class extends W(`@usine/config/LoopFile`)({name:LO,trigger:mk,selector:yT(dk),approval:hD,step:GD,agent:IO,body:JO}){},gk=RE,_k=zE,vk=class extends W(`@usine/config/AgentFile`)({name:IO,harness:gk,model:KO,effort:_k,parentModel:yT(KO),persona:YO}){},yk=class extends W(`@usine/config/InvalidAgent`)({file:jO,error:NO}){},bk=class extends W(`@usine/config/QuarantinedLoop`)({file:jO,error:NO}){},xk=e=>jO.make(`loops/${e}.md`),Sk=(e,t)=>({agentNames:new Set(t.map(({name:e})=>e)),registryTags:new Set(e.repos.flatMap(({tags:e})=>e)),repoNames:new Set(e.repos.map(({name:e})=>e))}),Ck=(e,t,n)=>{let r=t=>ul(new NO({file:e,stage:`reference`,expression:L(),message:t}));if(!n.agentNames.has(t.agent))return r(`Unknown agent: ${t.agent}`);if(fl(t.selector))return L();if(R(t.selector.value.repos)){let e=t.selector.value.repos.value.filter(e=>!n.repoNames.has(e));if(e.length>0)return r(`Unknown selector repos: ${e.join(`, `)}`)}if(R(t.selector.value.tags)){let e=t.selector.value.tags.value.filter(e=>!n.registryTags.has(e));if(e.length>0)return r(`Unknown selector tags: ${e.join(`, `)}`)}return L()};W(`@usine/config/LoadedInstance`)(V({config:uk,agents:H(vk),invalidAgents:H(yk),loops:H(hk),quarantinedLoops:H(bk)}).check(cT(({agents:e,config:t,loops:n})=>{let r=Sk(t,e);return n.every(e=>fl(Ck(xk(e.name),e,r)))},{message:`Expected every loop to reference the loaded roster and registry`})));var wk=(e,t,n)=>{let r=`${t}---`,i=e.indexOf(r,n);for(;i>=0;){let n=i+r.length;if(n===e.length||e.startsWith(t,n))return i;i=e.indexOf(r,n)}return-1},Tk=(e,t)=>{let n=t.startsWith(`---\r
15
+ `)?`\r
16
+ `:t.startsWith(`---
17
+ `)?`
18
+ `:void 0;if(n===void 0)return new NO({file:e,stage:`frontmatter`,expression:L(),message:`Expected the file to start with a YAML frontmatter delimiter (---)`});let r=3+n.length,i=`${n}---`,a=wk(t,n,r);if(a<0)return new NO({file:e,stage:`frontmatter`,expression:L(),message:`Expected a closing YAML frontmatter delimiter (---)`});let o=a+i.length,s=t.startsWith(n,o)?o+n.length:o;return pv({yaml:t.slice(r,a),body:t.slice(s),newline:n})},Ek=xw(xO),Dk=(e,t)=>new EO({name:e,fields:t.map(([e,t])=>new TO({name:e,type:Ek(t)}))}),Ok=Dk(`Actor`,[[`login`,`string`]]),kk=Dk(`Label`,[[`name`,`string`]]),Ak=Dk(`Milestone`,[[`title`,`string`]]),jk=Dk(`IssueType`,[[`name`,`string`]]),Mk=Dk(`Commit`,[[`oid`,`string`]]),Nk=Dk(`RepoContext`,[[`name`,`string`],[`owner`,`string`],[`url`,`string`]]),Pk=Dk(`Labels`,[[`totalCount`,`int`],[`nodes`,`list<Label>`]]),Fk=Dk(`Assignees`,[[`totalCount`,`int`],[`nodes`,`list<Actor>`]]),Ik=Dk(`IssueComment`,[[`author`,`Actor`],[`body`,`string`],[`createdAt`,`string`]]),Lk=Dk(`IssueComments`,[[`totalCount`,`int`],[`nodes`,`list<IssueComment>`]]),Rk=Dk(`PullRequestReference`,[[`number`,`int`],[`state`,`string`],[`isDraft`,`bool`],[`url`,`string`]]),zk=Dk(`PullRequestReferences`,[[`totalCount`,`int`],[`nodes`,`list<PullRequestReference>`]]),Bk=Dk(`IssuePayload`,[[`number`,`int`],[`title`,`string`],[`body`,`string`],[`url`,`string`],[`state`,`string`],[`stateReason`,`string`],[`createdAt`,`string`],[`updatedAt`,`string`],[`closedAt`,`string`],[`author`,`Actor`],[`issueType`,`IssueType`],[`milestone`,`Milestone`],[`labels`,`Labels`],[`assignees`,`Assignees`],[`comments`,`IssueComments`],[`closedByPullRequestsReferences`,`PullRequestReferences`]]),Vk=Dk(`RequestedReviewer`,[[`login`,`string`]]),Hk=Dk(`ReviewRequest`,[[`requestedReviewer`,`RequestedReviewer`]]),Uk=Dk(`ReviewRequests`,[[`totalCount`,`int`],[`nodes`,`list<ReviewRequest>`]]),hee=Dk(`Review`,[[`author`,`Actor`],[`state`,`string`],[`body`,`string`],[`submittedAt`,`string`],[`commit`,`Commit`]]),gee=Dk(`Reviews`,[[`totalCount`,`int`],[`nodes`,`list<Review>`]]),_ee=Dk(`ReviewThreadComment`,[[`author`,`Actor`],[`body`,`string`]]),vee=Dk(`ReviewThreadComments`,[[`totalCount`,`int`],[`nodes`,`list<ReviewThreadComment>`]]),yee=Dk(`ReviewThread`,[[`isResolved`,`bool`],[`isOutdated`,`bool`],[`path`,`string`],[`comments`,`ReviewThreadComments`]]),bee=Dk(`ReviewThreads`,[[`totalCount`,`int`],[`nodes`,`list<ReviewThread>`]]),xee=Dk(`PullRequestComment`,[[`author`,`Actor`],[`body`,`string`],[`createdAt`,`string`]]),See=Dk(`PullRequestComments`,[[`totalCount`,`int`],[`nodes`,`list<PullRequestComment>`]]),Cee=Dk(`ClosingIssueReference`,[[`number`,`int`],[`state`,`string`]]),wee=Dk(`ClosingIssueReferences`,[[`totalCount`,`int`],[`nodes`,`list<ClosingIssueReference>`]]),Wk=Dk(`StatusCheckRollup`,[[`state`,`string`]]),Gk=Dk(`PullRequestPayload`,[[`number`,`int`],[`title`,`string`],[`body`,`string`],[`url`,`string`],[`state`,`string`],[`isDraft`,`bool`],[`merged`,`bool`],[`createdAt`,`string`],[`updatedAt`,`string`],[`mergedAt`,`string`],[`author`,`Actor`],[`baseRefName`,`string`],[`headRefName`,`string`],[`headRefOid`,`string`],[`additions`,`int`],[`deletions`,`int`],[`changedFiles`,`int`],[`reviewDecision`,`string`],[`statusCheckRollup`,`StatusCheckRollup`],[`labels`,`Labels`],[`reviewRequests`,`ReviewRequests`],[`reviews`,`Reviews`],[`reviewThreads`,`ReviewThreads`],[`comments`,`PullRequestComments`],[`closingIssuesReferences`,`ClosingIssueReferences`]]),Kk=Dk(`Tick`,[[`scheduledAt`,`string`],[`scheduledAtLocal`,`string`],[`cron`,`string`],[`tz`,`string`]]),qk=Dk(`SchedulePayload`,[[`tick`,`Tick`]]),Jk=(e,t)=>new OO({types:[Nk,...e],variables:[new DO({name:`repo`,type:Ek(`RepoContext`)}),new DO({name:`item`,type:Ek(t)})]}),Yk=Jk([Ok,kk,Ak,jk,Pk,Fk,Ik,Lk,Rk,zk,Bk],`IssuePayload`),Xk=Jk([Ok,kk,Mk,Pk,Vk,Hk,Uk,hee,gee,_ee,vee,yee,bee,xee,See,Cee,wee,Wk,Gk],`PullRequestPayload`),Zk=Jk([Kk,qk],`SchedulePayload`),Qk=e=>{switch(e){case`issue`:return Yk;case`pr`:return Xk;case`schedule`:return Zk}},$k=e=>{let{owner:t}=rD(e.name);return{name:e.name,owner:t,url:`https://github.com/${e.name}`}},eA=Symbol.for(`yaml.alias`),tA=Symbol.for(`yaml.document`),nA=Symbol.for(`yaml.map`),rA=Symbol.for(`yaml.pair`),iA=Symbol.for(`yaml.scalar`),aA=Symbol.for(`yaml.seq`),oA=Symbol.for(`yaml.node.type`),sA=e=>!!e&&typeof e==`object`&&e[oA]===eA,cA=e=>!!e&&typeof e==`object`&&e[oA]===tA,lA=e=>!!e&&typeof e==`object`&&e[oA]===nA,uA=e=>!!e&&typeof e==`object`&&e[oA]===rA,dA=e=>!!e&&typeof e==`object`&&e[oA]===iA,fA=e=>!!e&&typeof e==`object`&&e[oA]===aA;function pA(e){if(e&&typeof e==`object`)switch(e[oA]){case nA:case aA:return!0}return!1}function mA(e){if(e&&typeof e==`object`)switch(e[oA]){case eA:case nA:case iA:case aA:return!0}return!1}var hA=e=>(dA(e)||pA(e))&&!!e.anchor,gA=Symbol(`break visit`),_A=Symbol(`skip children`),vA=Symbol(`remove node`);function yA(e,t){let n=xA(t);cA(e)?bA(null,e.contents,n,Object.freeze([e]))===vA&&(e.contents=null):bA(null,e,n,Object.freeze([]))}yA.BREAK=gA,yA.SKIP=_A,yA.REMOVE=vA;function bA(e,t,n,r){let i=SA(e,t,n,r);if(mA(i)||uA(i))return CA(e,r,i),bA(e,i,n,r);if(typeof i!=`symbol`){if(pA(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=bA(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===gA)return gA;else i===vA&&(t.items.splice(e,1),--e)}}else if(uA(t)){r=Object.freeze(r.concat(t));let e=bA(`key`,t.key,n,r);if(e===gA)return gA;e===vA&&(t.key=null);let i=bA(`value`,t.value,n,r);if(i===gA)return gA;i===vA&&(t.value=null)}}return i}function xA(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function SA(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(lA(t))return n.Map?.(e,t,r);if(fA(t))return n.Seq?.(e,t,r);if(uA(t))return n.Pair?.(e,t,r);if(dA(t))return n.Scalar?.(e,t,r);if(sA(t))return n.Alias?.(e,t,r)}function CA(e,t,n){let r=t[t.length-1];if(pA(r))r.items[e]=n;else if(uA(r))e===`key`?r.key=n:r.value=n;else if(cA(r))r.contents=n;else{let e=sA(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var wA={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},TA=e=>e.replace(/[!,[\]{}]/g,e=>wA[e]),EA=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+TA(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&mA(e.contents)){let t={};yA(e.contents,(e,n)=>{mA(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)(i!==`!!`||a!==`tag:yaml.org,2002:`)&&(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
19
+ `)}};EA.defaultYaml={explicit:!1,version:`1.2`},EA.defaultTags={"!!":`tag:yaml.org,2002:`};function DA(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function OA(e){let t=new Set;return yA(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function kA(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function AA(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=OA(e);let a=kA(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(dA(t.node)||pA(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function jA(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=jA(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=jA(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=jA(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=jA(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function MA(e,t,n){if(Array.isArray(e))return e.map((e,t)=>MA(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!hA(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var NA=class{constructor(e){Object.defineProperty(this,oA,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!cA(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=MA(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?jA(i,{"":o},``,o):o}},PA=class extends NA{constructor(e){super(eA),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],yA(e,{Node:(e,t)=>{(sA(t)||hA(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(MA(a,null,t),n.get(a)),!o||o.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=FA(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(DA(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function FA(e,t,n){if(sA(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(pA(t)){let r=0;for(let i of t.items){let t=FA(e,i,n);t>r&&(r=t)}return r}if(uA(t)){let r=FA(e,t.key,n),i=FA(e,t.value,n);return Math.max(r,i)}return 1}var IA=e=>!e||typeof e!=`function`&&typeof e!=`object`,LA=class extends NA{constructor(e){super(iA),this.value=e}toJSON(e,t){return t?.keep?this.value:MA(this.value,e,t)}toString(){return String(this.value)}};LA.BLOCK_FOLDED=`BLOCK_FOLDED`,LA.BLOCK_LITERAL=`BLOCK_LITERAL`,LA.PLAIN=`PLAIN`,LA.QUOTE_DOUBLE=`QUOTE_DOUBLE`,LA.QUOTE_SINGLE=`QUOTE_SINGLE`;var RA=`tag:yaml.org,2002:`;function zA(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function BA(e,t,n){if(cA(e)&&(e=e.contents),mA(e))return e;if(uA(e)){let t=n.schema[nA].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new PA(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=RA+t.slice(2));let l=zA(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new LA(e);return c&&(c.node=t),t}l=e instanceof Map?o[nA]:Symbol.iterator in Object(e)?o[aA]:o[nA]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new LA(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function VA(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return BA(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var HA=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,UA=class extends NA{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>mA(t)||uA(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(HA(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(pA(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,VA(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(pA(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&dA(i)?i.value:i:pA(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!uA(t))return!1;let n=t.value;return n==null||e&&dA(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return pA(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(pA(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,VA(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},WA=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function GA(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var KA=(e,t,n)=>e.endsWith(`
20
+ `)?GA(n,t):n.includes(`
21
+ `)?`
22
+ `+GA(n,t):(e.endsWith(` `)?``:` `)+n,qA=`flow`,JA=`block`,YA=`quoted`;function XA(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=ZA(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
23
+ `)n===`block`&&(h=ZA(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
24
+ `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
25
+ `&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function ZA(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
26
+ `);r=t,i=t+1,a=e[i]}return r}var QA=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),$A=e=>/^(%|---|\.\.\.)/m.test(e);function ej(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
27
+ `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function tj(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||($A(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
28
+
29
+ `;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
30
+ `,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:XA(o,a,YA,QA(t,!1))}function nj(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
31
+ `)||/[ \t]\n|\n[ \t]/.test(e))return tj(e,t);let n=t.indent||($A(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:XA(r,n,qA,QA(t,!1))}function rj(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=tj;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?nj:i&&!t?tj:n?nj:tj}return r(e,t)}var ij;try{ij=RegExp(`(^|(?<!
32
+ ))
33
+ +(?!
34
+ |$)`,`g`)}catch{ij=/\n+(?!\n|$)/g}function aj({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return rj(n,r);let l=r.indent||(r.forceBlockIndent||$A(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===LA.BLOCK_FOLDED?!1:t===LA.BLOCK_LITERAL||!ej(n,c,l.length);if(!n)return u?`|
35
+ `:`>
36
+ `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
37
+ `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
38
+ `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
39
+ `&&(p=p.slice(0,-1)),p.replace(ij,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
40
+ `)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
41
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=QA(r,!0);o!==`folded`&&t!==LA.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=XA(`${v}${e}${p}`,l,JA,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function oj(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
42
+ `)||u&&/[[\]{},]/.test(a))return rj(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
43
+ `)?rj(a,t):aj(e,t,n,r);if(!s&&!u&&i!==LA.PLAIN&&a.includes(`
44
+ `))return aj(e,t,n,r);if($A(a)){if(c===``)return t.forceBlockIndent=!0,aj(e,t,n,r);if(s&&c===l)return rj(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return rj(a,t)}return s?d:XA(d,c,qA,QA(t,!1))}function sj(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==LA.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=LA.QUOTE_DOUBLE);let c=e=>{switch(e){case LA.BLOCK_FOLDED:case LA.BLOCK_LITERAL:return i||a?rj(o.value,t):aj(o,t,n,r);case LA.QUOTE_DOUBLE:return tj(o.value,t);case LA.QUOTE_SINGLE:return nj(o.value,t);case LA.PLAIN:return oj(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function cj(e,t){let n=Object.assign({blockQuote:!0,commentString:WA,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function lj(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(dA(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function uj(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(dA(e)||pA(e))&&e.anchor;a&&DA(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function dj(e,t,n,r){if(uA(e))return e.toString(t,n,r);if(sA(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=mA(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=lj(t.doc.schema.tags,a);let o=uj(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):dA(a)?sj(a,t,n,r):a.toString(t,n,r);return o?dA(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function fj({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=mA(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(pA(e)||!mA(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||pA(e)||(dA(e)?e.type===LA.BLOCK_FOLDED||e.type===LA.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=dj(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=KA(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=KA(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=KA(g,n.indent,l(f))));let _,v,y;mA(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&dA(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&fA(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=dj(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
45
+ `:``,v){let e=l(v);S+=`\n${GA(e,n.indent)}`}x===``&&!n.inFlow?S===`
46
+ `&&(S=`
47
+
48
+ `):S+=`\n${n.indent}`}else if(!p&&pA(t)){let e=x[0],r=x.indexOf(`
49
+ `),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
50
+ `)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=KA(g,n.indent,l(y)):h&&i&&i(),g}function pj(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var mj=`<<`,hj={identify:e=>e===mj||typeof e==`symbol`&&e.description===mj,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new LA(Symbol(mj)),{addToJSMap:_j}),stringify:()=>mj},gj=(e,t)=>(hj.identify(t)||dA(t)&&(!t.type||t.type===LA.PLAIN)&&hj.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===hj.tag&&e.default);function _j(e,t,n){if(n=e&&sA(n)?n.resolve(e.doc):n,fA(n))for(let r of n.items)vj(e,t,r);else if(Array.isArray(n))for(let r of n)vj(e,t,r);else vj(e,t,n)}function vj(e,t,n){let r=e&&sA(n)?n.resolve(e.doc):n;if(!lA(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function yj(e,t,{key:n,value:r}){if(mA(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(gj(e,n))_j(e,t,r);else{let i=MA(n,``,e);if(t instanceof Map)t.set(i,MA(r,i,e));else if(t instanceof Set)t.add(i);else{let a=bj(n,i,e),o=MA(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function bj(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(mA(e)&&n?.doc){let t=cj(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),pj(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function xj(e,t,n){return new Sj(BA(e,void 0,n),BA(t,void 0,n))}var Sj=class e{constructor(e,t=null){Object.defineProperty(this,oA,{value:rA}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return mA(n)&&(n=n.clone(t)),mA(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return yj(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?fj(this,e,t,n):JSON.stringify(this)}};function Cj(e,t,n){return(t.inFlow??e.flow?Tee:wj)(e,t,n)}function wj({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(mA(i))!d&&i.spaceBefore&&f.push(``),Tj(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(uA(i)){let e=mA(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Tj(n,f,e.commentBefore,d))}d=!1;let s=dj(i,u,()=>o=null,()=>d=!0);o&&(s+=KA(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
51
+ `}}return e?(p+=`
52
+ `+GA(l(e),c),s&&s()):d&&o&&o(),p}function Tee({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(mA(i))i.spaceBefore&&d.push(``),Tj(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(uA(i)){let e=mA(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Tj(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=mA(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=dj(i,c,()=>a=null);n<e.length-1&&(o+=`,`),a&&(o+=KA(o,r,s(a))),!l&&(d.length>u||o.includes(`
53
+ `))&&(l=!0),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
54
+ `;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function Tj({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=GA(t(r),e);n.push(i.trimStart())}}function Ej(e,t){let n=dA(t)?t.value:t;for(let r of e)if(uA(r)&&(r.key===t||r.key===n||dA(r.key)&&r.key.value===n))return r}var Dj=class extends UA{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(nA,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(xj(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=uA(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Sj(e,e?.value):new Sj(e.key,e.value);let r=Ej(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);dA(r.value)&&IA(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=Ej(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=Ej(this.items,e)?.value;return(!t&&dA(n)?n.value:n)??void 0}has(e){return!!Ej(this.items,e)}set(e,t){this.add(new Sj(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)yj(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!uA(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Cj(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},Oj={collection:`map`,default:!0,nodeClass:Dj,tag:`tag:yaml.org,2002:map`,resolve(e,t){return lA(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Dj.from(e,t,n)},kj=class extends UA{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(aA,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Aj(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Aj(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&dA(r)?r.value:r}has(e){let t=Aj(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Aj(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];dA(r)&&IA(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(MA(e,String(r++),t));return n}toString(e,t,n){return e?Cj(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(BA(a,void 0,n))}}return i}};function Aj(e){let t=dA(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var jj={collection:`seq`,default:!0,nodeClass:kj,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return fA(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>kj.from(e,t,n)},Mj={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),sj(e,t,n,r)}},Nj={identify:e=>e==null,createNode:()=>new LA(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new LA(null),stringify:({source:e},t)=>typeof e==`string`&&Nj.test.test(e)?e:t.options.nullStr},Pj={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new LA(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&Pj.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function Fj({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(a)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var Ij={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Fj},Lj={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Fj(e)}},Rj={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new LA(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:Fj},zj=e=>typeof e==`bigint`||Number.isInteger(e),Bj=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Vj(e,t,n){let{value:r}=e;return zj(r)&&r>=0?n+r.toString(t):Fj(e)}var Hj={identify:e=>zj(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>Bj(e,2,8,n),stringify:e=>Vj(e,8,`0o`)},Uj={identify:zj,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Bj(e,0,10,n),stringify:Fj},Wj={identify:e=>zj(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Bj(e,2,16,n),stringify:e=>Vj(e,16,`0x`)},Gj=[Oj,jj,Mj,Nj,Pj,Hj,Uj,Wj,Ij,Lj,Rj];function Kj(e){return typeof e==`bigint`||Number.isInteger(e)}var qj=({value:e})=>JSON.stringify(e),Jj=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:qj},{identify:e=>e==null,createNode:()=>new LA(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:qj},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:qj},{identify:Kj,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Kj(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:qj}],Yj=[Oj,jj].concat(Jj,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),Xj={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=LA.BLOCK_LITERAL,t!==LA.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===LA.BLOCK_LITERAL?`
55
+ `:` `)}return sj({comment:e,type:t,value:s},r,i,a)}};function Zj(e,t){if(fA(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!uA(r)){if(lA(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new Sj(new LA(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=uA(r)?r:new Sj(r)}}else t(`Expected a sequence for this tag`);return e}function Qj(e,t,n){let{replacer:r}=n,i=new kj(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(xj(o,s,n))}return i}var $j={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:Zj,createNode:Qj},eM=class e extends kj{constructor(){super(),this.add=Dj.prototype.add.bind(this),this.delete=Dj.prototype.delete.bind(this),this.get=Dj.prototype.get.bind(this),this.has=Dj.prototype.has.bind(this),this.set=Dj.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(uA(e)?(r=MA(e.key,``,t),i=MA(e.value,r,t)):r=MA(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=Qj(e,t,n),i=new this;return i.items=r.items,i}};eM.tag=`tag:yaml.org,2002:omap`;var tM={collection:`seq`,identify:e=>e instanceof Map,nodeClass:eM,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=Zj(e,t),r=[];for(let{key:e}of n.items)dA(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new eM,n)},createNode:(e,t,n)=>eM.from(e,t,n)};function nM({value:e,source:t},n){return t&&(e?rM:iM).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var rM={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new LA(!0),stringify:nM},iM={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new LA(!1),stringify:nM},aM={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Fj},oM={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Fj(e)}},Eee={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new LA(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:Fj},sM=e=>typeof e==`bigint`||Number.isInteger(e);function cM(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function lM(e,t,n){let{value:r}=e;if(sM(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return Fj(e)}var Dee={identify:sM,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>cM(e,2,2,n),stringify:e=>lM(e,2,`0b`)},Oee={identify:sM,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>cM(e,1,8,n),stringify:e=>lM(e,8,`0`)},kee={identify:sM,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>cM(e,0,10,n),stringify:Fj},Aee={identify:sM,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>cM(e,2,16,n),stringify:e=>lM(e,16,`0x`)},uM=class e extends Dj{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=uA(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Sj(e.key,null):new Sj(e,null),Ej(this.items,t.key)||this.items.push(t)}get(e,t){let n=Ej(this.items,e);return!t&&uA(n)?dA(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Ej(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Sj(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(xj(e,null,n));return i}};uM.tag=`tag:yaml.org,2002:set`;var dM={collection:`map`,identify:e=>e instanceof Set,nodeClass:uM,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>uM.from(e,t,n),resolve(e,t){if(lA(e)){if(e.hasAllNullValues(!0))return Object.assign(new uM,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function fM(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function pM(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Fj(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var mM={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>fM(e,n),stringify:pM},hM={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>fM(e,!1),stringify:pM},gM={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(gM.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=fM(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},_M=[Oj,jj,Mj,Nj,rM,iM,Dee,Oee,kee,Aee,aM,oM,Eee,Xj,hj,tM,$j,dM,mM,hM,gM],vM=new Map([[`core`,Gj],[`failsafe`,[Oj,jj,Mj]],[`json`,Yj],[`yaml11`,_M],[`yaml-1.1`,_M]]),yM={binary:Xj,bool:Pj,float:Rj,floatExp:Lj,floatNaN:Ij,floatTime:hM,int:Uj,intHex:Wj,intOct:Hj,intTime:mM,map:Oj,merge:hj,null:Nj,omap:tM,pairs:$j,seq:jj,set:dM,timestamp:gM},jee={"tag:yaml.org,2002:binary":Xj,"tag:yaml.org,2002:merge":hj,"tag:yaml.org,2002:omap":tM,"tag:yaml.org,2002:pairs":$j,"tag:yaml.org,2002:set":dM,"tag:yaml.org,2002:timestamp":gM};function bM(e,t,n){let r=vM.get(t);if(r&&!e)return n&&!r.includes(hj)?r.concat(hj):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(vM.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(hj)),i.reduce((e,t)=>{let n=typeof t==`string`?yM[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(yM).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var Mee=(e,t)=>e.key<t.key?-1:+(e.key>t.key),xM=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?bM(e,`compat`):e?bM(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?jee:{},this.tags=bM(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,nA,{value:Oj}),Object.defineProperty(this,iA,{value:Mj}),Object.defineProperty(this,aA,{value:jj}),this.sortMapEntries=typeof a==`function`?a:a===!0?Mee:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function SM(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=cj(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(GA(t,``))}let o=!1,s=null;if(e.contents){if(mA(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(GA(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=dj(e.contents,i,()=>s=null,t);s&&(c+=KA(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(dj(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(`
56
+ `)?(n.push(`...`),n.push(GA(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(GA(a(t),``)))}return n.join(`
57
+ `)+`
58
+ `}var CM=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,oA,{value:tA});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new EA({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[oA]:{value:tA}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=mA(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){wM(this.contents)&&this.contents.add(e)}addIn(e,t){wM(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=OA(this);e.anchor=!t||n.has(t)?kA(t||`a`,n):t}return new PA(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=AA(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=BA(e,l,p);return o&&pA(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new Sj(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return wM(this.contents)?this.contents.delete(e):!1}deleteIn(e){return HA(e)?this.contents!=null&&(this.contents=null,!0):wM(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return pA(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return HA(e)?!t&&dA(this.contents)?this.contents.value:this.contents:pA(this.contents)?this.contents.getIn(e,t):void 0}has(e){return pA(this.contents)?this.contents.has(e):!1}hasIn(e){return HA(e)?this.contents!==void 0:pA(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=VA(this.schema,[e],t):wM(this.contents)&&this.contents.set(e,t)}setIn(e,t){HA(e)?this.contents=t:this.contents==null?this.contents=VA(this.schema,Array.from(e),t):wM(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new EA({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new EA({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new xM(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=MA(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?jA(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return SM(this,e)}};function wM(e){if(pA(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var TM=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},EM=class extends TM{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},DM=class extends TM{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},OM=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
59
+ `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t&&t.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function kM(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function AM(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
60
+ `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(AM(t.key)||AM(t.value))return!0}return!1;default:return!0}}function jM(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&AM(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function MM(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||dA(e)&&dA(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var NM=`All mapping items must start at the same column`;function PM({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??Dj)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=kM(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,NM)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
61
+ `+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||AM(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,NM);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&jM(r.indent,u,i),n.atKey=!1,MM(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=kM(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&jM(r.indent,f,i),s=c.range[2];let l=new Sj(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
62
+ `+_.comment:g.comment=_.comment);let e=new Sj(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function FM({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??kj)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=kM(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l&&l.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&jM(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function IM(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var LM=`Block collections are not allowed within flow collections`,RM=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function zM({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?Dj:kj))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=kM(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
63
+ `+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&AM(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];uA(t)&&(t=t.value??t.key),t.comment?t.comment+=`
64
+ `+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],RM(m)&&i(r.range,`BLOCK_IN_FLOW`,LM)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);RM(f)&&i(g.range,`BLOCK_IN_FLOW`,LM),n.atKey=!1;let _=kM(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source&&m.source[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?RM(m)&&i(v.range,`BLOCK_IN_FLOW`,LM):_.comment&&(g.comment?g.comment+=`
65
+ `+_.comment:g.comment=_.comment);let y=new Sj(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;MM(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new Dj(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f&&f.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=IM(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
66
+ `+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function BM(e,t,n,r,i,a){let o=n.type===`block-map`?PM(e,t,n,r,a):n.type===`block-seq`?FM(e,t,n,r,a):zM(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function VM(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===Dj.tagName&&s===`map`||o===kj.tagName&&s===`seq`)return BM(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r&&r.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),BM(e,t,n,i,o)}let l=BM(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=mA(u)?u:new LA(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function HM(e,t,n){let r=t.offset,i=UM(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?LA.BLOCK_FOLDED:LA.BLOCK_LITERAL,o=t.source?WM(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
67
+ `.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
68
+ `;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===LA.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
69
+ `):t.length>c||r[0]===` `?(f===` `?f=`
70
+ `:!p&&f===`
71
+ `&&(f=`
72
+
73
+ `),d+=f+t.slice(c)+r,f=`
74
+ `,p=!0):r===``?f===`
75
+ `?d+=`
76
+ `:f=`
77
+ `:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
78
+ `+o[e][0].slice(c);d[d.length-1]!==`
79
+ `&&(d+=`
80
+ `);break;default:d+=`
81
+ `}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function UM({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function WM(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function GM(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=LA.PLAIN,c=KM(a,l);break;case`single-quoted-scalar`:s=LA.QUOTE_SINGLE,c=qM(a,l);break;case`double-quoted-scalar`:s=LA.QUOTE_DOUBLE,c=YM(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=IM(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function KM(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),JM(e)}function qM(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),JM(e.slice(1,-1)).replace(/''/g,`'`)}function JM(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
82
+ `,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
83
+ `,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
84
+ `?i+=a:a=`
85
+ `:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function YM(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
86
+ `){if(i===`
87
+ `){let{fold:t,offset:i}=XM(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=ZM[i];if(a)n+=a;else if(i===`
88
+ `)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
89
+ `)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a={x:2,u:4,U:8}[i];n+=QM(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
90
+ `&&(a!==`\r`||e[r+2]!==`
91
+ `)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function XM(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
92
+ `||r===`\r`)&&(r!==`\r`||e[t+2]===`
93
+ `);)r===`
94
+ `&&(n+=`
95
+ `),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var ZM={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
96
+ `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function QM(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}function $M(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?HM(e,t,r):GM(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[iA]:c?eN(e.schema,i,c,n,r):t.type===`scalar`?tN(e,i,t,r):e.schema[iA];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=dA(a)?a:new LA(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new LA(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function eN(e,t,n,r,i){if(n===`!`)return e[iA];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[iA])}function tN({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[iA];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[iA];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function nN(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var rN={composeNode:iN,composeEmptyNode:aN};function iN(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=oN(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=$M(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:l=VM(rN,e,t,n,r),s&&(l.anchor=s.source.substring(1));break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),l=aN(e,t.offset,void 0,null,n,r),u=!1}return s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!dA(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function aN(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=$M(e,{type:`scalar`,offset:nN(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function oN({options:e},{offset:t,source:n,end:r},i){let a=new PA(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=IM(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function sN(e,t,{offset:n,start:r,value:i,end:a},o){let s=new CM(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=kM(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?iN(c,i,l,o):aN(c,l.end,r,null,l,o);let u=s.contents.range[2],d=IM(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function cN(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function lN(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
97
+
98
+ `:`
99
+ `)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var uN=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=cN(e);r?this.warnings.push(new DM(i,t,n)):this.errors.push(new EM(i,t,n))},this.directives=new EA({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=lN(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(pA(i)&&!i.flow&&i.items.length>0){let e=i.items[0];uA(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:lN(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=cN(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=sN(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new EM(cN(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new EM(cN(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=IM(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new EM(cN(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new CM(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},dN=Symbol(`break visit`),fN=Symbol(`skip children`),pN=Symbol(`remove item`);function mN(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),hN(Object.freeze([]),e,t)}mN.BREAK=dN,mN.SKIP=fN,mN.REMOVE=pN,mN.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},mN.parentCollection=(e,t)=>{let n=mN.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function hN(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=hN(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===dN)return dN;else r===pN&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function gN(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
100
+ `:case`\r
101
+ `:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function _N(e){switch(e){case void 0:case` `:case`
102
+ `:case`\r`:case` `:return!0;default:return!1}}var vN=new Set(`0123456789ABCDEFabcdef`),yN=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),bN=new Set(`,[]{}`),xN=new Set(` ,[]{}
103
+ \r `),SN=e=>!e||xN.has(e),CN=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
104
+ `||t===`\r`&&this.buffer[e+1]===`
105
+ `}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
106
+ `||!t&&!this.atEnd)return e+n+1}return t===`
107
+ `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&_N(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
108
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&_N(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!_N(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&_N(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(SN),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&_N(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(SN),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||_N(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
109
+ `,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
110
+ `,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>_N(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
111
+ `:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
112
+ `)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
113
+ `,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
114
+ `;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
115
+ `&&n>=this.pos&&n+1+t>i)e=n;else break}while(!0);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(_N(r)||e&&bN.has(r))break;t=n}else if(_N(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
116
+ `?(n+=1,r=`
117
+ `,i=this.buffer[n+1]):t=n),i===`#`||e&&bN.has(i))break;if(r===`
118
+ `){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&bN.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){switch(this.charAt(0)){case`!`:return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`&`:return(yield*this.pushUntil(SN))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`-`:case`?`:case`:`:{let e=this.flowLevel>0,t=this.charAt(1);if(_N(t)||e&&bN.has(t))return e?this.flowKey&&=!1:this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!_N(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(yN.has(t))t=this.buffer[++e];else if(t===`%`&&vN.has(this.buffer[e+1])&&vN.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
119
+ `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
120
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},wN=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function TN(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function EN(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function DN(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function ON(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function kN(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function AN(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!TN(t.start,`explicit-key-ind`)&&!TN(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,DN(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}var jN=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new CN,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=gN(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&(!e||e.type!==`doc-end`)){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&AN(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&EN(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:EN(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=kN(ON(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
121
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
122
+ `,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(TN(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=kN(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(TN(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(DN(t.key)&&!TN(t.sep,`newline`)){let e=kN(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):TN(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!TN(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||TN(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e&&e.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=kN(ON(t));AN(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
123
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
124
+ `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=kN(ON(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=kN(ON(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function MN(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new wN||null,prettyErrors:t}}function NN(e,t={}){let{lineCounter:n,prettyErrors:r}=MN(t),i=new jN(n?.addNewLine),a=new uN(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new EM(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(OM(e,n)),o.warnings.forEach(OM(e,n))),o}var PN=e=>pl(yw(V({message:U}))(e),{onNone:()=>`Unknown YAML parsing failure`,onSome:({message:e})=>e}),FN=(e,t)=>yv(function*(){let n=yield*Cv({try:()=>NN(t,{keepSourceTokens:!0,prettyErrors:!0,strict:!0,uniqueKeys:!0}),catch:t=>new NO({file:e,stage:`yaml`,expression:L(),message:PN(t)})}),r=n.errors[0]??n.warnings[0];return r===void 0?n:yield*new NO({file:e,stage:`yaml`,expression:L(),message:r.message})}),IN=Jy(),LN=class extends W(`@usine/config/LoopFrontmatter`)({trigger:mk,selector:xT(dk),approval:hD.pipe(rT(pv(`none`))),step:GD.pipe(rT(pv(`run`))),agent:IO}){},RN=class extends W(`@usine/config/AgentFrontmatter`)({harness:gk,model:KO,effort:_k,parent_model:xT(KO)}){},zN=(e,t)=>new NO({file:e,stage:`schema`,expression:L(),message:IN(t.issue)}),BN=pw(lE),VN=(e,t)=>yv(function*(){return yield*BN((yield*FN(e,t)).toJS()).pipe(Lv(t=>new NO({file:e,stage:`yaml`,expression:L(),message:IN(t.issue)})))}),HN=(e,t)=>new NO({file:e,stage:`expression`,expression:ul(t.source),message:t.message}),UN=e=>{let t=e.slice(e.lastIndexOf(`/`)+1);return t.endsWith(`.md`)?pv(t.slice(0,-3)):new NO({file:e,stage:`schema`,expression:L(),message:`Expected a .md filename`})},WN=e=>UN(e).pipe(Tv(t=>pw(LO)(t).pipe(Lv(t=>zN(e,t))))),GN=e=>UN(e).pipe(Tv(t=>pw(IO)(t).pipe(Lv(t=>zN(e,t))))),KN=(e,t)=>yv(function*(){let n=[],r=0;for(;r<t.length;){let i=t.indexOf(`{{`,r);if(i<0)break;let a=t.indexOf(`}}`,i+2);if(a<0)return yield*new NO({file:e,stage:`expression`,expression:L(),message:`Unclosed prompt interpolation at character ${i}`});let o=t.slice(i+2,a).trim(),s=yield*pw(bO)(o).pipe(Lv(t=>zN(e,t)));n.push({source:s,start:i,end:a+2}),r=a+2}return n}),qN=(e,t,n)=>{let r=xk(t.name),i=Qk(t.trigger.on);return yv(function*(){let a=yield*uv(yield*KN(r,t.body),t=>e.evaluateScalar(t.source,i,n).pipe(Lv(e=>HN(r,e)),Av(e=>({expression:t,value:e})))),o=``,s=0;for(let{expression:e,value:n}of a)o+=t.body.slice(s,e.start),o+=String(n),s=e.end;return o+t.body.slice(s)})},JN=z(`ConfigParser.parseUsineYaml`)((e,t)=>yv(function*(){let n=yield*VN(e,t);return yield*pw(uk)(n,{onExcessProperty:`error`}).pipe(Lv(t=>zN(e,t)))})),YN=z(`ConfigParser.parseAgentFile`)((e,t)=>yv(function*(){let n=yield*GN(e),r=yield*Tk(e,t),i=yield*VN(e,r.yaml),a=yield*pw(RN)(i,{onExcessProperty:`error`}).pipe(Lv(t=>zN(e,t))),o=yield*pw(YO)(r.body).pipe(Lv(t=>zN(e,t)));return new vk({name:n,harness:a.harness,model:a.model,effort:a.effort,parentModel:a.parent_model,persona:o})})),XN=e=>z(`ConfigParser.parseLoopFile`)((t,n)=>yv(function*(){let r=yield*WN(t),i=yield*Tk(t,n),a=yield*VN(t,i.yaml),o=yield*pw(LN)(a,{onExcessProperty:`error`}).pipe(Lv(e=>zN(t,e))),s=yield*pw(JO)(i.body).pipe(Lv(e=>zN(t,e))),c=Qk(o.trigger.on);return yield*e.checkBoolean(o.trigger.if,c).pipe(Lv(e=>HN(t,e))),yield*uv(yield*KN(t,s),({source:n})=>e.checkScalar(n,c).pipe(Lv(e=>HN(t,e))),{discard:!0}),new hk({name:r,trigger:o.trigger,selector:o.selector,approval:o.approval,step:o.step,agent:o.agent,body:s})})),ZN=class e extends bu()(`@usine/config/ConfigParser`){static layer=vg(e,yv(function*(){let e=yield*yO;return{parseUsineYaml:JN,parseAgentFile:YN,parseLoopFile:XN(e),renderPrompt:z(`ConfigParser.renderPrompt`)((t,n)=>qN(e,t,n))}}))},QN=(e,t)=>pl(e,{onNone:()=>!0,onSome:e=>{let n=pl(e.repos,{onNone:()=>!0,onSome:e=>e.includes(t.name)}),r=pl(e.tags,{onNone:()=>!0,onSome:e=>e.some(e=>t.tags.includes(e))});return n&&r}}),$N=mD,eP=hD,tP=class extends W(`@usine/engine/LoopRuntimeState`)({loop:pD,paused:zw}){},nP=class extends W(`@usine/engine/Submission`)({event:fD,itemKey:_O,loop:pD,step:GD,approval:eP,repository:eD,revision:tD,task:aO,agent:VE,parentModel:yT(IE)}){},rP=class extends G(`@usine/engine/Claimed`)(`Claimed`,{eventId:uD,runId:VD}){},iP=class extends G(`@usine/engine/Queued`)(`Queued`,{eventId:uD}){},aP=[`superseded`,`revoked`],oP=Xw(aP),sP=[`Approve`,`Continue`,`Interrupt`,`Resume`],cP=Xw(sP),lP=[`Resume`,`Interrupt`,`Continue`,`Approve`],uP=class extends G(`@usine/engine/Ignored`)(`Ignored`,{eventId:uD,reason:oP}){},dP=Yw([rP,iP,uP]),fP=class extends W(`@usine/engine/RunSnapshot`)({event:fD,itemKey:_O,run:HD,step:KD,attempts:H(tO),repository:eD,revision:tD,task:aO,agent:VE,parentModel:yT(IE)}){},pP=class extends W(`@usine/engine/RunSummary`)({itemKey:_O,run:HD,step:KD,attempts:H(tO),repository:eD,task:aO,agent:VE}){},mP=hT.check(pT(0)).pipe($w(`ProjectionRevision`)),hP=class extends W(`@usine/engine/StepExecution`)({attempt:tO,event:fD,run:HD,step:KD,repository:eD,revision:tD,task:aO,agent:VE,parentModel:yT(IE)}){},gP=hT.check(pT(1)).pipe($w(`TranscriptSequence`)),_P=class extends W(`@usine/engine/TranscriptEntry`)({sequence:gP,attemptId:YD,direction:iO,envelope:hO,receivedAt:GT}){};Yw([class extends G(`@usine/engine/TranscriptAllQuery`)(`TranscriptAllQuery`,{attemptId:YD}){},class extends G(`@usine/engine/TranscriptTailQuery`)(`TranscriptTailQuery`,{attemptId:YD,after:gP,limit:hT.check(pT(1))}){},class extends G(`@usine/engine/TranscriptPageQuery`)(`TranscriptPageQuery`,{attemptId:YD,before:yT(gP),limit:hT.check(pT(1))}){}]);var vP=class extends tE(`@usine/engine/RunNotFoundError`)(`RunNotFoundError`,{runId:VD}){},yP=class extends tE(`@usine/engine/RunOperationRejectedError`)(`RunOperationRejectedError`,{runId:VD,operation:Xw([`approve`,`retry`]),state:B}){},bP=class extends tE(`@usine/engine/EnginePersistenceError`)(`EnginePersistenceError`,{operation:B,cause:FT()}){},xP=class extends tE(`@usine/engine/AttemptCancellationError`)(`AttemptCancellationError`,{attemptId:YD,cause:FT()}){},SP=Yw([vP,yP,bP]);Yw([vP,yP,bP,xP]);var CP=U.pipe($w(`ItemProjectionSource`)),wP=vO,TP=U.pipe($w(`ItemContentHash`)),EP=class extends W(`@usine/engine/ItemProjection`)({itemKey:_O,repository:eD,source:CP,number:wP,contentHash:TP,payload:uE}){},K=Symbol.for(`drizzle:entityKind`);function q(e,t){if(!e||typeof e!=`object`)return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,K))throw Error(`Class "${t.name??`<unknown>`}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e)?.constructor;if(n)for(;n;){if(K in n&&n[K]===t[K])return!0;n=Object.getPrototypeOf(n)}return!1}var DP=Symbol.for(`drizzle:OriginalColumn`),OP=e=>e;OP.isNoop=!0;var kP=class{static[K]=`Column`;codec;name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;length;isLengthExact;isAlias;config;table;onInit(){}constructor(e,t){this.config=t,this.onInit(),this.table=e,this.name=t.name,this.isAlias=!1,this.keyAsName=t.keyAsName,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity,this.length=t.length,this.isLengthExact=t.isLengthExact}mapFromDriverValue=OP;mapToDriverValue=OP;postBuild(){return this}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!==`byDefault`}[DP](){return this}},AP=Symbol.for(`drizzle:Name`),jP=Symbol.for(`drizzle:Schema`),MP=Symbol.for(`drizzle:Columns`),NP=Symbol.for(`drizzle:ExtraConfigColumns`),PP=Symbol.for(`drizzle:OriginalName`),FP=Symbol.for(`drizzle:BaseName`),IP=Symbol.for(`drizzle:IsAlias`),LP=Symbol.for(`drizzle:ExtraConfigBuilder`),RP=Symbol.for(`drizzle:IsDrizzleTable`),zP=class{static[K]=`Table`;static Symbol={Name:AP,Schema:jP,OriginalName:PP,Columns:MP,ExtraConfigColumns:NP,BaseName:FP,IsAlias:IP,ExtraConfigBuilder:LP};[AP];[PP];[jP];[MP];[NP];[FP];[IP]=!1;[RP]=!0;[LP]=void 0;constructor(e,t,n){this[AP]=this[PP]=e,this[jP]=t,this[FP]=n}};function BP(e){return e[AP]}var VP=class{static[K]=`Subquery`;constructor(e,t,n,r=!1,i=[]){this._={brand:`Subquery`,sql:e,selectedFields:t,alias:n,isWith:r,usedTables:i}}},HP=class extends VP{static[K]=`WithSubquery`},UP={startActiveSpan(e,t){return t()}},WP=Symbol.for(`drizzle:ViewBaseConfig`);function GP(e){return e!=null&&typeof e.getSQL==`function`}function KP(e){let t={sql:``,params:[]};for(let n of e)t.sql+=n.sql,t.params.push(...n.params);return t}function qP(e){let t={sql:``,params:[]},n=[];for(let r of e)n.push(r.sql),t.params.push(...r.params);return t._sql=Object.assign(n,{raw:n}),t}var JP=class{static[K]=`StringChunk`;value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new YP([this])}},YP=class e{static[K]=`SQL`;decoder=QP;shouldInlineParams=!1;usedTables=[];constructor(e){this.queryChunks=e;for(let t of e)if(q(t,zP)){let e=t[zP.Symbol.Schema];this.usedTables.push(e===void 0?t[zP.Symbol.Name]:e+`.`+t[zP.Symbol.Name])}}append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return UP.startActiveSpan(`drizzle.buildSQL`,t=>{let n=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{escapeName:i,escapeParam:a,codecs:o,inlineParams:s,paramStartIndex:c,invokeSource:l}=r,u=t.map(t=>{if(q(t,JP))return{sql:t.value.join(``),params:[]};if(q(t,XP))return{sql:i(t.value),params:[]};if(t===void 0)return{sql:``,params:[]};if(Array.isArray(t)){let e=[new JP(`(`)];for(let[n,r]of t.entries())e.push(r),n<t.length-1&&e.push(new JP(`, `));return e.push(new JP(`)`)),this.buildQueryFromSourceParams(e,r)}if(q(t,e))return this.buildQueryFromSourceParams(t.queryChunks,{...r,inlineParams:s||t.shouldInlineParams});if(q(t,zP)){let e=t[zP.Symbol.Schema],n=t[zP.Symbol.Name];return l===`mssql-view-with-schemabinding`?{sql:i(e===void 0?`dbo`:e)+`.`+i(n),params:[]}:{sql:e===void 0||t[IP]?i(n):i(e)+`.`+i(n),params:[]}}if(q(t,kP)){let e=t.name;if(n.invokeSource===`indexes`)return{sql:i(e),params:[]};let r=l===`mssql-check`?void 0:t.table[zP.Symbol.Schema];return{sql:t.isAlias?i(t.name):t.table[IP]||r===void 0?i(t.table[zP.Symbol.Name])+`.`+i(e):i(r)+`.`+i(t.table[zP.Symbol.Name])+`.`+i(e),params:[]}}if(q(t,iF)){let e=t[WP].schema,n=t[WP].name;return{sql:e===void 0||t[WP].isAlias?i(n):i(e)+`.`+i(n),params:[]}}if(q(t,eF)){if(q(t.value,e))return this.buildQueryFromSourceParams([t.value],r);let n=o&&q(t.encoder,kP);if(q(t.value,nF)){let e=a(c.value++,t);return t.codec=n?e=>o.apply(t.encoder,`normalizeParam`,e):void 0,{sql:n?o.apply(t.encoder,`castParam`,e):e,params:[t]}}let i;if(t.value===null)i=t.value;else{if(i=t.encoder.mapToDriverValue.isNoop?t.value:t.encoder.mapToDriverValue(t.value),q(i,e))return this.buildQueryFromSourceParams([i],r);n&&(i=o.apply(t.encoder,`normalizeParam`,i))}if(s)return{sql:this.mapInlineParam(i,r),params:[]};let l=a(c.value++,i);return{sql:n?o.apply(t.encoder,`castParam`,l):l,params:[i]}}return q(t,nF)?{sql:a(c.value++,t),params:[t]}:q(t,e.Aliased)&&t.fieldAlias!==void 0?{sql:(t.origin===void 0?``:i(t.origin)+`.`)+i(t.fieldAlias),params:[]}:q(t,VP)?t._.isWith?{sql:i(t._.alias),params:[]}:this.buildQueryFromSourceParams([new JP(`(`),t._.sql,new JP(`) `),new XP(t._.alias)],r):typeof t==`function`&&`enumName`in t?`schema`in t&&t.schema?{sql:i(t.schema)+`.`+i(t.enumName),params:[]}:{sql:i(t.enumName),params:[]}:GP(t)?t.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([t.getSQL()],r):this.buildQueryFromSourceParams([new JP(`(`),t.getSQL(),new JP(`)`)],r):s?{sql:this.mapInlineParam(t,r),params:[]}:{sql:a(c.value++,t),params:[t]}});return n.tagged?qP(u):KP(u)}mapInlineParam(e,{escapeString:t}){if(e===null)return`null`;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return e.toString();if(typeof e==`string`)return t(e);if(typeof e==`object`){let n=e.toString();return t(n===`[object Object]`?JSON.stringify(e):n)}throw Error(`Unexpected param value: `+e)}getSQL(){return this}as(t){return t===void 0?this:new e.Aliased(this,t)}mapWith(e){return this.decoder=typeof e==`function`?{mapFromDriverValue:e}:e,this}nullable(){return this}inlineParams(){return this.shouldInlineParams=!0,this}if(e){return e?this:void 0}},XP=class{static[K]=`Name`;brand;constructor(e){this.value=e}getSQL(){return new YP([this])}};function ZP(e){return typeof e==`object`&&!!e&&`mapToDriverValue`in e&&typeof e.mapToDriverValue==`function`}var QP={mapFromDriverValue:e=>e};QP.mapFromDriverValue.isNoop=!0;var $P={mapToDriverValue:e=>e};$P.mapToDriverValue.isNoop=!0,{...QP,...$P};var eF=class{static[K]=`Param`;brand;constructor(e,t=$P,n){this.value=e,this.encoder=t,this.codec=n}getSQL(){return new YP([this])}};function J(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!==``)&&n.push(new JP(e[0]));for(let[r,i]of t.entries())n.push(i,new JP(e[r+1]));return new YP(n)}(function(e){function t(){return new YP([])}e.empty=t;function n(e){return new YP(e)}e.fromList=n;function r(e){return new YP([new JP(e)])}e.raw=r;function i(e,t){let n=[];for(let[r,i]of e.entries())r>0&&t!==void 0&&n.push(t),n.push(i);return new YP(n)}e.join=i;function a(e){return new XP(e)}e.identifier=a;function o(e){return new nF(e)}e.placeholder=o;function s(e,t){return new eF(e,t)}e.param=s;function c(e){let t=tF(e);if(t.length)return J.raw(t)}e.comment=c})(J||={});function tF(e){let t=tF.encodeInput(e);return t.length?`/*${t}*/`:``}(function(e){function t(e,t){let r;if(typeof e==`object`&&typeof t==`object`)r=n({...e,...t});else if(e&&t)r=[n(e),n(t)].filter(e=>e.length).join(`,`);else if(t)r=n(t);else if(e)r=n(e);else return``;return r.length?`/*${r}*/`:``}e.merge=t;function n(e){if(typeof e==`string`)return e.length?i(e):e;let t=[];for(let[n,i]of Object.entries(e)){if(i==null||i===``)continue;let e=r(n),a=r(String(i));t.push(`${e}='${a}'`)}return t.length?t.sort().join(`,`):``}e.encodeInput=n;function r(e){return encodeURIComponent(e).replace(/'/g,`\\'`)}e.sanitizeObjectElement=r;function i(e){return e.replace(/\/\*/g,`/ *`).replace(/\*\//g,`* /`)}e.sanitizeStringInput=i})(tF||={}),(function(e){class t{static[K]=`SQL.Aliased`;isSelectionField=!1;origin;constructor(e,t){this.sql=e,this.fieldAlias=t}getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(YP||={});var nF=class{static[K]=`Placeholder`;constructor(e){this.name=e}getSQL(){return new YP([this])}},rF=Symbol.for(`drizzle:IsDrizzleView`),iF=class{static[K]=`View`;[WP];[rF]=!0;get[AP](){return this[WP].name}get[jP](){return this[WP].schema}get[IP](){return this[WP].isAlias}get[PP](){return this[WP].originalName}get[MP](){return this[WP].selectedFields}constructor({name:e,schema:t,selectedFields:n,query:r}){this[WP]={name:e,originalName:e,schema:t,selectedFields:n,query:r,isExisting:!r,isAlias:!1}}};kP.prototype.getSQL=function(){return new YP([this])},VP.prototype.getSQL=function(){return new YP([this])};var aF=class extends Error{static[K]=`DrizzleError`;constructor({message:e,cause:t}){super(e),this.name=`DrizzleError`,this.cause=t}};function oF(e,t){return ZP(t)&&!GP(e)&&!q(e,eF)&&!q(e,nF)&&!q(e,kP)&&!q(e,zP)&&!q(e,iF)?new eF(e,t):e}var Y=(e,t)=>J`${e} = ${oF(t,e)}`,sF=(e,t)=>J`${e} <> ${oF(t,e)}`;function cF(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new YP(t):new YP([new JP(`(`),J.join(t.map(e=>J`(${e})`),new JP(` and `)),new JP(`)`)])}function lF(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new YP(t):new YP([new JP(`(`),J.join(t.map(e=>J`(${e})`),new JP(` or `)),new JP(`)`)])}function uF(e){return q(e,YP)?J`not (${e})`:J`not ${e}`}var dF=(e,t)=>J`${e} > ${oF(t,e)}`,fF=(e,t)=>J`${e} >= ${oF(t,e)}`,pF=(e,t)=>J`${e} < ${oF(t,e)}`,mF=(e,t)=>J`${e} <= ${oF(t,e)}`;function hF(e,t){return Array.isArray(t)?t.length===0?J`false`:J`${e} in ${t.map(t=>oF(t,e))}`:J`${e} in ${oF(t,e)}`}function gF(e,t){return Array.isArray(t)?t.length===0?J`true`:J`${e} not in ${t.map(t=>oF(t,e))}`:J`${e} not in ${oF(t,e)}`}function _F(e){return J`(${e} is null)`}function vF(e){return J`(${e} is not null)`}function yF(e){return J`exists ${e}`}function bF(e){return J`not exists ${e}`}function xF(e,t,n){return J`${e} between ${oF(t,e)} and ${oF(n,e)}`}function SF(e,t,n){return J`${e} not between ${oF(t,e)} and ${oF(n,e)}`}function CF(e,t){return J`${e} like ${t}`}function wF(e,t){return J`${e} not like ${t}`}function TF(e,t){return J`${e} ilike ${t}`}function EF(e,t){return J`${e} not ilike ${t}`}function DF(e,t){if(Array.isArray(t)){if(t.length===0)throw Error(`arrayContains requires at least one value`);let n=oF(t,e);return J`${e} @> ${J`${Array.isArray(n)?new eF(n):n}`}`}return J`${e} @> ${oF(t,e)}`}function OF(e,t){if(Array.isArray(t)){if(t.length===0)throw Error(`arrayContained requires at least one value`);let n=oF(t,e);return J`${e} <@ ${J`${Array.isArray(n)?new eF(n):n}`}`}return J`${e} <@ ${oF(t,e)}`}function kF(e,t){if(Array.isArray(t)){if(t.length===0)throw Error(`arrayOverlaps requires at least one value`);let n=oF(t,e);return J`${e} && ${J`${Array.isArray(n)?new eF(n):n}`}`}return J`${e} && ${oF(t,e)}`}function AF(e){return J`${e} asc`}function jF(e){return J`${e} desc`}var MF=class{static[K]=`ColumnTableAliasProxyHandler`;constructor(e,t){this.table=e,this.ignoreColumnAlias=t}get(e,t){return t===`table`?this.table:t===`isAlias`&&this.ignoreColumnAlias?!1:e[t]}},NF=class{static[K]=`ViewSelectionAliasProxyHandler`;constructor(e,t,n){this.view=e,this.selection=t,this.ignoreColumnAlias=n}get(e,t){let n=e[t];return q(n,kP)?new Proxy(n,new MF(this.view,this.ignoreColumnAlias)):q(n,VP)||q(n,YP)||q(n,YP.Aliased)||GP(n)||typeof n!=`object`||!n?n:new Proxy(n,this)}},PF=class{static[K]=`TableAliasProxyHandler`;constructor(e,t,n){this.alias=e,this.replaceOriginalName=t,this.ignoreColumnAlias=n}get(e,t){if(t===zP.Symbol.IsAlias)return!0;if(t===zP.Symbol.Name||this.replaceOriginalName&&t===zP.Symbol.OriginalName)return this.alias;if(t===WP)return{...e[WP],name:this.alias,isAlias:!0,selectedFields:new Proxy(e[WP].selectedFields,new NF(new Proxy(e,this),e[WP].selectedFields,this.ignoreColumnAlias))};if(t===zP.Symbol.Columns){let t=e[zP.Symbol.Columns];if(!t)return t;if(q(e,iF))return new Proxy(e[zP.Symbol.Columns],new NF(new Proxy(e,this),e[zP.Symbol.Columns],this.ignoreColumnAlias));let n={};return Object.keys(t).map(r=>{n[r]=new Proxy(t[r],new MF(new Proxy(e,this),this.ignoreColumnAlias))}),n}let n=e[t];return q(n,kP)?new Proxy(n,new MF(new Proxy(e,this),this.ignoreColumnAlias)):n}},FF=class{static[K]=`ColumnAliasProxyHandler`;constructor(e){this.alias=e}get(e,t){return t===`isAlias`?!0:t===`name`?this.alias:t===`keyAsName`?!1:t===DP?()=>e:e[t]}};function IF(e,t){return new Proxy(e,new PF(t,!1,!1))}function LF(e,t){return new Proxy(e,new FF(t))}kP.prototype.as=function(e){return LF(this,e)};function RF(e){return e[DP]()}var zF=Object.getPrototypeOf(()=>null).constructor;function BF(e,t={}){let n=[],r=[];r.push(`const [ ${e.map((e,t)=>`c${t}`).join(`, `)} ] = rows[i];`);let i={},a={},o=Array.from({length:e.length});for(let r=0;r<e.length;++r){let{field:s,path:c,codec:l,arrayDimensions:u}=e[r],d,f,p,m=!1;q(s,kP)?(m=!0,d=s,p=`field: decoder${r}`):q(s,YP)?(d=s.decoder,p=`field: { decoder: decoder${r} }`):q(s,VP)?(d=s._.sql.decoder,p=`field: { _: { sql: { decoder: decoder${r} } } }`):(d=s.sql.decoder,p=`field: { sql: { decoder: decoder${r} } }`),f=`decoder${r}.mapFromDriverValue`,d.mapFromDriverValue.isNoop&&(f=``),f?n.push(`const { ${p}${l?`, codec: codec${r}`:``} } = columns[${r}];`):l&&n.push(`const { codec: codec${r} } = columns[${r}];`);let h=`c${r}`,g=h;if(l&&(g=`codec${r}(${g}, ${u})`),f&&(g=`${f}(${g})`),o[r]=h===g?`${h}`:`${h} === null ? ${h} : ${g}`,c.length!==2||!m)continue;a[c[0]]===void 0?a[c[0]]=[`c${r}`]:a[c[0]]?.push(`c${r}`);let[_]=c,v=BP(s.table);i[_]=t[v]?!1:typeof i[_]==`string`?i[_]===v&&v:v}r.push(`mapped[i] = {`);let s=[];for(let t=0;t<e.length;++t){let{path:n}=e[t],c=n.map(e=>JSON.stringify(e)),l=o[t],u=n.slice(0,-1),d=0;for(;d<s.length&&d<u.length&&s[d]===u[d];)d++;for(let e=s.length-1;e>=d;--e)r.push(`${` `.repeat(e+1)}},`);for(let e=d;e<u.length;++e)r.push(`${` `.repeat(e+1)}${c[e]}: ${e===0&&u.length===1&&typeof i[n[0]]==`string`?`${a[n[0]]?.map(e=>`${e} === null`).join(` && `)} ? null : {`:`{`}`);s=u,r.push(`${` `.repeat(n.length)}${c[n.length-1]}: ${l},`)}for(let e=s.length-1;e>=0;--e)r.push(`${` `.repeat(e+1)}},`);return r.push(`};`),`${n.length?`${n.join(`
125
+ `)}\n\t`:``}for (let i = 0; i < length; ++i) {
126
+ ${r.join(`
127
+ `)}
128
+ }`}function VF(e,t){let n=`\t"use strict";
129
+ const { columns } = this;
130
+ const { length } = rows;
131
+ const mapped = Array.from({ length });
132
+ ${BF(e,t)}
133
+ return mapped;
134
+ //# sourceURL=drizzle:jit-query-mapper`;return Object.assign(new zF(`rows`,n).bind({columns:e}),{body:`function jitQueryMapper (rows) {\n${n}\n}`})}function HF(e,t){let n=e.map(({field:e,codec:n,arrayDimensions:r,path:i})=>{let a,o;if(q(e,kP)){if(o=e,t&&i.length===2){let t=i[0];a=(n,r)=>{t in n?typeof n[t]==`string`&&n[t]!==BP(e.table)&&(n[t]=!1):n[t]=r===null&&BP(e.table)}}}else o=q(e,YP)?e.decoder:q(e,VP)?e._.sql.decoder:e.sql.decoder;let s;return s=o.mapFromDriverValue.isNoop?n?e=>n(e,r):void 0:n?e=>o.mapFromDriverValue(n(e,r)):e=>o.mapFromDriverValue(e),[s,a]});return(r=>r.map(r=>{let i={},a=e.reduce((e,{path:t},a)=>{let o=e;for(let[e,s]of t.entries())if(e<t.length-1)s in o||(o[s]={}),o=o[s];else{let[e,t]=n[a],c=r[a],l=o[s]=c===null?null:e?e(c):c;t?.(i,l)}return e},{});if(t&&Object.keys(i).length>0)for(let[e,n]of Object.entries(i))typeof n==`string`&&!t[n]&&(a[e]=null);return a}))}function UF(e,t,n){return Object.entries(e).reduce((e,[r,i])=>{if(typeof r!=`string`)return e;let a=t?[...t,r]:[r];if(q(i,kP))e.push({path:a,field:i,codec:n?.get(i,`normalize`),arrayDimensions:i.dimensions,column:i});else if(q(i,YP)||q(i,YP.Aliased)){let t=WF(i);e.push(t?{path:a,field:i,codec:n?.get(t,`normalize`),arrayDimensions:t.dimensions,column:t}:{path:a,field:i})}else if(q(i,VP)){let t,r=Object.values(i._.selectedFields)[0],o;q(r,kP)?(t=r,o=r):q(r,YP)?(t=WF(r),o=r.decoder):(t=WF(r),o=r.sql.decoder),o&&(i._.sql.decoder=o),e.push(t?{path:a,field:i,codec:n?.get(t,`normalize`),arrayDimensions:t.dimensions,column:t}:{path:a,field:i})}else q(i,zP)?e.push(...UF(i[zP.Symbol.Columns],a,n)):e.push(...UF(i,a,n));return e},[])}function WF(e){let t=e.getSQL();if(q(t.decoder,kP))return t.decoder}function GF(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let[e,t]of n.entries())if(t!==r[e])return!1;return!0}function KF(e){return e[zP.Symbol.Columns]}function qF(e){return q(e,VP)?e._.alias:q(e,iF)?e[WP].name:q(e,YP)?void 0:e[zP.Symbol.IsAlias]?e[zP.Symbol.Name]:e[zP.Symbol.BaseName]}function JF(e,t){return{name:typeof e==`string`&&e.length>0?e:``,config:typeof e==`object`?e:t}}var YF=typeof TextDecoder>`u`?null:new TextDecoder,XF=class{static[K]=`RelationV2`;fieldName;sourceColumns;targetColumns;alias;where;sourceTable;targetTable;through;throughTable;isReversed;sourceColumnTableNames=[];targetColumnTableNames=[];constructor(e,t){this.targetTableName=t,this.targetTable=e}},ZF=class extends XF{static[K]=`OneV2`;relationType=`one`;optional;constructor(e,t,n,r){super(t,n),this.alias=r?.alias,this.where=r?.where,r?.from&&(this.sourceColumns=(Array.isArray(r.from)?r.from:[r.from]).map(t=>(this.throughTable??=t._.through?e[t._.through._.tableName]:void 0,this.sourceColumnTableNames.push(t._.tableName),t._.column))),r?.to&&(this.targetColumns=(Array.isArray(r.to)?r.to:[r.to]).map(t=>(this.throughTable??=t._.through?e[t._.through._.tableName]:void 0,this.targetColumnTableNames.push(t._.tableName),t._.column))),this.throughTable&&(this.through={source:(Array.isArray(r?.from)?r.from:r?.from?[r.from]:[]).map(e=>e._.through),target:(Array.isArray(r?.to)?r.to:r?.to?[r.to]:[]).map(e=>e._.through)}),this.optional=r?.optional??!0}},QF={and:cF,between:xF,eq:Y,exists:yF,gt:dF,gte:fF,ilike:TF,inArray:hF,arrayContains:DF,arrayContained:OF,arrayOverlaps:kF,isNull:_F,isNotNull:vF,like:CF,lt:pF,lte:mF,ne:sF,not:uF,notBetween:SF,notExists:bF,notLike:wF,notIlike:EF,notInArray:gF,or:lF,sql:J},$F={sql:J,asc:AF,desc:jF};function eI(e,t,n,r=!1,i=!1,a=!0){let o=t?1:e.length,s=n.map(({field:e,codec:t,arrayDimensions:n})=>{let r;return r=q(e,kP)?e:q(e,YP)?e.decoder:q(e,YP.Aliased)?e.sql.decoder:q(e,zP)||q(e,iF)?QP:e.getSQL().decoder,a&&e.mapFromJsonValue?t=>e.mapFromJsonValue(t):r.mapFromDriverValue.isNoop?t?e=>t(e,n):void 0:t?e=>r.mapFromDriverValue(t(e,n)):e=>r.mapFromDriverValue(e)});for(let a=0;a<o;++a){let o=t?e:e[a];for(let e=0;e<n.length;++e){let t=n[e];if(t.selection){if(o[t.key]===null)continue;if(r){if(o[t.key]=JSON.parse(o[t.key]),o[t.key]===null)continue}else i&&typeof o[t.key]==`string`&&(o[t.key]=JSON.parse(o[t.key]));if(t.isArray){eI(o[t.key],!1,t.selection,!1,i);continue}eI(o[t.key],!0,t.selection,!1,i);continue}if(o[t.key]===null)continue;let a=s[e];a&&(o[t.key]=a(o[t.key]))}}return e}function tI(e,t,n,r=!1,i=!1){let a=t?1:e.length,o=n.map(({field:e,codec:t,arrayDimensions:n})=>{let r;return r=q(e,kP)?e:q(e,YP)?e.decoder:q(e,YP.Aliased)?e.sql.decoder:q(e,zP)||q(e,iF)?QP:e.getSQL().decoder,r.mapFromDriverValue.isNoop?t?e=>t(e,n):void 0:t?e=>r.mapFromDriverValue(t(e,n)):e=>r.mapFromDriverValue(e)}),s=Array.from({length:a});for(let c=0;c<a;++c){let a=t?e:e[c],l={};for(let e=0;e<n.length;++e){let t=n[e],s=a[e];if(t.selection){if(s===null){l[t.key]=null;continue}if(r){if(s=JSON.parse(s),s===null){l[t.key]=null;continue}}else i&&typeof s==`string`&&(s=JSON.parse(s));t.isArray?eI(s,!1,t.selection,!1,i):eI(s,!0,t.selection,!1,i),l[t.key]=s;continue}if(s===null){l[t.key]=null;continue}let c=o[e];l[t.key]=c?c(s):s}s[c]=l}return t?s[0]:s}function nI({selection:e,isFirst:t,parseJson:n,parseJsonIfString:r,rootJsonMappers:i,arrayModeRoot:a}){return(o=>t&&!o[0]?o[0]:a?tI(t?o[0]:o,t,e,n,r):eI(t?o[0]:o,t,e,n,r,i))}function rI(e,t,n,r,i,a,o,s,c){let l=[],u=[],d=!1,f=e.map(()=>`c${s.n++}`),p=e.map((e,t)=>c?f[t]:`${JSON.stringify(e.key)}: ${f[t]}`);l.push(c?`let [ ${p.join(`, `)} ] = ${t};`:`let { ${p.join(`, `)} } = ${t};`);for(let[t,{field:c,key:p,codec:m,isArray:h,selection:g,arrayDimensions:_}]of e.entries()){let e=`${n}[${t}]`,v=JSON.stringify(p),y=f[t];if(g){r?(l.push(`if (${y} !== null) ${y} = JSON.parse(${y});`),d=!0):i&&(l.push(`if (typeof ${y} === 'string') ${y} = JSON.parse(${y});`),d=!0);let t=`s${s.n++}`,n=o.length;if(o.push(`const { selection: ${t} } = ${e};`),h){let e=`j${s.n++}`,r=rI(g,`${y}[${e}]`,t,!1,i,!0,o,s,!1);if(r.hasWork){d=!0,l.push(`if (${y} !== null) {`),l.push(`\tfor (let ${e} = 0; ${e} < ${y}.length; ++${e}) {`);for(let e of r.bodyStmts)l.push(`\t\t${e}`);l.push(`\t\t${y}[${e}] = ${r.literal};`),l.push(` }`),l.push(`}`)}else o.splice(n,1)}else{let e=rI(g,y,t,!1,i,!0,o,s,!1);if(e.hasWork){d=!0,l.push(`if (${y} !== null) {`);for(let t of e.bodyStmts)l.push(`\t${t}`);l.push(`\t${y} = ${e.literal};`),l.push(`}`)}else o.splice(n,1)}u.push(`${v}: ${y}`);continue}let b=``,x=``,S=!1;if(q(c,kP)){if(a&&c.mapFromJsonValue){S=!0;let e=s.n++;x=`field: dec${e}`,b=`dec${e}.mapFromJsonValue`}else if(!c.mapFromDriverValue.isNoop){let e=s.n++;x=`field: dec${e}`,b=`dec${e}.mapFromDriverValue`}}else if(q(c,YP)){if(a&&c.decoder.mapFromJsonValue){S=!0;let e=s.n++;x=`field: { decoder: dec${e} }`,b=`dec${e}.mapFromJsonValue`}else if(!c.decoder.mapFromDriverValue.isNoop){let e=s.n++;x=`field: { decoder: dec${e} }`,b=`dec${e}.mapFromDriverValue`}}else if(q(c,YP.Aliased)){if(a&&c.sql.decoder.mapFromJsonValue){S=!0;let e=s.n++;x=`field: { sql: { decoder: dec${e} } }`,b=`dec${e}.mapFromJsonValue`}else if(!c.sql.decoder.mapFromDriverValue.isNoop){let e=s.n++;x=`field: { sql: { decoder: dec${e} } }`,b=`dec${e}.mapFromDriverValue`}}else if(!(q(c,zP)||q(c,iF))){let t=c.getSQL();if(a&&t.decoder.mapFromJsonValue){S=!0;let t=s.n++;o.push(`const dec${t} = ${e}.field.getSQL().decoder;`),b=`dec${t}.mapFromJsonValue`}else if(!t.decoder.mapFromDriverValue.isNoop){let t=s.n++;o.push(`const dec${t} = ${e}.field.getSQL().decoder;`),b=`dec${t}.mapFromDriverValue`}}let C=``;if(!S&&m&&(C=`codec${s.n++}`),x||C){let t=[];x&&t.push(x),C&&t.push(`codec: ${C}`),o.push(`const { ${t.join(`, `)} } = ${e};`)}if(b||C){d=!0;let e=y;C&&(e=`${C}(${e}, ${_})`),b&&(e=`${b}(${e})`),u.push(`${v}: ${y} === null ? null : ${e}`)}else u.push(`${v}: ${y}`)}return{bodyStmts:l,literal:`{ ${u.join(`, `)} }`,hasWork:d}}function iI({selection:e,isFirst:t,parseJson:n,parseJsonIfString:r,rootJsonMappers:i,arrayModeRoot:a}){let o=[],s=rI(e,`row`,`selection`,n,r,!a&&i,o,{n:0},!!a),c=[];c.push(` "use strict";
135
+ const { selection } = this;`);for(let e of o)c.push(`\t${e}`);if(a){if(t){c.push(` const row = rows[0];`),c.push(` if (!row) return undefined;`);for(let e of s.bodyStmts)c.push(`\t${e}`);c.push(`\treturn ${s.literal};`)}else{c.push(` const { length } = rows;`),c.push(` const mapped = Array.from({ length });`),c.push(` for (let i = 0; i < length; ++i) {`),c.push(` const row = rows[i];`);for(let e of s.bodyStmts)c.push(`\t\t${e}`);c.push(`\t\tmapped[i] = ${s.literal};`),c.push(` }`),c.push(` return mapped;`)}}else if(!s.hasWork)c.push(t?` return rows[0];`:` return rows;`);else if(t){c.push(` const row = rows[0];`),c.push(` if (!row) return undefined;`);for(let e of s.bodyStmts)c.push(`\t${e}`);c.push(`\trows[0] = ${s.literal};`),c.push(` return rows[0];`)}else{c.push(` for (let i = 0; i < rows.length; ++i) {`),c.push(` const row = rows[i];`);for(let e of s.bodyStmts)c.push(`\t\t${e}`);c.push(`\t\trows[i] = ${s.literal};`),c.push(` }`),c.push(` return rows;`)}c.push(` //# sourceURL=drizzle:jit-relational-query-mapper`);let l=c.join(`
136
+ `);return Object.assign(new zF(`rows`,l).bind({selection:e}),{body:`function jitRqbMapper (rows) {\n${l}\n}`})}function aI(e,t){let n=e[MP][t];return n?q(n,kP)?n:q(n,YP.Aliased)?J`${e}.${J.identifier(n.fieldAlias)}`:J`${e}.${J.identifier(t)}`:J`${e}.${J.identifier(t)}`}function oI(e,t){if(typeof t!=`object`||q(t,nF))return Y(e,t);let n=Object.entries(t);if(!n.length)return;let r=[];for(let[t,i]of n)if(i!==void 0)switch(t){case`NOT`:{let t=oI(e,i);if(!t)continue;r.push(uF(t));continue}case`OR`:if(!i.length)continue;r.push(lF(...i.map(t=>oI(e,t))));continue;case`AND`:if(!i.length)continue;r.push(cF(...i.map(t=>oI(e,t))));continue;case`isNotNull`:case`isNull`:if(!i)continue;r.push(QF[t](e));continue;case`in`:r.push(QF.inArray(e,i));continue;case`notIn`:r.push(QF.notInArray(e,i));continue;default:r.push(QF[t](e,i));continue}if(r.length)return cF(...r)}function sI(e,t,n={},r={},i=0){let a=Object.entries(t);if(!a.length)return;let o=[];for(let[t,s]of a)if(s!==void 0)switch(t){case`RAW`:{let t=typeof s==`function`?s(e,QF):s.getSQL();o.push(t);continue}case`OR`:if(!s?.length)continue;o.push(lF(...s.map(t=>sI(e,t,n,r,i))));continue;case`AND`:if(!s?.length)continue;o.push(cF(...s.map(t=>sI(e,t,n,r,i))));continue;case`NOT`:{if(s===void 0)continue;let t=sI(e,s,n,r,i);if(!t)continue;o.push(uF(t));continue}default:{if(e[MP][t]){let n=oI(aI(e,t),s);n&&o.push(n);continue}let a=n[t];if(!a)throw new aF({message:`Unknown relational filter field: "${t}"`});let c=IF(a.targetTable,`f${i}`),l=a.throughTable?IF(a.throughTable,`ft${i}`):void 0,u=r[a.targetTableName],{filter:d,joinCondition:f}=uI(a,e,c,l),p=cF(d,typeof s==`boolean`?void 0:sI(c,s,u.relations,r,i+1)),m=l?J`(select * from ${dI(c)} inner join ${dI(l)} on ${f}${J` where ${p}`.if(p)} limit 1)`:J`(select * from ${dI(c)}${J` where ${p}`.if(p)} limit 1)`;p&&o.push((s?yF:bF)(m))}}return cF(...o)}function cI(e,t){if(typeof t==`function`){let n=t(e,$F);return q(n,YP)?n:Array.isArray(n)?n.length?J.join(n.map(e=>q(e,YP)?e:AF(e)),J`, `):void 0:q(n,kP)?AF(n):void 0}let n=Object.entries(t).filter(([e,t])=>t);if(n.length)return J.join(n.map(([t,n])=>(n===`asc`?AF:jF)(aI(e,t))),J`, `)}function lI(e,t,n,r){let i=[],a=[];for(let[o,s]of Object.entries(t)){if(!s)continue;let t=(typeof s==`function`?s(e,{sql:QF.sql}):s).getSQL(),c=n?WF(t):void 0,l=c&&(!r||!c.jsonSelectIdentifier)?J`${n.apply(c,r?`castInJson`:`cast`,J`(${t})`)} as ${J.identifier(o)}`:J`(${t}) as ${J.identifier(o)}`;l.decoder=t.decoder,i.push(l),a.push(c&&(!r||!c.mapFromJsonValue)?{key:o,field:l,codec:n.get(c,r?`normalizeInJson`:`normalize`),arrayDimensions:c.dimensions}:{key:o,field:l})}return{sql:i.length?J.join(i,J`, `):void 0,selection:a}}function uI(e,t,n,r){if(e.through){let i=e.sourceColumns.map((n,i)=>{let a=e.through.source[i];return Y(J`${t}.${J.identifier(n.name)}`,J`${r}.${J.identifier(q(a._.column,kP)?a._.column.name:a._.key)}`)}),a=e.targetColumns.map((t,i)=>{let a=e.through.target[i];return Y(J`${r}.${J.identifier(q(a._.column,kP)?a._.column.name:a._.key)}`,J`${n}.${J.identifier(t.name)}`)});return{filter:cF(e.where?sI(e.isReversed?t:n,e.where):void 0,...i),joinCondition:cF(...a)}}return{filter:cF(...e.sourceColumns.map((r,i)=>{let a=e.targetColumns[i];return Y(J`${t}.${J.identifier(r.name)}`,J`${n}.${J.identifier(a.name)}`)}),e.where?sI(e.isReversed?t:n,e.where):void 0)}}function dI(e){return J`${e[IP]?J`${J`${J.identifier(e[jP]??``)}.`.if(e[jP])}${J.identifier(e[PP])} as ${e}`:e}`}var fI=class{static[K]=`ColumnBuilder`;config;constructor(e,t,n){this.config={name:e,keyAsName:e===``,notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:n,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e,t){this.config.name===``&&(this.config.name=t(e))}},pI=class e extends bu()(`@usine/engine/internal/RunDatabase`){static layer=t=>gg(e)(t)},mI=class{static[K]=`SQLiteForeignKeyBuilder`;reference;_onUpdate;_onDelete;constructor(e,t){this.reference=()=>{let{name:t,columns:n,foreignColumns:r}=e();return{name:t,columns:n,foreignTable:r[0].table,foreignColumns:r}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=e,this}onDelete(e){return this._onDelete=e,this}build(e){return new hI(e,this)}},hI=class{static[K]=`SQLiteForeignKey`;reference;onUpdate;onDelete;constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}getName(){let{name:e,columns:t,foreignColumns:n}=this.reference(),r=t.map(e=>e.name),i=n.map(e=>e.name),a=[this.table[AP],...r,n[0].table[AP],...i];return e??`${a.join(`_`)}_fk`}isNameExplicit(){return!!this.reference().name}};function gI(e){function t(){if(typeof e==`function`){let{name:t,columns:n,foreignColumns:r}=e();return{name:t,columns:n,foreignColumns:r}}return e}return new mI(t)}var _I=class extends fI{static[K]=`SQLiteColumnBuilder`;foreignKeyConfigs=[];references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e){return this.config.isUnique=!0,this.config.uniqueName=e,this}generatedAlwaysAs(e,t){return this.config.generated={as:e,type:`always`,mode:t?.mode??`virtual`},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:n,actions:r})=>((n,r)=>{let i=new mI(()=>{let t=n();return{columns:[e],foreignColumns:[t]}});return r.onUpdate&&i.onUpdate(r.onUpdate),r.onDelete&&i.onDelete(r.onDelete),i.build(t)})(n,r))}},vI=class extends kP{static[K]=`SQLiteColumn`;table;constructor(e,t){super(e,t),this.table=e}};function yI(e){let t=``;for(let n=0;n<e.length;n+=2){let r=e.slice(n,n+2),i=Number.parseInt(r,16);t+=String.fromCodePoint(i)}return t}var bI=class extends _I{static[K]=`SQLiteBigIntBuilder`;constructor(e){super(e,`bigint int64`,`SQLiteBigInt`)}build(e){return new xI(e,this.config)}},xI=class extends vI{static[K]=`SQLiteBigInt`;getSQLType(){return`blob`}mapFromDriverValue=e=>{if(typeof e==`string`)return BigInt(yI(e));if(typeof Buffer<`u`&&Buffer.from){let t=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return BigInt(t.toString(`utf8`))}return BigInt(YF.decode(e))};mapToDriverValue=e=>Buffer.from(e.toString())},SI=class extends _I{static[K]=`SQLiteBlobJsonBuilder`;constructor(e){super(e,`object json`,`SQLiteBlobJson`)}build(e){return new CI(e,this.config)}},CI=class extends vI{static[K]=`SQLiteBlobJson`;getSQLType(){return`blob`}mapFromDriverValue=e=>{if(typeof e==`string`)return JSON.parse(yI(e));if(typeof Buffer<`u`&&Buffer.from){let t=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return JSON.parse(t.toString(`utf8`))}return JSON.parse(YF.decode(e))};mapToDriverValue=e=>Buffer.from(JSON.stringify(e))},wI=class extends _I{static[K]=`SQLiteBlobBufferBuilder`;constructor(e){super(e,`object buffer`,`SQLiteBlobBuffer`)}build(e){return new TI(e,this.config)}},TI=class extends vI{static[K]=`SQLiteBlobBuffer`;mapFromDriverValue=e=>Buffer.isBuffer(e)?e:typeof e==`string`?Buffer.from(e,`hex`):Buffer.from(e);getSQLType(){return`blob`}};function EI(e,t){let{name:n,config:r}=JF(e,t);return r?.mode===`bigint`?new bI(n):r?.mode===`buffer`?new wI(n):new SI(n)}var DI=class extends _I{static[K]=`SQLiteCustomColumnBuilder`;constructor(e,t,n){super(e,`custom`,`SQLiteCustomColumn`),this.config.fieldConfig=t,this.config.customTypeParams=n}build(e){return new OI(e,this.config)}},OI=class extends vI{static[K]=`SQLiteCustomColumn`;sqlName;mapTo;mapFrom;mapJson;forJsonSelect;constructor(e,t){super(e,t),this.sqlName=t.customTypeParams.dataType(t.fieldConfig),this.mapTo=t.customTypeParams.toDriver,this.mapFrom=t.customTypeParams.fromDriver,this.mapJson=t.customTypeParams.fromJson,this.forJsonSelect=t.customTypeParams.forJsonSelect}getSQLType(){return this.sqlName}mapFromDriverValue=e=>typeof this.mapFrom==`function`?this.mapFrom(e):e;mapFromJsonValue(e){return typeof this.mapJson==`function`?this.mapJson(e):this.mapFromDriverValue(e)}jsonSelectIdentifier(e,t){if(typeof this.forJsonSelect==`function`)return this.forJsonSelect(e,t);let n=this.getSQLType().toLowerCase(),r=n.indexOf(`(`);switch(r+1?n.slice(0,r):n){case`numeric`:case`decimal`:case`bigint`:return t`cast(${e} as text)`;case`blob`:return t`hex(${e})`;default:return e}}mapToDriverValue=e=>typeof this.mapTo==`function`?this.mapTo(e):e};function kI(e){return(t,n)=>{let{name:r,config:i}=JF(t,n);return new DI(r,i,e)}}var AI=class extends _I{static[K]=`SQLiteBaseIntegerBuilder`;constructor(e,t,n){super(e,t,n),this.config.autoIncrement=!1}primaryKey(e){return e?.autoIncrement&&(this.config.autoIncrement=!0),this.config.hasDefault=!0,super.primaryKey()}},jI=class extends vI{static[K]=`SQLiteBaseInteger`;autoIncrement=this.config.autoIncrement;getSQLType(){return`integer`}},MI=class extends AI{static[K]=`SQLiteIntegerBuilder`;constructor(e){super(e,`number int53`,`SQLiteInteger`)}build(e){return new NI(e,this.config)}},NI=class extends jI{static[K]=`SQLiteInteger`},PI=class extends AI{static[K]=`SQLiteTimestampBuilder`;constructor(e,t){super(e,`object date`,`SQLiteTimestamp`),this.config.mode=t}defaultNow(){return this.default(J`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(e){return new FI(e,this.config)}},FI=class extends jI{static[K]=`SQLiteTimestamp`;mode=this.config.mode;mapFromDriverValue=e=>typeof e==`string`?new Date(e.replaceAll(`"`,``)):this.config.mode===`timestamp`?new Date(e*1e3):new Date(e);mapToDriverValue=e=>{if(typeof e==`number`)return e;let t=e.getTime();return this.config.mode===`timestamp`?Math.floor(t/1e3):t}},II=class extends AI{static[K]=`SQLiteBooleanBuilder`;constructor(e,t){super(e,`boolean`,`SQLiteBoolean`),this.config.mode=t}build(e){return new LI(e,this.config)}},LI=class extends jI{static[K]=`SQLiteBoolean`;mode=this.config.mode;mapFromDriverValue=e=>Number(e)===1;mapToDriverValue=e=>+!!e};function RI(e,t){let{name:n,config:r}=JF(e,t);return r?.mode===`timestamp`||r?.mode===`timestamp_ms`?new PI(n,r.mode):r?.mode===`boolean`?new II(n,r.mode):new MI(n)}var zI=class extends _I{static[K]=`SQLiteNumericBuilder`;constructor(e){super(e,`string numeric`,`SQLiteNumeric`)}build(e){return new BI(e,this.config)}},BI=class extends vI{static[K]=`SQLiteNumeric`;mapFromDriverValue=e=>typeof e==`string`?e:String(e);getSQLType(){return`numeric`}},VI=class extends _I{static[K]=`SQLiteNumericNumberBuilder`;constructor(e){super(e,`number`,`SQLiteNumericNumber`)}build(e){return new HI(e,this.config)}},HI=class extends vI{static[K]=`SQLiteNumericNumber`;mapFromDriverValue=e=>typeof e==`number`?e:Number(e);mapToDriverValue=String;getSQLType(){return`numeric`}},UI=class extends _I{static[K]=`SQLiteNumericBigIntBuilder`;constructor(e){super(e,`bigint int64`,`SQLiteNumericBigInt`)}build(e){return new WI(e,this.config)}},WI=class extends vI{static[K]=`SQLiteNumericBigInt`;mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return`numeric`}};function GI(e,t){let{name:n,config:r}=JF(e,t),i=r?.mode;return i===`number`?new VI(n):i===`bigint`?new UI(n):new zI(n)}var KI=class extends _I{static[K]=`SQLiteRealBuilder`;constructor(e){super(e,`number double`,`SQLiteReal`)}build(e){return new qI(e,this.config)}},qI=class extends vI{static[K]=`SQLiteReal`;getSQLType(){return`real`}};function JI(e){return new KI(e??``)}var YI=class extends _I{static[K]=`SQLiteTextBuilder`;constructor(e,t){super(e,t.enum?.length?`string enum`:`string`,`SQLiteText`),this.config.enumValues=t.enum,this.config.length=t.length}build(e){return new XI(e,this.config)}},XI=class extends vI{static[K]=`SQLiteText`;enumValues=this.config.enumValues;constructor(e,t){super(e,t)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:``}`}},ZI=class extends _I{static[K]=`SQLiteTextJsonBuilder`;constructor(e){super(e,`object json`,`SQLiteTextJson`)}build(e){return new QI(e,this.config)}},QI=class extends vI{static[K]=`SQLiteTextJson`;getSQLType(){return`text`}mapFromDriverValue=e=>JSON.parse(e);mapToDriverValue=e=>JSON.stringify(e)};function $I(e,t={}){let{name:n,config:r}=JF(e,t);return r.mode===`json`?new ZI(n):new YI(n,r)}function eL(){return{blob:EI,customType:kI,integer:RI,numeric:GI,real:JI,text:$I}}function tL(e){return(e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join(`_`)}function nL(e){return(e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,t,n)=>e+(n===0?t.toLowerCase():`${t[0].toUpperCase()}${t.slice(1)}`),``)}function rL(e){return e===`snake_case`?tL:e===`camelCase`?nL:e=>e}var iL=Symbol.for(`drizzle:SQLiteInlineForeignKeys`),aL=class extends zP{static[K]=`SQLiteTable`;static Symbol=Object.assign({},zP.Symbol,{InlineForeignKeys:iL});[zP.Symbol.Columns];[iL]=[];[zP.Symbol.ExtraConfigBuilder]=void 0};function oL(e,t,n,r,i,a=e){let o=rL(i),s=new aL(e,r,a),c=typeof t==`function`?t(eL()):t,l=Object.fromEntries(Object.entries(c).map(([e,t])=>{let n=t;n.setName(e,o);let r=n.build(s).postBuild();return s[iL].push(...n.buildForeignKeys(r,s)),[e,r]})),u=Object.assign(s,l);return u[zP.Symbol.Columns]=l,u[zP.Symbol.ExtraConfigColumns]=l,n&&(u[aL.Symbol.ExtraConfigBuilder]=n),u}function sL(e){return(t,n,r)=>oL(t,n,r,void 0,e)}var cL=class{static[K]=`SQLiteCheckBuilder`;brand;constructor(e,t){this.name=e,this.value=t}build(e){return new lL(e,this)}},lL=class{static[K]=`SQLiteCheck`;name;value;constructor(e,t){this.table=e,this.name=t.name,this.value=t.value}};function uL(e,t){return new cL(e,t)}var dL=class{static[K]=`SQLiteIndexBuilderOn`;constructor(e,t){this.name=e,this.unique=t}on(...e){return new fL(this.name,e,this.unique)}},fL=class{static[K]=`SQLiteIndexBuilder`;config;constructor(e,t,n){this.config={name:e,columns:t,unique:n,where:void 0}}where(e){return this.config.where=e,this}build(e){return new pL(this.config,e)}},pL=class{static[K]=`SQLiteIndex`;config;isNameExplicit;constructor(e,t){this.config={...e,table:t},this.isNameExplicit=!!e.name}};function mL(e){return new dL(e,!1)}function hL(e){return new dL(e,!0)}function gL(...e){return e[0].columns?new _L(e[0].columns,e[0].name):new _L(e)}var _L=class{static[K]=`SQLitePrimaryKeyBuilder`;columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new vL(e,this.columns,this.name)}},vL=class{static[K]=`SQLitePrimaryKey`;columns;name;isNameExplicit;constructor(e,t,n){this.table=e,this.columns=t,this.name=n,this.isNameExplicit=!!n}getName(){return this.name??`${this.table[aL.Symbol.Name]}_${this.columns.map(e=>e.name).join(`_`)}_pk`}};function yL(e){return q(e,aL)?[`${e[zP.Symbol.BaseName]}`]:q(e,VP)?e._.usedTables??[]:q(e,YP)?e.usedTables??[]:[]}var bL=class extends iF{static[K]=`SQLiteViewBase`},xL=class e{static[K]=`SelectionProxyHandler`;config;constructor(e){this.config={...e}}get(t,n){if(n===`_`)return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(n===WP)return{...t[WP],selectedFields:new Proxy(t[WP].selectedFields,this)};if(typeof n==`symbol`)return t[n];let r=(q(t,VP)?t._.selectedFields:q(t,iF)?t[WP].selectedFields:t)[n];if(q(r,YP.Aliased)){if(this.config.sqlAliasedBehavior===`sql`&&!r.isSelectionField)return r.sql;let e=r.clone();return e.isSelectionField=!0,e.origin=this.config.alias,e}if(q(r,YP)){if(this.config.sqlBehavior===`sql`)return r;throw Error(`You tried to reference "${n}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return q(r,kP)?this.config.alias?new Proxy(r,new MF(new Proxy(r.table,new PF(this.config.alias,this.config.replaceOriginalName??!1,!0)),!0)):r:typeof r!=`object`||!r?r:new Proxy(r,new e(this.config))}},SL=class{static[K]=`TypedQueryBuilder`;getSelectedFields(){return this._.selectedFields}withoutSelectionCastCodecs(){return this}},CL=class{static[K]=`SQLiteSelectBuilder`;fields;session;dialect;withList;distinct;constructor(e,t=wL){this.builder=t,this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,this.withList=e.withList,this.distinct=e.distinct}from(e){let t=!!this.fields,n;return n=this.fields?this.fields:q(e,VP)?Object.fromEntries(Object.keys(e._.selectedFields).map(t=>[t,e[t]])):q(e,bL)?e[WP].selectedFields:q(e,YP)?{}:KF(e),new this.builder({table:e,fields:n,isPartialSelect:t,session:this.session,dialect:this.dialect,withList:this.withList??[],distinct:this.distinct})}},wL=class extends SL{static[K]=`SQLiteSelectQueryBuilder`;_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;cacheConfig=void 0;usedTables=new Set;constructor({table:e,fields:t,isPartialSelect:n,session:r,dialect:i,withList:a,distinct:o}){super(),this.config={withList:a,table:e,fields:{...t},distinct:o,setOperators:[]},this.isPartialSelect=n,this.session=r,this.dialect=i,this._={selectedFields:t,config:this.config},this.tableName=qF(e),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{};for(let t of yL(e))this.usedTables.add(t)}getUsedTables(){return[...this.usedTables]}createJoin(e){return(t,n)=>{let r=this.tableName,i=qF(t);for(let e of yL(t))this.usedTables.add(e);if(typeof i==`string`&&this.config.joins?.some(e=>e.alias===i))throw Error(`Alias "${i}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof r==`string`&&(this.config.fields={[r]:this.config.fields}),typeof i==`string`&&!q(t,YP))){let e=q(t,VP)?t._.selectedFields:q(t,iF)?t[WP].selectedFields:t[zP.Symbol.Columns];this.config.fields[i]=e}if(typeof n==`function`&&(n=n(new Proxy(this.config.fields,new xL({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:n,table:t,joinType:e,alias:i}),typeof i==`string`)switch(e){case`left`:this.joinsNotNullableMap[i]=!1;break;case`right`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[i]=!0;break;case`cross`:case`inner`:this.joinsNotNullableMap[i]=!0;break;case`full`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[i]=!1;break}return this}}leftJoin=this.createJoin(`left`);rightJoin=this.createJoin(`right`);innerJoin=this.createJoin(`inner`);fullJoin=this.createJoin(`full`);crossJoin=this.createJoin(`cross`);createSetOperator(e,t){return n=>{let r=typeof n==`function`?n(EL()):n;if(!GF(this.getSelectedFields(),r.getSelectedFields()))throw Error(`Set operator error (union / intersect / except): selected fields are not the same or are in a different order`);return this.config.setOperators.push({type:e,isAll:t,rightSelect:r}),this}}union=this.createSetOperator(`union`,!1);unionAll=this.createSetOperator(`union`,!0);intersect=this.createSetOperator(`intersect`,!1);except=this.createSetOperator(`except`,!1);addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new xL({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.where=e,this}having(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new xL({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]==`function`){let t=e[0](new Proxy(this.config.fields,new xL({sqlAliasedBehavior:`alias`,sqlBehavior:`sql`})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]==`function`){let t=e[0](new Proxy(this.config.fields,new xL({sqlAliasedBehavior:`alias`,sqlBehavior:`sql`}))),n=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{let t=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=t:this.config.orderBy=t}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}$withCache(e){return this.cacheConfig=e===void 0?{config:{},enabled:!0,autoInvalidate:!0}:e===!1?{enabled:!1}:{enabled:!0,autoInvalidate:!0,...e},this}getSQL(){return this.config.fieldsFlat=UF(this.config.fields),this.dialect.buildSelectQuery(this.config)}toSQL(){return this.dialect.sqlToQuery(this.getSQL())}as(e){let t=[];if(t.push(...yL(this.config.table)),this.config.joins)for(let e of this.config.joins)t.push(...yL(e.table));return new Proxy(new VP(this.getSQL(),this.config.fields,e,!1,[...new Set(t)]),new xL({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}getSelectedFields(){return new Proxy(this.config.fields,new xL({alias:this.tableName,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}withoutSelectionCastCodecs(){return this}$dynamic(){return this}};function TL(e,t){return(n,r,...i)=>{let a=[r,...i].map(n=>({type:e,isAll:t,rightSelect:n}));for(let e of a)if(!GF(n.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error(`Set operator error (union / intersect / except): selected fields are not the same or are in a different order`);return n.addSetOperators(a)}}var EL=()=>({union:DL,unionAll:OL,intersect:kL,except:AL}),DL=TL(`union`,!1),OL=TL(`union`,!0),kL=TL(`intersect`,!1),AL=TL(`except`,!1),jL=class{static[K]=`SQLiteDialect`;mapperGenerators;constructor(e){this.mapperGenerators=e?.useJitMappers?{rows:VF,relationalRows:iI}:{rows:HF,relationalRows:nI}}escapeName(e){return`"${e.replace(/"/g,`""`)}"`}escapeParam(e){return`?`}escapeString(e){return`'${e.replace(/'/g,`''`)}'`}buildWithCTE(e){if(!e?.length)return;let t=[J`with `];for(let[n,r]of e.entries())t.push(J`${J.identifier(r._.alias)} as (${r._.sql})`),n<e.length-1&&t.push(J`, `);return t.push(J` `),J.join(t)}buildDeleteQuery({table:e,where:t,returning:n,withList:r,limit:i,orderBy:a}){let o=this.buildWithCTE(r),s=n?J` returning ${this.buildSelection(n,{isSingleTable:!0})}`:void 0;return J`${o}delete from ${e}${t?J` where ${t}`:void 0}${s}${this.buildOrderBy(a)}${this.buildLimit(i)}`}buildUpdateSet(e,t){let n=e[zP.Symbol.Columns],r=Object.keys(n).filter(e=>t[e]!==void 0||n[e]?.onUpdateFn!==void 0),i=r.length;return J.join(r.flatMap((e,r)=>{let a=n[e],o=a.onUpdateFn?.(),s=t[e]??(q(o,YP)?o:J.param(o,a)),c=J`${J.identifier(a.name)} = ${s}`;return r<i-1?[c,J.raw(`, `)]:[c]}))}buildUpdateQuery({table:e,set:t,where:n,returning:r,withList:i,joins:a,from:o,limit:s,orderBy:c}){let l=this.buildWithCTE(i),u=this.buildUpdateSet(e,t),d=o&&J.join([J.raw(` from `),this.buildFromTable(o)]),f=this.buildJoins(a),p=r?J` returning ${this.buildSelection(r,{isSingleTable:!0})}`:void 0;return J`${l}update ${e} set ${u}${d}${f}${n?J` where ${n}`:void 0}${p}${this.buildOrderBy(c)}${this.buildLimit(s)}`}buildSelection(e,{isSingleTable:t=!1}={}){let n=e.length,r=e.flatMap(({field:e},r)=>{let i=[];if(q(e,YP.Aliased)){if(e.isSelectionField)!t&&e.origin!==void 0&&i.push(J.identifier(e.origin),J.raw(`.`)),i.push(J.identifier(e.fieldAlias));else{let n=e.sql;if(t){let e=new YP(n.queryChunks.map(e=>q(e,kP)?J.identifier(e.name):e));i.push(n.shouldInlineParams?e.inlineParams():e)}else i.push(n);i.push(J` as ${J.identifier(e.fieldAlias)}`)}}else if(q(e,YP)){let n=e;if(t){let e=new YP(n.queryChunks.map(e=>q(e,kP)?J.identifier(e.name):e));i.push(n.shouldInlineParams?e.inlineParams():e)}else i.push(n)}else q(e,kP)?e.columnType===`SQLiteNumericBigInt`||e.columnType===`SQLiteNumeric`?t?i.push(e.isAlias?J`cast(${J.identifier(RF(e).name)} as text) as ${e}`:J`cast(${J.identifier(e.name)} as text)`):i.push(e.isAlias?J`cast(${RF(e)} as text) as ${e}`:J`cast(${e} as text)`):t?i.push(e.isAlias?J`${J.identifier(RF(e).name)} as ${e}`:J.identifier(e.name)):i.push(e.isAlias?J`${RF(e)} as ${e}`:e):q(e,VP)&&(e._.isWith?i.push(e):i.push(J`(${e._.sql}) ${J.identifier(e._.alias)}`));return r<n-1&&i.push(J`, `),i});return J.join(r)}buildJoins(e){if(!e||e.length===0)return;let t=[];if(e)for(let[n,r]of e.entries()){n===0&&t.push(J` `);let i=r.table,a=r.on?J` on ${r.on}`:void 0;if(q(i,aL)){let e=i[aL.Symbol.Name],n=i[aL.Symbol.Schema],o=i[aL.Symbol.OriginalName],s=e===o?void 0:r.alias;t.push(J`${J.raw(r.joinType)} join ${n?J`${J.identifier(n)}.`:void 0}${J.identifier(o)}${s&&J` ${J.identifier(s)}`}${a}`)}else t.push(J`${J.raw(r.joinType)} join ${i}${a}`);n<e.length-1&&t.push(J` `)}return J.join(t)}buildLimit(e){return typeof e==`object`||typeof e==`number`&&e>=0?J` limit ${e}`:void 0}buildOrderBy(e){let t=[];if(e)for(let[n,r]of e.entries())t.push(r),n<e.length-1&&t.push(J`, `);return t.length>0?J` order by ${J.join(t)}`:void 0}buildFromTable(e){if(q(e,zP)&&e[zP.Symbol.IsAlias])return J`${J`${J.identifier(e[zP.Symbol.Schema]??``)}.`.if(e[zP.Symbol.Schema])}${J.identifier(e[zP.Symbol.OriginalName])} ${J.identifier(e[zP.Symbol.Name])}`;if(q(e,iF)&&e[WP].isAlias){let t=J`${J.identifier(e[WP].originalName)}`;return e[WP].schema&&(t=J`${J.identifier(e[WP].schema)}.${t}`),J`${t} ${J.identifier(e[WP].name)}`}return e}buildSelectQuery({withList:e,fields:t,fieldsFlat:n,where:r,having:i,table:a,joins:o,orderBy:s,groupBy:c,limit:l,offset:u,distinct:d,setOperators:f}){let p=n??UF(t);for(let e of p)if(q(e.field,kP)&&BP(e.field.table)!==(q(a,VP)?a._.alias:q(a,bL)?a[WP].name:q(a,YP)?void 0:BP(a))&&!(e=>o?.some(({alias:t})=>t===(e[zP.Symbol.IsAlias]?BP(e):e[zP.Symbol.BaseName])))(e.field.table)){let t=BP(e.field.table);throw Error(`Your "${e.path.join(`->`)}" field references a column "${t}"."${e.field.name}", but the table "${t}" is not part of the query! Did you forget to join it?`)}let m=!o||o.length===0,h=this.buildWithCTE(e),g=d?J` distinct`:void 0,_=this.buildSelection(p,{isSingleTable:m}),v=this.buildFromTable(a),y=this.buildJoins(o),b=r?J` where ${r}`:void 0,x=i?J` having ${i}`:void 0,S=[];if(c)for(let[e,t]of c.entries())S.push(t),e<c.length-1&&S.push(J`, `);let C=J`${h}select${g} ${_} from ${v}${y}${b}${S.length>0?J` group by ${J.join(S)}`:void 0}${x}${this.buildOrderBy(s)}${this.buildLimit(l)}${u?J` offset ${u}`:void 0}`;return f.length>0?this.buildSetOperations(C,f):C}buildSetOperations(e,t){let[n,...r]=t;if(!n)throw Error(`Cannot pass undefined values to any set operator`);return r.length===0?this.buildSetOperationQuery({leftSelect:e,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:n}),r)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:n,rightSelect:r,limit:i,orderBy:a,offset:o}}){let s=J`${e.getSQL()} `,c=J`${r.getSQL()}`,l;if(a&&a.length>0){let e=[];for(let t of a)if(q(t,vI))e.push(J.identifier(t.name));else if(q(t,YP)){for(let e=0;e<t.queryChunks.length;e++){let n=t.queryChunks[e];q(n,vI)&&(t.queryChunks[e]=J.identifier(n.name))}e.push(J`${t}`)}else e.push(J`${t}`);l=J` order by ${J.join(e,J`, `)}`}let u=typeof i==`object`||typeof i==`number`&&i>=0?J` limit ${i}`:void 0,d=J.raw(`${t} ${n?`all `:``}`),f=o?J` offset ${o}`:void 0;return J`${s}${d}${c}${l}${u}${f}`}buildInsertQuery({table:e,values:t,onConflict:n,returning:r,withList:i,select:a}){let o=[],s=e[zP.Symbol.Columns],c=Object.entries(s),l=a&&!q(t,YP)?Object.keys(t.getSelectedFields()).map(e=>[e,s[e]]):c.filter(([e,t])=>!t.shouldDisableInsert()),u=l.map(([,e])=>J.identifier(e.name));if(a){let e=t;q(e,YP)?o.push(e):o.push(e.getSQL())}else{let e=t;o.push(J.raw(`values `));for(let[t,n]of e.entries()){let r=[];for(let[e,t]of l){let i=n[e];if(i===void 0||q(i,eF)&&i.value===void 0){let e;if(t.default!==null&&t.default!==void 0)e=q(t.default,YP)?t.default:J.param(t.default,t);else if(t.defaultFn!==void 0){let n=t.defaultFn();e=q(n,YP)?n:J.param(n,t)}else if(!t.default&&t.onUpdateFn!==void 0){let n=t.onUpdateFn();e=q(n,YP)?n:J.param(n,t)}else e=J`null`;r.push(e)}else r.push(i)}o.push(r),t<e.length-1&&o.push(J`, `)}}let d=this.buildWithCTE(i),f=J.join(o),p=r?J` returning ${this.buildSelection(r,{isSingleTable:!0})}`:void 0;return J`${d}insert into ${e} ${u} ${f}${n?.length?J.join(n):void 0}${p}`}sqlToQuery(e,t){return e.toQuery({escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,invokeSource:t})}nestedSelectionerror(){throw new aF({message:`Views with nested selections are not supported by the relational query builder`})}buildRqbColumn(e,t,n,r){if(q(t,kP)){let i=J`${e}.${J.identifier(t.name)}`;switch(t.columnType){case`SQLiteBigInt`:case`SQLiteBlobJson`:case`SQLiteBlobBuffer`:return r?J`hex(${i}) as ${J.identifier(n)}`:J`${i} as ${J.identifier(n)}`;case`SQLiteNumeric`:case`SQLiteNumericNumber`:case`SQLiteNumericBigInt`:return J`cast(${i} as text) as ${J.identifier(n)}`;case`SQLiteCustomColumn`:return r?J`${t.jsonSelectIdentifier(i,J)} as ${J.identifier(n)}`:J`${i} as ${J.identifier(n)}`;default:return J`${i} as ${J.identifier(n)}`}}return J`${e}.${q(t,YP.Aliased)?J.identifier(t.fieldAlias):GP(t)?J.identifier(n):this.nestedSelectionerror()} as ${J.identifier(n)}`}unwrapAllColumns=(e,t,n)=>J.join(Object.entries(e[MP]).map(([r,i])=>(t.push({key:r,field:i}),this.buildRqbColumn(e,i,r,n))),J`, `);getSelectedTableColumns=(e,t)=>{let n=[],r=e[MP],i=Object.entries(t),a;for(let[e,t]of i)if(t!==void 0&&(a||=t,t)){let t=r[e];n.push({column:t,tsName:e})}if(a===!1)for(let[e,i]of Object.entries(r))t[e]!==!1&&n.push({column:i,tsName:e});return n};buildColumns=(e,t,n,r)=>r?.columns?(()=>{let i=[],a=this.getSelectedTableColumns(e,r?.columns);for(let{column:r,tsName:o}of a)i.push(this.buildRqbColumn(e,r,o,n)),t.push({key:o,field:r});return i.length?J.join(i,J`, `):void 0})():this.unwrapAllColumns(e,t,n);buildRelationalQuery({schema:e,table:t,tableConfig:n,queryConfig:r,relationWhere:i,mode:a,isNested:o,errorPath:s,depth:c,throughJoin:l,jsonb:u}){let d=[],f=a===`first`,p=r===!0?void 0:r,m=s??``,h=c??0;h||(t=IF(t,`d${h}`));let g=f?1:p?.limit,_=p?.offset,v=this.buildColumns(t,d,!!o,p),y=p?.where&&i?cF(sI(t,p.where,n.relations,e),i):p?.where?sI(t,p.where,n.relations,e):i,b=p?.orderBy?cI(t,p.orderBy):void 0,x=p?.extras?lI(t,p.extras):void 0;x&&d.push(...x.selection);let S=p?(()=>{let{with:r}=p;if(!r)return;let i=Object.entries(r).filter(([e,t])=>t);if(i.length)return J.join(i.map(([r,i])=>{let a=n.relations[r],s=q(a,ZF),c=IF(a.targetTable,`d${h+1}`),l=a.throughTable?IF(a.throughTable,`tr${h}`):void 0,{filter:f,joinCondition:p}=uI(a,t,c,l),g=l?J` inner join ${dI(l)} on ${p}`:void 0,_=this.buildRelationalQuery({table:c,mode:s?`first`:`many`,schema:e,queryConfig:i,tableConfig:e[a.targetTableName],relationWhere:f,isNested:!0,errorPath:`${m.length?`${m}.`:``}${r}`,depth:h+1,throughJoin:g,jsonb:u});d.push({field:c,key:r,selection:_.selection,isArray:!s,isOptional:(a.optional??!1)||i!==!0&&!!i.where});let v=J.join(_.selection.map(e=>J`${J.raw(this.escapeString(e.key))}, ${e.selection?J`${u}(${J.identifier(e.key)})`:J.identifier(e.key)}`),J`, `),y=o?u:J`json`;return s?J`(select ${y}_object(${v}) as ${J.identifier(`r`)} from (${_.sql}) as ${J.identifier(`t`)}) as ${J.identifier(r)}`:J`coalesce((select ${y}_group_array(json_object(${v})) as ${J.identifier(`r`)} from (${_.sql}) as ${J.identifier(`t`)}), ${u}_array()) as ${J.identifier(r)}`}),J`, `)})():void 0,C=[v,x?.sql,S].filter(e=>e!==void 0);if(!C.length)throw new aF({message:`No fields selected for table "${n.name}"${m?` ("${m}")`:``}`});return{sql:J`select ${J.join(C,J`, `)} from ${dI(t)}${l}${J` where ${y}`.if(y)}${J` order by ${b}`.if(b)}${J` limit ${g}`.if(g!==void 0)}${J` offset ${_}`.if(_!==void 0)}`,selection:d}}},ML=class{static[K]=`SQLiteQueryBuilder`;dialect;dialectConfig;constructor(e){this.dialect=q(e,jL)?e:void 0,this.dialectConfig=q(e,jL)?void 0:e}$with=(e,t)=>{let n=this;return{as:r=>(typeof r==`function`&&(r=r(n)),new Proxy(new HP(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new xL({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})))}};with(...e){let t=this;function n(n){return new CL({fields:n??void 0,session:void 0,dialect:t.getDialect(),withList:e})}function r(n){return new CL({fields:n??void 0,session:void 0,dialect:t.getDialect(),withList:e,distinct:!0})}return{select:n,selectDistinct:r}}select(e){return new CL({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new CL({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}getDialect(){return this.dialect||=new jL(this.dialectConfig),this.dialect}},NL=class{static[K]=`SQLiteViewBuilderCore`;constructor(e){this.name=e}config={}},PL=class extends NL{static[K]=`SQLiteViewBuilder`;as(e){typeof e==`function`&&(e=e(new ML));let t=new xL({alias:this.name,sqlBehavior:`error`,sqlAliasedBehavior:`alias`,replaceOriginalName:!0}),n=e.getSelectedFields();return new Proxy(new IL({config:{name:this.name,schema:void 0,selectedFields:n,query:e.getSQL().inlineParams()}}),t)}},FL=class extends NL{static[K]=`SQLiteManualViewBuilder`;columns;constructor(e,t,n){super(e),this.columns=KF(oL(e,t,void 0,void 0,n))}existing(){return new Proxy(new IL({config:{name:this.name,schema:void 0,selectedFields:this.columns,query:void 0}}),new xL({alias:this.name,sqlBehavior:`error`,sqlAliasedBehavior:`alias`,replaceOriginalName:!0}))}as(e){return new Proxy(new IL({config:{name:this.name,schema:void 0,selectedFields:this.columns,query:e.inlineParams()}}),new xL({alias:this.name,sqlBehavior:`error`,sqlAliasedBehavior:`alias`,replaceOriginalName:!0}))}},IL=class extends bL{static[K]=`SQLiteView`;constructor({config:e}){super(e)}};function LL(e){return((t,n)=>n?new FL(t,n,e):new PL(t))}var RL={table:sL(`snake_case`),view:LL(`snake_case`)};function zL(e,t){return new Proxy(e,new PF(t,!1))}var BL=RL.table(`usine_events`,{eventId:$I().$type().primaryKey(),dedupKey:$I().$type().notNull().unique(),payloadJson:$I({mode:`json`}).$type().notNull(),receivedAt:$I().notNull()},e=>[uL(`usine_events_payload_json_valid`,J`json_valid(${e.payloadJson})`)]),VL=RL.table(`usine_trigger_events`,{eventId:$I().$type().primaryKey().references(()=>BL.eventId),itemKey:$I().$type().notNull(),loopName:$I().$type().notNull(),stepName:$I().$type().notNull(),approval:$I({enum:$N}).$type().notNull(),repository:$I().$type().notNull(),revision:$I().$type().notNull(),task:$I().$type().notNull(),agentJson:$I({mode:`json`}).$type().notNull(),parentModel:$I().$type()},e=>[uL(`usine_trigger_events_approval`,J`${e.approval} in ('none', 'required')`),uL(`usine_trigger_events_agent_json_valid`,J`json_valid(${e.agentJson})`),mL(`usine_trigger_events_item`).on(e.loopName,e.itemKey)]),HL=RL.table(`usine_runs`,{runId:$I().$type().primaryKey(),eventId:$I().$type().notNull().unique().references(()=>VL.eventId),loopName:$I().$type().notNull(),stateJson:$I({mode:`json`}).$type().notNull(),openedAt:$I().notNull(),repository:$I().$type().notNull(),revision:$I().$type().notNull(),task:$I().$type().notNull(),agentJson:$I({mode:`json`}).$type().notNull(),parentModel:$I().$type()},e=>[uL(`usine_runs_state_json_valid`,J`json_valid(${e.stateJson})`),uL(`usine_runs_agent_json_valid`,J`json_valid(${e.agentJson})`)]),UL=RL.table(`usine_steps`,{runId:$I().$type().notNull().references(()=>HL.runId),stepName:$I().$type().notNull(),result:$I({mode:`json`}).$type()},e=>[gL({columns:[e.runId,e.stepName]}),uL(`usine_steps_result_json_valid`,J`${e.result} is null or json_valid(${e.result})`)]),WL=RL.table(`usine_attempts`,{attemptId:$I().$type().primaryKey(),runId:$I().$type().notNull(),stepName:$I().$type().notNull(),workerName:$I().$type().notNull(),attemptNumber:RI({mode:`number`}).$type().notNull(),brainJson:$I({mode:`json`}).$type().notNull(),parentModel:$I().$type(),startedAt:$I().notNull(),outcomeJson:$I({mode:`json`}).$type()},e=>[uL(`usine_attempts_number`,J`${e.attemptNumber} >= 1`),uL(`usine_attempts_brain_json_valid`,J`json_valid(${e.brainJson})`),uL(`usine_attempts_outcome_json_valid`,J`${e.outcomeJson} is null or json_valid(${e.outcomeJson})`),hL(`usine_attempt_number`).on(e.runId,e.stepName,e.attemptNumber),hL(`usine_one_in_flight_attempt`).on(e.runId).where(J`${e.outcomeJson} is null`),gI({columns:[e.runId,e.stepName],foreignColumns:[UL.runId,UL.stepName]})]),GL=RL.table(`usine_attempt_transcripts`,{sequence:RI({mode:`number`}).primaryKey({autoIncrement:!0}),attemptId:$I().$type().notNull().references(()=>WL.attemptId),direction:$I({enum:rO}).notNull(),channelSequence:RI({mode:`number`}).$type().notNull(),envelope:$I({mode:`json`}).$type().notNull(),receivedAt:$I().notNull()},e=>[uL(`usine_attempt_transcripts_direction`,J`${e.direction} in ('inbound', 'outbound')`),uL(`usine_attempt_transcripts_sequence`,J`${e.channelSequence} >= 1`),uL(`usine_attempt_transcripts_envelope_json_valid`,J`json_valid(${e.envelope})`),hL(`usine_attempt_transcript_envelope`).on(e.attemptId,e.direction,e.channelSequence),mL(`usine_attempt_transcript_tail`).on(e.attemptId,e.sequence)]),KL=RL.table(`usine_approvals`,{runId:$I().$type().primaryKey().references(()=>HL.runId),eventId:$I().$type().notNull().unique().references(()=>BL.eventId)}),qL=RL.table(`usine_ignored_events`,{eventId:$I().$type().primaryKey().references(()=>VL.eventId),reason:$I({enum:aP}).$type().notNull()},e=>[uL(`usine_ignored_events_reason`,J`${e.reason} in ('superseded', 'revoked')`)]),JL=RL.table(`usine_workflow_commands`,{runId:$I().$type().notNull().references(()=>HL.runId),command:$I({enum:sP}).$type().notNull()},e=>[uL(`usine_workflow_commands_command`,J`${e.command} in ('Approve', 'Continue', 'Interrupt', 'Resume')`),gL({columns:[e.runId,e.command]})]),YL=RL.table(`usine_cursors`,{cursorKey:$I().primaryKey(),valueJson:$I({mode:`json`}).$type().notNull()},e=>[uL(`usine_cursors_value_json_valid`,J`json_valid(${e.valueJson})`)]),XL=RL.table(`usine_item_projections`,{itemKey:$I().$type().primaryKey(),repository:$I().$type().notNull(),source:$I().notNull(),itemNumber:RI({mode:`number`}).notNull(),contentHash:$I().notNull(),payloadJson:$I({mode:`json`}).$type().notNull()},e=>[uL(`usine_item_projections_number`,J`${e.itemNumber} >= 1`),uL(`usine_item_projections_payload_json_valid`,J`json_valid(${e.payloadJson})`),hL(`usine_item_projection_number`).on(e.repository,e.itemNumber),mL(`usine_item_projection_repository`).on(e.repository,e.itemNumber)]),ZL=RL.table(`usine_repository_label_projections`,{repository:$I().$type().primaryKey(),labelsJson:$I({mode:`json`}).$type().notNull()},e=>[uL(`usine_repository_label_projections_labels_json_valid`,J`json_valid(${e.labelsJson})`)]),QL=RL.table(`usine_loop_runtime`,{loopName:$I().$type().primaryKey(),paused:RI({mode:`boolean`}).notNull()}),$L=RL.table(`usine_projection_revision`,{singleton:RI({mode:`number`}).primaryKey().default(1),revision:RI({mode:`number`}).notNull().default(0)},e=>[uL(`usine_projection_revision_singleton`,J`${e.singleton} = 1`)]),eR=pw(H(V({itemKey:EP.fields.itemKey,repository:eD,source:CP,number:wP,contentHash:TP,payload:uE}))),tR=Ew(uE),nR=e=>t=>Lv(t,t=>new bP({operation:e,cause:t})),rR=yv(function*(){let e=yield*pI;return{list:z(`ItemProjectionReader.list`)(function*(t,n){return yield*Xv({repository:t,limit:n.limit}),(yield*eR(yield*e.select({itemKey:XL.itemKey,repository:XL.repository,source:XL.source,number:XL.itemNumber,contentHash:XL.contentHash,payload:XL.payloadJson}).from(XL).where(Y(XL.repository,t)).orderBy(jF(XL.itemNumber)).limit(n.limit).execute(),{onExcessProperty:`error`})).map(e=>new EP(e))},nR(`list Item projections`))}}),iR=yv(function*(){let e=yield*pI;return{upsert:z(`ItemProjectionWriter.upsert`)(function*(t){return yield*Xv({repository:t.repository,item:t.number,itemKey:t.itemKey}),(yield*e.insert(XL).values({itemKey:t.itemKey,repository:t.repository,source:t.source,itemNumber:t.number,contentHash:t.contentHash,payloadJson:tR(t.payload)}).onConflictDoUpdate({target:XL.itemKey,set:{repository:t.repository,source:t.source,itemNumber:t.number,contentHash:t.contentHash,payloadJson:tR(t.payload)},setWhere:sF(XL.contentHash,t.contentHash)}).returning({itemKey:XL.itemKey}).execute()).length===0?(yield*ay(`Item projection already matched the observed snapshot`,{repository:t.repository,item:t.number,contentHash:t.contentHash}),!1):(yield*ay(`Item projection updated from trigger polling`,{repository:t.repository,item:t.number,source:t.source,contentHash:t.contentHash}),!0)},nR(`write Item projection`))}});(class e extends bu()(`@usine/engine/ItemProjectionReader`){static layer=vg(e,rR)});var aR=class e extends bu()(`@usine/engine/ItemProjectionWriter`){static layer=vg(e,iR)},oR=H(B.check(lT(/\S/u,{message:`Expected a non-blank repository label`}))).check(vT()),sR=class extends W(`@usine/engine/RepositoryLabelProjection`)({repository:eD,labels:oR}){},cR=pw(H(V({repository:eD,labels:sR.fields.labels}))),lR=Ew(sR.fields.labels),uR=e=>t=>Lv(t,t=>new bP({operation:e,cause:t})),dR=yv(function*(){let e=yield*pI;return{get:z(`RepositoryLabelProjectionReader.get`)(function*(t){let n=(yield*cR(yield*e.select({repository:ZL.repository,labels:ZL.labelsJson}).from(ZL).where(Y(ZL.repository,t)).limit(1).execute(),{onExcessProperty:`error`}))[0];return n===void 0?L():ul(new sR(n))},uR(`read repository label projection`))}}),fR=yv(function*(){let e=yield*pI;return{replace:z(`RepositoryLabelProjectionWriter.replace`)(function*(t){yield*Xv({repository:t.repository});let n=lR(t.labels);return(yield*e.insert(ZL).values({repository:t.repository,labelsJson:n}).onConflictDoUpdate({target:ZL.repository,set:{labelsJson:n},setWhere:sF(ZL.labelsJson,n)}).returning({repository:ZL.repository}).execute()).length===0?(yield*ay(`Repository label projection already matched GitHub`,{repository:t.repository,labels:t.labels.length}),!1):(yield*ay(`Repository label projection updated from trigger polling`,{repository:t.repository,labels:t.labels.length}),!0)},uR(`write repository label projection`))}});(class e extends bu()(`@usine/engine/RepositoryLabelProjectionReader`){static layer=vg(e,dR)});var pR=class e extends bu()(`@usine/engine/RepositoryLabelProjectionWriter`){static layer=vg(e,fR)},mR=U.pipe($w(`CursorKey`)),hR=pw(H(V({value:lE}))),gR=e=>t=>Lv(t,t=>new bP({operation:e,cause:t})),_R=class e extends bu()(`@usine/engine/CursorStore`){static layer=vg(e,yv(function*(){let e=yield*pI;return{read:z(`CursorStore.read`)(function*(t,n){let r=gl((yield*yv(function*(){return yield*hR(yield*e.select({value:YL.valueJson}).from(YL).where(Y(YL.cursorKey,t)).limit(1).execute())}).pipe(gR(`read runtime cursor`)))[0]);return fl(r)?L():yield*pw(n)(r.value.value,{onExcessProperty:`error`}).pipe(Av(ul),Nv(e=>ny(`Stored cursor no longer decodes; treating it as absent`,{key:t,detail:e.message}).pipe(jv(L()))))}),write:z(`CursorStore.write`)(function*(t,n,r){let i=yield*ww(n)(r).pipe(gR(`encode runtime cursor`));yield*e.insert(YL).values({cursorKey:t,valueJson:i}).onConflictDoUpdate({target:YL.cursorKey,set:{valueJson:i}}).execute().pipe(Mv,gR(`write runtime cursor`))})}}))},vR=Symbol.for(`~effect/http/Headers`),yR=Object.defineProperties(Object.create(null),{[vR]:{value:vR},[Ds]:{value(e){return DR(this,Gu(e,OR))}},toJSON:{value(){return ks(this)}},[ns]:{value(e){return xR(this,e)}},[Ro]:{value(){return qo(this)}},toString:{value:Ws.toString},[Vs]:{value:Ws[Vs]}}),bR=e=>Object.assign(Object.create(yR),e),xR=Vl(xs()),SR=Object.create(yR),CR=e=>{if(e===void 0)return SR;if(Symbol.iterator in e){let t=Object.create(yR);for(let[n,r]of e)t[n.toLowerCase()]=r;return t}let t=Object.create(yR);for(let[n,r]of Object.entries(e))Array.isArray(r)?t[n.toLowerCase()]=r.join(`, `):r!==void 0&&(t[n.toLowerCase()]=r);return t},wR=I(3,(e,t,n)=>{let r=bR(e);return r[t.toLowerCase()]=n,r}),TR=I(2,(e,t)=>bR({...e,...CR(t)})),ER=I(2,(e,t)=>{let n=bR(e);return delete n[t.toLowerCase()],n}),DR=I(2,(e,t)=>{let n={...e},r=t=>{if(typeof t==`string`){let r=t.toLowerCase();r in e&&(n[r]=ew(e[r]))}else for(let r in e)t.test(r)&&(n[r]=ew(e[r]))};if(Array.isArray(t))for(let e=0;e<t.length;e++)r(t[e]);else r(t);return n}),OR=Xu(`effect/Headers/CurrentRedactedNames`,{defaultValue:()=>[`authorization`,`cookie`,`set-cookie`,`x-api-key`]}),kR=`~effect/http/UrlParams`,AR=e=>Fo(e,kR),jR={...rc,[kR]:kR,[Symbol.iterator](){return this.params[Symbol.iterator]()},toJSON(){return{_id:`UrlParams`,params:Object.fromEntries(this.params)}},[ns](e){return FR(this,e)},[Ro](){return Yo(this.params.flat())}},MR=e=>{let t=Object.create(jR);return t.params=e,t},NR=e=>{if(AR(e))return e;let t=PR(e),n=[];for(let e=0;e<t.length;e++)if(Array.isArray(t[e][0])){let[r,i]=t[e];n.push([`${r[0]}[${r.slice(1).join(`][`)}]`,i])}else n.push(t[e]);return MR(n)},PR=e=>{let t=typeof e[Symbol.iterator]==`function`?Ul(e):Object.entries(e),n=[];for(let[e,r]of t)if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]!==void 0&&n.push([e,String(r[t])]);else if(typeof r==`object`){let t=PR(r);for(let[r,i]of t)n.push([[e,...typeof r==`string`?[r]:r],i])}else r!==void 0&&n.push([e,String(r)]);return n},FR=ys((e,t)=>IR(e.params,t.params)),IR=$l(Ll([xs(),xs()])),LR=MR([]),RR=I(2,(e,t)=>{let n=NR(t),r=n.params,i=new Set;for(let e=0;e<r.length;e++)i.add(r[e][0]);for(let t=0;t<e.params.length;t++)i.has(e.params[t][0])||r.push(e.params[t]);return n}),zR=`~effect/http/HttpBody`;Vd(`HttpBodyError`);var BR=class{[zR];constructor(){this[zR]=zR}[Vs](){return this.toJSON()}toString(){return Ps(this,{ignoreToString:!0})}},VR=new class extends BR{_tag=`Empty`;toJSON(){return{_id:`effect/HttpBody`,_tag:`Empty`}}},HR=class extends BR{_tag=`Uint8Array`;body;contentType;contentLength;constructor(e,t,n){super(),this.body=e,this.contentType=t,this.contentLength=n}toJSON(){return{_id:`effect/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}}},UR=(e,t)=>new HR(e,t??`application/octet-stream`,e.length),WR=new TextEncoder,GR=(e,t)=>UR(WR.encode(e),t??`text/plain`),KR=(e,t)=>GR(JSON.stringify(e),t??`application/json`);Vd(`CookieError`),{...Ws},{...Ws},Vd(`HttpClientError`),Vd(`TransportError`),Vd(`EncodeError`),Vd(`InvalidUrlError`),Vd(`StatusCodeError`),Vd(`DecodeError`),Vd(`EmptyBodyError`),eE(`~effect/http/HttpClientError`)({_tag:iT(`HttpError`),kind:Xw([`EncodeError`,`DecodeError`,`TransportError`,`InvalidUrlError`,`StatusCodeError`,`EmptyBodyError`]),cause:Aw(FT())});var qR=[[`GET`,`get`],[`POST`,`post`],[`PUT`,`put`],[`DELETE`,`del`],[`PATCH`,`patch`],[`HEAD`,`head`],[`OPTIONS`,`options`],[`TRACE`,`trace`]],JR=(e,t)=>t._tag===`Empty`||t._tag===`FormData`?ER(ER(e,`content-type`),`content-length`):(e=t.contentType===void 0?ER(e,`content-type`):wR(e,`content-type`,t.contentType),t.contentLength===void 0?ER(e,`content-length`):wR(e,`content-length`,t.contentLength.toString())),YR=`~effect/http/HttpClientRequest`,XR={[YR]:YR,...Ws,toJSON(){return{_id:`HttpClientRequest`,method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:ks(this.headers),body:this.body.toJSON()}},pipe(){return oo(this,arguments)}};function ZR(e,t,n,r,i,a){let o=Object.create(XR);return o.method=e,o.url=t,o.urlParams=n,o.hash=r,o.headers=i,o.body=a,o}var QR=ZR(`GET`,``,LR,L(),SR,VR),$R=e=>(t,n)=>nz(QR,{method:e,url:t,...n??void 0}),ez=$R(`GET`),tz=$R(`POST`),nz=I(2,(e,t)=>{let n=e;return t.method&&(n=rz(n,t.method)),t.url&&(n=cz(n,t.url)),t.headers&&(n=az(n,t.headers)),t.urlParams&&(n=lz(n,t.urlParams)),t.hash&&(n=uz(n,t.hash)),t.body&&(n=dz(n,t.body)),t.accept&&(n=oz(n,t.accept)),t.acceptJson&&(n=sz(n)),n}),rz=I(2,(e,t)=>ZR(t,e.url,e.urlParams,e.hash,e.headers,e.body)),iz=I(3,(e,t,n)=>ZR(e.method,e.url,e.urlParams,e.hash,wR(e.headers,t,n),e.body)),az=I(2,(e,t)=>ZR(e.method,e.url,e.urlParams,e.hash,TR(e.headers,t),e.body)),oz=I(2,(e,t)=>iz(e,`Accept`,t)),sz=oz(`application/json`),cz=I(2,(e,t)=>{if(typeof t==`string`)return ZR(e.method,t,e.urlParams,e.hash,e.headers,e.body);let n=new URL(t.toString()),r=NR(n.searchParams),i=gl(n.hash===``?void 0:n.hash.slice(1));return n.search=``,n.hash=``,ZR(e.method,n.toString(),r,i,e.headers,e.body)}),lz=I(2,(e,t)=>ZR(e.method,e.url,RR(e.urlParams,t),e.hash,e.headers,e.body)),uz=I(2,(e,t)=>ZR(e.method,e.url,e.urlParams,ul(t),e.headers,e.body)),dz=I(2,(e,t)=>ZR(e.method,e.url,e.urlParams,e.hash,JR(e.headers,t),t)),fz=I(2,(e,t)=>dz(e,KR(t))),pz=(e,t)=>{let n=hw(nE(e)),r=t?.reviver===void 0?void 0:hw(WT(nE(e),t));return e=>r===void 0?Tv(e.json,e=>n(e,t)):Tv(e.text,i=>i===``?Tv(e.json,e=>n(e,t)):r(i,t))},mz=bu(`effect/HttpClient`);({...Ws}),{...Object.fromEntries(qR.map(([e,t])=>[t,function(t,n){return this.execute($R(e)(t,n))}]))};var hz=e=>Av(dv(()=>crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e))),e=>{let t=new Uint8Array(e),n=``;for(let e=0;e<16;e++)n+=t[e].toString(16).padStart(2,`0`);return n}),gz=`~effect/workflow/Workflow`,_z=bu(`effect/workflow/WorkflowEngine`),vz=bu(`effect/workflow/WorkflowEngine/WorkflowInstance`),yz=(e,t)=>hz(`${e._tag}-${e.idempotencyKey(t)}`),bz={[gz]:gz,annotate(e,t){return xz({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,annotations:Vu(this.annotations,e,t),idempotencyKey:this.idempotencyKey,suspendedRetrySchedule:this.suspendedRetrySchedule})},annotateMerge(e){return xz({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,annotations:Yu(this.annotations,e),idempotencyKey:this.idempotencyKey,suspendedRetrySchedule:this.suspendedRetrySchedule})},execute(e,t){return hv(()=>{let n=this.payloadSchema.make(e);return Tv(_z,e=>Tv(yz(this,n),r=>Ev(Xv({executionId:r}),e.execute(this,{executionId:r,payload:n,discard:t?.discard,suspendedRetrySchedule:this.suspendedRetrySchedule}))))}).pipe(Zv(`${this._tag}.execute`,{},{captureStackTrace:!1}))},poll(e){return Tv(_z,t=>t.poll(this,e)).pipe(Zv(`${this._tag}.poll`,{attributes:{executionId:e}},{captureStackTrace:!1}))},interrupt(e){return Tv(_z,t=>t.interrupt(this,e)).pipe(Zv(`${this._tag}.interrupt`,{attributes:{executionId:e}},{captureStackTrace:!1}))},resume(e){return Tv(_z,t=>t.resume(this,e)).pipe(Zv(`${this._tag}.resume`,{attributes:{executionId:e}},{captureStackTrace:!1}))},toLayer(e){return xg(Tv(_z,t=>t.register(this,e)))},executionId(e){return Tv(Rv(this.payloadSchema.makeEffect(e)),e=>yz(this,e))},withCompensation:(...e)=>Oz(...e)},xz=e=>{function t(){}return Object.setPrototypeOf(t,bz),Object.assign(t,e),t},Sz=(e,t)=>xz({_tag:e,payloadSchema:Ow(t.payload)?t.payload:V(t.payload),successSchema:t.success??Vw,errorSchema:t.error??Pw,annotations:t.annotations??Ru(),idempotencyKey:t.idempotencyKey,suspendedRetrySchedule:t.suspendedRetrySchedule}),Cz=`~effect/workflow/Workflow/Result`,wz=e=>Fo(e,Cz);W(`effect/workflow/Workflow/Suspended`)({_tag:iT(`Suspended`),cause:Aw(OT(Pw,FT()))});var Tz=(e,t)=>Hv(n=>{let r=Gu(n,vz),i=r.activityState;return i.count===0&&i.latch.closeUnsafe(),i.count++,Kv(e,e=>{i.count--;let n=sg(e)&&t(e.value);return sg(e)&&wz(e.value)&&e.value._tag===`Suspended`&&e.value.cause&&(r.cause=r.cause?tee(r.cause,e.value.cause):e.value.cause),i.count===0?i.latch.open:n?Ez(r):_v})}),Ez=ty(function*(e){let t=e.activityState;for(;;){if(t.count>0){yield*t.latch.await,yield*wv;continue}if(yield*wv,t.count===0)return}}),Dz=ty(function*(e){let t=(yield*vz).scope,n=yield*Vv();yield*lg(t,t=>Uv(e(t),n))}),Oz=I(2,(e,t)=>Jv(n=>Dv(n(e),e=>Dz(n=>sg(n)?_v:t(e,n.cause))))),kz=e=>qv(vv(()=>{e.suspended=!0;let t=hC();t.interruptUnsafe(t.id)})),Az=Xu(`effect/workflow/Workflow/SuspendOnFailure`,{defaultValue:po}),jz=`~effect/workflow/DurableDeferred`,Mz=(e,t)=>{let n=t?.success??Vw,r=t?.error??Pw;return{[jz]:jz,name:e,successSchema:n,errorSchema:r,exitSchema:IT(nE(n),nE(r),nE(FT())),withActivityAttempt:yv(function*(){return Mz(`${e}/${yield*Fz}`,{success:n,error:r})})}},Nz=bu(`effect/workflow/WorkflowEngine`),Pz=bu(`effect/workflow/WorkflowEngine/WorkflowInstance`),Fz=Xu(`effect/workflow/Activity/CurrentAttempt`,{defaultValue:()=>1}),Iz=ty(function*(e){let t=yield*Nz,n=yield*Pz;n.awaitedDeferreds.add(e.name);let r=yield*Tz(t.deferredResult(e),fl);return fl(r)?yield*kz(n):yield*r.value}),Lz=class e extends W(`effect/workflow/DurableDeferred/TokenParsed`)({workflowName:B,executionId:B,deferredName:B}){get asToken(){return Gd(JSON.stringify([this.workflowName,this.executionId,this.deferredName]))}static FromString=B.pipe(eT(WT(qw([B,B,B])),{decode:Nb(),encode:Mb()}),eT(e,{decode:Sb(([t,n,r])=>new e({workflowName:t,executionId:n,deferredName:r})),encode:Sb(e=>[e.workflowName,e.executionId,e.deferredName])}));static fromString=Sw(e.FromString);static encode=Ew(e.FromString)},Nee=I(2,(e,t)=>new Lz({workflowName:t.workflow._tag,executionId:t.executionId,deferredName:e.name}).asToken),Pee=I(2,ty(function*(e,t){let n=yield*Nz,r=Lz.fromString(t.token);yield*n.deferredDone(e,{workflowName:r.workflowName,executionId:r.executionId,deferredName:r.deferredName,exit:t.exit})})),Fee=I(2,(e,t)=>Pee(e,{token:t.token,exit:rg(t.value)})),Rz=class extends bu()(`effect/workflow/WorkflowEngine`){};bu()(`effect/workflow/WorkflowEngine/WorkflowInstance`);var zz=V({eventId:uD,dedupKey:dD,payload:lE,receivedAt:KT,itemKey:_O,loop:pD,step:GD,approval:eP,repository:eD,revision:tD,task:aO,agent:VE,parentModel:Zw(IE)}),Iee=V({itemKey:_O,repository:eD,revision:tD,task:aO,agent:VE,parentModel:Zw(IE),runId:VD,eventId:uD,loop:pD,state:DD,openedAt:KT,stepName:GD,result:Zw(WD)}),Lee=V({attemptId:YD,runId:VD,stepName:GD,worker:JD,number:XD,brain:BE,parentModel:Zw(IE),startedAt:KT,outcome:Zw(eO)}),Ree=V({sequence:gP,attemptId:YD,direction:iO,envelope:hO,receivedAt:KT}),zee=V({...zz.fields,runId:VD,state:DD}),Bee=V({runId:VD}),Vee=V({reason:oP}),Hee=V({runId:VD,command:cP}),Uee=V({revision:mP}),Bz=pw(H(zz)),Vz=pw(H(Iee)),Hz=pw(H(Lee)),Wee=pw(H(zee)),Uz=pw(H(Bee)),Gee=pw(H(Vee)),Kee=pw(H(Hee)),qee=pw(H(Uee)),Jee=pw(H(Ree)),Wz=Ew(lE),Gz=Ew(KT),Kz=Ew(DD),Yee=Ew(eO),Xee=Ew(WD),Zee=Ew(hO),Qee=Ew(VE),$ee=Ew(BE),ete=fw(SP),qz=e=>t=>Lv(t,t=>ete(t)?t:new bP({operation:e,cause:t})),Jz=e=>new fD({id:e.eventId,dedupKey:e.dedupKey,payload:e.payload,receivedAt:e.receivedAt}),Yz=e=>new nP({event:Jz(e),itemKey:e.itemKey,loop:e.loop,step:e.step,approval:e.approval,repository:e.repository,revision:e.revision,task:e.task,agent:e.agent,parentModel:gl(e.parentModel)}),Xz=e=>new HD({id:e.runId,eventId:e.eventId,loop:e.loop,state:e.state,openedAt:e.openedAt}),Zz=e=>new KD({runId:e.runId,name:e.stepName,result:gl(e.result)}),Qz=e=>new tO({id:e.attemptId,runId:e.runId,stepName:e.stepName,worker:e.worker,number:e.number,brain:e.brain,parentModel:gl(e.parentModel),startedAt:e.startedAt,outcome:gl(e.outcome)}),tte=(e,t)=>new pP({itemKey:e.itemKey,run:Xz(e),step:Zz(e),attempts:t.map(Qz),repository:e.repository,task:e.task,agent:e.agent}),nte=e=>new _P({sequence:e.sequence,attemptId:e.attemptId,direction:e.direction,envelope:e.envelope,receivedAt:e.receivedAt}),$z={eventId:BL.eventId,dedupKey:BL.dedupKey,payload:BL.payloadJson,receivedAt:BL.receivedAt,itemKey:VL.itemKey,loop:VL.loopName,step:VL.stepName,approval:VL.approval,repository:VL.repository,revision:VL.revision,task:VL.task,agent:VL.agentJson,parentModel:VL.parentModel},eB={itemKey:VL.itemKey,runId:HL.runId,eventId:HL.eventId,loop:HL.loopName,state:HL.stateJson,openedAt:HL.openedAt,repository:HL.repository,revision:HL.revision,task:HL.task,agent:HL.agentJson,parentModel:HL.parentModel,stepName:UL.stepName,result:UL.result},tB={attemptId:WL.attemptId,runId:WL.runId,stepName:WL.stepName,worker:WL.workerName,number:WL.attemptNumber,brain:WL.brainJson,parentModel:WL.parentModel,startedAt:WL.startedAt,outcome:WL.outcomeJson},nB=J`json_extract(${HL.stateJson}, '$._tag')`,rB=hF(nB,[...AD]),rte=hF(nB,[...MD]),iB=e=>xw(lE)(Qee(e)),aB=e=>{let t=z(`RunStoreQueries.eventRouteByDedup`)(function*(t){return yield*Bz(yield*e.select($z).from(BL).innerJoin(VL,Y(VL.eventId,BL.eventId)).where(Y(BL.dedupKey,t)).execute())}),n=z(`RunStoreQueries.eventRouteByRun`)(function*(t){return yield*Bz(yield*e.select($z).from(HL).innerJoin(BL,Y(BL.eventId,HL.eventId)).innerJoin(VL,Y(VL.eventId,BL.eventId)).where(Y(HL.runId,t)).execute())}),r=z(`RunStoreQueries.runRows`)(function*(t){return yield*Vz(yield*e.select(eB).from(HL).innerJoin(VL,Y(VL.eventId,HL.eventId)).innerJoin(UL,Y(UL.runId,HL.runId)).where(Y(HL.runId,t)).execute())}),i=z(`RunStoreQueries.attemptRows`)(function*(t){return yield*Hz(yield*e.select(tB).from(WL).where(Y(WL.runId,t)).orderBy(WL.attemptNumber).execute())}),a=z(`RunStoreQueries.snapshot`)(function*(e){let[t,a,o]=yield*lv([r(e),i(e),n(e)]),s=t[0],c=o[0];return s===void 0||c===void 0?yield*new vP({runId:e}):new fP({event:Jz(c),itemKey:c.itemKey,run:Xz(s),step:Zz(s),attempts:a.map(Qz),repository:s.repository,revision:s.revision,task:s.task,agent:s.agent,parentModel:gl(s.parentModel)})}),o=z(`RunStoreQueries.runSummaries`)(function*(t){let[n,r]=yield*lv([e.select(eB).from(HL).innerJoin(VL,Y(VL.eventId,HL.eventId)).innerJoin(UL,Y(UL.runId,HL.runId)).where(rB).orderBy(jF(HL.openedAt),jF(HL.runId)).execute().pipe(Tv(Vz)),e.select(eB).from(HL).innerJoin(VL,Y(VL.eventId,HL.eventId)).innerJoin(UL,Y(UL.runId,HL.runId)).where(gF(nB,[...AD])).orderBy(jF(HL.openedAt),jF(HL.runId)).limit(t).execute().pipe(Tv(Vz))]),i=[...n,...r].sort((e,t)=>fb(t.openedAt)-fb(e.openedAt)||(t.runId>e.runId?1:-1)),a=i.map(({runId:e})=>e),o=a.length===0?[]:yield*e.select(tB).from(WL).where(hF(WL.runId,a)).orderBy(AF(WL.runId),AF(WL.attemptNumber)).execute().pipe(Tv(Hz)),s=new Map;for(let e of o){let t=s.get(e.runId)??[];t.push(e),s.set(e.runId,t)}return i.map(e=>tte(e,s.get(e.runId)??[]))}),s=z(`RunStoreQueries.projectionRevision`)(function*(){return gl((yield*qee(yield*e.select({revision:$L.revision}).from($L).where(Y($L.singleton,1)).limit(1).execute()))[0]?.revision)}),c=z(`RunStoreQueries.updateState`)(function*(t,n){if((yield*e.update(HL).set({stateJson:Kz(n)}).where(Y(HL.runId,t)).returning({runId:HL.runId}).execute()).length===0)return yield*new vP({runId:t})}),l=z(`RunStoreQueries.addAttempt`)(function*(t){yield*e.insert(WL).values({attemptId:t.id,runId:t.runId,stepName:t.stepName,workerName:t.worker,attemptNumber:t.number,brainJson:$ee(t.brain),parentModel:yl(t.parentModel),startedAt:Gz(t.startedAt),outcomeJson:null}).execute()}),u=z(`RunStoreQueries.closeAttempt`)(function*(t,n){yield*e.update(WL).set({outcomeJson:Yee(n)}).where(cF(Y(WL.attemptId,t),_F(WL.outcomeJson))).execute()}),d=z(`RunStoreQueries.updateAttemptParentModel`)(function*(t,n){yield*e.update(WL).set({parentModel:n}).where(Y(WL.attemptId,t)).execute()}),f=z(`RunStoreQueries.updateStepResult`)(function*(t,n,r){yield*e.update(UL).set({result:Xee(r)}).where(cF(Y(UL.runId,t),Y(UL.stepName,n))).execute()}),p=z(`RunStoreQueries.approvalExists`)(function*(t){return(yield*e.$count(KL,Y(KL.runId,t)).execute())>0}),m=z(`RunStoreQueries.recordApproval`)(function*(t,n){yield*e.insert(BL).values({eventId:n.id,dedupKey:n.dedupKey,payloadJson:Wz(n.payload),receivedAt:Gz(n.receivedAt)}).onConflictDoNothing().execute(),yield*e.insert(KL).values({runId:t,eventId:n.id}).execute()}),h=z(`RunStoreQueries.requestWorkflowCommand`)(function*(t,n){yield*e.insert(JL).values({runId:t,command:n}).onConflictDoNothing().execute()}),g=z(`RunStoreQueries.requestInterrupt`)(function*(t){yield*e.delete(JL).where(cF(Y(JL.runId,t),hF(JL.command,[`Approve`,`Resume`]))).execute(),yield*h(t,`Interrupt`)}),_=z(`RunStoreQueries.hasWorkflowCommand`)(function*(t,n){return(yield*e.$count(JL,cF(Y(JL.runId,t),Y(JL.command,n))).execute())>0}),v=z(`RunStoreQueries.createRun`)(function*(t,n,r){let i=zL(VL,`candidate`),a=zL(HL,`candidate_run`),o=zL(qL,`ignored`);yield*e.insert(qL).select(e.select({eventId:i.eventId,reason:J`'superseded'`.as(`reason`)}).from(i).leftJoin(a,Y(a.eventId,i.eventId)).leftJoin(o,Y(o.eventId,i.eventId)).where(cF(Y(i.loopName,t.loop),Y(i.itemKey,t.itemKey),sF(i.eventId,n),_F(a.runId),_F(o.eventId)))).onConflictDoNothing().execute(),yield*e.insert(HL).values({runId:r,eventId:n,loopName:t.loop,stateJson:Kz(new bD),openedAt:Gz(t.event.receivedAt),repository:t.repository,revision:t.revision,task:t.task,agentJson:iB(t.agent),parentModel:yl(t.parentModel)}).onConflictDoNothing().execute(),yield*e.insert(UL).values({runId:r,stepName:t.step,result:null}).onConflictDoNothing().execute()}),y=z(`RunStoreQueries.runForEvent`)(function*(t){return yield*Uz(yield*e.select({runId:HL.runId}).from(HL).where(Y(HL.eventId,t)).execute())}),b=z(`RunStoreQueries.ignoredEvent`)(function*(t){return yield*Gee(yield*e.select({reason:qL.reason}).from(qL).where(Y(qL.eventId,t)).execute())}),x=z(`RunStoreQueries.blockingRun`)(function*(t,n){return yield*Uz(yield*e.select({runId:HL.runId}).from(HL).innerJoin(VL,Y(VL.eventId,HL.eventId)).where(cF(Y(VL.loopName,t),Y(VL.itemKey,n),rB)).orderBy(jF(HL.openedAt)).limit(1).execute())}),S=z(`RunStoreQueries.recordTriggerEvent`)(function*(n){yield*e.insert(BL).values({eventId:n.event.id,dedupKey:n.event.dedupKey,payloadJson:Wz(n.event.payload),receivedAt:Gz(n.event.receivedAt)}).onConflictDoNothing().execute();let r=(yield*t(n.event.dedupKey))[0];return r===void 0?(yield*e.insert(VL).values({eventId:n.event.id,itemKey:n.itemKey,loopName:n.loop,stepName:n.step,approval:n.approval,repository:n.repository,revision:n.revision,task:n.task,agentJson:iB(n.agent),parentModel:yl(n.parentModel)}).execute(),n):Yz(r)}),C=z(`RunStoreQueries.nextQueued`)(function*(t){let r=(yield*n(t))[0];return r===void 0?L():gl((yield*Bz(yield*e.select($z).from(BL).innerJoin(VL,Y(VL.eventId,BL.eventId)).leftJoin(HL,Y(HL.eventId,BL.eventId)).leftJoin(qL,Y(qL.eventId,BL.eventId)).where(cF(Y(VL.loopName,r.loop),Y(VL.itemKey,r.itemKey),_F(HL.runId),_F(qL.eventId))).orderBy(jF(BL.receivedAt)).limit(1).execute()))[0]).pipe(Sl(Yz))}),w=z(`RunStoreQueries.appendTranscript`)(function*(t,n,r){yield*e.insert(GL).values({attemptId:n.attemptId,direction:t,channelSequence:n.sequence,envelope:Zee(n),receivedAt:Gz(r)}).onConflictDoNothing().execute()}),T=z(`RunStoreQueries.transcript`)(function*(t){yield*Xv({attemptId:t.attemptId,query:t._tag});let n=xE(t,{TranscriptAllQuery:({attemptId:e})=>Y(GL.attemptId,e),TranscriptTailQuery:({attemptId:e,after:t})=>cF(Y(GL.attemptId,e),dF(GL.sequence,t)),TranscriptPageQuery:({attemptId:e,before:t})=>pl(t,{onNone:()=>Y(GL.attemptId,e),onSome:t=>cF(Y(GL.attemptId,e),pF(GL.sequence,t))})}),r=e.select({sequence:GL.sequence,attemptId:GL.attemptId,direction:GL.direction,envelope:GL.envelope,receivedAt:GL.receivedAt}).from(GL).where(n);return(yield*Jee(yield*xE(t,{TranscriptAllQuery:()=>r.orderBy(AF(GL.sequence)).execute(),TranscriptTailQuery:({limit:e})=>r.orderBy(AF(GL.sequence)).limit(e).execute(),TranscriptPageQuery:({limit:e})=>r.orderBy(jF(GL.sequence)).limit(e).execute()}),{onExcessProperty:`error`})).map(nte).sort((e,t)=>e.sequence-t.sequence)}),E=z(`RunStoreQueries.recoverable`)(function*(){return yield*Wee(yield*e.select({...$z,runId:HL.runId,state:HL.stateJson}).from(HL).innerJoin(BL,Y(BL.eventId,HL.eventId)).innerJoin(VL,Y(VL.eventId,BL.eventId)).where(rB).execute())}),ee=z(`RunStoreQueries.pendingWorkflowCommands`)(function*(){let t=yield*Kee(yield*e.select({runId:JL.runId,command:JL.command}).from(JL).execute()),n=e=>lP.indexOf(e);return[...t].sort((e,t)=>e.runId===t.runId?n(e.command)-n(t.command):e.runId<t.runId?-1:1)});return{addAttempt:l,appendTranscript:w,approvalExists:p,blockingRun:x,closeAttempt:u,completeWorkflowCommand:z(`RunStoreQueries.completeWorkflowCommand`)(function*(t,n){yield*e.delete(JL).where(cF(Y(JL.runId,t),Y(JL.command,n))).execute()}),createRun:v,eventRouteByRun:n,hasWorkflowCommand:_,ignoredEvent:b,nextQueued:C,pendingWorkflowCommands:ee,recordTriggerEvent:S,recoverable:E,recordApproval:m,requestInterrupt:g,requestWorkflowCommand:h,revision:s,revokeUnstarted:z(`RunStoreQueries.revokeUnstarted`)(function*(t,n){let r=yield*Uz(yield*e.select({runId:HL.runId}).from(HL).innerJoin(VL,Y(VL.eventId,HL.eventId)).where(cF(Y(VL.loopName,t),Y(VL.itemKey,n),rte)).execute()),i=zL(VL,`candidate`),a=zL(HL,`candidate_run`);return yield*e.insert(qL).select(e.select({eventId:i.eventId,reason:J`'revoked'`.as(`reason`)}).from(i).leftJoin(a,Y(a.eventId,i.eventId)).where(cF(Y(i.loopName,t),Y(i.itemKey,n),_F(a.runId)))).onConflictDoNothing().execute(),r}),runSummaries:o,runForEvent:y,snapshot:a,transcript:T,updateStepResult:f,updateAttemptParentModel:d,updateState:c}},oB=XD.make(3),sB=class extends W(`@usine/engine/internal/StoredSubmission`)({submission:nP,runId:VD}){},ite=class extends W(`@usine/engine/internal/RecoverableRun`)({submission:nP,runId:VD,state:DD}){},cB=class extends W(`@usine/engine/internal/Claim`)({submission:nP,result:Yw([rP,iP,uP]),supersededRun:yT(VD)}){},ate=class extends G(`@usine/engine/internal/AttemptStarted`)(`AttemptStarted`,{execution:hP}){},lB=class extends G(`@usine/engine/internal/AttemptRecoveryFailed`)(`AttemptRecoveryFailed`,{failure:aD}){},uB=class extends G(`@usine/engine/internal/RunClosed`)(`RunClosed`,{state:B}){},dB=yv(function*(){let e=yield*pI,t=aB(e),n=(e,t,n=L())=>new cB({submission:e,result:new rP({eventId:e.event.id,runId:t}),supersededRun:n}),r=z(`RunStore.openRun`)(function*(e,t,r,i=L()){return yield*e.createRun(t,t.event.id,r),n(t,r,i)}),i=z(`RunStore.recordAndClaim`)(function*(t,i){return yield*e.transaction(e=>yv(function*(){let a=aB(e),o=yield*a.recordTriggerEvent(t),s=yield*a.runForEvent(o.event.id);if(s[0]!==void 0)return n(o,s[0].runId);let c=yield*a.ignoredEvent(o.event.id);if(c[0]!==void 0)return new cB({submission:o,result:new uP({eventId:o.event.id,reason:c[0].reason}),supersededRun:L()});let l=(yield*a.blockingRun(o.loop,o.itemKey))[0];if(l===void 0)return yield*r(a,o,i);let u=yield*a.snapshot(l.runId);return u.run.state._tag===`Running`?new cB({submission:o,result:new iP({eventId:o.event.id}),supersededRun:L()}):u.run.state._tag===`Pending`||u.run.state._tag===`Waiting`?(yield*a.updateState(u.run.id,zD(u.run.state,o.event.id)),yield*a.requestInterrupt(u.run.id),yield*r(a,o,i,ul(u.run.id))):yield*r(a,o,i)}))},qz(`submit Event`)),a=z(`RunStore.parkForApproval`)(function*(t){yield*e.transaction(e=>yv(function*(){let n=aB(e),r=yield*n.snapshot(t);r.run.state._tag===`Pending`&&(yield*n.updateState(t,ND(r.run.state)))}))},qz(`park run for approval`)),o=z(`RunStore.beginAttempt`)(function*(t,n){return yield*e.transaction(e=>yv(function*(){let r=aB(e),i=yield*r.snapshot(t),a=i.run.state,o=i.attempts[i.attempts.length-1];if(a._tag===`Running`&&o!==void 0&&fl(o.outcome)){let e=new aD({message:`The orchestrator stopped during the attempt`,cause:Error(`attempt interrupted by orchestrator restart`)});if(yield*r.closeAttempt(o.id,new QD({failure:e})),!nO({failure:e,number:o.number,maxAutoAttempts:oB}))return yield*r.updateState(t,ID(a)),yield*r.requestWorkflowCommand(t,`Continue`),new lB({failure:e})}if((a._tag===`Pending`||a._tag===`Waiting`)&&(a=PD(a),yield*r.updateState(t,a)),a._tag!==`Running`)return new uB({state:a._tag});let s=XD.make((o?.number??0)+1),c=YD.make(`${t}/${i.step.name}/${s}`),l=yield*sb,u=new tO({id:c,runId:t,stepName:i.step.name,worker:n,number:s,brain:i.agent.brain,parentModel:i.parentModel,startedAt:l,outcome:L()});return yield*r.addAttempt(u),new ate({execution:new hP({attempt:u,event:i.event,run:new HD({id:i.run.id,eventId:i.run.eventId,loop:i.run.loop,state:a,openedAt:i.run.openedAt}),step:i.step,repository:i.repository,revision:i.revision,task:i.task,agent:i.agent,parentModel:i.parentModel})})}))},qz(`begin attempt`)),s=z(`RunStore.succeedAttempt`)(function*(t,n){yield*e.transaction(e=>yv(function*(){let r=aB(e),i=yield*r.snapshot(t.runId);i.run.state._tag===`Running`&&(yield*r.closeAttempt(t.id,new ZD),yield*r.updateStepResult(t.runId,t.stepName,n),yield*r.updateState(t.runId,FD(i.run.state)),yield*r.requestWorkflowCommand(t.runId,`Continue`))}))},qz(`succeed attempt`)),c=z(`RunStore.failAttempt`)(function*(t,n){return yield*e.transaction(e=>yv(function*(){let r=aB(e),i=yield*r.snapshot(t.runId);if(i.run.state._tag!==`Running`)return!1;yield*r.closeAttempt(t.id,new QD({failure:n}));let a=nO({failure:n,number:t.number,maxAutoAttempts:oB});return a||(yield*r.updateState(t.runId,ID(i.run.state)),yield*r.requestWorkflowCommand(t.runId,`Continue`)),a}))},qz(`fail attempt`)),l=z(`RunStore.approve`)(function*(t,n){yield*e.transaction(e=>yv(function*(){let r=aB(e);if(yield*r.approvalExists(t))return;let i=yield*r.snapshot(t);if(i.run.state._tag!==`Waiting`)return yield*new yP({runId:t,operation:`approve`,state:i.run.state._tag});yield*r.recordApproval(t,n),yield*r.requestWorkflowCommand(t,`Approve`)}))},qz(`approve run`)),u=z(`RunStore.retry`)(function*(t){yield*e.transaction(e=>yv(function*(){let n=aB(e),r=yield*n.snapshot(t);if(r.run.state._tag===`Failed`){yield*n.updateState(t,LD(r.run.state)),yield*n.requestWorkflowCommand(t,`Resume`);return}if(!(r.run.state._tag===`Running`&&(yield*n.hasWorkflowCommand(t,`Resume`))))return yield*new yP({runId:t,operation:`retry`,state:r.run.state._tag})}))},qz(`retry run`)),d=z(`RunStore.cancel`)(function*(t){return yield*e.transaction(e=>yv(function*(){let n=aB(e),r=yield*n.snapshot(t);if(!OD(r.run.state))return{_tag:`AlreadyClosed`};let i=L();if(r.run.state._tag===`Running`){let e=r.attempts[r.attempts.length-1];e!==void 0&&fl(e.outcome)&&(yield*n.closeAttempt(e.id,new $D),i=ul(e.id))}return yield*n.updateState(t,RD(r.run.state)),yield*n.requestInterrupt(t),yield*n.requestWorkflowCommand(t,`Continue`),{_tag:`Canceled`,openAttempt:i}}))},qz(`cancel run`)),f=z(`RunStore.revoke`)(function*(t,n){return yield*e.transaction(e=>yv(function*(){let r=aB(e),i=yield*r.revokeUnstarted(t,n);for(let e of i){let t=yield*r.snapshot(e.runId);(t.run.state._tag===`Pending`||t.run.state._tag===`Waiting`)&&(yield*r.updateState(e.runId,BD(t.run.state)),yield*r.requestInterrupt(e.runId))}return i.map(e=>e.runId)}))},qz(`revoke run`)),p=z(`RunStore.claimQueued`)(function*(t,n){return yield*e.transaction(e=>yv(function*(){let r=aB(e),i=yield*r.runForEvent(t.event.id);return i[0]===void 0?(yield*r.ignoredEvent(t.event.id)).length>0||(yield*r.blockingRun(t.loop,t.itemKey)).length>0?L():(yield*r.createRun(t,t.event.id,n),ul(new sB({submission:t,runId:n}))):ul(new sB({submission:t,runId:i[0].runId}))}))},qz(`claim queued Event`)),m=z(`RunStore.recoverable`)(function*(){return(yield*t.recoverable()).map(e=>new ite({submission:Yz(e),runId:e.runId,state:e.state}))},qz(`list recoverable runs`)),h=z(`RunStore.appendTranscript`)(function*(t,n){let r=yield*sb;yield*e.transaction(e=>yv(function*(){let i=aB(e);t===`outbound`&&n.payload._tag===`Started`&&(yield*i.updateAttemptParentModel(n.attemptId,n.payload.parentModel)),yield*i.appendTranscript(t,n,r)}))},qz(`append Attempt transcript`)),g=z(`RunStore.transcript`)(function*(e){return yield*t.transcript(e)},qz(`read Attempt transcript`)),_=z(`RunStore.reconcileCompletion`)(function*(t,n){n._tag===`Complete`&&(yield*e.transaction(e=>yv(function*(){let r=aB(e),i=yield*r.snapshot(t);if(i.run.state._tag!==`Running`)return;let a=i.attempts[i.attempts.length-1];if(a===void 0||R(a.outcome))return;if(sg(n.exit)){yield*r.closeAttempt(a.id,new ZD),yield*r.updateStepResult(a.runId,a.stepName,n.exit.value),yield*r.updateState(t,FD(i.run.state)),yield*r.requestWorkflowCommand(t,`Continue`);return}let o=nee(n.exit.cause);fl(o)||(yield*r.closeAttempt(a.id,new QD({failure:o.value})),yield*r.updateState(t,ID(i.run.state)),yield*r.requestWorkflowCommand(t,`Continue`))})))},qz(`reconcile workflow completion`));return{approve:l,appendTranscript:h,beginAttempt:o,cancel:d,claimQueued:p,completeWorkflowCommand:(e,n)=>t.completeWorkflowCommand(e,n).pipe(qz(`complete workflow command`)),failAttempt:c,nextQueued:e=>t.nextQueued(e).pipe(qz(`find queued Event`)),parkForApproval:a,pendingWorkflowCommands:t.pendingWorkflowCommands().pipe(qz(`list pending workflow commands`)),recordAndClaim:i,reconcileCompletion:_,recoverable:m(),retry:u,revoke:f,snapshot:e=>t.snapshot(e).pipe(qz(`read run`)),succeedAttempt:s,transcript:g}}),fB=class e extends bu()(`@usine/engine/internal/RunStore`){static layer=vg(e,dB)},pB=class extends bu()(`@usine/engine/StepExecutor`){},mB=Sz(`@usine/engine/DurableRun`,{payload:V({submission:nP}),success:WD,error:cD,idempotencyKey:({submission:e})=>e.event.dedupKey}).annotate(Az,!0),hB=Mz(`@usine/engine/ApprovalGate`),gB=e=>Pv(e,{EnginePersistenceError:e=>new aD({message:`Engine persistence failed during ${e.operation}`,cause:e}),RunNotFoundError:e=>Sv(e),RunOperationRejectedError:e=>Sv(e)}),_B=e=>mB.executionId({submission:e}),vB=z(`DurableRun.continueWithNewest`)(function*(e,t){let n=yield*e.nextQueued(t);if(R(n)){let t=yield*_B(n.value),r=VD.make(t),i=yield*e.claimQueued(n.value,r);R(i)&&(yield*mB.execute({submission:i.value.submission},{discard:!0}))}yield*e.completeWorkflowCommand(t,`Continue`)}),yB=z(`DurableRun.execute`)(function*({submission:e},t){let n=VD.make(t),r=yield*fB,i=yield*pB;for(e.approval===`required`&&(yield*r.parkForApproval(n).pipe(gB),yield*Iz(hB));;){let t=yield*i.reserve(e),a=yield*yv(function*(){let e=yield*r.beginAttempt(n,t.worker).pipe(gB);return e instanceof lB||e._tag===`RunClosed`?e:{_tag:`AttemptExecuted`,result:yield*i.execute(e.execution,{append:(e,t)=>r.appendTranscript(e,t).pipe(gB)}).pipe(Iv(e=>new aD({message:`The step executor crashed outside its typed failure channel`,cause:e})),Ov),started:e}}).pipe(Gv(t.release));if(a._tag===`RunClosed`)return yield*iy(`Run closed while it waited for a worker`,{runId:n,state:a.state}),yield*vB(r,n).pipe(gB),yield*new oD({message:`The run closed (${a.state}) before an attempt started`});if(a instanceof lB)return yield*vB(r,n).pipe(gB),yield*a.failure;let{result:o,started:s}=a;if(Ml(o))return yield*r.succeedAttempt(s.execution.attempt,o.success).pipe(gB),yield*vB(r,n).pipe(gB),o.success;if(!(yield*r.failAttempt(s.execution.attempt,o.failure).pipe(gB)))return yield*vB(r,n).pipe(gB),yield*o.failure}});mB.toLayer(yB);var bB=z(`DurableRun.runIdFor`)(function*(e){return VD.make(yield*_B(e))}),xB=e=>t=>t.pipe(Lv(t=>new bP({operation:e,cause:t}))),SB=yv(function*(){let e=yield*pI,t=z(`LoopControl.stateFor`)(function*(t){yield*Xv({loop:t});let n=(yield*e.select({loop:QL.loopName,paused:QL.paused}).from(QL).where(Y(QL.loopName,t)).limit(1).execute())[0];return n===void 0?new tP({loop:t,paused:!1}):new tP(n)},xB(`read Loop runtime state`)),n=z(`LoopControl.states`)(function*(){return(yield*e.select({loop:QL.loopName,paused:QL.paused}).from(QL).orderBy(AF(QL.loopName)).execute()).map(e=>new tP(e))},xB(`list Loop runtime states`)),r=z(`LoopControl.write`)(function*(n){yield*Xv({loop:n.loop});let r=yield*t(n.loop);return r.paused===n.paused?(yield*ay(`Loop runtime state was already set`,{loop:n.loop,paused:n.paused}),r):(yield*e.insert(QL).values({loopName:n.loop,paused:n.paused}).onConflictDoUpdate({target:QL.loopName,set:{paused:n.paused}}).execute().pipe(xB(`write Loop runtime state`)),yield*iy(n.paused?`Loop paused`:`Loop unpaused`,{loop:n.loop,paused:n.paused}),n)});return{isPaused:z(`LoopControl.isPaused`)(function*(e){return(yield*t(e)).paused}),pause:z(`LoopControl.pause`)(e=>r(new tP({loop:e,paused:!0}))),states:n(),unpause:z(`LoopControl.unpause`)(e=>r(new tP({loop:e,paused:!1})))}}),CB=class e extends bu()(`@usine/engine/LoopControl`){static layer=vg(e,SB)},wB=500;yv(function*(){let e=yield*fB,t=yield*pB,n=yield*Rz,r=e=>Wv(e,Rz,n),i=z(`RunEngine.launch`)(function*(e){yield*mB.execute({submission:e},{discard:!0}).pipe(r)}),a=z(`RunEngine.deliverInterrupt`)(function*(t){yield*mB.interrupt(t).pipe(r),yield*e.completeWorkflowCommand(t,`Interrupt`)}),o=z(`RunEngine.deliverApproval`)(function*(t){yield*Fee(hB,{token:Nee(hB,{workflow:mB,executionId:t}),value:void 0}).pipe(r),yield*e.completeWorkflowCommand(t,`Approve`)}),s=z(`RunEngine.deliverContinuation`)(function*(t){yield*vB(e,t).pipe(r)}),c=z(`RunEngine.awaitWorkflowSettlement`)(function*(e){for(let t=0;t<wB;t+=1){let t=yield*mB.poll(e).pipe(r);if(R(t))return t.value;yield*zv(`10 millis`)}return yield*Sv(Error(`Run ${e} has no durable workflow execution to settle`))}),l=z(`RunEngine.deliverResume`)(function*(t){let n=yield*c(t);if(n._tag===`Complete`){yield*e.reconcileCompletion(t,n),yield*e.completeWorkflowCommand(t,`Resume`),yield*s(t);return}yield*mB.resume(t).pipe(r),yield*e.completeWorkflowCommand(t,`Resume`)}),u={Approve:o,Continue:s,Interrupt:a,Resume:l},d=z(`RunEngine.submit`)(function*(t){let n=yield*bB(t),r=yield*e.recordAndClaim(t,n);return R(r.supersededRun)&&(yield*a(r.supersededRun.value)),r.result._tag===`Claimed`&&(yield*i(r.submission)),r.result}),f=z(`RunEngine.approve`)(function*(t,n){yield*e.approve(t,n),yield*o(t)}),p=z(`RunEngine.retry`)(function*(t){yield*e.retry(t),yield*l(t)}),m=z(`RunEngine.cancel`)(function*(n){let r=yield*e.cancel(n);if(r._tag===`AlreadyClosed`){yield*ay(`Cancel was a no-op; the run was already closed`,{runId:n});return}yield*iy(`Run canceled`,{runId:n,openAttempt:ml(r.openAttempt,()=>`none`)});let i=R(r.openAttempt)?yield*t.interrupt(r.openAttempt.value).pipe(Ov):Dl(void 0);if(yield*a(n),yield*s(n),R(r.openAttempt)&&jl(i))return yield*new xP({attemptId:r.openAttempt.value,cause:i.failure})}),h=z(`RunEngine.revoke`)(function*(t,n){let r=yield*e.revoke(t,n);return yield*uv(r,a,{concurrency:`unbounded`,discard:!0}),r}),g=z(`RunEngine.inspect`)(function*(t){return yield*e.snapshot(t)}),_=z(`RunEngine.transcript`)(function*(t){return yield*e.transcript(t)}),v=z(`RunEngine.reconcile`)(function*(){yield*uv(yield*e.pendingWorkflowCommands,({command:e,runId:t})=>u[e](t),{discard:!0}),yield*uv(yield*e.recoverable,({runId:t,state:n,submission:a})=>yv(function*(){let o=yield*mB.poll(t).pipe(r);if(R(o)&&o.value._tag===`Complete`){yield*e.reconcileCompletion(t,o.value),yield*s(t);return}if(R(o)&&o.value._tag===`Suspended`){n._tag===`Running`&&(yield*l(t));return}yield*i(a)}),{concurrency:`unbounded`,discard:!0})});return yield*v(),{approve:f,cancel:m,inspect:g,reconcile:v,retry:p,revoke:h,submit:d,transcript:_}});var TB=class extends bu()(`@usine/engine/RunEngine`){},EB=hT.check(pT(1)),DB=EB.pipe($w(`GitHubAppId`)),OB=EB.pipe($w(`GitHubInstallationId`)),kB=EB.pipe($w(`GitHubRepositoryId`)),AB=CT(U.check(lT(/^-----BEGIN (?:RSA )?PRIVATE KEY-----[\s\S]+-----END (?:RSA )?PRIVATE KEY-----\s*$/u,{message:`Expected a PEM-encoded RSA private key`})).pipe($w(`GitHubAppPrivateKey`)),{disallowEncode:!0}),jB=Xw([`discover-installation`,`fetch-item-labels`,`fetch-issue-snapshot`,`fetch-pull-request-snapshot`,`list-installation-repositories`,`list-repository-labels`,`mint-installation-token`,`mint-worker-token`,`poll-repository-changes`,`update-item-labels`]);W(`@usine/github/AppCredentials`)({appId:DB,privateKey:AB});var MB=class extends bu()(`@usine/github/GitHubCredentials`){},NB={checks:`read`,contents:`write`,issues:`write`,metadata:`read`,pull_requests:`write`},PB=(e,t)=>e===t||t===`read`&&e===`write`,FB=e=>Object.entries(NB).flatMap(([t,n])=>PB(e[t],n)?[]:[`${t}:${n}`]),IB=class extends W(`@usine/github/Installation`)({id:OB,accountLogin:U}){},LB=class extends G(`@usine/github/TokenScope/InstallationWide`)(`InstallationWide`,{}){},RB=class extends G(`@usine/github/TokenScope/SingleRepository`)(`SingleRepository`,{repository:eD,repositoryId:kB}){},zB=Yw([LB,RB]),BB=class extends W(`@usine/github/InstallationToken`)({value:ST(U,{disallowJsonEncode:!0}),expiresAt:GT,scope:zB}){},VB=class extends G(`@usine/github/ProjectAccess/CoveredProject`)(`CoveredProject`,{installationId:OB,repository:eD,repositoryId:kB}){},HB=class extends tE(`@usine/github/ProjectNotInstalledError`)(`ProjectNotInstalledError`,{repository:eD,message:U}){};Yw([VB,HB]);var UB=(e,t,n)=>{let r=new Map(n.map(e=>[e.name.toLowerCase(),e]));return t.map(t=>{let n=r.get(t.toLowerCase());return n===void 0?new HB({repository:t,message:`The GitHub App installation does not cover ${t}`}):new VB({installationId:e.id,repository:t,repositoryId:n.id})})},WB=class extends tE(`@usine/github/AppAuthenticationError`)(`AppAuthenticationError`,{message:U}){},GB=Xw([`missing`,`multiple`,`suspended`]),KB=class extends tE(`@usine/github/InstallationDiscoveryError`)(`InstallationDiscoveryError`,{reason:GB,message:U}){},qB=class extends tE(`@usine/github/AppPermissionError`)(`AppPermissionError`,{missing:H(U).check(_T()),message:U}){},JB=class extends tE(`@usine/github/GitHubApiError`)(`GitHubApiError`,{operation:jB,status:yT(hT),message:U}){},YB=class extends tE(`@usine/github/GitHubRateLimitError`)(`GitHubRateLimitError`,{operation:jB,retryAt:GT,message:U}){},XB=class extends tE(`@usine/github/InvalidGitHubResponseError`)(`InvalidGitHubResponseError`,{operation:jB,message:U,detail:U}){};Yw([KB,qB,JB,YB,XB]);var ZB=new TextEncoder,QB=new Uint8Array([48,13,6,9,42,134,72,134,247,13,1,1,1,5,0]),$B=(...e)=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},eV=e=>{if(e<128)return new Uint8Array([e]);let t=[];for(let n=e;n>0;n>>>=8)t.unshift(n&255);return new Uint8Array([128|t.length,...t])},tV=(e,t)=>$B(new Uint8Array([e]),eV(t.length),t),nV=e=>tV(48,$B(new Uint8Array([2,1,0]),QB,tV(4,e))),rV=e=>{let t=e.includes(`-----BEGIN RSA PRIVATE KEY-----`),n=e.replace(/-----BEGIN (?:RSA )?PRIVATE KEY-----/gu,``).replace(/-----END (?:RSA )?PRIVATE KEY-----/gu,``).replace(/\s/gu,``),r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));return t?nV(i):i},iV=e=>{let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t).replace(/=/gu,``).replace(/\+/gu,`-`).replace(/\//gu,`_`)},aV=e=>iV(ZB.encode(JSON.stringify(e))),oV=e=>{let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t},sV=z(`AppJwt.import`)(function*(e){let t=yield*fv({try:async()=>crypto.subtle.importKey(`pkcs8`,oV(rV(nw(e.privateKey))),{name:`RSASSA-PKCS1-v1_5`,hash:`SHA-256`},!1,[`sign`]),catch:()=>new WB({message:`The GitHub App private key is not an RSA private key WebCrypto can import`})});return z(`AppJwt.sign`)(function*(){let n=Math.floor((yield*Sg)/1e3),r=`${aV({alg:`RS256`,typ:`JWT`})}.${aV({iat:n-60,exp:n+540,iss:e.appId})}`,i=yield*dv(()=>crypto.subtle.sign(`RSASSA-PKCS1-v1_5`,t,oV(ZB.encode(r))));return ew(`${r}.${iV(new Uint8Array(i))}`)})}),cV=`https://api.github.com`,lV=`2026-03-10`,uV=e=>az({accept:`application/vnd.github+json`,authorization:`Bearer ${nw(e)}`,"user-agent":`usine`,"x-github-api-version":lV}),dV=(e,t)=>new JB({operation:e,status:t.response===void 0?L():ul(t.response.status),message:t.response===void 0?`The request to GitHub could not be sent`:`GitHub rejected the request with status ${t.response.status}`}),fV=(e,t)=>new XB({operation:e,message:`GitHub returned a response that does not match its API contract`,detail:t}),pV=e=>{if(e===void 0||!/^\d+$/u.test(e))return L();let t=Number(e);return Number.isSafeInteger(t)?ul(t):L()},mV=(e,t)=>{let n=pV(e);if(R(n))return ul(t+n.value*1e3);if(e===void 0)return L();let r=Date.parse(e);return Number.isFinite(r)?ul(r):L()},hV=(e,t)=>{let n=pV(e[`x-ratelimit-remaining`]),r=pV(e[`x-ratelimit-reset`]);return R(n)&&n.value<=t&&R(r)?ul(r.value*1e3):L()},gV=(e,t)=>Sl(pV(e[`x-poll-interval`]),e=>t+e*1e3),_V=e=>{let t=e.flatMap(e=>pl(e,{onNone:()=>[],onSome:e=>[e]}));return t.length===0?L():ul(Math.max(...t))},vV=(e,t)=>_V([mV(e[`retry-after`],t),hV(e,0)]),yV=(e,t,n)=>{let r=Cl(vV(t.headers,n),ob);return(t.status===403||t.status===429)&&R(r)?new YB({operation:e,retryAt:r.value,message:`GitHub asked the poller to wait before retrying`}):new JB({operation:e,status:ul(t.status),message:`GitHub rejected the request with status ${t.status}`})},bV=36e5,xV=3e5,SV=H(V({id:OB,account:V({login:U}),permissions:Gw(B,B),suspendedAt:Zw(B)}).pipe(Ww({suspendedAt:`suspended_at`}))),CV=V({id:kB,name:eD}).pipe(Ww({name:`full_name`})),wV=V({totalCount:hT.check(pT(0)),repositories:H(CV)}).pipe(Ww({totalCount:`total_count`})),TV=V({token:U,expiresAt:KT,repositories:xT(H(CV))}).pipe(Ww({expiresAt:`expires_at`})),EV=e=>e._tag===`InstallationWide`?{operation:`mint-installation-token`,body:{permissions:NB}}:{operation:`mint-worker-token`,body:{permissions:NB,repository_ids:[e.repositoryId]}},DV=class e extends bu()(`@usine/github/GitHubApp`){static layer=vg(e,yv(function*(){let e=yield*sV(yield*MB),t=yield*mz,n=(e,n,r)=>yv(function*(){let i=yield*t.execute(n).pipe(Lv(t=>dV(e,t)));return i.status<200||i.status>=300?yield*yV(e,i,yield*Sg):yield*pz(r)(i).pipe(Lv(t=>fV(e,t.message)))}),r=z(`GitHubApp.discoverInstallation`)(function*(){let t=yield*e(),[r,...i]=yield*n(`discover-installation`,ez(`${cV}/app/installations?per_page=2`).pipe(uV(t)),SV);if(r===void 0)return yield*new KB({reason:`missing`,message:`The GitHub App is not installed on an account`});if(i.length>0)return yield*new KB({reason:`multiple`,message:`The GitHub App must have exactly one installation for this factory`});if(r.suspendedAt!==null)return yield*new KB({reason:`suspended`,message:`The GitHub App installation is suspended`});let a=FB(r.permissions);return a.length>0?yield*new qB({missing:a,message:`The GitHub App installation is missing permissions: ${a.join(`, `)}`}):new IB({id:r.id,accountLogin:r.account.login})}),i=z(`GitHubApp.mintToken`)(function*(t,r){let{operation:i,body:a}=EV(r),o=yield*e(),s=yield*n(i,tz(`${cV}/app/installations/${t}/access_tokens`).pipe(fz(a),uV(o)),TV),c=fb(s.expiresAt)-(yield*Sg);if(c<=0||c>bV)return yield*new XB({operation:i,message:`GitHub returned an installation token outside the one-hour lifetime bound`,detail:`expires_at ${pb(s.expiresAt)} leaves ${c}ms to live`});let l=ml(s.repositories,()=>[]);return r._tag===`SingleRepository`&&!(l.length===1&&l.every(e=>e.id===r.repositoryId))?yield*new XB({operation:i,message:`GitHub did not confirm that the worker token is scoped to exactly one repo`,detail:`expected repository id ${r.repositoryId}, confirmed [${l.map(e=>e.id).join(`, `)}]`}):new BB({value:ew(s.token),expiresAt:s.expiresAt,scope:r})}),a=z(`GitHubApp.installedRepositories`)(function*(e){let t=[];for(let r=1;;r+=1){let i=yield*n(`list-installation-repositories`,ez(`${cV}/installation/repositories?per_page=100&page=${r}`).pipe(uV(e.value)),wV);if(t.push(...i.repositories),t.length>=i.totalCount)return t;if(i.repositories.length===0)return yield*new XB({operation:`list-installation-repositories`,message:`GitHub pagination ended before total_count repositories were returned`,detail:`page ${r} was empty after ${t.length} of ${i.totalCount} repositories`})}}),o=yield*jE(L()),s=z(`GitHubApp.lease`)(()=>NE(o,e=>yv(function*(){let t=yield*Sg;if(R(e)&&fb(e.value.token.expiresAt)-t>xV)return[e.value,e];let n=yield*r(),a={installation:n,token:yield*i(n.id,new LB)};return[a,ul(a)]})));return{installation:z(`GitHubApp.installation`)(()=>Av(s(),e=>e.installation)),installationToken:z(`GitHubApp.installationToken`)(()=>Av(s(),e=>e.token)),projectAccess:z(`GitHubApp.projectAccess`)(function*(e){let{installation:t,token:n}=yield*s();return UB(t,e,yield*a(n))}),workerToken:z(`GitHubApp.workerToken`)(e=>i(e.installationId,new RB({repository:e.repository,repositoryId:e.repositoryId})))}}))},OV=hT.check(pT(1)),kV=hT.check(pT(0)),AV=B.check(lT(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/u,{message:`Expected a GitHub UTC timestamp`})),jV=new Set([`closedAt`,`createdAt`,`mergedAt`,`submittedAt`,`updatedAt`]),MV=U.pipe($w(`GitHubEntityTag`)),NV=U.pipe($w(`GitHubRepositoryLabelName`)),PV=class extends W(`@usine/github/RepositoryLabelCatalog`)({entityTag:bT(MV),labels:H(NV).check(vT())}){},FV=class extends G(`@usine/github/RepositoryLabelsNotModified`)(`RepositoryLabelsNotModified`,{}){};Yw([PV,FV]);var IV=class e extends W(`@usine/github/PollCursor`)({entityTag:bT(MV),watermark:bT(KT)}){static empty=new e({entityTag:L(),watermark:L()})},LV=class extends G(`@usine/github/ChangedIssue`)(`ChangedIssue`,{number:OV,updatedAt:GT}){},RV=class extends G(`@usine/github/ChangedPullRequest`)(`ChangedPullRequest`,{number:OV,updatedAt:GT}){},zV=Yw([LV,RV]),BV=class extends G(`@usine/github/RepositoryNotModified`)(`RepositoryNotModified`,{cursor:IV,nextPollAt:yT(GT)}){},VV=class extends G(`@usine/github/RepositoryChanges`)(`RepositoryChanges`,{cursor:IV,items:H(zV),backlog:zw,nextPollAt:yT(GT)}){};Yw([BV,VV]);var HV=(e,t)=>Zw(e).pipe(eT(e,{decode:Sb(e=>e??t),encode:Sb(e=>e)})),UV={totalCount:0,nodes:[]},WV=V({login:U}),GV=Zw(WV),KV=V({totalCount:kV,nodes:H(V({name:U}))}),qV=V({totalCount:kV,nodes:H(V({author:GV,body:B,createdAt:AV}))}),JV=V({number:OV,title:B,body:B,url:U,state:B,stateReason:Zw(B),createdAt:AV,updatedAt:AV,closedAt:Zw(AV),author:GV,issueType:Zw(V({name:B})),milestone:Zw(V({title:B})),labels:HV(KV,UV),assignees:V({totalCount:kV,nodes:H(WV)}),comments:qV,closedByPullRequestsReferences:HV(V({totalCount:kV,nodes:H(V({number:OV,state:B,isDraft:zw,url:U}))}),UV)}),YV=Zw(V({login:kw(U)})),XV=V({author:GV,state:B,body:B,submittedAt:Zw(AV),commit:Zw(V({oid:U}))}),ZV=V({author:GV,body:B}),QV=V({number:OV,title:B,body:B,url:U,state:B,isDraft:zw,merged:zw,createdAt:AV,updatedAt:AV,mergedAt:Zw(AV),author:GV,baseRefName:B,headRefName:B,headRefOid:U,additions:kV,deletions:kV,changedFiles:kV,reviewDecision:Zw(B),statusCheckRollup:Zw(V({state:B})),labels:HV(KV,UV),reviewRequests:HV(V({totalCount:kV,nodes:H(V({requestedReviewer:YV}))}),UV),reviews:HV(V({totalCount:kV,nodes:H(XV)}),UV),reviewThreads:V({totalCount:kV,nodes:H(V({isResolved:zw,isOutdated:zw,path:B,comments:V({totalCount:kV,nodes:H(ZV)})}))}),comments:qV,closingIssuesReferences:HV(V({totalCount:kV,nodes:H(V({number:OV,state:B}))}),UV)}),$V=B.check(lT(/^[a-f0-9]{64}$/u,{message:`Expected a SHA-256 content hash`})).pipe($w(`GitHubContentHash`)),eH=class extends G(`@usine/github/IssueSnapshot`)(`IssueSnapshot`,{payload:JV,contentHash:$V}){},tH=class extends G(`@usine/github/PullRequestSnapshot`)(`PullRequestSnapshot`,{payload:QV,contentHash:$V}){};Yw([eH,tH]);var nH=`
137
+ query UsineIssuePayload($owner: String!, $name: String!, $number: Int!) {
138
+ repository(owner: $owner, name: $name) {
139
+ issue(number: $number) {
140
+ number
141
+ title
142
+ body
143
+ url
144
+ state
145
+ stateReason
146
+ createdAt
147
+ updatedAt
148
+ closedAt
149
+ author { login }
150
+ issueType { name }
151
+ milestone { title }
152
+ labels(first: 50) {
153
+ totalCount
154
+ nodes { name }
155
+ }
156
+ assignees(first: 10) {
157
+ totalCount
158
+ nodes { login }
159
+ }
160
+ comments(last: 20) {
161
+ totalCount
162
+ nodes {
163
+ author { login }
164
+ body
165
+ createdAt
166
+ }
167
+ }
168
+ closedByPullRequestsReferences(first: 10, includeClosedPrs: true) {
169
+ totalCount
170
+ nodes {
171
+ number
172
+ state
173
+ isDraft
174
+ url
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ `,rH=`
181
+ query UsinePullRequestPayload($owner: String!, $name: String!, $number: Int!) {
182
+ repository(owner: $owner, name: $name) {
183
+ pullRequest(number: $number) {
184
+ number
185
+ title
186
+ body
187
+ url
188
+ state
189
+ isDraft
190
+ merged
191
+ createdAt
192
+ updatedAt
193
+ mergedAt
194
+ author { login }
195
+ baseRefName
196
+ headRefName
197
+ headRefOid
198
+ additions
199
+ deletions
200
+ changedFiles
201
+ reviewDecision
202
+ statusCheckRollup { state }
203
+ labels(first: 50) {
204
+ totalCount
205
+ nodes { name }
206
+ }
207
+ reviewRequests(first: 10) {
208
+ totalCount
209
+ nodes {
210
+ requestedReviewer {
211
+ ... on User { login }
212
+ }
213
+ }
214
+ }
215
+ reviews(last: 20) {
216
+ totalCount
217
+ nodes {
218
+ author { login }
219
+ state
220
+ body
221
+ submittedAt
222
+ commit { oid }
223
+ }
224
+ }
225
+ reviewThreads(first: 50) {
226
+ totalCount
227
+ nodes {
228
+ isResolved
229
+ isOutdated
230
+ path
231
+ comments(first: 10) {
232
+ totalCount
233
+ nodes {
234
+ author { login }
235
+ body
236
+ }
237
+ }
238
+ }
239
+ }
240
+ comments(last: 20) {
241
+ totalCount
242
+ nodes {
243
+ author { login }
244
+ body
245
+ createdAt
246
+ }
247
+ }
248
+ closingIssuesReferences(first: 10) {
249
+ totalCount
250
+ nodes {
251
+ number
252
+ state
253
+ }
254
+ }
255
+ }
256
+ }
257
+ }
258
+ `,iH=5e3,aH=100,oH=10,sH=100,cH=6e4,lH=H(V({number:hT.check(pT(1)),updatedAt:KT,pullRequest:kw(Fw)}).pipe(Ww({updatedAt:`updated_at`,pullRequest:`pull_request`}))),uH=H(V({name:NV})),dH=V({data:kw(Fw),errors:kw(H(V({message:B,type:kw(B)})))}),fH=V({repository:bT(V({issue:bT(JV)}))}),pH=V({repository:bT(V({pullRequest:bT(QV)}))}),mH=e=>Array.isArray(e)?e.map(mH):fw(uE)(e)?Object.fromEntries(Object.entries(e).filter(([e])=>!jV.has(e)).sort(([e],[t])=>e<t?-1:+(e>t)).map(([e,t])=>[e,mH(t)])):e,hH=e=>ob(e),gH=e=>e.map(e=>e.pullRequest===void 0?new LV({number:e.number,updatedAt:e.updatedAt}):new RV({number:e.number,updatedAt:e.updatedAt})),_H=e=>{let t=e.flatMap(e=>pl(e,{onNone:()=>[],onSome:e=>[e]}));return t.length===0?L():hH(Math.max(...t))},vH=(e,t)=>_H([gV(e,t),mV(e[`retry-after`],t),hV(e,aH)]),yH=e=>e===void 0?L():gl(/<(?<url>[^>]+)>;\s*rel="next"/u.exec(e)?.groups?.url),bH=e=>{let t=fb(e)-iH;return`${new Date(t-t%1e3).toISOString().slice(0,19)}Z`},xH=(e,t)=>{let{name:n,owner:r}=rD(e),i=new URL(`${cV}/repos/${encodeURIComponent(r)}/${encodeURIComponent(n)}/issues`);return i.searchParams.set(`state`,`all`),i.searchParams.set(`sort`,`updated`),i.searchParams.set(`direction`,`asc`),i.searchParams.set(`per_page`,`100`),R(t.watermark)&&i.searchParams.set(`since`,bH(t.watermark.value)),i.toString()},SH=e=>{let{name:t,owner:n}=rD(e),r=new URL(`${cV}/repos/${encodeURIComponent(n)}/${encodeURIComponent(t)}/labels`);return r.searchParams.set(`per_page`,`100`),r.toString()},CH=(e,t)=>{let{name:n,owner:r}=rD(e),i=new URL(`${cV}/repos/${encodeURIComponent(r)}/${encodeURIComponent(n)}/issues/${t}/labels`);return i.searchParams.set(`per_page`,`100`),i.toString()},wH=(e,t)=>{let n=t.map(({updatedAt:e})=>fb(e));return R(e.watermark)&&n.push(fb(e.watermark.value)),n.length===0?L():hH(Math.max(...n))},TH=e=>z(`GitHubPolling.contentHash`)(function*(t){let n=new TextEncoder().encode(JSON.stringify(mH(t))),r=yield*e.digest(`SHA-256`,n).pipe(Rv);return $V.make(Array.from(r,e=>e.toString(16).padStart(2,`0`)).join(``))}),EH=class e extends bu()(`@usine/github/GitHubPolling`){static layer=vg(e,yv(function*(){let e=yield*DV,t=yield*dE,n=yield*mz,r=TH(t),i=z(`GitHubPolling.execute`)(function*(e,t){return yield*n.execute(t).pipe(Lv(t=>dV(e,t)))}),a=z(`GitHubPolling.changesPage`)(function*(t){let n=yield*e.installationToken(),r=ez(t).pipe(uV(n.value)),a=yield*i(`poll-repository-changes`,r),o=yield*Sg;return a.status===200?{items:gH(yield*pz(lH)(a).pipe(Lv(e=>fV(`poll-repository-changes`,e.message)))),next:yH(a.headers.link)}:yield*yV(`poll-repository-changes`,a,o)}),o=z(`GitHubPolling.labelsPage`)(function*(t,n){let r=yield*e.installationToken(),a=ez(n).pipe(uV(r.value)),o=yield*i(t,a),s=yield*Sg;return o.status===200?{labels:(yield*pz(uH)(o).pipe(Lv(e=>fV(t,e.message)))).map(({name:e})=>e),next:yH(o.headers.link)}:yield*yV(t,o,s)}),s=z(`GitHubPolling.remainingLabelPages`)(function*(e,t){let n=[...t.labels],r=t.next,i=1;for(;R(r)&&i<sH;){let t=yield*o(e,r.value);n.push(...t.labels),r=t.next,i+=1}return R(r)?yield*fV(e,`GitHub label list exceeded ${sH} pages`):n.sort((e,t)=>e.localeCompare(t))}),c=z(`GitHubPolling.allLabels`)(function*(e,t){return yield*s(e,yield*o(e,t))}),l=z(`GitHubPolling.labels`)(function*(t,n){yield*Xv({repository:t});let r=yield*e.installationToken(),a=ez(SH(t)).pipe(uV(r.value));R(n)&&(a=iz(a,`if-none-match`,n.value));let o=yield*i(`list-repository-labels`,a),c=yield*Sg;if(o.status===304)return new FV;if(o.status!==200)return yield*yV(`list-repository-labels`,o,c);let l=yield*pz(uH)(o).pipe(Lv(e=>fV(`list-repository-labels`,e.message))),u=yield*s(`list-repository-labels`,{labels:l.map(({name:e})=>e),next:yH(o.headers.link)}),d=yw(MV)(o.headers.etag);return fl(d)&&(yield*ny(`GitHub omitted the label catalog ETag; next poll is unconditional`,{repository:t})),new PV({entityTag:d,labels:u})}),u=z(`GitHubPolling.changes`)(function*(t,n){let r=yield*e.installationToken(),o=ez(xH(t,n)).pipe(uV(r.value));R(n.entityTag)&&(o=iz(o,`if-none-match`,n.entityTag.value));let s=yield*i(`poll-repository-changes`,o),c=yield*Sg,l=vH(s.headers,c);if(s.status===304)return new BV({cursor:n,nextPollAt:l});if(s.status!==200)return yield*yV(`poll-repository-changes`,s,c);let u=gH(yield*pz(lH)(s).pipe(Lv(e=>fV(`poll-repository-changes`,e.message)))),d=yw(MV)(s.headers.etag);fl(d)&&(yield*ny(`GitHub omitted the changes ETag; next poll is unconditional`,{repository:t}));let f=[...u],p=yH(s.headers.link),m=1;for(;R(p)&&m<oH;){let e=yield*a(p.value);f.push(...e.items),p=e.next,m+=1}let h=R(p);return h&&(yield*iy(`GitHub changes walk hit the page cap; backlog remains`,{repository:t,pages:m,items:f.length})),new VV({cursor:new IV({entityTag:d,watermark:wH(n,f)}),items:f,backlog:h,nextPollAt:l})}),d=z(`GitHubPolling.graphql`)(function*(t,n,r,a,o){let s=yield*e.installationToken(),{name:c,owner:l}=rD(n),u=tz(`${cV}/graphql`).pipe(fz({query:a,variables:{owner:l,name:c,number:r}}),uV(s.value)),d=yield*i(t,u),f=yield*Sg;if(d.status!==200)return yield*yV(t,d,f);let p=yield*pz(dH)(d).pipe(Lv(e=>fV(t,e.message)));return p.errors!==void 0&&p.errors.length>0?p.errors.some(e=>e.type===`RATE_LIMITED`)?yield*new YB({operation:t,retryAt:ab(ml(vV(d.headers,f),()=>f+cH)),message:`GitHub GraphQL asked the poller to wait before retrying`}):yield*fV(t,`GraphQL errors: ${p.errors.map(e=>e.message).join(`; `)}`):yield*pw(o)(p.data).pipe(Lv(e=>fV(t,e.message)))});return{changes:u,labels:l,snapshot:z(`GitHubPolling.snapshot`)((e,t)=>yv(function*(){let n=z(`GitHubPolling.completeItemLabels`)(function*(n){if(n.labels.nodes.length>=n.labels.totalCount)return n.labels;yield*ay(`Completing truncated Item label connection for Board matching`,{repository:e,item:t.number,listedLabels:n.labels.nodes.length,totalLabels:n.labels.totalCount});let r=yield*c(`fetch-item-labels`,CH(e,t.number));return{totalCount:r.length,nodes:r.map(e=>({name:e}))}});if(t._tag===`ChangedIssue`){let i=Cl((yield*d(`fetch-issue-snapshot`,e,t.number,nH,fH)).repository,({issue:e})=>e);if(fl(i))return yield*fV(`fetch-issue-snapshot`,`issue ${t.number} came back null — deleted, transferred, or access lost`);let a={...i.value,labels:yield*n(i.value)};return new eH({payload:a,contentHash:yield*r(a)})}let i=Cl((yield*d(`fetch-pull-request-snapshot`,e,t.number,rH,pH)).repository,({pullRequest:e})=>e);if(fl(i))return yield*fV(`fetch-pull-request-snapshot`,`pull request ${t.number} came back null — deleted or access lost`);let a={...i.value,labels:yield*n(i.value)};return new tH({payload:a,contentHash:yield*r(a)})}))}}))},DH=tD.make(`HEAD`),OH=class extends tE(`@usine/orchestrator/LoopAgentResolutionError`)(`LoopAgentResolutionError`,{loop:pD,agent:FE,message:U}){},kH=z(`TriggerRouting.resolveLoop`)(function*(e,t){yield*Xv({loop:t.name,agent:t.agent});let n=new Map(e.agents.map(e=>[e.name,e])).get(t.agent);if(n===void 0)return yield*new OH({loop:t.name,agent:t.agent,message:`Loop ${t.name} references missing Agent ${t.agent}`});let r=new VE({name:n.name,brain:new BE({harness:n.harness,model:n.model,effort:n.effort}),parentModel:n.parentModel,persona:n.persona});return{agent:r,loop:t,parentModel:$E(r,e.config.settings.parentModel)}}),AH=z(`TriggerRouting.resolveLoops`)(function*(e){let t=[];for(let n of e.loops){let r=yield*Ov(kH(e,n));if(Ml(r)){t.push(r.success);continue}yield*ry(`Loaded loop lost its rostered Agent; skipping the loop`,{loop:r.failure.loop,agent:r.failure.agent,errorTag:r.failure._tag,message:r.failure.message})}return t}),jH=e=>new nP({event:new fD({id:uD.make(e.dedupKey),dedupKey:e.dedupKey,payload:e.payload,receivedAt:e.receivedAt}),itemKey:e.itemKey,loop:e.loop.name,step:e.loop.step,approval:e.loop.approval,repository:e.repository.name,revision:DH,task:e.task,agent:e.agent,parentModel:e.parentModel}),MH=e=>xE(e,{Claimed:({runId:e})=>({runId:e}),Queued:()=>({}),Ignored:({reason:e})=>({reason:e})}),NH=e=>pl(e.expression,{onNone:()=>({configFile:e.file,configStage:e.stage}),onSome:t=>({configFile:e.file,configStage:e.stage,expression:t})}),PH=4,FH=4,IH=U.pipe($w(`GitHubPollWatchKey`)),LH=class extends W(`@usine/orchestrator/StoredPollCursor`)({boardVersion:Nw(2),cursor:IV,labelEntityTag:bT(MV),watches:H(IH).check(vT())}){},RH=class extends W(`@usine/orchestrator/RepositoryPollFailure`)({repository:eD,errorTag:U,message:B}){},zH=class extends W(`@usine/orchestrator/PollCycle`)({repositories:hT.check(pT(0)),changedItems:hT.check(pT(0)),submissions:H(dP),revokedRuns:hT.check(pT(0)),failures:H(RH),nextPollAt:yT(GT)}){},BH=e=>{let t={errorTag:e._tag,message:e.message};return e._tag===`ConfigFileError`?{...t,...NH(e)}:e._tag===`ExpressionCheckError`||e._tag===`ExpressionEvaluationError`?{...t,expression:e.source}:t},VH=e=>mR.make(`github-poll:${iD(e.name)}`),HH=({loop:e})=>IH.make(JSON.stringify([e.name,e.trigger.on,e.trigger.if])),UH=(e,t)=>e.config.repos.map(e=>{let n=t.filter(({loop:t})=>t.trigger.on!==`schedule`&&QN(t.selector,e));return{repository:e,loops:n,watches:n.map(HH).sort()}}),WH=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),GH=e=>e._tag===`ChangedIssue`?`issue`:`pr`,KH=(e,t)=>_O.make(JSON.stringify([`github`,iD(e.name),t.number])),qH=(e,t,n,r)=>dD.make(JSON.stringify([e.name,iD(t.name),n.number,r.contentHash])),JH=e=>{let t=e.flatMap(e=>pl(e,{onNone:()=>[],onSome:e=>[fb(e)]}));return t.length===0?L():ob(Math.max(...t))};(class e extends bu()(`@usine/orchestrator/PollingTriggers`){static layer=vg(e,yv(function*(){let e=yield*_R,t=yield*ZN,n=yield*yO,r=yield*EH,i=yield*aR,a=yield*pR,o=yield*TB,s=yield*CB,c=yield*wE(L()),l=e=>new LH({boardVersion:2,cursor:IV.empty,labelEntityTag:L(),watches:e}),u=z(`PollingTriggers.readCursor`)(function*(t){let n=yield*e.read(VH(t.repository),LH);return fl(n)?l(t.watches):WH(n.value.watches,t.watches)?n.value:(yield*iy(`Watched loops changed; re-polling the repository from scratch`,{repository:t.repository.name,previousWatches:n.value.watches.length,currentWatches:t.watches.length}),l(t.watches))}),d=z(`PollingTriggers.writeCursor`)((t,n)=>e.write(VH(t.repository),LH,n)),f=z(`PollingTriggers.evaluateItem`)(function*(e,a){yield*Xv({repository:e.repository.name,item:a.number});let s=e.loops.filter(({loop:e})=>e.trigger.on===GH(a)),c=yield*r.snapshot(e.repository.name,a),l=c.payload,u={repo:$k(e.repository),item:l},d=KH(e.repository,a);if(yield*i.upsert(new EP({itemKey:d,repository:e.repository.name,source:CP.make(GH(a)),number:wP.make(a.number),contentHash:TP.make(c.contentHash),payload:l})),yield*ay(`Fetched changed-item snapshot`,{repository:e.repository.name,item:a.number,stream:GH(a),contentHash:c.contentHash}),s.length===0)return yield*ay(`Item projected without any matching repository Loop`,{repository:e.repository.name,item:a.number,stream:GH(a)}),{submissions:[],revokedRuns:0,failures:[]};let f=[],p=[],m=0;for(let{agent:r,loop:i,parentModel:h}of s){if(yield*Xv({loop:i.name,agent:r.name}),!(yield*n.evaluateBoolean(i.trigger.if,Qk(i.trigger.on),u))){yield*ay(`Item did not match its loop expression`,{repository:e.repository.name,loop:i.name,agent:r.name,item:a.number});let t=yield*o.revoke(i.name,d);m+=t.length,t.length>0&&(yield*iy(`Item stopped matching; revoked its unstarted runs`,{repository:e.repository.name,loop:i.name,agent:r.name,item:a.number,runIds:t.join(`, `)}));continue}let s=qH(i,e.repository,a,c),g=yield*sb,_=yield*Ov(t.renderPrompt(i,u));if(jl(_)){yield*ry(`Loop prompt rendering failed; sibling loops were unaffected`,{loop:i.name,repository:e.repository.name,agent:r.name,item:a.number,errorTag:_.failure._tag,message:_.failure.message,...NH(_.failure)}),p.push(new RH({repository:e.repository.name,errorTag:_.failure._tag,message:_.failure.message}));continue}let v=yield*o.submit(jH({dedupKey:s,itemKey:d,loop:i,payload:l,receivedAt:g,repository:e.repository,task:aO.make(_.success),agent:r,parentModel:h}));yield*iy(`Submitted matching item state`,{repository:e.repository.name,loop:i.name,agent:r.name,item:a.number,contentHash:c.contentHash,result:v._tag,...MH(v)}),f.push(v)}return{submissions:f,revokedRuns:m,failures:p}}),p=z(`PollingTriggers.applyLabelCatalog`)(function*(e,t,n){let r={labelEntityTag:t.labelEntityTag,stored:!1,failures:[],nextPollAt:L()};if(jl(n)){let t=n.failure;return t._tag===`GitHubRateLimitError`?(yield*ny(`Label catalog rate-limited; keeping the stored catalog`,{repository:e.repository.name,operation:t.operation,retryAt:pb(t.retryAt)}),{...r,nextPollAt:ul(t.retryAt)}):(yield*ry(`Label catalog request failed; kept the stored catalog and evaluated items anyway`,{repository:e.repository.name,...BH(t)}),{...r,failures:[new RH({repository:e.repository.name,errorTag:t._tag,message:t.message})]})}let i=n.success;return i instanceof PV?(yield*a.replace(new sR({repository:e.repository.name,labels:i.labels.map(String)})),{...r,labelEntityTag:i.entityTag,stored:!0}):(yield*ay(`Repository label catalog unchanged (304)`,{repository:e.repository.name}),r)}),m=z(`PollingTriggers.pollRepository`)(function*(e){yield*Xv({repository:e.repository.name});let t=yield*u(e),[n,i]=yield*lv([r.changes(e.repository.name,t.cursor),Ov(r.labels(e.repository.name,t.labelEntityTag))],{concurrency:`unbounded`}),a=yield*p(e,t,i),o=new LH({boardVersion:2,cursor:n.cursor,labelEntityTag:a.labelEntityTag,watches:e.watches}),s=JH([n.nextPollAt,a.nextPollAt]);if(n._tag===`RepositoryNotModified`)return a.stored&&(yield*d(e,o)),yield*ay(`Repository unchanged (304)`,{repository:e.repository.name}),{changedItems:0,submissions:[],revokedRuns:0,failures:a.failures,nextPollAt:s};yield*iy(`Repository changed`,{repository:e.repository.name,changedItems:n.items.length,backlog:n.backlog});let c=yield*uv(n.items,t=>f(e,t),{concurrency:FH});return yield*d(e,o),{changedItems:n.items.length,submissions:c.flatMap(({submissions:e})=>e),revokedRuns:c.reduce((e,t)=>e+t.revokedRuns,0),failures:[...a.failures,...c.flatMap(({failures:e})=>e)],nextPollAt:s}}),h=z(`PollingTriggers.poll`)(function*(e){let t=new Set((yield*s.states).filter(e=>e.paused).map(e=>e.loop));for(let n of e.loops)n.trigger.on!==`schedule`&&t.has(n.name)&&(yield*ay(`Paused Loop skipped during repository polling`,{loop:n.name}));let n=UH(e,(yield*AH(e)).filter(({loop:e})=>!t.has(e.name))),r=yield*uv(n,e=>Ov(m(e)).pipe(Av(t=>({repository:e,result:t}))),{concurrency:PH}),i=[],a=[],o=[];for(let{repository:e,result:t}of r){if(Ml(t)){i.push(t.success);continue}let n=t.failure;if(n._tag===`GitHubRateLimitError`){yield*ny(`GitHub rate limit reached; delaying the next cycle`,{repository:e.repository.name,operation:n.operation,retryAt:pb(n.retryAt)}),o.push(ul(n.retryAt));continue}yield*ry(`Repository poll cycle failed; siblings were unaffected`,{repository:e.repository.name,...BH(n)}),a.push(new RH({repository:e.repository.name,errorTag:n._tag,message:n.message}))}let l=new zH({repositories:n.length,changedItems:i.reduce((e,t)=>e+t.changedItems,0),submissions:i.flatMap(({submissions:e})=>e),revokedRuns:i.reduce((e,t)=>e+t.revokedRuns,0),failures:[...i.flatMap(({failures:e})=>e),...a],nextPollAt:JH([...i.map(({nextPollAt:e})=>e),...o])});return yield*EE(c,ul(l)),l});return{latest:TE(c),poll:h,run:e=>yv(function*(){let t=yield*Sg,n=yield*Ov(h(e));if(jl(n)){let t=e.config.settings.pollInterval*1e3;yield*ry(`Poll cycle could not read Loop runtime state; retrying`,{errorTag:n.failure._tag,message:n.failure.message,operation:n.failure.operation,sleepMs:t}),yield*zv(yd(t));return}let r=n.success,i=t+e.config.settings.pollInterval*1e3,a=pl(r.nextPollAt,{onNone:()=>i,onSome:e=>Math.max(i,fb(e))}),o=yield*Sg,s=Math.max(0,a-o);yield*iy(`Poll cycle complete`,{repositories:r.repositories,changedItems:r.changedItems,submissions:r.submissions.length,revokedRuns:r.revokedRuns,failures:r.failures.length,sleepMs:s}),yield*zv(yd(s))}).pipe(Yv)}}))});var YH=4,XH=6e4,ZH=e=>{let t={errorTag:e._tag,message:e.message};return e._tag===`ConfigFileError`?{...t,...NH(e)}:e._tag===`ExpressionCheckError`||e._tag===`ExpressionEvaluationError`?{...t,expression:e.source}:t},QH=class extends G(`@usine/orchestrator/ScheduleAgentFailure`)(`ScheduleAgentFailure`,{loop:pD,agent:FE,message:B}){},$H=class extends G(`@usine/orchestrator/ScheduleTickFailure`)(`ScheduleTickFailure`,{loop:pD,repository:eD,scheduledAt:GT,errorTag:U,message:B}){},eU=class extends G(`@usine/orchestrator/ScheduleCronFailure`)(`ScheduleCronFailure`,{loop:pD,cron:B,tz:B,message:B}){},tU=Yw([QH,eU,$H]),nU=class extends W(`@usine/orchestrator/ScheduleCycle`)({loops:hT.check(pT(0)),fanout:hT.check(pT(0)),submissions:H(dP),skipped:hT.check(pT(0)),alreadyFired:hT.check(pT(0)),failures:H(tU),nextTickAt:yT(GT)}){},rU=e=>e.loops.flatMap(t=>{let n=t.trigger;return n.on===`schedule`?[{loop:t,repositories:e.config.repos.filter(e=>QN(t.selector,e)),trigger:n}]:[]}),iU=(e,t)=>{let n=db(t);return n.setUTCSeconds(0,0),ib(U_(e,n)?n:K_(e,n))},aU=(e,t)=>ib(G_(e,db(t))),oU=(e,t)=>pl(ub(e,t),{onNone:()=>pb(e),onSome:mb}),sU=e=>e.length===0?L():ob(Math.min(...e.map(fb))),cU=e=>_O.make(JSON.stringify([`github`,iD(e.name)])),lU=(e,t,n)=>dD.make(JSON.stringify([e.name,iD(t.name),pb(n)])),uU=e=>({tick:{scheduledAt:pb(e.scheduledAt),scheduledAtLocal:e.scheduledAtLocal,cron:e.trigger.cron,tz:e.trigger.tz}});(class e extends bu()(`@usine/orchestrator/ScheduleTriggers`){static layer=vg(e,yv(function*(){let e=yield*ZN,t=yield*yO,n=yield*TB,r=yield*CB,i=yield*wE(L()),a=yield*wE(new Map),o=new WeakMap,s=e=>{let t=o.get(e);if(t!==void 0)return t;let n=H_(e.cron,e.tz);return o.set(e,n),n},c=z(`ScheduleTriggers.submitTick`)(function*(r,i){yield*Xv({loop:r.loop.name,repository:r.repository.name,agent:r.agent.name,scheduledAt:pb(r.scheduledAt)});let a=uU(r),o={repo:$k(r.repository),item:a};if(!(yield*t.evaluateBoolean(r.trigger.if,Qk(`schedule`),o)))return yield*ay(`Scheduled Tick did not match its expression`,{loop:r.loop.name,repository:r.repository.name,agent:r.agent.name,scheduledAt:pb(r.scheduledAt)}),L();let s=lU(r.loop,r.repository,r.scheduledAt),c=yield*e.renderPrompt(r.loop,o),l=yield*n.submit(jH({agent:r.agent,dedupKey:s,itemKey:cU(r.repository),loop:r.loop,payload:a,receivedAt:i,repository:r.repository,task:aO.make(c),parentModel:r.parentModel}));return yield*iy(`Submitted scheduled Tick`,{loop:r.loop.name,repository:r.repository.name,agent:r.agent.name,scheduledAt:pb(r.scheduledAt),scheduledAtLocal:r.scheduledAtLocal,result:l._tag,...MH(l)}),ul(l)}),l=z(`ScheduleTriggers.tick`)(function*(e){let t=yield*sb,n=new Set((yield*r.states).filter(e=>e.paused).map(e=>e.loop));for(let t of e.loops)t.trigger.on===`schedule`&&n.has(t.name)&&(yield*ay(`Paused Loop skipped during schedule evaluation`,{loop:t.name}));let o=rU(e).filter(({loop:e})=>!n.has(e.name)),l=yield*TE(a),u=[],d=[],f=[],p=new Map,m=[],h=0;for(let n of o){n.repositories.length===0&&(yield*ny(`Schedule loop selected no repositories`,{loop:n.loop.name}));let r=yield*Cv({try:()=>{let e=s(n.trigger),r=iU(e,t);return{latest:r,latestLocal:oU(r,n.trigger.tz),next:aU(e,t)}},catch:e=>e}).pipe(Ov);if(jl(r)){yield*ry(`Schedule cron boundaries could not be computed`,{loop:n.loop.name,cron:n.trigger.cron,tz:n.trigger.tz,message:String(r.failure)}),f.push(new eU({loop:n.loop.name,cron:n.trigger.cron,tz:n.trigger.tz,message:String(r.failure)}));continue}let i=r.success;m.push(i.next);let a=fb(i.latest),o=l.get(n.loop.name);if(o!==void 0&&o>=a){h+=1,yield*ay(`Tick already fired`,{loop:n.loop.name,scheduledAt:pb(i.latest)});continue}let c=yield*Ov(kH(e,n.loop));if(jl(c)){let e=c.failure;yield*ry(`Schedule loop could not resolve its Agent`,{loop:e.loop,agent:e.agent,errorTag:e._tag,message:e.message}),d.push(new QH({loop:e.loop,agent:e.agent,message:e.message}));continue}if(n.repositories.length!==0){p.set(n.loop.name,a),yield*iy(`Schedule tick due`,{loop:n.loop.name,agent:c.success.agent.name,cron:n.trigger.cron,tz:n.trigger.tz,scheduledAt:pb(i.latest),scheduledAtLocal:i.latestLocal,repositories:n.repositories.length,nextTickAt:pb(i.next)});for(let e of n.repositories)u.push({agent:c.success.agent,loop:n.loop,parentModel:c.success.parentModel,repository:e,scheduledAt:i.latest,scheduledAtLocal:i.latestLocal,trigger:n.trigger})}}yield*Xv({schedules:o.length,fanout:u.length});let g=yield*uv(u,e=>Ov(c(e,t)).pipe(Av(t=>({candidate:e,result:t}))),{concurrency:YH}),_=[],v=[],y=new Set,b=new Set,x=0;for(let{candidate:e,result:t}of g){if(Ml(t)){R(t.success)?(_.push(t.success.value),y.add(e.loop.name)):x+=1;continue}let n=t.failure;b.add(e.loop.name),yield*ry(`Scheduled Tick failed; sibling fanout was unaffected`,{loop:e.loop.name,repository:e.repository.name,agent:e.agent.name,scheduledAt:pb(e.scheduledAt),...ZH(n)}),v.push(new $H({loop:e.loop.name,repository:e.repository.name,scheduledAt:e.scheduledAt,errorTag:n._tag,message:n.message}))}yield*DE(a,e=>{let t=new Map(e);for(let[e,n]of p)y.has(e)&&!b.has(e)&&t.set(e,n);return t});let S=new nU({loops:o.length,fanout:u.length,submissions:_,skipped:x,alreadyFired:h,failures:[...d,...f,...v],nextTickAt:sU(m)});return yield*EE(i,ul(S)),S});return{latest:TE(i),run:e=>yv(function*(){let t=yield*Ov(l(e));if(jl(t)){yield*ry(`Schedule cycle could not read Loop runtime state; retrying`,{errorTag:t.failure._tag,message:t.failure.message,operation:t.failure.operation,sleepMs:XH}),yield*zv(yd(XH));return}let n=t.success,r=yield*Sg,i=pl(n.nextTickAt,{onNone:()=>r+XH,onSome:fb}),a=Math.min(XH,Math.max(0,i-r)),o={loops:n.loops,fanout:n.fanout,submissions:n.submissions.length,skipped:n.skipped,alreadyFired:n.alreadyFired,failures:n.failures.length,nextTickAt:pl(n.nextTickAt,{onNone:()=>`none`,onSome:pb}),sleepMs:a};n.fanout===0&&n.failures.length===0?yield*ay(`Schedule cycle complete`,o):yield*iy(`Schedule cycle complete`,o),yield*zv(yd(a))}).pipe(Yv),tick:l}}))});var dU=gP,fU=Xw([`clear`,`active`,`needs-you`]),pU=Xw(jD),mU=Zw(B),hU=Yw([class extends G(`@usine/orchestrator/InfraFailureView`)(`InfraFailure`,{message:B}){},class extends G(`@usine/orchestrator/AgentFailureView`)(`AgentFailure`,{message:B}){},class extends G(`@usine/orchestrator/RunawayFailureView`)(`RunawayFailure`,{ceiling:sD}){}]),gU=Yw([class extends G(`@usine/orchestrator/SucceededAttemptView`)(`Succeeded`,{}){},class extends G(`@usine/orchestrator/FailedAttemptView`)(`Failed`,{failure:hU}){},class extends G(`@usine/orchestrator/CanceledAttemptView`)(`Canceled`,{}){}]),_U=class extends W(`@usine/orchestrator/AttemptView`)({id:YD,number:XD,worker:JD,brain:BE,startedAt:B,outcome:Zw(gU)}){},vU=class extends W(`@usine/orchestrator/RunView`)({id:VD,itemKey:_O,loop:pD,repository:eD,agent:FE,state:pU,loopPaused:zw,openedAt:B,task:B,attempts:H(_U),resultMessage:mU,pullRequestUrl:mU,canApprove:zw,canRetry:zw,canCancel:zw}){},yU=U.pipe($w(`BoardLaneId`)),bU=Xw([`authored`,`proposed`,`fallback`]),xU=class extends W(`@usine/orchestrator/BoardItemView`)({itemKey:_O,kind:Xw([`issue`,`pr`]),number:vO,title:B,url:U,state:UO,labels:H(HO),runs:H(vU),run:Zw(vU),needsYou:zw}){},SU={id:yU,name:VO,sources:H(WO),origin:bU,items:H(xU)},CU=Yw([class extends G(`@usine/orchestrator/WritableBoardLaneView`)(`WritableBoardLane`,{...SU,labels:H(HO).check(_T())}){},class extends G(`@usine/orchestrator/ReadOnlyBoardLaneView`)(`ReadOnlyBoardLane`,SU){}]),wU=class extends tE(`@usine/orchestrator/BoardProjectionError`)(`BoardProjectionError`,{repository:eD,itemKey:_O,message:U}){},TU=class extends W(`@usine/orchestrator/BoardView`)({lanes:H(CU),failures:H(wU)}){},EU=class extends W(`@usine/orchestrator/ProjectView`)({repository:eD,status:fU,runs:H(vU),board:TU}){};W(`@usine/orchestrator/BoardMove`)({repository:eD,item:vO,toLane:yU}),tE(`@usine/orchestrator/BoardProjectNotFoundError`)(`BoardProjectNotFoundError`,{repository:eD}),tE(`@usine/orchestrator/BoardItemNotFoundError`)(`BoardItemNotFoundError`,{repository:eD,item:vO}),tE(`@usine/orchestrator/BoardLaneNotFoundError`)(`BoardLaneNotFoundError`,{repository:eD,lane:yU}),tE(`@usine/orchestrator/BoardLaneReadOnlyError`)(`BoardLaneReadOnlyError`,{repository:eD,lane:yU});var DU=class extends W(`@usine/orchestrator/LoopView`)({name:pD,trigger:B,agent:FE,paused:zw}){},OU=class extends G(`@usine/orchestrator/ApprovalNeed`)(`ApprovalNeed`,{id:B,repository:eD,runId:VD,loop:pD}){},kU=class extends G(`@usine/orchestrator/RunFailureNeed`)(`RunFailureNeed`,{id:B,repository:eD,runId:VD,loop:pD,failure:hU}){},AU=class extends G(`@usine/orchestrator/PollFailureNeed`)(`PollFailureNeed`,{id:B,failure:RH}){},jU=Yw([OU,class extends G(`@usine/orchestrator/BoardProjectionNeed`)(`BoardProjectionNeed`,{id:B,failure:wU}){},kU,AU,class extends G(`@usine/orchestrator/ScheduleFailureNeed`)(`ScheduleFailureNeed`,{id:B,failure:tU}){}]),MU=Yw([oO,sO,cO,class extends G(`@usine/orchestrator/FailedTranscriptView`)(`Failed`,{failure:hU}){},lO,uO,dO]),NU=class extends W(`@usine/orchestrator/TranscriptEventView`)({sequence:dU,attemptId:YD,receivedAt:B,direction:iO,payload:MU}){},PU=class extends W(`@usine/orchestrator/TranscriptPageCursor`)({attemptId:YD,before:dU}){};Yw([class extends G(`@usine/orchestrator/ColdTranscriptRequest`)(`ColdTranscriptRequest`,{}){},class extends G(`@usine/orchestrator/TailTranscriptRequest`)(`TailTranscriptRequest`,{after:dU}){},class extends G(`@usine/orchestrator/EarlierTranscriptRequest`)(`EarlierTranscriptRequest`,{attemptId:YD,before:dU}){}]),tE(`@usine/orchestrator/TranscriptAttemptNotFoundError`)(`TranscriptAttemptNotFoundError`,{runId:VD,attemptId:YD});var FU=class extends W(`@usine/orchestrator/RunDetailView`)({run:vU,eventDedupKey:B,eventPayload:lE,transcript:H(NU),earlierTranscript:H(PU)}){},IU=Yw([class extends G(`@usine/orchestrator/ReadyOverview`)(`Ready`,{projects:H(EU),loops:H(DU),needsYou:H(jU)}){},class extends G(`@usine/orchestrator/NeedsSetupOverview`)(`NeedsSetup`,{errorTag:U,projects:H(EU),loops:H(DU),needsYou:H(jU)}){}]),LU=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}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 c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=ee,D=function(){k.postMessage(null)}}else D=function(){_(ee,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),RU=o(((e,t)=>{t.exports=LU()})),zU=o((e=>{var t=d();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.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??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.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})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.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 i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),BU=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=zU()})),VU=o((e=>{var t=RU(),n=d(),r=BU();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function te(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?te(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var j=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function ae(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function oe(e,t){re++,ne[re]=e.current,e.current=t}var se=ie(null),ce=ie(null),F=ie(null),le=ie(null);function ue(e,t){switch(oe(F,t),oe(ce,e),oe(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ef(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ef(t),e=tf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(se),oe(se,e)}function de(){ae(se),ae(ce),ae(F)}function fe(e){e.memoizedState!==null&&oe(le,e);var t=se.current,n=tf(t,e.type);t!==n&&(oe(ce,e),oe(se,n))}function pe(e){ce.current===e&&(ae(se),ae(ce)),le.current===e&&(ae(le),dp._currentValue=P)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
259
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
260
+ `+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.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 c=o.split(`
261
+ `),l=s.split(`
262
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
263
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{_e=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ge(n):``}function ye(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge(`Lazy`);case 13:return e.child!==t&&t!==null?ge(`Suspense Fallback`):ge(`Suspense`);case 19:return ge(`SuspenseList`);case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return ge(`Activity`);default:return``}}function be(e){try{var t=``,n=null;do t+=ye(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
264
+ Error generating stack: `+e.message+`
265
+ `+e.stack}}var xe=Object.prototype.hasOwnProperty,Se=t.unstable_scheduleCallback,Ce=t.unstable_cancelCallback,we=t.unstable_shouldYield,Te=t.unstable_requestPaint,Ee=t.unstable_now,De=t.unstable_getCurrentPriorityLevel,Oe=t.unstable_ImmediatePriority,ke=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,je=t.unstable_LowPriority,Me=t.unstable_IdlePriority,Ne=t.log,Pe=t.unstable_setDisableYieldValue,Fe=null,Ie=null;function Le(e){if(typeof Ne==`function`&&Pe(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Fe,e)}catch{}}var Re=Math.clz32?Math.clz32:Ve,ze=Math.log,Be=Math.LN2;function Ve(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var He=256,Ue=262144,We=4194304;function Ge(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 Ke(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?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ge(n))):i=Ge(o):i=Ge(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ge(n))):i=Ge(o)):i=Ge(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Je(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 Ye(){var e=We;return We<<=1,!(We&62914560)&&(We=4194304),e}function Xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(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,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Re(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&$e(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function $e(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(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 rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=N.p;return e===0?(e=window.event,e===void 0?32:Dp(e.type)):e}function at(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var ot=Math.random().toString(36).slice(2),st=`__reactFiber$`+ot,ct=`__reactProps$`+ot,lt=`__reactContainer$`+ot,ut=`__reactEvents$`+ot,dt=`__reactListeners$`+ot,ft=`__reactHandles$`+ot,pt=`__reactResources$`+ot,mt=`__reactMarker$`+ot;function ht(e){delete e[st],delete e[ct],delete e[ut],delete e[dt],delete e[ft]}function gt(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=wf(e);e!==null;){if(n=e[st])return n;e=wf(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[st]||e[lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function yt(e){var t=e[pt];return t||=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function bt(e){e[mt]=!0}var xt=new Set,St={};function Ct(e,t){wt(e,t),wt(e+`Capture`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)xt.add(t[e])}var Tt=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]*$`),Et={},Dt={};function Ot(e){return xe.call(Dt,e)?!0:xe.call(Et,e)?!1:Tt.test(e)?Dt[e]=!0:(Et[e]=!0,!1)}function kt(e,t,n){if(Ot(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 At(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 jt(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 Mt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Pt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&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(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ft(e){if(!e._valueTracker){var t=Nt(e)?`checked`:`value`;e._valueTracker=Pt(e,t,``+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Nt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\n"\\]/g;function zt(e){return e.replace(Rt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Bt(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!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Mt(t)):e.value!==``+Mt(t)&&(e.value=``+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ht(e,o,Mt(n)):Ht(e,o,Mt(t)),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=``+Mt(s):e.removeAttribute(`name`)}function Vt(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)){Ft(e);return}n=n==null?``:``+Mt(n),t=t==null?n:``+Mt(t),s||t===e.value||(e.value=t),e.defaultValue=t}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),Ft(e)}function Ht(e,t,n){t===`number`&&Lt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ut(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=``+Mt(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 Wt(e,t,n){if(t!=null&&(t=``+Mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Mt(n)}function Gt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(j(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ft(e)}function Kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qt=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 Jt(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||qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Yt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(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 a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Jt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Jt(e,o,t[o])}function Xt(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 Zt=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`]]),Qt=/^[\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 $t(e){return Qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function en(){}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function on(e){var t=_t(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Bt(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="`+zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ct]||null;if(!a)throw Error(i(90));Bt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&It(r)}break a;case`textarea`:Wt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var sn=!1;function cn(e,t,n){if(sn)return e(t,n);sn=!0;try{return e(t)}finally{if(sn=!1,(rn!==null||an!==null)&&(Au(),rn&&(t=rn,e=an,an=rn=null,on(t),e)))for(t=0;t<e.length;t++)on(e[t])}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ct]||null;if(r===null)return null;n=r[t];a: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 a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var un=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,"passive",{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,hn=null;function gn(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.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 hn=i.slice(e,1<r?1-r:void 0)}function _n(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 vn(){return!0}function yn(){return!1}function bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?vn:yn,this.isPropagationStopped=yn,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(xn),Cn=p({},xn,{view:0,detail:0}),wn=bn(Cn),Tn,En,Dn,On=p({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zn,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!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=bn(On),An=bn(p({},On,{dataTransfer:0})),jn=bn(p({},Cn,{relatedTarget:0})),Mn=bn(p({},xn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=bn(p({},xn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Pn=bn(p({},xn,{data:0})),Fn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},In={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`},Ln={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ln[e])?!!t[e]:!1}function zn(){return Rn}var Bn=bn(p({},Cn,{key:function(e){if(e.key){var t=Fn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=_n(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?In[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zn,charCode:function(e){return e.type===`keypress`?_n(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?_n(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=bn(p({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=bn(p({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zn})),Un=bn(p({},xn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=bn(p({},On,{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})),Gn=bn(p({},xn,{newState:0,oldState:0})),Kn=[9,13,27,32],qn=un&&`CompositionEvent`in window,Jn=null;un&&`documentMode`in document&&(Jn=document.documentMode);var Yn=un&&`TextEvent`in window&&!Jn,Xn=un&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=gn(),hn=mn=pn=null,tr=!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 Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={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 ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=Rd(t,`onChange`),0<t.length&&(n=new Sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,cr=null;function lr(e){Ad(e,0)}function ur(e){if(It(vt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(un){var pr;if(un){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){sr&&(sr.detachEvent(`onpropertychange`,_r),cr=sr=null)}function _r(e){if(e.propertyName===`value`&&ur(cr)){var t=[];or(t,cr,e,nn(e)),cn(lr,t)}}function vr(e,t,n){e===`focusin`?(gr(),sr=t,cr=n,sr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function yr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(cr)}function br(e,t){if(e===`click`)return ur(t)}function xr(e,t){if(e===`input`||e===`change`)return ur(t)}function Sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Cr=typeof Object.is==`function`?Object.is:Sr;function wr(e,t){if(Cr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)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(!xe.call(t,i)||!Cr(e[i],t[i]))return!1}return!0}function Tr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Er(e,t){var n=Tr(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}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Tr(n)}}function Dr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Or(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(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=Lt(e.document)}return t}function kr(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 Ar=un&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function Fr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==Lt(r)||(r=jr,`selectionStart`in r&&kr(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}),Nr&&wr(Nr,r)||(Nr=r,r=Rd(Mr,`onSelect`),0<r.length&&(t=new Sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=jr)))}function Ir(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Lr={animationend:Ir(`Animation`,`AnimationEnd`),animationiteration:Ir(`Animation`,`AnimationIteration`),animationstart:Ir(`Animation`,`AnimationStart`),transitionrun:Ir(`Transition`,`TransitionRun`),transitionstart:Ir(`Transition`,`TransitionStart`),transitioncancel:Ir(`Transition`,`TransitionCancel`),transitionend:Ir(`Transition`,`TransitionEnd`)},Rr={},zr={};un&&(zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),`TransitionEvent`in window||delete Lr.transitionend.transition);function Br(e){if(Rr[e])return Rr[e];if(!Lr[e])return e;var t=Lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zr)return Rr[e]=t[n];return e}var Vr=Br(`animationend`),Hr=Br(`animationiteration`),Ur=Br(`animationstart`),Wr=Br(`transitionrun`),Gr=Br(`transitionstart`),Kr=Br(`transitioncancel`),qr=Br(`transitionend`),Jr=new Map,Yr=`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(` `);Yr.push(`scrollEnd`);function Xr(e,t){Jr.set(e,t),Ct(t,[e])}var Zr=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&&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)},Qr=[],$r=0,ei=0;function ti(){for(var e=$r,t=ei=$r=0;t<e;){var n=Qr[t];Qr[t++]=null;var r=Qr[t];Qr[t++]=null;var i=Qr[t];Qr[t++]=null;var a=Qr[t];if(Qr[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&&ai(n,i,a)}}function ni(e,t,n,r){Qr[$r++]=e,Qr[$r++]=t,Qr[$r++]=n,Qr[$r++]=r,ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ri(e,t,n,r){return ni(e,t,n,r),oi(e)}function ii(e,t){return ni(e,null,null,t),oi(e)}function ai(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-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function oi(e){if(50<xu)throw xu=0,Su=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function ci(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 li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(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 fi(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 pi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=np(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=li(31,n,t,a),e.elementType=ee,e.lanes=o,e;case _:return mi(n.children,a,o,t);case v:s=8,a|=24;break;case y:return e=li(12,n,t,a|2),e.elementType=y,e.lanes=o,e;case C:return e=li(13,n,t,a),e.elementType=C,e.lanes=o,e;case w:return e=li(19,n,t,a),e.elementType=w,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case x:s=10;break a;case b:s=9;break a;case S:s=11;break a;case T:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e){var t=li(18,null,null,0);return t.stateNode=e,t}function _i(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function yi(e,t){if(typeof e==`object`&&e){var n=vi.get(e);return n===void 0?(t={value:e,source:t,stack:be(t)},vi.set(e,t),t):n}return{value:e,source:t,stack:be(t)}}var bi=[],xi=0,Si=null,Ci=0,wi=[],Ti=0,Ei=null,Di=1,Oi=``;function ki(e,t){bi[xi++]=Ci,bi[xi++]=Si,Si=e,Ci=t}function Ai(e,t,n){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Ei=e;var r=Di;e=Oi;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Di=1<<32-Re(t)+i|n<<i|r,Oi=a+e}else Di=1<<a|n<<i|r,Oi=e}function ji(e){e.return!==null&&(ki(e,1),Ai(e,1,0))}function Mi(e){for(;e===Si;)Si=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null;for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,Oi=wi[--Ti],wi[Ti]=null,Di=wi[--Ti],wi[Ti]=null}function Ni(e,t){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Di=t.id,Oi=t.overflow,Ei=e}var Pi=null,Fi=null,Ii=!1,Li=null,Ri=!1,zi=Error(i(519));function Bi(e){throw Ki(yi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),zi}function Vi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[st]=e,t[ct]=r,n){case`dialog`:jd(`cancel`,t),jd(`close`,t);break;case`iframe`:case`object`:case`embed`:jd(`load`,t);break;case`video`:case`audio`:for(n=0;n<Od.length;n++)jd(Od[n],t);break;case`source`:jd(`error`,t);break;case`img`:case`image`:case`link`:jd(`error`,t),jd(`load`,t);break;case`details`:jd(`toggle`,t);break;case`input`:jd(`invalid`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:jd(`invalid`,t);break;case`textarea`:jd(`invalid`,t),Gt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Wd(t.textContent,n)?(r.popover!=null&&(jd(`beforetoggle`,t),jd(`toggle`,t)),r.onScroll!=null&&jd(`scroll`,t),r.onScrollEnd!=null&&jd(`scrollend`,t),r.onClick!=null&&(t.onclick=en),t=!0):t=!1,t||Bi(e,!0)}function Hi(e){for(Pi=e.return;Pi;)switch(Pi.tag){case 5:case 31:case 13:Ri=!1;return;case 27:case 3:Ri=!0;return;default:Pi=Pi.return}}function Ui(e){if(e!==Pi)return!1;if(!Ii)return Hi(e),Ii=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||nf(e.type,e.memoizedProps)),n=!n),n&&Fi&&Bi(e),Hi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=Cf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=Cf(e)}else t===27?(t=Fi,df(e.type)?(e=Sf,Sf=null,Fi=e):Fi=t):Fi=Pi?xf(e.stateNode.nextSibling):null;return!0}function Wi(){Fi=Pi=null,Ii=!1}function Gi(){var e=Li;return e!==null&&(su===null?su=e:su.push.apply(su,e),Li=null),e}function Ki(e){Li===null?Li=[e]:Li.push(e)}var qi=ie(null),Ji=null,Yi=null;function Xi(e,t,n){oe(qi,t._currentValue),t._currentValue=n}function Zi(e){e._currentValue=qi.current,ae(qi)}function Qi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function $i(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Qi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Qi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ea(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Cr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===le.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[dp]:e.push(dp))}a=a.return}e!==null&&$i(t,e,n,r),t.flags|=262144}function ta(e){for(e=e.firstContext;e!==null;){if(!Cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function na(e){Ji=e,Yi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ra(e){return aa(Ji,e)}function ia(e,t){return Ji===null&&na(e),aa(e,t)}function aa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Yi===null){if(e===null)throw Error(i(308));Yi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Yi=Yi.next=t;return n}var oa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},sa=t.unstable_scheduleCallback,ca=t.unstable_NormalPriority,la={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ua(){return{controller:new oa,data:new Map,refCount:0}}function da(e){e.refCount--,e.refCount===0&&sa(ca,function(){e.controller.abort()})}var fa=null,pa=0,ma=0,ha=null;function ga(e,t){if(fa===null){var n=fa=[];pa=0,ma=Sd(),ha={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return pa++,t.then(_a,_a),t}function _a(){if(--pa===0&&fa!==null){ha!==null&&(ha.status=`fulfilled`);var e=fa;fa=null,ma=0,ha=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function va(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ya=M.S;M.S=function(e,t){uu=Ee(),typeof t==`object`&&t&&typeof t.then==`function`&&ga(e,t),ya!==null&&ya(e,t)};var ba=ie(null);function xa(){var e=ba.current;return e===null?Gl.pooledCache:e}function Sa(e,t){t===null?oe(ba,ba.current):oe(ba,t.pool)}function Ca(){var e=xa();return e===null?null:{parent:la._currentValue,pool:e}}var wa=Error(i(460)),Ta=Error(i(474)),Ea=Error(i(542)),Da={then:function(){}};function Oa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ka(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(en,en),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Na(e),e;default:if(typeof t.status==`string`)t.then(en,en);else{if(e=Gl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Na(e),e}throw ja=t,wa}}function Aa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ja=e,wa):e}}var ja=null;function Ma(){if(ja===null)throw Error(i(459));var e=ja;return ja=null,e}function Na(e){if(e===wa||e===Ea)throw Error(i(483))}var Pa=null,Fa=0;function Ia(e){var t=Fa;return Fa+=1,Pa===null&&(Pa=[]),ka(Pa,e,t)}function La(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ra(e,t){throw t.$$typeof===m?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function za(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=di(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===_?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===E&&Aa(i)===t.type)?(t=a(t,n.props),La(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),La(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=_i(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=mi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case h:return n=pi(t.type,t.key,t.props,null,e.mode,n),La(n,t),n.return=e,n;case g:return t=_i(t,e.mode,n),t.return=e,t;case E:return t=Aa(t),f(e,t,n)}if(j(t)||k(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ia(t),n);if(t.$$typeof===x)return f(e,ia(e,t),n);Ra(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case h:return n.key===i?l(e,t,n,r):null;case g:return n.key===i?u(e,t,n,r):null;case E:return n=Aa(n),p(e,t,n,r)}if(j(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ia(n),r);if(n.$$typeof===x)return p(e,t,ia(e,n),r);Ra(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case h:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case g:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=Aa(r),m(e,t,n,r,i)}if(j(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ia(r),i);if(r.$$typeof===x)return m(e,t,n,ia(t,r),i);Ra(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Ii&&ki(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ii&&ki(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Ii&&ki(i,h),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Ii&&ki(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ii&&ki(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Ii&&ki(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Aa(l)===r.type){n(e,r.sibling),c=a(r,o.props),La(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===_?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),La(c,o),c.return=e,e=c)}return s(e);case g:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Aa(o),b(e,r,o,c)}if(j(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ia(o),c);if(o.$$typeof===x)return b(e,r,ia(e,o),c);Ra(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Fa=0;var i=b(e,t,n,r);return Pa=null,i}catch(t){if(t===wa||t===Ea)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ba=za(!0),Va=za(!1),Ha=!1;function Ua(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Wa(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 Ga(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ka(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Wl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=oi(e),ai(e,null,n),t}return ni(e,r,t,n),oi(e)}function qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}function Ja(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 Ya=!1;function Xa(){if(Ya){var e=ha;if(e!==null)throw e}}function Za(e,t,n,r){Ya=!1;var i=e.updateQueue;Ha=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,m=f!==s.lane;if(m?(ql&f)===f:(r&f)===f){f!==0&&f===ma&&(Ya=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Ha=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),tu|=o,e.lanes=o,e.memoizedState=d}}function Qa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function $a(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Qa(n[e],t)}var eo=ie(null),to=ie(0);function no(e,t){e=$l,oe(to,e),oe(eo,t),$l=e|t.baseLanes}function ro(){oe(to,$l),oe(eo,eo.current)}function io(){$l=to.current,ae(eo),ae(to)}var ao=ie(null),oo=null;function so(e){var t=e.alternate;oe(fo,fo.current&1),oe(ao,e),oo===null&&(t===null||eo.current!==null||t.memoizedState!==null)&&(oo=e)}function co(e){oe(fo,fo.current),oe(ao,e),oo===null&&(oo=e)}function I(e){e.tag===22?(oe(fo,fo.current),oe(ao,e),oo===null&&(oo=e)):lo(e)}function lo(){oe(fo,fo.current),oe(ao,ao.current)}function uo(e){ae(ao),oo===e&&(oo=null),ae(fo)}var fo=ie(0);function po(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||vf(n)||yf(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 mo=0,ho=null,go=null,_o=null,vo=!1,yo=!1,bo=!1,xo=0,So=0,Co=null,wo=0;function To(){throw Error(i(321))}function Eo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cr(e[n],t[n]))return!1;return!0}function Do(e,t,n,r,i,a){return mo=a,ho=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Ws:Gs,bo=!1,a=n(r,i),bo=!1,yo&&(a=ko(t,n,r,i)),Oo(e),a}function Oo(e){M.H=Us;var t=go!==null&&go.next!==null;if(mo=0,_o=go=ho=null,vo=!1,So=0,Co=null,t)throw Error(i(300));e===null||cc||(e=e.dependencies,e!==null&&ta(e)&&(cc=!0))}function ko(e,t,n,r){ho=e;var a=0;do{if(yo&&(Co=null),So=0,yo=!1,25<=a)throw Error(i(301));if(a+=1,_o=go=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=Ks,o=t(n,r)}while(yo);return o}function Ao(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?Lo(t):t,e=e.useState()[0],(go===null?null:go.memoizedState)!==e&&(ho.flags|=1024),t}function jo(){var e=xo!==0;return xo=0,e}function Mo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function No(e){if(vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vo=!1}mo=0,_o=go=ho=null,yo=!1,So=xo=0,Co=null}function Po(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _o===null?ho.memoizedState=_o=e:_o=_o.next=e,_o}function Fo(){if(go===null){var e=ho.alternate;e=e===null?null:e.memoizedState}else e=go.next;var t=_o===null?ho.memoizedState:_o.next;if(t!==null)_o=t,go=e;else{if(e===null)throw ho.alternate===null?Error(i(467)):Error(i(310));go=e,e={memoizedState:go.memoizedState,baseState:go.baseState,baseQueue:go.baseQueue,queue:go.queue,next:null},_o===null?ho.memoizedState=_o=e:_o=_o.next=e}return _o}function Io(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lo(e){var t=So;return So+=1,Co===null&&(Co=[]),e=ka(Co,e,t),t=ho,(_o===null?t.memoizedState:_o.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Ws:Gs),e}function Ro(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Lo(e);if(e.$$typeof===x)return ra(e)}throw Error(i(438,String(e)))}function zo(e){var t=null,n=ho.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=ho.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Io(),ho.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]=D;return t.index++,n}function Bo(e,t){return typeof t==`function`?t(e):t}function Vo(e){return Ho(Fo(),go,e)}function Ho(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(mo&f)===f:(ql&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ma&&(d=!0);else if((mo&p)===p){u=u.next,p===ma&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,ho.lanes|=p,tu|=p;f=u.action,bo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,ho.lanes|=f,tu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Cr(o,e.memoizedState)&&(cc=!0,d&&(n=ha,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Uo(e){var t=Fo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Cr(o,t.memoizedState)||(cc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Wo(e,t,n){var r=ho,a=Fo(),o=Ii;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Cr((go||a).memoizedState,n);if(s&&(a.memoizedState=n,cc=!0),a=a.queue,hs(qo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||_o!==null&&_o.memoizedState.tag&1){if(r.flags|=2048,us(9,{destroy:void 0},Ko.bind(null,r,a,n,t),null),Gl===null)throw Error(i(349));o||mo&127||Go(r,t,n)}return n}function Go(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ho.updateQueue,t===null?(t=Io(),ho.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ko(e,t,n,r){t.value=n,t.getSnapshot=r,Jo(t)&&Yo(e)}function qo(e,t,n){return n(function(){Jo(t)&&Yo(e)})}function Jo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cr(e,n)}catch{return!0}}function Yo(e){var t=ii(e,2);t!==null&&Tu(t,e,2)}function Xo(e){var t=Po();if(typeof e==`function`){var n=e;if(e=n(),bo){Le(!0);try{n()}finally{Le(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t}function Zo(e,t,n,r){return e.baseState=n,Ho(e,go,typeof r==`function`?r:Bo)}function Qo(e,t,n,r,a){if(Bs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,$o(t,o)):(o.next=n.next,t.pending=n.next=o)}}function $o(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),es(e,t,s)}catch(n){ns(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),es(e,t,a)}catch(n){ns(e,t,n)}}function es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ts(e,t,n)},function(n){return ns(e,t,n)}):ts(e,t,n)}function ts(e,t,n){t.status=`fulfilled`,t.value=n,rs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,$o(e,n)))}function ns(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,rs(t),t=t.next;while(t!==r)}e.action=null}function rs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function is(e,t){return t}function as(e,t){if(Ii){var n=Gl.formState;if(n!==null){a:{var r=ho;if(Ii){if(Fi){b:{for(var i=Fi,a=Ri;i.nodeType!==8;){if(!a){i=null;break b}if(i=xf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Fi=xf(i.nextSibling),r=i.data===`F!`;break a}}Bi(r)}r=!1}r&&(t=n[0])}}return n=Po(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:t},n.queue=r,n=Ls.bind(null,ho,r),r.dispatch=n,r=Xo(!1),a=zs.bind(null,ho,!1,r.queue),r=Po(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Qo.bind(null,ho,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function os(e){return ss(Fo(),go,e)}function ss(e,t,n){if(t=Ho(e,t,is)[0],e=Vo(Bo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Lo(t)}catch(e){throw e===wa?Ea:e}else r=t;t=Fo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(ho.flags|=2048,us(9,{destroy:void 0},cs.bind(null,i,n),null)),[r,a,e]}function cs(e,t){e.action=t}function ls(e){var t=Fo(),n=go;if(n!==null)return ss(t,n,e);Fo(),t=t.memoizedState,n=Fo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function us(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=ho.updateQueue,t===null&&(t=Io(),ho.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 ds(){return Fo().memoizedState}function fs(e,t,n,r){var i=Po();ho.flags|=e,i.memoizedState=us(1|t,{destroy:void 0},n,r===void 0?null:r)}function ps(e,t,n,r){var i=Fo();r=r===void 0?null:r;var a=i.memoizedState.inst;go!==null&&r!==null&&Eo(r,go.memoizedState.deps)?i.memoizedState=us(t,a,n,r):(ho.flags|=e,i.memoizedState=us(1|t,a,n,r))}function ms(e,t){fs(8390656,8,e,t)}function hs(e,t){ps(2048,8,e,t)}function gs(e){ho.flags|=4;var t=ho.updateQueue;if(t===null)t=Io(),ho.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function _s(e){var t=Fo().memoizedState;return gs({ref:t,nextImpl:e}),function(){if(Wl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function vs(e,t){return ps(4,2,e,t)}function ys(e,t){return ps(4,4,e,t)}function bs(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 xs(e,t,n){n=n==null?null:n.concat([e]),ps(4,4,bs.bind(null,t,e),n)}function Ss(){}function Cs(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Eo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ws(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Eo(t,r[1]))return r[0];if(r=e(),bo){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r}function Ts(e,t,n){return n===void 0||mo&1073741824&&!(ql&261930)?e.memoizedState=t:(e.memoizedState=n,e=wu(),ho.lanes|=e,tu|=e,n)}function Es(e,t,n,r){return Cr(n,t)?n:eo.current===null?!(mo&42)||mo&1073741824&&!(ql&261930)?(cc=!0,e.memoizedState=n):(e=wu(),ho.lanes|=e,tu|=e,t):(e=Ts(e,n,r),Cr(e,t)||(cc=!0),e)}function Ds(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};M.T=s,zs(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Rs(e,t,va(c,r),Cu(e)):Rs(e,t,r,Cu(e))}catch(n){Rs(e,t,{then:function(){},status:`rejected`,reason:n},Cu())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function Os(){}function ks(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=As(e).queue;Ds(e,a,t,P,n===null?Os:function(){return js(e),n(r)})}function As(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:P},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function js(e){var t=As(e);t.next===null&&(t=e.alternate.memoizedState),Rs(e,t.next.queue,{},Cu())}function Ms(){return ra(dp)}function Ns(){return Fo().memoizedState}function Ps(){return Fo().memoizedState}function Fs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cu();e=Ga(n);var r=Ka(t,e,n);r!==null&&(Tu(r,t,n),qa(r,t,n)),t={cache:ua()},e.payload=t;return}t=t.return}}function Is(e,t,n){var r=Cu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bs(e)?Vs(t,n):(n=ri(e,t,n,r),n!==null&&(Tu(n,e,r),Hs(n,t,r)))}function Ls(e,t,n){Rs(e,t,n,Cu())}function Rs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bs(e))Vs(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,Cr(s,o))return ni(e,t,i,0),Gl===null&&ti(),!1}catch{}if(n=ri(e,t,i,r),n!==null)return Tu(n,e,r),Hs(n,t,r),!0}return!1}function zs(e,t,n,r){if(r={lane:2,revertLane:Sd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Bs(e)){if(t)throw Error(i(479))}else t=ri(e,n,r,2),t!==null&&Tu(t,e,2)}function Bs(e){var t=e.alternate;return e===ho||t!==null&&t===ho}function Vs(e,t){yo=vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Hs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Us={readContext:ra,use:Ro,useCallback:To,useContext:To,useEffect:To,useImperativeHandle:To,useLayoutEffect:To,useInsertionEffect:To,useMemo:To,useReducer:To,useRef:To,useState:To,useDebugValue:To,useDeferredValue:To,useTransition:To,useSyncExternalStore:To,useId:To,useHostTransitionStatus:To,useFormState:To,useActionState:To,useOptimistic:To,useMemoCache:To,useCacheRefresh:To};Us.useEffectEvent=To;var Ws={readContext:ra,use:Ro,useCallback:function(e,t){return Po().memoizedState=[e,t===void 0?null:t],e},useContext:ra,useEffect:ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),fs(4194308,4,bs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fs(4194308,4,e,t)},useInsertionEffect:function(e,t){fs(4,2,e,t)},useMemo:function(e,t){var n=Po();t=t===void 0?null:t;var r=e();if(bo){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Po();if(n!==void 0){var i=n(t);if(bo){Le(!0);try{n(t)}finally{Le(!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=Is.bind(null,ho,e),[r.memoizedState,e]},useRef:function(e){var t=Po();return e={current:e},t.memoizedState=e},useState:function(e){e=Xo(e);var t=e.queue,n=Ls.bind(null,ho,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ss,useDeferredValue:function(e,t){return Ts(Po(),e,t)},useTransition:function(){var e=Xo(!1);return e=Ds.bind(null,ho,e.queue,!0,!1),Po().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=ho,a=Po();if(Ii){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Gl===null)throw Error(i(349));ql&127||Go(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ms(qo.bind(null,r,o,e),[e]),r.flags|=2048,us(9,{destroy:void 0},Ko.bind(null,r,o,n,t),null),n},useId:function(){var e=Po(),t=Gl.identifierPrefix;if(Ii){var n=Oi,r=Di;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ms,useFormState:as,useActionState:as,useOptimistic:function(e){var t=Po();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=zs.bind(null,ho,!0,n),n.dispatch=t,[e,t]},useMemoCache:zo,useCacheRefresh:function(){return Po().memoizedState=Fs.bind(null,ho)},useEffectEvent:function(e){var t=Po(),n={impl:e};return t.memoizedState=n,function(){if(Wl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Gs={readContext:ra,use:Ro,useCallback:Cs,useContext:ra,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Vo,useRef:ds,useState:function(){return Vo(Bo)},useDebugValue:Ss,useDeferredValue:function(e,t){return Es(Fo(),go.memoizedState,e,t)},useTransition:function(){var e=Vo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:Ns,useHostTransitionStatus:Ms,useFormState:os,useActionState:os,useOptimistic:function(e,t){return Zo(Fo(),go,e,t)},useMemoCache:zo,useCacheRefresh:Ps};Gs.useEffectEvent=_s;var Ks={readContext:ra,use:Ro,useCallback:Cs,useContext:ra,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Uo,useRef:ds,useState:function(){return Uo(Bo)},useDebugValue:Ss,useDeferredValue:function(e,t){var n=Fo();return go===null?Ts(n,e,t):Es(n,go.memoizedState,e,t)},useTransition:function(){var e=Uo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:Ns,useHostTransitionStatus:Ms,useFormState:ls,useActionState:ls,useOptimistic:function(e,t){var n=Fo();return go===null?(n.baseState=e,[e,n.queue.dispatch]):Zo(n,go,e,t)},useMemoCache:zo,useCacheRefresh:Ps};Ks.useEffectEvent=_s;function qs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Js={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Ga(r);i.payload=t,n!=null&&(i.callback=n),t=Ka(e,i,r),t!==null&&(Tu(t,e,r),qa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Ga(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ka(e,i,r),t!==null&&(Tu(t,e,r),qa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Cu(),r=Ga(n);r.tag=2,t!=null&&(r.callback=t),t=Ka(e,r,n),t!==null&&(Tu(t,e,n),qa(t,e,n))}};function Ys(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?!wr(n,r)||!wr(i,a):!0}function Xs(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&&Js.enqueueReplaceState(t,t.state,null)}function Zs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Qs(e){Zr(e)}function $s(e){console.error(e)}function ec(e){Zr(e)}function tc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function nc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function rc(e,t,n){return n=Ga(n),n.tag=3,n.payload={element:null},n.callback=function(){tc(e,t)},n}function ic(e){return e=Ga(e),e.tag=3,e}function ac(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(){nc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){nc(t,n,r),typeof i!=`function`&&(pu===null?pu=new Set([this]):pu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function oc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ea(t,n,a,!0),n=ao.current,n!==null){switch(n.tag){case 31:case 13:return oo===null?Lu():n.alternate===null&&eu===0&&(eu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Da?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),nd(e,r,a)),!1;case 22:return n.flags|=65536,r===Da?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)),nd(e,r,a)),!1}throw Error(i(435,n.tag))}return nd(e,r,a),Lu(),!1}if(Ii)return t=ao.current,t===null?(r!==zi&&(t=Error(i(423),{cause:r}),Ki(yi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=yi(r,n),a=rc(e.stateNode,r,a),Ja(e,a),eu!==4&&(eu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==zi&&(e=Error(i(422),{cause:r}),Ki(yi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=yi(o,n),ou===null?ou=[o]:ou.push(o),eu!==4&&(eu=2),t===null)return!0;r=yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=rc(n.stateNode,r,e),Ja(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(pu===null||!pu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ic(a),ac(a,e,n,r),Ja(n,a),!1}n=n.return}while(n!==null);return!1}var sc=Error(i(461)),cc=!1;function lc(e,t,n,r){t.child=e===null?Va(t,null,n,r):Ba(t,e.child,n,r)}function uc(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 na(t),r=Do(e,t,n,o,a,i),s=jo(),e!==null&&!cc?(Mo(e,t,i),Pc(e,t,i)):(Ii&&s&&ji(t),t.flags|=1,lc(e,t,r,i),t.child)}function dc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,fc(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Fc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?wr:n,n(o,r)&&e.ref===t.ref)return Pc(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(wr(a,r)&&e.ref===t.ref){if(cc=!1,t.pendingProps=r=a,Fc(e,i))e.flags&131072&&(cc=!0);else return t.lanes=e.lanes,Pc(e,t,i)}}return bc(e,t,n,r,i)}function pc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;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?n:a.baseLanes|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 hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Sa(t,a===null?null:a.cachePool),a===null?ro():no(t,a),I(t);else return r=t.lanes=536870912,hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Sa(t,null),ro(),lo(t)):(Sa(t,a.cachePool),no(t,a),lo(t),t.memoizedState=null);return lc(e,t,i,n),t.child}function mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function hc(e,t,n,r,i){var a=xa();return a=a===null?null:{parent:la._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Sa(t,null),ro(),I(t),e!==null&&ea(e,t,r,!0),t.childLanes=i,null}function gc(e,t){return t=kc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function _c(e,t,n){return Ba(t,e.child,null,n),e=gc(t,t.pendingProps),e.flags|=2,uo(t),t.memoizedState=null,e}function vc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Ii){if(r.mode===`hidden`)return e=gc(t,r),t.lanes=536870912,mc(null,e);if(co(t),(e=Fi)?(e=_f(e,Ri),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw Bi(t);return t.lanes=536870912,null}return gc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(co(t),a){if(t.flags&256)t.flags&=-257,t=_c(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(cc||ea(e,t,n,!1),a=(n&e.childLanes)!==0,cc||a){if(r=Gl,r!==null&&(s=tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ii(e,s),Tu(r,e,s),sc;Lu(),t=_c(e,t,n)}else e=o.treeContext,Fi=xf(s.nextSibling),Pi=t,Ii=!0,Li=null,Ri=!1,e!==null&&Ni(t,e),t=gc(t,r),t.flags|=4096;return t}return e=di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function yc(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function bc(e,t,n,r,i){return na(t),n=Do(e,t,n,r,void 0,i),r=jo(),e!==null&&!cc?(Mo(e,t,i),Pc(e,t,i)):(Ii&&r&&ji(t),t.flags|=1,lc(e,t,n,i),t.child)}function xc(e,t,n,r,i,a){return na(t),t.updateQueue=null,n=ko(t,r,n,i),Oo(e),r=jo(),e!==null&&!cc?(Mo(e,t,a),Pc(e,t,a)):(Ii&&r&&ji(t),t.flags|=1,lc(e,t,n,a),t.child)}function Sc(e,t,n,r,i){if(na(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=ra(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Js,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ua(t),o=n.contextType,a.context=typeof o==`object`&&o?ra(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(qs(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&&Js.enqueueReplaceState(a,a.state,null),Za(t,r,a,i),Xa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=ra(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Xs(t,a,r,o),Ha=!1;var f=t.memoizedState;a.state=f,Za(t,r,a,i),Xa(),l=t.memoizedState,s||f!==l||Ha?(typeof d==`function`&&(qs(t,n,d,r),l=t.memoizedState),(c=Ha||Ys(t,n,c,r,f,l,o))?(u||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=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Wa(e,t),o=t.memoizedProps,u=Zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=ra(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Xs(t,a,r,c),Ha=!1,f=t.memoizedState,a.state=f,Za(t,r,a,i),Xa();var p=t.memoizedState;o!==d||f!==p||Ha||e!==null&&e.dependencies!==null&&ta(e.dependencies)?(typeof s==`function`&&(qs(t,n,s,r),p=t.memoizedState),(u=Ha||Ys(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ta(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,yc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ba(t,e.child,null,i),t.child=Ba(t,null,n,i)):lc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Pc(e,t,i),e}function Cc(e,t,n,r){return Wi(),t.flags|=256,lc(e,t,n,r),t.child}var wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Tc(e){return{baseLanes:e,cachePool:Ca()}}function Ec(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=iu),e}function Dc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(fo.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Ii){if(a?so(t):lo(t),(e=Fi)?(e=_f(e,Ri),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw Bi(t);return yf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(lo(t),a=t.mode,c=kc({mode:`hidden`,children:c},a),r=mi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Tc(n),r.childLanes=Ec(e,s,n),t.memoizedState=wc,mc(null,r)):(so(t),Oc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(so(t),t.flags&=-257,t=Ac(e,t,n)):t.memoizedState===null?(lo(t),c=r.fallback,a=t.mode,r=kc({mode:`visible`,children:r.children},a),c=mi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ba(t,e.child,null,n),r=t.child,r.memoizedState=Tc(n),r.childLanes=Ec(e,s,n),t.memoizedState=wc,t=mc(null,r)):(lo(t),t.child=e.child,t.flags|=128,t=null);else if(so(t),yf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ki({value:r,source:null,stack:null}),t=Ac(e,t,n)}else if(cc||ea(e,t,n,!1),s=(n&e.childLanes)!==0,cc||s){if(s=Gl,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ii(e,r),Tu(s,e,r),sc;vf(c)||Lu(),t=Ac(e,t,n)}else vf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Fi=xf(c.nextSibling),Pi=t,Ii=!0,Li=null,Ri=!1,e!==null&&Ni(t,e),t=Oc(t,r.children),t.flags|=4096);return t}return a?(lo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=mi(c,a,n,null),c.flags|=2):c=di(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,mc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Tc(n):(a=c.cachePool,a===null?a=Ca():(l=la._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Ec(e,s,n),t.memoizedState=wc,mc(e.child,r)):(so(t),n=e.child,e=n.sibling,n=di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Oc(e,t){return t=kc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function kc(e,t){return e=li(22,e,null,t),e.lanes=0,e}function Ac(e,t,n){return Ba(t,e.child,null,n),e=Oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qi(e.return,t,n)}function Mc(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 Nc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=fo.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,oe(fo,o),lc(e,t,r,n),r=Ii?Ci:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jc(e,n,t);else if(e.tag===19)jc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;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&&po(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Mc(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&&po(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Mc(t,!0,n,null,a,r);break;case`together`:Mc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Pc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),tu|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ea(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ta(e)))}function Ic(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Xi(t,la,e.memoizedState.cache),Wi();break;case 27:case 5:fe(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Xi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,co(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(so(t),e=Pc(e,t,n),e===null?null:e.sibling):Dc(e,t,n):(so(t),t.flags|=128,null);so(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(ea(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Nc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),oe(fo,fo.current),r)break;return null;case 22:return t.lanes=0,pc(e,t,n,t.pendingProps);case 24:Xi(t,la,e.memoizedState.cache)}return Pc(e,t,n)}function Lc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)cc=!0;else{if(!Fc(e,n)&&!(t.flags&128))return cc=!1,Ic(e,t,n);cc=!!(e.flags&131072)}}else cc=!1,Ii&&t.flags&1048576&&Ai(t,Ci,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Aa(t.elementType),t.type=e,typeof e==`function`)ui(e)?(r=Zs(e,r),t.tag=1,t=Sc(null,t,e,r,n)):(t.tag=0,t=bc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===S){t.tag=11,t=uc(null,t,e,r,n);break a}if(a===T){t.tag=14,t=dc(null,t,e,r,n);break a}}throw t=te(e)||e,Error(i(306,t,``))}}return t;case 0:return bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Zs(r,t.pendingProps),Sc(e,t,r,a,n);case 3:a:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Wa(e,t),Za(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Xi(t,la,r),r!==o.cache&&$i(t,[la],n,!0),Xa(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Cc(e,t,r,n);break a}if(r!==a){a=yi(Error(i(424)),t),Ki(a),t=Cc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Fi=xf(e.firstChild),Pi=t,Ii=!0,Li=null,Ri=!0,n=Va(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Wi(),r===a){t=Pc(e,t,n);break a}lc(e,t,r,n)}t=t.child}return t;case 26:return yc(e,t),e===null?(n=Hf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ii||(n=t.type,e=t.pendingProps,r=$d(F.current).createElement(n),r[st]=t,r[ct]=e,qd(r,n,e),bt(r),t.stateNode=r):t.memoizedState=Hf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&Ii&&(r=t.stateNode=Tf(t.type,t.pendingProps,F.current),Pi=t,Ri=!0,a=Fi,df(t.type)?(Sf=a,Fi=xf(r.firstChild)):Fi=a),lc(e,t,t.pendingProps.children,n),yc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ii&&((a=r=Fi)&&(r=hf(r,t.type,t.pendingProps,Ri),r===null?a=!1:(t.stateNode=r,Pi=t,Fi=xf(r.firstChild),Ri=!1,a=!0)),a||Bi(t)),fe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,nf(a,o)?r=null:s!==null&&nf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Do(e,t,Ao,null,null,n),dp._currentValue=a),yc(e,t),lc(e,t,r,n),t.child;case 6:return e===null&&Ii&&((e=n=Fi)&&(n=gf(n,t.pendingProps,Ri),n===null?e=!1:(t.stateNode=n,Pi=t,Fi=null,e=!0)),e||Bi(t)),null;case 13:return Dc(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ba(t,null,r,n):lc(e,t,r,n),t.child;case 11:return uc(e,t,t.type,t.pendingProps,n);case 7:return lc(e,t,t.pendingProps,n),t.child;case 8:return lc(e,t,t.pendingProps.children,n),t.child;case 12:return lc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Xi(t,t.type,r.value),lc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,na(t),a=ra(a),r=r(a),t.flags|=1,lc(e,t,r,n),t.child;case 14:return dc(e,t,t.type,t.pendingProps,n);case 15:return fc(e,t,t.type,t.pendingProps,n);case 19:return Nc(e,t,n);case 31:return vc(e,t,n);case 22:return pc(e,t,n,t.pendingProps);case 24:return na(t),r=ra(la),e===null?(a=xa(),a===null&&(a=Gl,o=ua(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ua(t),Xi(t,la,a)):((e.lanes&n)!==0&&(Wa(e,t),Za(t,null,null,n),Xa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Xi(t,la,r),r!==a.cache&&$i(t,[la],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Xi(t,la,r))),lc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Rc(e){e.flags|=4}function zc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Pu())e.flags|=8192;else throw ja=Da,Ta}}else e.flags&=-16777217}function Bc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!rp(t)){if(Pu())e.flags|=8192;else throw ja=Da,Ta}}function Vc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ye(),e.lanes|=t,au|=t)}function Hc(e,t){if(!Ii)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 Uc(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 Wc(e,t,n){var r=t.pendingProps;switch(Mi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Uc(t),null;case 1:return Uc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Zi(la),de(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ui(t)?Rc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Gi())),Uc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Rc(t),o===null?(Uc(t),zc(t,a,null,r,n)):(Uc(t),Bc(t,o))):o?o===e.memoizedState?(Uc(t),t.flags&=-16777217):(Rc(t),Uc(t),Bc(t,o)):(e=e.memoizedProps,e!==r&&Rc(t),Uc(t),zc(t,a,e,r,n)),null;case 27:if(pe(t),n=F.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Uc(t),null}e=se.current,Ui(t)?Vi(t,e):(e=Tf(a,r,n),t.stateNode=e,Rc(t))}return Uc(t),null;case 5:if(pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Uc(t),null}if(o=se.current,Ui(t))Vi(t,o);else{var s=$d(F.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[st]=t,o[ct]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(qd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Rc(t)}}return Uc(t),zc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=F.current,Ui(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Pi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Wd(e.nodeValue,n)),e||Bi(t,!0)}else e=$d(e).createTextNode(r),e[st]=t,t.stateNode=e}return Uc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ui(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[st]=t}else Wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),e=!1}else n=Gi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(uo(t),t):(uo(t),null);if(t.flags&128)throw Error(i(558))}return Uc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ui(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[st]=t}else Wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),a=!1}else a=Gi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(uo(t),t):(uo(t),null)}return uo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Vc(t,t.updateQueue),Uc(t),null);case 4:return de(),e===null&&Pd(t.stateNode.containerInfo),Uc(t),null;case 10:return Zi(t.type),Uc(t),null;case 19:if(ae(fo),r=t.memoizedState,r===null)return Uc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Hc(r,!1);else{if(eu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=po(e),o!==null){for(t.flags|=128,Hc(r,!1),e=o.updateQueue,t.updateQueue=e,Vc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return oe(fo,fo.current&1|2),Ii&&ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>du&&(t.flags|=128,a=!0,Hc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=po(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Vc(t,e),Hc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ii)return Uc(t),null}else 2*Ee()-r.renderingStartTime>du&&n!==536870912&&(t.flags|=128,a=!0,Hc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Uc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=fo.current,oe(fo,a?n&1|2:n&1),Ii&&ki(t,r.treeForkCount),e);case 22:case 23:return uo(t),io(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Uc(t),t.subtreeFlags&6&&(t.flags|=8192)):Uc(t),n=t.updateQueue,n!==null&&Vc(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&&ae(ba),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Zi(la),Uc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Gc(e,t){switch(Mi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zi(la),de(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(uo(t),t.alternate===null)throw Error(i(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(uo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(fo),null;case 4:return de(),null;case 10:return Zi(t.type),null;case 22:case 23:return uo(t),io(),e!==null&&ae(ba),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Zi(la),null;case 25:return null;default:return null}}function Kc(e,t){switch(Mi(t),t.tag){case 3:Zi(la),de();break;case 26:case 27:case 5:pe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&uo(t);break;case 13:uo(t);break;case 19:ae(fo);break;case 10:Zi(t.type);break;case 22:case 23:uo(t),io(),e!==null&&ae(ba);break;case 24:Zi(la)}}function qc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;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(e){td(t,t.return,e)}}function Jc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;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 c=n,l=s;try{l()}catch(e){td(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){td(t,t.return,e)}}function Yc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{$a(t,n)}catch(t){td(e,e.return,t)}}}function Xc(e,t,n){n.props=Zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){td(e,t,n)}}function Zc(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(n){td(e,t,n)}}function Qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){td(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){td(e,t,n)}else n.current=null}}function $c(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){td(e,e.return,t)}}function el(e,t,n){try{var r=e.stateNode;Jd(r,e.type,n,t),r[ct]=t}catch(t){td(e,e.return,t)}}function tl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&df(e.type)||e.tag===4}function nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||tl(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&&df(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rl(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=en));else if(r!==4&&(r===27&&df(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(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&&df(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function al(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);qd(t,r,n),t[st]=e,t[ct]=n}catch(t){td(e,e.return,t)}}var ol=!1,sl=!1,cl=!1,ll=typeof WeakSet==`function`?WeakSet:Set,L=null;function ul(e,t){if(e=e.containerInfo,Zd=bp,e=Or(e),kr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Qd={focusedElem:e,selectionRange:n},bp=!1,L=t;L!==null;)if(t=L,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,L=e;else for(;L!==null;){switch(t=L,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){td(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)mf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:mf(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(i(163))}if(e=t.sibling,e!==null){e.return=t.return,L=e;break}L=t.return}}function dl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Tl(e,n),r&4&&qc(5,n);break;case 1:if(Tl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){td(n,n.return,e)}else{var i=Zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){td(n,n.return,e)}}}r&64&&Yc(n),r&512&&Zc(n,n.return);break;case 3:if(Tl(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{$a(e,t)}catch(e){td(n,n.return,e)}}break;case 27:t===null&&r&4&&al(n);case 26:case 5:Tl(e,n),t===null&&r&4&&$c(n),r&512&&Zc(n,n.return);break;case 12:Tl(e,n);break;case 31:Tl(e,n),r&4&&gl(e,n);break;case 13:Tl(e,n),r&4&&_l(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ad.bind(null,n),bf(e,n))));break;case 22:if(r=n.memoizedState!==null||ol,!r){t=t!==null&&t.memoizedState!==null||sl,i=ol;var a=sl;ol=r,(sl=t)&&!a?Dl(e,n,!!(n.subtreeFlags&8772)):Tl(e,n),ol=i,sl=a}break;case 30:break;default:Tl(e,n)}}function fl(e){var t=e.alternate;t!==null&&(e.alternate=null,fl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ht(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 R=null,pl=!1;function ml(e,t,n){for(n=n.child;n!==null;)hl(e,t,n),n=n.sibling}function hl(e,t,n){if(Ie&&typeof Ie.onCommitFiberUnmount==`function`)try{Ie.onCommitFiberUnmount(Fe,n)}catch{}switch(n.tag){case 26:sl||Qc(n,t),ml(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:sl||Qc(n,t);var r=R,i=pl;df(n.type)&&(R=n.stateNode,pl=!1),ml(e,t,n),Ef(n.stateNode),R=r,pl=i;break;case 5:sl||Qc(n,t);case 6:if(r=R,i=pl,R=null,ml(e,t,n),R=r,pl=i,R!==null){if(pl)try{(R.nodeType===9?R.body:R.nodeName===`HTML`?R.ownerDocument.body:R).removeChild(n.stateNode)}catch(e){td(n,t,e)}else try{R.removeChild(n.stateNode)}catch(e){td(n,t,e)}}break;case 18:R!==null&&(pl?(e=R,ff(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Kp(e)):ff(R,n.stateNode));break;case 4:r=R,i=pl,R=n.stateNode.containerInfo,pl=!0,ml(e,t,n),R=r,pl=i;break;case 0:case 11:case 14:case 15:Jc(2,n,t),sl||Jc(4,n,t),ml(e,t,n);break;case 1:sl||(Qc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Xc(n,t,r)),ml(e,t,n);break;case 21:ml(e,t,n);break;case 22:sl=(r=sl)||n.memoizedState!==null,ml(e,t,n),sl=r;break;default:ml(e,t,n)}}function gl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Kp(e)}catch(e){td(t,t.return,e)}}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Kp(e)}catch(e){td(t,t.return,e)}}function vl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ll),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ll),t;default:throw Error(i(435,e.tag))}}function yl(e,t){var n=vl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=od.bind(null,e,t);t.then(r,r)}})}function bl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(df(c.type)){R=c.stateNode,pl=!1;break a}break;case 5:R=c.stateNode,pl=!1;break a;case 3:case 4:R=c.stateNode.containerInfo,pl=!0;break a}c=c.return}if(R===null)throw Error(i(160));hl(o,s,a),R=null,pl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Sl(t,e),t=t.sibling}var xl=null;function Sl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bl(t,e),Cl(e),r&4&&(Jc(3,e,e.return),qc(3,e),Jc(5,e,e.return));break;case 1:bl(t,e),Cl(e),r&512&&(sl||n===null||Qc(n,n.return)),r&64&&ol&&(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 a=xl;if(bl(t,e),Cl(e),r&512&&(sl||n===null||Qc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[mt]||o[st]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),qd(o,r,n),o[st]=e,bt(o),r=o;break a;case`link`:var s=ep(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),qd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=ep(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),qd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[st]=e,bt(o),r=o}e.stateNode=r}else tp(a,e.type,e.stateNode)}else e.stateNode=Yf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&el(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?tp(a,e.type,e.stateNode):Yf(a,r,e.memoizedProps))}break;case 27:bl(t,e),Cl(e),r&512&&(sl||n===null||Qc(n,n.return)),n!==null&&r&4&&el(e,e.memoizedProps,n.memoizedProps);break;case 5:if(bl(t,e),Cl(e),r&512&&(sl||n===null||Qc(n,n.return)),e.flags&32){a=e.stateNode;try{Kt(a,``)}catch(t){td(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,el(e,a,n===null?a:n.memoizedProps)),r&1024&&(cl=!0);break;case 6:if(bl(t,e),Cl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){td(e,e.return,t)}}break;case 3:if($f=null,a=xl,xl=kf(t.containerInfo),bl(t,e),xl=a,Cl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Kp(t.containerInfo)}catch(t){td(e,e.return,t)}cl&&(cl=!1,wl(e));break;case 4:r=xl,xl=kf(e.stateNode.containerInfo),bl(t,e),Cl(e),xl=r;break;case 12:bl(t,e),Cl(e);break;case 31:bl(t,e),Cl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 13:bl(t,e),Cl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(lu=Ee()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=ol,d=sl;if(ol=u||a,sl=d||l,bl(t,e),sl=d,ol=u,Cl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||ol||sl||El(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){td(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){td(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?pf(m,!0):pf(l.stateNode,!1)}catch(e){td(l,l.return,e)}}}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 a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;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,yl(e,n))));break;case 19:bl(t,e),Cl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 30:break;case 21:break;default:bl(t,e),Cl(e)}}function Cl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(tl(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;il(e,nl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Kt(o,``),n.flags&=-33),il(e,nl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;rl(e,nl(e),s);break;default:throw Error(i(161))}}catch(t){td(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Tl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dl(e,t.alternate,t),t=t.sibling}function El(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Jc(4,t,t.return),El(t);break;case 1:Qc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Xc(t,t.return,n),El(t);break;case 27:Ef(t.stateNode);case 26:case 5:Qc(t,t.return),El(t);break;case 22:t.memoizedState===null&&El(t);break;case 30:El(t);break;default:El(t)}e=e.sibling}}function Dl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),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:Dl(i,a,n),qc(4,a);break;case 1:if(Dl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){td(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Qa(c[i],s)}catch(e){td(r,r.return,e)}}n&&o&64&&Yc(a),Zc(a,a.return);break;case 27:al(a);case 26:case 5:Dl(i,a,n),n&&r===null&&o&4&&$c(a),Zc(a,a.return);break;case 12:Dl(i,a,n);break;case 31:Dl(i,a,n),n&&o&4&&gl(i,a);break;case 13:Dl(i,a,n),n&&o&4&&_l(i,a);break;case 22:a.memoizedState===null&&Dl(i,a,n),Zc(a,a.return);break;case 30:break;default:Dl(i,a,n)}t=t.sibling}}function Ol(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&&da(n))}function kl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&da(e))}function Al(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jl(e,t,n,r),t=t.sibling}function jl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Al(e,t,n,r),i&2048&&qc(9,t);break;case 1:Al(e,t,n,r);break;case 3:Al(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&&da(e)));break;case 12:if(i&2048){Al(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(e){td(t,t.return,e)}}else Al(e,t,n,r);break;case 31:Al(e,t,n,r);break;case 13:Al(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Al(e,t,n,r):(a._visibility|=2,Ml(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Al(e,t,n,r):Nl(e,t),i&2048&&Ol(o,t);break;case 24:Al(e,t,n,r),i&2048&&kl(t.alternate,t);break;default:Al(e,t,n,r)}}function Ml(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ml(a,o,s,c,i),qc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ml(a,o,s,c,i)):u._visibility&2?Ml(a,o,s,c,i):Nl(a,o),i&&l&2048&&Ol(o.alternate,o);break;case 24:Ml(a,o,s,c,i),i&&l&2048&&kl(o.alternate,o);break;default:Ml(a,o,s,c,i)}t=t.sibling}}function Nl(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:Nl(n,r),i&2048&&Ol(r.alternate,r);break;case 24:Nl(n,r),i&2048&&kl(r.alternate,r);break;default:Nl(n,r)}t=t.sibling}}var Pl=8192;function Fl(e,t,n){if(e.subtreeFlags&Pl)for(e=e.child;e!==null;)Il(e,t,n),e=e.sibling}function Il(e,t,n){switch(e.tag){case 26:Fl(e,t,n),e.flags&Pl&&e.memoizedState!==null&&ip(n,xl,e.memoizedState,e.memoizedProps);break;case 5:Fl(e,t,n);break;case 3:case 4:var r=xl;xl=kf(e.stateNode.containerInfo),Fl(e,t,n),xl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Pl,Pl=16777216,Fl(e,t,n),Pl=r):Fl(e,t,n));break;default:Fl(e,t,n)}}function Ll(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 Rl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];L=r,Vl(r,e)}Ll(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)zl(e),e=e.sibling}function zl(e){switch(e.tag){case 0:case 11:case 15:Rl(e),e.flags&2048&&Jc(9,e,e.return);break;case 3:Rl(e);break;case 12:Rl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Bl(e)):Rl(e);break;default:Rl(e)}}function Bl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];L=r,Vl(r,e)}Ll(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Jc(8,t,t.return),Bl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Bl(t));break;default:Bl(t)}e=e.sibling}}function Vl(e,t){for(;L!==null;){var n=L;switch(n.tag){case 0:case 11:case 15:Jc(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:da(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,L=r;else a:for(n=e;L!==null;){r=L;var i=r.sibling,a=r.return;if(fl(r),r===n){L=null;break a}if(i!==null){i.return=a,L=i;break a}L=a}}}var Hl={getCacheForType:function(e){var t=ra(la),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ra(la).controller.signal}},Ul=typeof WeakMap==`function`?WeakMap:Map,Wl=0,Gl=null,Kl=null,ql=0,Jl=0,Yl=null,Xl=!1,Zl=!1,Ql=!1,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=null,su=null,cu=!1,lu=0,uu=0,du=1/0,fu=null,pu=null,mu=0,hu=null,gu=null,_u=0,vu=0,yu=null,bu=null,xu=0,Su=null;function Cu(){return Wl&2&&ql!==0?ql&-ql:M.T===null?it():Sd()}function wu(){if(iu===0){if(!(ql&536870912)||Ii){var e=Ue;Ue<<=1,!(Ue&3932160)&&(Ue=262144),iu=e}else iu=536870912}return e=ao.current,e!==null&&(e.flags|=32),iu}function Tu(e,t,n){(e===Gl&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)&&(Mu(e,0),ku(e,ql,iu,!1)),Ze(e,n),(!(Wl&2)||e!==Gl)&&(e===Gl&&(!(Wl&2)&&(nu|=n),eu===4&&ku(e,ql,iu,!1)),md(e))}function Eu(e,t,n){if(Wl&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||qe(e,t),a=r?Bu(e,t):Ru(e,t,!0),o=r;do{if(a===0){Zl&&!r&&ku(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ou(n)){a=Ru(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ou;var l=c.current.memoizedState.isDehydrated;if(l&&(Mu(c,s).flags|=256),s=Ru(c,s,!1),s!==2){if(Ql&&!l){c.errorRecoveryDisabledLanes|=o,nu|=o,a=4;break a}o=su,su=a,o!==null&&(su===null?su=o:su.push.apply(su,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Mu(e,0),ku(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:ku(r,t,iu,!Xl);break a;case 2:su=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=lu+300-Ee(),10<a)){if(ku(r,t,iu,!Xl),Ke(r,0,!0)!==0)break a;_u=t,r.timeoutHandle=of(Du.bind(null,r,n,su,fu,cu,t,iu,nu,au,Xl,o,`Throttled`,-0,0),a);break a}Du(r,n,su,fu,cu,t,iu,nu,au,Xl,o,null,-0,0)}break}while(1);md(e)}function Du(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:en},Il(t,a,d);var m=(a&62914560)===a?lu-Ee():(a&4194048)===a?uu-Ee():0;if(m=op(d,m),m!==null){_u=a,e.cancelPendingCommit=m(qu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),ku(e,a,o,!l);return}}qu(e,t,a,n,r,i,o,s,c)}function Ou(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(!Cr(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 ku(e,t,n,r){t&=~ru,t&=~nu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&$e(e,n,t)}function Au(){return Wl&6?!0:(hd(0,!1),!1)}function ju(){if(Kl!==null){if(Jl===0)var e=Kl.return;else e=Kl,Yi=Ji=null,No(e),Pa=null,Fa=0,e=Kl;for(;e!==null;)Kc(e.alternate,e),e=e.return;Kl=null}}function Mu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,sf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),_u=0,ju(),Gl=e,Kl=n=di(e.current,null),ql=t,Jl=0,Yl=null,Xl=!1,Zl=qe(e,t),Ql=!1,au=iu=ru=nu=tu=eu=0,su=ou=null,cu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return $l=t,ti(),n}function Nu(e,t){ho=null,M.H=Us,t===wa||t===Ea?(t=Ma(),Jl=3):t===Ta?(t=Ma(),Jl=4):Jl=t===sc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Yl=t,Kl===null&&(eu=1,tc(e,yi(t,e.current)))}function Pu(){var e=ao.current;return e===null?!0:(ql&4194048)===ql?oo===null:(ql&62914560)===ql||ql&536870912?e===oo:!1}function Fu(){var e=M.H;return M.H=Us,e===null?Us:e}function Iu(){var e=M.A;return M.A=Hl,e}function Lu(){eu=4,Xl||(ql&4194048)!==ql&&ao.current!==null||(Zl=!0),!(tu&134217727)&&!(nu&134217727)||Gl===null||ku(Gl,ql,iu,!1)}function Ru(e,t,n){var r=Wl;Wl|=2;var i=Fu(),a=Iu();(Gl!==e||ql!==t)&&(fu=null,Mu(e,t)),t=!1;var o=eu;a:do try{if(Jl!==0&&Kl!==null){var s=Kl,c=Yl;switch(Jl){case 8:ju(),o=6;break a;case 3:case 2:case 9:case 6:ao.current===null&&(t=!0);var l=Jl;if(Jl=0,Yl=null,Wu(e,s,c,l),n&&Zl){o=0;break a}break;default:l=Jl,Jl=0,Yl=null,Wu(e,s,c,l)}}zu(),o=eu;break}catch(t){Nu(e,t)}while(1);return t&&e.shellSuspendCounter++,Yi=Ji=null,Wl=r,M.H=i,M.A=a,Kl===null&&(Gl=null,ql=0,ti()),o}function zu(){for(;Kl!==null;)Hu(Kl)}function Bu(e,t){var n=Wl;Wl|=2;var r=Fu(),a=Iu();Gl!==e||ql!==t?(fu=null,du=Ee()+500,Mu(e,t)):Zl=qe(e,t);a:do try{if(Jl!==0&&Kl!==null){t=Kl;var o=Yl;b:switch(Jl){case 1:Jl=0,Yl=null,Wu(e,t,o,1);break;case 2:case 9:if(Oa(o)){Jl=0,Yl=null,Uu(t);break}t=function(){Jl!==2&&Jl!==9||Gl!==e||(Jl=7),md(e)},o.then(t,t);break a;case 3:Jl=7;break a;case 4:Jl=5;break a;case 7:Oa(o)?(Jl=0,Yl=null,Uu(t)):(Jl=0,Yl=null,Wu(e,t,o,7));break;case 5:var s=null;switch(Kl.tag){case 26:s=Kl.memoizedState;case 5:case 27:var c=Kl;if(s?rp(s):c.stateNode.complete){Jl=0,Yl=null;var l=c.sibling;if(l!==null)Kl=l;else{var u=c.return;u===null?Kl=null:(Kl=u,Gu(u))}break b}}Jl=0,Yl=null,Wu(e,t,o,5);break;case 6:Jl=0,Yl=null,Wu(e,t,o,6);break;case 8:ju(),eu=6;break a;default:throw Error(i(462))}}Vu();break}catch(t){Nu(e,t)}while(1);return Yi=Ji=null,M.H=r,M.A=a,Wl=n,Kl===null?(Gl=null,ql=0,ti(),eu):0}function Vu(){for(;Kl!==null&&!we();)Hu(Kl)}function Hu(e){var t=Lc(e.alternate,e,$l);e.memoizedProps=e.pendingProps,t===null?Gu(e):Kl=t}function Uu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=xc(n,t,t.pendingProps,t.type,void 0,ql);break;case 11:t=xc(n,t,t.pendingProps,t.type.render,t.ref,ql);break;case 5:No(t);default:Kc(n,t),t=Kl=fi(t,$l),t=Lc(n,t,$l)}e.memoizedProps=e.pendingProps,t===null?Gu(e):Kl=t}function Wu(e,t,n,r){Yi=Ji=null,No(t),Pa=null,Fa=0;var i=t.return;try{if(oc(e,i,t,n,ql)){eu=1,tc(e,yi(n,e.current)),Kl=null;return}}catch(t){if(i!==null)throw Kl=i,t;eu=1,tc(e,yi(n,e.current)),Kl=null;return}t.flags&32768?(Ii||r===1?e=!0:Zl||ql&536870912?e=!1:(Xl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ao.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ku(t,e)):Gu(t)}function Gu(e){var t=e;do{if(t.flags&32768){Ku(t,Xl);return}e=t.return;var n=Wc(t.alternate,t,$l);if(n!==null){Kl=n;return}if(t=t.sibling,t!==null){Kl=t;return}Kl=t=e}while(t!==null);eu===0&&(eu=5)}function Ku(e,t){do{var n=Gc(e.alternate,e);if(n!==null){n.flags&=32767,Kl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Kl=e;return}Kl=e=n}while(e!==null);eu=6,Kl=null}function qu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Qu();while(mu!==0);if(Wl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ei,Qe(e,n,o,s,c,l),e===Gl&&(Kl=Gl=null,ql=0),gu=t,hu=e,_u=n,vu=o,yu=a,bu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,sd(Ae,function(){return $u(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,a=N.p,N.p=2,s=Wl,Wl|=4;try{ul(e,t,n)}finally{Wl=s,N.p=a,M.T=r}}mu=1,Ju(),Yu(),Xu()}}function Ju(){if(mu===1){mu=0;var e=hu,t=gu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=Wl;Wl|=4;try{Sl(t,e);var a=Qd,o=Or(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Dr(s.ownerDocument.documentElement,s)){if(c!==null&&kr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Er(s,h),v=Er(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}bp=!!Zd,Qd=Zd=null}finally{Wl=i,N.p=r,M.T=n}}e.current=t,mu=2}}function Yu(){if(mu===2){mu=0;var e=hu,t=gu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=Wl;Wl|=4;try{dl(e,t.alternate,t)}finally{Wl=i,N.p=r,M.T=n}}mu=3}}function Xu(){if(mu===4||mu===3){mu=0,Te();var e=hu,t=gu,n=_u,r=bu;t.subtreeFlags&10256||t.flags&10256?mu=5:(mu=0,gu=hu=null,Zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(pu=null),rt(n),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot==`function`)try{Ie.onCommitFiberRoot(Fe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=M.T,i=N.p,N.p=2,M.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{M.T=t,N.p=i}}_u&3&&Qu(),md(e),i=e.pendingLanes,n&261930&&i&42?e===Su?xu++:(xu=0,Su=e):xu=0,hd(0,!1)}}function Zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,da(t)))}function Qu(){return Ju(),Yu(),Xu(),$u()}function $u(){if(mu!==5)return!1;var e=hu,t=vu;vu=0;var n=rt(_u),r=M.T,a=N.p;try{N.p=32>n?32:n,M.T=null,n=yu,yu=null;var o=hu,s=_u;if(mu=0,gu=hu=null,_u=0,Wl&6)throw Error(i(331));var c=Wl;if(Wl|=4,zl(o.current),jl(o,o.current,s,n),Wl=c,hd(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Fe,o)}catch{}return!0}finally{N.p=a,M.T=r,Zu(e,t)}}function ed(e,t,n){t=yi(n,t),t=rc(e.stateNode,t,2),e=Ka(e,t,2),e!==null&&(Ze(e,2),md(e))}function td(e,t,n){if(e.tag===3)ed(e,e,n);else for(;t!==null;){if(t.tag===3){ed(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(pu===null||!pu.has(r))){e=yi(n,e),n=ic(2),r=Ka(t,n,2),r!==null&&(ac(n,r,t,e),Ze(r,2),md(r));break}}t=t.return}}function nd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ul;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)||(Ql=!0,i.add(n),e=rd.bind(null,e,t,n),t.then(e,e))}function rd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gl===e&&(ql&n)===n&&(eu===4||eu===3&&(ql&62914560)===ql&&300>Ee()-lu?!(Wl&2)&&Mu(e,0):ru|=n,au===ql&&(au=0)),md(e)}function id(e,t){t===0&&(t=Ye()),e=ii(e,t),e!==null&&(Ze(e,t),md(e))}function ad(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),id(e,n)}function od(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),id(e,n)}function sd(e,t){return Se(e,t)}var cd=null,ld=null,ud=!1,dd=!1,fd=!1,pd=0;function md(e){e!==ld&&e.next===null&&(ld===null?cd=ld=e:ld=ld.next=e),dd=!0,ud||(ud=!0,xd())}function hd(e,t){if(!fd&&dd){fd=!0;do for(var n=!1,r=cd;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,bd(r,a))}else a=ql,a=Ke(r,r===Gl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||qe(r,a)||(n=!0,bd(r,a))}r=r.next}while(n);fd=!1}}function gd(){_d()}function _d(){dd=ud=!1;var e=0;pd!==0&&af()&&(e=pd);for(var t=Ee(),n=null,r=cd;r!==null;){var i=r.next,a=vd(r,t);a===0?(r.next=null,n===null?cd=i:n.next=i,i===null&&(ld=n)):(n=r,(e!==0||a&3)&&(dd=!0)),r=i}mu!==0&&mu!==5||hd(e,!1),pd!==0&&(pd=0)}function vd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Je(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Gl,n=ql,n=Ke(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ce(r),rt(n)){case 2:case 8:n=ke;break;case 32:n=Ae;break;case 268435456:n=Me;break;default:n=Ae}return r=yd.bind(null,e),n=Se(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ce(r),e.callbackPriority=2,e.callbackNode=null,2}function yd(e,t){if(mu!==0&&mu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Qu()&&e.callbackNode!==n)return null;var r=ql;return r=Ke(e,e===Gl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Eu(e,r,t),vd(e,Ee()),e.callbackNode!=null&&e.callbackNode===n?yd.bind(null,e):null)}function bd(e,t){if(Qu())return null;Eu(e,t,!0)}function xd(){lf(function(){Wl&6?Se(Oe,gd):_d()})}function Sd(){if(pd===0){var e=ma;e===0&&(e=He,He<<=1,!(He&261888)&&(He=256)),pd=e}return pd}function Cd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:$t(``+e)}function wd(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 Td(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Cd((i[ct]||null).action),o=r.submitter;o&&(t=(t=o[ct]||null)?Cd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(pd!==0){var e=o?wd(i,o):new FormData(i);ks(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?wd(i,o):new FormData(i),ks(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ed=0;Ed<Yr.length;Ed++){var Dd=Yr[Ed];Xr(Dd.toLowerCase(),`on`+(Dd[0].toUpperCase()+Dd.slice(1)))}Xr(Vr,`onAnimationEnd`),Xr(Hr,`onAnimationIteration`),Xr(Ur,`onAnimationStart`),Xr(`dblclick`,`onDoubleClick`),Xr(`focusin`,`onFocus`),Xr(`focusout`,`onBlur`),Xr(Wr,`onTransitionRun`),Xr(Gr,`onTransitionStart`),Xr(Kr,`onTransitionCancel`),Xr(qr,`onTransitionEnd`),wt(`onMouseEnter`,[`mouseout`,`mouseover`]),wt(`onMouseLeave`,[`mouseout`,`mouseover`]),wt(`onPointerEnter`,[`pointerout`,`pointerover`]),wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ct(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ct(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ct(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ct(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Od=`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(` `),kd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Od));function Ad(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Zr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Zr(e)}i.currentTarget=null,a=c}}}}function jd(e,t){var n=t[ut];n===void 0&&(n=t[ut]=new Set);var r=e+`__bubble`;n.has(r)||(Fd(t,e,2,!1),n.add(r))}function Md(e,t,n){var r=0;t&&(r|=4),Fd(n,e,r,t)}var Nd=`_reactListening`+Math.random().toString(36).slice(2);function Pd(e){if(!e[Nd]){e[Nd]=!0,xt.forEach(function(t){t!==`selectionchange`&&(kd.has(t)||Md(t,!1,e),Md(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nd]||(t[Nd]=!0,Md(`selectionchange`,!1,t))}}function Fd(e,t,n,r){switch(Dp(t)){case 2:var i=xp;break;case 8:i=Sp;break;default:i=Cp}n=i.bind(null,t,n,e),i=void 0,!dn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Id(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=gt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}cn(function(){var r=a,i=nn(n),s=[];a:{var c=Jr.get(e);if(c!==void 0){var l=Sn,u=e;switch(e){case`keypress`:if(_n(n)===0)break a;case`keydown`:case`keyup`:l=Bn;break;case`focusin`:u=`focus`,l=jn;break;case`focusout`:u=`blur`,l=jn;break;case`beforeblur`:case`afterblur`:l=jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Hn;break;case Vr:case Hr:case Ur:l=Mn;break;case qr:l=Un;break;case`scroll`:case`scrollend`:l=wn;break;case`wheel`:l=Wn;break;case`copy`:case`cut`:case`paste`:l=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Vn;break;case`toggle`:case`beforetoggle`:l=Gn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=ln(m,p),g!=null&&d.push(Ld(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==tn&&(u=n.relatedTarget||n.fromElement)&&(gt(u)||u[lt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?gt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Vn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:vt(l),h=u==null?c:vt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,gt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=zd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Bd(s,c,l,d,!1),u!==null&&f!==null&&Bd(s,f,u,d,!0)}}a:{if(c=r?vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=dr;else if(ar(c)){if(fr)v=xr;else{v=yr;var y=vr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Xt(r.elementType)&&(v=dr):v=br;if(v&&=v(e,r)){or(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ht(c,`number`,c.value)}switch(y=r?vt(r):window,e){case`focusin`:(ar(y)||y.contentEditable===`true`)&&(jr=y,Mr=r,Nr=null);break;case`focusout`:Nr=Mr=jr=null;break;case`mousedown`:Pr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Pr=!1,Fr(s,n,i);break;case`selectionchange`:if(Ar)break;case`keydown`:case`keyup`:Fr(s,n,i)}var b;if(qn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else tr?$n(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Xn&&n.locale!==`ko`&&(tr||x!==`onCompositionStart`?x===`onCompositionEnd`&&tr&&(b=gn()):(pn=i,mn=`value`in pn?pn.value:pn.textContent,tr=!0)),y=Rd(r,x),0<y.length&&(x=new Pn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=er(n),b!==null&&(x.data=b)))),(b=Yn?nr(e,n):rr(e,n))&&(x=Rd(r,`onBeforeInput`),0<x.length&&(y=new Pn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Td(s,e,r,n,i)}Ad(s,t)})}function Ld(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Rd(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=ln(e,n),i!=null&&r.unshift(Ld(e,i,a)),i=ln(e,t),i!=null&&r.push(Ld(e,i,a))),e.tag===3)return r;e=e.return}return[]}function zd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Bd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=ln(n,a),l!=null&&o.unshift(Ld(n,l,c))):i||(l=ln(n,a),l!=null&&o.push(Ld(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Vd=/\r\n?/g,Hd=/\u0000|\uFFFD/g;function Ud(e){return(typeof e==`string`?e:``+e).replace(Vd,`
266
+ `).replace(Hd,``)}function Wd(e,t){return t=Ud(t),Ud(e)===t}function Gd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){At(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=$t(``+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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Gd(e,t,`name`,a.name,a,null),Gd(e,t,`formEncType`,a.formEncType,a,null),Gd(e,t,`formMethod`,a.formMethod,a,null),Gd(e,t,`formTarget`,a.formTarget,a,null)):(Gd(e,t,`encType`,a.encType,a,null),Gd(e,t,`method`,a.method,a,null),Gd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&jd(`scroll`,e);break;case`onScrollEnd`:r!=null&&jd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(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=$t(``+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`:!0===r?e.setAttribute(n,``):!1!==r&&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`:jd(`beforetoggle`,e),jd(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(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=Zt.get(n)||n,kt(e,n,r))}}function Kd(e,t,n,r,a,o){switch(n){case`style`:Yt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&jd(`scroll`,e);break;case`onScrollEnd`:r!=null&&jd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ct]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):kt(e,n,r)}}}function qd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:jd(`error`,e),jd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Gd(e,t,o,s,n,null)}}a&&Gd(e,t,`srcSet`,n.srcSet,n,null),r&&Gd(e,t,`src`,n.src,n,null);return;case`input`:jd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Gd(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in jd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Gd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in jd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Gd(e,t,s,c,n,null)}Gt(e,r,a,o);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:Gd(e,t,l,r,n,null)}return;case`dialog`:jd(`beforetoggle`,e),jd(`toggle`,e),jd(`cancel`,e),jd(`close`,e);break;case`iframe`:case`object`:jd(`load`,e);break;case`video`:case`audio`:for(r=0;r<Od.length;r++)jd(Od[r],e);break;case`image`:jd(`error`,e),jd(`load`,e);break;case`details`:jd(`toggle`,e);break;case`embed`:case`source`:case`link`:jd(`error`,e),jd(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Gd(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Kd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Gd(e,t,c,r,n,null))}function Jd(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 a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Gd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Gd(e,t,p,m,r,f)}}Bt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Gd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Gd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Gd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Gd(e,t,s,a,r,o)}Wt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Gd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Gd(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Gd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Gd(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Kd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Kd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Gd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Gd(e,t,f,p,r,m)}function Yd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Xd(){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&&Yd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Yd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}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 Zd=null,Qd=null;function $d(e){return e.nodeType===9?e:e.ownerDocument}function ef(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 tf(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 nf(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 rf=null;function af(){var e=window.event;return e&&e.type===`popstate`?e!==rf&&(rf=e,!0):(rf=null,!1)}var of=typeof setTimeout==`function`?setTimeout:void 0,sf=typeof clearTimeout==`function`?clearTimeout:void 0,cf=typeof Promise==`function`?Promise:void 0,lf=typeof queueMicrotask==`function`?queueMicrotask:cf===void 0?of:function(e){return cf.resolve(null).then(e).catch(uf)};function uf(e){setTimeout(function(){throw e})}function df(e){return e===`head`}function ff(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),Kp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Ef(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Ef(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Ef(e.ownerDocument.body)}n=i}while(n);Kp(t)}function pf(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 mf(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`:mf(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function hf(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(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}else if(!e[mt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||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}if(e=xf(e.nextSibling),e===null)break}return null}function gf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=xf(e.nextSibling),e===null))return null;return e}function _f(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=xf(e.nextSibling),e===null))return null;return e}function vf(e){return e.data===`$?`||e.data===`$~`}function yf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function bf(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 xf(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 Sf=null;function Cf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return xf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function wf(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 Tf(e,t,n){switch(t=$d(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Ef(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var Df=new Map,Of=new Set;function kf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Af=N.d;N.d={f:jf,r:Mf,D:Ff,C:If,L:Lf,m:Rf,X:Bf,S:zf,M:Vf};function jf(){var e=Af.f(),t=Au();return e||t}function Mf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===`form`?js(t):Af.r(e)}var Nf=typeof document>`u`?null:document;function Pf(e,t,n){var r=Nf;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Of.has(i)||(Of.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),qd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Ff(e){Af.D(e),Pf(`dns-prefetch`,e,null)}function If(e,t){Af.C(e,t),Pf(`preconnect`,e,t)}function Lf(e,t,n){Af.L(e,t,n);var r=Nf;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=Uf(e);break;case`script`:a=qf(e)}Df.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Df.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Wf(a))||t===`script`&&r.querySelector(Jf(a))||(t=r.createElement(`link`),qd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Rf(e,t){Af.m(e,t);var n=Nf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=qf(e)}if(!Df.has(a)&&(e=p({rel:`modulepreload`,href:e},t),Df.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Jf(a)))return}r=n.createElement(`link`),qd(r,`link`,e),bt(r),n.head.appendChild(r)}}}function zf(e,t,n){Af.S(e,t,n);var r=Nf;if(r&&e){var i=yt(r).hoistableStyles,a=Uf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Wf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Df.get(a))&&Zf(e,n);var c=o=r.createElement(`link`);bt(c),qd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Xf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Bf(e,t){Af.X(e,t);var n=Nf;if(n&&e){var r=yt(n).hoistableScripts,i=qf(e),a=r.get(i);a||(a=n.querySelector(Jf(i)),a||(e=p({src:e,async:!0},t),(t=Df.get(i))&&Qf(e,t),a=n.createElement(`script`),bt(a),qd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vf(e,t){Af.M(e,t);var n=Nf;if(n&&e){var r=yt(n).hoistableScripts,i=qf(e),a=r.get(i);a||(a=n.querySelector(Jf(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=Df.get(i))&&Qf(e,t),a=n.createElement(`script`),bt(a),qd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hf(e,t,n,r){var a=(a=F.current)?kf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Uf(n.href),n=yt(a).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=Uf(n.href);var o=yt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Wf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Df.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},Df.set(e,n),o||Kf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=qf(n),n=yt(a).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(i(444,e))}}function Uf(e){return`href="`+zt(e)+`"`}function Wf(e){return`link[rel="stylesheet"][`+e+`]`}function Gf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Kf(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}),qd(t,`link`,n),bt(t),e.head.appendChild(t))}function qf(e){return`[src="`+zt(e)+`"]`}function Jf(e){return`script[async]`+e}function Yf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),qd(r,`style`,a),Xf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Uf(n.href);var o=e.querySelector(Wf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Gf(n),(a=Df.get(a))&&Zf(r,a),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),qd(o,`link`,r),t.state.loading|=4,Xf(o,n.precedence,e),t.instance=o;case`script`:return o=qf(n.src),(a=e.querySelector(Jf(o)))?(t.instance=a,bt(a),a):(r=n,(a=Df.get(o))&&(r=p({},n),Qf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),bt(a),qd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Xf(r,n.precedence,e));return t.instance}function Xf(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 Zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var $f=null;function ep(e,t,n){if($f===null){var r=new Map,i=$f=new Map;i.set(n,r)}else i=$f,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[mt]||a[st]||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 tp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function np(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 rp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ip(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Uf(r.href),a=t.querySelector(Wf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=sp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Gf(r),(i=Df.get(i))&&Zf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),qd(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=sp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ap=0;function op(e,t){return e.stylesheets&&e.count===0&&lp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&lp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ap===0&&(ap=62500*Xd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ap?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var cp=null;function lp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,cp=new Map,t.forEach(up,e),cp=null,sp.call(e))}function up(e,t){if(!(t.state.loading&4)){var n=cp.get(e);if(n)var r=n.get(null);else{n=new Map,cp.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=sp.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 dp={$$typeof:x,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function fp(e,t,n,r,i,a,o,s,c){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=Xe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xe(0),this.hiddenUpdates=Xe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function pp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new fp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=li(3,null,null,t),e.current=a,a.stateNode=e,t=ua(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ua(a),e}function mp(e){return e?(e=si,e):si}function hp(e,t,n,r,i,a){i=mp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ga(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ka(e,r,t),n!==null&&(Tu(n,e,t),qa(n,e,t))}function gp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _p(e,t){gp(e,t),(e=e.alternate)&&gp(e,t)}function vp(e){if(e.tag===13||e.tag===31){var t=ii(e,67108864);t!==null&&Tu(t,e,67108864),_p(e,67108864)}}function yp(e){if(e.tag===13||e.tag===31){var t=Cu();t=nt(t);var n=ii(e,t);n!==null&&Tu(n,e,t),_p(e,t)}}var bp=!0;function xp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,Cp(e,t,n,r)}finally{N.p=a,M.T=i}}function Sp(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,Cp(e,t,n,r)}finally{N.p=a,M.T=i}}function Cp(e,t,n,r){if(bp){var i=wp(r);if(i===null)Id(e,t,r,Tp,n),Ip(e,r);else if(Rp(i,e,t,n,r))r.stopPropagation();else if(Ip(e,r),t&4&&-1<Fp.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ge(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}md(a),!(Wl&6)&&(du=Ee()+500,hd(0,!1))}}break;case 31:case 13:s=ii(a,2),s!==null&&Tu(s,a,2),Au(),_p(a,2)}if(a=wp(r),a===null&&Id(e,t,r,Tp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Id(e,t,r,null,n)}}function wp(e){return e=nn(e),Ep(e)}var Tp=null;function Ep(e){if(Tp=null,e=gt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 Tp=e,null}function Dp(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(De()){case Oe:return 2;case ke:return 8;case Ae:case je:return 32;case Me:return 268435456;default:return 32}default:return 32}}var Op=!1,kp=null,Ap=null,jp=null,Mp=new Map,Np=new Map,Pp=[],Fp=`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 Ip(e,t){switch(e){case`focusin`:case`focusout`:kp=null;break;case`dragenter`:case`dragleave`:Ap=null;break;case`mouseover`:case`mouseout`:jp=null;break;case`pointerover`:case`pointerout`:Mp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Np.delete(t.pointerId)}}function Lp(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=_t(t),t!==null&&vp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Rp(e,t,n,r,i){switch(t){case`focusin`:return kp=Lp(kp,e,t,n,r,i),!0;case`dragenter`:return Ap=Lp(Ap,e,t,n,r,i),!0;case`mouseover`:return jp=Lp(jp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Mp.set(a,Lp(Mp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Np.set(a,Lp(Np.get(a)||null,e,t,n,r,i)),!0}return!1}function zp(e){var t=gt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,at(e.priority,function(){yp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,at(e.priority,function(){yp(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 Bp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=_t(n),t!==null&&vp(t),e.blockedOn=n,!1;t.shift()}return!0}function Vp(e,t,n){Bp(e)&&n.delete(t)}function Hp(){Op=!1,kp!==null&&Bp(kp)&&(kp=null),Ap!==null&&Bp(Ap)&&(Ap=null),jp!==null&&Bp(jp)&&(jp=null),Mp.forEach(Vp),Np.forEach(Vp)}function Up(e,n){e.blockedOn===n&&(e.blockedOn=null,Op||(Op=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Hp)))}var Wp=null;function Gp(e){Wp!==e&&(Wp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Wp===e&&(Wp=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(Ep(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Kp(e){function t(t){return Up(t,e)}kp!==null&&Up(kp,e),Ap!==null&&Up(Ap,e),jp!==null&&Up(jp,e),Mp.forEach(t),Np.forEach(t);for(var n=0;n<Pp.length;n++){var r=Pp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Pp.length&&(n=Pp[0],n.blockedOn===null);)zp(n),n.blockedOn===null&&Pp.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[ct]||null;if(typeof a==`function`)o||Gp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ct]||null)s=o.formAction;else if(Ep(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Gp(n)}}}function qp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.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 Jp(e){this._internalRoot=e}Yp.prototype.render=Jp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;hp(n,Cu(),e,t,null,null)},Yp.prototype.unmount=Jp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hp(e.current,2,null,e,null,null),Au(),t[lt]=null}};function Yp(e){this._internalRoot=e}Yp.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Pp.length&&t!==0&&t<Pp[n].priority;n++);Pp.splice(n,0,e),n===0&&zp(e)}};var Xp=n.version;if(Xp!==`19.2.8`)throw Error(i(527,Xp,`19.2.8`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Zp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qp.isDisabled&&Qp.supportsFiber)try{Fe=Qp.inject(Zp),Ie=Qp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Qs,s=$s,c=ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=pp(e,1,!1,null,null,n,r,null,o,s,c,qp),e[lt]=t.current,Pd(e),new Jp(t)}})),HU=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=VU()}));function UU(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var WU={};function GU(e,t,n,r,i){if(!n&&!r&&!i&&!e)return qU(t);let a=qU(e);return t&&(a=JU(a,t)),n&&(a=JU(a,n)),r&&(a=JU(a,r)),i&&(a=JU(a,i)),a}function KU(e){if(e.length===0)return WU;if(e.length===1)return qU(e[0]);let t=qU(e[0]);for(let n=1;n<e.length;n+=1)t=JU(t,e[n]);return t}function qU(e){return QU(e)?{...$U(e,WU)}:YU(e)}function JU(e,t){return QU(t)?$U(t,e):XU(e,t)}function YU(e){let t={...e};for(let e in t){let n=t[e];ZU(e,n)&&(t[e]=tW(n))}return t}function XU(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=UU(e.style,r);break;case`className`:e[n]=rW(e.className,r);break;default:e[n]=ZU(n,r)?eW(e[n],r):r}}return e}function ZU(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function QU(e){return typeof e==`function`}function $U(e,t){return QU(e)?e(t):e??WU}function eW(e,t){return t?e?(...n)=>{let r=n[0];if(iW(r)){let i=r;nW(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:tW(t):e}function tW(e){return e&&((...t)=>{let n=t[0];return iW(n)&&nW(n),e(...t)})}function nW(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function rW(e,t){return t?e?t+` `+e:t:e}function iW(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function aW(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var oW=aW(`https://base-ui.com/production-error`,`Base UI`),sW={};function cW(e,t){let n=f.useRef(sW);return n.current===sW&&(n.current=e(t)),n}function lW(e,t,n,r){let i=cW(dW).current;return fW(i,e,t,n,r)&&mW(i,[e,t,n,r]),i.callback}function uW(e){let t=cW(dW).current;return pW(t,e)&&mW(t,e),t.callback}function dW(){return{callback:null,cleanup:null,refs:[]}}function fW(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function pW(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function mW(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var hW=19;function gW(e){return hW>=e}function _W(e){if(!f.isValidElement(e))return null;let t=e,n=t.props;return(gW(19)?n?.ref:t.ref)??null}function vW(){}var yW=Object.freeze([]),bW=Object.freeze({});function xW(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function SW(e,t){return typeof e==`function`?e(t):e}function CW(e,t){return typeof e==`function`?e(t):e}function wW(e,t,n={}){let r=t.render,i=TW(t,n);return n.enabled===!1?null:OW(e,r,i,n.state??bW)}function TW(e,t={}){let{className:n,style:r,render:i}=e,{state:a=bW,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?SW(n,a):void 0,d=l?CW(r,a):void 0,f=l?xW(a,c):bW,p=l&&s?EW(s):void 0,m=l?UU(f,p)??{}:bW;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?uW([m.ref,_W(i),...o]):lW(m.ref,_W(i),o):lW(null,null)),l?(u!==void 0&&(m.className=rW(m.className,u)),d!==void 0&&(m.style=UU(m.style,d)),m):bW}function EW(e){return Array.isArray(e)?KU(e):GU(void 0,e)}var DW=Symbol.for(`react.lazy`);function OW(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=GU(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===DW&&(i=f.Children.toArray(t)[0]),f.cloneElement(i,e)}if(e&&typeof e==`string`)return kW(e,n);throw Error(oW(8))}function kW(e,t){return e===`button`?(0,f.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,f.createElement)(`img`,{alt:``,...t,key:t.key}):f.createElement(e,t)}function AW(e){return wW(e.defaultTagName??`div`,e,e)}var jW=HU();function MW(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=MW(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function NW(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=MW(e))&&(r&&(r+=` `),r+=t);return r}var PW=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,FW=NW,IW=(e,t)=>n=>{if(t?.variants==null)return FW(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=PW(t)||PW(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return FW(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},LW=768;function RW(){let[e,t]=f.useState(void 0);return f.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<LW)};return e.addEventListener(`change`,n),t(window.innerWidth<LW),()=>e.removeEventListener(`change`,n)},[]),!!e}var zW=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},BW=(e,t)=>({classGroupId:e,validator:t}),VW=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),HW=`-`,UW=[],WW=`arbitrary..`,GW=e=>{let t=JW(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return qW(e);let n=e.split(HW);return KW(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?zW(i,t):t:i||UW}return n[e]||UW}}},KW=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=KW(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(HW):e.slice(t).join(HW),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},qW=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?WW+r:void 0})(),JW=e=>{let{theme:t,classGroups:n}=e;return YW(n,t)},YW=(e,t)=>{let n=VW();for(let r in e){let i=e[r];XW(i,n,r,t)}return n},XW=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ZW(i,t,n,r)}},ZW=(e,t,n,r)=>{if(typeof e==`string`){QW(e,t,n);return}if(typeof e==`function`){$W(e,t,n,r);return}eG(e,t,n,r)},QW=(e,t,n)=>{let r=e===``?t:tG(t,e);r.classGroupId=n},$W=(e,t,n,r)=>{if(nG(e)){XW(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(BW(n,e))},eG=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];XW(o,tG(t,a),n,r)}},tG=(e,t)=>{let n=e,r=t.split(HW),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=VW(),n.nextPart.set(t,i)),n=i}return n},nG=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,rG=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},iG=`!`,aG=`:`,oG=[],sG=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),cG=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===aG){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(iG)?(c=s.slice(0,-1),l=!0):s.startsWith(iG)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return sG(t,l,c,u)};if(t){let e=t+aG,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):sG(oG,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},lG=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},uG=e=>({cache:rG(e.cacheSize),parseClassName:cG(e),sortModifiers:lG(e),postfixLookupClassGroupIds:dG(e),...GW(e)}),dG=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},fG=/\s+/,pG=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(fG),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+iG:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},mG=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=hG(n))&&(i&&(i+=` `),i+=r);return i},hG=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=hG(e[r]))&&(n&&(n+=` `),n+=t);return n},gG=(e,...t)=>{let n,r,i,a,o=o=>(n=uG(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=pG(e,n);return i(e,a),a};return a=o,(...e)=>a(mG(...e))},_G=[],vG=e=>{let t=t=>t[e]||_G;return t.isThemeGetter=!0,t},yG=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,bG=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xG=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,SG=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,CG=/\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$/,wG=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,TG=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,EG=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,DG=e=>xG.test(e),OG=e=>!!e&&!Number.isNaN(Number(e)),kG=e=>!!e&&Number.isInteger(Number(e)),AG=e=>e.endsWith(`%`)&&OG(e.slice(0,-1)),jG=e=>SG.test(e),MG=()=>!0,NG=e=>CG.test(e)&&!wG.test(e),PG=()=>!1,FG=e=>TG.test(e),IG=e=>EG.test(e),LG=e=>!X(e)&&!Z(e),RG=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),zG=e=>eK(e,iK,PG),X=e=>yG.test(e),BG=e=>eK(e,aK,NG),VG=e=>eK(e,oK,OG),HG=e=>eK(e,cK,MG),UG=e=>eK(e,sK,PG),WG=e=>eK(e,nK,PG),GG=e=>eK(e,rK,IG),KG=e=>eK(e,lK,FG),Z=e=>bG.test(e),qG=e=>tK(e,aK),JG=e=>tK(e,sK),YG=e=>tK(e,nK),XG=e=>tK(e,iK),ZG=e=>tK(e,rK),QG=e=>tK(e,lK,!0),$G=e=>tK(e,cK,!0),eK=(e,t,n)=>{let r=yG.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},tK=(e,t,n=!1)=>{let r=bG.exec(e);return r?r[1]?t(r[1]):n:!1},nK=e=>e===`position`||e===`percentage`,rK=e=>e===`image`||e===`url`,iK=e=>e===`length`||e===`size`||e===`bg-size`,aK=e=>e===`length`,oK=e=>e===`number`,sK=e=>e===`family-name`,cK=e=>e===`number`||e===`weight`,lK=e=>e===`shadow`,uK=gG(()=>{let e=vG(`color`),t=vG(`font`),n=vG(`text`),r=vG(`font-weight`),i=vG(`tracking`),a=vG(`leading`),o=vG(`breakpoint`),s=vG(`container`),c=vG(`spacing`),l=vG(`radius`),u=vG(`shadow`),d=vG(`inset-shadow`),f=vG(`text-shadow`),p=vG(`drop-shadow`),m=vG(`blur`),h=vG(`perspective`),g=vG(`aspect`),_=vG(`ease`),v=vG(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Z,X],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Z,X,c],T=()=>[DG,`full`,`auto`,...w()],E=()=>[kG,`none`,`subgrid`,Z,X],ee=()=>[`auto`,{span:[`full`,kG,Z,X]},kG,Z,X],D=()=>[kG,`auto`,Z,X],O=()=>[`auto`,`min`,`max`,`fr`,Z,X],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],A=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],te=()=>[`auto`,...w()],j=()=>[DG,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[DG,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],N=()=>[DG,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[e,Z,X],ne=()=>[...b(),YG,WG,{position:[Z,X]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,XG,zG,{size:[Z,X]}],ae=()=>[AG,qG,BG],oe=()=>[``,`none`,`full`,l,Z,X],se=()=>[``,OG,qG,BG],ce=()=>[`solid`,`dashed`,`dotted`,`double`],F=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],le=()=>[OG,AG,YG,WG],ue=()=>[``,`none`,m,Z,X],de=()=>[`none`,OG,Z,X],fe=()=>[`none`,OG,Z,X],pe=()=>[OG,Z,X],me=()=>[DG,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[jG],breakpoint:[jG],color:[MG],container:[jG],"drop-shadow":[jG],ease:[`in`,`out`,`in-out`],font:[LG],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[jG],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[jG],shadow:[jG],spacing:[`px`,OG],text:[jG],"text-shadow":[jG],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,DG,X,Z,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Z,X]}],"container-named":[RG],columns:[{columns:[OG,X,Z,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[kG,`auto`,Z,X]}],basis:[{basis:[DG,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[OG,DG,`auto`,`initial`,`none`,X]}],grow:[{grow:[``,OG,Z,X]}],shrink:[{shrink:[``,OG,Z,X]}],order:[{order:[kG,`first`,`last`,`none`,Z,X]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...A(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...A()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...A(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...A(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...A(),`baseline`]}],"place-self":[{"place-self":[`auto`,...A()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mbs:[{mbs:te()}],mbe:[{mbe:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...M()]}],"min-inline-size":[{"min-inline":[`auto`,...M()]}],"max-inline-size":[{"max-inline":[`none`,...M()]}],"block-size":[{block:[`auto`,...N()]}],"min-block-size":[{"min-block":[`auto`,...N()]}],"max-block-size":[{"max-block":[`none`,...N()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,qG,BG]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,$G,HG]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,AG,X]}],"font-family":[{font:[JG,UG,t]}],"font-features":[{"font-features":[X]}],"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,Z,X]}],"line-clamp":[{"line-clamp":[OG,`none`,Z,VG]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Z,X]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Z,X]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ce(),`wavy`]}],"text-decoration-thickness":[{decoration:[OG,`from-font`,`auto`,Z,BG]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[OG,`auto`,Z,X]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[kG,Z,X]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Z,X]}],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`,Z,X]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},kG,Z,X],radial:[``,Z,X],conic:[kG,Z,X]},ZG,GG]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":se()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ce(),`hidden`,`none`]}],"divide-style":[{divide:[...ce(),`hidden`,`none`]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ce(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[OG,Z,X]}],"outline-w":[{outline:[``,OG,qG,BG]}],"outline-color":[{outline:P()}],shadow:[{shadow:[``,`none`,u,QG,KG]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":[`none`,d,QG,KG]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:se()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[OG,BG]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":[`none`,f,QG,KG]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[OG,Z,X]}],"mix-blend":[{"mix-blend":[...F(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":F()}],"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":[OG]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[Z,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"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":b()}],"mask-image-conic-pos":[{"mask-conic":[OG]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Z,X]}],filter:[{filter:[``,`none`,Z,X]}],blur:[{blur:ue()}],brightness:[{brightness:[OG,Z,X]}],contrast:[{contrast:[OG,Z,X]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,QG,KG]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:[``,OG,Z,X]}],"hue-rotate":[{"hue-rotate":[OG,Z,X]}],invert:[{invert:[``,OG,Z,X]}],saturate:[{saturate:[OG,Z,X]}],sepia:[{sepia:[``,OG,Z,X]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Z,X]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[OG,Z,X]}],"backdrop-contrast":[{"backdrop-contrast":[OG,Z,X]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,OG,Z,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[OG,Z,X]}],"backdrop-invert":[{"backdrop-invert":[``,OG,Z,X]}],"backdrop-opacity":[{"backdrop-opacity":[OG,Z,X]}],"backdrop-saturate":[{"backdrop-saturate":[OG,Z,X]}],"backdrop-sepia":[{"backdrop-sepia":[``,OG,Z,X]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Z,X]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[OG,`initial`,Z,X]}],ease:[{ease:[`linear`,`initial`,_,Z,X]}],delay:[{delay:[OG,Z,X]}],animate:[{animate:[`none`,v,Z,X]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Z,X]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":[`scale-3d`],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[Z,X,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":[`translate-none`],zoom:[{zoom:[kG,Z,X]}],accent:[{accent:P()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:P()}],"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`,Z,X]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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`,Z,X]}],fill:[{fill:[`none`,...P()]}],"stroke-w":[{stroke:[OG,qG,BG,VG]}],stroke:[{stroke:[`none`,...P()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`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`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`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-bs`,`border-w-be`,`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-bs`,`border-color-be`,`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-mbs`,`scroll-mbe`,`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-pbs`,`scroll-pbe`,`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`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Q(...e){return uK(NW(e))}function dK(){return typeof window<`u`}function fK(e){return hK(e)?(e.nodeName||``).toLowerCase():`#document`}function pK(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mK(e){return((hK(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function hK(e){return dK()?e instanceof Node||e instanceof pK(e).Node:!1}function gK(e){return dK()?e instanceof Element||e instanceof pK(e).Element:!1}function _K(e){return dK()?e instanceof HTMLElement||e instanceof pK(e).HTMLElement:!1}function vK(e){return!dK()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof pK(e).ShadowRoot}function yK(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=AK(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function bK(e){return/^(table|td|th)$/.test(fK(e))}function xK(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var SK=/transform|translate|scale|rotate|perspective|filter/,CK=/paint|layout|strict|content/,wK=e=>!!e&&e!==`none`,TK;function EK(e){let t=gK(e)?AK(e):e;return wK(t.transform)||wK(t.translate)||wK(t.scale)||wK(t.rotate)||wK(t.perspective)||!OK()&&(wK(t.backdropFilter)||wK(t.filter))||SK.test(t.willChange||``)||CK.test(t.contain||``)}function DK(e){let t=MK(e);for(;_K(t)&&!kK(t);){if(EK(t))return t;if(xK(t))return null;t=MK(t)}return null}function OK(){return TK??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),TK}function kK(e){return/^(html|body|#document)$/.test(fK(e))}function AK(e){return pK(e).getComputedStyle(e)}function jK(e){return gK(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function MK(e){if(fK(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||vK(e)&&e.host||mK(e);return vK(t)?t.host:t}function NK(e){let t=MK(e);return kK(t)?(e.ownerDocument||e).body:_K(t)&&yK(t)?t:NK(t)}function PK(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=NK(e),i=r===e.ownerDocument?.body,a=pK(r);if(i){let e=FK(a);return t.concat(a,a.visualViewport||[],yK(r)?r:[],e&&n?PK(e):[])}return t.concat(r,PK(r,[],n))}function FK(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var IK={...f},LK=IK.useInsertionEffect,RK=LK&&LK!==IK.useLayoutEffect?LK:e=>e();function zK(e){let t=cW(BK).current;return t.next=e,RK(t.effect),t.trampoline}function BK(){let e={next:void 0,callback:VK,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function VK(){}var HK=typeof document<`u`?f.useLayoutEffect:()=>{},UK=f.createContext(void 0);function WK(e=!1){let t=f.useContext(UK);if(t===void 0&&!e)throw Error(oW(16));return t}function GK(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:f.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function KK(e){return e?.ownerDocument||document}function qK(e,t,{detail:n=0}={}){e.dispatchEvent(new(pK(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function JK(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=f.useRef(null),s=WK(!0),c=a??s!==void 0,{props:l}=GK({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=f.useCallback(()=>{let e=o.current;YK(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return HK(u,[u]),{getButtonProps:f.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return GU({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(nW(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=YK(r),s=!i&&XK(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),qK(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),qK(r,e)))},onKeyUp(e){if(!t){if(nW(e),a?.(e),e.target===e.currentTarget&&i&&c&&YK(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),qK(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:zK(e=>{o.current=e,u()})}}function YK(e){return _K(e)&&e.tagName===`BUTTON`}function XK(e){return _K(e)&&e.tagName===`A`&&!!e.href}var ZK=f.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=JK({disabled:i,focusableWhenDisabled:a,native:o});return wW(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),QK=IW(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,xs:`h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5`,sm:`h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,lg:`h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4`,icon:`size-7 [&_svg:not([class*='size-'])]:size-3.5`,"icon-xs":`size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5`,"icon-sm":`size-6 [&_svg:not([class*='size-'])]:size-3`,"icon-lg":`size-8 [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`,size:`default`}});function $K({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,F.jsx)(ZK,{"data-slot":`button`,className:Q(QK({variant:t,size:n,className:e})),...r})}var eq=0;function tq(e,t=`mui`){let[n,r]=f.useState(e),i=e||n;return f.useEffect(()=>{n??(eq+=1,r(`${t}-${eq}`))},[n,t]),i}var nq=IK.useId;function rq(e,t){if(nq!==void 0){let n=nq();return e??(t?`${t}-${n}`:n)}return tq(e,t)}function iq(e){return rq(e,`base-ui`)}function aq(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:oq,platform:sq,maxTouchPoints:cq}=aq(),lq=oq.toLowerCase(),uq=sq.toLowerCase(),dq=/^i(os$|p)/.test(uq)||uq===`macintel`&&cq>1,fq=`android`,pq=uq===fq||lq.includes(fq),mq=!dq&&uq.startsWith(`mac`);uq.startsWith(`win`),!pq&&/^(linux|chrome os)/.test(uq);var hq=mq||dq,gq=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!gq&&lq.includes(`firefox`),!gq&&lq.includes(`chrom`);var _q=hq,vq=/jsdom|happydom/.test(lq),yq=`data-base-ui-focusable`,bq=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function xq(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Sq(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&vK(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Cq(e){return`composedPath`in e?e.composedPath()[0]:e.target}function wq(e,t){if(!gK(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(Sq(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Tq(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Eq(e){return e.matches(`html,body`)}function Dq(e){return _K(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Oq(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${bq}`)!=null}function kq(e){return e?e.getAttribute(`role`)===`combobox`&&Dq(e):!1}function Aq(e){if(!e||vq)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function jq(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Mq(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Mq(e,t.id,n)])}function Nq(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Pq(e){e.preventDefault(),e.stopPropagation()}function Fq(e){return`nativeEvent`in e}function Iq(e){return e.pointerType===``&&e.isTrusted?!0:pq&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Lq(e){return vq?!1:!pq&&e.width===0&&e.height===0||pq&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Rq(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function zq(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Bq=Math.min,Vq=Math.max,Hq=Math.round,Uq=Math.floor,Wq=e=>({x:e,y:e}),Gq={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Kq(e,t,n){return Vq(e,Bq(t,n))}function qq(e,t){return typeof e==`function`?e(t):e}function Jq(e){return e.split(`-`)[0]}function Yq(e){return e.split(`-`)[1]}function Xq(e){return e===`x`?`y`:`x`}function Zq(e){return e===`y`?`height`:`width`}function Qq(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function $q(e){return Xq(Qq(e))}function eJ(e,t,n){n===void 0&&(n=!1);let r=Yq(e),i=$q(e),a=Zq(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=lJ(o)),[o,lJ(o)]}function tJ(e){let t=lJ(e);return[nJ(e),t,nJ(t)]}function nJ(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var rJ=[`left`,`right`],iJ=[`right`,`left`],aJ=[`top`,`bottom`],oJ=[`bottom`,`top`];function sJ(e,t,n){switch(e){case`top`:case`bottom`:return n?t?iJ:rJ:t?rJ:iJ;case`left`:case`right`:return t?aJ:oJ;default:return[]}}function cJ(e,t,n,r){let i=Yq(e),a=sJ(Jq(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(nJ)))),a}function lJ(e){let t=Jq(e);return Gq[t]+e.slice(t.length)}function uJ(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function dJ(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:uJ(e)}function fJ(e){let{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 pJ(e){return e.visibility===`hidden`||e.visibility===`collapse`}function mJ(e,t=e?AK(e):null){return!e||!e.isConnected||!t||pJ(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var hJ=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function gJ(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return vK(n)?n.host:null}function _J(e){for(let t of Array.from(e.children))if(fK(t)===`summary`)return t;return null}function vJ(e,t){let n=_J(t);return!!n&&(e===n||Sq(n,e))}function yJ(e){let t=e?fK(e):``;return e!=null&&e.matches(hJ)&&(t!==`summary`||e.parentElement!=null&&fK(e.parentElement)===`details`&&_J(e.parentElement)===e)&&(t!==`details`||_J(e)==null)&&(t!==`input`||e.type!==`hidden`)}function bJ(e){if(!yJ(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=gJ(t)){let n=t!==e,r=fK(t)===`slot`;if(t.hasAttribute(`inert`)||n&&fK(t)===`details`&&!t.open&&!vJ(e,t)||t.hasAttribute(`hidden`)||!r&&!xJ(t,n))return!1}return!0}function xJ(e,t){let n=AK(e);return t?n.display!==`none`:mJ(e,n)}function SJ(e){let t=e.tabIndex;if(t<0){let t=fK(e);if(t===`details`||t===`audio`||t===`video`||_K(e)&&e.isContentEditable)return 0}return t}function CJ(e){if(fK(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function wJ(e,t){let n=CJ(e);if(!n)return!0;let r=t.find(e=>{let t=CJ(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=CJ(e);return t?.name===n.name&&t.form===n.form})===n}function TJ(e){if(_K(e)&&fK(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return _K(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function EJ(e,t){TJ(e).forEach(e=>{yJ(e)&&t.push(e),EJ(e,t)})}function DJ(e,t,n){TJ(e).forEach(e=>{_K(e)&&e.matches(t)&&n.push(e),DJ(e,t,n)})}function OJ(e){return bJ(e)&&SJ(e)>=0}function kJ(e){let t=[];return EJ(e,t),t.filter(bJ)}function AJ(e){let t=kJ(e);return t.filter(e=>SJ(e)>=0&&wJ(e,t))}function jJ(e,t){let n=AJ(e),r=n.length;if(r===0)return;let i=xq(KK(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function MJ(e){return jJ(KK(e).body,1)||e}function NJ(e){return jJ(KK(e).body,-1)||e}function PJ(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Sq(n,r)}function FJ(e){AJ(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function IJ(e){let t=[];DJ(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function LJ(e){f.useEffect(e,yW)}var RJ=0,zJ=class e{static create(){return new e}currentId=RJ;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=RJ,t()},e)}isStarted(){return this.currentId!==RJ}clear=()=>{this.currentId!==RJ&&(clearTimeout(this.currentId),this.currentId=RJ)};disposeEffect=()=>this.clear};function BJ(){let e=cW(zJ.create).current;return LJ(e.disposeEffect),e}var VJ=null;globalThis.requestAnimationFrame;var HJ=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},UJ=class e{static create(){return new e}static request(e){return HJ.request(e)}static cancel(e){return HJ.cancel(e)}currentId=VJ;request(e){this.cancel(),this.currentId=HJ.request(()=>{this.currentId=VJ,e()})}cancel=()=>{this.currentId!==VJ&&(HJ.cancel(this.currentId),this.currentId=VJ)};disposeEffect=()=>this.cancel};function WJ(){let e=cW(UJ.create).current;return LJ(e.disposeEffect),e}function GJ(e){return e==null?e:`current`in e?e.current:e}var KJ=l(BU(),1);function qJ(e,t=!1){let n=WJ();return zK((r,i=null)=>{n.cancel();let a=GJ(e);if(a==null)return;let o=a,s=()=>{KJ.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function c(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||s()},()=>{if(!i?.aborted){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){c();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(c);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),c())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(c)})}function JJ(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=zK(i),o=qJ(r,n);f.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var YJ=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),XJ={"data-starting-style":``},ZJ={"data-ending-style":``},QJ={transitionStatus(e){return e===`starting`?XJ:e===`ending`?ZJ:null}};function $J(e,t=!1,n=!1){let[r,i]=f.useState(e&&t?`idle`:void 0),[a,o]=f.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),HK(()=>{if(!e&&a&&r!==`ending`&&n){let e=UJ.request(()=>{i(`ending`)});return()=>{UJ.cancel(e)}}},[e,a,r,n]),HK(()=>{if(!e||t)return;let n=UJ.request(()=>{i(void 0)});return()=>{UJ.cancel(n)}},[t,e]),HK(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=UJ.request(()=>{i(`idle`)});return()=>{UJ.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function eY({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=f.useRef(e!==void 0),[a,o]=f.useState(t);return[i?e:a,f.useCallback(e=>{i||o(e)},[])]}var tY=`none`,nY=`trigger-press`,rY=`trigger-hover`,iY=`trigger-focus`,aY=`outside-press`,oY=`close-press`,sY=`focus-out`,cY=`escape-key`,lY=`disabled`,uY=`imperative-action`;function dY(e,t,n,r){let i=!1,a=!1,o=r??bW;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var fY=f.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return wW(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function pY({className:e,orientation:t=`horizontal`,...n}){return(0,F.jsx)(fY,{"data-slot":`separator`,orientation:t,className:Q(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}var mY=f.createContext(void 0);function hY(e){let t=f.useContext(mY);if(!e&&t===void 0)throw Error(oW(27));return t}(function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=YJ.startingStyle]=`startingStyle`,e[e.endingStyle=YJ.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e})({});var gY={"data-popup-open":``},_Y={"data-open":``},vY={"data-closed":``},yY={"data-anchor-hidden":``},bY={open(e){return e?gY:null}},xY={open(e){return e?_Y:vY},anchorHidden(e){return e?yY:null}},SY={...xY,...QJ},CY=f.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=hY(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return wW(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:SY,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),wY=f.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=hY(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=JK({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,dY(oY,e.nativeEvent))}return wW(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),TY=f.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=hY(),c=iq(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),wW(`p`,e,{ref:t,props:[{id:c},o]})});function EY(e,t){return t!=null&&!Rq(t)?0:typeof e==`function`?e():e}function DY(e,t,n){let r=EY(e,n);return typeof r==`number`?r:r?.[t]}function OY(e){return typeof e==`function`?e():e}function kY(e,t){return t||e===`click`||e===`mousedown`}function AY(e){return e?.includes(`mouse`)&&e!==`mousedown`}var jY=f.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new zJ,currentIdRef:{current:null},currentContextRef:{current:null}});function MY(e,t){e.current=t.current}function NY(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=f.useContext(jY),[p,m]=f.useState(!1),h=f.useRef(n);return HK(()=>{h.current=n},[n]),HK(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(m(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(h.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),HK(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:m},a.current=i,o.current={open:0,close:DY(c.current,`close`)},t!==null&&t!==i?(m(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,dY(tY))):(m(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),HK(()=>()=>{if(a.current===i){if(l.current=null,!h.current)return;a.current=null,MY(o,c),d.clear()}},[l,a,o,i,c,d]),f.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:p}),[u,o,p])}function PY(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function FY(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function IY(e){let t=cW(LY,e).current;return t.next=e,HK(t.effect),t}function LY(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var RY={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},zY={...RY,position:`fixed`,top:0,left:0};({...RY});var BY=f.forwardRef(function(e,t){let[n,r]=f.useState();HK(()=>{_q&&gq&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,F.jsx)(`span`,{...e,ref:t,style:zY,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function VY(e){return`data-base-ui-${e}`}var HY=0;function UY(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(HY);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),vW;let o=requestAnimationFrame(a);return HY=o,()=>{HY===o&&(cancelAnimationFrame(o),HY=0)}}var WY={inert:new WeakMap,"aria-hidden":new WeakMap},GY=`data-base-ui-inert`,KY={inert:new WeakSet,"aria-hidden":new WeakSet},qY=new WeakMap,JY=0;function YY(e){return KY[e]}function XY(e){return e?vK(e)?e.host:XY(e.parentNode):null}var ZY=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=XY(t);return e.contains(n)?n:null}).filter(e=>e!=null),QY=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},$Y=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{fK(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function eX(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=ZY(t,e),l=i?$Y(t,QY(c),new Set(c)):[],u=[],d=[];if(a){let e=WY[a],n=YY(a);s=n,o=e;let r=ZY(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);$Y(t,QY(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(qY.get(e)||0)+1;qY.set(e,t),d.push(e),t===1&&e.setAttribute(GY,``)}),JY+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(qY.get(e)||0)-1;qY.set(e,t),t||e.removeAttribute(GY)}),--JY,JY||(WY.inert=new WeakMap,WY[`aria-hidden`]=new WeakMap,KY.inert=new WeakSet,KY[`aria-hidden`]=new WeakSet,qY=new WeakMap)}}function tX(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=KK(e[0]).body;return eX(e,a,n,r,{mark:i})}var nX={style:{transition:`none`}},rX={fallbackAxisSide:`end`},iX={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},aX=f.createContext(null),oX=()=>f.useContext(aX),sX=VY(`portal`);function cX(e={}){let{ref:t,container:n,componentProps:r=bW,elementProps:i}=e,a=rq(),o=oX()?.portalNode,[s,c]=f.useState(null),[l,u]=f.useState(null),d=zK(e=>{e!==null&&u(e)}),p=f.useRef(null);HK(()=>{if(n===null){p.current&&(p.current=null,u(null),c(null));return}let e=(n&&(hK(n)?n:n.current))??o??document.body;if(e==null){p.current&&(p.current=null,u(null),c(null));return}p.current!==e&&(p.current=e,u(null),c(e))},[n,o]);let m=wW(`div`,r,{ref:[t,d],props:[{id:a,[sX]:``},i]}),h=s&&m?KJ.createPortal(m,s):null;return{node:l,nodeId:f.isValidElement(m)?m.props.id:void 0,subtree:h}}var lX=f.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:c,nodeId:l,subtree:u}=cX({container:o,ref:t,componentProps:e,elementProps:s}),d=f.useRef(null),p=f.useRef(null),m=f.useRef(null),h=f.useRef(null),[g,_]=f.useState(null),v=f.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!c;f.useEffect(()=>{if(!c||y)return;function e(e){c&&e.relatedTarget&&PJ(e)&&(e.type===`focusin`?v.current&&=(IJ(c),!1):(FJ(c),v.current=!0))}return FY(PY(c,`focusin`,e,!0),PY(c,`focusout`,e,!0))},[c,y]),HK(()=>{!c||b!==!0||!v.current||(IJ(c),v.current=!1)},[b,c]);let S=f.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:c,setFocusManagerState:_}),[c]);return(0,F.jsxs)(f.Fragment,{children:[u,(0,F.jsxs)(aX.Provider,{value:S,children:[x&&c&&(0,F.jsx)(BY,{"data-type":`outside`,ref:d,onFocus:e=>{PJ(e,c)?m.current?.focus():NJ(g?g.domReference:null)?.focus()}}),x&&c&&(0,F.jsx)(`span`,{"aria-owns":l,style:iX}),c&&KJ.createPortal(a,c),x&&c&&(0,F.jsx)(BY,{"data-type":`outside`,ref:p,onFocus:e=>{PJ(e,c)?h.current?.focus():(MJ(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,dY(`focus-out`,e.nativeEvent)))}})]})]})});function uX(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var dX=f.createContext(null),fX=f.createContext(null),pX=()=>f.useContext(dX)?.id||null,mX=e=>{let t=f.useContext(fX);return e??t};function hX(e,t){let n=pK(Cq(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var gX=20,_X=[];function vX(){_X=_X.filter(e=>e.deref()?.isConnected)}function yX(e){vX(),e&&fK(e)!==`body`&&(_X.push(new WeakRef(e)),_X.length>gX&&(_X=_X.slice(-20)))}function bX(){return vX(),_X[_X.length-1]?.deref()}function xX(e){return e?OJ(e)?e:AJ(e)[0]||e:null}function SX(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=kJ(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return OJ(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function CX(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=`rootStore`in t?t.rootStore:t,_=g.useState(`open`),v=g.useState(`domReferenceElement`),y=g.useState(`floatingElement`),{events:b,dataRef:x}=g.context,S=zK(()=>x.current.floatingContext?.nodeId),C=i===!1,w=kq(v)&&C,T=IY(i),E=IY(a),ee=IY(l),D=IY(_),O=mX(m),k=oX(),A=f.useRef(!1),te=f.useRef(!1),j=f.useRef(!1),M=f.useRef(null),N=f.useRef(``),P=f.useRef(``),ne=f.useRef(null),re=f.useRef(null),ie=lW(ne,p,k?.beforeInsideRef),ae=lW(re,k?.afterInsideRef),oe=BJ(),se=BJ(),ce=WJ(),le=k!=null,ue=jq(y),de=zK((e=ue)=>e?AJ(e):[]),fe=zK(()=>h?.().filter(e=>e!=null)??[]);f.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&Sq(ue,xq(KK(ue)))&&de().length===0&&!w&&Pq(e)}return PY(KK(ue),`keydown`,e)},[r,ue,s,w,de]),f.useEffect(()=>{if(r||!_)return;let e=KK(ue);function t(){j.current=!1}function n(e){let t=Cq(e),n=fe(),r=Sq(y,t)||Sq(v,t)||Sq(k?.portalNode,t)||n.some(e=>e===t||Sq(e,t));j.current=!r,P.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(te.current=!0,se.start(0,()=>{te.current=!1}))}function i(){P.current=`keyboard`}return FY(PY(e,`pointerdown`,n,!0),PY(e,`pointerup`,t,!0),PY(e,`pointercancel`,t,!0),PY(e,`keydown`,i,!0),t)},[r,y,v,ue,_,k,se,fe]),f.useEffect(()=>{if(r||!c)return;let e=KK(ue);function t(){te.current=!0,se.start(0,()=>{te.current=!1})}function n(e){let t=Cq(e);OJ(t)&&(M.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=Cq(t);s&&n==null&&i!=null&&Sq(y,i)&&yX(i),queueMicrotask(()=>{let a=S(),c=g.context.triggerElements,l=fe(),f=n?.hasAttribute(VY(`focus-guard`))&&[ne.current,re.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,GJ(d),GJ(u)].includes(n),p=!(Sq(v,n)||Sq(y,n)||Sq(n,y)||Sq(k?.portalNode,n)||l.some(e=>e===n||Sq(e,n))||c.hasMatchingElement(e=>Sq(e,n))||f||O&&(Mq(O.nodesRef.current,a).find(e=>Sq(e.context?.elements.floating,n)||Sq(e.context?.elements.domReference,n))||Nq(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,jq(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===v&&ue&&SX(ue),o&&r!==v&&!mJ(i)&&xq(e)===e.body){if(_K(ue)&&(ue.focus(),o===`popup`)){ce.request(()=>{ue.focus()});return}let e=de(),t=M.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||ue;_K(n)&&n.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(w||!s)&&n&&p&&!te.current&&(w||n!==bX())&&(A.current=!0,g.setOpen(!1,dY(sY,t)))})}function a(){j.current||(x.current.insideReactTree=!0,oe.start(0,()=>{x.current.insideReactTree=!1}))}let l=_K(v)?v:null;if(!(!y&&!l))return FY(l&&PY(l,`focusout`,i),l&&PY(l,`pointerdown`,t),y&&PY(y,`focusin`,n),y&&PY(y,`focusout`,i),y&&k&&PY(y,`focusout`,a,!0))},[r,v,y,ue,s,O,k,g,c,o,de,w,S,x,oe,se,ce,u,d,fe]),f.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${VY(`portal`)}]`)||[]),t=(O?Nq(O.nodesRef.current,S()):[]).find(e=>kq(e.context?.elements.domReference||null))?.context?.elements.domReference,n=tX([y,...e,ne.current,re.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...fe(),t,GJ(d),GJ(u),w?v:null].filter(e=>e!=null),{ariaHidden:s||w,mark:!1}),i=tX([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,s,k,w,O,S,u,d,fe]),HK(()=>{if(!_||r||!_K(ue))return;N.current=``,P.current=``;let e=KK(ue),t=xq(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(ee.current||``):n;if(r===void 0||r===!1||Sq(ue,t))return;let i=null,a=()=>(i??=de(ue),i[0]||ue),o;o=r===!0||r===null?a():GJ(r),o||=a();let s=Sq(ue,xq(e));UY(o,{preventScroll:o===ue,shouldFocus(){if(!D.current)return!1;if(s)return!0;let t=xq(e);return!(t!==o&&Sq(ue,t))}})})},[r,_,ue,de,T,ee,D]),HK(()=>{if(r||!ue)return;let e=KK(ue),t=xq(e),n=ee.current==null;yX(t);function i(e){if(e.open||(N.current=hX(e.nativeEvent,P.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`){if(e.nested)A.current=!1;else if(Iq(e.nativeEvent)||Lq(e.nativeEvent))A.current=!1;else{let e=!1;KK(ue).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&fK(t)!==`body`?t:null,s=n?o||a:a||o;return s||=bX()||null,typeof i==`boolean`?s:GJ(i)||s||null}return()=>{b.off(`openchange`,i);let t=xq(e),n=fe(),r=Sq(y,t)||n.some(e=>e===t||Sq(e,t))||O&&Mq(O.nodesRef.current,S(),!1).some(e=>Sq(e.context?.elements.floating,t)),o=E.current,s=N.current,c=a(s);queueMicrotask(()=>{let n=xX(c),i=typeof o!=`boolean`;if(o&&!A.current&&_K(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}A.current=!1})}},[r,y,ue,E,ee,b,O,v,S,fe]),HK(()=>{if(!gq||_||!y)return;let e=xq(KK(y));!_K(e)||!Dq(e)||Sq(y,e)&&e.blur()},[_,y]),HK(()=>{if(!(r||!k))return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:_,onOpenChange:g.setOpen,domReference:v}),()=>{k.setFocusManagerState(null)}},[r,k,s,_,g,c,v]),HK(()=>{if(!(r||!ue))return SX(ue),()=>{queueMicrotask(vX)}},[r,ue]);let pe=!r&&(!s||!w)&&(le||s);return(0,F.jsxs)(f.Fragment,{children:[pe&&(0,F.jsx)(BY,{"data-type":`inside`,ref:ie,onFocus:e=>{if(s){let e=de();UY(e[e.length-1])}else k?.portalNode&&(A.current=!1,PJ(e,k.portalNode)?MJ(v)?.focus():GJ(d??k.beforeOutsideRef)?.focus())}}),n,pe&&(0,F.jsx)(BY,{"data-type":`inside`,ref:ae,onFocus:e=>{s?UY(de()[0]):k?.portalNode&&(c&&(A.current=!0),PJ(e,k.portalNode)?NJ(v)?.focus():GJ(u??k.afterOutsideRef)?.focus())}})]})}function wX(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function TX(e){return e!=null&&e.clientX!=null}function EX(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=f.useRef(!1),u=f.useRef(null),[d,p]=f.useState(),[m,h]=f.useState([]),g=zK(e=>{i.set(`positionReference`,e)}),_=zK((e,t,n)=>{l.current||c.current.openEvent&&!TX(c.current.openEvent)||i.set(`positionReference`,wX(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),v=zK(e=>{a?u.current||(_(e.clientX,e.clientY,e.currentTarget),h([])):_(e.clientX,e.clientY,e.currentTarget)}),y=Rq(d)?o:a;f.useEffect(()=>{if(!n){g(s);return}if(!y)return;function e(){u.current?.(),u.current=null}let t=pK(o);function r(t){let n=Cq(t);Sq(o,n)?e():_(t.clientX,t.clientY)}return!c.current.openEvent||TX(c.current.openEvent)?u.current=PY(t,`mousemove`,r):g(s),e},[y,n,o,c,s,i,_,g,m]),f.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),f.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),f.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let b=f.useMemo(()=>{function e(e){p(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:v,onMouseEnter:v}},[v]);return f.useMemo(()=>n?{reference:b,trigger:b}:{},[n,b])}function DX(){return!1}function OX(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function kX(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=DX,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:p}=l.context,m=mX(c),h=zK(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=zK(()=>a),{escapeKey:y,outsidePress:b}=OX(s),x=f.useRef(!1),S=f.useRef(!1),C=f.useRef(!1),w=f.useRef(!1),T=f.useRef(``),E=f.useRef(null),ee=BJ(),D=BJ(),O=zK(()=>{D.clear(),p.current.insideReactTree=!1}),k=zK(e=>{let t=p.current.floatingContext?.nodeId;return(m?Mq(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),A=zK(e=>Tq(e,l.select(`floatingElement`))||Tq(e,l.select(`domReferenceElement`))),te=zK(e=>{o()&&l.setOpen(!1,dY(nY,e.nativeEvent))}),j=zK(e=>{if(!u||!n||!r||e.key!==`Escape`||w.current||!y&&k(`__escapeKeyBubbles`))return;let t=dY(cY,Fq(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),M=zK(()=>{p.current.insideReactTree=!0,D.start(0,O)}),N=zK(e=>{if(!u||!n||e.button!==0)return;let t=Cq(e.nativeEvent);Sq(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),P=zK(e=>{!u||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});f.useEffect(()=>{if(!u||!n)return O;p.current.__escapeKeyBubbles=y,p.current.__outsidePressBubbles=b;let e=new zJ,t=new zJ;function i(){e.clear(),w.current=!0}function a(){e.start(gq?5:0,()=>{w.current=!1})}function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function s(){x.current=!1,S.current=!1}function c(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function f(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=p.current.floatingContext?.nodeId,n=m&&Mq(m.nodesRef.current,t).some(t=>Tq(e,t.context?.elements.floating));return A(e)||n}function D(e){if(f(e)){e.type!==`click`&&!A(e)&&(t.clear(),C.current=!1),O();return}if(p.current.insideReactTree){O();return}let n=Cq(e),r=`[${VY(`inert`)}]`,i=gK(n)?n.getRootNode():null,a=Array.from((vK(i)?i:KK(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Sq(e,n))))return;let s=gK(n)?n:null;for(;s&&!kK(s);){let e=MK(s);if(kK(e)||!gK(e))break;s=e}if(!(a.length&&gK(n)&&!Eq(n)&&!Sq(n,l.select(`floatingElement`))&&a.every(e=>!Sq(s,e)))){if(_K(n)&&!(`touches`in e)){let t=kK(n),r=AK(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!h(e)){if(c()===`intentional`&&C.current){t.clear(),C.current=!1;return}typeof g==`function`&&!g(e)||k(`__outsidePressBubbles`)||(l.setOpen(!1,dY(aY,e)),O())}}}function te(e){c()!==`sloppy`||e.pointerType===`touch`||!l.select(`open`)||!n||A(e)||D(e)}function M(e){if(c()!==`sloppy`||!l.select(`open`)||!n||A(e))return;let t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},ee.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function N(e,t){let n=Cq(e);if(!n)return;let r=PY(n,e.type,()=>{t(e),r()})}function P(e){T.current=`touch`,N(e,M)}function ne(e){ee.clear(),e.type===`pointerdown`&&(T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&N(e,e=>{e.type===`pointerdown`?te(e):D(e)})}function re(e){if(!x.current)return;let n=S.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!h(e)){if(n){o();return}typeof g==`function`&&!g(e)||(t.clear(),C.current=!0,O())}}}function ie(e){if(c()!==`sloppy`||!E.current||A(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(D(e),ee.clear(),E.current=null)}function ae(e){N(e,ie)}function oe(e){c()!==`sloppy`||!E.current||A(e)||(E.current.dismissOnTouchEnd&&D(e),ee.clear(),E.current=null)}function se(e){N(e,oe)}let ce=KK(d),F=FY(r&&FY(PY(ce,`keydown`,j),PY(ce,`compositionstart`,i),PY(ce,`compositionend`,a)),_&&FY(PY(ce,`click`,ne,!0),PY(ce,`pointerdown`,ne,!0),PY(ce,`pointerup`,re,!0),PY(ce,`pointercancel`,re,!0),PY(ce,`mousedown`,ne,!0),PY(ce,`mouseup`,re,!0),PY(ce,`touchstart`,P,!0),PY(ce,`touchmove`,ae,!0),PY(ce,`touchend`,se,!0)));return()=>{F(),e.clear(),t.clear(),s(),C.current=!1,O()}},[p,d,r,_,g,u,n,y,b,j,O,v,k,A,m,l,ee]);let ne=f.useMemo(()=>({onKeyDown:j,onPointerDown:te,onClick:te}),[j,te]),re=f.useMemo(()=>({onKeyDown:j,onPointerDown:P,onMouseDown:P,onClickCapture:M,onMouseDownCapture(e){M(),N(e)},onPointerDownCapture(e){M(),N(e)},onMouseUpCapture:M,onTouchEndCapture:M,onTouchMoveCapture:M}),[j,M,N,P]);return f.useMemo(()=>n?{reference:ne,floating:re,trigger:ne}:{},[n,ne,re])}function AX(e,t,n){let{reference:r,floating:i}=e,a=Qq(t),o=$q(t),s=Zq(o),c=Jq(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Yq(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function jX(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=qq(t,e),p=dJ(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=fJ(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=fJ(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var MX=50,NX=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:jX},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=AX(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<MX&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=AX(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},PX=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=qq(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Jq(r),_=Qq(o),v=Jq(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[lJ(o)]:tJ(o)),x=p!==`none`;!d&&x&&b.push(...cJ(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=eJ(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Qq(t)||T.every(e=>Qq(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Qq(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},FX=new Set([`left`,`top`]);async function IX(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Jq(n),s=Yq(n),c=Qq(n)===`y`,l=FX.has(o)?-1:1,u=a&&c?-1:1,d=qq(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var LX=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await IX(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},RX=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=qq(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Qq(i),p=Xq(f),m=u[p],h=u[f],g=(e,t)=>Kq(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},zX=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=qq(e,t),u={x:n,y:r},d=Qq(i),f=Xq(d),p=u[f],m=u[d],h=qq(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=FX.has(Jq(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},BX=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=qq(e,t),c=await i.detectOverflow(t,s),l=Jq(n),u=Yq(n),d=Qq(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Bq(p-c[m],g),y=Bq(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Vq(c.left,c.right):S=p-2*Vq(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function VX(e){let t=AK(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=_K(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Hq(n)!==a||Hq(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function HX(e){return gK(e)?e:e.contextElement}function UX(e){let t=HX(e);if(!_K(t))return Wq(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=VX(t),o=(a?Hq(n.width):n.width)/r,s=(a?Hq(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var WX=Wq(0);function GX(e){let t=pK(e);return!OK()||!t.visualViewport?WX:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function KX(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===pK(e)}function qX(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=HX(e),o=Wq(1);t&&(r?gK(r)&&(o=UX(r)):o=UX(e));let s=KX(a,n,r)?GX(a):Wq(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=pK(a),t=gK(r)?pK(r):r,n=e,i=FK(n);for(;i&&t!==n;){let e=UX(i),t=i.getBoundingClientRect(),r=AK(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=pK(i),i=FK(n)}}return fJ({width:u,height:d,x:c,y:l})}function JX(e,t){let n=jK(e).scrollLeft;return t?t.left+n:qX(mK(e)).left+n}function YX(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-JX(e,n),y:n.top+t.scrollTop}}function XX(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=mK(r),s=t?xK(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Wq(1),u=Wq(0),d=_K(r);if((d||!a)&&((fK(r)!==`body`||yK(o))&&(c=jK(r)),d)){let e=qX(r);l=UX(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?YX(o,c):Wq(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ZX(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function QX(e){let t=jK(e),n=e.ownerDocument.body,r=Vq(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Vq(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+JX(e),o=-t.scrollTop;return AK(n).direction===`rtl`&&(a+=Vq(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var $X=25;function eZ(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=pK(e),a=mK(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!OK()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(JX(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=$X&&(s-=o)}return{width:s,height:c,x:l,y:u}}function tZ(e,t){let n=qX(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=UX(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function nZ(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=eZ(e,n,t);else if(t===`document`)r=QX(mK(e));else if(gK(t))r=tZ(t,n);else{let n=GX(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return fJ(r)}function rZ(e,t){let n=t.get(e);if(n)return n;let r=PK(e,[],!1).filter(e=>gK(e)&&fK(e)!==`body`),i=null,a=AK(e).position===`fixed`,o=a?MK(e):e;for(;gK(o)&&!kK(o);){let e=AK(o),t=EK(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=MK(o)}return t.set(e,r),r}function iZ(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?xK(t)?[]:rZ(t,this._c):[].concat(n),r],o=nZ(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=nZ(t,a[e],i);s=Vq(n.top,s),c=Bq(n.right,c),l=Bq(n.bottom,l),u=Vq(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function aZ(e){let{width:t,height:n}=VX(e);return{width:t,height:n}}function oZ(e,t,n){let r=_K(t),i=mK(t),a=n===`fixed`,o=qX(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Wq(0);if((r||!a)&&((fK(t)!==`body`||yK(i))&&(s=jK(t)),r)){let e=qX(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=JX(i));let l=i&&!r&&!a?YX(i,s):Wq(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function sZ(e){return AK(e).position===`static`}function cZ(e,t){if(!_K(e)||AK(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return mK(e)===n&&(n=n.ownerDocument.body),n}function lZ(e,t){let n=pK(e);if(xK(e))return n;if(!_K(e)){let t=MK(e);for(;t&&!kK(t);){if(gK(t)&&!sZ(t))return t;t=MK(t)}return n}let r=cZ(e,t);for(;r&&bK(r)&&sZ(r);)r=cZ(r,t);return r&&kK(r)&&sZ(r)&&!EK(r)?n:r||DK(e)||n}var uZ=async function(e){let t=this.getOffsetParent||lZ,n=this.getDimensions,r=await n(e.floating);return{reference:oZ(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dZ(e){return AK(e).direction===`rtl`}var fZ={convertOffsetParentRelativeRectToViewportRelativeRect:XX,getDocumentElement:mK,getClippingRect:iZ,getOffsetParent:lZ,getElementRects:uZ,getClientRects:ZX,getDimensions:aZ,getScale:UX,isElement:gK,isRTL:dZ};function pZ(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mZ(e,t,n){let r=null,i,a=mK(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Uq(d),h=Uq(a.clientWidth-(u+f)),g=Uq(a.clientHeight-(d+p)),_=Uq(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Vq(0,Bq(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!pZ(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=pK(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function hZ(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=HX(e),u=i||a?[...l?PK(l):[],...t?PK(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?mZ(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?qX(e):null;c&&g();function g(){let t=qX(e);h&&!pZ(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var gZ=LX,_Z=RX,vZ=PX,yZ=BX,bZ=zX,xZ=(e,t,n)=>{let r=new Map,i=n??{},a={...fZ,...i.platform,_c:r};return NX(e,t,{...i,platform:a})},SZ=typeof document<`u`?f.useLayoutEffect:function(){};function CZ(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(!CZ(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;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!CZ(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function wZ(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function TZ(e,t){let n=wZ(e);return Math.round(t*n)/n}function EZ(e){let t=f.useRef(e);return SZ(()=>{t.current=e}),t}function DZ(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(r);CZ(p,r)||m(r);let[h,g]=f.useState(null),[_,v]=f.useState(null),y=f.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=f.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=f.useRef(null),w=f.useRef(null),T=f.useRef(u),E=c!=null,ee=EZ(c),D=EZ(i),O=EZ(l),k=f.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};D.current&&(e.platform=D.current),xZ(C.current,w.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!CZ(T.current,t)&&(T.current=t,KJ.flushSync(()=>{d(t)}))})},[p,t,n,D,O]);SZ(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=f.useRef(!1);SZ(()=>(A.current=!0,()=>{A.current=!1}),[]),SZ(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(ee.current)return ee.current(x,S,k);k()}},[x,S,k,ee,E]);let te=f.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),j=f.useMemo(()=>({reference:x,floating:S}),[x,S]),M=f.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=TZ(j.floating,u.x),r=TZ(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...wZ(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:k,refs:te,elements:j,floatingStyles:M}),[u,k,te,j,M])}var OZ=(e,t)=>{let n=gZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},kZ=(e,t)=>{let n=_Z(e);return{name:n.name,fn:n.fn,options:[e,t]}},AZ=(e,t)=>({fn:bZ(e).fn,options:[e,t]}),jZ=(e,t)=>{let n=vZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},MZ=(e,t)=>{let n=yZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},NZ=[],PZ=void 0;function FZ(){return PZ}function IZ(e){NZ.push(e)}function LZ(e){let t=(t,n)=>{let r=cW(zZ).current,i;try{PZ=r;for(let e of NZ)e.before(r);i=e(t,n);for(let e of NZ)e.after(r);r.didInitialize=!0}finally{PZ=void 0}return i};return t.displayName=e.displayName||e.name,t}function RZ(e){return f.forwardRef(LZ(e))}function zZ(){return{didInitialize:!1}}var BZ=sa(),VZ=gW(19)?WZ:GZ;function HZ(e,t,n,r,i){return VZ(e,t,n,r,i)}function UZ(e,t,n,r,i){let a=f.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,BZ.useSyncExternalStore)(e.subscribe,a,a)}IZ({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,BZ.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function WZ(e,t,n,r,i){let a=FZ();if(!a)return UZ(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function GZ(e,t,n,r,i){return(0,la.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var KZ=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return HZ(this,e,t,n,r)}},qZ=class extends KZ{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){f.useDebugValue(e);let n=this;HK(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;HK(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;HK(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){f.useDebugValue(e);let n=this,r=t!==void 0;HK(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return f.useDebugValue(e),HZ(this,this.selectors[e],t,n,r)}useContextCallback(e,t){f.useDebugValue(e);let n=zK(t??vW);this.context[e]=n}useStateSetter(e){let t=f.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},JZ={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},YZ=class extends qZ{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:uX(),nested:n,triggerElements:i},JZ),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&zq(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function XZ(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,p=f.useRef(null);r===void 0&&p.current===null&&(p.current=new YZ({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let m=r??p.current;return t.useSyncedValue(`floatingId`,i),HK(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};gK(c)&&(e.domReferenceElement=c),m.state.positionReference===m.state.referenceElement&&(e.positionReference=c),m.update(e)},[s,i,c,l,m]),m.context.onOpenChange=d,m.context.nested=a,m}var ZZ={tabIndex:-1,[yq]:``};function QZ(e){return t=>t!==`touch`||e.current}function $Z(e,t=!1){let n=rq(),r=pX()!=null,i=cW(()=>e(n,r)).current;return XZ({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function eQ({handle:e,store:t}){return HK(()=>e.attachStore(t),[e,t]),null}function tQ(e,t){let n=f.useRef(null),r=f.useRef(null);return f.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function nQ(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=n?.id??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function rQ(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function iQ(e,t,n,r={}){let i=n.reason,a=i===rY,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=rQ(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i={...r.extraState,open:t};o?i.instantType=`focus`:s?i.instantType=`dismiss`:a&&(i.instantType=void 0),nQ(i,t,n.trigger,c()),e.update(i)};a?KJ.flushSync(l):l()}function aQ(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=tQ(e,n),o=zK(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=f.useCallback(e=>{a(e),e&&o(e)},[a,o]);return HK(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function oQ(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=f.useRef(null),i=e.useState(`open`);HK(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=dY(tY);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function sQ(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=$J(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=zK(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return JJ({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function cQ(e,t){e.useSyncedValues(t),HK(()=>()=>{e.update({activeTriggerProps:bW,inactiveTriggerProps:bW,popupProps:bW})},[e])}function lQ(e,t){HK(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),HK(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var uQ=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function dQ(){return new YZ({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new uQ,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function fQ(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:dQ(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:bW,inactiveTriggerProps:bW,popupProps:bW}}function pQ(e,t,n=!1){return new YZ({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var mQ=e=>e.triggerIdProp??e.activeTriggerId,hQ=e=>e.openProp??e.open,gQ=e=>(e.popupElement?.id??e.floatingId)||void 0;function _Q(e,t){return t!==void 0&&hQ(e)&&mQ(e)===t}function vQ(e,t){return _Q(e,t)?!0:t!==void 0&&hQ(e)&&mQ(e)==null&&e.triggerCount===1}var yQ={open:hQ,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:mQ,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:gQ,isTriggerActive:(e,t)=>t!==void 0&&mQ(e)===t,isOpenedByTrigger:(e,t)=>_Q(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&mQ(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>vQ(e,t)?gQ(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function bQ(e){let t=f.useCallback(t=>e===void 0?vW:e.subscribeStore(t),[e]),n=f.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,BZ.useSyncExternalStore)(t,n,()=>e?.serverStore)}function xQ(e){return SQ(e,e.rootContext)}function SQ(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=f.useState(null),[d,p]=f.useState(void 0),[m,h]=f.useState(void 0),g=f.useRef(null),_=mX(r),v=f.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=DZ({...e,elements:{...v,...l&&{reference:l}}}),b=gK(d)?d:null,x=m===void 0?t.state.floatingElement:m;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:b),t.useSyncedValue(`floatingElement`,x);let S=f.useCallback(e=>{let t=gK(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),y.refs.setReference(t)},[y.refs]),C=f.useCallback(e=>{(gK(e)||e===null)&&(g.current=e,p(e)),(gK(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!gK(e))&&y.refs.setReference(e)},[y.refs,p]),w=f.useCallback(e=>{h(e),y.refs.setFloating(e)},[y.refs]),T=f.useMemo(()=>({...y.refs,setReference:C,setFloating:w,setPositionReference:S,domReference:g}),[y.refs,C,w,S]),E=f.useMemo(()=>({...y.elements,domReference:o}),[y.elements,o]),ee=f.useMemo(()=>({...y,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:T,elements:E,nodeId:n,rootStore:t}),[y,T,E,n,t,s,c]);return HK(()=>{o&&(g.current=o)},[o]),HK(()=>{t.context.dataRef.current.floatingContext=ee;let e=_?.nodesRef.current.find(e=>e.id===n);e&&(e.context=ee)}),f.useMemo(()=>({...y,context:ee,refs:T,elements:E,rootStore:t}),[y,T,E,ee,t])}var CQ=mq&&gq;function wQ(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=f.useRef(!1),c=f.useRef(null),l=f.useRef(!0),u=BJ();f.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=pK(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&_K(e)&&e===xq(KK(e))&&(s.current=!0)}function a(){l.current=!0}function o(){l.current=!1}return FY(PY(t,`blur`,r),CQ&&PY(t,`keydown`,a,!0),CQ&&PY(t,`pointerdown`,o,!0))},[i,n]),f.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);gK(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=f.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=Cq(t.nativeEvent);if(gK(a)){if(CQ&&!t.relatedTarget){if(!l.current&&!Dq(a))return}else if(!Aq(a))return}let o=wq(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;if(i.select(`open`)&&o||p===0||p===void 0){i.setOpen(!0,dY(iY,d,f));return}u.start(p,()=>{s.current||i.setOpen(!0,dY(iY,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=gK(n)&&n.hasAttribute(VY(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=xq(KK(e));!n&&t===e||Sq(o.current.floatingContext?.refs.floating.current,t)||Sq(e,t)||a||wq(n??t,i.context.triggerElements)||i.setOpen(!1,dY(iY,r))})}}},[o,r,i,u]);return f.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var TQ=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new zJ,this.restTimeout=new zJ,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},EQ=new WeakMap;function DQ(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&EQ.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),EQ.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function OQ(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=EQ.get(n);a&&a!==e&&DQ(a),DQ(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,EQ.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function kQ(e){let t=e.context.dataRef.current,n=cW(()=>t.hoverInteractionState??TQ.create()).current;return t.hoverInteractionState||=n,LJ(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function AQ(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=mX(),d=pX(),p=kQ(a),m=BJ(),h=zK(()=>kY(l.current.openEvent?.type,p.interactedInside)),g=zK(()=>AY(l.current.openEvent?.type)),_=zK(()=>{DQ(p)});HK(()=>{o||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,_())},[o,p,_]),f.useEffect(()=>_,[_]),HK(()=>{if(n&&o&&p.handleCloseOptions?.blockPointerEvents&&g()&&gK(c)&&s){let e=c,t=s,n=KK(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=p.pointerEventsScopeElement===t?null:p.pointerEventsScopeElement,a=r===t?null:r,o=p.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return OQ(p,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{_()}}},[n,o,c,s,p,g,u,d,_]),f.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&Mq(u.nodesRef.current,d).length>0)}function t(e){let t=DY(r,`close`,p.pointerType),n=()=>{a.setOpen(!1,dY(rY,e)),u?.events.emit(`floating.closed`,e)};t?p.openChangeTimeout.start(t,n):(p.openChangeTimeout.clear(),n())}function o(e){let t=Cq(e);if(!Oq(t)){p.interactedInside=!1;return}p.interactedInside=t?.closest(`[aria-haspopup]`)!=null}function c(){p.openChangeTimeout.clear(),m.clear(),u?.events.off(`floating.closed`,v),_()}function f(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(wq(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(u&&r&&gK(o)&&Mq(u.nodesRef.current,r,!1).some(e=>Sq(e.context?.elements.floating,o)))){if(p.handler){p.handler(n);return}_(),g()&&!h()&&t(n)}}function v(t){!u||!d||e()||m.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,dY(rY,t)),u.events.emit(`floating.closed`,t)})}let y=s;return FY(y&&PY(y,`mouseenter`,c),y&&PY(y,`mouseleave`,f),y&&PY(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,g,h,_,p,u,d,m])}var jQ={current:null};function MQ(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=jQ,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:p,shouldOpen:m,guardStaleOpen:h=!1}=t,g=`rootStore`in e?e.rootStore:e,{dataRef:_,events:v}=g.context,y=mX(l),b=kQ(g),x=f.useRef(!1),S=IY(i),C=IY(r),w=IY(o),T=IY(n),E=IY(m),ee=IY(p),D=zK(()=>kY(_.current.openEvent?.type,b.interactedInside)),O=zK(()=>E.current?.()!==!1),k=zK((e,t,n)=>{let r=g.context.triggerElements;if(r.hasElement(t))return!e||!Sq(e,t);if(!gK(n))return!1;let i=n;return r.hasMatchingElement(e=>Sq(e,i))&&(!e||!Sq(e,i))}),A=zK(()=>{b.handler&&=(KK(g.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),te=zK(()=>{DQ(b)});return u&&(b.handleCloseOptions=S.current?.__options),f.useEffect(()=>A,[A]),f.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===rY,A(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return v.on(`openchange`,e),()=>{v.off(`openchange`,e)}},[n,v,b,A]),f.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=DY(C.current,`close`,b.pointerType);n?b.openChangeTimeout.start(n,()=>{g.setOpen(!1,dY(rY,e)),y?.events.emit(`floating.closed`,e)}):t&&(b.openChangeTimeout.clear(),g.setOpen(!1,dY(rY,e)),y?.events.emit(`floating.closed`,e))}let t=c.current??(u?g.select(`domReferenceElement`):null);if(!gK(t))return;function r(e){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!Rq(b.pointerType))return;let t=OY(w.current),n=DY(C.current,`open`,b.pointerType),r=Cq(e),i=e.currentTarget??null,o=g.select(`domReferenceElement`),s=i;if(gK(r)&&!g.context.triggerElements.hasElement(r)){for(let e of g.context.triggerElements.elements())if(Sq(e,r)){s=e;break}}gK(i)&&gK(o)&&!g.context.triggerElements.hasElement(i)&&Sq(i,o)&&(s=o);let c=s!=null&&k(o,s,r),l=g.select(`open`),u=ee.current?.()??g.select(`transitionStatus`)===`ending`,d=!l&&u&&x.current,f=!c&&gK(s)&&gK(o)&&Sq(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,h=!l||c;if(m){O()&&g.setOpen(!0,dY(rY,e,s));return}p||(n?b.openChangeTimeout.start(n,()=>{h&&O()&&g.setOpen(!0,dY(rY,e,s))}):h&&O()&&g.setOpen(!0,dY(rY,e,s)))}function i(t){if(D()){te();return}A();let n=KK(g.select(`domReferenceElement`));b.restTimeout.clear(),b.restTimeoutPending=!1;let r=_.current.floatingContext??d?.();if(!wq(t.relatedTarget,g.context.triggerElements)){if(S.current&&r){g.select(`open`)||b.openChangeTimeout.clear();let i=c.current;b.handler=S.current({...r,tree:y,x:t.clientX,y:t.clientY,onClose(){te(),A(),T.current&&!D()&&i===g.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,b.handler),b.handler(t);return}(b.pointerType!==`touch`||!Sq(g.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){Sq(t,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let l=h?PY(t,`mouseout`,o):void 0;return s?FY(PY(t,`mousemove`,r,{once:!0}),PY(t,`mouseenter`,r),PY(t,`mouseleave`,i),l):FY(PY(t,`mouseenter`,r),PY(t,`mouseleave`,i),l)},[A,te,_,C,g,n,S,b,u,k,D,a,s,w,c,y,T,d,ee,O,h]),f.useMemo(()=>{if(!n)return;function e(e){b.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=g.select(`domReferenceElement`),i=g.select(`open`),o=k(r,n,e.target);if(a&&!Rq(b.pointerType))return;if(i&&o&&b.handleCloseOptions?.blockPointerEvents){let e=g.select(`floatingElement`);if(e){let t=b.handleCloseOptions?.getScope?.()??n.ownerDocument.body;OQ(b,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=OY(w.current);if(i&&!o||s===0||!o&&b.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;b.restTimeout.clear();function c(){if(b.restTimeoutPending=!1,D())return;let e=g.select(`open`);!b.blockMouseMove&&(!e||o)&&O()&&g.setOpen(!0,dY(rY,t,n))}b.pointerType===`touch`?KJ.flushSync(()=>{c()}):o&&i?c():(b.restTimeoutPending=!0,b.restTimeout.start(s,c))}}},[n,b,D,k,a,g,w,O])}var NQ=.1,PQ=NQ*NQ,FQ=.5;function IQ(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function LQ(e,t,n,r,i,a,o,s,c,l){let u=!1;return IQ(e,t,n,r,i,a)&&(u=!u),IQ(e,t,i,a,o,s)&&(u=!u),IQ(e,t,o,s,c,l)&&(u=!u),IQ(e,t,c,l,n,r)&&(u=!u),u}function RQ(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function zQ(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function BQ(e={}){let{blockPointerEvents:t=!1}=e,n=new zJ,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*PQ;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Cq(r),g=r.type===`mouseleave`,_=Sq(u,h),v=Sq(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&gK(r.relatedTarget)&&Sq(u,r.relatedTarget))return;function y(){return!!(s&&Mq(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,ee=(T?x:S).left,D=(T?x:S).right,O=(E?x:S).top,k=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let A=!1;switch(c){case`top`:A=zQ(d,f,ee,x.top+1,D,S.bottom-1);break;case`bottom`:A=zQ(d,f,ee,S.top+1,D,x.bottom-1);break;case`left`:A=zQ(d,f,S.right-1,k,x.left+1,O);break;case`right`:A=zQ(d,f,x.right-1,k,S.left+1,O)}if(A)return;if(l&&!RQ(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let te=!1;switch(c){case`top`:{let n=T?FQ/2:FQ*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+FQ+1,o=C||T?S.bottom-FQ:S.top,s=C?T?S.bottom-FQ:S.top:S.bottom-FQ;te=LQ(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?FQ/2:FQ*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-FQ,o=C||T?S.top+FQ:S.bottom,s=C?T?S.top+FQ:S.bottom:S.top+FQ;te=LQ(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?FQ/2:FQ*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+FQ+1,o=w||E?S.right-FQ:S.left,s=w?E?S.right-FQ:S.left:S.right-FQ;te=LQ(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?FQ/2:FQ*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-FQ,o=w||E?S.left+FQ:S.right,s=w?E?S.left+FQ:S.right:S.left+FQ;te=LQ(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}te?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var VQ=f.createContext(void 0);function HQ(){let e=f.useContext(VQ);if(e===void 0)throw Error(oW(26));return e}var UQ=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),WQ={...xY,...QJ,nestedDialogOpen(e){return e?{"data-nested-dialog-open":``}:null}},GQ=f.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=hY(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);HQ(),JJ({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?QZ(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=wW(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...ZZ,hidden:!m,onKeyDown(e){UQ.has(e.key)&&e.stopPropagation()},style:{"--nested-dialogs":g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:WQ});return(0,F.jsx)(CX,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})});function KQ(e){return gW(19)?e:e?`true`:void 0}var qQ=f.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,F.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),JQ=f.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=hY(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,F.jsx)(VQ.Provider,{value:n,children:(0,F.jsxs)(lX,{ref:t,...r,children:[a&&o===!0&&(0,F.jsx)(qQ,{ref:i.context.internalBackdropRef,inert:KQ(!s)}),e.children]})}):null}),YQ={},XQ={},ZQ=``;function QQ(e,t){return yK(e)?e:t}function $Q(e,t,n){return/hidden|clip/.test(e.getComputedStyle(QQ(t,n)).overflowY)}function e$(e){if(typeof document>`u`)return!1;let t=KK(e);return pK(t).innerWidth-t.documentElement.clientWidth>0}function t$(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=KK(e),n=t.documentElement,r=t.body,i=QQ(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function n$(e){let t=KK(e),n=t.documentElement,r=t.body,i=QQ(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function r$(e){let t=KK(e),n=t.documentElement,r=t.body,i=pK(n),a=0,o=0,s=!1,c=UJ.create();if(gq&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,YQ={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ZQ=n.style.scrollBehavior,XQ={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=QQ(n,r);if(s=t$(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,YQ),Object.assign(r.style,XQ),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=ZQ)}function d(){u(),c.request(l)}l();let f=PY(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var i$=new class{lockCount=0;restore=null;timeoutLock=zJ.create();timeoutUnlock=zJ.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=KK(e),n=t.documentElement,r=t.body,i=pK(n);if($Q(i,n,r)){let t=new i.MutationObserver(()=>{$Q(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=dq||!e$(e);this.restore=a?n$(e):r$(e)}};function a$(e=!0,t=null){HK(()=>{if(e)return i$.acquire(t)},[e,t])}function o$({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=f.useState(0),[u,d]=f.useState(0),p=c===0,m=kX(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Cq(t);if(p&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Sq(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return a$(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),HK(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),cQ(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var s$={...yQ,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},c$=class extends qZ{constructor(e,t,n){let r=new uQ,i=l$(e,r,t,n);super(i,u$(r),s$)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};nQ(n,e,t.trigger),this.update(n)}};function l$(e,t,n,r=!1){let i={...fQ(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e};return i.floatingRootContext=pQ(t,n,r),i}function u$(e){return{popupRef:f.createRef(),backdropRef:f.createRef(),internalBackdropRef:f.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function d$(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:p=null}=t,m=e===`drawer`,h=e===`alert-dialog`,g=h?!0:c,_=h||s,v=h?`alertdialog`:`dialog`,y=hY(!0),b={modal:g,disablePointerDismissal:_,nested:y!=null,role:v},x=$Z((e,t)=>new c$({open:i,openProp:r,activeTriggerId:p,triggerIdProp:d,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,d),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,a),x.useContextCallback(`onOpenChangeComplete`,o);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);lQ(x,S),oQ(x);let{forceUnmount:T}=sQ(S,x);f.useImperativeHandle(l,()=>({unmount:T,close:()=>x.setOpen(!1,dY(uY))}),[T,x]);let E=S||C;return(0,F.jsxs)(mY.Provider,{value:x,children:[u&&(0,F.jsx)(eQ,{handle:u,store:x}),E&&(0,F.jsx)(o$,{store:x,parentContext:y?.context,isDrawer:m}),typeof n==`function`?n({payload:w}):n]})}function f$(e){return d$(`dialog`,e)}var p$=f.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=hY(),c=iq(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),wW(`h2`,e,{ref:t,props:[{id:c},o]})});function m$({...e}){return(0,F.jsx)(f$,{"data-slot":`sheet`,...e})}function h$({...e}){return(0,F.jsx)(JQ,{"data-slot":`sheet-portal`,...e})}function g$({className:e,...t}){return(0,F.jsx)(CY,{"data-slot":`sheet-overlay`,className:Q(`fixed inset-0 z-50 bg-black/80 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs`,e),...t})}function _$({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,F.jsxs)(h$,{children:[(0,F.jsx)(g$,{}),(0,F.jsxs)(GQ,{"data-slot":`sheet-content`,"data-side":n,className:Q(`fixed z-50 flex flex-col bg-popover bg-clip-padding text-xs/relaxed text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...i,children:[t,r&&(0,F.jsxs)(wY,{"data-slot":`sheet-close`,render:(0,F.jsx)($K,{variant:`ghost`,className:`absolute top-4 right-4`,size:`icon-sm`}),children:[(0,F.jsx)(se,{}),(0,F.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function v$({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`sheet-header`,className:Q(`flex flex-col gap-1.5 p-6`,e),...t})}function y$({className:e,...t}){return(0,F.jsx)(p$,{"data-slot":`sheet-title`,className:Q(`font-heading text-sm font-medium text-foreground`,e),...t})}function b$({className:e,...t}){return(0,F.jsx)(TY,{"data-slot":`sheet-description`,className:Q(`text-xs/relaxed text-muted-foreground`,e),...t})}var x$=f.createContext(void 0);function S$(e){let t=f.useContext(x$);if(t===void 0&&!e)throw Error(oW(72));return t}var C$={...yQ,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},w$=class extends qZ{constructor(e,t,n){let r=new uQ;super(T$(e,r,t,n),E$(r),C$)}setOpen=(e,t)=>{iQ(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,dY(nY,e))}};function T$(e,t,n,r=!1){let i={...fQ(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return i.floatingRootContext=pQ(t,n,r),i}function E$(e){return{popupRef:f.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var D$=LZ(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:p}=e,m=$Z((e,t)=>new w$({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));m.useControlledProp(`openProp`,r),m.useControlledProp(`triggerIdProp`,u),m.useContextCallback(`onOpenChange`,s),m.useContextCallback(`onOpenChangeComplete`,c);let h=m.useState(`open`),g=!t&&h,_=m.useState(`activeTriggerId`),v=m.useState(`mounted`),y=m.useState(`payload`);m.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),oQ(m,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:x}=sQ(g,m),S=m.useState(`isInstantPhase`),C=m.useState(`instantType`),w=m.useState(`lastOpenChangeReason`),T=f.useRef(null);HK(()=>{h&&t&&m.setOpen(!1,dY(lY))},[h,t,m]),HK(()=>{x===`ending`&&w===`none`||x!==`ending`&&S?(C!==`delay`&&(T.current=C),m.set(`instantType`,`delay`)):T.current!==null&&(m.set(`instantType`,T.current),T.current=null)},[x,S,w,C,m]),HK(()=>{g&&(_??m.set(`payload`,void 0))},[m,_,g]),f.useImperativeHandle(o,()=>({unmount:b,close:()=>m.setOpen(!1,dY(uY))}),[b,m]);let E=g||v||!t&&a!==`none`;return(0,F.jsxs)(x$.Provider,{value:m,children:[l&&(0,F.jsx)(eQ,{handle:l,store:m}),E&&(0,F.jsx)(O$,{store:m,disabled:t,trackCursorAxis:a}),typeof p==`function`?p({payload:y}):p]})});function O$({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=kX(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=EX(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=f.useMemo(()=>GU(a.reference,i.reference),[a.reference,i.reference]);return cQ(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??bW}),null}var k$=f.createContext(void 0);function A$(){return f.useContext(k$)}var j$=`data-base-ui-tooltip-trigger`;function M$(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(gK(n))return n}}let t=e.target;return gK(t)?t:null}function N$(e){let t=e;for(;t;){let e=t.closest(`[${j$}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&gK(n.host)?n.host:null}return null}var P$=RZ(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...p}=e,m=S$(!0),h=bQ(a)??m;if(!h)throw Error(oW(82));let g=iq(d),_=h.useState(`isTriggerActive`,g),v=h.useState(`isOpenedByTrigger`,g),y=h.useState(`floatingRootContext`),b=f.useRef(null),x=c??600,S=u??0,{registerTrigger:C,isMountedByThisTrigger:w}=aQ(g,b,h,{payload:o,closeOnClick:l,closeDelay:S}),T=A$(),{delayRef:E,isInstantPhase:ee,hasProvider:D}=NY(y,{open:v}),O=kQ(y);h.useSyncedValue(`isInstantPhase`,ee);let k=h.useState(`disabled`),A=s??k,te=IY(A),j=h.useState(`trackCursorAxis`),M=h.useState(`disableHoverablePopup`),N=f.useRef(!1),P=BJ(),ne=f.useRef(void 0);function re(){return D?DY(E.current,`open`)===0?0:c??T??600:x}function ie(e){let t=b.current;if(!t||!e)return!1;let n=N$(e);return n!==null&&n!==t&&Sq(t,n)}function ae(e){let t=ie(e);return N.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,P.clear()),t}let oe=MQ(y,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!M&&j!==`both`?BQ():null,restMs:re,delay(){return u==null&&D?{close:DY(E.current,`close`)}:{close:S}},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`,shouldOpen(){return!N.current}}),se=wQ(y,{enabled:!A}).reference,ce=e=>{let t=N.current,n=M$(e),r=ae(n),i=b.current,a=i&&n&&Sq(i,n);if(r&&h.select(`open`)&&h.select(`lastOpenChangeReason`)===`trigger-hover`){h.setOpen(!1,dY(rY,e));return}if(t&&!r&&a&&!te.current&&!h.select(`open`)&&i&&Rq(ne.current)){let t=()=>{!N.current&&!te.current&&!h.select(`open`)&&h.setOpen(!0,dY(rY,e,i))},n=re();n===0?(P.clear(),t()):P.start(n,t)}},F=h.useState(`triggerProps`,w);return wW(`button`,e,{state:{open:v},ref:[t,C,b],props:[oe,se,w||j!==`none`?F:void 0,{onMouseOver(e){ce(e.nativeEvent)},onFocus(e){ie(M$(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){N.current=!1,P.clear(),ne.current=void 0},onPointerEnter(e){ne.current=e.pointerType},onPointerDown(e){ne.current=e.pointerType,h.set(`closeOnClick`,l),l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!h.select(`open`)&&h.cancelPendingOpen(e.nativeEvent)},id:g,"data-trigger-disabled":A?``:void 0,[j$]:A?void 0:``},p],stateAttributesMapping:bY})}),F$=f.createContext(void 0);function I$(){let e=f.useContext(F$);if(e===void 0)throw Error(oW(70));return e}var L$=f.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=cX({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,F.jsxs)(f.Fragment,{children:[l,c&&KJ.createPortal(n,c)]})}),R$=f.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return S$().useState(`mounted`)||n?(0,F.jsx)(F$.Provider,{value:n,children:(0,F.jsx)(L$,{ref:t,...r})}):null}),z$=f.createContext(void 0);function B$(){let e=f.useContext(z$);if(e===void 0)throw Error(oW(71));return e}var V$=f.createContext(void 0);function H$(){return f.useContext(V$)?.direction??`ltr`}var U$=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=qq(e,t)||{};if(l==null)return{};let f=dJ(u),p={x:n,y:r},m=$q(i),h=Zq(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,ee=Math.min(f[v],E),D=Math.min(f[y],E),O=ee,k=w-g[h]-D,A=w/2-g[h]/2+T,te=Kq(O,A,k),j=!c.arrow&&Yq(i)!=null&&A!==te&&a.reference[h]/2-(A<O?ee:D)-g[h]/2<0,M=j?A<O?A-O:A-k:0;return{[m]:p[m]+M,data:{[m]:te,centerOffset:A-te-M,...j&&{alignmentOffset:M}},reset:j}}}),W$=(e,t)=>({...U$(e),options:[e,t]}),G$={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},K$={sideX:`left`,sideY:`top`},q$=`--available-width`,J$=`--available-height`;function Y$(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function X$(e,t,n){let{rects:r,placement:i}=e;return{side:Y$(t,Jq(i),n),align:Yq(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Z$(e){return Q$(e,xQ)}function Q$(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:p=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,[w,T]=f.useState(null);!_&&w!==null&&T(null);let E=v.side||`flip`,ee=v.align||`flip`,D=v.fallbackAxisSide||`end`,O=y?.crossAxis??!1,k=y?.rootBoundary,A=typeof n==`function`?n:void 0,te=zK(A),j=A?te:n,M=IY(n),N=IY(_),P=H$()===`rtl`,ne=w||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],re=o===`center`?ne:`${ne}-${o}`,ie=l;typeof ie==`number`?ie={top:ie,right:ie,bottom:ie,left:ie}:ie&&={top:ie.top||0,right:ie.right||0,bottom:ie.bottom||0,left:ie.left||0};let ae=+(i===`bottom`),oe=+(i===`top`),se=+(i===`right`),ce=+(i===`left`),F={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:ie},le=f.useRef(null),ue=IY(a),de=IY(s),fe=typeof a==`function`?0:a,pe=typeof s==`function`?0:s,me=[];m&&me.push(m),me.push(OZ(e=>{let t=X$(e,i,P),n=typeof ue.current==`function`?ue.current(t):ue.current,r=typeof de.current==`function`?de.current(t):de.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[fe,pe,P,i]));let he=ee===`none`&&E!==`shift`,ge=!he&&(u||O||E===`shift`),_e=E===`none`?null:jZ({...F,padding:{top:ie.top+1+ae,right:ie.right+1+ce,bottom:ie.bottom+1+oe,left:ie.left+1+se},mainAxis:!O&&E===`flip`,crossAxis:ee===`flip`&&`alignment`,fallbackAxisSideDirection:D}),ve=he?null:kZ({...F,rootBoundary:k,mainAxis:ee!==`none`,crossAxis:ge,limiter:u||O?void 0:AZ(e=>{if(!le.current)return{};let{width:t,height:n}=le.current.getBoundingClientRect(),r=Qq(Jq(e.placement)),i=r===`y`?t:n,a=r===`y`?ie.left+ie.right:ie.top+ie.bottom;return{offset:i/2+a/2}})},[F,u,O,k,ie,ee]);E===`shift`||ee===`shift`||o===`center`?me.push(ve,_e):me.push(_e,ve),me.push(MZ({...F,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(q$,`${t}px`),i.setProperty(J$,`${n}px`);let a=pK(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),W$(e=>({element:le.current||KK(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:r,rects:o,y:s}=e,c=Jq(r),l=Qq(c),u=le.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(X$(e,i,P)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,ge&&l===`y`&&b?S:x),{}}},G$,x),HK(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let ye=f.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<`u`,layoutShift:!p&&typeof IntersectionObserver<`u`}),[p]),{refs:be,elements:xe,x:Se,y:Ce,middlewareData:we,update:Te,placement:Ee,context:De,isPositioned:Oe,floatingStyles:ke}=t({rootContext:g,open:h?_:void 0,placement:re,middleware:me,strategy:r,whileElementsMounted:h?void 0:(...e)=>hZ(...e,ye),nodeId:b,externalTree:C}),{sideX:Ae,sideY:je}=we.adaptiveOrigin||K$,Me=Oe?r:`fixed`,Ne=f.useMemo(()=>{let e;return e=Oe?x?{position:Me,[Ae]:Se,[je]:Ce}:{...ke,position:Me}:{position:Me,top:0,left:0},e[q$]=`100vw`,e[J$]=`100vh`,Oe||(e.opacity=0),e},[x,Me,Ae,Se,je,Ce,ke,Oe]),Pe=f.useRef(null);HK(()=>{if(!_)return;let e=M.current,t=typeof e==`function`?e():e,n=($$(t)?t.current:t)||null;n!==Pe.current&&(be.setPositionReference(n),Pe.current=n)},[_,be,j,M]),f.useEffect(()=>{if(!_)return;let e=M.current;typeof e!=`function`&&$$(e)&&e.current!==Pe.current&&(be.setPositionReference(e.current),Pe.current=e.current)},[_,be,j,M]),f.useEffect(()=>{if(h&&_&&xe.reference&&xe.floating)return hZ(xe.reference,xe.floating,Te,ye)},[h,_,xe,Te,ye]);let Fe=Jq(Ee),Ie=Y$(i,Fe,P),Le=Yq(Ee)||`center`,Re=!!we.hide?.referenceHidden;HK(()=>{S&&_&&Oe&&Fe!==ne&&T(Fe)},[S,_,Oe,Fe,ne]);let ze=f.useMemo(()=>({position:`absolute`,top:we.arrow?.y,left:we.arrow?.x}),[we.arrow]),Be=we.arrow?.centerOffset!==0;return f.useMemo(()=>({positionerStyles:Ne,arrowStyles:ze,arrowRef:le,arrowUncentered:Be,side:Ie,align:Le,physicalSide:Fe,anchorHidden:Re,refs:be,context:De,isPositioned:Oe,update:Te}),[Ne,ze,le,Be,Ie,Le,Fe,Re,be,De,Oe,Te])}function $$(e){return e!=null&&`current`in e}function e1(e){return e===`starting`?nX:bW}function t1(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),wW(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},e1(r),i],stateAttributesMapping:xY})}var n1=f.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=rX,style:_,...v}=e,y=S$(),b=I$(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`trackCursorAxis`),w=y.useState(`disableHoverablePopup`),T=y.useState(`floatingRootContext`),E=y.useState(`instantType`),ee=y.useState(`transitionStatus`),D=Z$({anchor:i,positionMethod:a,floatingRootContext:T,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:m,arrowPadding:p,disableAnchorTracking:h,keepMounted:b,collisionAvoidance:g,adaptiveOrigin:y.useState(`adaptiveOrigin`)}),O=t1(e,f.useMemo(()=>({open:x,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[x,D.side,D.align,D.anchorHidden,C,E]),{styles:D.positionerStyles,transitionStatus:ee,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x||C===`both`||w});return(0,F.jsx)(z$.Provider,{value:D,children:O})}),r1=f.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=S$(),{side:s,align:c}=B$(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);JJ({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),AQ(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return wW(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[ZZ,f,e1(d),a],stateAttributesMapping:SY})}),i1=f.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=S$(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=B$();return wW(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:xY})});function a1({...e}){return(0,F.jsx)(D$,{"data-slot":`tooltip`,...e})}function o1({...e}){return(0,F.jsx)(P$,{"data-slot":`tooltip-trigger`,...e})}function s1({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,F.jsx)(R$,{children:(0,F.jsx)(n1,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,F.jsxs)(r1,{"data-slot":`tooltip-content`,className:Q(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,F.jsx)(i1,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var c1=`sidebar_state`,l1=604800,u1=`16rem`,d1=`18rem`,f1=`3rem`,p1=`b`,m1=f.createContext(null);function h1(){let e=f.useContext(m1);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function g1({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=RW(),[c,l]=f.useState(!1),[u,d]=f.useState(e),p=t??u,m=f.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):d(t),document.cookie=`${c1}=${t}; path=/; max-age=${l1}`},[n,p]),h=f.useCallback(()=>s?l(e=>!e):m(e=>!e),[s,m,l]);f.useEffect(()=>{let e=e=>{e.key===p1&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,_=f.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:h}),[g,p,m,s,c,l,h]);return(0,F.jsx)(m1.Provider,{value:_,children:(0,F.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":u1,"--sidebar-width-icon":f1,...i},className:Q(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})}function _1({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=h1();return n===`none`?(0,F.jsx)(`div`,{"data-slot":`sidebar`,className:Q(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,F.jsx)(m$,{open:l,onOpenChange:u,...o,children:(0,F.jsxs)(_$,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":d1},side:e,children:[(0,F.jsxs)(v$,{className:`sr-only`,children:[(0,F.jsx)(y$,{children:`Sidebar`}),(0,F.jsx)(b$,{children:`Displays the mobile sidebar.`})]}),(0,F.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,F.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,F.jsx)(`div`,{"data-slot":`sidebar-gap`,className:Q(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,F.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:Q(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,F.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function v1({className:e,onClick:t,...n}){let{toggleSidebar:r}=h1();return(0,F.jsxs)($K,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:Q(e),onClick:e=>{t?.(e),r()},...n,children:[(0,F.jsx)(ne,{}),(0,F.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function y1({className:e,...t}){return(0,F.jsx)(`main`,{"data-slot":`sidebar-inset`,className:Q(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function b1({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:Q(`flex flex-col gap-2 p-2`,e),...t})}function x1({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:Q(`flex flex-col gap-2 p-2`,e),...t})}function S1({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:Q(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function C1({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:Q(`relative flex w-full min-w-0 flex-col px-2 py-1`,e),...t})}function w1({className:e,render:t,...n}){return AW({defaultTagName:`div`,props:GU({className:Q(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,e)},n),render:t,state:{slot:`sidebar-group-label`,sidebar:`group-label`}})}function T1({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:Q(`w-full text-xs`,e),...t})}function E1({className:e,...t}){return(0,F.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:Q(`flex w-full min-w-0 flex-col gap-px`,e),...t})}function D1({className:e,...t}){return(0,F.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:Q(`group/menu-item relative`,e),...t})}var O1=IW(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-[calc(var(--radius-sm)+2px)] p-2 text-left text-xs ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-xs`,sm:`h-7 text-xs`,lg:`h-12 text-xs group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function k1({render:e,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let{isMobile:s,state:c}=h1(),l=AW({defaultTagName:`button`,props:GU({className:Q(O1({variant:n,size:r}),a)},o),render:i?(0,F.jsx)(o1,{render:e}):e,state:{slot:`sidebar-menu-button`,sidebar:`menu-button`,size:r,active:t}});return i?(typeof i==`string`&&(i={children:i}),(0,F.jsxs)(a1,{children:[l,(0,F.jsx)(s1,{side:`right`,align:`center`,hidden:c!==`collapsed`||s,...i})]})):l}function A1({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:Q(`pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-[calc(var(--radius-sm)-2px)] px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground`,e),...t})}function j1({className:e,...t}){return(0,F.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:Q(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden`,e),...t})}function M1({className:e,...t}){return(0,F.jsx)(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:Q(`group/menu-sub-item relative`,e),...t})}function N1({render:e,size:t=`md`,isActive:n=!1,className:r,...i}){return AW({defaultTagName:`a`,props:GU({className:Q(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-xs data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,r)},i),render:e,state:{slot:`sidebar-menu-sub-button`,sidebar:`menu-sub-button`,size:t,active:n}})}var P1=({projects:e,view:t,project:n,needsYou:r,live:i})=>(0,F.jsxs)(_1,{variant:`inset`,children:[(0,F.jsx)(b1,{children:(0,F.jsx)(E1,{children:(0,F.jsx)(D1,{children:(0,F.jsxs)(k1,{size:`lg`,render:(0,F.jsx)(Fa,{to:`/`,search:{}}),children:[(0,F.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-md bg-primary font-heading text-sm font-semibold text-primary-foreground`,"aria-hidden":`true`,children:`U`}),(0,F.jsx)(`span`,{className:`font-heading text-sm font-medium`,children:`Usine`})]})})})}),(0,F.jsxs)(S1,{children:[(0,F.jsx)(C1,{children:(0,F.jsx)(T1,{children:(0,F.jsx)(E1,{children:(0,F.jsxs)(D1,{children:[(0,F.jsxs)(k1,{isActive:t===`projects`&&n===void 0,render:(0,F.jsx)(Fa,{to:`/`,search:{}}),children:[(0,F.jsx)(M,{"aria-hidden":`true`}),(0,F.jsx)(`span`,{children:`Projects`})]}),r>0&&(0,F.jsx)(A1,{className:`font-mono text-needs-you`,children:r}),e.length>0&&(0,F.jsx)(j1,{children:e.map(e=>(0,F.jsx)(M1,{children:(0,F.jsxs)(N1,{isActive:n===e.repository,render:(0,F.jsx)(Fa,{to:`/`,search:{project:e.repository}}),children:[(0,F.jsx)(`span`,{className:`truncate`,children:e.repository}),e.status===`needs-you`&&(0,F.jsx)(ae,{weight:`fill`,className:`ml-auto text-needs-you`,"aria-label":`Needs you`})]})},e.repository))})]})})})}),(0,F.jsxs)(C1,{children:[(0,F.jsx)(w1,{children:`Configuration`}),(0,F.jsx)(T1,{children:(0,F.jsx)(E1,{children:(0,F.jsx)(D1,{children:(0,F.jsxs)(k1,{isActive:t===`configuration`,render:(0,F.jsx)(Fa,{to:`/`,search:{view:`configuration`}}),children:[(0,F.jsx)(re,{"aria-hidden":`true`}),(0,F.jsx)(`span`,{children:`Loops`})]})})})})]})]}),(0,F.jsx)(x1,{children:(0,F.jsxs)(`div`,{className:Q(`flex items-center gap-2 px-2 py-1 font-mono text-[0.625rem]`,i?`text-run-succeeded`:`text-muted-foreground`),children:[(0,F.jsx)(j,{weight:`fill`,className:`size-2`,"aria-hidden":`true`}),i?`live`:`idle`]})})]}),F1=IW(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2 py-1.5 text-left text-xs/relaxed has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-1.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-3.5`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function I1({className:e,variant:t,...n}){return(0,F.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:Q(F1({variant:t}),e),...n})}function L1({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`alert-title`,className:Q(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function R1({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`alert-description`,className:Q(`text-xs/relaxed text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}var z1=({title:e,message:t,className:n})=>(0,F.jsxs)(I1,{variant:`destructive`,className:Q(`wrap-anywhere`,n),children:[(0,F.jsx)(oe,{weight:`fill`}),e!==void 0&&(0,F.jsx)(L1,{children:e}),(0,F.jsx)(R1,{children:t})]}),B1=IW(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-2.5!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border bg-input/20 text-foreground dark:bg-input/30 [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function V1({className:e,variant:t=`default`,render:n,...r}){return AW({defaultTagName:`span`,props:GU({className:Q(B1({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var H1=e=>{switch(e){case`Succeeded`:case`clear`:return`text-run-succeeded`;case`Running`:case`Pending`:case`active`:return`text-run-active`;case`Waiting`:case`Failed`:case`needs-you`:return`text-needs-you`;default:return`text-muted-foreground`}},U1=({state:e})=>(0,F.jsxs)(V1,{variant:`outline`,"aria-label":e,className:Q(`font-mono`,H1(e)),children:[(0,F.jsx)(j,{weight:`fill`,"aria-hidden":`true`}),e]}),W1=({count:e})=>(0,F.jsx)(V1,{variant:`outline`,className:`border-needs-you/40 font-mono text-needs-you`,children:e===void 0||e===0?`Needs you`:`${e} need you`});function G1({className:e,...t}){return(0,F.jsx)(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,className:Q(e),...t})}function K1({className:e,...t}){return(0,F.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:Q(`flex flex-wrap items-center gap-1.5 text-xs/relaxed wrap-break-word text-muted-foreground`,e),...t})}function q1({className:e,...t}){return(0,F.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:Q(`inline-flex items-center gap-1`,e),...t})}function J1({className:e,render:t,...n}){return AW({defaultTagName:`a`,props:GU({className:Q(`transition-colors hover:text-foreground`,e)},n),render:t,state:{slot:`breadcrumb-link`}})}function Y1({className:e,...t}){return(0,F.jsx)(`span`,{"data-slot":`breadcrumb-page`,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:Q(`font-normal text-foreground`,e),...t})}function X1({children:e,className:t,...n}){return(0,F.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:Q(`[&>svg]:size-3.5`,t),...n,children:e??(0,F.jsx)(te,{})})}function Z1({className:e,size:t=`default`,...n}){return(0,F.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:Q(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-xs/relaxed text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,e),...n})}function Q1({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-header`,className:Q(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function $1({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-title`,className:Q(`font-heading text-sm font-medium`,e),...t})}function e0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-description`,className:Q(`text-xs/relaxed text-muted-foreground`,e),...t})}function t0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-action`,className:Q(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,e),...t})}function n0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`card-content`,className:Q(`px-(--card-spacing)`,e),...t})}function r0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`empty`,className:Q(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,e),...t})}function i0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`empty-header`,className:Q(`flex max-w-sm flex-col items-center gap-1`,e),...t})}var a0=IW(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-8 shrink-0 items-center justify-center rounded-md bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function o0({className:e,variant:t=`default`,...n}){return(0,F.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:Q(a0({variant:t,className:e})),...n})}function s0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`empty-title`,className:Q(`font-heading text-sm font-medium tracking-tight`,e),...t})}function c0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`empty-description`,className:Q(`text-xs/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function l0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`empty-content`,className:Q(`flex w-full max-w-sm min-w-0 flex-col items-center gap-2 text-xs/relaxed text-balance`,e),...t})}function u0({className:e,...t}){return(0,F.jsx)(`div`,{role:`list`,"data-slot":`item-group`,className:Q(`group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2`,e),...t})}var d0=IW(`group/item flex w-full flex-wrap items-center rounded-md border text-xs/relaxed transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted`,{variants:{variant:{default:`border-transparent`,outline:`border-border`,muted:`border-transparent bg-muted/50`},size:{default:`gap-2.5 px-3 py-2.5`,sm:`gap-2.5 px-3 py-2.5`,xs:`gap-2.5 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0`}},defaultVariants:{variant:`default`,size:`default`}});function f0({className:e,variant:t=`default`,size:n=`default`,render:r,...i}){return AW({defaultTagName:`div`,props:GU({className:Q(d0({variant:t,size:n,className:e}))},i),render:r,state:{slot:`item`,variant:t,size:n}})}function p0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`item-content`,className:Q(`flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0.5 [&+[data-slot=item-content]]:flex-none`,e),...t})}function m0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`item-title`,className:Q(`line-clamp-1 flex w-fit items-center gap-2 text-xs/relaxed leading-snug font-medium underline-offset-4`,e),...t})}function h0({className:e,...t}){return(0,F.jsx)(`p`,{"data-slot":`item-description`,className:Q(`line-clamp-2 text-left text-xs/relaxed font-normal text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function g0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`item-header`,className:Q(`flex basis-full items-center justify-between gap-2`,e),...t})}function _0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`item-footer`,className:Q(`flex basis-full items-center justify-between gap-2`,e),...t})}function v0({className:e,...t}){return(0,F.jsx)(ie,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:Q(`size-4 animate-spin`,e),...t})}function y0({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,F.jsx)(`table`,{"data-slot":`table`,className:Q(`w-full caption-bottom text-xs`,e),...t})})}function b0({className:e,...t}){return(0,F.jsx)(`thead`,{"data-slot":`table-header`,className:Q(`[&_tr]:border-b`,e),...t})}function x0({className:e,...t}){return(0,F.jsx)(`tbody`,{"data-slot":`table-body`,className:Q(`[&_tr:last-child]:border-0`,e),...t})}function S0({className:e,...t}){return(0,F.jsx)(`tr`,{"data-slot":`table-row`,className:Q(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function C0({className:e,...t}){return(0,F.jsx)(`th`,{"data-slot":`table-head`,className:Q(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function w0({className:e,...t}){return(0,F.jsx)(`td`,{"data-slot":`table-cell`,className:Q(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}var T0=V({ok:Nw(!0)}),E0=fw(V({error:B,message:B})),D0=async e=>{let t=await e.text();try{let e=JSON.parse(t);if(E0(e))return e.message}catch{}return t||`Request failed with status ${e.status}`},O0=async(e,t,n)=>{let r=await fetch(e,n);if(!r.ok)throw Error(await D0(r));return bw(t)(await r.json())},k0=e=>`${e.harness} · ${e.model} · ${e.effort}`,A0=e=>xE(e,{InfraFailure:({message:e})=>e,AgentFailure:({message:e})=>e,RunawayFailure:({ceiling:e})=>`Runaway guard tripped its ${e} ceiling`}),j0=e=>xE(e,{ApprovalNeed:({loop:e,repository:t,runId:n})=>({title:`Approval required`,detail:`${e} is waiting to run on ${t}.`,repository:t,runId:n}),RunFailureNeed:({failure:e,repository:t,runId:n})=>({title:e._tag,detail:A0(e),repository:t,runId:n}),BoardProjectionNeed:({failure:e})=>({title:`Item projection quarantined`,detail:e.message,repository:e.repository,runId:null}),PollFailureNeed:({failure:e})=>({title:e.errorTag,detail:e.message,repository:e.repository,runId:null}),ScheduleFailureNeed:({failure:e})=>({title:e._tag===`ScheduleTickFailure`?e.errorTag:e._tag,detail:e.message,repository:e._tag===`ScheduleTickFailure`?e.repository:null,runId:null})}),M0=e=>JSON.stringify(e,null,2),N0=(e,t)=>pl(t,{onNone:()=>[],onSome:({usedPercent:t})=>[`${e} ${t}% used`]}),P0=e=>{let t=e.session,n={scope:t._tag===`ChildSession`?`child`:`parent`,sessionId:t.id,parentId:t._tag===`ChildSession`?t.parentId:null,agent:t.agent,detail:``,format:`plain`,isError:!1};return xE(e,{SessionStarted:()=>({...n,label:`${t.agent} started`,detail:k0(t.brain)}),TextOutput:({text:e})=>({...n,label:t.agent,detail:e,format:`markdown`}),ToolStarted:({tool:e,input:t})=>({...n,label:`${e} started`,detail:M0(t)}),ToolFinished:({tool:e,output:t,isError:r})=>({...n,label:`${e} ${r?`failed`:`finished`}`,detail:M0(t),isError:r}),PoolRateLimitsUpdated:({pool:e,rateLimits:t})=>({...n,label:`${e} rate limits updated`,detail:[...N0(`primary`,t.primary),...N0(`secondary`,t.secondary)].join(` · `)}),SessionFinished:()=>({...n,label:`${t.agent} finished`})})},F0=e=>({sequence:e.sequence,receivedAt:e.receivedAt,...xE(e.payload,{Started:({parentModel:e})=>({scope:`channel`,sessionId:null,parentId:null,agent:null,label:`Attempt started`,detail:e,format:`plain`,isError:!1}),SessionEvent:({event:e})=>P0(e),Final:({result:e})=>({scope:`channel`,sessionId:null,parentId:null,agent:null,label:`Attempt finished`,detail:e.message,format:`markdown`,isError:!1}),Failed:({failure:e})=>({scope:`channel`,sessionId:null,parentId:null,agent:null,label:e._tag,detail:A0(e),format:`plain`,isError:!0}),Interrupted:()=>({scope:`channel`,sessionId:null,parentId:null,agent:null,label:`Interrupted`,detail:`The run host acknowledged the interrupt.`,format:`plain`,isError:!1}),Steer:({message:e})=>({scope:`channel`,sessionId:null,parentId:null,agent:null,label:`Operator message`,detail:e,format:`markdown`,isError:!1}),Interrupt:()=>({scope:`channel`,sessionId:null,parentId:null,agent:null,label:`Interrupt`,detail:`The operator asked the run host to stop.`,format:`plain`,isError:!1})})}),I0=e=>{let t=e.runs.find(({state:e})=>e===`Failed`)??(e.run?.state===`Failed`?e.run:null);if(t===null)return null;let n=t.attempts;for(let e=n.length-1;e>=0;--e){let t=n[e]?.outcome;if(t?._tag===`Failed`)return A0(t.failure)}return null},L0=({item:e,draggable:t,beginDrag:n,endDrag:r,openRun:i})=>{let a=I0(e),o=e.run,s=e.runs.filter(({state:e})=>e===`Waiting`||e===`Failed`),c=s.length>0?s:o===null?[]:[o],l=`h-auto justify-start p-0 text-left text-xs/relaxed font-medium whitespace-normal text-card-foreground hover:text-primary`;return(0,F.jsxs)(Z1,{size:`sm`,className:Q(`gap-2.5`,t&&`cursor-grab active:cursor-grabbing`,e.needsYou&&`ring-needs-you/50`),draggable:t,onDragStart:t=>{t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e.number)),n(e.number)},onDragEnd:r,children:[(0,F.jsxs)(Q1,{className:`gap-0.5`,children:[(0,F.jsxs)(e0,{className:`font-mono`,children:[e.kind===`pr`?`PR`:`Issue`,` #`,e.number]}),(0,F.jsx)($1,{className:`font-sans text-xs/relaxed`,children:o===null?(0,F.jsx)($K,{variant:`link`,className:l,nativeButton:!1,render:(0,F.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`}),children:e.title}):(0,F.jsx)($K,{variant:`link`,className:l,onClick:()=>i(o.id),children:e.title})})]}),(e.labels.length>0||c.length>0||e.needsYou||a!==null)&&(0,F.jsxs)(n0,{className:`flex flex-col items-start gap-2`,children:[e.labels.length>0&&(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.labels.map(e=>(0,F.jsx)(V1,{variant:`outline`,children:e},e))}),c.map(e=>(0,F.jsxs)($K,{variant:`ghost`,size:`sm`,className:`-ml-2 gap-2`,onClick:()=>i(e.id),children:[(0,F.jsx)(U1,{state:e.state}),(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:e.agent})]},e.id)),e.needsYou&&(0,F.jsx)(W1,{}),a!==null&&(0,F.jsx)(`p`,{className:`text-destructive wrap-anywhere`,children:a}),s.some(({state:e})=>e===`Waiting`)&&(0,F.jsx)(`p`,{className:`text-needs-you`,children:`A run on this item is waiting for approval.`})]})]})},R0=({lane:e,dragged:t,pending:n,drop:r,beginDrag:i,endDrag:a,openRun:o})=>{let s=e._tag===`WritableBoardLane`;return(0,F.jsxs)(Z1,{size:`sm`,"aria-label":`${e.name} lane`,className:Q(`w-72 shrink-0 bg-muted/30 transition-shadow`,s&&t!==null&&`ring-run-active`),onDragOver:e=>{s&&!n&&e.preventDefault()},onDrop:i=>{i.preventDefault(),s&&t!==null&&!n&&r(t,e)},children:[(0,F.jsxs)(Q1,{children:[(0,F.jsx)($1,{className:`wrap-anywhere`,children:e.name}),(0,F.jsxs)(e0,{children:[e.items.length,` item`,e.items.length===1?``:`s`]}),(0,F.jsx)(t0,{children:(0,F.jsx)(V1,{variant:`secondary`,className:`font-mono`,children:e.origin})})]}),(0,F.jsxs)(n0,{className:`flex min-h-40 flex-col gap-2`,children:[e.items.length===0&&(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:`No items.`}),e.items.map(e=>(0,F.jsx)(L0,{item:e,draggable:!n,beginDrag:i,endDrag:a,openRun:o},e.itemKey))]})]})},z0=e=>{let t=new Set(e.board.lanes.flatMap(({items:e})=>e.map(({itemKey:e})=>e)));return e.runs.filter(({itemKey:e})=>!t.has(e))},B0=({runs:e,openRun:t})=>(0,F.jsxs)(Z1,{className:`max-w-5xl`,children:[(0,F.jsxs)(Q1,{children:[(0,F.jsx)($1,{children:`Runs without a card`}),(0,F.jsxs)(e0,{children:[e.length,` run`,e.length===1?``:`s`,` whose Item has no card on this board`]})]}),(0,F.jsx)(n0,{children:(0,F.jsxs)(y0,{children:[(0,F.jsx)(b0,{children:(0,F.jsxs)(S0,{children:[(0,F.jsx)(C0,{children:`Loop`}),(0,F.jsx)(C0,{children:`Agent`}),(0,F.jsx)(C0,{children:`Item`}),(0,F.jsx)(C0,{children:`State`}),(0,F.jsx)(C0,{className:`w-0`})]})}),(0,F.jsx)(x0,{children:e.map(e=>(0,F.jsxs)(S0,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,F.jsx)(w0,{className:`font-mono font-medium`,children:e.loop}),(0,F.jsx)(w0,{className:`font-mono`,children:e.agent}),(0,F.jsx)(w0,{className:`max-w-64 truncate font-mono`,children:e.itemKey}),(0,F.jsx)(w0,{children:(0,F.jsx)(U1,{state:e.state})}),(0,F.jsx)(w0,{className:`text-right`,children:(0,F.jsx)($K,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,F.jsx)(A,{"aria-hidden":`true`})})})]},e.id))})]})})]}),V0=({project:e,disabled:t,openRun:n})=>{let r=ue(),[i,a]=(0,f.useState)(null),o=z0(e),s=Mt({mutationFn:({item:t,lane:n})=>{let{owner:r,name:i}=rD(e.repository);return O0(`/api/projects/${encodeURIComponent(r)}/${encodeURIComponent(i)}/items/${t}/lane`,T0,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({toLane:n.id})})},onSuccess:()=>r.invalidateQueries({queryKey:[`overview`]}),onSettled:()=>a(null)});return(0,F.jsxs)(`main`,{className:`flex flex-col gap-4 px-4 py-6 sm:px-6`,children:[(0,F.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,F.jsx)(`h1`,{className:`font-heading text-xl font-medium wrap-anywhere`,children:e.repository}),e.status===`needs-you`&&(0,F.jsx)(W1,{})]}),e.board.failures.length>0&&(0,F.jsx)(z1,{className:`max-w-3xl`,title:`${e.board.failures.length} Item projection${e.board.failures.length===1?` was`:`s were`} quarantined`,message:e.board.failures.map(e=>e.message).join(`
267
+ `)}),(0,F.jsx)(`div`,{className:`flex gap-3 overflow-x-auto pb-3 overscroll-x-contain scrollbar-thin`,"aria-label":`${e.repository} project board`,children:e.board.lanes.map(e=>(0,F.jsx)(R0,{lane:e,dragged:i,pending:t||s.isPending,drop:(e,t)=>s.mutate({item:e,lane:t}),beginDrag:a,endDrag:()=>a(null),openRun:n},e.id))}),s.isError&&(0,F.jsx)(z1,{className:`max-w-3xl`,message:s.error.message}),o.length>0&&(0,F.jsx)(B0,{runs:o,openRun:n})]})};function H0(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var U0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,W0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,G0={};function K0(e,t){return((t||G0).jsx?W0:U0).test(e)}var q0=/[ \t\n\f\r]/g;function J0(e){return typeof e==`object`?e.type===`text`&&Y0(e.value):Y0(e)}function Y0(e){return e.replace(q0,``)===``}var X0=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};X0.prototype.normal={},X0.prototype.property={},X0.prototype.space=void 0;function Z0(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new X0(n,r,t)}function Q0(e){return e.toLowerCase()}var $0=class{constructor(e,t){this.attribute=t,this.property=e}};$0.prototype.attribute=``,$0.prototype.booleanish=!1,$0.prototype.boolean=!1,$0.prototype.commaOrSpaceSeparated=!1,$0.prototype.commaSeparated=!1,$0.prototype.defined=!1,$0.prototype.mustUseProperty=!1,$0.prototype.number=!1,$0.prototype.overloadedBoolean=!1,$0.prototype.property=``,$0.prototype.spaceSeparated=!1,$0.prototype.space=void 0;var e2=s({boolean:()=>n2,booleanish:()=>r2,commaOrSpaceSeparated:()=>s2,commaSeparated:()=>o2,number:()=>$,overloadedBoolean:()=>i2,spaceSeparated:()=>a2}),t2=0,n2=c2(),r2=c2(),i2=c2(),$=c2(),a2=c2(),o2=c2(),s2=c2();function c2(){return 2**++t2}var l2=Object.keys(e2),u2=class extends $0{constructor(e,t,n,r){let i=-1;if(super(e,t),d2(this,`space`,r),typeof n==`number`)for(;++i<l2.length;){let e=l2[i];d2(this,l2[i],(n&e2[e])===e2[e])}}};u2.prototype.defined=!0;function d2(e,t,n){n&&(e[t]=n)}function f2(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new u2(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Q0(r)]=r,n[Q0(a.attribute)]=r}return new X0(t,n,e.space)}var p2=f2({properties:{ariaActiveDescendant:null,ariaAtomic:r2,ariaAutoComplete:null,ariaBusy:r2,ariaChecked:r2,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:a2,ariaCurrent:null,ariaDescribedBy:a2,ariaDetails:null,ariaDisabled:r2,ariaDropEffect:a2,ariaErrorMessage:null,ariaExpanded:r2,ariaFlowTo:a2,ariaGrabbed:r2,ariaHasPopup:null,ariaHidden:r2,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:a2,ariaLevel:$,ariaLive:null,ariaModal:r2,ariaMultiLine:r2,ariaMultiSelectable:r2,ariaOrientation:null,ariaOwns:a2,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:r2,ariaReadOnly:r2,ariaRelevant:null,ariaRequired:r2,ariaRoleDescription:a2,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:r2,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function m2(e,t){return t in e?e[t]:t}function h2(e,t){return m2(e,t.toLowerCase())}var g2=f2({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:o2,acceptCharset:a2,accessKey:a2,action:null,allow:null,allowFullScreen:n2,allowPaymentRequest:n2,allowUserMedia:n2,alpha:n2,alt:null,as:null,async:n2,autoCapitalize:null,autoComplete:a2,autoFocus:n2,autoPlay:n2,blocking:a2,capture:null,charSet:null,checked:n2,cite:null,className:a2,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:r2,controls:n2,controlsList:a2,coords:$|o2,crossOrigin:null,data:null,dateTime:null,decoding:null,default:n2,defer:n2,dir:null,dirName:null,disabled:n2,download:i2,draggable:r2,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:n2,formTarget:null,headers:a2,height:$,hidden:i2,high:$,href:null,hrefLang:null,htmlFor:a2,httpEquiv:a2,id:null,imageSizes:null,imageSrcSet:null,inert:n2,inputMode:null,integrity:null,is:null,isMap:n2,itemId:null,itemProp:a2,itemRef:a2,itemScope:n2,itemType:a2,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:n2,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:n2,muted:n2,name:null,nonce:null,noModule:n2,noValidate:n2,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:n2,optimum:$,pattern:null,ping:a2,placeholder:null,playsInline:n2,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:n2,referrerPolicy:null,rel:a2,required:n2,reversed:n2,rows:$,rowSpan:$,sandbox:a2,scope:null,scoped:n2,seamless:n2,selected:n2,shadowRootClonable:n2,shadowRootCustomElementRegistry:n2,shadowRootDelegatesFocus:n2,shadowRootMode:null,shadowRootSerializable:n2,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:r2,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:n2,useMap:null,value:r2,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:a2,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:n2,declare:n2,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:n2,noHref:n2,noShade:n2,noWrap:n2,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:r2,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:n2,disablePictureInPicture:n2,disableRemotePlayback:n2,exportParts:o2,part:a2,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:h2}),_2=f2({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`,maskType:`mask-type`,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:s2,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:a2,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:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:n2,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,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:o2,g2:o2,glyphName:o2,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:s2,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,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:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:a2,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:s2,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:s2,rev:s2,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:s2,requiredFeatures:s2,requiredFonts:s2,requiredFormats:s2,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:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:s2,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:s2,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:s2,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:m2}),v2=f2({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()}}),y2=f2({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:h2}),b2=f2({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),x2={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`},S2=/[A-Z]/g,C2=/-[a-z]/g,w2=/^data[-\w.:]+$/i;function T2(e,t){let n=Q0(t),r=t,i=$0;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&w2.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(C2,D2);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!C2.test(e)){let n=e.replace(S2,E2);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=u2}return new i(r,t)}function E2(e){return`-`+e.toLowerCase()}function D2(e){return e.charAt(1).toUpperCase()}var O2=Z0([p2,g2,v2,y2,b2],`html`),k2=Z0([p2,_2,v2,y2,b2],`svg`);function A2(e){return e.join(` `).trim()}var j2=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
268
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),M2=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(j2());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),N2=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),P2=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(M2()),r=N2();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),F2=L2(`end`),I2=L2(`start`);function L2(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function R2(e){let t=I2(e),n=F2(e);if(t&&n)return{start:t,end:n}}function z2(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?V2(e.position):`start`in e||`end`in e?V2(e):`line`in e||`column`in e?B2(e):``}function B2(e){return H2(e&&e.line)+`:`+H2(e&&e.column)}function V2(e){return B2(e&&e.start)+`-`+B2(e&&e.end)}function H2(e){return e&&typeof e==`number`?e:1}var U2=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=z2(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};U2.prototype.file=``,U2.prototype.name=``,U2.prototype.reason=``,U2.prototype.message=``,U2.prototype.stack=``,U2.prototype.column=void 0,U2.prototype.line=void 0,U2.prototype.ancestors=void 0,U2.prototype.cause=void 0,U2.prototype.fatal=void 0,U2.prototype.place=void 0,U2.prototype.ruleId=void 0,U2.prototype.source=void 0;var W2=l(P2(),1),G2={}.hasOwnProperty,K2=new Map,q2=/[A-Z]/g,J2=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Y2=new Set([`td`,`th`]),X2=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Z2(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=c4(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=s4(n,t.jsx,t.jsxs)}let 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`?k2:O2,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Q2(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Q2(e,t,n){if(t.type===`element`)return $2(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return e4(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return n4(e,t,n);if(t.type===`mdxjsEsm`)return t4(e,t);if(t.type===`root`)return r4(e,t,n);if(t.type===`text`)return i4(e,t)}function $2(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=k2,e.schema=i),e.ancestors.push(t);let a=m4(e,t.tagName,!1),o=l4(e,t),s=d4(e,t);return J2.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!J0(e)})),a4(e,o,a,t),o4(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function e4(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}h4(e,t.position)}function t4(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);h4(e,t.position)}function n4(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=k2,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:m4(e,t.name,!0),o=u4(e,t),s=d4(e,t);return a4(e,o,a,t),o4(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function r4(e,t,n){let r={};return o4(r,d4(e,t)),e.create(t,e.Fragment,r,n)}function i4(e,t){return t.value}function a4(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function o4(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function s4(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function c4(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=I2(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function l4(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&G2.call(t.properties,i)){let a=f4(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Y2.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function u4(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else h4(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else h4(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function d4(e,t){let n=[],r=-1,i=e.passKeys?new Map:K2;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Q2(e,a,o);s!==void 0&&n.push(s)}return n}function f4(e,t,n){let r=T2(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?H0(n):A2(n)),r.property===`style`){let t=typeof n==`object`?n:p4(e,String(n));return e.stylePropertyNameCase===`css`&&(t=g4(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?x2[r.property]||r.property:r.attribute,n]}}function p4(e,t){try{return(0,W2.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new U2("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=X2+`#cannot-parse-style-attribute`,r}}function m4(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=K0(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=K0(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return G2.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);h4(e)}function h4(e,t){let n=new U2("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=X2+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function g4(e){let t={},n;for(n in e)G2.call(e,n)&&(t[_4(n)]=e[n]);return t}function _4(e){let t=e.replace(q2,v4);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function v4(e){return`-`+e.toLowerCase()}var y4={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`]},b4={};function x4(e,t){let n=t||b4;return S4(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function S4(e,t,n){if(w4(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 C4(e.children,t,n)}return Array.isArray(e)?C4(e,t,n):``}function C4(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=S4(e[i],t,n);return r.join(``)}function w4(e){return!!(e&&typeof e==`object`)}var T4=document.createElement(`i`);function E4(e){let t=`&`+e+`;`;T4.innerHTML=t;let n=T4.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function D4(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+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 O4(e,t){return e.length>0?(D4(e,e.length,0,t),e):t}var k4={}.hasOwnProperty;function A4(e){let t={},n=-1;for(;++n<e.length;)j4(t,e[n]);return t}function j4(e,t){let n;for(n in t){let r=(k4.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){k4.call(r,a)||(r[a]=[]);let e=i[a];M4(r[a],Array.isArray(e)?e:e?[e]:[])}}}function M4(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);D4(e,0,0,r)}function N4(e,t){let 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 P4(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var F4=q4(/[A-Za-z]/),I4=q4(/[\dA-Za-z]/),L4=q4(/[#-'*+\--9=?A-Z^-~]/);function R4(e){return e!==null&&(e<32||e===127)}var z4=q4(/\d/),B4=q4(/[\dA-Fa-f]/),V4=q4(/[!-/:-@[-`{-~]/);function H4(e){return e!==null&&e<-2}function U4(e){return e!==null&&(e<0||e===32)}function W4(e){return e===-2||e===-1||e===32}var G4=q4(/\p{P}|\p{S}/u),K4=q4(/\s/);function q4(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function J4(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&I4(e.charCodeAt(n+1))&&I4(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){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Y4(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return W4(r)?(e.enter(n),s(r)):t(r)}function s(r){return W4(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var X4={tokenize:Z4};function Z4(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Y4(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return H4(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Q4={tokenize:e3},$4={tokenize:t3};function e3(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return D4(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($4,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt($4,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return H4(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;D4(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function t3(e,t,n){return Y4(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function n3(e){if(e===null||U4(e)||K4(e))return 1;if(G4(e))return 2}function r3(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var i3={name:`attention`,resolveAll:a3,tokenize:o3};function a3(e,t){let n=-1,r,i,a,o,s,c,l,u;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;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};s3(d,-c),s3(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=O4(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=O4(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=O4(l,r3(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=O4(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=O4(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,D4(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function o3(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=n3(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=n3(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function s3(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var c3={name:`autolink`,tokenize:l3};function l3(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return F4(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||I4(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||I4(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||R4(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):L4(t)?(e.consume(t),l):n(t)}function u(e){return I4(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||I4(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var u3={partial:!0,tokenize:d3};function d3(e,t,n){return r;function r(t){return W4(t)?Y4(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||H4(e)?t(e):n(e)}}var f3={continuation:{tokenize:m3},exit:h3,name:`blockQuote`,tokenize:p3};function p3(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return W4(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function m3(e,t,n){let r=this;return i;function i(t){return W4(t)?Y4(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(f3,t,n)(r)}}function h3(e){e.exit(`blockQuote`)}var g3={name:`characterEscape`,tokenize:_3};function _3(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return V4(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var v3={name:`characterReference`,tokenize:y3};function y3(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=I4,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=B4,u):(e.enter(`characterReferenceValue`),a=7,o=z4,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===I4&&!E4(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var b3={partial:!0,tokenize:C3},x3={concrete:!0,name:`codeFenced`,tokenize:S3};function S3(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),W4(t)?Y4(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||H4(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(b3,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||H4(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):W4(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Y4(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||H4(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||H4(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&W4(t)?Y4(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||H4(t)?e.check(b3,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||H4(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),W4(t)?Y4(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),W4(t)?Y4(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||H4(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function C3(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var w3={name:`codeIndented`,tokenize:E3},T3={partial:!0,tokenize:D3};function E3(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Y4(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):H4(t)?e.attempt(T3,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||H4(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function D3(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):H4(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Y4(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):H4(e)?i(e):n(e)}}var O3={name:`codeText`,previous:A3,resolve:k3,tokenize:j3};function k3(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 A3(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function j3(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):H4(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||H4(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var M3=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&N3(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),N3(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),N3(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);N3(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);N3(this.left,t.reverse())}}}};function N3(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 P3(e){let t={},n=-1,r,i,a,o,s,c,l,u=new M3(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,F3(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.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={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return D4(e,0,1/0,u.slice(0)),!l}function F3(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var I3={resolve:R3,tokenize:z3},L3={partial:!0,tokenize:B3};function R3(e){return P3(e),e}function z3(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):H4(t)?e.check(L3,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function B3(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y4(e,a,`linePrefix`)}function a(i){if(i===null||H4(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function V3(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||R4(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||H4(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||U4(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||R4(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function H3(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):H4(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||H4(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!W4(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function U3(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):H4(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Y4(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||H4(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function W3(e,t){let n;return r;function r(i){return H4(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):W4(i)?Y4(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var G3={name:`definition`,tokenize:q3},K3={partial:!0,tokenize:J3};function q3(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return H3.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=P4(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return U4(t)?W3(e,l)(t):l(t)}function l(t){return V3(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(K3,d,d)(t)}function d(t){return W4(t)?Y4(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||H4(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function J3(e,t,n){return r;function r(t){return U4(t)?W3(e,i)(t):n(t)}function i(t){return U3(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return W4(t)?Y4(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||H4(e)?t(e):n(e)}}var Y3={name:`hardBreakEscape`,tokenize:X3};function X3(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return H4(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Z3={name:`headingAtx`,resolve:Q3,tokenize:$3};function Q3(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`},D4(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function $3(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||U4(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||H4(n)?(e.exit(`atxHeading`),t(n)):W4(n)?Y4(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||U4(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var e6=`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`.split(`.`),t6=[`pre`,`script`,`style`,`textarea`],n6={concrete:!0,name:`htmlFlow`,resolveTo:a6,tokenize:o6},r6={partial:!0,tokenize:c6},i6={partial:!0,tokenize:s6};function a6(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 o6(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):F4(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):F4(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return F4(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||U4(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&t6.includes(l)?(i=1,r.interrupt?t(s):D(s)):e6.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||I4(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return W4(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||F4(t)?(e.consume(t),b):W4(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||I4(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):W4(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):W4(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||H4(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||U4(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||W4(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||H4(t)?D(t):W4(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),te):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),N):H4(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(r6,re,O)(t)):t===null||H4(t)?(e.exit(`htmlFlowData`),O(t)):(e.consume(t),D)}function O(t){return e.check(i6,k,re)(t)}function k(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),A}function A(t){return t===null||H4(t)?O(t):(e.enter(`htmlFlowData`),D(t))}function te(t){return t===45?(e.consume(t),P):D(t)}function j(t){return t===47?(e.consume(t),o=``,M):D(t)}function M(t){if(t===62){let n=o.toLowerCase();return t6.includes(n)?(e.consume(t),ne):D(t)}return F4(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),M):D(t)}function N(t){return t===93?(e.consume(t),P):D(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):D(t)}function ne(t){return t===null||H4(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function s6(e,t,n){let r=this;return i;function i(t){return H4(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function c6(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(u3,t,n)}}var l6={name:`htmlText`,tokenize:u6};function u6(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):F4(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):F4(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):H4(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?te(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):H4(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?te(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?te(t):H4(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):H4(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?te(e):y(e)}function x(t){return F4(t)?(e.consume(t),S):n(t)}function S(t){return t===45||I4(t)?(e.consume(t),S):C(t)}function C(t){return H4(t)?(o=C,j(t)):W4(t)?(e.consume(t),C):te(t)}function w(t){return t===45||I4(t)?(e.consume(t),w):t===47||t===62||U4(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),te):t===58||t===95||F4(t)?(e.consume(t),E):H4(t)?(o=T,j(t)):W4(t)?(e.consume(t),T):te(t)}function E(t){return t===45||t===46||t===58||t===95||I4(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):H4(t)?(o=ee,j(t)):W4(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,O):H4(t)?(o=D,j(t)):W4(t)?(e.consume(t),D):(e.consume(t),k)}function O(t){return t===i?(e.consume(t),i=void 0,A):t===null?n(t):H4(t)?(o=O,j(t)):(e.consume(t),O)}function k(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||U4(t)?T(t):(e.consume(t),k)}function A(e){return e===47||e===62||U4(e)?T(e):n(e)}function te(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),M}function M(t){return W4(t)?Y4(e,N,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):N(t)}function N(t){return e.enter(`htmlTextData`),o(t)}}var d6={name:`labelEnd`,resolveAll:h6,resolveTo:g6,tokenize:_6},f6={tokenize:v6},p6={tokenize:y6},m6={tokenize:b6};function h6(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&D4(e,0,e.length,n),e}function g6(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);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=O4(s,e.slice(a+1,a+r+3)),s=O4(s,[[`enter`,u,t]]),s=O4(s,r3(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=O4(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=O4(s,e.slice(o+1)),s=O4(s,[[`exit`,c,t]]),D4(e,a,e.length,s),e}function _6(e,t,n){let r=this,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(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(P4(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(f6,u,o?u:d)(t):t===91?e.attempt(p6,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(m6,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function v6(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return U4(t)?W3(e,a)(t):a(t)}function a(t){return t===41?u(t):V3(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return U4(t)?W3(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?U3(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return U4(t)?W3(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function y6(e,t,n){let r=this;return i;function i(t){return H3.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(P4(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function b6(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var x6={name:`labelStartImage`,resolveAll:d6.resolveAll,tokenize:S6};function S6(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var C6={name:`labelStartLink`,resolveAll:d6.resolveAll,tokenize:w6};function w6(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var T6={name:`lineEnding`,tokenize:E6};function E6(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Y4(e,t,`linePrefix`)}}var D6={name:`thematicBreak`,tokenize:O6};function O6(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||H4(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),W4(t)?Y4(e,s,`whitespace`)(t):s(t))}}var k6={continuation:{tokenize:N6},exit:F6,name:`list`,tokenize:M6},A6={partial:!0,tokenize:I6},j6={partial:!0,tokenize:P6};function M6(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:z4(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(D6,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return z4(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(u3,r.interrupt?n:u,e.attempt(A6,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return W4(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function N6(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(u3,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Y4(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!W4(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(j6,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Y4(e,e.attempt(k6,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function P6(e,t,n){let r=this;return Y4(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function F6(e){e.exit(this.containerState.type)}function I6(e,t,n){let r=this;return Y4(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!W4(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var L6={name:`setextUnderline`,resolveTo:R6,tokenize:z6};function R6(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);let 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 z6(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),W4(t)?Y4(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||H4(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var B6={tokenize:V6};function V6(e){let t=this,n=e.attempt(u3,r,e.attempt(this.parser.constructs.flowInitial,i,Y4(e,e.attempt(this.parser.constructs.flow,i,e.attempt(I3,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var H6={resolveAll:K6()},U6=G6(`string`),W6=G6(`text`);function G6(e){return{resolveAll:K6(e===`text`?q6:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function K6(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function q6(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||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={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var J6=s({attentionMarkers:()=>n8,contentInitial:()=>X6,disable:()=>r8,document:()=>Y6,flow:()=>Q6,flowInitial:()=>Z6,insideSpan:()=>t8,string:()=>$6,text:()=>e8}),Y6={42:k6,43:k6,45:k6,48:k6,49:k6,50:k6,51:k6,52:k6,53:k6,54:k6,55:k6,56:k6,57:k6,62:f3},X6={91:G3},Z6={[-2]:w3,[-1]:w3,32:w3},Q6={35:Z3,42:D6,45:[L6,D6],60:n6,61:L6,95:D6,96:x3,126:x3},$6={38:v3,92:g3},e8={[-5]:T6,[-4]:T6,[-3]:T6,33:x6,38:v3,42:i3,60:[c3,l6],91:C6,92:[Y3,g3],93:d6,95:i3,96:O3},t8={null:[i3,H6]},n8={null:[42,95]},r8={null:[]};function i8(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=O4(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=r3(a,l.events,l),l.events):[]}function f(e,t){return o8(p(e),t)}function p(e){return a8(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){H4(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&D4(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function a8(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function o8(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
269
+ `;break;case-3:o=`\r
270
+ `;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 s8(e){let t={constructs:A4([J6,...(e||{}).extensions||[]]),content:n(X4),defined:[],document:n(Q4),flow:n(B6),lazy:{},string:n(U6),text:n(W6)};return t;function n(e){return n;function n(n){return i8(t,e,n)}}}function c8(e){for(;!P3(e););return e}var l8=/[\0\t\n\r]/g;function u8(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(l8.lastIndex=u,c=l8.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var d8=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function f8(e){return e.replace(d8,p8)}function p8(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return N4(n.slice(t?2:1),t?16:10)}return E4(n)||e}var m8={}.hasOwnProperty;function h8(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),g8(n)(c8(s8(n).document().write(u8()(e,t,!0))))}function g8(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ye),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(he),blockQuote:a(ue),characterEscape:T,characterReference:T,codeFenced:a(de),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(de,o),codeText:a(fe,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(pe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(me),hardBreakEscape:a(ge),hardBreakTrailing:a(ge),htmlFlow:a(_e,o),htmlFlowData:T,htmlText:a(_e,o),htmlTextData:T,image:a(ve),label:o,link:a(ye),listItem:a(xe),listItemValue:f,listOrdered:a(be,d),listUnordered:a(be),paragraph:a(Se),reference:ie,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(he),strong:a(Ce),thematicBreak:a(Te)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:le,autolinkProtocol:F,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:se,characterReference:ce,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(A),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(O),htmlFlowData:E,htmlText:c(k),htmlTextData:E,image:c(j),label:N,labelText:M,lineEnding:ee,link:c(te),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ae,resourceDestinationString:P,resourceTitleString:ne,resource:re,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};v8(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];m8.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||b8).call(a,void 0,e[0])}for(r.position={start:_8(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:_8(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:_8(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||b8).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+z2({start:e.start,end:e.end})+`): it’s not open`);n.position.end=_8(e.end)}function u(){return x4(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=P4(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=we(),n.position={start:_8(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=_8(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=_8(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function O(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=f8(t),n.identifier=P4(t).toLowerCase()}function N(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function re(){this.data.inReference=void 0}function ie(){this.data.referenceType=`collapsed`}function ae(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=P4(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function oe(e){this.data.characterReferenceType=e.type}function se(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=N4(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=E4(t);let i=this.stack[this.stack.length-1];i.value+=r}function ce(e){let t=this.stack.pop();t.position.end=_8(e.end)}function F(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function le(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ue(){return{type:`blockquote`,children:[]}}function de(){return{type:`code`,lang:null,meta:null,value:``}}function fe(){return{type:`inlineCode`,value:``}}function pe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function me(){return{type:`emphasis`,children:[]}}function he(){return{type:`heading`,depth:0,children:[]}}function ge(){return{type:`break`}}function _e(){return{type:`html`,value:``}}function ve(){return{type:`image`,title:null,url:``,alt:null}}function ye(){return{type:`link`,title:null,url:``,children:[]}}function be(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function xe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Se(){return{type:`paragraph`,children:[]}}function Ce(){return{type:`strong`,children:[]}}function we(){return{type:`text`,value:``}}function Te(){return{type:`thematicBreak`}}}function _8(e){return{line:e.line,column:e.column,offset:e.offset}}function v8(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?v8(e,r):y8(e,r)}}function y8(e,t){let n;for(n in t)if(m8.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function b8(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+z2({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+z2({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+z2({start:t.start,end:t.end})+`) is still open`)}function x8(e){let t=this;t.parser=n;function n(n){return h8(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function S8(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function C8(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
271
+ `}]}function w8(e,t){let n=t.value?t.value+`
272
+ `:``,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 T8(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function E8(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D8(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=J4(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),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);let c={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,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function O8(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k8(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function A8(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function j8(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return A8(e,t);let i={src:J4(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function M8(e,t){let n={src:J4(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function N8(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function P8(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return A8(e,t);let i={href:J4(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function F8(e,t){let n={href:J4(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function I8(e,t,n){let r=e.all(t),i=n?L8(n):R8(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.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;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
273
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
274
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function L8(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=R8(n[r])}return t}function R8(e){return e.spread??e.children.length>1}function z8(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let 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 B8(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function V8(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function H8(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function U8(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=I2(t.children[1]),o=F2(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function W8(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function G8(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var K8=9,q8=32;function J8(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Y8(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Y8(t.slice(i),i>0,!1)),a.join(``)}function Y8(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===K8||t===q8;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===K8||t===q8;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function X8(e,t){let n={type:`text`,value:J8(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Z8(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Q8={blockquote:S8,break:C8,code:w8,delete:T8,emphasis:E8,footnoteReference:D8,heading:O8,html:k8,imageReference:j8,image:M8,inlineCode:N8,linkReference:P8,link:F8,listItem:I8,list:z8,paragraph:B8,root:V8,strong:H8,table:U8,tableCell:G8,tableRow:W8,text:X8,thematicBreak:Z8,toml:$8,yaml:$8,definition:$8,footnoteDefinition:$8};function $8(){}var{defineProperty:e5}=Object,t5=typeof self==`object`?self:globalThis,n5=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new t5[e](t)},r5=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?e5(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof t5[e]==`function`?n5(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(n5(a,o),i)};return r},i5=e=>r5(new Map,e)(0),a5=``,{toString:o5}={},{keys:s5,is:c5}=Object,l5=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=o5.call(e).slice(8,-1);switch(n){case`Array`:return[1,a5];case`Object`:return[2,a5];case`Date`:return[3,a5];case`RegExp`:return[4,a5];case`Map`:return[5,a5];case`Set`:return[6,a5];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},u5=([e,t])=>e===0&&(t===`function`||t===`symbol`),d5=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=l5(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&c5(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of s5(o))(e||!u5(l5(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?a5:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(u5(l5(n))||u5(l5(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!u5(l5(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},f5=(e,{json:t,lossy:n}={})=>{let r=[];return d5(!(t||n),!!t,new Map,r)(e),r},p5=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?i5(f5(e,t)):structuredClone(e):(e,t)=>i5(f5(e,t));function m5(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function h5(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function g5(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||m5,r=e.options.footnoteBackLabel||h5,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=J4(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...p5(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
275
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
276
+ `}]}}var _5=(function(e){if(e==null)return S5;if(typeof e==`function`)return x5(e);if(typeof e==`object`)return Array.isArray(e)?v5(e):y5(e);if(typeof e==`string`)return b5(e);throw Error(`Expected function, string, or object as test`)});function v5(e){let t=[],n=-1;for(;++n<e.length;)t[n]=_5(e[n]);return x5(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function y5(e){let t=e;return x5(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function b5(e){return x5(t);function t(t){return t&&t.type===e}}function x5(e){return t;function t(t,n,r){return!!(C5(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function S5(){return!0}function C5(e){return typeof e==`object`&&!!e&&`type`in e}function w5(e){return e}var T5=[];function E5(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=_5(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+w5(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=T5,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=D5(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function D5(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?T5:[e]}function O5(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),E5(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var k5={}.hasOwnProperty,A5={};function j5(e,t){let n=t||A5,r=new Map,i=new Map,a={all:s,applyData:N5,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Q8,...n.handlers},one:o,options:n,patch:M5,wrap:F5};return O5(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(k5.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=p5(n);return r.children=a.all(e),r}return p5(e)}return(a.options.unknownHandler||P5)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=I5(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=I5(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function M5(e,t){e.position&&(t.position=R2(e))}function N5(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,p5(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function P5(e,t){let n=t.data||{},r=`value`in t&&!(k5.call(n,`hProperties`)||k5.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 F5(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
277
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
278
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
279
+ `}),n}function I5(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function L5(e,t){let n=j5(e,t),r=n.one(e,void 0),i=g5(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
280
+ `},i)),a}function R5(e,t){return e&&`run`in e?async function(n,r){let i=L5(n,{file:r,...t});await e.run(i,r)}:function(n,r){return L5(n,{file:r,...e||t})}}function z5(e){if(e)throw e}var B5=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function V5(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function H5(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?U5(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function U5(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var W5={basename:G5,dirname:K5,extname:q5,join:J5,sep:`/`};function G5(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Z5(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 K5(e){if(Z5(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||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function q5(e){Z5(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let 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 J5(...e){let t=-1,n;for(;++t<e.length;)Z5(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Y5(n)}function Y5(e){Z5(e);let t=e.codePointAt(0)===47,n=X5(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function X5(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else 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(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),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 Z5(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Q5={cwd:$5};function $5(){return`/`}function e7(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function t7(e){if(typeof e==`string`)e=new URL(e);else if(!e7(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return n7(e)}function n7(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var r7=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],i7=class{constructor(e){let t;t=e?e7(e)?{path:e}:typeof e==`string`||c7(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Q5.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<r7.length;){let e=r7[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)r7.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?W5.basename(this.path):void 0}set basename(e){o7(e,`basename`),a7(e,`basename`),this.path=W5.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?W5.dirname(this.path):void 0}set dirname(e){s7(this.basename,`dirname`),this.path=W5.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?W5.extname(this.path):void 0}set extname(e){if(a7(e,`extname`),s7(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=W5.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){e7(e)&&(e=t7(e)),o7(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?W5.basename(this.path,this.extname):void 0}set stem(e){o7(e,`stem`),a7(e,`stem`),this.path=W5.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new U2(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function a7(e,t){if(e&&e.includes(W5.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+W5.sep+"`")}function o7(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function s7(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function c7(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var l7=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),u7=l(B5(),1),d7={}.hasOwnProperty,f7=new class e extends l7{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=H5()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,u7.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(h7(`data`,this.frozen),this.namespace[e]=t,this):d7.call(this.namespace,e)&&this.namespace[e]||void 0:e?(h7(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=v7(e),n=this.parser||this.Parser;return p7(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),p7(`process`,this.parser||this.Parser),m7(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=v7(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);b7(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),p7(`processSync`,this.parser||this.Parser),m7(`processSync`,this.compiler||this.Compiler),this.process(e,r),_7(`processSync`,`process`,t),n;function r(e,r){t=!0,z5(e),n=r}}run(e,t,n){g7(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=v7(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),_7(`runSync`,`run`,n),r;function i(e,t){z5(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=v7(t),r=this.compiler||this.Compiler;return m7(`stringify`,r),g7(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(h7(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,u7.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];V5(o)&&V5(r)&&(r=(0,u7.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function p7(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function m7(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function h7(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function g7(e){if(!V5(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function _7(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function v7(e){return y7(e)?e:new i7(e)}function y7(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function b7(e){return typeof e==`string`||x7(e)}function x7(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var S7=[],C7={allowDangerousHtml:!0},w7=/^(https?|ircs?|mailto|xmpp)$/i,T7=[{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 E7(e){let t=D7(e),n=O7(e);return k7(t.runSync(t.parse(n),n),e)}function D7(e){let t=e.rehypePlugins||S7,n=e.remarkPlugins||S7,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...C7}:C7;return f7().use(x8).use(n).use(R5,r).use(t)}function O7(e){let t=e.children||``,n=new i7;return typeof t==`string`?n.value=t:``+t,n}function k7(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||A7;for(let e of T7)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return O5(e,l),Z2(e,{Fragment:F.Fragment,components:i,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in y4)if(Object.hasOwn(y4,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=y4[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function A7(e){let 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||w7.test(e.slice(0,t))?e:``}function j7(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function M7(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function N7(e,t,n){let r=_5((n||{}).ignore||[]),i=P7(t),a=-1;for(;++a<i.length;)E5(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function P7(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([F7(e[0]),I7(e[1])])}return t}function F7(e){return typeof e==`string`?new RegExp(M7(e),`g`):e}function I7(e){return typeof e==`function`?e:function(){return e}}var L7=`phrasing`,R7=[`autolink`,`link`,`image`,`label`];function z7(){return{transforms:[q7],enter:{literalAutolink:V7,literalAutolinkEmail:H7,literalAutolinkHttp:H7,literalAutolinkWww:H7},exit:{literalAutolink:K7,literalAutolinkEmail:G7,literalAutolinkHttp:U7,literalAutolinkWww:W7}}}function B7(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:L7,notInConstruct:R7},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:L7,notInConstruct:R7},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:L7,notInConstruct:R7}]}}function V7(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function H7(e){this.config.enter.autolinkProtocol.call(this,e)}function U7(e){this.config.exit.autolinkProtocol.call(this,e)}function W7(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function G7(e){this.config.exit.autolinkEmail.call(this,e)}function K7(e){this.exit(e)}function q7(e){N7(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,J7],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ote]],{ignore:[`link`,`linkReference`]})}function J7(e,t,n,r,i){let a=``;if(!Y7(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!ste(n)))return!1;let o=cte(n+r);if(!o[0])return!1;let 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 ote(e,t,n,r){return!Y7(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function ste(e){let 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 cte(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=j7(e,`(`),a=j7(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 Y7(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||K4(n)||G4(n))&&(!t||n!==47)}X7.peek=_te;function lte(){this.buffer()}function ute(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function dte(){this.buffer()}function fte(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function pte(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=P4(this.sliceSerialize(e)).toLowerCase(),n.label=t}function mte(e){this.exit(e)}function hte(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=P4(this.sliceSerialize(e)).toLowerCase(),n.label=t}function gte(e){this.exit(e)}function _te(){return`[`}function X7(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),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 vte(){return{enter:{gfmFootnoteCallString:lte,gfmFootnoteCall:ute,gfmFootnoteDefinitionLabelString:dte,gfmFootnoteDefinition:fte},exit:{gfmFootnoteCallString:pte,gfmFootnoteCall:mte,gfmFootnoteDefinitionLabelString:hte,gfmFootnoteDefinition:gte}}}function yte(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:X7},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
281
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Z7:bte))),s(),o}}function bte(e,t,n){return t===0?e:Z7(e,t,n)}function Z7(e,t,n){return(n?``:` `)+e}var xte=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Q7.peek=Ete;function Ste(){return{canContainEols:[`delete`],enter:{strikethrough:wte},exit:{strikethrough:Tte}}}function Cte(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:xte}],handlers:{delete:Q7}}}function wte(e){this.enter({type:`delete`,children:[]},e)}function Tte(e){this.exit(e)}function Q7(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Ete(){return`~`}function Dte(e){return e.length}function Ote(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Dte,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=kte(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=$7(r[d]);else{let e=$7(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
282
+ `)}function kte(e){return e==null?``:String(e)}function $7(e){let 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 Ate(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),jte);return i(),o}function jte(e,t,n){return`>`+(n?``:` `)+e}function Mte(e,t){return e9(e,t.inConstruct,!0)&&!e9(e,t.notInConstruct,!1)}function e9(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 t9(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
283
+ `&&Mte(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
284
+ `}function Nte(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw 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 Pte(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 Fte(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Ite(e,t,n,r){let i=Fte(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Pte(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Lte);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Nte(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
285
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
286
+ `),a&&(u+=s.move(a+`
287
+ `)),u+=s.move(c),l(),u}function Lte(e,t,n){return(n?``:` `)+e}function n9(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Rte(e,t,n,r){let i=n9(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
288
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function zte(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function r9(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function i9(e,t,n){let r=n3(e),i=n3(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}}a9.peek=Bte;function a9(e,t,n,r){let i=zte(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=i9(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=r9(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=i9(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+r9(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Bte(e,t,n){return n.options.emphasis||`*`}function Vte(e,t){let n=!1;return O5(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&x4(e)&&(t.options.setext||n))}function Hte(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Vte(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
289
+ `,after:`
290
+ `});return r(),t(),o+`
291
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
292
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
293
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=r9(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}o9.peek=Ute;function o9(e){return e.value||``}function Ute(){return`<`}s9.peek=Wte;function s9(e,t,n,r){let i=n9(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Wte(){return`!`}c9.peek=Gte;function c9(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Gte(){return`!`}l9.peek=Kte;function l9(e,t,n){let r=e.value||``,i="`",a=-1;for(;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;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Kte(){return"`"}function u9(e,t){let n=x4(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))}d9.peek=qte;function d9(e,t,n,r){let i=n9(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(u9(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function qte(e,t,n){return u9(e,n)?`<`:`[`}f9.peek=Jte;function f9(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Jte(){return`[`}function p9(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Yte(e){let t=p9(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Xte(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function m9(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Zte(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Xte(n):p9(n),s=e.ordered?o===`.`?`)`:`.`:Yte(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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&&(c=!0),m9(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Qte(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function $te(e,t,n,r){let i=Qte(n),a=n.bulletCurrent||p9(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);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function ene(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var tne=_5([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function nne(e,t,n,r){return(e.children.some(function(e){return tne(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function rne(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}h9.peek=ine;function h9(e,t,n,r){let i=rne(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=i9(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=r9(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=i9(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+r9(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function ine(e,t,n){return n.options.strong||`*`}function ane(e,t,n,r){return n.safe(e.value,r)}function one(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function sne(e,t,n){let r=(m9(n)+(n.options.ruleSpaces?` `:``)).repeat(one(n));return n.options.ruleSpaces?r.slice(0,-1):r}var g9={blockquote:Ate,break:t9,code:Ite,definition:Rte,emphasis:a9,hardBreak:t9,heading:Hte,html:o9,image:s9,imageReference:c9,inlineCode:l9,link:d9,linkReference:f9,list:Zte,listItem:$te,paragraph:ene,root:nne,strong:h9,text:ane,thematicBreak:sne};function cne(){return{enter:{table:lne,tableData:v9,tableHeader:v9,tableRow:dne},exit:{codeText:fne,table:une,tableData:_9,tableHeader:_9,tableRow:_9}}}function lne(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function une(e){this.exit(e),this.data.inTable=void 0}function dne(e){this.enter({type:`tableRow`,children:[]},e)}function _9(e){this.exit(e)}function v9(e){this.enter({type:`tableCell`,children:[]},e)}function fne(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,pne));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function pne(e,t){return t===`|`?t:e}function mne(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
294
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
295
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Ote(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=g9.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function hne(){return{exit:{taskListCheckValueChecked:y9,taskListCheckValueUnchecked:y9,paragraph:_ne}}}function gne(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:vne}}}function y9(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function _ne(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function vne(e,t,n,r){let 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 c=g9.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function yne(){return[z7(),vte(),Ste(),cne(),hne()]}function bne(e){return{extensions:[B7(),yte(e),Cte(),mne(e),gne()]}}var xne={tokenize:Dne,partial:!0},b9={tokenize:One,partial:!0},x9={tokenize:kne,partial:!0},S9={tokenize:Ane,partial:!0},Sne={tokenize:jne,partial:!0},C9={name:`wwwAutolink`,tokenize:Tne,previous:O9},w9={name:`protocolAutolink`,tokenize:Ene,previous:k9},T9={name:`emailAutolink`,tokenize:wne,previous:A9},E9={};function Cne(){return{text:E9}}for(var D9=48;D9<123;)E9[D9]=T9,D9++,D9===58?D9=65:D9===91&&(D9=97);E9[43]=T9,E9[45]=T9,E9[46]=T9,E9[95]=T9,E9[72]=[T9,w9],E9[104]=[T9,w9],E9[87]=[T9,C9],E9[119]=[T9,C9];function wne(e,t,n){let r=this,i,a;return o;function o(t){return!j9(t)||!A9.call(r,r.previous)||M9(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return j9(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Sne,u,l)(t):t===45||t===95||I4(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&F4(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Tne(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!O9.call(r,r.previous)||M9(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(xne,e.attempt(b9,e.attempt(x9,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Ene(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&k9.call(r,r.previous)&&!M9(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(F4(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||R4(t)||U4(t)||K4(t)||G4(t)?n(t):e.attempt(b9,e.attempt(x9,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Dne(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function One(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(S9,c,s)(t):t===null||U4(t)||K4(t)||t!==45&&G4(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function kne(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(S9,t,a)(o):o===null||U4(o)||K4(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Ane(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||U4(o)||K4(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||U4(e)||K4(e)?t(e):r(e)}function a(e){return F4(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):F4(t)?(e.consume(t),o):n(t)}}function jne(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return I4(e)?n(e):t(e)}}function O9(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||U4(e)}function k9(e){return!F4(e)}function A9(e){return!(e===47||j9(e))}function j9(e){return e===43||e===45||e===46||e===95||I4(e)}function M9(e){let t=e.length,n=!1;for(;t--;){let 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}var Mne={tokenize:Bne,partial:!0};function Nne(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Lne,continuation:{tokenize:Rne},exit:zne}},text:{91:{name:`gfmFootnoteCall`,tokenize:Ine},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Pne,resolveTo:Fne}}}}function Pne(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=P4(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Fne(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`;let 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++;let 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 Ine(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||U4(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(P4(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return U4(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Lne(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||U4(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=P4(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return U4(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Y4(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Rne(e,t,n){return e.check(u3,t,e.attempt(Mne,t,n))}function zne(e){e.exit(`gfmFootnoteDefinition`)}function Bne(e,t,n){let r=this;return Y4(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Vne(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&D4(o,o.length,0,r3(s,e.slice(r+1,n),t)),D4(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),D4(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=n3(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=n3(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Hne=class{constructor(){this.map=[]}add(e,t,n){Une(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Une(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 Wne(e,t){let n=!1,r=[];for(;t<e.length;){let 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`){let e=r.length-1;r[e]=r[e]===`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 Gne(){return{flow:{null:{name:`table`,tokenize:Kne,resolveAll:qne}}}}function Kne(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):H4(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):W4(t)?Y4(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||U4(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,W4(t)?Y4(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return W4(t)?Y4(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||H4(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return W4(t)?Y4(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||H4(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||H4(n)?(e.exit(`tableRow`),t(n)):W4(n)?Y4(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||U4(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function qne(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Hne;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(P9(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=N9(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=N9(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=N9(f,t,o,i,n,d)):(o[0]=o[1],d=N9(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&P9(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Wne(t.events,n))}return e}function N9(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},F9(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=F9(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=F9(t.events,n[2]),a=F9(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},F9(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function P9(e,t,n,r,i){let a=[],o=F9(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 F9(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Jne={name:`tasklistCheck`,tokenize:Xne};function Yne(){return{text:{91:Jne}}}function Xne(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return U4(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return H4(r)?t(r):W4(r)?e.check({tokenize:Zne},t,n)(r):n(r)}}function Zne(e,t,n){return Y4(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Qne(e){return A4([Cne(),Nne(),Vne(e),Gne(),Yne()])}var $ne={};function ere(e){let t=this,n=e||$ne,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Qne(n)),a.push(yne()),o.push(bne(n))}var tre=[ere],nre={a:({node:e,...t})=>(0,F.jsx)(`a`,{...t,target:`_blank`,rel:`noreferrer`})},I9=({children:e,className:t})=>(0,F.jsx)(`div`,{className:Q(`typeset typeset-chat`,t),children:(0,F.jsx)(E7,{remarkPlugins:tre,components:nre,children:e})}),rre=IW(`group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full`,{variants:{variant:{default:`*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80`,secondary:`*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]`,muted:`*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]`,tinted:`*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]`,outline:`*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30`,ghost:`border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50`,destructive:`*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30`}},defaultVariants:{variant:`default`}});function ire({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,F.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:Q(rre({variant:e}),n),...r})}function L9({className:e,render:t,...n}){return AW({defaultTagName:`div`,props:GU({className:Q(`w-fit max-w-full min-w-0 overflow-hidden rounded-lg border border-transparent px-2.5 py-1.5 text-xs/relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-2 [button,a]:focus-visible:ring-ring/30`,e)},n),render:t,state:{slot:`bubble-content`}})}function are(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,[a,o]=eY({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=$J(a,!0,!0),u=iq(),[d,p]=f.useState(),m=d===null?void 0:d??u,h=zK(e=>{let t=!a,n=dY(nY,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return f.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:h,mounted:s,open:a,panelId:m,setMounted:c,setOpen:o,setPanelIdState:p,transitionStatus:l}),[u,i,h,s,a,m,c,o,p,l])}var R9=f.createContext(void 0);function z9(){let e=f.useContext(R9);if(e===void 0)throw Error(oW(15));return e}var B9=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=YJ.startingStyle]=`startingStyle`,e[e.endingStyle=YJ.endingStyle]=`endingStyle`,e}({}),ore=function(e){return e.panelOpen=`data-panel-open`,e}({}),sre={[B9.open]:``},cre={[B9.closed]:``},lre={open(e){return e?{[ore.panelOpen]:``}:null}},V9={open(e){return e?sre:cre},...QJ},ure=f.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=zK(o),d=are({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),p=f.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),m=f.useMemo(()=>({...d,onOpenChange:u,state:p}),[d,u,p]),h=wW(`div`,e,{state:p,ref:t,props:l,stateAttributesMapping:V9});return(0,F.jsx)(R9.Provider,{value:m,children:h})}),dre={...lre,...QJ},fre=f.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=z9(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=JK({disabled:c,focusableWhenDisabled:!0,native:u});return wW(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:dre})}),H9={height:void 0,width:void 0};function pre(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=f.useRef(null),p=f.useRef(null),[m,h]=f.useState(H9),g=f.useRef(H9),_=f.useRef(!1),v=f.useRef(s),y=f.useRef(!1),[b,x]=f.useState(!1),S=f.useRef(null),C=lW(t,d),w=IY(s),T=qJ(d),E=!s&&!a,ee=b?`idle`:u,D=s&&(v.current||y.current),O=!s&&a&&p.current===`css-animation`&&m.height===void 0&&m.width===void 0?g.current:m,k=n&&E&&p.current!==`css-animation`,A=zK((e,t=!0)=>{t&&(g.current=e),h(e)}),te=zK(()=>{S.current?.(),S.current=null}),j=zK(e=>{te(),S.current=()=>{S.current=null,e()}}),M=zK(()=>{s&&a&&p.current===`css-animation`&&(y.current=!0)});HK(()=>{!b||u===`starting`||x(!1)},[b,u]),f.useEffect(()=>()=>{M(),te()},[M,te]),HK(()=>{let e=d.current;if(!e)return;!s&&S.current&&te();let t=mre(e,D);if(p.current=t,s&&u===`idle`&&v.current&&t===`css-animation`){g.current=U9(e);return}if(s&&u===`starting`){let n=_.current;if(_.current=!1,t===`none`){A(U9(e)),x(!0);return}if(t===`css-transition`){let t=hre(e);if(A(U9(e)),!n)return t;let r=G9(e,`transition-duration`,`0s`);return j(r),x(!0),t}A(U9(e));let r=G9(e,`animation-name`,`none`);if(!n){r();return}let i=G9(e,`animation-duration`,`0s`);r(),j(i),x(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(v.current=!1,y.current=!1,t===`none`){A(H9,!1),c(!1);return}A(U9(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=U9(e);if(!(n.height>0||n.width>0)){c(!1);return}A(n),t===`css-animation`&&G9(e,`animation-name`,`none`)()},[a,s,te,A,c,j,D,u]),JJ({enabled:s&&a&&ee===`idle`,open:!0,ref:d,onComplete(){s&&A(H9,!1)}}),f.useEffect(()=>{if(s||!a||ee!==`ending`||!d.current)return;let e=new AbortController,t=-1;function n(){w.current||(c(!1),A(H9,!1))}return t=UJ.request(()=>{T(n,e.signal)}),()=>{UJ.cancel(t),e.abort()}},[w,a,s,ee,T,A,c]),HK(()=>{let e=d.current;!e||!n||!E||e.setAttribute(`hidden`,`until-found`)},[E,n]),f.useEffect(function(){let e=d.current;if(!e)return;function t(e){let t=dY(tY,e);o(!0,t),!t.isCanceled&&(_.current=!0,l(!0))}return PY(e,`beforematch`,t)},[o,l]);let N=i||n||a||s;return{height:O.height,props:{...k?{[B9.startingStyle]:``}:void 0,hidden:E,id:r},ref:C,shouldPreventOpenAnimation:D,shouldRender:N,transitionStatus:ee,width:O.width}}function U9(e){return{height:e.scrollHeight,width:e.scrollWidth}}function mre(e,t){let n=pK(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&W9(n.animationDuration),i=W9(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function W9(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function G9(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function hre(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=UJ.request(n);return()=>{UJ.cancel(r),n()}}var K9=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),gre=f.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=z9(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;HK(()=>(m(e=>b??(e===null?void 0:e)),()=>{m(e=>e===b?null:e)}),[b,m]);let{height:S,props:C,ref:w,shouldPreventOpenAnimation:T,shouldRender:E,transitionStatus:ee,width:D}=pre({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),O={...g,transitionStatus:ee},k=CW(s,O),A=wW(`div`,{...e,style:void 0},{state:O,ref:w,props:[C,{style:{[K9.collapsiblePanelHeight]:S===void 0?`auto`:`${S}px`,[K9.collapsiblePanelWidth]:D===void 0?`auto`:`${D}px`}},c,k?{style:k}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:V9});return E?A:null});function _re({...e}){return(0,F.jsx)(ure,{"data-slot":`collapsible`,...e})}function vre({...e}){return(0,F.jsx)(fre,{"data-slot":`collapsible-trigger`,...e})}function yre({...e}){return(0,F.jsx)(gre,{"data-slot":`collapsible-content`,...e})}function bre({className:e,align:t=`start`,...n}){return(0,F.jsx)(`div`,{"data-slot":`message`,"data-align":t,className:Q(`group/message relative flex w-full min-w-0 gap-1.5 text-xs/relaxed data-[align=end]:flex-row-reverse`,e),...n})}function xre({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`message-content`,className:Q(`flex w-full min-w-0 flex-col gap-2 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end`,e),...t})}function Sre({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`message-header`,className:Q(`flex max-w-full min-w-0 items-center px-2.5 text-[0.625rem] font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0`,e),...t})}var q9=(e,t)=>{let n=new Map(e.map(e=>[e.sequence,e]));for(let e of t)n.has(e.sequence)||n.set(e.sequence,e);return[...n.values()].sort((e,t)=>e.sequence-t.sequence)},Cre=(e,t,n)=>[...e.filter(({attemptId:e})=>e!==t),...n].sort((e,t)=>e.before-t.before),J9=({event:e})=>(0,F.jsx)(bre,{children:(0,F.jsxs)(xre,{children:[(0,F.jsxs)(Sre,{className:Q(`justify-between gap-3 px-0`,e.isError&&`text-destructive`),children:[(0,F.jsx)(`span`,{className:`truncate`,children:e.label}),(0,F.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,children:new Date(e.receivedAt).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})})]}),e.detail!==``&&(0,F.jsx)(ire,{variant:e.isError?`destructive`:`muted`,className:`max-w-full`,children:e.format===`markdown`?(0,F.jsx)(L9,{className:`w-full`,children:(0,F.jsx)(I9,{children:e.detail})}):(0,F.jsx)(L9,{render:(0,F.jsx)(`pre`,{}),className:`max-h-64 w-full overflow-y-auto font-mono text-[0.625rem]/relaxed whitespace-pre-wrap wrap-anywhere`,children:e.detail})})]})}),wre=({events:e})=>{let t=(0,f.useMemo)(()=>{let t=new Map,n=e.map(F0);for(let e of n){if(e.scope!==`child`||e.sessionId===null)continue;let n=t.get(e.sessionId);t.set(e.sessionId,{key:`child:${e.sessionId}`,sequence:Math.min(n?.sequence??e.sequence,e.sequence),agent:n?.agent??e.agent,events:[...n?.events??[],e]})}return[...n.filter(e=>e.scope!==`child`).map(e=>({key:`event:${e.sequence}`,sequence:e.sequence,event:e})),...t.values()].sort((e,t)=>e.sequence-t.sequence)},[e]);return t.length===0?(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:`No transcript events yet.`}):(0,F.jsx)(`div`,{className:`flex flex-col gap-3`,children:t.map(e=>`event`in e?(0,F.jsx)(J9,{event:e.event},e.key):(0,F.jsxs)(_re,{className:`rounded-md border`,children:[(0,F.jsxs)(vre,{render:(0,F.jsx)($K,{variant:`ghost`,size:`sm`,className:`w-full justify-between rounded-b-none font-mono data-[panel-open]:[&_svg]:rotate-90`}),children:[(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,F.jsx)(te,{className:`transition-transform`,"aria-hidden":`true`}),e.agent??`Child`,` activity`]}),(0,F.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.events.length,` events`]})]}),(0,F.jsx)(yre,{className:`flex flex-col gap-3 border-t p-2.5`,children:e.events.map(e=>(0,F.jsx)(J9,{event:e},e.sequence))})]},e.key))})},Tre=e=>{let t=Math.max(0,Date.now()-Date.parse(e));return t<6e4?`now`:t<36e5?`${Math.floor(t/6e4)}m`:t<864e5?`${Math.floor(t/36e5)}h`:`${Math.floor(t/864e5)}d`},Ere=e=>JSON.stringify(e,null,2),Y9=({title:e,children:t})=>(0,F.jsxs)(`section`,{className:`border-b px-6 py-4`,children:[(0,F.jsx)(`h3`,{className:`mb-2 font-heading text-[0.625rem] font-medium text-muted-foreground`,children:e}),t]}),Dre=({runId:e,close:t})=>{let n=ue(),[r,i]=(0,f.useState)(!1),a=jt({queryKey:[`run`,e],queryFn:async()=>{let t=[`run`,e],r=n.getQueryData(t)?.transcript.at(-1)?.sequence,i=r===void 0?``:`?after=${r}`,a=await O0(`/api/runs/${encodeURIComponent(e)}${i}`,FU),o=n.getQueryData(t);return r===void 0||o===void 0?a:new FU({...a,transcript:q9(o.transcript,a.transcript),earlierTranscript:o.earlierTranscript})},structuralSharing:!1,refetchInterval:e=>e.state.data?.run.canCancel===!0&&1e3}),o=Mt({mutationFn:t=>O0(`/api/runs/${encodeURIComponent(e)}/${t}`,T0,{method:`POST`}),onSuccess:async()=>{i(!1),await Promise.all([n.invalidateQueries({queryKey:[`overview`]}),n.invalidateQueries({queryKey:[`run`,e]})])}}),s=Mt({mutationFn:t=>O0(`/api/runs/${encodeURIComponent(e)}?attempt=${encodeURIComponent(t.attemptId)}&before=${t.before}`,FU),onSuccess:(t,r)=>{let i=[`run`,e];n.setQueryData(i,e=>e===void 0?e:new FU({...t,transcript:q9(e.transcript,t.transcript),earlierTranscript:Cre(e.earlierTranscript,r.attemptId,t.earlierTranscript)}))}}),c=a.data?.run,l=a.data?.earlierTranscript.at(-1);return(0,F.jsx)(m$,{open:!0,onOpenChange:e=>{e||t()},children:(0,F.jsxs)(_$,{side:`right`,"aria-label":`Run detail`,className:`gap-0 data-[side=right]:w-full data-[side=right]:sm:max-w-2xl`,children:[(0,F.jsxs)(v$,{className:`border-b pr-14`,children:[(0,F.jsx)(y$,{className:`text-lg`,children:c?.loop??`Loading…`}),c!==void 0&&(0,F.jsxs)(b$,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 font-mono wrap-anywhere`,children:[(0,F.jsx)(`span`,{children:c.repository}),(0,F.jsx)(`span`,{children:c.id}),c.loopPaused&&(0,F.jsx)(V1,{variant:`outline`,children:`paused`})]})]}),(0,F.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto scrollbar-thin`,children:[a.isError&&(0,F.jsx)(z1,{className:`m-6`,message:a.error.message}),c!==void 0&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b px-6 py-3`,children:[(0,F.jsx)(U1,{state:c.state}),(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:c.agent}),(0,F.jsxs)(`span`,{className:`text-muted-foreground`,children:[c.attempts.length,` attempt`,c.attempts.length===1?``:`s`]})]}),(c.canApprove||c.canRetry||c.canCancel)&&(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b px-6 py-3`,children:[c.canApprove&&(0,F.jsx)($K,{disabled:o.isPending,onClick:()=>o.mutate(`approve`),children:`Approve`}),c.canRetry&&(0,F.jsx)($K,{variant:`secondary`,disabled:o.isPending,onClick:()=>o.mutate(`retry`),children:`Retry`}),c.canCancel&&!r&&(0,F.jsx)($K,{variant:`outline`,disabled:o.isPending,onClick:()=>i(!0),children:`Cancel`}),c.canCancel&&r&&(0,F.jsx)($K,{variant:`destructive`,disabled:o.isPending,onClick:()=>o.mutate(`cancel`),children:`Confirm cancel`})]}),o.isError&&(0,F.jsx)(z1,{className:`mx-6 mt-4`,message:o.error.message}),(0,F.jsx)(Y9,{title:`Task`,children:(0,F.jsx)(I9,{className:`max-w-prose`,children:c.task})}),(0,F.jsxs)(Y9,{title:`Event`,children:[(0,F.jsx)(`p`,{className:`font-mono text-muted-foreground wrap-anywhere`,children:a.data?.eventDedupKey}),(0,F.jsx)(`pre`,{className:`mt-2 max-h-56 overflow-auto rounded-md bg-muted/50 px-2.5 py-2 font-mono text-[0.625rem]/relaxed whitespace-pre-wrap wrap-anywhere`,children:Ere(a.data?.eventPayload??null)})]}),(0,F.jsxs)(Y9,{title:`Attempts`,children:[c.attempts.length===0&&(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:`No attempt has started.`}),(0,F.jsx)(u0,{className:`gap-2`,children:c.attempts.map(e=>(0,F.jsxs)(f0,{variant:`muted`,size:`sm`,children:[(0,F.jsxs)(g0,{children:[(0,F.jsxs)(m0,{children:[`Attempt `,e.number]}),(0,F.jsx)(U1,{state:e.outcome?._tag??`Running`})]}),(0,F.jsxs)(p0,{children:[(0,F.jsxs)(h0,{className:`font-mono`,children:[e.worker,` · `,k0(e.brain),` ·`,` `,Tre(e.startedAt)]}),e.outcome?._tag===`Failed`&&(0,F.jsxs)(`p`,{className:`text-destructive wrap-anywhere`,children:[(0,F.jsx)(`strong`,{children:e.outcome.failure._tag}),` — ${A0(e.outcome.failure)}`]})]})]},e.id))})]}),c.resultMessage!==null&&(0,F.jsxs)(Y9,{title:`Result`,children:[(0,F.jsx)(I9,{className:`max-w-prose`,children:c.resultMessage}),c.pullRequestUrl!==null&&(0,F.jsxs)($K,{variant:`link`,className:`mt-2 px-0`,nativeButton:!1,render:(0,F.jsx)(`a`,{href:c.pullRequestUrl,target:`_blank`,rel:`noreferrer`}),children:[`Open pull request`,(0,F.jsx)(k,{"data-icon":`inline-end`,"aria-hidden":`true`})]})]}),(0,F.jsxs)(Y9,{title:`Transcript`,children:[l!==void 0&&(0,F.jsx)($K,{variant:`outline`,size:`sm`,className:`mb-3`,disabled:s.isPending,onClick:()=>s.mutate(l),children:s.isPending?`Loading…`:`Load earlier`}),s.isError&&(0,F.jsx)(z1,{className:`mb-3`,message:s.error.message}),(0,F.jsx)(wre,{events:a.data?.transcript??[]})]})]})]})]})})},Ore=dw(V({run:Aw(VD),project:Aw(eD),view:Aw(Nw(`configuration`))})),kre=2e3,Are=15e3,jre=()=>({queryKey:[`overview`],queryFn:()=>O0(`/api/overview`,IU),refetchInterval:e=>{let t=e.state.data;return t?._tag===`NeedsSetup`?!1:t?.projects.some(e=>e.runs.some(({canCancel:e})=>e))===!0?kre:Are}}),X9=({title:e,description:t,tone:n=`loading`,children:r})=>(0,F.jsx)(`main`,{className:`grid min-h-svh place-items-center p-6`,children:(0,F.jsxs)(r0,{className:`max-w-md`,children:[(0,F.jsxs)(i0,{children:[(0,F.jsx)(o0,{variant:`icon`,className:Q(n===`error`&&`text-destructive`),children:n===`loading`?(0,F.jsx)(v0,{}):(0,F.jsx)(oe,{weight:`fill`})}),(0,F.jsx)(s0,{children:e}),(0,F.jsx)(c0,{className:`wrap-anywhere`,children:t})]}),r!==void 0&&(0,F.jsx)(l0,{children:r})]})}),Mre=({needs:e,openRun:t})=>(0,F.jsxs)(`section`,{"aria-label":`Items needing intervention`,className:`border-b px-4 py-3 sm:px-6`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`h2`,{className:`font-heading text-sm font-medium`,children:`Needs you`}),e.length>0?(0,F.jsx)(V1,{className:`bg-needs-you font-mono text-background`,children:e.length}):(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:`No item needs intervention.`})]}),e.length>0&&(0,F.jsx)(`div`,{className:`mt-2 flex gap-2 overflow-x-auto pb-1 scrollbar-thin`,children:e.map(e=>{let n=j0(e),r=n.runId,i=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(p0,{children:[(0,F.jsx)(m0,{className:`line-clamp-1`,children:n.title}),(0,F.jsx)(h0,{className:`line-clamp-3 wrap-anywhere`,children:n.detail})]}),n.repository!==null&&(0,F.jsx)(_0,{className:`font-mono text-[0.625rem] text-muted-foreground`,children:n.repository})]});return r===null?(0,F.jsx)(f0,{variant:`muted`,size:`sm`,className:`w-80 shrink-0`,children:i},e.id):(0,F.jsx)(f0,{variant:`outline`,size:`sm`,className:`w-80 shrink-0 cursor-pointer text-left hover:bg-muted`,render:(0,F.jsx)(`button`,{type:`button`,onClick:()=>t(r)}),children:i},e.id)})})]}),Nre=({projects:e,open:t})=>(0,F.jsx)(`main`,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:(0,F.jsxs)(Z1,{className:`max-w-5xl`,children:[(0,F.jsxs)(Q1,{children:[(0,F.jsx)($1,{children:`Projects`}),(0,F.jsxs)(e0,{children:[e.length,` registered repositor`,e.length===1?`y`:`ies`]})]}),(0,F.jsx)(n0,{children:e.length===0?(0,F.jsx)(r0,{children:(0,F.jsxs)(i0,{children:[(0,F.jsx)(s0,{children:`No project registered`}),(0,F.jsxs)(c0,{children:[`Add a repository under `,(0,F.jsx)(`code`,{children:`repos`}),` in `,(0,F.jsx)(`code`,{children:`usine.yaml`}),` and restart`,` `,(0,F.jsx)(`code`,{children:`usine up`}),`.`]})]})}):(0,F.jsxs)(y0,{children:[(0,F.jsx)(b0,{children:(0,F.jsxs)(S0,{children:[(0,F.jsx)(C0,{children:`Repository`}),(0,F.jsx)(C0,{className:`text-right`,children:`Items`}),(0,F.jsx)(C0,{className:`text-right`,children:`Lanes`}),(0,F.jsx)(C0,{children:`Status`}),(0,F.jsx)(C0,{className:`w-0`})]})}),(0,F.jsx)(x0,{children:e.map(e=>{let n=e.board.lanes.reduce((e,t)=>e+t.items.length,0),r=e.board.lanes.reduce((e,t)=>e+t.items.filter(e=>e.needsYou).length,0);return(0,F.jsxs)(S0,{className:`cursor-pointer`,onClick:()=>t(e.repository),children:[(0,F.jsx)(w0,{className:`font-mono font-medium`,children:e.repository}),(0,F.jsx)(w0,{className:`text-right tabular-nums`,children:n}),(0,F.jsx)(w0,{className:`text-right tabular-nums`,children:e.board.lanes.length}),(0,F.jsx)(w0,{children:e.status===`needs-you`?(0,F.jsx)(W1,{count:r}):(0,F.jsx)(U1,{state:e.status})}),(0,F.jsx)(w0,{className:`text-right`,children:(0,F.jsx)($K,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open ${e.repository}`,onClick:n=>{n.stopPropagation(),t(e.repository)},children:(0,F.jsx)(O,{"aria-hidden":`true`})})})]},e.repository)})})]})})]})}),Pre=({loops:e,pending:t,act:n,error:r})=>(0,F.jsxs)(`main`,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,F.jsxs)(Z1,{className:`max-w-5xl`,children:[(0,F.jsxs)(Q1,{children:[(0,F.jsx)($1,{children:`Loops`}),(0,F.jsxs)(e0,{children:[e.length,` loop`,e.length===1?``:`s`]})]}),(0,F.jsx)(n0,{children:(0,F.jsxs)(y0,{children:[(0,F.jsx)(b0,{children:(0,F.jsxs)(S0,{children:[(0,F.jsx)(C0,{children:`Loop`}),(0,F.jsx)(C0,{children:`Trigger`}),(0,F.jsx)(C0,{children:`Agent`}),(0,F.jsx)(C0,{children:`State`}),(0,F.jsx)(C0,{className:`w-0`})]})}),(0,F.jsx)(x0,{children:e.map(e=>(0,F.jsxs)(S0,{children:[(0,F.jsx)(w0,{className:`font-mono font-medium`,children:e.name}),(0,F.jsx)(w0,{className:`font-mono`,children:e.trigger}),(0,F.jsx)(w0,{className:`font-mono`,children:e.agent}),(0,F.jsx)(w0,{children:(0,F.jsx)(V1,{variant:`outline`,children:e.paused?`paused`:`active`})}),(0,F.jsx)(w0,{className:`text-right`,children:(0,F.jsxs)($K,{variant:e.paused?`default`:`outline`,size:`sm`,disabled:t,onClick:()=>n(e),children:[e.paused?(0,F.jsx)(P,{"data-icon":`inline-start`,"aria-hidden":`true`}):(0,F.jsx)(N,{"data-icon":`inline-start`,"aria-hidden":`true`}),e.paused?`Unpause`:`Pause`]})})]},e.name))})]})})]}),r!==null&&(0,F.jsx)(z1,{className:`max-w-5xl`,message:r})]}),Fre=()=>{let e=ya({from:`/`}),t=Q9.useSearch(),n=jt(jre()),r=ue(),i=Mt({mutationFn:e=>O0(`/api/loops/${encodeURIComponent(e.name)}/${e.paused?`unpause`:`pause`}`,T0,{method:`POST`}),onSuccess:()=>r.invalidateQueries({queryKey:[`overview`]})}),a={};t.project!==void 0&&(a.project=t.project),t.view!==void 0&&(a.view=t.view);let o=t=>e({search:{...a,run:t}}),s=()=>e({search:a});if(n.isPending)return(0,F.jsx)(X9,{title:`Usine`,description:`Loading…`});if(n.isError)return(0,F.jsx)(X9,{title:`Server unreachable`,description:n.error.message,tone:`error`});let c=n.data,l=c._tag!==`NeedsSetup`;return(0,F.jsxs)(g1,{children:[(0,F.jsx)(P1,{projects:c.projects,view:t.view??`projects`,project:t.project,needsYou:c.needsYou.length,live:l}),(0,F.jsxs)(y1,{children:[(0,F.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-2 border-b px-4`,children:[(0,F.jsx)(v1,{className:`-ml-1`}),(0,F.jsx)(pY,{orientation:`vertical`,className:`mr-2 data-vertical:h-4 data-vertical:self-auto`}),(0,F.jsx)(G1,{children:(0,F.jsx)(K1,{children:t.view===`configuration`?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(q1,{children:(0,F.jsx)(J1,{render:(0,F.jsx)(Fa,{to:`/`,search:{view:`configuration`}}),children:`Configuration`})}),(0,F.jsx)(X1,{}),(0,F.jsx)(q1,{children:(0,F.jsx)(Y1,{children:`Loops`})})]}):t.project===void 0?(0,F.jsx)(q1,{children:(0,F.jsx)(Y1,{children:`Projects`})}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(q1,{children:(0,F.jsx)(J1,{render:(0,F.jsx)(Fa,{to:`/`,search:{}}),children:`Projects`})}),(0,F.jsx)(X1,{}),(0,F.jsx)(q1,{children:(0,F.jsx)(Y1,{className:`font-mono`,children:t.project})})]})})})]}),c._tag===`NeedsSetup`&&(0,F.jsxs)(I1,{className:`rounded-none border-x-0 border-t-0 bg-transparent px-4 py-4 sm:px-6`,children:[(0,F.jsx)(ae,{weight:`fill`,className:`text-needs-you`}),(0,F.jsx)(L1,{className:`text-sm`,children:`GitHub App credentials are missing`}),(0,F.jsx)(R1,{className:`max-w-prose`,children:(0,F.jsxs)(`p`,{children:[c.errorTag,`. Set `,(0,F.jsx)(`code`,{children:`USINE_GITHUB_APP_ID`}),` and`,` `,(0,F.jsx)(`code`,{children:`USINE_GITHUB_PRIVATE_KEY`}),`, or create `,(0,F.jsx)(`code`,{children:`.usine/github-app.json`}),` `,`with mode 0600, then restart `,(0,F.jsx)(`code`,{children:`usine up`}),`. Credentials are read at startup only.`]})})]}),(0,F.jsx)(Mre,{needs:c.needsYou,openRun:o}),t.view===`configuration`?(0,F.jsx)(Pre,{loops:c.loops,pending:i.isPending||c._tag===`NeedsSetup`,act:e=>i.mutate(e),error:i.isError?i.error.message:null}):t.project===void 0?(0,F.jsx)(Nre,{projects:c.projects,open:t=>e({search:{project:t}})}):(()=>{let n=c.projects.find(({repository:e})=>e===t.project);return n===void 0?(0,F.jsx)(X9,{title:`Project not found`,description:`${t.project} is not a registered project.`,tone:`error`,children:(0,F.jsx)($K,{variant:`outline`,onClick:()=>e({search:{}}),children:`Back to projects`})}):(0,F.jsx)(V0,{project:n,disabled:c._tag===`NeedsSetup`,openRun:o})})(),t.run!==void 0&&(0,F.jsx)(Dre,{runId:t.run,close:s})]})]})},Z9=za(),Q9=La({getParentRoute:()=>Z9,path:`/`,validateSearch:Ore,component:Fre}),Ire=no({routeTree:Z9.addChildren([Q9])}),Lre=new vt({defaultOptions:{queries:{retry:1,staleTime:500}}}),$9=document.getElementById(`root`);if($9===null)throw Error(`Missing #root mount point`);(0,jW.createRoot)($9).render((0,F.jsx)(f.StrictMode,{children:(0,F.jsx)(de,{client:Lre,children:(0,F.jsx)(ao,{router:Ire})})}));