@mobile-reality/mdma-cli 0.2.10 → 0.3.1

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 (52) hide show
  1. package/app-dist/assets/index--HOffMh7.css +1 -0
  2. package/app-dist/assets/index-DcZY-SXG.js +882 -0
  3. package/app-dist/index.html +2 -2
  4. package/dist/bin/mdma.js +2 -21
  5. package/dist/bin/mdma.js.map +1 -1
  6. package/dist/commands/load-data-sources.d.ts +4 -0
  7. package/dist/commands/load-data-sources.d.ts.map +1 -0
  8. package/dist/commands/load-data-sources.js +9 -0
  9. package/dist/commands/load-data-sources.js.map +1 -0
  10. package/dist/commands/prompt.d.ts +8 -0
  11. package/dist/commands/prompt.d.ts.map +1 -0
  12. package/dist/commands/prompt.js +13 -0
  13. package/dist/commands/prompt.js.map +1 -0
  14. package/dist/commands/validate.d.ts +1 -0
  15. package/dist/commands/validate.d.ts.map +1 -1
  16. package/dist/commands/validate.js +3 -1
  17. package/dist/commands/validate.js.map +1 -1
  18. package/dist/index.d.ts +2 -0
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +2 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/program.d.ts +5 -0
  23. package/dist/program.d.ts.map +1 -0
  24. package/dist/program.js +47 -0
  25. package/dist/program.js.map +1 -0
  26. package/dist/prompts/anthropic/_shared.d.ts +3 -3
  27. package/dist/prompts/anthropic/_shared.d.ts.map +1 -1
  28. package/dist/prompts/anthropic/_shared.js +83 -10
  29. package/dist/prompts/anthropic/_shared.js.map +1 -1
  30. package/dist/prompts/anthropic/haiku.d.ts +1 -1
  31. package/dist/prompts/anthropic/haiku.d.ts.map +1 -1
  32. package/dist/prompts/anthropic/opus.d.ts +1 -1
  33. package/dist/prompts/anthropic/opus.d.ts.map +1 -1
  34. package/dist/prompts/anthropic/sonnet-5.5.d.ts +21 -0
  35. package/dist/prompts/anthropic/sonnet-5.5.d.ts.map +1 -0
  36. package/dist/prompts/anthropic/sonnet-5.5.js +74 -0
  37. package/dist/prompts/anthropic/sonnet-5.5.js.map +1 -0
  38. package/dist/prompts/anthropic/sonnet.d.ts +1 -1
  39. package/dist/prompts/anthropic/sonnet.d.ts.map +1 -1
  40. package/dist/prompts/google/_shared.d.ts +3 -3
  41. package/dist/prompts/google/_shared.d.ts.map +1 -1
  42. package/dist/prompts/google/_shared.js +83 -10
  43. package/dist/prompts/google/_shared.js.map +1 -1
  44. package/dist/prompts/google/gemma.d.ts +1 -1
  45. package/dist/prompts/google/gemma.d.ts.map +1 -1
  46. package/dist/prompts/master-prompt.d.ts +1 -1
  47. package/dist/prompts/master-prompt.d.ts.map +1 -1
  48. package/dist/prompts/master-prompt.js +84 -9
  49. package/dist/prompts/master-prompt.js.map +1 -1
  50. package/package.json +8 -8
  51. package/app-dist/assets/index-D38uvQue.css +0 -1735
  52. package/app-dist/assets/index-DE6VOPh-.js +0 -27893
@@ -0,0 +1,882 @@
1
+ var wx=Object.defineProperty;var _x=(i,t,a)=>t in i?wx(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a;var Nt=(i,t,a)=>_x(i,typeof t!="symbol"?t+"":t,a);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))l(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&l(c)}).observe(document,{childList:!0,subtree:!0});function a(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function l(r){if(r.ep)return;r.ep=!0;const o=a(r);fetch(r.href,o)}})();function Tx(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Sf={exports:{}},Tl={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Lg;function Ax(){if(Lg)return Tl;Lg=1;var i=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(l,r,o){var c=null;if(o!==void 0&&(c=""+o),r.key!==void 0&&(c=""+r.key),"key"in r){o={};for(var h in r)h!=="key"&&(o[h]=r[h])}else o=r;return r=o.ref,{$$typeof:i,type:l,key:c,ref:r!==void 0?r:null,props:o}}return Tl.Fragment=t,Tl.jsx=a,Tl.jsxs=a,Tl}var Bg;function Ex(){return Bg||(Bg=1,Sf.exports=Ax()),Sf.exports}var v=Ex(),kf={exports:{}},_e={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var qg;function Nx(){if(qg)return _e;qg=1;var i=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),S=Symbol.iterator;function x(E){return E===null||typeof E!="object"?null:(E=S&&E[S]||E["@@iterator"],typeof E=="function"?E:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,M={};function j(E,V,w){this.props=E,this.context=V,this.refs=M,this.updater=w||N}j.prototype.isReactComponent={},j.prototype.setState=function(E,V){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,V,"setState")},j.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function Y(){}Y.prototype=j.prototype;function H(E,V,w){this.props=E,this.context=V,this.refs=M,this.updater=w||N}var Z=H.prototype=new Y;Z.constructor=H,T(Z,j.prototype),Z.isPureReactComponent=!0;var te=Array.isArray;function q(){}var C={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function X(E,V,w){var ie=w.ref;return{$$typeof:i,type:E,key:V,ref:ie!==void 0?ie:null,props:w}}function F(E,V){return X(E.type,V,E.props)}function P(E){return typeof E=="object"&&E!==null&&E.$$typeof===i}function ne(E){var V={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(w){return V[w]})}var pe=/\/+/g;function Ae(E,V){return typeof E=="object"&&E!==null&&E.key!=null?ne(""+E.key):V.toString(36)}function be(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(q,q):(E.status="pending",E.then(function(V){E.status==="pending"&&(E.status="fulfilled",E.value=V)},function(V){E.status==="pending"&&(E.status="rejected",E.reason=V)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function U(E,V,w,ie,fe){var ue=typeof E;(ue==="undefined"||ue==="boolean")&&(E=null);var ye=!1;if(E===null)ye=!0;else switch(ue){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(E.$$typeof){case i:case t:ye=!0;break;case b:return ye=E._init,U(ye(E._payload),V,w,ie,fe)}}if(ye)return fe=fe(E),ye=ie===""?"."+Ae(E,0):ie,te(fe)?(w="",ye!=null&&(w=ye.replace(pe,"$&/")+"/"),U(fe,V,w,"",function(yt){return yt})):fe!=null&&(P(fe)&&(fe=F(fe,w+(fe.key==null||E&&E.key===fe.key?"":(""+fe.key).replace(pe,"$&/")+"/")+ye)),V.push(fe)),1;ye=0;var Ke=ie===""?".":ie+":";if(te(E))for(var Be=0;Be<E.length;Be++)ie=E[Be],ue=Ke+Ae(ie,Be),ye+=U(ie,V,w,ue,fe);else if(Be=x(E),typeof Be=="function")for(E=Be.call(E),Be=0;!(ie=E.next()).done;)ie=ie.value,ue=Ke+Ae(ie,Be++),ye+=U(ie,V,w,ue,fe);else if(ue==="object"){if(typeof E.then=="function")return U(be(E),V,w,ie,fe);throw V=String(E),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return ye}function J(E,V,w){if(E==null)return E;var ie=[],fe=0;return U(E,ie,"","",function(ue){return V.call(w,ue,fe++)}),ie}function de(E){if(E._status===-1){var V=E._result;V=V(),V.then(function(w){(E._status===0||E._status===-1)&&(E._status=1,E._result=w)},function(w){(E._status===0||E._status===-1)&&(E._status=2,E._result=w)}),E._status===-1&&(E._status=0,E._result=V)}if(E._status===1)return E._result.default;throw E._result}var se=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},_={map:J,forEach:function(E,V,w){J(E,function(){V.apply(this,arguments)},w)},count:function(E){var V=0;return J(E,function(){V++}),V},toArray:function(E){return J(E,function(V){return V})||[]},only:function(E){if(!P(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return _e.Activity=y,_e.Children=_,_e.Component=j,_e.Fragment=a,_e.Profiler=r,_e.PureComponent=H,_e.StrictMode=l,_e.Suspense=p,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,_e.__COMPILER_RUNTIME={__proto__:null,c:function(E){return C.H.useMemoCache(E)}},_e.cache=function(E){return function(){return E.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(E,V,w){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var ie=T({},E.props),fe=E.key;if(V!=null)for(ue in V.key!==void 0&&(fe=""+V.key),V)!B.call(V,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&V.ref===void 0||(ie[ue]=V[ue]);var ue=arguments.length-2;if(ue===1)ie.children=w;else if(1<ue){for(var ye=Array(ue),Ke=0;Ke<ue;Ke++)ye[Ke]=arguments[Ke+2];ie.children=ye}return X(E.type,fe,ie)},_e.createContext=function(E){return E={$$typeof:c,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:o,_context:E},E},_e.createElement=function(E,V,w){var ie,fe={},ue=null;if(V!=null)for(ie in V.key!==void 0&&(ue=""+V.key),V)B.call(V,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(fe[ie]=V[ie]);var ye=arguments.length-2;if(ye===1)fe.children=w;else if(1<ye){for(var Ke=Array(ye),Be=0;Be<ye;Be++)Ke[Be]=arguments[Be+2];fe.children=Ke}if(E&&E.defaultProps)for(ie in ye=E.defaultProps,ye)fe[ie]===void 0&&(fe[ie]=ye[ie]);return X(E,ue,fe)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(E){return{$$typeof:h,render:E}},_e.isValidElement=P,_e.lazy=function(E){return{$$typeof:b,_payload:{_status:-1,_result:E},_init:de}},_e.memo=function(E,V){return{$$typeof:m,type:E,compare:V===void 0?null:V}},_e.startTransition=function(E){var V=C.T,w={};C.T=w;try{var ie=E(),fe=C.S;fe!==null&&fe(w,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(q,se)}catch(ue){se(ue)}finally{V!==null&&w.types!==null&&(V.types=w.types),C.T=V}},_e.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},_e.use=function(E){return C.H.use(E)},_e.useActionState=function(E,V,w){return C.H.useActionState(E,V,w)},_e.useCallback=function(E,V){return C.H.useCallback(E,V)},_e.useContext=function(E){return C.H.useContext(E)},_e.useDebugValue=function(){},_e.useDeferredValue=function(E,V){return C.H.useDeferredValue(E,V)},_e.useEffect=function(E,V){return C.H.useEffect(E,V)},_e.useEffectEvent=function(E){return C.H.useEffectEvent(E)},_e.useId=function(){return C.H.useId()},_e.useImperativeHandle=function(E,V,w){return C.H.useImperativeHandle(E,V,w)},_e.useInsertionEffect=function(E,V){return C.H.useInsertionEffect(E,V)},_e.useLayoutEffect=function(E,V){return C.H.useLayoutEffect(E,V)},_e.useMemo=function(E,V){return C.H.useMemo(E,V)},_e.useOptimistic=function(E,V){return C.H.useOptimistic(E,V)},_e.useReducer=function(E,V,w){return C.H.useReducer(E,V,w)},_e.useRef=function(E){return C.H.useRef(E)},_e.useState=function(E){return C.H.useState(E)},_e.useSyncExternalStore=function(E,V,w){return C.H.useSyncExternalStore(E,V,w)},_e.useTransition=function(){return C.H.useTransition()},_e.version="19.2.4",_e}var Ug;function hd(){return Ug||(Ug=1,kf.exports=Nx()),kf.exports}var W=hd(),wf={exports:{}},Al={},_f={exports:{}},Tf={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Ig;function Cx(){return Ig||(Ig=1,(function(i){function t(U,J){var de=U.length;U.push(J);e:for(;0<de;){var se=de-1>>>1,_=U[se];if(0<r(_,J))U[se]=J,U[de]=_,de=se;else break e}}function a(U){return U.length===0?null:U[0]}function l(U){if(U.length===0)return null;var J=U[0],de=U.pop();if(de!==J){U[0]=de;e:for(var se=0,_=U.length,E=_>>>1;se<E;){var V=2*(se+1)-1,w=U[V],ie=V+1,fe=U[ie];if(0>r(w,de))ie<_&&0>r(fe,w)?(U[se]=fe,U[ie]=de,se=ie):(U[se]=w,U[V]=de,se=V);else if(ie<_&&0>r(fe,de))U[se]=fe,U[ie]=de,se=ie;else break e}}return J}function r(U,J){var de=U.sortIndex-J.sortIndex;return de!==0?de:U.id-J.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;i.unstable_now=function(){return o.now()}}else{var c=Date,h=c.now();i.unstable_now=function(){return c.now()-h}}var p=[],m=[],b=1,y=null,S=3,x=!1,N=!1,T=!1,M=!1,j=typeof setTimeout=="function"?setTimeout:null,Y=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function Z(U){for(var J=a(m);J!==null;){if(J.callback===null)l(m);else if(J.startTime<=U)l(m),J.sortIndex=J.expirationTime,t(p,J);else break;J=a(m)}}function te(U){if(T=!1,Z(U),!N)if(a(p)!==null)N=!0,q||(q=!0,ne());else{var J=a(m);J!==null&&be(te,J.startTime-U)}}var q=!1,C=-1,B=5,X=-1;function F(){return M?!0:!(i.unstable_now()-X<B)}function P(){if(M=!1,q){var U=i.unstable_now();X=U;var J=!0;try{e:{N=!1,T&&(T=!1,Y(C),C=-1),x=!0;var de=S;try{t:{for(Z(U),y=a(p);y!==null&&!(y.expirationTime>U&&F());){var se=y.callback;if(typeof se=="function"){y.callback=null,S=y.priorityLevel;var _=se(y.expirationTime<=U);if(U=i.unstable_now(),typeof _=="function"){y.callback=_,Z(U),J=!0;break t}y===a(p)&&l(p),Z(U)}else l(p);y=a(p)}if(y!==null)J=!0;else{var E=a(m);E!==null&&be(te,E.startTime-U),J=!1}}break e}finally{y=null,S=de,x=!1}J=void 0}}finally{J?ne():q=!1}}}var ne;if(typeof H=="function")ne=function(){H(P)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,Ae=pe.port2;pe.port1.onmessage=P,ne=function(){Ae.postMessage(null)}}else ne=function(){j(P,0)};function be(U,J){C=j(function(){U(i.unstable_now())},J)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(U){U.callback=null},i.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<U?Math.floor(1e3/U):5},i.unstable_getCurrentPriorityLevel=function(){return S},i.unstable_next=function(U){switch(S){case 1:case 2:case 3:var J=3;break;default:J=S}var de=S;S=J;try{return U()}finally{S=de}},i.unstable_requestPaint=function(){M=!0},i.unstable_runWithPriority=function(U,J){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var de=S;S=U;try{return J()}finally{S=de}},i.unstable_scheduleCallback=function(U,J,de){var se=i.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?se+de:se):de=se,U){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=de+_,U={id:b++,callback:J,priorityLevel:U,startTime:de,expirationTime:_,sortIndex:-1},de>se?(U.sortIndex=de,t(m,U),a(p)===null&&U===a(m)&&(T?(Y(C),C=-1):T=!0,be(te,de-se))):(U.sortIndex=_,t(p,U),N||x||(N=!0,q||(q=!0,ne()))),U},i.unstable_shouldYield=F,i.unstable_wrapCallback=function(U){var J=S;return function(){var de=S;S=J;try{return U.apply(this,arguments)}finally{S=de}}}})(Tf)),Tf}var Hg;function Ox(){return Hg||(Hg=1,_f.exports=Cx()),_f.exports}var Af={exports:{}},Ct={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Vg;function jx(){if(Vg)return Ct;Vg=1;var i=hd();function t(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var l={d:{f:a,r:function(){throw Error(t(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},r=Symbol.for("react.portal");function o(p,m,b){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:p,containerInfo:m,implementation:b}}var c=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Ct.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Ct.createPortal=function(p,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return o(p,m,null,b)},Ct.flushSync=function(p){var m=c.T,b=l.p;try{if(c.T=null,l.p=2,p)return p()}finally{c.T=m,l.p=b,l.d.f()}},Ct.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,l.d.C(p,m))},Ct.prefetchDNS=function(p){typeof p=="string"&&l.d.D(p)},Ct.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var b=m.as,y=h(b,m.crossOrigin),S=typeof m.integrity=="string"?m.integrity:void 0,x=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?l.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:S,fetchPriority:x}):b==="script"&&l.d.X(p,{crossOrigin:y,integrity:S,fetchPriority:x,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Ct.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=h(m.as,m.crossOrigin);l.d.M(p,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&l.d.M(p)},Ct.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,y=h(b,m.crossOrigin);l.d.L(p,b,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Ct.preloadModule=function(p,m){if(typeof p=="string")if(m){var b=h(m.as,m.crossOrigin);l.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else l.d.m(p)},Ct.requestFormReset=function(p){l.d.r(p)},Ct.unstable_batchedUpdates=function(p,m){return p(m)},Ct.useFormState=function(p,m,b){return c.H.useFormState(p,m,b)},Ct.useFormStatus=function(){return c.H.useHostTransitionStatus()},Ct.version="19.2.4",Ct}var Yg;function Mx(){if(Yg)return Af.exports;Yg=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(t){console.error(t)}}return i(),Af.exports=jx(),Af.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Gg;function Dx(){if(Gg)return Al;Gg=1;var i=Ox(),t=hd(),a=Mx();function l(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var n=e,s=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(s=n.return),e=n.return;while(e)}return n.tag===3?s:null}function c(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function h(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(o(e)!==e)throw Error(l(188))}function m(e){var n=e.alternate;if(!n){if(n=o(e),n===null)throw Error(l(188));return n!==e?null:e}for(var s=e,u=n;;){var f=s.return;if(f===null)break;var d=f.alternate;if(d===null){if(u=f.return,u!==null){s=u;continue}break}if(f.child===d.child){for(d=f.child;d;){if(d===s)return p(f),e;if(d===u)return p(f),n;d=d.sibling}throw Error(l(188))}if(s.return!==u.return)s=f,u=d;else{for(var g=!1,k=f.child;k;){if(k===s){g=!0,s=f,u=d;break}if(k===u){g=!0,u=f,s=d;break}k=k.sibling}if(!g){for(k=d.child;k;){if(k===s){g=!0,s=d,u=f;break}if(k===u){g=!0,u=d,s=f;break}k=k.sibling}if(!g)throw Error(l(189))}}if(s.alternate!==u)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?e:n}function b(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=b(e),n!==null)return n;e=e.sibling}return null}var y=Object.assign,S=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),Y=Symbol.for("react.consumer"),H=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function ne(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var pe=Symbol.for("react.client.reference");function Ae(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case j:return"Profiler";case M:return"StrictMode";case te:return"Suspense";case q:return"SuspenseList";case X:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case H:return e.displayName||"Context";case Y:return(e._context.displayName||"Context")+".Consumer";case Z:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case C:return n=e.displayName||null,n!==null?n:Ae(e.type)||"Memo";case B:n=e._payload,e=e._init;try{return Ae(e(n))}catch{}}return null}var be=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},se=[],_=-1;function E(e){return{current:e}}function V(e){0>_||(e.current=se[_],se[_]=null,_--)}function w(e,n){_++,se[_]=e.current,e.current=n}var ie=E(null),fe=E(null),ue=E(null),ye=E(null);function Ke(e,n){switch(w(ue,n),w(fe,e),w(ie,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?sg(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=sg(n),e=lg(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(ie),w(ie,e)}function Be(){V(ie),V(fe),V(ue)}function yt(e){e.memoizedState!==null&&w(ye,e);var n=ie.current,s=lg(n,e.type);n!==s&&(w(fe,e),w(ie,s))}function xn(e){fe.current===e&&(V(ie),V(fe)),ye.current===e&&(V(ye),Sl._currentValue=de)}var Hn,Ql;function Vn(e){if(Hn===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);Hn=n&&n[1]||"",Ql=-1<s.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Hn+e+Ql}var Aa=!1;function Ea(e,n){if(!e||Aa)return"";Aa=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(n){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(I){var L=I}Reflect.construct(e,[],Q)}else{try{Q.call()}catch(I){L=I}e.call(Q.prototype)}}else{try{throw Error()}catch(I){L=I}(Q=e())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(I){if(I&&L&&typeof I.stack=="string")return[I.stack,L.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=u.DetermineComponentFrameRoot(),g=d[0],k=d[1];if(g&&k){var A=g.split(`
44
+ `),R=k.split(`
45
+ `);for(f=u=0;u<A.length&&!A[u].includes("DetermineComponentFrameRoot");)u++;for(;f<R.length&&!R[f].includes("DetermineComponentFrameRoot");)f++;if(u===A.length||f===R.length)for(u=A.length-1,f=R.length-1;1<=u&&0<=f&&A[u]!==R[f];)f--;for(;1<=u&&0<=f;u--,f--)if(A[u]!==R[f]){if(u!==1||f!==1)do if(u--,f--,0>f||A[u]!==R[f]){var G=`
46
+ `+A[u].replace(" at new "," at ");return e.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",e.displayName)),G}while(1<=u&&0<=f);break}}}finally{Aa=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Vn(s):""}function Xl(e,n){switch(e.tag){case 26:case 27:case 5:return Vn(e.type);case 16:return Vn("Lazy");case 13:return e.child!==n&&n!==null?Vn("Suspense Fallback"):Vn("Suspense");case 19:return Vn("SuspenseList");case 0:case 15:return Ea(e.type,!1);case 11:return Ea(e.type.render,!1);case 1:return Ea(e.type,!0);case 31:return Vn("Activity");default:return""}}function Fl(e){try{var n="",s=null;do n+=Xl(e,s),s=e,e=e.return;while(e);return n}catch(u){return`
47
+ Error generating stack: `+u.message+`
48
+ `+u.stack}}var Na=Object.prototype.hasOwnProperty,Ca=i.unstable_scheduleCallback,Ds=i.unstable_cancelCallback,ao=i.unstable_shouldYield,so=i.unstable_requestPaint,Ot=i.unstable_now,lo=i.unstable_getCurrentPriorityLevel,$=i.unstable_ImmediatePriority,ae=i.unstable_UserBlockingPriority,xe=i.unstable_NormalPriority,Oe=i.unstable_LowPriority,Ye=i.unstable_IdlePriority,Qt=i.log,Yn=i.unstable_setDisableYieldValue,jt=null,bt=null;function Bt(e){if(typeof Qt=="function"&&Yn(e),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(jt,e)}catch{}}var Fe=Math.clz32?Math.clz32:ov,gi=Math.log,Sn=Math.LN2;function ov(e){return e>>>=0,e===0?32:31-(gi(e)/Sn|0)|0}var Jl=256,Wl=262144,Pl=4194304;function Fi(e){var n=e&42;if(n!==0)return n;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 er(e,n,s){var u=e.pendingLanes;if(u===0)return 0;var f=0,d=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var k=u&134217727;return k!==0?(u=k&~d,u!==0?f=Fi(u):(g&=k,g!==0?f=Fi(g):s||(s=k&~e,s!==0&&(f=Fi(s))))):(k=u&~d,k!==0?f=Fi(k):g!==0?f=Fi(g):s||(s=u&~e,s!==0&&(f=Fi(s)))),f===0?0:n!==0&&n!==f&&(n&d)===0&&(d=f&-f,s=n&-n,d>=s||d===32&&(s&4194048)!==0)?n:f}function zs(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function cv(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Id(){var e=Pl;return Pl<<=1,(Pl&62914560)===0&&(Pl=4194304),e}function ro(e){for(var n=[],s=0;31>s;s++)n.push(e);return n}function Rs(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function fv(e,n,s,u,f,d){var g=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var k=e.entanglements,A=e.expirationTimes,R=e.hiddenUpdates;for(s=g&~s;0<s;){var G=31-Fe(s),Q=1<<G;k[G]=0,A[G]=-1;var L=R[G];if(L!==null)for(R[G]=null,G=0;G<L.length;G++){var I=L[G];I!==null&&(I.lane&=-536870913)}s&=~Q}u!==0&&Hd(e,u,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(g&~n))}function Hd(e,n,s){e.pendingLanes|=n,e.suspendedLanes&=~n;var u=31-Fe(n);e.entangledLanes|=n,e.entanglements[u]=e.entanglements[u]|1073741824|s&261930}function Vd(e,n){var s=e.entangledLanes|=n;for(e=e.entanglements;s;){var u=31-Fe(s),f=1<<u;f&n|e[u]&n&&(e[u]|=n),s&=~f}}function Yd(e,n){var s=n&-n;return s=(s&42)!==0?1:uo(s),(s&(e.suspendedLanes|n))!==0?0:s}function uo(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 oo(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Gd(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:Cg(e.type))}function $d(e,n){var s=J.p;try{return J.p=e,n()}finally{J.p=s}}var yi=Math.random().toString(36).slice(2),wt="__reactFiber$"+yi,qt="__reactProps$"+yi,Oa="__reactContainer$"+yi,co="__reactEvents$"+yi,dv="__reactListeners$"+yi,hv="__reactHandles$"+yi,Kd="__reactResources$"+yi,Ls="__reactMarker$"+yi;function fo(e){delete e[wt],delete e[qt],delete e[co],delete e[dv],delete e[hv]}function ja(e){var n=e[wt];if(n)return n;for(var s=e.parentNode;s;){if(n=s[Oa]||s[wt]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=hg(e);e!==null;){if(s=e[wt])return s;e=hg(e)}return n}e=s,s=e.parentNode}return null}function Ma(e){if(e=e[wt]||e[Oa]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function Bs(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(l(33))}function Da(e){var n=e[Kd];return n||(n=e[Kd]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function St(e){e[Ls]=!0}var Zd=new Set,Qd={};function Ji(e,n){za(e,n),za(e+"Capture",n)}function za(e,n){for(Qd[e]=n,e=0;e<n.length;e++)Zd.add(n[e])}var mv=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]*$"),Xd={},Fd={};function pv(e){return Na.call(Fd,e)?!0:Na.call(Xd,e)?!1:mv.test(e)?Fd[e]=!0:(Xd[e]=!0,!1)}function tr(e,n,s){if(pv(n))if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var u=n.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+s)}}function nr(e,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+s)}}function Gn(e,n,s,u){if(u===null)e.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(n,s,""+u)}}function sn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jd(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function gv(e,n,s){var u=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var f=u.get,d=u.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(g){s=""+g,d.call(this,g)}}),Object.defineProperty(e,n,{enumerable:u.enumerable}),{getValue:function(){return s},setValue:function(g){s=""+g},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function ho(e){if(!e._valueTracker){var n=Jd(e)?"checked":"value";e._valueTracker=gv(e,n,""+e[n])}}function Wd(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),u="";return e&&(u=Jd(e)?e.checked?"true":"false":e.value),e=u,e!==s?(n.setValue(e),!0):!1}function ir(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var yv=/[\n"\\]/g;function ln(e){return e.replace(yv,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function mo(e,n,s,u,f,d,g,k){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),n!=null?g==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+sn(n)):e.value!==""+sn(n)&&(e.value=""+sn(n)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),n!=null?po(e,g,sn(n)):s!=null?po(e,g,sn(s)):u!=null&&e.removeAttribute("value"),f==null&&d!=null&&(e.defaultChecked=!!d),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+sn(k):e.removeAttribute("name")}function Pd(e,n,s,u,f,d,g,k){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),n!=null||s!=null){if(!(d!=="submit"&&d!=="reset"||n!=null)){ho(e);return}s=s!=null?""+sn(s):"",n=n!=null?""+sn(n):s,k||n===e.value||(e.value=n),e.defaultValue=n}u=u??f,u=typeof u!="function"&&typeof u!="symbol"&&!!u,e.checked=k?e.checked:!!u,e.defaultChecked=!!u,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),ho(e)}function po(e,n,s){n==="number"&&ir(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ra(e,n,s,u){if(e=e.options,n){n={};for(var f=0;f<s.length;f++)n["$"+s[f]]=!0;for(s=0;s<e.length;s++)f=n.hasOwnProperty("$"+e[s].value),e[s].selected!==f&&(e[s].selected=f),f&&u&&(e[s].defaultSelected=!0)}else{for(s=""+sn(s),n=null,f=0;f<e.length;f++){if(e[f].value===s){e[f].selected=!0,u&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function eh(e,n,s){if(n!=null&&(n=""+sn(n),n!==e.value&&(e.value=n),s==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=s!=null?""+sn(s):""}function th(e,n,s,u){if(n==null){if(u!=null){if(s!=null)throw Error(l(92));if(be(u)){if(1<u.length)throw Error(l(93));u=u[0]}s=u}s==null&&(s=""),n=s}s=sn(n),e.defaultValue=s,u=e.textContent,u===s&&u!==""&&u!==null&&(e.value=u),ho(e)}function La(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}var bv=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 nh(e,n,s){var u=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?u?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":u?e.setProperty(n,s):typeof s!="number"||s===0||bv.has(n)?n==="float"?e.cssFloat=s:e[n]=(""+s).trim():e[n]=s+"px"}function ih(e,n,s){if(n!=null&&typeof n!="object")throw Error(l(62));if(e=e.style,s!=null){for(var u in s)!s.hasOwnProperty(u)||n!=null&&n.hasOwnProperty(u)||(u.indexOf("--")===0?e.setProperty(u,""):u==="float"?e.cssFloat="":e[u]="");for(var f in n)u=n[f],n.hasOwnProperty(f)&&s[f]!==u&&nh(e,f,u)}else for(var d in n)n.hasOwnProperty(d)&&nh(e,d,n[d])}function go(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 vv=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"]]),xv=/^[\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 ar(e){return xv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function $n(){}var yo=null;function bo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ba=null,qa=null;function ah(e){var n=Ma(e);if(n&&(e=n.stateNode)){var s=e[qt]||null;e:switch(e=n.stateNode,n.type){case"input":if(mo(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+ln(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var u=s[n];if(u!==e&&u.form===e.form){var f=u[qt]||null;if(!f)throw Error(l(90));mo(u,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<s.length;n++)u=s[n],u.form===e.form&&Wd(u)}break e;case"textarea":eh(e,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&Ra(e,!!s.multiple,n,!1)}}}var vo=!1;function sh(e,n,s){if(vo)return e(n,s);vo=!0;try{var u=e(n);return u}finally{if(vo=!1,(Ba!==null||qa!==null)&&($r(),Ba&&(n=Ba,e=qa,qa=Ba=null,ah(n),e)))for(n=0;n<e.length;n++)ah(e[n])}}function qs(e,n){var s=e.stateNode;if(s===null)return null;var u=s[qt]||null;if(u===null)return null;s=u[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,n,typeof s));return s}var Kn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xo=!1;if(Kn)try{var Us={};Object.defineProperty(Us,"passive",{get:function(){xo=!0}}),window.addEventListener("test",Us,Us),window.removeEventListener("test",Us,Us)}catch{xo=!1}var bi=null,So=null,sr=null;function lh(){if(sr)return sr;var e,n=So,s=n.length,u,f="value"in bi?bi.value:bi.textContent,d=f.length;for(e=0;e<s&&n[e]===f[e];e++);var g=s-e;for(u=1;u<=g&&n[s-u]===f[d-u];u++);return sr=f.slice(e,1<u?1-u:void 0)}function lr(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function rr(){return!0}function rh(){return!1}function Ut(e){function n(s,u,f,d,g){this._reactName=s,this._targetInst=f,this.type=u,this.nativeEvent=d,this.target=g,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(s=e[k],this[k]=s?s(d):d[k]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?rr:rh,this.isPropagationStopped=rh,this}return y(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=rr)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=rr)},persist:function(){},isPersistent:rr}),n}var Wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ur=Ut(Wi),Is=y({},Wi,{view:0,detail:0}),Sv=Ut(Is),ko,wo,Hs,or=y({},Is,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:To,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!==Hs&&(Hs&&e.type==="mousemove"?(ko=e.screenX-Hs.screenX,wo=e.screenY-Hs.screenY):wo=ko=0,Hs=e),ko)},movementY:function(e){return"movementY"in e?e.movementY:wo}}),uh=Ut(or),kv=y({},or,{dataTransfer:0}),wv=Ut(kv),_v=y({},Is,{relatedTarget:0}),_o=Ut(_v),Tv=y({},Wi,{animationName:0,elapsedTime:0,pseudoElement:0}),Av=Ut(Tv),Ev=y({},Wi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Nv=Ut(Ev),Cv=y({},Wi,{data:0}),oh=Ut(Cv),Ov={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jv={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"},Mv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Dv(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Mv[e])?!!n[e]:!1}function To(){return Dv}var zv=y({},Is,{key:function(e){if(e.key){var n=Ov[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=lr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:To,charCode:function(e){return e.type==="keypress"?lr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?lr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rv=Ut(zv),Lv=y({},or,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ch=Ut(Lv),Bv=y({},Is,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:To}),qv=Ut(Bv),Uv=y({},Wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Iv=Ut(Uv),Hv=y({},or,{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}),Vv=Ut(Hv),Yv=y({},Wi,{newState:0,oldState:0}),Gv=Ut(Yv),$v=[9,13,27,32],Ao=Kn&&"CompositionEvent"in window,Vs=null;Kn&&"documentMode"in document&&(Vs=document.documentMode);var Kv=Kn&&"TextEvent"in window&&!Vs,fh=Kn&&(!Ao||Vs&&8<Vs&&11>=Vs),dh=" ",hh=!1;function mh(e,n){switch(e){case"keyup":return $v.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ph(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ua=!1;function Zv(e,n){switch(e){case"compositionend":return ph(n);case"keypress":return n.which!==32?null:(hh=!0,dh);case"textInput":return e=n.data,e===dh&&hh?null:e;default:return null}}function Qv(e,n){if(Ua)return e==="compositionend"||!Ao&&mh(e,n)?(e=lh(),sr=So=bi=null,Ua=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return fh&&n.locale!=="ko"?null:n.data;default:return null}}var Xv={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 gh(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Xv[e.type]:n==="textarea"}function yh(e,n,s,u){Ba?qa?qa.push(u):qa=[u]:Ba=u,n=Wr(n,"onChange"),0<n.length&&(s=new ur("onChange","change",null,s,u),e.push({event:s,listeners:n}))}var Ys=null,Gs=null;function Fv(e){Pp(e,0)}function cr(e){var n=Bs(e);if(Wd(n))return e}function bh(e,n){if(e==="change")return n}var vh=!1;if(Kn){var Eo;if(Kn){var No="oninput"in document;if(!No){var xh=document.createElement("div");xh.setAttribute("oninput","return;"),No=typeof xh.oninput=="function"}Eo=No}else Eo=!1;vh=Eo&&(!document.documentMode||9<document.documentMode)}function Sh(){Ys&&(Ys.detachEvent("onpropertychange",kh),Gs=Ys=null)}function kh(e){if(e.propertyName==="value"&&cr(Gs)){var n=[];yh(n,Gs,e,bo(e)),sh(Fv,n)}}function Jv(e,n,s){e==="focusin"?(Sh(),Ys=n,Gs=s,Ys.attachEvent("onpropertychange",kh)):e==="focusout"&&Sh()}function Wv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return cr(Gs)}function Pv(e,n){if(e==="click")return cr(n)}function e0(e,n){if(e==="input"||e==="change")return cr(n)}function t0(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Xt=typeof Object.is=="function"?Object.is:t0;function $s(e,n){if(Xt(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var s=Object.keys(e),u=Object.keys(n);if(s.length!==u.length)return!1;for(u=0;u<s.length;u++){var f=s[u];if(!Na.call(n,f)||!Xt(e[f],n[f]))return!1}return!0}function wh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _h(e,n){var s=wh(e);e=0;for(var u;s;){if(s.nodeType===3){if(u=e+s.textContent.length,e<=n&&u>=n)return{node:s,offset:n-e};e=u}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=wh(s)}}function Th(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Th(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Ah(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=ir(e.document);n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=ir(e.document)}return n}function Co(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var n0=Kn&&"documentMode"in document&&11>=document.documentMode,Ia=null,Oo=null,Ks=null,jo=!1;function Eh(e,n,s){var u=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;jo||Ia==null||Ia!==ir(u)||(u=Ia,"selectionStart"in u&&Co(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Ks&&$s(Ks,u)||(Ks=u,u=Wr(Oo,"onSelect"),0<u.length&&(n=new ur("onSelect","select",null,n,s),e.push({event:n,listeners:u}),n.target=Ia)))}function Pi(e,n){var s={};return s[e.toLowerCase()]=n.toLowerCase(),s["Webkit"+e]="webkit"+n,s["Moz"+e]="moz"+n,s}var Ha={animationend:Pi("Animation","AnimationEnd"),animationiteration:Pi("Animation","AnimationIteration"),animationstart:Pi("Animation","AnimationStart"),transitionrun:Pi("Transition","TransitionRun"),transitionstart:Pi("Transition","TransitionStart"),transitioncancel:Pi("Transition","TransitionCancel"),transitionend:Pi("Transition","TransitionEnd")},Mo={},Nh={};Kn&&(Nh=document.createElement("div").style,"AnimationEvent"in window||(delete Ha.animationend.animation,delete Ha.animationiteration.animation,delete Ha.animationstart.animation),"TransitionEvent"in window||delete Ha.transitionend.transition);function ea(e){if(Mo[e])return Mo[e];if(!Ha[e])return e;var n=Ha[e],s;for(s in n)if(n.hasOwnProperty(s)&&s in Nh)return Mo[e]=n[s];return e}var Ch=ea("animationend"),Oh=ea("animationiteration"),jh=ea("animationstart"),i0=ea("transitionrun"),a0=ea("transitionstart"),s0=ea("transitioncancel"),Mh=ea("transitionend"),Dh=new Map,Do="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(" ");Do.push("scrollEnd");function kn(e,n){Dh.set(e,n),Ji(n,[e])}var fr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},rn=[],Va=0,zo=0;function dr(){for(var e=Va,n=zo=Va=0;n<e;){var s=rn[n];rn[n++]=null;var u=rn[n];rn[n++]=null;var f=rn[n];rn[n++]=null;var d=rn[n];if(rn[n++]=null,u!==null&&f!==null){var g=u.pending;g===null?f.next=f:(f.next=g.next,g.next=f),u.pending=f}d!==0&&zh(s,f,d)}}function hr(e,n,s,u){rn[Va++]=e,rn[Va++]=n,rn[Va++]=s,rn[Va++]=u,zo|=u,e.lanes|=u,e=e.alternate,e!==null&&(e.lanes|=u)}function Ro(e,n,s,u){return hr(e,n,s,u),mr(e)}function ta(e,n){return hr(e,null,null,n),mr(e)}function zh(e,n,s){e.lanes|=s;var u=e.alternate;u!==null&&(u.lanes|=s);for(var f=!1,d=e.return;d!==null;)d.childLanes|=s,u=d.alternate,u!==null&&(u.childLanes|=s),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(f=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,f&&n!==null&&(f=31-Fe(s),e=d.hiddenUpdates,u=e[f],u===null?e[f]=[n]:u.push(n),n.lane=s|536870912),d):null}function mr(e){if(50<ml)throw ml=0,Gc=null,Error(l(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Ya={};function l0(e,n,s,u){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ft(e,n,s,u){return new l0(e,n,s,u)}function Lo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zn(e,n){var s=e.alternate;return s===null?(s=Ft(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=n,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Rh(e,n){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,n=s.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function pr(e,n,s,u,f,d){var g=0;if(u=e,typeof e=="function")Lo(e)&&(g=1);else if(typeof e=="string")g=fx(e,s,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case X:return e=Ft(31,s,n,f),e.elementType=X,e.lanes=d,e;case T:return na(s.children,f,d,n);case M:g=8,f|=24;break;case j:return e=Ft(12,s,n,f|2),e.elementType=j,e.lanes=d,e;case te:return e=Ft(13,s,n,f),e.elementType=te,e.lanes=d,e;case q:return e=Ft(19,s,n,f),e.elementType=q,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:g=10;break e;case Y:g=9;break e;case Z:g=11;break e;case C:g=14;break e;case B:g=16,u=null;break e}g=29,s=Error(l(130,e===null?"null":typeof e,"")),u=null}return n=Ft(g,s,n,f),n.elementType=e,n.type=u,n.lanes=d,n}function na(e,n,s,u){return e=Ft(7,e,u,n),e.lanes=s,e}function Bo(e,n,s){return e=Ft(6,e,null,n),e.lanes=s,e}function Lh(e){var n=Ft(18,null,null,0);return n.stateNode=e,n}function qo(e,n,s){return n=Ft(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Bh=new WeakMap;function un(e,n){if(typeof e=="object"&&e!==null){var s=Bh.get(e);return s!==void 0?s:(n={value:e,source:n,stack:Fl(n)},Bh.set(e,n),n)}return{value:e,source:n,stack:Fl(n)}}var Ga=[],$a=0,gr=null,Zs=0,on=[],cn=0,vi=null,On=1,jn="";function Qn(e,n){Ga[$a++]=Zs,Ga[$a++]=gr,gr=e,Zs=n}function qh(e,n,s){on[cn++]=On,on[cn++]=jn,on[cn++]=vi,vi=e;var u=On;e=jn;var f=32-Fe(u)-1;u&=~(1<<f),s+=1;var d=32-Fe(n)+f;if(30<d){var g=f-f%5;d=(u&(1<<g)-1).toString(32),u>>=g,f-=g,On=1<<32-Fe(n)+f|s<<f|u,jn=d+e}else On=1<<d|s<<f|u,jn=e}function Uo(e){e.return!==null&&(Qn(e,1),qh(e,1,0))}function Io(e){for(;e===gr;)gr=Ga[--$a],Ga[$a]=null,Zs=Ga[--$a],Ga[$a]=null;for(;e===vi;)vi=on[--cn],on[cn]=null,jn=on[--cn],on[cn]=null,On=on[--cn],on[cn]=null}function Uh(e,n){on[cn++]=On,on[cn++]=jn,on[cn++]=vi,On=n.id,jn=n.overflow,vi=e}var _t=null,et=null,Le=!1,xi=null,fn=!1,Ho=Error(l(519));function Si(e){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qs(un(n,e)),Ho}function Ih(e){var n=e.stateNode,s=e.type,u=e.memoizedProps;switch(n[wt]=e,n[qt]=u,s){case"dialog":Me("cancel",n),Me("close",n);break;case"iframe":case"object":case"embed":Me("load",n);break;case"video":case"audio":for(s=0;s<gl.length;s++)Me(gl[s],n);break;case"source":Me("error",n);break;case"img":case"image":case"link":Me("error",n),Me("load",n);break;case"details":Me("toggle",n);break;case"input":Me("invalid",n),Pd(n,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Me("invalid",n);break;case"textarea":Me("invalid",n),th(n,u.value,u.defaultValue,u.children)}s=u.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||u.suppressHydrationWarning===!0||ig(n.textContent,s)?(u.popover!=null&&(Me("beforetoggle",n),Me("toggle",n)),u.onScroll!=null&&Me("scroll",n),u.onScrollEnd!=null&&Me("scrollend",n),u.onClick!=null&&(n.onclick=$n),n=!0):n=!1,n||Si(e,!0)}function Hh(e){for(_t=e.return;_t;)switch(_t.tag){case 5:case 31:case 13:fn=!1;return;case 27:case 3:fn=!0;return;default:_t=_t.return}}function Ka(e){if(e!==_t)return!1;if(!Le)return Hh(e),Le=!0,!1;var n=e.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||lf(e.type,e.memoizedProps)),s=!s),s&&et&&Si(e),Hh(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));et=dg(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));et=dg(e)}else n===27?(n=et,Ri(e.type)?(e=ff,ff=null,et=e):et=n):et=_t?hn(e.stateNode.nextSibling):null;return!0}function ia(){et=_t=null,Le=!1}function Vo(){var e=xi;return e!==null&&(Yt===null?Yt=e:Yt.push.apply(Yt,e),xi=null),e}function Qs(e){xi===null?xi=[e]:xi.push(e)}var Yo=E(null),aa=null,Xn=null;function ki(e,n,s){w(Yo,n._currentValue),n._currentValue=s}function Fn(e){e._currentValue=Yo.current,V(Yo)}function Go(e,n,s){for(;e!==null;){var u=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),e===s)break;e=e.return}}function $o(e,n,s,u){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var d=f.dependencies;if(d!==null){var g=f.child;d=d.firstContext;e:for(;d!==null;){var k=d;d=f;for(var A=0;A<n.length;A++)if(k.context===n[A]){d.lanes|=s,k=d.alternate,k!==null&&(k.lanes|=s),Go(d.return,s,e),u||(g=null);break e}d=k.next}}else if(f.tag===18){if(g=f.return,g===null)throw Error(l(341));g.lanes|=s,d=g.alternate,d!==null&&(d.lanes|=s),Go(g,s,e),g=null}else g=f.child;if(g!==null)g.return=f;else for(g=f;g!==null;){if(g===e){g=null;break}if(f=g.sibling,f!==null){f.return=g.return,g=f;break}g=g.return}f=g}}function Za(e,n,s,u){e=null;for(var f=n,d=!1;f!==null;){if(!d){if((f.flags&524288)!==0)d=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var g=f.alternate;if(g===null)throw Error(l(387));if(g=g.memoizedProps,g!==null){var k=f.type;Xt(f.pendingProps.value,g.value)||(e!==null?e.push(k):e=[k])}}else if(f===ye.current){if(g=f.alternate,g===null)throw Error(l(387));g.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Sl):e=[Sl])}f=f.return}e!==null&&$o(n,e,s,u),n.flags|=262144}function yr(e){for(e=e.firstContext;e!==null;){if(!Xt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function sa(e){aa=e,Xn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return Vh(aa,e)}function br(e,n){return aa===null&&sa(e),Vh(e,n)}function Vh(e,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},Xn===null){if(e===null)throw Error(l(308));Xn=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Xn=Xn.next=n;return s}var r0=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(s,u){e.push(u)}};this.abort=function(){n.aborted=!0,e.forEach(function(s){return s()})}},u0=i.unstable_scheduleCallback,o0=i.unstable_NormalPriority,dt={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ko(){return{controller:new r0,data:new Map,refCount:0}}function Xs(e){e.refCount--,e.refCount===0&&u0(o0,function(){e.controller.abort()})}var Fs=null,Zo=0,Qa=0,Xa=null;function c0(e,n){if(Fs===null){var s=Fs=[];Zo=0,Qa=Fc(),Xa={status:"pending",value:void 0,then:function(u){s.push(u)}}}return Zo++,n.then(Yh,Yh),n}function Yh(){if(--Zo===0&&Fs!==null){Xa!==null&&(Xa.status="fulfilled");var e=Fs;Fs=null,Qa=0,Xa=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function f0(e,n){var s=[],u={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return e.then(function(){u.status="fulfilled",u.value=n;for(var f=0;f<s.length;f++)(0,s[f])(n)},function(f){for(u.status="rejected",u.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),u}var Gh=U.S;U.S=function(e,n){Ep=Ot(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&c0(e,n),Gh!==null&&Gh(e,n)};var la=E(null);function Qo(){var e=la.current;return e!==null?e:Je.pooledCache}function vr(e,n){n===null?w(la,la.current):w(la,n.pool)}function $h(){var e=Qo();return e===null?null:{parent:dt._currentValue,pool:e}}var Fa=Error(l(460)),Xo=Error(l(474)),xr=Error(l(542)),Sr={then:function(){}};function Kh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Zh(e,n,s){switch(s=e[s],s===void 0?e.push(n):s!==n&&(n.then($n,$n),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Xh(e),e;default:if(typeof n.status=="string")n.then($n,$n);else{if(e=Je,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=n,e.status="pending",e.then(function(u){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=u}},function(u){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=u}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Xh(e),e}throw ua=n,Fa}}function ra(e){try{var n=e._init;return n(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ua=s,Fa):s}}var ua=null;function Qh(){if(ua===null)throw Error(l(459));var e=ua;return ua=null,e}function Xh(e){if(e===Fa||e===xr)throw Error(l(483))}var Ja=null,Js=0;function kr(e){var n=Js;return Js+=1,Ja===null&&(Ja=[]),Zh(Ja,e,n)}function Ws(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function wr(e,n){throw n.$$typeof===S?Error(l(525)):(e=Object.prototype.toString.call(n),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Fh(e){function n(D,O){if(e){var z=D.deletions;z===null?(D.deletions=[O],D.flags|=16):z.push(O)}}function s(D,O){if(!e)return null;for(;O!==null;)n(D,O),O=O.sibling;return null}function u(D){for(var O=new Map;D!==null;)D.key!==null?O.set(D.key,D):O.set(D.index,D),D=D.sibling;return O}function f(D,O){return D=Zn(D,O),D.index=0,D.sibling=null,D}function d(D,O,z){return D.index=z,e?(z=D.alternate,z!==null?(z=z.index,z<O?(D.flags|=67108866,O):z):(D.flags|=67108866,O)):(D.flags|=1048576,O)}function g(D){return e&&D.alternate===null&&(D.flags|=67108866),D}function k(D,O,z,K){return O===null||O.tag!==6?(O=Bo(z,D.mode,K),O.return=D,O):(O=f(O,z),O.return=D,O)}function A(D,O,z,K){var ge=z.type;return ge===T?G(D,O,z.props.children,K,z.key):O!==null&&(O.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===B&&ra(ge)===O.type)?(O=f(O,z.props),Ws(O,z),O.return=D,O):(O=pr(z.type,z.key,z.props,null,D.mode,K),Ws(O,z),O.return=D,O)}function R(D,O,z,K){return O===null||O.tag!==4||O.stateNode.containerInfo!==z.containerInfo||O.stateNode.implementation!==z.implementation?(O=qo(z,D.mode,K),O.return=D,O):(O=f(O,z.children||[]),O.return=D,O)}function G(D,O,z,K,ge){return O===null||O.tag!==7?(O=na(z,D.mode,K,ge),O.return=D,O):(O=f(O,z),O.return=D,O)}function Q(D,O,z){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=Bo(""+O,D.mode,z),O.return=D,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case x:return z=pr(O.type,O.key,O.props,null,D.mode,z),Ws(z,O),z.return=D,z;case N:return O=qo(O,D.mode,z),O.return=D,O;case B:return O=ra(O),Q(D,O,z)}if(be(O)||ne(O))return O=na(O,D.mode,z,null),O.return=D,O;if(typeof O.then=="function")return Q(D,kr(O),z);if(O.$$typeof===H)return Q(D,br(D,O),z);wr(D,O)}return null}function L(D,O,z,K){var ge=O!==null?O.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return ge!==null?null:k(D,O,""+z,K);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case x:return z.key===ge?A(D,O,z,K):null;case N:return z.key===ge?R(D,O,z,K):null;case B:return z=ra(z),L(D,O,z,K)}if(be(z)||ne(z))return ge!==null?null:G(D,O,z,K,null);if(typeof z.then=="function")return L(D,O,kr(z),K);if(z.$$typeof===H)return L(D,O,br(D,z),K);wr(D,z)}return null}function I(D,O,z,K,ge){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return D=D.get(z)||null,k(O,D,""+K,ge);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case x:return D=D.get(K.key===null?z:K.key)||null,A(O,D,K,ge);case N:return D=D.get(K.key===null?z:K.key)||null,R(O,D,K,ge);case B:return K=ra(K),I(D,O,z,K,ge)}if(be(K)||ne(K))return D=D.get(z)||null,G(O,D,K,ge,null);if(typeof K.then=="function")return I(D,O,z,kr(K),ge);if(K.$$typeof===H)return I(D,O,z,br(O,K),ge);wr(O,K)}return null}function ce(D,O,z,K){for(var ge=null,Ue=null,he=O,Ne=O=0,ze=null;he!==null&&Ne<z.length;Ne++){he.index>Ne?(ze=he,he=null):ze=he.sibling;var Ie=L(D,he,z[Ne],K);if(Ie===null){he===null&&(he=ze);break}e&&he&&Ie.alternate===null&&n(D,he),O=d(Ie,O,Ne),Ue===null?ge=Ie:Ue.sibling=Ie,Ue=Ie,he=ze}if(Ne===z.length)return s(D,he),Le&&Qn(D,Ne),ge;if(he===null){for(;Ne<z.length;Ne++)he=Q(D,z[Ne],K),he!==null&&(O=d(he,O,Ne),Ue===null?ge=he:Ue.sibling=he,Ue=he);return Le&&Qn(D,Ne),ge}for(he=u(he);Ne<z.length;Ne++)ze=I(he,D,Ne,z[Ne],K),ze!==null&&(e&&ze.alternate!==null&&he.delete(ze.key===null?Ne:ze.key),O=d(ze,O,Ne),Ue===null?ge=ze:Ue.sibling=ze,Ue=ze);return e&&he.forEach(function(Ii){return n(D,Ii)}),Le&&Qn(D,Ne),ge}function ve(D,O,z,K){if(z==null)throw Error(l(151));for(var ge=null,Ue=null,he=O,Ne=O=0,ze=null,Ie=z.next();he!==null&&!Ie.done;Ne++,Ie=z.next()){he.index>Ne?(ze=he,he=null):ze=he.sibling;var Ii=L(D,he,Ie.value,K);if(Ii===null){he===null&&(he=ze);break}e&&he&&Ii.alternate===null&&n(D,he),O=d(Ii,O,Ne),Ue===null?ge=Ii:Ue.sibling=Ii,Ue=Ii,he=ze}if(Ie.done)return s(D,he),Le&&Qn(D,Ne),ge;if(he===null){for(;!Ie.done;Ne++,Ie=z.next())Ie=Q(D,Ie.value,K),Ie!==null&&(O=d(Ie,O,Ne),Ue===null?ge=Ie:Ue.sibling=Ie,Ue=Ie);return Le&&Qn(D,Ne),ge}for(he=u(he);!Ie.done;Ne++,Ie=z.next())Ie=I(he,D,Ne,Ie.value,K),Ie!==null&&(e&&Ie.alternate!==null&&he.delete(Ie.key===null?Ne:Ie.key),O=d(Ie,O,Ne),Ue===null?ge=Ie:Ue.sibling=Ie,Ue=Ie);return e&&he.forEach(function(kx){return n(D,kx)}),Le&&Qn(D,Ne),ge}function Xe(D,O,z,K){if(typeof z=="object"&&z!==null&&z.type===T&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case x:e:{for(var ge=z.key;O!==null;){if(O.key===ge){if(ge=z.type,ge===T){if(O.tag===7){s(D,O.sibling),K=f(O,z.props.children),K.return=D,D=K;break e}}else if(O.elementType===ge||typeof ge=="object"&&ge!==null&&ge.$$typeof===B&&ra(ge)===O.type){s(D,O.sibling),K=f(O,z.props),Ws(K,z),K.return=D,D=K;break e}s(D,O);break}else n(D,O);O=O.sibling}z.type===T?(K=na(z.props.children,D.mode,K,z.key),K.return=D,D=K):(K=pr(z.type,z.key,z.props,null,D.mode,K),Ws(K,z),K.return=D,D=K)}return g(D);case N:e:{for(ge=z.key;O!==null;){if(O.key===ge)if(O.tag===4&&O.stateNode.containerInfo===z.containerInfo&&O.stateNode.implementation===z.implementation){s(D,O.sibling),K=f(O,z.children||[]),K.return=D,D=K;break e}else{s(D,O);break}else n(D,O);O=O.sibling}K=qo(z,D.mode,K),K.return=D,D=K}return g(D);case B:return z=ra(z),Xe(D,O,z,K)}if(be(z))return ce(D,O,z,K);if(ne(z)){if(ge=ne(z),typeof ge!="function")throw Error(l(150));return z=ge.call(z),ve(D,O,z,K)}if(typeof z.then=="function")return Xe(D,O,kr(z),K);if(z.$$typeof===H)return Xe(D,O,br(D,z),K);wr(D,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,O!==null&&O.tag===6?(s(D,O.sibling),K=f(O,z),K.return=D,D=K):(s(D,O),K=Bo(z,D.mode,K),K.return=D,D=K),g(D)):s(D,O)}return function(D,O,z,K){try{Js=0;var ge=Xe(D,O,z,K);return Ja=null,ge}catch(he){if(he===Fa||he===xr)throw he;var Ue=Ft(29,he,null,D.mode);return Ue.lanes=K,Ue.return=D,Ue}finally{}}}var oa=Fh(!0),Jh=Fh(!1),wi=!1;function Fo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jo(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _i(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ti(e,n,s){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(He&2)!==0){var f=u.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),u.pending=n,n=mr(e),zh(e,null,s),n}return hr(e,u,n,s),mr(e)}function Ps(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var u=n.lanes;u&=e.pendingLanes,s|=u,n.lanes=s,Vd(e,s)}}function Wo(e,n){var s=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,s===u)){var f=null,d=null;if(s=s.firstBaseUpdate,s!==null){do{var g={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};d===null?f=d=g:d=d.next=g,s=s.next}while(s!==null);d===null?f=d=n:d=d.next=n}else f=d=n;s={baseState:u.baseState,firstBaseUpdate:f,lastBaseUpdate:d,shared:u.shared,callbacks:u.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}var Po=!1;function el(){if(Po){var e=Xa;if(e!==null)throw e}}function tl(e,n,s,u){Po=!1;var f=e.updateQueue;wi=!1;var d=f.firstBaseUpdate,g=f.lastBaseUpdate,k=f.shared.pending;if(k!==null){f.shared.pending=null;var A=k,R=A.next;A.next=null,g===null?d=R:g.next=R,g=A;var G=e.alternate;G!==null&&(G=G.updateQueue,k=G.lastBaseUpdate,k!==g&&(k===null?G.firstBaseUpdate=R:k.next=R,G.lastBaseUpdate=A))}if(d!==null){var Q=f.baseState;g=0,G=R=A=null,k=d;do{var L=k.lane&-536870913,I=L!==k.lane;if(I?(De&L)===L:(u&L)===L){L!==0&&L===Qa&&(Po=!0),G!==null&&(G=G.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ce=e,ve=k;L=n;var Xe=s;switch(ve.tag){case 1:if(ce=ve.payload,typeof ce=="function"){Q=ce.call(Xe,Q,L);break e}Q=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=ve.payload,L=typeof ce=="function"?ce.call(Xe,Q,L):ce,L==null)break e;Q=y({},Q,L);break e;case 2:wi=!0}}L=k.callback,L!==null&&(e.flags|=64,I&&(e.flags|=8192),I=f.callbacks,I===null?f.callbacks=[L]:I.push(L))}else I={lane:L,tag:k.tag,payload:k.payload,callback:k.callback,next:null},G===null?(R=G=I,A=Q):G=G.next=I,g|=L;if(k=k.next,k===null){if(k=f.shared.pending,k===null)break;I=k,k=I.next,I.next=null,f.lastBaseUpdate=I,f.shared.pending=null}}while(!0);G===null&&(A=Q),f.baseState=A,f.firstBaseUpdate=R,f.lastBaseUpdate=G,d===null&&(f.shared.lanes=0),Oi|=g,e.lanes=g,e.memoizedState=Q}}function Wh(e,n){if(typeof e!="function")throw Error(l(191,e));e.call(n)}function Ph(e,n){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Wh(s[e],n)}var Wa=E(null),_r=E(0);function em(e,n){e=si,w(_r,e),w(Wa,n),si=e|n.baseLanes}function ec(){w(_r,si),w(Wa,Wa.current)}function tc(){si=_r.current,V(Wa),V(_r)}var Jt=E(null),dn=null;function Ai(e){var n=e.alternate;w(lt,lt.current&1),w(Jt,e),dn===null&&(n===null||Wa.current!==null||n.memoizedState!==null)&&(dn=e)}function nc(e){w(lt,lt.current),w(Jt,e),dn===null&&(dn=e)}function tm(e){e.tag===22?(w(lt,lt.current),w(Jt,e),dn===null&&(dn=e)):Ei()}function Ei(){w(lt,lt.current),w(Jt,Jt.current)}function Wt(e){V(Jt),dn===e&&(dn=null),V(lt)}var lt=E(0);function Tr(e){for(var n=e;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||of(s)||cf(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Jn=0,Ee=null,Ze=null,ht=null,Ar=!1,Pa=!1,ca=!1,Er=0,nl=0,es=null,d0=0;function at(){throw Error(l(321))}function ic(e,n){if(n===null)return!1;for(var s=0;s<n.length&&s<e.length;s++)if(!Xt(e[s],n[s]))return!1;return!0}function ac(e,n,s,u,f,d){return Jn=d,Ee=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,U.H=e===null||e.memoizedState===null?qm:vc,ca=!1,d=s(u,f),ca=!1,Pa&&(d=im(n,s,u,f)),nm(e),d}function nm(e){U.H=sl;var n=Ze!==null&&Ze.next!==null;if(Jn=0,ht=Ze=Ee=null,Ar=!1,nl=0,es=null,n)throw Error(l(300));e===null||mt||(e=e.dependencies,e!==null&&yr(e)&&(mt=!0))}function im(e,n,s,u){Ee=e;var f=0;do{if(Pa&&(es=null),nl=0,Pa=!1,25<=f)throw Error(l(301));if(f+=1,ht=Ze=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}U.H=Um,d=n(s,u)}while(Pa);return d}function h0(){var e=U.H,n=e.useState()[0];return n=typeof n.then=="function"?il(n):n,e=e.useState()[0],(Ze!==null?Ze.memoizedState:null)!==e&&(Ee.flags|=1024),n}function sc(){var e=Er!==0;return Er=0,e}function lc(e,n,s){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~s}function rc(e){if(Ar){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Ar=!1}Jn=0,ht=Ze=Ee=null,Pa=!1,nl=Er=0,es=null}function Mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?Ee.memoizedState=ht=e:ht=ht.next=e,ht}function rt(){if(Ze===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var n=ht===null?Ee.memoizedState:ht.next;if(n!==null)ht=n,Ze=e;else{if(e===null)throw Ee.alternate===null?Error(l(467)):Error(l(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},ht===null?Ee.memoizedState=ht=e:ht=ht.next=e}return ht}function Nr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function il(e){var n=nl;return nl+=1,es===null&&(es=[]),e=Zh(es,e,n),n=Ee,(ht===null?n.memoizedState:ht.next)===null&&(n=n.alternate,U.H=n===null||n.memoizedState===null?qm:vc),e}function Cr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return il(e);if(e.$$typeof===H)return Tt(e)}throw Error(l(438,String(e)))}function uc(e){var n=null,s=Ee.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var u=Ee.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(n={data:u.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=Nr(),Ee.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(e),u=0;u<e;u++)s[u]=F;return n.index++,s}function Wn(e,n){return typeof n=="function"?n(e):n}function Or(e){var n=rt();return oc(n,Ze,e)}function oc(e,n,s){var u=e.queue;if(u===null)throw Error(l(311));u.lastRenderedReducer=s;var f=e.baseQueue,d=u.pending;if(d!==null){if(f!==null){var g=f.next;f.next=d.next,d.next=g}n.baseQueue=f=d,u.pending=null}if(d=e.baseState,f===null)e.memoizedState=d;else{n=f.next;var k=g=null,A=null,R=n,G=!1;do{var Q=R.lane&-536870913;if(Q!==R.lane?(De&Q)===Q:(Jn&Q)===Q){var L=R.revertLane;if(L===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),Q===Qa&&(G=!0);else if((Jn&L)===L){R=R.next,L===Qa&&(G=!0);continue}else Q={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},A===null?(k=A=Q,g=d):A=A.next=Q,Ee.lanes|=L,Oi|=L;Q=R.action,ca&&s(d,Q),d=R.hasEagerState?R.eagerState:s(d,Q)}else L={lane:Q,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},A===null?(k=A=L,g=d):A=A.next=L,Ee.lanes|=Q,Oi|=Q;R=R.next}while(R!==null&&R!==n);if(A===null?g=d:A.next=k,!Xt(d,e.memoizedState)&&(mt=!0,G&&(s=Xa,s!==null)))throw s;e.memoizedState=d,e.baseState=g,e.baseQueue=A,u.lastRenderedState=d}return f===null&&(u.lanes=0),[e.memoizedState,u.dispatch]}function cc(e){var n=rt(),s=n.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var u=s.dispatch,f=s.pending,d=n.memoizedState;if(f!==null){s.pending=null;var g=f=f.next;do d=e(d,g.action),g=g.next;while(g!==f);Xt(d,n.memoizedState)||(mt=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),s.lastRenderedState=d}return[d,u]}function am(e,n,s){var u=Ee,f=rt(),d=Le;if(d){if(s===void 0)throw Error(l(407));s=s()}else s=n();var g=!Xt((Ze||f).memoizedState,s);if(g&&(f.memoizedState=s,mt=!0),f=f.queue,hc(rm.bind(null,u,f,e),[e]),f.getSnapshot!==n||g||ht!==null&&ht.memoizedState.tag&1){if(u.flags|=2048,ts(9,{destroy:void 0},lm.bind(null,u,f,s,n),null),Je===null)throw Error(l(349));d||(Jn&127)!==0||sm(u,n,s)}return s}function sm(e,n,s){e.flags|=16384,e={getSnapshot:n,value:s},n=Ee.updateQueue,n===null?(n=Nr(),Ee.updateQueue=n,n.stores=[e]):(s=n.stores,s===null?n.stores=[e]:s.push(e))}function lm(e,n,s,u){n.value=s,n.getSnapshot=u,um(n)&&om(e)}function rm(e,n,s){return s(function(){um(n)&&om(e)})}function um(e){var n=e.getSnapshot;e=e.value;try{var s=n();return!Xt(e,s)}catch{return!0}}function om(e){var n=ta(e,2);n!==null&&Gt(n,e,2)}function fc(e){var n=Mt();if(typeof e=="function"){var s=e;if(e=s(),ca){Bt(!0);try{s()}finally{Bt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:e},n}function cm(e,n,s,u){return e.baseState=s,oc(e,Ze,typeof u=="function"?u:Wn)}function m0(e,n,s,u,f){if(Dr(e))throw Error(l(485));if(e=n.action,e!==null){var d={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){d.listeners.push(g)}};U.T!==null?s(!0):d.isTransition=!1,u(d),s=n.pending,s===null?(d.next=n.pending=d,fm(n,d)):(d.next=s.next,n.pending=s.next=d)}}function fm(e,n){var s=n.action,u=n.payload,f=e.state;if(n.isTransition){var d=U.T,g={};U.T=g;try{var k=s(f,u),A=U.S;A!==null&&A(g,k),dm(e,n,k)}catch(R){dc(e,n,R)}finally{d!==null&&g.types!==null&&(d.types=g.types),U.T=d}}else try{d=s(f,u),dm(e,n,d)}catch(R){dc(e,n,R)}}function dm(e,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(u){hm(e,n,u)},function(u){return dc(e,n,u)}):hm(e,n,s)}function hm(e,n,s){n.status="fulfilled",n.value=s,mm(n),e.state=s,n=e.pending,n!==null&&(s=n.next,s===n?e.pending=null:(s=s.next,n.next=s,fm(e,s)))}function dc(e,n,s){var u=e.pending;if(e.pending=null,u!==null){u=u.next;do n.status="rejected",n.reason=s,mm(n),n=n.next;while(n!==u)}e.action=null}function mm(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function pm(e,n){return n}function gm(e,n){if(Le){var s=Je.formState;if(s!==null){e:{var u=Ee;if(Le){if(et){t:{for(var f=et,d=fn;f.nodeType!==8;){if(!d){f=null;break t}if(f=hn(f.nextSibling),f===null){f=null;break t}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){et=hn(f.nextSibling),u=f.data==="F!";break e}}Si(u)}u=!1}u&&(n=s[0])}}return s=Mt(),s.memoizedState=s.baseState=n,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:pm,lastRenderedState:n},s.queue=u,s=Rm.bind(null,Ee,u),u.dispatch=s,u=fc(!1),d=bc.bind(null,Ee,!1,u.queue),u=Mt(),f={state:n,dispatch:null,action:e,pending:null},u.queue=f,s=m0.bind(null,Ee,f,d,s),f.dispatch=s,u.memoizedState=e,[n,s,!1]}function ym(e){var n=rt();return bm(n,Ze,e)}function bm(e,n,s){if(n=oc(e,n,pm)[0],e=Or(Wn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var u=il(n)}catch(g){throw g===Fa?xr:g}else u=n;n=rt();var f=n.queue,d=f.dispatch;return s!==n.memoizedState&&(Ee.flags|=2048,ts(9,{destroy:void 0},p0.bind(null,f,s),null)),[u,d,e]}function p0(e,n){e.action=n}function vm(e){var n=rt(),s=Ze;if(s!==null)return bm(n,s,e);rt(),n=n.memoizedState,s=rt();var u=s.queue.dispatch;return s.memoizedState=e,[n,u,!1]}function ts(e,n,s,u){return e={tag:e,create:s,deps:u,inst:n,next:null},n=Ee.updateQueue,n===null&&(n=Nr(),Ee.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=e.next=e:(u=s.next,s.next=e,e.next=u,n.lastEffect=e),e}function xm(){return rt().memoizedState}function jr(e,n,s,u){var f=Mt();Ee.flags|=e,f.memoizedState=ts(1|n,{destroy:void 0},s,u===void 0?null:u)}function Mr(e,n,s,u){var f=rt();u=u===void 0?null:u;var d=f.memoizedState.inst;Ze!==null&&u!==null&&ic(u,Ze.memoizedState.deps)?f.memoizedState=ts(n,d,s,u):(Ee.flags|=e,f.memoizedState=ts(1|n,d,s,u))}function Sm(e,n){jr(8390656,8,e,n)}function hc(e,n){Mr(2048,8,e,n)}function g0(e){Ee.flags|=4;var n=Ee.updateQueue;if(n===null)n=Nr(),Ee.updateQueue=n,n.events=[e];else{var s=n.events;s===null?n.events=[e]:s.push(e)}}function km(e){var n=rt().memoizedState;return g0({ref:n,nextImpl:e}),function(){if((He&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function wm(e,n){return Mr(4,2,e,n)}function _m(e,n){return Mr(4,4,e,n)}function Tm(e,n){if(typeof n=="function"){e=e();var s=n(e);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Am(e,n,s){s=s!=null?s.concat([e]):null,Mr(4,4,Tm.bind(null,n,e),s)}function mc(){}function Em(e,n){var s=rt();n=n===void 0?null:n;var u=s.memoizedState;return n!==null&&ic(n,u[1])?u[0]:(s.memoizedState=[e,n],e)}function Nm(e,n){var s=rt();n=n===void 0?null:n;var u=s.memoizedState;if(n!==null&&ic(n,u[1]))return u[0];if(u=e(),ca){Bt(!0);try{e()}finally{Bt(!1)}}return s.memoizedState=[u,n],u}function pc(e,n,s){return s===void 0||(Jn&1073741824)!==0&&(De&261930)===0?e.memoizedState=n:(e.memoizedState=s,e=Cp(),Ee.lanes|=e,Oi|=e,s)}function Cm(e,n,s,u){return Xt(s,n)?s:Wa.current!==null?(e=pc(e,s,u),Xt(e,n)||(mt=!0),e):(Jn&42)===0||(Jn&1073741824)!==0&&(De&261930)===0?(mt=!0,e.memoizedState=s):(e=Cp(),Ee.lanes|=e,Oi|=e,n)}function Om(e,n,s,u,f){var d=J.p;J.p=d!==0&&8>d?d:8;var g=U.T,k={};U.T=k,bc(e,!1,n,s);try{var A=f(),R=U.S;if(R!==null&&R(k,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var G=f0(A,u);al(e,n,G,tn(e))}else al(e,n,u,tn(e))}catch(Q){al(e,n,{then:function(){},status:"rejected",reason:Q},tn())}finally{J.p=d,g!==null&&k.types!==null&&(g.types=k.types),U.T=g}}function y0(){}function gc(e,n,s,u){if(e.tag!==5)throw Error(l(476));var f=jm(e).queue;Om(e,f,n,de,s===null?y0:function(){return Mm(e),s(u)})}function jm(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:de},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wn,lastRenderedState:s},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Mm(e){var n=jm(e);n.next===null&&(n=e.alternate.memoizedState),al(e,n.next.queue,{},tn())}function yc(){return Tt(Sl)}function Dm(){return rt().memoizedState}function zm(){return rt().memoizedState}function b0(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var s=tn();e=_i(s);var u=Ti(n,e,s);u!==null&&(Gt(u,n,s),Ps(u,n,s)),n={cache:Ko()},e.payload=n;return}n=n.return}}function v0(e,n,s){var u=tn();s={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Dr(e)?Lm(n,s):(s=Ro(e,n,s,u),s!==null&&(Gt(s,e,u),Bm(s,n,u)))}function Rm(e,n,s){var u=tn();al(e,n,s,u)}function al(e,n,s,u){var f={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Dr(e))Lm(n,f);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var g=n.lastRenderedState,k=d(g,s);if(f.hasEagerState=!0,f.eagerState=k,Xt(k,g))return hr(e,n,f,0),Je===null&&dr(),!1}catch{}finally{}if(s=Ro(e,n,f,u),s!==null)return Gt(s,e,u),Bm(s,n,u),!0}return!1}function bc(e,n,s,u){if(u={lane:2,revertLane:Fc(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Dr(e)){if(n)throw Error(l(479))}else n=Ro(e,s,u,2),n!==null&&Gt(n,e,2)}function Dr(e){var n=e.alternate;return e===Ee||n!==null&&n===Ee}function Lm(e,n){Pa=Ar=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function Bm(e,n,s){if((s&4194048)!==0){var u=n.lanes;u&=e.pendingLanes,s|=u,n.lanes=s,Vd(e,s)}}var sl={readContext:Tt,use:Cr,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};sl.useEffectEvent=at;var qm={readContext:Tt,use:Cr,useCallback:function(e,n){return Mt().memoizedState=[e,n===void 0?null:n],e},useContext:Tt,useEffect:Sm,useImperativeHandle:function(e,n,s){s=s!=null?s.concat([e]):null,jr(4194308,4,Tm.bind(null,n,e),s)},useLayoutEffect:function(e,n){return jr(4194308,4,e,n)},useInsertionEffect:function(e,n){jr(4,2,e,n)},useMemo:function(e,n){var s=Mt();n=n===void 0?null:n;var u=e();if(ca){Bt(!0);try{e()}finally{Bt(!1)}}return s.memoizedState=[u,n],u},useReducer:function(e,n,s){var u=Mt();if(s!==void 0){var f=s(n);if(ca){Bt(!0);try{s(n)}finally{Bt(!1)}}}else f=n;return u.memoizedState=u.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},u.queue=e,e=e.dispatch=v0.bind(null,Ee,e),[u.memoizedState,e]},useRef:function(e){var n=Mt();return e={current:e},n.memoizedState=e},useState:function(e){e=fc(e);var n=e.queue,s=Rm.bind(null,Ee,n);return n.dispatch=s,[e.memoizedState,s]},useDebugValue:mc,useDeferredValue:function(e,n){var s=Mt();return pc(s,e,n)},useTransition:function(){var e=fc(!1);return e=Om.bind(null,Ee,e.queue,!0,!1),Mt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,s){var u=Ee,f=Mt();if(Le){if(s===void 0)throw Error(l(407));s=s()}else{if(s=n(),Je===null)throw Error(l(349));(De&127)!==0||sm(u,n,s)}f.memoizedState=s;var d={value:s,getSnapshot:n};return f.queue=d,Sm(rm.bind(null,u,d,e),[e]),u.flags|=2048,ts(9,{destroy:void 0},lm.bind(null,u,d,s,n),null),s},useId:function(){var e=Mt(),n=Je.identifierPrefix;if(Le){var s=jn,u=On;s=(u&~(1<<32-Fe(u)-1)).toString(32)+s,n="_"+n+"R_"+s,s=Er++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=d0++,n="_"+n+"r_"+s.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:yc,useFormState:gm,useActionState:gm,useOptimistic:function(e){var n=Mt();n.memoizedState=n.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=bc.bind(null,Ee,!0,s),s.dispatch=n,[e,n]},useMemoCache:uc,useCacheRefresh:function(){return Mt().memoizedState=b0.bind(null,Ee)},useEffectEvent:function(e){var n=Mt(),s={impl:e};return n.memoizedState=s,function(){if((He&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},vc={readContext:Tt,use:Cr,useCallback:Em,useContext:Tt,useEffect:hc,useImperativeHandle:Am,useInsertionEffect:wm,useLayoutEffect:_m,useMemo:Nm,useReducer:Or,useRef:xm,useState:function(){return Or(Wn)},useDebugValue:mc,useDeferredValue:function(e,n){var s=rt();return Cm(s,Ze.memoizedState,e,n)},useTransition:function(){var e=Or(Wn)[0],n=rt().memoizedState;return[typeof e=="boolean"?e:il(e),n]},useSyncExternalStore:am,useId:Dm,useHostTransitionStatus:yc,useFormState:ym,useActionState:ym,useOptimistic:function(e,n){var s=rt();return cm(s,Ze,e,n)},useMemoCache:uc,useCacheRefresh:zm};vc.useEffectEvent=km;var Um={readContext:Tt,use:Cr,useCallback:Em,useContext:Tt,useEffect:hc,useImperativeHandle:Am,useInsertionEffect:wm,useLayoutEffect:_m,useMemo:Nm,useReducer:cc,useRef:xm,useState:function(){return cc(Wn)},useDebugValue:mc,useDeferredValue:function(e,n){var s=rt();return Ze===null?pc(s,e,n):Cm(s,Ze.memoizedState,e,n)},useTransition:function(){var e=cc(Wn)[0],n=rt().memoizedState;return[typeof e=="boolean"?e:il(e),n]},useSyncExternalStore:am,useId:Dm,useHostTransitionStatus:yc,useFormState:vm,useActionState:vm,useOptimistic:function(e,n){var s=rt();return Ze!==null?cm(s,Ze,e,n):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:uc,useCacheRefresh:zm};Um.useEffectEvent=km;function xc(e,n,s,u){n=e.memoizedState,s=s(u,n),s=s==null?n:y({},n,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Sc={enqueueSetState:function(e,n,s){e=e._reactInternals;var u=tn(),f=_i(u);f.payload=n,s!=null&&(f.callback=s),n=Ti(e,f,u),n!==null&&(Gt(n,e,u),Ps(n,e,u))},enqueueReplaceState:function(e,n,s){e=e._reactInternals;var u=tn(),f=_i(u);f.tag=1,f.payload=n,s!=null&&(f.callback=s),n=Ti(e,f,u),n!==null&&(Gt(n,e,u),Ps(n,e,u))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var s=tn(),u=_i(s);u.tag=2,n!=null&&(u.callback=n),n=Ti(e,u,s),n!==null&&(Gt(n,e,s),Ps(n,e,s))}};function Im(e,n,s,u,f,d,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,d,g):n.prototype&&n.prototype.isPureReactComponent?!$s(s,u)||!$s(f,d):!0}function Hm(e,n,s,u){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,u),n.state!==e&&Sc.enqueueReplaceState(n,n.state,null)}function fa(e,n){var s=n;if("ref"in n){s={};for(var u in n)u!=="ref"&&(s[u]=n[u])}if(e=e.defaultProps){s===n&&(s=y({},s));for(var f in e)s[f]===void 0&&(s[f]=e[f])}return s}function Vm(e){fr(e)}function Ym(e){console.error(e)}function Gm(e){fr(e)}function zr(e,n){try{var s=e.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(u){setTimeout(function(){throw u})}}function $m(e,n,s){try{var u=e.onCaughtError;u(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function kc(e,n,s){return s=_i(s),s.tag=3,s.payload={element:null},s.callback=function(){zr(e,n)},s}function Km(e){return e=_i(e),e.tag=3,e}function Zm(e,n,s,u){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var d=u.value;e.payload=function(){return f(d)},e.callback=function(){$m(n,s,u)}}var g=s.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){$m(n,s,u),typeof f!="function"&&(ji===null?ji=new Set([this]):ji.add(this));var k=u.stack;this.componentDidCatch(u.value,{componentStack:k!==null?k:""})})}function x0(e,n,s,u,f){if(s.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(n=s.alternate,n!==null&&Za(n,s,f,!0),s=Jt.current,s!==null){switch(s.tag){case 31:case 13:return dn===null?Kr():s.alternate===null&&st===0&&(st=3),s.flags&=-257,s.flags|=65536,s.lanes=f,u===Sr?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([u]):n.add(u),Zc(e,u,f)),!1;case 22:return s.flags|=65536,u===Sr?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([u])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([u]):s.add(u)),Zc(e,u,f)),!1}throw Error(l(435,s.tag))}return Zc(e,u,f),Kr(),!1}if(Le)return n=Jt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,u!==Ho&&(e=Error(l(422),{cause:u}),Qs(un(e,s)))):(u!==Ho&&(n=Error(l(423),{cause:u}),Qs(un(n,s))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,u=un(u,s),f=kc(e.stateNode,u,f),Wo(e,f),st!==4&&(st=2)),!1;var d=Error(l(520),{cause:u});if(d=un(d,s),hl===null?hl=[d]:hl.push(d),st!==4&&(st=2),n===null)return!0;u=un(u,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,e=f&-f,s.lanes|=e,e=kc(s.stateNode,u,e),Wo(s,e),!1;case 1:if(n=s.type,d=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(ji===null||!ji.has(d))))return s.flags|=65536,f&=-f,s.lanes|=f,f=Km(f),Zm(f,e,s,u),Wo(s,f),!1}s=s.return}while(s!==null);return!1}var wc=Error(l(461)),mt=!1;function At(e,n,s,u){n.child=e===null?Jh(n,null,s,u):oa(n,e.child,s,u)}function Qm(e,n,s,u,f){s=s.render;var d=n.ref;if("ref"in u){var g={};for(var k in u)k!=="ref"&&(g[k]=u[k])}else g=u;return sa(n),u=ac(e,n,s,g,d,f),k=sc(),e!==null&&!mt?(lc(e,n,f),Pn(e,n,f)):(Le&&k&&Uo(n),n.flags|=1,At(e,n,u,f),n.child)}function Xm(e,n,s,u,f){if(e===null){var d=s.type;return typeof d=="function"&&!Lo(d)&&d.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=d,Fm(e,n,d,u,f)):(e=pr(s.type,null,u,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(d=e.child,!jc(e,f)){var g=d.memoizedProps;if(s=s.compare,s=s!==null?s:$s,s(g,u)&&e.ref===n.ref)return Pn(e,n,f)}return n.flags|=1,e=Zn(d,u),e.ref=n.ref,e.return=n,n.child=e}function Fm(e,n,s,u,f){if(e!==null){var d=e.memoizedProps;if($s(d,u)&&e.ref===n.ref)if(mt=!1,n.pendingProps=u=d,jc(e,f))(e.flags&131072)!==0&&(mt=!0);else return n.lanes=e.lanes,Pn(e,n,f)}return _c(e,n,s,u,f)}function Jm(e,n,s,u){var f=u.children,d=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((n.flags&128)!==0){if(d=d!==null?d.baseLanes|s:s,e!==null){for(u=n.child=e.child,f=0;u!==null;)f=f|u.lanes|u.childLanes,u=u.sibling;u=f&~d}else u=0,n.child=null;return Wm(e,n,d,s,u)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&vr(n,d!==null?d.cachePool:null),d!==null?em(n,d):ec(),tm(n);else return u=n.lanes=536870912,Wm(e,n,d!==null?d.baseLanes|s:s,s,u)}else d!==null?(vr(n,d.cachePool),em(n,d),Ei(),n.memoizedState=null):(e!==null&&vr(n,null),ec(),Ei());return At(e,n,f,s),n.child}function ll(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Wm(e,n,s,u,f){var d=Qo();return d=d===null?null:{parent:dt._currentValue,pool:d},n.memoizedState={baseLanes:s,cachePool:d},e!==null&&vr(n,null),ec(),tm(n),e!==null&&Za(e,n,u,!0),n.childLanes=f,null}function Rr(e,n){return n=Br({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Pm(e,n,s){return oa(n,e.child,null,s),e=Rr(n,n.pendingProps),e.flags|=2,Wt(n),n.memoizedState=null,e}function S0(e,n,s){var u=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Le){if(u.mode==="hidden")return e=Rr(n,u),n.lanes=536870912,ll(null,e);if(nc(n),(e=et)?(e=fg(e,fn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:vi!==null?{id:On,overflow:jn}:null,retryLane:536870912,hydrationErrors:null},s=Lh(e),s.return=n,n.child=s,_t=n,et=null)):e=null,e===null)throw Si(n);return n.lanes=536870912,null}return Rr(n,u)}var d=e.memoizedState;if(d!==null){var g=d.dehydrated;if(nc(n),f)if(n.flags&256)n.flags&=-257,n=Pm(e,n,s);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(l(558));else if(mt||Za(e,n,s,!1),f=(s&e.childLanes)!==0,mt||f){if(u=Je,u!==null&&(g=Yd(u,s),g!==0&&g!==d.retryLane))throw d.retryLane=g,ta(e,g),Gt(u,e,g),wc;Kr(),n=Pm(e,n,s)}else e=d.treeContext,et=hn(g.nextSibling),_t=n,Le=!0,xi=null,fn=!1,e!==null&&Uh(n,e),n=Rr(n,u),n.flags|=4096;return n}return e=Zn(e.child,{mode:u.mode,children:u.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Lr(e,n){var s=n.ref;if(s===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(l(284));(e===null||e.ref!==s)&&(n.flags|=4194816)}}function _c(e,n,s,u,f){return sa(n),s=ac(e,n,s,u,void 0,f),u=sc(),e!==null&&!mt?(lc(e,n,f),Pn(e,n,f)):(Le&&u&&Uo(n),n.flags|=1,At(e,n,s,f),n.child)}function ep(e,n,s,u,f,d){return sa(n),n.updateQueue=null,s=im(n,u,s,f),nm(e),u=sc(),e!==null&&!mt?(lc(e,n,d),Pn(e,n,d)):(Le&&u&&Uo(n),n.flags|=1,At(e,n,s,d),n.child)}function tp(e,n,s,u,f){if(sa(n),n.stateNode===null){var d=Ya,g=s.contextType;typeof g=="object"&&g!==null&&(d=Tt(g)),d=new s(u,d),n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Sc,n.stateNode=d,d._reactInternals=n,d=n.stateNode,d.props=u,d.state=n.memoizedState,d.refs={},Fo(n),g=s.contextType,d.context=typeof g=="object"&&g!==null?Tt(g):Ya,d.state=n.memoizedState,g=s.getDerivedStateFromProps,typeof g=="function"&&(xc(n,s,g,u),d.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(g=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),g!==d.state&&Sc.enqueueReplaceState(d,d.state,null),tl(n,u,d,f),el(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),u=!0}else if(e===null){d=n.stateNode;var k=n.memoizedProps,A=fa(s,k);d.props=A;var R=d.context,G=s.contextType;g=Ya,typeof G=="object"&&G!==null&&(g=Tt(G));var Q=s.getDerivedStateFromProps;G=typeof Q=="function"||typeof d.getSnapshotBeforeUpdate=="function",k=n.pendingProps!==k,G||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(k||R!==g)&&Hm(n,d,u,g),wi=!1;var L=n.memoizedState;d.state=L,tl(n,u,d,f),el(),R=n.memoizedState,k||L!==R||wi?(typeof Q=="function"&&(xc(n,s,Q,u),R=n.memoizedState),(A=wi||Im(n,s,A,u,L,R,g))?(G||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(n.flags|=4194308)):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=R),d.props=u,d.state=R,d.context=g,u=A):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{d=n.stateNode,Jo(e,n),g=n.memoizedProps,G=fa(s,g),d.props=G,Q=n.pendingProps,L=d.context,R=s.contextType,A=Ya,typeof R=="object"&&R!==null&&(A=Tt(R)),k=s.getDerivedStateFromProps,(R=typeof k=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(g!==Q||L!==A)&&Hm(n,d,u,A),wi=!1,L=n.memoizedState,d.state=L,tl(n,u,d,f),el();var I=n.memoizedState;g!==Q||L!==I||wi||e!==null&&e.dependencies!==null&&yr(e.dependencies)?(typeof k=="function"&&(xc(n,s,k,u),I=n.memoizedState),(G=wi||Im(n,s,G,u,L,I,A)||e!==null&&e.dependencies!==null&&yr(e.dependencies))?(R||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(u,I,A),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(u,I,A)),typeof d.componentDidUpdate=="function"&&(n.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof d.componentDidUpdate!="function"||g===e.memoizedProps&&L===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&L===e.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=I),d.props=u,d.state=I,d.context=A,u=G):(typeof d.componentDidUpdate!="function"||g===e.memoizedProps&&L===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&L===e.memoizedState||(n.flags|=1024),u=!1)}return d=u,Lr(e,n),u=(n.flags&128)!==0,d||u?(d=n.stateNode,s=u&&typeof s.getDerivedStateFromError!="function"?null:d.render(),n.flags|=1,e!==null&&u?(n.child=oa(n,e.child,null,f),n.child=oa(n,null,s,f)):At(e,n,s,f),n.memoizedState=d.state,e=n.child):e=Pn(e,n,f),e}function np(e,n,s,u){return ia(),n.flags|=256,At(e,n,s,u),n.child}var Tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ac(e){return{baseLanes:e,cachePool:$h()}}function Ec(e,n,s){return e=e!==null?e.childLanes&~s:0,n&&(e|=en),e}function ip(e,n,s){var u=n.pendingProps,f=!1,d=(n.flags&128)!==0,g;if((g=d)||(g=e!==null&&e.memoizedState===null?!1:(lt.current&2)!==0),g&&(f=!0,n.flags&=-129),g=(n.flags&32)!==0,n.flags&=-33,e===null){if(Le){if(f?Ai(n):Ei(),(e=et)?(e=fg(e,fn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:vi!==null?{id:On,overflow:jn}:null,retryLane:536870912,hydrationErrors:null},s=Lh(e),s.return=n,n.child=s,_t=n,et=null)):e=null,e===null)throw Si(n);return cf(e)?n.lanes=32:n.lanes=536870912,null}var k=u.children;return u=u.fallback,f?(Ei(),f=n.mode,k=Br({mode:"hidden",children:k},f),u=na(u,f,s,null),k.return=n,u.return=n,k.sibling=u,n.child=k,u=n.child,u.memoizedState=Ac(s),u.childLanes=Ec(e,g,s),n.memoizedState=Tc,ll(null,u)):(Ai(n),Nc(n,k))}var A=e.memoizedState;if(A!==null&&(k=A.dehydrated,k!==null)){if(d)n.flags&256?(Ai(n),n.flags&=-257,n=Cc(e,n,s)):n.memoizedState!==null?(Ei(),n.child=e.child,n.flags|=128,n=null):(Ei(),k=u.fallback,f=n.mode,u=Br({mode:"visible",children:u.children},f),k=na(k,f,s,null),k.flags|=2,u.return=n,k.return=n,u.sibling=k,n.child=u,oa(n,e.child,null,s),u=n.child,u.memoizedState=Ac(s),u.childLanes=Ec(e,g,s),n.memoizedState=Tc,n=ll(null,u));else if(Ai(n),cf(k)){if(g=k.nextSibling&&k.nextSibling.dataset,g)var R=g.dgst;g=R,u=Error(l(419)),u.stack="",u.digest=g,Qs({value:u,source:null,stack:null}),n=Cc(e,n,s)}else if(mt||Za(e,n,s,!1),g=(s&e.childLanes)!==0,mt||g){if(g=Je,g!==null&&(u=Yd(g,s),u!==0&&u!==A.retryLane))throw A.retryLane=u,ta(e,u),Gt(g,e,u),wc;of(k)||Kr(),n=Cc(e,n,s)}else of(k)?(n.flags|=192,n.child=e.child,n=null):(e=A.treeContext,et=hn(k.nextSibling),_t=n,Le=!0,xi=null,fn=!1,e!==null&&Uh(n,e),n=Nc(n,u.children),n.flags|=4096);return n}return f?(Ei(),k=u.fallback,f=n.mode,A=e.child,R=A.sibling,u=Zn(A,{mode:"hidden",children:u.children}),u.subtreeFlags=A.subtreeFlags&65011712,R!==null?k=Zn(R,k):(k=na(k,f,s,null),k.flags|=2),k.return=n,u.return=n,u.sibling=k,n.child=u,ll(null,u),u=n.child,k=e.child.memoizedState,k===null?k=Ac(s):(f=k.cachePool,f!==null?(A=dt._currentValue,f=f.parent!==A?{parent:A,pool:A}:f):f=$h(),k={baseLanes:k.baseLanes|s,cachePool:f}),u.memoizedState=k,u.childLanes=Ec(e,g,s),n.memoizedState=Tc,ll(e.child,u)):(Ai(n),s=e.child,e=s.sibling,s=Zn(s,{mode:"visible",children:u.children}),s.return=n,s.sibling=null,e!==null&&(g=n.deletions,g===null?(n.deletions=[e],n.flags|=16):g.push(e)),n.child=s,n.memoizedState=null,s)}function Nc(e,n){return n=Br({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Br(e,n){return e=Ft(22,e,null,n),e.lanes=0,e}function Cc(e,n,s){return oa(n,e.child,null,s),e=Nc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function ap(e,n,s){e.lanes|=n;var u=e.alternate;u!==null&&(u.lanes|=n),Go(e.return,n,s)}function Oc(e,n,s,u,f,d){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:s,tailMode:f,treeForkCount:d}:(g.isBackwards=n,g.rendering=null,g.renderingStartTime=0,g.last=u,g.tail=s,g.tailMode=f,g.treeForkCount=d)}function sp(e,n,s){var u=n.pendingProps,f=u.revealOrder,d=u.tail;u=u.children;var g=lt.current,k=(g&2)!==0;if(k?(g=g&1|2,n.flags|=128):g&=1,w(lt,g),At(e,n,u,s),u=Le?Zs:0,!k&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ap(e,s,n);else if(e.tag===19)ap(e,s,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(s=n.child,f=null;s!==null;)e=s.alternate,e!==null&&Tr(e)===null&&(f=s),s=s.sibling;s=f,s===null?(f=n.child,n.child=null):(f=s.sibling,s.sibling=null),Oc(n,!1,f,s,d,u);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&Tr(e)===null){n.child=f;break}e=f.sibling,f.sibling=s,s=f,f=e}Oc(n,!0,s,null,d,u);break;case"together":Oc(n,!1,null,null,void 0,u);break;default:n.memoizedState=null}return n.child}function Pn(e,n,s){if(e!==null&&(n.dependencies=e.dependencies),Oi|=n.lanes,(s&n.childLanes)===0)if(e!==null){if(Za(e,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(l(153));if(n.child!==null){for(e=n.child,s=Zn(e,e.pendingProps),n.child=s,s.return=n;e.sibling!==null;)e=e.sibling,s=s.sibling=Zn(e,e.pendingProps),s.return=n;s.sibling=null}return n.child}function jc(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&yr(e)))}function k0(e,n,s){switch(n.tag){case 3:Ke(n,n.stateNode.containerInfo),ki(n,dt,e.memoizedState.cache),ia();break;case 27:case 5:yt(n);break;case 4:Ke(n,n.stateNode.containerInfo);break;case 10:ki(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,nc(n),null;break;case 13:var u=n.memoizedState;if(u!==null)return u.dehydrated!==null?(Ai(n),n.flags|=128,null):(s&n.child.childLanes)!==0?ip(e,n,s):(Ai(n),e=Pn(e,n,s),e!==null?e.sibling:null);Ai(n);break;case 19:var f=(e.flags&128)!==0;if(u=(s&n.childLanes)!==0,u||(Za(e,n,s,!1),u=(s&n.childLanes)!==0),f){if(u)return sp(e,n,s);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),w(lt,lt.current),u)break;return null;case 22:return n.lanes=0,Jm(e,n,s,n.pendingProps);case 24:ki(n,dt,e.memoizedState.cache)}return Pn(e,n,s)}function lp(e,n,s){if(e!==null)if(e.memoizedProps!==n.pendingProps)mt=!0;else{if(!jc(e,s)&&(n.flags&128)===0)return mt=!1,k0(e,n,s);mt=(e.flags&131072)!==0}else mt=!1,Le&&(n.flags&1048576)!==0&&qh(n,Zs,n.index);switch(n.lanes=0,n.tag){case 16:e:{var u=n.pendingProps;if(e=ra(n.elementType),n.type=e,typeof e=="function")Lo(e)?(u=fa(e,u),n.tag=1,n=tp(null,n,e,u,s)):(n.tag=0,n=_c(null,n,e,u,s));else{if(e!=null){var f=e.$$typeof;if(f===Z){n.tag=11,n=Qm(null,n,e,u,s);break e}else if(f===C){n.tag=14,n=Xm(null,n,e,u,s);break e}}throw n=Ae(e)||e,Error(l(306,n,""))}}return n;case 0:return _c(e,n,n.type,n.pendingProps,s);case 1:return u=n.type,f=fa(u,n.pendingProps),tp(e,n,u,f,s);case 3:e:{if(Ke(n,n.stateNode.containerInfo),e===null)throw Error(l(387));u=n.pendingProps;var d=n.memoizedState;f=d.element,Jo(e,n),tl(n,u,null,s);var g=n.memoizedState;if(u=g.cache,ki(n,dt,u),u!==d.cache&&$o(n,[dt],s,!0),el(),u=g.element,d.isDehydrated)if(d={element:u,isDehydrated:!1,cache:g.cache},n.updateQueue.baseState=d,n.memoizedState=d,n.flags&256){n=np(e,n,u,s);break e}else if(u!==f){f=un(Error(l(424)),n),Qs(f),n=np(e,n,u,s);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(et=hn(e.firstChild),_t=n,Le=!0,xi=null,fn=!0,s=Jh(n,null,u,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ia(),u===f){n=Pn(e,n,s);break e}At(e,n,u,s)}n=n.child}return n;case 26:return Lr(e,n),e===null?(s=yg(n.type,null,n.pendingProps,null))?n.memoizedState=s:Le||(s=n.type,e=n.pendingProps,u=Pr(ue.current).createElement(s),u[wt]=n,u[qt]=e,Et(u,s,e),St(u),n.stateNode=u):n.memoizedState=yg(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return yt(n),e===null&&Le&&(u=n.stateNode=mg(n.type,n.pendingProps,ue.current),_t=n,fn=!0,f=et,Ri(n.type)?(ff=f,et=hn(u.firstChild)):et=f),At(e,n,n.pendingProps.children,s),Lr(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Le&&((f=u=et)&&(u=W0(u,n.type,n.pendingProps,fn),u!==null?(n.stateNode=u,_t=n,et=hn(u.firstChild),fn=!1,f=!0):f=!1),f||Si(n)),yt(n),f=n.type,d=n.pendingProps,g=e!==null?e.memoizedProps:null,u=d.children,lf(f,d)?u=null:g!==null&&lf(f,g)&&(n.flags|=32),n.memoizedState!==null&&(f=ac(e,n,h0,null,null,s),Sl._currentValue=f),Lr(e,n),At(e,n,u,s),n.child;case 6:return e===null&&Le&&((e=s=et)&&(s=P0(s,n.pendingProps,fn),s!==null?(n.stateNode=s,_t=n,et=null,e=!0):e=!1),e||Si(n)),null;case 13:return ip(e,n,s);case 4:return Ke(n,n.stateNode.containerInfo),u=n.pendingProps,e===null?n.child=oa(n,null,u,s):At(e,n,u,s),n.child;case 11:return Qm(e,n,n.type,n.pendingProps,s);case 7:return At(e,n,n.pendingProps,s),n.child;case 8:return At(e,n,n.pendingProps.children,s),n.child;case 12:return At(e,n,n.pendingProps.children,s),n.child;case 10:return u=n.pendingProps,ki(n,n.type,u.value),At(e,n,u.children,s),n.child;case 9:return f=n.type._context,u=n.pendingProps.children,sa(n),f=Tt(f),u=u(f),n.flags|=1,At(e,n,u,s),n.child;case 14:return Xm(e,n,n.type,n.pendingProps,s);case 15:return Fm(e,n,n.type,n.pendingProps,s);case 19:return sp(e,n,s);case 31:return S0(e,n,s);case 22:return Jm(e,n,s,n.pendingProps);case 24:return sa(n),u=Tt(dt),e===null?(f=Qo(),f===null&&(f=Je,d=Ko(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=s),f=d),n.memoizedState={parent:u,cache:f},Fo(n),ki(n,dt,f)):((e.lanes&s)!==0&&(Jo(e,n),tl(n,null,null,s),el()),f=e.memoizedState,d=n.memoizedState,f.parent!==u?(f={parent:u,cache:u},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),ki(n,dt,u)):(u=d.cache,ki(n,dt,u),u!==f.cache&&$o(n,[dt],s,!0))),At(e,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(l(156,n.tag))}function ei(e){e.flags|=4}function Mc(e,n,s,u,f){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(Dp())e.flags|=8192;else throw ua=Sr,Xo}else e.flags&=-16777217}function rp(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!kg(n))if(Dp())e.flags|=8192;else throw ua=Sr,Xo}function qr(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Id():536870912,e.lanes|=n,ss|=n)}function rl(e,n){if(!Le)switch(e.tailMode){case"hidden":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function tt(e){var n=e.alternate!==null&&e.alternate.child===e.child,s=0,u=0;if(n)for(var f=e.child;f!==null;)s|=f.lanes|f.childLanes,u|=f.subtreeFlags&65011712,u|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)s|=f.lanes|f.childLanes,u|=f.subtreeFlags,u|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=u,e.childLanes=s,n}function w0(e,n,s){var u=n.pendingProps;switch(Io(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(n),null;case 1:return tt(n),null;case 3:return s=n.stateNode,u=null,e!==null&&(u=e.memoizedState.cache),n.memoizedState.cache!==u&&(n.flags|=2048),Fn(dt),Be(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Ka(n)?ei(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Vo())),tt(n),null;case 26:var f=n.type,d=n.memoizedState;return e===null?(ei(n),d!==null?(tt(n),rp(n,d)):(tt(n),Mc(n,f,null,u,s))):d?d!==e.memoizedState?(ei(n),tt(n),rp(n,d)):(tt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==u&&ei(n),tt(n),Mc(n,f,e,u,s)),null;case 27:if(xn(n),s=ue.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==u&&ei(n);else{if(!u){if(n.stateNode===null)throw Error(l(166));return tt(n),null}e=ie.current,Ka(n)?Ih(n):(e=mg(f,u,s),n.stateNode=e,ei(n))}return tt(n),null;case 5:if(xn(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==u&&ei(n);else{if(!u){if(n.stateNode===null)throw Error(l(166));return tt(n),null}if(d=ie.current,Ka(n))Ih(n);else{var g=Pr(ue.current);switch(d){case 1:d=g.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:d=g.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":d=g.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":d=g.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":d=g.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof u.is=="string"?g.createElement("select",{is:u.is}):g.createElement("select"),u.multiple?d.multiple=!0:u.size&&(d.size=u.size);break;default:d=typeof u.is=="string"?g.createElement(f,{is:u.is}):g.createElement(f)}}d[wt]=n,d[qt]=u;e:for(g=n.child;g!==null;){if(g.tag===5||g.tag===6)d.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===n)break e;for(;g.sibling===null;){if(g.return===null||g.return===n)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}n.stateNode=d;e:switch(Et(d,f,u),f){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&ei(n)}}return tt(n),Mc(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,s),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==u&&ei(n);else{if(typeof u!="string"&&n.stateNode===null)throw Error(l(166));if(e=ue.current,Ka(n)){if(e=n.stateNode,s=n.memoizedProps,u=null,f=_t,f!==null)switch(f.tag){case 27:case 5:u=f.memoizedProps}e[wt]=n,e=!!(e.nodeValue===s||u!==null&&u.suppressHydrationWarning===!0||ig(e.nodeValue,s)),e||Si(n,!0)}else e=Pr(e).createTextNode(u),e[wt]=n,n.stateNode=e}return tt(n),null;case 31:if(s=n.memoizedState,e===null||e.memoizedState!==null){if(u=Ka(n),s!==null){if(e===null){if(!u)throw Error(l(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[wt]=n}else ia(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;tt(n),e=!1}else s=Vo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return n.flags&256?(Wt(n),n):(Wt(n),null);if((n.flags&128)!==0)throw Error(l(558))}return tt(n),null;case 13:if(u=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=Ka(n),u!==null&&u.dehydrated!==null){if(e===null){if(!f)throw Error(l(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(l(317));f[wt]=n}else ia(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;tt(n),f=!1}else f=Vo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Wt(n),n):(Wt(n),null)}return Wt(n),(n.flags&128)!==0?(n.lanes=s,n):(s=u!==null,e=e!==null&&e.memoizedState!==null,s&&(u=n.child,f=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(f=u.alternate.memoizedState.cachePool.pool),d=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(d=u.memoizedState.cachePool.pool),d!==f&&(u.flags|=2048)),s!==e&&s&&(n.child.flags|=8192),qr(n,n.updateQueue),tt(n),null);case 4:return Be(),e===null&&ef(n.stateNode.containerInfo),tt(n),null;case 10:return Fn(n.type),tt(n),null;case 19:if(V(lt),u=n.memoizedState,u===null)return tt(n),null;if(f=(n.flags&128)!==0,d=u.rendering,d===null)if(f)rl(u,!1);else{if(st!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(d=Tr(e),d!==null){for(n.flags|=128,rl(u,!1),e=d.updateQueue,n.updateQueue=e,qr(n,e),n.subtreeFlags=0,e=s,s=n.child;s!==null;)Rh(s,e),s=s.sibling;return w(lt,lt.current&1|2),Le&&Qn(n,u.treeForkCount),n.child}e=e.sibling}u.tail!==null&&Ot()>Yr&&(n.flags|=128,f=!0,rl(u,!1),n.lanes=4194304)}else{if(!f)if(e=Tr(d),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,qr(n,e),rl(u,!0),u.tail===null&&u.tailMode==="hidden"&&!d.alternate&&!Le)return tt(n),null}else 2*Ot()-u.renderingStartTime>Yr&&s!==536870912&&(n.flags|=128,f=!0,rl(u,!1),n.lanes=4194304);u.isBackwards?(d.sibling=n.child,n.child=d):(e=u.last,e!==null?e.sibling=d:n.child=d,u.last=d)}return u.tail!==null?(e=u.tail,u.rendering=e,u.tail=e.sibling,u.renderingStartTime=Ot(),e.sibling=null,s=lt.current,w(lt,f?s&1|2:s&1),Le&&Qn(n,u.treeForkCount),e):(tt(n),null);case 22:case 23:return Wt(n),tc(),u=n.memoizedState!==null,e!==null?e.memoizedState!==null!==u&&(n.flags|=8192):u&&(n.flags|=8192),u?(s&536870912)!==0&&(n.flags&128)===0&&(tt(n),n.subtreeFlags&6&&(n.flags|=8192)):tt(n),s=n.updateQueue,s!==null&&qr(n,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==s&&(n.flags|=2048),e!==null&&V(la),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Fn(dt),tt(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function _0(e,n){switch(Io(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Fn(dt),Be(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return xn(n),null;case 31:if(n.memoizedState!==null){if(Wt(n),n.alternate===null)throw Error(l(340));ia()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Wt(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(l(340));ia()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return V(lt),null;case 4:return Be(),null;case 10:return Fn(n.type),null;case 22:case 23:return Wt(n),tc(),e!==null&&V(la),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Fn(dt),null;case 25:return null;default:return null}}function up(e,n){switch(Io(n),n.tag){case 3:Fn(dt),Be();break;case 26:case 27:case 5:xn(n);break;case 4:Be();break;case 31:n.memoizedState!==null&&Wt(n);break;case 13:Wt(n);break;case 19:V(lt);break;case 10:Fn(n.type);break;case 22:case 23:Wt(n),tc(),e!==null&&V(la);break;case 24:Fn(dt)}}function ul(e,n){try{var s=n.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var f=u.next;s=f;do{if((s.tag&e)===e){u=void 0;var d=s.create,g=s.inst;u=d(),g.destroy=u}s=s.next}while(s!==f)}}catch(k){$e(n,n.return,k)}}function Ni(e,n,s){try{var u=n.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var d=f.next;u=d;do{if((u.tag&e)===e){var g=u.inst,k=g.destroy;if(k!==void 0){g.destroy=void 0,f=n;var A=s,R=k;try{R()}catch(G){$e(f,A,G)}}}u=u.next}while(u!==d)}}catch(G){$e(n,n.return,G)}}function op(e){var n=e.updateQueue;if(n!==null){var s=e.stateNode;try{Ph(n,s)}catch(u){$e(e,e.return,u)}}}function cp(e,n,s){s.props=fa(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(u){$e(e,n,u)}}function ol(e,n){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var u=e.stateNode;break;case 30:u=e.stateNode;break;default:u=e.stateNode}typeof s=="function"?e.refCleanup=s(u):s.current=u}}catch(f){$e(e,n,f)}}function Mn(e,n){var s=e.ref,u=e.refCleanup;if(s!==null)if(typeof u=="function")try{u()}catch(f){$e(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){$e(e,n,f)}else s.current=null}function fp(e){var n=e.type,s=e.memoizedProps,u=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&u.focus();break e;case"img":s.src?u.src=s.src:s.srcSet&&(u.srcset=s.srcSet)}}catch(f){$e(e,e.return,f)}}function Dc(e,n,s){try{var u=e.stateNode;K0(u,e.type,s,n),u[qt]=n}catch(f){$e(e,e.return,f)}}function dp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ri(e.type)||e.tag===4}function zc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dp(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&&Ri(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rc(e,n,s){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(e),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=$n));else if(u!==4&&(u===27&&Ri(e.type)&&(s=e.stateNode,n=null),e=e.child,e!==null))for(Rc(e,n,s),e=e.sibling;e!==null;)Rc(e,n,s),e=e.sibling}function Ur(e,n,s){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(u!==4&&(u===27&&Ri(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(Ur(e,n,s),e=e.sibling;e!==null;)Ur(e,n,s),e=e.sibling}function hp(e){var n=e.stateNode,s=e.memoizedProps;try{for(var u=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);Et(n,u,s),n[wt]=e,n[qt]=s}catch(d){$e(e,e.return,d)}}var ti=!1,pt=!1,Lc=!1,mp=typeof WeakSet=="function"?WeakSet:Set,kt=null;function T0(e,n){if(e=e.containerInfo,af=lu,e=Ah(e),Co(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var u=s.getSelection&&s.getSelection();if(u&&u.rangeCount!==0){s=u.anchorNode;var f=u.anchorOffset,d=u.focusNode;u=u.focusOffset;try{s.nodeType,d.nodeType}catch{s=null;break e}var g=0,k=-1,A=-1,R=0,G=0,Q=e,L=null;t:for(;;){for(var I;Q!==s||f!==0&&Q.nodeType!==3||(k=g+f),Q!==d||u!==0&&Q.nodeType!==3||(A=g+u),Q.nodeType===3&&(g+=Q.nodeValue.length),(I=Q.firstChild)!==null;)L=Q,Q=I;for(;;){if(Q===e)break t;if(L===s&&++R===f&&(k=g),L===d&&++G===u&&(A=g),(I=Q.nextSibling)!==null)break;Q=L,L=Q.parentNode}Q=I}s=k===-1||A===-1?null:{start:k,end:A}}else s=null}s=s||{start:0,end:0}}else s=null;for(sf={focusedElem:e,selectionRange:s},lu=!1,kt=n;kt!==null;)if(n=kt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,kt=e;else for(;kt!==null;){switch(n=kt,d=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)f=e[s],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,s=n,f=d.memoizedProps,d=d.memoizedState,u=s.stateNode;try{var ce=fa(s.type,f);e=u.getSnapshotBeforeUpdate(ce,d),u.__reactInternalSnapshotBeforeUpdate=e}catch(ve){$e(s,s.return,ve)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,s=e.nodeType,s===9)uf(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":uf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=n.sibling,e!==null){e.return=n.return,kt=e;break}kt=n.return}}function pp(e,n,s){var u=s.flags;switch(s.tag){case 0:case 11:case 15:ii(e,s),u&4&&ul(5,s);break;case 1:if(ii(e,s),u&4)if(e=s.stateNode,n===null)try{e.componentDidMount()}catch(g){$e(s,s.return,g)}else{var f=fa(s.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(g){$e(s,s.return,g)}}u&64&&op(s),u&512&&ol(s,s.return);break;case 3:if(ii(e,s),u&64&&(e=s.updateQueue,e!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{Ph(e,n)}catch(g){$e(s,s.return,g)}}break;case 27:n===null&&u&4&&hp(s);case 26:case 5:ii(e,s),n===null&&u&4&&fp(s),u&512&&ol(s,s.return);break;case 12:ii(e,s);break;case 31:ii(e,s),u&4&&bp(e,s);break;case 13:ii(e,s),u&4&&vp(e,s),u&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=z0.bind(null,s),ex(e,s))));break;case 22:if(u=s.memoizedState!==null||ti,!u){n=n!==null&&n.memoizedState!==null||pt,f=ti;var d=pt;ti=u,(pt=n)&&!d?ai(e,s,(s.subtreeFlags&8772)!==0):ii(e,s),ti=f,pt=d}break;case 30:break;default:ii(e,s)}}function gp(e){var n=e.alternate;n!==null&&(e.alternate=null,gp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&fo(n)),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 nt=null,It=!1;function ni(e,n,s){for(s=s.child;s!==null;)yp(e,n,s),s=s.sibling}function yp(e,n,s){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(jt,s)}catch{}switch(s.tag){case 26:pt||Mn(s,n),ni(e,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:pt||Mn(s,n);var u=nt,f=It;Ri(s.type)&&(nt=s.stateNode,It=!1),ni(e,n,s),bl(s.stateNode),nt=u,It=f;break;case 5:pt||Mn(s,n);case 6:if(u=nt,f=It,nt=null,ni(e,n,s),nt=u,It=f,nt!==null)if(It)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(s.stateNode)}catch(d){$e(s,n,d)}else try{nt.removeChild(s.stateNode)}catch(d){$e(s,n,d)}break;case 18:nt!==null&&(It?(e=nt,og(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),hs(e)):og(nt,s.stateNode));break;case 4:u=nt,f=It,nt=s.stateNode.containerInfo,It=!0,ni(e,n,s),nt=u,It=f;break;case 0:case 11:case 14:case 15:Ni(2,s,n),pt||Ni(4,s,n),ni(e,n,s);break;case 1:pt||(Mn(s,n),u=s.stateNode,typeof u.componentWillUnmount=="function"&&cp(s,n,u)),ni(e,n,s);break;case 21:ni(e,n,s);break;case 22:pt=(u=pt)||s.memoizedState!==null,ni(e,n,s),pt=u;break;default:ni(e,n,s)}}function bp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{hs(e)}catch(s){$e(n,n.return,s)}}}function vp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{hs(e)}catch(s){$e(n,n.return,s)}}function A0(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new mp),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new mp),n;default:throw Error(l(435,e.tag))}}function Ir(e,n){var s=A0(e);n.forEach(function(u){if(!s.has(u)){s.add(u);var f=R0.bind(null,e,u);u.then(f,f)}})}function Ht(e,n){var s=n.deletions;if(s!==null)for(var u=0;u<s.length;u++){var f=s[u],d=e,g=n,k=g;e:for(;k!==null;){switch(k.tag){case 27:if(Ri(k.type)){nt=k.stateNode,It=!1;break e}break;case 5:nt=k.stateNode,It=!1;break e;case 3:case 4:nt=k.stateNode.containerInfo,It=!0;break e}k=k.return}if(nt===null)throw Error(l(160));yp(d,g,f),nt=null,It=!1,d=f.alternate,d!==null&&(d.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)xp(n,e),n=n.sibling}var wn=null;function xp(e,n){var s=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ht(n,e),Vt(e),u&4&&(Ni(3,e,e.return),ul(3,e),Ni(5,e,e.return));break;case 1:Ht(n,e),Vt(e),u&512&&(pt||s===null||Mn(s,s.return)),u&64&&ti&&(e=e.updateQueue,e!==null&&(u=e.callbacks,u!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?u:s.concat(u))));break;case 26:var f=wn;if(Ht(n,e),Vt(e),u&512&&(pt||s===null||Mn(s,s.return)),u&4){var d=s!==null?s.memoizedState:null;if(u=e.memoizedState,s===null)if(u===null)if(e.stateNode===null){e:{u=e.type,s=e.memoizedProps,f=f.ownerDocument||f;t:switch(u){case"title":d=f.getElementsByTagName("title")[0],(!d||d[Ls]||d[wt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=f.createElement(u),f.head.insertBefore(d,f.querySelector("head > title"))),Et(d,u,s),d[wt]=e,St(d),u=d;break e;case"link":var g=xg("link","href",f).get(u+(s.href||""));if(g){for(var k=0;k<g.length;k++)if(d=g[k],d.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&d.getAttribute("rel")===(s.rel==null?null:s.rel)&&d.getAttribute("title")===(s.title==null?null:s.title)&&d.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){g.splice(k,1);break t}}d=f.createElement(u),Et(d,u,s),f.head.appendChild(d);break;case"meta":if(g=xg("meta","content",f).get(u+(s.content||""))){for(k=0;k<g.length;k++)if(d=g[k],d.getAttribute("content")===(s.content==null?null:""+s.content)&&d.getAttribute("name")===(s.name==null?null:s.name)&&d.getAttribute("property")===(s.property==null?null:s.property)&&d.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&d.getAttribute("charset")===(s.charSet==null?null:s.charSet)){g.splice(k,1);break t}}d=f.createElement(u),Et(d,u,s),f.head.appendChild(d);break;default:throw Error(l(468,u))}d[wt]=e,St(d),u=d}e.stateNode=u}else Sg(f,e.type,e.stateNode);else e.stateNode=vg(f,u,e.memoizedProps);else d!==u?(d===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):d.count--,u===null?Sg(f,e.type,e.stateNode):vg(f,u,e.memoizedProps)):u===null&&e.stateNode!==null&&Dc(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ht(n,e),Vt(e),u&512&&(pt||s===null||Mn(s,s.return)),s!==null&&u&4&&Dc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ht(n,e),Vt(e),u&512&&(pt||s===null||Mn(s,s.return)),e.flags&32){f=e.stateNode;try{La(f,"")}catch(ce){$e(e,e.return,ce)}}u&4&&e.stateNode!=null&&(f=e.memoizedProps,Dc(e,f,s!==null?s.memoizedProps:f)),u&1024&&(Lc=!0);break;case 6:if(Ht(n,e),Vt(e),u&4){if(e.stateNode===null)throw Error(l(162));u=e.memoizedProps,s=e.stateNode;try{s.nodeValue=u}catch(ce){$e(e,e.return,ce)}}break;case 3:if(nu=null,f=wn,wn=eu(n.containerInfo),Ht(n,e),wn=f,Vt(e),u&4&&s!==null&&s.memoizedState.isDehydrated)try{hs(n.containerInfo)}catch(ce){$e(e,e.return,ce)}Lc&&(Lc=!1,Sp(e));break;case 4:u=wn,wn=eu(e.stateNode.containerInfo),Ht(n,e),Vt(e),wn=u;break;case 12:Ht(n,e),Vt(e);break;case 31:Ht(n,e),Vt(e),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,Ir(e,u)));break;case 13:Ht(n,e),Vt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Vr=Ot()),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,Ir(e,u)));break;case 22:f=e.memoizedState!==null;var A=s!==null&&s.memoizedState!==null,R=ti,G=pt;if(ti=R||f,pt=G||A,Ht(n,e),pt=G,ti=R,Vt(e),u&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(s===null||A||ti||pt||da(e)),s=null,n=e;;){if(n.tag===5||n.tag===26){if(s===null){A=s=n;try{if(d=A.stateNode,f)g=d.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{k=A.stateNode;var Q=A.memoizedProps.style,L=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;k.style.display=L==null||typeof L=="boolean"?"":(""+L).trim()}}catch(ce){$e(A,A.return,ce)}}}else if(n.tag===6){if(s===null){A=n;try{A.stateNode.nodeValue=f?"":A.memoizedProps}catch(ce){$e(A,A.return,ce)}}}else if(n.tag===18){if(s===null){A=n;try{var I=A.stateNode;f?cg(I,!0):cg(A.stateNode,!1)}catch(ce){$e(A,A.return,ce)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}u&4&&(u=e.updateQueue,u!==null&&(s=u.retryQueue,s!==null&&(u.retryQueue=null,Ir(e,s))));break;case 19:Ht(n,e),Vt(e),u&4&&(u=e.updateQueue,u!==null&&(e.updateQueue=null,Ir(e,u)));break;case 30:break;case 21:break;default:Ht(n,e),Vt(e)}}function Vt(e){var n=e.flags;if(n&2){try{for(var s,u=e.return;u!==null;){if(dp(u)){s=u;break}u=u.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var f=s.stateNode,d=zc(e);Ur(e,d,f);break;case 5:var g=s.stateNode;s.flags&32&&(La(g,""),s.flags&=-33);var k=zc(e);Ur(e,k,g);break;case 3:case 4:var A=s.stateNode.containerInfo,R=zc(e);Rc(e,R,A);break;default:throw Error(l(161))}}catch(G){$e(e,e.return,G)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Sp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Sp(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function ii(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)pp(e,n.alternate,n),n=n.sibling}function da(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Ni(4,n,n.return),da(n);break;case 1:Mn(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&cp(n,n.return,s),da(n);break;case 27:bl(n.stateNode);case 26:case 5:Mn(n,n.return),da(n);break;case 22:n.memoizedState===null&&da(n);break;case 30:da(n);break;default:da(n)}e=e.sibling}}function ai(e,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var u=n.alternate,f=e,d=n,g=d.flags;switch(d.tag){case 0:case 11:case 15:ai(f,d,s),ul(4,d);break;case 1:if(ai(f,d,s),u=d,f=u.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(R){$e(u,u.return,R)}if(u=d,f=u.updateQueue,f!==null){var k=u.stateNode;try{var A=f.shared.hiddenCallbacks;if(A!==null)for(f.shared.hiddenCallbacks=null,f=0;f<A.length;f++)Wh(A[f],k)}catch(R){$e(u,u.return,R)}}s&&g&64&&op(d),ol(d,d.return);break;case 27:hp(d);case 26:case 5:ai(f,d,s),s&&u===null&&g&4&&fp(d),ol(d,d.return);break;case 12:ai(f,d,s);break;case 31:ai(f,d,s),s&&g&4&&bp(f,d);break;case 13:ai(f,d,s),s&&g&4&&vp(f,d);break;case 22:d.memoizedState===null&&ai(f,d,s),ol(d,d.return);break;case 30:break;default:ai(f,d,s)}n=n.sibling}}function Bc(e,n){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&Xs(s))}function qc(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Xs(e))}function _n(e,n,s,u){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)kp(e,n,s,u),n=n.sibling}function kp(e,n,s,u){var f=n.flags;switch(n.tag){case 0:case 11:case 15:_n(e,n,s,u),f&2048&&ul(9,n);break;case 1:_n(e,n,s,u);break;case 3:_n(e,n,s,u),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Xs(e)));break;case 12:if(f&2048){_n(e,n,s,u),e=n.stateNode;try{var d=n.memoizedProps,g=d.id,k=d.onPostCommit;typeof k=="function"&&k(g,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){$e(n,n.return,A)}}else _n(e,n,s,u);break;case 31:_n(e,n,s,u);break;case 13:_n(e,n,s,u);break;case 23:break;case 22:d=n.stateNode,g=n.alternate,n.memoizedState!==null?d._visibility&2?_n(e,n,s,u):cl(e,n):d._visibility&2?_n(e,n,s,u):(d._visibility|=2,ns(e,n,s,u,(n.subtreeFlags&10256)!==0||!1)),f&2048&&Bc(g,n);break;case 24:_n(e,n,s,u),f&2048&&qc(n.alternate,n);break;default:_n(e,n,s,u)}}function ns(e,n,s,u,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var d=e,g=n,k=s,A=u,R=g.flags;switch(g.tag){case 0:case 11:case 15:ns(d,g,k,A,f),ul(8,g);break;case 23:break;case 22:var G=g.stateNode;g.memoizedState!==null?G._visibility&2?ns(d,g,k,A,f):cl(d,g):(G._visibility|=2,ns(d,g,k,A,f)),f&&R&2048&&Bc(g.alternate,g);break;case 24:ns(d,g,k,A,f),f&&R&2048&&qc(g.alternate,g);break;default:ns(d,g,k,A,f)}n=n.sibling}}function cl(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=e,u=n,f=u.flags;switch(u.tag){case 22:cl(s,u),f&2048&&Bc(u.alternate,u);break;case 24:cl(s,u),f&2048&&qc(u.alternate,u);break;default:cl(s,u)}n=n.sibling}}var fl=8192;function is(e,n,s){if(e.subtreeFlags&fl)for(e=e.child;e!==null;)wp(e,n,s),e=e.sibling}function wp(e,n,s){switch(e.tag){case 26:is(e,n,s),e.flags&fl&&e.memoizedState!==null&&dx(s,wn,e.memoizedState,e.memoizedProps);break;case 5:is(e,n,s);break;case 3:case 4:var u=wn;wn=eu(e.stateNode.containerInfo),is(e,n,s),wn=u;break;case 22:e.memoizedState===null&&(u=e.alternate,u!==null&&u.memoizedState!==null?(u=fl,fl=16777216,is(e,n,s),fl=u):is(e,n,s));break;default:is(e,n,s)}}function _p(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function dl(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var u=n[s];kt=u,Ap(u,e)}_p(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Tp(e),e=e.sibling}function Tp(e){switch(e.tag){case 0:case 11:case 15:dl(e),e.flags&2048&&Ni(9,e,e.return);break;case 3:dl(e);break;case 12:dl(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Hr(e)):dl(e);break;default:dl(e)}}function Hr(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var u=n[s];kt=u,Ap(u,e)}_p(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Ni(8,n,n.return),Hr(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,Hr(n));break;default:Hr(n)}e=e.sibling}}function Ap(e,n){for(;kt!==null;){var s=kt;switch(s.tag){case 0:case 11:case 15:Ni(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var u=s.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Xs(s.memoizedState.cache)}if(u=s.child,u!==null)u.return=s,kt=u;else e:for(s=e;kt!==null;){u=kt;var f=u.sibling,d=u.return;if(gp(u),u===s){kt=null;break e}if(f!==null){f.return=d,kt=f;break e}kt=d}}}var E0={getCacheForType:function(e){var n=Tt(dt),s=n.data.get(e);return s===void 0&&(s=e(),n.data.set(e,s)),s},cacheSignal:function(){return Tt(dt).controller.signal}},N0=typeof WeakMap=="function"?WeakMap:Map,He=0,Je=null,je=null,De=0,Ge=0,Pt=null,Ci=!1,as=!1,Uc=!1,si=0,st=0,Oi=0,ha=0,Ic=0,en=0,ss=0,hl=null,Yt=null,Hc=!1,Vr=0,Ep=0,Yr=1/0,Gr=null,ji=null,vt=0,Mi=null,ls=null,li=0,Vc=0,Yc=null,Np=null,ml=0,Gc=null;function tn(){return(He&2)!==0&&De!==0?De&-De:U.T!==null?Fc():Gd()}function Cp(){if(en===0)if((De&536870912)===0||Le){var e=Wl;Wl<<=1,(Wl&3932160)===0&&(Wl=262144),en=e}else en=536870912;return e=Jt.current,e!==null&&(e.flags|=32),en}function Gt(e,n,s){(e===Je&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)&&(rs(e,0),Di(e,De,en,!1)),Rs(e,s),((He&2)===0||e!==Je)&&(e===Je&&((He&2)===0&&(ha|=s),st===4&&Di(e,De,en,!1)),Dn(e))}function Op(e,n,s){if((He&6)!==0)throw Error(l(327));var u=!s&&(n&127)===0&&(n&e.expiredLanes)===0||zs(e,n),f=u?j0(e,n):Kc(e,n,!0),d=u;do{if(f===0){as&&!u&&Di(e,n,0,!1);break}else{if(s=e.current.alternate,d&&!C0(s)){f=Kc(e,n,!1),d=!1;continue}if(f===2){if(d=n,e.errorRecoveryDisabledLanes&d)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){n=g;e:{var k=e;f=hl;var A=k.current.memoizedState.isDehydrated;if(A&&(rs(k,g).flags|=256),g=Kc(k,g,!1),g!==2){if(Uc&&!A){k.errorRecoveryDisabledLanes|=d,ha|=d,f=4;break e}d=Yt,Yt=f,d!==null&&(Yt===null?Yt=d:Yt.push.apply(Yt,d))}f=g}if(d=!1,f!==2)continue}}if(f===1){rs(e,0),Di(e,n,0,!0);break}e:{switch(u=e,d=f,d){case 0:case 1:throw Error(l(345));case 4:if((n&4194048)!==n)break;case 6:Di(u,n,en,!Ci);break e;case 2:Yt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(f=Vr+300-Ot(),10<f)){if(Di(u,n,en,!Ci),er(u,0,!0)!==0)break e;li=n,u.timeoutHandle=rg(jp.bind(null,u,s,Yt,Gr,Hc,n,en,ha,ss,Ci,d,"Throttled",-0,0),f);break e}jp(u,s,Yt,Gr,Hc,n,en,ha,ss,Ci,d,null,-0,0)}}break}while(!0);Dn(e)}function jp(e,n,s,u,f,d,g,k,A,R,G,Q,L,I){if(e.timeoutHandle=-1,Q=n.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$n},wp(n,d,Q);var ce=(d&62914560)===d?Vr-Ot():(d&4194048)===d?Ep-Ot():0;if(ce=hx(Q,ce),ce!==null){li=d,e.cancelPendingCommit=ce(Up.bind(null,e,n,d,s,u,f,g,k,A,G,Q,null,L,I)),Di(e,d,g,!R);return}}Up(e,n,d,s,u,f,g,k,A)}function C0(e){for(var n=e;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var u=0;u<s.length;u++){var f=s[u],d=f.getSnapshot;f=f.value;try{if(!Xt(d(),f))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Di(e,n,s,u){n&=~Ic,n&=~ha,e.suspendedLanes|=n,e.pingedLanes&=~n,u&&(e.warmLanes|=n),u=e.expirationTimes;for(var f=n;0<f;){var d=31-Fe(f),g=1<<d;u[d]=-1,f&=~g}s!==0&&Hd(e,s,n)}function $r(){return(He&6)===0?(pl(0),!1):!0}function $c(){if(je!==null){if(Ge===0)var e=je.return;else e=je,Xn=aa=null,rc(e),Ja=null,Js=0,e=je;for(;e!==null;)up(e.alternate,e),e=e.return;je=null}}function rs(e,n){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,X0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),li=0,$c(),Je=e,je=s=Zn(e.current,null),De=n,Ge=0,Pt=null,Ci=!1,as=zs(e,n),Uc=!1,ss=en=Ic=ha=Oi=st=0,Yt=hl=null,Hc=!1,(n&8)!==0&&(n|=n&32);var u=e.entangledLanes;if(u!==0)for(e=e.entanglements,u&=n;0<u;){var f=31-Fe(u),d=1<<f;n|=e[f],u&=~d}return si=n,dr(),s}function Mp(e,n){Ee=null,U.H=sl,n===Fa||n===xr?(n=Qh(),Ge=3):n===Xo?(n=Qh(),Ge=4):Ge=n===wc?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Pt=n,je===null&&(st=1,zr(e,un(n,e.current)))}function Dp(){var e=Jt.current;return e===null?!0:(De&4194048)===De?dn===null:(De&62914560)===De||(De&536870912)!==0?e===dn:!1}function zp(){var e=U.H;return U.H=sl,e===null?sl:e}function Rp(){var e=U.A;return U.A=E0,e}function Kr(){st=4,Ci||(De&4194048)!==De&&Jt.current!==null||(as=!0),(Oi&134217727)===0&&(ha&134217727)===0||Je===null||Di(Je,De,en,!1)}function Kc(e,n,s){var u=He;He|=2;var f=zp(),d=Rp();(Je!==e||De!==n)&&(Gr=null,rs(e,n)),n=!1;var g=st;e:do try{if(Ge!==0&&je!==null){var k=je,A=Pt;switch(Ge){case 8:$c(),g=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(n=!0);var R=Ge;if(Ge=0,Pt=null,us(e,k,A,R),s&&as){g=0;break e}break;default:R=Ge,Ge=0,Pt=null,us(e,k,A,R)}}O0(),g=st;break}catch(G){Mp(e,G)}while(!0);return n&&e.shellSuspendCounter++,Xn=aa=null,He=u,U.H=f,U.A=d,je===null&&(Je=null,De=0,dr()),g}function O0(){for(;je!==null;)Lp(je)}function j0(e,n){var s=He;He|=2;var u=zp(),f=Rp();Je!==e||De!==n?(Gr=null,Yr=Ot()+500,rs(e,n)):as=zs(e,n);e:do try{if(Ge!==0&&je!==null){n=je;var d=Pt;t:switch(Ge){case 1:Ge=0,Pt=null,us(e,n,d,1);break;case 2:case 9:if(Kh(d)){Ge=0,Pt=null,Bp(n);break}n=function(){Ge!==2&&Ge!==9||Je!==e||(Ge=7),Dn(e)},d.then(n,n);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:Kh(d)?(Ge=0,Pt=null,Bp(n)):(Ge=0,Pt=null,us(e,n,d,7));break;case 5:var g=null;switch(je.tag){case 26:g=je.memoizedState;case 5:case 27:var k=je;if(g?kg(g):k.stateNode.complete){Ge=0,Pt=null;var A=k.sibling;if(A!==null)je=A;else{var R=k.return;R!==null?(je=R,Zr(R)):je=null}break t}}Ge=0,Pt=null,us(e,n,d,5);break;case 6:Ge=0,Pt=null,us(e,n,d,6);break;case 8:$c(),st=6;break e;default:throw Error(l(462))}}M0();break}catch(G){Mp(e,G)}while(!0);return Xn=aa=null,U.H=u,U.A=f,He=s,je!==null?0:(Je=null,De=0,dr(),st)}function M0(){for(;je!==null&&!ao();)Lp(je)}function Lp(e){var n=lp(e.alternate,e,si);e.memoizedProps=e.pendingProps,n===null?Zr(e):je=n}function Bp(e){var n=e,s=n.alternate;switch(n.tag){case 15:case 0:n=ep(s,n,n.pendingProps,n.type,void 0,De);break;case 11:n=ep(s,n,n.pendingProps,n.type.render,n.ref,De);break;case 5:rc(n);default:up(s,n),n=je=Rh(n,si),n=lp(s,n,si)}e.memoizedProps=e.pendingProps,n===null?Zr(e):je=n}function us(e,n,s,u){Xn=aa=null,rc(n),Ja=null,Js=0;var f=n.return;try{if(x0(e,f,n,s,De)){st=1,zr(e,un(s,e.current)),je=null;return}}catch(d){if(f!==null)throw je=f,d;st=1,zr(e,un(s,e.current)),je=null;return}n.flags&32768?(Le||u===1?e=!0:as||(De&536870912)!==0?e=!1:(Ci=e=!0,(u===2||u===9||u===3||u===6)&&(u=Jt.current,u!==null&&u.tag===13&&(u.flags|=16384))),qp(n,e)):Zr(n)}function Zr(e){var n=e;do{if((n.flags&32768)!==0){qp(n,Ci);return}e=n.return;var s=w0(n.alternate,n,si);if(s!==null){je=s;return}if(n=n.sibling,n!==null){je=n;return}je=n=e}while(n!==null);st===0&&(st=5)}function qp(e,n){do{var s=_0(e.alternate,e);if(s!==null){s.flags&=32767,je=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(e=e.sibling,e!==null)){je=e;return}je=e=s}while(e!==null);st=6,je=null}function Up(e,n,s,u,f,d,g,k,A){e.cancelPendingCommit=null;do Qr();while(vt!==0);if((He&6)!==0)throw Error(l(327));if(n!==null){if(n===e.current)throw Error(l(177));if(d=n.lanes|n.childLanes,d|=zo,fv(e,s,d,g,k,A),e===Je&&(je=Je=null,De=0),ls=n,Mi=e,li=s,Vc=d,Yc=f,Np=u,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,L0(xe,function(){return Gp(),null})):(e.callbackNode=null,e.callbackPriority=0),u=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||u){u=U.T,U.T=null,f=J.p,J.p=2,g=He,He|=4;try{T0(e,n,s)}finally{He=g,J.p=f,U.T=u}}vt=1,Ip(),Hp(),Vp()}}function Ip(){if(vt===1){vt=0;var e=Mi,n=ls,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=U.T,U.T=null;var u=J.p;J.p=2;var f=He;He|=4;try{xp(n,e);var d=sf,g=Ah(e.containerInfo),k=d.focusedElem,A=d.selectionRange;if(g!==k&&k&&k.ownerDocument&&Th(k.ownerDocument.documentElement,k)){if(A!==null&&Co(k)){var R=A.start,G=A.end;if(G===void 0&&(G=R),"selectionStart"in k)k.selectionStart=R,k.selectionEnd=Math.min(G,k.value.length);else{var Q=k.ownerDocument||document,L=Q&&Q.defaultView||window;if(L.getSelection){var I=L.getSelection(),ce=k.textContent.length,ve=Math.min(A.start,ce),Xe=A.end===void 0?ve:Math.min(A.end,ce);!I.extend&&ve>Xe&&(g=Xe,Xe=ve,ve=g);var D=_h(k,ve),O=_h(k,Xe);if(D&&O&&(I.rangeCount!==1||I.anchorNode!==D.node||I.anchorOffset!==D.offset||I.focusNode!==O.node||I.focusOffset!==O.offset)){var z=Q.createRange();z.setStart(D.node,D.offset),I.removeAllRanges(),ve>Xe?(I.addRange(z),I.extend(O.node,O.offset)):(z.setEnd(O.node,O.offset),I.addRange(z))}}}}for(Q=[],I=k;I=I.parentNode;)I.nodeType===1&&Q.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<Q.length;k++){var K=Q[k];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}lu=!!af,sf=af=null}finally{He=f,J.p=u,U.T=s}}e.current=n,vt=2}}function Hp(){if(vt===2){vt=0;var e=Mi,n=ls,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=U.T,U.T=null;var u=J.p;J.p=2;var f=He;He|=4;try{pp(e,n.alternate,n)}finally{He=f,J.p=u,U.T=s}}vt=3}}function Vp(){if(vt===4||vt===3){vt=0,so();var e=Mi,n=ls,s=li,u=Np;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?vt=5:(vt=0,ls=Mi=null,Yp(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(ji=null),oo(s),n=n.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(jt,n,void 0,(n.current.flags&128)===128)}catch{}if(u!==null){n=U.T,f=J.p,J.p=2,U.T=null;try{for(var d=e.onRecoverableError,g=0;g<u.length;g++){var k=u[g];d(k.value,{componentStack:k.stack})}}finally{U.T=n,J.p=f}}(li&3)!==0&&Qr(),Dn(e),f=e.pendingLanes,(s&261930)!==0&&(f&42)!==0?e===Gc?ml++:(ml=0,Gc=e):ml=0,pl(0)}}function Yp(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Xs(n)))}function Qr(){return Ip(),Hp(),Vp(),Gp()}function Gp(){if(vt!==5)return!1;var e=Mi,n=Vc;Vc=0;var s=oo(li),u=U.T,f=J.p;try{J.p=32>s?32:s,U.T=null,s=Yc,Yc=null;var d=Mi,g=li;if(vt=0,ls=Mi=null,li=0,(He&6)!==0)throw Error(l(331));var k=He;if(He|=4,Tp(d.current),kp(d,d.current,g,s),He=k,pl(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(jt,d)}catch{}return!0}finally{J.p=f,U.T=u,Yp(e,n)}}function $p(e,n,s){n=un(s,n),n=kc(e.stateNode,n,2),e=Ti(e,n,2),e!==null&&(Rs(e,2),Dn(e))}function $e(e,n,s){if(e.tag===3)$p(e,e,s);else for(;n!==null;){if(n.tag===3){$p(n,e,s);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ji===null||!ji.has(u))){e=un(s,e),s=Km(2),u=Ti(n,s,2),u!==null&&(Zm(s,u,n,e),Rs(u,2),Dn(u));break}}n=n.return}}function Zc(e,n,s){var u=e.pingCache;if(u===null){u=e.pingCache=new N0;var f=new Set;u.set(n,f)}else f=u.get(n),f===void 0&&(f=new Set,u.set(n,f));f.has(s)||(Uc=!0,f.add(s),e=D0.bind(null,e,n,s),n.then(e,e))}function D0(e,n,s){var u=e.pingCache;u!==null&&u.delete(n),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Je===e&&(De&s)===s&&(st===4||st===3&&(De&62914560)===De&&300>Ot()-Vr?(He&2)===0&&rs(e,0):Ic|=s,ss===De&&(ss=0)),Dn(e)}function Kp(e,n){n===0&&(n=Id()),e=ta(e,n),e!==null&&(Rs(e,n),Dn(e))}function z0(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),Kp(e,s)}function R0(e,n){var s=0;switch(e.tag){case 31:case 13:var u=e.stateNode,f=e.memoizedState;f!==null&&(s=f.retryLane);break;case 19:u=e.stateNode;break;case 22:u=e.stateNode._retryCache;break;default:throw Error(l(314))}u!==null&&u.delete(n),Kp(e,s)}function L0(e,n){return Ca(e,n)}var Xr=null,os=null,Qc=!1,Fr=!1,Xc=!1,zi=0;function Dn(e){e!==os&&e.next===null&&(os===null?Xr=os=e:os=os.next=e),Fr=!0,Qc||(Qc=!0,q0())}function pl(e,n){if(!Xc&&Fr){Xc=!0;do for(var s=!1,u=Xr;u!==null;){if(e!==0){var f=u.pendingLanes;if(f===0)var d=0;else{var g=u.suspendedLanes,k=u.pingedLanes;d=(1<<31-Fe(42|e)+1)-1,d&=f&~(g&~k),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(s=!0,Fp(u,d))}else d=De,d=er(u,u===Je?d:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(d&3)===0||zs(u,d)||(s=!0,Fp(u,d));u=u.next}while(s);Xc=!1}}function B0(){Zp()}function Zp(){Fr=Qc=!1;var e=0;zi!==0&&Q0()&&(e=zi);for(var n=Ot(),s=null,u=Xr;u!==null;){var f=u.next,d=Qp(u,n);d===0?(u.next=null,s===null?Xr=f:s.next=f,f===null&&(os=s)):(s=u,(e!==0||(d&3)!==0)&&(Fr=!0)),u=f}vt!==0&&vt!==5||pl(e),zi!==0&&(zi=0)}function Qp(e,n){for(var s=e.suspendedLanes,u=e.pingedLanes,f=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var g=31-Fe(d),k=1<<g,A=f[g];A===-1?((k&s)===0||(k&u)!==0)&&(f[g]=cv(k,n)):A<=n&&(e.expiredLanes|=k),d&=~k}if(n=Je,s=De,s=er(e,e===n?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),u=e.callbackNode,s===0||e===n&&(Ge===2||Ge===9)||e.cancelPendingCommit!==null)return u!==null&&u!==null&&Ds(u),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||zs(e,s)){if(n=s&-s,n===e.callbackPriority)return n;switch(u!==null&&Ds(u),oo(s)){case 2:case 8:s=ae;break;case 32:s=xe;break;case 268435456:s=Ye;break;default:s=xe}return u=Xp.bind(null,e),s=Ca(s,u),e.callbackPriority=n,e.callbackNode=s,n}return u!==null&&u!==null&&Ds(u),e.callbackPriority=2,e.callbackNode=null,2}function Xp(e,n){if(vt!==0&&vt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Qr()&&e.callbackNode!==s)return null;var u=De;return u=er(e,e===Je?u:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),u===0?null:(Op(e,u,n),Qp(e,Ot()),e.callbackNode!=null&&e.callbackNode===s?Xp.bind(null,e):null)}function Fp(e,n){if(Qr())return null;Op(e,n,!0)}function q0(){F0(function(){(He&6)!==0?Ca($,B0):Zp()})}function Fc(){if(zi===0){var e=Qa;e===0&&(e=Jl,Jl<<=1,(Jl&261888)===0&&(Jl=256)),zi=e}return zi}function Jp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ar(""+e)}function Wp(e,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,e.id&&s.setAttribute("form",e.id),n.parentNode.insertBefore(s,n),e=new FormData(e),s.parentNode.removeChild(s),e}function U0(e,n,s,u,f){if(n==="submit"&&s&&s.stateNode===f){var d=Jp((f[qt]||null).action),g=u.submitter;g&&(n=(n=g[qt]||null)?Jp(n.formAction):g.getAttribute("formAction"),n!==null&&(d=n,g=null));var k=new ur("action","action",null,u,f);e.push({event:k,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(zi!==0){var A=g?Wp(f,g):new FormData(f);gc(s,{pending:!0,data:A,method:f.method,action:d},null,A)}}else typeof d=="function"&&(k.preventDefault(),A=g?Wp(f,g):new FormData(f),gc(s,{pending:!0,data:A,method:f.method,action:d},d,A))},currentTarget:f}]})}}for(var Jc=0;Jc<Do.length;Jc++){var Wc=Do[Jc],I0=Wc.toLowerCase(),H0=Wc[0].toUpperCase()+Wc.slice(1);kn(I0,"on"+H0)}kn(Ch,"onAnimationEnd"),kn(Oh,"onAnimationIteration"),kn(jh,"onAnimationStart"),kn("dblclick","onDoubleClick"),kn("focusin","onFocus"),kn("focusout","onBlur"),kn(i0,"onTransitionRun"),kn(a0,"onTransitionStart"),kn(s0,"onTransitionCancel"),kn(Mh,"onTransitionEnd"),za("onMouseEnter",["mouseout","mouseover"]),za("onMouseLeave",["mouseout","mouseover"]),za("onPointerEnter",["pointerout","pointerover"]),za("onPointerLeave",["pointerout","pointerover"]),Ji("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ji("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ji("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ji("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ji("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ji("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gl="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(" "),V0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gl));function Pp(e,n){n=(n&4)!==0;for(var s=0;s<e.length;s++){var u=e[s],f=u.event;u=u.listeners;e:{var d=void 0;if(n)for(var g=u.length-1;0<=g;g--){var k=u[g],A=k.instance,R=k.currentTarget;if(k=k.listener,A!==d&&f.isPropagationStopped())break e;d=k,f.currentTarget=R;try{d(f)}catch(G){fr(G)}f.currentTarget=null,d=A}else for(g=0;g<u.length;g++){if(k=u[g],A=k.instance,R=k.currentTarget,k=k.listener,A!==d&&f.isPropagationStopped())break e;d=k,f.currentTarget=R;try{d(f)}catch(G){fr(G)}f.currentTarget=null,d=A}}}}function Me(e,n){var s=n[co];s===void 0&&(s=n[co]=new Set);var u=e+"__bubble";s.has(u)||(eg(n,e,2,!1),s.add(u))}function Pc(e,n,s){var u=0;n&&(u|=4),eg(s,e,u,n)}var Jr="_reactListening"+Math.random().toString(36).slice(2);function ef(e){if(!e[Jr]){e[Jr]=!0,Zd.forEach(function(s){s!=="selectionchange"&&(V0.has(s)||Pc(s,!1,e),Pc(s,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Jr]||(n[Jr]=!0,Pc("selectionchange",!1,n))}}function eg(e,n,s,u){switch(Cg(n)){case 2:var f=gx;break;case 8:f=yx;break;default:f=gf}s=f.bind(null,n,s,e),f=void 0,!xo||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),u?f!==void 0?e.addEventListener(n,s,{capture:!0,passive:f}):e.addEventListener(n,s,!0):f!==void 0?e.addEventListener(n,s,{passive:f}):e.addEventListener(n,s,!1)}function tf(e,n,s,u,f){var d=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var g=u.tag;if(g===3||g===4){var k=u.stateNode.containerInfo;if(k===f)break;if(g===4)for(g=u.return;g!==null;){var A=g.tag;if((A===3||A===4)&&g.stateNode.containerInfo===f)return;g=g.return}for(;k!==null;){if(g=ja(k),g===null)return;if(A=g.tag,A===5||A===6||A===26||A===27){u=d=g;continue e}k=k.parentNode}}u=u.return}sh(function(){var R=d,G=bo(s),Q=[];e:{var L=Dh.get(e);if(L!==void 0){var I=ur,ce=e;switch(e){case"keypress":if(lr(s)===0)break e;case"keydown":case"keyup":I=Rv;break;case"focusin":ce="focus",I=_o;break;case"focusout":ce="blur",I=_o;break;case"beforeblur":case"afterblur":I=_o;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":I=uh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=wv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=qv;break;case Ch:case Oh:case jh:I=Av;break;case Mh:I=Iv;break;case"scroll":case"scrollend":I=Sv;break;case"wheel":I=Vv;break;case"copy":case"cut":case"paste":I=Nv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=ch;break;case"toggle":case"beforetoggle":I=Gv}var ve=(n&4)!==0,Xe=!ve&&(e==="scroll"||e==="scrollend"),D=ve?L!==null?L+"Capture":null:L;ve=[];for(var O=R,z;O!==null;){var K=O;if(z=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||z===null||D===null||(K=qs(O,D),K!=null&&ve.push(yl(O,K,z))),Xe)break;O=O.return}0<ve.length&&(L=new I(L,ce,null,s,G),Q.push({event:L,listeners:ve}))}}if((n&7)===0){e:{if(L=e==="mouseover"||e==="pointerover",I=e==="mouseout"||e==="pointerout",L&&s!==yo&&(ce=s.relatedTarget||s.fromElement)&&(ja(ce)||ce[Oa]))break e;if((I||L)&&(L=G.window===G?G:(L=G.ownerDocument)?L.defaultView||L.parentWindow:window,I?(ce=s.relatedTarget||s.toElement,I=R,ce=ce?ja(ce):null,ce!==null&&(Xe=o(ce),ve=ce.tag,ce!==Xe||ve!==5&&ve!==27&&ve!==6)&&(ce=null)):(I=null,ce=R),I!==ce)){if(ve=uh,K="onMouseLeave",D="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(ve=ch,K="onPointerLeave",D="onPointerEnter",O="pointer"),Xe=I==null?L:Bs(I),z=ce==null?L:Bs(ce),L=new ve(K,O+"leave",I,s,G),L.target=Xe,L.relatedTarget=z,K=null,ja(G)===R&&(ve=new ve(D,O+"enter",ce,s,G),ve.target=z,ve.relatedTarget=Xe,K=ve),Xe=K,I&&ce)t:{for(ve=Y0,D=I,O=ce,z=0,K=D;K;K=ve(K))z++;K=0;for(var ge=O;ge;ge=ve(ge))K++;for(;0<z-K;)D=ve(D),z--;for(;0<K-z;)O=ve(O),K--;for(;z--;){if(D===O||O!==null&&D===O.alternate){ve=D;break t}D=ve(D),O=ve(O)}ve=null}else ve=null;I!==null&&tg(Q,L,I,ve,!1),ce!==null&&Xe!==null&&tg(Q,Xe,ce,ve,!0)}}e:{if(L=R?Bs(R):window,I=L.nodeName&&L.nodeName.toLowerCase(),I==="select"||I==="input"&&L.type==="file")var Ue=bh;else if(gh(L))if(vh)Ue=e0;else{Ue=Wv;var he=Jv}else I=L.nodeName,!I||I.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?R&&go(R.elementType)&&(Ue=bh):Ue=Pv;if(Ue&&(Ue=Ue(e,R))){yh(Q,Ue,s,G);break e}he&&he(e,L,R),e==="focusout"&&R&&L.type==="number"&&R.memoizedProps.value!=null&&po(L,"number",L.value)}switch(he=R?Bs(R):window,e){case"focusin":(gh(he)||he.contentEditable==="true")&&(Ia=he,Oo=R,Ks=null);break;case"focusout":Ks=Oo=Ia=null;break;case"mousedown":jo=!0;break;case"contextmenu":case"mouseup":case"dragend":jo=!1,Eh(Q,s,G);break;case"selectionchange":if(n0)break;case"keydown":case"keyup":Eh(Q,s,G)}var Ne;if(Ao)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Ua?mh(e,s)&&(ze="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(ze="onCompositionStart");ze&&(fh&&s.locale!=="ko"&&(Ua||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Ua&&(Ne=lh()):(bi=G,So="value"in bi?bi.value:bi.textContent,Ua=!0)),he=Wr(R,ze),0<he.length&&(ze=new oh(ze,e,null,s,G),Q.push({event:ze,listeners:he}),Ne?ze.data=Ne:(Ne=ph(s),Ne!==null&&(ze.data=Ne)))),(Ne=Kv?Zv(e,s):Qv(e,s))&&(ze=Wr(R,"onBeforeInput"),0<ze.length&&(he=new oh("onBeforeInput","beforeinput",null,s,G),Q.push({event:he,listeners:ze}),he.data=Ne)),U0(Q,e,R,s,G)}Pp(Q,n)})}function yl(e,n,s){return{instance:e,listener:n,currentTarget:s}}function Wr(e,n){for(var s=n+"Capture",u=[];e!==null;){var f=e,d=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||d===null||(f=qs(e,s),f!=null&&u.unshift(yl(e,f,d)),f=qs(e,n),f!=null&&u.push(yl(e,f,d))),e.tag===3)return u;e=e.return}return[]}function Y0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tg(e,n,s,u,f){for(var d=n._reactName,g=[];s!==null&&s!==u;){var k=s,A=k.alternate,R=k.stateNode;if(k=k.tag,A!==null&&A===u)break;k!==5&&k!==26&&k!==27||R===null||(A=R,f?(R=qs(s,d),R!=null&&g.unshift(yl(s,R,A))):f||(R=qs(s,d),R!=null&&g.push(yl(s,R,A)))),s=s.return}g.length!==0&&e.push({event:n,listeners:g})}var G0=/\r\n?/g,$0=/\u0000|\uFFFD/g;function ng(e){return(typeof e=="string"?e:""+e).replace(G0,`
49
+ `).replace($0,"")}function ig(e,n){return n=ng(n),ng(e)===n}function Qe(e,n,s,u,f,d){switch(s){case"children":typeof u=="string"?n==="body"||n==="textarea"&&u===""||La(e,u):(typeof u=="number"||typeof u=="bigint")&&n!=="body"&&La(e,""+u);break;case"className":nr(e,"class",u);break;case"tabIndex":nr(e,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":nr(e,s,u);break;case"style":ih(e,u,d);break;case"data":if(n!=="object"){nr(e,"data",u);break}case"src":case"href":if(u===""&&(n!=="a"||s!=="href")){e.removeAttribute(s);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){e.removeAttribute(s);break}u=ar(""+u),e.setAttribute(s,u);break;case"action":case"formAction":if(typeof u=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(s==="formAction"?(n!=="input"&&Qe(e,n,"name",f.name,f,null),Qe(e,n,"formEncType",f.formEncType,f,null),Qe(e,n,"formMethod",f.formMethod,f,null),Qe(e,n,"formTarget",f.formTarget,f,null)):(Qe(e,n,"encType",f.encType,f,null),Qe(e,n,"method",f.method,f,null),Qe(e,n,"target",f.target,f,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){e.removeAttribute(s);break}u=ar(""+u),e.setAttribute(s,u);break;case"onClick":u!=null&&(e.onclick=$n);break;case"onScroll":u!=null&&Me("scroll",e);break;case"onScrollEnd":u!=null&&Me("scrollend",e);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(l(61));if(s=u.__html,s!=null){if(f.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"multiple":e.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":e.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){e.removeAttribute("xlink:href");break}s=ar(""+u),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(s,""+u):e.removeAttribute(s);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":u&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":u===!0?e.setAttribute(s,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?e.setAttribute(s,u):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?e.setAttribute(s,u):e.removeAttribute(s);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?e.removeAttribute(s):e.setAttribute(s,u);break;case"popover":Me("beforetoggle",e),Me("toggle",e),tr(e,"popover",u);break;case"xlinkActuate":Gn(e,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Gn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Gn(e,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Gn(e,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Gn(e,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Gn(e,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":tr(e,"is",u);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=vv.get(s)||s,tr(e,s,u))}}function nf(e,n,s,u,f,d){switch(s){case"style":ih(e,u,d);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(l(61));if(s=u.__html,s!=null){if(f.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"children":typeof u=="string"?La(e,u):(typeof u=="number"||typeof u=="bigint")&&La(e,""+u);break;case"onScroll":u!=null&&Me("scroll",e);break;case"onScrollEnd":u!=null&&Me("scrollend",e);break;case"onClick":u!=null&&(e.onclick=$n);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qd.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),n=s.slice(2,f?s.length-7:void 0),d=e[qt]||null,d=d!=null?d[s]:null,typeof d=="function"&&e.removeEventListener(n,d,f),typeof u=="function")){typeof d!="function"&&d!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(n,u,f);break e}s in e?e[s]=u:u===!0?e.setAttribute(s,""):tr(e,s,u)}}}function Et(e,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",e),Me("load",e);var u=!1,f=!1,d;for(d in s)if(s.hasOwnProperty(d)){var g=s[d];if(g!=null)switch(d){case"src":u=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:Qe(e,n,d,g,s,null)}}f&&Qe(e,n,"srcSet",s.srcSet,s,null),u&&Qe(e,n,"src",s.src,s,null);return;case"input":Me("invalid",e);var k=d=g=f=null,A=null,R=null;for(u in s)if(s.hasOwnProperty(u)){var G=s[u];if(G!=null)switch(u){case"name":f=G;break;case"type":g=G;break;case"checked":A=G;break;case"defaultChecked":R=G;break;case"value":d=G;break;case"defaultValue":k=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(l(137,n));break;default:Qe(e,n,u,G,s,null)}}Pd(e,d,k,A,R,g,f,!1);return;case"select":Me("invalid",e),u=g=d=null;for(f in s)if(s.hasOwnProperty(f)&&(k=s[f],k!=null))switch(f){case"value":d=k;break;case"defaultValue":g=k;break;case"multiple":u=k;default:Qe(e,n,f,k,s,null)}n=d,s=g,e.multiple=!!u,n!=null?Ra(e,!!u,n,!1):s!=null&&Ra(e,!!u,s,!0);return;case"textarea":Me("invalid",e),d=f=u=null;for(g in s)if(s.hasOwnProperty(g)&&(k=s[g],k!=null))switch(g){case"value":u=k;break;case"defaultValue":f=k;break;case"children":d=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(l(91));break;default:Qe(e,n,g,k,s,null)}th(e,u,f,d);return;case"option":for(A in s)if(s.hasOwnProperty(A)&&(u=s[A],u!=null))switch(A){case"selected":e.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Qe(e,n,A,u,s,null)}return;case"dialog":Me("beforetoggle",e),Me("toggle",e),Me("cancel",e),Me("close",e);break;case"iframe":case"object":Me("load",e);break;case"video":case"audio":for(u=0;u<gl.length;u++)Me(gl[u],e);break;case"image":Me("error",e),Me("load",e);break;case"details":Me("toggle",e);break;case"embed":case"source":case"link":Me("error",e),Me("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(R in s)if(s.hasOwnProperty(R)&&(u=s[R],u!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:Qe(e,n,R,u,s,null)}return;default:if(go(n)){for(G in s)s.hasOwnProperty(G)&&(u=s[G],u!==void 0&&nf(e,n,G,u,s,void 0));return}}for(k in s)s.hasOwnProperty(k)&&(u=s[k],u!=null&&Qe(e,n,k,u,s,null))}function K0(e,n,s,u){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,d=null,g=null,k=null,A=null,R=null,G=null;for(I in s){var Q=s[I];if(s.hasOwnProperty(I)&&Q!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":A=Q;default:u.hasOwnProperty(I)||Qe(e,n,I,null,u,Q)}}for(var L in u){var I=u[L];if(Q=s[L],u.hasOwnProperty(L)&&(I!=null||Q!=null))switch(L){case"type":d=I;break;case"name":f=I;break;case"checked":R=I;break;case"defaultChecked":G=I;break;case"value":g=I;break;case"defaultValue":k=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(l(137,n));break;default:I!==Q&&Qe(e,n,L,I,u,Q)}}mo(e,g,k,A,R,G,d,f);return;case"select":I=g=k=L=null;for(d in s)if(A=s[d],s.hasOwnProperty(d)&&A!=null)switch(d){case"value":break;case"multiple":I=A;default:u.hasOwnProperty(d)||Qe(e,n,d,null,u,A)}for(f in u)if(d=u[f],A=s[f],u.hasOwnProperty(f)&&(d!=null||A!=null))switch(f){case"value":L=d;break;case"defaultValue":k=d;break;case"multiple":g=d;default:d!==A&&Qe(e,n,f,d,u,A)}n=k,s=g,u=I,L!=null?Ra(e,!!s,L,!1):!!u!=!!s&&(n!=null?Ra(e,!!s,n,!0):Ra(e,!!s,s?[]:"",!1));return;case"textarea":I=L=null;for(k in s)if(f=s[k],s.hasOwnProperty(k)&&f!=null&&!u.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Qe(e,n,k,null,u,f)}for(g in u)if(f=u[g],d=s[g],u.hasOwnProperty(g)&&(f!=null||d!=null))switch(g){case"value":L=f;break;case"defaultValue":I=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(l(91));break;default:f!==d&&Qe(e,n,g,f,u,d)}eh(e,L,I);return;case"option":for(var ce in s)if(L=s[ce],s.hasOwnProperty(ce)&&L!=null&&!u.hasOwnProperty(ce))switch(ce){case"selected":e.selected=!1;break;default:Qe(e,n,ce,null,u,L)}for(A in u)if(L=u[A],I=s[A],u.hasOwnProperty(A)&&L!==I&&(L!=null||I!=null))switch(A){case"selected":e.selected=L&&typeof L!="function"&&typeof L!="symbol";break;default:Qe(e,n,A,L,u,I)}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 ve in s)L=s[ve],s.hasOwnProperty(ve)&&L!=null&&!u.hasOwnProperty(ve)&&Qe(e,n,ve,null,u,L);for(R in u)if(L=u[R],I=s[R],u.hasOwnProperty(R)&&L!==I&&(L!=null||I!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(l(137,n));break;default:Qe(e,n,R,L,u,I)}return;default:if(go(n)){for(var Xe in s)L=s[Xe],s.hasOwnProperty(Xe)&&L!==void 0&&!u.hasOwnProperty(Xe)&&nf(e,n,Xe,void 0,u,L);for(G in u)L=u[G],I=s[G],!u.hasOwnProperty(G)||L===I||L===void 0&&I===void 0||nf(e,n,G,L,u,I);return}}for(var D in s)L=s[D],s.hasOwnProperty(D)&&L!=null&&!u.hasOwnProperty(D)&&Qe(e,n,D,null,u,L);for(Q in u)L=u[Q],I=s[Q],!u.hasOwnProperty(Q)||L===I||L==null&&I==null||Qe(e,n,Q,L,u,I)}function ag(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Z0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,s=performance.getEntriesByType("resource"),u=0;u<s.length;u++){var f=s[u],d=f.transferSize,g=f.initiatorType,k=f.duration;if(d&&k&&ag(g)){for(g=0,k=f.responseEnd,u+=1;u<s.length;u++){var A=s[u],R=A.startTime;if(R>k)break;var G=A.transferSize,Q=A.initiatorType;G&&ag(Q)&&(A=A.responseEnd,g+=G*(A<k?1:(k-R)/(A-R)))}if(--u,n+=8*(d+g)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var af=null,sf=null;function Pr(e){return e.nodeType===9?e:e.ownerDocument}function sg(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 lg(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function lf(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var rf=null;function Q0(){var e=window.event;return e&&e.type==="popstate"?e===rf?!1:(rf=e,!0):(rf=null,!1)}var rg=typeof setTimeout=="function"?setTimeout:void 0,X0=typeof clearTimeout=="function"?clearTimeout:void 0,ug=typeof Promise=="function"?Promise:void 0,F0=typeof queueMicrotask=="function"?queueMicrotask:typeof ug<"u"?function(e){return ug.resolve(null).then(e).catch(J0)}:rg;function J0(e){setTimeout(function(){throw e})}function Ri(e){return e==="head"}function og(e,n){var s=n,u=0;do{var f=s.nextSibling;if(e.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(u===0){e.removeChild(f),hs(n);return}u--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")u++;else if(s==="html")bl(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,bl(s);for(var d=s.firstChild;d;){var g=d.nextSibling,k=d.nodeName;d[Ls]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&d.rel.toLowerCase()==="stylesheet"||s.removeChild(d),d=g}}else s==="body"&&bl(e.ownerDocument.body);s=f}while(s);hs(n)}function cg(e,n){var s=e;e=0;do{var u=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),u&&u.nodeType===8)if(s=u.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=u}while(s)}function uf(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":uf(s),fo(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function W0(e,n,s,u){for(;e.nodeType===1;){var f=s;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!u&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(u){if(!e[Ls])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var d=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=hn(e.nextSibling),e===null)break}return null}function P0(e,n,s){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=hn(e.nextSibling),e===null))return null;return e}function fg(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=hn(e.nextSibling),e===null))return null;return e}function of(e){return e.data==="$?"||e.data==="$~"}function cf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function ex(e,n){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||s.readyState!=="loading")n();else{var u=function(){n(),s.removeEventListener("DOMContentLoaded",u)};s.addEventListener("DOMContentLoaded",u),e._reactRetry=u}}function hn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var ff=null;function dg(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(n===0)return hn(e.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}e=e.nextSibling}return null}function hg(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return e;n--}else s!=="/$"&&s!=="/&"||n++}e=e.previousSibling}return null}function mg(e,n,s){switch(n=Pr(s),e){case"html":if(e=n.documentElement,!e)throw Error(l(452));return e;case"head":if(e=n.head,!e)throw Error(l(453));return e;case"body":if(e=n.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function bl(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);fo(e)}var mn=new Map,pg=new Set;function eu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ri=J.d;J.d={f:tx,r:nx,D:ix,C:ax,L:sx,m:lx,X:ux,S:rx,M:ox};function tx(){var e=ri.f(),n=$r();return e||n}function nx(e){var n=Ma(e);n!==null&&n.tag===5&&n.type==="form"?Mm(n):ri.r(e)}var cs=typeof document>"u"?null:document;function gg(e,n,s){var u=cs;if(u&&typeof n=="string"&&n){var f=ln(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),pg.has(f)||(pg.add(f),e={rel:e,crossOrigin:s,href:n},u.querySelector(f)===null&&(n=u.createElement("link"),Et(n,"link",e),St(n),u.head.appendChild(n)))}}function ix(e){ri.D(e),gg("dns-prefetch",e,null)}function ax(e,n){ri.C(e,n),gg("preconnect",e,n)}function sx(e,n,s){ri.L(e,n,s);var u=cs;if(u&&e&&n){var f='link[rel="preload"][as="'+ln(n)+'"]';n==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+ln(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+ln(s.imageSizes)+'"]')):f+='[href="'+ln(e)+'"]';var d=f;switch(n){case"style":d=fs(e);break;case"script":d=ds(e)}mn.has(d)||(e=y({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:e,as:n},s),mn.set(d,e),u.querySelector(f)!==null||n==="style"&&u.querySelector(vl(d))||n==="script"&&u.querySelector(xl(d))||(n=u.createElement("link"),Et(n,"link",e),St(n),u.head.appendChild(n)))}}function lx(e,n){ri.m(e,n);var s=cs;if(s&&e){var u=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+ln(u)+'"][href="'+ln(e)+'"]',d=f;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=ds(e)}if(!mn.has(d)&&(e=y({rel:"modulepreload",href:e},n),mn.set(d,e),s.querySelector(f)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(xl(d)))return}u=s.createElement("link"),Et(u,"link",e),St(u),s.head.appendChild(u)}}}function rx(e,n,s){ri.S(e,n,s);var u=cs;if(u&&e){var f=Da(u).hoistableStyles,d=fs(e);n=n||"default";var g=f.get(d);if(!g){var k={loading:0,preload:null};if(g=u.querySelector(vl(d)))k.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":n},s),(s=mn.get(d))&&df(e,s);var A=g=u.createElement("link");St(A),Et(A,"link",e),A._p=new Promise(function(R,G){A.onload=R,A.onerror=G}),A.addEventListener("load",function(){k.loading|=1}),A.addEventListener("error",function(){k.loading|=2}),k.loading|=4,tu(g,n,u)}g={type:"stylesheet",instance:g,count:1,state:k},f.set(d,g)}}}function ux(e,n){ri.X(e,n);var s=cs;if(s&&e){var u=Da(s).hoistableScripts,f=ds(e),d=u.get(f);d||(d=s.querySelector(xl(f)),d||(e=y({src:e,async:!0},n),(n=mn.get(f))&&hf(e,n),d=s.createElement("script"),St(d),Et(d,"link",e),s.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},u.set(f,d))}}function ox(e,n){ri.M(e,n);var s=cs;if(s&&e){var u=Da(s).hoistableScripts,f=ds(e),d=u.get(f);d||(d=s.querySelector(xl(f)),d||(e=y({src:e,async:!0,type:"module"},n),(n=mn.get(f))&&hf(e,n),d=s.createElement("script"),St(d),Et(d,"link",e),s.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},u.set(f,d))}}function yg(e,n,s,u){var f=(f=ue.current)?eu(f):null;if(!f)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=fs(s.href),s=Da(f).hoistableStyles,u=s.get(n),u||(u={type:"style",instance:null,count:0,state:null},s.set(n,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=fs(s.href);var d=Da(f).hoistableStyles,g=d.get(e);if(g||(f=f.ownerDocument||f,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,g),(d=f.querySelector(vl(e)))&&!d._p&&(g.instance=d,g.state.loading=5),mn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},mn.set(e,s),d||cx(f,e,s,g.state))),n&&u===null)throw Error(l(528,""));return g}if(n&&u!==null)throw Error(l(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=ds(s),s=Da(f).hoistableScripts,u=s.get(n),u||(u={type:"script",instance:null,count:0,state:null},s.set(n,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function fs(e){return'href="'+ln(e)+'"'}function vl(e){return'link[rel="stylesheet"]['+e+"]"}function bg(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function cx(e,n,s,u){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?u.loading=1:(n=e.createElement("link"),u.preload=n,n.addEventListener("load",function(){return u.loading|=1}),n.addEventListener("error",function(){return u.loading|=2}),Et(n,"link",s),St(n),e.head.appendChild(n))}function ds(e){return'[src="'+ln(e)+'"]'}function xl(e){return"script[async]"+e}function vg(e,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var u=e.querySelector('style[data-href~="'+ln(s.href)+'"]');if(u)return n.instance=u,St(u),u;var f=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return u=(e.ownerDocument||e).createElement("style"),St(u),Et(u,"style",f),tu(u,s.precedence,e),n.instance=u;case"stylesheet":f=fs(s.href);var d=e.querySelector(vl(f));if(d)return n.state.loading|=4,n.instance=d,St(d),d;u=bg(s),(f=mn.get(f))&&df(u,f),d=(e.ownerDocument||e).createElement("link"),St(d);var g=d;return g._p=new Promise(function(k,A){g.onload=k,g.onerror=A}),Et(d,"link",u),n.state.loading|=4,tu(d,s.precedence,e),n.instance=d;case"script":return d=ds(s.src),(f=e.querySelector(xl(d)))?(n.instance=f,St(f),f):(u=s,(f=mn.get(d))&&(u=y({},s),hf(u,f)),e=e.ownerDocument||e,f=e.createElement("script"),St(f),Et(f,"link",u),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(u=n.instance,n.state.loading|=4,tu(u,s.precedence,e));return n.instance}function tu(e,n,s){for(var u=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=u.length?u[u.length-1]:null,d=f,g=0;g<u.length;g++){var k=u[g];if(k.dataset.precedence===n)d=k;else if(d!==f)break}d?d.parentNode.insertBefore(e,d.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(e,n.firstChild))}function df(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function hf(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var nu=null;function xg(e,n,s){if(nu===null){var u=new Map,f=nu=new Map;f.set(s,u)}else f=nu,u=f.get(s),u||(u=new Map,f.set(s,u));if(u.has(e))return u;for(u.set(e,null),s=s.getElementsByTagName(e),f=0;f<s.length;f++){var d=s[f];if(!(d[Ls]||d[wt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var g=d.getAttribute(n)||"";g=e+g;var k=u.get(g);k?k.push(d):u.set(g,[d])}}return u}function Sg(e,n,s){e=e.ownerDocument||e,e.head.insertBefore(s,n==="title"?e.querySelector("head > title"):null)}function fx(e,n,s){if(s===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function kg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function dx(e,n,s,u){if(s.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=fs(u.href),d=n.querySelector(vl(f));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=iu.bind(e),n.then(e,e)),s.state.loading|=4,s.instance=d,St(d);return}d=n.ownerDocument||n,u=bg(u),(f=mn.get(f))&&df(u,f),d=d.createElement("link"),St(d);var g=d;g._p=new Promise(function(k,A){g.onload=k,g.onerror=A}),Et(d,"link",u),s.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=iu.bind(e),n.addEventListener("load",s),n.addEventListener("error",s))}}var mf=0;function hx(e,n){return e.stylesheets&&e.count===0&&su(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var u=setTimeout(function(){if(e.stylesheets&&su(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+n);0<e.imgBytes&&mf===0&&(mf=62500*Z0());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&su(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>mf?50:800)+n);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(u),clearTimeout(f)}}:null}function iu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)su(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var au=null;function su(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,au=new Map,n.forEach(mx,e),au=null,iu.call(e))}function mx(e,n){if(!(n.state.loading&4)){var s=au.get(e);if(s)var u=s.get(null);else{s=new Map,au.set(e,s);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<f.length;d++){var g=f[d];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(s.set(g.dataset.precedence,g),u=g)}u&&s.set(null,u)}f=n.instance,g=f.getAttribute("data-precedence"),d=s.get(g)||u,d===u&&s.set(null,f),s.set(g,f),this.count++,u=iu.bind(this),f.addEventListener("load",u),f.addEventListener("error",u),d?d.parentNode.insertBefore(f,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var Sl={$$typeof:H,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function px(e,n,s,u,f,d,g,k,A){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=ro(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ro(0),this.hiddenUpdates=ro(null),this.identifierPrefix=u,this.onUncaughtError=f,this.onCaughtError=d,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function wg(e,n,s,u,f,d,g,k,A,R,G,Q){return e=new px(e,n,s,g,A,R,G,Q,k),n=1,d===!0&&(n|=24),d=Ft(3,null,null,n),e.current=d,d.stateNode=e,n=Ko(),n.refCount++,e.pooledCache=n,n.refCount++,d.memoizedState={element:u,isDehydrated:s,cache:n},Fo(d),e}function _g(e){return e?(e=Ya,e):Ya}function Tg(e,n,s,u,f,d){f=_g(f),u.context===null?u.context=f:u.pendingContext=f,u=_i(n),u.payload={element:s},d=d===void 0?null:d,d!==null&&(u.callback=d),s=Ti(e,u,n),s!==null&&(Gt(s,e,n),Ps(s,e,n))}function Ag(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<n?s:n}}function pf(e,n){Ag(e,n),(e=e.alternate)&&Ag(e,n)}function Eg(e){if(e.tag===13||e.tag===31){var n=ta(e,67108864);n!==null&&Gt(n,e,67108864),pf(e,67108864)}}function Ng(e){if(e.tag===13||e.tag===31){var n=tn();n=uo(n);var s=ta(e,n);s!==null&&Gt(s,e,n),pf(e,n)}}var lu=!0;function gx(e,n,s,u){var f=U.T;U.T=null;var d=J.p;try{J.p=2,gf(e,n,s,u)}finally{J.p=d,U.T=f}}function yx(e,n,s,u){var f=U.T;U.T=null;var d=J.p;try{J.p=8,gf(e,n,s,u)}finally{J.p=d,U.T=f}}function gf(e,n,s,u){if(lu){var f=yf(u);if(f===null)tf(e,n,u,ru,s),Og(e,u);else if(vx(f,e,n,s,u))u.stopPropagation();else if(Og(e,u),n&4&&-1<bx.indexOf(e)){for(;f!==null;){var d=Ma(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var g=Fi(d.pendingLanes);if(g!==0){var k=d;for(k.pendingLanes|=2,k.entangledLanes|=2;g;){var A=1<<31-Fe(g);k.entanglements[1]|=A,g&=~A}Dn(d),(He&6)===0&&(Yr=Ot()+500,pl(0))}}break;case 31:case 13:k=ta(d,2),k!==null&&Gt(k,d,2),$r(),pf(d,2)}if(d=yf(u),d===null&&tf(e,n,u,ru,s),d===f)break;f=d}f!==null&&u.stopPropagation()}else tf(e,n,u,null,s)}}function yf(e){return e=bo(e),bf(e)}var ru=null;function bf(e){if(ru=null,e=ja(e),e!==null){var n=o(e);if(n===null)e=null;else{var s=n.tag;if(s===13){if(e=c(n),e!==null)return e;e=null}else if(s===31){if(e=h(n),e!==null)return e;e=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return ru=e,null}function Cg(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(lo()){case $:return 2;case ae:return 8;case xe:case Oe:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var vf=!1,Li=null,Bi=null,qi=null,kl=new Map,wl=new Map,Ui=[],bx="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 Og(e,n){switch(e){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":Bi=null;break;case"mouseover":case"mouseout":qi=null;break;case"pointerover":case"pointerout":kl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":wl.delete(n.pointerId)}}function _l(e,n,s,u,f,d){return e===null||e.nativeEvent!==d?(e={blockedOn:n,domEventName:s,eventSystemFlags:u,nativeEvent:d,targetContainers:[f]},n!==null&&(n=Ma(n),n!==null&&Eg(n)),e):(e.eventSystemFlags|=u,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function vx(e,n,s,u,f){switch(n){case"focusin":return Li=_l(Li,e,n,s,u,f),!0;case"dragenter":return Bi=_l(Bi,e,n,s,u,f),!0;case"mouseover":return qi=_l(qi,e,n,s,u,f),!0;case"pointerover":var d=f.pointerId;return kl.set(d,_l(kl.get(d)||null,e,n,s,u,f)),!0;case"gotpointercapture":return d=f.pointerId,wl.set(d,_l(wl.get(d)||null,e,n,s,u,f)),!0}return!1}function jg(e){var n=ja(e.target);if(n!==null){var s=o(n);if(s!==null){if(n=s.tag,n===13){if(n=c(s),n!==null){e.blockedOn=n,$d(e.priority,function(){Ng(s)});return}}else if(n===31){if(n=h(s),n!==null){e.blockedOn=n,$d(e.priority,function(){Ng(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function uu(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var s=yf(e.nativeEvent);if(s===null){s=e.nativeEvent;var u=new s.constructor(s.type,s);yo=u,s.target.dispatchEvent(u),yo=null}else return n=Ma(s),n!==null&&Eg(n),e.blockedOn=s,!1;n.shift()}return!0}function Mg(e,n,s){uu(e)&&s.delete(n)}function xx(){vf=!1,Li!==null&&uu(Li)&&(Li=null),Bi!==null&&uu(Bi)&&(Bi=null),qi!==null&&uu(qi)&&(qi=null),kl.forEach(Mg),wl.forEach(Mg)}function ou(e,n){e.blockedOn===n&&(e.blockedOn=null,vf||(vf=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,xx)))}var cu=null;function Dg(e){cu!==e&&(cu=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){cu===e&&(cu=null);for(var n=0;n<e.length;n+=3){var s=e[n],u=e[n+1],f=e[n+2];if(typeof u!="function"){if(bf(u||s)===null)continue;break}var d=Ma(s);d!==null&&(e.splice(n,3),n-=3,gc(d,{pending:!0,data:f,method:s.method,action:u},u,f))}}))}function hs(e){function n(A){return ou(A,e)}Li!==null&&ou(Li,e),Bi!==null&&ou(Bi,e),qi!==null&&ou(qi,e),kl.forEach(n),wl.forEach(n);for(var s=0;s<Ui.length;s++){var u=Ui[s];u.blockedOn===e&&(u.blockedOn=null)}for(;0<Ui.length&&(s=Ui[0],s.blockedOn===null);)jg(s),s.blockedOn===null&&Ui.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(u=0;u<s.length;u+=3){var f=s[u],d=s[u+1],g=f[qt]||null;if(typeof d=="function")g||Dg(s);else if(g){var k=null;if(d&&d.hasAttribute("formAction")){if(f=d,g=d[qt]||null)k=g.formAction;else if(bf(f)!==null)continue}else k=g.action;typeof k=="function"?s[u+1]=k:(s.splice(u,3),u-=3),Dg(s)}}}function zg(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(g){return f=g})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),u||setTimeout(s,20)}function s(){if(!u&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){u=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function xf(e){this._internalRoot=e}fu.prototype.render=xf.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(l(409));var s=n.current,u=tn();Tg(s,u,e,n,null,null)},fu.prototype.unmount=xf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Tg(e.current,2,null,e,null,null),$r(),n[Oa]=null}};function fu(e){this._internalRoot=e}fu.prototype.unstable_scheduleHydration=function(e){if(e){var n=Gd();e={blockedOn:null,target:e,priority:n};for(var s=0;s<Ui.length&&n!==0&&n<Ui[s].priority;s++);Ui.splice(s,0,e),s===0&&jg(e)}};var Rg=t.version;if(Rg!=="19.2.4")throw Error(l(527,Rg,"19.2.4"));J.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=m(n),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Sx={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var du=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!du.isDisabled&&du.supportsFiber)try{jt=du.inject(Sx),bt=du}catch{}}return Al.createRoot=function(e,n){if(!r(e))throw Error(l(299));var s=!1,u="",f=Vm,d=Ym,g=Gm;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError)),n=wg(e,1,!1,null,null,s,u,null,f,d,g,zg),e[Oa]=n.current,ef(e),new xf(n)},Al.hydrateRoot=function(e,n,s){if(!r(e))throw Error(l(299));var u=!1,f="",d=Vm,g=Ym,k=Gm,A=null;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(d=s.onUncaughtError),s.onCaughtError!==void 0&&(g=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError),s.formState!==void 0&&(A=s.formState)),n=wg(e,1,!0,n,s??null,u,f,A,d,g,k,zg),n.context=_g(null),s=n.current,u=tn(),u=uo(u),f=_i(u),f.callback=null,Ti(s,f,u),s=u,n.current.lanes=s,Rs(n,s),Dn(n),e[Oa]=n.current,ef(e),new fu(n)},Al.version="19.2.4",Al}var $g;function zx(){if($g)return wf.exports;$g=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(t){console.error(t)}}return i(),wf.exports=Dx(),wf.exports}var Rx=zx();function Lx({domain:i,onChange:t,onSample:a}){const l=(r,o)=>{t({...i,[r]:o})};return v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("h3",{className:"m-0 text-sm font-semibold text-text-primary",children:"Domain Context"}),v.jsx("button",{type:"button",onClick:a,className:"px-2.5 py-1 border border-border rounded bg-surface-1 text-primary text-xs font-medium cursor-pointer hover:bg-surface-2 transition-colors",title:"Fill with random sample data",children:"Sample"})]}),v.jsxs("label",{className:"flex flex-col gap-1",children:[v.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Flow Name"}),v.jsx("input",{type:"text",value:i.name,onChange:r=>l("name",r.target.value),placeholder:"e.g., kyc-verification",className:"px-2.5 py-2 border border-border rounded-md bg-surface-2 text-text-primary text-sm outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 transition-colors"})]}),v.jsxs("label",{className:"flex flex-col gap-1",children:[v.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Domain"}),v.jsx("input",{type:"text",value:i.domain,onChange:r=>l("domain",r.target.value),placeholder:"e.g., finance, healthcare, engineering",className:"px-2.5 py-2 border border-border rounded-md bg-surface-2 text-text-primary text-sm outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 transition-colors"})]}),v.jsxs("label",{className:"flex flex-col gap-1",children:[v.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Description"}),v.jsx("textarea",{value:i.description,onChange:r=>l("description",r.target.value),placeholder:"What should this flow accomplish?",rows:3,className:"px-2.5 py-2 border border-border rounded-md bg-surface-2 text-text-primary text-sm outline-none resize-y focus:border-primary focus:ring-1 focus:ring-primary/30 transition-colors font-[inherit]"})]}),v.jsxs("label",{className:"flex flex-col gap-1",children:[v.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Business Rules"}),v.jsx("textarea",{value:i.businessRules,onChange:r=>l("businessRules",r.target.value),placeholder:"Constraints, requirements, compliance rules...",rows:3,className:"px-2.5 py-2 border border-border rounded-md bg-surface-2 text-text-primary text-sm outline-none resize-y focus:border-primary focus:ring-1 focus:ring-primary/30 transition-colors font-[inherit]"})]})]})}function $i({className:i="",...t}){return v.jsx("input",{...t,className:`px-2 py-1 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary ${i}`})}const Bx={primary:"px-2.5 py-1 border border-primary rounded bg-primary-light text-primary-text text-[11px] cursor-pointer whitespace-nowrap hover:bg-primary hover:text-white transition-colors",ghost:"border-none bg-transparent text-text-muted cursor-pointer text-xs px-0.5 hover:text-error"};function En({variant:i="primary",className:t="",...a}){return v.jsx("button",{type:"button",...a,className:`${Bx[i]} ${t}`})}const qx=[{mode:"immediate",short:"Immediate",hint:"Components appear in the first response"},{mode:"keyword",short:"Keyword",hint:"When user says a keyword"},{mode:"form-submit",short:"Form Submit",hint:"After form submission from previous step"},{mode:"contextual",short:"Contextual",hint:"Based on conversation context"}],Ux=[{type:"form",label:"Form"},{type:"button",label:"Button"},{type:"tasklist",label:"Tasklist"},{type:"table",label:"Table"},{type:"callout",label:"Callout"},{type:"approval-gate",label:"Approval Gate"},{type:"webhook",label:"Webhook"},{type:"chart",label:"Chart"},{type:"thinking",label:"Thinking"}];function Ix(i){const t={type:i,enabled:!0};return i==="form"&&(t.form={fields:[]}),i==="tasklist"&&(t.tasklist={items:[]}),i==="table"&&(t.table={columns:[]}),i==="approval-gate"&&(t.approvalGate={roles:[],requiredApprovers:1,requireReason:!1}),t}function Hx(i){return{label:`Step ${i+1}`,triggerMode:i===0?"immediate":"form-submit",trigger:"",components:[],description:""}}function Vx({flowSteps:i,onChange:t}){const a=(m,b)=>{t(i.map((y,S)=>S===m?{...y,...b}:y))},l=()=>t([...i,Hx(i.length)]),r=m=>{i.length<=1||t(i.filter((b,y)=>y!==m))},o=(m,b)=>{const y=m+b;if(y<0||y>=i.length)return;const S=[...i];[S[m],S[y]]=[S[y],S[m]],t(S)},c=(m,b)=>{const y=i[m];a(m,{components:[...y.components,Ix(b)]})},h=(m,b)=>{const y=i[m];a(m,{components:y.components.filter((S,x)=>x!==b)})},p=(m,b,y)=>{const x=i[m].components.map((N,T)=>T===b?{...N,...y}:N);a(m,{components:x})};return v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx("h3",{className:"m-0 text-sm font-semibold text-text-primary",children:"Conversation Flow"}),v.jsx("p",{className:"text-xs text-text-muted m-0",children:"Define each step of the conversation. Each step has its own trigger and components."}),i.map((m,b)=>v.jsx(Yx,{index:b,step:m,total:i.length,onUpdate:y=>a(b,y),onMove:y=>o(b,y),onRemove:()=>r(b),onAddComponent:y=>c(b,y),onRemoveComponent:y=>h(b,y),onUpdateComponent:(y,S)=>p(b,y,S)},b)),v.jsx(En,{onClick:l,className:"self-start",children:"+ Add Step"})]})}function Yx({index:i,step:t,total:a,onUpdate:l,onMove:r,onRemove:o,onAddComponent:c,onRemoveComponent:h,onUpdateComponent:p}){const[m,b]=W.useState(!1);return v.jsxs("div",{className:"flex flex-col gap-2 p-3 border border-border rounded-lg bg-surface-1",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"w-6 h-6 rounded-full bg-primary text-white text-xs font-bold flex items-center justify-center flex-shrink-0",children:i+1}),v.jsx("input",{type:"text",value:t.label,onChange:y=>l({label:y.target.value}),placeholder:"Step label...",className:"flex-1 px-2 py-1 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary"}),v.jsxs("div",{className:"flex gap-0.5",children:[v.jsx("button",{type:"button",onClick:()=>r(-1),disabled:i===0,className:"px-1.5 py-0.5 text-xs text-text-muted hover:text-text-primary disabled:opacity-30 bg-transparent border-none cursor-pointer",children:"↑"}),v.jsx("button",{type:"button",onClick:()=>r(1),disabled:i===a-1,className:"px-1.5 py-0.5 text-xs text-text-muted hover:text-text-primary disabled:opacity-30 bg-transparent border-none cursor-pointer",children:"↓"}),a>1&&v.jsx("button",{type:"button",onClick:o,className:"px-1.5 py-0.5 text-xs text-text-muted hover:text-error bg-transparent border-none cursor-pointer",children:"✕"})]})]}),v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsx("span",{className:"text-[11px] text-text-secondary font-medium",children:"Trigger"}),v.jsx("div",{className:"flex gap-1 flex-wrap",children:qx.map(y=>v.jsx("button",{type:"button",onClick:()=>l({triggerMode:y.mode,trigger:y.mode==="immediate"||y.mode==="form-submit"?"":t.trigger}),title:y.hint,className:`px-2 py-1 border rounded text-[10px] font-medium cursor-pointer transition-colors
50
+ ${t.triggerMode===y.mode?"border-primary text-primary-text bg-primary-light":"border-border text-text-secondary bg-surface-2 hover:bg-surface-3"}`,children:y.short},y.mode))}),t.triggerMode==="keyword"&&v.jsx($i,{value:t.trigger,onChange:y=>l({trigger:y.target.value}),placeholder:'e.g., "start KYC", "new incident"',className:"w-full"}),t.triggerMode==="contextual"&&v.jsx("textarea",{value:t.trigger,onChange:y=>l({trigger:y.target.value}),placeholder:'e.g., "After user provides details..."',rows:2,className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none resize-y focus:border-primary font-[inherit]"}),t.triggerMode==="form-submit"&&v.jsx("span",{className:"text-[10px] text-text-muted italic",children:"Triggered after form submission from previous step."}),t.triggerMode==="immediate"&&v.jsx("span",{className:"text-[10px] text-text-muted italic",children:"Components appear in the first response."})]}),v.jsxs("div",{className:"flex flex-col gap-1.5",children:[v.jsx("span",{className:"text-[11px] text-text-secondary font-medium",children:"Components"}),t.components.map((y,S)=>v.jsx(Gx,{comp:y,onUpdate:x=>p(S,x),onRemove:()=>h(S)},S)),v.jsxs("div",{className:"relative",children:[v.jsx(En,{onClick:()=>b(y=>!y),children:"+ Add Component"}),m&&v.jsx("div",{className:"absolute z-10 mt-1 bg-surface-2 border border-border rounded-lg shadow-lg py-1 w-48",children:Ux.map(y=>v.jsx("button",{type:"button",onClick:()=>{c(y.type),b(!1)},className:"w-full text-left px-3 py-1.5 text-xs text-text-primary hover:bg-surface-3 bg-transparent border-none cursor-pointer",children:y.label},y.type))})]})]}),v.jsx("textarea",{value:t.description,onChange:y=>l({description:y.target.value}),placeholder:"Optional: describe what happens at this step...",rows:2,className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none resize-y focus:border-primary font-[inherit]"})]})}function Gx({comp:i,onUpdate:t,onRemove:a}){const[l,r]=W.useState(!1);return v.jsxs("div",{className:"border border-border rounded bg-surface-0 p-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("button",{type:"button",onClick:()=>r(o=>!o),className:"text-[10px] text-text-muted bg-transparent border-none cursor-pointer",children:l?"▼":"▶"}),v.jsx("span",{className:"text-xs font-medium text-primary-text flex-1",children:i.type}),v.jsx(En,{variant:"ghost",onClick:a,children:"✕"})]}),l&&v.jsxs("div",{className:"mt-2",children:[i.type==="form"&&v.jsx($x,{comp:i,onUpdate:t}),i.type==="approval-gate"&&v.jsx(Kx,{comp:i,onUpdate:t}),i.type==="tasklist"&&v.jsx(Zx,{comp:i,onUpdate:t}),i.type==="table"&&v.jsx(Qx,{comp:i,onUpdate:t}),!["form","approval-gate","tasklist","table"].includes(i.type)&&v.jsx("span",{className:"text-[10px] text-text-muted",children:"No additional configuration needed."})]})]})}function $x({comp:i,onUpdate:t}){var c;const a=((c=i.form)==null?void 0:c.fields)??[],[l,r]=W.useState({name:"",type:"text",label:"",required:!1,sensitive:!1}),o=()=>{!l.name||!l.label||(t({form:{fields:[...a,{...l}]}}),r({name:"",type:"text",label:"",required:!1,sensitive:!1}))};return v.jsxs("div",{className:"flex flex-col gap-1.5",children:[a.map((h,p)=>v.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[v.jsx("span",{className:"font-medium text-primary-text",children:h.name}),v.jsxs("span",{className:"text-text-muted",children:["(",h.type,")"]}),v.jsxs("span",{className:"text-text-secondary",children:['"',h.label,'"']}),h.required&&v.jsx("span",{className:"text-warning",children:"req"}),h.sensitive&&v.jsx("span",{className:"text-error",children:"PII"}),v.jsx(En,{variant:"ghost",onClick:()=>t({form:{fields:a.filter((m,b)=>b!==p)}}),children:"x"})]},p)),v.jsxs("div",{className:"flex gap-1 flex-wrap items-center",children:[v.jsx($i,{placeholder:"name",value:l.name,onChange:h=>r(p=>({...p,name:h.target.value})),className:"w-16"}),v.jsx($i,{placeholder:"label",value:l.label,onChange:h=>r(p=>({...p,label:h.target.value})),className:"w-20"}),v.jsx("select",{value:l.type,onChange:h=>r(p=>({...p,type:h.target.value})),className:"px-1 py-0.5 border border-border rounded bg-surface-2 text-text-primary text-[10px] outline-none",children:["text","number","email","date","select","checkbox","textarea"].map(h=>v.jsx("option",{value:h,children:h},h))}),v.jsxs("label",{className:"text-[10px] text-text-secondary flex items-center gap-0.5",children:[v.jsx("input",{type:"checkbox",checked:l.required,onChange:h=>r(p=>({...p,required:h.target.checked}))}),"req"]}),v.jsxs("label",{className:"text-[10px] text-text-secondary flex items-center gap-0.5",children:[v.jsx("input",{type:"checkbox",checked:l.sensitive,onChange:h=>r(p=>({...p,sensitive:h.target.checked}))}),"PII"]}),v.jsx(En,{onClick:o,children:"+"})]})]})}function Kx({comp:i,onUpdate:t}){const a=i.approvalGate??{roles:[],requiredApprovers:1,requireReason:!1},[l,r]=W.useState("");return v.jsxs("div",{className:"flex flex-col gap-1.5",children:[v.jsx("div",{className:"flex gap-1 flex-wrap",children:a.roles.map((o,c)=>v.jsxs("span",{className:"bg-primary-light text-primary-text px-1.5 py-0.5 rounded text-[10px]",children:[o," ",v.jsx(En,{variant:"ghost",className:"ml-0.5",onClick:()=>t({approvalGate:{...a,roles:a.roles.filter((h,p)=>p!==c)}}),children:"x"})]},c))}),v.jsxs("div",{className:"flex gap-1 items-center",children:[v.jsx($i,{placeholder:"role",value:l,onChange:o=>r(o.target.value),onKeyDown:o=>{o.key==="Enter"&&l&&(t({approvalGate:{...a,roles:[...a.roles,l]}}),r(""))},className:"w-24"}),v.jsx(En,{onClick:()=>{l&&(t({approvalGate:{...a,roles:[...a.roles,l]}}),r(""))},children:"+"})]}),v.jsxs("span",{className:"text-[10px] text-text-secondary flex items-center gap-1",children:["Approvers:"," ",v.jsx($i,{type:"number",min:1,value:a.requiredApprovers,onChange:o=>t({approvalGate:{...a,requiredApprovers:Number(o.target.value)}}),className:"w-10"})]}),v.jsxs("label",{className:"text-[10px] text-text-secondary flex items-center gap-1",children:[v.jsx("input",{type:"checkbox",checked:a.requireReason,onChange:o=>t({approvalGate:{...a,requireReason:o.target.checked}})}),"Require reason on denial"]})]})}function Zx({comp:i,onUpdate:t}){var o;const a=((o=i.tasklist)==null?void 0:o.items)??[],[l,r]=W.useState("");return v.jsxs("div",{className:"flex flex-col gap-1",children:[a.map((c,h)=>v.jsxs("div",{className:"flex items-center gap-1 text-[10px]",children:[v.jsx("span",{className:"text-text-primary",children:c}),v.jsx(En,{variant:"ghost",onClick:()=>t({tasklist:{items:a.filter((p,m)=>m!==h)}}),children:"x"})]},h)),v.jsxs("div",{className:"flex gap-1",children:[v.jsx($i,{placeholder:"New item",value:l,onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"&&l&&(t({tasklist:{items:[...a,l]}}),r(""))},className:"flex-1"}),v.jsx(En,{onClick:()=>{l&&(t({tasklist:{items:[...a,l]}}),r(""))},children:"+"})]})]})}function Qx({comp:i,onUpdate:t}){var o;const a=((o=i.table)==null?void 0:o.columns)??[],[l,r]=W.useState({key:"",header:""});return v.jsxs("div",{className:"flex flex-col gap-1",children:[a.map((c,h)=>v.jsxs("div",{className:"flex items-center gap-1 text-[10px]",children:[v.jsx("span",{className:"text-primary-text",children:c.key}),v.jsxs("span",{className:"text-text-secondary",children:['"',c.header,'"']}),v.jsx(En,{variant:"ghost",onClick:()=>t({table:{columns:a.filter((p,m)=>m!==h)}}),children:"x"})]},h)),v.jsxs("div",{className:"flex gap-1",children:[v.jsx($i,{placeholder:"key",value:l.key,onChange:c=>r(h=>({...h,key:c.target.value})),className:"w-16"}),v.jsx($i,{placeholder:"header",value:l.header,onChange:c=>r(h=>({...h,header:c.target.value})),className:"flex-1"}),v.jsx(En,{onClick:()=>{l.key&&l.header&&(t({table:{columns:[...a,{...l}]}}),r({key:"",header:""}))},children:"+"})]})]})}const Xx={baseUrl:"http://localhost:11434/v1",apiKey:"",model:"llama3"},Bl={openai:{label:"OpenAI",baseUrl:"https://api.openai.com/v1",apiKey:"",model:"gpt-4o",requiresKey:!0},anthropic:{label:"Anthropic",baseUrl:"https://api.anthropic.com/v1",apiKey:"",model:"claude-sonnet-4-5-20250929",requiresKey:!0},gemini:{label:"Gemini",baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai",apiKey:"",model:"gemini-2.0-flash",requiresKey:!0},openrouter:{label:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",apiKey:"",model:"anthropic/claude-sonnet-4-5-20250929",requiresKey:!0},groq:{label:"Groq",baseUrl:"https://api.groq.com/openai/v1",apiKey:"",model:"llama-3.3-70b-versatile",requiresKey:!0},ollama:{label:"Ollama",baseUrl:"http://localhost:11434/v1",apiKey:"",model:"llama3",requiresKey:!1}};async function*Hy(i,t,a){var m,b,y,S;const l=`${i.baseUrl.replace(/\/+$/,"")}/chat/completions`,r={"Content-Type":"application/json"};i.apiKey&&(r.Authorization=`Bearer ${i.apiKey}`);const o=await fetch(l,{method:"POST",headers:r,body:JSON.stringify({model:i.model,messages:t,stream:!0}),signal:a});if(!o.ok){const x=await o.text();throw new Error(`LLM API error ${o.status}: ${x}`)}const c=(m=o.body)==null?void 0:m.getReader();if(!c)throw new Error("No response body");const h=new TextDecoder;let p="";for(;;){const{done:x,value:N}=await c.read();if(x)break;p+=h.decode(N,{stream:!0});const T=p.split(`
51
+ `);p=T.pop()??"";for(const M of T){const j=M.trim();if(!j||!j.startsWith("data: "))continue;const Y=j.slice(6);if(Y==="[DONE]")return;try{const Z=(S=(y=(b=JSON.parse(Y).choices)==null?void 0:b[0])==null?void 0:y.delta)==null?void 0:S.content;Z&&(yield Z)}catch{}}}}async function Vy(i,t,a){var h,p,m;const l=`${i.baseUrl.replace(/\/+$/,"")}/chat/completions`,r={"Content-Type":"application/json"};i.apiKey&&(r.Authorization=`Bearer ${i.apiKey}`);const o=await fetch(l,{method:"POST",headers:r,body:JSON.stringify({model:i.model,messages:t,stream:!1}),signal:a});if(!o.ok){const b=await o.text();throw new Error(`LLM API error ${o.status}: ${b}`)}return((m=(p=(h=(await o.json()).choices)==null?void 0:h[0])==null?void 0:p.message)==null?void 0:m.content)??""}function Fx({config:i,onConfigChange:t,activeProvider:a}){const l=a?Bl[a]:null;return v.jsxs("div",{className:"p-3 border border-border rounded-lg bg-surface-1 mb-2 flex flex-col gap-2.5",children:[v.jsx("span",{className:"text-xs text-text-secondary font-medium",children:"Provider"}),v.jsx("div",{className:"flex gap-1.5 flex-wrap",children:Object.entries(Bl).map(([r,o])=>v.jsx("button",{type:"button",onClick:()=>t({baseUrl:o.baseUrl,model:o.model,apiKey:i.apiKey}),className:`
52
+ px-3 py-1.5 border rounded text-xs font-medium cursor-pointer transition-colors
53
+ ${a===r?"border-primary text-primary-text bg-primary-light":"border-border text-text-secondary bg-surface-2 hover:bg-surface-3"}
54
+ `,children:o.label},r))}),(l==null?void 0:l.requiresKey)&&v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsxs("span",{className:"text-[11px] text-text-secondary",children:[l.label," API Key"]}),v.jsx("input",{placeholder:`Enter your ${l.label} API key...`,type:"password",value:i.apiKey,onChange:r=>t({...i,apiKey:r.target.value}),className:`
55
+ px-2 py-1.5 border rounded bg-surface-2 text-text-primary text-xs outline-none focus:ring-1 focus:ring-primary/30
56
+ ${i.apiKey?"border-success/30":"border-warning/30"}
57
+ `}),i.apiKey&&v.jsxs("span",{className:"text-[10px] text-success",children:["Key saved for ",l.label]})]}),v.jsxs("div",{className:"flex gap-2",children:[v.jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[v.jsx("span",{className:"text-[11px] text-text-secondary",children:"Model"}),v.jsx("input",{placeholder:"Model",value:i.model,onChange:r=>t({...i,model:r.target.value}),className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary"})]}),v.jsxs("div",{className:"flex-[2] flex flex-col gap-1",children:[v.jsx("span",{className:"text-[11px] text-text-secondary",children:"Base URL"}),v.jsx("input",{placeholder:"Base URL",value:i.baseUrl,onChange:r=>t({...i,baseUrl:r.target.value}),className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary"})]})]})]})}function Yy({value:i,onChange:t,onSend:a,onStop:l,isGenerating:r,disabled:o,placeholder:c,sendLabel:h}){return v.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border-light",children:[v.jsx("textarea",{value:i,onChange:p=>t(p.target.value),onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),!r&&!o&&a())},placeholder:c,rows:2,disabled:o,className:`
58
+ flex-1 px-2.5 py-2 border border-border rounded-md bg-surface-2 text-text-primary text-sm
59
+ outline-none resize-none font-[inherit] focus:border-primary focus:ring-1 focus:ring-primary/30
60
+ ${o?"opacity-50":""}
61
+ `}),r?v.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 border border-error rounded-md bg-error/10 text-error text-sm font-semibold cursor-pointer self-end hover:bg-error/20 transition-colors",children:"Stop"}):v.jsx("button",{type:"button",onClick:a,disabled:o,className:`
62
+ px-4 py-2 border border-primary rounded-md bg-primary-light text-primary-text text-sm font-semibold cursor-pointer self-end
63
+ hover:bg-primary hover:text-white transition-colors
64
+ ${o?"opacity-50 cursor-not-allowed":""}
65
+ `,children:h})]})}const Gy="mdma-builder-api-keys";function $y(){try{return JSON.parse(localStorage.getItem(Gy)||"{}")}catch{return{}}}function Jx(i,t){const a=$y();a[i]=t,localStorage.setItem(Gy,JSON.stringify(a))}function Kf(i){for(const[t,a]of Object.entries(Bl))if(i===a.baseUrl)return t;return null}function Wx({messages:i,isGenerating:t,error:a,onGenerate:l,onStop:r,onReset:o,config:c,onConfigChange:h}){const[p,m]=W.useState(""),[b,y]=W.useState(!1),S=W.useMemo(()=>Kf(c.baseUrl),[c.baseUrl]),x=S?Bl[S]:null,N=j=>{const Y=Kf(j.baseUrl);if(Y){const H=$y(),Z=j.apiKey!==c.apiKey?j.apiKey:H[Y]||j.apiKey;j.apiKey!==c.apiKey&&Jx(Y,j.apiKey),h({...j,apiKey:Z})}else h(j)},T=!(x!=null&&x.requiresKey)||c.apiKey.length>0,M=()=>{const j=p.trim();m(""),l(j||void 0)};return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex gap-2 items-center py-2",children:[v.jsx("button",{type:"button",onClick:()=>y(j=>!j),className:"border-none bg-transparent text-primary cursor-pointer text-xs p-0 hover:text-primary-hover",children:b?"Hide Settings":"Settings"}),v.jsxs("span",{className:"text-[11px] text-text-muted",children:[(x==null?void 0:x.label)||"Custom"," / ",c.model]}),!T&&v.jsx("span",{className:"text-[11px] text-warning",children:"API key required"}),v.jsx("div",{className:"flex-1"}),v.jsx("button",{type:"button",onClick:o,className:"border-none bg-transparent text-primary cursor-pointer text-xs p-0 hover:text-primary-hover",children:"Clear"})]}),b&&v.jsx(Fx,{config:c,onConfigChange:N,activeProvider:S}),v.jsxs("div",{className:"flex-1 overflow-y-auto flex flex-col gap-2 py-1",children:[i.length===0&&!t&&v.jsx("div",{className:"text-text-muted text-sm text-center py-10 px-5",children:T?v.jsxs(v.Fragment,{children:["Configure components on the left, then click ",v.jsx("strong",{children:"Generate"}),"."]}):v.jsxs(v.Fragment,{children:["Set your ",v.jsx("strong",{children:(x==null?void 0:x.label)||"LLM"})," API key in Settings above to get started."]})}),i.filter(j=>j.role!=="system").map((j,Y)=>v.jsx("div",{className:`
66
+ px-3 py-2 rounded-lg text-sm leading-relaxed max-w-[90%] whitespace-pre-wrap
67
+ ${j.role==="user"?"bg-primary-light text-primary-text self-end":"bg-surface-2 text-text-primary self-start"}
68
+ `,children:j.content},Y)),t&&v.jsx("div",{className:"text-xs text-primary px-1",children:"Generating..."}),a&&v.jsx("div",{className:"text-xs text-error px-1",children:a})]}),v.jsx(Yy,{value:p,onChange:m,onSend:M,onStop:r,isGenerating:t,disabled:!T,placeholder:i.length===0?"Click Generate or type to refine...":"Refine the prompt...",sendLabel:i.length===0?"Generate":"Send"})]})}function Px({prompt:i,isGenerating:t}){const[a,l]=W.useState(!1),r=async()=>{await navigator.clipboard.writeText(i),l(!0),setTimeout(()=>l(!1),2e3)},o=()=>{const c=new Blob([i],{type:"text/plain"}),h=URL.createObjectURL(c),p=document.createElement("a");p.href=h,p.download="mdma-custom-prompt.txt",p.click(),URL.revokeObjectURL(h)};return!i&&!t?v.jsx("div",{className:"flex flex-col h-full",children:v.jsxs("div",{className:"text-text-muted text-sm text-center py-10 px-5",children:[v.jsxs("p",{className:"mb-2",children:["Configure your components and click ",v.jsx("strong",{children:"Generate"}),"."]}),v.jsxs("p",{className:"text-[11px]",children:["The generated prompt will be used with:",v.jsx("br",{}),v.jsxs("code",{className:"text-primary-text",children:["buildSystemPrompt(","{ customPrompt }",")"]})]})]})}):v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex justify-between items-center mb-2",children:[v.jsx("h3",{className:"m-0 text-sm font-semibold text-text-primary",children:"Generated Prompt"}),v.jsxs("div",{className:"flex gap-1.5",children:[v.jsx("button",{type:"button",onClick:r,disabled:!i,className:"px-3 py-1 border border-border rounded bg-surface-1 text-text-primary text-[11px] cursor-pointer hover:bg-surface-2 transition-colors disabled:opacity-40",children:a?"Copied!":"Copy"}),v.jsx("button",{type:"button",onClick:o,disabled:!i,className:"px-3 py-1 border border-border rounded bg-surface-1 text-text-primary text-[11px] cursor-pointer hover:bg-surface-2 transition-colors disabled:opacity-40",children:"Save"})]})]}),v.jsxs("pre",{className:"flex-1 overflow-y-auto p-3 border border-border rounded-md bg-surface-0 text-text-primary text-xs leading-relaxed whitespace-pre-wrap break-words m-0",children:[i,t&&v.jsx("span",{className:"text-primary",children:"|"})]}),i&&v.jsxs("div",{className:"mt-2.5 p-2.5 border border-primary/30 rounded-md bg-primary-light/50",children:[v.jsx("p",{className:"m-0 text-[11px] text-text-secondary",children:"Usage in your app:"}),v.jsxs("code",{className:"text-xs text-primary-text",children:["import { buildSystemPrompt } from '@mobile-reality/mdma-prompt-pack';",v.jsx("br",{}),v.jsx("br",{}),"const systemPrompt = buildSystemPrompt({",v.jsx("br",{})," customPrompt: `<paste generated prompt here>`",v.jsx("br",{}),"});"]})]})]})}const e1="You are an expert MDMA document author. MDMA (Markdown Document with Mounted Applications) extends standard Markdown with interactive components defined in fenced code blocks using the `mdma` language tag. Think before you generate content, and ensure it adheres to the MDMA format and authoring rules.",Ky=`## Document Format
69
+
70
+ An MDMA document is a standard Markdown file that contains one or more interactive component blocks. Each component block is a YAML snippet inside a fenced code block tagged with \`mdma\`. Here is an example of what your output should look like — note there are NO outer \`\`\`markdown fences:
71
+
72
+ # My Document Title
73
+
74
+ Some regular Markdown content here.
75
+
76
+ \`\`\`mdma
77
+ type: form
78
+ id: contact-form
79
+ fields:
80
+ - name: email
81
+ type: email
82
+ label: Email Address
83
+ required: true
84
+ \`\`\`
85
+
86
+ More Markdown content can follow.
87
+
88
+ ## Component Types
89
+
90
+ MDMA supports 10 component types. Every component shares these base fields:
91
+
92
+ - **id** (string, required) — Unique identifier within the document
93
+ - **type** (string, required) — Component type name
94
+ - **label** (string, optional) — Display label
95
+ - **sensitive** (boolean, default: false) — If true, values are redacted in logs
96
+ - **disabled** (boolean | binding, default: false) — accepts \`true\`, \`false\`, or a quoted binding like \`"{{checklist.completed}}"\`
97
+ - **visible** (boolean | binding, default: true) — accepts \`true\`, \`false\`, or a quoted binding like \`"{{form.field}}"\`
98
+ - **meta** (object, optional) — Arbitrary metadata
99
+
100
+ ### 1. form
101
+
102
+ Collects user input via structured fields.
103
+
104
+ \`\`\`mdma
105
+ type: form
106
+ id: <unique-id>
107
+ fields:
108
+ - name: <field-name> # required, string
109
+ type: text | number | email | date | select | checkbox | textarea | file
110
+ label: <display-label> # required, string
111
+ required: true | false # default: false
112
+ sensitive: true | false # default: false — set true for PII
113
+ defaultValue: <any> # optional
114
+ options: # required when type is "select" — a list, OR { source, params } from a data-source catalog
115
+ - label: <label>
116
+ value: <value> # string — quote numeric-looking values, e.g. "1" not 1
117
+ validation: # optional
118
+ pattern: <regex>
119
+ min: <number>
120
+ max: <number>
121
+ message: <error-message>
122
+ bind: "{{variable.path}}" # optional binding
123
+ onSubmit: <action-id> # required — action triggered on submit
124
+ \`\`\`
125
+
126
+ ### 2. button
127
+
128
+ Triggers an action when clicked.
129
+
130
+ \`\`\`mdma
131
+ type: button
132
+ id: <unique-id>
133
+ text: <button-label> # required, string
134
+ variant: primary | secondary | danger | ghost # default: primary
135
+ onAction: <action-id> # required — action triggered on click
136
+ confirm: # optional confirmation dialog
137
+ title: <dialog-title>
138
+ message: <dialog-message>
139
+ confirmText: <confirm-label> # default: "Confirm"
140
+ cancelText: <cancel-label> # default: "Cancel"
141
+ \`\`\`
142
+
143
+ ### 3. tasklist
144
+
145
+ A checklist of items that can be individually checked off.
146
+
147
+ \`\`\`mdma
148
+ type: tasklist
149
+ id: <unique-id>
150
+ items:
151
+ - id: <item-id> # required, unique within tasklist
152
+ text: <item-description> # required, string
153
+ checked: true | false # default: false
154
+ required: true | false # default: false
155
+ bind: "{{variable.path}}" # optional binding
156
+ onComplete: <action-id> # optional — triggered when all items checked
157
+ \`\`\`
158
+
159
+ ### 4. table
160
+
161
+ Displays tabular data with optional sorting, filtering, and pagination.
162
+
163
+ \`\`\`mdma
164
+ type: table
165
+ id: <unique-id>
166
+ columns:
167
+ - key: <field-key> # required, string
168
+ header: <column-header> # required, string
169
+ sortable: true | false # default: false
170
+ sensitive: true | false # default: false
171
+ width: <css-width> # optional, e.g. "200px"
172
+ data: # array of row objects OR a binding OR a data-source ref
173
+ - { key1: value1, key2: value2 }
174
+ # OR: data: "{{variable.path}}"
175
+ # OR: data: { source: <source-name>, params: { <param>: <value> } } # source from the data-source catalog
176
+ sortable: true | false # default: false (table-level)
177
+ filterable: true | false # default: false
178
+ pageSize: <number> # optional, positive integer
179
+ \`\`\`
180
+
181
+ ### 5. callout
182
+
183
+ Displays a highlighted message block.
184
+
185
+ \`\`\`mdma
186
+ type: callout
187
+ id: <unique-id>
188
+ variant: info | warning | error | success # default: info
189
+ title: <optional-title>
190
+ content: <message-text> # required, string
191
+ dismissible: true | false # default: false
192
+ \`\`\`
193
+
194
+ ### 6. approval-gate
195
+
196
+ Blocks workflow progression until required approvals are received.
197
+
198
+ \`\`\`mdma
199
+ type: approval-gate
200
+ id: <unique-id>
201
+ title: <gate-title> # required, string
202
+ description: <details> # optional
203
+ requiredApprovers: <number> # default: 1, positive integer
204
+ allowedRoles: # optional — restrict who can approve
205
+ - <role-name>
206
+ onApprove: <action-id> # optional
207
+ onDeny: <action-id> # optional
208
+ requireReason: true | false # default: false — require reason on denial
209
+ \`\`\`
210
+
211
+ ### 7. webhook
212
+
213
+ Makes an HTTP request when triggered by an action.
214
+
215
+ \`\`\`mdma
216
+ type: webhook
217
+ id: <unique-id>
218
+ url: <endpoint-url> # required, valid URL or binding
219
+ method: GET | POST | PUT | PATCH | DELETE # default: POST
220
+ headers: # optional, key-value pairs
221
+ Content-Type: application/json
222
+ body: # optional, object or binding
223
+ key: value
224
+ trigger: <action-id> # required — action ID that triggers this webhook
225
+ retries: <0-5> # default: 0
226
+ timeout: <milliseconds> # default: 30000
227
+ \`\`\`
228
+
229
+ ### 8. chart
230
+
231
+ Displays data as a visual chart. Data is provided as a compact CSV-like multiline string where the first row contains column headers and subsequent rows contain comma-separated values.
232
+
233
+ \`\`\`mdma
234
+ type: chart
235
+ id: <unique-id>
236
+ variant: line | bar | area | pie # default: line
237
+ label: <chart-title> # optional
238
+ data: | # required — CSV multiline string, binding, or { source, params } data-source ref
239
+ <col1>, <col2>, <col3>
240
+ <val1>, <val2>, <val3>
241
+ <val1>, <val2>, <val3>
242
+ xAxis: <column-name> # optional — column for x-axis (default: first column)
243
+ yAxis: <column-name> | [<col1>, <col2>] # optional — column(s) for y-axis (default: all numeric non-xAxis columns)
244
+ colors: # optional — custom color palette
245
+ - "<hex-color>"
246
+ showLegend: true | false # default: true
247
+ showGrid: true | false # default: true
248
+ height: <number> # default: 300 (pixels)
249
+ stacked: true | false # default: false (for bar/area)
250
+ \`\`\`
251
+
252
+ **Data format rules:**
253
+ - First line of \`data\` = column headers (comma-separated, trimmed)
254
+ - Subsequent lines = data rows (comma-separated, trimmed)
255
+ - Numeric values are auto-detected and coerced
256
+ - Use YAML \`|\` block scalar for multi-line data
257
+
258
+ **Example — line chart:**
259
+ \`\`\`mdma
260
+ type: chart
261
+ id: revenue-chart
262
+ variant: line
263
+ label: Revenue Trend
264
+ data: |
265
+ month, revenue, costs
266
+ Jan, 45000, 32000
267
+ Feb, 52000, 35000
268
+ Mar, 48000, 31000
269
+ Apr, 61000, 38000
270
+ xAxis: month
271
+ \`\`\`
272
+
273
+ **Example — pie chart:**
274
+ \`\`\`mdma
275
+ type: chart
276
+ id: market-share
277
+ variant: pie
278
+ label: Market Share
279
+ data: |
280
+ company, share
281
+ Ours, 35
282
+ Competitor A, 25
283
+ Competitor B, 20
284
+ Others, 20
285
+ xAxis: company
286
+ \`\`\`
287
+
288
+ ### 9. thinking
289
+
290
+ Displays a collapsible block that shows AI reasoning or thinking process. Useful for transparency about how the AI arrived at conclusions or recommendations.
291
+
292
+ \`\`\`mdma
293
+ type: thinking
294
+ id: <unique-id>
295
+ label: <header-text> # optional — default: "Thinking"
296
+ content: | # required — free-form reasoning text
297
+ <reasoning text>
298
+ status: thinking | done # default: done — "thinking" shows pulsing animation
299
+ collapsed: true | false # default: true — starts collapsed
300
+ \`\`\`
301
+
302
+ - \`content\`: free-form reasoning text — use YAML \`|\` block scalar for multi-line
303
+ - \`collapsed: true\` by default — thinking is supplementary information
304
+ - \`status: thinking\` shows a pulsing animation (use during streaming), \`done\` when complete
305
+
306
+ **Example — analysis reasoning:**
307
+ \`\`\`mdma
308
+ type: thinking
309
+ id: analysis-reasoning
310
+ label: Analyzing revenue data...
311
+ status: done
312
+ collapsed: true
313
+ content: |
314
+ First, I examined the quarterly revenue trends.
315
+ Q3 shows a 15% dip which correlates with seasonal patterns.
316
+ However, year-over-year growth remains strong at 23%.
317
+ Recommendation: maintain current strategy with Q3 adjustments.
318
+ \`\`\`
319
+
320
+ ### 10. custom
321
+
322
+ An extension point for host-provided components that the built-in types do not cover. A \`custom\` component is a thin envelope: the host defines what each named variant does and how it renders. A \`custom\` component is a **standalone, top-level component** — it is NEVER a \`form\` field \`type\`, and must never be nested inside a \`form\`'s \`fields\` (there is no \`type: custom\` field). To collect signature or other host-specific input, emit a \`custom\` block on its own. You may ONLY use a \`custom\` component when its \`name\` appears in the "Available Custom Components" section below. If that section is absent, or lists no suitable variant, use a built-in type instead — NEVER invent a \`name\`.
323
+
324
+ \`\`\`mdma
325
+ type: custom
326
+ id: <unique-id>
327
+ name: <registered-variant-name> # required — MUST match an available custom component
328
+ props: # variant inputs; the named variant defines the shape
329
+ <key>: <value>
330
+ actions: # optional — map a variant event to an action-label
331
+ <onEvent>: <action-id>
332
+ \`\`\`
333
+
334
+ - **Standalone only**: a \`custom\` block is its own top-level component. Do NOT set \`type: custom\` on a \`form\` field or nest a variant under a form — a signature/rating/map input is a \`custom\` block, not a form field.
335
+ - \`name\`: selects the variant — must be one listed in "Available Custom Components".
336
+ - \`props\`: the variant's inputs. Provide exactly the keys that variant documents; do not add unknown keys or invent a shape.
337
+ - \`actions\`: opaque action-label strings for variant events (same semantics as \`onAction\`), wired by the host.
338
+ - Prefer a built-in component whenever one fits the request — \`custom\` is a last resort for host-specific needs. If a \`custom\` component collects input or fires actions, treat it as the one interactive component for the message.
339
+
340
+ ## Binding Syntax
341
+
342
+ Use \`{{variable.path}}\` to create dynamic bindings between components. Bindings must:
343
+ - Start with \`{{\` and end with \`}}\`
344
+ - Contain ONLY a dot-notation path starting with a letter or underscore — no operators (no \`==\`, \`!=\`, \`||\`, \`&&\`, \`!\`), no quotes, no spaces, no expressions
345
+ - Reference existing component IDs or context variables
346
+
347
+ Examples:
348
+ - \`{{contact_form.email}}\` — bind to the email field of a form
349
+ - \`{{user.name}}\` — bind to a context variable
350
+
351
+ **IMPORTANT — binding values on \`visible\` and \`disabled\`:**
352
+
353
+ The base fields \`visible\` and \`disabled\` accept either a boolean OR a binding string. When using a binding, the value MUST be a double-quoted string containing \`{{...}}\`. This is the ONLY correct syntax:
354
+
355
+ \`\`\`mdma
356
+ type: button
357
+ id: get-started-btn
358
+ text: "Get Started"
359
+ disabled: "{{onboarding-checklist.completed}}"
360
+ \`\`\`
361
+
362
+ \`\`\`mdma
363
+ type: callout
364
+ id: notification-info
365
+ variant: info
366
+ content: "You will receive notifications."
367
+ visible: "{{settings-form.notifications-enabled}}"
368
+ \`\`\`
369
+
370
+ Common mistakes to AVOID:
371
+ - ❌ \`disabled: {{foo.bar}}\` — missing quotes, YAML will break
372
+ - ❌ \`disabled: true\` when a binding was requested — always reproduce the exact binding
373
+ - ❌ Omitting \`visible\` or \`disabled\` when the blueprint includes it — copy it verbatim
374
+ - NEVER write \`visible: "\\"{{foo.bar}}\\""\` — do not put literal \`"\` characters inside the binding string. The YAML quotes are the ONLY quotes; the resolved value must start with \`{{\` and end with \`}}\`.
375
+ - NEVER use comparison or logical operators inside a binding (e.g. \`visible: "{{form.severity == 'p0' || form.severity == 'p1'}}"\`). Bindings are dot-paths only. If the requested behavior needs conditional logic, bind to a dedicated boolean field (e.g. add a \`is-critical: checkbox\` field and reference \`"{{form.is-critical}}"\`), or omit \`visible\` and let the component always render.
376
+
377
+ When a user request includes \`visible\` or \`disabled\` with a \`{{}}\` binding, you MUST reproduce it exactly as a quoted string.
378
+
379
+ ## Authoring Rules
380
+
381
+ 1. **Unique IDs** — Every component \`id\` must be unique within the document. Use descriptive kebab-case names (e.g., \`employee-onboarding-form\`, \`submit-btn\`).
382
+ 2. **Sensitive data** — Set \`sensitive: true\` on any field or column that contains PII (personally identifiable information) such as email addresses, phone numbers, SSNs, addresses, or financial data.
383
+ 3. **Required fields** — Mark form fields as \`required: true\` when the workflow cannot proceed without them.
384
+ 4. **Action labels** — Every \`type: form\` MUST include an \`onSubmit\` field. Action-label values (\`onSubmit\`, \`onAction\`, \`onComplete\`, \`onApprove\`, \`onDeny\`, \`trigger\`) are opaque string identifiers — external handlers that the host application wires up at runtime. They do NOT need to match a component in the document. Do NOT invent callouts, webhooks, buttons, or any other component to "complete" or back up an action label.
385
+ 5. **Binding validity** — Every \`{{binding}}\` must reference a valid source. Do not leave unresolved bindings.
386
+ 6. **Minimal components** — Only include components that are necessary for the workflow. Avoid empty or placeholder components.
387
+ 7. **YAML correctness** — Ensure all YAML in mdma blocks is valid and properly indented. Always wrap string values in double quotes if they contain a colon followed by a space (\`: \`), e.g. \`label: "Step 1: Enter your info"\`.
388
+ 8. **Always include thinking** — When generating MDMA components, ALWAYS include a \`thinking\` block BEFORE the main content to show your reasoning process. Use \`status: done\` and \`collapsed: true\`.
389
+ 9. **Never expose MDMA internals to the user** — Do NOT mention thinking blocks, sensitive flags, bindings, component IDs, YAML structure, or any other MDMA implementation details in your visible Markdown text. The user should see a natural, helpful response — not commentary about how the document is built. All reasoning belongs inside the \`thinking\` block, not in the prose. Never write things like "I included a thinking block" or "the email field is marked as sensitive".
390
+ 10. **Blueprint fidelity** — When the user provides an exact component structure, reproduce EVERY field verbatim, including \`visible\`, \`disabled\`, \`onComplete\`, \`onAction\`, and binding expressions. Never omit fields, never simplify bindings, never substitute \`true\`/\`false\` for a \`"{{...}}"\` binding. If the blueprint says \`disabled: "{{onboarding-checklist.completed}}"\`, your output must contain that exact line. If the blueprint says \`visible: "{{settings-form.notifications-enabled}}"\`, your output must contain that exact line.
391
+ 11. **One interactive component per message** — Each response must contain at most one **interactive** component: \`form\`, \`button\`, \`webhook\`, \`approval-gate\`, or \`tasklist\`. Non-interactive components (\`callout\`, \`table\`, \`chart\`, \`thinking\`) may appear alongside it freely. For multi-step workflows — where the user needs a form, then an approval gate, then a webhook — generate only the current step and tell the user what comes next. Never collapse multiple interactive steps into a single message.`,t1='## Self-Check Checklist\n\nBefore finalizing an MDMA document, verify:\n\n- [ ] Every component has a unique `id`\n- [ ] All PII fields have `sensitive: true`\n- [ ] All `{{bindings}}` reference valid sources\n- [ ] Required form fields are marked `required: true`\n- [ ] Every `type: form` has an `onSubmit` field (an opaque handler label, not a component reference)\n- [ ] No components were invented to back up `onSubmit`/`onAction`/`onApprove`/etc. labels\n- [ ] Select fields include an `options` array\n- [ ] YAML syntax is valid in all mdma blocks\n- [ ] Table `data` matches the declared `columns` keys\n- [ ] Approval gates have at least one approver configured\n- [ ] Webhook URLs are valid or use binding syntax\n- [ ] All `visible` and `disabled` bindings are double-quoted strings: `"{{component.field}}"`\n- [ ] Response contains at most one interactive component (`form`, `button`, `webhook`, `approval-gate`, `tasklist`)\n- [ ] Every `custom` component\'s `name` matches a listed "Available Custom Component" (never invented)\n- [ ] `custom` is used only when no built-in type fits the request',n1=`${e1}
392
+
393
+ CRITICAL: Your output IS the Markdown document — write headings, paragraphs, and \`\`\`mdma blocks directly. NEVER wrap your response in \`\`\`markdown code fences. Your response is already rendered as Markdown.
394
+
395
+ ${Ky}
396
+
397
+ ${t1}
398
+ `,Zy="mdma";var qe;(function(i){i.assertEqual=r=>{};function t(r){}i.assertIs=t;function a(r){throw new Error}i.assertNever=a,i.arrayToEnum=r=>{const o={};for(const c of r)o[c]=c;return o},i.getValidEnumValues=r=>{const o=i.objectKeys(r).filter(h=>typeof r[r[h]]!="number"),c={};for(const h of o)c[h]=r[h];return i.objectValues(c)},i.objectValues=r=>i.objectKeys(r).map(function(o){return r[o]}),i.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const c in r)Object.prototype.hasOwnProperty.call(r,c)&&o.push(c);return o},i.find=(r,o)=>{for(const c of r)if(o(c))return c},i.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function l(r,o=" | "){return r.map(c=>typeof c=="string"?`'${c}'`:c).join(o)}i.joinValues=l,i.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(qe||(qe={}));var Kg;(function(i){i.mergeShapes=(t,a)=>({...t,...a})})(Kg||(Kg={}));const oe=qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Vi=i=>{switch(typeof i){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return Number.isNaN(i)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(i)?oe.array:i===null?oe.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?oe.promise:typeof Map<"u"&&i instanceof Map?oe.map:typeof Set<"u"&&i instanceof Set?oe.set:typeof Date<"u"&&i instanceof Date?oe.date:oe.object;default:return oe.unknown}},ee=qe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class hi extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=l=>{this.issues=[...this.issues,l]},this.addIssues=(l=[])=>{this.issues=[...this.issues,...l]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=t}format(t){const a=t||function(o){return o.message},l={_errors:[]},r=o=>{for(const c of o.issues)if(c.code==="invalid_union")c.unionErrors.map(r);else if(c.code==="invalid_return_type")r(c.returnTypeError);else if(c.code==="invalid_arguments")r(c.argumentsError);else if(c.path.length===0)l._errors.push(a(c));else{let h=l,p=0;for(;p<c.path.length;){const m=c.path[p];p===c.path.length-1?(h[m]=h[m]||{_errors:[]},h[m]._errors.push(a(c))):h[m]=h[m]||{_errors:[]},h=h[m],p++}}};return r(this),l}static assert(t){if(!(t instanceof hi))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,qe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=a=>a.message){const a={},l=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];a[o]=a[o]||[],a[o].push(t(r))}else l.push(t(r));return{formErrors:l,fieldErrors:a}}get formErrors(){return this.flatten()}}hi.create=i=>new hi(i);const Zf=(i,t)=>{let a;switch(i.code){case ee.invalid_type:i.received===oe.undefined?a="Required":a=`Expected ${i.expected}, received ${i.received}`;break;case ee.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(i.expected,qe.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:a=`Unrecognized key(s) in object: ${qe.joinValues(i.keys,", ")}`;break;case ee.invalid_union:a="Invalid input";break;case ee.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${qe.joinValues(i.options)}`;break;case ee.invalid_enum_value:a=`Invalid enum value. Expected ${qe.joinValues(i.options)}, received '${i.received}'`;break;case ee.invalid_arguments:a="Invalid function arguments";break;case ee.invalid_return_type:a="Invalid function return type";break;case ee.invalid_date:a="Invalid date";break;case ee.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(a=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?a=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?a=`Invalid input: must end with "${i.validation.endsWith}"`:qe.assertNever(i.validation):i.validation!=="regex"?a=`Invalid ${i.validation}`:a="Invalid";break;case ee.too_small:i.type==="array"?a=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?a=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?a=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?a=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?a=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:a="Invalid input";break;case ee.too_big:i.type==="array"?a=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?a=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?a=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?a=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?a=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:a="Invalid input";break;case ee.custom:a="Invalid input";break;case ee.invalid_intersection_types:a="Intersection results could not be merged";break;case ee.not_multiple_of:a=`Number must be a multiple of ${i.multipleOf}`;break;case ee.not_finite:a="Number must be finite";break;default:a=t.defaultError,qe.assertNever(i)}return{message:a}};let i1=Zf;function a1(){return i1}const s1=i=>{const{data:t,path:a,errorMaps:l,issueData:r}=i,o=[...a,...r.path||[]],c={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let h="";const p=l.filter(m=>!!m).slice().reverse();for(const m of p)h=m(c,{data:t,defaultError:h}).message;return{...r,path:o,message:h}};function re(i,t){const a=a1(),l=s1({issueData:t,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,a,a===Zf?void 0:Zf].filter(r=>!!r)});i.common.issues.push(l)}class Lt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,a){const l=[];for(const r of a){if(r.status==="aborted")return ke;r.status==="dirty"&&t.dirty(),l.push(r.value)}return{status:t.value,value:l}}static async mergeObjectAsync(t,a){const l=[];for(const r of a){const o=await r.key,c=await r.value;l.push({key:o,value:c})}return Lt.mergeObjectSync(t,l)}static mergeObjectSync(t,a){const l={};for(const r of a){const{key:o,value:c}=r;if(o.status==="aborted"||c.status==="aborted")return ke;o.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof c.value<"u"||r.alwaysSet)&&(l[o.value]=c.value)}return{status:t.value,value:l}}}const ke=Object.freeze({status:"aborted"}),Ol=i=>({status:"dirty",value:i}),vn=i=>({status:"valid",value:i}),Zg=i=>i.status==="aborted",Qg=i=>i.status==="dirty",_s=i=>i.status==="valid",Tu=i=>typeof Promise<"u"&&i instanceof Promise;var me;(function(i){i.errToObj=t=>typeof t=="string"?{message:t}:t||{},i.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(me||(me={}));class Bn{constructor(t,a,l,r){this._cachedPath=[],this.parent=t,this.data=a,this._path=l,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Xg=(i,t)=>{if(_s(t))return{success:!0,data:t.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const a=new hi(i.common.issues);return this._error=a,this._error}}};function Ce(i){if(!i)return{};const{errorMap:t,invalid_type_error:a,required_error:l,description:r}=i;if(t&&(a||l))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(c,h)=>{const{message:p}=i;return c.code==="invalid_enum_value"?{message:p??h.defaultError}:typeof h.data>"u"?{message:p??l??h.defaultError}:c.code!=="invalid_type"?{message:h.defaultError}:{message:p??a??h.defaultError}},description:r}}class Re{get description(){return this._def.description}_getType(t){return Vi(t.data)}_getOrReturnCtx(t,a){return a||{common:t.parent.common,data:t.data,parsedType:Vi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Lt,ctx:{common:t.parent.common,data:t.data,parsedType:Vi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const a=this._parse(t);if(Tu(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(t){const a=this._parse(t);return Promise.resolve(a)}parse(t,a){const l=this.safeParse(t,a);if(l.success)return l.data;throw l.error}safeParse(t,a){const l={common:{issues:[],async:(a==null?void 0:a.async)??!1,contextualErrorMap:a==null?void 0:a.errorMap},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Vi(t)},r=this._parseSync({data:t,path:l.path,parent:l});return Xg(l,r)}"~validate"(t){var l,r;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Vi(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:a});return _s(o)?{value:o.value}:{issues:a.common.issues}}catch(o){(r=(l=o==null?void 0:o.message)==null?void 0:l.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:a}).then(o=>_s(o)?{value:o.value}:{issues:a.common.issues})}async parseAsync(t,a){const l=await this.safeParseAsync(t,a);if(l.success)return l.data;throw l.error}async safeParseAsync(t,a){const l={common:{issues:[],contextualErrorMap:a==null?void 0:a.errorMap,async:!0},path:(a==null?void 0:a.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Vi(t)},r=this._parse({data:t,path:l.path,parent:l}),o=await(Tu(r)?r:Promise.resolve(r));return Xg(l,o)}refine(t,a){const l=r=>typeof a=="string"||typeof a>"u"?{message:a}:typeof a=="function"?a(r):a;return this._refinement((r,o)=>{const c=t(r),h=()=>o.addIssue({code:ee.custom,...l(r)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(h(),!1)):c?!0:(h(),!1)})}refinement(t,a){return this._refinement((l,r)=>t(l)?!0:(r.addIssue(typeof a=="function"?a(l,r):a),!1))}_refinement(t){return new Zi({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a=>this["~validate"](a)}}optional(){return fi.create(this,this._def)}nullable(){return ka.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ln.create(this)}promise(){return Mu.create(this,this._def)}or(t){return Nu.create([this,t],this._def)}and(t){return Cu.create(this,t,this._def)}transform(t){return new Zi({...Ce(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const a=typeof t=="function"?t:()=>t;return new Du({...Ce(this._def),innerType:this,defaultValue:a,typeName:we.ZodDefault})}brand(){return new Jy({typeName:we.ZodBranded,type:this,...Ce(this._def)})}catch(t){const a=typeof t=="function"?t:()=>t;return new zu({...Ce(this._def),innerType:this,catchValue:a,typeName:we.ZodCatch})}describe(t){const a=this.constructor;return new a({...this._def,description:t})}pipe(t){return pd.create(this,t)}readonly(){return Ru.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const l1=/^c[^\s-]{8,}$/i,r1=/^[0-9a-z]+$/,u1=/^[0-9A-HJKMNP-TV-Z]{26}$/i,o1=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,c1=/^[a-z0-9_-]{21}$/i,f1=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,d1=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,h1=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,m1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ef;const p1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,g1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,y1=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,b1=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,v1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,x1=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Qy="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",S1=new RegExp(`^${Qy}$`);function Xy(i){let t="[0-5]\\d";i.precision?t=`${t}\\.\\d{${i.precision}}`:i.precision==null&&(t=`${t}(\\.\\d+)?`);const a=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${a}`}function k1(i){return new RegExp(`^${Xy(i)}$`)}function w1(i){let t=`${Qy}T${Xy(i)}`;const a=[];return a.push(i.local?"Z?":"Z"),i.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}function _1(i,t){return!!((t==="v4"||!t)&&p1.test(i)||(t==="v6"||!t)&&y1.test(i))}function T1(i,t){if(!f1.test(i))return!1;try{const[a]=i.split(".");if(!a)return!1;const l=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),r=JSON.parse(atob(l));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function A1(i,t){return!!((t==="v4"||!t)&&g1.test(i)||(t==="v6"||!t)&&b1.test(i))}class oi extends Re{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const o=this._getOrReturnCtx(t);return re(o,{code:ee.invalid_type,expected:oe.string,received:o.parsedType}),ke}const l=new Lt;let r;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(r=this._getOrReturnCtx(t,r),re(r,{code:ee.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),l.dirty());else if(o.kind==="max")t.data.length>o.value&&(r=this._getOrReturnCtx(t,r),re(r,{code:ee.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),l.dirty());else if(o.kind==="length"){const c=t.data.length>o.value,h=t.data.length<o.value;(c||h)&&(r=this._getOrReturnCtx(t,r),c?re(r,{code:ee.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):h&&re(r,{code:ee.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),l.dirty())}else if(o.kind==="email")h1.test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"email",code:ee.invalid_string,message:o.message}),l.dirty());else if(o.kind==="emoji")Ef||(Ef=new RegExp(m1,"u")),Ef.test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"emoji",code:ee.invalid_string,message:o.message}),l.dirty());else if(o.kind==="uuid")o1.test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"uuid",code:ee.invalid_string,message:o.message}),l.dirty());else if(o.kind==="nanoid")c1.test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"nanoid",code:ee.invalid_string,message:o.message}),l.dirty());else if(o.kind==="cuid")l1.test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"cuid",code:ee.invalid_string,message:o.message}),l.dirty());else if(o.kind==="cuid2")r1.test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"cuid2",code:ee.invalid_string,message:o.message}),l.dirty());else if(o.kind==="ulid")u1.test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"ulid",code:ee.invalid_string,message:o.message}),l.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),re(r,{validation:"url",code:ee.invalid_string,message:o.message}),l.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"regex",code:ee.invalid_string,message:o.message}),l.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(t,r),re(r,{code:ee.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),l.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(r=this._getOrReturnCtx(t,r),re(r,{code:ee.invalid_string,validation:{startsWith:o.value},message:o.message}),l.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(r=this._getOrReturnCtx(t,r),re(r,{code:ee.invalid_string,validation:{endsWith:o.value},message:o.message}),l.dirty()):o.kind==="datetime"?w1(o).test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{code:ee.invalid_string,validation:"datetime",message:o.message}),l.dirty()):o.kind==="date"?S1.test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{code:ee.invalid_string,validation:"date",message:o.message}),l.dirty()):o.kind==="time"?k1(o).test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{code:ee.invalid_string,validation:"time",message:o.message}),l.dirty()):o.kind==="duration"?d1.test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"duration",code:ee.invalid_string,message:o.message}),l.dirty()):o.kind==="ip"?_1(t.data,o.version)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"ip",code:ee.invalid_string,message:o.message}),l.dirty()):o.kind==="jwt"?T1(t.data,o.alg)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"jwt",code:ee.invalid_string,message:o.message}),l.dirty()):o.kind==="cidr"?A1(t.data,o.version)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"cidr",code:ee.invalid_string,message:o.message}),l.dirty()):o.kind==="base64"?v1.test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"base64",code:ee.invalid_string,message:o.message}),l.dirty()):o.kind==="base64url"?x1.test(t.data)||(r=this._getOrReturnCtx(t,r),re(r,{validation:"base64url",code:ee.invalid_string,message:o.message}),l.dirty()):qe.assertNever(o);return{status:l.value,value:t.data}}_regex(t,a,l){return this.refinement(r=>t.test(r),{validation:a,code:ee.invalid_string,...me.errToObj(l)})}_addCheck(t){return new oi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...me.errToObj(t)})}url(t){return this._addCheck({kind:"url",...me.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...me.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...me.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...me.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...me.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...me.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...me.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...me.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...me.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...me.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...me.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...me.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...me.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...me.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...me.errToObj(t)})}regex(t,a){return this._addCheck({kind:"regex",regex:t,...me.errToObj(a)})}includes(t,a){return this._addCheck({kind:"includes",value:t,position:a==null?void 0:a.position,...me.errToObj(a==null?void 0:a.message)})}startsWith(t,a){return this._addCheck({kind:"startsWith",value:t,...me.errToObj(a)})}endsWith(t,a){return this._addCheck({kind:"endsWith",value:t,...me.errToObj(a)})}min(t,a){return this._addCheck({kind:"min",value:t,...me.errToObj(a)})}max(t,a){return this._addCheck({kind:"max",value:t,...me.errToObj(a)})}length(t,a){return this._addCheck({kind:"length",value:t,...me.errToObj(a)})}nonempty(t){return this.min(1,me.errToObj(t))}trim(){return new oi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new oi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new oi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const a of this._def.checks)a.kind==="min"&&(t===null||a.value>t)&&(t=a.value);return t}get maxLength(){let t=null;for(const a of this._def.checks)a.kind==="max"&&(t===null||a.value<t)&&(t=a.value);return t}}oi.create=i=>new oi({checks:[],typeName:we.ZodString,coerce:(i==null?void 0:i.coerce)??!1,...Ce(i)});function E1(i,t){const a=(i.toString().split(".")[1]||"").length,l=(t.toString().split(".")[1]||"").length,r=a>l?a:l,o=Number.parseInt(i.toFixed(r).replace(".","")),c=Number.parseInt(t.toFixed(r).replace(".",""));return o%c/10**r}class Ts extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==oe.number){const o=this._getOrReturnCtx(t);return re(o,{code:ee.invalid_type,expected:oe.number,received:o.parsedType}),ke}let l;const r=new Lt;for(const o of this._def.checks)o.kind==="int"?qe.isInteger(t.data)||(l=this._getOrReturnCtx(t,l),re(l,{code:ee.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(l=this._getOrReturnCtx(t,l),re(l,{code:ee.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(l=this._getOrReturnCtx(t,l),re(l,{code:ee.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?E1(t.data,o.value)!==0&&(l=this._getOrReturnCtx(t,l),re(l,{code:ee.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(l=this._getOrReturnCtx(t,l),re(l,{code:ee.not_finite,message:o.message}),r.dirty()):qe.assertNever(o);return{status:r.value,value:t.data}}gte(t,a){return this.setLimit("min",t,!0,me.toString(a))}gt(t,a){return this.setLimit("min",t,!1,me.toString(a))}lte(t,a){return this.setLimit("max",t,!0,me.toString(a))}lt(t,a){return this.setLimit("max",t,!1,me.toString(a))}setLimit(t,a,l,r){return new Ts({...this._def,checks:[...this._def.checks,{kind:t,value:a,inclusive:l,message:me.toString(r)}]})}_addCheck(t){return new Ts({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:me.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(t)})}multipleOf(t,a){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(a)})}finite(t){return this._addCheck({kind:"finite",message:me.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.toString(t)})}get minValue(){let t=null;for(const a of this._def.checks)a.kind==="min"&&(t===null||a.value>t)&&(t=a.value);return t}get maxValue(){let t=null;for(const a of this._def.checks)a.kind==="max"&&(t===null||a.value<t)&&(t=a.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&qe.isInteger(t.value))}get isFinite(){let t=null,a=null;for(const l of this._def.checks){if(l.kind==="finite"||l.kind==="int"||l.kind==="multipleOf")return!0;l.kind==="min"?(a===null||l.value>a)&&(a=l.value):l.kind==="max"&&(t===null||l.value<t)&&(t=l.value)}return Number.isFinite(a)&&Number.isFinite(t)}}Ts.create=i=>new Ts({checks:[],typeName:we.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...Ce(i)});class ql extends Re{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==oe.bigint)return this._getInvalidInput(t);let l;const r=new Lt;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(l=this._getOrReturnCtx(t,l),re(l,{code:ee.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(l=this._getOrReturnCtx(t,l),re(l,{code:ee.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(l=this._getOrReturnCtx(t,l),re(l,{code:ee.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):qe.assertNever(o);return{status:r.value,value:t.data}}_getInvalidInput(t){const a=this._getOrReturnCtx(t);return re(a,{code:ee.invalid_type,expected:oe.bigint,received:a.parsedType}),ke}gte(t,a){return this.setLimit("min",t,!0,me.toString(a))}gt(t,a){return this.setLimit("min",t,!1,me.toString(a))}lte(t,a){return this.setLimit("max",t,!0,me.toString(a))}lt(t,a){return this.setLimit("max",t,!1,me.toString(a))}setLimit(t,a,l,r){return new ql({...this._def,checks:[...this._def.checks,{kind:t,value:a,inclusive:l,message:me.toString(r)}]})}_addCheck(t){return new ql({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(t)})}multipleOf(t,a){return this._addCheck({kind:"multipleOf",value:t,message:me.toString(a)})}get minValue(){let t=null;for(const a of this._def.checks)a.kind==="min"&&(t===null||a.value>t)&&(t=a.value);return t}get maxValue(){let t=null;for(const a of this._def.checks)a.kind==="max"&&(t===null||a.value<t)&&(t=a.value);return t}}ql.create=i=>new ql({checks:[],typeName:we.ZodBigInt,coerce:(i==null?void 0:i.coerce)??!1,...Ce(i)});class Qf extends Re{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==oe.boolean){const l=this._getOrReturnCtx(t);return re(l,{code:ee.invalid_type,expected:oe.boolean,received:l.parsedType}),ke}return vn(t.data)}}Qf.create=i=>new Qf({typeName:we.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...Ce(i)});class Au extends Re{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const o=this._getOrReturnCtx(t);return re(o,{code:ee.invalid_type,expected:oe.date,received:o.parsedType}),ke}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return re(o,{code:ee.invalid_date}),ke}const l=new Lt;let r;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(r=this._getOrReturnCtx(t,r),re(r,{code:ee.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),l.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(r=this._getOrReturnCtx(t,r),re(r,{code:ee.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),l.dirty()):qe.assertNever(o);return{status:l.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Au({...this._def,checks:[...this._def.checks,t]})}min(t,a){return this._addCheck({kind:"min",value:t.getTime(),message:me.toString(a)})}max(t,a){return this._addCheck({kind:"max",value:t.getTime(),message:me.toString(a)})}get minDate(){let t=null;for(const a of this._def.checks)a.kind==="min"&&(t===null||a.value>t)&&(t=a.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const a of this._def.checks)a.kind==="max"&&(t===null||a.value<t)&&(t=a.value);return t!=null?new Date(t):null}}Au.create=i=>new Au({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:we.ZodDate,...Ce(i)});class Fg extends Re{_parse(t){if(this._getType(t)!==oe.symbol){const l=this._getOrReturnCtx(t);return re(l,{code:ee.invalid_type,expected:oe.symbol,received:l.parsedType}),ke}return vn(t.data)}}Fg.create=i=>new Fg({typeName:we.ZodSymbol,...Ce(i)});class Xf extends Re{_parse(t){if(this._getType(t)!==oe.undefined){const l=this._getOrReturnCtx(t);return re(l,{code:ee.invalid_type,expected:oe.undefined,received:l.parsedType}),ke}return vn(t.data)}}Xf.create=i=>new Xf({typeName:we.ZodUndefined,...Ce(i)});class Eu extends Re{_parse(t){if(this._getType(t)!==oe.null){const l=this._getOrReturnCtx(t);return re(l,{code:ee.invalid_type,expected:oe.null,received:l.parsedType}),ke}return vn(t.data)}}Eu.create=i=>new Eu({typeName:we.ZodNull,...Ce(i)});class Jg extends Re{constructor(){super(...arguments),this._any=!0}_parse(t){return vn(t.data)}}Jg.create=i=>new Jg({typeName:we.ZodAny,...Ce(i)});class Ff extends Re{constructor(){super(...arguments),this._unknown=!0}_parse(t){return vn(t.data)}}Ff.create=i=>new Ff({typeName:we.ZodUnknown,...Ce(i)});class Ki extends Re{_parse(t){const a=this._getOrReturnCtx(t);return re(a,{code:ee.invalid_type,expected:oe.never,received:a.parsedType}),ke}}Ki.create=i=>new Ki({typeName:we.ZodNever,...Ce(i)});class Wg extends Re{_parse(t){if(this._getType(t)!==oe.undefined){const l=this._getOrReturnCtx(t);return re(l,{code:ee.invalid_type,expected:oe.void,received:l.parsedType}),ke}return vn(t.data)}}Wg.create=i=>new Wg({typeName:we.ZodVoid,...Ce(i)});class Ln extends Re{_parse(t){const{ctx:a,status:l}=this._processInputParams(t),r=this._def;if(a.parsedType!==oe.array)return re(a,{code:ee.invalid_type,expected:oe.array,received:a.parsedType}),ke;if(r.exactLength!==null){const c=a.data.length>r.exactLength.value,h=a.data.length<r.exactLength.value;(c||h)&&(re(a,{code:c?ee.too_big:ee.too_small,minimum:h?r.exactLength.value:void 0,maximum:c?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),l.dirty())}if(r.minLength!==null&&a.data.length<r.minLength.value&&(re(a,{code:ee.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),l.dirty()),r.maxLength!==null&&a.data.length>r.maxLength.value&&(re(a,{code:ee.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),l.dirty()),a.common.async)return Promise.all([...a.data].map((c,h)=>r.type._parseAsync(new Bn(a,c,a.path,h)))).then(c=>Lt.mergeArray(l,c));const o=[...a.data].map((c,h)=>r.type._parseSync(new Bn(a,c,a.path,h)));return Lt.mergeArray(l,o)}get element(){return this._def.type}min(t,a){return new Ln({...this._def,minLength:{value:t,message:me.toString(a)}})}max(t,a){return new Ln({...this._def,maxLength:{value:t,message:me.toString(a)}})}length(t,a){return new Ln({...this._def,exactLength:{value:t,message:me.toString(a)}})}nonempty(t){return this.min(1,t)}}Ln.create=(i,t)=>new Ln({type:i,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Ce(t)});function gs(i){if(i instanceof gt){const t={};for(const a in i.shape){const l=i.shape[a];t[a]=fi.create(gs(l))}return new gt({...i._def,shape:()=>t})}else return i instanceof Ln?new Ln({...i._def,type:gs(i.element)}):i instanceof fi?fi.create(gs(i.unwrap())):i instanceof ka?ka.create(gs(i.unwrap())):i instanceof xa?xa.create(i.items.map(t=>gs(t))):i}class gt extends Re{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),a=qe.objectKeys(t);return this._cached={shape:t,keys:a},this._cached}_parse(t){if(this._getType(t)!==oe.object){const m=this._getOrReturnCtx(t);return re(m,{code:ee.invalid_type,expected:oe.object,received:m.parsedType}),ke}const{status:l,ctx:r}=this._processInputParams(t),{shape:o,keys:c}=this._getCached(),h=[];if(!(this._def.catchall instanceof Ki&&this._def.unknownKeys==="strip"))for(const m in r.data)c.includes(m)||h.push(m);const p=[];for(const m of c){const b=o[m],y=r.data[m];p.push({key:{status:"valid",value:m},value:b._parse(new Bn(r,y,r.path,m)),alwaysSet:m in r.data})}if(this._def.catchall instanceof Ki){const m=this._def.unknownKeys;if(m==="passthrough")for(const b of h)p.push({key:{status:"valid",value:b},value:{status:"valid",value:r.data[b]}});else if(m==="strict")h.length>0&&(re(r,{code:ee.unrecognized_keys,keys:h}),l.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const b of h){const y=r.data[b];p.push({key:{status:"valid",value:b},value:m._parse(new Bn(r,y,r.path,b)),alwaysSet:b in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const m=[];for(const b of p){const y=await b.key,S=await b.value;m.push({key:y,value:S,alwaysSet:b.alwaysSet})}return m}).then(m=>Lt.mergeObjectSync(l,m)):Lt.mergeObjectSync(l,p)}get shape(){return this._def.shape()}strict(t){return me.errToObj,new gt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(a,l)=>{var o,c;const r=((c=(o=this._def).errorMap)==null?void 0:c.call(o,a,l).message)??l.defaultError;return a.code==="unrecognized_keys"?{message:me.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new gt({...this._def,unknownKeys:"strip"})}passthrough(){return new gt({...this._def,unknownKeys:"passthrough"})}extend(t){return new gt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new gt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:we.ZodObject})}setKey(t,a){return this.augment({[t]:a})}catchall(t){return new gt({...this._def,catchall:t})}pick(t){const a={};for(const l of qe.objectKeys(t))t[l]&&this.shape[l]&&(a[l]=this.shape[l]);return new gt({...this._def,shape:()=>a})}omit(t){const a={};for(const l of qe.objectKeys(this.shape))t[l]||(a[l]=this.shape[l]);return new gt({...this._def,shape:()=>a})}deepPartial(){return gs(this)}partial(t){const a={};for(const l of qe.objectKeys(this.shape)){const r=this.shape[l];t&&!t[l]?a[l]=r:a[l]=r.optional()}return new gt({...this._def,shape:()=>a})}required(t){const a={};for(const l of qe.objectKeys(this.shape))if(t&&!t[l])a[l]=this.shape[l];else{let o=this.shape[l];for(;o instanceof fi;)o=o._def.innerType;a[l]=o}return new gt({...this._def,shape:()=>a})}keyof(){return Fy(qe.objectKeys(this.shape))}}gt.create=(i,t)=>new gt({shape:()=>i,unknownKeys:"strip",catchall:Ki.create(),typeName:we.ZodObject,...Ce(t)});gt.strictCreate=(i,t)=>new gt({shape:()=>i,unknownKeys:"strict",catchall:Ki.create(),typeName:we.ZodObject,...Ce(t)});gt.lazycreate=(i,t)=>new gt({shape:i,unknownKeys:"strip",catchall:Ki.create(),typeName:we.ZodObject,...Ce(t)});class Nu extends Re{_parse(t){const{ctx:a}=this._processInputParams(t),l=this._def.options;function r(o){for(const h of o)if(h.result.status==="valid")return h.result;for(const h of o)if(h.result.status==="dirty")return a.common.issues.push(...h.ctx.common.issues),h.result;const c=o.map(h=>new hi(h.ctx.common.issues));return re(a,{code:ee.invalid_union,unionErrors:c}),ke}if(a.common.async)return Promise.all(l.map(async o=>{const c={...a,common:{...a.common,issues:[]},parent:null};return{result:await o._parseAsync({data:a.data,path:a.path,parent:c}),ctx:c}})).then(r);{let o;const c=[];for(const p of l){const m={...a,common:{...a.common,issues:[]},parent:null},b=p._parseSync({data:a.data,path:a.path,parent:m});if(b.status==="valid")return b;b.status==="dirty"&&!o&&(o={result:b,ctx:m}),m.common.issues.length&&c.push(m.common.issues)}if(o)return a.common.issues.push(...o.ctx.common.issues),o.result;const h=c.map(p=>new hi(p));return re(a,{code:ee.invalid_union,unionErrors:h}),ke}}get options(){return this._def.options}}Nu.create=(i,t)=>new Nu({options:i,typeName:we.ZodUnion,...Ce(t)});const ui=i=>i instanceof Wf?ui(i.schema):i instanceof Zi?ui(i.innerType()):i instanceof ju?[i.value]:i instanceof Sa?i.options:i instanceof Pf?qe.objectValues(i.enum):i instanceof Du?ui(i._def.innerType):i instanceof Xf?[void 0]:i instanceof Eu?[null]:i instanceof fi?[void 0,...ui(i.unwrap())]:i instanceof ka?[null,...ui(i.unwrap())]:i instanceof Jy||i instanceof Ru?ui(i.unwrap()):i instanceof zu?ui(i._def.innerType):[];class md extends Re{_parse(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==oe.object)return re(a,{code:ee.invalid_type,expected:oe.object,received:a.parsedType}),ke;const l=this.discriminator,r=a.data[l],o=this.optionsMap.get(r);return o?a.common.async?o._parseAsync({data:a.data,path:a.path,parent:a}):o._parseSync({data:a.data,path:a.path,parent:a}):(re(a,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[l]}),ke)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,a,l){const r=new Map;for(const o of a){const c=ui(o.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const h of c){if(r.has(h))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(h)}`);r.set(h,o)}}return new md({typeName:we.ZodDiscriminatedUnion,discriminator:t,options:a,optionsMap:r,...Ce(l)})}}function Jf(i,t){const a=Vi(i),l=Vi(t);if(i===t)return{valid:!0,data:i};if(a===oe.object&&l===oe.object){const r=qe.objectKeys(t),o=qe.objectKeys(i).filter(h=>r.indexOf(h)!==-1),c={...i,...t};for(const h of o){const p=Jf(i[h],t[h]);if(!p.valid)return{valid:!1};c[h]=p.data}return{valid:!0,data:c}}else if(a===oe.array&&l===oe.array){if(i.length!==t.length)return{valid:!1};const r=[];for(let o=0;o<i.length;o++){const c=i[o],h=t[o],p=Jf(c,h);if(!p.valid)return{valid:!1};r.push(p.data)}return{valid:!0,data:r}}else return a===oe.date&&l===oe.date&&+i==+t?{valid:!0,data:i}:{valid:!1}}class Cu extends Re{_parse(t){const{status:a,ctx:l}=this._processInputParams(t),r=(o,c)=>{if(Zg(o)||Zg(c))return ke;const h=Jf(o.value,c.value);return h.valid?((Qg(o)||Qg(c))&&a.dirty(),{status:a.value,value:h.data}):(re(l,{code:ee.invalid_intersection_types}),ke)};return l.common.async?Promise.all([this._def.left._parseAsync({data:l.data,path:l.path,parent:l}),this._def.right._parseAsync({data:l.data,path:l.path,parent:l})]).then(([o,c])=>r(o,c)):r(this._def.left._parseSync({data:l.data,path:l.path,parent:l}),this._def.right._parseSync({data:l.data,path:l.path,parent:l}))}}Cu.create=(i,t,a)=>new Cu({left:i,right:t,typeName:we.ZodIntersection,...Ce(a)});class xa extends Re{_parse(t){const{status:a,ctx:l}=this._processInputParams(t);if(l.parsedType!==oe.array)return re(l,{code:ee.invalid_type,expected:oe.array,received:l.parsedType}),ke;if(l.data.length<this._def.items.length)return re(l,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ke;!this._def.rest&&l.data.length>this._def.items.length&&(re(l,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());const o=[...l.data].map((c,h)=>{const p=this._def.items[h]||this._def.rest;return p?p._parse(new Bn(l,c,l.path,h)):null}).filter(c=>!!c);return l.common.async?Promise.all(o).then(c=>Lt.mergeArray(a,c)):Lt.mergeArray(a,o)}get items(){return this._def.items}rest(t){return new xa({...this._def,rest:t})}}xa.create=(i,t)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xa({items:i,typeName:we.ZodTuple,rest:null,...Ce(t)})};class Ou extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:a,ctx:l}=this._processInputParams(t);if(l.parsedType!==oe.object)return re(l,{code:ee.invalid_type,expected:oe.object,received:l.parsedType}),ke;const r=[],o=this._def.keyType,c=this._def.valueType;for(const h in l.data)r.push({key:o._parse(new Bn(l,h,l.path,h)),value:c._parse(new Bn(l,l.data[h],l.path,h)),alwaysSet:h in l.data});return l.common.async?Lt.mergeObjectAsync(a,r):Lt.mergeObjectSync(a,r)}get element(){return this._def.valueType}static create(t,a,l){return a instanceof Re?new Ou({keyType:t,valueType:a,typeName:we.ZodRecord,...Ce(l)}):new Ou({keyType:oi.create(),valueType:t,typeName:we.ZodRecord,...Ce(a)})}}class Pg extends Re{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:a,ctx:l}=this._processInputParams(t);if(l.parsedType!==oe.map)return re(l,{code:ee.invalid_type,expected:oe.map,received:l.parsedType}),ke;const r=this._def.keyType,o=this._def.valueType,c=[...l.data.entries()].map(([h,p],m)=>({key:r._parse(new Bn(l,h,l.path,[m,"key"])),value:o._parse(new Bn(l,p,l.path,[m,"value"]))}));if(l.common.async){const h=new Map;return Promise.resolve().then(async()=>{for(const p of c){const m=await p.key,b=await p.value;if(m.status==="aborted"||b.status==="aborted")return ke;(m.status==="dirty"||b.status==="dirty")&&a.dirty(),h.set(m.value,b.value)}return{status:a.value,value:h}})}else{const h=new Map;for(const p of c){const m=p.key,b=p.value;if(m.status==="aborted"||b.status==="aborted")return ke;(m.status==="dirty"||b.status==="dirty")&&a.dirty(),h.set(m.value,b.value)}return{status:a.value,value:h}}}}Pg.create=(i,t,a)=>new Pg({valueType:t,keyType:i,typeName:we.ZodMap,...Ce(a)});class Ul extends Re{_parse(t){const{status:a,ctx:l}=this._processInputParams(t);if(l.parsedType!==oe.set)return re(l,{code:ee.invalid_type,expected:oe.set,received:l.parsedType}),ke;const r=this._def;r.minSize!==null&&l.data.size<r.minSize.value&&(re(l,{code:ee.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),a.dirty()),r.maxSize!==null&&l.data.size>r.maxSize.value&&(re(l,{code:ee.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),a.dirty());const o=this._def.valueType;function c(p){const m=new Set;for(const b of p){if(b.status==="aborted")return ke;b.status==="dirty"&&a.dirty(),m.add(b.value)}return{status:a.value,value:m}}const h=[...l.data.values()].map((p,m)=>o._parse(new Bn(l,p,l.path,m)));return l.common.async?Promise.all(h).then(p=>c(p)):c(h)}min(t,a){return new Ul({...this._def,minSize:{value:t,message:me.toString(a)}})}max(t,a){return new Ul({...this._def,maxSize:{value:t,message:me.toString(a)}})}size(t,a){return this.min(t,a).max(t,a)}nonempty(t){return this.min(1,t)}}Ul.create=(i,t)=>new Ul({valueType:i,minSize:null,maxSize:null,typeName:we.ZodSet,...Ce(t)});class Wf extends Re{get schema(){return this._def.getter()}_parse(t){const{ctx:a}=this._processInputParams(t);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}}Wf.create=(i,t)=>new Wf({getter:i,typeName:we.ZodLazy,...Ce(t)});class ju extends Re{_parse(t){if(t.data!==this._def.value){const a=this._getOrReturnCtx(t);return re(a,{received:a.data,code:ee.invalid_literal,expected:this._def.value}),ke}return{status:"valid",value:t.data}}get value(){return this._def.value}}ju.create=(i,t)=>new ju({value:i,typeName:we.ZodLiteral,...Ce(t)});function Fy(i,t){return new Sa({values:i,typeName:we.ZodEnum,...Ce(t)})}class Sa extends Re{_parse(t){if(typeof t.data!="string"){const a=this._getOrReturnCtx(t),l=this._def.values;return re(a,{expected:qe.joinValues(l),received:a.parsedType,code:ee.invalid_type}),ke}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const a=this._getOrReturnCtx(t),l=this._def.values;return re(a,{received:a.data,code:ee.invalid_enum_value,options:l}),ke}return vn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const a of this._def.values)t[a]=a;return t}get Values(){const t={};for(const a of this._def.values)t[a]=a;return t}get Enum(){const t={};for(const a of this._def.values)t[a]=a;return t}extract(t,a=this._def){return Sa.create(t,{...this._def,...a})}exclude(t,a=this._def){return Sa.create(this.options.filter(l=>!t.includes(l)),{...this._def,...a})}}Sa.create=Fy;class Pf extends Re{_parse(t){const a=qe.getValidEnumValues(this._def.values),l=this._getOrReturnCtx(t);if(l.parsedType!==oe.string&&l.parsedType!==oe.number){const r=qe.objectValues(a);return re(l,{expected:qe.joinValues(r),received:l.parsedType,code:ee.invalid_type}),ke}if(this._cache||(this._cache=new Set(qe.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const r=qe.objectValues(a);return re(l,{received:l.data,code:ee.invalid_enum_value,options:r}),ke}return vn(t.data)}get enum(){return this._def.values}}Pf.create=(i,t)=>new Pf({values:i,typeName:we.ZodNativeEnum,...Ce(t)});class Mu extends Re{unwrap(){return this._def.type}_parse(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==oe.promise&&a.common.async===!1)return re(a,{code:ee.invalid_type,expected:oe.promise,received:a.parsedType}),ke;const l=a.parsedType===oe.promise?a.data:Promise.resolve(a.data);return vn(l.then(r=>this._def.type.parseAsync(r,{path:a.path,errorMap:a.common.contextualErrorMap})))}}Mu.create=(i,t)=>new Mu({type:i,typeName:we.ZodPromise,...Ce(t)});class Zi extends Re{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:a,ctx:l}=this._processInputParams(t),r=this._def.effect||null,o={addIssue:c=>{re(l,c),c.fatal?a.abort():a.dirty()},get path(){return l.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){const c=r.transform(l.data,o);if(l.common.async)return Promise.resolve(c).then(async h=>{if(a.value==="aborted")return ke;const p=await this._def.schema._parseAsync({data:h,path:l.path,parent:l});return p.status==="aborted"?ke:p.status==="dirty"||a.value==="dirty"?Ol(p.value):p});{if(a.value==="aborted")return ke;const h=this._def.schema._parseSync({data:c,path:l.path,parent:l});return h.status==="aborted"?ke:h.status==="dirty"||a.value==="dirty"?Ol(h.value):h}}if(r.type==="refinement"){const c=h=>{const p=r.refinement(h,o);if(l.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(l.common.async===!1){const h=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});return h.status==="aborted"?ke:(h.status==="dirty"&&a.dirty(),c(h.value),{status:a.value,value:h.value})}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(h=>h.status==="aborted"?ke:(h.status==="dirty"&&a.dirty(),c(h.value).then(()=>({status:a.value,value:h.value}))))}if(r.type==="transform")if(l.common.async===!1){const c=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});if(!_s(c))return ke;const h=r.transform(c.value,o);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:h}}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(c=>_s(c)?Promise.resolve(r.transform(c.value,o)).then(h=>({status:a.value,value:h})):ke);qe.assertNever(r)}}Zi.create=(i,t,a)=>new Zi({schema:i,typeName:we.ZodEffects,effect:t,...Ce(a)});Zi.createWithPreprocess=(i,t,a)=>new Zi({schema:t,effect:{type:"preprocess",transform:i},typeName:we.ZodEffects,...Ce(a)});class fi extends Re{_parse(t){return this._getType(t)===oe.undefined?vn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}fi.create=(i,t)=>new fi({innerType:i,typeName:we.ZodOptional,...Ce(t)});class ka extends Re{_parse(t){return this._getType(t)===oe.null?vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ka.create=(i,t)=>new ka({innerType:i,typeName:we.ZodNullable,...Ce(t)});class Du extends Re{_parse(t){const{ctx:a}=this._processInputParams(t);let l=a.data;return a.parsedType===oe.undefined&&(l=this._def.defaultValue()),this._def.innerType._parse({data:l,path:a.path,parent:a})}removeDefault(){return this._def.innerType}}Du.create=(i,t)=>new Du({innerType:i,typeName:we.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ce(t)});class zu extends Re{_parse(t){const{ctx:a}=this._processInputParams(t),l={...a,common:{...a.common,issues:[]}},r=this._def.innerType._parse({data:l.data,path:l.path,parent:{...l}});return Tu(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new hi(l.common.issues)},input:l.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new hi(l.common.issues)},input:l.data})}}removeCatch(){return this._def.innerType}}zu.create=(i,t)=>new zu({innerType:i,typeName:we.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ce(t)});class ey extends Re{_parse(t){if(this._getType(t)!==oe.nan){const l=this._getOrReturnCtx(t);return re(l,{code:ee.invalid_type,expected:oe.nan,received:l.parsedType}),ke}return{status:"valid",value:t.data}}}ey.create=i=>new ey({typeName:we.ZodNaN,...Ce(i)});class Jy extends Re{_parse(t){const{ctx:a}=this._processInputParams(t),l=a.data;return this._def.type._parse({data:l,path:a.path,parent:a})}unwrap(){return this._def.type}}class pd extends Re{_parse(t){const{status:a,ctx:l}=this._processInputParams(t);if(l.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:l.data,path:l.path,parent:l});return o.status==="aborted"?ke:o.status==="dirty"?(a.dirty(),Ol(o.value)):this._def.out._parseAsync({data:o.value,path:l.path,parent:l})})();{const r=this._def.in._parseSync({data:l.data,path:l.path,parent:l});return r.status==="aborted"?ke:r.status==="dirty"?(a.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:l.path,parent:l})}}static create(t,a){return new pd({in:t,out:a,typeName:we.ZodPipeline})}}class Ru extends Re{_parse(t){const a=this._def.innerType._parse(t),l=r=>(_s(r)&&(r.value=Object.freeze(r.value)),r);return Tu(a)?a.then(r=>l(r)):l(a)}unwrap(){return this._def.innerType}}Ru.create=(i,t)=>new Ru({innerType:i,typeName:we.ZodReadonly,...Ce(t)});var we;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(we||(we={}));const le=oi.create,mi=Ts.create,it=Qf.create,N1=Eu.create,Ns=Ff.create;Ki.create;const ut=Ln.create,xt=gt.create,pi=Nu.create,C1=md.create;Cu.create;xa.create;const Qi=Ou.create,Nn=ju.create,an=Sa.create;Mu.create;fi.create;ka.create;const Wy=Zi.createWithPreprocess,wa=le().regex(/^\{\{.+\}\}$/s,"Binding must be wrapped in {{ }}");function ty(i){return pi([i,wa])}const In=xt({id:le().min(1).describe("Unique component identifier within the document"),type:le().min(1).describe("Component type name"),label:le().optional(),sensitive:it().default(!1).describe("If true, values are redacted in logs"),disabled:ty(it()).default(!1),visible:ty(it()).default(!0),meta:Qi(Ns()).optional()}),O1=pi([le(),mi(),it(),N1()]),gd=xt({source:le().min(1),params:Qi(O1).optional()});function va(i){return typeof i=="object"&&i!==null&&typeof i.source=="string"}const j1=xt({key:le().min(1),type:an(["string","number","boolean","date"]),description:le().optional(),sensitive:it().default(!1)}),M1=xt({name:le().min(1),type:an(["string","number","boolean"]),required:it().default(!1),allowed:ut(pi([le(),mi(),it()])).optional()});xt({name:le().min(1),description:le().optional(),kind:an(["options","rows","series"]),columns:ut(j1).optional(),params:ut(M1).optional()});function Py(i){const t={};for(const a of i){if(Object.hasOwn(t,a.name))throw new Error(`Duplicate data source name "${a.name}"`);t[a.name]=a}return t}const D1=xt({name:le().min(1),type:an(["text","number","email","date","select","checkbox","textarea","file"]),label:le(),required:it().default(!1),sensitive:it().default(!1),defaultValue:Ns().optional(),options:Wy(i=>Array.isArray(i)?i.map(t=>typeof t=="string"?{label:t,value:t}:t):i,pi([ut(xt({label:le(),value:le()})),le().min(1),gd]).optional()),validation:xt({pattern:le().optional(),min:mi().optional(),max:mi().optional(),message:le().optional()}).optional(),bind:wa.optional()}),Lu=In.extend({type:Nn("form"),fields:ut(D1).min(1),onSubmit:le().describe("Action ID dispatched on submit")}),Bu=In.extend({type:Nn("button"),text:le().min(1),variant:an(["primary","secondary","danger","ghost"]).default("primary"),onAction:le().describe("Action ID dispatched on click").optional(),confirm:xt({title:le(),message:le(),confirmText:le().default("Confirm"),cancelText:le().default("Cancel")}).optional()}),z1=xt({id:le().min(1),text:le().min(1),checked:it().default(!1),required:it().default(!1),bind:wa.optional()}),qu=In.extend({type:Nn("tasklist"),items:ut(z1).min(1),onComplete:le().optional().describe("Action ID dispatched when all items are checked")}),R1=Wy(i=>{if(typeof i!="object"||i===null)return i;const a={...i};return"field"in a&&!("key"in a)&&(a.key=a.field,a.field=void 0),"label"in a&&!("header"in a)&&(a.header=a.label,a.label=void 0),a},xt({key:le().min(1),header:le().min(1),sortable:it().default(!1),sensitive:it().default(!1),width:le().optional()})),Uu=In.extend({type:Nn("table"),columns:ut(R1).min(1),data:pi([ut(Qi(Ns())),wa,gd]),sortable:it().default(!1),filterable:it().default(!1),pageSize:mi().positive().optional()}),Iu=In.extend({type:Nn("callout"),variant:an(["info","warning","error","success"]).default("info"),title:le().optional(),content:le().min(1),dismissible:it().default(!1)}),Hu=In.extend({type:Nn("approval-gate"),title:le().min(1),description:le().optional(),requiredApprovers:mi().int().positive().default(1),allowedRoles:ut(le()).optional(),onApprove:le().optional().describe("Action ID dispatched on approval"),onDeny:le().optional().describe("Action ID dispatched on denial"),requireReason:it().default(!1).describe("Require reason on denial")}),Vu=In.extend({type:Nn("webhook"),url:pi([le().url(),wa]),method:an(["GET","POST","PUT","PATCH","DELETE"]).default("POST"),headers:Qi(le()).optional(),body:pi([Qi(Ns()),wa]).optional(),trigger:le().describe("Action ID that fires this webhook"),retries:mi().int().min(0).max(5).default(0),timeout:mi().int().positive().default(3e4).describe("Timeout in milliseconds")}),eb=In.extend({type:Nn("chart"),variant:an(["line","bar","area","pie"]).default("line"),data:pi([le(),wa,gd]),xAxis:le().optional(),yAxis:pi([le(),ut(le())]).optional(),colors:ut(le()).optional(),showLegend:it().default(!0),showGrid:it().default(!0),height:mi().default(300),stacked:it().default(!1)}),tb=In.extend({type:Nn("thinking"),content:le().min(1),status:an(["thinking","done"]).default("done"),collapsed:it().default(!0)}),nb=In.extend({type:Nn("custom"),name:le().min(1).describe('Registered custom component variant, e.g. "signature-pad"'),props:Qi(Ns()).default({}).describe("Intent payload for the variant; validated per `name` by the host"),actions:Qi(le()).optional().describe('Maps a variant event (e.g. "onCapture") to an action label')}),ny=C1("type",[Lu,Bu,qu,Uu,Iu,Hu,Vu,eb,tb,nb]),L1=new Map([["form",Lu],["button",Bu],["tasklist",qu],["table",Uu],["callout",Iu],["approval-gate",Hu],["webhook",Vu],["chart",eb],["thinking",tb],["custom",nb]]),B1=an(["component_rendered","field_changed","action_triggered","integration_called","approval_granted","approval_denied","validation_error","policy_violation","data_loading","data_resolved","data_error"]),q1=xt({id:le(),role:le().optional()});xt({timestamp:le().datetime(),sessionId:le().uuid(),documentId:le(),eventType:B1,componentId:le(),payload:Qi(Ns()),redacted:it().default(!1),actor:q1.optional()});const U1=xt({action:le().describe("Action type to control"),environments:ut(le()).describe("Environments where this rule applies"),effect:an(["allow","deny"]),reason:le().optional()});xt({version:Nn(1),rules:ut(U1),defaultEffect:an(["allow","deny"]).default("deny")});xt({title:le().optional(),version:le().optional(),author:le().optional(),description:le().optional(),tags:ut(le()).optional(),domain:le().optional()});const I1=an(["experimental","stable","enterprise-ready"]),H1=xt({name:le(),type:le(),description:le().optional(),mock:it().default(!0)}),V1=xt({security:ut(le()).optional(),logging:ut(le()).optional(),schema:ut(le()).optional(),mocks:ut(le()).optional(),docs:ut(le()).optional()});xt({name:le().min(1),version:le(),maturity:I1,description:le(),outcome:le(),domain:le(),components_used:ut(le()),integrations:ut(H1).optional(),checklists:V1.optional()});function Y1(i){return`## Available data sources
399
+
400
+ The host exposes these external data sources. Data that a source provides is ALWAYS referenced with \`{ source: <name>, params: { ... } }\` — in a \`form\` select field's \`options\`, in \`table.data\`, or in \`chart.data\` — and is NEVER generated inline as rows, options, or CSV.
401
+
402
+ Sources:
403
+
404
+ ${i.map(a=>{var r,o;const l=[`- **${a.name}** (kind: ${a.kind})`];if(a.description&&(l[0]+=` — ${a.description}`),(r=a.columns)!=null&&r.length){const c=a.columns.map(h=>`${h.key}: ${h.type}${h.description?` (${h.description})`:""}`).join(", ");l.push(` - columns: ${c}`)}if((o=a.params)!=null&&o.length){const c=a.params.map(h=>{var m;const p=(m=h.allowed)!=null&&m.length?`, allowed: ${h.allowed.map(b=>JSON.stringify(b)).join(" | ")}`:"";return`${h.name}: ${h.type} (${h.required?"required":"optional"}${p})`}).join("; ");l.push(` - params: ${c}`)}return l.join(`
405
+ `)}).join(`
406
+ `)}
407
+
408
+ Rules:
409
+ - Use only source names listed above. NEVER invent a source; if the request needs data no listed source provides, do not reference a source and do not fabricate the data — say the data is not available.
410
+ - \`table.columns[].key\` and chart \`xAxis\` / \`yAxis\` MUST be columns of the referenced source.
411
+ - Give each param only a value of its declared type, respecting \`allowed\` values, and always supply required params. A param value may be a \`{{binding}}\` to react to another component.
412
+
413
+ Example:
414
+
415
+ \`\`\`mdma
416
+ type: table
417
+ id: open-incidents
418
+ columns:
419
+ - key: title
420
+ header: Title
421
+ data:
422
+ source: incidents
423
+ params: { status: open }
424
+ \`\`\``}const G1=[["AI reasoning or thinking process. Useful for transparency about how the AI arrived at conclusions or recommendations.","a short plan summary: what the document below contains and how it is structured."],["free-form reasoning text","free-form plan summary text"],["<reasoning text>","<plan summary>"],["to show your reasoning process","to summarize your plan for the document"],["All reasoning belongs inside the `thinking` block","All planning notes belong inside the `thinking` block"],["**Example — analysis reasoning:**","**Example — plan summary:**"],[`First, I examined the quarterly revenue trends.
425
+ Q3 shows a 15% dip which correlates with seasonal patterns.
426
+ However, year-over-year growth remains strong at 23%.
427
+ Recommendation: maintain current strategy with Q3 adjustments.`,`Plan: a table of quarterly revenue with a year-over-year summary.
428
+ Columns: quarter, revenue, change vs. the previous year.`]];G1.reduce((i,[t,a])=>{if(!i.includes(t))throw new Error(`sonnet-5.5 prompt: shared body no longer contains "${t.slice(0,60)}"`);return i.split(t).join(a)},Ky);function $1(i){return`## Available Custom Components
429
+
430
+ The host has registered these custom components. To use one, emit a \`custom\` block whose \`name\` is EXACTLY one of the names below, place its inputs under \`props\` (only the documented keys), and wire any listed events under \`actions\`. Do NOT invent custom components or names that are not listed here, and prefer a built-in component type whenever one fits.
431
+
432
+ ${i.map(a=>{var r;const l=[`- **${a.name}** — ${a.description}`];return a.props&&l.push(` - props: ${a.props}`),(r=a.actions)!=null&&r.length&&l.push(` - actions: ${a.actions.join(", ")}`),l.join(`
433
+ `)}).join(`
434
+ `)}`}function K1(i={}){const{customPrompt:t,authorPrompt:a,customComponents:l,dataSources:r}=i,o=a??n1,c=l!=null&&l.length?`
435
+
436
+ ---
437
+
438
+ ${$1(l)}`:"";r&&Py(r);const h=r!=null&&r.length?`
439
+
440
+ ---
441
+
442
+ ${Y1(r)}`:"",p=`${o}${c}${h}`;return t?`${p}
443
+
444
+ ---
445
+
446
+ ${t}
447
+
448
+ ---
449
+
450
+ Reminder — when generating MDMA components you MUST:
451
+ - Include a \`thinking\` block BEFORE the main content (status: done, collapsed: true).
452
+ - Use unique kebab-case IDs for every component.
453
+ - Mark PII fields with \`sensitive: true\`.
454
+ - NEVER mention thinking blocks, sensitive flags, bindings, component IDs, or any MDMA implementation details in your visible text. All reasoning goes inside the thinking block. The user should see a natural response, not meta-commentary about how the document is structured.
455
+ - Respond in plain Markdown — do NOT wrap the entire response in code fences.`:p}function iy(i){if(i)throw i}var Nf,ay;function Z1(){if(ay)return Nf;ay=1;var i=Object.prototype.hasOwnProperty,t=Object.prototype.toString,a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,r=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},o=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var b=i.call(m,"constructor"),y=m.constructor&&m.constructor.prototype&&i.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!y)return!1;var S;for(S in m);return typeof S>"u"||i.call(m,S)},c=function(m,b){a&&b.name==="__proto__"?a(m,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):m[b.name]=b.newValue},h=function(m,b){if(b==="__proto__")if(i.call(m,b)){if(l)return l(m,b).value}else return;return m[b]};return Nf=function p(){var m,b,y,S,x,N,T=arguments[0],M=1,j=arguments.length,Y=!1;for(typeof T=="boolean"&&(Y=T,T=arguments[1]||{},M=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});M<j;++M)if(m=arguments[M],m!=null)for(b in m)y=h(T,b),S=h(m,b),T!==S&&(Y&&S&&(o(S)||(x=r(S)))?(x?(x=!1,N=y&&r(y)?y:[]):N=y&&o(y)?y:{},c(T,{name:b,newValue:p(Y,N,S)})):typeof S<"u"&&c(T,{name:b,newValue:S}));return T},Nf}var Q1=Z1();const Cf=Tx(Q1);function ed(i){if(typeof i!="object"||i===null)return!1;const t=Object.getPrototypeOf(i);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)}function X1(){const i=[],t={run:a,use:l};return t;function a(...r){let o=-1;const c=r.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);h(null,...r);function h(p,...m){const b=i[++o];let y=-1;if(p){c(p);return}for(;++y<r.length;)(m[y]===null||m[y]===void 0)&&(m[y]=r[y]);r=m,b?F1(b,h)(...m):c(null,...m)}}function l(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return i.push(r),t}}function F1(i,t){let a;return l;function l(...c){const h=i.length>c.length;let p;h&&c.push(r);try{p=i.apply(this,c)}catch(m){const b=m;if(h&&a)throw b;return r(b)}h||(p&&p.then&&typeof p.then=="function"?p.then(o,r):p instanceof Error?r(p):o(p))}function r(c,...h){a||(a=!0,t(c,...h))}function o(c){r(null,c)}}function Dl(i){return!i||typeof i!="object"?"":"position"in i||"type"in i?sy(i.position):"start"in i||"end"in i?sy(i):"line"in i||"column"in i?td(i):""}function td(i){return ly(i&&i.line)+":"+ly(i&&i.column)}function sy(i){return td(i&&i.start)+"-"+td(i&&i.end)}function ly(i){return i&&typeof i=="number"?i:1}class Zt extends Error{constructor(t,a,l){super(),typeof a=="string"&&(l=a,a=void 0);let r="",o={},c=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof t=="string"?r=t:!o.cause&&t&&(c=!0,r=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof l=="string"){const p=l.indexOf(":");p===-1?o.ruleId=l:(o.source=l.slice(0,p),o.ruleId=l.slice(p+1))}if(!o.place&&o.ancestors&&o.ancestors){const p=o.ancestors[o.ancestors.length-1];p&&(o.place=p.position)}const h=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=h?h.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=h?h.line:void 0,this.name=Dl(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Zt.prototype.file="";Zt.prototype.name="";Zt.prototype.reason="";Zt.prototype.message="";Zt.prototype.stack="";Zt.prototype.column=void 0;Zt.prototype.line=void 0;Zt.prototype.ancestors=void 0;Zt.prototype.cause=void 0;Zt.prototype.fatal=void 0;Zt.prototype.place=void 0;Zt.prototype.ruleId=void 0;Zt.prototype.source=void 0;const zn={basename:J1,dirname:W1,extname:P1,join:eS,sep:"/"};function J1(i,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Vl(i);let a=0,l=-1,r=i.length,o;if(t===void 0||t.length===0||t.length>i.length){for(;r--;)if(i.codePointAt(r)===47){if(o){a=r+1;break}}else l<0&&(o=!0,l=r+1);return l<0?"":i.slice(a,l)}if(t===i)return"";let c=-1,h=t.length-1;for(;r--;)if(i.codePointAt(r)===47){if(o){a=r+1;break}}else c<0&&(o=!0,c=r+1),h>-1&&(i.codePointAt(r)===t.codePointAt(h--)?h<0&&(l=r):(h=-1,l=c));return a===l?l=c:l<0&&(l=i.length),i.slice(a,l)}function W1(i){if(Vl(i),i.length===0)return".";let t=-1,a=i.length,l;for(;--a;)if(i.codePointAt(a)===47){if(l){t=a;break}}else l||(l=!0);return t<0?i.codePointAt(0)===47?"/":".":t===1&&i.codePointAt(0)===47?"//":i.slice(0,t)}function P1(i){Vl(i);let t=i.length,a=-1,l=0,r=-1,o=0,c;for(;t--;){const h=i.codePointAt(t);if(h===47){if(c){l=t+1;break}continue}a<0&&(c=!0,a=t+1),h===46?r<0?r=t:o!==1&&(o=1):r>-1&&(o=-1)}return r<0||a<0||o===0||o===1&&r===a-1&&r===l+1?"":i.slice(r,a)}function eS(...i){let t=-1,a;for(;++t<i.length;)Vl(i[t]),i[t]&&(a=a===void 0?i[t]:a+"/"+i[t]);return a===void 0?".":tS(a)}function tS(i){Vl(i);const t=i.codePointAt(0)===47;let a=nS(i,!t);return a.length===0&&!t&&(a="."),a.length>0&&i.codePointAt(i.length-1)===47&&(a+="/"),t?"/"+a:a}function nS(i,t){let a="",l=0,r=-1,o=0,c=-1,h,p;for(;++c<=i.length;){if(c<i.length)h=i.codePointAt(c);else{if(h===47)break;h=47}if(h===47){if(!(r===c-1||o===1))if(r!==c-1&&o===2){if(a.length<2||l!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",l=0):(a=a.slice(0,p),l=a.length-1-a.lastIndexOf("/")),r=c,o=0;continue}}else if(a.length>0){a="",l=0,r=c,o=0;continue}}t&&(a=a.length>0?a+"/..":"..",l=2)}else a.length>0?a+="/"+i.slice(r+1,c):a=i.slice(r+1,c),l=c-r-1;r=c,o=0}else h===46&&o>-1?o++:o=-1}return a}function Vl(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}const iS={cwd:aS};function aS(){return"/"}function nd(i){return!!(i!==null&&typeof i=="object"&&"href"in i&&i.href&&"protocol"in i&&i.protocol&&i.auth===void 0)}function sS(i){if(typeof i=="string")i=new URL(i);else if(!nd(i)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+i+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(i.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return lS(i)}function lS(i){if(i.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const t=i.pathname;let a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){const l=t.codePointAt(a+2);if(l===70||l===102){const r=new TypeError("File URL path must not include encoded / characters");throw r.code="ERR_INVALID_FILE_URL_PATH",r}}return decodeURIComponent(t)}const Of=["history","path","basename","stem","extname","dirname"];class rS{constructor(t){let a;t?nd(t)?a={path:t}:typeof t=="string"||uS(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":iS.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<Of.length;){const o=Of[l];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let r;for(r in a)Of.includes(r)||(this[r]=a[r])}get basename(){return typeof this.path=="string"?zn.basename(this.path):void 0}set basename(t){Mf(t,"basename"),jf(t,"basename"),this.path=zn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?zn.dirname(this.path):void 0}set dirname(t){ry(this.basename,"dirname"),this.path=zn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?zn.extname(this.path):void 0}set extname(t){if(jf(t,"extname"),ry(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=zn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){nd(t)&&(t=sS(t)),Mf(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?zn.basename(this.path,this.extname):void 0}set stem(t){Mf(t,"stem"),jf(t,"stem"),this.path=zn.join(this.dirname||"",t+(this.extname||""))}fail(t,a,l){const r=this.message(t,a,l);throw r.fatal=!0,r}info(t,a,l){const r=this.message(t,a,l);return r.fatal=void 0,r}message(t,a,l){const r=new Zt(t,a,l);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function jf(i,t){if(i&&i.includes(zn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zn.sep+"`")}function Mf(i,t){if(!i)throw new Error("`"+t+"` cannot be empty")}function ry(i,t){if(!i)throw new Error("Setting `"+t+"` requires `path` to be set too")}function uS(i){return!!(i&&typeof i=="object"&&"byteLength"in i&&"byteOffset"in i)}const oS=(function(i){const l=this.constructor.prototype,r=l[i],o=function(){return r.apply(o,arguments)};return Object.setPrototypeOf(o,l),o}),cS={}.hasOwnProperty;class yd extends oS{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=X1()}copy(){const t=new yd;let a=-1;for(;++a<this.attachers.length;){const l=this.attachers[a];t.use(...l)}return t.data(Cf(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(Rf("data",this.frozen),this.namespace[t]=a,this):cS.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Rf("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const r=a.call(t,...l);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const a=hu(t),l=this.parser||this.Parser;return Df("parse",l),l(String(a),a)}process(t,a){const l=this;return this.freeze(),Df("process",this.parser||this.Parser),zf("process",this.compiler||this.Compiler),a?r(void 0,a):new Promise(r);function r(o,c){const h=hu(t),p=l.parse(h);l.run(p,h,function(b,y,S){if(b||!y||!S)return m(b);const x=y,N=l.stringify(x,S);hS(N)?S.value=N:S.result=N,m(b,S)});function m(b,y){b||!y?c(b):o?o(y):a(void 0,y)}}}processSync(t){let a=!1,l;return this.freeze(),Df("processSync",this.parser||this.Parser),zf("processSync",this.compiler||this.Compiler),this.process(t,r),oy("processSync","process",a),l;function r(o,c){a=!0,iy(o),l=c}}run(t,a,l){uy(t),this.freeze();const r=this.transformers;return!l&&typeof a=="function"&&(l=a,a=void 0),l?o(void 0,l):new Promise(o);function o(c,h){const p=hu(a);r.run(t,p,m);function m(b,y,S){const x=y||t;b?h(b):c?c(x):l(void 0,x,S)}}}runSync(t,a){let l=!1,r;return this.run(t,a,o),oy("runSync","run",l),r;function o(c,h){iy(c),r=h,l=!0}}stringify(t,a){this.freeze();const l=hu(a),r=this.compiler||this.Compiler;return zf("stringify",r),uy(t),r(t,l)}use(t,...a){const l=this.attachers,r=this.namespace;if(Rf("use",this.frozen),t!=null)if(typeof t=="function")p(t,a);else if(typeof t=="object")Array.isArray(t)?h(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(m){if(typeof m=="function")p(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...y]=m;p(b,y)}else c(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function c(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");h(m.plugins),m.settings&&(r.settings=Cf(!0,r.settings,m.settings))}function h(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const y=m[b];o(y)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function p(m,b){let y=-1,S=-1;for(;++y<l.length;)if(l[y][0]===m){S=y;break}if(S===-1)l.push([m,...b]);else if(b.length>0){let[x,...N]=b;const T=l[S][1];ed(T)&&ed(x)&&(x=Cf(!0,T,x)),l[S]=[m,x,...N]}}}}const fS=new yd().freeze();function Df(i,t){if(typeof t!="function")throw new TypeError("Cannot `"+i+"` without `parser`")}function zf(i,t){if(typeof t!="function")throw new TypeError("Cannot `"+i+"` without `compiler`")}function Rf(i,t){if(t)throw new Error("Cannot call `"+i+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function uy(i){if(!ed(i)||typeof i.type!="string")throw new TypeError("Expected node, got `"+i+"`")}function oy(i,t,a){if(!a)throw new Error("`"+i+"` finished async. Use `"+t+"` instead")}function hu(i){return dS(i)?i:new rS(i)}function dS(i){return!!(i&&typeof i=="object"&&"message"in i&&"messages"in i)}function hS(i){return typeof i=="string"||mS(i)}function mS(i){return!!(i&&typeof i=="object"&&"byteLength"in i&&"byteOffset"in i)}const pS={};function gS(i,t){const a=pS,l=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,r=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return ib(i,l,r)}function ib(i,t,a){if(yS(i)){if("value"in i)return i.type==="html"&&!a?"":i.value;if(t&&"alt"in i&&i.alt)return i.alt;if("children"in i)return cy(i.children,t,a)}return Array.isArray(i)?cy(i,t,a):""}function cy(i,t,a){const l=[];let r=-1;for(;++r<i.length;)l[r]=ib(i[r],t,a);return l.join("")}function yS(i){return!!(i&&typeof i=="object")}const fy=document.createElement("i");function bd(i){const t="&"+i+";";fy.innerHTML=t;const a=fy.textContent;return a.charCodeAt(a.length-1)===59&&i!=="semi"||a===t?!1:a}function qn(i,t,a,l){const r=i.length;let o=0,c;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,a=a>0?a:0,l.length<1e4)c=Array.from(l),c.unshift(t,a),i.splice(...c);else for(a&&i.splice(t,a);o<l.length;)c=l.slice(o,o+1e4),c.unshift(t,0),i.splice(...c),o+=1e4,t+=1e4}function pn(i,t){return i.length>0?(qn(i,i.length,0,t),i):t}const dy={}.hasOwnProperty;function bS(i){const t={};let a=-1;for(;++a<i.length;)vS(t,i[a]);return t}function vS(i,t){let a;for(a in t){const r=(dy.call(i,a)?i[a]:void 0)||(i[a]={}),o=t[a];let c;if(o)for(c in o){dy.call(r,c)||(r[c]=[]);const h=o[c];xS(r[c],Array.isArray(h)?h:h?[h]:[])}}}function xS(i,t){let a=-1;const l=[];for(;++a<t.length;)(t[a].add==="after"?i:l).push(t[a]);qn(i,0,0,l)}function ab(i,t){const a=Number.parseInt(i,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Ss(i){return i.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Rn=Xi(/[A-Za-z]/),An=Xi(/[\dA-Za-z]/),SS=Xi(/[#-'*+\--9=?A-Z^-~]/);function id(i){return i!==null&&(i<32||i===127)}const ad=Xi(/\d/),kS=Xi(/[\dA-Fa-f]/),wS=Xi(/[!-/:-@[-`{-~]/);function Se(i){return i!==null&&i<-2}function Kt(i){return i!==null&&(i<0||i===32)}function Ve(i){return i===-2||i===-1||i===32}const _S=Xi(new RegExp("\\p{P}|\\p{S}","u")),TS=Xi(/\s/);function Xi(i){return t;function t(a){return a!==null&&a>-1&&i.test(String.fromCharCode(a))}}function We(i,t,a,l){const r=l?l-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(p){return Ve(p)?(i.enter(a),h(p)):t(p)}function h(p){return Ve(p)&&o++<r?(i.consume(p),h):(i.exit(a),t(p))}}const AS={tokenize:ES};function ES(i){const t=i.attempt(this.parser.constructs.contentInitial,l,r);let a;return t;function l(h){if(h===null){i.consume(h);return}return i.enter("lineEnding"),i.consume(h),i.exit("lineEnding"),We(i,t,"linePrefix")}function r(h){return i.enter("paragraph"),o(h)}function o(h){const p=i.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,c(h)}function c(h){if(h===null){i.exit("chunkText"),i.exit("paragraph"),i.consume(h);return}return Se(h)?(i.consume(h),i.exit("chunkText"),o):(i.consume(h),c)}}const NS={tokenize:CS},hy={tokenize:OS};function CS(i){const t=this,a=[];let l=0,r,o,c;return h;function h(H){if(l<a.length){const Z=a[l];return t.containerState=Z[1],i.attempt(Z[0].continuation,p,m)(H)}return m(H)}function p(H){if(l++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&Y();const Z=t.events.length;let te=Z,q;for(;te--;)if(t.events[te][0]==="exit"&&t.events[te][1].type==="chunkFlow"){q=t.events[te][1].end;break}j(l);let C=Z;for(;C<t.events.length;)t.events[C][1].end={...q},C++;return qn(t.events,te+1,0,t.events.slice(Z)),t.events.length=C,m(H)}return h(H)}function m(H){if(l===a.length){if(!r)return S(H);if(r.currentConstruct&&r.currentConstruct.concrete)return N(H);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},i.check(hy,b,y)(H)}function b(H){return r&&Y(),j(l),S(H)}function y(H){return t.parser.lazy[t.now().line]=l!==a.length,c=t.now().offset,N(H)}function S(H){return t.containerState={},i.attempt(hy,x,N)(H)}function x(H){return l++,a.push([t.currentConstruct,t.containerState]),S(H)}function N(H){if(H===null){r&&Y(),j(0),i.consume(H);return}return r=r||t.parser.flow(t.now()),i.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),T(H)}function T(H){if(H===null){M(i.exit("chunkFlow"),!0),j(0),i.consume(H);return}return Se(H)?(i.consume(H),M(i.exit("chunkFlow")),l=0,t.interrupt=void 0,h):(i.consume(H),T)}function M(H,Z){const te=t.sliceStream(H);if(Z&&te.push(null),H.previous=o,o&&(o.next=H),o=H,r.defineSkip(H.start),r.write(te),t.parser.lazy[H.start.line]){let q=r.events.length;for(;q--;)if(r.events[q][1].start.offset<c&&(!r.events[q][1].end||r.events[q][1].end.offset>c))return;const C=t.events.length;let B=C,X,F;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(X){F=t.events[B][1].end;break}X=!0}for(j(l),q=C;q<t.events.length;)t.events[q][1].end={...F},q++;qn(t.events,B+1,0,t.events.slice(C)),t.events.length=q}}function j(H){let Z=a.length;for(;Z-- >H;){const te=a[Z];t.containerState=te[1],te[0].exit.call(t,i)}a.length=H}function Y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}function OS(i,t,a){return We(i,i.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function my(i){if(i===null||Kt(i)||TS(i))return 1;if(_S(i))return 2}function vd(i,t,a){const l=[];let r=-1;for(;++r<i.length;){const o=i[r].resolveAll;o&&!l.includes(o)&&(t=o(t,a),l.push(o))}return t}const sd={name:"attention",resolveAll:jS,tokenize:MS};function jS(i,t){let a=-1,l,r,o,c,h,p,m,b;for(;++a<i.length;)if(i[a][0]==="enter"&&i[a][1].type==="attentionSequence"&&i[a][1]._close){for(l=a;l--;)if(i[l][0]==="exit"&&i[l][1].type==="attentionSequence"&&i[l][1]._open&&t.sliceSerialize(i[l][1]).charCodeAt(0)===t.sliceSerialize(i[a][1]).charCodeAt(0)){if((i[l][1]._close||i[a][1]._open)&&(i[a][1].end.offset-i[a][1].start.offset)%3&&!((i[l][1].end.offset-i[l][1].start.offset+i[a][1].end.offset-i[a][1].start.offset)%3))continue;p=i[l][1].end.offset-i[l][1].start.offset>1&&i[a][1].end.offset-i[a][1].start.offset>1?2:1;const y={...i[l][1].end},S={...i[a][1].start};py(y,-p),py(S,p),c={type:p>1?"strongSequence":"emphasisSequence",start:y,end:{...i[l][1].end}},h={type:p>1?"strongSequence":"emphasisSequence",start:{...i[a][1].start},end:S},o={type:p>1?"strongText":"emphasisText",start:{...i[l][1].end},end:{...i[a][1].start}},r={type:p>1?"strong":"emphasis",start:{...c.start},end:{...h.end}},i[l][1].end={...c.start},i[a][1].start={...h.end},m=[],i[l][1].end.offset-i[l][1].start.offset&&(m=pn(m,[["enter",i[l][1],t],["exit",i[l][1],t]])),m=pn(m,[["enter",r,t],["enter",c,t],["exit",c,t],["enter",o,t]]),m=pn(m,vd(t.parser.constructs.insideSpan.null,i.slice(l+1,a),t)),m=pn(m,[["exit",o,t],["enter",h,t],["exit",h,t],["exit",r,t]]),i[a][1].end.offset-i[a][1].start.offset?(b=2,m=pn(m,[["enter",i[a][1],t],["exit",i[a][1],t]])):b=0,qn(i,l-1,a-l+3,m),a=l+m.length-b-2;break}}for(a=-1;++a<i.length;)i[a][1].type==="attentionSequence"&&(i[a][1].type="data");return i}function MS(i,t){const a=this.parser.constructs.attentionMarkers.null,l=this.previous,r=my(l);let o;return c;function c(p){return o=p,i.enter("attentionSequence"),h(p)}function h(p){if(p===o)return i.consume(p),h;const m=i.exit("attentionSequence"),b=my(p),y=!b||b===2&&r||a.includes(p),S=!r||r===2&&b||a.includes(l);return m._open=!!(o===42?y:y&&(r||!S)),m._close=!!(o===42?S:S&&(b||!y)),t(p)}}function py(i,t){i.column+=t,i.offset+=t,i._bufferIndex+=t}const DS={name:"autolink",tokenize:zS};function zS(i,t,a){let l=0;return r;function r(x){return i.enter("autolink"),i.enter("autolinkMarker"),i.consume(x),i.exit("autolinkMarker"),i.enter("autolinkProtocol"),o}function o(x){return Rn(x)?(i.consume(x),c):x===64?a(x):m(x)}function c(x){return x===43||x===45||x===46||An(x)?(l=1,h(x)):m(x)}function h(x){return x===58?(i.consume(x),l=0,p):(x===43||x===45||x===46||An(x))&&l++<32?(i.consume(x),h):(l=0,m(x))}function p(x){return x===62?(i.exit("autolinkProtocol"),i.enter("autolinkMarker"),i.consume(x),i.exit("autolinkMarker"),i.exit("autolink"),t):x===null||x===32||x===60||id(x)?a(x):(i.consume(x),p)}function m(x){return x===64?(i.consume(x),b):SS(x)?(i.consume(x),m):a(x)}function b(x){return An(x)?y(x):a(x)}function y(x){return x===46?(i.consume(x),l=0,b):x===62?(i.exit("autolinkProtocol").type="autolinkEmail",i.enter("autolinkMarker"),i.consume(x),i.exit("autolinkMarker"),i.exit("autolink"),t):S(x)}function S(x){if((x===45||An(x))&&l++<63){const N=x===45?S:y;return i.consume(x),N}return a(x)}}const $u={partial:!0,tokenize:RS};function RS(i,t,a){return l;function l(o){return Ve(o)?We(i,r,"linePrefix")(o):r(o)}function r(o){return o===null||Se(o)?t(o):a(o)}}const sb={continuation:{tokenize:BS},exit:qS,name:"blockQuote",tokenize:LS};function LS(i,t,a){const l=this;return r;function r(c){if(c===62){const h=l.containerState;return h.open||(i.enter("blockQuote",{_container:!0}),h.open=!0),i.enter("blockQuotePrefix"),i.enter("blockQuoteMarker"),i.consume(c),i.exit("blockQuoteMarker"),o}return a(c)}function o(c){return Ve(c)?(i.enter("blockQuotePrefixWhitespace"),i.consume(c),i.exit("blockQuotePrefixWhitespace"),i.exit("blockQuotePrefix"),t):(i.exit("blockQuotePrefix"),t(c))}}function BS(i,t,a){const l=this;return r;function r(c){return Ve(c)?We(i,o,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return i.attempt(sb,t,a)(c)}}function qS(i){i.exit("blockQuote")}const lb={name:"characterEscape",tokenize:US};function US(i,t,a){return l;function l(o){return i.enter("characterEscape"),i.enter("escapeMarker"),i.consume(o),i.exit("escapeMarker"),r}function r(o){return wS(o)?(i.enter("characterEscapeValue"),i.consume(o),i.exit("characterEscapeValue"),i.exit("characterEscape"),t):a(o)}}const rb={name:"characterReference",tokenize:IS};function IS(i,t,a){const l=this;let r=0,o,c;return h;function h(y){return i.enter("characterReference"),i.enter("characterReferenceMarker"),i.consume(y),i.exit("characterReferenceMarker"),p}function p(y){return y===35?(i.enter("characterReferenceMarkerNumeric"),i.consume(y),i.exit("characterReferenceMarkerNumeric"),m):(i.enter("characterReferenceValue"),o=31,c=An,b(y))}function m(y){return y===88||y===120?(i.enter("characterReferenceMarkerHexadecimal"),i.consume(y),i.exit("characterReferenceMarkerHexadecimal"),i.enter("characterReferenceValue"),o=6,c=kS,b):(i.enter("characterReferenceValue"),o=7,c=ad,b(y))}function b(y){if(y===59&&r){const S=i.exit("characterReferenceValue");return c===An&&!bd(l.sliceSerialize(S))?a(y):(i.enter("characterReferenceMarker"),i.consume(y),i.exit("characterReferenceMarker"),i.exit("characterReference"),t)}return c(y)&&r++<o?(i.consume(y),b):a(y)}}const gy={partial:!0,tokenize:VS},yy={concrete:!0,name:"codeFenced",tokenize:HS};function HS(i,t,a){const l=this,r={partial:!0,tokenize:te};let o=0,c=0,h;return p;function p(q){return m(q)}function m(q){const C=l.events[l.events.length-1];return o=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,h=q,i.enter("codeFenced"),i.enter("codeFencedFence"),i.enter("codeFencedFenceSequence"),b(q)}function b(q){return q===h?(c++,i.consume(q),b):c<3?a(q):(i.exit("codeFencedFenceSequence"),Ve(q)?We(i,y,"whitespace")(q):y(q))}function y(q){return q===null||Se(q)?(i.exit("codeFencedFence"),l.interrupt?t(q):i.check(gy,T,Z)(q)):(i.enter("codeFencedFenceInfo"),i.enter("chunkString",{contentType:"string"}),S(q))}function S(q){return q===null||Se(q)?(i.exit("chunkString"),i.exit("codeFencedFenceInfo"),y(q)):Ve(q)?(i.exit("chunkString"),i.exit("codeFencedFenceInfo"),We(i,x,"whitespace")(q)):q===96&&q===h?a(q):(i.consume(q),S)}function x(q){return q===null||Se(q)?y(q):(i.enter("codeFencedFenceMeta"),i.enter("chunkString",{contentType:"string"}),N(q))}function N(q){return q===null||Se(q)?(i.exit("chunkString"),i.exit("codeFencedFenceMeta"),y(q)):q===96&&q===h?a(q):(i.consume(q),N)}function T(q){return i.attempt(r,Z,M)(q)}function M(q){return i.enter("lineEnding"),i.consume(q),i.exit("lineEnding"),j}function j(q){return o>0&&Ve(q)?We(i,Y,"linePrefix",o+1)(q):Y(q)}function Y(q){return q===null||Se(q)?i.check(gy,T,Z)(q):(i.enter("codeFlowValue"),H(q))}function H(q){return q===null||Se(q)?(i.exit("codeFlowValue"),Y(q)):(i.consume(q),H)}function Z(q){return i.exit("codeFenced"),t(q)}function te(q,C,B){let X=0;return F;function F(be){return q.enter("lineEnding"),q.consume(be),q.exit("lineEnding"),P}function P(be){return q.enter("codeFencedFence"),Ve(be)?We(q,ne,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(be):ne(be)}function ne(be){return be===h?(q.enter("codeFencedFenceSequence"),pe(be)):B(be)}function pe(be){return be===h?(X++,q.consume(be),pe):X>=c?(q.exit("codeFencedFenceSequence"),Ve(be)?We(q,Ae,"whitespace")(be):Ae(be)):B(be)}function Ae(be){return be===null||Se(be)?(q.exit("codeFencedFence"),C(be)):B(be)}}}function VS(i,t,a){const l=this;return r;function r(c){return c===null?a(c):(i.enter("lineEnding"),i.consume(c),i.exit("lineEnding"),o)}function o(c){return l.parser.lazy[l.now().line]?a(c):t(c)}}const Lf={name:"codeIndented",tokenize:GS},YS={partial:!0,tokenize:$S};function GS(i,t,a){const l=this;return r;function r(m){return i.enter("codeIndented"),We(i,o,"linePrefix",5)(m)}function o(m){const b=l.events[l.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?c(m):a(m)}function c(m){return m===null?p(m):Se(m)?i.attempt(YS,c,p)(m):(i.enter("codeFlowValue"),h(m))}function h(m){return m===null||Se(m)?(i.exit("codeFlowValue"),c(m)):(i.consume(m),h)}function p(m){return i.exit("codeIndented"),t(m)}}function $S(i,t,a){const l=this;return r;function r(c){return l.parser.lazy[l.now().line]?a(c):Se(c)?(i.enter("lineEnding"),i.consume(c),i.exit("lineEnding"),r):We(i,o,"linePrefix",5)(c)}function o(c){const h=l.events[l.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?t(c):Se(c)?r(c):a(c)}}const KS={name:"codeText",previous:QS,resolve:ZS,tokenize:XS};function ZS(i){let t=i.length-4,a=3,l,r;if((i[a][1].type==="lineEnding"||i[a][1].type==="space")&&(i[t][1].type==="lineEnding"||i[t][1].type==="space")){for(l=a;++l<t;)if(i[l][1].type==="codeTextData"){i[a][1].type="codeTextPadding",i[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(l=a-1,t++;++l<=t;)r===void 0?l!==t&&i[l][1].type!=="lineEnding"&&(r=l):(l===t||i[l][1].type==="lineEnding")&&(i[r][1].type="codeTextData",l!==r+2&&(i[r][1].end=i[l-1][1].end,i.splice(r+2,l-r-2),t-=l-r-2,l=r+2),r=void 0);return i}function QS(i){return i!==96||this.events[this.events.length-1][1].type==="characterEscape"}function XS(i,t,a){let l=0,r,o;return c;function c(y){return i.enter("codeText"),i.enter("codeTextSequence"),h(y)}function h(y){return y===96?(i.consume(y),l++,h):(i.exit("codeTextSequence"),p(y))}function p(y){return y===null?a(y):y===32?(i.enter("space"),i.consume(y),i.exit("space"),p):y===96?(o=i.enter("codeTextSequence"),r=0,b(y)):Se(y)?(i.enter("lineEnding"),i.consume(y),i.exit("lineEnding"),p):(i.enter("codeTextData"),m(y))}function m(y){return y===null||y===32||y===96||Se(y)?(i.exit("codeTextData"),p(y)):(i.consume(y),m)}function b(y){return y===96?(i.consume(y),r++,b):r===l?(i.exit("codeTextSequence"),i.exit("codeText"),t(y)):(o.type="codeTextData",m(y))}}class FS{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,a){const l=a??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(t,l):t>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(t,a,l){const r=a||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return l&&El(this.left,l),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),El(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),El(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const a=this.left.splice(t,Number.POSITIVE_INFINITY);El(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);El(this.left,a.reverse())}}}function El(i,t){let a=0;if(t.length<1e4)i.push(...t);else for(;a<t.length;)i.push(...t.slice(a,a+1e4)),a+=1e4}function ub(i){const t={};let a=-1,l,r,o,c,h,p,m;const b=new FS(i);for(;++a<b.length;){for(;a in t;)a=t[a];if(l=b.get(a),a&&l[1].type==="chunkFlow"&&b.get(a-1)[1].type==="listItemPrefix"&&(p=l[1]._tokenizer.events,o=0,o<p.length&&p[o][1].type==="lineEndingBlank"&&(o+=2),o<p.length&&p[o][1].type==="content"))for(;++o<p.length&&p[o][1].type!=="content";)p[o][1].type==="chunkText"&&(p[o][1]._isInFirstContentOfListItem=!0,o++);if(l[0]==="enter")l[1].contentType&&(Object.assign(t,JS(b,a)),a=t[a],m=!0);else if(l[1]._container){for(o=a,r=void 0;o--;)if(c=b.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(r&&(b.get(r)[1].type="lineEndingBlank"),c[1].type="lineEnding",r=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;r&&(l[1].end={...b.get(r)[1].start},h=b.slice(r,a),h.unshift(l),b.splice(r,a-r+1,h))}}return qn(i,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function JS(i,t){const a=i.get(t)[1],l=i.get(t)[2];let r=t-1;const o=[];let c=a._tokenizer;c||(c=l.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const h=c.events,p=[],m={};let b,y,S=-1,x=a,N=0,T=0;const M=[T];for(;x;){for(;i.get(++r)[1]!==x;);o.push(r),x._tokenizer||(b=l.sliceStream(x),x.next||b.push(null),y&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(b),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),y=x,x=x.next}for(x=a;++S<h.length;)h[S][0]==="exit"&&h[S-1][0]==="enter"&&h[S][1].type===h[S-1][1].type&&h[S][1].start.line!==h[S][1].end.line&&(T=S+1,M.push(T),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):M.pop(),S=M.length;S--;){const j=h.slice(M[S],M[S+1]),Y=o.pop();p.push([Y,Y+j.length-1]),i.splice(Y,2,j)}for(p.reverse(),S=-1;++S<p.length;)m[N+p[S][0]]=N+p[S][1],N+=p[S][1]-p[S][0]-1;return m}const WS={resolve:ek,tokenize:tk},PS={partial:!0,tokenize:nk};function ek(i){return ub(i),i}function tk(i,t){let a;return l;function l(h){return i.enter("content"),a=i.enter("chunkContent",{contentType:"content"}),r(h)}function r(h){return h===null?o(h):Se(h)?i.check(PS,c,o)(h):(i.consume(h),r)}function o(h){return i.exit("chunkContent"),i.exit("content"),t(h)}function c(h){return i.consume(h),i.exit("chunkContent"),a.next=i.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,r}}function nk(i,t,a){const l=this;return r;function r(c){return i.exit("chunkContent"),i.enter("lineEnding"),i.consume(c),i.exit("lineEnding"),We(i,o,"linePrefix")}function o(c){if(c===null||Se(c))return a(c);const h=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?t(c):i.interrupt(l.parser.constructs.flow,a,t)(c)}}function ob(i,t,a,l,r,o,c,h,p){const m=p||Number.POSITIVE_INFINITY;let b=0;return y;function y(j){return j===60?(i.enter(l),i.enter(r),i.enter(o),i.consume(j),i.exit(o),S):j===null||j===32||j===41||id(j)?a(j):(i.enter(l),i.enter(c),i.enter(h),i.enter("chunkString",{contentType:"string"}),T(j))}function S(j){return j===62?(i.enter(o),i.consume(j),i.exit(o),i.exit(r),i.exit(l),t):(i.enter(h),i.enter("chunkString",{contentType:"string"}),x(j))}function x(j){return j===62?(i.exit("chunkString"),i.exit(h),S(j)):j===null||j===60||Se(j)?a(j):(i.consume(j),j===92?N:x)}function N(j){return j===60||j===62||j===92?(i.consume(j),x):x(j)}function T(j){return!b&&(j===null||j===41||Kt(j))?(i.exit("chunkString"),i.exit(h),i.exit(c),i.exit(l),t(j)):b<m&&j===40?(i.consume(j),b++,T):j===41?(i.consume(j),b--,T):j===null||j===32||j===40||id(j)?a(j):(i.consume(j),j===92?M:T)}function M(j){return j===40||j===41||j===92?(i.consume(j),T):T(j)}}function cb(i,t,a,l,r,o){const c=this;let h=0,p;return m;function m(x){return i.enter(l),i.enter(r),i.consume(x),i.exit(r),i.enter(o),b}function b(x){return h>999||x===null||x===91||x===93&&!p||x===94&&!h&&"_hiddenFootnoteSupport"in c.parser.constructs?a(x):x===93?(i.exit(o),i.enter(r),i.consume(x),i.exit(r),i.exit(l),t):Se(x)?(i.enter("lineEnding"),i.consume(x),i.exit("lineEnding"),b):(i.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||x===91||x===93||Se(x)||h++>999?(i.exit("chunkString"),b(x)):(i.consume(x),p||(p=!Ve(x)),x===92?S:y)}function S(x){return x===91||x===92||x===93?(i.consume(x),h++,y):y(x)}}function fb(i,t,a,l,r,o){let c;return h;function h(S){return S===34||S===39||S===40?(i.enter(l),i.enter(r),i.consume(S),i.exit(r),c=S===40?41:S,p):a(S)}function p(S){return S===c?(i.enter(r),i.consume(S),i.exit(r),i.exit(l),t):(i.enter(o),m(S))}function m(S){return S===c?(i.exit(o),p(c)):S===null?a(S):Se(S)?(i.enter("lineEnding"),i.consume(S),i.exit("lineEnding"),We(i,m,"linePrefix")):(i.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===c||S===null||Se(S)?(i.exit("chunkString"),m(S)):(i.consume(S),S===92?y:b)}function y(S){return S===c||S===92?(i.consume(S),b):b(S)}}function zl(i,t){let a;return l;function l(r){return Se(r)?(i.enter("lineEnding"),i.consume(r),i.exit("lineEnding"),a=!0,l):Ve(r)?We(i,l,a?"linePrefix":"lineSuffix")(r):t(r)}}const ik={name:"definition",tokenize:sk},ak={partial:!0,tokenize:lk};function sk(i,t,a){const l=this;let r;return o;function o(x){return i.enter("definition"),c(x)}function c(x){return cb.call(l,i,h,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function h(x){return r=Ss(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),x===58?(i.enter("definitionMarker"),i.consume(x),i.exit("definitionMarker"),p):a(x)}function p(x){return Kt(x)?zl(i,m)(x):m(x)}function m(x){return ob(i,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function b(x){return i.attempt(ak,y,y)(x)}function y(x){return Ve(x)?We(i,S,"whitespace")(x):S(x)}function S(x){return x===null||Se(x)?(i.exit("definition"),l.parser.defined.push(r),t(x)):a(x)}}function lk(i,t,a){return l;function l(h){return Kt(h)?zl(i,r)(h):a(h)}function r(h){return fb(i,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(h)}function o(h){return Ve(h)?We(i,c,"whitespace")(h):c(h)}function c(h){return h===null||Se(h)?t(h):a(h)}}const rk={name:"hardBreakEscape",tokenize:uk};function uk(i,t,a){return l;function l(o){return i.enter("hardBreakEscape"),i.consume(o),r}function r(o){return Se(o)?(i.exit("hardBreakEscape"),t(o)):a(o)}}const ok={name:"headingAtx",resolve:ck,tokenize:fk};function ck(i,t){let a=i.length-2,l=3,r,o;return i[l][1].type==="whitespace"&&(l+=2),a-2>l&&i[a][1].type==="whitespace"&&(a-=2),i[a][1].type==="atxHeadingSequence"&&(l===a-1||a-4>l&&i[a-2][1].type==="whitespace")&&(a-=l+1===a?2:4),a>l&&(r={type:"atxHeadingText",start:i[l][1].start,end:i[a][1].end},o={type:"chunkText",start:i[l][1].start,end:i[a][1].end,contentType:"text"},qn(i,l,a-l+1,[["enter",r,t],["enter",o,t],["exit",o,t],["exit",r,t]])),i}function fk(i,t,a){let l=0;return r;function r(b){return i.enter("atxHeading"),o(b)}function o(b){return i.enter("atxHeadingSequence"),c(b)}function c(b){return b===35&&l++<6?(i.consume(b),c):b===null||Kt(b)?(i.exit("atxHeadingSequence"),h(b)):a(b)}function h(b){return b===35?(i.enter("atxHeadingSequence"),p(b)):b===null||Se(b)?(i.exit("atxHeading"),t(b)):Ve(b)?We(i,h,"whitespace")(b):(i.enter("atxHeadingText"),m(b))}function p(b){return b===35?(i.consume(b),p):(i.exit("atxHeadingSequence"),h(b))}function m(b){return b===null||b===35||Kt(b)?(i.exit("atxHeadingText"),h(b)):(i.consume(b),m)}}const dk=["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"],by=["pre","script","style","textarea"],hk={concrete:!0,name:"htmlFlow",resolveTo:gk,tokenize:yk},mk={partial:!0,tokenize:vk},pk={partial:!0,tokenize:bk};function gk(i){let t=i.length;for(;t--&&!(i[t][0]==="enter"&&i[t][1].type==="htmlFlow"););return t>1&&i[t-2][1].type==="linePrefix"&&(i[t][1].start=i[t-2][1].start,i[t+1][1].start=i[t-2][1].start,i.splice(t-2,2)),i}function yk(i,t,a){const l=this;let r,o,c,h,p;return m;function m(w){return b(w)}function b(w){return i.enter("htmlFlow"),i.enter("htmlFlowData"),i.consume(w),y}function y(w){return w===33?(i.consume(w),S):w===47?(i.consume(w),o=!0,T):w===63?(i.consume(w),r=3,l.interrupt?t:_):Rn(w)?(i.consume(w),c=String.fromCharCode(w),M):a(w)}function S(w){return w===45?(i.consume(w),r=2,x):w===91?(i.consume(w),r=5,h=0,N):Rn(w)?(i.consume(w),r=4,l.interrupt?t:_):a(w)}function x(w){return w===45?(i.consume(w),l.interrupt?t:_):a(w)}function N(w){const ie="CDATA[";return w===ie.charCodeAt(h++)?(i.consume(w),h===ie.length?l.interrupt?t:ne:N):a(w)}function T(w){return Rn(w)?(i.consume(w),c=String.fromCharCode(w),M):a(w)}function M(w){if(w===null||w===47||w===62||Kt(w)){const ie=w===47,fe=c.toLowerCase();return!ie&&!o&&by.includes(fe)?(r=1,l.interrupt?t(w):ne(w)):dk.includes(c.toLowerCase())?(r=6,ie?(i.consume(w),j):l.interrupt?t(w):ne(w)):(r=7,l.interrupt&&!l.parser.lazy[l.now().line]?a(w):o?Y(w):H(w))}return w===45||An(w)?(i.consume(w),c+=String.fromCharCode(w),M):a(w)}function j(w){return w===62?(i.consume(w),l.interrupt?t:ne):a(w)}function Y(w){return Ve(w)?(i.consume(w),Y):F(w)}function H(w){return w===47?(i.consume(w),F):w===58||w===95||Rn(w)?(i.consume(w),Z):Ve(w)?(i.consume(w),H):F(w)}function Z(w){return w===45||w===46||w===58||w===95||An(w)?(i.consume(w),Z):te(w)}function te(w){return w===61?(i.consume(w),q):Ve(w)?(i.consume(w),te):H(w)}function q(w){return w===null||w===60||w===61||w===62||w===96?a(w):w===34||w===39?(i.consume(w),p=w,C):Ve(w)?(i.consume(w),q):B(w)}function C(w){return w===p?(i.consume(w),p=null,X):w===null||Se(w)?a(w):(i.consume(w),C)}function B(w){return w===null||w===34||w===39||w===47||w===60||w===61||w===62||w===96||Kt(w)?te(w):(i.consume(w),B)}function X(w){return w===47||w===62||Ve(w)?H(w):a(w)}function F(w){return w===62?(i.consume(w),P):a(w)}function P(w){return w===null||Se(w)?ne(w):Ve(w)?(i.consume(w),P):a(w)}function ne(w){return w===45&&r===2?(i.consume(w),U):w===60&&r===1?(i.consume(w),J):w===62&&r===4?(i.consume(w),E):w===63&&r===3?(i.consume(w),_):w===93&&r===5?(i.consume(w),se):Se(w)&&(r===6||r===7)?(i.exit("htmlFlowData"),i.check(mk,V,pe)(w)):w===null||Se(w)?(i.exit("htmlFlowData"),pe(w)):(i.consume(w),ne)}function pe(w){return i.check(pk,Ae,V)(w)}function Ae(w){return i.enter("lineEnding"),i.consume(w),i.exit("lineEnding"),be}function be(w){return w===null||Se(w)?pe(w):(i.enter("htmlFlowData"),ne(w))}function U(w){return w===45?(i.consume(w),_):ne(w)}function J(w){return w===47?(i.consume(w),c="",de):ne(w)}function de(w){if(w===62){const ie=c.toLowerCase();return by.includes(ie)?(i.consume(w),E):ne(w)}return Rn(w)&&c.length<8?(i.consume(w),c+=String.fromCharCode(w),de):ne(w)}function se(w){return w===93?(i.consume(w),_):ne(w)}function _(w){return w===62?(i.consume(w),E):w===45&&r===2?(i.consume(w),_):ne(w)}function E(w){return w===null||Se(w)?(i.exit("htmlFlowData"),V(w)):(i.consume(w),E)}function V(w){return i.exit("htmlFlow"),t(w)}}function bk(i,t,a){const l=this;return r;function r(c){return Se(c)?(i.enter("lineEnding"),i.consume(c),i.exit("lineEnding"),o):a(c)}function o(c){return l.parser.lazy[l.now().line]?a(c):t(c)}}function vk(i,t,a){return l;function l(r){return i.enter("lineEnding"),i.consume(r),i.exit("lineEnding"),i.attempt($u,t,a)}}const xk={name:"htmlText",tokenize:Sk};function Sk(i,t,a){const l=this;let r,o,c;return h;function h(_){return i.enter("htmlText"),i.enter("htmlTextData"),i.consume(_),p}function p(_){return _===33?(i.consume(_),m):_===47?(i.consume(_),te):_===63?(i.consume(_),H):Rn(_)?(i.consume(_),B):a(_)}function m(_){return _===45?(i.consume(_),b):_===91?(i.consume(_),o=0,N):Rn(_)?(i.consume(_),Y):a(_)}function b(_){return _===45?(i.consume(_),x):a(_)}function y(_){return _===null?a(_):_===45?(i.consume(_),S):Se(_)?(c=y,J(_)):(i.consume(_),y)}function S(_){return _===45?(i.consume(_),x):y(_)}function x(_){return _===62?U(_):_===45?S(_):y(_)}function N(_){const E="CDATA[";return _===E.charCodeAt(o++)?(i.consume(_),o===E.length?T:N):a(_)}function T(_){return _===null?a(_):_===93?(i.consume(_),M):Se(_)?(c=T,J(_)):(i.consume(_),T)}function M(_){return _===93?(i.consume(_),j):T(_)}function j(_){return _===62?U(_):_===93?(i.consume(_),j):T(_)}function Y(_){return _===null||_===62?U(_):Se(_)?(c=Y,J(_)):(i.consume(_),Y)}function H(_){return _===null?a(_):_===63?(i.consume(_),Z):Se(_)?(c=H,J(_)):(i.consume(_),H)}function Z(_){return _===62?U(_):H(_)}function te(_){return Rn(_)?(i.consume(_),q):a(_)}function q(_){return _===45||An(_)?(i.consume(_),q):C(_)}function C(_){return Se(_)?(c=C,J(_)):Ve(_)?(i.consume(_),C):U(_)}function B(_){return _===45||An(_)?(i.consume(_),B):_===47||_===62||Kt(_)?X(_):a(_)}function X(_){return _===47?(i.consume(_),U):_===58||_===95||Rn(_)?(i.consume(_),F):Se(_)?(c=X,J(_)):Ve(_)?(i.consume(_),X):U(_)}function F(_){return _===45||_===46||_===58||_===95||An(_)?(i.consume(_),F):P(_)}function P(_){return _===61?(i.consume(_),ne):Se(_)?(c=P,J(_)):Ve(_)?(i.consume(_),P):X(_)}function ne(_){return _===null||_===60||_===61||_===62||_===96?a(_):_===34||_===39?(i.consume(_),r=_,pe):Se(_)?(c=ne,J(_)):Ve(_)?(i.consume(_),ne):(i.consume(_),Ae)}function pe(_){return _===r?(i.consume(_),r=void 0,be):_===null?a(_):Se(_)?(c=pe,J(_)):(i.consume(_),pe)}function Ae(_){return _===null||_===34||_===39||_===60||_===61||_===96?a(_):_===47||_===62||Kt(_)?X(_):(i.consume(_),Ae)}function be(_){return _===47||_===62||Kt(_)?X(_):a(_)}function U(_){return _===62?(i.consume(_),i.exit("htmlTextData"),i.exit("htmlText"),t):a(_)}function J(_){return i.exit("htmlTextData"),i.enter("lineEnding"),i.consume(_),i.exit("lineEnding"),de}function de(_){return Ve(_)?We(i,se,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):se(_)}function se(_){return i.enter("htmlTextData"),c(_)}}const xd={name:"labelEnd",resolveAll:Tk,resolveTo:Ak,tokenize:Ek},kk={tokenize:Nk},wk={tokenize:Ck},_k={tokenize:Ok};function Tk(i){let t=-1;const a=[];for(;++t<i.length;){const l=i[t][1];if(a.push(i[t]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const r=l.type==="labelImage"?4:2;l.type="data",t+=r}}return i.length!==a.length&&qn(i,0,i.length,a),i}function Ak(i,t){let a=i.length,l=0,r,o,c,h;for(;a--;)if(r=i[a][1],o){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;i[a][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(c){if(i[a][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(o=a,r.type!=="labelLink")){l=2;break}}else r.type==="labelEnd"&&(c=a);const p={type:i[o][1].type==="labelLink"?"link":"image",start:{...i[o][1].start},end:{...i[i.length-1][1].end}},m={type:"label",start:{...i[o][1].start},end:{...i[c][1].end}},b={type:"labelText",start:{...i[o+l+2][1].end},end:{...i[c-2][1].start}};return h=[["enter",p,t],["enter",m,t]],h=pn(h,i.slice(o+1,o+l+3)),h=pn(h,[["enter",b,t]]),h=pn(h,vd(t.parser.constructs.insideSpan.null,i.slice(o+l+4,c-3),t)),h=pn(h,[["exit",b,t],i[c-2],i[c-1],["exit",m,t]]),h=pn(h,i.slice(c+1)),h=pn(h,[["exit",p,t]]),qn(i,o,i.length,h),i}function Ek(i,t,a){const l=this;let r=l.events.length,o,c;for(;r--;)if((l.events[r][1].type==="labelImage"||l.events[r][1].type==="labelLink")&&!l.events[r][1]._balanced){o=l.events[r][1];break}return h;function h(S){return o?o._inactive?y(S):(c=l.parser.defined.includes(Ss(l.sliceSerialize({start:o.end,end:l.now()}))),i.enter("labelEnd"),i.enter("labelMarker"),i.consume(S),i.exit("labelMarker"),i.exit("labelEnd"),p):a(S)}function p(S){return S===40?i.attempt(kk,b,c?b:y)(S):S===91?i.attempt(wk,b,c?m:y)(S):c?b(S):y(S)}function m(S){return i.attempt(_k,b,y)(S)}function b(S){return t(S)}function y(S){return o._balanced=!0,a(S)}}function Nk(i,t,a){return l;function l(y){return i.enter("resource"),i.enter("resourceMarker"),i.consume(y),i.exit("resourceMarker"),r}function r(y){return Kt(y)?zl(i,o)(y):o(y)}function o(y){return y===41?b(y):ob(i,c,h,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function c(y){return Kt(y)?zl(i,p)(y):b(y)}function h(y){return a(y)}function p(y){return y===34||y===39||y===40?fb(i,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):b(y)}function m(y){return Kt(y)?zl(i,b)(y):b(y)}function b(y){return y===41?(i.enter("resourceMarker"),i.consume(y),i.exit("resourceMarker"),i.exit("resource"),t):a(y)}}function Ck(i,t,a){const l=this;return r;function r(h){return cb.call(l,i,o,c,"reference","referenceMarker","referenceString")(h)}function o(h){return l.parser.defined.includes(Ss(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?t(h):a(h)}function c(h){return a(h)}}function Ok(i,t,a){return l;function l(o){return i.enter("reference"),i.enter("referenceMarker"),i.consume(o),i.exit("referenceMarker"),r}function r(o){return o===93?(i.enter("referenceMarker"),i.consume(o),i.exit("referenceMarker"),i.exit("reference"),t):a(o)}}const jk={name:"labelStartImage",resolveAll:xd.resolveAll,tokenize:Mk};function Mk(i,t,a){const l=this;return r;function r(h){return i.enter("labelImage"),i.enter("labelImageMarker"),i.consume(h),i.exit("labelImageMarker"),o}function o(h){return h===91?(i.enter("labelMarker"),i.consume(h),i.exit("labelMarker"),i.exit("labelImage"),c):a(h)}function c(h){return h===94&&"_hiddenFootnoteSupport"in l.parser.constructs?a(h):t(h)}}const Dk={name:"labelStartLink",resolveAll:xd.resolveAll,tokenize:zk};function zk(i,t,a){const l=this;return r;function r(c){return i.enter("labelLink"),i.enter("labelMarker"),i.consume(c),i.exit("labelMarker"),i.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in l.parser.constructs?a(c):t(c)}}const Bf={name:"lineEnding",tokenize:Rk};function Rk(i,t){return a;function a(l){return i.enter("lineEnding"),i.consume(l),i.exit("lineEnding"),We(i,t,"linePrefix")}}const xu={name:"thematicBreak",tokenize:Lk};function Lk(i,t,a){let l=0,r;return o;function o(m){return i.enter("thematicBreak"),c(m)}function c(m){return r=m,h(m)}function h(m){return m===r?(i.enter("thematicBreakSequence"),p(m)):l>=3&&(m===null||Se(m))?(i.exit("thematicBreak"),t(m)):a(m)}function p(m){return m===r?(i.consume(m),l++,p):(i.exit("thematicBreakSequence"),Ve(m)?We(i,h,"whitespace")(m):h(m))}}const $t={continuation:{tokenize:Ik},exit:Vk,name:"list",tokenize:Uk},Bk={partial:!0,tokenize:Yk},qk={partial:!0,tokenize:Hk};function Uk(i,t,a){const l=this,r=l.events[l.events.length-1];let o=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,c=0;return h;function h(x){const N=l.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(N==="listUnordered"?!l.containerState.marker||x===l.containerState.marker:ad(x)){if(l.containerState.type||(l.containerState.type=N,i.enter(N,{_container:!0})),N==="listUnordered")return i.enter("listItemPrefix"),x===42||x===45?i.check(xu,a,m)(x):m(x);if(!l.interrupt||x===49)return i.enter("listItemPrefix"),i.enter("listItemValue"),p(x)}return a(x)}function p(x){return ad(x)&&++c<10?(i.consume(x),p):(!l.interrupt||c<2)&&(l.containerState.marker?x===l.containerState.marker:x===41||x===46)?(i.exit("listItemValue"),m(x)):a(x)}function m(x){return i.enter("listItemMarker"),i.consume(x),i.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||x,i.check($u,l.interrupt?a:b,i.attempt(Bk,S,y))}function b(x){return l.containerState.initialBlankLine=!0,o++,S(x)}function y(x){return Ve(x)?(i.enter("listItemPrefixWhitespace"),i.consume(x),i.exit("listItemPrefixWhitespace"),S):a(x)}function S(x){return l.containerState.size=o+l.sliceSerialize(i.exit("listItemPrefix"),!0).length,t(x)}}function Ik(i,t,a){const l=this;return l.containerState._closeFlow=void 0,i.check($u,r,o);function r(h){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,We(i,t,"listItemIndent",l.containerState.size+1)(h)}function o(h){return l.containerState.furtherBlankLines||!Ve(h)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,c(h)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,i.attempt(qk,t,c)(h))}function c(h){return l.containerState._closeFlow=!0,l.interrupt=void 0,We(i,i.attempt($t,t,a),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h)}}function Hk(i,t,a){const l=this;return We(i,r,"listItemIndent",l.containerState.size+1);function r(o){const c=l.events[l.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===l.containerState.size?t(o):a(o)}}function Vk(i){i.exit(this.containerState.type)}function Yk(i,t,a){const l=this;return We(i,r,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(o){const c=l.events[l.events.length-1];return!Ve(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}const vy={name:"setextUnderline",resolveTo:Gk,tokenize:$k};function Gk(i,t){let a=i.length,l,r,o;for(;a--;)if(i[a][0]==="enter"){if(i[a][1].type==="content"){l=a;break}i[a][1].type==="paragraph"&&(r=a)}else i[a][1].type==="content"&&i.splice(a,1),!o&&i[a][1].type==="definition"&&(o=a);const c={type:"setextHeading",start:{...i[l][1].start},end:{...i[i.length-1][1].end}};return i[r][1].type="setextHeadingText",o?(i.splice(r,0,["enter",c,t]),i.splice(o+1,0,["exit",i[l][1],t]),i[l][1].end={...i[o][1].end}):i[l][1]=c,i.push(["exit",c,t]),i}function $k(i,t,a){const l=this;let r;return o;function o(m){let b=l.events.length,y;for(;b--;)if(l.events[b][1].type!=="lineEnding"&&l.events[b][1].type!=="linePrefix"&&l.events[b][1].type!=="content"){y=l.events[b][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||y)?(i.enter("setextHeadingLine"),r=m,c(m)):a(m)}function c(m){return i.enter("setextHeadingLineSequence"),h(m)}function h(m){return m===r?(i.consume(m),h):(i.exit("setextHeadingLineSequence"),Ve(m)?We(i,p,"lineSuffix")(m):p(m))}function p(m){return m===null||Se(m)?(i.exit("setextHeadingLine"),t(m)):a(m)}}const Kk={tokenize:Zk};function Zk(i){const t=this,a=i.attempt($u,l,i.attempt(this.parser.constructs.flowInitial,r,We(i,i.attempt(this.parser.constructs.flow,r,i.attempt(WS,r)),"linePrefix")));return a;function l(o){if(o===null){i.consume(o);return}return i.enter("lineEndingBlank"),i.consume(o),i.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function r(o){if(o===null){i.consume(o);return}return i.enter("lineEnding"),i.consume(o),i.exit("lineEnding"),t.currentConstruct=void 0,a}}const Qk={resolveAll:hb()},Xk=db("string"),Fk=db("text");function db(i){return{resolveAll:hb(i==="text"?Jk:void 0),tokenize:t};function t(a){const l=this,r=this.parser.constructs[i],o=a.attempt(r,c,h);return c;function c(b){return m(b)?o(b):h(b)}function h(b){if(b===null){a.consume(b);return}return a.enter("data"),a.consume(b),p}function p(b){return m(b)?(a.exit("data"),o(b)):(a.consume(b),p)}function m(b){if(b===null)return!0;const y=r[b];let S=-1;if(y)for(;++S<y.length;){const x=y[S];if(!x.previous||x.previous.call(l,l.previous))return!0}return!1}}}function hb(i){return t;function t(a,l){let r=-1,o;for(;++r<=a.length;)o===void 0?a[r]&&a[r][1].type==="data"&&(o=r,r++):(!a[r]||a[r][1].type!=="data")&&(r!==o+2&&(a[o][1].end=a[r-1][1].end,a.splice(o+2,r-o-2),r=o+2),o=void 0);return i?i(a,l):a}}function Jk(i,t){let a=0;for(;++a<=i.length;)if((a===i.length||i[a][1].type==="lineEnding")&&i[a-1][1].type==="data"){const l=i[a-1][1],r=t.sliceStream(l);let o=r.length,c=-1,h=0,p;for(;o--;){const m=r[o];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)h++,c--;if(c)break;c=-1}else if(m===-2)p=!0,h++;else if(m!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===i.length&&(h=0),h){const m={type:a===i.length||p||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:l.start._bufferIndex+c,_index:l.start._index+o,line:l.end.line,column:l.end.column-h,offset:l.end.offset-h},end:{...l.end}};l.end={...m.start},l.start.offset===l.end.offset?Object.assign(l,m):(i.splice(a,0,["enter",m,t],["exit",m,t]),a+=2)}a++}return i}const Wk={42:$t,43:$t,45:$t,48:$t,49:$t,50:$t,51:$t,52:$t,53:$t,54:$t,55:$t,56:$t,57:$t,62:sb},Pk={91:ik},ew={[-2]:Lf,[-1]:Lf,32:Lf},tw={35:ok,42:xu,45:[vy,xu],60:hk,61:vy,95:xu,96:yy,126:yy},nw={38:rb,92:lb},iw={[-5]:Bf,[-4]:Bf,[-3]:Bf,33:jk,38:rb,42:sd,60:[DS,xk],91:Dk,92:[rk,lb],93:xd,95:sd,96:KS},aw={null:[sd,Qk]},sw={null:[42,95]},lw={null:[]},rw=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:sw,contentInitial:Pk,disable:lw,document:Wk,flow:tw,flowInitial:ew,insideSpan:aw,string:nw,text:iw},Symbol.toStringTag,{value:"Module"}));function uw(i,t,a){let l={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const r={},o=[];let c=[],h=[];const p={attempt:C(te),check:C(q),consume:Y,enter:H,exit:Z,interrupt:C(q,{interrupt:!0})},m={code:null,containerState:{},defineSkip:T,events:[],now:N,parser:i,previous:null,sliceSerialize:S,sliceStream:x,write:y};let b=t.tokenize.call(m,p);return t.resolveAll&&o.push(t),m;function y(P){return c=pn(c,P),M(),c[c.length-1]!==null?[]:(B(t,0),m.events=vd(o,m.events,m),m.events)}function S(P,ne){return cw(x(P),ne)}function x(P){return ow(c,P)}function N(){const{_bufferIndex:P,_index:ne,line:pe,column:Ae,offset:be}=l;return{_bufferIndex:P,_index:ne,line:pe,column:Ae,offset:be}}function T(P){r[P.line]=P.column,F()}function M(){let P;for(;l._index<c.length;){const ne=c[l._index];if(typeof ne=="string")for(P=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===P&&l._bufferIndex<ne.length;)j(ne.charCodeAt(l._bufferIndex));else j(ne)}}function j(P){b=b(P)}function Y(P){Se(P)?(l.line++,l.column=1,l.offset+=P===-3?2:1,F()):P!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===c[l._index].length&&(l._bufferIndex=-1,l._index++)),m.previous=P}function H(P,ne){const pe=ne||{};return pe.type=P,pe.start=N(),m.events.push(["enter",pe,m]),h.push(pe),pe}function Z(P){const ne=h.pop();return ne.end=N(),m.events.push(["exit",ne,m]),ne}function te(P,ne){B(P,ne.from)}function q(P,ne){ne.restore()}function C(P,ne){return pe;function pe(Ae,be,U){let J,de,se,_;return Array.isArray(Ae)?V(Ae):"tokenize"in Ae?V([Ae]):E(Ae);function E(ue){return ye;function ye(Ke){const Be=Ke!==null&&ue[Ke],yt=Ke!==null&&ue.null,xn=[...Array.isArray(Be)?Be:Be?[Be]:[],...Array.isArray(yt)?yt:yt?[yt]:[]];return V(xn)(Ke)}}function V(ue){return J=ue,de=0,ue.length===0?U:w(ue[de])}function w(ue){return ye;function ye(Ke){return _=X(),se=ue,ue.partial||(m.currentConstruct=ue),ue.name&&m.parser.constructs.disable.null.includes(ue.name)?fe():ue.tokenize.call(ne?Object.assign(Object.create(m),ne):m,p,ie,fe)(Ke)}}function ie(ue){return P(se,_),be}function fe(ue){return _.restore(),++de<J.length?w(J[de]):U}}}function B(P,ne){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&qn(m.events,ne,m.events.length-ne,P.resolve(m.events.slice(ne),m)),P.resolveTo&&(m.events=P.resolveTo(m.events,m))}function X(){const P=N(),ne=m.previous,pe=m.currentConstruct,Ae=m.events.length,be=Array.from(h);return{from:Ae,restore:U};function U(){l=P,m.previous=ne,m.currentConstruct=pe,m.events.length=Ae,h=be,F()}}function F(){l.line in r&&l.column<2&&(l.column=r[l.line],l.offset+=r[l.line]-1)}}function ow(i,t){const a=t.start._index,l=t.start._bufferIndex,r=t.end._index,o=t.end._bufferIndex;let c;if(a===r)c=[i[a].slice(l,o)];else{if(c=i.slice(a,r),l>-1){const h=c[0];typeof h=="string"?c[0]=h.slice(l):c.shift()}o>0&&c.push(i[r].slice(0,o))}return c}function cw(i,t){let a=-1;const l=[];let r;for(;++a<i.length;){const o=i[a];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
456
+ `;break}case-3:{c=`\r
457
+ `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&r)continue;c=" ";break}default:c=String.fromCharCode(o)}r=o===-2,l.push(c)}return l.join("")}function fw(i){const l={constructs:bS([rw,...(i||{}).extensions||[]]),content:r(AS),defined:[],document:r(NS),flow:r(Kk),lazy:{},string:r(Xk),text:r(Fk)};return l;function r(o){return c;function c(h){return uw(l,o,h)}}}function dw(i){for(;!ub(i););return i}const xy=/[\0\t\n\r]/g;function hw(){let i=1,t="",a=!0,l;return r;function r(o,c,h){const p=[];let m,b,y,S,x;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),y=0,t="",a&&(o.charCodeAt(0)===65279&&y++,a=void 0);y<o.length;){if(xy.lastIndex=y,m=xy.exec(o),S=m&&m.index!==void 0?m.index:o.length,x=o.charCodeAt(S),!m){t=o.slice(y);break}if(x===10&&y===S&&l)p.push(-3),l=void 0;else switch(l&&(p.push(-5),l=void 0),y<S&&(p.push(o.slice(y,S)),i+=S-y),x){case 0:{p.push(65533),i++;break}case 9:{for(b=Math.ceil(i/4)*4,p.push(-2);i++<b;)p.push(-1);break}case 10:{p.push(-4),i=1;break}default:l=!0,i=1}y=S+1}return h&&(l&&p.push(-5),t&&p.push(t),p.push(null)),p}}const mw=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function pw(i){return i.replace(mw,gw)}function gw(i,t,a){if(t)return t;if(a.charCodeAt(0)===35){const r=a.charCodeAt(1),o=r===120||r===88;return ab(a.slice(o?2:1),o?16:10)}return bd(a)||i}const mb={}.hasOwnProperty;function yw(i,t,a){return typeof t!="string"&&(a=t,t=void 0),bw(a)(dw(fw(a).document().write(hw()(i,t,!0))))}function bw(i){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Na),autolinkProtocol:X,autolinkEmail:X,atxHeading:o(Aa),blockQuote:o(yt),characterEscape:X,characterReference:X,codeFenced:o(xn),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(xn,c),codeText:o(Hn,c),codeTextData:X,data:X,codeFlowValue:X,definition:o(Ql),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(Vn),hardBreakEscape:o(Ea),hardBreakTrailing:o(Ea),htmlFlow:o(Xl,c),htmlFlowData:X,htmlText:o(Xl,c),htmlTextData:X,image:o(Fl),label:c,link:o(Na),listItem:o(Ds),listItemValue:S,listOrdered:o(Ca,y),listUnordered:o(Ca),paragraph:o(ao),reference:w,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(Aa),strong:o(so),thematicBreak:o(lo)},exit:{atxHeading:p(),atxHeadingSequence:te,autolink:p(),autolinkEmail:Be,autolinkProtocol:Ke,blockQuote:p(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ue,characterReference:ye,codeFenced:p(M),codeFencedFence:T,codeFencedFenceInfo:x,codeFencedFenceMeta:N,codeFlowValue:F,codeIndented:p(j),codeText:p(be),codeTextData:F,data:F,definition:p(),definitionDestinationString:Z,definitionLabelString:Y,definitionTitleString:H,emphasis:p(),hardBreakEscape:p(ne),hardBreakTrailing:p(ne),htmlFlow:p(pe),htmlFlowData:F,htmlText:p(Ae),htmlTextData:F,image:p(J),label:se,labelText:de,lineEnding:P,link:p(U),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ie,resourceDestinationString:_,resourceTitleString:E,resource:V,setextHeading:p(B),setextHeadingLineSequence:C,setextHeadingText:q,strong:p(),thematicBreak:p()}};pb(t,(i||{}).mdastExtensions||[]);const a={};return l;function l($){let ae={type:"root",children:[]};const xe={stack:[ae],tokenStack:[],config:t,enter:h,exit:m,buffer:c,resume:b,data:a},Oe=[];let Ye=-1;for(;++Ye<$.length;)if($[Ye][1].type==="listOrdered"||$[Ye][1].type==="listUnordered")if($[Ye][0]==="enter")Oe.push(Ye);else{const Qt=Oe.pop();Ye=r($,Qt,Ye)}for(Ye=-1;++Ye<$.length;){const Qt=t[$[Ye][0]];mb.call(Qt,$[Ye][1].type)&&Qt[$[Ye][1].type].call(Object.assign({sliceSerialize:$[Ye][2].sliceSerialize},xe),$[Ye][1])}if(xe.tokenStack.length>0){const Qt=xe.tokenStack[xe.tokenStack.length-1];(Qt[1]||Sy).call(xe,void 0,Qt[0])}for(ae.position={start:Hi($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:Hi($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye<t.transforms.length;)ae=t.transforms[Ye](ae)||ae;return ae}function r($,ae,xe){let Oe=ae-1,Ye=-1,Qt=!1,Yn,jt,bt,Bt;for(;++Oe<=xe;){const Fe=$[Oe];switch(Fe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Fe[0]==="enter"?Ye++:Ye--,Bt=void 0;break}case"lineEndingBlank":{Fe[0]==="enter"&&(Yn&&!Bt&&!Ye&&!bt&&(bt=Oe),Bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Bt=void 0}if(!Ye&&Fe[0]==="enter"&&Fe[1].type==="listItemPrefix"||Ye===-1&&Fe[0]==="exit"&&(Fe[1].type==="listUnordered"||Fe[1].type==="listOrdered")){if(Yn){let gi=Oe;for(jt=void 0;gi--;){const Sn=$[gi];if(Sn[1].type==="lineEnding"||Sn[1].type==="lineEndingBlank"){if(Sn[0]==="exit")continue;jt&&($[jt][1].type="lineEndingBlank",Qt=!0),Sn[1].type="lineEnding",jt=gi}else if(!(Sn[1].type==="linePrefix"||Sn[1].type==="blockQuotePrefix"||Sn[1].type==="blockQuotePrefixWhitespace"||Sn[1].type==="blockQuoteMarker"||Sn[1].type==="listItemIndent"))break}bt&&(!jt||bt<jt)&&(Yn._spread=!0),Yn.end=Object.assign({},jt?$[jt][1].start:Fe[1].end),$.splice(jt||Oe,0,["exit",Yn,Fe[2]]),Oe++,xe++}if(Fe[1].type==="listItemPrefix"){const gi={type:"listItem",_spread:!1,start:Object.assign({},Fe[1].start),end:void 0};Yn=gi,$.splice(Oe,0,["enter",gi,Fe[2]]),Oe++,xe++,bt=void 0,Bt=!0}}}return $[ae][1]._spread=Qt,xe}function o($,ae){return xe;function xe(Oe){h.call(this,$(Oe),Oe),ae&&ae.call(this,Oe)}}function c(){this.stack.push({type:"fragment",children:[]})}function h($,ae,xe){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([ae,xe||void 0]),$.position={start:Hi(ae.start),end:void 0}}function p($){return ae;function ae(xe){$&&$.call(this,xe),m.call(this,xe)}}function m($,ae){const xe=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==$.type&&(ae?ae.call(this,$,Oe[0]):(Oe[1]||Sy).call(this,$,Oe[0]));else throw new Error("Cannot close `"+$.type+"` ("+Dl({start:$.start,end:$.end})+"): it’s not open");xe.position.end=Hi($.end)}function b(){return gS(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function S($){if(this.data.expectingFirstListItemValue){const ae=this.stack[this.stack.length-2];ae.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function x(){const $=this.resume(),ae=this.stack[this.stack.length-1];ae.lang=$}function N(){const $=this.resume(),ae=this.stack[this.stack.length-1];ae.meta=$}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function M(){const $=this.resume(),ae=this.stack[this.stack.length-1];ae.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function j(){const $=this.resume(),ae=this.stack[this.stack.length-1];ae.value=$.replace(/(\r?\n|\r)$/g,"")}function Y($){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.label=ae,xe.identifier=Ss(this.sliceSerialize($)).toLowerCase()}function H(){const $=this.resume(),ae=this.stack[this.stack.length-1];ae.title=$}function Z(){const $=this.resume(),ae=this.stack[this.stack.length-1];ae.url=$}function te($){const ae=this.stack[this.stack.length-1];if(!ae.depth){const xe=this.sliceSerialize($).length;ae.depth=xe}}function q(){this.data.setextHeadingSlurpLineEnding=!0}function C($){const ae=this.stack[this.stack.length-1];ae.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function X($){const xe=this.stack[this.stack.length-1].children;let Oe=xe[xe.length-1];(!Oe||Oe.type!=="text")&&(Oe=Ot(),Oe.position={start:Hi($.start),end:void 0},xe.push(Oe)),this.stack.push(Oe)}function F($){const ae=this.stack.pop();ae.value+=this.sliceSerialize($),ae.position.end=Hi($.end)}function P($){const ae=this.stack[this.stack.length-1];if(this.data.atHardBreak){const xe=ae.children[ae.children.length-1];xe.position.end=Hi($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ae.type)&&(X.call(this,$),F.call(this,$))}function ne(){this.data.atHardBreak=!0}function pe(){const $=this.resume(),ae=this.stack[this.stack.length-1];ae.value=$}function Ae(){const $=this.resume(),ae=this.stack[this.stack.length-1];ae.value=$}function be(){const $=this.resume(),ae=this.stack[this.stack.length-1];ae.value=$}function U(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=ae,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function J(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const ae=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=ae,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function de($){const ae=this.sliceSerialize($),xe=this.stack[this.stack.length-2];xe.label=pw(ae),xe.identifier=Ss(ae).toLowerCase()}function se(){const $=this.stack[this.stack.length-1],ae=this.resume(),xe=this.stack[this.stack.length-1];if(this.data.inReference=!0,xe.type==="link"){const Oe=$.children;xe.children=Oe}else xe.alt=ae}function _(){const $=this.resume(),ae=this.stack[this.stack.length-1];ae.url=$}function E(){const $=this.resume(),ae=this.stack[this.stack.length-1];ae.title=$}function V(){this.data.inReference=void 0}function w(){this.data.referenceType="collapsed"}function ie($){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.label=ae,xe.identifier=Ss(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function fe($){this.data.characterReferenceType=$.type}function ue($){const ae=this.sliceSerialize($),xe=this.data.characterReferenceType;let Oe;xe?(Oe=ab(ae,xe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=bd(ae);const Ye=this.stack[this.stack.length-1];Ye.value+=Oe}function ye($){const ae=this.stack.pop();ae.position.end=Hi($.end)}function Ke($){F.call(this,$);const ae=this.stack[this.stack.length-1];ae.url=this.sliceSerialize($)}function Be($){F.call(this,$);const ae=this.stack[this.stack.length-1];ae.url="mailto:"+this.sliceSerialize($)}function yt(){return{type:"blockquote",children:[]}}function xn(){return{type:"code",lang:null,meta:null,value:""}}function Hn(){return{type:"inlineCode",value:""}}function Ql(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Vn(){return{type:"emphasis",children:[]}}function Aa(){return{type:"heading",depth:0,children:[]}}function Ea(){return{type:"break"}}function Xl(){return{type:"html",value:""}}function Fl(){return{type:"image",title:null,url:"",alt:null}}function Na(){return{type:"link",title:null,url:"",children:[]}}function Ca($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[]}}function Ds($){return{type:"listItem",spread:$._spread,checked:null,children:[]}}function ao(){return{type:"paragraph",children:[]}}function so(){return{type:"strong",children:[]}}function Ot(){return{type:"text",value:""}}function lo(){return{type:"thematicBreak"}}}function Hi(i){return{line:i.line,column:i.column,offset:i.offset}}function pb(i,t){let a=-1;for(;++a<t.length;){const l=t[a];Array.isArray(l)?pb(i,l):vw(i,l)}}function vw(i,t){let a;for(a in t)if(mb.call(t,a))switch(a){case"canContainEols":{const l=t[a];l&&i[a].push(...l);break}case"transforms":{const l=t[a];l&&i[a].push(...l);break}case"enter":case"exit":{const l=t[a];l&&Object.assign(i[a],l);break}}}function Sy(i,t){throw i?new Error("Cannot close `"+i.type+"` ("+Dl({start:i.start,end:i.end})+"): a different token (`"+t.type+"`, "+Dl({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Dl({start:t.start,end:t.end})+") is still open")}function xw(i){const t=this;t.parser=a;function a(l){return yw(l,{...t.data("settings"),...i,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}const gb=(function(i){if(i==null)return _w;if(typeof i=="function")return Ku(i);if(typeof i=="object")return Array.isArray(i)?Sw(i):kw(i);if(typeof i=="string")return ww(i);throw new Error("Expected function, string, or object as test")});function Sw(i){const t=[];let a=-1;for(;++a<i.length;)t[a]=gb(i[a]);return Ku(l);function l(...r){let o=-1;for(;++o<t.length;)if(t[o].apply(this,r))return!0;return!1}}function kw(i){const t=i;return Ku(a);function a(l){const r=l;let o;for(o in i)if(r[o]!==t[o])return!1;return!0}}function ww(i){return Ku(t);function t(a){return a&&a.type===i}}function Ku(i){return t;function t(a,l,r){return!!(Tw(a)&&i.call(this,a,typeof l=="number"?l:void 0,r||void 0))}}function _w(){return!0}function Tw(i){return i!==null&&typeof i=="object"&&"type"in i}const yb=[],Aw=!0,ky=!1,bb="skip";function Ew(i,t,a,l){let r;typeof t=="function"&&typeof a!="function"?(l=a,a=t):r=t;const o=gb(r),c=l?-1:1;h(i,void 0,[])();function h(p,m,b){const y=p&&typeof p=="object"?p:{};if(typeof y.type=="string"){const x=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(p.type+(x?"<"+x+">":""))+")"})}return S;function S(){let x=yb,N,T,M;if((!t||o(p,m,b[b.length-1]||void 0))&&(x=Nw(a(p,b)),x[0]===ky))return x;if("children"in p&&p.children){const j=p;if(j.children&&x[0]!==bb)for(T=(l?j.children.length:-1)+c,M=b.concat(j);T>-1&&T<j.children.length;){const Y=j.children[T];if(N=h(Y,T,M)(),N[0]===ky)return N;T=typeof N[1]=="number"?N[1]:T+c}}return x}}}function Nw(i){return Array.isArray(i)?i:typeof i=="number"?[Aw,i]:i==null?yb:[i]}function Cw(i,t,a,l){let r,o,c;o=t,c=a,r=l,Ew(i,o,h,r);function h(p,m){const b=m[m.length-1],y=b?b.children.indexOf(p):void 0;return c(p,y,b)}}const Sd=Symbol.for("yaml.alias"),ld=Symbol.for("yaml.document"),Gi=Symbol.for("yaml.map"),vb=Symbol.for("yaml.pair"),Un=Symbol.for("yaml.scalar"),Cs=Symbol.for("yaml.seq"),bn=Symbol.for("yaml.node.type"),Ta=i=>!!i&&typeof i=="object"&&i[bn]===Sd,Zu=i=>!!i&&typeof i=="object"&&i[bn]===ld,Yl=i=>!!i&&typeof i=="object"&&i[bn]===Gi,ft=i=>!!i&&typeof i=="object"&&i[bn]===vb,Pe=i=>!!i&&typeof i=="object"&&i[bn]===Un,Gl=i=>!!i&&typeof i=="object"&&i[bn]===Cs;function ot(i){if(i&&typeof i=="object")switch(i[bn]){case Gi:case Cs:return!0}return!1}function ct(i){if(i&&typeof i=="object")switch(i[bn]){case Sd:case Gi:case Un:case Cs:return!0}return!1}const xb=i=>(Pe(i)||ot(i))&&!!i.anchor,ma=Symbol("break visit"),Ow=Symbol("skip children"),Rl=Symbol("remove node");function Os(i,t){const a=jw(t);Zu(i)?bs(null,i.contents,a,Object.freeze([i]))===Rl&&(i.contents=null):bs(null,i,a,Object.freeze([]))}Os.BREAK=ma;Os.SKIP=Ow;Os.REMOVE=Rl;function bs(i,t,a,l){const r=Mw(i,t,a,l);if(ct(r)||ft(r))return Dw(i,l,r),bs(i,r,a,l);if(typeof r!="symbol"){if(ot(t)){l=Object.freeze(l.concat(t));for(let o=0;o<t.items.length;++o){const c=bs(o,t.items[o],a,l);if(typeof c=="number")o=c-1;else{if(c===ma)return ma;c===Rl&&(t.items.splice(o,1),o-=1)}}}else if(ft(t)){l=Object.freeze(l.concat(t));const o=bs("key",t.key,a,l);if(o===ma)return ma;o===Rl&&(t.key=null);const c=bs("value",t.value,a,l);if(c===ma)return ma;c===Rl&&(t.value=null)}}return r}function jw(i){return typeof i=="object"&&(i.Collection||i.Node||i.Value)?Object.assign({Alias:i.Node,Map:i.Node,Scalar:i.Node,Seq:i.Node},i.Value&&{Map:i.Value,Scalar:i.Value,Seq:i.Value},i.Collection&&{Map:i.Collection,Seq:i.Collection},i):i}function Mw(i,t,a,l){var r,o,c,h,p;if(typeof a=="function")return a(i,t,l);if(Yl(t))return(r=a.Map)==null?void 0:r.call(a,i,t,l);if(Gl(t))return(o=a.Seq)==null?void 0:o.call(a,i,t,l);if(ft(t))return(c=a.Pair)==null?void 0:c.call(a,i,t,l);if(Pe(t))return(h=a.Scalar)==null?void 0:h.call(a,i,t,l);if(Ta(t))return(p=a.Alias)==null?void 0:p.call(a,i,t,l)}function Dw(i,t,a){const l=t[t.length-1];if(ot(l))l.items[i]=a;else if(ft(l))i==="key"?l.key=a:l.value=a;else if(Zu(l))l.contents=a;else{const r=Ta(l)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const zw={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Rw=i=>i.replace(/[!,[\]{}]/g,t=>zw[t]);class Dt{constructor(t,a){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Dt.defaultYaml,t),this.tags=Object.assign({},Dt.defaultTags,a)}clone(){const t=new Dt(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Dt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Dt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Dt.defaultTags);break}return t}add(t,a){this.atNextDocument&&(this.yaml={explicit:Dt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Dt.defaultTags),this.atNextDocument=!1);const l=t.trim().split(/[ \t]+/),r=l.shift();switch(r){case"%TAG":{if(l.length!==2&&(a(0,"%TAG directive should contain exactly two parts"),l.length<2))return!1;const[o,c]=l;return this.tags[o]=c,!0}case"%YAML":{if(this.yaml.explicit=!0,l.length!==1)return a(0,"%YAML directive should contain exactly one part"),!1;const[o]=l;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const c=/^\d+\.\d+$/.test(o);return a(6,`Unsupported YAML version ${o}`,c),!1}}default:return a(0,`Unknown directive ${r}`,!0),!1}}tagName(t,a){if(t==="!")return"!";if(t[0]!=="!")return a(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const c=t.slice(2,-1);return c==="!"||c==="!!"?(a(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&a("Verbatim tags must end with a >"),c)}const[,l,r]=t.match(/^(.*!)([^!]*)$/s);r||a(`The ${t} tag has no suffix`);const o=this.tags[l];if(o)try{return o+decodeURIComponent(r)}catch(c){return a(String(c)),null}return l==="!"?t:(a(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[a,l]of Object.entries(this.tags))if(t.startsWith(l))return a+Rw(t.substring(l.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const a=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],l=Object.entries(this.tags);let r;if(t&&l.length>0&&ct(t.contents)){const o={};Os(t.contents,(c,h)=>{ct(h)&&h.tag&&(o[h.tag]=!0)}),r=Object.keys(o)}else r=[];for(const[o,c]of l)o==="!!"&&c==="tag:yaml.org,2002:"||(!t||r.some(h=>h.startsWith(c)))&&a.push(`%TAG ${o} ${c}`);return a.join(`
458
+ `)}}Dt.defaultYaml={explicit:!1,version:"1.2"};Dt.defaultTags={"!!":"tag:yaml.org,2002:"};function Sb(i){if(/[\x00-\x19\s,[\]{}]/.test(i)){const a=`Anchor must not contain whitespace or control characters: ${JSON.stringify(i)}`;throw new Error(a)}return!0}function kb(i){const t=new Set;return Os(i,{Value(a,l){l.anchor&&t.add(l.anchor)}}),t}function wb(i,t){for(let a=1;;++a){const l=`${i}${a}`;if(!t.has(l))return l}}function Lw(i,t){const a=[],l=new Map;let r=null;return{onAnchor:o=>{a.push(o),r??(r=kb(i));const c=wb(t,r);return r.add(c),c},setAnchors:()=>{for(const o of a){const c=l.get(o);if(typeof c=="object"&&c.anchor&&(Pe(c.node)||ot(c.node)))c.node.anchor=c.anchor;else{const h=new Error("Failed to resolve repeated object (this should not happen)");throw h.source=o,h}}},sourceObjects:l}}function vs(i,t,a,l){if(l&&typeof l=="object")if(Array.isArray(l))for(let r=0,o=l.length;r<o;++r){const c=l[r],h=vs(i,l,String(r),c);h===void 0?delete l[r]:h!==c&&(l[r]=h)}else if(l instanceof Map)for(const r of Array.from(l.keys())){const o=l.get(r),c=vs(i,l,r,o);c===void 0?l.delete(r):c!==o&&l.set(r,c)}else if(l instanceof Set)for(const r of Array.from(l)){const o=vs(i,l,r,r);o===void 0?l.delete(r):o!==r&&(l.delete(r),l.add(o))}else for(const[r,o]of Object.entries(l)){const c=vs(i,l,r,o);c===void 0?delete l[r]:c!==o&&(l[r]=c)}return i.call(t,a,l)}function yn(i,t,a){if(Array.isArray(i))return i.map((l,r)=>yn(l,String(r),a));if(i&&typeof i.toJSON=="function"){if(!a||!xb(i))return i.toJSON(t,a);const l={aliasCount:0,count:1,res:void 0};a.anchors.set(i,l),a.onCreate=o=>{l.res=o,delete a.onCreate};const r=i.toJSON(t,a);return a.onCreate&&a.onCreate(r),r}return typeof i=="bigint"&&!(a!=null&&a.keep)?Number(i):i}class kd{constructor(t){Object.defineProperty(this,bn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:a,maxAliasCount:l,onAnchor:r,reviver:o}={}){if(!Zu(t))throw new TypeError("A document argument is required");const c={anchors:new Map,doc:t,keep:!0,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof l=="number"?l:100},h=yn(this,"",c);if(typeof r=="function")for(const{count:p,res:m}of c.anchors.values())r(m,p);return typeof o=="function"?vs(o,{"":h},"",h):h}}class wd extends kd{constructor(t){super(Sd),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,a){let l;a!=null&&a.aliasResolveCache?l=a.aliasResolveCache:(l=[],Os(t,{Node:(o,c)=>{(Ta(c)||xb(c))&&l.push(c)}}),a&&(a.aliasResolveCache=l));let r;for(const o of l){if(o===this)break;o.anchor===this.source&&(r=o)}return r}toJSON(t,a){if(!a)return{source:this.source};const{anchors:l,doc:r,maxAliasCount:o}=a,c=this.resolve(r,a);if(!c){const p=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(p)}let h=l.get(c);if(h||(yn(c,null,a),h=l.get(c)),(h==null?void 0:h.res)===void 0){const p="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(p)}if(o>=0&&(h.count+=1,h.aliasCount===0&&(h.aliasCount=Su(r,c,l)),h.count*h.aliasCount>o)){const p="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(p)}return h.res}toString(t,a,l){const r=`*${this.source}`;if(t){if(Sb(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${r} `}return r}}function Su(i,t,a){if(Ta(t)){const l=t.resolve(i),r=a&&l&&a.get(l);return r?r.count*r.aliasCount:0}else if(ot(t)){let l=0;for(const r of t.items){const o=Su(i,r,a);o>l&&(l=o)}return l}else if(ft(t)){const l=Su(i,t.key,a),r=Su(i,t.value,a);return Math.max(l,r)}return 1}const _b=i=>!i||typeof i!="function"&&typeof i!="object";class Te extends kd{constructor(t){super(Un),this.value=t}toJSON(t,a){return a!=null&&a.keep?this.value:yn(this.value,t,a)}toString(){return String(this.value)}}Te.BLOCK_FOLDED="BLOCK_FOLDED";Te.BLOCK_LITERAL="BLOCK_LITERAL";Te.PLAIN="PLAIN";Te.QUOTE_DOUBLE="QUOTE_DOUBLE";Te.QUOTE_SINGLE="QUOTE_SINGLE";const Bw="tag:yaml.org,2002:";function qw(i,t,a){if(t){const l=a.filter(o=>o.tag===t),r=l.find(o=>!o.format)??l[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return a.find(l=>{var r;return((r=l.identify)==null?void 0:r.call(l,i))&&!l.format})}function Il(i,t,a){var y,S,x;if(Zu(i)&&(i=i.contents),ct(i))return i;if(ft(i)){const N=(S=(y=a.schema[Gi]).createNode)==null?void 0:S.call(y,a.schema,null,a);return N.items.push(i),N}(i instanceof String||i instanceof Number||i instanceof Boolean||typeof BigInt<"u"&&i instanceof BigInt)&&(i=i.valueOf());const{aliasDuplicateObjects:l,onAnchor:r,onTagObj:o,schema:c,sourceObjects:h}=a;let p;if(l&&i&&typeof i=="object"){if(p=h.get(i),p)return p.anchor??(p.anchor=r(i)),new wd(p.anchor);p={anchor:null,node:null},h.set(i,p)}t!=null&&t.startsWith("!!")&&(t=Bw+t.slice(2));let m=qw(i,t,c.tags);if(!m){if(i&&typeof i.toJSON=="function"&&(i=i.toJSON()),!i||typeof i!="object"){const N=new Te(i);return p&&(p.node=N),N}m=i instanceof Map?c[Gi]:Symbol.iterator in Object(i)?c[Cs]:c[Gi]}o&&(o(m),delete a.onTagObj);const b=m!=null&&m.createNode?m.createNode(a.schema,i,a):typeof((x=m==null?void 0:m.nodeClass)==null?void 0:x.from)=="function"?m.nodeClass.from(a.schema,i,a):new Te(i);return t?b.tag=t:m.default||(b.tag=m.tag),p&&(p.node=b),b}function Yu(i,t,a){let l=a;for(let r=t.length-1;r>=0;--r){const o=t[r];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const c=[];c[o]=l,l=c}else l=new Map([[o,l]])}return Il(l,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:i,sourceObjects:new Map})}const jl=i=>i==null||typeof i=="object"&&!!i[Symbol.iterator]().next().done;class Tb extends kd{constructor(t,a){super(t),Object.defineProperty(this,"schema",{value:a,configurable:!0,enumerable:!1,writable:!0})}clone(t){const a=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(a.schema=t),a.items=a.items.map(l=>ct(l)||ft(l)?l.clone(t):l),this.range&&(a.range=this.range.slice()),a}addIn(t,a){if(jl(t))this.add(a);else{const[l,...r]=t,o=this.get(l,!0);if(ot(o))o.addIn(r,a);else if(o===void 0&&this.schema)this.set(l,Yu(this.schema,r,a));else throw new Error(`Expected YAML collection at ${l}. Remaining path: ${r}`)}}deleteIn(t){const[a,...l]=t;if(l.length===0)return this.delete(a);const r=this.get(a,!0);if(ot(r))return r.deleteIn(l);throw new Error(`Expected YAML collection at ${a}. Remaining path: ${l}`)}getIn(t,a){const[l,...r]=t,o=this.get(l,!0);return r.length===0?!a&&Pe(o)?o.value:o:ot(o)?o.getIn(r,a):void 0}hasAllNullValues(t){return this.items.every(a=>{if(!ft(a))return!1;const l=a.value;return l==null||t&&Pe(l)&&l.value==null&&!l.commentBefore&&!l.comment&&!l.tag})}hasIn(t){const[a,...l]=t;if(l.length===0)return this.has(a);const r=this.get(a,!0);return ot(r)?r.hasIn(l):!1}setIn(t,a){const[l,...r]=t;if(r.length===0)this.set(l,a);else{const o=this.get(l,!0);if(ot(o))o.setIn(r,a);else if(o===void 0&&this.schema)this.set(l,Yu(this.schema,r,a));else throw new Error(`Expected YAML collection at ${l}. Remaining path: ${r}`)}}}const Uw=i=>i.replace(/^(?!$)(?: $)?/gm,"#");function ci(i,t){return/^\n+$/.test(i)?i.substring(1):t?i.replace(/^(?! *$)/gm,t):i}const ya=(i,t,a)=>i.endsWith(`
459
+ `)?ci(a,t):a.includes(`
460
+ `)?`
461
+ `+ci(a,t):(i.endsWith(" ")?"":" ")+a,Ab="flow",rd="block",ku="quoted";function Qu(i,t,a="flow",{indentAtStart:l,lineWidth:r=80,minContentWidth:o=20,onFold:c,onOverflow:h}={}){if(!r||r<0)return i;r<o&&(o=0);const p=Math.max(1+o,1+r-t.length);if(i.length<=p)return i;const m=[],b={};let y=r-t.length;typeof l=="number"&&(l>r-Math.max(2,o)?m.push(0):y=r-l);let S,x,N=!1,T=-1,M=-1,j=-1;a===rd&&(T=wy(i,T,t.length),T!==-1&&(y=T+p));for(let H;H=i[T+=1];){if(a===ku&&H==="\\"){switch(M=T,i[T+1]){case"x":T+=3;break;case"u":T+=5;break;case"U":T+=9;break;default:T+=1}j=T}if(H===`
462
+ `)a===rd&&(T=wy(i,T,t.length)),y=T+t.length+p,S=void 0;else{if(H===" "&&x&&x!==" "&&x!==`
463
+ `&&x!==" "){const Z=i[T+1];Z&&Z!==" "&&Z!==`
464
+ `&&Z!==" "&&(S=T)}if(T>=y)if(S)m.push(S),y=S+p,S=void 0;else if(a===ku){for(;x===" "||x===" ";)x=H,H=i[T+=1],N=!0;const Z=T>j+1?T-2:M-1;if(b[Z])return i;m.push(Z),b[Z]=!0,y=Z+p,S=void 0}else N=!0}x=H}if(N&&h&&h(),m.length===0)return i;c&&c();let Y=i.slice(0,m[0]);for(let H=0;H<m.length;++H){const Z=m[H],te=m[H+1]||i.length;Z===0?Y=`
465
+ ${t}${i.slice(0,te)}`:(a===ku&&b[Z]&&(Y+=`${i[Z]}\\`),Y+=`
466
+ ${t}${i.slice(Z+1,te)}`)}return Y}function wy(i,t,a){let l=t,r=t+1,o=i[r];for(;o===" "||o===" ";)if(t<r+a)o=i[++t];else{do o=i[++t];while(o&&o!==`
467
+ `);l=t,r=t+1,o=i[r]}return l}const Xu=(i,t)=>({indentAtStart:t?i.indent.length:i.indentAtStart,lineWidth:i.options.lineWidth,minContentWidth:i.options.minContentWidth}),Fu=i=>/^(%|---|\.\.\.)/m.test(i);function Iw(i,t,a){if(!t||t<0)return!1;const l=t-a,r=i.length;if(r<=l)return!1;for(let o=0,c=0;o<r;++o)if(i[o]===`
468
+ `){if(o-c>l)return!0;if(c=o+1,r-c<=l)return!1}return!0}function Ll(i,t){const a=JSON.stringify(i);if(t.options.doubleQuotedAsJSON)return a;const{implicitKey:l}=t,r=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Fu(i)?" ":"");let c="",h=0;for(let p=0,m=a[p];m;m=a[++p])if(m===" "&&a[p+1]==="\\"&&a[p+2]==="n"&&(c+=a.slice(h,p)+"\\ ",p+=1,h=p,m="\\"),m==="\\")switch(a[p+1]){case"u":{c+=a.slice(h,p);const b=a.substr(p+2,4);switch(b){case"0000":c+="\\0";break;case"0007":c+="\\a";break;case"000b":c+="\\v";break;case"001b":c+="\\e";break;case"0085":c+="\\N";break;case"00a0":c+="\\_";break;case"2028":c+="\\L";break;case"2029":c+="\\P";break;default:b.substr(0,2)==="00"?c+="\\x"+b.substr(2):c+=a.substr(p,6)}p+=5,h=p+1}break;case"n":if(l||a[p+2]==='"'||a.length<r)p+=1;else{for(c+=a.slice(h,p)+`
469
+
470
+ `;a[p+2]==="\\"&&a[p+3]==="n"&&a[p+4]!=='"';)c+=`
471
+ `,p+=2;c+=o,a[p+2]===" "&&(c+="\\"),p+=1,h=p+1}break;default:p+=1}return c=h?c+a.slice(h):a,l?c:Qu(c,o,ku,Xu(t,!1))}function ud(i,t){if(t.options.singleQuote===!1||t.implicitKey&&i.includes(`
472
+ `)||/[ \t]\n|\n[ \t]/.test(i))return Ll(i,t);const a=t.indent||(Fu(i)?" ":""),l="'"+i.replace(/'/g,"''").replace(/\n+/g,`$&
473
+ ${a}`)+"'";return t.implicitKey?l:Qu(l,a,Ab,Xu(t,!1))}function xs(i,t){const{singleQuote:a}=t.options;let l;if(a===!1)l=Ll;else{const r=i.includes('"'),o=i.includes("'");r&&!o?l=ud:o&&!r?l=Ll:l=a?ud:Ll}return l(i,t)}let od;try{od=new RegExp(`(^|(?<!
474
+ ))
475
+ +(?!
476
+ |$)`,"g")}catch{od=/\n+(?!\n|$)/g}function wu({comment:i,type:t,value:a},l,r,o){const{blockQuote:c,commentString:h,lineWidth:p}=l.options;if(!c||/\n[\t ]+$/.test(a))return xs(a,l);const m=l.indent||(l.forceBlockIndent||Fu(a)?" ":""),b=c==="literal"?!0:c==="folded"||t===Te.BLOCK_FOLDED?!1:t===Te.BLOCK_LITERAL?!0:!Iw(a,p,m.length);if(!a)return b?`|
477
+ `:`>
478
+ `;let y,S;for(S=a.length;S>0;--S){const te=a[S-1];if(te!==`
479
+ `&&te!==" "&&te!==" ")break}let x=a.substring(S);const N=x.indexOf(`
480
+ `);N===-1?y="-":a===x||N!==x.length-1?(y="+",o&&o()):y="",x&&(a=a.slice(0,-x.length),x[x.length-1]===`
481
+ `&&(x=x.slice(0,-1)),x=x.replace(od,`$&${m}`));let T=!1,M,j=-1;for(M=0;M<a.length;++M){const te=a[M];if(te===" ")T=!0;else if(te===`
482
+ `)j=M;else break}let Y=a.substring(0,j<M?j+1:M);Y&&(a=a.substring(Y.length),Y=Y.replace(/\n+/g,`$&${m}`));let Z=(T?m?"2":"1":"")+y;if(i&&(Z+=" "+h(i.replace(/ ?[\r\n]+/g," ")),r&&r()),!b){const te=a.replace(/\n+/g,`
483
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`);let q=!1;const C=Xu(l,!0);c!=="folded"&&t!==Te.BLOCK_FOLDED&&(C.onOverflow=()=>{q=!0});const B=Qu(`${Y}${te}${x}`,m,rd,C);if(!q)return`>${Z}
484
+ ${m}${B}`}return a=a.replace(/\n+/g,`$&${m}`),`|${Z}
485
+ ${m}${Y}${a}${x}`}function Hw(i,t,a,l){const{type:r,value:o}=i,{actualString:c,implicitKey:h,indent:p,indentStep:m,inFlow:b}=t;if(h&&o.includes(`
486
+ `)||b&&/[[\]{},]/.test(o))return xs(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return h||b||!o.includes(`
487
+ `)?xs(o,t):wu(i,t,a,l);if(!h&&!b&&r!==Te.PLAIN&&o.includes(`
488
+ `))return wu(i,t,a,l);if(Fu(o)){if(p==="")return t.forceBlockIndent=!0,wu(i,t,a,l);if(h&&p===m)return xs(o,t)}const y=o.replace(/\n+/g,`$&
489
+ ${p}`);if(c){const S=T=>{var M;return T.default&&T.tag!=="tag:yaml.org,2002:str"&&((M=T.test)==null?void 0:M.test(y))},{compat:x,tags:N}=t.doc.schema;if(N.some(S)||x!=null&&x.some(S))return xs(o,t)}return h?y:Qu(y,p,Ab,Xu(t,!1))}function _d(i,t,a,l){const{implicitKey:r,inFlow:o}=t,c=typeof i.value=="string"?i:Object.assign({},i,{value:String(i.value)});let{type:h}=i;h!==Te.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(h=Te.QUOTE_DOUBLE);const p=b=>{switch(b){case Te.BLOCK_FOLDED:case Te.BLOCK_LITERAL:return r||o?xs(c.value,t):wu(c,t,a,l);case Te.QUOTE_DOUBLE:return Ll(c.value,t);case Te.QUOTE_SINGLE:return ud(c.value,t);case Te.PLAIN:return Hw(c,t,a,l);default:return null}};let m=p(h);if(m===null){const{defaultKeyType:b,defaultStringType:y}=t.options,S=r&&b||y;if(m=p(S),m===null)throw new Error(`Unsupported default string type ${S}`)}return m}function Eb(i,t){const a=Object.assign({blockQuote:!0,commentString:Uw,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},i.schema.toStringOptions,t);let l;switch(a.collectionStyle){case"block":l=!1;break;case"flow":l=!0;break;default:l=null}return{anchors:new Set,doc:i,flowCollectionPadding:a.flowCollectionPadding?" ":"",indent:"",indentStep:typeof a.indent=="number"?" ".repeat(a.indent):" ",inFlow:l,options:a}}function Vw(i,t){var r;if(t.tag){const o=i.filter(c=>c.tag===t.tag);if(o.length>0)return o.find(c=>c.format===t.format)??o[0]}let a,l;if(Pe(t)){l=t.value;let o=i.filter(c=>{var h;return(h=c.identify)==null?void 0:h.call(c,l)});if(o.length>1){const c=o.filter(h=>h.test);c.length>0&&(o=c)}a=o.find(c=>c.format===t.format)??o.find(c=>!c.format)}else l=t,a=i.find(o=>o.nodeClass&&l instanceof o.nodeClass);if(!a){const o=((r=l==null?void 0:l.constructor)==null?void 0:r.name)??(l===null?"null":typeof l);throw new Error(`Tag not resolved for ${o} value`)}return a}function Yw(i,t,{anchors:a,doc:l}){if(!l.directives)return"";const r=[],o=(Pe(i)||ot(i))&&i.anchor;o&&Sb(o)&&(a.add(o),r.push(`&${o}`));const c=i.tag??(t.default?null:t.tag);return c&&r.push(l.directives.tagString(c)),r.join(" ")}function As(i,t,a,l){var p;if(ft(i))return i.toString(t,a,l);if(Ta(i)){if(t.doc.directives)return i.toString(t);if((p=t.resolvedAliases)!=null&&p.has(i))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(i):t.resolvedAliases=new Set([i]),i=i.resolve(t.doc)}let r;const o=ct(i)?i:t.doc.createNode(i,{onTagObj:m=>r=m});r??(r=Vw(t.doc.schema.tags,o));const c=Yw(o,r,t);c.length>0&&(t.indentAtStart=(t.indentAtStart??0)+c.length+1);const h=typeof r.stringify=="function"?r.stringify(o,t,a,l):Pe(o)?_d(o,t,a,l):o.toString(t,a,l);return c?Pe(o)||h[0]==="{"||h[0]==="["?`${c} ${h}`:`${c}
490
+ ${t.indent}${h}`:h}function Gw({key:i,value:t},a,l,r){const{allNullValues:o,doc:c,indent:h,indentStep:p,options:{commentString:m,indentSeq:b,simpleKeys:y}}=a;let S=ct(i)&&i.comment||null;if(y){if(S)throw new Error("With simple keys, key nodes cannot have comments");if(ot(i)||!ct(i)&&typeof i=="object"){const C="With simple keys, collection cannot be used as a key value";throw new Error(C)}}let x=!y&&(!i||S&&t==null&&!a.inFlow||ot(i)||(Pe(i)?i.type===Te.BLOCK_FOLDED||i.type===Te.BLOCK_LITERAL:typeof i=="object"));a=Object.assign({},a,{allNullValues:!1,implicitKey:!x&&(y||!o),indent:h+p});let N=!1,T=!1,M=As(i,a,()=>N=!0,()=>T=!0);if(!x&&!a.inFlow&&M.length>1024){if(y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");x=!0}if(a.inFlow){if(o||t==null)return N&&l&&l(),M===""?"?":x?`? ${M}`:M}else if(o&&!y||t==null&&x)return M=`? ${M}`,S&&!N?M+=ya(M,a.indent,m(S)):T&&r&&r(),M;N&&(S=null),x?(S&&(M+=ya(M,a.indent,m(S))),M=`? ${M}
491
+ ${h}:`):(M=`${M}:`,S&&(M+=ya(M,a.indent,m(S))));let j,Y,H;ct(t)?(j=!!t.spaceBefore,Y=t.commentBefore,H=t.comment):(j=!1,Y=null,H=null,t&&typeof t=="object"&&(t=c.createNode(t))),a.implicitKey=!1,!x&&!S&&Pe(t)&&(a.indentAtStart=M.length+1),T=!1,!b&&p.length>=2&&!a.inFlow&&!x&&Gl(t)&&!t.flow&&!t.tag&&!t.anchor&&(a.indent=a.indent.substring(2));let Z=!1;const te=As(t,a,()=>Z=!0,()=>T=!0);let q=" ";if(S||j||Y){if(q=j?`
492
+ `:"",Y){const C=m(Y);q+=`
493
+ ${ci(C,a.indent)}`}te===""&&!a.inFlow?q===`
494
+ `&&H&&(q=`
495
+
496
+ `):q+=`
497
+ ${a.indent}`}else if(!x&&ot(t)){const C=te[0],B=te.indexOf(`
498
+ `),X=B!==-1,F=a.inFlow??t.flow??t.items.length===0;if(X||!F){let P=!1;if(X&&(C==="&"||C==="!")){let ne=te.indexOf(" ");C==="&"&&ne!==-1&&ne<B&&te[ne+1]==="!"&&(ne=te.indexOf(" ",ne+1)),(ne===-1||B<ne)&&(P=!0)}P||(q=`
499
+ ${a.indent}`)}}else(te===""||te[0]===`
500
+ `)&&(q="");return M+=q+te,a.inFlow?Z&&l&&l():H&&!Z?M+=ya(M,a.indent,m(H)):T&&r&&r(),M}function Nb(i,t){(i==="debug"||i==="warn")&&console.warn(t)}const mu="<<",di={identify:i=>i===mu||typeof i=="symbol"&&i.description===mu,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Te(Symbol(mu)),{addToJSMap:Cb}),stringify:()=>mu},$w=(i,t)=>(di.identify(t)||Pe(t)&&(!t.type||t.type===Te.PLAIN)&&di.identify(t.value))&&(i==null?void 0:i.doc.schema.tags.some(a=>a.tag===di.tag&&a.default));function Cb(i,t,a){if(a=i&&Ta(a)?a.resolve(i.doc):a,Gl(a))for(const l of a.items)qf(i,t,l);else if(Array.isArray(a))for(const l of a)qf(i,t,l);else qf(i,t,a)}function qf(i,t,a){const l=i&&Ta(a)?a.resolve(i.doc):a;if(!Yl(l))throw new Error("Merge sources must be maps or map aliases");const r=l.toJSON(null,i,Map);for(const[o,c]of r)t instanceof Map?t.has(o)||t.set(o,c):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:c,writable:!0,enumerable:!0,configurable:!0});return t}function Ob(i,t,{key:a,value:l}){if(ct(a)&&a.addToJSMap)a.addToJSMap(i,t,l);else if($w(i,a))Cb(i,t,l);else{const r=yn(a,"",i);if(t instanceof Map)t.set(r,yn(l,r,i));else if(t instanceof Set)t.add(r);else{const o=Kw(a,r,i),c=yn(l,o,i);o in t?Object.defineProperty(t,o,{value:c,writable:!0,enumerable:!0,configurable:!0}):t[o]=c}}return t}function Kw(i,t,a){if(t===null)return"";if(typeof t!="object")return String(t);if(ct(i)&&(a!=null&&a.doc)){const l=Eb(a.doc,{});l.anchors=new Set;for(const o of a.anchors.keys())l.anchors.add(o.anchor);l.inFlow=!0,l.inStringifyKey=!0;const r=i.toString(l);if(!a.mapKeyWarned){let o=JSON.stringify(r);o.length>40&&(o=o.substring(0,36)+'..."'),Nb(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Td(i,t,a){const l=Il(i,void 0,a),r=Il(t,void 0,a);return new Rt(l,r)}class Rt{constructor(t,a=null){Object.defineProperty(this,bn,{value:vb}),this.key=t,this.value=a}clone(t){let{key:a,value:l}=this;return ct(a)&&(a=a.clone(t)),ct(l)&&(l=l.clone(t)),new Rt(a,l)}toJSON(t,a){const l=a!=null&&a.mapAsMap?new Map:{};return Ob(a,l,this)}toString(t,a,l){return t!=null&&t.doc?Gw(this,t,a,l):JSON.stringify(this)}}function jb(i,t,a){return(t.inFlow??i.flow?Qw:Zw)(i,t,a)}function Zw({comment:i,items:t},a,{blockItemPrefix:l,flowChars:r,itemIndent:o,onChompKeep:c,onComment:h}){const{indent:p,options:{commentString:m}}=a,b=Object.assign({},a,{indent:o,type:null});let y=!1;const S=[];for(let N=0;N<t.length;++N){const T=t[N];let M=null;if(ct(T))!y&&T.spaceBefore&&S.push(""),Gu(a,S,T.commentBefore,y),T.comment&&(M=T.comment);else if(ft(T)){const Y=ct(T.key)?T.key:null;Y&&(!y&&Y.spaceBefore&&S.push(""),Gu(a,S,Y.commentBefore,y))}y=!1;let j=As(T,b,()=>M=null,()=>y=!0);M&&(j+=ya(j,o,m(M))),y&&M&&(y=!1),S.push(l+j)}let x;if(S.length===0)x=r.start+r.end;else{x=S[0];for(let N=1;N<S.length;++N){const T=S[N];x+=T?`
501
+ ${p}${T}`:`
502
+ `}}return i?(x+=`
503
+ `+ci(m(i),p),h&&h()):y&&c&&c(),x}function Qw({items:i},t,{flowChars:a,itemIndent:l}){const{indent:r,indentStep:o,flowCollectionPadding:c,options:{commentString:h}}=t;l+=o;const p=Object.assign({},t,{indent:l,inFlow:!0,type:null});let m=!1,b=0;const y=[];for(let N=0;N<i.length;++N){const T=i[N];let M=null;if(ct(T))T.spaceBefore&&y.push(""),Gu(t,y,T.commentBefore,!1),T.comment&&(M=T.comment);else if(ft(T)){const Y=ct(T.key)?T.key:null;Y&&(Y.spaceBefore&&y.push(""),Gu(t,y,Y.commentBefore,!1),Y.comment&&(m=!0));const H=ct(T.value)?T.value:null;H?(H.comment&&(M=H.comment),H.commentBefore&&(m=!0)):T.value==null&&(Y!=null&&Y.comment)&&(M=Y.comment)}M&&(m=!0);let j=As(T,p,()=>M=null);N<i.length-1&&(j+=","),M&&(j+=ya(j,l,h(M))),!m&&(y.length>b||j.includes(`
504
+ `))&&(m=!0),y.push(j),b=y.length}const{start:S,end:x}=a;if(y.length===0)return S+x;if(!m){const N=y.reduce((T,M)=>T+M.length+2,2);m=t.options.lineWidth>0&&N>t.options.lineWidth}if(m){let N=S;for(const T of y)N+=T?`
505
+ ${o}${r}${T}`:`
506
+ `;return`${N}
507
+ ${r}${x}`}else return`${S}${c}${y.join(" ")}${c}${x}`}function Gu({indent:i,options:{commentString:t}},a,l,r){if(l&&r&&(l=l.replace(/^\n+/,"")),l){const o=ci(t(l),i);a.push(o.trimStart())}}function ba(i,t){const a=Pe(t)?t.value:t;for(const l of i)if(ft(l)&&(l.key===t||l.key===a||Pe(l.key)&&l.key.value===a))return l}class gn extends Tb{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Gi,t),this.items=[]}static from(t,a,l){const{keepUndefined:r,replacer:o}=l,c=new this(t),h=(p,m)=>{if(typeof o=="function")m=o.call(a,p,m);else if(Array.isArray(o)&&!o.includes(p))return;(m!==void 0||r)&&c.items.push(Td(p,m,l))};if(a instanceof Map)for(const[p,m]of a)h(p,m);else if(a&&typeof a=="object")for(const p of Object.keys(a))h(p,a[p]);return typeof t.sortMapEntries=="function"&&c.items.sort(t.sortMapEntries),c}add(t,a){var c;let l;ft(t)?l=t:!t||typeof t!="object"||!("key"in t)?l=new Rt(t,t==null?void 0:t.value):l=new Rt(t.key,t.value);const r=ba(this.items,l.key),o=(c=this.schema)==null?void 0:c.sortMapEntries;if(r){if(!a)throw new Error(`Key ${l.key} already set`);Pe(r.value)&&_b(l.value)?r.value.value=l.value:r.value=l.value}else if(o){const h=this.items.findIndex(p=>o(l,p)<0);h===-1?this.items.push(l):this.items.splice(h,0,l)}else this.items.push(l)}delete(t){const a=ba(this.items,t);return a?this.items.splice(this.items.indexOf(a),1).length>0:!1}get(t,a){const l=ba(this.items,t),r=l==null?void 0:l.value;return(!a&&Pe(r)?r.value:r)??void 0}has(t){return!!ba(this.items,t)}set(t,a){this.add(new Rt(t,a),!0)}toJSON(t,a,l){const r=l?new l:a!=null&&a.mapAsMap?new Map:{};a!=null&&a.onCreate&&a.onCreate(r);for(const o of this.items)Ob(a,r,o);return r}toString(t,a,l){if(!t)return JSON.stringify(this);for(const r of this.items)if(!ft(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),jb(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:l,onComment:a})}}const js={collection:"map",default:!0,nodeClass:gn,tag:"tag:yaml.org,2002:map",resolve(i,t){return Yl(i)||t("Expected a mapping for this tag"),i},createNode:(i,t,a)=>gn.from(i,t,a)};class _a extends Tb{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Cs,t),this.items=[]}add(t){this.items.push(t)}delete(t){const a=pu(t);return typeof a!="number"?!1:this.items.splice(a,1).length>0}get(t,a){const l=pu(t);if(typeof l!="number")return;const r=this.items[l];return!a&&Pe(r)?r.value:r}has(t){const a=pu(t);return typeof a=="number"&&a<this.items.length}set(t,a){const l=pu(t);if(typeof l!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[l];Pe(r)&&_b(a)?r.value=a:this.items[l]=a}toJSON(t,a){const l=[];a!=null&&a.onCreate&&a.onCreate(l);let r=0;for(const o of this.items)l.push(yn(o,String(r++),a));return l}toString(t,a,l){return t?jb(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:l,onComment:a}):JSON.stringify(this)}static from(t,a,l){const{replacer:r}=l,o=new this(t);if(a&&Symbol.iterator in Object(a)){let c=0;for(let h of a){if(typeof r=="function"){const p=a instanceof Set?h:String(c++);h=r.call(a,p,h)}o.items.push(Il(h,void 0,l))}}return o}}function pu(i){let t=Pe(i)?i.value:i;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Ms={collection:"seq",default:!0,nodeClass:_a,tag:"tag:yaml.org,2002:seq",resolve(i,t){return Gl(i)||t("Expected a sequence for this tag"),i},createNode:(i,t,a)=>_a.from(i,t,a)},Ju={identify:i=>typeof i=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i=>i,stringify(i,t,a,l){return t=Object.assign({actualString:!0},t),_d(i,t,a,l)}},Wu={identify:i=>i==null,createNode:()=>new Te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Te(null),stringify:({source:i},t)=>typeof i=="string"&&Wu.test.test(i)?i:t.options.nullStr},Ad={identify:i=>typeof i=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:i=>new Te(i[0]==="t"||i[0]==="T"),stringify({source:i,value:t},a){if(i&&Ad.test.test(i)){const l=i[0]==="t"||i[0]==="T";if(t===l)return i}return t?a.options.trueStr:a.options.falseStr}};function Cn({format:i,minFractionDigits:t,tag:a,value:l}){if(typeof l=="bigint")return String(l);const r=typeof l=="number"?l:Number(l);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let o=Object.is(l,-0)?"-0":JSON.stringify(l);if(!i&&t&&(!a||a==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let c=o.indexOf(".");c<0&&(c=o.length,o+=".");let h=t-(o.length-c-1);for(;h-- >0;)o+="0"}return o}const Mb={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:i=>i.slice(-3).toLowerCase()==="nan"?NaN:i[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Cn},Db={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:i=>parseFloat(i),stringify(i){const t=Number(i.value);return isFinite(t)?t.toExponential():Cn(i)}},zb={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(i){const t=new Te(parseFloat(i)),a=i.indexOf(".");return a!==-1&&i[i.length-1]==="0"&&(t.minFractionDigits=i.length-a-1),t},stringify:Cn},Pu=i=>typeof i=="bigint"||Number.isInteger(i),Ed=(i,t,a,{intAsBigInt:l})=>l?BigInt(i):parseInt(i.substring(t),a);function Rb(i,t,a){const{value:l}=i;return Pu(l)&&l>=0?a+l.toString(t):Cn(i)}const Lb={identify:i=>Pu(i)&&i>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(i,t,a)=>Ed(i,2,8,a),stringify:i=>Rb(i,8,"0o")},Bb={identify:Pu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(i,t,a)=>Ed(i,0,10,a),stringify:Cn},qb={identify:i=>Pu(i)&&i>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(i,t,a)=>Ed(i,2,16,a),stringify:i=>Rb(i,16,"0x")},Xw=[js,Ms,Ju,Wu,Ad,Lb,Bb,qb,Mb,Db,zb];function _y(i){return typeof i=="bigint"||Number.isInteger(i)}const gu=({value:i})=>JSON.stringify(i),Fw=[{identify:i=>typeof i=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:i=>i,stringify:gu},{identify:i=>i==null,createNode:()=>new Te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:gu},{identify:i=>typeof i=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:i=>i==="true",stringify:gu},{identify:_y,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(i,t,{intAsBigInt:a})=>a?BigInt(i):parseInt(i,10),stringify:({value:i})=>_y(i)?i.toString():JSON.stringify(i)},{identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:i=>parseFloat(i),stringify:gu}],Jw={default:!0,tag:"",test:/^/,resolve(i,t){return t(`Unresolved plain scalar ${JSON.stringify(i)}`),i}},Ww=[js,Ms].concat(Fw,Jw),Nd={identify:i=>i instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(i,t){if(typeof atob=="function"){const a=atob(i.replace(/[\n\r]/g,"")),l=new Uint8Array(a.length);for(let r=0;r<a.length;++r)l[r]=a.charCodeAt(r);return l}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),i},stringify({comment:i,type:t,value:a},l,r,o){if(!a)return"";const c=a;let h;if(typeof btoa=="function"){let p="";for(let m=0;m<c.length;++m)p+=String.fromCharCode(c[m]);h=btoa(p)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Te.BLOCK_LITERAL),t!==Te.QUOTE_DOUBLE){const p=Math.max(l.options.lineWidth-l.indent.length,l.options.minContentWidth),m=Math.ceil(h.length/p),b=new Array(m);for(let y=0,S=0;y<m;++y,S+=p)b[y]=h.substr(S,p);h=b.join(t===Te.BLOCK_LITERAL?`
508
+ `:" ")}return _d({comment:i,type:t,value:h},l,r,o)}};function Ub(i,t){if(Gl(i))for(let a=0;a<i.items.length;++a){let l=i.items[a];if(!ft(l)){if(Yl(l)){l.items.length>1&&t("Each pair must have its own sequence indicator");const r=l.items[0]||new Rt(new Te(null));if(l.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${l.commentBefore}
509
+ ${r.key.commentBefore}`:l.commentBefore),l.comment){const o=r.value??r.key;o.comment=o.comment?`${l.comment}
510
+ ${o.comment}`:l.comment}l=r}i.items[a]=ft(l)?l:new Rt(l)}}else t("Expected a sequence for this tag");return i}function Ib(i,t,a){const{replacer:l}=a,r=new _a(i);r.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let c of t){typeof l=="function"&&(c=l.call(t,String(o++),c));let h,p;if(Array.isArray(c))if(c.length===2)h=c[0],p=c[1];else throw new TypeError(`Expected [key, value] tuple: ${c}`);else if(c&&c instanceof Object){const m=Object.keys(c);if(m.length===1)h=m[0],p=c[h];else throw new TypeError(`Expected tuple with one key, not ${m.length} keys`)}else h=c;r.items.push(Td(h,p,a))}return r}const Cd={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Ub,createNode:Ib};class ks extends _a{constructor(){super(),this.add=gn.prototype.add.bind(this),this.delete=gn.prototype.delete.bind(this),this.get=gn.prototype.get.bind(this),this.has=gn.prototype.has.bind(this),this.set=gn.prototype.set.bind(this),this.tag=ks.tag}toJSON(t,a){if(!a)return super.toJSON(t);const l=new Map;a!=null&&a.onCreate&&a.onCreate(l);for(const r of this.items){let o,c;if(ft(r)?(o=yn(r.key,"",a),c=yn(r.value,o,a)):o=yn(r,"",a),l.has(o))throw new Error("Ordered maps must not include duplicate keys");l.set(o,c)}return l}static from(t,a,l){const r=Ib(t,a,l),o=new this;return o.items=r.items,o}}ks.tag="tag:yaml.org,2002:omap";const Od={collection:"seq",identify:i=>i instanceof Map,nodeClass:ks,default:!1,tag:"tag:yaml.org,2002:omap",resolve(i,t){const a=Ub(i,t),l=[];for(const{key:r}of a.items)Pe(r)&&(l.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):l.push(r.value));return Object.assign(new ks,a)},createNode:(i,t,a)=>ks.from(i,t,a)};function Hb({value:i,source:t},a){return t&&(i?Vb:Yb).test.test(t)?t:i?a.options.trueStr:a.options.falseStr}const Vb={identify:i=>i===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Te(!0),stringify:Hb},Yb={identify:i=>i===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Te(!1),stringify:Hb},Pw={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:i=>i.slice(-3).toLowerCase()==="nan"?NaN:i[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Cn},e_={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:i=>parseFloat(i.replace(/_/g,"")),stringify(i){const t=Number(i.value);return isFinite(t)?t.toExponential():Cn(i)}},t_={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(i){const t=new Te(parseFloat(i.replace(/_/g,""))),a=i.indexOf(".");if(a!==-1){const l=i.substring(a+1).replace(/_/g,"");l[l.length-1]==="0"&&(t.minFractionDigits=l.length)}return t},stringify:Cn},$l=i=>typeof i=="bigint"||Number.isInteger(i);function eo(i,t,a,{intAsBigInt:l}){const r=i[0];if((r==="-"||r==="+")&&(t+=1),i=i.substring(t).replace(/_/g,""),l){switch(a){case 2:i=`0b${i}`;break;case 8:i=`0o${i}`;break;case 16:i=`0x${i}`;break}const c=BigInt(i);return r==="-"?BigInt(-1)*c:c}const o=parseInt(i,a);return r==="-"?-1*o:o}function jd(i,t,a){const{value:l}=i;if($l(l)){const r=l.toString(t);return l<0?"-"+a+r.substr(1):a+r}return Cn(i)}const n_={identify:$l,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(i,t,a)=>eo(i,2,2,a),stringify:i=>jd(i,2,"0b")},i_={identify:$l,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(i,t,a)=>eo(i,1,8,a),stringify:i=>jd(i,8,"0")},a_={identify:$l,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(i,t,a)=>eo(i,0,10,a),stringify:Cn},s_={identify:$l,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(i,t,a)=>eo(i,2,16,a),stringify:i=>jd(i,16,"0x")};class ws extends gn{constructor(t){super(t),this.tag=ws.tag}add(t){let a;ft(t)?a=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?a=new Rt(t.key,null):a=new Rt(t,null),ba(this.items,a.key)||this.items.push(a)}get(t,a){const l=ba(this.items,t);return!a&&ft(l)?Pe(l.key)?l.key.value:l.key:l}set(t,a){if(typeof a!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof a}`);const l=ba(this.items,t);l&&!a?this.items.splice(this.items.indexOf(l),1):!l&&a&&this.items.push(new Rt(t))}toJSON(t,a){return super.toJSON(t,a,Set)}toString(t,a,l){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),a,l);throw new Error("Set items must all have null values")}static from(t,a,l){const{replacer:r}=l,o=new this(t);if(a&&Symbol.iterator in Object(a))for(let c of a)typeof r=="function"&&(c=r.call(a,c,c)),o.items.push(Td(c,null,l));return o}}ws.tag="tag:yaml.org,2002:set";const Md={collection:"map",identify:i=>i instanceof Set,nodeClass:ws,default:!1,tag:"tag:yaml.org,2002:set",createNode:(i,t,a)=>ws.from(i,t,a),resolve(i,t){if(Yl(i)){if(i.hasAllNullValues(!0))return Object.assign(new ws,i);t("Set items must all have null values")}else t("Expected a mapping for this tag");return i}};function Dd(i,t){const a=i[0],l=a==="-"||a==="+"?i.substring(1):i,r=c=>t?BigInt(c):Number(c),o=l.replace(/_/g,"").split(":").reduce((c,h)=>c*r(60)+r(h),r(0));return a==="-"?r(-1)*o:o}function Gb(i){let{value:t}=i,a=c=>c;if(typeof t=="bigint")a=c=>BigInt(c);else if(isNaN(t)||!isFinite(t))return Cn(i);let l="";t<0&&(l="-",t*=a(-1));const r=a(60),o=[t%r];return t<60?o.unshift(0):(t=(t-o[0])/r,o.unshift(t%r),t>=60&&(t=(t-o[0])/r,o.unshift(t))),l+o.map(c=>String(c).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const $b={identify:i=>typeof i=="bigint"||Number.isInteger(i),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(i,t,{intAsBigInt:a})=>Dd(i,a),stringify:Gb},Kb={identify:i=>typeof i=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:i=>Dd(i,!1),stringify:Gb},to={identify:i=>i 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(i){const t=i.match(to.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,a,l,r,o,c,h]=t.map(Number),p=t[7]?Number((t[7]+"00").substr(1,3)):0;let m=Date.UTC(a,l-1,r,o||0,c||0,h||0,p);const b=t[8];if(b&&b!=="Z"){let y=Dd(b,!1);Math.abs(y)<30&&(y*=60),m-=6e4*y}return new Date(m)},stringify:({value:i})=>(i==null?void 0:i.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Ty=[js,Ms,Ju,Wu,Vb,Yb,n_,i_,a_,s_,Pw,e_,t_,Nd,di,Od,Cd,Md,$b,Kb,to],Ay=new Map([["core",Xw],["failsafe",[js,Ms,Ju]],["json",Ww],["yaml11",Ty],["yaml-1.1",Ty]]),Ey={binary:Nd,bool:Ad,float:zb,floatExp:Db,floatNaN:Mb,floatTime:Kb,int:Bb,intHex:qb,intOct:Lb,intTime:$b,map:js,merge:di,null:Wu,omap:Od,pairs:Cd,seq:Ms,set:Md,timestamp:to},l_={"tag:yaml.org,2002:binary":Nd,"tag:yaml.org,2002:merge":di,"tag:yaml.org,2002:omap":Od,"tag:yaml.org,2002:pairs":Cd,"tag:yaml.org,2002:set":Md,"tag:yaml.org,2002:timestamp":to};function Uf(i,t,a){const l=Ay.get(t);if(l&&!i)return a&&!l.includes(di)?l.concat(di):l.slice();let r=l;if(!r)if(Array.isArray(i))r=[];else{const o=Array.from(Ay.keys()).filter(c=>c!=="yaml11").map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(i))for(const o of i)r=r.concat(o);else typeof i=="function"&&(r=i(r.slice()));return a&&(r=r.concat(di)),r.reduce((o,c)=>{const h=typeof c=="string"?Ey[c]:c;if(!h){const p=JSON.stringify(c),m=Object.keys(Ey).map(b=>JSON.stringify(b)).join(", ");throw new Error(`Unknown custom tag ${p}; use one of ${m}`)}return o.includes(h)||o.push(h),o},[])}const r_=(i,t)=>i.key<t.key?-1:i.key>t.key?1:0;class zd{constructor({compat:t,customTags:a,merge:l,resolveKnownTags:r,schema:o,sortMapEntries:c,toStringDefaults:h}){this.compat=Array.isArray(t)?Uf(t,"compat"):t?Uf(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=r?l_:{},this.tags=Uf(a,this.name,l),this.toStringOptions=h??null,Object.defineProperty(this,Gi,{value:js}),Object.defineProperty(this,Un,{value:Ju}),Object.defineProperty(this,Cs,{value:Ms}),this.sortMapEntries=typeof c=="function"?c:c===!0?r_:null}clone(){const t=Object.create(zd.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function u_(i,t){var p;const a=[];let l=t.directives===!0;if(t.directives!==!1&&i.directives){const m=i.directives.toString(i);m?(a.push(m),l=!0):i.directives.docStart&&(l=!0)}l&&a.push("---");const r=Eb(i,t),{commentString:o}=r.options;if(i.commentBefore){a.length!==1&&a.unshift("");const m=o(i.commentBefore);a.unshift(ci(m,""))}let c=!1,h=null;if(i.contents){if(ct(i.contents)){if(i.contents.spaceBefore&&l&&a.push(""),i.contents.commentBefore){const y=o(i.contents.commentBefore);a.push(ci(y,""))}r.forceBlockIndent=!!i.comment,h=i.contents.comment}const m=h?void 0:()=>c=!0;let b=As(i.contents,r,()=>h=null,m);h&&(b+=ya(b,"",o(h))),(b[0]==="|"||b[0]===">")&&a[a.length-1]==="---"?a[a.length-1]=`--- ${b}`:a.push(b)}else a.push(As(i.contents,r));if((p=i.directives)!=null&&p.docEnd)if(i.comment){const m=o(i.comment);m.includes(`
511
+ `)?(a.push("..."),a.push(ci(m,""))):a.push(`... ${m}`)}else a.push("...");else{let m=i.comment;m&&c&&(m=m.replace(/^\n+/,"")),m&&((!c||h)&&a[a.length-1]!==""&&a.push(""),a.push(ci(o(m),"")))}return a.join(`
512
+ `)+`
513
+ `}class no{constructor(t,a,l){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,bn,{value:ld});let r=null;typeof a=="function"||Array.isArray(a)?r=a:l===void 0&&a&&(l=a,a=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},l);this.options=o;let{version:c}=o;l!=null&&l._directives?(this.directives=l._directives.atDocument(),this.directives.yaml.explicit&&(c=this.directives.yaml.version)):this.directives=new Dt({version:c}),this.setSchema(c,l),this.contents=t===void 0?null:this.createNode(t,r,l)}clone(){const t=Object.create(no.prototype,{[bn]:{value:ld}});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=ct(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){ms(this.contents)&&this.contents.add(t)}addIn(t,a){ms(this.contents)&&this.contents.addIn(t,a)}createAlias(t,a){if(!t.anchor){const l=kb(this);t.anchor=!a||l.has(a)?wb(a||"a",l):a}return new wd(t.anchor)}createNode(t,a,l){let r;if(typeof a=="function")t=a.call({"":t},"",t),r=a;else if(Array.isArray(a)){const M=Y=>typeof Y=="number"||Y instanceof String||Y instanceof Number,j=a.filter(M).map(String);j.length>0&&(a=a.concat(j)),r=a}else l===void 0&&a&&(l=a,a=void 0);const{aliasDuplicateObjects:o,anchorPrefix:c,flow:h,keepUndefined:p,onTagObj:m,tag:b}=l??{},{onAnchor:y,setAnchors:S,sourceObjects:x}=Lw(this,c||"a"),N={aliasDuplicateObjects:o??!0,keepUndefined:p??!1,onAnchor:y,onTagObj:m,replacer:r,schema:this.schema,sourceObjects:x},T=Il(t,b,N);return h&&ot(T)&&(T.flow=!0),S(),T}createPair(t,a,l={}){const r=this.createNode(t,null,l),o=this.createNode(a,null,l);return new Rt(r,o)}delete(t){return ms(this.contents)?this.contents.delete(t):!1}deleteIn(t){return jl(t)?this.contents==null?!1:(this.contents=null,!0):ms(this.contents)?this.contents.deleteIn(t):!1}get(t,a){return ot(this.contents)?this.contents.get(t,a):void 0}getIn(t,a){return jl(t)?!a&&Pe(this.contents)?this.contents.value:this.contents:ot(this.contents)?this.contents.getIn(t,a):void 0}has(t){return ot(this.contents)?this.contents.has(t):!1}hasIn(t){return jl(t)?this.contents!==void 0:ot(this.contents)?this.contents.hasIn(t):!1}set(t,a){this.contents==null?this.contents=Yu(this.schema,[t],a):ms(this.contents)&&this.contents.set(t,a)}setIn(t,a){jl(t)?this.contents=a:this.contents==null?this.contents=Yu(this.schema,Array.from(t),a):ms(this.contents)&&this.contents.setIn(t,a)}setSchema(t,a={}){typeof t=="number"&&(t=String(t));let l;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Dt({version:"1.1"}),l={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Dt({version:t}),l={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,l=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(a.schema instanceof Object)this.schema=a.schema;else if(l)this.schema=new zd(Object.assign(l,a));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:a,mapAsMap:l,maxAliasCount:r,onAnchor:o,reviver:c}={}){const h={anchors:new Map,doc:this,keep:!t,mapAsMap:l===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},p=yn(this.contents,a??"",h);if(typeof o=="function")for(const{count:m,res:b}of h.anchors.values())o(b,m);return typeof c=="function"?vs(c,{"":p},"",p):p}toJSON(t,a){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:a})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const a=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${a}`)}return u_(this,t)}}function ms(i){if(ot(i))return!0;throw new Error("Expected a YAML collection as document contents")}class Zb extends Error{constructor(t,a,l,r){super(),this.name=t,this.code=l,this.message=r,this.pos=a}}class Ml extends Zb{constructor(t,a,l){super("YAMLParseError",t,a,l)}}class o_ extends Zb{constructor(t,a,l){super("YAMLWarning",t,a,l)}}const Ny=(i,t)=>a=>{if(a.pos[0]===-1)return;a.linePos=a.pos.map(h=>t.linePos(h));const{line:l,col:r}=a.linePos[0];a.message+=` at line ${l}, column ${r}`;let o=r-1,c=i.substring(t.lineStarts[l-1],t.lineStarts[l]).replace(/[\n\r]+$/,"");if(o>=60&&c.length>80){const h=Math.min(o-39,c.length-79);c="…"+c.substring(h),o-=h-1}if(c.length>80&&(c=c.substring(0,79)+"…"),l>1&&/^ *$/.test(c.substring(0,o))){let h=i.substring(t.lineStarts[l-2],t.lineStarts[l-1]);h.length>80&&(h=h.substring(0,79)+`…
514
+ `),c=h+c}if(/[^ ]/.test(c)){let h=1;const p=a.linePos[1];(p==null?void 0:p.line)===l&&p.col>r&&(h=Math.max(1,Math.min(p.col-r,80-o)));const m=" ".repeat(o)+"^".repeat(h);a.message+=`:
515
+
516
+ ${c}
517
+ ${m}
518
+ `}};function Es(i,{flow:t,indicator:a,next:l,offset:r,onError:o,parentIndent:c,startOnNewline:h}){let p=!1,m=h,b=h,y="",S="",x=!1,N=!1,T=null,M=null,j=null,Y=null,H=null,Z=null,te=null;for(const B of i)switch(N&&(B.type!=="space"&&B.type!=="newline"&&B.type!=="comma"&&o(B.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),N=!1),T&&(m&&B.type!=="comment"&&B.type!=="newline"&&o(T,"TAB_AS_INDENT","Tabs are not allowed as indentation"),T=null),B.type){case"space":!t&&(a!=="doc-start"||(l==null?void 0:l.type)!=="flow-collection")&&B.source.includes(" ")&&(T=B),b=!0;break;case"comment":{b||o(B,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const X=B.source.substring(1)||" ";y?y+=S+X:y=X,S="",m=!1;break}case"newline":m?y?y+=B.source:(!Z||a!=="seq-item-ind")&&(p=!0):S+=B.source,m=!0,x=!0,(M||j)&&(Y=B),b=!0;break;case"anchor":M&&o(B,"MULTIPLE_ANCHORS","A node can have at most one anchor"),B.source.endsWith(":")&&o(B.offset+B.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),M=B,te??(te=B.offset),m=!1,b=!1,N=!0;break;case"tag":{j&&o(B,"MULTIPLE_TAGS","A node can have at most one tag"),j=B,te??(te=B.offset),m=!1,b=!1,N=!0;break}case a:(M||j)&&o(B,"BAD_PROP_ORDER",`Anchors and tags must be after the ${B.source} indicator`),Z&&o(B,"UNEXPECTED_TOKEN",`Unexpected ${B.source} in ${t??"collection"}`),Z=B,m=a==="seq-item-ind"||a==="explicit-key-ind",b=!1;break;case"comma":if(t){H&&o(B,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),H=B,m=!1,b=!1;break}default:o(B,"UNEXPECTED_TOKEN",`Unexpected ${B.type} token`),m=!1,b=!1}const q=i[i.length-1],C=q?q.offset+q.source.length:r;return N&&l&&l.type!=="space"&&l.type!=="newline"&&l.type!=="comma"&&(l.type!=="scalar"||l.source!=="")&&o(l.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),T&&(m&&T.indent<=c||(l==null?void 0:l.type)==="block-map"||(l==null?void 0:l.type)==="block-seq")&&o(T,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:H,found:Z,spaceBefore:p,comment:y,hasNewline:x,anchor:M,tag:j,newlineAfterProp:Y,end:C,start:te??C}}function Hl(i){if(!i)return null;switch(i.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(i.source.includes(`
519
+ `))return!0;if(i.end){for(const t of i.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of i.items){for(const a of t.start)if(a.type==="newline")return!0;if(t.sep){for(const a of t.sep)if(a.type==="newline")return!0}if(Hl(t.key)||Hl(t.value))return!0}return!1;default:return!0}}function cd(i,t,a){if((t==null?void 0:t.type)==="flow-collection"){const l=t.end[0];l.indent===i&&(l.source==="]"||l.source==="}")&&Hl(t)&&a(l,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Qb(i,t,a){const{uniqueKeys:l}=i.options;if(l===!1)return!1;const r=typeof l=="function"?l:(o,c)=>o===c||Pe(o)&&Pe(c)&&o.value===c.value;return t.some(o=>r(o.key,a))}const Cy="All mapping items must start at the same column";function c_({composeNode:i,composeEmptyNode:t},a,l,r,o){var b;const c=(o==null?void 0:o.nodeClass)??gn,h=new c(a.schema);a.atRoot&&(a.atRoot=!1);let p=l.offset,m=null;for(const y of l.items){const{start:S,key:x,sep:N,value:T}=y,M=Es(S,{indicator:"explicit-key-ind",next:x??(N==null?void 0:N[0]),offset:p,onError:r,parentIndent:l.indent,startOnNewline:!0}),j=!M.found;if(j){if(x&&(x.type==="block-seq"?r(p,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in x&&x.indent!==l.indent&&r(p,"BAD_INDENT",Cy)),!M.anchor&&!M.tag&&!N){m=M.end,M.comment&&(h.comment?h.comment+=`
520
+ `+M.comment:h.comment=M.comment);continue}(M.newlineAfterProp||Hl(x))&&r(x??S[S.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((b=M.found)==null?void 0:b.indent)!==l.indent&&r(p,"BAD_INDENT",Cy);a.atKey=!0;const Y=M.end,H=x?i(a,x,M,r):t(a,Y,S,null,M,r);a.schema.compat&&cd(l.indent,x,r),a.atKey=!1,Qb(a,h.items,H)&&r(Y,"DUPLICATE_KEY","Map keys must be unique");const Z=Es(N??[],{indicator:"map-value-ind",next:T,offset:H.range[2],onError:r,parentIndent:l.indent,startOnNewline:!x||x.type==="block-scalar"});if(p=Z.end,Z.found){j&&((T==null?void 0:T.type)==="block-map"&&!Z.hasNewline&&r(p,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),a.options.strict&&M.start<Z.found.offset-1024&&r(H.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const te=T?i(a,T,Z,r):t(a,p,N,null,Z,r);a.schema.compat&&cd(l.indent,T,r),p=te.range[2];const q=new Rt(H,te);a.options.keepSourceTokens&&(q.srcToken=y),h.items.push(q)}else{j&&r(H.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),Z.comment&&(H.comment?H.comment+=`
521
+ `+Z.comment:H.comment=Z.comment);const te=new Rt(H);a.options.keepSourceTokens&&(te.srcToken=y),h.items.push(te)}}return m&&m<p&&r(m,"IMPOSSIBLE","Map comment with trailing content"),h.range=[l.offset,p,m??p],h}function f_({composeNode:i,composeEmptyNode:t},a,l,r,o){const c=(o==null?void 0:o.nodeClass)??_a,h=new c(a.schema);a.atRoot&&(a.atRoot=!1),a.atKey&&(a.atKey=!1);let p=l.offset,m=null;for(const{start:b,value:y}of l.items){const S=Es(b,{indicator:"seq-item-ind",next:y,offset:p,onError:r,parentIndent:l.indent,startOnNewline:!0});if(!S.found)if(S.anchor||S.tag||y)(y==null?void 0:y.type)==="block-seq"?r(S.end,"BAD_INDENT","All sequence items must start at the same column"):r(p,"MISSING_CHAR","Sequence item without - indicator");else{m=S.end,S.comment&&(h.comment=S.comment);continue}const x=y?i(a,y,S,r):t(a,S.end,b,null,S,r);a.schema.compat&&cd(l.indent,y,r),p=x.range[2],h.items.push(x)}return h.range=[l.offset,p,m??p],h}function Kl(i,t,a,l){let r="";if(i){let o=!1,c="";for(const h of i){const{source:p,type:m}=h;switch(m){case"space":o=!0;break;case"comment":{a&&!o&&l(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const b=p.substring(1)||" ";r?r+=c+b:r=b,c="";break}case"newline":r&&(c+=p),o=!0;break;default:l(h,"UNEXPECTED_TOKEN",`Unexpected ${m} at node end`)}t+=p.length}}return{comment:r,offset:t}}const If="Block collections are not allowed within flow collections",Hf=i=>i&&(i.type==="block-map"||i.type==="block-seq");function d_({composeNode:i,composeEmptyNode:t},a,l,r,o){var M;const c=l.start.source==="{",h=c?"flow map":"flow sequence",p=(o==null?void 0:o.nodeClass)??(c?gn:_a),m=new p(a.schema);m.flow=!0;const b=a.atRoot;b&&(a.atRoot=!1),a.atKey&&(a.atKey=!1);let y=l.offset+l.start.source.length;for(let j=0;j<l.items.length;++j){const Y=l.items[j],{start:H,key:Z,sep:te,value:q}=Y,C=Es(H,{flow:h,indicator:"explicit-key-ind",next:Z??(te==null?void 0:te[0]),offset:y,onError:r,parentIndent:l.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!te&&!q){j===0&&C.comma?r(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`):j<l.items.length-1&&r(C.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${h}`),C.comment&&(m.comment?m.comment+=`
522
+ `+C.comment:m.comment=C.comment),y=C.end;continue}!c&&a.options.strict&&Hl(Z)&&r(Z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0)C.comma&&r(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`);else if(C.comma||r(C.start,"MISSING_CHAR",`Missing , between ${h} items`),C.comment){let B="";e:for(const X of H)switch(X.type){case"comma":case"space":break;case"comment":B=X.source.substring(1);break e;default:break e}if(B){let X=m.items[m.items.length-1];ft(X)&&(X=X.value??X.key),X.comment?X.comment+=`
523
+ `+B:X.comment=B,C.comment=C.comment.substring(B.length+1)}}if(!c&&!te&&!C.found){const B=q?i(a,q,C,r):t(a,C.end,te,null,C,r);m.items.push(B),y=B.range[2],Hf(q)&&r(B.range,"BLOCK_IN_FLOW",If)}else{a.atKey=!0;const B=C.end,X=Z?i(a,Z,C,r):t(a,B,H,null,C,r);Hf(Z)&&r(X.range,"BLOCK_IN_FLOW",If),a.atKey=!1;const F=Es(te??[],{flow:h,indicator:"map-value-ind",next:q,offset:X.range[2],onError:r,parentIndent:l.indent,startOnNewline:!1});if(F.found){if(!c&&!C.found&&a.options.strict){if(te)for(const pe of te){if(pe===F.found)break;if(pe.type==="newline"){r(pe,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}C.start<F.found.offset-1024&&r(F.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else q&&("source"in q&&((M=q.source)==null?void 0:M[0])===":"?r(q,"MISSING_CHAR",`Missing space after : in ${h}`):r(F.start,"MISSING_CHAR",`Missing , or : between ${h} items`));const P=q?i(a,q,F,r):F.found?t(a,F.end,te,null,F,r):null;P?Hf(q)&&r(P.range,"BLOCK_IN_FLOW",If):F.comment&&(X.comment?X.comment+=`
524
+ `+F.comment:X.comment=F.comment);const ne=new Rt(X,P);if(a.options.keepSourceTokens&&(ne.srcToken=Y),c){const pe=m;Qb(a,pe.items,X)&&r(B,"DUPLICATE_KEY","Map keys must be unique"),pe.items.push(ne)}else{const pe=new gn(a.schema);pe.flow=!0,pe.items.push(ne);const Ae=(P??X).range;pe.range=[X.range[0],Ae[1],Ae[2]],m.items.push(pe)}y=P?P.range[2]:F.end}}const S=c?"}":"]",[x,...N]=l.end;let T=y;if((x==null?void 0:x.source)===S)T=x.offset+x.source.length;else{const j=h[0].toUpperCase()+h.substring(1),Y=b?`${j} must end with a ${S}`:`${j} in block collection must be sufficiently indented and end with a ${S}`;r(y,b?"MISSING_CHAR":"BAD_INDENT",Y),x&&x.source.length!==1&&N.unshift(x)}if(N.length>0){const j=Kl(N,T,a.options.strict,r);j.comment&&(m.comment?m.comment+=`
525
+ `+j.comment:m.comment=j.comment),m.range=[l.offset,T,j.offset]}else m.range=[l.offset,T,T];return m}function Vf(i,t,a,l,r,o){const c=a.type==="block-map"?c_(i,t,a,l,o):a.type==="block-seq"?f_(i,t,a,l,o):d_(i,t,a,l,o),h=c.constructor;return r==="!"||r===h.tagName?(c.tag=h.tagName,c):(r&&(c.tag=r),c)}function h_(i,t,a,l,r){var S;const o=l.tag,c=o?t.directives.tagName(o.source,x=>r(o,"TAG_RESOLVE_FAILED",x)):null;if(a.type==="block-seq"){const{anchor:x,newlineAfterProp:N}=l,T=x&&o?x.offset>o.offset?x:o:x??o;T&&(!N||N.offset<T.offset)&&r(T,"MISSING_CHAR","Missing newline after block sequence props")}const h=a.type==="block-map"?"map":a.type==="block-seq"?"seq":a.start.source==="{"?"map":"seq";if(!o||!c||c==="!"||c===gn.tagName&&h==="map"||c===_a.tagName&&h==="seq")return Vf(i,t,a,r,c);let p=t.schema.tags.find(x=>x.tag===c&&x.collection===h);if(!p){const x=t.schema.knownTags[c];if((x==null?void 0:x.collection)===h)t.schema.tags.push(Object.assign({},x,{default:!1})),p=x;else return x?r(o,"BAD_COLLECTION_TYPE",`${x.tag} used for ${h} collection, but expects ${x.collection??"scalar"}`,!0):r(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,!0),Vf(i,t,a,r,c)}const m=Vf(i,t,a,r,c,p),b=((S=p.resolve)==null?void 0:S.call(p,m,x=>r(o,"TAG_RESOLVE_FAILED",x),t.options))??m,y=ct(b)?b:new Te(b);return y.range=m.range,y.tag=c,p!=null&&p.format&&(y.format=p.format),y}function m_(i,t,a){const l=t.offset,r=p_(t,i.options.strict,a);if(!r)return{value:"",type:null,comment:"",range:[l,l,l]};const o=r.mode===">"?Te.BLOCK_FOLDED:Te.BLOCK_LITERAL,c=t.source?g_(t.source):[];let h=c.length;for(let T=c.length-1;T>=0;--T){const M=c[T][1];if(M===""||M==="\r")h=T;else break}if(h===0){const T=r.chomp==="+"&&c.length>0?`
526
+ `.repeat(Math.max(1,c.length-1)):"";let M=l+r.length;return t.source&&(M+=t.source.length),{value:T,type:o,comment:r.comment,range:[l,M,M]}}let p=t.indent+r.indent,m=t.offset+r.length,b=0;for(let T=0;T<h;++T){const[M,j]=c[T];if(j===""||j==="\r")r.indent===0&&M.length>p&&(p=M.length);else{M.length<p&&a(m+M.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(p=M.length),b=T,p===0&&!i.atRoot&&a(m,"BAD_INDENT","Block scalar values in collections must be indented");break}m+=M.length+j.length+1}for(let T=c.length-1;T>=h;--T)c[T][0].length>p&&(h=T+1);let y="",S="",x=!1;for(let T=0;T<b;++T)y+=c[T][0].slice(p)+`
527
+ `;for(let T=b;T<h;++T){let[M,j]=c[T];m+=M.length+j.length+1;const Y=j[j.length-1]==="\r";if(Y&&(j=j.slice(0,-1)),j&&M.length<p){const Z=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;a(m-j.length-(Y?2:1),"BAD_INDENT",Z),M=""}o===Te.BLOCK_LITERAL?(y+=S+M.slice(p)+j,S=`
528
+ `):M.length>p||j[0]===" "?(S===" "?S=`
529
+ `:!x&&S===`
530
+ `&&(S=`
531
+
532
+ `),y+=S+M.slice(p)+j,S=`
533
+ `,x=!0):j===""?S===`
534
+ `?y+=`
535
+ `:S=`
536
+ `:(y+=S+j,S=" ",x=!1)}switch(r.chomp){case"-":break;case"+":for(let T=h;T<c.length;++T)y+=`
537
+ `+c[T][0].slice(p);y[y.length-1]!==`
538
+ `&&(y+=`
539
+ `);break;default:y+=`
540
+ `}const N=l+r.length+t.source.length;return{value:y,type:o,comment:r.comment,range:[l,N,N]}}function p_({offset:i,props:t},a,l){if(t[0].type!=="block-scalar-header")return l(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],o=r[0];let c=0,h="",p=-1;for(let S=1;S<r.length;++S){const x=r[S];if(!h&&(x==="-"||x==="+"))h=x;else{const N=Number(x);!c&&N?c=N:p===-1&&(p=i+S)}}p!==-1&&l(p,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let m=!1,b="",y=r.length;for(let S=1;S<t.length;++S){const x=t[S];switch(x.type){case"space":m=!0;case"newline":y+=x.source.length;break;case"comment":a&&!m&&l(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),y+=x.source.length,b=x.source.substring(1);break;case"error":l(x,"UNEXPECTED_TOKEN",x.message),y+=x.source.length;break;default:{const N=`Unexpected token in block scalar header: ${x.type}`;l(x,"UNEXPECTED_TOKEN",N);const T=x.source;T&&typeof T=="string"&&(y+=T.length)}}}return{mode:o,indent:c,chomp:h,comment:b,length:y}}function g_(i){const t=i.split(/\n( *)/),a=t[0],l=a.match(/^( *)/),o=[l!=null&&l[1]?[l[1],a.slice(l[1].length)]:["",a]];for(let c=1;c<t.length;c+=2)o.push([t[c],t[c+1]]);return o}function y_(i,t,a){const{offset:l,type:r,source:o,end:c}=i;let h,p;const m=(S,x,N)=>a(l+S,x,N);switch(r){case"scalar":h=Te.PLAIN,p=b_(o,m);break;case"single-quoted-scalar":h=Te.QUOTE_SINGLE,p=v_(o,m);break;case"double-quoted-scalar":h=Te.QUOTE_DOUBLE,p=x_(o,m);break;default:return a(i,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[l,l+o.length,l+o.length]}}const b=l+o.length,y=Kl(c,b,t,a);return{value:p,type:h,comment:y.comment,range:[l,b,y.offset]}}function b_(i,t){let a="";switch(i[0]){case" ":a="a tab character";break;case",":a="flow indicator character ,";break;case"%":a="directive indicator character %";break;case"|":case">":{a=`block scalar indicator ${i[0]}`;break}case"@":case"`":{a=`reserved character ${i[0]}`;break}}return a&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${a}`),Xb(i)}function v_(i,t){return(i[i.length-1]!=="'"||i.length===1)&&t(i.length,"MISSING_CHAR","Missing closing 'quote"),Xb(i.slice(1,-1)).replace(/''/g,"'")}function Xb(i){let t,a;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
541
+ `,"sy"),a=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
542
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,a=/[ \t]*(.*?)[ \t]*\r?\n/sy}let l=t.exec(i);if(!l)return i;let r=l[1],o=" ",c=t.lastIndex;for(a.lastIndex=c;l=a.exec(i);)l[1]===""?o===`
543
+ `?r+=o:o=`
544
+ `:(r+=o+l[1],o=" "),c=a.lastIndex;const h=/[ \t]*(.*)/sy;return h.lastIndex=c,l=h.exec(i),r+o+((l==null?void 0:l[1])??"")}function x_(i,t){let a="";for(let l=1;l<i.length-1;++l){const r=i[l];if(!(r==="\r"&&i[l+1]===`
545
+ `))if(r===`
546
+ `){const{fold:o,offset:c}=S_(i,l);a+=o,l=c}else if(r==="\\"){let o=i[++l];const c=k_[o];if(c)a+=c;else if(o===`
547
+ `)for(o=i[l+1];o===" "||o===" ";)o=i[++l+1];else if(o==="\r"&&i[l+1]===`
548
+ `)for(o=i[++l+1];o===" "||o===" ";)o=i[++l+1];else if(o==="x"||o==="u"||o==="U"){const h={x:2,u:4,U:8}[o];a+=w_(i,l+1,h,t),l+=h}else{const h=i.substr(l-1,2);t(l-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),a+=h}}else if(r===" "||r===" "){const o=l;let c=i[l+1];for(;c===" "||c===" ";)c=i[++l+1];c!==`
549
+ `&&!(c==="\r"&&i[l+2]===`
550
+ `)&&(a+=l>o?i.slice(o,l+1):r)}else a+=r}return(i[i.length-1]!=='"'||i.length===1)&&t(i.length,"MISSING_CHAR",'Missing closing "quote'),a}function S_(i,t){let a="",l=i[t+1];for(;(l===" "||l===" "||l===`
551
+ `||l==="\r")&&!(l==="\r"&&i[t+2]!==`
552
+ `);)l===`
553
+ `&&(a+=`
554
+ `),t+=1,l=i[t+1];return a||(a=" "),{fold:a,offset:t}}const k_={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
555
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function w_(i,t,a,l){const r=i.substr(t,a),c=r.length===a&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(c)){const h=i.substr(t-2,a+2);return l(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),h}return String.fromCodePoint(c)}function Fb(i,t,a,l){const{value:r,type:o,comment:c,range:h}=t.type==="block-scalar"?m_(i,t,l):y_(t,i.options.strict,l),p=a?i.directives.tagName(a.source,y=>l(a,"TAG_RESOLVE_FAILED",y)):null;let m;i.options.stringKeys&&i.atKey?m=i.schema[Un]:p?m=__(i.schema,r,p,a,l):t.type==="scalar"?m=T_(i,r,t,l):m=i.schema[Un];let b;try{const y=m.resolve(r,S=>l(a??t,"TAG_RESOLVE_FAILED",S),i.options);b=Pe(y)?y:new Te(y)}catch(y){const S=y instanceof Error?y.message:String(y);l(a??t,"TAG_RESOLVE_FAILED",S),b=new Te(r)}return b.range=h,b.source=r,o&&(b.type=o),p&&(b.tag=p),m.format&&(b.format=m.format),c&&(b.comment=c),b}function __(i,t,a,l,r){var h;if(a==="!")return i[Un];const o=[];for(const p of i.tags)if(!p.collection&&p.tag===a)if(p.default&&p.test)o.push(p);else return p;for(const p of o)if((h=p.test)!=null&&h.test(t))return p;const c=i.knownTags[a];return c&&!c.collection?(i.tags.push(Object.assign({},c,{default:!1,test:void 0})),c):(r(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,a!=="tag:yaml.org,2002:str"),i[Un])}function T_({atKey:i,directives:t,schema:a},l,r,o){const c=a.tags.find(h=>{var p;return(h.default===!0||i&&h.default==="key")&&((p=h.test)==null?void 0:p.test(l))})||a[Un];if(a.compat){const h=a.compat.find(p=>{var m;return p.default&&((m=p.test)==null?void 0:m.test(l))})??a[Un];if(c.tag!==h.tag){const p=t.tagString(c.tag),m=t.tagString(h.tag),b=`Value may be parsed as either ${p} or ${m}`;o(r,"TAG_RESOLVE_FAILED",b,!0)}}return c}function A_(i,t,a){if(t){a??(a=t.length);for(let l=a-1;l>=0;--l){let r=t[l];switch(r.type){case"space":case"comment":case"newline":i-=r.source.length;continue}for(r=t[++l];(r==null?void 0:r.type)==="space";)i+=r.source.length,r=t[++l];break}}return i}const E_={composeNode:Jb,composeEmptyNode:Rd};function Jb(i,t,a,l){const r=i.atKey,{spaceBefore:o,comment:c,anchor:h,tag:p}=a;let m,b=!0;switch(t.type){case"alias":m=N_(i,t,l),(h||p)&&l(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":m=Fb(i,t,p,l),h&&(m.anchor=h.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":m=h_(E_,i,t,a,l),h&&(m.anchor=h.source.substring(1));break;default:{const y=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;l(t,"UNEXPECTED_TOKEN",y),m=Rd(i,t.offset,void 0,null,a,l),b=!1}}return h&&m.anchor===""&&l(h,"BAD_ALIAS","Anchor cannot be an empty string"),r&&i.options.stringKeys&&(!Pe(m)||typeof m.value!="string"||m.tag&&m.tag!=="tag:yaml.org,2002:str")&&l(p??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(m.spaceBefore=!0),c&&(t.type==="scalar"&&t.source===""?m.comment=c:m.commentBefore=c),i.options.keepSourceTokens&&b&&(m.srcToken=t),m}function Rd(i,t,a,l,{spaceBefore:r,comment:o,anchor:c,tag:h,end:p},m){const b={type:"scalar",offset:A_(t,a,l),indent:-1,source:""},y=Fb(i,b,h,m);return c&&(y.anchor=c.source.substring(1),y.anchor===""&&m(c,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(y.spaceBefore=!0),o&&(y.comment=o,y.range[2]=p),y}function N_({options:i},{offset:t,source:a,end:l},r){const o=new wd(a.substring(1));o.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&r(t+a.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const c=t+a.length,h=Kl(l,c,i.strict,r);return o.range=[t,c,h.offset],h.comment&&(o.comment=h.comment),o}function C_(i,t,{offset:a,start:l,value:r,end:o},c){const h=Object.assign({_directives:t},i),p=new no(void 0,h),m={atKey:!1,atRoot:!0,directives:p.directives,options:p.options,schema:p.schema},b=Es(l,{indicator:"doc-start",next:r??(o==null?void 0:o[0]),offset:a,onError:c,parentIndent:0,startOnNewline:!0});b.found&&(p.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!b.hasNewline&&c(b.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),p.contents=r?Jb(m,r,b,c):Rd(m,b.end,l,null,b,c);const y=p.contents.range[2],S=Kl(o,y,!1,c);return S.comment&&(p.comment=S.comment),p.range=[a,y,S.offset],p}function Nl(i){if(typeof i=="number")return[i,i+1];if(Array.isArray(i))return i.length===2?i:[i[0],i[1]];const{offset:t,source:a}=i;return[t,t+(typeof a=="string"?a.length:1)]}function Oy(i){var r;let t="",a=!1,l=!1;for(let o=0;o<i.length;++o){const c=i[o];switch(c[0]){case"#":t+=(t===""?"":l?`
556
+
557
+ `:`
558
+ `)+(c.substring(1)||" "),a=!0,l=!1;break;case"%":((r=i[o+1])==null?void 0:r[0])!=="#"&&(o+=1),a=!1;break;default:a||(l=!0),a=!1}}return{comment:t,afterEmptyLine:l}}class O_{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(a,l,r,o)=>{const c=Nl(a);o?this.warnings.push(new o_(c,l,r)):this.errors.push(new Ml(c,l,r))},this.directives=new Dt({version:t.version||"1.2"}),this.options=t}decorate(t,a){const{comment:l,afterEmptyLine:r}=Oy(this.prelude);if(l){const o=t.contents;if(a)t.comment=t.comment?`${t.comment}
559
+ ${l}`:l;else if(r||t.directives.docStart||!o)t.commentBefore=l;else if(ot(o)&&!o.flow&&o.items.length>0){let c=o.items[0];ft(c)&&(c=c.key);const h=c.commentBefore;c.commentBefore=h?`${l}
560
+ ${h}`:l}else{const c=o.commentBefore;o.commentBefore=c?`${l}
561
+ ${c}`:l}}a?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Oy(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,a=!1,l=-1){for(const r of t)yield*this.next(r);yield*this.end(a,l)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(a,l,r)=>{const o=Nl(t);o[0]+=a,this.onError(o,"BAD_DIRECTIVE",l,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const a=C_(this.options,this.directives,t,this.onError);this.atDirectives&&!a.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(a,!1),this.doc&&(yield this.doc),this.doc=a,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const a=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,l=new Ml(Nl(t),"UNEXPECTED_TOKEN",a);this.atDirectives||!this.doc?this.errors.push(l):this.doc.errors.push(l);break}case"doc-end":{if(!this.doc){const l="Unexpected doc-end without preceding document";this.errors.push(new Ml(Nl(t),"UNEXPECTED_TOKEN",l));break}this.doc.directives.docEnd=!0;const a=Kl(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),a.comment){const l=this.doc.comment;this.doc.comment=l?`${l}
562
+ ${a.comment}`:a.comment}this.doc.range[2]=a.offset;break}default:this.errors.push(new Ml(Nl(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,a=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const l=Object.assign({_directives:this.directives},this.options),r=new no(void 0,l);this.atDirectives&&this.onError(a,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,a,a],this.decorate(r,!1),yield r}}}const Wb="\uFEFF",Pb="",ev="",fd="";function j_(i){switch(i){case Wb:return"byte-order-mark";case Pb:return"doc-mode";case ev:return"flow-error-end";case fd:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
563
+ `:case`\r
564
+ `: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(i[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 Tn(i){switch(i){case void 0:case" ":case`
565
+ `:case"\r":case" ":return!0;default:return!1}}const jy=new Set("0123456789ABCDEFabcdef"),M_=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),yu=new Set(",[]{}"),D_=new Set(` ,[]{}
566
+ \r `),Yf=i=>!i||D_.has(i);class z_{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(t,a=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!a;let l=this.next??"stream";for(;l&&(a||this.hasChars(1));)l=yield*this.parseNext(l)}atLineEnd(){let t=this.pos,a=this.buffer[t];for(;a===" "||a===" ";)a=this.buffer[++t];return!a||a==="#"||a===`
567
+ `?!0:a==="\r"?this.buffer[t+1]===`
568
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let a=this.buffer[t];if(this.indentNext>0){let l=0;for(;a===" ";)a=this.buffer[++l+t];if(a==="\r"){const r=this.buffer[l+t+1];if(r===`
569
+ `||!r&&!this.atEnd)return t+l+1}return a===`
570
+ `||l>=this.indentNext||!a&&!this.atEnd?t+l:-1}if(a==="-"||a==="."){const l=this.buffer.substr(t,3);if((l==="---"||l==="...")&&Tn(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
571
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){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 t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===Wb&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let a=t.length,l=t.indexOf("#");for(;l!==-1;){const o=t[l-1];if(o===" "||o===" "){a=l-1;break}else l=t.indexOf("#",l+1)}for(;;){const o=t[a-1];if(o===" "||o===" ")a-=1;else break}const r=(yield*this.pushCount(a))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const a=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-a),yield*this.pushNewline(),"stream"}return yield Pb,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const a=this.peek(3);if((a==="---"||a==="...")&&Tn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,a==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Tn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,a]=this.peek(2);if(!a&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&Tn(a)){const l=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=l,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let a=yield*this.pushIndicators();switch(t[a]){case"#":yield*this.pushCount(t.length-a);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(Yf),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return a+=yield*this.parseBlockScalarHeader(),a+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-a),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,a,l=-1;do t=yield*this.pushNewline(),t>0?(a=yield*this.pushSpaces(!1),this.indentValue=l=a):a=0,a+=yield*this.pushSpaces(!0);while(t+a>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((l!==-1&&l<this.indentNext&&r[0]!=="#"||l===0&&(r.startsWith("---")||r.startsWith("..."))&&Tn(r[3]))&&!(l===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield ev,yield*this.parseLineStart();let o=0;for(;r[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),r[o]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-o),"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-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Yf),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const c=this.charAt(1);if(this.flowKey||Tn(c)||c===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let a=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;a!==-1&&this.buffer[a+1]==="'";)a=this.buffer.indexOf("'",a+2);else for(;a!==-1;){let o=0;for(;this.buffer[a-1-o]==="\\";)o+=1;if(o%2===0)break;a=this.buffer.indexOf('"',a+1)}const l=this.buffer.substring(0,a);let r=l.indexOf(`
572
+ `,this.pos);if(r!==-1){for(;r!==-1;){const o=this.continueScalar(r+1);if(o===-1)break;r=l.indexOf(`
573
+ `,o)}r!==-1&&(a=r-(l[r-1]==="\r"?2:1))}if(a===-1){if(!this.atEnd)return this.setNext("quoted-scalar");a=this.buffer.length}return yield*this.pushToIndex(a+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const a=this.buffer[++t];if(a==="+")this.blockScalarKeep=!0;else if(a>"0"&&a<="9")this.blockScalarIndent=Number(a)-1;else if(a!=="-")break}return yield*this.pushUntil(a=>Tn(a)||a==="#")}*parseBlockScalar(){let t=this.pos-1,a=0,l;e:for(let o=this.pos;l=this.buffer[o];++o)switch(l){case" ":a+=1;break;case`
574
+ `:t=o,a=0;break;case"\r":{const c=this.buffer[o+1];if(!c&&!this.atEnd)return this.setNext("block-scalar");if(c===`
575
+ `)break}default:break e}if(!l&&!this.atEnd)return this.setNext("block-scalar");if(a>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=a:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(`
576
+ `,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(l=this.buffer[r];l===" ";)l=this.buffer[++r];if(l===" "){for(;l===" "||l===" "||l==="\r"||l===`
577
+ `;)l=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let o=t-1,c=this.buffer[o];c==="\r"&&(c=this.buffer[--o]);const h=o;for(;c===" ";)c=this.buffer[--o];if(c===`
578
+ `&&o>=this.pos&&o+1+a>h)t=o;else break}while(!0);return yield fd,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let a=this.pos-1,l=this.pos-1,r;for(;r=this.buffer[++l];)if(r===":"){const o=this.buffer[l+1];if(Tn(o)||t&&yu.has(o))break;a=l}else if(Tn(r)){let o=this.buffer[l+1];if(r==="\r"&&(o===`
579
+ `?(l+=1,r=`
580
+ `,o=this.buffer[l+1]):a=l),o==="#"||t&&yu.has(o))break;if(r===`
581
+ `){const c=this.continueScalar(l+1);if(c===-1)break;l=Math.max(l,c-2)}}else{if(t&&yu.has(r))break;a=l}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield fd,yield*this.pushToIndex(a+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,a){const l=this.buffer.slice(this.pos,t);return l?(yield l,this.pos+=l.length,l.length):(a&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Yf))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,a=this.charAt(1);if(Tn(a)||t&&yu.has(a))return t?this.flowKey&&(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 t=this.pos+2,a=this.buffer[t];for(;!Tn(a)&&a!==">";)a=this.buffer[++t];return yield*this.pushToIndex(a===">"?t+1:t,!1)}else{let t=this.pos+1,a=this.buffer[t];for(;a;)if(M_.has(a))a=this.buffer[++t];else if(a==="%"&&jy.has(this.buffer[t+1])&&jy.has(this.buffer[t+2]))a=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
582
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
583
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let a=this.pos-1,l;do l=this.buffer[++a];while(l===" "||t&&l===" ");const r=a-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=a),r}*pushUntil(t){let a=this.pos,l=this.buffer[a];for(;!t(l);)l=this.buffer[++a];return yield*this.pushToIndex(a,!1)}}class R_{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let a=0,l=this.lineStarts.length;for(;a<l;){const o=a+l>>1;this.lineStarts[o]<t?a=o+1:l=o}if(this.lineStarts[a]===t)return{line:a+1,col:1};if(a===0)return{line:0,col:t};const r=this.lineStarts[a-1];return{line:a,col:t-r+1}}}}function Yi(i,t){for(let a=0;a<i.length;++a)if(i[a].type===t)return!0;return!1}function My(i){for(let t=0;t<i.length;++t)switch(i[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function tv(i){switch(i==null?void 0:i.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function bu(i){switch(i.type){case"document":return i.start;case"block-map":{const t=i.items[i.items.length-1];return t.sep??t.start}case"block-seq":return i.items[i.items.length-1].start;default:return[]}}function ps(i){var a;if(i.length===0)return[];let t=i.length;e:for(;--t>=0;)switch(i[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((a=i[++t])==null?void 0:a.type)==="space";);return i.splice(t,i.length)}function Dy(i){if(i.start.type==="flow-seq-start")for(const t of i.items)t.sep&&!t.value&&!Yi(t.start,"explicit-key-ind")&&!Yi(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,tv(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)}class L_{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new z_,this.onNewLine=t}*parse(t,a=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const l of this.lexer.lex(t,a))yield*this.next(l);a||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const a=j_(t);if(a)if(a==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=a,yield*this.step(),a){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const l=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:l,source:t}),this.offset+=t.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(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.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(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const a=t??this.stack.pop();if(!a)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield a;else{const l=this.peek(1);switch(a.type==="block-scalar"?a.indent="indent"in l?l.indent:0:a.type==="flow-collection"&&l.type==="document"&&(a.indent=0),a.type==="flow-collection"&&Dy(a),l.type){case"document":l.value=a;break;case"block-scalar":l.props.push(a);break;case"block-map":{const r=l.items[l.items.length-1];if(r.value){l.items.push({start:[],key:a,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=a;else{Object.assign(r,{key:a,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=l.items[l.items.length-1];r.value?l.items.push({start:[],value:a}):r.value=a;break}case"flow-collection":{const r=l.items[l.items.length-1];!r||r.value?l.items.push({start:[],key:a,sep:[]}):r.sep?r.value=a:Object.assign(r,{key:a,sep:[]});return}default:yield*this.pop(),yield*this.pop(a)}if((l.type==="document"||l.type==="block-map"||l.type==="block-seq")&&(a.type==="block-map"||a.type==="block-seq")){const r=a.items[a.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&My(r.start)===-1&&(a.indent===0||r.start.every(o=>o.type!=="comment"||o.indent<a.indent))&&(l.type==="document"?l.end=r.start:l.items.push({start:r.start}),a.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":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{My(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const a=this.startBlockValue(t);a?this.stack.push(a):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const a=bu(this.peek(2)),l=ps(a);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:l,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let a=this.source.indexOf(`
584
+ `)+1;for(;a!==0;)this.onNewLine(this.offset+a),a=this.source.indexOf(`
585
+ `,a)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var l;const a=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,a.value){const r="end"in a.value?a.value.end:void 0,o=Array.isArray(r)?r[r.length-1]:void 0;(o==null?void 0:o.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"space":case"comment":if(a.value)t.items.push({start:[this.sourceToken]});else if(a.sep)a.sep.push(this.sourceToken);else{if(this.atIndentedComment(a.start,t.indent)){const r=t.items[t.items.length-2],o=(l=r==null?void 0:r.value)==null?void 0:l.end;if(Array.isArray(o)){Array.prototype.push.apply(o,a.start),o.push(this.sourceToken),t.items.pop();return}}a.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,o=r&&(a.sep||a.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(o&&a.sep&&!a.value){const h=[];for(let p=0;p<a.sep.length;++p){const m=a.sep[p];switch(m.type){case"newline":h.push(p);break;case"space":break;case"comment":m.indent>t.indent&&(h.length=0);break;default:h.length=0}}h.length>=2&&(c=a.sep.splice(h[1]))}switch(this.type){case"anchor":case"tag":o||a.value?(c.push(this.sourceToken),t.items.push({start:c}),this.onKeyLine=!0):a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"explicit-key-ind":!a.sep&&!a.explicitKey?(a.start.push(this.sourceToken),a.explicitKey=!0):o||a.value?(c.push(this.sourceToken),t.items.push({start:c,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(a.explicitKey)if(a.sep)if(a.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Yi(a.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(tv(a.key)&&!Yi(a.sep,"newline")){const h=ps(a.start),p=a.key,m=a.sep;m.push(this.sourceToken),delete a.key,delete a.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:h,key:p,sep:m}]})}else c.length>0?a.sep=a.sep.concat(c,this.sourceToken):a.sep.push(this.sourceToken);else if(Yi(a.start,"newline"))Object.assign(a,{key:null,sep:[this.sourceToken]});else{const h=ps(a.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:h,key:null,sep:[this.sourceToken]}]})}else a.sep?a.value||o?t.items.push({start:c,key:null,sep:[this.sourceToken]}):Yi(a.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):a.sep.push(this.sourceToken):Object.assign(a,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const h=this.flowScalar(this.type);o||a.value?(t.items.push({start:c,key:h,sep:[]}),this.onKeyLine=!0):a.sep?this.stack.push(h):(Object.assign(a,{key:h,sep:[]}),this.onKeyLine=!0);return}default:{const h=this.startBlockValue(t);if(h){if(h.type==="block-seq"){if(!a.explicitKey&&a.sep&&!Yi(a.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 r&&t.items.push({start:c});this.stack.push(h);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var l;const a=t.items[t.items.length-1];switch(this.type){case"newline":if(a.value){const r="end"in a.value?a.value.end:void 0,o=Array.isArray(r)?r[r.length-1]:void 0;(o==null?void 0:o.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else a.start.push(this.sourceToken);return;case"space":case"comment":if(a.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(a.start,t.indent)){const r=t.items[t.items.length-2],o=(l=r==null?void 0:r.value)==null?void 0:l.end;if(Array.isArray(o)){Array.prototype.push.apply(o,a.start),o.push(this.sourceToken),t.items.pop();return}}a.start.push(this.sourceToken)}return;case"anchor":case"tag":if(a.value||this.indent<=t.indent)break;a.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;a.value||Yi(a.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):a.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const a=t.items[t.items.length-1];if(this.type==="flow-error-end"){let l;do yield*this.pop(),l=this.peek(1);while((l==null?void 0:l.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!a||a.sep?t.items.push({start:[this.sourceToken]}):a.start.push(this.sourceToken);return;case"map-value-ind":!a||a.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):a.sep?a.sep.push(this.sourceToken):Object.assign(a,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!a||a.value?t.items.push({start:[this.sourceToken]}):a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!a||a.value?t.items.push({start:[],key:r,sep:[]}):a.sep?this.stack.push(r):Object.assign(a,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const l=this.startBlockValue(t);l?this.stack.push(l):(yield*this.pop(),yield*this.step())}else{const l=this.peek(2);if(l.type==="block-map"&&(this.type==="map-value-ind"&&l.indent===t.indent||this.type==="newline"&&!l.items[l.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&l.type!=="flow-collection"){const r=bu(l),o=ps(r);Dy(t);const c=t.end.splice(1,t.end.length);c.push(this.sourceToken);const h={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:c}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=h}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let a=this.source.indexOf(`
586
+ `)+1;for(;a!==0;)this.onNewLine(this.offset+a),a=this.source.indexOf(`
587
+ `,a)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){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;const a=bu(t),l=ps(a);return l.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const a=bu(t),l=ps(a);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,a){return this.type!=="comment"||this.indent<=a?!1:t.every(l=>l.type==="newline"||l.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){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;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function B_(i){const t=i.prettyErrors!==!1;return{lineCounter:i.lineCounter||t&&new R_||null,prettyErrors:t}}function q_(i,t={}){const{lineCounter:a,prettyErrors:l}=B_(t),r=new L_(a==null?void 0:a.addNewLine),o=new O_(t);let c=null;for(const h of o.compose(r.parse(i),!0,i.length))if(!c)c=h;else if(c.options.logLevel!=="silent"){c.errors.push(new Ml(h.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return l&&a&&(c.errors.forEach(Ny(i,a)),c.warnings.forEach(Ny(i,a))),c}function U_(i,t,a){let l;const r=q_(i,a);if(!r)return null;if(r.warnings.forEach(o=>Nb(r.options.logLevel,o)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:l},a))}class pa extends Error{constructor(a,l,r){super(a);Nt(this,"code");Nt(this,"position");this.name="MdmaParseError",this.code=l,this.position=r}}const ga={YAML_PARSE_ERROR:"mdma/yaml-parse-error",SCHEMA_VALIDATION_ERROR:"mdma/schema-validation-error",UNKNOWN_COMPONENT_TYPE:"mdma/unknown-component-type",DUPLICATE_COMPONENT_ID:"mdma/duplicate-component-id",INVALID_BINDING:"mdma/invalid-binding",UNRESOLVED_BINDING:"mdma/unresolved-binding"},I_=/^[%@`!&*>|?,]/;function H_(i){const t=i.split(`
588
+ `);let a=!1,l=0;for(let r=0;r<t.length;r++){const o=t[r];if(a){const m=o.search(/\S/);if(m>=0&&m<=l)a=!1;else continue}if(/^\s*[\w-]+:\s*[|>]\s*$/.test(o)){a=!0,l=o.search(/\S/);continue}const c=o.match(/^(\s*)([\w-]+):\s+(.+)$/);if(!c)continue;const[,h,,p]=c;if(!/^["']/.test(p)&&!/^[[\]{]/.test(p)&&!/^(true|false|null|~)$/i.test(p)&&!/^-?\d+(\.\d+)?$/.test(p)&&!(h&&/^\s*-/.test(o))&&(p.includes(": ")||I_.test(p))){const m=p.replace(/\\/g,"\\\\").replace(/"/g,'\\"');t[r]=o.replace(/:\s+.+$/,`: "${m}"`)}}return t.join(`
589
+ `)}function V_(i,t){try{const a=U_(H_(i));return typeof a!="object"||a===null||Array.isArray(a)?{ok:!1,error:new pa("MDMA block must contain a YAML mapping (object)",ga.YAML_PARSE_ERROR,t)}:{ok:!0,data:a}}catch(a){return{ok:!1,error:new pa(`YAML parse error: ${a instanceof Error?a.message:String(a)}`,ga.YAML_PARSE_ERROR,t)}}}function Y_(i,t,a){const l=i.type;if(typeof l!="string")return{ok:!1,errors:[new pa('MDMA component must have a "type" string field',ga.SCHEMA_VALIDATION_ERROR,a)]};const r=t==null?void 0:t.get(l);if(r){const c=r.safeParse(i);return c.success?{ok:!0,component:c.data}:{ok:!1,errors:c.error.issues.map(h=>new pa(`${h.path.join(".")}: ${h.message}`,ga.SCHEMA_VALIDATION_ERROR,a))}}if(l==="custom"){const c=ny.safeParse(i);if(!c.success)return{ok:!1,errors:c.error.issues.map(m=>new pa(`${m.path.join(".")}: ${m.message}`,ga.SCHEMA_VALIDATION_ERROR,a))};const h=c.data,p=t==null?void 0:t.get(h.name);if(p){const m=p.safeParse(h.props);if(!m.success)return{ok:!1,errors:m.error.issues.map(b=>new pa(`props.${b.path.join(".")}: ${b.message}`,ga.SCHEMA_VALIDATION_ERROR,a))};h.props=m.data}return{ok:!0,component:h}}if(!L1.has(l))return{ok:!0,unknownType:!0,component:{id:typeof i.id=="string"?i.id:`unknown-${l}`,type:l,...i}};const o=ny.safeParse(i);return o.success?{ok:!0,component:o.data}:{ok:!1,errors:o.error.issues.map(c=>new pa(`${c.path.join(".")}: ${c.message}`,ga.SCHEMA_VALIDATION_ERROR,a))}}function G_(i,t){return{type:"mdmaBlock",rawYaml:i.value,component:t,position:i.position}}function $_(i,t,a={}){const l=new Set,r=typeof t.value=="string"?t.value:String(t.value??"");return Cw(i,"code",(o,c,h)=>{if(o.lang!==Zy)return;const p=V_(o.value,o.position);if(!p.ok){if(console.warn("[mdma] YAML parse error:",p.error.message),t.message(p.error.message,o.position),a.failFast)throw p.error;return}const m=Y_(p.data,a.customSchemas,o.position);if(!m.ok){console.warn(`[mdma] Validation failed for component type="${p.data.type}" id="${p.data.id??"?"}":`,m.errors.map(S=>S.message).join("; "));for(const S of m.errors)t.message(S.message,o.position);if(a.failFast)throw m.errors[0];return}if(m.unknownType&&!K_(o,r))return;const b=m.component.id;if(l.has(b)){const S=`Duplicate component ID: "${b}"`;if(t.message(S,o.position),a.failFast)throw new Error(S)}l.add(b);const y=G_(o,m.component);return h&&typeof c=="number"&&(h.children[c]=y),bb}),i}function K_(i,t){var c,h,p,m;const a=(h=(c=i.position)==null?void 0:c.start)==null?void 0:h.offset,l=(m=(p=i.position)==null?void 0:p.end)==null?void 0:m.offset;if(a==null||l==null||!t)return!0;const o=t.slice(a,l).split(`
590
+ `);for(let b=o.length-1;b>=1;b--){const y=o[b].trim();if(y!=="")return/^(`{3,}|~{3,})$/.test(y)}return!1}const Z_=(i={})=>(t,a)=>$_(t,a,{customSchemas:i.customSchemas,failFast:i.failFast});function Q_(){const i=new Map,t=new Set;return{on(a,l){let r=i.get(a);return r||(r=new Set,i.set(a,r)),r.add(l),()=>{r==null||r.delete(l)}},onAny(a){return t.add(a),()=>{t.delete(a)}},emit(a){const l=i.get(a.type);if(l)for(const r of l)r(a);for(const r of t)r(a)}}}function X_(i){const t=[];return{append(a){const l={timestamp:new Date().toISOString(),sessionId:i.sessionId,documentId:i.documentId,eventType:a.eventType,componentId:a.componentId,payload:a.payload,redacted:a.redacted??!1,actor:a.actor};return t.push(l),l},entries(){return t},forComponent(a){return t.filter(l=>l.componentId===a)},size(){return t.length}}}function F_(i,t){const a=t.split(".");let l=i;for(const r of a){if(l==null||typeof l!="object")return;l=l[r]}return l}function J_(i){const t=i.match(/^\{\{([a-zA-Z_][a-zA-Z0-9_.\-]*)\}\}$/);return t?t[1]:null}function ys(i,t){if(typeof i=="string"){const a=J_(i);if(a)return F_(t,a)}return i}function dd(i){if(typeof File<"u"&&i instanceof File)return{name:i.name,size:i.size,type:i.type,lastModified:i.lastModified};if(Array.isArray(i))return i.map(dd);if(i&&typeof i=="object"){const t={};for(const[a,l]of Object.entries(i))t[a]=dd(l);return t}return i}function W_(i){const t=typeof i=="string"?i:JSON.stringify(i);let a=0;for(let l=0;l<t.length;l++){const r=t.charCodeAt(l);a=(a<<5)-a+r|0}return`redacted:${(a>>>0).toString(16).padStart(8,"0")}`}function P_(i,t,a){const l=a.sensitiveComponents.has(t);if(!l&&!eT(i,a.sensitiveFields))return{payload:i,redacted:!1};const r={};for(const[o,c]of Object.entries(i))l||a.sensitiveFields.has(o)?r[o]=W_(c):r[o]=c;return{payload:r,redacted:!0}}function eT(i,t){for(const a of Object.keys(i))if(t.has(a))return!0;return!1}class tT extends Error{constructor(a,l){super(a);Nt(this,"rule");this.name="PolicyViolationError",this.rule=l}}class nT{constructor(t,a){Nt(this,"policy");Nt(this,"environment");this.policy=t,this.environment=a}evaluate(t){const a=this.policy.rules.filter(l=>l.action===t&&l.environments.includes(this.environment));if(a.length>0){const l=a[0];return{allowed:l.effect==="allow",rule:l,reason:l.reason}}return{allowed:this.policy.defaultEffect==="allow",reason:`Default policy: ${this.policy.defaultEffect}`}}enforce(t){const a=this.evaluate(t);if(!a.allowed)throw new tT(a.reason??`Action "${t}" denied by policy`,a.rule)}get currentEnvironment(){return this.environment}}function iT(){return{version:1,rules:[{action:"send_email",environments:["preview","test"],effect:"deny",reason:"Email sending is blocked in non-production environments"},{action:"webhook_call",environments:["preview"],effect:"deny",reason:"External webhook calls are blocked in preview"}],defaultEffect:"allow"}}function aT(i){if(!i||!Array.isArray(i))return i;const t={};for(const[a,l]of Object.entries(Py(i)))t[a]=l.resolve??(async()=>{throw new Error(`No resolver registered for data source "${a}"`)});return t}function vu(i,t){const a={};if(!i)return a;for(const[l,r]of Object.entries(i))a[l]=ys(r,t);return a}function sT(i,t){return i.source===t.source&&JSON.stringify(i.params??{})===JSON.stringify(t.params??{})}function lT(i,t){const a=Object.keys(i),l=Object.keys(t);return a.length!==l.length?!1:a.every(r=>Object.is(i[r],t[r]))}function rT(i,t){return JSON.stringify([i,t.params,t.page??null,t.pageSize??null,t.sort??null,t.filter??null])}function uT(i,t){return i===t?0:i==null?-1:t==null?1:typeof i=="number"&&typeof t=="number"?i-t:String(i).localeCompare(String(t))}function oT(i,t){let a=i.slice();if(t.filter){const r=t.filter.toLowerCase();a=a.filter(o=>Object.values(o).some(c=>String(c??"").toLowerCase().includes(r)))}if(t.sort){const{key:r,direction:o}=t.sort;a.sort((c,h)=>{const p=uT(c[r],h[r]);return o==="desc"?-p:p})}const l=a.length;if(t.page!==void 0&&t.pageSize){const r=(t.page-1)*t.pageSize;a=a.slice(r,r+t.pageSize)}return{rows:a,total:l}}class cT{constructor(t={}){Nt(this,"dataSources");Nt(this,"debounceMs");Nt(this,"onLog");Nt(this,"onChange");Nt(this,"onResolved");Nt(this,"disposed",!1);Nt(this,"slots",new Map);Nt(this,"deferredKeys");Nt(this,"batchDepth",0);Nt(this,"cache",new Map);this.dataSources=t.dataSources??{},this.debounceMs=t.debounceMs??150,this.onLog=t.onLog,this.onChange=t.onChange,this.onResolved=t.onResolved}dispose(){this.disposed=!0;for(const t of this.keys())this.unregister(t)}has(t){return this.slots.has(t)}keys(){return[...this.slots.keys()]}register(t,a,l,r={}){if(this.disposed||this.slots.has(t))return;const o=vu(a.params,l),c={key:t,ref:a,pageSize:r.pageSize,resolvedParams:o,fetchToken:0,state:{status:"idle",rows:[],page:1,pageSize:r.pageSize}};this.slots.set(t,c),this.requestFetch(c)}hasSource(t){return Object.hasOwn(this.dataSources,t)}beginBatch(){this.batchDepth++===0&&(this.deferredKeys=new Set)}endBatch(t){if(this.batchDepth===0||--this.batchDepth>0)return;const a=this.deferredKeys??new Set;this.deferredKeys=void 0;for(const l of a){const r=this.slots.get(l);r&&(r.resolvedParams=vu(r.ref.params,t),this.fetch(r))}this.onBindingsChanged(t)}runBatch(t,a){this.beginBatch();let l;try{l=a()}catch(r){try{this.endBatch(t)}catch{}throw r}return this.endBatch(t),l}sync(t,a,l,r={}){const o=this.slots.get(t);if(!o){this.register(t,a,l,r);return}sT(o.ref,a)&&o.pageSize===r.pageSize||(o.ref=a,o.pageSize=r.pageSize,o.resolvedParams=vu(a.params,l),o.state={...o.state,page:1,pageSize:r.pageSize},this.scheduleFetch(o))}unregister(t){var l,r;const a=this.slots.get(t);a&&(a.fetchToken++,(l=a.abortController)==null||l.abort(),a.debounceTimer&&clearTimeout(a.debounceTimer),(r=this.deferredKeys)==null||r.delete(t),this.slots.delete(t))}getState(t){var a;return(a=this.slots.get(t))==null?void 0:a.state}setPage(t,a){const l=this.slots.get(t);l&&(l.state={...l.state,page:a},this.fetch(l))}setSort(t,a){const l=this.slots.get(t);l&&(l.state={...l.state,sort:a,page:1},this.fetch(l))}setFilter(t,a){var r;const l=this.slots.get(t);l&&(l.state={...l.state,filter:a,page:1},(r=this.onChange)==null||r.call(this),this.scheduleFetch(l))}retry(t){const a=this.slots.get(t);a&&this.fetch(a)}onBindingsChanged(t){for(const a of this.slots.values()){const l=vu(a.ref.params,t);lT(l,a.resolvedParams)||(a.resolvedParams=l,a.state={...a.state,page:1},this.scheduleFetch(a))}}async resolveAll(){await Promise.all([...this.slots.values()].map(t=>this.fetch(t)))}requestFetch(t){this.deferredKeys?this.deferredKeys.add(t.key):this.fetch(t)}scheduleFetch(t){var a;t.debounceTimer&&clearTimeout(t.debounceTimer),t.fetchToken++,(a=t.abortController)==null||a.abort(),t.debounceTimer=setTimeout(()=>{t.debounceTimer=void 0,this.fetch(t)},this.debounceMs)}async fetch(t){var c,h,p,m,b,y;t.debounceTimer&&(clearTimeout(t.debounceTimer),t.debounceTimer=void 0),(c=t.abortController)==null||c.abort();const a=new AbortController;t.abortController=a;const l=++t.fetchToken,r=this.dataSources[t.ref.source];if(r===void 0){t.state={...t.state,status:"error",error:`Unknown data source "${t.ref.source}"`},this.log(t,"data_error",{error:t.state.error,source:t.ref.source}),(h=this.onChange)==null||h.call(this);return}t.state={...t.state,status:"loading",error:void 0},(p=this.onChange)==null||p.call(this),this.log(t,"data_loading",{source:t.ref.source,paramKeys:Object.keys(t.resolvedParams)});const o={source:t.ref.source,params:t.resolvedParams,page:t.state.page,pageSize:t.pageSize,sort:t.state.sort,filter:t.state.filter};try{const S=Array.isArray(r)?oT(r,o):await this.fetchViaResolver(r,o,a.signal);if(l!==t.fetchToken)return;t.state={...t.state,status:"ready",rows:S.rows,total:S.total,error:void 0},this.log(t,"data_resolved",{source:t.ref.source,rowCount:S.rows.length,total:S.total}),(m=this.onResolved)==null||m.call(this,t.key,S.rows),(b=this.onChange)==null||b.call(this)}catch(S){if(a.signal.aborted||l!==t.fetchToken)return;const x=S instanceof Error?S.message:String(S);t.state={...t.state,status:"error",error:x},this.log(t,"data_error",{source:t.ref.source,error:x}),(y=this.onChange)==null||y.call(this)}}async fetchViaResolver(t,a,l){const r=rT(a.source,a);let o=this.cache.get(r);if(o!=null&&o.controller.signal.aborted&&(o=void 0),!o){const p=new AbortController,m=t(a,{signal:p.signal});o={promise:m,controller:p,refCount:0},this.cache.set(r,o),m.catch(()=>{}).finally(()=>{this.cache.get(r)===o&&this.cache.delete(r)})}const c=o;c.refCount++;const h=()=>{c.refCount--,c.refCount<=0&&c.controller.abort()};l.addEventListener("abort",h);try{return await c.promise}finally{l.removeEventListener("abort",h)}}log(t,a,l){var r;(r=this.onLog)==null||r.call(this,{key:t.key,eventType:a,payload:l})}}function fT(i,t={}){const a=t.sessionId??crypto.randomUUID(),l=t.documentId??`doc-${Date.now()}`,r=t.environment??"preview",o=new nT(t.policy??iT(),r),c=Q_(),h=X_({sessionId:a,documentId:l}),p={bindings:{},components:new Map},m=t.initialState,b=new Set;let y=!1;const S=new Map;function x(){if(!y)for(const C of b)C(p)}const N=new cT({dataSources:aT(t.dataSources),onChange:x,onResolved:j,onLog:({key:C,eventType:B,payload:X})=>{y||h.append({eventType:B,componentId:C,payload:X,redacted:!1})}});function T(C){if(va(C))return C;if(typeof C=="string"&&N.hasSource(C))return{source:C}}function M(C){const B=new Set;if(C.type==="table")va(C.data)&&(B.add(C.id),N.sync(C.id,C.data,p.bindings,{pageSize:C.pageSize}));else if(C.type==="chart")va(C.data)&&(B.add(C.id),N.sync(C.id,C.data,p.bindings));else if(C.type==="form")for(const X of C.fields){const F=`${C.id}.${X.name}`,P=T(X.options);P&&(B.add(F),S.set(F,{componentId:C.id,field:X.name}),N.sync(F,P,p.bindings))}for(const X of N.keys())(X===C.id||X.startsWith(`${C.id}.`))&&!B.has(X)&&(N.unregister(X),S.delete(X))}function j(C,B){const X=S.get(C);if(!X)return;const F=p.components.get(X.componentId),P=F==null?void 0:F.values[X.field];if(!F||P===void 0||P===null||P===""||B.some(U=>String(U==null?void 0:U.value)===String(P)))return;const{[X.field]:pe,...Ae}=F.values;F.values=Ae;const be=p.bindings[X.componentId];typeof be=="object"&&be!==null&&delete be[X.field],p.bindings[X.field]===P&&delete p.bindings[X.field],N.onBindingsChanged(p.bindings)}function Y(C){for(const B of N.keys())(B===C||B.startsWith(`${C}.`))&&(N.unregister(B),S.delete(B))}function H(C){const B=m==null?void 0:m[C.id];if(!B)return;(!p.bindings[C.id]||typeof p.bindings[C.id]!="object")&&(p.bindings[C.id]={});const X=p.bindings[C.id];for(const[F,P]of Object.entries(B))C.values[F]=P,X[F]=P,F in p.bindings||(p.bindings[F]=P)}const Z={sensitiveComponents:new Set,sensitiveFields:new Set};N.runBatch(p.bindings,()=>{for(const C of i.children)if(Gf(C)){const B=C.component,X={id:B.id,type:B.type,values:{},errors:[],touched:!1,visible:ys(B.visible,p.bindings)!==!1,disabled:ys(B.disabled,p.bindings)===!0};if(B.sensitive&&Z.sensitiveComponents.add(B.id),B.type==="form")for(const F of B.fields)F.sensitive&&Z.sensitiveFields.add(F.name),F.defaultValue!==void 0&&(X.values[F.name]=F.defaultValue,p.bindings[F.name]=F.defaultValue,(!p.bindings[B.id]||typeof p.bindings[B.id]!="object")&&(p.bindings[B.id]={}),p.bindings[B.id][F.name]=F.defaultValue);H(X),p.components.set(B.id,X),M(B)}});function te(C){const B={FIELD_CHANGED:"field_changed",ACTION_TRIGGERED:"action_triggered",COMPONENT_RENDERED:"component_rendered",APPROVAL_GRANTED:"approval_granted",APPROVAL_DENIED:"approval_denied",INTEGRATION_CALLED:"integration_called"},X=dd({...C});X.type=void 0,X.componentId=void 0;let F=Z;C.type==="FIELD_CHANGED"&&Z.sensitiveFields.has(C.field)&&(F={...Z,sensitiveFields:new Set([...Z.sensitiveFields,"value"])});const{payload:P,redacted:ne}=P_(X,C.componentId,F);h.append({eventType:B[C.type],componentId:C.componentId,payload:P,redacted:ne,actor:"actor"in C?C.actor:void 0})}return{getState(){return p},getBindings(){return p.bindings},getComponentState(C){return p.components.get(C)},resolveBinding(C){return ys(C,p.bindings)},dispatch(C){switch(te(C),c.emit(C),C.type){case"FIELD_CHANGED":{const B=p.components.get(C.componentId);B&&(B.values={...B.values,[C.field]:C.value},B.touched=!0,p.bindings[C.field]=C.value,(!p.bindings[C.componentId]||typeof p.bindings[C.componentId]!="object")&&(p.bindings[C.componentId]={}),p.bindings[C.componentId][C.field]=C.value,N.onBindingsChanged(p.bindings));break}case"COMPONENT_RENDERED":break;case"APPROVAL_GRANTED":{const B=p.components.get(C.componentId);B&&(B.values={...B.values,status:"approved",approvedBy:C.actor},p.bindings[`${C.componentId}.status`]="approved",N.onBindingsChanged(p.bindings));break}case"APPROVAL_DENIED":{const B=p.components.get(C.componentId);B&&(B.values={...B.values,status:"denied",deniedBy:C.actor,deniedReason:C.reason},p.bindings[`${C.componentId}.status`]="denied",N.onBindingsChanged(p.bindings));break}}x()},subscribe(C){return b.add(C),()=>{b.delete(C)}},getEventLog(){return h},getEventBus(){return c},getPolicyEngine(){return o},updateAst(C){const B=new Set;for(const X of C.children)if(Gf(X))B.add(X.component.id);else if(dT(X)){const F=hT(X.value);F&&B.add(F)}for(const X of p.components.keys())B.has(X)||(p.components.delete(X),Z.sensitiveComponents.delete(X),Y(X));N.runBatch(p.bindings,()=>{for(const X of C.children){if(!Gf(X))continue;const F=X.component,P=p.components.get(F.id);if(P&&P.type===F.type){M(F);continue}Z.sensitiveComponents.delete(F.id);const ne={id:F.id,type:F.type,values:{},errors:[],touched:!1,visible:ys(F.visible,p.bindings)!==!1,disabled:ys(F.disabled,p.bindings)===!0};if(F.sensitive&&Z.sensitiveComponents.add(F.id),F.type==="form"){for(const pe of F.fields)if(pe.sensitive&&Z.sensitiveFields.add(pe.name),pe.defaultValue!==void 0){ne.values[pe.name]=pe.defaultValue,pe.name in p.bindings||(p.bindings[pe.name]=pe.defaultValue),(!p.bindings[F.id]||typeof p.bindings[F.id]!="object")&&(p.bindings[F.id]={});const Ae=p.bindings[F.id];pe.name in Ae||(Ae[pe.name]=pe.defaultValue)}}H(ne),p.components.set(F.id,ne),M(F)}}),x()},getDataState(C){return N.getState(C)},setDataPage(C,B){N.setPage(C,B)},setDataSort(C,B){N.setSort(C,B)},setDataFilter(C,B){N.setFilter(C,B)},retryData(C){N.retry(C)},async resolveAllData(){await N.resolveAll()},dispose(){y=!0,b.clear(),N.dispose(),S.clear()}}}function Gf(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="mdmaBlock"}function dT(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="code"&&"lang"in i&&i.lang==="mdma"}function hT(i){if(!i)return null;const t=i.match(/^\s*id:\s*(\S+)/m);return t?t[1]:null}function mT(i,t,a){return va(i)?!0:typeof i=="string"&&a(t)!==void 0}class pT{constructor(){Nt(this,"handlers",new Map)}register(t){this.handlers.set(t.definition.type,t)}get(t){return this.handlers.get(t)}has(t){return this.handlers.has(t)}list(){return Array.from(this.handlers.values()).map(t=>t.definition)}get size(){return this.handlers.size}}const gT={definition:{type:"form",schema:Lu,description:"Interactive form with fields, validation, and submit action",version:"0.1.0"},initialize(i,t){const a=Lu.parse(t),l={};for(const r of a.fields)l[r.name]=r.defaultValue??(r.type==="checkbox"?!1:"");return{id:a.id,type:"form",values:l,errors:[],touched:!1,visible:!0,disabled:!1}}},yT={definition:{type:"button",schema:Bu,description:"Clickable button that triggers an action",version:"0.1.0"},initialize(i,t){return{id:Bu.parse(t).id,type:"button",values:{},errors:[],touched:!1,visible:!0,disabled:!1}}},bT={definition:{type:"tasklist",schema:qu,description:"Checklist of tasks with completion tracking",version:"0.1.0"},initialize(i,t){const a=qu.parse(t),l={};for(const r of a.items)l[r.id]=r.checked;return{id:a.id,type:"tasklist",values:l,errors:[],touched:!1,visible:!0,disabled:!1}}},vT={definition:{type:"table",schema:Uu,description:"Data table with optional sorting and filtering",version:"0.1.0"},initialize(i,t){return{id:Uu.parse(t).id,type:"table",values:{sortColumn:null,sortDirection:"asc",page:0},errors:[],touched:!1,visible:!0,disabled:!1}}},xT={definition:{type:"callout",schema:Iu,description:"Informational callout box (info, warning, error, success)",version:"0.1.0"},initialize(i,t){return{id:Iu.parse(t).id,type:"callout",values:{dismissed:!1},errors:[],touched:!1,visible:!0,disabled:!1}}},ST={definition:{type:"approval-gate",schema:Hu,description:"Requires explicit approval before downstream components become active",version:"0.1.0"},initialize(i,t){return{id:Hu.parse(t).id,type:"approval-gate",values:{status:"pending",approvals:[]},errors:[],touched:!1,visible:!0,disabled:!1}}},kT={definition:{type:"webhook",schema:Vu,description:"HTTP webhook integration with policy enforcement",version:"0.1.0"},initialize(i,t){return{id:Vu.parse(t).id,type:"webhook",values:{status:"idle",lastResult:null},errors:[],touched:!1,visible:!0,disabled:!1}}};function wT(i){i.register(gT),i.register(yT),i.register(bT),i.register(vT),i.register(xT),i.register(ST),i.register(kT)}const zy=fS().use(xw).use(Z_,{});function _T(){const i=new pT;return wT(i),i}async function Ry(i,t){const a=zy.parse(i),l=await zy.run(a,i);return t?(t.updateAst(l),{ast:l,store:t}):{ast:l,store:fT(l,{registry:_T()})}}const nv=W.createContext(null);function io(){const i=W.useContext(nv);if(!i)throw new Error("useMdmaContext must be used within a MdmaProvider");return i}function TT({store:i,dataSources:t,children:a}){const l=W.useMemo(()=>({store:i,dataSources:t}),[i,t]);return v.jsx(nv.Provider,{value:l,children:a})}const iv=W.createContext(null);function AT({value:i,children:t}){const a=W.useMemo(()=>i??null,[i]);return v.jsx(iv.Provider,{value:a,children:t})}function zt(i,t){var l,r;const a=W.useContext(iv);if(a)return((l=a[i])==null?void 0:l[t])??((r=a["*"])==null?void 0:r[t])}const av=W.createContext({});function ET({value:i,children:t}){return v.jsx(av.Provider,{value:i??{},children:t})}function NT(){return W.useContext(av)}const _u={colors:{background:"#ffffff",surface:"#f8f9fa",text:"#333333",textMuted:"#666666",border:"#e0e0e0",primary:"#6c5ce7",onPrimary:"#ffffff",secondary:"#dfe6e9",onSecondary:"#2d3436",danger:"#e74c3c",onDanger:"#ffffff",info:"#3498db",infoBg:"#ebf5fb",warning:"#f39c12",warningBg:"#fef9e7",error:"#e74c3c",errorBg:"#fdedec",success:"#27ae60",successBg:"#eafaf1"},spacing:{xs:4,sm:8,md:12,lg:16},radius:{sm:6,md:10},fontSize:{small:13,body:14,label:15,title:18}},CT={colors:{background:"#151a26",surface:"#1c2333",text:"#e5e7eb",textMuted:"#9ca3af",border:"#2a3140",primary:"#8b7ff0",onPrimary:"#ffffff",secondary:"#2a3140",onSecondary:"#e5e7eb",danger:"#ef4444",onDanger:"#ffffff",info:"#5dade2",infoBg:"#16283a",warning:"#f5b041",warningBg:"#2a2412",error:"#ef4444",errorBg:"#2a1717",success:"#2ecc71",successBg:"#12251a"},spacing:{xs:4,sm:8,md:12,lg:16},radius:{sm:6,md:10},fontSize:{small:13,body:14,label:15,title:18}},Ly=W.createContext({theme:_u});function By(i){return i.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function OT(i){const t={};for(const[a,l]of Object.entries(i.colors))t[`--mdma-color-${By(a)}`]=l;for(const[a,l]of Object.entries(i.spacing))t[`--mdma-spacing-${a}`]=`${l}px`;for(const[a,l]of Object.entries(i.radius))t[`--mdma-radius-${a}`]=`${l}px`;for(const[a,l]of Object.entries(i.fontSize))t[`--mdma-font-size-${By(a)}`]=`${l}px`;return t}function jT(i){return i===void 0?{theme:_u}:i==="light"?{dataTheme:"light",theme:_u}:i==="dark"?{dataTheme:"dark",theme:CT}:i==="auto"?{dataTheme:"auto",theme:_u}:{dataTheme:MT(i)?"dark":"light",style:OT(i),theme:i}}function MT(i){const t=i.colors.background.replace("#","");if(t.length<6)return!1;const a=Number.parseInt(t.slice(0,2),16),l=Number.parseInt(t.slice(2,4),16),r=Number.parseInt(t.slice(4,6),16);return Number.isNaN(a+l+r)?!1:.299*a+.587*l+.114*r<128}function Zl(){const{store:i}=io();return i}function DT(i){const{store:t}=io(),a=W.useRef(void 0),l=W.useCallback(o=>t.subscribe(o),[t]),r=W.useCallback(()=>{const o=t.getComponentState(i);if(!o){a.current=void 0;return}const c=a.current;if(c&&c.id===o.id&&c.touched===o.touched&&c.visible===o.visible&&c.disabled===o.disabled&&c.values===o.values&&c.errors===o.errors)return c;const h={...o};return a.current=h,h},[t,i]);return W.useSyncExternalStore(l,r,r)}function Ld(i){const{store:t}=io(),a=W.useCallback(r=>t.subscribe(r),[t]),l=W.useCallback(()=>t.getDataState(i),[t,i]);return W.useSyncExternalStore(a,l,l)}function Bd({componentId:i,reloading:t}){return t?v.jsx("span",{className:"mdma-table-loading-indicator","data-component-id":i,children:"Loading…"}):v.jsx("div",{className:"mdma-data-loading","data-component-id":i,children:"Loading…"})}function qd({componentId:i,error:t,onRetry:a}){return v.jsxs("div",{className:"mdma-data-error","data-component-id":i,children:[v.jsx("span",{children:t}),v.jsx("button",{type:"button",onClick:a,children:"Retry"})]})}function sv({componentId:i,label:t}){return v.jsxs("div",{className:"mdma-data-empty","data-component-id":i,children:[t&&v.jsx("div",{className:"mdma-chart-label",children:t}),"No data"]})}function zT({Select:i,dataKey:t,...a}){const l=Zl(),r=Ld(t),o=zt("form","dataLoading")??Bd,c=zt("form","dataError")??qd;if(!r||r.status==="loading")return v.jsx(o,{componentId:t});if(r.status==="error")return v.jsx(c,{componentId:t,error:r.error??"Failed to load options",onRetry:()=>l.retryData(t)});const h=r.rows;return v.jsx(i,{...a,options:h})}function RT({label:i}){return v.jsx("span",{className:"mdma-sensitive-badge",title:`${i} contains sensitive data (PII)`,children:"🔒"})}function LT({id:i,type:t,value:a,onChange:l,required:r,sensitive:o}){const[c,h]=W.useState(o===!0),p=c?"password":t;return v.jsxs("span",{className:`mdma-input-wrapper ${o?"mdma-input--sensitive":""}`,children:[v.jsx("input",{id:i,type:p,value:a,required:r,placeholder:o?`Enter ${t}...`:void 0,onChange:m=>l(m.target.value)}),o&&a&&v.jsx("button",{type:"button",className:"mdma-sensitive-toggle",onClick:()=>h(!c),title:c?"Reveal value":"Mask value",children:c?"👁":"🔒"})]})}function BT({id:i,value:t,onChange:a,required:l,options:r}){return v.jsxs("select",{id:i,value:t,required:l,onChange:o=>a(o.target.value),children:[v.jsx("option",{value:"",children:"Select..."}),r.map(o=>v.jsx("option",{value:o.value,children:o.label},o.value))]})}function qT({id:i,checked:t,onChange:a}){return v.jsx("input",{id:i,type:"checkbox",checked:t,onChange:l=>a(l.target.checked)})}function UT({id:i,value:t,onChange:a,required:l,sensitive:r}){return v.jsx("span",{className:`mdma-input-wrapper ${r?"mdma-input--sensitive":""}`,children:v.jsx("textarea",{id:i,value:t,required:l,placeholder:r?"Enter sensitive data...":void 0,onChange:o=>a(o.target.value)})})}function IT({id:i,value:t,onChange:a,required:l,sensitive:r}){return v.jsxs("span",{className:`mdma-input-wrapper mdma-input--file ${r?"mdma-input--sensitive":""}`,children:[v.jsx("input",{id:i,type:"file",required:l,onChange:o=>{const c=o.target.files?Array.from(o.target.files):[];a(c)}}),t.length>0&&v.jsx("ul",{className:"mdma-file-list",children:t.map(o=>v.jsxs("li",{children:[r?"•••":o.name," ",v.jsxs("span",{className:"mdma-file-size",children:["(",o.size," B)"]})]},`${o.name}-${o.lastModified}-${o.size}`))})]})}function HT({onClick:i,label:t}){return v.jsx("button",{type:"button",className:"mdma-form-submit",onClick:i,children:t})}const VT=W.memo(function({component:t,componentState:a,dispatch:l}){const{dataSources:r,store:o}=io(),c=zt("form","input")??LT,h=zt("form","select")??BT,p=zt("form","checkbox")??qT,m=zt("form","textarea")??UT,b=zt("form","file")??IT,y=zt("form","submitButton")??HT,S=zt("form","sensitiveIndicator")??RT;return t.type!=="form"?null:v.jsxs("div",{className:"mdma-form","data-component-id":t.id,children:[t.label&&v.jsx("h3",{className:"mdma-form-label",children:t.label}),t.fields.map(x=>{const N=`${t.id}-${x.name}`,T=String((a==null?void 0:a.values[x.name])??""),M=H=>l({type:"FIELD_CHANGED",componentId:t.id,field:x.name,value:H}),j=H=>l({type:"FIELD_CHANGED",componentId:t.id,field:x.name,value:H}),Y=H=>l({type:"FIELD_CHANGED",componentId:t.id,field:x.name,value:H});return v.jsxs("div",{className:`mdma-form-field ${x.sensitive?"mdma-form-field--sensitive":""}`,children:[v.jsxs("label",{htmlFor:N,children:[x.label,x.sensitive&&v.jsx(S,{name:x.name,label:x.label})]}),x.type==="select"?mT(x.options,`${t.id}.${x.name}`,H=>o.getDataState(H))?v.jsx(zT,{Select:h,dataKey:`${t.id}.${x.name}`,id:N,name:x.name,label:x.label,type:"select",value:T,onChange:M,required:x.required,sensitive:x.sensitive}):v.jsx(h,{id:N,name:x.name,label:x.label,type:"select",value:T,onChange:M,required:x.required,sensitive:x.sensitive,options:typeof x.options=="string"?(r==null?void 0:r[x.options])??[]:Array.isArray(x.options)?x.options:[]}):x.type==="checkbox"?v.jsx(p,{id:N,name:x.name,label:x.label,checked:!!(a!=null&&a.values[x.name]),onChange:j,sensitive:x.sensitive}):x.type==="textarea"?v.jsx(m,{id:N,name:x.name,label:x.label,value:T,onChange:M,required:x.required,sensitive:x.sensitive}):x.type==="file"?v.jsx(b,{id:N,name:x.name,label:x.label,value:Array.isArray(a==null?void 0:a.values[x.name])?a.values[x.name]:[],onChange:Y,required:x.required,sensitive:x.sensitive}):v.jsx(c,{id:N,name:x.name,label:x.label,type:x.type,value:T,onChange:M,required:x.required,sensitive:x.sensitive})]},x.name)}),t.onSubmit&&v.jsx(y,{onClick:()=>l({type:"ACTION_TRIGGERED",componentId:t.id,actionId:t.onSubmit}),label:"Submit"})]})}),YT=W.memo(function({component:t,dispatch:a}){if(t.type!=="button")return null;const l=`mdma-button--${t.variant??"primary"}`;return v.jsx("button",{type:"button",className:`mdma-button ${l}`,"data-component-id":t.id,onClick:()=>{t.onAction&&a({type:"ACTION_TRIGGERED",componentId:t.id,actionId:t.onAction})},children:t.text})}),GT=W.memo(function({component:t,componentState:a,dispatch:l}){return t.type!=="tasklist"?null:v.jsxs("div",{className:"mdma-tasklist","data-component-id":t.id,children:[t.label&&v.jsx("h3",{className:"mdma-tasklist-label",children:t.label}),v.jsx("ul",{className:"mdma-tasklist-items",children:t.items.map(r=>v.jsx("li",{className:"mdma-tasklist-item",children:v.jsxs("label",{children:[v.jsx("input",{type:"checkbox",checked:!!(a!=null&&a.values[r.id]),onChange:o=>{const c=o.target.checked;if(l({type:"FIELD_CHANGED",componentId:t.id,field:r.id,value:c}),t.onComplete){const h=t.items.every(m=>!!(a!=null&&a.values[m.id])),p=t.items.every(m=>m.id===r.id?c:!!(a!=null&&a.values[m.id]));!h&&p&&l({type:"ACTION_TRIGGERED",componentId:t.id,actionId:t.onComplete})}}}),v.jsx("span",{children:r.text})]})},r.id))})]})}),qy=new Set;function $T({value:i,revealed:t,onToggle:a}){return v.jsx("span",{className:"mdma-table-cell--sensitive",onClick:a,title:t?"Click to mask":"Click to reveal",children:t?i:"•••••"})}function KT({componentId:i,defaultValue:t}){const a=Zl();return v.jsx("div",{className:"mdma-table-filter",children:v.jsx("input",{type:"search","aria-label":"Filter rows",placeholder:"Filter…",defaultValue:t??"",onChange:l=>a.setDataFilter(i,l.target.value||void 0)})})}const ZT=W.memo(function({component:t,resolveBinding:a}){if(t.type!=="table")return null;if(va(t.data))return v.jsx(QT,{component:t});const l=typeof t.data=="string"?a(t.data):t.data,r=Array.isArray(l)?l:[];return v.jsx(lv,{component:t,data:r,resolveBinding:a})});function QT({component:i}){const t=Zl(),a=Ld(i.id),l=zt("table","dataLoading")??Bd,r=zt("table","dataError")??qd,o=zt("table","dataEmpty")??sv,c=(a==null?void 0:a.status)==="loading"&&a.rows.length>0;if(!a)return v.jsx(l,{componentId:i.id});const h=i.filterable?v.jsx(KT,{componentId:i.id,defaultValue:a.filter}):null;if(a.status==="loading"&&!c)return v.jsxs(v.Fragment,{children:[h,v.jsx(l,{componentId:i.id})]});if(a.status==="error")return v.jsxs(v.Fragment,{children:[h,v.jsx(r,{componentId:i.id,error:a.error??"Failed to load data",onRetry:()=>t.retryData(i.id)})]});if(a.rows.length===0)return v.jsxs(v.Fragment,{children:[h,v.jsx(o,{componentId:i.id})]});const p=i.pageSize??a.pageSize??a.rows.length,m=a.total??a.rows.length,b=p>0?Math.max(1,Math.ceil(m/p)):1,y=b>1?v.jsxs("div",{className:"mdma-table-pagination",children:[v.jsx("button",{type:"button",disabled:a.page<=1,onClick:()=>t.setDataPage(i.id,a.page-1),children:"Prev"}),v.jsxs("span",{className:"mdma-table-pagination-status",children:["Page ",a.page," / ",b]}),v.jsx("button",{type:"button",disabled:a.page>=b,onClick:()=>t.setDataPage(i.id,a.page+1),children:"Next"})]}):null;return v.jsxs(v.Fragment,{children:[h,v.jsx(lv,{component:i,data:a.rows,revealScope:a.rows,sort:a.sort,busy:c,indicator:c?v.jsx(l,{componentId:i.id,reloading:!0}):null,footer:y,onSort:S=>{var N;const x=((N=a.sort)==null?void 0:N.key)===S&&a.sort.direction==="asc"?{key:S,direction:"desc"}:{key:S,direction:"asc"};t.setDataSort(i.id,x)}})]})}function lv({component:i,data:t,revealScope:a,sort:l,onSort:r,resolveBinding:o,busy:c,indicator:h,footer:p}){const m=new Set(i.columns.filter(N=>N.sensitive).map(N=>N.key)),[b,y]=W.useState({scope:a,keys:new Set}),S=b.scope===a?b.keys:qy,x=N=>y(T=>{const M=new Set(T.scope===a?T.keys:qy);return M.delete(N)||M.add(N),{scope:a,keys:M}});return v.jsxs("div",{className:"mdma-table","data-component-id":i.id,"aria-busy":c||void 0,children:[h,i.label&&v.jsx("h3",{className:"mdma-table-label",children:i.label}),v.jsxs("table",{children:[v.jsx("thead",{children:v.jsx("tr",{children:i.columns.map(N=>v.jsxs("th",{style:N.width?{width:N.width}:void 0,onClick:r&&N.sortable?()=>r(N.key):void 0,className:r&&N.sortable?"mdma-table-sortable":void 0,"aria-sort":(l==null?void 0:l.key)===N.key?l.direction==="asc"?"ascending":"descending":void 0,children:[N.header,(l==null?void 0:l.key)===N.key&&v.jsx("span",{className:"mdma-table-sort-indicator","aria-hidden":"true",children:l.direction==="asc"?"↑":"↓"}),N.sensitive&&v.jsx("span",{className:"mdma-sensitive-badge",title:"Sensitive column (PII)",children:"🔒"})]},N.key))})}),v.jsxs("tbody",{children:[t.map((N,T)=>v.jsx("tr",{children:i.columns.map(M=>{const j=N[M.key]??"",Y=o&&typeof j=="string"&&/^\{\{.+\}\}$/.test(j)?o(j):j,H=String(Y??"");return v.jsx("td",{children:m.has(M.key)&&H?v.jsx($T,{value:H,revealed:S.has(`${T}:${M.key}`),onToggle:()=>x(`${T}:${M.key}`)}):H},M.key)})},T)),t.length===0&&v.jsx("tr",{children:v.jsx("td",{colSpan:i.columns.length,className:"mdma-table-empty",children:"No data"})})]})]}),p]})}const XT=W.memo(function({component:t,componentState:a,dispatch:l}){if(t.type!=="callout"||a!=null&&a.values.dismissed)return null;const r=`mdma-callout--${t.variant??"info"}`;return v.jsxs("div",{className:`mdma-callout ${r}`,"data-component-id":t.id,role:"alert",children:[t.title&&v.jsx("strong",{className:"mdma-callout-title",children:t.title}),v.jsx("p",{className:"mdma-callout-content",children:t.content}),t.dismissible&&v.jsx("button",{type:"button",className:"mdma-callout-dismiss","aria-label":"Dismiss",onClick:()=>l({type:"FIELD_CHANGED",componentId:t.id,field:"dismissed",value:!0}),children:"×"})]})}),FT=W.memo(function({component:t,componentState:a,dispatch:l}){if(t.type!=="approval-gate")return null;const r=(a==null?void 0:a.values.status)??"pending";return v.jsxs("div",{className:`mdma-approval-gate mdma-approval-gate--${r}`,"data-component-id":t.id,children:[v.jsx("h3",{className:"mdma-approval-gate-title",children:t.title}),t.description&&v.jsx("p",{className:"mdma-approval-gate-description",children:t.description}),v.jsxs("div",{className:"mdma-approval-gate-status",children:["Status: ",v.jsx("strong",{children:r})]}),r==="pending"&&v.jsxs("div",{className:"mdma-approval-gate-actions",children:[v.jsx("button",{type:"button",className:"mdma-button mdma-button--primary",onClick:()=>l({type:"APPROVAL_GRANTED",componentId:t.id,actor:{id:"current-user"}}),children:"Approve"}),v.jsx("button",{type:"button",className:"mdma-button mdma-button--danger",onClick:()=>l({type:"APPROVAL_DENIED",componentId:t.id,actor:{id:"current-user"},reason:""}),children:"Deny"})]})]})}),JT=W.memo(function({component:t,componentState:a,dispatch:l}){const[r,o]=W.useState(!1);if(t.type!=="webhook")return null;const c=(a==null?void 0:a.values.status)??"idle";return v.jsxs("div",{className:"mdma-webhook","data-component-id":t.id,children:[t.label&&v.jsx("span",{className:"mdma-webhook-label",children:t.label}),v.jsxs("span",{className:`mdma-webhook-status mdma-webhook-status--${c}`,children:["Webhook: ",r?"triggered":c]}),!r&&c==="idle"&&v.jsx("button",{type:"button",className:"mdma-webhook-trigger",onClick:()=>{o(!0),l({type:"INTEGRATION_CALLED",componentId:t.id,integrationId:"webhook",result:{status:"triggered",url:t.url,method:t.method}})},children:"Trigger webhook"})]})});function Uy(i){const t=i.trim().split(`
591
+ `).filter(r=>r.trim()!=="");if(t.length===0)return{headers:[],rows:[]};const a=t[0].split(",").map(r=>r.trim()),l=t.slice(1).map(r=>{const o=r.split(",").map(h=>h.trim()),c={};return a.forEach((h,p)=>{const m=o[p]??"",b=Number(m);c[h]=m!==""&&!Number.isNaN(b)?b:m}),c});return{headers:a,rows:l}}function WT(i){const t=new Set;for(const a of i)for(const l of Object.keys(a))t.add(l);return{headers:[...t],rows:i}}const PT=W.memo(function({component:t,resolveBinding:a}){const l=W.useMemo(()=>{if(t.type!=="chart")return{headers:[],rows:[]};const r=t.data;if(va(r))return{headers:[],rows:[]};if(typeof r=="string"&&r.startsWith("{{")){const o=a(r);return typeof o=="string"?Uy(o):{headers:[],rows:[]}}return Uy(r)},[t,a]);return t.type!=="chart"?null:va(t.data)?v.jsx(eA,{component:t}):l.rows.length===0?v.jsxs("div",{className:"mdma-chart mdma-chart--empty","data-component-id":t.id,children:[t.label&&v.jsx("div",{className:"mdma-chart-label",children:t.label}),v.jsx("div",{className:"mdma-chart-empty",children:"No chart data"})]}):v.jsxs("div",{className:"mdma-chart","data-component-id":t.id,children:[t.label&&v.jsx("div",{className:"mdma-chart-label",children:t.label}),v.jsxs("div",{className:"mdma-chart-variant",children:[t.variant??"line"," chart"]}),v.jsxs("table",{className:"mdma-chart-data",children:[v.jsx("thead",{children:v.jsx("tr",{children:l.headers.map(r=>v.jsx("th",{children:r},r))})}),v.jsx("tbody",{children:l.rows.map((r,o)=>v.jsx("tr",{children:l.headers.map(c=>v.jsx("td",{children:String(r[c]??"")},c))},o))})]})]})});function eA({component:i}){const t=Zl(),a=Ld(i.id),l=zt("chart","dataLoading")??Bd,r=zt("chart","dataError")??qd,o=zt("chart","dataEmpty")??sv;if(!a||a.status==="loading")return v.jsx(l,{componentId:i.id});if(a.status==="error")return v.jsx(r,{componentId:i.id,error:a.error??"Failed to load chart data",onRetry:()=>t.retryData(i.id)});if(a.rows.length===0)return v.jsx(o,{componentId:i.id,label:i.label});const c=WT(a.rows);return v.jsxs("div",{className:"mdma-chart","data-component-id":i.id,children:[i.label&&v.jsx("div",{className:"mdma-chart-label",children:i.label}),v.jsxs("div",{className:"mdma-chart-variant",children:[i.variant??"line"," chart"]}),v.jsxs("table",{className:"mdma-chart-data",children:[v.jsx("thead",{children:v.jsx("tr",{children:c.headers.map(h=>v.jsx("th",{children:h},h))})}),v.jsx("tbody",{children:c.rows.map((h,p)=>v.jsx("tr",{children:c.headers.map(m=>v.jsx("td",{children:String(h[m]??"")},m))},p))})]})]})}const tA=W.memo(function({component:t,componentState:a,dispatch:l}){if(t.type!=="thinking")return null;const r=(a==null?void 0:a.values.collapsed)??t.collapsed??!0,o=t.status??"done",c=t.label??"Thinking",h=p=>{p.preventDefault(),l({type:"FIELD_CHANGED",componentId:t.id,field:"collapsed",value:!r})};return v.jsxs("details",{className:`mdma-thinking mdma-thinking--${o}`,"data-component-id":t.id,open:!r,children:[v.jsxs("summary",{className:"mdma-thinking-summary",onClick:h,children:[o==="thinking"&&v.jsx("span",{className:"mdma-thinking-indicator"}),v.jsx("span",{className:"mdma-thinking-label",children:c})]}),v.jsx("div",{className:"mdma-thinking-content",children:t.content})]})}),nA=W.memo(function({component:t,componentState:a,dispatch:l,resolveBinding:r}){const o=NT();if(t.type!=="custom")return null;const c=o[t.name];return c?v.jsx(c,{component:t,props:t.props,componentState:a,dispatch:l,resolveBinding:r}):v.jsxs("div",{className:"mdma-unknown-component","data-component-id":t.id,children:["Unknown custom component: ",t.name]})}),iA={form:VT,button:YT,tasklist:GT,table:ZT,callout:XT,"approval-gate":FT,webhook:JT,chart:PT,thinking:tA,custom:nA},$f=W.memo(function({block:t,renderers:a}){const l=Zl(),r=DT(t.component.id),o=W.useCallback(p=>l.dispatch(p),[l]),c=W.useCallback(p=>l.resolveBinding(p),[l]),h=(a==null?void 0:a[t.component.type])??iA[t.component.type];return h?v.jsx(h,{component:t.component,componentState:r,dispatch:o,resolveBinding:c}):v.jsxs("div",{className:"mdma-unknown-component",children:["Unknown component type: ",t.component.type]})});function aA(i){if(!i)return null;const t=i.match(/^\s*type:\s*(\S+)/m);return t?t[1]:null}const sA=W.memo(function({node:t}){const a=aA(t.value);return v.jsxs("div",{className:"mdma-block-loading",children:[v.jsx("div",{className:"mdma-block-loading-shimmer"}),v.jsxs("div",{className:"mdma-block-loading-content",children:[v.jsx("span",{className:"mdma-block-loading-icon"}),v.jsx("span",{className:"mdma-block-loading-text",children:a?`Loading ${a} component...`:"Loading component..."})]})]})});function nn(i){return!i||i.length===0?null:i.map((t,a)=>v.jsx(rv,{node:t},a))}function rv({node:i}){switch(i.type){case"heading":{const t=`h${i.depth??1}`;return v.jsx(t,{children:nn(i.children)})}case"paragraph":return v.jsx("p",{children:nn(i.children)});case"blockquote":return v.jsx("blockquote",{children:nn(i.children)});case"list":{const t=i.ordered?"ol":"ul";return v.jsx(t,{start:i.ordered?i.start??1:void 0,children:nn(i.children)})}case"listItem":return i.checked!=null?v.jsxs("li",{className:"mdast-task-item",children:[v.jsx("input",{type:"checkbox",checked:i.checked,readOnly:!0}),nn(i.children)]}):v.jsx("li",{children:nn(i.children)});case"code":return v.jsx("pre",{className:"mdast-code-block",children:v.jsx("code",{className:i.lang?`language-${i.lang}`:void 0,children:i.value})});case"thematicBreak":return v.jsx("hr",{});case"html":return v.jsx("div",{className:"mdast-raw-html",children:i.value});case"table":{const t=i.children??[],a=t[0],l=t.slice(1);return v.jsxs("table",{className:"mdast-table",children:[a&&v.jsx("thead",{children:v.jsx("tr",{children:(a.children??[]).map((r,o)=>{var c;return v.jsx("th",{style:(c=i.align)!=null&&c[o]?{textAlign:i.align[o]}:void 0,children:nn(r.children)},o)})})}),l.length>0&&v.jsx("tbody",{children:l.map((r,o)=>v.jsx("tr",{children:(r.children??[]).map((c,h)=>{var p;return v.jsx("td",{style:(p=i.align)!=null&&p[h]?{textAlign:i.align[h]}:void 0,children:nn(c.children)},h)})},o))})]})}case"text":return v.jsx(v.Fragment,{children:i.value});case"emphasis":return v.jsx("em",{children:nn(i.children)});case"strong":return v.jsx("strong",{children:nn(i.children)});case"delete":return v.jsx("del",{children:nn(i.children)});case"inlineCode":return v.jsx("code",{className:"mdast-inline-code",children:i.value});case"link":return v.jsx("a",{href:i.url,title:i.title??void 0,target:"_blank",rel:"noopener noreferrer",children:nn(i.children)});case"image":return v.jsx("img",{src:i.url,alt:i.alt??"",title:i.title??void 0});case"break":return v.jsx("br",{});default:return i.children?v.jsx(v.Fragment,{children:nn(i.children)}):i.value?v.jsx(v.Fragment,{children:i.value}):null}}const lA=W.memo(function({node:t}){return v.jsx("div",{className:"mdma-markdown-content",children:v.jsx(rv,{node:t})})});function rA(i){return typeof i=="object"&&i!==null&&("renderer"in i||"elements"in i)}function uA(i){if(!i)return{renderers:void 0,elementOverrides:void 0};const t={},a={};for(const[l,r]of Object.entries(i))rA(r)?(r.renderer&&(t[l]=r.renderer),r.elements&&(a[l]=r.elements)):t[l]=r;return{renderers:Object.keys(t).length>0?t:void 0,elementOverrides:Object.keys(a).length>0?a:void 0}}function uv(i){if(!i)return null;const t=i.match(/^\s*id:\s*(\S+)/m);return t?t[1]:null}function oA(i){if(!i)return null;const t=i.match(/^\s*type:\s*(\S+)/m);return t?t[1]:null}function cA(i){const t=uv(i);if(!t)return null;const a=i.match(/^\s*label:\s*(.+)$/m),l=a?a[1].trim():void 0;let r="";const o=i.match(/^\s*content:\s*\|\s*\n([\s\S]*)$/m);if(o){const c=o[1],h=[];for(const p of c.split(`
592
+ `)){if(p.length>0&&!p.startsWith(" ")&&!p.startsWith(" "))break;h.push(p.replace(/^ {1,2}/,""))}r=h.join(`
593
+ `).trimEnd()}else{const c=i.match(/^\s*content:\s*(?:"([^"]*)"|'([^']*)'|(.+))$/m);c&&(r=(c[1]??c[2]??c[3]??"").trim())}return{type:"mdmaBlock",rawYaml:i,component:{type:"thinking",id:t,content:r||"...",status:"thinking",collapsed:!1,...l?{label:l}:{}}}}function fA({ast:i,store:t,customizations:a,theme:l,className:r}){const{renderers:o,elementOverrides:c}=W.useMemo(()=>uA(a==null?void 0:a.components),[a==null?void 0:a.components]),h=W.useContext(Ly),p=W.useMemo(()=>l!==void 0?jT(l):h,[l,h]),m=W.useRef(new Map);return v.jsx(TT,{store:t,dataSources:a==null?void 0:a.dataSources,children:v.jsx(ET,{value:a==null?void 0:a.customVariants,children:v.jsx(AT,{value:c,children:v.jsx(Ly.Provider,{value:p,children:v.jsx("div",{className:`mdma-document ${r??""}`,"data-theme":p.dataTheme,style:p.style,children:i.children.map((b,y)=>{if(dA(b))return m.current.set(b.component.id,b),v.jsx($f,{block:b,renderers:o},b.component.id);if(hA(b)){const S=b.value,x=uv(S),N=x?m.current.get(x):null;if(N)return v.jsx($f,{block:N,renderers:o},N.component.id);if(oA(S)==="thinking"&&S){const M=cA(S);if(M)return v.jsx($f,{block:M,renderers:o},M.component.id)}return v.jsx(sA,{node:b},y)}return v.jsx(lA,{node:b},y)})})})})})})}function dA(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="mdmaBlock"}function hA(i){return typeof i=="object"&&i!==null&&"type"in i&&i.type==="code"&&"lang"in i&&i.lang===Zy}function mA({role:i,content:t,ast:a,store:l}){const r=i==="user";return v.jsxs("div",{className:`flex flex-col gap-1 ${r?"items-end":""}`,children:[v.jsx("span",{className:`text-[11px] font-semibold ${r?"text-primary":"text-success"}`,children:r?"You":"MDMA AI"}),r?v.jsx("div",{className:"px-3 py-2 rounded-lg bg-primary-light text-primary-text text-sm leading-relaxed max-w-[80%]",children:t}):a&&l?v.jsx("div",{className:"px-4 py-3 rounded-lg bg-surface-2 border border-border-light text-sm leading-relaxed w-full overflow-auto",children:v.jsx(fA,{ast:a,store:l})}):t?v.jsxs("div",{className:"px-4 py-3 rounded-lg bg-surface-2 border border-border-light w-full",children:[v.jsx("pre",{className:"m-0 whitespace-pre-wrap text-xs text-text-secondary",children:t}),v.jsx("span",{className:"text-[11px] text-primary",children:"Parsing..."})]}):v.jsx("div",{className:"px-4 py-3 rounded-lg bg-surface-2 border border-border-light w-full",children:v.jsx("span",{className:"text-xs text-text-muted",children:"Generating..."})})]})}const pA=200,Ud="mdma-builder-preview-messages";function gA(){try{const i=localStorage.getItem(Ud);return i?JSON.parse(i):[]}catch{return[]}}function yA(i){const t=i.filter(a=>a.content).map(({id:a,role:l,content:r})=>({id:a,role:l,content:r}));localStorage.setItem(Ud,JSON.stringify(t))}function bA({customPrompt:i,llmConfig:t,llmOverride:a,onOverrideChange:l,chatConfig:r}){const[o,c]=W.useState(!1),h=Kf(t.baseUrl),p=h?Bl[h]:null,m=!!(a.model||a.baseUrl||a.apiKey),[b,y]=W.useState([]),[S,x]=W.useState(""),[N,T]=W.useState(!1),[M,j]=W.useState(null),[Y,H]=W.useState(!1),Z=W.useRef(null),te=W.useRef(0),q=W.useRef(null),C=W.useRef(b);C.current=b,W.useEffect(()=>{const se=gA();if(se.length===0){H(!0);return}const _=Math.max(...se.map(V=>V.id));te.current=_;const E=se.map(V=>({...V,ast:null,store:null}));y(E),(async()=>{for(const V of se)if(V.role==="assistant"&&V.content)try{const{ast:w,store:ie}=await Ry(V.content);y(fe=>fe.map(ue=>ue.id===V.id?{...ue,ast:w,store:ie}:ue))}catch{}H(!0)})()},[]),W.useEffect(()=>{Y&&!N&&yA(b)},[b,Y,N]);const B=W.useCallback(()=>{var se;(se=q.current)==null||se.scrollIntoView({behavior:"smooth"})},[]),X=W.useCallback(async(se,_)=>{var E;try{const V=((E=C.current.find(fe=>fe.id===_))==null?void 0:E.store)??void 0,{ast:w,store:ie}=await Ry(se,V);y(fe=>fe.map(ue=>ue.id===_?{...ue,ast:w,store:ie}:ue))}catch{}},[]),F=W.useRef(!1),P=W.useCallback(async se=>{if(!se||F.current)return;j(null),T(!0),F.current=!0;const _={id:++te.current,role:"user",content:se,ast:null,store:null},E={id:++te.current,role:"assistant",content:"",ast:null,store:null},V=C.current;y([...V,_,E]),B();const ie=[{role:"system",content:K1({customPrompt:i||void 0})},...V.map(ye=>({role:ye.role,content:ye.content})),{role:"user",content:`${se}
594
+
595
+ Respond with an MDMA Markdown document. Do not wrap it in code fences.`}];Z.current=new AbortController;const fe=E.id;let ue=0;try{let ye="";try{for await(const Ke of Hy(t,ie,Z.current.signal)){ye+=Ke;const Be=ye;y(xn=>xn.map(Hn=>Hn.id===fe?{...Hn,content:Be}:Hn));const yt=Date.now();yt-ue>=pA&&(ue=yt,X(Be,fe))}}catch(Ke){if(Z.current.signal.aborted)throw Ke;ye=await Vy(t,ie,Z.current.signal),y(Be=>Be.map(yt=>yt.id===fe?{...yt,content:ye}:yt))}await X(ye,fe)}catch(ye){ye instanceof DOMException&&ye.name==="AbortError"||j(ye instanceof Error?ye.message:String(ye))}finally{T(!1),F.current=!1,Z.current=null}},[i,t,X,B]),ne=W.useRef(P);ne.current=P;const pe=W.useCallback(()=>{const se=S.trim();se&&(x(""),ne.current(se))},[S]),Ae=W.useRef(new Set);W.useEffect(()=>{for(const se of b)if(se.role==="assistant"&&se.store&&!Ae.current.has(se.store)){Ae.current.add(se.store);const _=se.store;_.getEventBus().on("ACTION_TRIGGERED",E=>{const V=_.getComponentState(E.componentId);if(!V)return;const w=V.values,ie=Object.entries(w);if(ie.length===0)return;const fe=ie.map(([ue,ye])=>`${ue}: ${ye}`).join(`
596
+ `);ne.current(`[Form submitted: ${E.componentId}]
597
+ ${fe}`)})}return()=>{}},[b]),W.useEffect(()=>()=>{Ae.current.clear()},[]);const be=W.useCallback(()=>{var se;(se=Z.current)==null||se.abort()},[]),U=W.useCallback(()=>{var se;(se=Z.current)==null||se.abort(),y([]),j(null),x(""),te.current=0,localStorage.removeItem(Ud)},[]),de=!(t.apiKey.length>0||t.baseUrl.includes("localhost"))||!i;return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex gap-2 items-center pb-2 border-b border-border-light",children:[v.jsx("h3",{className:"m-0 text-sm font-semibold text-text-primary",children:"Preview Chat"}),i?v.jsx("span",{className:"text-[11px] text-success",children:"customPrompt loaded"}):v.jsx("span",{className:"text-[11px] text-warning",children:"Generate a prompt first"}),v.jsx("button",{type:"button",onClick:()=>c(se=>!se),className:"border-none bg-transparent text-primary cursor-pointer text-xs p-0 hover:text-primary-hover",children:o?"Hide Settings":"Settings"}),v.jsxs("span",{className:"text-[11px] text-text-muted",children:[(p==null?void 0:p.label)||"Custom"," / ",t.model,m&&" (override)"]}),v.jsx("div",{className:"flex-1"}),b.length>0&&v.jsx("button",{type:"button",onClick:U,className:"border-none bg-transparent text-primary cursor-pointer text-xs p-0 hover:text-primary-hover",children:"Clear"})]}),o&&v.jsxs("div",{className:"p-3 border border-border rounded-lg bg-surface-1 mb-2 flex flex-col gap-2.5",children:[v.jsxs("span",{className:"text-xs text-text-secondary font-medium",children:["Preview LLM Override",v.jsx("span",{className:"text-text-muted font-normal ml-1",children:"(leave empty to use Chat settings)"})]}),v.jsxs("div",{className:"flex gap-2",children:[v.jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[v.jsx("span",{className:"text-[11px] text-text-secondary",children:"Model"}),v.jsx("input",{placeholder:r.model,value:a.model??"",onChange:se=>l({...a,model:se.target.value}),className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary"})]}),v.jsxs("div",{className:"flex-1 flex flex-col gap-1",children:[v.jsx("span",{className:"text-[11px] text-text-secondary",children:"API Key"}),v.jsx("input",{placeholder:r.apiKey?"••••••••":"Same as Chat",type:"password",value:a.apiKey??"",onChange:se=>l({...a,apiKey:se.target.value}),className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary"})]}),v.jsxs("div",{className:"flex-[2] flex flex-col gap-1",children:[v.jsx("span",{className:"text-[11px] text-text-secondary",children:"Base URL"}),v.jsx("input",{placeholder:r.baseUrl,value:a.baseUrl??"",onChange:se=>l({...a,baseUrl:se.target.value}),className:"px-2 py-1.5 border border-border rounded bg-surface-2 text-text-primary text-xs outline-none focus:border-primary"})]})]}),m&&v.jsx("button",{type:"button",onClick:()=>l({}),className:"self-start border-none bg-transparent text-primary cursor-pointer text-xs p-0 hover:text-primary-hover",children:"Reset to Chat settings"})]}),v.jsxs("div",{className:"flex-1 overflow-y-auto py-2 flex flex-col gap-3",children:[b.length===0&&v.jsx("div",{className:"text-text-muted text-sm text-center py-10 px-5",children:i?v.jsx(v.Fragment,{children:"Test your generated prompt here. Ask the LLM to create an interactive document and see MDMA components render live."}):v.jsxs(v.Fragment,{children:["Switch to the ",v.jsx("strong",{children:"Chat"})," tab and generate a prompt first, then come back here to test it."]})}),b.map(se=>v.jsx(mA,{role:se.role,content:se.content,ast:se.ast,store:se.store},se.id)),M&&v.jsx("div",{className:"text-xs text-error px-2",children:M}),v.jsx("div",{ref:q})]}),v.jsx(Yy,{value:S,onChange:x,onSend:pe,onStop:be,isGenerating:N,disabled:de,placeholder:"Describe the interactive document you need...",sendLabel:"Send"})]})}function vA({theme:i,onToggle:t}){return v.jsx("button",{type:"button",onClick:t,className:"p-2 rounded-lg border border-border bg-surface-1 hover:bg-surface-2 text-text-secondary hover:text-text-primary transition-colors text-sm",title:`Switch to ${i==="dark"?"light":"dark"} mode`,children:i==="dark"?"☀️":"🌙"})}function xA({steps:i,currentStep:t,onStepChange:a}){const l=i.findIndex(r=>r.id===t);return v.jsx("nav",{className:"flex lg:flex-col border-b lg:border-b-0 border-border-light",children:v.jsx("div",{className:"flex lg:flex-col w-full",children:i.map((r,o)=>v.jsxs("button",{type:"button",onClick:()=>a(r.id),className:`
598
+ flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors
599
+ border-b-2 lg:border-b-0 lg:border-l-2 flex-1 lg:flex-none
600
+ ${t===r.id?"border-primary text-primary bg-primary-light/50":"border-transparent text-text-secondary hover:text-text-primary hover:bg-surface-1"}
601
+ `,children:[v.jsx("span",{className:`
602
+ w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold
603
+ ${o<l?"bg-success text-white":t===r.id?"bg-primary text-white":"bg-surface-3 text-text-secondary"}
604
+ `,children:o<l?"✓":r.icon}),v.jsx("span",{className:"hidden sm:inline",children:r.label})]},r.id))})})}function SA({domain:i}){const t=new Set;for(const a of i.flowSteps)for(const l of a.components)l.enabled&&t.add(l.type);return v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx("h3",{className:"text-sm font-semibold text-text-primary m-0",children:"Summary"}),v.jsxs("div",{className:"text-xs text-text-secondary space-y-1",children:[v.jsxs("p",{children:[v.jsx("span",{className:"font-medium text-text-primary",children:"Flow:"})," ",i.name||"(not set)"]}),v.jsxs("p",{children:[v.jsx("span",{className:"font-medium text-text-primary",children:"Domain:"})," ",i.domain||"(not set)"]}),v.jsxs("p",{children:[v.jsx("span",{className:"font-medium text-text-primary",children:"Components:"})," ",t.size>0?[...t].join(", "):"(none)"]})]}),i.flowSteps.length>0&&v.jsxs("div",{className:"flex flex-col gap-1 mt-1",children:[v.jsxs("span",{className:"text-xs font-medium text-text-primary",children:["Conversation Flow (",i.flowSteps.length," step",i.flowSteps.length>1?"s":"",")"]}),i.flowSteps.map((a,l)=>{const r=a.components.filter(o=>o.enabled).map(o=>o.type);return v.jsxs("div",{className:"text-xs text-text-muted py-1 border-b border-border-light last:border-0",children:[v.jsxs("span",{className:"font-medium text-primary-text",children:[l+1,". ",a.label||`Step ${l+1}`]}),v.jsxs("span",{className:"ml-1 text-text-secondary",children:["(",a.triggerMode,")"]}),r.length>0&&v.jsxs("span",{className:"ml-1",children:["—"," ",r.join(", ")]})]},l)})]})]})}function kA({tabs:i,activeTab:t,onTabChange:a,indicators:l={}}){return v.jsx("div",{className:"flex border-b border-border-light px-4",children:i.map(r=>v.jsxs("button",{type:"button",onClick:()=>a(r),className:`
605
+ px-4 py-2.5 text-sm font-medium border-b-2 transition-colors capitalize
606
+ ${t===r?"border-primary text-primary":"border-transparent text-text-secondary hover:text-text-primary"}
607
+ `,children:[r,l[r]&&v.jsx("span",{className:`ml-1.5 w-1.5 h-1.5 rounded-full inline-block ${l[r]}`})]},r))})}const wA=`You are an expert MDMA prompt engineer. Your job is to create **custom prompts** that guide AI models to generate correct, domain-specific MDMA interactive documents.
608
+
609
+ ## Context
610
+
611
+ MDMA (Markdown Document with Mounted Applications) extends Markdown with interactive components defined in fenced \`mdma\` code blocks. **MDMA components use YAML syntax inside the fenced blocks — never JSON.** Users install MDMA libraries in their apps and use \`buildSystemPrompt({ customPrompt })\` to configure their AI chat. The \`buildSystemPrompt\` function automatically prepends the full MDMA specification (all component types, binding syntax, authoring rules). Your output is the \`customPrompt\` that layers on top.
612
+
613
+ **Your output will be concatenated AFTER the full MDMA spec.** Therefore you MUST NOT:
614
+ - Repeat the MDMA component schemas (they're already in the spec)
615
+ - Repeat the base authoring rules (unique IDs, sensitive flags, etc.)
616
+ - Include the self-check checklist (already provided)
617
+
618
+ **You MUST:**
619
+ - Define the domain context and purpose
620
+ - Specify which components to use and when
621
+ - Define **conversation flow** — a multi-step sequence describing when to generate MDMA components at each stage (e.g., Step 1: show form on keyword, Step 2: show approval gate after form submission)
622
+ - Provide domain-specific examples showing realistic content
623
+ - Define business rules, validation constraints, and workflow logic
624
+ - Specify which fields should be marked as sensitive
625
+ - Define the expected document structure and flow
626
+
627
+ ## What You Receive
628
+
629
+ The user will provide a configuration describing their needs:
630
+ - **Domain**: The business domain (e.g., finance, healthcare, engineering)
631
+ - **Description**: What the flow/document should accomplish
632
+ - **Selected components**: Which MDMA component types to use (the builder offers form, button, tasklist, table, callout, approval-gate, webhook, chart and thinking; a host-registered \`custom\` variant can also be listed)
633
+ - **Component configurations**: Field definitions, options, roles, etc.
634
+ - **Data sources** (optional): An "Available data sources" catalog of external data sources the host exposes (see External Data Sources below)
635
+ - **Business rules**: Free-text constraints and requirements
636
+ - **Conversation flow**: An ordered list of steps, each with a trigger condition (immediate, keyword, form-submit, contextual) and which components to render at that point
637
+
638
+ ## Required Fields per Component
639
+
640
+ When writing domain examples with \`mdma\` blocks, every block MUST include all required fields for its type. Missing required fields cause validation errors.
641
+
642
+ | Component | Required fields (besides \`id\` and \`type\`) |
643
+ |-----------------|--------------------------------------------------------------|
644
+ | form | \`fields\` (array, each with \`name\`, \`type\`, \`label\`), \`onSubmit\` (action ID — renders submit button) |
645
+ | callout | \`content\` |
646
+ | button | \`text\` |
647
+ | approval-gate | \`title\` |
648
+ | tasklist | \`items\` (array, each with \`id\` and \`text\`) |
649
+ | table | \`columns\` (array, each with \`key\` and \`header\`), \`data\` (array of row objects, a quoted \`"{{binding}}"\`, or \`{ source, params }\`) |
650
+ | chart | \`data\` (CSV string with a header row first, e.g. \`"Header1, Header2\\nVal1, Val2"\`, a quoted \`"{{binding}}"\`, or \`{ source, params }\`) |
651
+ | webhook | \`url\`, \`trigger\` |
652
+ | thinking | \`content\` |
653
+ | custom | \`name\` (a registered variant name) |
654
+
655
+ **Every form MUST include \`onSubmit\`** with a descriptive action ID (e.g., \`onSubmit: submit-kyc-form\`). Without it, the form renders without a submit button and users cannot submit their data.
656
+
657
+ Select fields use \`options\` as an array of objects: \`- label: "Display" value: key\`, NOT flat strings. Quote numeric-looking values (\`value: "1"\`, not \`value: 1\`). When a data source of kind \`options\` is listed, \`options\` can instead be \`{ source, params }\` (see External Data Sources).
658
+ Approval gates use \`allowedRoles\` (NOT \`roles\`) for role restrictions.
659
+ Tables can also set \`sortable\` (per column or on the table), \`filterable\` (adds a filter box) and \`pageSize\` (positive integer). For a large data source, set \`pageSize\` so the table pages instead of loading everything.
660
+ A \`custom\` component is a standalone top-level block, NEVER a form field \`type\` and never nested in a form's \`fields\`. Include it only when it is listed under "Selected Components", with a \`name\` the configuration provides (never invent one); variant inputs go under \`props\`, event wiring under \`actions\`.
661
+
662
+ ## External Data Sources
663
+
664
+ When the configuration includes an "Available data sources" catalog, each entry is a **definition without data**: it names a source and declares its \`kind\`, \`columns\` and \`params\`. The host fetches the rows when the document renders, so the AI never writes them. Your custom prompt MUST tell the AI to reference a source and NEVER to generate inline rows, options or CSV for data a source covers.
665
+
666
+ | Source kind | Used in | Reference goes in |
667
+ |-------------|----------------------------------|---------------------------------|
668
+ | \`rows\` | \`table\` | \`table.data\` |
669
+ | \`series\` | \`chart\` | \`chart.data\` |
670
+ | \`options\` | \`form\` select field | the select field's \`options\` |
671
+
672
+ Rules to carry into the custom prompt:
673
+ - Reference a source as a YAML mapping: \`source: <name>\` with optional \`params:\` underneath. Use only source names from the catalog and NEVER invent one. If the request needs data no listed source provides, say the data is not available instead of fabricating it.
674
+ - The kind must match the slot: a \`rows\` source feeds only a table, a \`series\` source only a chart, an \`options\` source only a select.
675
+ - When the same data is needed as both a table and a chart, the catalog holds two sources, a \`rows\` one and a \`series\` one, under different names. Use the \`rows\` source for the table and the \`series\` source for the chart.
676
+ - \`table.columns[].key\` and chart \`xAxis\` / \`yAxis\` MUST be columns of the referenced source.
677
+ - Give each param a value of its declared type, respect \`allowed\` values, and always supply required params. A param value can be a quoted binding such as \`"{{filters.service}}"\` so the data reacts to another component.
678
+ - Data sources are not components: use them only inside table, chart and form components that are listed under "Selected Components".
679
+
680
+ Example of what a data-source-backed section of a custom prompt looks like:
681
+
682
+ \`\`\`\`
683
+ \`\`\`mdma
684
+ type: table
685
+ id: open-incidents
686
+ sortable: true
687
+ filterable: true
688
+ pageSize: 10
689
+ columns:
690
+ - key: title
691
+ header: Title
692
+ sortable: true
693
+ - key: severity
694
+ header: Severity
695
+ data:
696
+ source: incidents
697
+ params:
698
+ status: open
699
+ \`\`\`
700
+
701
+ \`\`\`mdma
702
+ type: chart
703
+ id: incidents-per-day
704
+ variant: line
705
+ label: Incidents per day
706
+ xAxis: day
707
+ yAxis: count
708
+ data:
709
+ source: incidents-by-day
710
+ params:
711
+ status: open
712
+ \`\`\`
713
+
714
+ \`\`\`mdma
715
+ type: form
716
+ id: incident-filters
717
+ onSubmit: apply-incident-filters
718
+ fields:
719
+ - name: service
720
+ type: select
721
+ label: Service
722
+ options:
723
+ source: services
724
+ \`\`\`
725
+ \`\`\`\`
726
+
727
+ ## Output Format
728
+
729
+ Generate a clean, well-structured custom prompt in plain text. Structure it as:
730
+
731
+ 1. **Role & Domain** — Set the domain context ("You are assisting with [domain] workflows...")
732
+ 2. **Conversation Flow** — Define the multi-step conversation flow. For each step, specify:
733
+ - What triggers it (user keyword, form submission, contextual condition, or immediate)
734
+ - Which components to render
735
+ - How the AI should respond at this step
736
+ The AI must follow these steps in order — after completing one step, wait for the appropriate trigger before moving to the next. Do NOT show all components at once unless the flow has a single step.
737
+ 3. **Document Purpose** — What the generated document should achieve
738
+ 4. **Component Instructions** — For each selected component, provide:
739
+ - When to include it
740
+ - What content/fields it should have
741
+ - Domain-specific field names and labels
742
+ - Which fields are sensitive (PII)
743
+ - Which catalog source (and params) feeds each table, chart or select, when the configuration lists data sources
744
+ 5. **Workflow Logic** — How components relate to each other (bindings, action triggers, approval flows)
745
+ 6. **MANDATORY: Concrete MDMA Examples** — For EVERY form in the configuration, you MUST include a complete \`\`\`mdma code block example showing the exact form with all its fields. This is NOT optional. The AI that reads your prompt needs these examples to generate correct MDMA output. Examples MUST use **YAML syntax** inside fenced \`mdma\` code blocks (never JSON). Every example block MUST include all required fields for its component type — omitting required fields is a validation error. If the flow has 2 steps with 2 forms, include 2 separate form examples.
746
+ 7. **Constraints** — Things the AI must or must not do in this domain
747
+
748
+ ## Example
749
+
750
+ Given a configuration for a KYC (Know Your Customer) flow in finance with a 3-step conversation flow (Step 1: form on keyword trigger, Step 2: approval-gate after form submission, Step 3: tasklist after approval), you would generate:
751
+
752
+ ---
753
+
754
+ You are assisting with KYC (Know Your Customer) verification workflows in the financial services domain.
755
+
756
+ ### Document Purpose
757
+ Generate interactive KYC case review documents that collect applicant information, enforce compliance checks, and require dual approval before account activation.
758
+
759
+ ### Conversation Flow
760
+
761
+ **Step 1 — Collect Applicant Data**
762
+ When the user says "start KYC review", "new customer verification", or "verify identity", respond with a form to collect applicant information. Do NOT show the approval gate or tasklist yet.
763
+
764
+ Form fields: full name, date of birth, nationality, government ID number, ID type (passport/driver's license/national ID), residential address, email, phone.
765
+ - Mark as sensitive: government ID number, date of birth, residential address, email, phone
766
+ - All fields required except phone
767
+ - Use a select field for ID type with standard document options
768
+
769
+ **Step 2 — Compliance Review**
770
+ After the user submits the applicant form, show the compliance approval gate. Include a thinking block analyzing the case before presenting the component. Do NOT show the verification checklist yet.
771
+
772
+ Approval Gate:
773
+ - Require 2 approvers with roles: compliance-officer, senior-analyst
774
+ - Require a reason on denial
775
+ - Title: "KYC Compliance Approval"
776
+
777
+ Include a callout with variant "warning" if the case involves a PEP (Politically Exposed Person).
778
+
779
+ **Step 3 — Verification Checklist**
780
+ After the compliance approval gate is approved, show the verification checklist.
781
+
782
+ Tasklist:
783
+ - Items: identity document verified, address proof verified, PEP screening completed, sanctions list checked, source of funds verified
784
+ - All items required
785
+
786
+ ### Domain Example
787
+
788
+ Here are correctly structured MDMA blocks for a KYC review. They are listed together for reference only; in the conversation each message carries just one interactive component (the form in Step 1, the approval gate in Step 2):
789
+
790
+ \`\`\`\`
791
+ ## KYC Case Review
792
+
793
+ Please complete the applicant information below:
794
+
795
+ \`\`\`mdma
796
+ type: form
797
+ id: kyc-applicant-form
798
+ onSubmit: submit-kyc-form
799
+ fields:
800
+ - name: full_name
801
+ type: text
802
+ label: Full Legal Name
803
+ required: true
804
+ - name: date_of_birth
805
+ type: date
806
+ label: Date of Birth
807
+ required: true
808
+ sensitive: true
809
+ - name: nationality
810
+ type: text
811
+ label: Nationality
812
+ required: true
813
+ - name: id_type
814
+ type: select
815
+ label: ID Document Type
816
+ required: true
817
+ options:
818
+ - label: Passport
819
+ value: passport
820
+ - label: "Driver's License"
821
+ value: drivers-license
822
+ - label: National ID
823
+ value: national-id
824
+ - name: id_number
825
+ type: text
826
+ label: Government ID Number
827
+ required: true
828
+ sensitive: true
829
+ \`\`\`
830
+
831
+ \`\`\`mdma
832
+ type: approval-gate
833
+ id: kyc-compliance-approval
834
+ title: KYC Compliance Approval
835
+ allowedRoles:
836
+ - compliance-officer
837
+ - senior-analyst
838
+ requiredApprovers: 2
839
+ requireReason: true
840
+ \`\`\`
841
+
842
+ \`\`\`mdma
843
+ type: callout
844
+ id: pep-warning
845
+ variant: warning
846
+ title: PEP Flag Detected
847
+ content: "This applicant has been flagged as a Politically Exposed Person (PEP). Enhanced due diligence is required before approval."
848
+ dismissible: false
849
+ \`\`\`
850
+ \`\`\`\`
851
+
852
+ ### Constraints
853
+ - Always include a thinking block analyzing the case complexity
854
+ - Never display raw ID numbers in the document text
855
+ - Use formal, compliance-appropriate language
856
+
857
+ ---
858
+
859
+ ## CRITICAL: Component Scope Rule
860
+
861
+ **ONLY include components that appear under "Selected Components" in the user's configuration.** The description and business rules may mention other component types as context — IGNORE THEM. If the user selected only "form" and "thinking", your output must ONLY contain instructions and examples for form and thinking. Do not add approval-gate, tasklist, webhook, button, table, chart, or callout unless they are explicitly listed under "Selected Components".
862
+
863
+ This is the most important rule. Violating it produces a broken prompt that generates unwanted components.
864
+
865
+ ## Important Rules
866
+
867
+ 1. **Be specific** — Use real field names, labels, and options relevant to the domain. Don't use generic placeholders.
868
+ 2. **Strict component scope** — NEVER include components not listed under "Selected Components". The description and business rules provide context, not a component wishlist. If a business rule mentions "approval required" but approval-gate is not in Selected Components, reference the rule in prose but do NOT add an approval-gate component.
869
+ 3. **Be complete** — Cover all selected components with detailed instructions.
870
+ 4. **Be concise** — The prompt should be focused and actionable, not a tutorial.
871
+ 5. **Respect the architecture** — Your output is a \`customPrompt\`, not a standalone system prompt. Never include MDMA spec details that are already in the base prompt.
872
+ 6. **Use YAML, never JSON** — All domain examples with fenced \`mdma\` code blocks MUST use YAML syntax. MDMA components are always defined in YAML. Never use JSON objects like \`{"type": "form", ...}\` in examples.
873
+ 7. **Respect flow ordering** — When the configuration defines a multi-step conversation flow, your output MUST instruct the AI to present components in the defined step order, waiting for each trigger before proceeding to the next step. Do NOT show all components at once unless the flow has a single step. Each step's trigger must be clearly communicated so the AI knows when to advance.
874
+ 8. **Always include MDMA examples** — Your output MUST contain at least one \`\`\`mdma code block for every form defined in the configuration. A prompt without concrete MDMA examples is incomplete — the AI needs them to generate correct output. If there are 2 forms across 2 steps, include 2 form code blocks.
875
+ 9. **One interactive component per message** — The AI may emit at most one interactive component (\`form\`, \`button\`, \`webhook\`, \`approval-gate\`, \`tasklist\`) in a response; \`callout\`, \`table\`, \`chart\` and \`thinking\` can accompany it. Your custom prompt must never tell the AI to show two interactive components together: when a step lists several, instruct it to present them one per message, in order, telling the user what comes next.
876
+ 10. **Reference data sources, never inline their data** — When the configuration lists data sources, the tables, charts and select fields they cover use \`source\` and \`params\` exactly as described under External Data Sources. Do NOT write example rows, options or CSV for data a source provides.
877
+ `;function _A(i){switch(i.triggerMode){case"immediate":return"Immediately when the conversation starts";case"keyword":return i.trigger?`When the user says: ${i.trigger}`:"When the user says a specific keyword or phrase";case"form-submit":return"After the user submits the form/component from the previous step";case"contextual":return i.trigger||"Based on conversation context"}}function TA(i){var a,l,r;const t=[];if(t.push(` - **${i.type}**`),i.type==="form"&&((a=i.form)!=null&&a.fields.length)){t.push(" Fields:");for(const o of i.form.fields)t.push(` - ${o.name} (${o.type}, label: "${o.label}", required: ${o.required}, sensitive: ${o.sensitive})`)}if(i.type==="approval-gate"&&i.approvalGate){const o=i.approvalGate;t.push(` Roles: ${o.roles.join(", ")||"(none)"}`),t.push(` Required approvers: ${o.requiredApprovers}`),t.push(` Require reason on denial: ${o.requireReason}`)}if(i.type==="tasklist"&&((l=i.tasklist)!=null&&l.items.length)){t.push(" Items:");for(const o of i.tasklist.items)t.push(` - ${o}`)}if(i.type==="table"&&((r=i.table)!=null&&r.columns.length)){t.push(" Columns:");for(const o of i.table.columns)t.push(` - ${o.key}: "${o.header}"`)}return t}function AA(i){const t=["## User Configuration","",`**Flow Name:** ${i.name||"(not set)"}`,`**Domain:** ${i.domain||"(not set)"}`,`**Description:** ${i.description||"(not set)"}`];if(i.businessRules&&t.push(`**Business Rules:** ${i.businessRules}`),i.flowSteps.length>0){t.push("","**Conversation Flow:**","");for(let r=0;r<i.flowSteps.length;r++){const o=i.flowSteps[r];t.push(`Step ${r+1} — ${o.label||`Step ${r+1}`}`),t.push(` Trigger: ${_A(o)}`);const c=o.components.filter(h=>h.enabled);if(c.length>0){t.push(" Components:");for(const h of c)t.push(...TA(h))}o.description&&t.push(` ${o.description}`),t.push("")}const a=new Set;for(const r of i.flowSteps)for(const o of r.components)o.enabled&&a.add(o.type);a.size>0&&t.push(`**All Component Types Used:** ${[...a].join(", ")}`,"");let l=0;for(const r of i.flowSteps)l+=r.components.filter(o=>o.enabled&&o.type==="form").length;l>0&&t.push(`**IMPORTANT:** Your output MUST include concrete \`\`\`mdma code block examples for all ${l} form(s) defined above. Each form must include onSubmit and all specified fields.`,"")}return t.join(`
878
+ `)}function EA(i){const[t,a]=W.useState({name:"",domain:"",description:"",businessRules:"",flowSteps:[{label:"Step 1",triggerMode:"immediate",trigger:"",components:[],description:""}]}),[l,r]=W.useState([]),[o,c]=W.useState(""),[h,p]=W.useState(!1),[m,b]=W.useState(null),y=W.useRef(null),S=W.useCallback(async M=>{b(null),p(!0),y.current=new AbortController;const j=AA(t),Y=[...l,{role:"user",content:M?`${M}
879
+
880
+ ${j}`:`Generate a custom prompt based on this configuration:
881
+
882
+ ${j}`}];r(Y);const H=[{role:"system",content:wA},...Y];try{let Z="";try{for await(const te of Hy(i,H,y.current.signal))Z+=te,c(Z)}catch{Z=await Vy(i,H,y.current.signal),c(Z)}r(te=>[...te,{role:"assistant",content:Z}])}catch(Z){Z instanceof Error&&Z.name!=="AbortError"&&b(Z.message)}finally{p(!1)}},[t,l,i]),x=W.useCallback(()=>{var M;(M=y.current)==null||M.abort()},[]),N=W.useCallback(()=>{r([]),c(""),b(null)},[]),T=W.useCallback(M=>{a(j=>({...j,flowSteps:M}))},[]);return{domain:t,setDomain:a,updateFlowSteps:T,messages:l,generatedPrompt:o,isGenerating:h,error:m,generate:S,stop:x,reset:N}}function NA(){const i=localStorage.getItem("mdma-builder-theme");return i==="light"||i==="dark"?i:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function CA(){const[i,t]=W.useState(NA);W.useEffect(()=>{document.documentElement.classList.toggle("dark",i==="dark")},[i]);const a=W.useCallback(r=>{t(r),localStorage.setItem("mdma-builder-theme",r)},[]),l=W.useCallback(()=>{a(i==="dark"?"light":"dark")},[i,a]);return{theme:i,setTheme:a,toggle:l}}const Iy=[{domain:{name:"contact-form",domain:"support",description:"Collect contact info, then gather feedback after the issue is resolved.",businessRules:"Email is sensitive.",flowSteps:[{label:"Contact info",triggerMode:"immediate",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"name",type:"text",label:"Name",required:!0,sensitive:!1},{name:"email",type:"email",label:"Email",required:!0,sensitive:!0},{name:"message",type:"textarea",label:"Message",required:!0,sensitive:!1}]}}]},{label:"Feedback",triggerMode:"form-submit",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"rating",type:"select",label:"Rating",required:!0,sensitive:!1},{name:"comments",type:"textarea",label:"Comments",required:!1,sensitive:!1}]}}]}]}},{domain:{name:"bug-report",domain:"engineering",description:"Report a bug, then collect repro steps after initial triage.",businessRules:"Reporter email is sensitive.",flowSteps:[{label:"Bug details",triggerMode:"keyword",trigger:"bug, report bug, found a bug",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"title",type:"text",label:"Bug Title",required:!0,sensitive:!1},{name:"severity",type:"select",label:"Severity",required:!0,sensitive:!1},{name:"reporter_email",type:"email",label:"Reporter Email",required:!0,sensitive:!0}]}}]},{label:"Repro steps",triggerMode:"form-submit",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"steps",type:"textarea",label:"Steps to Reproduce",required:!0,sensitive:!1},{name:"expected",type:"textarea",label:"Expected Behavior",required:!0,sensitive:!1},{name:"actual",type:"textarea",label:"Actual Behavior",required:!0,sensitive:!1}]}}]}]}},{domain:{name:"event-rsvp",domain:"events",description:"RSVP for an event, then collect dietary preferences.",businessRules:"Phone number is sensitive.",flowSteps:[{label:"RSVP",triggerMode:"keyword",trigger:"rsvp, register, sign up",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"attendee_name",type:"text",label:"Name",required:!0,sensitive:!1},{name:"phone",type:"text",label:"Phone",required:!1,sensitive:!0},{name:"guests",type:"number",label:"Number of Guests",required:!0,sensitive:!1}]}}]},{label:"Preferences",triggerMode:"form-submit",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"dietary",type:"select",label:"Dietary Preference",required:!1,sensitive:!1},{name:"allergies",type:"text",label:"Allergies",required:!1,sensitive:!1}]}}]}]}},{domain:{name:"leave-request",domain:"hr",description:"Submit a leave request, then manager adds review notes.",businessRules:"No sensitive fields.",flowSteps:[{label:"Request",triggerMode:"immediate",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"employee_name",type:"text",label:"Employee Name",required:!0,sensitive:!1},{name:"leave_type",type:"select",label:"Leave Type",required:!0,sensitive:!1},{name:"start_date",type:"date",label:"Start Date",required:!0,sensitive:!1},{name:"end_date",type:"date",label:"End Date",required:!0,sensitive:!1}]}}]},{label:"Manager review",triggerMode:"form-submit",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"reviewer",type:"text",label:"Reviewer Name",required:!0,sensitive:!1},{name:"decision",type:"select",label:"Decision",required:!0,sensitive:!1},{name:"notes",type:"textarea",label:"Notes",required:!1,sensitive:!1}]}}]}]}},{domain:{name:"order-return",domain:"e-commerce",description:"Request a product return, then provide shipping details.",businessRules:"Address is sensitive.",flowSteps:[{label:"Return request",triggerMode:"keyword",trigger:"return, refund, send back",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"order_id",type:"text",label:"Order ID",required:!0,sensitive:!1},{name:"reason",type:"select",label:"Return Reason",required:!0,sensitive:!1},{name:"item_condition",type:"select",label:"Item Condition",required:!0,sensitive:!1}]}}]},{label:"Shipping details",triggerMode:"form-submit",trigger:"",description:"",components:[{type:"form",enabled:!0,form:{fields:[{name:"return_address",type:"textarea",label:"Return Address",required:!0,sensitive:!0},{name:"pickup_date",type:"date",label:"Preferred Pickup Date",required:!1,sensitive:!1}]}}]}]}}];function OA(){const i=Math.floor(Math.random()*Iy.length);return Iy[i]}const Cl=[{id:"domain",label:"Domain",icon:"1"},{id:"flow",label:"Flow",icon:"2"},{id:"generate",label:"Generate",icon:"3"}],jA=["chat","output","preview"];function MA(){const{theme:i,toggle:t}=CA(),[a,l]=W.useState(()=>{const Y=localStorage.getItem("mdma-builder-llm-config");return Y?JSON.parse(Y):Xx}),[r,o]=W.useState(()=>{const Y=localStorage.getItem("mdma-builder-preview-llm-override");return Y?JSON.parse(Y):{}}),c=Y=>{l(Y),localStorage.setItem("mdma-builder-llm-config",JSON.stringify(Y))},h=Y=>{o(Y),localStorage.setItem("mdma-builder-preview-llm-override",JSON.stringify(Y))},p={...a,...Object.fromEntries(Object.entries(r).filter(([,Y])=>Y))},m=EA(a),[b,y]=W.useState("domain"),[S,x]=W.useState("chat"),N=()=>{const Y=OA();m.setDomain(Y.domain)},T=Cl.findIndex(Y=>Y.id===b),M=W.useMemo(()=>m.generatedPrompt?{output:"bg-success",preview:"bg-primary"}:{},[m.generatedPrompt]),j={domain:v.jsx(Lx,{domain:m.domain,onChange:m.setDomain,onSample:N}),flow:v.jsx(Vx,{flowSteps:m.domain.flowSteps,onChange:m.updateFlowSteps}),generate:v.jsx(SA,{domain:m.domain})};return v.jsxs("div",{className:"flex flex-col h-screen bg-surface-0 text-text-primary",children:[v.jsxs("header",{className:"flex items-center justify-between px-5 py-3 border-b border-border-light",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsxs("h1",{className:"text-lg font-bold m-0",children:[v.jsx("span",{className:"text-primary",children:"MDMA"})," Prompt Builder"]}),v.jsx("span",{className:"text-xs text-text-muted hidden sm:inline",children:"Generate custom prompts for your MDMA-powered chat"})]}),v.jsx(vA,{theme:i,onToggle:t})]}),v.jsxs("div",{className:"flex flex-1 overflow-hidden flex-col lg:flex-row",children:[v.jsxs("aside",{className:"w-full lg:w-[400px] border-b lg:border-b-0 lg:border-r border-border-light overflow-y-auto flex-shrink-0 flex flex-col",children:[v.jsx(xA,{steps:Cl,currentStep:b,onStepChange:y}),v.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:j[b]}),v.jsxs("div",{className:"flex gap-2 p-4 border-t border-border-light",children:[v.jsx("button",{type:"button",onClick:()=>{const Y=Cl[T-1];Y&&y(Y.id)},disabled:T===0,className:"px-4 py-2 text-sm rounded-lg border border-border bg-surface-1 text-text-secondary hover:bg-surface-2 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:"Back"}),v.jsx("button",{type:"button",onClick:()=>{const Y=Cl[T+1];Y&&y(Y.id)},disabled:T===Cl.length-1,className:"px-4 py-2 text-sm rounded-lg border border-primary bg-primary-light text-primary-text font-medium hover:bg-primary hover:text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors flex-1",children:"Next"})]})]}),v.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsx(kA,{tabs:jA,activeTab:S,onTabChange:x,indicators:M}),v.jsx("div",{className:"flex-1 p-4 overflow-hidden flex flex-col",children:S==="chat"?v.jsx(Wx,{messages:m.messages,isGenerating:m.isGenerating,error:m.error,onGenerate:m.generate,onStop:m.stop,onReset:m.reset,config:a,onConfigChange:c}):S==="output"?v.jsx(Px,{prompt:m.generatedPrompt,isGenerating:m.isGenerating}):v.jsx(bA,{customPrompt:m.generatedPrompt,llmConfig:p,llmOverride:r,onOverrideChange:h,chatConfig:a})})]})]})]})}Rx.createRoot(document.getElementById("root")).render(v.jsx(W.StrictMode,{children:v.jsx(MA,{})}));