spytial-core 6.4.1 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/browser/spytial-core-complete.css +1 -1
- package/dist/browser/spytial-core-complete.css.map +1 -1
- package/dist/browser/spytial-core-complete.global.js +1 -1
- package/dist/cli/spytial-check.js +1 -1
- package/dist/components/react-component-integration.css +1 -1
- package/dist/components/react-component-integration.css.map +1 -1
- package/dist/components/react-component-integration.d.ts +8 -3
- package/dist/components/react-component-integration.global.js +79 -79
- package/dist/components/react-component-integration.global.js.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/react.css +24 -7
- package/dist/react.mjs +11 -8
- package/dist/react.mjs.map +1 -1
- package/dist/types/components/ErrorMessageModal/ErrorMessageContainer.d.ts +2 -0
- package/dist/types/components/ErrorMessageModal/ErrorMessageModal.d.ts +2 -0
- package/dist/types/react-component-integration.d.ts +8 -3
- package/docs/spytial-language.json +1 -1
- package/docs/spytial-spec.schema.json +2 -2
- package/package.json +1 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";var IntegratedDemo=(()=>{var v_=Object.create;var Vf=Object.defineProperty;var x_=Object.getOwnPropertyDescriptor;var S_=Object.getOwnPropertyNames;var w_=Object.getPrototypeOf,k_=Object.prototype.hasOwnProperty;var ZS=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),A_=(t,e)=>{for(var n in e)Vf(t,n,{get:e[n],enumerable:!0})},JS=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of S_(e))!k_.call(t,r)&&r!==n&&Vf(t,r,{get:()=>e[r],enumerable:!(i=x_(e,r))||i.enumerable});return t};var X=(t,e,n)=>(n=t!=null?v_(w_(t)):{},JS(e||!t||!t.__esModule?Vf(n,"default",{value:t,enumerable:!0}):n,t)),C_=t=>JS(Vf({},"__esModule",{value:!0}),t);var fw=S(Z=>{"use strict";var pg=Symbol.for("react.transitional.element"),O_=Symbol.for("react.portal"),T_=Symbol.for("react.fragment"),E_=Symbol.for("react.strict_mode"),D_=Symbol.for("react.profiler"),M_=Symbol.for("react.consumer"),R_=Symbol.for("react.context"),N_=Symbol.for("react.forward_ref"),L_=Symbol.for("react.suspense"),I_=Symbol.for("react.memo"),sw=Symbol.for("react.lazy"),ew=Symbol.iterator;function __(t){return t===null||typeof t!="object"?null:(t=ew&&t[ew]||t["@@iterator"],typeof t=="function"?t:null)}var ow={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},lw=Object.assign,aw={};function Xo(t,e,n){this.props=t,this.context=e,this.refs=aw,this.updater=n||ow}Xo.prototype.isReactComponent={};Xo.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};Xo.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function cw(){}cw.prototype=Xo.prototype;function mg(t,e,n){this.props=t,this.context=e,this.refs=aw,this.updater=n||ow}var gg=mg.prototype=new cw;gg.constructor=mg;lw(gg,Xo.prototype);gg.isPureReactComponent=!0;var tw=Array.isArray,Be={H:null,A:null,T:null,S:null,V:null},uw=Object.prototype.hasOwnProperty;function yg(t,e,n,i,r,s){return n=s.ref,{$$typeof:pg,type:t,key:e,ref:n!==void 0?n:null,props:s}}function B_(t,e){return yg(t.type,e,void 0,void 0,void 0,t.props)}function bg(t){return typeof t=="object"&&t!==null&&t.$$typeof===pg}function q_(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var nw=/\/+/g;function hg(t,e){return typeof t=="object"&&t!==null&&t.key!=null?q_(""+t.key):e.toString(36)}function iw(){}function P_(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(iw,iw):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Qo(t,e,n,i,r){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case pg:case O_:o=!0;break;case sw:return o=t._init,Qo(o(t._payload),e,n,i,r)}}if(o)return r=r(t),o=i===""?"."+hg(t,0):i,tw(r)?(n="",o!=null&&(n=o.replace(nw,"$&/")+"/"),Qo(r,e,n,"",function(c){return c})):r!=null&&(bg(r)&&(r=B_(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(nw,"$&/")+"/")+o)),e.push(r)),1;o=0;var l=i===""?".":i+":";if(tw(t))for(var a=0;a<t.length;a++)i=t[a],s=l+hg(i,a),o+=Qo(i,e,n,s,r);else if(a=__(t),typeof a=="function")for(t=a.call(t),a=0;!(i=t.next()).done;)i=i.value,s=l+hg(i,a++),o+=Qo(i,e,n,s,r);else if(s==="object"){if(typeof t.then=="function")return Qo(P_(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return o}function jf(t,e,n){if(t==null)return t;var i=[],r=0;return Qo(t,i,"","",function(s){return e.call(n,s,r++)}),i}function z_(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var rw=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function H_(){}Z.Children={map:jf,forEach:function(t,e,n){jf(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return jf(t,function(){e++}),e},toArray:function(t){return jf(t,function(e){return e})||[]},only:function(t){if(!bg(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Z.Component=Xo;Z.Fragment=T_;Z.Profiler=D_;Z.PureComponent=mg;Z.StrictMode=E_;Z.Suspense=L_;Z.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Be;Z.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Be.H.useMemoCache(t)}};Z.cache=function(t){return function(){return t.apply(null,arguments)}};Z.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=lw({},t.props),r=t.key,s=void 0;if(e!=null)for(o in e.ref!==void 0&&(s=void 0),e.key!==void 0&&(r=""+e.key),e)!uw.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(i[o]=e[o]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var l=Array(o),a=0;a<o;a++)l[a]=arguments[a+2];i.children=l}return yg(t.type,r,void 0,void 0,s,i)};Z.createContext=function(t){return t={$$typeof:R_,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:M_,_context:t},t};Z.createElement=function(t,e,n){var i,r={},s=null;if(e!=null)for(i in e.key!==void 0&&(s=""+e.key),e)uw.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var l=Array(o),a=0;a<o;a++)l[a]=arguments[a+2];r.children=l}if(t&&t.defaultProps)for(i in o=t.defaultProps,o)r[i]===void 0&&(r[i]=o[i]);return yg(t,s,void 0,void 0,null,r)};Z.createRef=function(){return{current:null}};Z.forwardRef=function(t){return{$$typeof:N_,render:t}};Z.isValidElement=bg;Z.lazy=function(t){return{$$typeof:sw,_payload:{_status:-1,_result:t},_init:z_}};Z.memo=function(t,e){return{$$typeof:I_,type:t,compare:e===void 0?null:e}};Z.startTransition=function(t){var e=Be.T,n={};Be.T=n;try{var i=t(),r=Be.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(H_,rw)}catch(s){rw(s)}finally{Be.T=e}};Z.unstable_useCacheRefresh=function(){return Be.H.useCacheRefresh()};Z.use=function(t){return Be.H.use(t)};Z.useActionState=function(t,e,n){return Be.H.useActionState(t,e,n)};Z.useCallback=function(t,e){return Be.H.useCallback(t,e)};Z.useContext=function(t){return Be.H.useContext(t)};Z.useDebugValue=function(){};Z.useDeferredValue=function(t,e){return Be.H.useDeferredValue(t,e)};Z.useEffect=function(t,e,n){var i=Be.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(t,e)};Z.useId=function(){return Be.H.useId()};Z.useImperativeHandle=function(t,e,n){return Be.H.useImperativeHandle(t,e,n)};Z.useInsertionEffect=function(t,e){return Be.H.useInsertionEffect(t,e)};Z.useLayoutEffect=function(t,e){return Be.H.useLayoutEffect(t,e)};Z.useMemo=function(t,e){return Be.H.useMemo(t,e)};Z.useOptimistic=function(t,e){return Be.H.useOptimistic(t,e)};Z.useReducer=function(t,e,n){return Be.H.useReducer(t,e,n)};Z.useRef=function(t){return Be.H.useRef(t)};Z.useState=function(t){return Be.H.useState(t)};Z.useSyncExternalStore=function(t,e,n){return Be.H.useSyncExternalStore(t,e,n)};Z.useTransition=function(){return Be.H.useTransition()};Z.version="19.1.0"});var Tt=S((Ise,dw)=>{"use strict";dw.exports=fw()});var ww=S(qe=>{"use strict";function wg(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<Yf(r,e))t[i]=e,t[n]=r,n=i;else break e}}function ki(t){return t.length===0?null:t[0]}function Gf(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,s=r>>>1;i<s;){var o=2*(i+1)-1,l=t[o],a=o+1,c=t[a];if(0>Yf(l,n))a<r&&0>Yf(c,l)?(t[i]=c,t[a]=n,i=a):(t[i]=l,t[o]=n,i=o);else if(a<r&&0>Yf(c,n))t[i]=c,t[a]=n,i=a;else break e}}return e}function Yf(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}qe.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(hw=performance,qe.unstable_now=function(){return hw.now()}):(vg=Date,pw=vg.now(),qe.unstable_now=function(){return vg.now()-pw});var hw,vg,pw,er=[],Br=[],U_=1,Dn=null,Et=3,kg=!1,Qa=!1,Xa=!1,Ag=!1,yw=typeof setTimeout=="function"?setTimeout:null,bw=typeof clearTimeout=="function"?clearTimeout:null,mw=typeof setImmediate<"u"?setImmediate:null;function Kf(t){for(var e=ki(Br);e!==null;){if(e.callback===null)Gf(Br);else if(e.startTime<=t)Gf(Br),e.sortIndex=e.expirationTime,wg(er,e);else break;e=ki(Br)}}function Cg(t){if(Xa=!1,Kf(t),!Qa)if(ki(er)!==null)Qa=!0,Zo||(Zo=!0,Wo());else{var e=ki(Br);e!==null&&Og(Cg,e.startTime-t)}}var Zo=!1,Wa=-1,vw=5,xw=-1;function Sw(){return Ag?!0:!(qe.unstable_now()-xw<vw)}function xg(){if(Ag=!1,Zo){var t=qe.unstable_now();xw=t;var e=!0;try{e:{Qa=!1,Xa&&(Xa=!1,bw(Wa),Wa=-1),kg=!0;var n=Et;try{t:{for(Kf(t),Dn=ki(er);Dn!==null&&!(Dn.expirationTime>t&&Sw());){var i=Dn.callback;if(typeof i=="function"){Dn.callback=null,Et=Dn.priorityLevel;var r=i(Dn.expirationTime<=t);if(t=qe.unstable_now(),typeof r=="function"){Dn.callback=r,Kf(t),e=!0;break t}Dn===ki(er)&&Gf(er),Kf(t)}else Gf(er);Dn=ki(er)}if(Dn!==null)e=!0;else{var s=ki(Br);s!==null&&Og(Cg,s.startTime-t),e=!1}}break e}finally{Dn=null,Et=n,kg=!1}e=void 0}}finally{e?Wo():Zo=!1}}}var Wo;typeof mw=="function"?Wo=function(){mw(xg)}:typeof MessageChannel<"u"?(Sg=new MessageChannel,gw=Sg.port2,Sg.port1.onmessage=xg,Wo=function(){gw.postMessage(null)}):Wo=function(){yw(xg,0)};var Sg,gw;function Og(t,e){Wa=yw(function(){t(qe.unstable_now())},e)}qe.unstable_IdlePriority=5;qe.unstable_ImmediatePriority=1;qe.unstable_LowPriority=4;qe.unstable_NormalPriority=3;qe.unstable_Profiling=null;qe.unstable_UserBlockingPriority=2;qe.unstable_cancelCallback=function(t){t.callback=null};qe.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):vw=0<t?Math.floor(1e3/t):5};qe.unstable_getCurrentPriorityLevel=function(){return Et};qe.unstable_next=function(t){switch(Et){case 1:case 2:case 3:var e=3;break;default:e=Et}var n=Et;Et=e;try{return t()}finally{Et=n}};qe.unstable_requestPaint=function(){Ag=!0};qe.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=Et;Et=t;try{return e()}finally{Et=n}};qe.unstable_scheduleCallback=function(t,e,n){var i=qe.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:U_++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,wg(Br,t),ki(er)===null&&t===ki(Br)&&(Xa?(bw(Wa),Wa=-1):Xa=!0,Og(Cg,n-i))):(t.sortIndex=r,wg(er,t),Qa||kg||(Qa=!0,Zo||(Zo=!0,Wo()))),t};qe.unstable_shouldYield=Sw;qe.unstable_wrapCallback=function(t){var e=Et;return function(){var n=Et;Et=e;try{return t.apply(this,arguments)}finally{Et=n}}}});var Aw=S((Bse,kw)=>{"use strict";kw.exports=ww()});var Ow=S(zt=>{"use strict";var F_=Tt();function Cw(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function qr(){}var Pt={d:{f:qr,r:function(){throw Error(Cw(522))},D:qr,C:qr,L:qr,m:qr,X:qr,S:qr,M:qr},p:0,findDOMNode:null},$_=Symbol.for("react.portal");function V_(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$_,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Za=F_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Qf(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Pt;zt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Cw(299));return V_(t,e,null,n)};zt.flushSync=function(t){var e=Za.T,n=Pt.p;try{if(Za.T=null,Pt.p=2,t)return t()}finally{Za.T=e,Pt.p=n,Pt.d.f()}};zt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Pt.d.C(t,e))};zt.prefetchDNS=function(t){typeof t=="string"&&Pt.d.D(t)};zt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=Qf(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,s=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Pt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:s}):n==="script"&&Pt.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:s,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};zt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=Qf(e.as,e.crossOrigin);Pt.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Pt.d.M(t)};zt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=Qf(n,e.crossOrigin);Pt.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};zt.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=Qf(e.as,e.crossOrigin);Pt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Pt.d.m(t)};zt.requestFormReset=function(t){Pt.d.r(t)};zt.unstable_batchedUpdates=function(t,e){return t(e)};zt.useFormState=function(t,e,n){return Za.H.useFormState(t,e,n)};zt.useFormStatus=function(){return Za.H.useHostTransitionStatus()};zt.version="19.1.0"});var Dw=S((Pse,Ew)=>{"use strict";function Tw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Tw)}catch(t){console.error(t)}}Tw(),Ew.exports=Ow()});var RC=S(yh=>{"use strict";var lt=Aw(),Wk=Tt(),j_=Dw();function E(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Zk(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function zc(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Jk(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Mw(t){if(zc(t)!==t)throw Error(E(188))}function Y_(t){var e=t.alternate;if(!e){if(e=zc(t),e===null)throw Error(E(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return Mw(r),t;if(s===i)return Mw(r),e;s=s.sibling}throw Error(E(188))}if(n.return!==i.return)n=r,i=s;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,i=s;break}if(l===i){o=!0,i=r,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,i=r;break}if(l===i){o=!0,i=s,n=r;break}l=l.sibling}if(!o)throw Error(E(189))}}if(n.alternate!==i)throw Error(E(190))}if(n.tag!==3)throw Error(E(188));return n.stateNode.current===n?t:e}function eA(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=eA(t),e!==null)return e;t=t.sibling}return null}var Ne=Object.assign,K_=Symbol.for("react.element"),Xf=Symbol.for("react.transitional.element"),lc=Symbol.for("react.portal"),sl=Symbol.for("react.fragment"),tA=Symbol.for("react.strict_mode"),ry=Symbol.for("react.profiler"),G_=Symbol.for("react.provider"),nA=Symbol.for("react.consumer"),sr=Symbol.for("react.context"),Jy=Symbol.for("react.forward_ref"),sy=Symbol.for("react.suspense"),oy=Symbol.for("react.suspense_list"),e0=Symbol.for("react.memo"),Hr=Symbol.for("react.lazy"),ly=Symbol.for("react.activity"),Q_=Symbol.for("react.memo_cache_sentinel"),Rw=Symbol.iterator;function Ja(t){return t===null||typeof t!="object"?null:(t=Rw&&t[Rw]||t["@@iterator"],typeof t=="function"?t:null)}var X_=Symbol.for("react.client.reference");function ay(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===X_?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case sl:return"Fragment";case ry:return"Profiler";case tA:return"StrictMode";case sy:return"Suspense";case oy:return"SuspenseList";case ly:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case lc:return"Portal";case sr:return(t.displayName||"Context")+".Provider";case nA:return(t._context.displayName||"Context")+".Consumer";case Jy:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case e0:return e=t.displayName||null,e!==null?e:ay(t.type)||"Memo";case Hr:e=t._payload,t=t._init;try{return ay(t(e))}catch{}}return null}var ac=Array.isArray,j=Wk.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=j_.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ys={pending:!1,data:null,method:null,action:null},cy=[],ol=-1;function Mi(t){return{current:t}}function pt(t){0>ol||(t.current=cy[ol],cy[ol]=null,ol--)}function ze(t,e){ol++,cy[ol]=t.current,t.current=e}var Ti=Mi(null),Cc=Mi(null),Xr=Mi(null),Od=Mi(null);function Td(t,e){switch(ze(Xr,e),ze(Cc,t),ze(Ti,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?qk(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=qk(e),t=vC(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}pt(Ti),ze(Ti,t)}function Cl(){pt(Ti),pt(Cc),pt(Xr)}function uy(t){t.memoizedState!==null&&ze(Od,t);var e=Ti.current,n=vC(e,t.type);e!==n&&(ze(Cc,t),ze(Ti,n))}function Ed(t){Cc.current===t&&(pt(Ti),pt(Cc)),Od.current===t&&(pt(Od),_c._currentValue=Ys)}var fy=Object.prototype.hasOwnProperty,t0=lt.unstable_scheduleCallback,Tg=lt.unstable_cancelCallback,W_=lt.unstable_shouldYield,Z_=lt.unstable_requestPaint,Ei=lt.unstable_now,J_=lt.unstable_getCurrentPriorityLevel,iA=lt.unstable_ImmediatePriority,rA=lt.unstable_UserBlockingPriority,Dd=lt.unstable_NormalPriority,eB=lt.unstable_LowPriority,sA=lt.unstable_IdlePriority,tB=lt.log,nB=lt.unstable_setDisableYieldValue,Hc=null,mn=null;function Yr(t){if(typeof tB=="function"&&nB(t),mn&&typeof mn.setStrictMode=="function")try{mn.setStrictMode(Hc,t)}catch{}}var gn=Math.clz32?Math.clz32:sB,iB=Math.log,rB=Math.LN2;function sB(t){return t>>>=0,t===0?32:31-(iB(t)/rB|0)|0}var Wf=256,Zf=4194304;function $s(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function nh(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,s=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=$s(i):(o&=l,o!==0?r=$s(o):n||(n=l&~t,n!==0&&(r=$s(n))))):(l=i&~s,l!==0?r=$s(l):o!==0?r=$s(o):n||(n=i&~t,n!==0&&(r=$s(n)))),r===0?0:e!==0&&e!==r&&(e&s)===0&&(s=r&-r,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:r}function Uc(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function oB(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 oA(){var t=Wf;return Wf<<=1,(Wf&4194048)===0&&(Wf=256),t}function lA(){var t=Zf;return Zf<<=1,(Zf&62914560)===0&&(Zf=4194304),t}function Eg(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Fc(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function lB(t,e,n,i,r,s){var o=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var l=t.entanglements,a=t.expirationTimes,c=t.hiddenUpdates;for(n=o&~n;0<n;){var u=31-gn(n),f=1<<u;l[u]=0,a[u]=-1;var d=c[u];if(d!==null)for(c[u]=null,u=0;u<d.length;u++){var h=d[u];h!==null&&(h.lane&=-536870913)}n&=~f}i!==0&&aA(t,i,0),s!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=s&~(o&~e))}function aA(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-gn(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&4194090}function cA(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-gn(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function n0(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function i0(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function uA(){var t=ye.p;return t!==0?t:(t=window.event,t===void 0?32:DC(t.type))}function aB(t,e){var n=ye.p;try{return ye.p=t,e()}finally{ye.p=n}}var ls=Math.random().toString(36).slice(2),Dt="__reactFiber$"+ls,en="__reactProps$"+ls,Bl="__reactContainer$"+ls,dy="__reactEvents$"+ls,cB="__reactListeners$"+ls,uB="__reactHandles$"+ls,Nw="__reactResources$"+ls,$c="__reactMarker$"+ls;function r0(t){delete t[Dt],delete t[en],delete t[dy],delete t[cB],delete t[uB]}function ll(t){var e=t[Dt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Bl]||n[Dt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Hk(t);t!==null;){if(n=t[Dt])return n;t=Hk(t)}return e}t=n,n=t.parentNode}return null}function ql(t){if(t=t[Dt]||t[Bl]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function cc(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(E(33))}function yl(t){var e=t[Nw];return e||(e=t[Nw]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function dt(t){t[$c]=!0}var fA=new Set,dA={};function io(t,e){Ol(t,e),Ol(t+"Capture",e)}function Ol(t,e){for(dA[t]=e,t=0;t<e.length;t++)fA.add(e[t])}var fB=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]*$"),Lw={},Iw={};function dB(t){return fy.call(Iw,t)?!0:fy.call(Lw,t)?!1:fB.test(t)?Iw[t]=!0:(Lw[t]=!0,!1)}function hd(t,e,n){if(dB(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function Jf(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function tr(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}var Dg,_w;function nl(t){if(Dg===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Dg=e&&e[1]||"",_w=-1<n.stack.indexOf(`
|
|
1
|
+
"use strict";var IntegratedDemo=(()=>{var v_=Object.create;var Vf=Object.defineProperty;var x_=Object.getOwnPropertyDescriptor;var S_=Object.getOwnPropertyNames;var w_=Object.getPrototypeOf,k_=Object.prototype.hasOwnProperty;var ZS=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),A_=(t,e)=>{for(var n in e)Vf(t,n,{get:e[n],enumerable:!0})},JS=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of S_(e))!k_.call(t,r)&&r!==n&&Vf(t,r,{get:()=>e[r],enumerable:!(i=x_(e,r))||i.enumerable});return t};var X=(t,e,n)=>(n=t!=null?v_(w_(t)):{},JS(e||!t||!t.__esModule?Vf(n,"default",{value:t,enumerable:!0}):n,t)),C_=t=>JS(Vf({},"__esModule",{value:!0}),t);var fw=S(Z=>{"use strict";var pg=Symbol.for("react.transitional.element"),O_=Symbol.for("react.portal"),T_=Symbol.for("react.fragment"),E_=Symbol.for("react.strict_mode"),D_=Symbol.for("react.profiler"),M_=Symbol.for("react.consumer"),R_=Symbol.for("react.context"),N_=Symbol.for("react.forward_ref"),L_=Symbol.for("react.suspense"),I_=Symbol.for("react.memo"),sw=Symbol.for("react.lazy"),ew=Symbol.iterator;function __(t){return t===null||typeof t!="object"?null:(t=ew&&t[ew]||t["@@iterator"],typeof t=="function"?t:null)}var ow={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},lw=Object.assign,aw={};function Xo(t,e,n){this.props=t,this.context=e,this.refs=aw,this.updater=n||ow}Xo.prototype.isReactComponent={};Xo.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};Xo.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function cw(){}cw.prototype=Xo.prototype;function mg(t,e,n){this.props=t,this.context=e,this.refs=aw,this.updater=n||ow}var gg=mg.prototype=new cw;gg.constructor=mg;lw(gg,Xo.prototype);gg.isPureReactComponent=!0;var tw=Array.isArray,Be={H:null,A:null,T:null,S:null,V:null},uw=Object.prototype.hasOwnProperty;function yg(t,e,n,i,r,s){return n=s.ref,{$$typeof:pg,type:t,key:e,ref:n!==void 0?n:null,props:s}}function B_(t,e){return yg(t.type,e,void 0,void 0,void 0,t.props)}function bg(t){return typeof t=="object"&&t!==null&&t.$$typeof===pg}function q_(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var nw=/\/+/g;function hg(t,e){return typeof t=="object"&&t!==null&&t.key!=null?q_(""+t.key):e.toString(36)}function iw(){}function P_(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(iw,iw):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function Qo(t,e,n,i,r){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case pg:case O_:o=!0;break;case sw:return o=t._init,Qo(o(t._payload),e,n,i,r)}}if(o)return r=r(t),o=i===""?"."+hg(t,0):i,tw(r)?(n="",o!=null&&(n=o.replace(nw,"$&/")+"/"),Qo(r,e,n,"",function(c){return c})):r!=null&&(bg(r)&&(r=B_(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(nw,"$&/")+"/")+o)),e.push(r)),1;o=0;var l=i===""?".":i+":";if(tw(t))for(var a=0;a<t.length;a++)i=t[a],s=l+hg(i,a),o+=Qo(i,e,n,s,r);else if(a=__(t),typeof a=="function")for(t=a.call(t),a=0;!(i=t.next()).done;)i=i.value,s=l+hg(i,a++),o+=Qo(i,e,n,s,r);else if(s==="object"){if(typeof t.then=="function")return Qo(P_(t),e,n,i,r);throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.")}return o}function jf(t,e,n){if(t==null)return t;var i=[],r=0;return Qo(t,i,"","",function(s){return e.call(n,s,r++)}),i}function z_(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var rw=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function H_(){}Z.Children={map:jf,forEach:function(t,e,n){jf(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return jf(t,function(){e++}),e},toArray:function(t){return jf(t,function(e){return e})||[]},only:function(t){if(!bg(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Z.Component=Xo;Z.Fragment=T_;Z.Profiler=D_;Z.PureComponent=mg;Z.StrictMode=E_;Z.Suspense=L_;Z.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Be;Z.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Be.H.useMemoCache(t)}};Z.cache=function(t){return function(){return t.apply(null,arguments)}};Z.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=lw({},t.props),r=t.key,s=void 0;if(e!=null)for(o in e.ref!==void 0&&(s=void 0),e.key!==void 0&&(r=""+e.key),e)!uw.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(i[o]=e[o]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var l=Array(o),a=0;a<o;a++)l[a]=arguments[a+2];i.children=l}return yg(t.type,r,void 0,void 0,s,i)};Z.createContext=function(t){return t={$$typeof:R_,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:M_,_context:t},t};Z.createElement=function(t,e,n){var i,r={},s=null;if(e!=null)for(i in e.key!==void 0&&(s=""+e.key),e)uw.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var l=Array(o),a=0;a<o;a++)l[a]=arguments[a+2];r.children=l}if(t&&t.defaultProps)for(i in o=t.defaultProps,o)r[i]===void 0&&(r[i]=o[i]);return yg(t,s,void 0,void 0,null,r)};Z.createRef=function(){return{current:null}};Z.forwardRef=function(t){return{$$typeof:N_,render:t}};Z.isValidElement=bg;Z.lazy=function(t){return{$$typeof:sw,_payload:{_status:-1,_result:t},_init:z_}};Z.memo=function(t,e){return{$$typeof:I_,type:t,compare:e===void 0?null:e}};Z.startTransition=function(t){var e=Be.T,n={};Be.T=n;try{var i=t(),r=Be.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(H_,rw)}catch(s){rw(s)}finally{Be.T=e}};Z.unstable_useCacheRefresh=function(){return Be.H.useCacheRefresh()};Z.use=function(t){return Be.H.use(t)};Z.useActionState=function(t,e,n){return Be.H.useActionState(t,e,n)};Z.useCallback=function(t,e){return Be.H.useCallback(t,e)};Z.useContext=function(t){return Be.H.useContext(t)};Z.useDebugValue=function(){};Z.useDeferredValue=function(t,e){return Be.H.useDeferredValue(t,e)};Z.useEffect=function(t,e,n){var i=Be.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(t,e)};Z.useId=function(){return Be.H.useId()};Z.useImperativeHandle=function(t,e,n){return Be.H.useImperativeHandle(t,e,n)};Z.useInsertionEffect=function(t,e){return Be.H.useInsertionEffect(t,e)};Z.useLayoutEffect=function(t,e){return Be.H.useLayoutEffect(t,e)};Z.useMemo=function(t,e){return Be.H.useMemo(t,e)};Z.useOptimistic=function(t,e){return Be.H.useOptimistic(t,e)};Z.useReducer=function(t,e,n){return Be.H.useReducer(t,e,n)};Z.useRef=function(t){return Be.H.useRef(t)};Z.useState=function(t){return Be.H.useState(t)};Z.useSyncExternalStore=function(t,e,n){return Be.H.useSyncExternalStore(t,e,n)};Z.useTransition=function(){return Be.H.useTransition()};Z.version="19.1.0"});var Et=S((Ise,dw)=>{"use strict";dw.exports=fw()});var ww=S(qe=>{"use strict";function wg(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<Yf(r,e))t[i]=e,t[n]=r,n=i;else break e}}function ki(t){return t.length===0?null:t[0]}function Gf(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,s=r>>>1;i<s;){var o=2*(i+1)-1,l=t[o],a=o+1,c=t[a];if(0>Yf(l,n))a<r&&0>Yf(c,l)?(t[i]=c,t[a]=n,i=a):(t[i]=l,t[o]=n,i=o);else if(a<r&&0>Yf(c,n))t[i]=c,t[a]=n,i=a;else break e}}return e}function Yf(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}qe.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(hw=performance,qe.unstable_now=function(){return hw.now()}):(vg=Date,pw=vg.now(),qe.unstable_now=function(){return vg.now()-pw});var hw,vg,pw,er=[],Br=[],U_=1,Mn=null,Dt=3,kg=!1,Qa=!1,Xa=!1,Ag=!1,yw=typeof setTimeout=="function"?setTimeout:null,bw=typeof clearTimeout=="function"?clearTimeout:null,mw=typeof setImmediate<"u"?setImmediate:null;function Kf(t){for(var e=ki(Br);e!==null;){if(e.callback===null)Gf(Br);else if(e.startTime<=t)Gf(Br),e.sortIndex=e.expirationTime,wg(er,e);else break;e=ki(Br)}}function Cg(t){if(Xa=!1,Kf(t),!Qa)if(ki(er)!==null)Qa=!0,Zo||(Zo=!0,Wo());else{var e=ki(Br);e!==null&&Og(Cg,e.startTime-t)}}var Zo=!1,Wa=-1,vw=5,xw=-1;function Sw(){return Ag?!0:!(qe.unstable_now()-xw<vw)}function xg(){if(Ag=!1,Zo){var t=qe.unstable_now();xw=t;var e=!0;try{e:{Qa=!1,Xa&&(Xa=!1,bw(Wa),Wa=-1),kg=!0;var n=Dt;try{t:{for(Kf(t),Mn=ki(er);Mn!==null&&!(Mn.expirationTime>t&&Sw());){var i=Mn.callback;if(typeof i=="function"){Mn.callback=null,Dt=Mn.priorityLevel;var r=i(Mn.expirationTime<=t);if(t=qe.unstable_now(),typeof r=="function"){Mn.callback=r,Kf(t),e=!0;break t}Mn===ki(er)&&Gf(er),Kf(t)}else Gf(er);Mn=ki(er)}if(Mn!==null)e=!0;else{var s=ki(Br);s!==null&&Og(Cg,s.startTime-t),e=!1}}break e}finally{Mn=null,Dt=n,kg=!1}e=void 0}}finally{e?Wo():Zo=!1}}}var Wo;typeof mw=="function"?Wo=function(){mw(xg)}:typeof MessageChannel<"u"?(Sg=new MessageChannel,gw=Sg.port2,Sg.port1.onmessage=xg,Wo=function(){gw.postMessage(null)}):Wo=function(){yw(xg,0)};var Sg,gw;function Og(t,e){Wa=yw(function(){t(qe.unstable_now())},e)}qe.unstable_IdlePriority=5;qe.unstable_ImmediatePriority=1;qe.unstable_LowPriority=4;qe.unstable_NormalPriority=3;qe.unstable_Profiling=null;qe.unstable_UserBlockingPriority=2;qe.unstable_cancelCallback=function(t){t.callback=null};qe.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):vw=0<t?Math.floor(1e3/t):5};qe.unstable_getCurrentPriorityLevel=function(){return Dt};qe.unstable_next=function(t){switch(Dt){case 1:case 2:case 3:var e=3;break;default:e=Dt}var n=Dt;Dt=e;try{return t()}finally{Dt=n}};qe.unstable_requestPaint=function(){Ag=!0};qe.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=Dt;Dt=t;try{return e()}finally{Dt=n}};qe.unstable_scheduleCallback=function(t,e,n){var i=qe.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:U_++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,wg(Br,t),ki(er)===null&&t===ki(Br)&&(Xa?(bw(Wa),Wa=-1):Xa=!0,Og(Cg,n-i))):(t.sortIndex=r,wg(er,t),Qa||kg||(Qa=!0,Zo||(Zo=!0,Wo()))),t};qe.unstable_shouldYield=Sw;qe.unstable_wrapCallback=function(t){var e=Dt;return function(){var n=Dt;Dt=e;try{return t.apply(this,arguments)}finally{Dt=n}}}});var Aw=S((Bse,kw)=>{"use strict";kw.exports=ww()});var Ow=S(Ht=>{"use strict";var F_=Et();function Cw(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function qr(){}var zt={d:{f:qr,r:function(){throw Error(Cw(522))},D:qr,C:qr,L:qr,m:qr,X:qr,S:qr,M:qr},p:0,findDOMNode:null},$_=Symbol.for("react.portal");function V_(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$_,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Za=F_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Qf(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Ht.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=zt;Ht.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Cw(299));return V_(t,e,null,n)};Ht.flushSync=function(t){var e=Za.T,n=zt.p;try{if(Za.T=null,zt.p=2,t)return t()}finally{Za.T=e,zt.p=n,zt.d.f()}};Ht.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,zt.d.C(t,e))};Ht.prefetchDNS=function(t){typeof t=="string"&&zt.d.D(t)};Ht.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=Qf(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,s=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?zt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:s}):n==="script"&&zt.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:s,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Ht.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=Qf(e.as,e.crossOrigin);zt.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&zt.d.M(t)};Ht.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=Qf(n,e.crossOrigin);zt.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Ht.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=Qf(e.as,e.crossOrigin);zt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else zt.d.m(t)};Ht.requestFormReset=function(t){zt.d.r(t)};Ht.unstable_batchedUpdates=function(t,e){return t(e)};Ht.useFormState=function(t,e,n){return Za.H.useFormState(t,e,n)};Ht.useFormStatus=function(){return Za.H.useHostTransitionStatus()};Ht.version="19.1.0"});var Dw=S((Pse,Ew)=>{"use strict";function Tw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Tw)}catch(t){console.error(t)}}Tw(),Ew.exports=Ow()});var RC=S(yh=>{"use strict";var lt=Aw(),Wk=Et(),j_=Dw();function E(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Zk(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function zc(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Jk(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Mw(t){if(zc(t)!==t)throw Error(E(188))}function Y_(t){var e=t.alternate;if(!e){if(e=zc(t),e===null)throw Error(E(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return Mw(r),t;if(s===i)return Mw(r),e;s=s.sibling}throw Error(E(188))}if(n.return!==i.return)n=r,i=s;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,i=s;break}if(l===i){o=!0,i=r,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,i=r;break}if(l===i){o=!0,i=s,n=r;break}l=l.sibling}if(!o)throw Error(E(189))}}if(n.alternate!==i)throw Error(E(190))}if(n.tag!==3)throw Error(E(188));return n.stateNode.current===n?t:e}function eA(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=eA(t),e!==null)return e;t=t.sibling}return null}var Ne=Object.assign,K_=Symbol.for("react.element"),Xf=Symbol.for("react.transitional.element"),lc=Symbol.for("react.portal"),sl=Symbol.for("react.fragment"),tA=Symbol.for("react.strict_mode"),ry=Symbol.for("react.profiler"),G_=Symbol.for("react.provider"),nA=Symbol.for("react.consumer"),sr=Symbol.for("react.context"),Jy=Symbol.for("react.forward_ref"),sy=Symbol.for("react.suspense"),oy=Symbol.for("react.suspense_list"),e0=Symbol.for("react.memo"),Hr=Symbol.for("react.lazy"),ly=Symbol.for("react.activity"),Q_=Symbol.for("react.memo_cache_sentinel"),Rw=Symbol.iterator;function Ja(t){return t===null||typeof t!="object"?null:(t=Rw&&t[Rw]||t["@@iterator"],typeof t=="function"?t:null)}var X_=Symbol.for("react.client.reference");function ay(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===X_?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case sl:return"Fragment";case ry:return"Profiler";case tA:return"StrictMode";case sy:return"Suspense";case oy:return"SuspenseList";case ly:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case lc:return"Portal";case sr:return(t.displayName||"Context")+".Provider";case nA:return(t._context.displayName||"Context")+".Consumer";case Jy:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case e0:return e=t.displayName||null,e!==null?e:ay(t.type)||"Memo";case Hr:e=t._payload,t=t._init;try{return ay(t(e))}catch{}}return null}var ac=Array.isArray,Y=Wk.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye=j_.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ys={pending:!1,data:null,method:null,action:null},cy=[],ol=-1;function Mi(t){return{current:t}}function mt(t){0>ol||(t.current=cy[ol],cy[ol]=null,ol--)}function ze(t,e){ol++,cy[ol]=t.current,t.current=e}var Ti=Mi(null),Cc=Mi(null),Xr=Mi(null),Od=Mi(null);function Td(t,e){switch(ze(Xr,e),ze(Cc,t),ze(Ti,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?qk(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=qk(e),t=vC(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}mt(Ti),ze(Ti,t)}function Cl(){mt(Ti),mt(Cc),mt(Xr)}function uy(t){t.memoizedState!==null&&ze(Od,t);var e=Ti.current,n=vC(e,t.type);e!==n&&(ze(Cc,t),ze(Ti,n))}function Ed(t){Cc.current===t&&(mt(Ti),mt(Cc)),Od.current===t&&(mt(Od),_c._currentValue=Ys)}var fy=Object.prototype.hasOwnProperty,t0=lt.unstable_scheduleCallback,Tg=lt.unstable_cancelCallback,W_=lt.unstable_shouldYield,Z_=lt.unstable_requestPaint,Ei=lt.unstable_now,J_=lt.unstable_getCurrentPriorityLevel,iA=lt.unstable_ImmediatePriority,rA=lt.unstable_UserBlockingPriority,Dd=lt.unstable_NormalPriority,eB=lt.unstable_LowPriority,sA=lt.unstable_IdlePriority,tB=lt.log,nB=lt.unstable_setDisableYieldValue,Hc=null,gn=null;function Yr(t){if(typeof tB=="function"&&nB(t),gn&&typeof gn.setStrictMode=="function")try{gn.setStrictMode(Hc,t)}catch{}}var yn=Math.clz32?Math.clz32:sB,iB=Math.log,rB=Math.LN2;function sB(t){return t>>>=0,t===0?32:31-(iB(t)/rB|0)|0}var Wf=256,Zf=4194304;function $s(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function nh(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,s=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=$s(i):(o&=l,o!==0?r=$s(o):n||(n=l&~t,n!==0&&(r=$s(n))))):(l=i&~s,l!==0?r=$s(l):o!==0?r=$s(o):n||(n=i&~t,n!==0&&(r=$s(n)))),r===0?0:e!==0&&e!==r&&(e&s)===0&&(s=r&-r,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:r}function Uc(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function oB(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 oA(){var t=Wf;return Wf<<=1,(Wf&4194048)===0&&(Wf=256),t}function lA(){var t=Zf;return Zf<<=1,(Zf&62914560)===0&&(Zf=4194304),t}function Eg(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Fc(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function lB(t,e,n,i,r,s){var o=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var l=t.entanglements,a=t.expirationTimes,c=t.hiddenUpdates;for(n=o&~n;0<n;){var u=31-yn(n),f=1<<u;l[u]=0,a[u]=-1;var d=c[u];if(d!==null)for(c[u]=null,u=0;u<d.length;u++){var h=d[u];h!==null&&(h.lane&=-536870913)}n&=~f}i!==0&&aA(t,i,0),s!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=s&~(o&~e))}function aA(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-yn(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&4194090}function cA(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-yn(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function n0(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function i0(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function uA(){var t=ye.p;return t!==0?t:(t=window.event,t===void 0?32:DC(t.type))}function aB(t,e){var n=ye.p;try{return ye.p=t,e()}finally{ye.p=n}}var ls=Math.random().toString(36).slice(2),Mt="__reactFiber$"+ls,en="__reactProps$"+ls,Bl="__reactContainer$"+ls,dy="__reactEvents$"+ls,cB="__reactListeners$"+ls,uB="__reactHandles$"+ls,Nw="__reactResources$"+ls,$c="__reactMarker$"+ls;function r0(t){delete t[Mt],delete t[en],delete t[dy],delete t[cB],delete t[uB]}function ll(t){var e=t[Mt];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Bl]||n[Mt]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Hk(t);t!==null;){if(n=t[Mt])return n;t=Hk(t)}return e}t=n,n=t.parentNode}return null}function ql(t){if(t=t[Mt]||t[Bl]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function cc(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(E(33))}function yl(t){var e=t[Nw];return e||(e=t[Nw]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function ht(t){t[$c]=!0}var fA=new Set,dA={};function io(t,e){Ol(t,e),Ol(t+"Capture",e)}function Ol(t,e){for(dA[t]=e,t=0;t<e.length;t++)fA.add(e[t])}var fB=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]*$"),Lw={},Iw={};function dB(t){return fy.call(Iw,t)?!0:fy.call(Lw,t)?!1:fB.test(t)?Iw[t]=!0:(Lw[t]=!0,!1)}function hd(t,e,n){if(dB(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function Jf(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function tr(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}var Dg,_w;function nl(t){if(Dg===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Dg=e&&e[1]||"",_w=-1<n.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
3
|
`+Dg+t+_w}var Mg=!1;function Rg(t,e){if(!t||Mg)return"";Mg=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(h){var d=h}Reflect.construct(t,[],f)}else{try{f.call()}catch(h){d=h}t.call(f.prototype)}}else{try{throw Error()}catch(h){d=h}(f=t())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(h){if(h&&d&&typeof h.stack=="string")return[h.stack,d.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=i.DetermineComponentFrameRoot(),o=s[0],l=s[1];if(o&&l){var a=o.split(`
|
|
4
4
|
`),c=l.split(`
|
|
5
5
|
`);for(r=i=0;i<a.length&&!a[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===a.length||r===c.length)for(i=a.length-1,r=c.length-1;1<=i&&0<=r&&a[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(a[i]!==c[r]){if(i!==1||r!==1)do if(i--,r--,0>r||a[i]!==c[r]){var u=`
|
|
6
6
|
`+a[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{Mg=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?nl(n):""}function hB(t){switch(t.tag){case 26:case 27:case 5:return nl(t.type);case 16:return nl("Lazy");case 13:return nl("Suspense");case 19:return nl("SuspenseList");case 0:case 15:return Rg(t.type,!1);case 11:return Rg(t.type.render,!1);case 1:return Rg(t.type,!0);case 31:return nl("Activity");default:return""}}function Bw(t){try{var e="";do e+=hB(t),t=t.return;while(t);return e}catch(n){return`
|
|
7
7
|
Error generating stack: `+n.message+`
|
|
8
|
-
`+n.stack}}function Rn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function hA(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function pB(t){var e=hA(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Md(t){t._valueTracker||(t._valueTracker=pB(t))}function pA(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=hA(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function Rd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var mB=/[\n"\\]/g;function In(t){return t.replace(mB,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function hy(t,e,n,i,r,s,o,l){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Rn(e)):t.value!==""+Rn(e)&&(t.value=""+Rn(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?py(t,o,Rn(e)):n!=null?py(t,o,Rn(n)):i!=null&&t.removeAttribute("value"),r==null&&s!=null&&(t.defaultChecked=!!s),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?t.name=""+Rn(l):t.removeAttribute("name")}function mA(t,e,n,i,r,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null))return;n=n!=null?""+Rn(n):"",e=e!=null?""+Rn(e):n,l||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=l?t.checked:!!i,t.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o)}function py(t,e,n){e==="number"&&Rd(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function bl(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+Rn(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function gA(t,e,n){if(e!=null&&(e=""+Rn(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+Rn(n):""}function yA(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(E(92));if(ac(i)){if(1<i.length)throw Error(E(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=Rn(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i)}function Tl(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var gB=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 qw(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||gB.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function bA(t,e,n){if(e!=null&&typeof e!="object")throw Error(E(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&qw(t,r,i)}else for(var s in e)e.hasOwnProperty(s)&&qw(t,s,e[s])}function s0(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yB=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"]]),bB=/^[\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 pd(t){return bB.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var my=null;function o0(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var al=null,vl=null;function Pw(t){var e=ql(t);if(e&&(t=e.stateNode)){var n=t[en]||null;e:switch(t=e.stateNode,e.type){case"input":if(hy(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+In(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[en]||null;if(!r)throw Error(E(90));hy(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&pA(i)}break e;case"textarea":gA(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&bl(t,!!n.multiple,e,!1)}}}var Ng=!1;function vA(t,e,n){if(Ng)return t(e,n);Ng=!0;try{var i=t(e);return i}finally{if(Ng=!1,(al!==null||vl!==null)&&(dh(),al&&(e=al,t=vl,vl=al=null,Pw(e),t)))for(e=0;e<t.length;e++)Pw(t[e])}}function Oc(t,e){var n=t.stateNode;if(n===null)return null;var i=n[en]||null;if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(E(231,e,typeof n));return n}var dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gy=!1;if(dr)try{Jo={},Object.defineProperty(Jo,"passive",{get:function(){gy=!0}}),window.addEventListener("test",Jo,Jo),window.removeEventListener("test",Jo,Jo)}catch{gy=!1}var Jo,Kr=null,l0=null,md=null;function xA(){if(md)return md;var t,e=l0,n=e.length,i,r="value"in Kr?Kr.value:Kr.textContent,s=r.length;for(t=0;t<n&&e[t]===r[t];t++);var o=n-t;for(i=1;i<=o&&e[n-i]===r[s-i];i++);return md=r.slice(t,1<i?1-i:void 0)}function gd(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function ed(){return!0}function zw(){return!1}function tn(t){function e(n,i,r,s,o){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?ed:zw,this.isPropagationStopped=zw,this}return Ne(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ed)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ed)},persist:function(){},isPersistent:ed}),e}var ro={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ih=tn(ro),Vc=Ne({},ro,{view:0,detail:0}),vB=tn(Vc),Lg,Ig,ec,rh=Ne({},Vc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:a0,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ec&&(ec&&t.type==="mousemove"?(Lg=t.screenX-ec.screenX,Ig=t.screenY-ec.screenY):Ig=Lg=0,ec=t),Lg)},movementY:function(t){return"movementY"in t?t.movementY:Ig}}),Hw=tn(rh),xB=Ne({},rh,{dataTransfer:0}),SB=tn(xB),wB=Ne({},Vc,{relatedTarget:0}),_g=tn(wB),kB=Ne({},ro,{animationName:0,elapsedTime:0,pseudoElement:0}),AB=tn(kB),CB=Ne({},ro,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),OB=tn(CB),TB=Ne({},ro,{data:0}),Uw=tn(TB),EB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},DB={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"},MB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RB(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=MB[t])?!!e[t]:!1}function a0(){return RB}var NB=Ne({},Vc,{key:function(t){if(t.key){var e=EB[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=gd(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?DB[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:a0,charCode:function(t){return t.type==="keypress"?gd(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?gd(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),LB=tn(NB),IB=Ne({},rh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fw=tn(IB),_B=Ne({},Vc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:a0}),BB=tn(_B),qB=Ne({},ro,{propertyName:0,elapsedTime:0,pseudoElement:0}),PB=tn(qB),zB=Ne({},rh,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),HB=tn(zB),UB=Ne({},ro,{newState:0,oldState:0}),FB=tn(UB),$B=[9,13,27,32],c0=dr&&"CompositionEvent"in window,fc=null;dr&&"documentMode"in document&&(fc=document.documentMode);var VB=dr&&"TextEvent"in window&&!fc,SA=dr&&(!c0||fc&&8<fc&&11>=fc),$w=" ",Vw=!1;function wA(t,e){switch(t){case"keyup":return $B.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kA(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var cl=!1;function jB(t,e){switch(t){case"compositionend":return kA(e);case"keypress":return e.which!==32?null:(Vw=!0,$w);case"textInput":return t=e.data,t===$w&&Vw?null:t;default:return null}}function YB(t,e){if(cl)return t==="compositionend"||!c0&&wA(t,e)?(t=xA(),md=l0=Kr=null,cl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return SA&&e.locale!=="ko"?null:e.data;default:return null}}var KB={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 jw(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!KB[t.type]:e==="textarea"}function AA(t,e,n,i){al?vl?vl.push(i):vl=[i]:al=i,e=Qd(e,"onChange"),0<e.length&&(n=new ih("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var dc=null,Tc=null;function GB(t){gC(t,0)}function sh(t){var e=cc(t);if(pA(e))return t}function Yw(t,e){if(t==="change")return e}var CA=!1;dr&&(dr?(nd="oninput"in document,nd||(Bg=document.createElement("div"),Bg.setAttribute("oninput","return;"),nd=typeof Bg.oninput=="function"),td=nd):td=!1,CA=td&&(!document.documentMode||9<document.documentMode));var td,nd,Bg;function Kw(){dc&&(dc.detachEvent("onpropertychange",OA),Tc=dc=null)}function OA(t){if(t.propertyName==="value"&&sh(Tc)){var e=[];AA(e,Tc,t,o0(t)),vA(GB,e)}}function QB(t,e,n){t==="focusin"?(Kw(),dc=e,Tc=n,dc.attachEvent("onpropertychange",OA)):t==="focusout"&&Kw()}function XB(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return sh(Tc)}function WB(t,e){if(t==="click")return sh(e)}function ZB(t,e){if(t==="input"||t==="change")return sh(e)}function JB(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var vn=typeof Object.is=="function"?Object.is:JB;function Ec(t,e){if(vn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!fy.call(e,r)||!vn(t[r],e[r]))return!1}return!0}function Gw(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Qw(t,e){var n=Gw(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Gw(n)}}function TA(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?TA(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function EA(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Rd(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Rd(t.document)}return e}function u0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var e9=dr&&"documentMode"in document&&11>=document.documentMode,ul=null,yy=null,hc=null,by=!1;function Xw(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;by||ul==null||ul!==Rd(i)||(i=ul,"selectionStart"in i&&u0(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),hc&&Ec(hc,i)||(hc=i,i=Qd(yy,"onSelect"),0<i.length&&(e=new ih("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=ul)))}function Fs(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var fl={animationend:Fs("Animation","AnimationEnd"),animationiteration:Fs("Animation","AnimationIteration"),animationstart:Fs("Animation","AnimationStart"),transitionrun:Fs("Transition","TransitionRun"),transitionstart:Fs("Transition","TransitionStart"),transitioncancel:Fs("Transition","TransitionCancel"),transitionend:Fs("Transition","TransitionEnd")},qg={},DA={};dr&&(DA=document.createElement("div").style,"AnimationEvent"in window||(delete fl.animationend.animation,delete fl.animationiteration.animation,delete fl.animationstart.animation),"TransitionEvent"in window||delete fl.transitionend.transition);function so(t){if(qg[t])return qg[t];if(!fl[t])return t;var e=fl[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in DA)return qg[t]=e[n];return t}var MA=so("animationend"),RA=so("animationiteration"),NA=so("animationstart"),t9=so("transitionrun"),n9=so("transitionstart"),i9=so("transitioncancel"),LA=so("transitionend"),IA=new Map,vy="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(" ");vy.push("scrollEnd");function ni(t,e){IA.set(t,e),io(e,[t])}var Ww=new WeakMap;function _n(t,e){if(typeof t=="object"&&t!==null){var n=Ww.get(t);return n!==void 0?n:(e={value:t,source:e,stack:Bw(e)},Ww.set(t,e),e)}return{value:t,source:e,stack:Bw(e)}}var Mn=[],dl=0,f0=0;function oh(){for(var t=dl,e=f0=dl=0;e<t;){var n=Mn[e];Mn[e++]=null;var i=Mn[e];Mn[e++]=null;var r=Mn[e];Mn[e++]=null;var s=Mn[e];if(Mn[e++]=null,i!==null&&r!==null){var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r}s!==0&&_A(n,r,s)}}function lh(t,e,n,i){Mn[dl++]=t,Mn[dl++]=e,Mn[dl++]=n,Mn[dl++]=i,f0|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function d0(t,e,n,i){return lh(t,e,n,i),Nd(t)}function Pl(t,e){return lh(t,null,null,e),Nd(t)}function _A(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,s=t.return;s!==null;)s.childLanes|=n,i=s.alternate,i!==null&&(i.childLanes|=n),s.tag===22&&(t=s.stateNode,t===null||t._visibility&1||(r=!0)),t=s,s=s.return;return t.tag===3?(s=t.stateNode,r&&e!==null&&(r=31-gn(n),t=s.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),s):null}function Nd(t){if(50<kc)throw kc=0,Hy=null,Error(E(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var hl={};function r9(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pn(t,e,n,i){return new r9(t,e,n,i)}function h0(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ur(t,e){var n=t.alternate;return n===null?(n=pn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function BA(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function yd(t,e,n,i,r,s){var o=0;if(i=t,typeof t=="function")h0(t)&&(o=1);else if(typeof t=="string")o=r7(t,n,Ti.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ly:return t=pn(31,n,e,r),t.elementType=ly,t.lanes=s,t;case sl:return Ks(n.children,r,s,e);case tA:o=8,r|=24;break;case ry:return t=pn(12,n,e,r|2),t.elementType=ry,t.lanes=s,t;case sy:return t=pn(13,n,e,r),t.elementType=sy,t.lanes=s,t;case oy:return t=pn(19,n,e,r),t.elementType=oy,t.lanes=s,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case G_:case sr:o=10;break e;case nA:o=9;break e;case Jy:o=11;break e;case e0:o=14;break e;case Hr:o=16,i=null;break e}o=29,n=Error(E(130,t===null?"null":typeof t,"")),i=null}return e=pn(o,n,e,r),e.elementType=t,e.type=i,e.lanes=s,e}function Ks(t,e,n,i){return t=pn(7,t,i,e),t.lanes=n,t}function Pg(t,e,n){return t=pn(6,t,null,e),t.lanes=n,t}function zg(t,e,n){return e=pn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var pl=[],ml=0,Ld=null,Id=0,Nn=[],Ln=0,Gs=null,or=1,lr="";function Vs(t,e){pl[ml++]=Id,pl[ml++]=Ld,Ld=t,Id=e}function qA(t,e,n){Nn[Ln++]=or,Nn[Ln++]=lr,Nn[Ln++]=Gs,Gs=t;var i=or;t=lr;var r=32-gn(i)-1;i&=~(1<<r),n+=1;var s=32-gn(e)+r;if(30<s){var o=r-r%5;s=(i&(1<<o)-1).toString(32),i>>=o,r-=o,or=1<<32-gn(e)+r|n<<r|i,lr=s+t}else or=1<<s|n<<r|i,lr=t}function p0(t){t.return!==null&&(Vs(t,1),qA(t,1,0))}function m0(t){for(;t===Ld;)Ld=pl[--ml],pl[ml]=null,Id=pl[--ml],pl[ml]=null;for(;t===Gs;)Gs=Nn[--Ln],Nn[Ln]=null,lr=Nn[--Ln],Nn[Ln]=null,or=Nn[--Ln],Nn[Ln]=null}var Ht=null,je=null,ge=!1,Qs=null,Ci=!1,xy=Error(E(519));function Js(t){var e=Error(E(418,""));throw Dc(_n(e,t)),xy}function Zw(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[Dt]=t,e[en]=i,n){case"dialog":se("cancel",e),se("close",e);break;case"iframe":case"object":case"embed":se("load",e);break;case"video":case"audio":for(n=0;n<Nc.length;n++)se(Nc[n],e);break;case"source":se("error",e);break;case"img":case"image":case"link":se("error",e),se("load",e);break;case"details":se("toggle",e);break;case"input":se("invalid",e),mA(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),Md(e);break;case"select":se("invalid",e);break;case"textarea":se("invalid",e),yA(e,i.value,i.defaultValue,i.children),Md(e)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||bC(e.textContent,n)?(i.popover!=null&&(se("beforetoggle",e),se("toggle",e)),i.onScroll!=null&&se("scroll",e),i.onScrollEnd!=null&&se("scrollend",e),i.onClick!=null&&(e.onclick=mh),e=!0):e=!1,e||Js(t)}function Jw(t){for(Ht=t.return;Ht;)switch(Ht.tag){case 5:case 13:Ci=!1;return;case 27:case 3:Ci=!0;return;default:Ht=Ht.return}}function tc(t){if(t!==Ht)return!1;if(!ge)return Jw(t),ge=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Yy(t.type,t.memoizedProps)),n=!n),n&&je&&Js(t),Jw(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(E(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8)if(n=t.data,n==="/$"){if(e===0){je=ti(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++;t=t.nextSibling}je=null}}else e===27?(e=je,as(t.type)?(t=Qy,Qy=null,je=t):je=e):je=Ht?ti(t.stateNode.nextSibling):null;return!0}function jc(){je=Ht=null,ge=!1}function ek(){var t=Qs;return t!==null&&(Jt===null?Jt=t:Jt.push.apply(Jt,t),Qs=null),t}function Dc(t){Qs===null?Qs=[t]:Qs.push(t)}var Sy=Mi(null),oo=null,ar=null;function Fr(t,e,n){ze(Sy,e._currentValue),e._currentValue=n}function fr(t){t._currentValue=Sy.current,pt(Sy)}function wy(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function ky(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var s=r.dependencies;if(s!==null){var o=r.child;s=s.firstContext;e:for(;s!==null;){var l=s;s=r;for(var a=0;a<e.length;a++)if(l.context===e[a]){s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),wy(s.return,n,t),i||(o=null);break e}s=l.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(E(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),wy(o,n,t),o=null}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function Yc(t,e,n,i){t=null;for(var r=e,s=!1;r!==null;){if(!s){if((r.flags&524288)!==0)s=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(E(387));if(o=o.memoizedProps,o!==null){var l=r.type;vn(r.pendingProps.value,o.value)||(t!==null?t.push(l):t=[l])}}else if(r===Od.current){if(o=r.alternate,o===null)throw Error(E(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(_c):t=[_c])}r=r.return}t!==null&&ky(e,t,n,i),e.flags|=262144}function _d(t){for(t=t.firstContext;t!==null;){if(!vn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function eo(t){oo=t,ar=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Mt(t){return PA(oo,t)}function id(t,e){return oo===null&&eo(t),PA(t,e)}function PA(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},ar===null){if(t===null)throw Error(E(308));ar=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else ar=ar.next=e;return n}var s9=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},o9=lt.unstable_scheduleCallback,l9=lt.unstable_NormalPriority,st={$$typeof:sr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function g0(){return{controller:new s9,data:new Map,refCount:0}}function Kc(t){t.refCount--,t.refCount===0&&o9(l9,function(){t.controller.abort()})}var pc=null,Ay=0,El=0,xl=null;function a9(t,e){if(pc===null){var n=pc=[];Ay=0,El=z0(),xl={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Ay++,e.then(tk,tk),e}function tk(){if(--Ay===0&&pc!==null){xl!==null&&(xl.status="fulfilled");var t=pc;pc=null,El=0,xl=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function c9(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var nk=j.S;j.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&a9(t,e),nk!==null&&nk(t,e)};var Xs=Mi(null);function y0(){var t=Xs.current;return t!==null?t:Ee.pooledCache}function bd(t,e){e===null?ze(Xs,Xs.current):ze(Xs,e.pool)}function zA(){var t=y0();return t===null?null:{parent:st._currentValue,pool:t}}var Gc=Error(E(460)),HA=Error(E(474)),ah=Error(E(542)),Cy={then:function(){}};function ik(t){return t=t.status,t==="fulfilled"||t==="rejected"}function rd(){}function UA(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(rd,rd),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,sk(t),t;default:if(typeof e.status=="string")e.then(rd,rd);else{if(t=Ee,t!==null&&100<t.shellSuspendCounter)throw Error(E(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,sk(t),t}throw mc=e,Gc}}var mc=null;function rk(){if(mc===null)throw Error(E(459));var t=mc;return mc=null,t}function sk(t){if(t===Gc||t===ah)throw Error(E(483))}var Ur=!1;function b0(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Oy(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Wr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Zr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(xe&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=Nd(t),_A(t,null,n),e}return lh(t,i,e,n),Nd(t)}function gc(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,cA(t,n)}}function Hg(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=e:s=s.next=e}else r=s=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Ty=!1;function yc(){if(Ty){var t=xl;if(t!==null)throw t}}function bc(t,e,n,i){Ty=!1;var r=t.updateQueue;Ur=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var a=l,c=a.next;a.next=null,o===null?s=c:o.next=c,o=a;var u=t.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(s!==null){var f=r.baseState;o=0,u=c=a=null,l=s;do{var d=l.lane&-536870913,h=d!==l.lane;if(h?(de&d)===d:(i&d)===d){d!==0&&d===El&&(Ty=!0),u!==null&&(u=u.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var p=t,g=l;d=e;var b=n;switch(g.tag){case 1:if(p=g.payload,typeof p=="function"){f=p.call(b,f,d);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,d=typeof p=="function"?p.call(b,f,d):p,d==null)break e;f=Ne({},f,d);break e;case 2:Ur=!0}}d=l.callback,d!==null&&(t.flags|=64,h&&(t.flags|=8192),h=r.callbacks,h===null?r.callbacks=[d]:h.push(d))}else h={lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=h,a=f):u=u.next=h,o|=d;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;h=l,l=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(!0);u===null&&(a=f),r.baseState=a,r.firstBaseUpdate=c,r.lastBaseUpdate=u,s===null&&(r.shared.lanes=0),os|=o,t.lanes=o,t.memoizedState=f}}function FA(t,e){if(typeof t!="function")throw Error(E(191,t));t.call(e)}function $A(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)FA(n[t],e)}var Dl=Mi(null),Bd=Mi(0);function ok(t,e){t=mr,ze(Bd,t),ze(Dl,e),mr=t|e.baseLanes}function Ey(){ze(Bd,mr),ze(Dl,Dl.current)}function v0(){mr=Bd.current,pt(Dl),pt(Bd)}var rs=0,J=null,ke=null,tt=null,qd=!1,Sl=!1,to=!1,Pd=0,Mc=0,wl=null,u9=0;function Qe(){throw Error(E(321))}function x0(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!vn(t[n],e[n]))return!1;return!0}function S0(t,e,n,i,r,s){return rs=s,J=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,j.H=t===null||t.memoizedState===null?x2:S2,to=!1,s=n(i,r),to=!1,Sl&&(s=jA(e,n,i,r)),VA(t),s}function VA(t){j.H=zd;var e=ke!==null&&ke.next!==null;if(rs=0,tt=ke=J=null,qd=!1,Mc=0,wl=null,e)throw Error(E(300));t===null||ht||(t=t.dependencies,t!==null&&_d(t)&&(ht=!0))}function jA(t,e,n,i){J=t;var r=0;do{if(Sl&&(wl=null),Mc=0,Sl=!1,25<=r)throw Error(E(301));if(r+=1,tt=ke=null,t.updateQueue!=null){var s=t.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}j.H=y9,s=e(n,i)}while(Sl);return s}function f9(){var t=j.H,e=t.useState()[0];return e=typeof e.then=="function"?Qc(e):e,t=t.useState()[0],(ke!==null?ke.memoizedState:null)!==t&&(J.flags|=1024),e}function w0(){var t=Pd!==0;return Pd=0,t}function k0(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function A0(t){if(qd){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}qd=!1}rs=0,tt=ke=J=null,Sl=!1,Mc=Pd=0,wl=null}function Wt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?J.memoizedState=tt=t:tt=tt.next=t,tt}function nt(){if(ke===null){var t=J.alternate;t=t!==null?t.memoizedState:null}else t=ke.next;var e=tt===null?J.memoizedState:tt.next;if(e!==null)tt=e,ke=t;else{if(t===null)throw J.alternate===null?Error(E(467)):Error(E(310));ke=t,t={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},tt===null?J.memoizedState=tt=t:tt=tt.next=t}return tt}function C0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qc(t){var e=Mc;return Mc+=1,wl===null&&(wl=[]),t=UA(wl,t,e),e=J,(tt===null?e.memoizedState:tt.next)===null&&(e=e.alternate,j.H=e===null||e.memoizedState===null?x2:S2),t}function ch(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Qc(t);if(t.$$typeof===sr)return Mt(t)}throw Error(E(438,String(t)))}function O0(t){var e=null,n=J.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=J.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=C0(),J.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=Q_;return e.index++,n}function hr(t,e){return typeof e=="function"?e(t):e}function vd(t){var e=nt();return T0(e,ke,t)}function T0(t,e,n){var i=t.queue;if(i===null)throw Error(E(311));i.lastRenderedReducer=n;var r=t.baseQueue,s=i.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}e.baseQueue=r=s,i.pending=null}if(s=t.baseState,r===null)t.memoizedState=s;else{e=r.next;var l=o=null,a=null,c=e,u=!1;do{var f=c.lane&-536870913;if(f!==c.lane?(de&f)===f:(rs&f)===f){var d=c.revertLane;if(d===0)a!==null&&(a=a.next={lane:0,revertLane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===El&&(u=!0);else if((rs&d)===d){c=c.next,d===El&&(u=!0);continue}else f={lane:0,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},a===null?(l=a=f,o=s):a=a.next=f,J.lanes|=d,os|=d;f=c.action,to&&n(s,f),s=c.hasEagerState?c.eagerState:n(s,f)}else d={lane:f,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},a===null?(l=a=d,o=s):a=a.next=d,J.lanes|=f,os|=f;c=c.next}while(c!==null&&c!==e);if(a===null?o=s:a.next=l,!vn(s,t.memoizedState)&&(ht=!0,u&&(n=xl,n!==null)))throw n;t.memoizedState=s,t.baseState=o,t.baseQueue=a,i.lastRenderedState=s}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Ug(t){var e=nt(),n=e.queue;if(n===null)throw Error(E(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do s=t(s,o.action),o=o.next;while(o!==r);vn(s,e.memoizedState)||(ht=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function YA(t,e,n){var i=J,r=nt(),s=ge;if(s){if(n===void 0)throw Error(E(407));n=n()}else n=e();var o=!vn((ke||r).memoizedState,n);o&&(r.memoizedState=n,ht=!0),r=r.queue;var l=QA.bind(null,i,r,t);if(Xc(2048,8,l,[t]),r.getSnapshot!==e||o||tt!==null&&tt.memoizedState.tag&1){if(i.flags|=2048,Ml(9,uh(),GA.bind(null,i,r,n,e),null),Ee===null)throw Error(E(349));s||(rs&124)!==0||KA(i,e,n)}return n}function KA(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=J.updateQueue,e===null?(e=C0(),J.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function GA(t,e,n,i){e.value=n,e.getSnapshot=i,XA(e)&&WA(t)}function QA(t,e,n){return n(function(){XA(e)&&WA(t)})}function XA(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!vn(t,n)}catch{return!0}}function WA(t){var e=Pl(t,2);e!==null&&bn(e,t,2)}function Dy(t){var e=Wt();if(typeof t=="function"){var n=t;if(t=n(),to){Yr(!0);try{n()}finally{Yr(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:t},e}function ZA(t,e,n,i){return t.baseState=n,T0(t,ke,typeof i=="function"?i:hr)}function d9(t,e,n,i,r){if(fh(t))throw Error(E(485));if(t=e.action,t!==null){var s={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){s.listeners.push(o)}};j.T!==null?n(!0):s.isTransition=!1,i(s),n=e.pending,n===null?(s.next=e.pending=s,JA(e,s)):(s.next=n.next,e.pending=n.next=s)}}function JA(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var s=j.T,o={};j.T=o;try{var l=n(r,i),a=j.S;a!==null&&a(o,l),lk(t,e,l)}catch(c){My(t,e,c)}finally{j.T=s}}else try{s=n(r,i),lk(t,e,s)}catch(c){My(t,e,c)}}function lk(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){ak(t,e,i)},function(i){return My(t,e,i)}):ak(t,e,n)}function ak(t,e,n){e.status="fulfilled",e.value=n,e2(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,JA(t,n)))}function My(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,e2(e),e=e.next;while(e!==i)}t.action=null}function e2(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function t2(t,e){return e}function ck(t,e){if(ge){var n=Ee.formState;if(n!==null){e:{var i=J;if(ge){if(je){t:{for(var r=je,s=Ci;r.nodeType!==8;){if(!s){r=null;break t}if(r=ti(r.nextSibling),r===null){r=null;break t}}s=r.data,r=s==="F!"||s==="F"?r:null}if(r){je=ti(r.nextSibling),i=r.data==="F!";break e}}Js(i)}i=!1}i&&(e=n[0])}}return n=Wt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t2,lastRenderedState:e},n.queue=i,n=y2.bind(null,J,i),i.dispatch=n,i=Dy(!1),s=R0.bind(null,J,!1,i.queue),i=Wt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=d9.bind(null,J,r,s,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function uk(t){var e=nt();return n2(e,ke,t)}function n2(t,e,n){if(e=T0(t,e,t2)[0],t=vd(hr)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Qc(e)}catch(o){throw o===Gc?ah:o}else i=e;e=nt();var r=e.queue,s=r.dispatch;return n!==e.memoizedState&&(J.flags|=2048,Ml(9,uh(),h9.bind(null,r,n),null)),[i,s,t]}function h9(t,e){t.action=e}function fk(t){var e=nt(),n=ke;if(n!==null)return n2(e,n,t);nt(),e=e.memoizedState,n=nt();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function Ml(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=J.updateQueue,e===null&&(e=C0(),J.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function uh(){return{destroy:void 0,resource:void 0}}function i2(){return nt().memoizedState}function xd(t,e,n,i){var r=Wt();i=i===void 0?null:i,J.flags|=t,r.memoizedState=Ml(1|e,uh(),n,i)}function Xc(t,e,n,i){var r=nt();i=i===void 0?null:i;var s=r.memoizedState.inst;ke!==null&&i!==null&&x0(i,ke.memoizedState.deps)?r.memoizedState=Ml(e,s,n,i):(J.flags|=t,r.memoizedState=Ml(1|e,s,n,i))}function dk(t,e){xd(8390656,8,t,e)}function r2(t,e){Xc(2048,8,t,e)}function s2(t,e){return Xc(4,2,t,e)}function o2(t,e){return Xc(4,4,t,e)}function l2(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function a2(t,e,n){n=n!=null?n.concat([t]):null,Xc(4,4,l2.bind(null,e,t),n)}function E0(){}function c2(t,e){var n=nt();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&x0(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function u2(t,e){var n=nt();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&x0(e,i[1]))return i[0];if(i=t(),to){Yr(!0);try{t()}finally{Yr(!1)}}return n.memoizedState=[i,e],i}function D0(t,e,n){return n===void 0||(rs&1073741824)!==0?t.memoizedState=e:(t.memoizedState=n,t=eC(),J.lanes|=t,os|=t,n)}function f2(t,e,n,i){return vn(n,e)?n:Dl.current!==null?(t=D0(t,n,i),vn(t,e)||(ht=!0),t):(rs&42)===0?(ht=!0,t.memoizedState=n):(t=eC(),J.lanes|=t,os|=t,e)}function d2(t,e,n,i,r){var s=ye.p;ye.p=s!==0&&8>s?s:8;var o=j.T,l={};j.T=l,R0(t,!1,e,n);try{var a=r(),c=j.S;if(c!==null&&c(l,a),a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=c9(a,i);vc(t,e,u,yn(t))}else vc(t,e,i,yn(t))}catch(f){vc(t,e,{then:function(){},status:"rejected",reason:f},yn())}finally{ye.p=s,j.T=o}}function p9(){}function Ry(t,e,n,i){if(t.tag!==5)throw Error(E(476));var r=h2(t).queue;d2(t,r,e,Ys,n===null?p9:function(){return p2(t),n(i)})}function h2(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Ys,baseState:Ys,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:Ys},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function p2(t){var e=h2(t).next.queue;vc(t,e,{},yn())}function M0(){return Mt(_c)}function m2(){return nt().memoizedState}function g2(){return nt().memoizedState}function m9(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=yn();t=Wr(n);var i=Zr(e,t,n);i!==null&&(bn(i,e,n),gc(i,e,n)),e={cache:g0()},t.payload=e;return}e=e.return}}function g9(t,e,n){var i=yn();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},fh(t)?b2(e,n):(n=d0(t,e,n,i),n!==null&&(bn(n,t,i),v2(n,e,i)))}function y2(t,e,n){var i=yn();vc(t,e,n,i)}function vc(t,e,n,i){var r={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(fh(t))b2(e,r);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,vn(l,o))return lh(t,e,r,0),Ee===null&&oh(),!1}catch{}if(n=d0(t,e,r,i),n!==null)return bn(n,t,i),v2(n,e,i),!0}return!1}function R0(t,e,n,i){if(i={lane:2,revertLane:z0(),action:i,hasEagerState:!1,eagerState:null,next:null},fh(t)){if(e)throw Error(E(479))}else e=d0(t,n,i,2),e!==null&&bn(e,t,2)}function fh(t){var e=t.alternate;return t===J||e!==null&&e===J}function b2(t,e){Sl=qd=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function v2(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,cA(t,n)}}var zd={readContext:Mt,use:ch,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe},x2={readContext:Mt,use:ch,useCallback:function(t,e){return Wt().memoizedState=[t,e===void 0?null:e],t},useContext:Mt,useEffect:dk,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,xd(4194308,4,l2.bind(null,e,t),n)},useLayoutEffect:function(t,e){return xd(4194308,4,t,e)},useInsertionEffect:function(t,e){xd(4,2,t,e)},useMemo:function(t,e){var n=Wt();e=e===void 0?null:e;var i=t();if(to){Yr(!0);try{t()}finally{Yr(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Wt();if(n!==void 0){var r=n(e);if(to){Yr(!0);try{n(e)}finally{Yr(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=g9.bind(null,J,t),[i.memoizedState,t]},useRef:function(t){var e=Wt();return t={current:t},e.memoizedState=t},useState:function(t){t=Dy(t);var e=t.queue,n=y2.bind(null,J,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:E0,useDeferredValue:function(t,e){var n=Wt();return D0(n,t,e)},useTransition:function(){var t=Dy(!1);return t=d2.bind(null,J,t.queue,!0,!1),Wt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=J,r=Wt();if(ge){if(n===void 0)throw Error(E(407));n=n()}else{if(n=e(),Ee===null)throw Error(E(349));(de&124)!==0||KA(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,dk(QA.bind(null,i,s,t),[t]),i.flags|=2048,Ml(9,uh(),GA.bind(null,i,s,n,e),null),n},useId:function(){var t=Wt(),e=Ee.identifierPrefix;if(ge){var n=lr,i=or;n=(i&~(1<<32-gn(i)-1)).toString(32)+n,e="\xAB"+e+"R"+n,n=Pd++,0<n&&(e+="H"+n.toString(32)),e+="\xBB"}else n=u9++,e="\xAB"+e+"r"+n.toString(32)+"\xBB";return t.memoizedState=e},useHostTransitionStatus:M0,useFormState:ck,useActionState:ck,useOptimistic:function(t){var e=Wt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=R0.bind(null,J,!0,n),n.dispatch=e,[t,e]},useMemoCache:O0,useCacheRefresh:function(){return Wt().memoizedState=m9.bind(null,J)}},S2={readContext:Mt,use:ch,useCallback:c2,useContext:Mt,useEffect:r2,useImperativeHandle:a2,useInsertionEffect:s2,useLayoutEffect:o2,useMemo:u2,useReducer:vd,useRef:i2,useState:function(){return vd(hr)},useDebugValue:E0,useDeferredValue:function(t,e){var n=nt();return f2(n,ke.memoizedState,t,e)},useTransition:function(){var t=vd(hr)[0],e=nt().memoizedState;return[typeof t=="boolean"?t:Qc(t),e]},useSyncExternalStore:YA,useId:m2,useHostTransitionStatus:M0,useFormState:uk,useActionState:uk,useOptimistic:function(t,e){var n=nt();return ZA(n,ke,t,e)},useMemoCache:O0,useCacheRefresh:g2},y9={readContext:Mt,use:ch,useCallback:c2,useContext:Mt,useEffect:r2,useImperativeHandle:a2,useInsertionEffect:s2,useLayoutEffect:o2,useMemo:u2,useReducer:Ug,useRef:i2,useState:function(){return Ug(hr)},useDebugValue:E0,useDeferredValue:function(t,e){var n=nt();return ke===null?D0(n,t,e):f2(n,ke.memoizedState,t,e)},useTransition:function(){var t=Ug(hr)[0],e=nt().memoizedState;return[typeof t=="boolean"?t:Qc(t),e]},useSyncExternalStore:YA,useId:m2,useHostTransitionStatus:M0,useFormState:fk,useActionState:fk,useOptimistic:function(t,e){var n=nt();return ke!==null?ZA(n,ke,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:O0,useCacheRefresh:g2},kl=null,Rc=0;function sd(t){var e=Rc;return Rc+=1,kl===null&&(kl=[]),UA(kl,t,e)}function nc(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function od(t,e){throw e.$$typeof===K_?Error(E(525)):(t=Object.prototype.toString.call(e),Error(E(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function hk(t){var e=t._init;return e(t._payload)}function w2(t){function e(m,y){if(t){var v=m.deletions;v===null?(m.deletions=[y],m.flags|=16):v.push(y)}}function n(m,y){if(!t)return null;for(;y!==null;)e(m,y),y=y.sibling;return null}function i(m){for(var y=new Map;m!==null;)m.key!==null?y.set(m.key,m):y.set(m.index,m),m=m.sibling;return y}function r(m,y){return m=ur(m,y),m.index=0,m.sibling=null,m}function s(m,y,v){return m.index=v,t?(v=m.alternate,v!==null?(v=v.index,v<y?(m.flags|=67108866,y):v):(m.flags|=67108866,y)):(m.flags|=1048576,y)}function o(m){return t&&m.alternate===null&&(m.flags|=67108866),m}function l(m,y,v,x){return y===null||y.tag!==6?(y=Pg(v,m.mode,x),y.return=m,y):(y=r(y,v),y.return=m,y)}function a(m,y,v,x){var A=v.type;return A===sl?u(m,y,v.props.children,x,v.key):y!==null&&(y.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Hr&&hk(A)===y.type)?(y=r(y,v.props),nc(y,v),y.return=m,y):(y=yd(v.type,v.key,v.props,null,m.mode,x),nc(y,v),y.return=m,y)}function c(m,y,v,x){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=zg(v,m.mode,x),y.return=m,y):(y=r(y,v.children||[]),y.return=m,y)}function u(m,y,v,x,A){return y===null||y.tag!==7?(y=Ks(v,m.mode,x,A),y.return=m,y):(y=r(y,v),y.return=m,y)}function f(m,y,v){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=Pg(""+y,m.mode,v),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Xf:return v=yd(y.type,y.key,y.props,null,m.mode,v),nc(v,y),v.return=m,v;case lc:return y=zg(y,m.mode,v),y.return=m,y;case Hr:var x=y._init;return y=x(y._payload),f(m,y,v)}if(ac(y)||Ja(y))return y=Ks(y,m.mode,v,null),y.return=m,y;if(typeof y.then=="function")return f(m,sd(y),v);if(y.$$typeof===sr)return f(m,id(m,y),v);od(m,y)}return null}function d(m,y,v,x){var A=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return A!==null?null:l(m,y,""+v,x);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Xf:return v.key===A?a(m,y,v,x):null;case lc:return v.key===A?c(m,y,v,x):null;case Hr:return A=v._init,v=A(v._payload),d(m,y,v,x)}if(ac(v)||Ja(v))return A!==null?null:u(m,y,v,x,null);if(typeof v.then=="function")return d(m,y,sd(v),x);if(v.$$typeof===sr)return d(m,y,id(m,v),x);od(m,v)}return null}function h(m,y,v,x,A){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return m=m.get(v)||null,l(y,m,""+x,A);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Xf:return m=m.get(x.key===null?v:x.key)||null,a(y,m,x,A);case lc:return m=m.get(x.key===null?v:x.key)||null,c(y,m,x,A);case Hr:var w=x._init;return x=w(x._payload),h(m,y,v,x,A)}if(ac(x)||Ja(x))return m=m.get(v)||null,u(y,m,x,A,null);if(typeof x.then=="function")return h(m,y,v,sd(x),A);if(x.$$typeof===sr)return h(m,y,v,id(y,x),A);od(y,x)}return null}function p(m,y,v,x){for(var A=null,w=null,k=y,C=y=0,O=null;k!==null&&C<v.length;C++){k.index>C?(O=k,k=null):O=k.sibling;var M=d(m,k,v[C],x);if(M===null){k===null&&(k=O);break}t&&k&&M.alternate===null&&e(m,k),y=s(M,y,C),w===null?A=M:w.sibling=M,w=M,k=O}if(C===v.length)return n(m,k),ge&&Vs(m,C),A;if(k===null){for(;C<v.length;C++)k=f(m,v[C],x),k!==null&&(y=s(k,y,C),w===null?A=k:w.sibling=k,w=k);return ge&&Vs(m,C),A}for(k=i(k);C<v.length;C++)O=h(k,m,C,v[C],x),O!==null&&(t&&O.alternate!==null&&k.delete(O.key===null?C:O.key),y=s(O,y,C),w===null?A=O:w.sibling=O,w=O);return t&&k.forEach(function(_){return e(m,_)}),ge&&Vs(m,C),A}function g(m,y,v,x){if(v==null)throw Error(E(151));for(var A=null,w=null,k=y,C=y=0,O=null,M=v.next();k!==null&&!M.done;C++,M=v.next()){k.index>C?(O=k,k=null):O=k.sibling;var _=d(m,k,M.value,x);if(_===null){k===null&&(k=O);break}t&&k&&_.alternate===null&&e(m,k),y=s(_,y,C),w===null?A=_:w.sibling=_,w=_,k=O}if(M.done)return n(m,k),ge&&Vs(m,C),A;if(k===null){for(;!M.done;C++,M=v.next())M=f(m,M.value,x),M!==null&&(y=s(M,y,C),w===null?A=M:w.sibling=M,w=M);return ge&&Vs(m,C),A}for(k=i(k);!M.done;C++,M=v.next())M=h(k,m,C,M.value,x),M!==null&&(t&&M.alternate!==null&&k.delete(M.key===null?C:M.key),y=s(M,y,C),w===null?A=M:w.sibling=M,w=M);return t&&k.forEach(function(D){return e(m,D)}),ge&&Vs(m,C),A}function b(m,y,v,x){if(typeof v=="object"&&v!==null&&v.type===sl&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Xf:e:{for(var A=v.key;y!==null;){if(y.key===A){if(A=v.type,A===sl){if(y.tag===7){n(m,y.sibling),x=r(y,v.props.children),x.return=m,m=x;break e}}else if(y.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Hr&&hk(A)===y.type){n(m,y.sibling),x=r(y,v.props),nc(x,v),x.return=m,m=x;break e}n(m,y);break}else e(m,y);y=y.sibling}v.type===sl?(x=Ks(v.props.children,m.mode,x,v.key),x.return=m,m=x):(x=yd(v.type,v.key,v.props,null,m.mode,x),nc(x,v),x.return=m,m=x)}return o(m);case lc:e:{for(A=v.key;y!==null;){if(y.key===A)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(m,y.sibling),x=r(y,v.children||[]),x.return=m,m=x;break e}else{n(m,y);break}else e(m,y);y=y.sibling}x=zg(v,m.mode,x),x.return=m,m=x}return o(m);case Hr:return A=v._init,v=A(v._payload),b(m,y,v,x)}if(ac(v))return p(m,y,v,x);if(Ja(v)){if(A=Ja(v),typeof A!="function")throw Error(E(150));return v=A.call(v),g(m,y,v,x)}if(typeof v.then=="function")return b(m,y,sd(v),x);if(v.$$typeof===sr)return b(m,y,id(m,v),x);od(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,y!==null&&y.tag===6?(n(m,y.sibling),x=r(y,v),x.return=m,m=x):(n(m,y),x=Pg(v,m.mode,x),x.return=m,m=x),o(m)):n(m,y)}return function(m,y,v,x){try{Rc=0;var A=b(m,y,v,x);return kl=null,A}catch(k){if(k===Gc||k===ah)throw k;var w=pn(29,k,null,m.mode);return w.lanes=x,w.return=m,w}}}var Rl=w2(!0),k2=w2(!1),qn=Mi(null),Di=null;function $r(t){var e=t.alternate;ze(ot,ot.current&1),ze(qn,t),Di===null&&(e===null||Dl.current!==null||e.memoizedState!==null)&&(Di=t)}function A2(t){if(t.tag===22){if(ze(ot,ot.current),ze(qn,t),Di===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(Di=t)}}else Vr(t)}function Vr(){ze(ot,ot.current),ze(qn,qn.current)}function cr(t){pt(qn),Di===t&&(Di=null),pt(ot)}var ot=Mi(0);function Hd(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||Gy(n)))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function Fg(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:Ne({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Ny={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=yn(),r=Wr(i);r.payload=e,n!=null&&(r.callback=n),e=Zr(t,r,i),e!==null&&(bn(e,t,i),gc(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=yn(),r=Wr(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Zr(t,r,i),e!==null&&(bn(e,t,i),gc(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=yn(),i=Wr(n);i.tag=2,e!=null&&(i.callback=e),e=Zr(t,i,n),e!==null&&(bn(e,t,n),gc(e,t,n))}};function pk(t,e,n,i,r,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,s,o):e.prototype&&e.prototype.isPureReactComponent?!Ec(n,i)||!Ec(r,s):!0}function mk(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&Ny.enqueueReplaceState(e,e.state,null)}function no(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=Ne({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}var Ud=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function C2(t){Ud(t)}function O2(t){console.error(t)}function T2(t){Ud(t)}function Fd(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function gk(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Ly(t,e,n){return n=Wr(n),n.tag=3,n.payload={element:null},n.callback=function(){Fd(t,e)},n}function E2(t){return t=Wr(t),t.tag=3,t}function D2(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var s=i.value;t.payload=function(){return r(s)},t.callback=function(){gk(e,n,i)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){gk(e,n,i),typeof r!="function"&&(Jr===null?Jr=new Set([this]):Jr.add(this));var l=i.stack;this.componentDidCatch(i.value,{componentStack:l!==null?l:""})})}function b9(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Yc(e,n,r,!0),n=qn.current,n!==null){switch(n.tag){case 13:return Di===null?Uy():n.alternate===null&&Ye===0&&(Ye=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===Cy?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),Jg(t,i,r)),!1;case 22:return n.flags|=65536,i===Cy?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),Jg(t,i,r)),!1}throw Error(E(435,n.tag))}return Jg(t,i,r),Uy(),!1}if(ge)return e=qn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==xy&&(t=Error(E(422),{cause:i}),Dc(_n(t,n)))):(i!==xy&&(e=Error(E(423),{cause:i}),Dc(_n(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=_n(i,n),r=Ly(t.stateNode,i,r),Hg(t,r),Ye!==4&&(Ye=2)),!1;var s=Error(E(520),{cause:i});if(s=_n(s,n),wc===null?wc=[s]:wc.push(s),Ye!==4&&(Ye=2),e===null)return!0;i=_n(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=Ly(n.stateNode,i,t),Hg(n,t),!1;case 1:if(e=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Jr===null||!Jr.has(s))))return n.flags|=65536,r&=-r,n.lanes|=r,r=E2(r),D2(r,t,n,i),Hg(n,r),!1}n=n.return}while(n!==null);return!1}var M2=Error(E(461)),ht=!1;function vt(t,e,n,i){e.child=t===null?k2(e,null,n,i):Rl(e,t.child,n,i)}function yk(t,e,n,i,r){n=n.render;var s=e.ref;if("ref"in i){var o={};for(var l in i)l!=="ref"&&(o[l]=i[l])}else o=i;return eo(e),i=S0(t,e,n,o,s,r),l=w0(),t!==null&&!ht?(k0(t,e,r),pr(t,e,r)):(ge&&l&&p0(e),e.flags|=1,vt(t,e,i,r),e.child)}function bk(t,e,n,i,r){if(t===null){var s=n.type;return typeof s=="function"&&!h0(s)&&s.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=s,R2(t,e,s,i,r)):(t=yd(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!N0(t,r)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Ec,n(o,i)&&t.ref===e.ref)return pr(t,e,r)}return e.flags|=1,t=ur(s,i),t.ref=e.ref,t.return=e,e.child=t}function R2(t,e,n,i,r){if(t!==null){var s=t.memoizedProps;if(Ec(s,i)&&t.ref===e.ref)if(ht=!1,e.pendingProps=i=s,N0(t,r))(t.flags&131072)!==0&&(ht=!0);else return e.lanes=t.lanes,pr(t,e,r)}return Iy(t,e,n,i,r)}function N2(t,e,n){var i=e.pendingProps,r=i.children,s=t!==null?t.memoizedState:null;if(i.mode==="hidden"){if((e.flags&128)!==0){if(i=s!==null?s.baseLanes|n:n,t!==null){for(r=e.child=t.child,s=0;r!==null;)s=s|r.lanes|r.childLanes,r=r.sibling;e.childLanes=s&~i}else e.childLanes=0,e.child=null;return vk(t,e,i,n)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&bd(e,s!==null?s.cachePool:null),s!==null?ok(e,s):Ey(),A2(e);else return e.lanes=e.childLanes=536870912,vk(t,e,s!==null?s.baseLanes|n:n,n)}else s!==null?(bd(e,s.cachePool),ok(e,s),Vr(e),e.memoizedState=null):(t!==null&&bd(e,null),Ey(),Vr(e));return vt(t,e,r,n),e.child}function vk(t,e,n,i){var r=y0();return r=r===null?null:{parent:st._currentValue,pool:r},e.memoizedState={baseLanes:n,cachePool:r},t!==null&&bd(e,null),Ey(),A2(e),t!==null&&Yc(t,e,i,!0),null}function Sd(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(E(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function Iy(t,e,n,i,r){return eo(e),n=S0(t,e,n,i,void 0,r),i=w0(),t!==null&&!ht?(k0(t,e,r),pr(t,e,r)):(ge&&i&&p0(e),e.flags|=1,vt(t,e,n,r),e.child)}function xk(t,e,n,i,r,s){return eo(e),e.updateQueue=null,n=jA(e,i,n,r),VA(t),i=w0(),t!==null&&!ht?(k0(t,e,s),pr(t,e,s)):(ge&&i&&p0(e),e.flags|=1,vt(t,e,n,s),e.child)}function Sk(t,e,n,i,r){if(eo(e),e.stateNode===null){var s=hl,o=n.contextType;typeof o=="object"&&o!==null&&(s=Mt(o)),s=new n(i,s),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Ny,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=i,s.state=e.memoizedState,s.refs={},b0(e),o=n.contextType,s.context=typeof o=="object"&&o!==null?Mt(o):hl,s.state=e.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(Fg(e,n,o,i),s.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(o=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),o!==s.state&&Ny.enqueueReplaceState(s,s.state,null),bc(e,i,s,r),yc(),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){s=e.stateNode;var l=e.memoizedProps,a=no(n,l);s.props=a;var c=s.context,u=n.contextType;o=hl,typeof u=="object"&&u!==null&&(o=Mt(u));var f=n.getDerivedStateFromProps;u=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function",l=e.pendingProps!==l,u||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l||c!==o)&&mk(e,s,i,o),Ur=!1;var d=e.memoizedState;s.state=d,bc(e,i,s,r),yc(),c=e.memoizedState,l||d!==c||Ur?(typeof f=="function"&&(Fg(e,n,f,i),c=e.memoizedState),(a=Ur||pk(e,n,a,i,d,c,o))?(u||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),s.props=i,s.state=c,s.context=o,i=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{s=e.stateNode,Oy(t,e),o=e.memoizedProps,u=no(n,o),s.props=u,f=e.pendingProps,d=s.context,c=n.contextType,a=hl,typeof c=="object"&&c!==null&&(a=Mt(c)),l=n.getDerivedStateFromProps,(c=typeof l=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==f||d!==a)&&mk(e,s,i,a),Ur=!1,d=e.memoizedState,s.state=d,bc(e,i,s,r),yc();var h=e.memoizedState;o!==f||d!==h||Ur||t!==null&&t.dependencies!==null&&_d(t.dependencies)?(typeof l=="function"&&(Fg(e,n,l,i),h=e.memoizedState),(u=Ur||pk(e,n,u,i,d,h,a)||t!==null&&t.dependencies!==null&&_d(t.dependencies))?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(i,h,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(i,h,a)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=h),s.props=i,s.state=h,s.context=a,i=u):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),i=!1)}return s=i,Sd(t,e),i=(e.flags&128)!==0,s||i?(s=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:s.render(),e.flags|=1,t!==null&&i?(e.child=Rl(e,t.child,null,r),e.child=Rl(e,null,n,r)):vt(t,e,n,r),e.memoizedState=s.state,t=e.child):t=pr(t,e,r),t}function wk(t,e,n,i){return jc(),e.flags|=256,vt(t,e,n,i),e.child}var $g={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vg(t){return{baseLanes:t,cachePool:zA()}}function jg(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=Bn),t}function L2(t,e,n){var i=e.pendingProps,r=!1,s=(e.flags&128)!==0,o;if((o=s)||(o=t!==null&&t.memoizedState===null?!1:(ot.current&2)!==0),o&&(r=!0,e.flags&=-129),o=(e.flags&32)!==0,e.flags&=-33,t===null){if(ge){if(r?$r(e):Vr(e),ge){var l=je,a;if(a=l){e:{for(a=l,l=Ci;a.nodeType!==8;){if(!l){l=null;break e}if(a=ti(a.nextSibling),a===null){l=null;break e}}l=a}l!==null?(e.memoizedState={dehydrated:l,treeContext:Gs!==null?{id:or,overflow:lr}:null,retryLane:536870912,hydrationErrors:null},a=pn(18,null,null,0),a.stateNode=l,a.return=e,e.child=a,Ht=e,je=null,a=!0):a=!1}a||Js(e)}if(l=e.memoizedState,l!==null&&(l=l.dehydrated,l!==null))return Gy(l)?e.lanes=32:e.lanes=536870912,null;cr(e)}return l=i.children,i=i.fallback,r?(Vr(e),r=e.mode,l=$d({mode:"hidden",children:l},r),i=Ks(i,r,n,null),l.return=e,i.return=e,l.sibling=i,e.child=l,r=e.child,r.memoizedState=Vg(n),r.childLanes=jg(t,o,n),e.memoizedState=$g,i):($r(e),_y(e,l))}if(a=t.memoizedState,a!==null&&(l=a.dehydrated,l!==null)){if(s)e.flags&256?($r(e),e.flags&=-257,e=Yg(t,e,n)):e.memoizedState!==null?(Vr(e),e.child=t.child,e.flags|=128,e=null):(Vr(e),r=i.fallback,l=e.mode,i=$d({mode:"visible",children:i.children},l),r=Ks(r,l,n,null),r.flags|=2,i.return=e,r.return=e,i.sibling=r,e.child=i,Rl(e,t.child,null,n),i=e.child,i.memoizedState=Vg(n),i.childLanes=jg(t,o,n),e.memoizedState=$g,e=r);else if($r(e),Gy(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var c=o.dgst;o=c,i=Error(E(419)),i.stack="",i.digest=o,Dc({value:i,source:null,stack:null}),e=Yg(t,e,n)}else if(ht||Yc(t,e,n,!1),o=(n&t.childLanes)!==0,ht||o){if(o=Ee,o!==null&&(i=n&-n,i=(i&42)!==0?1:n0(i),i=(i&(o.suspendedLanes|n))!==0?0:i,i!==0&&i!==a.retryLane))throw a.retryLane=i,Pl(t,i),bn(o,t,i),M2;l.data==="$?"||Uy(),e=Yg(t,e,n)}else l.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=a.treeContext,je=ti(l.nextSibling),Ht=e,ge=!0,Qs=null,Ci=!1,t!==null&&(Nn[Ln++]=or,Nn[Ln++]=lr,Nn[Ln++]=Gs,or=t.id,lr=t.overflow,Gs=e),e=_y(e,i.children),e.flags|=4096);return e}return r?(Vr(e),r=i.fallback,l=e.mode,a=t.child,c=a.sibling,i=ur(a,{mode:"hidden",children:i.children}),i.subtreeFlags=a.subtreeFlags&65011712,c!==null?r=ur(c,r):(r=Ks(r,l,n,null),r.flags|=2),r.return=e,i.return=e,i.sibling=r,e.child=i,i=r,r=e.child,l=t.child.memoizedState,l===null?l=Vg(n):(a=l.cachePool,a!==null?(c=st._currentValue,a=a.parent!==c?{parent:c,pool:c}:a):a=zA(),l={baseLanes:l.baseLanes|n,cachePool:a}),r.memoizedState=l,r.childLanes=jg(t,o,n),e.memoizedState=$g,i):($r(e),n=t.child,t=n.sibling,n=ur(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(o=e.deletions,o===null?(e.deletions=[t],e.flags|=16):o.push(t)),e.child=n,e.memoizedState=null,n)}function _y(t,e){return e=$d({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function $d(t,e){return t=pn(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Yg(t,e,n){return Rl(e,t.child,null,n),t=_y(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function kk(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),wy(t.return,e,n)}function Kg(t,e,n,i,r){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function I2(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(vt(t,e,i.children,n),i=ot.current,(i&2)!==0)i=i&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&kk(t,n,e);else if(t.tag===19)kk(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}switch(ze(ot,i),r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&Hd(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Kg(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&Hd(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Kg(e,!0,n,null,s);break;case"together":Kg(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function pr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),os|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Yc(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(E(153));if(e.child!==null){for(t=e.child,n=ur(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ur(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function N0(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&_d(t)))}function v9(t,e,n){switch(e.tag){case 3:Td(e,e.stateNode.containerInfo),Fr(e,st,t.memoizedState.cache),jc();break;case 27:case 5:uy(e);break;case 4:Td(e,e.stateNode.containerInfo);break;case 10:Fr(e,e.type,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?($r(e),e.flags|=128,null):(n&e.child.childLanes)!==0?L2(t,e,n):($r(e),t=pr(t,e,n),t!==null?t.sibling:null);$r(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Yc(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return I2(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ze(ot,ot.current),i)break;return null;case 22:case 23:return e.lanes=0,N2(t,e,n);case 24:Fr(e,st,t.memoizedState.cache)}return pr(t,e,n)}function _2(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)ht=!0;else{if(!N0(t,n)&&(e.flags&128)===0)return ht=!1,v9(t,e,n);ht=(t.flags&131072)!==0}else ht=!1,ge&&(e.flags&1048576)!==0&&qA(e,Id,e.index);switch(e.lanes=0,e.tag){case 16:e:{t=e.pendingProps;var i=e.elementType,r=i._init;if(i=r(i._payload),e.type=i,typeof i=="function")h0(i)?(t=no(i,t),e.tag=1,e=Sk(null,e,i,t,n)):(e.tag=0,e=Iy(null,e,i,t,n));else{if(i!=null){if(r=i.$$typeof,r===Jy){e.tag=11,e=yk(null,e,i,t,n);break e}else if(r===e0){e.tag=14,e=bk(null,e,i,t,n);break e}}throw e=ay(i)||i,Error(E(306,e,""))}}return e;case 0:return Iy(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=no(i,e.pendingProps),Sk(t,e,i,r,n);case 3:e:{if(Td(e,e.stateNode.containerInfo),t===null)throw Error(E(387));i=e.pendingProps;var s=e.memoizedState;r=s.element,Oy(t,e),bc(e,i,null,n);var o=e.memoizedState;if(i=o.cache,Fr(e,st,i),i!==s.cache&&ky(e,[st],n,!0),yc(),i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){e=wk(t,e,i,n);break e}else if(i!==r){r=_n(Error(E(424)),e),Dc(r),e=wk(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,je=ti(t.firstChild),Ht=e,ge=!0,Qs=null,Ci=!0,n=k2(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(jc(),i===r){e=pr(t,e,n);break e}vt(t,e,i,n)}e=e.child}return e;case 26:return Sd(t,e),t===null?(n=Fk(e.type,null,e.pendingProps,null))?e.memoizedState=n:ge||(n=e.type,t=e.pendingProps,i=Xd(Xr.current).createElement(n),i[Dt]=e,i[en]=t,St(i,n,t),dt(i),e.stateNode=i):e.memoizedState=Fk(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return uy(e),t===null&&ge&&(i=e.stateNode=SC(e.type,e.pendingProps,Xr.current),Ht=e,Ci=!0,r=je,as(e.type)?(Qy=r,je=ti(i.firstChild)):je=r),vt(t,e,e.pendingProps.children,n),Sd(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&ge&&((r=i=je)&&(i=j9(i,e.type,e.pendingProps,Ci),i!==null?(e.stateNode=i,Ht=e,je=ti(i.firstChild),Ci=!1,r=!0):r=!1),r||Js(e)),uy(e),r=e.type,s=e.pendingProps,o=t!==null?t.memoizedProps:null,i=s.children,Yy(r,s)?i=null:o!==null&&Yy(r,o)&&(e.flags|=32),e.memoizedState!==null&&(r=S0(t,e,f9,null,null,n),_c._currentValue=r),Sd(t,e),vt(t,e,i,n),e.child;case 6:return t===null&&ge&&((t=n=je)&&(n=Y9(n,e.pendingProps,Ci),n!==null?(e.stateNode=n,Ht=e,je=null,t=!0):t=!1),t||Js(e)),null;case 13:return L2(t,e,n);case 4:return Td(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=Rl(e,null,i,n):vt(t,e,i,n),e.child;case 11:return yk(t,e,e.type,e.pendingProps,n);case 7:return vt(t,e,e.pendingProps,n),e.child;case 8:return vt(t,e,e.pendingProps.children,n),e.child;case 12:return vt(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,Fr(e,e.type,i.value),vt(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,eo(e),r=Mt(r),i=i(r),e.flags|=1,vt(t,e,i,n),e.child;case 14:return bk(t,e,e.type,e.pendingProps,n);case 15:return R2(t,e,e.type,e.pendingProps,n);case 19:return I2(t,e,n);case 31:return i=e.pendingProps,n=e.mode,i={mode:i.mode,children:i.children},t===null?(n=$d(i,n),n.ref=e.ref,e.child=n,n.return=e,e=n):(n=ur(t.child,i),n.ref=e.ref,e.child=n,n.return=e,e=n),e;case 22:return N2(t,e,n);case 24:return eo(e),i=Mt(st),t===null?(r=y0(),r===null&&(r=Ee,s=g0(),r.pooledCache=s,s.refCount++,s!==null&&(r.pooledCacheLanes|=n),r=s),e.memoizedState={parent:i,cache:r},b0(e),Fr(e,st,r)):((t.lanes&n)!==0&&(Oy(t,e),bc(e,null,null,n),yc()),r=t.memoizedState,s=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),Fr(e,st,i)):(i=s.cache,Fr(e,st,i),i!==r.cache&&ky(e,[st],n,!0))),vt(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(E(156,e.tag))}function nr(t){t.flags|=4}function Ak(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!AC(e)){if(e=qn.current,e!==null&&((de&4194048)===de?Di!==null:(de&62914560)!==de&&(de&536870912)===0||e!==Di))throw mc=Cy,HA;t.flags|=8192}}function ld(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?lA():536870912,t.lanes|=e,Nl|=e)}function ic(t,e){if(!ge)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Fe(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function x9(t,e,n){var i=e.pendingProps;switch(m0(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(e),null;case 1:return Fe(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),fr(st),Cl(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(tc(e)?nr(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,ek())),Fe(e),null;case 26:return n=e.memoizedState,t===null?(nr(e),n!==null?(Fe(e),Ak(e,n)):(Fe(e),e.flags&=-16777217)):n?n!==t.memoizedState?(nr(e),Fe(e),Ak(e,n)):(Fe(e),e.flags&=-16777217):(t.memoizedProps!==i&&nr(e),Fe(e),e.flags&=-16777217),null;case 27:Ed(e),n=Xr.current;var r=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==i&&nr(e);else{if(!i){if(e.stateNode===null)throw Error(E(166));return Fe(e),null}t=Ti.current,tc(e)?Zw(e,t):(t=SC(r,i,n),e.stateNode=t,nr(e))}return Fe(e),null;case 5:if(Ed(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&nr(e);else{if(!i){if(e.stateNode===null)throw Error(E(166));return Fe(e),null}if(t=Ti.current,tc(e))Zw(e,t);else{switch(r=Xd(Xr.current),t){case 1:t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":t=r.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof i.is=="string"?r.createElement("select",{is:i.is}):r.createElement("select"),i.multiple?t.multiple=!0:i.size&&(t.size=i.size);break;default:t=typeof i.is=="string"?r.createElement(n,{is:i.is}):r.createElement(n)}}t[Dt]=e,t[en]=i;e:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=t;e:switch(St(t,n,i),n){case"button":case"input":case"select":case"textarea":t=!!i.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&nr(e)}}return Fe(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&nr(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(E(166));if(t=Xr.current,tc(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=Ht,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[Dt]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||bC(t.nodeValue,n)),t||Js(e)}else t=Xd(t).createTextNode(i),t[Dt]=e,e.stateNode=t}return Fe(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=tc(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(E(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(E(317));r[Dt]=e}else jc(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Fe(e),r=!1}else r=ek(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(cr(e),e):(cr(e),null)}if(cr(e),(e.flags&128)!==0)return e.lanes=n,e;if(n=i!==null,t=t!==null&&t.memoizedState!==null,n){i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool);var s=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)}return n!==t&&n&&(e.child.flags|=8192),ld(e,e.updateQueue),Fe(e),null;case 4:return Cl(),t===null&&H0(e.stateNode.containerInfo),Fe(e),null;case 10:return fr(e.type),Fe(e),null;case 19:if(pt(ot),r=e.memoizedState,r===null)return Fe(e),null;if(i=(e.flags&128)!==0,s=r.rendering,s===null)if(i)ic(r,!1);else{if(Ye!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=Hd(t),s!==null){for(e.flags|=128,ic(r,!1),t=s.updateQueue,e.updateQueue=t,ld(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)BA(n,t),n=n.sibling;return ze(ot,ot.current&1|2),e.child}t=t.sibling}r.tail!==null&&Ei()>jd&&(e.flags|=128,i=!0,ic(r,!1),e.lanes=4194304)}else{if(!i)if(t=Hd(s),t!==null){if(e.flags|=128,i=!0,t=t.updateQueue,e.updateQueue=t,ld(e,t),ic(r,!0),r.tail===null&&r.tailMode==="hidden"&&!s.alternate&&!ge)return Fe(e),null}else 2*Ei()-r.renderingStartTime>jd&&n!==536870912&&(e.flags|=128,i=!0,ic(r,!1),e.lanes=4194304);r.isBackwards?(s.sibling=e.child,e.child=s):(t=r.last,t!==null?t.sibling=s:e.child=s,r.last=s)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ei(),e.sibling=null,t=ot.current,ze(ot,i?t&1|2:t&1),e):(Fe(e),null);case 22:case 23:return cr(e),v0(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(Fe(e),e.subtreeFlags&6&&(e.flags|=8192)):Fe(e),n=e.updateQueue,n!==null&&ld(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&pt(Xs),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),fr(st),Fe(e),null;case 25:return null;case 30:return null}throw Error(E(156,e.tag))}function S9(t,e){switch(m0(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return fr(st),Cl(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Ed(e),null;case 13:if(cr(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(E(340));jc()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return pt(ot),null;case 4:return Cl(),null;case 10:return fr(e.type),null;case 22:case 23:return cr(e),v0(),t!==null&&pt(Xs),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return fr(st),null;case 25:return null;default:return null}}function B2(t,e){switch(m0(e),e.tag){case 3:fr(st),Cl();break;case 26:case 27:case 5:Ed(e);break;case 4:Cl();break;case 13:cr(e);break;case 19:pt(ot);break;case 10:fr(e.type);break;case 22:case 23:cr(e),v0(),t!==null&&pt(Xs);break;case 24:fr(st)}}function Wc(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var s=n.create,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){Ae(e,e.return,l)}}function ss(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&t)===t){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=e;var a=n,c=l;try{c()}catch(u){Ae(r,a,u)}}}i=i.next}while(i!==s)}}catch(u){Ae(e,e.return,u)}}function q2(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{$A(e,n)}catch(i){Ae(t,t.return,i)}}}function P2(t,e,n){n.props=no(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){Ae(t,e,i)}}function xc(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){Ae(t,e,r)}}function Oi(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Ae(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Ae(t,e,r)}else n.current=null}function z2(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){Ae(t,t.return,r)}}function Gg(t,e,n){try{var i=t.stateNode;H9(i,t.type,n,e),i[en]=e}catch(r){Ae(t,t.return,r)}}function H2(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&as(t.type)||t.tag===4}function Qg(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||H2(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&as(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function By(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=mh));else if(i!==4&&(i===27&&as(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(By(t,e,n),t=t.sibling;t!==null;)By(t,e,n),t=t.sibling}function Vd(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&as(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Vd(t,e,n),t=t.sibling;t!==null;)Vd(t,e,n),t=t.sibling}function U2(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);St(e,i,n),e[Dt]=t,e[en]=n}catch(s){Ae(t,t.return,s)}}var rr=!1,Xe=!1,Xg=!1,Ck=typeof WeakSet=="function"?WeakSet:Set,ft=null;function w9(t,e){if(t=t.containerInfo,Vy=eh,t=EA(t),u0(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,c=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(a=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===n&&++c===r&&(l=o),d===s&&++u===i&&(a=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(jy={focusedElem:t,selectionRange:n},eh=!1,ft=e;ft!==null;)if(e=ft,t=e.child,(e.subtreeFlags&1024)!==0&&t!==null)t.return=e,ft=t;else for(;ft!==null;){switch(e=ft,s=e.alternate,t=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&s!==null){t=void 0,n=e,r=s.memoizedProps,s=s.memoizedState,i=n.stateNode;try{var p=no(n.type,r,n.elementType===n.type);t=i.getSnapshotBeforeUpdate(p,s),i.__reactInternalSnapshotBeforeUpdate=t}catch(g){Ae(n,n.return,g)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Ky(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ky(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(E(163))}if(t=e.sibling,t!==null){t.return=e.return,ft=t;break}ft=e.return}}function F2(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Pr(t,n),i&4&&Wc(5,n);break;case 1:if(Pr(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(o){Ae(n,n.return,o)}else{var r=no(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(o){Ae(n,n.return,o)}}i&64&&q2(n),i&512&&xc(n,n.return);break;case 3:if(Pr(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{$A(t,e)}catch(o){Ae(n,n.return,o)}}break;case 27:e===null&&i&4&&U2(n);case 26:case 5:Pr(t,n),e===null&&i&4&&z2(n),i&512&&xc(n,n.return);break;case 12:Pr(t,n);break;case 13:Pr(t,n),i&4&&j2(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=R9.bind(null,n),K9(t,n))));break;case 22:if(i=n.memoizedState!==null||rr,!i){e=e!==null&&e.memoizedState!==null||Xe,r=rr;var s=Xe;rr=i,(Xe=e)&&!s?zr(t,n,(n.subtreeFlags&8772)!==0):Pr(t,n),rr=r,Xe=s}break;case 30:break;default:Pr(t,n)}}function $2(t){var e=t.alternate;e!==null&&(t.alternate=null,$2(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&r0(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Pe=null,Zt=!1;function ir(t,e,n){for(n=n.child;n!==null;)V2(t,e,n),n=n.sibling}function V2(t,e,n){if(mn&&typeof mn.onCommitFiberUnmount=="function")try{mn.onCommitFiberUnmount(Hc,n)}catch{}switch(n.tag){case 26:Xe||Oi(n,e),ir(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Xe||Oi(n,e);var i=Pe,r=Zt;as(n.type)&&(Pe=n.stateNode,Zt=!1),ir(t,e,n),Ac(n.stateNode),Pe=i,Zt=r;break;case 5:Xe||Oi(n,e);case 6:if(i=Pe,r=Zt,Pe=null,ir(t,e,n),Pe=i,Zt=r,Pe!==null)if(Zt)try{(Pe.nodeType===9?Pe.body:Pe.nodeName==="HTML"?Pe.ownerDocument.body:Pe).removeChild(n.stateNode)}catch(s){Ae(n,e,s)}else try{Pe.removeChild(n.stateNode)}catch(s){Ae(n,e,s)}break;case 18:Pe!==null&&(Zt?(t=Pe,zk(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Pc(t)):zk(Pe,n.stateNode));break;case 4:i=Pe,r=Zt,Pe=n.stateNode.containerInfo,Zt=!0,ir(t,e,n),Pe=i,Zt=r;break;case 0:case 11:case 14:case 15:Xe||ss(2,n,e),Xe||ss(4,n,e),ir(t,e,n);break;case 1:Xe||(Oi(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&P2(n,e,i)),ir(t,e,n);break;case 21:ir(t,e,n);break;case 22:Xe=(i=Xe)||n.memoizedState!==null,ir(t,e,n),Xe=i;break;default:ir(t,e,n)}}function j2(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Pc(t)}catch(n){Ae(e,e.return,n)}}function k9(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new Ck),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new Ck),e;default:throw Error(E(435,t.tag))}}function Wg(t,e){var n=k9(t);e.forEach(function(i){var r=N9.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}function fn(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],s=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(as(l.type)){Pe=l.stateNode,Zt=!1;break e}break;case 5:Pe=l.stateNode,Zt=!1;break e;case 3:case 4:Pe=l.stateNode.containerInfo,Zt=!0;break e}l=l.return}if(Pe===null)throw Error(E(160));V2(s,o,r),Pe=null,Zt=!1,s=r.alternate,s!==null&&(s.return=null),r.return=null}if(e.subtreeFlags&13878)for(e=e.child;e!==null;)Y2(e,t),e=e.sibling}var ei=null;function Y2(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:fn(e,t),dn(t),i&4&&(ss(3,t,t.return),Wc(3,t),ss(5,t,t.return));break;case 1:fn(e,t),dn(t),i&512&&(Xe||n===null||Oi(n,n.return)),i&64&&rr&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=ei;if(fn(e,t),dn(t),i&512&&(Xe||n===null||Oi(n,n.return)),i&4){var s=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":s=r.getElementsByTagName("title")[0],(!s||s[$c]||s[Dt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(i),r.head.insertBefore(s,r.querySelector("head > title"))),St(s,i,n),s[Dt]=t,dt(s),i=s;break e;case"link":var o=Vk("link","href",r).get(i+(n.href||""));if(o){for(var l=0;l<o.length;l++)if(s=o[l],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(l,1);break t}}s=r.createElement(i),St(s,i,n),r.head.appendChild(s);break;case"meta":if(o=Vk("meta","content",r).get(i+(n.content||""))){for(l=0;l<o.length;l++)if(s=o[l],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(l,1);break t}}s=r.createElement(i),St(s,i,n),r.head.appendChild(s);break;default:throw Error(E(468,i))}s[Dt]=t,dt(s),i=s}t.stateNode=i}else jk(r,t.type,t.stateNode);else t.stateNode=$k(r,i,t.memoizedProps);else s!==i?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,i===null?jk(r,t.type,t.stateNode):$k(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&Gg(t,t.memoizedProps,n.memoizedProps)}break;case 27:fn(e,t),dn(t),i&512&&(Xe||n===null||Oi(n,n.return)),n!==null&&i&4&&Gg(t,t.memoizedProps,n.memoizedProps);break;case 5:if(fn(e,t),dn(t),i&512&&(Xe||n===null||Oi(n,n.return)),t.flags&32){r=t.stateNode;try{Tl(r,"")}catch(h){Ae(t,t.return,h)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,Gg(t,r,n!==null?n.memoizedProps:r)),i&1024&&(Xg=!0);break;case 6:if(fn(e,t),dn(t),i&4){if(t.stateNode===null)throw Error(E(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(h){Ae(t,t.return,h)}}break;case 3:if(Ad=null,r=ei,ei=Wd(e.containerInfo),fn(e,t),ei=r,dn(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Pc(e.containerInfo)}catch(h){Ae(t,t.return,h)}Xg&&(Xg=!1,K2(t));break;case 4:i=ei,ei=Wd(t.stateNode.containerInfo),fn(e,t),dn(t),ei=i;break;case 12:fn(e,t),dn(t);break;case 13:fn(e,t),dn(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(q0=Ei()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Wg(t,i)));break;case 22:r=t.memoizedState!==null;var a=n!==null&&n.memoizedState!==null,c=rr,u=Xe;if(rr=c||r,Xe=u||a,fn(e,t),Xe=u,rr=c,dn(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||a||rr||Xe||js(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){a=n=e;try{if(s=a.stateNode,r)o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=a.stateNode;var f=a.memoizedProps.style,d=f!=null&&f.hasOwnProperty("display")?f.display:null;l.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(h){Ae(a,a.return,h)}}}else if(e.tag===6){if(n===null){a=e;try{a.stateNode.nodeValue=r?"":a.memoizedProps}catch(h){Ae(a,a.return,h)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Wg(t,n))));break;case 19:fn(e,t),dn(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Wg(t,i)));break;case 30:break;case 21:break;default:fn(e,t),dn(t)}}function dn(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(H2(i)){n=i;break}i=i.return}if(n==null)throw Error(E(160));switch(n.tag){case 27:var r=n.stateNode,s=Qg(t);Vd(t,s,r);break;case 5:var o=n.stateNode;n.flags&32&&(Tl(o,""),n.flags&=-33);var l=Qg(t);Vd(t,l,o);break;case 3:case 4:var a=n.stateNode.containerInfo,c=Qg(t);By(t,c,a);break;default:throw Error(E(161))}}catch(u){Ae(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function K2(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;K2(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Pr(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)F2(t,e.alternate,e),e=e.sibling}function js(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:ss(4,e,e.return),js(e);break;case 1:Oi(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&P2(e,e.return,n),js(e);break;case 27:Ac(e.stateNode);case 26:case 5:Oi(e,e.return),js(e);break;case 22:e.memoizedState===null&&js(e);break;case 30:js(e);break;default:js(e)}t=t.sibling}}function zr(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,s=e,o=s.flags;switch(s.tag){case 0:case 11:case 15:zr(r,s,n),Wc(4,s);break;case 1:if(zr(r,s,n),i=s,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){Ae(i,i.return,c)}if(i=s,r=i.updateQueue,r!==null){var l=i.stateNode;try{var a=r.shared.hiddenCallbacks;if(a!==null)for(r.shared.hiddenCallbacks=null,r=0;r<a.length;r++)FA(a[r],l)}catch(c){Ae(i,i.return,c)}}n&&o&64&&q2(s),xc(s,s.return);break;case 27:U2(s);case 26:case 5:zr(r,s,n),n&&i===null&&o&4&&z2(s),xc(s,s.return);break;case 12:zr(r,s,n);break;case 13:zr(r,s,n),n&&o&4&&j2(r,s);break;case 22:s.memoizedState===null&&zr(r,s,n),xc(s,s.return);break;case 30:break;default:zr(r,s,n)}e=e.sibling}}function L0(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Kc(n))}function I0(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Kc(t))}function Ai(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)G2(t,e,n,i),e=e.sibling}function G2(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:Ai(t,e,n,i),r&2048&&Wc(9,e);break;case 1:Ai(t,e,n,i);break;case 3:Ai(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Kc(t)));break;case 12:if(r&2048){Ai(t,e,n,i),t=e.stateNode;try{var s=e.memoizedProps,o=s.id,l=s.onPostCommit;typeof l=="function"&&l(o,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(a){Ae(e,e.return,a)}}else Ai(t,e,n,i);break;case 13:Ai(t,e,n,i);break;case 23:break;case 22:s=e.stateNode,o=e.alternate,e.memoizedState!==null?s._visibility&2?Ai(t,e,n,i):Sc(t,e):s._visibility&2?Ai(t,e,n,i):(s._visibility|=2,il(t,e,n,i,(e.subtreeFlags&10256)!==0)),r&2048&&L0(o,e);break;case 24:Ai(t,e,n,i),r&2048&&I0(e.alternate,e);break;default:Ai(t,e,n,i)}}function il(t,e,n,i,r){for(r=r&&(e.subtreeFlags&10256)!==0,e=e.child;e!==null;){var s=t,o=e,l=n,a=i,c=o.flags;switch(o.tag){case 0:case 11:case 15:il(s,o,l,a,r),Wc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState!==null?u._visibility&2?il(s,o,l,a,r):Sc(s,o):(u._visibility|=2,il(s,o,l,a,r)),r&&c&2048&&L0(o.alternate,o);break;case 24:il(s,o,l,a,r),r&&c&2048&&I0(o.alternate,o);break;default:il(s,o,l,a,r)}e=e.sibling}}function Sc(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:Sc(n,i),r&2048&&L0(i.alternate,i);break;case 24:Sc(n,i),r&2048&&I0(i.alternate,i);break;default:Sc(n,i)}e=e.sibling}}var uc=8192;function el(t){if(t.subtreeFlags&uc)for(t=t.child;t!==null;)Q2(t),t=t.sibling}function Q2(t){switch(t.tag){case 26:el(t),t.flags&uc&&t.memoizedState!==null&&o7(ei,t.memoizedState,t.memoizedProps);break;case 5:el(t);break;case 3:case 4:var e=ei;ei=Wd(t.stateNode.containerInfo),el(t),ei=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=uc,uc=16777216,el(t),uc=e):el(t));break;default:el(t)}}function X2(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function rc(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ft=i,Z2(i,t)}X2(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)W2(t),t=t.sibling}function W2(t){switch(t.tag){case 0:case 11:case 15:rc(t),t.flags&2048&&ss(9,t,t.return);break;case 3:rc(t);break;case 12:rc(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,wd(t)):rc(t);break;default:rc(t)}}function wd(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ft=i,Z2(i,t)}X2(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:ss(8,e,e.return),wd(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,wd(e));break;default:wd(e)}t=t.sibling}}function Z2(t,e){for(;ft!==null;){var n=ft;switch(n.tag){case 0:case 11:case 15:ss(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Kc(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,ft=i;else e:for(n=t;ft!==null;){i=ft;var r=i.sibling,s=i.return;if($2(i),i===n){ft=null;break e}if(r!==null){r.return=s,ft=r;break e}ft=s}}}var A9={getCacheForType:function(t){var e=Mt(st),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n}},C9=typeof WeakMap=="function"?WeakMap:Map,xe=0,Ee=null,oe=null,de=0,ve=0,hn=null,Gr=!1,zl=!1,_0=!1,mr=0,Ye=0,os=0,Ws=0,B0=0,Bn=0,Nl=0,wc=null,Jt=null,qy=!1,q0=0,jd=1/0,Yd=null,Jr=null,xt=0,es=null,Ll=null,Al=0,Py=0,zy=null,J2=null,kc=0,Hy=null;function yn(){if((xe&2)!==0&&de!==0)return de&-de;if(j.T!==null){var t=El;return t!==0?t:z0()}return uA()}function eC(){Bn===0&&(Bn=(de&536870912)===0||ge?oA():536870912);var t=qn.current;return t!==null&&(t.flags|=32),Bn}function bn(t,e,n){(t===Ee&&(ve===2||ve===9)||t.cancelPendingCommit!==null)&&(Il(t,0),Qr(t,de,Bn,!1)),Fc(t,n),((xe&2)===0||t!==Ee)&&(t===Ee&&((xe&2)===0&&(Ws|=n),Ye===4&&Qr(t,de,Bn,!1)),Ri(t))}function tC(t,e,n){if((xe&6)!==0)throw Error(E(327));var i=!n&&(e&124)===0&&(e&t.expiredLanes)===0||Uc(t,e),r=i?E9(t,e):Zg(t,e,!0),s=i;do{if(r===0){zl&&!i&&Qr(t,e,0,!1);break}else{if(n=t.current.alternate,s&&!O9(n)){r=Zg(t,e,!1),s=!1;continue}if(r===2){if(s=e,t.errorRecoveryDisabledLanes&s)var o=0;else o=t.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){e=o;e:{var l=t;r=wc;var a=l.current.memoizedState.isDehydrated;if(a&&(Il(l,o).flags|=256),o=Zg(l,o,!1),o!==2){if(_0&&!a){l.errorRecoveryDisabledLanes|=s,Ws|=s,r=4;break e}s=Jt,Jt=r,s!==null&&(Jt===null?Jt=s:Jt.push.apply(Jt,s))}r=o}if(s=!1,r!==2)continue}}if(r===1){Il(t,0),Qr(t,e,0,!0);break}e:{switch(i=t,s=r,s){case 0:case 1:throw Error(E(345));case 4:if((e&4194048)!==e)break;case 6:Qr(i,e,Bn,!Gr);break e;case 2:Jt=null;break;case 3:case 5:break;default:throw Error(E(329))}if((e&62914560)===e&&(r=q0+300-Ei(),10<r)){if(Qr(i,e,Bn,!Gr),nh(i,0,!0)!==0)break e;i.timeoutHandle=xC(Ok.bind(null,i,n,Jt,Yd,qy,e,Bn,Ws,Nl,Gr,s,2,-0,0),r);break e}Ok(i,n,Jt,Yd,qy,e,Bn,Ws,Nl,Gr,s,0,-0,0)}}break}while(!0);Ri(t)}function Ok(t,e,n,i,r,s,o,l,a,c,u,f,d,h){if(t.timeoutHandle=-1,f=e.subtreeFlags,(f&8192||(f&16785408)===16785408)&&(Ic={stylesheets:null,count:0,unsuspend:s7},Q2(e),f=l7(),f!==null)){t.cancelPendingCommit=f(Ek.bind(null,t,e,s,n,i,r,o,l,a,u,1,d,h)),Qr(t,s,o,!c);return}Ek(t,e,s,n,i,r,o,l,a)}function O9(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!vn(s(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Qr(t,e,n,i){e&=~B0,e&=~Ws,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var s=31-gn(r),o=1<<s;i[s]=-1,r&=~o}n!==0&&aA(t,n,e)}function dh(){return(xe&6)===0?(Zc(0,!1),!1):!0}function P0(){if(oe!==null){if(ve===0)var t=oe.return;else t=oe,ar=oo=null,A0(t),kl=null,Rc=0,t=oe;for(;t!==null;)B2(t.alternate,t),t=t.return;oe=null}}function Il(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,F9(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),P0(),Ee=t,oe=n=ur(t.current,null),de=e,ve=0,hn=null,Gr=!1,zl=Uc(t,e),_0=!1,Nl=Bn=B0=Ws=os=Ye=0,Jt=wc=null,qy=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-gn(i),s=1<<r;e|=t[r],i&=~s}return mr=e,oh(),n}function nC(t,e){J=null,j.H=zd,e===Gc||e===ah?(e=rk(),ve=3):e===HA?(e=rk(),ve=4):ve=e===M2?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,hn=e,oe===null&&(Ye=1,Fd(t,_n(e,t.current)))}function iC(){var t=j.H;return j.H=zd,t===null?zd:t}function rC(){var t=j.A;return j.A=A9,t}function Uy(){Ye=4,Gr||(de&4194048)!==de&&qn.current!==null||(zl=!0),(os&134217727)===0&&(Ws&134217727)===0||Ee===null||Qr(Ee,de,Bn,!1)}function Zg(t,e,n){var i=xe;xe|=2;var r=iC(),s=rC();(Ee!==t||de!==e)&&(Yd=null,Il(t,e)),e=!1;var o=Ye;e:do try{if(ve!==0&&oe!==null){var l=oe,a=hn;switch(ve){case 8:P0(),o=6;break e;case 3:case 2:case 9:case 6:qn.current===null&&(e=!0);var c=ve;if(ve=0,hn=null,gl(t,l,a,c),n&&zl){o=0;break e}break;default:c=ve,ve=0,hn=null,gl(t,l,a,c)}}T9(),o=Ye;break}catch(u){nC(t,u)}while(!0);return e&&t.shellSuspendCounter++,ar=oo=null,xe=i,j.H=r,j.A=s,oe===null&&(Ee=null,de=0,oh()),o}function T9(){for(;oe!==null;)sC(oe)}function E9(t,e){var n=xe;xe|=2;var i=iC(),r=rC();Ee!==t||de!==e?(Yd=null,jd=Ei()+500,Il(t,e)):zl=Uc(t,e);e:do try{if(ve!==0&&oe!==null){e=oe;var s=hn;t:switch(ve){case 1:ve=0,hn=null,gl(t,e,s,1);break;case 2:case 9:if(ik(s)){ve=0,hn=null,Tk(e);break}e=function(){ve!==2&&ve!==9||Ee!==t||(ve=7),Ri(t)},s.then(e,e);break e;case 3:ve=7;break e;case 4:ve=5;break e;case 7:ik(s)?(ve=0,hn=null,Tk(e)):(ve=0,hn=null,gl(t,e,s,7));break;case 5:var o=null;switch(oe.tag){case 26:o=oe.memoizedState;case 5:case 27:var l=oe;if(!o||AC(o)){ve=0,hn=null;var a=l.sibling;if(a!==null)oe=a;else{var c=l.return;c!==null?(oe=c,hh(c)):oe=null}break t}}ve=0,hn=null,gl(t,e,s,5);break;case 6:ve=0,hn=null,gl(t,e,s,6);break;case 8:P0(),Ye=6;break e;default:throw Error(E(462))}}D9();break}catch(u){nC(t,u)}while(!0);return ar=oo=null,j.H=i,j.A=r,xe=n,oe!==null?0:(Ee=null,de=0,oh(),Ye)}function D9(){for(;oe!==null&&!W_();)sC(oe)}function sC(t){var e=_2(t.alternate,t,mr);t.memoizedProps=t.pendingProps,e===null?hh(t):oe=e}function Tk(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=xk(n,e,e.pendingProps,e.type,void 0,de);break;case 11:e=xk(n,e,e.pendingProps,e.type.render,e.ref,de);break;case 5:A0(e);default:B2(n,e),e=oe=BA(e,mr),e=_2(n,e,mr)}t.memoizedProps=t.pendingProps,e===null?hh(t):oe=e}function gl(t,e,n,i){ar=oo=null,A0(e),kl=null,Rc=0;var r=e.return;try{if(b9(t,r,e,n,de)){Ye=1,Fd(t,_n(n,t.current)),oe=null;return}}catch(s){if(r!==null)throw oe=r,s;Ye=1,Fd(t,_n(n,t.current)),oe=null;return}e.flags&32768?(ge||i===1?t=!0:zl||(de&536870912)!==0?t=!1:(Gr=t=!0,(i===2||i===9||i===3||i===6)&&(i=qn.current,i!==null&&i.tag===13&&(i.flags|=16384))),oC(e,t)):hh(e)}function hh(t){var e=t;do{if((e.flags&32768)!==0){oC(e,Gr);return}t=e.return;var n=x9(e.alternate,e,mr);if(n!==null){oe=n;return}if(e=e.sibling,e!==null){oe=e;return}oe=e=t}while(e!==null);Ye===0&&(Ye=5)}function oC(t,e){do{var n=S9(t.alternate,t);if(n!==null){n.flags&=32767,oe=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){oe=t;return}oe=t=n}while(t!==null);Ye=6,oe=null}function Ek(t,e,n,i,r,s,o,l,a){t.cancelPendingCommit=null;do ph();while(xt!==0);if((xe&6)!==0)throw Error(E(327));if(e!==null){if(e===t.current)throw Error(E(177));if(s=e.lanes|e.childLanes,s|=f0,lB(t,n,s,o,l,a),t===Ee&&(oe=Ee=null,de=0),Ll=e,es=t,Al=n,Py=s,zy=r,J2=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,L9(Dd,function(){return fC(!0),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=j.T,j.T=null,r=ye.p,ye.p=2,o=xe,xe|=4;try{w9(t,e,n)}finally{xe=o,ye.p=r,j.T=i}}xt=1,lC(),aC(),cC()}}function lC(){if(xt===1){xt=0;var t=es,e=Ll,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=j.T,j.T=null;var i=ye.p;ye.p=2;var r=xe;xe|=4;try{Y2(e,t);var s=jy,o=EA(t.containerInfo),l=s.focusedElem,a=s.selectionRange;if(o!==l&&l&&l.ownerDocument&&TA(l.ownerDocument.documentElement,l)){if(a!==null&&u0(l)){var c=a.start,u=a.end;if(u===void 0&&(u=c),"selectionStart"in l)l.selectionStart=c,l.selectionEnd=Math.min(u,l.value.length);else{var f=l.ownerDocument||document,d=f&&f.defaultView||window;if(d.getSelection){var h=d.getSelection(),p=l.textContent.length,g=Math.min(a.start,p),b=a.end===void 0?g:Math.min(a.end,p);!h.extend&&g>b&&(o=b,b=g,g=o);var m=Qw(l,g),y=Qw(l,b);if(m&&y&&(h.rangeCount!==1||h.anchorNode!==m.node||h.anchorOffset!==m.offset||h.focusNode!==y.node||h.focusOffset!==y.offset)){var v=f.createRange();v.setStart(m.node,m.offset),h.removeAllRanges(),g>b?(h.addRange(v),h.extend(y.node,y.offset)):(v.setEnd(y.node,y.offset),h.addRange(v))}}}}for(f=[],h=l;h=h.parentNode;)h.nodeType===1&&f.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<f.length;l++){var x=f[l];x.element.scrollLeft=x.left,x.element.scrollTop=x.top}}eh=!!Vy,jy=Vy=null}finally{xe=r,ye.p=i,j.T=n}}t.current=e,xt=2}}function aC(){if(xt===2){xt=0;var t=es,e=Ll,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=j.T,j.T=null;var i=ye.p;ye.p=2;var r=xe;xe|=4;try{F2(t,e.alternate,e)}finally{xe=r,ye.p=i,j.T=n}}xt=3}}function cC(){if(xt===4||xt===3){xt=0,Z_();var t=es,e=Ll,n=Al,i=J2;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?xt=5:(xt=0,Ll=es=null,uC(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Jr=null),i0(n),e=e.stateNode,mn&&typeof mn.onCommitFiberRoot=="function")try{mn.onCommitFiberRoot(Hc,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=j.T,r=ye.p,ye.p=2,j.T=null;try{for(var s=t.onRecoverableError,o=0;o<i.length;o++){var l=i[o];s(l.value,{componentStack:l.stack})}}finally{j.T=e,ye.p=r}}(Al&3)!==0&&ph(),Ri(t),r=t.pendingLanes,(n&4194090)!==0&&(r&42)!==0?t===Hy?kc++:(kc=0,Hy=t):kc=0,Zc(0,!1)}}function uC(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Kc(e)))}function ph(t){return lC(),aC(),cC(),fC(t)}function fC(){if(xt!==5)return!1;var t=es,e=Py;Py=0;var n=i0(Al),i=j.T,r=ye.p;try{ye.p=32>n?32:n,j.T=null,n=zy,zy=null;var s=es,o=Al;if(xt=0,Ll=es=null,Al=0,(xe&6)!==0)throw Error(E(331));var l=xe;if(xe|=4,W2(s.current),G2(s,s.current,o,n),xe=l,Zc(0,!1),mn&&typeof mn.onPostCommitFiberRoot=="function")try{mn.onPostCommitFiberRoot(Hc,s)}catch{}return!0}finally{ye.p=r,j.T=i,uC(t,e)}}function Dk(t,e,n){e=_n(n,e),e=Ly(t.stateNode,e,2),t=Zr(t,e,2),t!==null&&(Fc(t,2),Ri(t))}function Ae(t,e,n){if(t.tag===3)Dk(t,t,n);else for(;e!==null;){if(e.tag===3){Dk(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Jr===null||!Jr.has(i))){t=_n(n,t),n=E2(2),i=Zr(e,n,2),i!==null&&(D2(n,i,e,t),Fc(i,2),Ri(i));break}}e=e.return}}function Jg(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new C9;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(_0=!0,r.add(n),t=M9.bind(null,t,e,n),e.then(t,t))}function M9(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ee===t&&(de&n)===n&&(Ye===4||Ye===3&&(de&62914560)===de&&300>Ei()-q0?(xe&2)===0&&Il(t,0):B0|=n,Nl===de&&(Nl=0)),Ri(t)}function dC(t,e){e===0&&(e=lA()),t=Pl(t,e),t!==null&&(Fc(t,e),Ri(t))}function R9(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),dC(t,n)}function N9(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(E(314))}i!==null&&i.delete(e),dC(t,n)}function L9(t,e){return t0(t,e)}var Kd=null,rl=null,Fy=!1,Gd=!1,ey=!1,Zs=0;function Ri(t){t!==rl&&t.next===null&&(rl===null?Kd=rl=t:rl=rl.next=t),Gd=!0,Fy||(Fy=!0,_9())}function Zc(t,e){if(!ey&&Gd){ey=!0;do for(var n=!1,i=Kd;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-gn(42|t)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,Mk(i,s))}else s=de,s=nh(i,i===Ee?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(s&3)===0||Uc(i,s)||(n=!0,Mk(i,s));i=i.next}while(n);ey=!1}}function I9(){hC()}function hC(){Gd=Fy=!1;var t=0;Zs!==0&&(U9()&&(t=Zs),Zs=0);for(var e=Ei(),n=null,i=Kd;i!==null;){var r=i.next,s=pC(i,e);s===0?(i.next=null,n===null?Kd=r:n.next=r,r===null&&(rl=n)):(n=i,(t!==0||(s&3)!==0)&&(Gd=!0)),i=r}Zc(t,!1)}function pC(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes&-62914561;0<s;){var o=31-gn(s),l=1<<o,a=r[o];a===-1?((l&n)===0||(l&i)!==0)&&(r[o]=oB(l,e)):a<=e&&(t.expiredLanes|=l),s&=~l}if(e=Ee,n=de,n=nh(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(ve===2||ve===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Tg(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Uc(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&Tg(i),i0(n)){case 2:case 8:n=rA;break;case 32:n=Dd;break;case 268435456:n=sA;break;default:n=Dd}return i=mC.bind(null,t),n=t0(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&Tg(i),t.callbackPriority=2,t.callbackNode=null,2}function mC(t,e){if(xt!==0&&xt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(ph(!0)&&t.callbackNode!==n)return null;var i=de;return i=nh(t,t===Ee?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(tC(t,i,e),pC(t,Ei()),t.callbackNode!=null&&t.callbackNode===n?mC.bind(null,t):null)}function Mk(t,e){if(ph())return null;tC(t,e,!0)}function _9(){$9(function(){(xe&6)!==0?t0(iA,I9):hC()})}function z0(){return Zs===0&&(Zs=oA()),Zs}function Rk(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:pd(""+t)}function Nk(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function B9(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var s=Rk((r[en]||null).action),o=i.submitter;o&&(e=(e=o[en]||null)?Rk(e.formAction):o.getAttribute("formAction"),e!==null&&(s=e,o=null));var l=new ih("action","action",null,i,r);t.push({event:l,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Zs!==0){var a=o?Nk(r,o):new FormData(r);Ry(n,{pending:!0,data:a,method:r.method,action:s},null,a)}}else typeof s=="function"&&(l.preventDefault(),a=o?Nk(r,o):new FormData(r),Ry(n,{pending:!0,data:a,method:r.method,action:s},s,a))},currentTarget:r}]})}}for(ad=0;ad<vy.length;ad++)cd=vy[ad],Lk=cd.toLowerCase(),Ik=cd[0].toUpperCase()+cd.slice(1),ni(Lk,"on"+Ik);var cd,Lk,Ik,ad;ni(MA,"onAnimationEnd");ni(RA,"onAnimationIteration");ni(NA,"onAnimationStart");ni("dblclick","onDoubleClick");ni("focusin","onFocus");ni("focusout","onBlur");ni(t9,"onTransitionRun");ni(n9,"onTransitionStart");ni(i9,"onTransitionCancel");ni(LA,"onTransitionEnd");Ol("onMouseEnter",["mouseout","mouseover"]);Ol("onMouseLeave",["mouseout","mouseover"]);Ol("onPointerEnter",["pointerout","pointerover"]);Ol("onPointerLeave",["pointerout","pointerover"]);io("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));io("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));io("onBeforeInput",["compositionend","keypress","textInput","paste"]);io("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));io("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));io("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nc="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(" "),q9=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nc));function gC(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var s=void 0;if(e)for(var o=i.length-1;0<=o;o--){var l=i[o],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=c;try{s(r)}catch(u){Ud(u)}r.currentTarget=null,s=a}else for(o=0;o<i.length;o++){if(l=i[o],a=l.instance,c=l.currentTarget,l=l.listener,a!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=c;try{s(r)}catch(u){Ud(u)}r.currentTarget=null,s=a}}}}function se(t,e){var n=e[dy];n===void 0&&(n=e[dy]=new Set);var i=t+"__bubble";n.has(i)||(yC(e,t,2,!1),n.add(i))}function ty(t,e,n){var i=0;e&&(i|=4),yC(n,t,i,e)}var ud="_reactListening"+Math.random().toString(36).slice(2);function H0(t){if(!t[ud]){t[ud]=!0,fA.forEach(function(n){n!=="selectionchange"&&(q9.has(n)||ty(n,!1,t),ty(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[ud]||(e[ud]=!0,ty("selectionchange",!1,e))}}function yC(t,e,n,i){switch(DC(e)){case 2:var r=u7;break;case 8:r=f7;break;default:r=V0}n=r.bind(null,e,n,t),r=void 0,!gy||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function ny(t,e,n,i,r){var s=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var l=i.stateNode.containerInfo;if(l===r)break;if(o===4)for(o=i.return;o!==null;){var a=o.tag;if((a===3||a===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;l!==null;){if(o=ll(l),o===null)return;if(a=o.tag,a===5||a===6||a===26||a===27){i=s=o;continue e}l=l.parentNode}}i=i.return}vA(function(){var c=s,u=o0(n),f=[];e:{var d=IA.get(t);if(d!==void 0){var h=ih,p=t;switch(t){case"keypress":if(gd(n)===0)break e;case"keydown":case"keyup":h=LB;break;case"focusin":p="focus",h=_g;break;case"focusout":p="blur",h=_g;break;case"beforeblur":case"afterblur":h=_g;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Hw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=SB;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=BB;break;case MA:case RA:case NA:h=AB;break;case LA:h=PB;break;case"scroll":case"scrollend":h=vB;break;case"wheel":h=HB;break;case"copy":case"cut":case"paste":h=OB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Fw;break;case"toggle":case"beforetoggle":h=FB}var g=(e&4)!==0,b=!g&&(t==="scroll"||t==="scrollend"),m=g?d!==null?d+"Capture":null:d;g=[];for(var y=c,v;y!==null;){var x=y;if(v=x.stateNode,x=x.tag,x!==5&&x!==26&&x!==27||v===null||m===null||(x=Oc(y,m),x!=null&&g.push(Lc(y,x,v))),b)break;y=y.return}0<g.length&&(d=new h(d,p,null,n,u),f.push({event:d,listeners:g}))}}if((e&7)===0){e:{if(d=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",d&&n!==my&&(p=n.relatedTarget||n.fromElement)&&(ll(p)||p[Bl]))break e;if((h||d)&&(d=u.window===u?u:(d=u.ownerDocument)?d.defaultView||d.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=c,p=p?ll(p):null,p!==null&&(b=zc(p),g=p.tag,p!==b||g!==5&&g!==27&&g!==6)&&(p=null)):(h=null,p=c),h!==p)){if(g=Hw,x="onMouseLeave",m="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(g=Fw,x="onPointerLeave",m="onPointerEnter",y="pointer"),b=h==null?d:cc(h),v=p==null?d:cc(p),d=new g(x,y+"leave",h,n,u),d.target=b,d.relatedTarget=v,x=null,ll(u)===c&&(g=new g(m,y+"enter",p,n,u),g.target=v,g.relatedTarget=b,x=g),b=x,h&&p)t:{for(g=h,m=p,y=0,v=g;v;v=tl(v))y++;for(v=0,x=m;x;x=tl(x))v++;for(;0<y-v;)g=tl(g),y--;for(;0<v-y;)m=tl(m),v--;for(;y--;){if(g===m||m!==null&&g===m.alternate)break t;g=tl(g),m=tl(m)}g=null}else g=null;h!==null&&_k(f,d,h,g,!1),p!==null&&b!==null&&_k(f,b,p,g,!0)}}e:{if(d=c?cc(c):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var A=Yw;else if(jw(d))if(CA)A=ZB;else{A=XB;var w=QB}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?c&&s0(c.elementType)&&(A=Yw):A=WB;if(A&&(A=A(t,c))){AA(f,A,n,u);break e}w&&w(t,d,c),t==="focusout"&&c&&d.type==="number"&&c.memoizedProps.value!=null&&py(d,"number",d.value)}switch(w=c?cc(c):window,t){case"focusin":(jw(w)||w.contentEditable==="true")&&(ul=w,yy=c,hc=null);break;case"focusout":hc=yy=ul=null;break;case"mousedown":by=!0;break;case"contextmenu":case"mouseup":case"dragend":by=!1,Xw(f,n,u);break;case"selectionchange":if(e9)break;case"keydown":case"keyup":Xw(f,n,u)}var k;if(c0)e:{switch(t){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else cl?wA(t,n)&&(C="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(SA&&n.locale!=="ko"&&(cl||C!=="onCompositionStart"?C==="onCompositionEnd"&&cl&&(k=xA()):(Kr=u,l0="value"in Kr?Kr.value:Kr.textContent,cl=!0)),w=Qd(c,C),0<w.length&&(C=new Uw(C,t,null,n,u),f.push({event:C,listeners:w}),k?C.data=k:(k=kA(n),k!==null&&(C.data=k)))),(k=VB?jB(t,n):YB(t,n))&&(C=Qd(c,"onBeforeInput"),0<C.length&&(w=new Uw("onBeforeInput","beforeinput",null,n,u),f.push({event:w,listeners:C}),w.data=k)),B9(f,t,c,n,u)}gC(f,e)})}function Lc(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Qd(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,s=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||s===null||(r=Oc(t,n),r!=null&&i.unshift(Lc(t,r,s)),r=Oc(t,e),r!=null&&i.push(Lc(t,r,s))),t.tag===3)return i;t=t.return}return[]}function tl(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function _k(t,e,n,i,r){for(var s=e._reactName,o=[];n!==null&&n!==i;){var l=n,a=l.alternate,c=l.stateNode;if(l=l.tag,a!==null&&a===i)break;l!==5&&l!==26&&l!==27||c===null||(a=c,r?(c=Oc(n,s),c!=null&&o.unshift(Lc(n,c,a))):r||(c=Oc(n,s),c!=null&&o.push(Lc(n,c,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var P9=/\r\n?/g,z9=/\u0000|\uFFFD/g;function Bk(t){return(typeof t=="string"?t:""+t).replace(P9,`
|
|
9
|
-
`).replace(z9,"")}function bC(t,e){return e=Bk(e),Bk(t)===e}function mh(){}function we(t,e,n,i,r,s){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||Tl(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&Tl(t,""+i);break;case"className":Jf(t,"class",i);break;case"tabIndex":Jf(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Jf(t,n,i);break;case"style":bA(t,i,s);break;case"data":if(e!=="object"){Jf(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=pd(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(e!=="input"&&we(t,e,"name",r.name,r,null),we(t,e,"formEncType",r.formEncType,r,null),we(t,e,"formMethod",r.formMethod,r,null),we(t,e,"formTarget",r.formTarget,r,null)):(we(t,e,"encType",r.encType,r,null),we(t,e,"method",r.method,r,null),we(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=pd(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=mh);break;case"onScroll":i!=null&&se("scroll",t);break;case"onScrollEnd":i!=null&&se("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(E(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(E(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=pd(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":se("beforetoggle",t),se("toggle",t),hd(t,"popover",i);break;case"xlinkActuate":tr(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":tr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":tr(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":tr(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":tr(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":tr(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":tr(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":tr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":tr(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":hd(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=yB.get(n)||n,hd(t,n,i))}}function $y(t,e,n,i,r,s){switch(n){case"style":bA(t,i,s);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(E(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(E(60));t.innerHTML=n}}break;case"children":typeof i=="string"?Tl(t,i):(typeof i=="number"||typeof i=="bigint")&&Tl(t,""+i);break;case"onScroll":i!=null&&se("scroll",t);break;case"onScrollEnd":i!=null&&se("scrollend",t);break;case"onClick":i!=null&&(t.onclick=mh);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dA.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),s=t[en]||null,s=s!=null?s[n]:null,typeof s=="function"&&t.removeEventListener(e,s,r),typeof i=="function")){typeof s!="function"&&s!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):hd(t,n,i)}}}function St(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":se("error",t),se("load",t);var i=!1,r=!1,s;for(s in n)if(n.hasOwnProperty(s)){var o=n[s];if(o!=null)switch(s){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(E(137,e));default:we(t,e,s,o,n,null)}}r&&we(t,e,"srcSet",n.srcSet,n,null),i&&we(t,e,"src",n.src,n,null);return;case"input":se("invalid",t);var l=s=o=r=null,a=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":o=u;break;case"checked":a=u;break;case"defaultChecked":c=u;break;case"value":s=u;break;case"defaultValue":l=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(E(137,e));break;default:we(t,e,i,u,n,null)}}mA(t,s,l,a,c,o,r,!1),Md(t);return;case"select":se("invalid",t),i=o=s=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":s=l;break;case"defaultValue":o=l;break;case"multiple":i=l;default:we(t,e,r,l,n,null)}e=s,n=o,t.multiple=!!i,e!=null?bl(t,!!i,e,!1):n!=null&&bl(t,!!i,n,!0);return;case"textarea":se("invalid",t),s=r=i=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":i=l;break;case"defaultValue":r=l;break;case"children":s=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(E(91));break;default:we(t,e,o,l,n,null)}yA(t,i,r,s),Md(t);return;case"option":for(a in n)n.hasOwnProperty(a)&&(i=n[a],i!=null)&&(a==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":we(t,e,a,i,n,null));return;case"dialog":se("beforetoggle",t),se("toggle",t),se("cancel",t),se("close",t);break;case"iframe":case"object":se("load",t);break;case"video":case"audio":for(i=0;i<Nc.length;i++)se(Nc[i],t);break;case"image":se("error",t),se("load",t);break;case"details":se("toggle",t);break;case"embed":case"source":case"link":se("error",t),se("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(E(137,e));default:we(t,e,c,i,n,null)}return;default:if(s0(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&$y(t,e,u,i,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null&&we(t,e,l,i,n,null))}function H9(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,s=null,o=null,l=null,a=null,c=null,u=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&f!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":a=f;default:i.hasOwnProperty(h)||we(t,e,h,null,i,f)}}for(var d in i){var h=i[d];if(f=n[d],i.hasOwnProperty(d)&&(h!=null||f!=null))switch(d){case"type":s=h;break;case"name":r=h;break;case"checked":c=h;break;case"defaultChecked":u=h;break;case"value":o=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(E(137,e));break;default:h!==f&&we(t,e,d,h,i,f)}}hy(t,o,l,a,c,u,s,r);return;case"select":h=o=l=d=null;for(s in n)if(a=n[s],n.hasOwnProperty(s)&&a!=null)switch(s){case"value":break;case"multiple":h=a;default:i.hasOwnProperty(s)||we(t,e,s,null,i,a)}for(r in i)if(s=i[r],a=n[r],i.hasOwnProperty(r)&&(s!=null||a!=null))switch(r){case"value":d=s;break;case"defaultValue":l=s;break;case"multiple":o=s;default:s!==a&&we(t,e,r,s,i,a)}e=l,n=o,i=h,d!=null?bl(t,!!n,d,!1):!!i!=!!n&&(e!=null?bl(t,!!n,e,!0):bl(t,!!n,n?[]:"",!1));return;case"textarea":h=d=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!i.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:we(t,e,l,null,i,r)}for(o in i)if(r=i[o],s=n[o],i.hasOwnProperty(o)&&(r!=null||s!=null))switch(o){case"value":d=r;break;case"defaultValue":h=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(E(91));break;default:r!==s&&we(t,e,o,r,i,s)}gA(t,d,h);return;case"option":for(var p in n)d=n[p],n.hasOwnProperty(p)&&d!=null&&!i.hasOwnProperty(p)&&(p==="selected"?t.selected=!1:we(t,e,p,null,i,d));for(a in i)d=i[a],h=n[a],i.hasOwnProperty(a)&&d!==h&&(d!=null||h!=null)&&(a==="selected"?t.selected=d&&typeof d!="function"&&typeof d!="symbol":we(t,e,a,d,i,h));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)d=n[g],n.hasOwnProperty(g)&&d!=null&&!i.hasOwnProperty(g)&&we(t,e,g,null,i,d);for(c in i)if(d=i[c],h=n[c],i.hasOwnProperty(c)&&d!==h&&(d!=null||h!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(E(137,e));break;default:we(t,e,c,d,i,h)}return;default:if(s0(e)){for(var b in n)d=n[b],n.hasOwnProperty(b)&&d!==void 0&&!i.hasOwnProperty(b)&&$y(t,e,b,void 0,i,d);for(u in i)d=i[u],h=n[u],!i.hasOwnProperty(u)||d===h||d===void 0&&h===void 0||$y(t,e,u,d,i,h);return}}for(var m in n)d=n[m],n.hasOwnProperty(m)&&d!=null&&!i.hasOwnProperty(m)&&we(t,e,m,null,i,d);for(f in i)d=i[f],h=n[f],!i.hasOwnProperty(f)||d===h||d==null&&h==null||we(t,e,f,d,i,h)}var Vy=null,jy=null;function Xd(t){return t.nodeType===9?t:t.ownerDocument}function qk(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vC(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Yy(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var iy=null;function U9(){var t=window.event;return t&&t.type==="popstate"?t===iy?!1:(iy=t,!0):(iy=null,!1)}var xC=typeof setTimeout=="function"?setTimeout:void 0,F9=typeof clearTimeout=="function"?clearTimeout:void 0,Pk=typeof Promise=="function"?Promise:void 0,$9=typeof queueMicrotask=="function"?queueMicrotask:typeof Pk<"u"?function(t){return Pk.resolve(null).then(t).catch(V9)}:xC;function V9(t){setTimeout(function(){throw t})}function as(t){return t==="head"}function zk(t,e){var n=e,i=0,r=0;do{var s=n.nextSibling;if(t.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(0<i&&8>i){n=i;var o=t.ownerDocument;if(n&1&&Ac(o.documentElement),n&2&&Ac(o.body),n&4)for(n=o.head,Ac(n),o=n.firstChild;o;){var l=o.nextSibling,a=o.nodeName;o[$c]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=l}}if(r===0){t.removeChild(s),Pc(e);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:i=n.charCodeAt(0)-48;else i=0;n=s}while(n);Pc(e)}function Ky(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Ky(n),r0(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function j9(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[$c])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(s=t.getAttribute("rel"),s==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(s!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(s=t.getAttribute("src"),(s!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&s&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var s=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===s)return t}else return t;if(t=ti(t.nextSibling),t===null)break}return null}function Y9(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=ti(t.nextSibling),t===null))return null;return t}function Gy(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function K9(t,e){var n=t.ownerDocument;if(t.data!=="$?"||n.readyState==="complete")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function ti(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="F!"||e==="F")break;if(e==="/$")return null}}return t}var Qy=null;function Hk(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}function SC(t,e,n){switch(e=Xd(n),t){case"html":if(t=e.documentElement,!t)throw Error(E(452));return t;case"head":if(t=e.head,!t)throw Error(E(453));return t;case"body":if(t=e.body,!t)throw Error(E(454));return t;default:throw Error(E(451))}}function Ac(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);r0(t)}var Pn=new Map,Uk=new Set;function Wd(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var gr=ye.d;ye.d={f:G9,r:Q9,D:X9,C:W9,L:Z9,m:J9,X:t7,S:e7,M:n7};function G9(){var t=gr.f(),e=dh();return t||e}function Q9(t){var e=ql(t);e!==null&&e.tag===5&&e.type==="form"?p2(e):gr.r(t)}var Hl=typeof document>"u"?null:document;function wC(t,e,n){var i=Hl;if(i&&typeof e=="string"&&e){var r=In(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Uk.has(r)||(Uk.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),St(e,"link",t),dt(e),i.head.appendChild(e)))}}function X9(t){gr.D(t),wC("dns-prefetch",t,null)}function W9(t,e){gr.C(t,e),wC("preconnect",t,e)}function Z9(t,e,n){gr.L(t,e,n);var i=Hl;if(i&&t&&e){var r='link[rel="preload"][as="'+In(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+In(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+In(n.imageSizes)+'"]')):r+='[href="'+In(t)+'"]';var s=r;switch(e){case"style":s=_l(t);break;case"script":s=Ul(t)}Pn.has(s)||(t=Ne({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),Pn.set(s,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Jc(s))||e==="script"&&i.querySelector(eu(s))||(e=i.createElement("link"),St(e,"link",t),dt(e),i.head.appendChild(e)))}}function J9(t,e){gr.m(t,e);var n=Hl;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+In(i)+'"][href="'+In(t)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Ul(t)}if(!Pn.has(s)&&(t=Ne({rel:"modulepreload",href:t},e),Pn.set(s,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(eu(s)))return}i=n.createElement("link"),St(i,"link",t),dt(i),n.head.appendChild(i)}}}function e7(t,e,n){gr.S(t,e,n);var i=Hl;if(i&&t){var r=yl(i).hoistableStyles,s=_l(t);e=e||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(Jc(s)))l.loading=5;else{t=Ne({rel:"stylesheet",href:t,"data-precedence":e},n),(n=Pn.get(s))&&U0(t,n);var a=o=i.createElement("link");dt(a),St(a,"link",t),a._p=new Promise(function(c,u){a.onload=c,a.onerror=u}),a.addEventListener("load",function(){l.loading|=1}),a.addEventListener("error",function(){l.loading|=2}),l.loading|=4,kd(o,e,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function t7(t,e){gr.X(t,e);var n=Hl;if(n&&t){var i=yl(n).hoistableScripts,r=Ul(t),s=i.get(r);s||(s=n.querySelector(eu(r)),s||(t=Ne({src:t,async:!0},e),(e=Pn.get(r))&&F0(t,e),s=n.createElement("script"),dt(s),St(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function n7(t,e){gr.M(t,e);var n=Hl;if(n&&t){var i=yl(n).hoistableScripts,r=Ul(t),s=i.get(r);s||(s=n.querySelector(eu(r)),s||(t=Ne({src:t,async:!0,type:"module"},e),(e=Pn.get(r))&&F0(t,e),s=n.createElement("script"),dt(s),St(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function Fk(t,e,n,i){var r=(r=Xr.current)?Wd(r):null;if(!r)throw Error(E(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=_l(n.href),n=yl(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=_l(n.href);var s=yl(r).hoistableStyles,o=s.get(t);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,o),(s=r.querySelector(Jc(t)))&&!s._p&&(o.instance=s,o.state.loading=5),Pn.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Pn.set(t,n),s||i7(r,t,n,o.state))),e&&i===null)throw Error(E(528,""));return o}if(e&&i!==null)throw Error(E(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Ul(n),n=yl(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(E(444,t))}}function _l(t){return'href="'+In(t)+'"'}function Jc(t){return'link[rel="stylesheet"]['+t+"]"}function kC(t){return Ne({},t,{"data-precedence":t.precedence,precedence:null})}function i7(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),St(e,"link",n),dt(e),t.head.appendChild(e))}function Ul(t){return'[src="'+In(t)+'"]'}function eu(t){return"script[async]"+t}function $k(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+In(n.href)+'"]');if(i)return e.instance=i,dt(i),i;var r=Ne({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),dt(i),St(i,"style",r),kd(i,n.precedence,t),e.instance=i;case"stylesheet":r=_l(n.href);var s=t.querySelector(Jc(r));if(s)return e.state.loading|=4,e.instance=s,dt(s),s;i=kC(n),(r=Pn.get(r))&&U0(i,r),s=(t.ownerDocument||t).createElement("link"),dt(s);var o=s;return o._p=new Promise(function(l,a){o.onload=l,o.onerror=a}),St(s,"link",i),e.state.loading|=4,kd(s,n.precedence,t),e.instance=s;case"script":return s=Ul(n.src),(r=t.querySelector(eu(s)))?(e.instance=r,dt(r),r):(i=n,(r=Pn.get(s))&&(i=Ne({},n),F0(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),dt(r),St(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(E(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,kd(i,n.precedence,t));return e.instance}function kd(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,o=0;o<i.length;o++){var l=i[o];if(l.dataset.precedence===e)s=l;else if(s!==r)break}s?s.parentNode.insertBefore(t,s.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function U0(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function F0(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Ad=null;function Vk(t,e,n){if(Ad===null){var i=new Map,r=Ad=new Map;r.set(n,i)}else r=Ad,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var s=n[r];if(!(s[$c]||s[Dt]||t==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var o=s.getAttribute(e)||"";o=t+o;var l=i.get(o);l?l.push(s):i.set(o,[s])}}return i}function jk(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function r7(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function AC(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var Ic=null;function s7(){}function o7(t,e,n){if(Ic===null)throw Error(E(475));var i=Ic;if(e.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var r=_l(n.href),s=t.querySelector(Jc(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(i.count++,i=Zd.bind(i),t.then(i,i)),e.state.loading|=4,e.instance=s,dt(s);return}s=t.ownerDocument||t,n=kC(n),(r=Pn.get(r))&&U0(n,r),s=s.createElement("link"),dt(s);var o=s;o._p=new Promise(function(l,a){o.onload=l,o.onerror=a}),St(s,"link",n),e.instance=s}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(e,t),(t=e.state.preload)&&(e.state.loading&3)===0&&(i.count++,e=Zd.bind(i),t.addEventListener("load",e),t.addEventListener("error",e))}}function l7(){if(Ic===null)throw Error(E(475));var t=Ic;return t.stylesheets&&t.count===0&&Xy(t,t.stylesheets),0<t.count?function(e){var n=setTimeout(function(){if(t.stylesheets&&Xy(t,t.stylesheets),t.unsuspend){var i=t.unsuspend;t.unsuspend=null,i()}},6e4);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(n)}}:null}function Zd(){if(this.count--,this.count===0){if(this.stylesheets)Xy(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Jd=null;function Xy(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Jd=new Map,e.forEach(a7,t),Jd=null,Zd.call(t))}function a7(t,e){if(!(e.state.loading&4)){var n=Jd.get(t);if(n)var i=n.get(null);else{n=new Map,Jd.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<r.length;s++){var o=r[s];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),i=o)}i&&n.set(null,i)}r=e.instance,o=r.getAttribute("data-precedence"),s=n.get(o)||i,s===i&&n.set(null,r),n.set(o,r),this.count++,i=Zd.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),s?s.parentNode.insertBefore(r,s.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var _c={$$typeof:sr,Provider:null,Consumer:null,_currentValue:Ys,_currentValue2:Ys,_threadCount:0};function c7(t,e,n,i,r,s,o,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Eg(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Eg(0),this.hiddenUpdates=Eg(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=s,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function CC(t,e,n,i,r,s,o,l,a,c,u,f){return t=new c7(t,e,n,o,l,a,c,f),e=1,s===!0&&(e|=24),s=pn(3,null,null,e),t.current=s,s.stateNode=t,e=g0(),e.refCount++,t.pooledCache=e,e.refCount++,s.memoizedState={element:i,isDehydrated:n,cache:e},b0(s),t}function OC(t){return t?(t=hl,t):hl}function TC(t,e,n,i,r,s){r=OC(r),i.context===null?i.context=r:i.pendingContext=r,i=Wr(e),i.payload={element:n},s=s===void 0?null:s,s!==null&&(i.callback=s),n=Zr(t,i,e),n!==null&&(bn(n,t,e),gc(n,t,e))}function Yk(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function $0(t,e){Yk(t,e),(t=t.alternate)&&Yk(t,e)}function EC(t){if(t.tag===13){var e=Pl(t,67108864);e!==null&&bn(e,t,67108864),$0(t,67108864)}}var eh=!0;function u7(t,e,n,i){var r=j.T;j.T=null;var s=ye.p;try{ye.p=2,V0(t,e,n,i)}finally{ye.p=s,j.T=r}}function f7(t,e,n,i){var r=j.T;j.T=null;var s=ye.p;try{ye.p=8,V0(t,e,n,i)}finally{ye.p=s,j.T=r}}function V0(t,e,n,i){if(eh){var r=Wy(i);if(r===null)ny(t,e,i,th,n),Kk(t,i);else if(h7(r,t,e,n,i))i.stopPropagation();else if(Kk(t,i),e&4&&-1<d7.indexOf(t)){for(;r!==null;){var s=ql(r);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var o=$s(s.pendingLanes);if(o!==0){var l=s;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var a=1<<31-gn(o);l.entanglements[1]|=a,o&=~a}Ri(s),(xe&6)===0&&(jd=Ei()+500,Zc(0,!1))}}break;case 13:l=Pl(s,2),l!==null&&bn(l,s,2),dh(),$0(s,2)}if(s=Wy(i),s===null&&ny(t,e,i,th,n),s===r)break;r=s}r!==null&&i.stopPropagation()}else ny(t,e,i,null,n)}}function Wy(t){return t=o0(t),j0(t)}var th=null;function j0(t){if(th=null,t=ll(t),t!==null){var e=zc(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=Jk(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return th=t,null}function DC(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"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(J_()){case iA:return 2;case rA:return 8;case Dd:case eB:return 32;case sA:return 268435456;default:return 32}default:return 32}}var Zy=!1,ts=null,ns=null,is=null,Bc=new Map,qc=new Map,jr=[],d7="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 Kk(t,e){switch(t){case"focusin":case"focusout":ts=null;break;case"dragenter":case"dragleave":ns=null;break;case"mouseover":case"mouseout":is=null;break;case"pointerover":case"pointerout":Bc.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":qc.delete(e.pointerId)}}function sc(t,e,n,i,r,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=ql(e),e!==null&&EC(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function h7(t,e,n,i,r){switch(e){case"focusin":return ts=sc(ts,t,e,n,i,r),!0;case"dragenter":return ns=sc(ns,t,e,n,i,r),!0;case"mouseover":return is=sc(is,t,e,n,i,r),!0;case"pointerover":var s=r.pointerId;return Bc.set(s,sc(Bc.get(s)||null,t,e,n,i,r)),!0;case"gotpointercapture":return s=r.pointerId,qc.set(s,sc(qc.get(s)||null,t,e,n,i,r)),!0}return!1}function MC(t){var e=ll(t.target);if(e!==null){var n=zc(e);if(n!==null){if(e=n.tag,e===13){if(e=Jk(n),e!==null){t.blockedOn=e,aB(t.priority,function(){if(n.tag===13){var i=yn();i=n0(i);var r=Pl(n,i);r!==null&&bn(r,n,i),$0(n,i)}});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Cd(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Wy(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);my=i,n.target.dispatchEvent(i),my=null}else return e=ql(n),e!==null&&EC(e),t.blockedOn=n,!1;e.shift()}return!0}function Gk(t,e,n){Cd(t)&&n.delete(e)}function p7(){Zy=!1,ts!==null&&Cd(ts)&&(ts=null),ns!==null&&Cd(ns)&&(ns=null),is!==null&&Cd(is)&&(is=null),Bc.forEach(Gk),qc.forEach(Gk)}function fd(t,e){t.blockedOn===e&&(t.blockedOn=null,Zy||(Zy=!0,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,p7)))}var dd=null;function Qk(t){dd!==t&&(dd=t,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,function(){dd===t&&(dd=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(j0(i||n)===null)continue;break}var s=ql(n);s!==null&&(t.splice(e,3),e-=3,Ry(s,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Pc(t){function e(a){return fd(a,t)}ts!==null&&fd(ts,t),ns!==null&&fd(ns,t),is!==null&&fd(is,t),Bc.forEach(e),qc.forEach(e);for(var n=0;n<jr.length;n++){var i=jr[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<jr.length&&(n=jr[0],n.blockedOn===null);)MC(n),n.blockedOn===null&&jr.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],s=n[i+1],o=r[en]||null;if(typeof s=="function")o||Qk(n);else if(o){var l=null;if(s&&s.hasAttribute("formAction")){if(r=s,o=s[en]||null)l=o.formAction;else if(j0(r)!==null)continue}else l=o.action;typeof l=="function"?n[i+1]=l:(n.splice(i,3),i-=3),Qk(n)}}}function Y0(t){this._internalRoot=t}gh.prototype.render=Y0.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(E(409));var n=e.current,i=yn();TC(n,i,t,e,null,null)};gh.prototype.unmount=Y0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;TC(t.current,2,null,t,null,null),dh(),e[Bl]=null}};function gh(t){this._internalRoot=t}gh.prototype.unstable_scheduleHydration=function(t){if(t){var e=uA();t={blockedOn:null,target:t,priority:e};for(var n=0;n<jr.length&&e!==0&&e<jr[n].priority;n++);jr.splice(n,0,t),n===0&&MC(t)}};var Xk=Wk.version;if(Xk!=="19.1.0")throw Error(E(527,Xk,"19.1.0"));ye.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(E(188)):(t=Object.keys(t).join(","),Error(E(268,t)));return t=Y_(e),t=t!==null?eA(t):null,t=t===null?null:t.stateNode,t};var m7={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(oc=__REACT_DEVTOOLS_GLOBAL_HOOK__,!oc.isDisabled&&oc.supportsFiber))try{Hc=oc.inject(m7),mn=oc}catch{}var oc;yh.createRoot=function(t,e){if(!Zk(t))throw Error(E(299));var n=!1,i="",r=C2,s=O2,o=T2,l=null;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(s=e.onCaughtError),e.onRecoverableError!==void 0&&(o=e.onRecoverableError),e.unstable_transitionCallbacks!==void 0&&(l=e.unstable_transitionCallbacks)),e=CC(t,1,!1,null,null,n,i,r,s,o,l,null),t[Bl]=e.current,H0(t),new Y0(e)};yh.hydrateRoot=function(t,e,n){if(!Zk(t))throw Error(E(299));var i=!1,r="",s=C2,o=O2,l=T2,a=null,c=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(a=n.unstable_transitionCallbacks),n.formState!==void 0&&(c=n.formState)),e=CC(t,1,!0,e,n??null,i,r,s,o,l,a,c),e.context=OC(null),n=e.current,i=yn(),i=n0(i),r=Wr(i),r.callback=null,Zr(n,r,i),n=i,e.current.lanes=n,Fc(e,n),Ri(e),t[Bl]=e.current,H0(t),new gh(e)};yh.version="19.1.0"});var IC=S((Hse,LC)=>{"use strict";function NC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(NC)}catch(t){console.error(t)}}NC(),LC.exports=RC()});var sE=S(up=>{"use strict";var DH=Symbol.for("react.transitional.element"),MH=Symbol.for("react.fragment");function rE(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:DH,type:t,key:i,ref:e!==void 0?e:null,props:n}}up.Fragment=MH;up.jsx=rE;up.jsxs=rE});var Ce=S((Jfe,oE)=>{"use strict";oE.exports=sE()});var gR=S((uge,mR)=>{"use strict";function Hj(){this.__data__=[],this.size=0}mR.exports=Hj});var Nm=S((fge,yR)=>{"use strict";function Uj(t,e){return t===e||t!==t&&e!==e}yR.exports=Uj});var xf=S((dge,bR)=>{"use strict";var Fj=Nm();function $j(t,e){for(var n=t.length;n--;)if(Fj(t[n][0],e))return n;return-1}bR.exports=$j});var xR=S((hge,vR)=>{"use strict";var Vj=xf(),jj=Array.prototype,Yj=jj.splice;function Kj(t){var e=this.__data__,n=Vj(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():Yj.call(e,n,1),--this.size,!0}vR.exports=Kj});var wR=S((pge,SR)=>{"use strict";var Gj=xf();function Qj(t){var e=this.__data__,n=Gj(e,t);return n<0?void 0:e[n][1]}SR.exports=Qj});var AR=S((mge,kR)=>{"use strict";var Xj=xf();function Wj(t){return Xj(this.__data__,t)>-1}kR.exports=Wj});var OR=S((gge,CR)=>{"use strict";var Zj=xf();function Jj(t,e){var n=this.__data__,i=Zj(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}CR.exports=Jj});var Sf=S((yge,TR)=>{"use strict";var eY=gR(),tY=xR(),nY=wR(),iY=AR(),rY=OR();function _a(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}_a.prototype.clear=eY;_a.prototype.delete=tY;_a.prototype.get=nY;_a.prototype.has=iY;_a.prototype.set=rY;TR.exports=_a});var DR=S((bge,ER)=>{"use strict";var sY=Sf();function oY(){this.__data__=new sY,this.size=0}ER.exports=oY});var RR=S((vge,MR)=>{"use strict";function lY(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}MR.exports=lY});var LR=S((xge,NR)=>{"use strict";function aY(t){return this.__data__.get(t)}NR.exports=aY});var _R=S((Sge,IR)=>{"use strict";function cY(t){return this.__data__.has(t)}IR.exports=cY});var Qx=S((wge,BR)=>{"use strict";var uY=typeof global=="object"&&global&&global.Object===Object&&global;BR.exports=uY});var Si=S((kge,qR)=>{"use strict";var fY=Qx(),dY=typeof self=="object"&&self&&self.Object===Object&&self,hY=fY||dY||Function("return this")();qR.exports=hY});var zo=S((Age,PR)=>{"use strict";var pY=Si(),mY=pY.Symbol;PR.exports=mY});var FR=S((Cge,UR)=>{"use strict";var zR=zo(),HR=Object.prototype,gY=HR.hasOwnProperty,yY=HR.toString,wf=zR?zR.toStringTag:void 0;function bY(t){var e=gY.call(t,wf),n=t[wf];try{t[wf]=void 0;var i=!0}catch{}var r=yY.call(t);return i&&(e?t[wf]=n:delete t[wf]),r}UR.exports=bY});var VR=S((Oge,$R)=>{"use strict";var vY=Object.prototype,xY=vY.toString;function SY(t){return xY.call(t)}$R.exports=SY});var Ho=S((Tge,KR)=>{"use strict";var jR=zo(),wY=FR(),kY=VR(),AY="[object Null]",CY="[object Undefined]",YR=jR?jR.toStringTag:void 0;function OY(t){return t==null?t===void 0?CY:AY:YR&&YR in Object(t)?wY(t):kY(t)}KR.exports=OY});var Is=S((Ege,GR)=>{"use strict";function TY(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}GR.exports=TY});var kf=S((Dge,QR)=>{"use strict";var EY=Ho(),DY=Is(),MY="[object AsyncFunction]",RY="[object Function]",NY="[object GeneratorFunction]",LY="[object Proxy]";function IY(t){if(!DY(t))return!1;var e=EY(t);return e==RY||e==NY||e==MY||e==LY}QR.exports=IY});var WR=S((Mge,XR)=>{"use strict";var _Y=Si(),BY=_Y["__core-js_shared__"];XR.exports=BY});var e3=S((Rge,JR)=>{"use strict";var Xx=WR(),ZR=(function(){var t=/[^.]+$/.exec(Xx&&Xx.keys&&Xx.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function qY(t){return!!ZR&&ZR in t}JR.exports=qY});var Wx=S((Nge,t3)=>{"use strict";var PY=Function.prototype,zY=PY.toString;function HY(t){if(t!=null){try{return zY.call(t)}catch{}try{return t+""}catch{}}return""}t3.exports=HY});var i3=S((Lge,n3)=>{"use strict";var UY=kf(),FY=e3(),$Y=Is(),VY=Wx(),jY=/[\\^$.*+?()[\]{}|]/g,YY=/^\[object .+?Constructor\]$/,KY=Function.prototype,GY=Object.prototype,QY=KY.toString,XY=GY.hasOwnProperty,WY=RegExp("^"+QY.call(XY).replace(jY,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ZY(t){if(!$Y(t)||FY(t))return!1;var e=UY(t)?WY:YY;return e.test(VY(t))}n3.exports=ZY});var s3=S((Ige,r3)=>{"use strict";function JY(t,e){return t?.[e]}r3.exports=JY});var _s=S((_ge,o3)=>{"use strict";var eK=i3(),tK=s3();function nK(t,e){var n=tK(t,e);return eK(n)?n:void 0}o3.exports=nK});var Lm=S((Bge,l3)=>{"use strict";var iK=_s(),rK=Si(),sK=iK(rK,"Map");l3.exports=sK});var Af=S((qge,a3)=>{"use strict";var oK=_s(),lK=oK(Object,"create");a3.exports=lK});var f3=S((Pge,u3)=>{"use strict";var c3=Af();function aK(){this.__data__=c3?c3(null):{},this.size=0}u3.exports=aK});var h3=S((zge,d3)=>{"use strict";function cK(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}d3.exports=cK});var m3=S((Hge,p3)=>{"use strict";var uK=Af(),fK="__lodash_hash_undefined__",dK=Object.prototype,hK=dK.hasOwnProperty;function pK(t){var e=this.__data__;if(uK){var n=e[t];return n===fK?void 0:n}return hK.call(e,t)?e[t]:void 0}p3.exports=pK});var y3=S((Uge,g3)=>{"use strict";var mK=Af(),gK=Object.prototype,yK=gK.hasOwnProperty;function bK(t){var e=this.__data__;return mK?e[t]!==void 0:yK.call(e,t)}g3.exports=bK});var v3=S((Fge,b3)=>{"use strict";var vK=Af(),xK="__lodash_hash_undefined__";function SK(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=vK&&e===void 0?xK:e,this}b3.exports=SK});var S3=S(($ge,x3)=>{"use strict";var wK=f3(),kK=h3(),AK=m3(),CK=y3(),OK=v3();function Ba(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Ba.prototype.clear=wK;Ba.prototype.delete=kK;Ba.prototype.get=AK;Ba.prototype.has=CK;Ba.prototype.set=OK;x3.exports=Ba});var A3=S((Vge,k3)=>{"use strict";var w3=S3(),TK=Sf(),EK=Lm();function DK(){this.size=0,this.__data__={hash:new w3,map:new(EK||TK),string:new w3}}k3.exports=DK});var O3=S((jge,C3)=>{"use strict";function MK(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}C3.exports=MK});var Cf=S((Yge,T3)=>{"use strict";var RK=O3();function NK(t,e){var n=t.__data__;return RK(e)?n[typeof e=="string"?"string":"hash"]:n.map}T3.exports=NK});var D3=S((Kge,E3)=>{"use strict";var LK=Cf();function IK(t){var e=LK(this,t).delete(t);return this.size-=e?1:0,e}E3.exports=IK});var R3=S((Gge,M3)=>{"use strict";var _K=Cf();function BK(t){return _K(this,t).get(t)}M3.exports=BK});var L3=S((Qge,N3)=>{"use strict";var qK=Cf();function PK(t){return qK(this,t).has(t)}N3.exports=PK});var _3=S((Xge,I3)=>{"use strict";var zK=Cf();function HK(t,e){var n=zK(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}I3.exports=HK});var Im=S((Wge,B3)=>{"use strict";var UK=A3(),FK=D3(),$K=R3(),VK=L3(),jK=_3();function qa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}qa.prototype.clear=UK;qa.prototype.delete=FK;qa.prototype.get=$K;qa.prototype.has=VK;qa.prototype.set=jK;B3.exports=qa});var P3=S((Zge,q3)=>{"use strict";var YK=Sf(),KK=Lm(),GK=Im(),QK=200;function XK(t,e){var n=this.__data__;if(n instanceof YK){var i=n.__data__;if(!KK||i.length<QK-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new GK(i)}return n.set(t,e),this.size=n.size,this}q3.exports=XK});var _m=S((Jge,z3)=>{"use strict";var WK=Sf(),ZK=DR(),JK=RR(),eG=LR(),tG=_R(),nG=P3();function Pa(t){var e=this.__data__=new WK(t);this.size=e.size}Pa.prototype.clear=ZK;Pa.prototype.delete=JK;Pa.prototype.get=eG;Pa.prototype.has=tG;Pa.prototype.set=nG;z3.exports=Pa});var Bm=S((eye,H3)=>{"use strict";function iG(t,e){for(var n=-1,i=t==null?0:t.length;++n<i&&e(t[n],n,t)!==!1;);return t}H3.exports=iG});var Zx=S((tye,U3)=>{"use strict";var rG=_s(),sG=(function(){try{var t=rG(Object,"defineProperty");return t({},"",{}),t}catch{}})();U3.exports=sG});var Jx=S((nye,$3)=>{"use strict";var F3=Zx();function oG(t,e,n){e=="__proto__"&&F3?F3(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}$3.exports=oG});var eS=S((iye,V3)=>{"use strict";var lG=Jx(),aG=Nm(),cG=Object.prototype,uG=cG.hasOwnProperty;function fG(t,e,n){var i=t[e];(!(uG.call(t,e)&&aG(i,n))||n===void 0&&!(e in t))&&lG(t,e,n)}V3.exports=fG});var Of=S((rye,j3)=>{"use strict";var dG=eS(),hG=Jx();function pG(t,e,n,i){var r=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var l=e[s],a=i?i(n[l],t[l],l,n,t):void 0;a===void 0&&(a=t[l]),r?hG(n,l,a):dG(n,l,a)}return n}j3.exports=pG});var K3=S((sye,Y3)=>{"use strict";function mG(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}Y3.exports=mG});var Gi=S((oye,G3)=>{"use strict";function gG(t){return t!=null&&typeof t=="object"}G3.exports=gG});var X3=S((lye,Q3)=>{"use strict";var yG=Ho(),bG=Gi(),vG="[object Arguments]";function xG(t){return bG(t)&&yG(t)==vG}Q3.exports=xG});var Tf=S((aye,J3)=>{"use strict";var W3=X3(),SG=Gi(),Z3=Object.prototype,wG=Z3.hasOwnProperty,kG=Z3.propertyIsEnumerable,AG=W3((function(){return arguments})())?W3:function(t){return SG(t)&&wG.call(t,"callee")&&!kG.call(t,"callee")};J3.exports=AG});var ut=S((cye,eN)=>{"use strict";var CG=Array.isArray;eN.exports=CG});var nN=S((uye,tN)=>{"use strict";function OG(){return!1}tN.exports=OG});var Ha=S((Ef,za)=>{"use strict";var TG=Si(),EG=nN(),sN=typeof Ef=="object"&&Ef&&!Ef.nodeType&&Ef,iN=sN&&typeof za=="object"&&za&&!za.nodeType&&za,DG=iN&&iN.exports===sN,rN=DG?TG.Buffer:void 0,MG=rN?rN.isBuffer:void 0,RG=MG||EG;za.exports=RG});var tS=S((fye,oN)=>{"use strict";var NG=9007199254740991,LG=/^(?:0|[1-9]\d*)$/;function IG(t,e){var n=typeof t;return e=e??NG,!!e&&(n=="number"||n!="symbol"&&LG.test(t))&&t>-1&&t%1==0&&t<e}oN.exports=IG});var qm=S((dye,lN)=>{"use strict";var _G=9007199254740991;function BG(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=_G}lN.exports=BG});var cN=S((hye,aN)=>{"use strict";var qG=Ho(),PG=qm(),zG=Gi(),HG="[object Arguments]",UG="[object Array]",FG="[object Boolean]",$G="[object Date]",VG="[object Error]",jG="[object Function]",YG="[object Map]",KG="[object Number]",GG="[object Object]",QG="[object RegExp]",XG="[object Set]",WG="[object String]",ZG="[object WeakMap]",JG="[object ArrayBuffer]",eQ="[object DataView]",tQ="[object Float32Array]",nQ="[object Float64Array]",iQ="[object Int8Array]",rQ="[object Int16Array]",sQ="[object Int32Array]",oQ="[object Uint8Array]",lQ="[object Uint8ClampedArray]",aQ="[object Uint16Array]",cQ="[object Uint32Array]",_e={};_e[tQ]=_e[nQ]=_e[iQ]=_e[rQ]=_e[sQ]=_e[oQ]=_e[lQ]=_e[aQ]=_e[cQ]=!0;_e[HG]=_e[UG]=_e[JG]=_e[FG]=_e[eQ]=_e[$G]=_e[VG]=_e[jG]=_e[YG]=_e[KG]=_e[GG]=_e[QG]=_e[XG]=_e[WG]=_e[ZG]=!1;function uQ(t){return zG(t)&&PG(t.length)&&!!_e[qG(t)]}aN.exports=uQ});var Pm=S((pye,uN)=>{"use strict";function fQ(t){return function(e){return t(e)}}uN.exports=fQ});var zm=S((Df,Ua)=>{"use strict";var dQ=Qx(),fN=typeof Df=="object"&&Df&&!Df.nodeType&&Df,Mf=fN&&typeof Ua=="object"&&Ua&&!Ua.nodeType&&Ua,hQ=Mf&&Mf.exports===fN,nS=hQ&&dQ.process,pQ=(function(){try{var t=Mf&&Mf.require&&Mf.require("util").types;return t||nS&&nS.binding&&nS.binding("util")}catch{}})();Ua.exports=pQ});var Rf=S((mye,pN)=>{"use strict";var mQ=cN(),gQ=Pm(),dN=zm(),hN=dN&&dN.isTypedArray,yQ=hN?gQ(hN):mQ;pN.exports=yQ});var iS=S((gye,mN)=>{"use strict";var bQ=K3(),vQ=Tf(),xQ=ut(),SQ=Ha(),wQ=tS(),kQ=Rf(),AQ=Object.prototype,CQ=AQ.hasOwnProperty;function OQ(t,e){var n=xQ(t),i=!n&&vQ(t),r=!n&&!i&&SQ(t),s=!n&&!i&&!r&&kQ(t),o=n||i||r||s,l=o?bQ(t.length,String):[],a=l.length;for(var c in t)(e||CQ.call(t,c))&&!(o&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||wQ(c,a)))&&l.push(c);return l}mN.exports=OQ});var Nf=S((yye,gN)=>{"use strict";var TQ=Object.prototype;function EQ(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||TQ;return t===n}gN.exports=EQ});var rS=S((bye,yN)=>{"use strict";function DQ(t,e){return function(n){return t(e(n))}}yN.exports=DQ});var vN=S((vye,bN)=>{"use strict";var MQ=rS(),RQ=MQ(Object.keys,Object);bN.exports=RQ});var Hm=S((xye,xN)=>{"use strict";var NQ=Nf(),LQ=vN(),IQ=Object.prototype,_Q=IQ.hasOwnProperty;function BQ(t){if(!NQ(t))return LQ(t);var e=[];for(var n in Object(t))_Q.call(t,n)&&n!="constructor"&&e.push(n);return e}xN.exports=BQ});var Bs=S((Sye,SN)=>{"use strict";var qQ=kf(),PQ=qm();function zQ(t){return t!=null&&PQ(t.length)&&!qQ(t)}SN.exports=zQ});var qs=S((wye,wN)=>{"use strict";var HQ=iS(),UQ=Hm(),FQ=Bs();function $Q(t){return FQ(t)?HQ(t):UQ(t)}wN.exports=$Q});var AN=S((kye,kN)=>{"use strict";var VQ=Of(),jQ=qs();function YQ(t,e){return t&&VQ(e,jQ(e),t)}kN.exports=YQ});var ON=S((Aye,CN)=>{"use strict";function KQ(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}CN.exports=KQ});var EN=S((Cye,TN)=>{"use strict";var GQ=Is(),QQ=Nf(),XQ=ON(),WQ=Object.prototype,ZQ=WQ.hasOwnProperty;function JQ(t){if(!GQ(t))return XQ(t);var e=QQ(t),n=[];for(var i in t)i=="constructor"&&(e||!ZQ.call(t,i))||n.push(i);return n}TN.exports=JQ});var Um=S((Oye,DN)=>{"use strict";var eX=iS(),tX=EN(),nX=Bs();function iX(t){return nX(t)?eX(t,!0):tX(t)}DN.exports=iX});var RN=S((Tye,MN)=>{"use strict";var rX=Of(),sX=Um();function oX(t,e){return t&&rX(e,sX(e),t)}MN.exports=oX});var BN=S((Lf,Fa)=>{"use strict";var lX=Si(),_N=typeof Lf=="object"&&Lf&&!Lf.nodeType&&Lf,NN=_N&&typeof Fa=="object"&&Fa&&!Fa.nodeType&&Fa,aX=NN&&NN.exports===_N,LN=aX?lX.Buffer:void 0,IN=LN?LN.allocUnsafe:void 0;function cX(t,e){if(e)return t.slice();var n=t.length,i=IN?IN(n):new t.constructor(n);return t.copy(i),i}Fa.exports=cX});var PN=S((Eye,qN)=>{"use strict";function uX(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}qN.exports=uX});var sS=S((Dye,zN)=>{"use strict";function fX(t,e){for(var n=-1,i=t==null?0:t.length,r=0,s=[];++n<i;){var o=t[n];e(o,n,t)&&(s[r++]=o)}return s}zN.exports=fX});var oS=S((Mye,HN)=>{"use strict";function dX(){return[]}HN.exports=dX});var Fm=S((Rye,FN)=>{"use strict";var hX=sS(),pX=oS(),mX=Object.prototype,gX=mX.propertyIsEnumerable,UN=Object.getOwnPropertySymbols,yX=UN?function(t){return t==null?[]:(t=Object(t),hX(UN(t),function(e){return gX.call(t,e)}))}:pX;FN.exports=yX});var VN=S((Nye,$N)=>{"use strict";var bX=Of(),vX=Fm();function xX(t,e){return bX(t,vX(t),e)}$N.exports=xX});var $m=S((Lye,jN)=>{"use strict";function SX(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}jN.exports=SX});var Vm=S((Iye,YN)=>{"use strict";var wX=rS(),kX=wX(Object.getPrototypeOf,Object);YN.exports=kX});var lS=S((_ye,KN)=>{"use strict";var AX=$m(),CX=Vm(),OX=Fm(),TX=oS(),EX=Object.getOwnPropertySymbols,DX=EX?function(t){for(var e=[];t;)AX(e,OX(t)),t=CX(t);return e}:TX;KN.exports=DX});var QN=S((Bye,GN)=>{"use strict";var MX=Of(),RX=lS();function NX(t,e){return MX(t,RX(t),e)}GN.exports=NX});var aS=S((qye,XN)=>{"use strict";var LX=$m(),IX=ut();function _X(t,e,n){var i=e(t);return IX(t)?i:LX(i,n(t))}XN.exports=_X});var cS=S((Pye,WN)=>{"use strict";var BX=aS(),qX=Fm(),PX=qs();function zX(t){return BX(t,PX,qX)}WN.exports=zX});var JN=S((zye,ZN)=>{"use strict";var HX=aS(),UX=lS(),FX=Um();function $X(t){return HX(t,FX,UX)}ZN.exports=$X});var tL=S((Hye,eL)=>{"use strict";var VX=_s(),jX=Si(),YX=VX(jX,"DataView");eL.exports=YX});var iL=S((Uye,nL)=>{"use strict";var KX=_s(),GX=Si(),QX=KX(GX,"Promise");nL.exports=QX});var uS=S((Fye,rL)=>{"use strict";var XX=_s(),WX=Si(),ZX=XX(WX,"Set");rL.exports=ZX});var oL=S(($ye,sL)=>{"use strict";var JX=_s(),eW=Si(),tW=JX(eW,"WeakMap");sL.exports=tW});var Fo=S((Vye,hL)=>{"use strict";var fS=tL(),dS=Lm(),hS=iL(),pS=uS(),mS=oL(),dL=Ho(),$a=Wx(),lL="[object Map]",nW="[object Object]",aL="[object Promise]",cL="[object Set]",uL="[object WeakMap]",fL="[object DataView]",iW=$a(fS),rW=$a(dS),sW=$a(hS),oW=$a(pS),lW=$a(mS),Uo=dL;(fS&&Uo(new fS(new ArrayBuffer(1)))!=fL||dS&&Uo(new dS)!=lL||hS&&Uo(hS.resolve())!=aL||pS&&Uo(new pS)!=cL||mS&&Uo(new mS)!=uL)&&(Uo=function(t){var e=dL(t),n=e==nW?t.constructor:void 0,i=n?$a(n):"";if(i)switch(i){case iW:return fL;case rW:return lL;case sW:return aL;case oW:return cL;case lW:return uL}return e});hL.exports=Uo});var mL=S((jye,pL)=>{"use strict";var aW=Object.prototype,cW=aW.hasOwnProperty;function uW(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&cW.call(t,"index")&&(n.index=t.index,n.input=t.input),n}pL.exports=uW});var gS=S((Yye,gL)=>{"use strict";var fW=Si(),dW=fW.Uint8Array;gL.exports=dW});var jm=S((Kye,bL)=>{"use strict";var yL=gS();function hW(t){var e=new t.constructor(t.byteLength);return new yL(e).set(new yL(t)),e}bL.exports=hW});var xL=S((Gye,vL)=>{"use strict";var pW=jm();function mW(t,e){var n=e?pW(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}vL.exports=mW});var wL=S((Qye,SL)=>{"use strict";var gW=/\w*$/;function yW(t){var e=new t.constructor(t.source,gW.exec(t));return e.lastIndex=t.lastIndex,e}SL.exports=yW});var TL=S((Xye,OL)=>{"use strict";var kL=zo(),AL=kL?kL.prototype:void 0,CL=AL?AL.valueOf:void 0;function bW(t){return CL?Object(CL.call(t)):{}}OL.exports=bW});var DL=S((Wye,EL)=>{"use strict";var vW=jm();function xW(t,e){var n=e?vW(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}EL.exports=xW});var RL=S((Zye,ML)=>{"use strict";var SW=jm(),wW=xL(),kW=wL(),AW=TL(),CW=DL(),OW="[object Boolean]",TW="[object Date]",EW="[object Map]",DW="[object Number]",MW="[object RegExp]",RW="[object Set]",NW="[object String]",LW="[object Symbol]",IW="[object ArrayBuffer]",_W="[object DataView]",BW="[object Float32Array]",qW="[object Float64Array]",PW="[object Int8Array]",zW="[object Int16Array]",HW="[object Int32Array]",UW="[object Uint8Array]",FW="[object Uint8ClampedArray]",$W="[object Uint16Array]",VW="[object Uint32Array]";function jW(t,e,n){var i=t.constructor;switch(e){case IW:return SW(t);case OW:case TW:return new i(+t);case _W:return wW(t,n);case BW:case qW:case PW:case zW:case HW:case UW:case FW:case $W:case VW:return CW(t,n);case EW:return new i;case DW:case NW:return new i(t);case MW:return kW(t);case RW:return new i;case LW:return AW(t)}}ML.exports=jW});var yS=S((Jye,LL)=>{"use strict";var YW=Is(),NL=Object.create,KW=(function(){function t(){}return function(e){if(!YW(e))return{};if(NL)return NL(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();LL.exports=KW});var _L=S((e0e,IL)=>{"use strict";var GW=yS(),QW=Vm(),XW=Nf();function WW(t){return typeof t.constructor=="function"&&!XW(t)?GW(QW(t)):{}}IL.exports=WW});var qL=S((t0e,BL)=>{"use strict";var ZW=Fo(),JW=Gi(),eZ="[object Map]";function tZ(t){return JW(t)&&ZW(t)==eZ}BL.exports=tZ});var UL=S((n0e,HL)=>{"use strict";var nZ=qL(),iZ=Pm(),PL=zm(),zL=PL&&PL.isMap,rZ=zL?iZ(zL):nZ;HL.exports=rZ});var $L=S((i0e,FL)=>{"use strict";var sZ=Fo(),oZ=Gi(),lZ="[object Set]";function aZ(t){return oZ(t)&&sZ(t)==lZ}FL.exports=aZ});var KL=S((r0e,YL)=>{"use strict";var cZ=$L(),uZ=Pm(),VL=zm(),jL=VL&&VL.isSet,fZ=jL?uZ(jL):cZ;YL.exports=fZ});var ZL=S((s0e,WL)=>{"use strict";var dZ=_m(),hZ=Bm(),pZ=eS(),mZ=AN(),gZ=RN(),yZ=BN(),bZ=PN(),vZ=VN(),xZ=QN(),SZ=cS(),wZ=JN(),kZ=Fo(),AZ=mL(),CZ=RL(),OZ=_L(),TZ=ut(),EZ=Ha(),DZ=UL(),MZ=Is(),RZ=KL(),NZ=qs(),LZ=Um(),IZ=1,_Z=2,BZ=4,GL="[object Arguments]",qZ="[object Array]",PZ="[object Boolean]",zZ="[object Date]",HZ="[object Error]",QL="[object Function]",UZ="[object GeneratorFunction]",FZ="[object Map]",$Z="[object Number]",XL="[object Object]",VZ="[object RegExp]",jZ="[object Set]",YZ="[object String]",KZ="[object Symbol]",GZ="[object WeakMap]",QZ="[object ArrayBuffer]",XZ="[object DataView]",WZ="[object Float32Array]",ZZ="[object Float64Array]",JZ="[object Int8Array]",eJ="[object Int16Array]",tJ="[object Int32Array]",nJ="[object Uint8Array]",iJ="[object Uint8ClampedArray]",rJ="[object Uint16Array]",sJ="[object Uint32Array]",Re={};Re[GL]=Re[qZ]=Re[QZ]=Re[XZ]=Re[PZ]=Re[zZ]=Re[WZ]=Re[ZZ]=Re[JZ]=Re[eJ]=Re[tJ]=Re[FZ]=Re[$Z]=Re[XL]=Re[VZ]=Re[jZ]=Re[YZ]=Re[KZ]=Re[nJ]=Re[iJ]=Re[rJ]=Re[sJ]=!0;Re[HZ]=Re[QL]=Re[GZ]=!1;function Ym(t,e,n,i,r,s){var o,l=e&IZ,a=e&_Z,c=e&BZ;if(n&&(o=r?n(t,i,r,s):n(t)),o!==void 0)return o;if(!MZ(t))return t;var u=TZ(t);if(u){if(o=AZ(t),!l)return bZ(t,o)}else{var f=kZ(t),d=f==QL||f==UZ;if(EZ(t))return yZ(t,l);if(f==XL||f==GL||d&&!r){if(o=a||d?{}:OZ(t),!l)return a?xZ(t,gZ(o,t)):vZ(t,mZ(o,t))}else{if(!Re[f])return r?t:{};o=CZ(t,f,l)}}s||(s=new dZ);var h=s.get(t);if(h)return h;s.set(t,o),RZ(t)?t.forEach(function(b){o.add(Ym(b,e,n,b,t,s))}):DZ(t)&&t.forEach(function(b,m){o.set(m,Ym(b,e,n,m,t,s))});var p=c?a?wZ:SZ:a?LZ:NZ,g=u?void 0:p(t);return hZ(g||t,function(b,m){g&&(m=b,b=t[m]),pZ(o,m,Ym(b,e,n,m,t,s))}),o}WL.exports=Ym});var e4=S((o0e,JL)=>{"use strict";var oJ=ZL(),lJ=4;function aJ(t){return oJ(t,lJ)}JL.exports=aJ});var bS=S((l0e,t4)=>{"use strict";function cJ(t){return function(){return t}}t4.exports=cJ});var i4=S((a0e,n4)=>{"use strict";function uJ(t){return function(e,n,i){for(var r=-1,s=Object(e),o=i(e),l=o.length;l--;){var a=o[t?l:++r];if(n(s[a],a,s)===!1)break}return e}}n4.exports=uJ});var s4=S((c0e,r4)=>{"use strict";var fJ=i4(),dJ=fJ();r4.exports=dJ});var vS=S((u0e,o4)=>{"use strict";var hJ=s4(),pJ=qs();function mJ(t,e){return t&&hJ(t,e,pJ)}o4.exports=mJ});var a4=S((f0e,l4)=>{"use strict";var gJ=Bs();function yJ(t,e){return function(n,i){if(n==null)return n;if(!gJ(n))return t(n,i);for(var r=n.length,s=e?r:-1,o=Object(n);(e?s--:++s<r)&&i(o[s],s,o)!==!1;);return n}}l4.exports=yJ});var If=S((d0e,c4)=>{"use strict";var bJ=vS(),vJ=a4(),xJ=vJ(bJ);c4.exports=xJ});var _f=S((h0e,u4)=>{"use strict";function SJ(t){return t}u4.exports=SJ});var d4=S((p0e,f4)=>{"use strict";var wJ=_f();function kJ(t){return typeof t=="function"?t:wJ}f4.exports=kJ});var p4=S((m0e,h4)=>{"use strict";var AJ=Bm(),CJ=If(),OJ=d4(),TJ=ut();function EJ(t,e){var n=TJ(t)?AJ:CJ;return n(t,OJ(e))}h4.exports=EJ});var g4=S((g0e,m4)=>{"use strict";m4.exports=p4()});var b4=S((y0e,y4)=>{"use strict";var DJ=If();function MJ(t,e){var n=[];return DJ(t,function(i,r,s){e(i,r,s)&&n.push(i)}),n}y4.exports=MJ});var x4=S((b0e,v4)=>{"use strict";var RJ="__lodash_hash_undefined__";function NJ(t){return this.__data__.set(t,RJ),this}v4.exports=NJ});var w4=S((v0e,S4)=>{"use strict";function LJ(t){return this.__data__.has(t)}S4.exports=LJ});var xS=S((x0e,k4)=>{"use strict";var IJ=Im(),_J=x4(),BJ=w4();function Km(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new IJ;++e<n;)this.add(t[e])}Km.prototype.add=Km.prototype.push=_J;Km.prototype.has=BJ;k4.exports=Km});var C4=S((S0e,A4)=>{"use strict";function qJ(t,e){for(var n=-1,i=t==null?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}A4.exports=qJ});var SS=S((w0e,O4)=>{"use strict";function PJ(t,e){return t.has(e)}O4.exports=PJ});var wS=S((k0e,T4)=>{"use strict";var zJ=xS(),HJ=C4(),UJ=SS(),FJ=1,$J=2;function VJ(t,e,n,i,r,s){var o=n&FJ,l=t.length,a=e.length;if(l!=a&&!(o&&a>l))return!1;var c=s.get(t),u=s.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=n&$J?new zJ:void 0;for(s.set(t,e),s.set(e,t);++f<l;){var p=t[f],g=e[f];if(i)var b=o?i(g,p,f,e,t,s):i(p,g,f,t,e,s);if(b!==void 0){if(b)continue;d=!1;break}if(h){if(!HJ(e,function(m,y){if(!UJ(h,y)&&(p===m||r(p,m,n,i,s)))return h.push(y)})){d=!1;break}}else if(!(p===g||r(p,g,n,i,s))){d=!1;break}}return s.delete(t),s.delete(e),d}T4.exports=VJ});var D4=S((A0e,E4)=>{"use strict";function jJ(t){var e=-1,n=Array(t.size);return t.forEach(function(i,r){n[++e]=[r,i]}),n}E4.exports=jJ});var Gm=S((C0e,M4)=>{"use strict";function YJ(t){var e=-1,n=Array(t.size);return t.forEach(function(i){n[++e]=i}),n}M4.exports=YJ});var _4=S((O0e,I4)=>{"use strict";var R4=zo(),N4=gS(),KJ=Nm(),GJ=wS(),QJ=D4(),XJ=Gm(),WJ=1,ZJ=2,JJ="[object Boolean]",eee="[object Date]",tee="[object Error]",nee="[object Map]",iee="[object Number]",ree="[object RegExp]",see="[object Set]",oee="[object String]",lee="[object Symbol]",aee="[object ArrayBuffer]",cee="[object DataView]",L4=R4?R4.prototype:void 0,kS=L4?L4.valueOf:void 0;function uee(t,e,n,i,r,s,o){switch(n){case cee:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case aee:return!(t.byteLength!=e.byteLength||!s(new N4(t),new N4(e)));case JJ:case eee:case iee:return KJ(+t,+e);case tee:return t.name==e.name&&t.message==e.message;case ree:case oee:return t==e+"";case nee:var l=QJ;case see:var a=i&WJ;if(l||(l=XJ),t.size!=e.size&&!a)return!1;var c=o.get(t);if(c)return c==e;i|=ZJ,o.set(t,e);var u=GJ(l(t),l(e),i,r,s,o);return o.delete(t),u;case lee:if(kS)return kS.call(t)==kS.call(e)}return!1}I4.exports=uee});var P4=S((T0e,q4)=>{"use strict";var B4=cS(),fee=1,dee=Object.prototype,hee=dee.hasOwnProperty;function pee(t,e,n,i,r,s){var o=n&fee,l=B4(t),a=l.length,c=B4(e),u=c.length;if(a!=u&&!o)return!1;for(var f=a;f--;){var d=l[f];if(!(o?d in e:hee.call(e,d)))return!1}var h=s.get(t),p=s.get(e);if(h&&p)return h==e&&p==t;var g=!0;s.set(t,e),s.set(e,t);for(var b=o;++f<a;){d=l[f];var m=t[d],y=e[d];if(i)var v=o?i(y,m,d,e,t,s):i(m,y,d,t,e,s);if(!(v===void 0?m===y||r(m,y,n,i,s):v)){g=!1;break}b||(b=d=="constructor")}if(g&&!b){var x=t.constructor,A=e.constructor;x!=A&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof A=="function"&&A instanceof A)&&(g=!1)}return s.delete(t),s.delete(e),g}q4.exports=pee});var Y4=S((E0e,j4)=>{"use strict";var AS=_m(),mee=wS(),gee=_4(),yee=P4(),z4=Fo(),H4=ut(),U4=Ha(),bee=Rf(),vee=1,F4="[object Arguments]",$4="[object Array]",Qm="[object Object]",xee=Object.prototype,V4=xee.hasOwnProperty;function See(t,e,n,i,r,s){var o=H4(t),l=H4(e),a=o?$4:z4(t),c=l?$4:z4(e);a=a==F4?Qm:a,c=c==F4?Qm:c;var u=a==Qm,f=c==Qm,d=a==c;if(d&&U4(t)){if(!U4(e))return!1;o=!0,u=!1}if(d&&!u)return s||(s=new AS),o||bee(t)?mee(t,e,n,i,r,s):gee(t,e,a,n,i,r,s);if(!(n&vee)){var h=u&&V4.call(t,"__wrapped__"),p=f&&V4.call(e,"__wrapped__");if(h||p){var g=h?t.value():t,b=p?e.value():e;return s||(s=new AS),r(g,b,n,i,s)}}return d?(s||(s=new AS),yee(t,e,n,i,r,s)):!1}j4.exports=See});var CS=S((D0e,Q4)=>{"use strict";var wee=Y4(),K4=Gi();function G4(t,e,n,i,r){return t===e?!0:t==null||e==null||!K4(t)&&!K4(e)?t!==t&&e!==e:wee(t,e,n,i,G4,r)}Q4.exports=G4});var W4=S((M0e,X4)=>{"use strict";var kee=_m(),Aee=CS(),Cee=1,Oee=2;function Tee(t,e,n,i){var r=n.length,s=r,o=!i;if(t==null)return!s;for(t=Object(t);r--;){var l=n[r];if(o&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++r<s;){l=n[r];var a=l[0],c=t[a],u=l[1];if(o&&l[2]){if(c===void 0&&!(a in t))return!1}else{var f=new kee;if(i)var d=i(c,u,a,t,e,f);if(!(d===void 0?Aee(u,c,Cee|Oee,i,f):d))return!1}}return!0}X4.exports=Tee});var OS=S((R0e,Z4)=>{"use strict";var Eee=Is();function Dee(t){return t===t&&!Eee(t)}Z4.exports=Dee});var e6=S((N0e,J4)=>{"use strict";var Mee=OS(),Ree=qs();function Nee(t){for(var e=Ree(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,Mee(r)]}return e}J4.exports=Nee});var TS=S((L0e,t6)=>{"use strict";function Lee(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}t6.exports=Lee});var i6=S((I0e,n6)=>{"use strict";var Iee=W4(),_ee=e6(),Bee=TS();function qee(t){var e=_ee(t);return e.length==1&&e[0][2]?Bee(e[0][0],e[0][1]):function(n){return n===t||Iee(n,t,e)}}n6.exports=qee});var Xm=S((_0e,r6)=>{"use strict";var Pee=Ho(),zee=Gi(),Hee="[object Symbol]";function Uee(t){return typeof t=="symbol"||zee(t)&&Pee(t)==Hee}r6.exports=Uee});var Wm=S((B0e,s6)=>{"use strict";var Fee=ut(),$ee=Xm(),Vee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jee=/^\w*$/;function Yee(t,e){if(Fee(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||$ee(t)?!0:jee.test(t)||!Vee.test(t)||e!=null&&t in Object(e)}s6.exports=Yee});var a6=S((q0e,l6)=>{"use strict";var o6=Im(),Kee="Expected a function";function ES(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Kee);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(ES.Cache||o6),n}ES.Cache=o6;l6.exports=ES});var u6=S((P0e,c6)=>{"use strict";var Gee=a6(),Qee=500;function Xee(t){var e=Gee(t,function(i){return n.size===Qee&&n.clear(),i}),n=e.cache;return e}c6.exports=Xee});var d6=S((z0e,f6)=>{"use strict";var Wee=u6(),Zee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jee=/\\(\\)?/g,ete=Wee(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Zee,function(n,i,r,s){e.push(r?s.replace(Jee,"$1"):i||n)}),e});f6.exports=ete});var Zm=S((H0e,h6)=>{"use strict";function tte(t,e){for(var n=-1,i=t==null?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}h6.exports=tte});var v6=S((U0e,b6)=>{"use strict";var p6=zo(),nte=Zm(),ite=ut(),rte=Xm(),ste=1/0,m6=p6?p6.prototype:void 0,g6=m6?m6.toString:void 0;function y6(t){if(typeof t=="string")return t;if(ite(t))return nte(t,y6)+"";if(rte(t))return g6?g6.call(t):"";var e=t+"";return e=="0"&&1/t==-ste?"-0":e}b6.exports=y6});var S6=S((F0e,x6)=>{"use strict";var ote=v6();function lte(t){return t==null?"":ote(t)}x6.exports=lte});var DS=S(($0e,w6)=>{"use strict";var ate=ut(),cte=Wm(),ute=d6(),fte=S6();function dte(t,e){return ate(t)?t:cte(t,e)?[t]:ute(fte(t))}w6.exports=dte});var Bf=S((V0e,k6)=>{"use strict";var hte=Xm(),pte=1/0;function mte(t){if(typeof t=="string"||hte(t))return t;var e=t+"";return e=="0"&&1/t==-pte?"-0":e}k6.exports=mte});var MS=S((j0e,A6)=>{"use strict";var gte=DS(),yte=Bf();function bte(t,e){e=gte(e,t);for(var n=0,i=e.length;t!=null&&n<i;)t=t[yte(e[n++])];return n&&n==i?t:void 0}A6.exports=bte});var O6=S((Y0e,C6)=>{"use strict";var vte=MS();function xte(t,e,n){var i=t==null?void 0:vte(t,e);return i===void 0?n:i}C6.exports=xte});var E6=S((K0e,T6)=>{"use strict";function Ste(t,e){return t!=null&&e in Object(t)}T6.exports=Ste});var RS=S((G0e,D6)=>{"use strict";var wte=DS(),kte=Tf(),Ate=ut(),Cte=tS(),Ote=qm(),Tte=Bf();function Ete(t,e,n){e=wte(e,t);for(var i=-1,r=e.length,s=!1;++i<r;){var o=Tte(e[i]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++i!=r?s:(r=t==null?0:t.length,!!r&&Ote(r)&&Cte(o,r)&&(Ate(t)||kte(t)))}D6.exports=Ete});var R6=S((Q0e,M6)=>{"use strict";var Dte=E6(),Mte=RS();function Rte(t,e){return t!=null&&Mte(t,e,Dte)}M6.exports=Rte});var L6=S((X0e,N6)=>{"use strict";var Nte=CS(),Lte=O6(),Ite=R6(),_te=Wm(),Bte=OS(),qte=TS(),Pte=Bf(),zte=1,Hte=2;function Ute(t,e){return _te(t)&&Bte(e)?qte(Pte(t),e):function(n){var i=Lte(n,t);return i===void 0&&i===e?Ite(n,t):Nte(e,i,zte|Hte)}}N6.exports=Ute});var NS=S((W0e,I6)=>{"use strict";function Fte(t){return function(e){return e?.[t]}}I6.exports=Fte});var B6=S((Z0e,_6)=>{"use strict";var $te=MS();function Vte(t){return function(e){return $te(e,t)}}_6.exports=Vte});var P6=S((J0e,q6)=>{"use strict";var jte=NS(),Yte=B6(),Kte=Wm(),Gte=Bf();function Qte(t){return Kte(t)?jte(Gte(t)):Yte(t)}q6.exports=Qte});var qf=S((ebe,z6)=>{"use strict";var Xte=i6(),Wte=L6(),Zte=_f(),Jte=ut(),ene=P6();function tne(t){return typeof t=="function"?t:t==null?Zte:typeof t=="object"?Jte(t)?Wte(t[0],t[1]):Xte(t):ene(t)}z6.exports=tne});var U6=S((tbe,H6)=>{"use strict";var nne=sS(),ine=b4(),rne=qf(),sne=ut();function one(t,e){var n=sne(t)?nne:ine;return n(t,rne(e,3))}H6.exports=one});var $6=S((nbe,F6)=>{"use strict";var lne=Object.prototype,ane=lne.hasOwnProperty;function cne(t,e){return t!=null&&ane.call(t,e)}F6.exports=cne});var j6=S((ibe,V6)=>{"use strict";var une=$6(),fne=RS();function dne(t,e){return t!=null&&fne(t,e,une)}V6.exports=dne});var K6=S((rbe,Y6)=>{"use strict";var hne=Hm(),pne=Fo(),mne=Tf(),gne=ut(),yne=Bs(),bne=Ha(),vne=Nf(),xne=Rf(),Sne="[object Map]",wne="[object Set]",kne=Object.prototype,Ane=kne.hasOwnProperty;function Cne(t){if(t==null)return!0;if(yne(t)&&(gne(t)||typeof t=="string"||typeof t.splice=="function"||bne(t)||xne(t)||mne(t)))return!t.length;var e=pne(t);if(e==Sne||e==wne)return!t.size;if(vne(t))return!hne(t).length;for(var n in t)if(Ane.call(t,n))return!1;return!0}Y6.exports=Cne});var Q6=S((sbe,G6)=>{"use strict";function One(t){return t===void 0}G6.exports=One});var W6=S((obe,X6)=>{"use strict";var Tne=If(),Ene=Bs();function Dne(t,e){var n=-1,i=Ene(t)?Array(t.length):[];return Tne(t,function(r,s,o){i[++n]=e(r,s,o)}),i}X6.exports=Dne});var J6=S((lbe,Z6)=>{"use strict";var Mne=Zm(),Rne=qf(),Nne=W6(),Lne=ut();function Ine(t,e){var n=Lne(t)?Mne:Nne;return n(t,Rne(e,3))}Z6.exports=Ine});var t8=S((abe,e8)=>{"use strict";function _ne(t,e,n,i){var r=-1,s=t==null?0:t.length;for(i&&s&&(n=t[++r]);++r<s;)n=e(n,t[r],r,t);return n}e8.exports=_ne});var i8=S((cbe,n8)=>{"use strict";function Bne(t,e,n,i,r){return r(t,function(s,o,l){n=i?(i=!1,s):e(n,s,o,l)}),n}n8.exports=Bne});var s8=S((ube,r8)=>{"use strict";var qne=t8(),Pne=If(),zne=qf(),Hne=i8(),Une=ut();function Fne(t,e,n){var i=Une(t)?qne:Hne,r=arguments.length<3;return i(t,zne(e,4),n,r,Pne)}r8.exports=Fne});var l8=S((fbe,o8)=>{"use strict";var $ne=Ho(),Vne=ut(),jne=Gi(),Yne="[object String]";function Kne(t){return typeof t=="string"||!Vne(t)&&jne(t)&&$ne(t)==Yne}o8.exports=Kne});var c8=S((dbe,a8)=>{"use strict";var Gne=NS(),Qne=Gne("length");a8.exports=Qne});var f8=S((hbe,u8)=>{"use strict";var Xne="\\ud800-\\udfff",Wne="\\u0300-\\u036f",Zne="\\ufe20-\\ufe2f",Jne="\\u20d0-\\u20ff",eie=Wne+Zne+Jne,tie="\\ufe0e\\ufe0f",nie="\\u200d",iie=RegExp("["+nie+Xne+eie+tie+"]");function rie(t){return iie.test(t)}u8.exports=rie});var x8=S((pbe,v8)=>{"use strict";var h8="\\ud800-\\udfff",sie="\\u0300-\\u036f",oie="\\ufe20-\\ufe2f",lie="\\u20d0-\\u20ff",aie=sie+oie+lie,cie="\\ufe0e\\ufe0f",uie="["+h8+"]",LS="["+aie+"]",IS="\\ud83c[\\udffb-\\udfff]",fie="(?:"+LS+"|"+IS+")",p8="[^"+h8+"]",m8="(?:\\ud83c[\\udde6-\\uddff]){2}",g8="[\\ud800-\\udbff][\\udc00-\\udfff]",die="\\u200d",y8=fie+"?",b8="["+cie+"]?",hie="(?:"+die+"(?:"+[p8,m8,g8].join("|")+")"+b8+y8+")*",pie=b8+y8+hie,mie="(?:"+[p8+LS+"?",LS,m8,g8,uie].join("|")+")",d8=RegExp(IS+"(?="+IS+")|"+mie+pie,"g");function gie(t){for(var e=d8.lastIndex=0;d8.test(t);)++e;return e}v8.exports=gie});var w8=S((mbe,S8)=>{"use strict";var yie=c8(),bie=f8(),vie=x8();function xie(t){return bie(t)?vie(t):yie(t)}S8.exports=xie});var A8=S((gbe,k8)=>{"use strict";var Sie=Hm(),wie=Fo(),kie=Bs(),Aie=l8(),Cie=w8(),Oie="[object Map]",Tie="[object Set]";function Eie(t){if(t==null)return 0;if(kie(t))return Aie(t)?Cie(t):t.length;var e=wie(t);return e==Oie||e==Tie?t.size:Sie(t).length}k8.exports=Eie});var O8=S((ybe,C8)=>{"use strict";var Die=Bm(),Mie=yS(),Rie=vS(),Nie=qf(),Lie=Vm(),Iie=ut(),_ie=Ha(),Bie=kf(),qie=Is(),Pie=Rf();function zie(t,e,n){var i=Iie(t),r=i||_ie(t)||Pie(t);if(e=Nie(e,4),n==null){var s=t&&t.constructor;r?n=i?new s:[]:qie(t)?n=Bie(s)?Mie(Lie(t)):{}:n={}}return(r?Die:Rie)(t,function(o,l,a){return e(n,o,l,a)}),n}C8.exports=zie});var M8=S((bbe,D8)=>{"use strict";var T8=zo(),Hie=Tf(),Uie=ut(),E8=T8?T8.isConcatSpreadable:void 0;function Fie(t){return Uie(t)||Hie(t)||!!(E8&&t&&t[E8])}D8.exports=Fie});var L8=S((vbe,N8)=>{"use strict";var $ie=$m(),Vie=M8();function R8(t,e,n,i,r){var s=-1,o=t.length;for(n||(n=Vie),r||(r=[]);++s<o;){var l=t[s];e>0&&n(l)?e>1?R8(l,e-1,n,i,r):$ie(r,l):i||(r[r.length]=l)}return r}N8.exports=R8});var _8=S((xbe,I8)=>{"use strict";function jie(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}I8.exports=jie});var P8=S((Sbe,q8)=>{"use strict";var Yie=_8(),B8=Math.max;function Kie(t,e,n){return e=B8(e===void 0?t.length-1:e,0),function(){for(var i=arguments,r=-1,s=B8(i.length-e,0),o=Array(s);++r<s;)o[r]=i[e+r];r=-1;for(var l=Array(e+1);++r<e;)l[r]=i[r];return l[e]=n(o),Yie(t,this,l)}}q8.exports=Kie});var U8=S((wbe,H8)=>{"use strict";var Gie=bS(),z8=Zx(),Qie=_f(),Xie=z8?function(t,e){return z8(t,"toString",{configurable:!0,enumerable:!1,value:Gie(e),writable:!0})}:Qie;H8.exports=Xie});var $8=S((kbe,F8)=>{"use strict";var Wie=800,Zie=16,Jie=Date.now;function ere(t){var e=0,n=0;return function(){var i=Jie(),r=Zie-(i-n);if(n=i,r>0){if(++e>=Wie)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}F8.exports=ere});var j8=S((Abe,V8)=>{"use strict";var tre=U8(),nre=$8(),ire=nre(tre);V8.exports=ire});var K8=S((Cbe,Y8)=>{"use strict";var rre=_f(),sre=P8(),ore=j8();function lre(t,e){return ore(sre(t,e,rre),t+"")}Y8.exports=lre});var Q8=S((Obe,G8)=>{"use strict";function are(t,e,n,i){for(var r=t.length,s=n+(i?1:-1);i?s--:++s<r;)if(e(t[s],s,t))return s;return-1}G8.exports=are});var W8=S((Tbe,X8)=>{"use strict";function cre(t){return t!==t}X8.exports=cre});var J8=S((Ebe,Z8)=>{"use strict";function ure(t,e,n){for(var i=n-1,r=t.length;++i<r;)if(t[i]===e)return i;return-1}Z8.exports=ure});var tI=S((Dbe,eI)=>{"use strict";var fre=Q8(),dre=W8(),hre=J8();function pre(t,e,n){return e===e?hre(t,e,n):fre(t,dre,n)}eI.exports=pre});var iI=S((Mbe,nI)=>{"use strict";var mre=tI();function gre(t,e){var n=t==null?0:t.length;return!!n&&mre(t,e,0)>-1}nI.exports=gre});var sI=S((Rbe,rI)=>{"use strict";function yre(t,e,n){for(var i=-1,r=t==null?0:t.length;++i<r;)if(n(e,t[i]))return!0;return!1}rI.exports=yre});var lI=S((Nbe,oI)=>{"use strict";function bre(){}oI.exports=bre});var cI=S((Lbe,aI)=>{"use strict";var _S=uS(),vre=lI(),xre=Gm(),Sre=1/0,wre=_S&&1/xre(new _S([,-0]))[1]==Sre?function(t){return new _S(t)}:vre;aI.exports=wre});var fI=S((Ibe,uI)=>{"use strict";var kre=xS(),Are=iI(),Cre=sI(),Ore=SS(),Tre=cI(),Ere=Gm(),Dre=200;function Mre(t,e,n){var i=-1,r=Are,s=t.length,o=!0,l=[],a=l;if(n)o=!1,r=Cre;else if(s>=Dre){var c=e?null:Tre(t);if(c)return Ere(c);o=!1,r=Ore,a=new kre}else a=e?[]:l;e:for(;++i<s;){var u=t[i],f=e?e(u):u;if(u=n||u!==0?u:0,o&&f===f){for(var d=a.length;d--;)if(a[d]===f)continue e;e&&a.push(f),l.push(u)}else r(a,f,n)||(a!==l&&a.push(f),l.push(u))}return l}uI.exports=Mre});var hI=S((_be,dI)=>{"use strict";var Rre=Bs(),Nre=Gi();function Lre(t){return Nre(t)&&Rre(t)}dI.exports=Lre});var mI=S((Bbe,pI)=>{"use strict";var Ire=L8(),_re=K8(),Bre=fI(),qre=hI(),Pre=_re(function(t){return Bre(Ire(t,1,qre,!0))});pI.exports=Pre});var yI=S((qbe,gI)=>{"use strict";var zre=Zm();function Hre(t,e){return zre(e,function(n){return t[n]})}gI.exports=Hre});var vI=S((Pbe,bI)=>{"use strict";var Ure=yI(),Fre=qs();function $re(t){return t==null?[]:Ure(t,Fre(t))}bI.exports=$re});var Tn=S((zbe,xI)=>{"use strict";var Jm;if(typeof ZS=="function")try{Jm={clone:e4(),constant:bS(),each:g4(),filter:U6(),has:j6(),isArray:ut(),isEmpty:K6(),isFunction:kf(),isUndefined:Q6(),keys:qs(),map:J6(),reduce:s8(),size:A8(),transform:O8(),union:mI(),values:vI()}}catch{}Jm||(Jm=window._);xI.exports=Jm});var eg=S((Ube,AI)=>{"use strict";var Q=Tn();AI.exports=ie;var Vre="\0",$o="\0",SI="";function ie(t){this._isDirected=Q.has(t,"directed")?t.directed:!0,this._isMultigraph=Q.has(t,"multigraph")?t.multigraph:!1,this._isCompound=Q.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Q.constant(void 0),this._defaultEdgeLabelFn=Q.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[$o]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}ie.prototype._nodeCount=0;ie.prototype._edgeCount=0;ie.prototype.isDirected=function(){return this._isDirected};ie.prototype.isMultigraph=function(){return this._isMultigraph};ie.prototype.isCompound=function(){return this._isCompound};ie.prototype.setGraph=function(t){return this._label=t,this};ie.prototype.graph=function(){return this._label};ie.prototype.setDefaultNodeLabel=function(t){return Q.isFunction(t)||(t=Q.constant(t)),this._defaultNodeLabelFn=t,this};ie.prototype.nodeCount=function(){return this._nodeCount};ie.prototype.nodes=function(){return Q.keys(this._nodes)};ie.prototype.sources=function(){var t=this;return Q.filter(this.nodes(),function(e){return Q.isEmpty(t._in[e])})};ie.prototype.sinks=function(){var t=this;return Q.filter(this.nodes(),function(e){return Q.isEmpty(t._out[e])})};ie.prototype.setNodes=function(t,e){var n=arguments,i=this;return Q.each(t,function(r){n.length>1?i.setNode(r,e):i.setNode(r)}),this};ie.prototype.setNode=function(t,e){return Q.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=$o,this._children[t]={},this._children[$o][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};ie.prototype.node=function(t){return this._nodes[t]};ie.prototype.hasNode=function(t){return Q.has(this._nodes,t)};ie.prototype.removeNode=function(t){var e=this;if(Q.has(this._nodes,t)){var n=function(i){e.removeEdge(e._edgeObjs[i])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],Q.each(this.children(t),function(i){e.setParent(i)}),delete this._children[t]),Q.each(Q.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],Q.each(Q.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};ie.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Q.isUndefined(e))e=$o;else{e+="";for(var n=e;!Q.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this};ie.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};ie.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==$o)return e}};ie.prototype.children=function(t){if(Q.isUndefined(t)&&(t=$o),this._isCompound){var e=this._children[t];if(e)return Q.keys(e)}else{if(t===$o)return this.nodes();if(this.hasNode(t))return[]}};ie.prototype.predecessors=function(t){var e=this._preds[t];if(e)return Q.keys(e)};ie.prototype.successors=function(t){var e=this._sucs[t];if(e)return Q.keys(e)};ie.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return Q.union(e,this.successors(t))};ie.prototype.isLeaf=function(t){var e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0};ie.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;Q.each(this._nodes,function(s,o){t(o)&&e.setNode(o,s)}),Q.each(this._edgeObjs,function(s){e.hasNode(s.v)&&e.hasNode(s.w)&&e.setEdge(s,n.edge(s))});var i={};function r(s){var o=n.parent(s);return o===void 0||e.hasNode(o)?(i[s]=o,o):o in i?i[o]:r(o)}return this._isCompound&&Q.each(e.nodes(),function(s){e.setParent(s,r(s))}),e};ie.prototype.setDefaultEdgeLabel=function(t){return Q.isFunction(t)||(t=Q.constant(t)),this._defaultEdgeLabelFn=t,this};ie.prototype.edgeCount=function(){return this._edgeCount};ie.prototype.edges=function(){return Q.values(this._edgeObjs)};ie.prototype.setPath=function(t,e){var n=this,i=arguments;return Q.reduce(t,function(r,s){return i.length>1?n.setEdge(r,s,e):n.setEdge(r,s),s}),this};ie.prototype.setEdge=function(){var t,e,n,i,r=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(t=s.v,e=s.w,n=s.name,arguments.length===2&&(i=arguments[1],r=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),t=""+t,e=""+e,Q.isUndefined(n)||(n=""+n);var o=Pf(this._isDirected,t,e,n);if(Q.has(this._edgeLabels,o))return r&&(this._edgeLabels[o]=i),this;if(!Q.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[o]=r?i:this._defaultEdgeLabelFn(t,e,n);var l=jre(this._isDirected,t,e,n);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[o]=l,wI(this._preds[e],t),wI(this._sucs[t],e),this._in[e][o]=l,this._out[t][o]=l,this._edgeCount++,this};ie.prototype.edge=function(t,e,n){var i=arguments.length===1?BS(this._isDirected,arguments[0]):Pf(this._isDirected,t,e,n);return this._edgeLabels[i]};ie.prototype.hasEdge=function(t,e,n){var i=arguments.length===1?BS(this._isDirected,arguments[0]):Pf(this._isDirected,t,e,n);return Q.has(this._edgeLabels,i)};ie.prototype.removeEdge=function(t,e,n){var i=arguments.length===1?BS(this._isDirected,arguments[0]):Pf(this._isDirected,t,e,n),r=this._edgeObjs[i];return r&&(t=r.v,e=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],kI(this._preds[e],t),kI(this._sucs[t],e),delete this._in[e][i],delete this._out[t][i],this._edgeCount--),this};ie.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=Q.values(n);return e?Q.filter(i,function(r){return r.v===e}):i}};ie.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=Q.values(n);return e?Q.filter(i,function(r){return r.w===e}):i}};ie.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};function wI(t,e){t[e]?t[e]++:t[e]=1}function kI(t,e){--t[e]||delete t[e]}function Pf(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var o=r;r=s,s=o}return r+SI+s+SI+(Q.isUndefined(i)?Vre:i)}function jre(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var o=r;r=s,s=o}var l={v:r,w:s};return i&&(l.name=i),l}function BS(t,e){return Pf(t,e.v,e.w,e.name)}});var OI=S((Fbe,CI)=>{"use strict";CI.exports="2.1.8"});var EI=S(($be,TI)=>{"use strict";TI.exports={Graph:eg(),version:OI()}});var MI=S((Vbe,DI)=>{"use strict";var Qi=Tn(),Yre=eg();DI.exports={write:Kre,read:Xre};function Kre(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Gre(t),edges:Qre(t)};return Qi.isUndefined(t.graph())||(e.value=Qi.clone(t.graph())),e}function Gre(t){return Qi.map(t.nodes(),function(e){var n=t.node(e),i=t.parent(e),r={v:e};return Qi.isUndefined(n)||(r.value=n),Qi.isUndefined(i)||(r.parent=i),r})}function Qre(t){return Qi.map(t.edges(),function(e){var n=t.edge(e),i={v:e.v,w:e.w};return Qi.isUndefined(e.name)||(i.name=e.name),Qi.isUndefined(n)||(i.value=n),i})}function Xre(t){var e=new Yre(t.options).setGraph(t.value);return Qi.each(t.nodes,function(n){e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),Qi.each(t.edges,function(n){e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}});var NI=S((jbe,RI)=>{"use strict";var tg=Tn();RI.exports=Wre;function Wre(t){var e={},n=[],i;function r(s){tg.has(e,s)||(e[s]=!0,i.push(s),tg.each(t.successors(s),r),tg.each(t.predecessors(s),r))}return tg.each(t.nodes(),function(s){i=[],r(s),i.length&&n.push(i)}),n}});var qS=S((Ybe,II)=>{"use strict";var LI=Tn();II.exports=Qn;function Qn(){this._arr=[],this._keyIndices={}}Qn.prototype.size=function(){return this._arr.length};Qn.prototype.keys=function(){return this._arr.map(function(t){return t.key})};Qn.prototype.has=function(t){return LI.has(this._keyIndices,t)};Qn.prototype.priority=function(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority};Qn.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};Qn.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!LI.has(n,t)){var i=this._arr,r=i.length;return n[t]=r,i.push({key:t,priority:e}),this._decrease(r),!0}return!1};Qn.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key};Qn.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)};Qn.prototype._heapify=function(t){var e=this._arr,n=2*t,i=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,i<e.length&&(r=e[i].priority<e[r].priority?i:r),r!==t&&(this._swap(t,r),this._heapify(r)))};Qn.prototype._decrease=function(t){for(var e=this._arr,n=e[t].priority,i;t!==0&&(i=t>>1,!(e[i].priority<n));)this._swap(t,i),t=i};Qn.prototype._swap=function(t,e){var n=this._arr,i=this._keyIndices,r=n[t],s=n[e];n[t]=s,n[e]=r,i[s.key]=t,i[r.key]=e}});var PS=S((Kbe,_I)=>{"use strict";var Zre=Tn(),Jre=qS();_I.exports=tse;var ese=Zre.constant(1);function tse(t,e,n,i){return nse(t,String(e),n||ese,i||function(r){return t.outEdges(r)})}function nse(t,e,n,i){var r={},s=new Jre,o,l,a=function(c){var u=c.v!==o?c.v:c.w,f=r[u],d=n(c),h=l.distance+d;if(d<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+d);h<f.distance&&(f.distance=h,f.predecessor=o,s.decrease(u,h))};for(t.nodes().forEach(function(c){var u=c===e?0:Number.POSITIVE_INFINITY;r[c]={distance:u},s.add(c,u)});s.size()>0&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(a);return r}});var qI=S((Gbe,BI)=>{"use strict";var ise=PS(),rse=Tn();BI.exports=sse;function sse(t,e,n){return rse.transform(t.nodes(),function(i,r){i[r]=ise(t,r,e,n)},{})}});var zS=S((Qbe,zI)=>{"use strict";var PI=Tn();zI.exports=ose;function ose(t){var e=0,n=[],i={},r=[];function s(o){var l=i[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),t.successors(o).forEach(function(u){PI.has(i,u)?i[u].onStack&&(l.lowlink=Math.min(l.lowlink,i[u].index)):(s(u),l.lowlink=Math.min(l.lowlink,i[u].lowlink))}),l.lowlink===l.index){var a=[],c;do c=n.pop(),i[c].onStack=!1,a.push(c);while(o!==c);r.push(a)}}return t.nodes().forEach(function(o){PI.has(i,o)||s(o)}),r}});var UI=S((Xbe,HI)=>{"use strict";var lse=Tn(),ase=zS();HI.exports=cse;function cse(t){return lse.filter(ase(t),function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}});var $I=S((Wbe,FI)=>{"use strict";var use=Tn();FI.exports=dse;var fse=use.constant(1);function dse(t,e,n){return hse(t,e||fse,n||function(i){return t.outEdges(i)})}function hse(t,e,n){var i={},r=t.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY})}),n(s).forEach(function(o){var l=o.v===s?o.w:o.v,a=e(o);i[s][l]={distance:a,predecessor:s}})}),r.forEach(function(s){var o=i[s];r.forEach(function(l){var a=i[l];r.forEach(function(c){var u=a[s],f=o[c],d=a[c],h=u.distance+f.distance;h<d.distance&&(d.distance=h,d.predecessor=f.predecessor)})})}),i}});var HS=S((Zbe,jI)=>{"use strict";var zf=Tn();jI.exports=VI;VI.CycleException=ng;function VI(t){var e={},n={},i=[];function r(s){if(zf.has(n,s))throw new ng;zf.has(e,s)||(n[s]=!0,e[s]=!0,zf.each(t.predecessors(s),r),delete n[s],i.push(s))}if(zf.each(t.sinks(),r),zf.size(e)!==t.nodeCount())throw new ng;return i}function ng(){}ng.prototype=new Error});var GI=S((Jbe,KI)=>{"use strict";var YI=HS();KI.exports=pse;function pse(t){try{YI(t)}catch(e){if(e instanceof YI.CycleException)return!1;throw e}return!0}});var US=S((e1e,XI)=>{"use strict";var ig=Tn();XI.exports=mse;function mse(t,e,n){ig.isArray(e)||(e=[e]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),r=[],s={};return ig.each(e,function(o){if(!t.hasNode(o))throw new Error("Graph does not have node: "+o);QI(t,o,n==="post",s,i,r)}),r}function QI(t,e,n,i,r,s){ig.has(i,e)||(i[e]=!0,n||s.push(e),ig.each(r(e),function(o){QI(t,o,n,i,r,s)}),n&&s.push(e))}});var ZI=S((t1e,WI)=>{"use strict";var gse=US();WI.exports=yse;function yse(t,e){return gse(t,e,"post")}});var e_=S((n1e,JI)=>{"use strict";var bse=US();JI.exports=vse;function vse(t,e){return bse(t,e,"pre")}});var i_=S((i1e,n_)=>{"use strict";var t_=Tn(),xse=eg(),Sse=qS();n_.exports=wse;function wse(t,e){var n=new xse,i={},r=new Sse,s;function o(a){var c=a.v===s?a.w:a.v,u=r.priority(c);if(u!==void 0){var f=e(a);f<u&&(i[c]=s,r.decrease(c,f))}}if(t.nodeCount()===0)return n;t_.each(t.nodes(),function(a){r.add(a,Number.POSITIVE_INFINITY),n.setNode(a)}),r.decrease(t.nodes()[0],0);for(var l=!1;r.size()>0;){if(s=r.removeMin(),t_.has(i,s))n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(s).forEach(o)}return n}});var s_=S((r1e,r_)=>{"use strict";r_.exports={components:NI(),dijkstra:PS(),dijkstraAll:qI(),findCycles:UI(),floydWarshall:$I(),isAcyclic:GI(),postorder:ZI(),preorder:e_(),prim:i_(),tarjan:zS(),topsort:HS()}});var a_=S((s1e,l_)=>{"use strict";var o_=EI();l_.exports={Graph:o_.Graph,json:MI(),alg:s_(),version:o_.version}});var Rse={};A_(Rse,{CnDCore:()=>m_,CndLayoutStateManager:()=>Hs,DataAPI:()=>ja,ErrorAPI:()=>Nr,InstanceStateManager:()=>Lr,getCurrentCNDSpecFromReact:()=>Mse,getCurrentInstanceFromReact:()=>Dse,globalErrorManager:()=>Xn,mountCndLayoutInterface:()=>YS,mountErrorMessageModal:()=>KS,mountEvaluatorRepl:()=>GS,mountRelationHighlighter:()=>QS,unmountCndLayoutInterface:()=>og});var Je=X(Tt()),Uf=X(IC());var bf=X(Tt());var qC="#000000";function cs(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function W(t){return t==null?"":String(t)}function _C(t){return Array.isArray(t)?t.map(e=>W(e)).filter(e=>e.length>0):t==null||t===""?[]:[W(t)]}function K0(t){return t==null||t===""}function G0(t,e,n="error"){return{severity:n,message:e,fieldKey:t,source:"structure"}}var PC=["above","below","left","right","directlyAbove","directlyBelow","directlyLeft","directlyRight"],zC=["clockwise","counterclockwise"],HC=["horizontal","vertical"],Q0=["solid","dashed","dotted"],g7=["full","badge"],y7=["small","normal","large"],tu=[{key:"size",kind:"enum",options:y7,label:"Size"},{key:"color",kind:"color",label:"Color"}],b7=["none","togroup","fromgroup"];function BC(t){return t&&typeof t=="object"&&(t=t.points),t===!0||t==="togroup"?"togroup":t==="fromgroup"?"fromgroup":"none"}var v7=["hideDisconnected","hideDisconnectedBuiltIns"],x7={kind:"constraint",type:"orientation",label:"Orientation",description:"Specify the relative positioning of elements.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary",placeholder:"e.g. parent",help:"Binary selector; orientation applies from the source end to the target end of each tuple."},{key:"directions",kind:"enum",label:"Directions",required:!0,multiple:!0,options:PC,help:"Where the target sits relative to the source."}],summary(t){let e=_C(t.directions),n=W(t.selector),i=e.length>0?e.join(", "):"no directions";return n?`target ${i} of source \xB7 ${n}`:`target ${i} of source`},validate(t){let e=[],n=_C(t.directions),i=r=>n.includes(r);return i("above")&&i("below")&&e.push(G0("directions","Cannot be both above and below.")),i("left")&&i("right")&&e.push(G0("directions","Cannot be both left and right.")),e}},S7={kind:"constraint",type:"cyclic",label:"Cyclic",description:"Arrange elements along the perimeter of a circle.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"direction",kind:"enum",label:"Direction",options:zC,default:"clockwise"}],summary(t){let e=W(t.direction)||"clockwise",n=W(t.selector);return n?`${e} \xB7 ${n}`:e}},w7={kind:"constraint",type:"align",label:"Align",description:"Ensure elements are aligned horizontally or vertically.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"direction",kind:"enum",label:"Direction",required:!0,options:HC,default:"horizontal"}],summary(t){let e=W(t.direction)||"horizontal",n=W(t.selector);return n?`${e} \xB7 ${n}`:e}},k7={kind:"constraint",type:"groupselector",label:"Group (by selector)",description:"Group elements based on a selector.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"name",kind:"text",label:"Group name",placeholder:"e.g. cluster"},{key:"showLabel",kind:"boolean",label:"Show label",default:!0},{key:"addEdge",kind:"enum",label:"Add edge",options:b7,default:"none",help:'Draw an edge between the group key and the group: "togroup" points key \u2192 group, "fromgroup" points group \u2192 key, "none" draws nothing. (To style that connector, author addEdge as a block \u2014 { points, lineStyle, textStyle } \u2014 in YAML.)'},{key:"textStyle",kind:"group",label:"Label text style",children:[{key:"color",kind:"color",label:"Color"}]}],summary(t){let e=W(t.selector),n=W(t.name),i=n?`group "${n}"`:"group";return e?`${i} \xB7 ${e}`:i},toYamlNode(t){let e={selector:W(t.selector)};K0(t.name)||(e.name=W(t.name));let n=BC(t.addEdge);if(typeof t.showLabel=="boolean"&&(e.showLabel=t.showLabel),n!=="none"&&(e.addEdge=n),cs(t.textStyle)){let i={};for(let[r,s]of Object.entries(t.textStyle))s!=null&&s!==""&&(i[r]=s);Object.keys(i).length>0&&(e.textStyle=i)}return t.hold!==void 0&&(e.hold=t.hold),cs(t.source)&&(e.source={...t.source}),{group:e}},fromYamlNode(t){if(!cs(t))return null;let e=t.group;if(!cs(e)||e.field!==void 0)return null;let n={selector:W(e.selector),addEdge:BC(e.addEdge)};return e.name!==void 0&&(n.name=W(e.name)),typeof e.showLabel=="boolean"&&(n.showLabel=e.showLabel),cs(e.textStyle)&&(n.textStyle={...e.textStyle}),e.hold!==void 0&&(n.hold=e.hold),cs(e.source)&&(n.source={...e.source}),n}},A7={kind:"constraint",type:"size",label:"Size",description:"Set the width and height of elements matching the selector.",alsoAcceptedIn:["directive"],fields:[{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"width",kind:"number",label:"Width",required:!0,default:100},{key:"height",kind:"number",label:"Height",required:!0,default:60}],summary(t){let e=K0(t.width)?"?":W(t.width),n=K0(t.height)?"?":W(t.height),i=W(t.selector);return i?`${e}\xD7${n} \xB7 ${i}`:`${e}\xD7${n}`},validate(t){let e=[];for(let n of["width","height"]){let i=t[n];typeof i=="number"&&(Number.isNaN(i)||i<=0)&&e.push(G0(n,`${n} must be greater than 0.`))}return e}},C7={kind:"constraint",type:"hideAtom",label:"Hide atom",description:"Hide elements matching the selector from the visualization.",alsoAcceptedIn:["directive"],fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"unary"}],summary(t){let e=W(t.selector);return e?`hide \xB7 ${e}`:"hide"}},O7={kind:"directive",type:"flag",label:"Flag",description:"Toggle a built-in rendering flag, e.g. hideDisconnectedBuiltIns.",fields:[{key:"flag",kind:"enum",options:v7,label:"Flag",required:!0,default:"hideDisconnected",help:"hideDisconnected hides disconnected atoms; hideDisconnectedBuiltIns hides only disconnected built-in atoms."}],summary(t){return W(t.flag)||"(no flag)"},toYamlNode(t){return{flag:W(t.flag)}},fromYamlNode(t){if(!cs(t))return null;let e=t.flag;return typeof e=="string"?{flag:e}:cs(e)&&typeof e.flag=="string"?{flag:e.flag}:null}},T7={kind:"directive",type:"attribute",label:"Attribute",description:"Render a field as an inline attribute on its source atom.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary",help:"Optional n-ary selector \u2014 apply only to matching (source, target) tuples."},{key:"textStyle",kind:"group",label:"Text style",children:tu}],summary(t){let e=W(t.field),n=W(t.selector),i=e||"(no field)";return n?`${i} \xB7 ${n}`:i}},E7={kind:"directive",type:"hideField",label:"Hide field",description:"Hide a relation/field from the visualization.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary",help:"Optional n-ary selector \u2014 hide only matching (source, target) tuples."}],summary(t){let e=W(t.field),n=W(t.selector),i=e?`hide ${e}`:"hide field";return n?`${i} \xB7 ${n}`:i}},D7={kind:"directive",type:"icon",label:"Icon",description:"Deprecated \u2014 use Atom style (atomStyle) with an 'iconStyle' block. Still parsed/rendered for back-compat (showLabels splits into showLabel + iconStyle.placement).",deprecated:!0,deprecatedInFavorOf:"atomStyle",fields:[{key:"path",kind:"text",label:"Path / URL",required:!0,placeholder:"e.g. https://\u2026 or assets/foo.svg"},{key:"showLabels",kind:"boolean",label:"Show labels",default:!1},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=W(t.path),n=W(t.selector),i=e||"(no path)";return n?`${i} \xB7 ${n}`:i}},M7={kind:"directive",type:"atomColor",label:"Atom color",description:"Deprecated \u2014 use Atom style (atomStyle). Still parsed/rendered for back-compat (value \u2192 border color).",deprecated:!0,deprecatedInFavorOf:"atomStyle",fields:[{key:"value",kind:"color",label:"Color",required:!0,default:qC},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=W(t.value),n=W(t.selector),i=e||"(no color)";return n?`${i} \xB7 ${n}`:i}},UC=[{key:"color",kind:"color",label:"Color"},{key:"pattern",kind:"enum",options:Q0,label:"Pattern"},{key:"weight",kind:"number",label:"Weight"},{key:"highlight",kind:"color",label:"Highlight"}],R7=[{key:"color",kind:"color",label:"Color"}],N7=[{key:"color",kind:"color",label:"Color"},{key:"width",kind:"number",label:"Width"}],L7=[{key:"path",kind:"iconPath",label:"Icon",placeholder:"e.g. person, bi:person-fill, https://\u2026"},{key:"placement",kind:"enum",options:g7,label:"Placement"},{key:"opacity",kind:"number",label:"Opacity",help:"0\u20131. Fade a full-bleed icon to use it as a watermark behind the label."}],I7={kind:"directive",type:"edgeStyle",label:"Edge style",description:"Style the edges of a field/relation \u2014 line and label.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary"},{key:"lineStyle",kind:"group",label:"Line style",children:UC},{key:"textStyle",kind:"group",label:"Text style",children:tu},{key:"showLabel",kind:"boolean",label:"Show label"},{key:"hidden",kind:"boolean",label:"Hidden"}],summary(t){let e=W(t.field),n=t.lineStyle??{},i=W(n.color),r=e?i?`${e}: ${i}`:e:i||"edge",s=W(t.selector);return s?`${r} \xB7 ${s}`:r}},_7={kind:"directive",type:"atomStyle",label:"Atom style",description:"Style matching atoms \u2014 fill, border, icon, and label.",fields:[{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"fillStyle",kind:"group",label:"Fill style",children:R7},{key:"borderStyle",kind:"group",label:"Border style",children:N7},{key:"iconStyle",kind:"group",label:"Icon style",children:L7},{key:"textStyle",kind:"group",label:"Text style",children:tu},{key:"showLabel",kind:"boolean",label:"Show label"}],summary(t){let e=t.fillStyle??{},n=t.borderStyle??{},i=W(e.color)||W(n.color),r=W(t.selector),s=i||"atom";return r?`${s} \xB7 ${r}`:s}},B7={kind:"directive",type:"edgeColor",label:"Edge color",description:"Deprecated \u2014 use Edge style (edgeStyle). Still parsed/rendered for back-compat.",deprecated:!0,deprecatedInFavorOf:"edgeStyle",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"value",kind:"color",label:"Color",required:!0,default:qC},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"style",kind:"enum",label:"Style",options:Q0},{key:"weight",kind:"number",label:"Weight"}],summary(t){let e=W(t.field),n=W(t.value),i=e?`${e}: ${n||"edge"}`:n||"edge",r=W(t.selector);return r?`${i} \xB7 ${r}`:i}},q7={kind:"directive",type:"inferredEdge",label:"Inferred edge",description:"Draw an inferred edge from a selector \u2014 line and label.",fields:[{key:"name",kind:"text",label:"Name",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"binary"},{key:"draw",kind:"text",label:"Draw",help:"Endpoint interpretation: '<end> -> <end>', each end '_' (the atom itself) or a group constraint name (attach to that group's hull \u2014 a keyed group picks by the end's atom; a unary group is a single group and attaches directly). E.g. 'regions -> regions' or '_ -> regions'."},{key:"lineStyle",kind:"group",label:"Line style",children:UC},{key:"textStyle",kind:"group",label:"Text style",children:tu}],summary(t){let e=W(t.name),n=W(t.selector),i=t.lineStyle??{},r=W(i.color),s=e||"(no name)",o=r?`${s}: ${r}`:s;return n?`${o} \xB7 ${n}`:o}},P7={kind:"directive",type:"tag",label:"Tag",description:"Add computed attributes to nodes based on selector evaluation.",fields:[{key:"toTag",kind:"selector",label:"To tag (selector)",required:!0,selectorArity:"unary",help:"Selects which atoms get the tag."},{key:"name",kind:"text",label:"Name",required:!0,help:"The attribute name to display."},{key:"value",kind:"selector",label:"Value (selector)",required:!0,help:"Selector whose result becomes the attribute value."},{key:"textStyle",kind:"group",label:"Text style",children:tu}],summary(t){let e=W(t.name),n=W(t.toTag),i=e||"(no name)";return n?`${i} \xB7 ${n}`:i}},X0=[x7,S7,w7,k7,A7,C7,O7,T7,E7,D7,_7,M7,I7,B7,q7,P7],W0=new Map(X0.map(t=>[t.type,t])),z7={groupselector:"group"};function H7(t){return z7[t]??t}var Z0=(()=>{let t=new Map;for(let e of X0){let n=H7(e.type),i=t.get(n);i?i.push(e):t.set(n,[e])}return t})();function J0(t){return Z0.get(t)??[]}function bh(t){return Z0.has(t)}function vh(t){let e=[];for(let[n,i]of Z0)(!t||i.some(r=>r.kind===t))&&e.push(n);return e}function Ut(t){return W0.get(t)}function eb(t){return W0.has(t)}function tb(t,e={}){let n=e.includeDeprecated??!1;return X0.filter(i=>i.kind===t&&(n||!i.deprecated))}function nb(t){let e=W0.get(t);if(!e)return{};let n={};for(let i of e.fields)i.default!==void 0&&(n[i.key]=i.default);return n}function iO(t){return typeof t>"u"||t===null}function U7(t){return typeof t=="object"&&t!==null}function F7(t){return Array.isArray(t)?t:iO(t)?[]:[t]}function $7(t,e){var n,i,r,s;if(e)for(s=Object.keys(e),n=0,i=s.length;n<i;n+=1)r=s[n],t[r]=e[r];return t}function V7(t,e){var n="",i;for(i=0;i<e;i+=1)n+=t;return n}function j7(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var Y7=iO,K7=U7,G7=F7,Q7=V7,X7=j7,W7=$7,at={isNothing:Y7,isObject:K7,toArray:G7,repeat:Q7,isNegativeZero:X7,extend:W7};function rO(t,e){var n="",i=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(n+=`
|
|
8
|
+
`+n.stack}}function Nn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function hA(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function pB(t){var e=hA(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Md(t){t._valueTracker||(t._valueTracker=pB(t))}function pA(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=hA(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function Rd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var mB=/[\n"\\]/g;function _n(t){return t.replace(mB,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function hy(t,e,n,i,r,s,o,l){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Nn(e)):t.value!==""+Nn(e)&&(t.value=""+Nn(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?py(t,o,Nn(e)):n!=null?py(t,o,Nn(n)):i!=null&&t.removeAttribute("value"),r==null&&s!=null&&(t.defaultChecked=!!s),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?t.name=""+Nn(l):t.removeAttribute("name")}function mA(t,e,n,i,r,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null))return;n=n!=null?""+Nn(n):"",e=e!=null?""+Nn(e):n,l||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=l?t.checked:!!i,t.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o)}function py(t,e,n){e==="number"&&Rd(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function bl(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+Nn(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function gA(t,e,n){if(e!=null&&(e=""+Nn(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+Nn(n):""}function yA(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(E(92));if(ac(i)){if(1<i.length)throw Error(E(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=Nn(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i)}function Tl(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var gB=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 qw(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||gB.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function bA(t,e,n){if(e!=null&&typeof e!="object")throw Error(E(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&qw(t,r,i)}else for(var s in e)e.hasOwnProperty(s)&&qw(t,s,e[s])}function s0(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yB=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"]]),bB=/^[\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 pd(t){return bB.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var my=null;function o0(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var al=null,vl=null;function Pw(t){var e=ql(t);if(e&&(t=e.stateNode)){var n=t[en]||null;e:switch(t=e.stateNode,e.type){case"input":if(hy(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+_n(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[en]||null;if(!r)throw Error(E(90));hy(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&pA(i)}break e;case"textarea":gA(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&bl(t,!!n.multiple,e,!1)}}}var Ng=!1;function vA(t,e,n){if(Ng)return t(e,n);Ng=!0;try{var i=t(e);return i}finally{if(Ng=!1,(al!==null||vl!==null)&&(dh(),al&&(e=al,t=vl,vl=al=null,Pw(e),t)))for(e=0;e<t.length;e++)Pw(t[e])}}function Oc(t,e){var n=t.stateNode;if(n===null)return null;var i=n[en]||null;if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(E(231,e,typeof n));return n}var dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gy=!1;if(dr)try{Jo={},Object.defineProperty(Jo,"passive",{get:function(){gy=!0}}),window.addEventListener("test",Jo,Jo),window.removeEventListener("test",Jo,Jo)}catch{gy=!1}var Jo,Kr=null,l0=null,md=null;function xA(){if(md)return md;var t,e=l0,n=e.length,i,r="value"in Kr?Kr.value:Kr.textContent,s=r.length;for(t=0;t<n&&e[t]===r[t];t++);var o=n-t;for(i=1;i<=o&&e[n-i]===r[s-i];i++);return md=r.slice(t,1<i?1-i:void 0)}function gd(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function ed(){return!0}function zw(){return!1}function tn(t){function e(n,i,r,s,o){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?ed:zw,this.isPropagationStopped=zw,this}return Ne(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ed)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ed)},persist:function(){},isPersistent:ed}),e}var ro={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ih=tn(ro),Vc=Ne({},ro,{view:0,detail:0}),vB=tn(Vc),Lg,Ig,ec,rh=Ne({},Vc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:a0,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ec&&(ec&&t.type==="mousemove"?(Lg=t.screenX-ec.screenX,Ig=t.screenY-ec.screenY):Ig=Lg=0,ec=t),Lg)},movementY:function(t){return"movementY"in t?t.movementY:Ig}}),Hw=tn(rh),xB=Ne({},rh,{dataTransfer:0}),SB=tn(xB),wB=Ne({},Vc,{relatedTarget:0}),_g=tn(wB),kB=Ne({},ro,{animationName:0,elapsedTime:0,pseudoElement:0}),AB=tn(kB),CB=Ne({},ro,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),OB=tn(CB),TB=Ne({},ro,{data:0}),Uw=tn(TB),EB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},DB={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"},MB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RB(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=MB[t])?!!e[t]:!1}function a0(){return RB}var NB=Ne({},Vc,{key:function(t){if(t.key){var e=EB[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=gd(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?DB[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:a0,charCode:function(t){return t.type==="keypress"?gd(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?gd(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),LB=tn(NB),IB=Ne({},rh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fw=tn(IB),_B=Ne({},Vc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:a0}),BB=tn(_B),qB=Ne({},ro,{propertyName:0,elapsedTime:0,pseudoElement:0}),PB=tn(qB),zB=Ne({},rh,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),HB=tn(zB),UB=Ne({},ro,{newState:0,oldState:0}),FB=tn(UB),$B=[9,13,27,32],c0=dr&&"CompositionEvent"in window,fc=null;dr&&"documentMode"in document&&(fc=document.documentMode);var VB=dr&&"TextEvent"in window&&!fc,SA=dr&&(!c0||fc&&8<fc&&11>=fc),$w=" ",Vw=!1;function wA(t,e){switch(t){case"keyup":return $B.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kA(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var cl=!1;function jB(t,e){switch(t){case"compositionend":return kA(e);case"keypress":return e.which!==32?null:(Vw=!0,$w);case"textInput":return t=e.data,t===$w&&Vw?null:t;default:return null}}function YB(t,e){if(cl)return t==="compositionend"||!c0&&wA(t,e)?(t=xA(),md=l0=Kr=null,cl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return SA&&e.locale!=="ko"?null:e.data;default:return null}}var KB={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 jw(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!KB[t.type]:e==="textarea"}function AA(t,e,n,i){al?vl?vl.push(i):vl=[i]:al=i,e=Qd(e,"onChange"),0<e.length&&(n=new ih("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var dc=null,Tc=null;function GB(t){gC(t,0)}function sh(t){var e=cc(t);if(pA(e))return t}function Yw(t,e){if(t==="change")return e}var CA=!1;dr&&(dr?(nd="oninput"in document,nd||(Bg=document.createElement("div"),Bg.setAttribute("oninput","return;"),nd=typeof Bg.oninput=="function"),td=nd):td=!1,CA=td&&(!document.documentMode||9<document.documentMode));var td,nd,Bg;function Kw(){dc&&(dc.detachEvent("onpropertychange",OA),Tc=dc=null)}function OA(t){if(t.propertyName==="value"&&sh(Tc)){var e=[];AA(e,Tc,t,o0(t)),vA(GB,e)}}function QB(t,e,n){t==="focusin"?(Kw(),dc=e,Tc=n,dc.attachEvent("onpropertychange",OA)):t==="focusout"&&Kw()}function XB(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return sh(Tc)}function WB(t,e){if(t==="click")return sh(e)}function ZB(t,e){if(t==="input"||t==="change")return sh(e)}function JB(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var xn=typeof Object.is=="function"?Object.is:JB;function Ec(t,e){if(xn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!fy.call(e,r)||!xn(t[r],e[r]))return!1}return!0}function Gw(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Qw(t,e){var n=Gw(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Gw(n)}}function TA(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?TA(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function EA(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Rd(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Rd(t.document)}return e}function u0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var e9=dr&&"documentMode"in document&&11>=document.documentMode,ul=null,yy=null,hc=null,by=!1;function Xw(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;by||ul==null||ul!==Rd(i)||(i=ul,"selectionStart"in i&&u0(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),hc&&Ec(hc,i)||(hc=i,i=Qd(yy,"onSelect"),0<i.length&&(e=new ih("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=ul)))}function Fs(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var fl={animationend:Fs("Animation","AnimationEnd"),animationiteration:Fs("Animation","AnimationIteration"),animationstart:Fs("Animation","AnimationStart"),transitionrun:Fs("Transition","TransitionRun"),transitionstart:Fs("Transition","TransitionStart"),transitioncancel:Fs("Transition","TransitionCancel"),transitionend:Fs("Transition","TransitionEnd")},qg={},DA={};dr&&(DA=document.createElement("div").style,"AnimationEvent"in window||(delete fl.animationend.animation,delete fl.animationiteration.animation,delete fl.animationstart.animation),"TransitionEvent"in window||delete fl.transitionend.transition);function so(t){if(qg[t])return qg[t];if(!fl[t])return t;var e=fl[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in DA)return qg[t]=e[n];return t}var MA=so("animationend"),RA=so("animationiteration"),NA=so("animationstart"),t9=so("transitionrun"),n9=so("transitionstart"),i9=so("transitioncancel"),LA=so("transitionend"),IA=new Map,vy="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(" ");vy.push("scrollEnd");function ni(t,e){IA.set(t,e),io(e,[t])}var Ww=new WeakMap;function Bn(t,e){if(typeof t=="object"&&t!==null){var n=Ww.get(t);return n!==void 0?n:(e={value:t,source:e,stack:Bw(e)},Ww.set(t,e),e)}return{value:t,source:e,stack:Bw(e)}}var Rn=[],dl=0,f0=0;function oh(){for(var t=dl,e=f0=dl=0;e<t;){var n=Rn[e];Rn[e++]=null;var i=Rn[e];Rn[e++]=null;var r=Rn[e];Rn[e++]=null;var s=Rn[e];if(Rn[e++]=null,i!==null&&r!==null){var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r}s!==0&&_A(n,r,s)}}function lh(t,e,n,i){Rn[dl++]=t,Rn[dl++]=e,Rn[dl++]=n,Rn[dl++]=i,f0|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function d0(t,e,n,i){return lh(t,e,n,i),Nd(t)}function Pl(t,e){return lh(t,null,null,e),Nd(t)}function _A(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,s=t.return;s!==null;)s.childLanes|=n,i=s.alternate,i!==null&&(i.childLanes|=n),s.tag===22&&(t=s.stateNode,t===null||t._visibility&1||(r=!0)),t=s,s=s.return;return t.tag===3?(s=t.stateNode,r&&e!==null&&(r=31-yn(n),t=s.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),s):null}function Nd(t){if(50<kc)throw kc=0,Hy=null,Error(E(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var hl={};function r9(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(t,e,n,i){return new r9(t,e,n,i)}function h0(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ur(t,e){var n=t.alternate;return n===null?(n=mn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&65011712,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n.refCleanup=t.refCleanup,n}function BA(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function yd(t,e,n,i,r,s){var o=0;if(i=t,typeof t=="function")h0(t)&&(o=1);else if(typeof t=="string")o=r7(t,n,Ti.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ly:return t=mn(31,n,e,r),t.elementType=ly,t.lanes=s,t;case sl:return Ks(n.children,r,s,e);case tA:o=8,r|=24;break;case ry:return t=mn(12,n,e,r|2),t.elementType=ry,t.lanes=s,t;case sy:return t=mn(13,n,e,r),t.elementType=sy,t.lanes=s,t;case oy:return t=mn(19,n,e,r),t.elementType=oy,t.lanes=s,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case G_:case sr:o=10;break e;case nA:o=9;break e;case Jy:o=11;break e;case e0:o=14;break e;case Hr:o=16,i=null;break e}o=29,n=Error(E(130,t===null?"null":typeof t,"")),i=null}return e=mn(o,n,e,r),e.elementType=t,e.type=i,e.lanes=s,e}function Ks(t,e,n,i){return t=mn(7,t,i,e),t.lanes=n,t}function Pg(t,e,n){return t=mn(6,t,null,e),t.lanes=n,t}function zg(t,e,n){return e=mn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var pl=[],ml=0,Ld=null,Id=0,Ln=[],In=0,Gs=null,or=1,lr="";function Vs(t,e){pl[ml++]=Id,pl[ml++]=Ld,Ld=t,Id=e}function qA(t,e,n){Ln[In++]=or,Ln[In++]=lr,Ln[In++]=Gs,Gs=t;var i=or;t=lr;var r=32-yn(i)-1;i&=~(1<<r),n+=1;var s=32-yn(e)+r;if(30<s){var o=r-r%5;s=(i&(1<<o)-1).toString(32),i>>=o,r-=o,or=1<<32-yn(e)+r|n<<r|i,lr=s+t}else or=1<<s|n<<r|i,lr=t}function p0(t){t.return!==null&&(Vs(t,1),qA(t,1,0))}function m0(t){for(;t===Ld;)Ld=pl[--ml],pl[ml]=null,Id=pl[--ml],pl[ml]=null;for(;t===Gs;)Gs=Ln[--In],Ln[In]=null,lr=Ln[--In],Ln[In]=null,or=Ln[--In],Ln[In]=null}var Ut=null,je=null,ge=!1,Qs=null,Ci=!1,xy=Error(E(519));function Js(t){var e=Error(E(418,""));throw Dc(Bn(e,t)),xy}function Zw(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[Mt]=t,e[en]=i,n){case"dialog":se("cancel",e),se("close",e);break;case"iframe":case"object":case"embed":se("load",e);break;case"video":case"audio":for(n=0;n<Nc.length;n++)se(Nc[n],e);break;case"source":se("error",e);break;case"img":case"image":case"link":se("error",e),se("load",e);break;case"details":se("toggle",e);break;case"input":se("invalid",e),mA(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),Md(e);break;case"select":se("invalid",e);break;case"textarea":se("invalid",e),yA(e,i.value,i.defaultValue,i.children),Md(e)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||bC(e.textContent,n)?(i.popover!=null&&(se("beforetoggle",e),se("toggle",e)),i.onScroll!=null&&se("scroll",e),i.onScrollEnd!=null&&se("scrollend",e),i.onClick!=null&&(e.onclick=mh),e=!0):e=!1,e||Js(t)}function Jw(t){for(Ut=t.return;Ut;)switch(Ut.tag){case 5:case 13:Ci=!1;return;case 27:case 3:Ci=!0;return;default:Ut=Ut.return}}function tc(t){if(t!==Ut)return!1;if(!ge)return Jw(t),ge=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Yy(t.type,t.memoizedProps)),n=!n),n&&je&&Js(t),Jw(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(E(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8)if(n=t.data,n==="/$"){if(e===0){je=ti(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++;t=t.nextSibling}je=null}}else e===27?(e=je,as(t.type)?(t=Qy,Qy=null,je=t):je=e):je=Ut?ti(t.stateNode.nextSibling):null;return!0}function jc(){je=Ut=null,ge=!1}function ek(){var t=Qs;return t!==null&&(Jt===null?Jt=t:Jt.push.apply(Jt,t),Qs=null),t}function Dc(t){Qs===null?Qs=[t]:Qs.push(t)}var Sy=Mi(null),oo=null,ar=null;function Fr(t,e,n){ze(Sy,e._currentValue),e._currentValue=n}function fr(t){t._currentValue=Sy.current,mt(Sy)}function wy(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function ky(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var s=r.dependencies;if(s!==null){var o=r.child;s=s.firstContext;e:for(;s!==null;){var l=s;s=r;for(var a=0;a<e.length;a++)if(l.context===e[a]){s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),wy(s.return,n,t),i||(o=null);break e}s=l.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(E(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),wy(o,n,t),o=null}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function Yc(t,e,n,i){t=null;for(var r=e,s=!1;r!==null;){if(!s){if((r.flags&524288)!==0)s=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(E(387));if(o=o.memoizedProps,o!==null){var l=r.type;xn(r.pendingProps.value,o.value)||(t!==null?t.push(l):t=[l])}}else if(r===Od.current){if(o=r.alternate,o===null)throw Error(E(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(_c):t=[_c])}r=r.return}t!==null&&ky(e,t,n,i),e.flags|=262144}function _d(t){for(t=t.firstContext;t!==null;){if(!xn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function eo(t){oo=t,ar=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Rt(t){return PA(oo,t)}function id(t,e){return oo===null&&eo(t),PA(t,e)}function PA(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},ar===null){if(t===null)throw Error(E(308));ar=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else ar=ar.next=e;return n}var s9=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},o9=lt.unstable_scheduleCallback,l9=lt.unstable_NormalPriority,st={$$typeof:sr,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function g0(){return{controller:new s9,data:new Map,refCount:0}}function Kc(t){t.refCount--,t.refCount===0&&o9(l9,function(){t.controller.abort()})}var pc=null,Ay=0,El=0,xl=null;function a9(t,e){if(pc===null){var n=pc=[];Ay=0,El=z0(),xl={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Ay++,e.then(tk,tk),e}function tk(){if(--Ay===0&&pc!==null){xl!==null&&(xl.status="fulfilled");var t=pc;pc=null,El=0,xl=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function c9(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var nk=Y.S;Y.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&a9(t,e),nk!==null&&nk(t,e)};var Xs=Mi(null);function y0(){var t=Xs.current;return t!==null?t:Ee.pooledCache}function bd(t,e){e===null?ze(Xs,Xs.current):ze(Xs,e.pool)}function zA(){var t=y0();return t===null?null:{parent:st._currentValue,pool:t}}var Gc=Error(E(460)),HA=Error(E(474)),ah=Error(E(542)),Cy={then:function(){}};function ik(t){return t=t.status,t==="fulfilled"||t==="rejected"}function rd(){}function UA(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(rd,rd),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,sk(t),t;default:if(typeof e.status=="string")e.then(rd,rd);else{if(t=Ee,t!==null&&100<t.shellSuspendCounter)throw Error(E(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,sk(t),t}throw mc=e,Gc}}var mc=null;function rk(){if(mc===null)throw Error(E(459));var t=mc;return mc=null,t}function sk(t){if(t===Gc||t===ah)throw Error(E(483))}var Ur=!1;function b0(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Oy(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Wr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Zr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(xe&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=Nd(t),_A(t,null,n),e}return lh(t,i,e,n),Nd(t)}function gc(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,cA(t,n)}}function Hg(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=e:s=s.next=e}else r=s=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var Ty=!1;function yc(){if(Ty){var t=xl;if(t!==null)throw t}}function bc(t,e,n,i){Ty=!1;var r=t.updateQueue;Ur=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var a=l,c=a.next;a.next=null,o===null?s=c:o.next=c,o=a;var u=t.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(s!==null){var f=r.baseState;o=0,u=c=a=null,l=s;do{var d=l.lane&-536870913,h=d!==l.lane;if(h?(de&d)===d:(i&d)===d){d!==0&&d===El&&(Ty=!0),u!==null&&(u=u.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=t,g=l;d=e;var b=n;switch(g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(b,f,d);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,d=typeof m=="function"?m.call(b,f,d):m,d==null)break e;f=Ne({},f,d);break e;case 2:Ur=!0}}d=l.callback,d!==null&&(t.flags|=64,h&&(t.flags|=8192),h=r.callbacks,h===null?r.callbacks=[d]:h.push(d))}else h={lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=h,a=f):u=u.next=h,o|=d;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;h=l,l=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(!0);u===null&&(a=f),r.baseState=a,r.firstBaseUpdate=c,r.lastBaseUpdate=u,s===null&&(r.shared.lanes=0),os|=o,t.lanes=o,t.memoizedState=f}}function FA(t,e){if(typeof t!="function")throw Error(E(191,t));t.call(e)}function $A(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)FA(n[t],e)}var Dl=Mi(null),Bd=Mi(0);function ok(t,e){t=mr,ze(Bd,t),ze(Dl,e),mr=t|e.baseLanes}function Ey(){ze(Bd,mr),ze(Dl,Dl.current)}function v0(){mr=Bd.current,mt(Dl),mt(Bd)}var rs=0,J=null,ke=null,tt=null,qd=!1,Sl=!1,to=!1,Pd=0,Mc=0,wl=null,u9=0;function Xe(){throw Error(E(321))}function x0(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!xn(t[n],e[n]))return!1;return!0}function S0(t,e,n,i,r,s){return rs=s,J=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Y.H=t===null||t.memoizedState===null?x2:S2,to=!1,s=n(i,r),to=!1,Sl&&(s=jA(e,n,i,r)),VA(t),s}function VA(t){Y.H=zd;var e=ke!==null&&ke.next!==null;if(rs=0,tt=ke=J=null,qd=!1,Mc=0,wl=null,e)throw Error(E(300));t===null||pt||(t=t.dependencies,t!==null&&_d(t)&&(pt=!0))}function jA(t,e,n,i){J=t;var r=0;do{if(Sl&&(wl=null),Mc=0,Sl=!1,25<=r)throw Error(E(301));if(r+=1,tt=ke=null,t.updateQueue!=null){var s=t.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}Y.H=y9,s=e(n,i)}while(Sl);return s}function f9(){var t=Y.H,e=t.useState()[0];return e=typeof e.then=="function"?Qc(e):e,t=t.useState()[0],(ke!==null?ke.memoizedState:null)!==t&&(J.flags|=1024),e}function w0(){var t=Pd!==0;return Pd=0,t}function k0(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function A0(t){if(qd){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}qd=!1}rs=0,tt=ke=J=null,Sl=!1,Mc=Pd=0,wl=null}function Wt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?J.memoizedState=tt=t:tt=tt.next=t,tt}function nt(){if(ke===null){var t=J.alternate;t=t!==null?t.memoizedState:null}else t=ke.next;var e=tt===null?J.memoizedState:tt.next;if(e!==null)tt=e,ke=t;else{if(t===null)throw J.alternate===null?Error(E(467)):Error(E(310));ke=t,t={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},tt===null?J.memoizedState=tt=t:tt=tt.next=t}return tt}function C0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qc(t){var e=Mc;return Mc+=1,wl===null&&(wl=[]),t=UA(wl,t,e),e=J,(tt===null?e.memoizedState:tt.next)===null&&(e=e.alternate,Y.H=e===null||e.memoizedState===null?x2:S2),t}function ch(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Qc(t);if(t.$$typeof===sr)return Rt(t)}throw Error(E(438,String(t)))}function O0(t){var e=null,n=J.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=J.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=C0(),J.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=Q_;return e.index++,n}function hr(t,e){return typeof e=="function"?e(t):e}function vd(t){var e=nt();return T0(e,ke,t)}function T0(t,e,n){var i=t.queue;if(i===null)throw Error(E(311));i.lastRenderedReducer=n;var r=t.baseQueue,s=i.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}e.baseQueue=r=s,i.pending=null}if(s=t.baseState,r===null)t.memoizedState=s;else{e=r.next;var l=o=null,a=null,c=e,u=!1;do{var f=c.lane&-536870913;if(f!==c.lane?(de&f)===f:(rs&f)===f){var d=c.revertLane;if(d===0)a!==null&&(a=a.next={lane:0,revertLane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===El&&(u=!0);else if((rs&d)===d){c=c.next,d===El&&(u=!0);continue}else f={lane:0,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},a===null?(l=a=f,o=s):a=a.next=f,J.lanes|=d,os|=d;f=c.action,to&&n(s,f),s=c.hasEagerState?c.eagerState:n(s,f)}else d={lane:f,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},a===null?(l=a=d,o=s):a=a.next=d,J.lanes|=f,os|=f;c=c.next}while(c!==null&&c!==e);if(a===null?o=s:a.next=l,!xn(s,t.memoizedState)&&(pt=!0,u&&(n=xl,n!==null)))throw n;t.memoizedState=s,t.baseState=o,t.baseQueue=a,i.lastRenderedState=s}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Ug(t){var e=nt(),n=e.queue;if(n===null)throw Error(E(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do s=t(s,o.action),o=o.next;while(o!==r);xn(s,e.memoizedState)||(pt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function YA(t,e,n){var i=J,r=nt(),s=ge;if(s){if(n===void 0)throw Error(E(407));n=n()}else n=e();var o=!xn((ke||r).memoizedState,n);o&&(r.memoizedState=n,pt=!0),r=r.queue;var l=QA.bind(null,i,r,t);if(Xc(2048,8,l,[t]),r.getSnapshot!==e||o||tt!==null&&tt.memoizedState.tag&1){if(i.flags|=2048,Ml(9,uh(),GA.bind(null,i,r,n,e),null),Ee===null)throw Error(E(349));s||(rs&124)!==0||KA(i,e,n)}return n}function KA(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=J.updateQueue,e===null?(e=C0(),J.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function GA(t,e,n,i){e.value=n,e.getSnapshot=i,XA(e)&&WA(t)}function QA(t,e,n){return n(function(){XA(e)&&WA(t)})}function XA(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!xn(t,n)}catch{return!0}}function WA(t){var e=Pl(t,2);e!==null&&vn(e,t,2)}function Dy(t){var e=Wt();if(typeof t=="function"){var n=t;if(t=n(),to){Yr(!0);try{n()}finally{Yr(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:t},e}function ZA(t,e,n,i){return t.baseState=n,T0(t,ke,typeof i=="function"?i:hr)}function d9(t,e,n,i,r){if(fh(t))throw Error(E(485));if(t=e.action,t!==null){var s={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){s.listeners.push(o)}};Y.T!==null?n(!0):s.isTransition=!1,i(s),n=e.pending,n===null?(s.next=e.pending=s,JA(e,s)):(s.next=n.next,e.pending=n.next=s)}}function JA(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var s=Y.T,o={};Y.T=o;try{var l=n(r,i),a=Y.S;a!==null&&a(o,l),lk(t,e,l)}catch(c){My(t,e,c)}finally{Y.T=s}}else try{s=n(r,i),lk(t,e,s)}catch(c){My(t,e,c)}}function lk(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){ak(t,e,i)},function(i){return My(t,e,i)}):ak(t,e,n)}function ak(t,e,n){e.status="fulfilled",e.value=n,e2(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,JA(t,n)))}function My(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,e2(e),e=e.next;while(e!==i)}t.action=null}function e2(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function t2(t,e){return e}function ck(t,e){if(ge){var n=Ee.formState;if(n!==null){e:{var i=J;if(ge){if(je){t:{for(var r=je,s=Ci;r.nodeType!==8;){if(!s){r=null;break t}if(r=ti(r.nextSibling),r===null){r=null;break t}}s=r.data,r=s==="F!"||s==="F"?r:null}if(r){je=ti(r.nextSibling),i=r.data==="F!";break e}}Js(i)}i=!1}i&&(e=n[0])}}return n=Wt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t2,lastRenderedState:e},n.queue=i,n=y2.bind(null,J,i),i.dispatch=n,i=Dy(!1),s=R0.bind(null,J,!1,i.queue),i=Wt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=d9.bind(null,J,r,s,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function uk(t){var e=nt();return n2(e,ke,t)}function n2(t,e,n){if(e=T0(t,e,t2)[0],t=vd(hr)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Qc(e)}catch(o){throw o===Gc?ah:o}else i=e;e=nt();var r=e.queue,s=r.dispatch;return n!==e.memoizedState&&(J.flags|=2048,Ml(9,uh(),h9.bind(null,r,n),null)),[i,s,t]}function h9(t,e){t.action=e}function fk(t){var e=nt(),n=ke;if(n!==null)return n2(e,n,t);nt(),e=e.memoizedState,n=nt();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function Ml(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=J.updateQueue,e===null&&(e=C0(),J.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function uh(){return{destroy:void 0,resource:void 0}}function i2(){return nt().memoizedState}function xd(t,e,n,i){var r=Wt();i=i===void 0?null:i,J.flags|=t,r.memoizedState=Ml(1|e,uh(),n,i)}function Xc(t,e,n,i){var r=nt();i=i===void 0?null:i;var s=r.memoizedState.inst;ke!==null&&i!==null&&x0(i,ke.memoizedState.deps)?r.memoizedState=Ml(e,s,n,i):(J.flags|=t,r.memoizedState=Ml(1|e,s,n,i))}function dk(t,e){xd(8390656,8,t,e)}function r2(t,e){Xc(2048,8,t,e)}function s2(t,e){return Xc(4,2,t,e)}function o2(t,e){return Xc(4,4,t,e)}function l2(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function a2(t,e,n){n=n!=null?n.concat([t]):null,Xc(4,4,l2.bind(null,e,t),n)}function E0(){}function c2(t,e){var n=nt();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&x0(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function u2(t,e){var n=nt();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&x0(e,i[1]))return i[0];if(i=t(),to){Yr(!0);try{t()}finally{Yr(!1)}}return n.memoizedState=[i,e],i}function D0(t,e,n){return n===void 0||(rs&1073741824)!==0?t.memoizedState=e:(t.memoizedState=n,t=eC(),J.lanes|=t,os|=t,n)}function f2(t,e,n,i){return xn(n,e)?n:Dl.current!==null?(t=D0(t,n,i),xn(t,e)||(pt=!0),t):(rs&42)===0?(pt=!0,t.memoizedState=n):(t=eC(),J.lanes|=t,os|=t,e)}function d2(t,e,n,i,r){var s=ye.p;ye.p=s!==0&&8>s?s:8;var o=Y.T,l={};Y.T=l,R0(t,!1,e,n);try{var a=r(),c=Y.S;if(c!==null&&c(l,a),a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=c9(a,i);vc(t,e,u,bn(t))}else vc(t,e,i,bn(t))}catch(f){vc(t,e,{then:function(){},status:"rejected",reason:f},bn())}finally{ye.p=s,Y.T=o}}function p9(){}function Ry(t,e,n,i){if(t.tag!==5)throw Error(E(476));var r=h2(t).queue;d2(t,r,e,Ys,n===null?p9:function(){return p2(t),n(i)})}function h2(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Ys,baseState:Ys,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:Ys},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function p2(t){var e=h2(t).next.queue;vc(t,e,{},bn())}function M0(){return Rt(_c)}function m2(){return nt().memoizedState}function g2(){return nt().memoizedState}function m9(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=bn();t=Wr(n);var i=Zr(e,t,n);i!==null&&(vn(i,e,n),gc(i,e,n)),e={cache:g0()},t.payload=e;return}e=e.return}}function g9(t,e,n){var i=bn();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},fh(t)?b2(e,n):(n=d0(t,e,n,i),n!==null&&(vn(n,t,i),v2(n,e,i)))}function y2(t,e,n){var i=bn();vc(t,e,n,i)}function vc(t,e,n,i){var r={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(fh(t))b2(e,r);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,xn(l,o))return lh(t,e,r,0),Ee===null&&oh(),!1}catch{}if(n=d0(t,e,r,i),n!==null)return vn(n,t,i),v2(n,e,i),!0}return!1}function R0(t,e,n,i){if(i={lane:2,revertLane:z0(),action:i,hasEagerState:!1,eagerState:null,next:null},fh(t)){if(e)throw Error(E(479))}else e=d0(t,n,i,2),e!==null&&vn(e,t,2)}function fh(t){var e=t.alternate;return t===J||e!==null&&e===J}function b2(t,e){Sl=qd=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function v2(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,cA(t,n)}}var zd={readContext:Rt,use:ch,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useLayoutEffect:Xe,useInsertionEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useSyncExternalStore:Xe,useId:Xe,useHostTransitionStatus:Xe,useFormState:Xe,useActionState:Xe,useOptimistic:Xe,useMemoCache:Xe,useCacheRefresh:Xe},x2={readContext:Rt,use:ch,useCallback:function(t,e){return Wt().memoizedState=[t,e===void 0?null:e],t},useContext:Rt,useEffect:dk,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,xd(4194308,4,l2.bind(null,e,t),n)},useLayoutEffect:function(t,e){return xd(4194308,4,t,e)},useInsertionEffect:function(t,e){xd(4,2,t,e)},useMemo:function(t,e){var n=Wt();e=e===void 0?null:e;var i=t();if(to){Yr(!0);try{t()}finally{Yr(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Wt();if(n!==void 0){var r=n(e);if(to){Yr(!0);try{n(e)}finally{Yr(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=g9.bind(null,J,t),[i.memoizedState,t]},useRef:function(t){var e=Wt();return t={current:t},e.memoizedState=t},useState:function(t){t=Dy(t);var e=t.queue,n=y2.bind(null,J,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:E0,useDeferredValue:function(t,e){var n=Wt();return D0(n,t,e)},useTransition:function(){var t=Dy(!1);return t=d2.bind(null,J,t.queue,!0,!1),Wt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=J,r=Wt();if(ge){if(n===void 0)throw Error(E(407));n=n()}else{if(n=e(),Ee===null)throw Error(E(349));(de&124)!==0||KA(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,dk(QA.bind(null,i,s,t),[t]),i.flags|=2048,Ml(9,uh(),GA.bind(null,i,s,n,e),null),n},useId:function(){var t=Wt(),e=Ee.identifierPrefix;if(ge){var n=lr,i=or;n=(i&~(1<<32-yn(i)-1)).toString(32)+n,e="\xAB"+e+"R"+n,n=Pd++,0<n&&(e+="H"+n.toString(32)),e+="\xBB"}else n=u9++,e="\xAB"+e+"r"+n.toString(32)+"\xBB";return t.memoizedState=e},useHostTransitionStatus:M0,useFormState:ck,useActionState:ck,useOptimistic:function(t){var e=Wt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=R0.bind(null,J,!0,n),n.dispatch=e,[t,e]},useMemoCache:O0,useCacheRefresh:function(){return Wt().memoizedState=m9.bind(null,J)}},S2={readContext:Rt,use:ch,useCallback:c2,useContext:Rt,useEffect:r2,useImperativeHandle:a2,useInsertionEffect:s2,useLayoutEffect:o2,useMemo:u2,useReducer:vd,useRef:i2,useState:function(){return vd(hr)},useDebugValue:E0,useDeferredValue:function(t,e){var n=nt();return f2(n,ke.memoizedState,t,e)},useTransition:function(){var t=vd(hr)[0],e=nt().memoizedState;return[typeof t=="boolean"?t:Qc(t),e]},useSyncExternalStore:YA,useId:m2,useHostTransitionStatus:M0,useFormState:uk,useActionState:uk,useOptimistic:function(t,e){var n=nt();return ZA(n,ke,t,e)},useMemoCache:O0,useCacheRefresh:g2},y9={readContext:Rt,use:ch,useCallback:c2,useContext:Rt,useEffect:r2,useImperativeHandle:a2,useInsertionEffect:s2,useLayoutEffect:o2,useMemo:u2,useReducer:Ug,useRef:i2,useState:function(){return Ug(hr)},useDebugValue:E0,useDeferredValue:function(t,e){var n=nt();return ke===null?D0(n,t,e):f2(n,ke.memoizedState,t,e)},useTransition:function(){var t=Ug(hr)[0],e=nt().memoizedState;return[typeof t=="boolean"?t:Qc(t),e]},useSyncExternalStore:YA,useId:m2,useHostTransitionStatus:M0,useFormState:fk,useActionState:fk,useOptimistic:function(t,e){var n=nt();return ke!==null?ZA(n,ke,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:O0,useCacheRefresh:g2},kl=null,Rc=0;function sd(t){var e=Rc;return Rc+=1,kl===null&&(kl=[]),UA(kl,t,e)}function nc(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function od(t,e){throw e.$$typeof===K_?Error(E(525)):(t=Object.prototype.toString.call(e),Error(E(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function hk(t){var e=t._init;return e(t._payload)}function w2(t){function e(p,y){if(t){var v=p.deletions;v===null?(p.deletions=[y],p.flags|=16):v.push(y)}}function n(p,y){if(!t)return null;for(;y!==null;)e(p,y),y=y.sibling;return null}function i(p){for(var y=new Map;p!==null;)p.key!==null?y.set(p.key,p):y.set(p.index,p),p=p.sibling;return y}function r(p,y){return p=ur(p,y),p.index=0,p.sibling=null,p}function s(p,y,v){return p.index=v,t?(v=p.alternate,v!==null?(v=v.index,v<y?(p.flags|=67108866,y):v):(p.flags|=67108866,y)):(p.flags|=1048576,y)}function o(p){return t&&p.alternate===null&&(p.flags|=67108866),p}function l(p,y,v,x){return y===null||y.tag!==6?(y=Pg(v,p.mode,x),y.return=p,y):(y=r(y,v),y.return=p,y)}function a(p,y,v,x){var k=v.type;return k===sl?u(p,y,v.props.children,x,v.key):y!==null&&(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Hr&&hk(k)===y.type)?(y=r(y,v.props),nc(y,v),y.return=p,y):(y=yd(v.type,v.key,v.props,null,p.mode,x),nc(y,v),y.return=p,y)}function c(p,y,v,x){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=zg(v,p.mode,x),y.return=p,y):(y=r(y,v.children||[]),y.return=p,y)}function u(p,y,v,x,k){return y===null||y.tag!==7?(y=Ks(v,p.mode,x,k),y.return=p,y):(y=r(y,v),y.return=p,y)}function f(p,y,v){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=Pg(""+y,p.mode,v),y.return=p,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Xf:return v=yd(y.type,y.key,y.props,null,p.mode,v),nc(v,y),v.return=p,v;case lc:return y=zg(y,p.mode,v),y.return=p,y;case Hr:var x=y._init;return y=x(y._payload),f(p,y,v)}if(ac(y)||Ja(y))return y=Ks(y,p.mode,v,null),y.return=p,y;if(typeof y.then=="function")return f(p,sd(y),v);if(y.$$typeof===sr)return f(p,id(p,y),v);od(p,y)}return null}function d(p,y,v,x){var k=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return k!==null?null:l(p,y,""+v,x);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Xf:return v.key===k?a(p,y,v,x):null;case lc:return v.key===k?c(p,y,v,x):null;case Hr:return k=v._init,v=k(v._payload),d(p,y,v,x)}if(ac(v)||Ja(v))return k!==null?null:u(p,y,v,x,null);if(typeof v.then=="function")return d(p,y,sd(v),x);if(v.$$typeof===sr)return d(p,y,id(p,v),x);od(p,v)}return null}function h(p,y,v,x,k){if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return p=p.get(v)||null,l(y,p,""+x,k);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Xf:return p=p.get(x.key===null?v:x.key)||null,a(y,p,x,k);case lc:return p=p.get(x.key===null?v:x.key)||null,c(y,p,x,k);case Hr:var C=x._init;return x=C(x._payload),h(p,y,v,x,k)}if(ac(x)||Ja(x))return p=p.get(v)||null,u(y,p,x,k,null);if(typeof x.then=="function")return h(p,y,v,sd(x),k);if(x.$$typeof===sr)return h(p,y,v,id(y,x),k);od(y,x)}return null}function m(p,y,v,x){for(var k=null,C=null,w=y,A=y=0,O=null;w!==null&&A<v.length;A++){w.index>A?(O=w,w=null):O=w.sibling;var D=d(p,w,v[A],x);if(D===null){w===null&&(w=O);break}t&&w&&D.alternate===null&&e(p,w),y=s(D,y,A),C===null?k=D:C.sibling=D,C=D,w=O}if(A===v.length)return n(p,w),ge&&Vs(p,A),k;if(w===null){for(;A<v.length;A++)w=f(p,v[A],x),w!==null&&(y=s(w,y,A),C===null?k=w:C.sibling=w,C=w);return ge&&Vs(p,A),k}for(w=i(w);A<v.length;A++)O=h(w,p,A,v[A],x),O!==null&&(t&&O.alternate!==null&&w.delete(O.key===null?A:O.key),y=s(O,y,A),C===null?k=O:C.sibling=O,C=O);return t&&w.forEach(function(I){return e(p,I)}),ge&&Vs(p,A),k}function g(p,y,v,x){if(v==null)throw Error(E(151));for(var k=null,C=null,w=y,A=y=0,O=null,D=v.next();w!==null&&!D.done;A++,D=v.next()){w.index>A?(O=w,w=null):O=w.sibling;var I=d(p,w,D.value,x);if(I===null){w===null&&(w=O);break}t&&w&&I.alternate===null&&e(p,w),y=s(I,y,A),C===null?k=I:C.sibling=I,C=I,w=O}if(D.done)return n(p,w),ge&&Vs(p,A),k;if(w===null){for(;!D.done;A++,D=v.next())D=f(p,D.value,x),D!==null&&(y=s(D,y,A),C===null?k=D:C.sibling=D,C=D);return ge&&Vs(p,A),k}for(w=i(w);!D.done;A++,D=v.next())D=h(w,p,A,D.value,x),D!==null&&(t&&D.alternate!==null&&w.delete(D.key===null?A:D.key),y=s(D,y,A),C===null?k=D:C.sibling=D,C=D);return t&&w.forEach(function(M){return e(p,M)}),ge&&Vs(p,A),k}function b(p,y,v,x){if(typeof v=="object"&&v!==null&&v.type===sl&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Xf:e:{for(var k=v.key;y!==null;){if(y.key===k){if(k=v.type,k===sl){if(y.tag===7){n(p,y.sibling),x=r(y,v.props.children),x.return=p,p=x;break e}}else if(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Hr&&hk(k)===y.type){n(p,y.sibling),x=r(y,v.props),nc(x,v),x.return=p,p=x;break e}n(p,y);break}else e(p,y);y=y.sibling}v.type===sl?(x=Ks(v.props.children,p.mode,x,v.key),x.return=p,p=x):(x=yd(v.type,v.key,v.props,null,p.mode,x),nc(x,v),x.return=p,p=x)}return o(p);case lc:e:{for(k=v.key;y!==null;){if(y.key===k)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(p,y.sibling),x=r(y,v.children||[]),x.return=p,p=x;break e}else{n(p,y);break}else e(p,y);y=y.sibling}x=zg(v,p.mode,x),x.return=p,p=x}return o(p);case Hr:return k=v._init,v=k(v._payload),b(p,y,v,x)}if(ac(v))return m(p,y,v,x);if(Ja(v)){if(k=Ja(v),typeof k!="function")throw Error(E(150));return v=k.call(v),g(p,y,v,x)}if(typeof v.then=="function")return b(p,y,sd(v),x);if(v.$$typeof===sr)return b(p,y,id(p,v),x);od(p,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,y!==null&&y.tag===6?(n(p,y.sibling),x=r(y,v),x.return=p,p=x):(n(p,y),x=Pg(v,p.mode,x),x.return=p,p=x),o(p)):n(p,y)}return function(p,y,v,x){try{Rc=0;var k=b(p,y,v,x);return kl=null,k}catch(w){if(w===Gc||w===ah)throw w;var C=mn(29,w,null,p.mode);return C.lanes=x,C.return=p,C}}}var Rl=w2(!0),k2=w2(!1),Pn=Mi(null),Di=null;function $r(t){var e=t.alternate;ze(ot,ot.current&1),ze(Pn,t),Di===null&&(e===null||Dl.current!==null||e.memoizedState!==null)&&(Di=t)}function A2(t){if(t.tag===22){if(ze(ot,ot.current),ze(Pn,t),Di===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(Di=t)}}else Vr(t)}function Vr(){ze(ot,ot.current),ze(Pn,Pn.current)}function cr(t){mt(Pn),Di===t&&(Di=null),mt(ot)}var ot=Mi(0);function Hd(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||Gy(n)))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function Fg(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:Ne({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Ny={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=bn(),r=Wr(i);r.payload=e,n!=null&&(r.callback=n),e=Zr(t,r,i),e!==null&&(vn(e,t,i),gc(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=bn(),r=Wr(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Zr(t,r,i),e!==null&&(vn(e,t,i),gc(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=bn(),i=Wr(n);i.tag=2,e!=null&&(i.callback=e),e=Zr(t,i,n),e!==null&&(vn(e,t,n),gc(e,t,n))}};function pk(t,e,n,i,r,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,s,o):e.prototype&&e.prototype.isPureReactComponent?!Ec(n,i)||!Ec(r,s):!0}function mk(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&Ny.enqueueReplaceState(e,e.state,null)}function no(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=Ne({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}var Ud=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function C2(t){Ud(t)}function O2(t){console.error(t)}function T2(t){Ud(t)}function Fd(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function gk(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Ly(t,e,n){return n=Wr(n),n.tag=3,n.payload={element:null},n.callback=function(){Fd(t,e)},n}function E2(t){return t=Wr(t),t.tag=3,t}function D2(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var s=i.value;t.payload=function(){return r(s)},t.callback=function(){gk(e,n,i)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){gk(e,n,i),typeof r!="function"&&(Jr===null?Jr=new Set([this]):Jr.add(this));var l=i.stack;this.componentDidCatch(i.value,{componentStack:l!==null?l:""})})}function b9(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Yc(e,n,r,!0),n=Pn.current,n!==null){switch(n.tag){case 13:return Di===null?Uy():n.alternate===null&&Ye===0&&(Ye=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===Cy?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),Jg(t,i,r)),!1;case 22:return n.flags|=65536,i===Cy?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),Jg(t,i,r)),!1}throw Error(E(435,n.tag))}return Jg(t,i,r),Uy(),!1}if(ge)return e=Pn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==xy&&(t=Error(E(422),{cause:i}),Dc(Bn(t,n)))):(i!==xy&&(e=Error(E(423),{cause:i}),Dc(Bn(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=Bn(i,n),r=Ly(t.stateNode,i,r),Hg(t,r),Ye!==4&&(Ye=2)),!1;var s=Error(E(520),{cause:i});if(s=Bn(s,n),wc===null?wc=[s]:wc.push(s),Ye!==4&&(Ye=2),e===null)return!0;i=Bn(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=Ly(n.stateNode,i,t),Hg(n,t),!1;case 1:if(e=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Jr===null||!Jr.has(s))))return n.flags|=65536,r&=-r,n.lanes|=r,r=E2(r),D2(r,t,n,i),Hg(n,r),!1}n=n.return}while(n!==null);return!1}var M2=Error(E(461)),pt=!1;function xt(t,e,n,i){e.child=t===null?k2(e,null,n,i):Rl(e,t.child,n,i)}function yk(t,e,n,i,r){n=n.render;var s=e.ref;if("ref"in i){var o={};for(var l in i)l!=="ref"&&(o[l]=i[l])}else o=i;return eo(e),i=S0(t,e,n,o,s,r),l=w0(),t!==null&&!pt?(k0(t,e,r),pr(t,e,r)):(ge&&l&&p0(e),e.flags|=1,xt(t,e,i,r),e.child)}function bk(t,e,n,i,r){if(t===null){var s=n.type;return typeof s=="function"&&!h0(s)&&s.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=s,R2(t,e,s,i,r)):(t=yd(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!N0(t,r)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Ec,n(o,i)&&t.ref===e.ref)return pr(t,e,r)}return e.flags|=1,t=ur(s,i),t.ref=e.ref,t.return=e,e.child=t}function R2(t,e,n,i,r){if(t!==null){var s=t.memoizedProps;if(Ec(s,i)&&t.ref===e.ref)if(pt=!1,e.pendingProps=i=s,N0(t,r))(t.flags&131072)!==0&&(pt=!0);else return e.lanes=t.lanes,pr(t,e,r)}return Iy(t,e,n,i,r)}function N2(t,e,n){var i=e.pendingProps,r=i.children,s=t!==null?t.memoizedState:null;if(i.mode==="hidden"){if((e.flags&128)!==0){if(i=s!==null?s.baseLanes|n:n,t!==null){for(r=e.child=t.child,s=0;r!==null;)s=s|r.lanes|r.childLanes,r=r.sibling;e.childLanes=s&~i}else e.childLanes=0,e.child=null;return vk(t,e,i,n)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&bd(e,s!==null?s.cachePool:null),s!==null?ok(e,s):Ey(),A2(e);else return e.lanes=e.childLanes=536870912,vk(t,e,s!==null?s.baseLanes|n:n,n)}else s!==null?(bd(e,s.cachePool),ok(e,s),Vr(e),e.memoizedState=null):(t!==null&&bd(e,null),Ey(),Vr(e));return xt(t,e,r,n),e.child}function vk(t,e,n,i){var r=y0();return r=r===null?null:{parent:st._currentValue,pool:r},e.memoizedState={baseLanes:n,cachePool:r},t!==null&&bd(e,null),Ey(),A2(e),t!==null&&Yc(t,e,i,!0),null}function Sd(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(E(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function Iy(t,e,n,i,r){return eo(e),n=S0(t,e,n,i,void 0,r),i=w0(),t!==null&&!pt?(k0(t,e,r),pr(t,e,r)):(ge&&i&&p0(e),e.flags|=1,xt(t,e,n,r),e.child)}function xk(t,e,n,i,r,s){return eo(e),e.updateQueue=null,n=jA(e,i,n,r),VA(t),i=w0(),t!==null&&!pt?(k0(t,e,s),pr(t,e,s)):(ge&&i&&p0(e),e.flags|=1,xt(t,e,n,s),e.child)}function Sk(t,e,n,i,r){if(eo(e),e.stateNode===null){var s=hl,o=n.contextType;typeof o=="object"&&o!==null&&(s=Rt(o)),s=new n(i,s),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Ny,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=i,s.state=e.memoizedState,s.refs={},b0(e),o=n.contextType,s.context=typeof o=="object"&&o!==null?Rt(o):hl,s.state=e.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(Fg(e,n,o,i),s.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(o=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),o!==s.state&&Ny.enqueueReplaceState(s,s.state,null),bc(e,i,s,r),yc(),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){s=e.stateNode;var l=e.memoizedProps,a=no(n,l);s.props=a;var c=s.context,u=n.contextType;o=hl,typeof u=="object"&&u!==null&&(o=Rt(u));var f=n.getDerivedStateFromProps;u=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function",l=e.pendingProps!==l,u||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l||c!==o)&&mk(e,s,i,o),Ur=!1;var d=e.memoizedState;s.state=d,bc(e,i,s,r),yc(),c=e.memoizedState,l||d!==c||Ur?(typeof f=="function"&&(Fg(e,n,f,i),c=e.memoizedState),(a=Ur||pk(e,n,a,i,d,c,o))?(u||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),s.props=i,s.state=c,s.context=o,i=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{s=e.stateNode,Oy(t,e),o=e.memoizedProps,u=no(n,o),s.props=u,f=e.pendingProps,d=s.context,c=n.contextType,a=hl,typeof c=="object"&&c!==null&&(a=Rt(c)),l=n.getDerivedStateFromProps,(c=typeof l=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==f||d!==a)&&mk(e,s,i,a),Ur=!1,d=e.memoizedState,s.state=d,bc(e,i,s,r),yc();var h=e.memoizedState;o!==f||d!==h||Ur||t!==null&&t.dependencies!==null&&_d(t.dependencies)?(typeof l=="function"&&(Fg(e,n,l,i),h=e.memoizedState),(u=Ur||pk(e,n,u,i,d,h,a)||t!==null&&t.dependencies!==null&&_d(t.dependencies))?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(i,h,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(i,h,a)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=h),s.props=i,s.state=h,s.context=a,i=u):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),i=!1)}return s=i,Sd(t,e),i=(e.flags&128)!==0,s||i?(s=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:s.render(),e.flags|=1,t!==null&&i?(e.child=Rl(e,t.child,null,r),e.child=Rl(e,null,n,r)):xt(t,e,n,r),e.memoizedState=s.state,t=e.child):t=pr(t,e,r),t}function wk(t,e,n,i){return jc(),e.flags|=256,xt(t,e,n,i),e.child}var $g={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vg(t){return{baseLanes:t,cachePool:zA()}}function jg(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=qn),t}function L2(t,e,n){var i=e.pendingProps,r=!1,s=(e.flags&128)!==0,o;if((o=s)||(o=t!==null&&t.memoizedState===null?!1:(ot.current&2)!==0),o&&(r=!0,e.flags&=-129),o=(e.flags&32)!==0,e.flags&=-33,t===null){if(ge){if(r?$r(e):Vr(e),ge){var l=je,a;if(a=l){e:{for(a=l,l=Ci;a.nodeType!==8;){if(!l){l=null;break e}if(a=ti(a.nextSibling),a===null){l=null;break e}}l=a}l!==null?(e.memoizedState={dehydrated:l,treeContext:Gs!==null?{id:or,overflow:lr}:null,retryLane:536870912,hydrationErrors:null},a=mn(18,null,null,0),a.stateNode=l,a.return=e,e.child=a,Ut=e,je=null,a=!0):a=!1}a||Js(e)}if(l=e.memoizedState,l!==null&&(l=l.dehydrated,l!==null))return Gy(l)?e.lanes=32:e.lanes=536870912,null;cr(e)}return l=i.children,i=i.fallback,r?(Vr(e),r=e.mode,l=$d({mode:"hidden",children:l},r),i=Ks(i,r,n,null),l.return=e,i.return=e,l.sibling=i,e.child=l,r=e.child,r.memoizedState=Vg(n),r.childLanes=jg(t,o,n),e.memoizedState=$g,i):($r(e),_y(e,l))}if(a=t.memoizedState,a!==null&&(l=a.dehydrated,l!==null)){if(s)e.flags&256?($r(e),e.flags&=-257,e=Yg(t,e,n)):e.memoizedState!==null?(Vr(e),e.child=t.child,e.flags|=128,e=null):(Vr(e),r=i.fallback,l=e.mode,i=$d({mode:"visible",children:i.children},l),r=Ks(r,l,n,null),r.flags|=2,i.return=e,r.return=e,i.sibling=r,e.child=i,Rl(e,t.child,null,n),i=e.child,i.memoizedState=Vg(n),i.childLanes=jg(t,o,n),e.memoizedState=$g,e=r);else if($r(e),Gy(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var c=o.dgst;o=c,i=Error(E(419)),i.stack="",i.digest=o,Dc({value:i,source:null,stack:null}),e=Yg(t,e,n)}else if(pt||Yc(t,e,n,!1),o=(n&t.childLanes)!==0,pt||o){if(o=Ee,o!==null&&(i=n&-n,i=(i&42)!==0?1:n0(i),i=(i&(o.suspendedLanes|n))!==0?0:i,i!==0&&i!==a.retryLane))throw a.retryLane=i,Pl(t,i),vn(o,t,i),M2;l.data==="$?"||Uy(),e=Yg(t,e,n)}else l.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=a.treeContext,je=ti(l.nextSibling),Ut=e,ge=!0,Qs=null,Ci=!1,t!==null&&(Ln[In++]=or,Ln[In++]=lr,Ln[In++]=Gs,or=t.id,lr=t.overflow,Gs=e),e=_y(e,i.children),e.flags|=4096);return e}return r?(Vr(e),r=i.fallback,l=e.mode,a=t.child,c=a.sibling,i=ur(a,{mode:"hidden",children:i.children}),i.subtreeFlags=a.subtreeFlags&65011712,c!==null?r=ur(c,r):(r=Ks(r,l,n,null),r.flags|=2),r.return=e,i.return=e,i.sibling=r,e.child=i,i=r,r=e.child,l=t.child.memoizedState,l===null?l=Vg(n):(a=l.cachePool,a!==null?(c=st._currentValue,a=a.parent!==c?{parent:c,pool:c}:a):a=zA(),l={baseLanes:l.baseLanes|n,cachePool:a}),r.memoizedState=l,r.childLanes=jg(t,o,n),e.memoizedState=$g,i):($r(e),n=t.child,t=n.sibling,n=ur(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(o=e.deletions,o===null?(e.deletions=[t],e.flags|=16):o.push(t)),e.child=n,e.memoizedState=null,n)}function _y(t,e){return e=$d({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function $d(t,e){return t=mn(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Yg(t,e,n){return Rl(e,t.child,null,n),t=_y(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function kk(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),wy(t.return,e,n)}function Kg(t,e,n,i,r){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function I2(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(xt(t,e,i.children,n),i=ot.current,(i&2)!==0)i=i&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&kk(t,n,e);else if(t.tag===19)kk(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}switch(ze(ot,i),r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&Hd(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Kg(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&Hd(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Kg(e,!0,n,null,s);break;case"together":Kg(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function pr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),os|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Yc(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(E(153));if(e.child!==null){for(t=e.child,n=ur(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ur(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function N0(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&_d(t)))}function v9(t,e,n){switch(e.tag){case 3:Td(e,e.stateNode.containerInfo),Fr(e,st,t.memoizedState.cache),jc();break;case 27:case 5:uy(e);break;case 4:Td(e,e.stateNode.containerInfo);break;case 10:Fr(e,e.type,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?($r(e),e.flags|=128,null):(n&e.child.childLanes)!==0?L2(t,e,n):($r(e),t=pr(t,e,n),t!==null?t.sibling:null);$r(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Yc(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return I2(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),ze(ot,ot.current),i)break;return null;case 22:case 23:return e.lanes=0,N2(t,e,n);case 24:Fr(e,st,t.memoizedState.cache)}return pr(t,e,n)}function _2(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)pt=!0;else{if(!N0(t,n)&&(e.flags&128)===0)return pt=!1,v9(t,e,n);pt=(t.flags&131072)!==0}else pt=!1,ge&&(e.flags&1048576)!==0&&qA(e,Id,e.index);switch(e.lanes=0,e.tag){case 16:e:{t=e.pendingProps;var i=e.elementType,r=i._init;if(i=r(i._payload),e.type=i,typeof i=="function")h0(i)?(t=no(i,t),e.tag=1,e=Sk(null,e,i,t,n)):(e.tag=0,e=Iy(null,e,i,t,n));else{if(i!=null){if(r=i.$$typeof,r===Jy){e.tag=11,e=yk(null,e,i,t,n);break e}else if(r===e0){e.tag=14,e=bk(null,e,i,t,n);break e}}throw e=ay(i)||i,Error(E(306,e,""))}}return e;case 0:return Iy(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=no(i,e.pendingProps),Sk(t,e,i,r,n);case 3:e:{if(Td(e,e.stateNode.containerInfo),t===null)throw Error(E(387));i=e.pendingProps;var s=e.memoizedState;r=s.element,Oy(t,e),bc(e,i,null,n);var o=e.memoizedState;if(i=o.cache,Fr(e,st,i),i!==s.cache&&ky(e,[st],n,!0),yc(),i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){e=wk(t,e,i,n);break e}else if(i!==r){r=Bn(Error(E(424)),e),Dc(r),e=wk(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,je=ti(t.firstChild),Ut=e,ge=!0,Qs=null,Ci=!0,n=k2(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(jc(),i===r){e=pr(t,e,n);break e}xt(t,e,i,n)}e=e.child}return e;case 26:return Sd(t,e),t===null?(n=Fk(e.type,null,e.pendingProps,null))?e.memoizedState=n:ge||(n=e.type,t=e.pendingProps,i=Xd(Xr.current).createElement(n),i[Mt]=e,i[en]=t,wt(i,n,t),ht(i),e.stateNode=i):e.memoizedState=Fk(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return uy(e),t===null&&ge&&(i=e.stateNode=SC(e.type,e.pendingProps,Xr.current),Ut=e,Ci=!0,r=je,as(e.type)?(Qy=r,je=ti(i.firstChild)):je=r),xt(t,e,e.pendingProps.children,n),Sd(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&ge&&((r=i=je)&&(i=j9(i,e.type,e.pendingProps,Ci),i!==null?(e.stateNode=i,Ut=e,je=ti(i.firstChild),Ci=!1,r=!0):r=!1),r||Js(e)),uy(e),r=e.type,s=e.pendingProps,o=t!==null?t.memoizedProps:null,i=s.children,Yy(r,s)?i=null:o!==null&&Yy(r,o)&&(e.flags|=32),e.memoizedState!==null&&(r=S0(t,e,f9,null,null,n),_c._currentValue=r),Sd(t,e),xt(t,e,i,n),e.child;case 6:return t===null&&ge&&((t=n=je)&&(n=Y9(n,e.pendingProps,Ci),n!==null?(e.stateNode=n,Ut=e,je=null,t=!0):t=!1),t||Js(e)),null;case 13:return L2(t,e,n);case 4:return Td(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=Rl(e,null,i,n):xt(t,e,i,n),e.child;case 11:return yk(t,e,e.type,e.pendingProps,n);case 7:return xt(t,e,e.pendingProps,n),e.child;case 8:return xt(t,e,e.pendingProps.children,n),e.child;case 12:return xt(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,Fr(e,e.type,i.value),xt(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,eo(e),r=Rt(r),i=i(r),e.flags|=1,xt(t,e,i,n),e.child;case 14:return bk(t,e,e.type,e.pendingProps,n);case 15:return R2(t,e,e.type,e.pendingProps,n);case 19:return I2(t,e,n);case 31:return i=e.pendingProps,n=e.mode,i={mode:i.mode,children:i.children},t===null?(n=$d(i,n),n.ref=e.ref,e.child=n,n.return=e,e=n):(n=ur(t.child,i),n.ref=e.ref,e.child=n,n.return=e,e=n),e;case 22:return N2(t,e,n);case 24:return eo(e),i=Rt(st),t===null?(r=y0(),r===null&&(r=Ee,s=g0(),r.pooledCache=s,s.refCount++,s!==null&&(r.pooledCacheLanes|=n),r=s),e.memoizedState={parent:i,cache:r},b0(e),Fr(e,st,r)):((t.lanes&n)!==0&&(Oy(t,e),bc(e,null,null,n),yc()),r=t.memoizedState,s=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),Fr(e,st,i)):(i=s.cache,Fr(e,st,i),i!==r.cache&&ky(e,[st],n,!0))),xt(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(E(156,e.tag))}function nr(t){t.flags|=4}function Ak(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!AC(e)){if(e=Pn.current,e!==null&&((de&4194048)===de?Di!==null:(de&62914560)!==de&&(de&536870912)===0||e!==Di))throw mc=Cy,HA;t.flags|=8192}}function ld(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?lA():536870912,t.lanes|=e,Nl|=e)}function ic(t,e){if(!ge)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function $e(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function x9(t,e,n){var i=e.pendingProps;switch(m0(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(e),null;case 1:return $e(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),fr(st),Cl(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(tc(e)?nr(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,ek())),$e(e),null;case 26:return n=e.memoizedState,t===null?(nr(e),n!==null?($e(e),Ak(e,n)):($e(e),e.flags&=-16777217)):n?n!==t.memoizedState?(nr(e),$e(e),Ak(e,n)):($e(e),e.flags&=-16777217):(t.memoizedProps!==i&&nr(e),$e(e),e.flags&=-16777217),null;case 27:Ed(e),n=Xr.current;var r=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==i&&nr(e);else{if(!i){if(e.stateNode===null)throw Error(E(166));return $e(e),null}t=Ti.current,tc(e)?Zw(e,t):(t=SC(r,i,n),e.stateNode=t,nr(e))}return $e(e),null;case 5:if(Ed(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&nr(e);else{if(!i){if(e.stateNode===null)throw Error(E(166));return $e(e),null}if(t=Ti.current,tc(e))Zw(e,t);else{switch(r=Xd(Xr.current),t){case 1:t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":t=r.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof i.is=="string"?r.createElement("select",{is:i.is}):r.createElement("select"),i.multiple?t.multiple=!0:i.size&&(t.size=i.size);break;default:t=typeof i.is=="string"?r.createElement(n,{is:i.is}):r.createElement(n)}}t[Mt]=e,t[en]=i;e:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=t;e:switch(wt(t,n,i),n){case"button":case"input":case"select":case"textarea":t=!!i.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&nr(e)}}return $e(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&nr(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(E(166));if(t=Xr.current,tc(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=Ut,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[Mt]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||bC(t.nodeValue,n)),t||Js(e)}else t=Xd(t).createTextNode(i),t[Mt]=e,e.stateNode=t}return $e(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=tc(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(E(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(E(317));r[Mt]=e}else jc(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;$e(e),r=!1}else r=ek(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(cr(e),e):(cr(e),null)}if(cr(e),(e.flags&128)!==0)return e.lanes=n,e;if(n=i!==null,t=t!==null&&t.memoizedState!==null,n){i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool);var s=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)}return n!==t&&n&&(e.child.flags|=8192),ld(e,e.updateQueue),$e(e),null;case 4:return Cl(),t===null&&H0(e.stateNode.containerInfo),$e(e),null;case 10:return fr(e.type),$e(e),null;case 19:if(mt(ot),r=e.memoizedState,r===null)return $e(e),null;if(i=(e.flags&128)!==0,s=r.rendering,s===null)if(i)ic(r,!1);else{if(Ye!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=Hd(t),s!==null){for(e.flags|=128,ic(r,!1),t=s.updateQueue,e.updateQueue=t,ld(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)BA(n,t),n=n.sibling;return ze(ot,ot.current&1|2),e.child}t=t.sibling}r.tail!==null&&Ei()>jd&&(e.flags|=128,i=!0,ic(r,!1),e.lanes=4194304)}else{if(!i)if(t=Hd(s),t!==null){if(e.flags|=128,i=!0,t=t.updateQueue,e.updateQueue=t,ld(e,t),ic(r,!0),r.tail===null&&r.tailMode==="hidden"&&!s.alternate&&!ge)return $e(e),null}else 2*Ei()-r.renderingStartTime>jd&&n!==536870912&&(e.flags|=128,i=!0,ic(r,!1),e.lanes=4194304);r.isBackwards?(s.sibling=e.child,e.child=s):(t=r.last,t!==null?t.sibling=s:e.child=s,r.last=s)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ei(),e.sibling=null,t=ot.current,ze(ot,i?t&1|2:t&1),e):($e(e),null);case 22:case 23:return cr(e),v0(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&($e(e),e.subtreeFlags&6&&(e.flags|=8192)):$e(e),n=e.updateQueue,n!==null&&ld(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&mt(Xs),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),fr(st),$e(e),null;case 25:return null;case 30:return null}throw Error(E(156,e.tag))}function S9(t,e){switch(m0(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return fr(st),Cl(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Ed(e),null;case 13:if(cr(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(E(340));jc()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return mt(ot),null;case 4:return Cl(),null;case 10:return fr(e.type),null;case 22:case 23:return cr(e),v0(),t!==null&&mt(Xs),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return fr(st),null;case 25:return null;default:return null}}function B2(t,e){switch(m0(e),e.tag){case 3:fr(st),Cl();break;case 26:case 27:case 5:Ed(e);break;case 4:Cl();break;case 13:cr(e);break;case 19:mt(ot);break;case 10:fr(e.type);break;case 22:case 23:cr(e),v0(),t!==null&&mt(Xs);break;case 24:fr(st)}}function Wc(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var s=n.create,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){Ae(e,e.return,l)}}function ss(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&t)===t){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=e;var a=n,c=l;try{c()}catch(u){Ae(r,a,u)}}}i=i.next}while(i!==s)}}catch(u){Ae(e,e.return,u)}}function q2(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{$A(e,n)}catch(i){Ae(t,t.return,i)}}}function P2(t,e,n){n.props=no(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){Ae(t,e,i)}}function xc(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){Ae(t,e,r)}}function Oi(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Ae(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Ae(t,e,r)}else n.current=null}function z2(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){Ae(t,t.return,r)}}function Gg(t,e,n){try{var i=t.stateNode;H9(i,t.type,n,e),i[en]=e}catch(r){Ae(t,t.return,r)}}function H2(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&as(t.type)||t.tag===4}function Qg(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||H2(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&as(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function By(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=mh));else if(i!==4&&(i===27&&as(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(By(t,e,n),t=t.sibling;t!==null;)By(t,e,n),t=t.sibling}function Vd(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&as(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Vd(t,e,n),t=t.sibling;t!==null;)Vd(t,e,n),t=t.sibling}function U2(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);wt(e,i,n),e[Mt]=t,e[en]=n}catch(s){Ae(t,t.return,s)}}var rr=!1,We=!1,Xg=!1,Ck=typeof WeakSet=="function"?WeakSet:Set,dt=null;function w9(t,e){if(t=t.containerInfo,Vy=eh,t=EA(t),u0(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,c=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(a=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===n&&++c===r&&(l=o),d===s&&++u===i&&(a=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(jy={focusedElem:t,selectionRange:n},eh=!1,dt=e;dt!==null;)if(e=dt,t=e.child,(e.subtreeFlags&1024)!==0&&t!==null)t.return=e,dt=t;else for(;dt!==null;){switch(e=dt,s=e.alternate,t=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&s!==null){t=void 0,n=e,r=s.memoizedProps,s=s.memoizedState,i=n.stateNode;try{var m=no(n.type,r,n.elementType===n.type);t=i.getSnapshotBeforeUpdate(m,s),i.__reactInternalSnapshotBeforeUpdate=t}catch(g){Ae(n,n.return,g)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Ky(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ky(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(E(163))}if(t=e.sibling,t!==null){t.return=e.return,dt=t;break}dt=e.return}}function F2(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Pr(t,n),i&4&&Wc(5,n);break;case 1:if(Pr(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(o){Ae(n,n.return,o)}else{var r=no(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(o){Ae(n,n.return,o)}}i&64&&q2(n),i&512&&xc(n,n.return);break;case 3:if(Pr(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{$A(t,e)}catch(o){Ae(n,n.return,o)}}break;case 27:e===null&&i&4&&U2(n);case 26:case 5:Pr(t,n),e===null&&i&4&&z2(n),i&512&&xc(n,n.return);break;case 12:Pr(t,n);break;case 13:Pr(t,n),i&4&&j2(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=R9.bind(null,n),K9(t,n))));break;case 22:if(i=n.memoizedState!==null||rr,!i){e=e!==null&&e.memoizedState!==null||We,r=rr;var s=We;rr=i,(We=e)&&!s?zr(t,n,(n.subtreeFlags&8772)!==0):Pr(t,n),rr=r,We=s}break;case 30:break;default:Pr(t,n)}}function $2(t){var e=t.alternate;e!==null&&(t.alternate=null,$2(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&r0(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Pe=null,Zt=!1;function ir(t,e,n){for(n=n.child;n!==null;)V2(t,e,n),n=n.sibling}function V2(t,e,n){if(gn&&typeof gn.onCommitFiberUnmount=="function")try{gn.onCommitFiberUnmount(Hc,n)}catch{}switch(n.tag){case 26:We||Oi(n,e),ir(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:We||Oi(n,e);var i=Pe,r=Zt;as(n.type)&&(Pe=n.stateNode,Zt=!1),ir(t,e,n),Ac(n.stateNode),Pe=i,Zt=r;break;case 5:We||Oi(n,e);case 6:if(i=Pe,r=Zt,Pe=null,ir(t,e,n),Pe=i,Zt=r,Pe!==null)if(Zt)try{(Pe.nodeType===9?Pe.body:Pe.nodeName==="HTML"?Pe.ownerDocument.body:Pe).removeChild(n.stateNode)}catch(s){Ae(n,e,s)}else try{Pe.removeChild(n.stateNode)}catch(s){Ae(n,e,s)}break;case 18:Pe!==null&&(Zt?(t=Pe,zk(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Pc(t)):zk(Pe,n.stateNode));break;case 4:i=Pe,r=Zt,Pe=n.stateNode.containerInfo,Zt=!0,ir(t,e,n),Pe=i,Zt=r;break;case 0:case 11:case 14:case 15:We||ss(2,n,e),We||ss(4,n,e),ir(t,e,n);break;case 1:We||(Oi(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&P2(n,e,i)),ir(t,e,n);break;case 21:ir(t,e,n);break;case 22:We=(i=We)||n.memoizedState!==null,ir(t,e,n),We=i;break;default:ir(t,e,n)}}function j2(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Pc(t)}catch(n){Ae(e,e.return,n)}}function k9(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new Ck),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new Ck),e;default:throw Error(E(435,t.tag))}}function Wg(t,e){var n=k9(t);e.forEach(function(i){var r=N9.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}function dn(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],s=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(as(l.type)){Pe=l.stateNode,Zt=!1;break e}break;case 5:Pe=l.stateNode,Zt=!1;break e;case 3:case 4:Pe=l.stateNode.containerInfo,Zt=!0;break e}l=l.return}if(Pe===null)throw Error(E(160));V2(s,o,r),Pe=null,Zt=!1,s=r.alternate,s!==null&&(s.return=null),r.return=null}if(e.subtreeFlags&13878)for(e=e.child;e!==null;)Y2(e,t),e=e.sibling}var ei=null;function Y2(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:dn(e,t),hn(t),i&4&&(ss(3,t,t.return),Wc(3,t),ss(5,t,t.return));break;case 1:dn(e,t),hn(t),i&512&&(We||n===null||Oi(n,n.return)),i&64&&rr&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=ei;if(dn(e,t),hn(t),i&512&&(We||n===null||Oi(n,n.return)),i&4){var s=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":s=r.getElementsByTagName("title")[0],(!s||s[$c]||s[Mt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(i),r.head.insertBefore(s,r.querySelector("head > title"))),wt(s,i,n),s[Mt]=t,ht(s),i=s;break e;case"link":var o=Vk("link","href",r).get(i+(n.href||""));if(o){for(var l=0;l<o.length;l++)if(s=o[l],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(l,1);break t}}s=r.createElement(i),wt(s,i,n),r.head.appendChild(s);break;case"meta":if(o=Vk("meta","content",r).get(i+(n.content||""))){for(l=0;l<o.length;l++)if(s=o[l],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(l,1);break t}}s=r.createElement(i),wt(s,i,n),r.head.appendChild(s);break;default:throw Error(E(468,i))}s[Mt]=t,ht(s),i=s}t.stateNode=i}else jk(r,t.type,t.stateNode);else t.stateNode=$k(r,i,t.memoizedProps);else s!==i?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,i===null?jk(r,t.type,t.stateNode):$k(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&Gg(t,t.memoizedProps,n.memoizedProps)}break;case 27:dn(e,t),hn(t),i&512&&(We||n===null||Oi(n,n.return)),n!==null&&i&4&&Gg(t,t.memoizedProps,n.memoizedProps);break;case 5:if(dn(e,t),hn(t),i&512&&(We||n===null||Oi(n,n.return)),t.flags&32){r=t.stateNode;try{Tl(r,"")}catch(h){Ae(t,t.return,h)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,Gg(t,r,n!==null?n.memoizedProps:r)),i&1024&&(Xg=!0);break;case 6:if(dn(e,t),hn(t),i&4){if(t.stateNode===null)throw Error(E(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(h){Ae(t,t.return,h)}}break;case 3:if(Ad=null,r=ei,ei=Wd(e.containerInfo),dn(e,t),ei=r,hn(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Pc(e.containerInfo)}catch(h){Ae(t,t.return,h)}Xg&&(Xg=!1,K2(t));break;case 4:i=ei,ei=Wd(t.stateNode.containerInfo),dn(e,t),hn(t),ei=i;break;case 12:dn(e,t),hn(t);break;case 13:dn(e,t),hn(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(q0=Ei()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Wg(t,i)));break;case 22:r=t.memoizedState!==null;var a=n!==null&&n.memoizedState!==null,c=rr,u=We;if(rr=c||r,We=u||a,dn(e,t),We=u,rr=c,hn(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||a||rr||We||js(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){a=n=e;try{if(s=a.stateNode,r)o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=a.stateNode;var f=a.memoizedProps.style,d=f!=null&&f.hasOwnProperty("display")?f.display:null;l.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(h){Ae(a,a.return,h)}}}else if(e.tag===6){if(n===null){a=e;try{a.stateNode.nodeValue=r?"":a.memoizedProps}catch(h){Ae(a,a.return,h)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Wg(t,n))));break;case 19:dn(e,t),hn(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Wg(t,i)));break;case 30:break;case 21:break;default:dn(e,t),hn(t)}}function hn(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(H2(i)){n=i;break}i=i.return}if(n==null)throw Error(E(160));switch(n.tag){case 27:var r=n.stateNode,s=Qg(t);Vd(t,s,r);break;case 5:var o=n.stateNode;n.flags&32&&(Tl(o,""),n.flags&=-33);var l=Qg(t);Vd(t,l,o);break;case 3:case 4:var a=n.stateNode.containerInfo,c=Qg(t);By(t,c,a);break;default:throw Error(E(161))}}catch(u){Ae(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function K2(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;K2(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Pr(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)F2(t,e.alternate,e),e=e.sibling}function js(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:ss(4,e,e.return),js(e);break;case 1:Oi(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&P2(e,e.return,n),js(e);break;case 27:Ac(e.stateNode);case 26:case 5:Oi(e,e.return),js(e);break;case 22:e.memoizedState===null&&js(e);break;case 30:js(e);break;default:js(e)}t=t.sibling}}function zr(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,s=e,o=s.flags;switch(s.tag){case 0:case 11:case 15:zr(r,s,n),Wc(4,s);break;case 1:if(zr(r,s,n),i=s,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){Ae(i,i.return,c)}if(i=s,r=i.updateQueue,r!==null){var l=i.stateNode;try{var a=r.shared.hiddenCallbacks;if(a!==null)for(r.shared.hiddenCallbacks=null,r=0;r<a.length;r++)FA(a[r],l)}catch(c){Ae(i,i.return,c)}}n&&o&64&&q2(s),xc(s,s.return);break;case 27:U2(s);case 26:case 5:zr(r,s,n),n&&i===null&&o&4&&z2(s),xc(s,s.return);break;case 12:zr(r,s,n);break;case 13:zr(r,s,n),n&&o&4&&j2(r,s);break;case 22:s.memoizedState===null&&zr(r,s,n),xc(s,s.return);break;case 30:break;default:zr(r,s,n)}e=e.sibling}}function L0(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Kc(n))}function I0(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Kc(t))}function Ai(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)G2(t,e,n,i),e=e.sibling}function G2(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:Ai(t,e,n,i),r&2048&&Wc(9,e);break;case 1:Ai(t,e,n,i);break;case 3:Ai(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Kc(t)));break;case 12:if(r&2048){Ai(t,e,n,i),t=e.stateNode;try{var s=e.memoizedProps,o=s.id,l=s.onPostCommit;typeof l=="function"&&l(o,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(a){Ae(e,e.return,a)}}else Ai(t,e,n,i);break;case 13:Ai(t,e,n,i);break;case 23:break;case 22:s=e.stateNode,o=e.alternate,e.memoizedState!==null?s._visibility&2?Ai(t,e,n,i):Sc(t,e):s._visibility&2?Ai(t,e,n,i):(s._visibility|=2,il(t,e,n,i,(e.subtreeFlags&10256)!==0)),r&2048&&L0(o,e);break;case 24:Ai(t,e,n,i),r&2048&&I0(e.alternate,e);break;default:Ai(t,e,n,i)}}function il(t,e,n,i,r){for(r=r&&(e.subtreeFlags&10256)!==0,e=e.child;e!==null;){var s=t,o=e,l=n,a=i,c=o.flags;switch(o.tag){case 0:case 11:case 15:il(s,o,l,a,r),Wc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState!==null?u._visibility&2?il(s,o,l,a,r):Sc(s,o):(u._visibility|=2,il(s,o,l,a,r)),r&&c&2048&&L0(o.alternate,o);break;case 24:il(s,o,l,a,r),r&&c&2048&&I0(o.alternate,o);break;default:il(s,o,l,a,r)}e=e.sibling}}function Sc(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:Sc(n,i),r&2048&&L0(i.alternate,i);break;case 24:Sc(n,i),r&2048&&I0(i.alternate,i);break;default:Sc(n,i)}e=e.sibling}}var uc=8192;function el(t){if(t.subtreeFlags&uc)for(t=t.child;t!==null;)Q2(t),t=t.sibling}function Q2(t){switch(t.tag){case 26:el(t),t.flags&uc&&t.memoizedState!==null&&o7(ei,t.memoizedState,t.memoizedProps);break;case 5:el(t);break;case 3:case 4:var e=ei;ei=Wd(t.stateNode.containerInfo),el(t),ei=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=uc,uc=16777216,el(t),uc=e):el(t));break;default:el(t)}}function X2(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function rc(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];dt=i,Z2(i,t)}X2(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)W2(t),t=t.sibling}function W2(t){switch(t.tag){case 0:case 11:case 15:rc(t),t.flags&2048&&ss(9,t,t.return);break;case 3:rc(t);break;case 12:rc(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,wd(t)):rc(t);break;default:rc(t)}}function wd(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];dt=i,Z2(i,t)}X2(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:ss(8,e,e.return),wd(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,wd(e));break;default:wd(e)}t=t.sibling}}function Z2(t,e){for(;dt!==null;){var n=dt;switch(n.tag){case 0:case 11:case 15:ss(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Kc(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,dt=i;else e:for(n=t;dt!==null;){i=dt;var r=i.sibling,s=i.return;if($2(i),i===n){dt=null;break e}if(r!==null){r.return=s,dt=r;break e}dt=s}}}var A9={getCacheForType:function(t){var e=Rt(st),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n}},C9=typeof WeakMap=="function"?WeakMap:Map,xe=0,Ee=null,oe=null,de=0,ve=0,pn=null,Gr=!1,zl=!1,_0=!1,mr=0,Ye=0,os=0,Ws=0,B0=0,qn=0,Nl=0,wc=null,Jt=null,qy=!1,q0=0,jd=1/0,Yd=null,Jr=null,St=0,es=null,Ll=null,Al=0,Py=0,zy=null,J2=null,kc=0,Hy=null;function bn(){if((xe&2)!==0&&de!==0)return de&-de;if(Y.T!==null){var t=El;return t!==0?t:z0()}return uA()}function eC(){qn===0&&(qn=(de&536870912)===0||ge?oA():536870912);var t=Pn.current;return t!==null&&(t.flags|=32),qn}function vn(t,e,n){(t===Ee&&(ve===2||ve===9)||t.cancelPendingCommit!==null)&&(Il(t,0),Qr(t,de,qn,!1)),Fc(t,n),((xe&2)===0||t!==Ee)&&(t===Ee&&((xe&2)===0&&(Ws|=n),Ye===4&&Qr(t,de,qn,!1)),Ri(t))}function tC(t,e,n){if((xe&6)!==0)throw Error(E(327));var i=!n&&(e&124)===0&&(e&t.expiredLanes)===0||Uc(t,e),r=i?E9(t,e):Zg(t,e,!0),s=i;do{if(r===0){zl&&!i&&Qr(t,e,0,!1);break}else{if(n=t.current.alternate,s&&!O9(n)){r=Zg(t,e,!1),s=!1;continue}if(r===2){if(s=e,t.errorRecoveryDisabledLanes&s)var o=0;else o=t.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){e=o;e:{var l=t;r=wc;var a=l.current.memoizedState.isDehydrated;if(a&&(Il(l,o).flags|=256),o=Zg(l,o,!1),o!==2){if(_0&&!a){l.errorRecoveryDisabledLanes|=s,Ws|=s,r=4;break e}s=Jt,Jt=r,s!==null&&(Jt===null?Jt=s:Jt.push.apply(Jt,s))}r=o}if(s=!1,r!==2)continue}}if(r===1){Il(t,0),Qr(t,e,0,!0);break}e:{switch(i=t,s=r,s){case 0:case 1:throw Error(E(345));case 4:if((e&4194048)!==e)break;case 6:Qr(i,e,qn,!Gr);break e;case 2:Jt=null;break;case 3:case 5:break;default:throw Error(E(329))}if((e&62914560)===e&&(r=q0+300-Ei(),10<r)){if(Qr(i,e,qn,!Gr),nh(i,0,!0)!==0)break e;i.timeoutHandle=xC(Ok.bind(null,i,n,Jt,Yd,qy,e,qn,Ws,Nl,Gr,s,2,-0,0),r);break e}Ok(i,n,Jt,Yd,qy,e,qn,Ws,Nl,Gr,s,0,-0,0)}}break}while(!0);Ri(t)}function Ok(t,e,n,i,r,s,o,l,a,c,u,f,d,h){if(t.timeoutHandle=-1,f=e.subtreeFlags,(f&8192||(f&16785408)===16785408)&&(Ic={stylesheets:null,count:0,unsuspend:s7},Q2(e),f=l7(),f!==null)){t.cancelPendingCommit=f(Ek.bind(null,t,e,s,n,i,r,o,l,a,u,1,d,h)),Qr(t,s,o,!c);return}Ek(t,e,s,n,i,r,o,l,a)}function O9(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!xn(s(),r))return!1}catch{return!1}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Qr(t,e,n,i){e&=~B0,e&=~Ws,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var s=31-yn(r),o=1<<s;i[s]=-1,r&=~o}n!==0&&aA(t,n,e)}function dh(){return(xe&6)===0?(Zc(0,!1),!1):!0}function P0(){if(oe!==null){if(ve===0)var t=oe.return;else t=oe,ar=oo=null,A0(t),kl=null,Rc=0,t=oe;for(;t!==null;)B2(t.alternate,t),t=t.return;oe=null}}function Il(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,F9(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),P0(),Ee=t,oe=n=ur(t.current,null),de=e,ve=0,pn=null,Gr=!1,zl=Uc(t,e),_0=!1,Nl=qn=B0=Ws=os=Ye=0,Jt=wc=null,qy=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-yn(i),s=1<<r;e|=t[r],i&=~s}return mr=e,oh(),n}function nC(t,e){J=null,Y.H=zd,e===Gc||e===ah?(e=rk(),ve=3):e===HA?(e=rk(),ve=4):ve=e===M2?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,pn=e,oe===null&&(Ye=1,Fd(t,Bn(e,t.current)))}function iC(){var t=Y.H;return Y.H=zd,t===null?zd:t}function rC(){var t=Y.A;return Y.A=A9,t}function Uy(){Ye=4,Gr||(de&4194048)!==de&&Pn.current!==null||(zl=!0),(os&134217727)===0&&(Ws&134217727)===0||Ee===null||Qr(Ee,de,qn,!1)}function Zg(t,e,n){var i=xe;xe|=2;var r=iC(),s=rC();(Ee!==t||de!==e)&&(Yd=null,Il(t,e)),e=!1;var o=Ye;e:do try{if(ve!==0&&oe!==null){var l=oe,a=pn;switch(ve){case 8:P0(),o=6;break e;case 3:case 2:case 9:case 6:Pn.current===null&&(e=!0);var c=ve;if(ve=0,pn=null,gl(t,l,a,c),n&&zl){o=0;break e}break;default:c=ve,ve=0,pn=null,gl(t,l,a,c)}}T9(),o=Ye;break}catch(u){nC(t,u)}while(!0);return e&&t.shellSuspendCounter++,ar=oo=null,xe=i,Y.H=r,Y.A=s,oe===null&&(Ee=null,de=0,oh()),o}function T9(){for(;oe!==null;)sC(oe)}function E9(t,e){var n=xe;xe|=2;var i=iC(),r=rC();Ee!==t||de!==e?(Yd=null,jd=Ei()+500,Il(t,e)):zl=Uc(t,e);e:do try{if(ve!==0&&oe!==null){e=oe;var s=pn;t:switch(ve){case 1:ve=0,pn=null,gl(t,e,s,1);break;case 2:case 9:if(ik(s)){ve=0,pn=null,Tk(e);break}e=function(){ve!==2&&ve!==9||Ee!==t||(ve=7),Ri(t)},s.then(e,e);break e;case 3:ve=7;break e;case 4:ve=5;break e;case 7:ik(s)?(ve=0,pn=null,Tk(e)):(ve=0,pn=null,gl(t,e,s,7));break;case 5:var o=null;switch(oe.tag){case 26:o=oe.memoizedState;case 5:case 27:var l=oe;if(!o||AC(o)){ve=0,pn=null;var a=l.sibling;if(a!==null)oe=a;else{var c=l.return;c!==null?(oe=c,hh(c)):oe=null}break t}}ve=0,pn=null,gl(t,e,s,5);break;case 6:ve=0,pn=null,gl(t,e,s,6);break;case 8:P0(),Ye=6;break e;default:throw Error(E(462))}}D9();break}catch(u){nC(t,u)}while(!0);return ar=oo=null,Y.H=i,Y.A=r,xe=n,oe!==null?0:(Ee=null,de=0,oh(),Ye)}function D9(){for(;oe!==null&&!W_();)sC(oe)}function sC(t){var e=_2(t.alternate,t,mr);t.memoizedProps=t.pendingProps,e===null?hh(t):oe=e}function Tk(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=xk(n,e,e.pendingProps,e.type,void 0,de);break;case 11:e=xk(n,e,e.pendingProps,e.type.render,e.ref,de);break;case 5:A0(e);default:B2(n,e),e=oe=BA(e,mr),e=_2(n,e,mr)}t.memoizedProps=t.pendingProps,e===null?hh(t):oe=e}function gl(t,e,n,i){ar=oo=null,A0(e),kl=null,Rc=0;var r=e.return;try{if(b9(t,r,e,n,de)){Ye=1,Fd(t,Bn(n,t.current)),oe=null;return}}catch(s){if(r!==null)throw oe=r,s;Ye=1,Fd(t,Bn(n,t.current)),oe=null;return}e.flags&32768?(ge||i===1?t=!0:zl||(de&536870912)!==0?t=!1:(Gr=t=!0,(i===2||i===9||i===3||i===6)&&(i=Pn.current,i!==null&&i.tag===13&&(i.flags|=16384))),oC(e,t)):hh(e)}function hh(t){var e=t;do{if((e.flags&32768)!==0){oC(e,Gr);return}t=e.return;var n=x9(e.alternate,e,mr);if(n!==null){oe=n;return}if(e=e.sibling,e!==null){oe=e;return}oe=e=t}while(e!==null);Ye===0&&(Ye=5)}function oC(t,e){do{var n=S9(t.alternate,t);if(n!==null){n.flags&=32767,oe=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){oe=t;return}oe=t=n}while(t!==null);Ye=6,oe=null}function Ek(t,e,n,i,r,s,o,l,a){t.cancelPendingCommit=null;do ph();while(St!==0);if((xe&6)!==0)throw Error(E(327));if(e!==null){if(e===t.current)throw Error(E(177));if(s=e.lanes|e.childLanes,s|=f0,lB(t,n,s,o,l,a),t===Ee&&(oe=Ee=null,de=0),Ll=e,es=t,Al=n,Py=s,zy=r,J2=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,L9(Dd,function(){return fC(!0),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Y.T,Y.T=null,r=ye.p,ye.p=2,o=xe,xe|=4;try{w9(t,e,n)}finally{xe=o,ye.p=r,Y.T=i}}St=1,lC(),aC(),cC()}}function lC(){if(St===1){St=0;var t=es,e=Ll,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=Y.T,Y.T=null;var i=ye.p;ye.p=2;var r=xe;xe|=4;try{Y2(e,t);var s=jy,o=EA(t.containerInfo),l=s.focusedElem,a=s.selectionRange;if(o!==l&&l&&l.ownerDocument&&TA(l.ownerDocument.documentElement,l)){if(a!==null&&u0(l)){var c=a.start,u=a.end;if(u===void 0&&(u=c),"selectionStart"in l)l.selectionStart=c,l.selectionEnd=Math.min(u,l.value.length);else{var f=l.ownerDocument||document,d=f&&f.defaultView||window;if(d.getSelection){var h=d.getSelection(),m=l.textContent.length,g=Math.min(a.start,m),b=a.end===void 0?g:Math.min(a.end,m);!h.extend&&g>b&&(o=b,b=g,g=o);var p=Qw(l,g),y=Qw(l,b);if(p&&y&&(h.rangeCount!==1||h.anchorNode!==p.node||h.anchorOffset!==p.offset||h.focusNode!==y.node||h.focusOffset!==y.offset)){var v=f.createRange();v.setStart(p.node,p.offset),h.removeAllRanges(),g>b?(h.addRange(v),h.extend(y.node,y.offset)):(v.setEnd(y.node,y.offset),h.addRange(v))}}}}for(f=[],h=l;h=h.parentNode;)h.nodeType===1&&f.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<f.length;l++){var x=f[l];x.element.scrollLeft=x.left,x.element.scrollTop=x.top}}eh=!!Vy,jy=Vy=null}finally{xe=r,ye.p=i,Y.T=n}}t.current=e,St=2}}function aC(){if(St===2){St=0;var t=es,e=Ll,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=Y.T,Y.T=null;var i=ye.p;ye.p=2;var r=xe;xe|=4;try{F2(t,e.alternate,e)}finally{xe=r,ye.p=i,Y.T=n}}St=3}}function cC(){if(St===4||St===3){St=0,Z_();var t=es,e=Ll,n=Al,i=J2;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?St=5:(St=0,Ll=es=null,uC(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Jr=null),i0(n),e=e.stateNode,gn&&typeof gn.onCommitFiberRoot=="function")try{gn.onCommitFiberRoot(Hc,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Y.T,r=ye.p,ye.p=2,Y.T=null;try{for(var s=t.onRecoverableError,o=0;o<i.length;o++){var l=i[o];s(l.value,{componentStack:l.stack})}}finally{Y.T=e,ye.p=r}}(Al&3)!==0&&ph(),Ri(t),r=t.pendingLanes,(n&4194090)!==0&&(r&42)!==0?t===Hy?kc++:(kc=0,Hy=t):kc=0,Zc(0,!1)}}function uC(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Kc(e)))}function ph(t){return lC(),aC(),cC(),fC(t)}function fC(){if(St!==5)return!1;var t=es,e=Py;Py=0;var n=i0(Al),i=Y.T,r=ye.p;try{ye.p=32>n?32:n,Y.T=null,n=zy,zy=null;var s=es,o=Al;if(St=0,Ll=es=null,Al=0,(xe&6)!==0)throw Error(E(331));var l=xe;if(xe|=4,W2(s.current),G2(s,s.current,o,n),xe=l,Zc(0,!1),gn&&typeof gn.onPostCommitFiberRoot=="function")try{gn.onPostCommitFiberRoot(Hc,s)}catch{}return!0}finally{ye.p=r,Y.T=i,uC(t,e)}}function Dk(t,e,n){e=Bn(n,e),e=Ly(t.stateNode,e,2),t=Zr(t,e,2),t!==null&&(Fc(t,2),Ri(t))}function Ae(t,e,n){if(t.tag===3)Dk(t,t,n);else for(;e!==null;){if(e.tag===3){Dk(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Jr===null||!Jr.has(i))){t=Bn(n,t),n=E2(2),i=Zr(e,n,2),i!==null&&(D2(n,i,e,t),Fc(i,2),Ri(i));break}}e=e.return}}function Jg(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new C9;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(_0=!0,r.add(n),t=M9.bind(null,t,e,n),e.then(t,t))}function M9(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ee===t&&(de&n)===n&&(Ye===4||Ye===3&&(de&62914560)===de&&300>Ei()-q0?(xe&2)===0&&Il(t,0):B0|=n,Nl===de&&(Nl=0)),Ri(t)}function dC(t,e){e===0&&(e=lA()),t=Pl(t,e),t!==null&&(Fc(t,e),Ri(t))}function R9(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),dC(t,n)}function N9(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(E(314))}i!==null&&i.delete(e),dC(t,n)}function L9(t,e){return t0(t,e)}var Kd=null,rl=null,Fy=!1,Gd=!1,ey=!1,Zs=0;function Ri(t){t!==rl&&t.next===null&&(rl===null?Kd=rl=t:rl=rl.next=t),Gd=!0,Fy||(Fy=!0,_9())}function Zc(t,e){if(!ey&&Gd){ey=!0;do for(var n=!1,i=Kd;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-yn(42|t)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,Mk(i,s))}else s=de,s=nh(i,i===Ee?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(s&3)===0||Uc(i,s)||(n=!0,Mk(i,s));i=i.next}while(n);ey=!1}}function I9(){hC()}function hC(){Gd=Fy=!1;var t=0;Zs!==0&&(U9()&&(t=Zs),Zs=0);for(var e=Ei(),n=null,i=Kd;i!==null;){var r=i.next,s=pC(i,e);s===0?(i.next=null,n===null?Kd=r:n.next=r,r===null&&(rl=n)):(n=i,(t!==0||(s&3)!==0)&&(Gd=!0)),i=r}Zc(t,!1)}function pC(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes&-62914561;0<s;){var o=31-yn(s),l=1<<o,a=r[o];a===-1?((l&n)===0||(l&i)!==0)&&(r[o]=oB(l,e)):a<=e&&(t.expiredLanes|=l),s&=~l}if(e=Ee,n=de,n=nh(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(ve===2||ve===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&Tg(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Uc(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&Tg(i),i0(n)){case 2:case 8:n=rA;break;case 32:n=Dd;break;case 268435456:n=sA;break;default:n=Dd}return i=mC.bind(null,t),n=t0(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&Tg(i),t.callbackPriority=2,t.callbackNode=null,2}function mC(t,e){if(St!==0&&St!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(ph(!0)&&t.callbackNode!==n)return null;var i=de;return i=nh(t,t===Ee?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(tC(t,i,e),pC(t,Ei()),t.callbackNode!=null&&t.callbackNode===n?mC.bind(null,t):null)}function Mk(t,e){if(ph())return null;tC(t,e,!0)}function _9(){$9(function(){(xe&6)!==0?t0(iA,I9):hC()})}function z0(){return Zs===0&&(Zs=oA()),Zs}function Rk(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:pd(""+t)}function Nk(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function B9(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var s=Rk((r[en]||null).action),o=i.submitter;o&&(e=(e=o[en]||null)?Rk(e.formAction):o.getAttribute("formAction"),e!==null&&(s=e,o=null));var l=new ih("action","action",null,i,r);t.push({event:l,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Zs!==0){var a=o?Nk(r,o):new FormData(r);Ry(n,{pending:!0,data:a,method:r.method,action:s},null,a)}}else typeof s=="function"&&(l.preventDefault(),a=o?Nk(r,o):new FormData(r),Ry(n,{pending:!0,data:a,method:r.method,action:s},s,a))},currentTarget:r}]})}}for(ad=0;ad<vy.length;ad++)cd=vy[ad],Lk=cd.toLowerCase(),Ik=cd[0].toUpperCase()+cd.slice(1),ni(Lk,"on"+Ik);var cd,Lk,Ik,ad;ni(MA,"onAnimationEnd");ni(RA,"onAnimationIteration");ni(NA,"onAnimationStart");ni("dblclick","onDoubleClick");ni("focusin","onFocus");ni("focusout","onBlur");ni(t9,"onTransitionRun");ni(n9,"onTransitionStart");ni(i9,"onTransitionCancel");ni(LA,"onTransitionEnd");Ol("onMouseEnter",["mouseout","mouseover"]);Ol("onMouseLeave",["mouseout","mouseover"]);Ol("onPointerEnter",["pointerout","pointerover"]);Ol("onPointerLeave",["pointerout","pointerover"]);io("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));io("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));io("onBeforeInput",["compositionend","keypress","textInput","paste"]);io("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));io("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));io("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nc="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(" "),q9=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nc));function gC(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var s=void 0;if(e)for(var o=i.length-1;0<=o;o--){var l=i[o],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=c;try{s(r)}catch(u){Ud(u)}r.currentTarget=null,s=a}else for(o=0;o<i.length;o++){if(l=i[o],a=l.instance,c=l.currentTarget,l=l.listener,a!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=c;try{s(r)}catch(u){Ud(u)}r.currentTarget=null,s=a}}}}function se(t,e){var n=e[dy];n===void 0&&(n=e[dy]=new Set);var i=t+"__bubble";n.has(i)||(yC(e,t,2,!1),n.add(i))}function ty(t,e,n){var i=0;e&&(i|=4),yC(n,t,i,e)}var ud="_reactListening"+Math.random().toString(36).slice(2);function H0(t){if(!t[ud]){t[ud]=!0,fA.forEach(function(n){n!=="selectionchange"&&(q9.has(n)||ty(n,!1,t),ty(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[ud]||(e[ud]=!0,ty("selectionchange",!1,e))}}function yC(t,e,n,i){switch(DC(e)){case 2:var r=u7;break;case 8:r=f7;break;default:r=V0}n=r.bind(null,e,n,t),r=void 0,!gy||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function ny(t,e,n,i,r){var s=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var l=i.stateNode.containerInfo;if(l===r)break;if(o===4)for(o=i.return;o!==null;){var a=o.tag;if((a===3||a===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;l!==null;){if(o=ll(l),o===null)return;if(a=o.tag,a===5||a===6||a===26||a===27){i=s=o;continue e}l=l.parentNode}}i=i.return}vA(function(){var c=s,u=o0(n),f=[];e:{var d=IA.get(t);if(d!==void 0){var h=ih,m=t;switch(t){case"keypress":if(gd(n)===0)break e;case"keydown":case"keyup":h=LB;break;case"focusin":m="focus",h=_g;break;case"focusout":m="blur",h=_g;break;case"beforeblur":case"afterblur":h=_g;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Hw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=SB;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=BB;break;case MA:case RA:case NA:h=AB;break;case LA:h=PB;break;case"scroll":case"scrollend":h=vB;break;case"wheel":h=HB;break;case"copy":case"cut":case"paste":h=OB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Fw;break;case"toggle":case"beforetoggle":h=FB}var g=(e&4)!==0,b=!g&&(t==="scroll"||t==="scrollend"),p=g?d!==null?d+"Capture":null:d;g=[];for(var y=c,v;y!==null;){var x=y;if(v=x.stateNode,x=x.tag,x!==5&&x!==26&&x!==27||v===null||p===null||(x=Oc(y,p),x!=null&&g.push(Lc(y,x,v))),b)break;y=y.return}0<g.length&&(d=new h(d,m,null,n,u),f.push({event:d,listeners:g}))}}if((e&7)===0){e:{if(d=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",d&&n!==my&&(m=n.relatedTarget||n.fromElement)&&(ll(m)||m[Bl]))break e;if((h||d)&&(d=u.window===u?u:(d=u.ownerDocument)?d.defaultView||d.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=c,m=m?ll(m):null,m!==null&&(b=zc(m),g=m.tag,m!==b||g!==5&&g!==27&&g!==6)&&(m=null)):(h=null,m=c),h!==m)){if(g=Hw,x="onMouseLeave",p="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(g=Fw,x="onPointerLeave",p="onPointerEnter",y="pointer"),b=h==null?d:cc(h),v=m==null?d:cc(m),d=new g(x,y+"leave",h,n,u),d.target=b,d.relatedTarget=v,x=null,ll(u)===c&&(g=new g(p,y+"enter",m,n,u),g.target=v,g.relatedTarget=b,x=g),b=x,h&&m)t:{for(g=h,p=m,y=0,v=g;v;v=tl(v))y++;for(v=0,x=p;x;x=tl(x))v++;for(;0<y-v;)g=tl(g),y--;for(;0<v-y;)p=tl(p),v--;for(;y--;){if(g===p||p!==null&&g===p.alternate)break t;g=tl(g),p=tl(p)}g=null}else g=null;h!==null&&_k(f,d,h,g,!1),m!==null&&b!==null&&_k(f,b,m,g,!0)}}e:{if(d=c?cc(c):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var k=Yw;else if(jw(d))if(CA)k=ZB;else{k=XB;var C=QB}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?c&&s0(c.elementType)&&(k=Yw):k=WB;if(k&&(k=k(t,c))){AA(f,k,n,u);break e}C&&C(t,d,c),t==="focusout"&&c&&d.type==="number"&&c.memoizedProps.value!=null&&py(d,"number",d.value)}switch(C=c?cc(c):window,t){case"focusin":(jw(C)||C.contentEditable==="true")&&(ul=C,yy=c,hc=null);break;case"focusout":hc=yy=ul=null;break;case"mousedown":by=!0;break;case"contextmenu":case"mouseup":case"dragend":by=!1,Xw(f,n,u);break;case"selectionchange":if(e9)break;case"keydown":case"keyup":Xw(f,n,u)}var w;if(c0)e:{switch(t){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else cl?wA(t,n)&&(A="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(SA&&n.locale!=="ko"&&(cl||A!=="onCompositionStart"?A==="onCompositionEnd"&&cl&&(w=xA()):(Kr=u,l0="value"in Kr?Kr.value:Kr.textContent,cl=!0)),C=Qd(c,A),0<C.length&&(A=new Uw(A,t,null,n,u),f.push({event:A,listeners:C}),w?A.data=w:(w=kA(n),w!==null&&(A.data=w)))),(w=VB?jB(t,n):YB(t,n))&&(A=Qd(c,"onBeforeInput"),0<A.length&&(C=new Uw("onBeforeInput","beforeinput",null,n,u),f.push({event:C,listeners:A}),C.data=w)),B9(f,t,c,n,u)}gC(f,e)})}function Lc(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Qd(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,s=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||s===null||(r=Oc(t,n),r!=null&&i.unshift(Lc(t,r,s)),r=Oc(t,e),r!=null&&i.push(Lc(t,r,s))),t.tag===3)return i;t=t.return}return[]}function tl(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function _k(t,e,n,i,r){for(var s=e._reactName,o=[];n!==null&&n!==i;){var l=n,a=l.alternate,c=l.stateNode;if(l=l.tag,a!==null&&a===i)break;l!==5&&l!==26&&l!==27||c===null||(a=c,r?(c=Oc(n,s),c!=null&&o.unshift(Lc(n,c,a))):r||(c=Oc(n,s),c!=null&&o.push(Lc(n,c,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var P9=/\r\n?/g,z9=/\u0000|\uFFFD/g;function Bk(t){return(typeof t=="string"?t:""+t).replace(P9,`
|
|
9
|
+
`).replace(z9,"")}function bC(t,e){return e=Bk(e),Bk(t)===e}function mh(){}function we(t,e,n,i,r,s){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||Tl(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&Tl(t,""+i);break;case"className":Jf(t,"class",i);break;case"tabIndex":Jf(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Jf(t,n,i);break;case"style":bA(t,i,s);break;case"data":if(e!=="object"){Jf(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=pd(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(e!=="input"&&we(t,e,"name",r.name,r,null),we(t,e,"formEncType",r.formEncType,r,null),we(t,e,"formMethod",r.formMethod,r,null),we(t,e,"formTarget",r.formTarget,r,null)):(we(t,e,"encType",r.encType,r,null),we(t,e,"method",r.method,r,null),we(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=pd(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=mh);break;case"onScroll":i!=null&&se("scroll",t);break;case"onScrollEnd":i!=null&&se("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(E(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(E(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=pd(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":se("beforetoggle",t),se("toggle",t),hd(t,"popover",i);break;case"xlinkActuate":tr(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":tr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":tr(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":tr(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":tr(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":tr(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":tr(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":tr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":tr(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":hd(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=yB.get(n)||n,hd(t,n,i))}}function $y(t,e,n,i,r,s){switch(n){case"style":bA(t,i,s);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(E(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(E(60));t.innerHTML=n}}break;case"children":typeof i=="string"?Tl(t,i):(typeof i=="number"||typeof i=="bigint")&&Tl(t,""+i);break;case"onScroll":i!=null&&se("scroll",t);break;case"onScrollEnd":i!=null&&se("scrollend",t);break;case"onClick":i!=null&&(t.onclick=mh);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dA.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),s=t[en]||null,s=s!=null?s[n]:null,typeof s=="function"&&t.removeEventListener(e,s,r),typeof i=="function")){typeof s!="function"&&s!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):hd(t,n,i)}}}function wt(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":se("error",t),se("load",t);var i=!1,r=!1,s;for(s in n)if(n.hasOwnProperty(s)){var o=n[s];if(o!=null)switch(s){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(E(137,e));default:we(t,e,s,o,n,null)}}r&&we(t,e,"srcSet",n.srcSet,n,null),i&&we(t,e,"src",n.src,n,null);return;case"input":se("invalid",t);var l=s=o=r=null,a=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":o=u;break;case"checked":a=u;break;case"defaultChecked":c=u;break;case"value":s=u;break;case"defaultValue":l=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(E(137,e));break;default:we(t,e,i,u,n,null)}}mA(t,s,l,a,c,o,r,!1),Md(t);return;case"select":se("invalid",t),i=o=s=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":s=l;break;case"defaultValue":o=l;break;case"multiple":i=l;default:we(t,e,r,l,n,null)}e=s,n=o,t.multiple=!!i,e!=null?bl(t,!!i,e,!1):n!=null&&bl(t,!!i,n,!0);return;case"textarea":se("invalid",t),s=r=i=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":i=l;break;case"defaultValue":r=l;break;case"children":s=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(E(91));break;default:we(t,e,o,l,n,null)}yA(t,i,r,s),Md(t);return;case"option":for(a in n)n.hasOwnProperty(a)&&(i=n[a],i!=null)&&(a==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":we(t,e,a,i,n,null));return;case"dialog":se("beforetoggle",t),se("toggle",t),se("cancel",t),se("close",t);break;case"iframe":case"object":se("load",t);break;case"video":case"audio":for(i=0;i<Nc.length;i++)se(Nc[i],t);break;case"image":se("error",t),se("load",t);break;case"details":se("toggle",t);break;case"embed":case"source":case"link":se("error",t),se("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(E(137,e));default:we(t,e,c,i,n,null)}return;default:if(s0(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&$y(t,e,u,i,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null&&we(t,e,l,i,n,null))}function H9(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,s=null,o=null,l=null,a=null,c=null,u=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&f!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":a=f;default:i.hasOwnProperty(h)||we(t,e,h,null,i,f)}}for(var d in i){var h=i[d];if(f=n[d],i.hasOwnProperty(d)&&(h!=null||f!=null))switch(d){case"type":s=h;break;case"name":r=h;break;case"checked":c=h;break;case"defaultChecked":u=h;break;case"value":o=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(E(137,e));break;default:h!==f&&we(t,e,d,h,i,f)}}hy(t,o,l,a,c,u,s,r);return;case"select":h=o=l=d=null;for(s in n)if(a=n[s],n.hasOwnProperty(s)&&a!=null)switch(s){case"value":break;case"multiple":h=a;default:i.hasOwnProperty(s)||we(t,e,s,null,i,a)}for(r in i)if(s=i[r],a=n[r],i.hasOwnProperty(r)&&(s!=null||a!=null))switch(r){case"value":d=s;break;case"defaultValue":l=s;break;case"multiple":o=s;default:s!==a&&we(t,e,r,s,i,a)}e=l,n=o,i=h,d!=null?bl(t,!!n,d,!1):!!i!=!!n&&(e!=null?bl(t,!!n,e,!0):bl(t,!!n,n?[]:"",!1));return;case"textarea":h=d=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!i.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:we(t,e,l,null,i,r)}for(o in i)if(r=i[o],s=n[o],i.hasOwnProperty(o)&&(r!=null||s!=null))switch(o){case"value":d=r;break;case"defaultValue":h=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(E(91));break;default:r!==s&&we(t,e,o,r,i,s)}gA(t,d,h);return;case"option":for(var m in n)d=n[m],n.hasOwnProperty(m)&&d!=null&&!i.hasOwnProperty(m)&&(m==="selected"?t.selected=!1:we(t,e,m,null,i,d));for(a in i)d=i[a],h=n[a],i.hasOwnProperty(a)&&d!==h&&(d!=null||h!=null)&&(a==="selected"?t.selected=d&&typeof d!="function"&&typeof d!="symbol":we(t,e,a,d,i,h));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)d=n[g],n.hasOwnProperty(g)&&d!=null&&!i.hasOwnProperty(g)&&we(t,e,g,null,i,d);for(c in i)if(d=i[c],h=n[c],i.hasOwnProperty(c)&&d!==h&&(d!=null||h!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(E(137,e));break;default:we(t,e,c,d,i,h)}return;default:if(s0(e)){for(var b in n)d=n[b],n.hasOwnProperty(b)&&d!==void 0&&!i.hasOwnProperty(b)&&$y(t,e,b,void 0,i,d);for(u in i)d=i[u],h=n[u],!i.hasOwnProperty(u)||d===h||d===void 0&&h===void 0||$y(t,e,u,d,i,h);return}}for(var p in n)d=n[p],n.hasOwnProperty(p)&&d!=null&&!i.hasOwnProperty(p)&&we(t,e,p,null,i,d);for(f in i)d=i[f],h=n[f],!i.hasOwnProperty(f)||d===h||d==null&&h==null||we(t,e,f,d,i,h)}var Vy=null,jy=null;function Xd(t){return t.nodeType===9?t:t.ownerDocument}function qk(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function vC(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Yy(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var iy=null;function U9(){var t=window.event;return t&&t.type==="popstate"?t===iy?!1:(iy=t,!0):(iy=null,!1)}var xC=typeof setTimeout=="function"?setTimeout:void 0,F9=typeof clearTimeout=="function"?clearTimeout:void 0,Pk=typeof Promise=="function"?Promise:void 0,$9=typeof queueMicrotask=="function"?queueMicrotask:typeof Pk<"u"?function(t){return Pk.resolve(null).then(t).catch(V9)}:xC;function V9(t){setTimeout(function(){throw t})}function as(t){return t==="head"}function zk(t,e){var n=e,i=0,r=0;do{var s=n.nextSibling;if(t.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(0<i&&8>i){n=i;var o=t.ownerDocument;if(n&1&&Ac(o.documentElement),n&2&&Ac(o.body),n&4)for(n=o.head,Ac(n),o=n.firstChild;o;){var l=o.nextSibling,a=o.nodeName;o[$c]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=l}}if(r===0){t.removeChild(s),Pc(e);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:i=n.charCodeAt(0)-48;else i=0;n=s}while(n);Pc(e)}function Ky(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Ky(n),r0(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function j9(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[$c])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(s=t.getAttribute("rel"),s==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(s!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(s=t.getAttribute("src"),(s!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&s&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var s=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===s)return t}else return t;if(t=ti(t.nextSibling),t===null)break}return null}function Y9(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=ti(t.nextSibling),t===null))return null;return t}function Gy(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function K9(t,e){var n=t.ownerDocument;if(t.data!=="$?"||n.readyState==="complete")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function ti(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="F!"||e==="F")break;if(e==="/$")return null}}return t}var Qy=null;function Hk(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}function SC(t,e,n){switch(e=Xd(n),t){case"html":if(t=e.documentElement,!t)throw Error(E(452));return t;case"head":if(t=e.head,!t)throw Error(E(453));return t;case"body":if(t=e.body,!t)throw Error(E(454));return t;default:throw Error(E(451))}}function Ac(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);r0(t)}var zn=new Map,Uk=new Set;function Wd(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var gr=ye.d;ye.d={f:G9,r:Q9,D:X9,C:W9,L:Z9,m:J9,X:t7,S:e7,M:n7};function G9(){var t=gr.f(),e=dh();return t||e}function Q9(t){var e=ql(t);e!==null&&e.tag===5&&e.type==="form"?p2(e):gr.r(t)}var Hl=typeof document>"u"?null:document;function wC(t,e,n){var i=Hl;if(i&&typeof e=="string"&&e){var r=_n(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Uk.has(r)||(Uk.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),wt(e,"link",t),ht(e),i.head.appendChild(e)))}}function X9(t){gr.D(t),wC("dns-prefetch",t,null)}function W9(t,e){gr.C(t,e),wC("preconnect",t,e)}function Z9(t,e,n){gr.L(t,e,n);var i=Hl;if(i&&t&&e){var r='link[rel="preload"][as="'+_n(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+_n(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+_n(n.imageSizes)+'"]')):r+='[href="'+_n(t)+'"]';var s=r;switch(e){case"style":s=_l(t);break;case"script":s=Ul(t)}zn.has(s)||(t=Ne({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),zn.set(s,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Jc(s))||e==="script"&&i.querySelector(eu(s))||(e=i.createElement("link"),wt(e,"link",t),ht(e),i.head.appendChild(e)))}}function J9(t,e){gr.m(t,e);var n=Hl;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+_n(i)+'"][href="'+_n(t)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Ul(t)}if(!zn.has(s)&&(t=Ne({rel:"modulepreload",href:t},e),zn.set(s,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(eu(s)))return}i=n.createElement("link"),wt(i,"link",t),ht(i),n.head.appendChild(i)}}}function e7(t,e,n){gr.S(t,e,n);var i=Hl;if(i&&t){var r=yl(i).hoistableStyles,s=_l(t);e=e||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(Jc(s)))l.loading=5;else{t=Ne({rel:"stylesheet",href:t,"data-precedence":e},n),(n=zn.get(s))&&U0(t,n);var a=o=i.createElement("link");ht(a),wt(a,"link",t),a._p=new Promise(function(c,u){a.onload=c,a.onerror=u}),a.addEventListener("load",function(){l.loading|=1}),a.addEventListener("error",function(){l.loading|=2}),l.loading|=4,kd(o,e,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function t7(t,e){gr.X(t,e);var n=Hl;if(n&&t){var i=yl(n).hoistableScripts,r=Ul(t),s=i.get(r);s||(s=n.querySelector(eu(r)),s||(t=Ne({src:t,async:!0},e),(e=zn.get(r))&&F0(t,e),s=n.createElement("script"),ht(s),wt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function n7(t,e){gr.M(t,e);var n=Hl;if(n&&t){var i=yl(n).hoistableScripts,r=Ul(t),s=i.get(r);s||(s=n.querySelector(eu(r)),s||(t=Ne({src:t,async:!0,type:"module"},e),(e=zn.get(r))&&F0(t,e),s=n.createElement("script"),ht(s),wt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function Fk(t,e,n,i){var r=(r=Xr.current)?Wd(r):null;if(!r)throw Error(E(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=_l(n.href),n=yl(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=_l(n.href);var s=yl(r).hoistableStyles,o=s.get(t);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,o),(s=r.querySelector(Jc(t)))&&!s._p&&(o.instance=s,o.state.loading=5),zn.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},zn.set(t,n),s||i7(r,t,n,o.state))),e&&i===null)throw Error(E(528,""));return o}if(e&&i!==null)throw Error(E(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Ul(n),n=yl(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(E(444,t))}}function _l(t){return'href="'+_n(t)+'"'}function Jc(t){return'link[rel="stylesheet"]['+t+"]"}function kC(t){return Ne({},t,{"data-precedence":t.precedence,precedence:null})}function i7(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),wt(e,"link",n),ht(e),t.head.appendChild(e))}function Ul(t){return'[src="'+_n(t)+'"]'}function eu(t){return"script[async]"+t}function $k(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+_n(n.href)+'"]');if(i)return e.instance=i,ht(i),i;var r=Ne({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),ht(i),wt(i,"style",r),kd(i,n.precedence,t),e.instance=i;case"stylesheet":r=_l(n.href);var s=t.querySelector(Jc(r));if(s)return e.state.loading|=4,e.instance=s,ht(s),s;i=kC(n),(r=zn.get(r))&&U0(i,r),s=(t.ownerDocument||t).createElement("link"),ht(s);var o=s;return o._p=new Promise(function(l,a){o.onload=l,o.onerror=a}),wt(s,"link",i),e.state.loading|=4,kd(s,n.precedence,t),e.instance=s;case"script":return s=Ul(n.src),(r=t.querySelector(eu(s)))?(e.instance=r,ht(r),r):(i=n,(r=zn.get(s))&&(i=Ne({},n),F0(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),ht(r),wt(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(E(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,kd(i,n.precedence,t));return e.instance}function kd(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,o=0;o<i.length;o++){var l=i[o];if(l.dataset.precedence===e)s=l;else if(s!==r)break}s?s.parentNode.insertBefore(t,s.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function U0(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function F0(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Ad=null;function Vk(t,e,n){if(Ad===null){var i=new Map,r=Ad=new Map;r.set(n,i)}else r=Ad,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var s=n[r];if(!(s[$c]||s[Mt]||t==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var o=s.getAttribute(e)||"";o=t+o;var l=i.get(o);l?l.push(s):i.set(o,[s])}}return i}function jk(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function r7(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function AC(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var Ic=null;function s7(){}function o7(t,e,n){if(Ic===null)throw Error(E(475));var i=Ic;if(e.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var r=_l(n.href),s=t.querySelector(Jc(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(i.count++,i=Zd.bind(i),t.then(i,i)),e.state.loading|=4,e.instance=s,ht(s);return}s=t.ownerDocument||t,n=kC(n),(r=zn.get(r))&&U0(n,r),s=s.createElement("link"),ht(s);var o=s;o._p=new Promise(function(l,a){o.onload=l,o.onerror=a}),wt(s,"link",n),e.instance=s}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(e,t),(t=e.state.preload)&&(e.state.loading&3)===0&&(i.count++,e=Zd.bind(i),t.addEventListener("load",e),t.addEventListener("error",e))}}function l7(){if(Ic===null)throw Error(E(475));var t=Ic;return t.stylesheets&&t.count===0&&Xy(t,t.stylesheets),0<t.count?function(e){var n=setTimeout(function(){if(t.stylesheets&&Xy(t,t.stylesheets),t.unsuspend){var i=t.unsuspend;t.unsuspend=null,i()}},6e4);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(n)}}:null}function Zd(){if(this.count--,this.count===0){if(this.stylesheets)Xy(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Jd=null;function Xy(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Jd=new Map,e.forEach(a7,t),Jd=null,Zd.call(t))}function a7(t,e){if(!(e.state.loading&4)){var n=Jd.get(t);if(n)var i=n.get(null);else{n=new Map,Jd.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<r.length;s++){var o=r[s];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),i=o)}i&&n.set(null,i)}r=e.instance,o=r.getAttribute("data-precedence"),s=n.get(o)||i,s===i&&n.set(null,r),n.set(o,r),this.count++,i=Zd.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),s?s.parentNode.insertBefore(r,s.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var _c={$$typeof:sr,Provider:null,Consumer:null,_currentValue:Ys,_currentValue2:Ys,_threadCount:0};function c7(t,e,n,i,r,s,o,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Eg(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Eg(0),this.hiddenUpdates=Eg(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=s,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function CC(t,e,n,i,r,s,o,l,a,c,u,f){return t=new c7(t,e,n,o,l,a,c,f),e=1,s===!0&&(e|=24),s=mn(3,null,null,e),t.current=s,s.stateNode=t,e=g0(),e.refCount++,t.pooledCache=e,e.refCount++,s.memoizedState={element:i,isDehydrated:n,cache:e},b0(s),t}function OC(t){return t?(t=hl,t):hl}function TC(t,e,n,i,r,s){r=OC(r),i.context===null?i.context=r:i.pendingContext=r,i=Wr(e),i.payload={element:n},s=s===void 0?null:s,s!==null&&(i.callback=s),n=Zr(t,i,e),n!==null&&(vn(n,t,e),gc(n,t,e))}function Yk(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function $0(t,e){Yk(t,e),(t=t.alternate)&&Yk(t,e)}function EC(t){if(t.tag===13){var e=Pl(t,67108864);e!==null&&vn(e,t,67108864),$0(t,67108864)}}var eh=!0;function u7(t,e,n,i){var r=Y.T;Y.T=null;var s=ye.p;try{ye.p=2,V0(t,e,n,i)}finally{ye.p=s,Y.T=r}}function f7(t,e,n,i){var r=Y.T;Y.T=null;var s=ye.p;try{ye.p=8,V0(t,e,n,i)}finally{ye.p=s,Y.T=r}}function V0(t,e,n,i){if(eh){var r=Wy(i);if(r===null)ny(t,e,i,th,n),Kk(t,i);else if(h7(r,t,e,n,i))i.stopPropagation();else if(Kk(t,i),e&4&&-1<d7.indexOf(t)){for(;r!==null;){var s=ql(r);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var o=$s(s.pendingLanes);if(o!==0){var l=s;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var a=1<<31-yn(o);l.entanglements[1]|=a,o&=~a}Ri(s),(xe&6)===0&&(jd=Ei()+500,Zc(0,!1))}}break;case 13:l=Pl(s,2),l!==null&&vn(l,s,2),dh(),$0(s,2)}if(s=Wy(i),s===null&&ny(t,e,i,th,n),s===r)break;r=s}r!==null&&i.stopPropagation()}else ny(t,e,i,null,n)}}function Wy(t){return t=o0(t),j0(t)}var th=null;function j0(t){if(th=null,t=ll(t),t!==null){var e=zc(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=Jk(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return th=t,null}function DC(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"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(J_()){case iA:return 2;case rA:return 8;case Dd:case eB:return 32;case sA:return 268435456;default:return 32}default:return 32}}var Zy=!1,ts=null,ns=null,is=null,Bc=new Map,qc=new Map,jr=[],d7="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 Kk(t,e){switch(t){case"focusin":case"focusout":ts=null;break;case"dragenter":case"dragleave":ns=null;break;case"mouseover":case"mouseout":is=null;break;case"pointerover":case"pointerout":Bc.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":qc.delete(e.pointerId)}}function sc(t,e,n,i,r,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=ql(e),e!==null&&EC(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function h7(t,e,n,i,r){switch(e){case"focusin":return ts=sc(ts,t,e,n,i,r),!0;case"dragenter":return ns=sc(ns,t,e,n,i,r),!0;case"mouseover":return is=sc(is,t,e,n,i,r),!0;case"pointerover":var s=r.pointerId;return Bc.set(s,sc(Bc.get(s)||null,t,e,n,i,r)),!0;case"gotpointercapture":return s=r.pointerId,qc.set(s,sc(qc.get(s)||null,t,e,n,i,r)),!0}return!1}function MC(t){var e=ll(t.target);if(e!==null){var n=zc(e);if(n!==null){if(e=n.tag,e===13){if(e=Jk(n),e!==null){t.blockedOn=e,aB(t.priority,function(){if(n.tag===13){var i=bn();i=n0(i);var r=Pl(n,i);r!==null&&vn(r,n,i),$0(n,i)}});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Cd(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Wy(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);my=i,n.target.dispatchEvent(i),my=null}else return e=ql(n),e!==null&&EC(e),t.blockedOn=n,!1;e.shift()}return!0}function Gk(t,e,n){Cd(t)&&n.delete(e)}function p7(){Zy=!1,ts!==null&&Cd(ts)&&(ts=null),ns!==null&&Cd(ns)&&(ns=null),is!==null&&Cd(is)&&(is=null),Bc.forEach(Gk),qc.forEach(Gk)}function fd(t,e){t.blockedOn===e&&(t.blockedOn=null,Zy||(Zy=!0,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,p7)))}var dd=null;function Qk(t){dd!==t&&(dd=t,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,function(){dd===t&&(dd=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(j0(i||n)===null)continue;break}var s=ql(n);s!==null&&(t.splice(e,3),e-=3,Ry(s,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Pc(t){function e(a){return fd(a,t)}ts!==null&&fd(ts,t),ns!==null&&fd(ns,t),is!==null&&fd(is,t),Bc.forEach(e),qc.forEach(e);for(var n=0;n<jr.length;n++){var i=jr[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<jr.length&&(n=jr[0],n.blockedOn===null);)MC(n),n.blockedOn===null&&jr.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],s=n[i+1],o=r[en]||null;if(typeof s=="function")o||Qk(n);else if(o){var l=null;if(s&&s.hasAttribute("formAction")){if(r=s,o=s[en]||null)l=o.formAction;else if(j0(r)!==null)continue}else l=o.action;typeof l=="function"?n[i+1]=l:(n.splice(i,3),i-=3),Qk(n)}}}function Y0(t){this._internalRoot=t}gh.prototype.render=Y0.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(E(409));var n=e.current,i=bn();TC(n,i,t,e,null,null)};gh.prototype.unmount=Y0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;TC(t.current,2,null,t,null,null),dh(),e[Bl]=null}};function gh(t){this._internalRoot=t}gh.prototype.unstable_scheduleHydration=function(t){if(t){var e=uA();t={blockedOn:null,target:t,priority:e};for(var n=0;n<jr.length&&e!==0&&e<jr[n].priority;n++);jr.splice(n,0,t),n===0&&MC(t)}};var Xk=Wk.version;if(Xk!=="19.1.0")throw Error(E(527,Xk,"19.1.0"));ye.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(E(188)):(t=Object.keys(t).join(","),Error(E(268,t)));return t=Y_(e),t=t!==null?eA(t):null,t=t===null?null:t.stateNode,t};var m7={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(oc=__REACT_DEVTOOLS_GLOBAL_HOOK__,!oc.isDisabled&&oc.supportsFiber))try{Hc=oc.inject(m7),gn=oc}catch{}var oc;yh.createRoot=function(t,e){if(!Zk(t))throw Error(E(299));var n=!1,i="",r=C2,s=O2,o=T2,l=null;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(s=e.onCaughtError),e.onRecoverableError!==void 0&&(o=e.onRecoverableError),e.unstable_transitionCallbacks!==void 0&&(l=e.unstable_transitionCallbacks)),e=CC(t,1,!1,null,null,n,i,r,s,o,l,null),t[Bl]=e.current,H0(t),new Y0(e)};yh.hydrateRoot=function(t,e,n){if(!Zk(t))throw Error(E(299));var i=!1,r="",s=C2,o=O2,l=T2,a=null,c=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(a=n.unstable_transitionCallbacks),n.formState!==void 0&&(c=n.formState)),e=CC(t,1,!0,e,n??null,i,r,s,o,l,a,c),e.context=OC(null),n=e.current,i=bn(),i=n0(i),r=Wr(i),r.callback=null,Zr(n,r,i),n=i,e.current.lanes=n,Fc(e,n),Ri(e),t[Bl]=e.current,H0(t),new gh(e)};yh.version="19.1.0"});var IC=S((Hse,LC)=>{"use strict";function NC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(NC)}catch(t){console.error(t)}}NC(),LC.exports=RC()});var sE=S(up=>{"use strict";var DH=Symbol.for("react.transitional.element"),MH=Symbol.for("react.fragment");function rE(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:DH,type:t,key:i,ref:e!==void 0?e:null,props:n}}up.Fragment=MH;up.jsx=rE;up.jsxs=rE});var Ce=S((Jfe,oE)=>{"use strict";oE.exports=sE()});var gR=S((uge,mR)=>{"use strict";function Hj(){this.__data__=[],this.size=0}mR.exports=Hj});var Nm=S((fge,yR)=>{"use strict";function Uj(t,e){return t===e||t!==t&&e!==e}yR.exports=Uj});var xf=S((dge,bR)=>{"use strict";var Fj=Nm();function $j(t,e){for(var n=t.length;n--;)if(Fj(t[n][0],e))return n;return-1}bR.exports=$j});var xR=S((hge,vR)=>{"use strict";var Vj=xf(),jj=Array.prototype,Yj=jj.splice;function Kj(t){var e=this.__data__,n=Vj(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():Yj.call(e,n,1),--this.size,!0}vR.exports=Kj});var wR=S((pge,SR)=>{"use strict";var Gj=xf();function Qj(t){var e=this.__data__,n=Gj(e,t);return n<0?void 0:e[n][1]}SR.exports=Qj});var AR=S((mge,kR)=>{"use strict";var Xj=xf();function Wj(t){return Xj(this.__data__,t)>-1}kR.exports=Wj});var OR=S((gge,CR)=>{"use strict";var Zj=xf();function Jj(t,e){var n=this.__data__,i=Zj(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}CR.exports=Jj});var Sf=S((yge,TR)=>{"use strict";var eY=gR(),tY=xR(),nY=wR(),iY=AR(),rY=OR();function _a(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}_a.prototype.clear=eY;_a.prototype.delete=tY;_a.prototype.get=nY;_a.prototype.has=iY;_a.prototype.set=rY;TR.exports=_a});var DR=S((bge,ER)=>{"use strict";var sY=Sf();function oY(){this.__data__=new sY,this.size=0}ER.exports=oY});var RR=S((vge,MR)=>{"use strict";function lY(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}MR.exports=lY});var LR=S((xge,NR)=>{"use strict";function aY(t){return this.__data__.get(t)}NR.exports=aY});var _R=S((Sge,IR)=>{"use strict";function cY(t){return this.__data__.has(t)}IR.exports=cY});var Qx=S((wge,BR)=>{"use strict";var uY=typeof global=="object"&&global&&global.Object===Object&&global;BR.exports=uY});var Si=S((kge,qR)=>{"use strict";var fY=Qx(),dY=typeof self=="object"&&self&&self.Object===Object&&self,hY=fY||dY||Function("return this")();qR.exports=hY});var zo=S((Age,PR)=>{"use strict";var pY=Si(),mY=pY.Symbol;PR.exports=mY});var FR=S((Cge,UR)=>{"use strict";var zR=zo(),HR=Object.prototype,gY=HR.hasOwnProperty,yY=HR.toString,wf=zR?zR.toStringTag:void 0;function bY(t){var e=gY.call(t,wf),n=t[wf];try{t[wf]=void 0;var i=!0}catch{}var r=yY.call(t);return i&&(e?t[wf]=n:delete t[wf]),r}UR.exports=bY});var VR=S((Oge,$R)=>{"use strict";var vY=Object.prototype,xY=vY.toString;function SY(t){return xY.call(t)}$R.exports=SY});var Ho=S((Tge,KR)=>{"use strict";var jR=zo(),wY=FR(),kY=VR(),AY="[object Null]",CY="[object Undefined]",YR=jR?jR.toStringTag:void 0;function OY(t){return t==null?t===void 0?CY:AY:YR&&YR in Object(t)?wY(t):kY(t)}KR.exports=OY});var Is=S((Ege,GR)=>{"use strict";function TY(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}GR.exports=TY});var kf=S((Dge,QR)=>{"use strict";var EY=Ho(),DY=Is(),MY="[object AsyncFunction]",RY="[object Function]",NY="[object GeneratorFunction]",LY="[object Proxy]";function IY(t){if(!DY(t))return!1;var e=EY(t);return e==RY||e==NY||e==MY||e==LY}QR.exports=IY});var WR=S((Mge,XR)=>{"use strict";var _Y=Si(),BY=_Y["__core-js_shared__"];XR.exports=BY});var e3=S((Rge,JR)=>{"use strict";var Xx=WR(),ZR=(function(){var t=/[^.]+$/.exec(Xx&&Xx.keys&&Xx.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function qY(t){return!!ZR&&ZR in t}JR.exports=qY});var Wx=S((Nge,t3)=>{"use strict";var PY=Function.prototype,zY=PY.toString;function HY(t){if(t!=null){try{return zY.call(t)}catch{}try{return t+""}catch{}}return""}t3.exports=HY});var i3=S((Lge,n3)=>{"use strict";var UY=kf(),FY=e3(),$Y=Is(),VY=Wx(),jY=/[\\^$.*+?()[\]{}|]/g,YY=/^\[object .+?Constructor\]$/,KY=Function.prototype,GY=Object.prototype,QY=KY.toString,XY=GY.hasOwnProperty,WY=RegExp("^"+QY.call(XY).replace(jY,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ZY(t){if(!$Y(t)||FY(t))return!1;var e=UY(t)?WY:YY;return e.test(VY(t))}n3.exports=ZY});var s3=S((Ige,r3)=>{"use strict";function JY(t,e){return t?.[e]}r3.exports=JY});var _s=S((_ge,o3)=>{"use strict";var eK=i3(),tK=s3();function nK(t,e){var n=tK(t,e);return eK(n)?n:void 0}o3.exports=nK});var Lm=S((Bge,l3)=>{"use strict";var iK=_s(),rK=Si(),sK=iK(rK,"Map");l3.exports=sK});var Af=S((qge,a3)=>{"use strict";var oK=_s(),lK=oK(Object,"create");a3.exports=lK});var f3=S((Pge,u3)=>{"use strict";var c3=Af();function aK(){this.__data__=c3?c3(null):{},this.size=0}u3.exports=aK});var h3=S((zge,d3)=>{"use strict";function cK(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}d3.exports=cK});var m3=S((Hge,p3)=>{"use strict";var uK=Af(),fK="__lodash_hash_undefined__",dK=Object.prototype,hK=dK.hasOwnProperty;function pK(t){var e=this.__data__;if(uK){var n=e[t];return n===fK?void 0:n}return hK.call(e,t)?e[t]:void 0}p3.exports=pK});var y3=S((Uge,g3)=>{"use strict";var mK=Af(),gK=Object.prototype,yK=gK.hasOwnProperty;function bK(t){var e=this.__data__;return mK?e[t]!==void 0:yK.call(e,t)}g3.exports=bK});var v3=S((Fge,b3)=>{"use strict";var vK=Af(),xK="__lodash_hash_undefined__";function SK(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=vK&&e===void 0?xK:e,this}b3.exports=SK});var S3=S(($ge,x3)=>{"use strict";var wK=f3(),kK=h3(),AK=m3(),CK=y3(),OK=v3();function Ba(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Ba.prototype.clear=wK;Ba.prototype.delete=kK;Ba.prototype.get=AK;Ba.prototype.has=CK;Ba.prototype.set=OK;x3.exports=Ba});var A3=S((Vge,k3)=>{"use strict";var w3=S3(),TK=Sf(),EK=Lm();function DK(){this.size=0,this.__data__={hash:new w3,map:new(EK||TK),string:new w3}}k3.exports=DK});var O3=S((jge,C3)=>{"use strict";function MK(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}C3.exports=MK});var Cf=S((Yge,T3)=>{"use strict";var RK=O3();function NK(t,e){var n=t.__data__;return RK(e)?n[typeof e=="string"?"string":"hash"]:n.map}T3.exports=NK});var D3=S((Kge,E3)=>{"use strict";var LK=Cf();function IK(t){var e=LK(this,t).delete(t);return this.size-=e?1:0,e}E3.exports=IK});var R3=S((Gge,M3)=>{"use strict";var _K=Cf();function BK(t){return _K(this,t).get(t)}M3.exports=BK});var L3=S((Qge,N3)=>{"use strict";var qK=Cf();function PK(t){return qK(this,t).has(t)}N3.exports=PK});var _3=S((Xge,I3)=>{"use strict";var zK=Cf();function HK(t,e){var n=zK(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}I3.exports=HK});var Im=S((Wge,B3)=>{"use strict";var UK=A3(),FK=D3(),$K=R3(),VK=L3(),jK=_3();function qa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}qa.prototype.clear=UK;qa.prototype.delete=FK;qa.prototype.get=$K;qa.prototype.has=VK;qa.prototype.set=jK;B3.exports=qa});var P3=S((Zge,q3)=>{"use strict";var YK=Sf(),KK=Lm(),GK=Im(),QK=200;function XK(t,e){var n=this.__data__;if(n instanceof YK){var i=n.__data__;if(!KK||i.length<QK-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new GK(i)}return n.set(t,e),this.size=n.size,this}q3.exports=XK});var _m=S((Jge,z3)=>{"use strict";var WK=Sf(),ZK=DR(),JK=RR(),eG=LR(),tG=_R(),nG=P3();function Pa(t){var e=this.__data__=new WK(t);this.size=e.size}Pa.prototype.clear=ZK;Pa.prototype.delete=JK;Pa.prototype.get=eG;Pa.prototype.has=tG;Pa.prototype.set=nG;z3.exports=Pa});var Bm=S((eye,H3)=>{"use strict";function iG(t,e){for(var n=-1,i=t==null?0:t.length;++n<i&&e(t[n],n,t)!==!1;);return t}H3.exports=iG});var Zx=S((tye,U3)=>{"use strict";var rG=_s(),sG=(function(){try{var t=rG(Object,"defineProperty");return t({},"",{}),t}catch{}})();U3.exports=sG});var Jx=S((nye,$3)=>{"use strict";var F3=Zx();function oG(t,e,n){e=="__proto__"&&F3?F3(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}$3.exports=oG});var eS=S((iye,V3)=>{"use strict";var lG=Jx(),aG=Nm(),cG=Object.prototype,uG=cG.hasOwnProperty;function fG(t,e,n){var i=t[e];(!(uG.call(t,e)&&aG(i,n))||n===void 0&&!(e in t))&&lG(t,e,n)}V3.exports=fG});var Of=S((rye,j3)=>{"use strict";var dG=eS(),hG=Jx();function pG(t,e,n,i){var r=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var l=e[s],a=i?i(n[l],t[l],l,n,t):void 0;a===void 0&&(a=t[l]),r?hG(n,l,a):dG(n,l,a)}return n}j3.exports=pG});var K3=S((sye,Y3)=>{"use strict";function mG(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}Y3.exports=mG});var Gi=S((oye,G3)=>{"use strict";function gG(t){return t!=null&&typeof t=="object"}G3.exports=gG});var X3=S((lye,Q3)=>{"use strict";var yG=Ho(),bG=Gi(),vG="[object Arguments]";function xG(t){return bG(t)&&yG(t)==vG}Q3.exports=xG});var Tf=S((aye,J3)=>{"use strict";var W3=X3(),SG=Gi(),Z3=Object.prototype,wG=Z3.hasOwnProperty,kG=Z3.propertyIsEnumerable,AG=W3((function(){return arguments})())?W3:function(t){return SG(t)&&wG.call(t,"callee")&&!kG.call(t,"callee")};J3.exports=AG});var ut=S((cye,eN)=>{"use strict";var CG=Array.isArray;eN.exports=CG});var nN=S((uye,tN)=>{"use strict";function OG(){return!1}tN.exports=OG});var Ha=S((Ef,za)=>{"use strict";var TG=Si(),EG=nN(),sN=typeof Ef=="object"&&Ef&&!Ef.nodeType&&Ef,iN=sN&&typeof za=="object"&&za&&!za.nodeType&&za,DG=iN&&iN.exports===sN,rN=DG?TG.Buffer:void 0,MG=rN?rN.isBuffer:void 0,RG=MG||EG;za.exports=RG});var tS=S((fye,oN)=>{"use strict";var NG=9007199254740991,LG=/^(?:0|[1-9]\d*)$/;function IG(t,e){var n=typeof t;return e=e??NG,!!e&&(n=="number"||n!="symbol"&&LG.test(t))&&t>-1&&t%1==0&&t<e}oN.exports=IG});var qm=S((dye,lN)=>{"use strict";var _G=9007199254740991;function BG(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=_G}lN.exports=BG});var cN=S((hye,aN)=>{"use strict";var qG=Ho(),PG=qm(),zG=Gi(),HG="[object Arguments]",UG="[object Array]",FG="[object Boolean]",$G="[object Date]",VG="[object Error]",jG="[object Function]",YG="[object Map]",KG="[object Number]",GG="[object Object]",QG="[object RegExp]",XG="[object Set]",WG="[object String]",ZG="[object WeakMap]",JG="[object ArrayBuffer]",eQ="[object DataView]",tQ="[object Float32Array]",nQ="[object Float64Array]",iQ="[object Int8Array]",rQ="[object Int16Array]",sQ="[object Int32Array]",oQ="[object Uint8Array]",lQ="[object Uint8ClampedArray]",aQ="[object Uint16Array]",cQ="[object Uint32Array]",_e={};_e[tQ]=_e[nQ]=_e[iQ]=_e[rQ]=_e[sQ]=_e[oQ]=_e[lQ]=_e[aQ]=_e[cQ]=!0;_e[HG]=_e[UG]=_e[JG]=_e[FG]=_e[eQ]=_e[$G]=_e[VG]=_e[jG]=_e[YG]=_e[KG]=_e[GG]=_e[QG]=_e[XG]=_e[WG]=_e[ZG]=!1;function uQ(t){return zG(t)&&PG(t.length)&&!!_e[qG(t)]}aN.exports=uQ});var Pm=S((pye,uN)=>{"use strict";function fQ(t){return function(e){return t(e)}}uN.exports=fQ});var zm=S((Df,Ua)=>{"use strict";var dQ=Qx(),fN=typeof Df=="object"&&Df&&!Df.nodeType&&Df,Mf=fN&&typeof Ua=="object"&&Ua&&!Ua.nodeType&&Ua,hQ=Mf&&Mf.exports===fN,nS=hQ&&dQ.process,pQ=(function(){try{var t=Mf&&Mf.require&&Mf.require("util").types;return t||nS&&nS.binding&&nS.binding("util")}catch{}})();Ua.exports=pQ});var Rf=S((mye,pN)=>{"use strict";var mQ=cN(),gQ=Pm(),dN=zm(),hN=dN&&dN.isTypedArray,yQ=hN?gQ(hN):mQ;pN.exports=yQ});var iS=S((gye,mN)=>{"use strict";var bQ=K3(),vQ=Tf(),xQ=ut(),SQ=Ha(),wQ=tS(),kQ=Rf(),AQ=Object.prototype,CQ=AQ.hasOwnProperty;function OQ(t,e){var n=xQ(t),i=!n&&vQ(t),r=!n&&!i&&SQ(t),s=!n&&!i&&!r&&kQ(t),o=n||i||r||s,l=o?bQ(t.length,String):[],a=l.length;for(var c in t)(e||CQ.call(t,c))&&!(o&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||wQ(c,a)))&&l.push(c);return l}mN.exports=OQ});var Nf=S((yye,gN)=>{"use strict";var TQ=Object.prototype;function EQ(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||TQ;return t===n}gN.exports=EQ});var rS=S((bye,yN)=>{"use strict";function DQ(t,e){return function(n){return t(e(n))}}yN.exports=DQ});var vN=S((vye,bN)=>{"use strict";var MQ=rS(),RQ=MQ(Object.keys,Object);bN.exports=RQ});var Hm=S((xye,xN)=>{"use strict";var NQ=Nf(),LQ=vN(),IQ=Object.prototype,_Q=IQ.hasOwnProperty;function BQ(t){if(!NQ(t))return LQ(t);var e=[];for(var n in Object(t))_Q.call(t,n)&&n!="constructor"&&e.push(n);return e}xN.exports=BQ});var Bs=S((Sye,SN)=>{"use strict";var qQ=kf(),PQ=qm();function zQ(t){return t!=null&&PQ(t.length)&&!qQ(t)}SN.exports=zQ});var qs=S((wye,wN)=>{"use strict";var HQ=iS(),UQ=Hm(),FQ=Bs();function $Q(t){return FQ(t)?HQ(t):UQ(t)}wN.exports=$Q});var AN=S((kye,kN)=>{"use strict";var VQ=Of(),jQ=qs();function YQ(t,e){return t&&VQ(e,jQ(e),t)}kN.exports=YQ});var ON=S((Aye,CN)=>{"use strict";function KQ(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}CN.exports=KQ});var EN=S((Cye,TN)=>{"use strict";var GQ=Is(),QQ=Nf(),XQ=ON(),WQ=Object.prototype,ZQ=WQ.hasOwnProperty;function JQ(t){if(!GQ(t))return XQ(t);var e=QQ(t),n=[];for(var i in t)i=="constructor"&&(e||!ZQ.call(t,i))||n.push(i);return n}TN.exports=JQ});var Um=S((Oye,DN)=>{"use strict";var eX=iS(),tX=EN(),nX=Bs();function iX(t){return nX(t)?eX(t,!0):tX(t)}DN.exports=iX});var RN=S((Tye,MN)=>{"use strict";var rX=Of(),sX=Um();function oX(t,e){return t&&rX(e,sX(e),t)}MN.exports=oX});var BN=S((Lf,Fa)=>{"use strict";var lX=Si(),_N=typeof Lf=="object"&&Lf&&!Lf.nodeType&&Lf,NN=_N&&typeof Fa=="object"&&Fa&&!Fa.nodeType&&Fa,aX=NN&&NN.exports===_N,LN=aX?lX.Buffer:void 0,IN=LN?LN.allocUnsafe:void 0;function cX(t,e){if(e)return t.slice();var n=t.length,i=IN?IN(n):new t.constructor(n);return t.copy(i),i}Fa.exports=cX});var PN=S((Eye,qN)=>{"use strict";function uX(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}qN.exports=uX});var sS=S((Dye,zN)=>{"use strict";function fX(t,e){for(var n=-1,i=t==null?0:t.length,r=0,s=[];++n<i;){var o=t[n];e(o,n,t)&&(s[r++]=o)}return s}zN.exports=fX});var oS=S((Mye,HN)=>{"use strict";function dX(){return[]}HN.exports=dX});var Fm=S((Rye,FN)=>{"use strict";var hX=sS(),pX=oS(),mX=Object.prototype,gX=mX.propertyIsEnumerable,UN=Object.getOwnPropertySymbols,yX=UN?function(t){return t==null?[]:(t=Object(t),hX(UN(t),function(e){return gX.call(t,e)}))}:pX;FN.exports=yX});var VN=S((Nye,$N)=>{"use strict";var bX=Of(),vX=Fm();function xX(t,e){return bX(t,vX(t),e)}$N.exports=xX});var $m=S((Lye,jN)=>{"use strict";function SX(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}jN.exports=SX});var Vm=S((Iye,YN)=>{"use strict";var wX=rS(),kX=wX(Object.getPrototypeOf,Object);YN.exports=kX});var lS=S((_ye,KN)=>{"use strict";var AX=$m(),CX=Vm(),OX=Fm(),TX=oS(),EX=Object.getOwnPropertySymbols,DX=EX?function(t){for(var e=[];t;)AX(e,OX(t)),t=CX(t);return e}:TX;KN.exports=DX});var QN=S((Bye,GN)=>{"use strict";var MX=Of(),RX=lS();function NX(t,e){return MX(t,RX(t),e)}GN.exports=NX});var aS=S((qye,XN)=>{"use strict";var LX=$m(),IX=ut();function _X(t,e,n){var i=e(t);return IX(t)?i:LX(i,n(t))}XN.exports=_X});var cS=S((Pye,WN)=>{"use strict";var BX=aS(),qX=Fm(),PX=qs();function zX(t){return BX(t,PX,qX)}WN.exports=zX});var JN=S((zye,ZN)=>{"use strict";var HX=aS(),UX=lS(),FX=Um();function $X(t){return HX(t,FX,UX)}ZN.exports=$X});var tL=S((Hye,eL)=>{"use strict";var VX=_s(),jX=Si(),YX=VX(jX,"DataView");eL.exports=YX});var iL=S((Uye,nL)=>{"use strict";var KX=_s(),GX=Si(),QX=KX(GX,"Promise");nL.exports=QX});var uS=S((Fye,rL)=>{"use strict";var XX=_s(),WX=Si(),ZX=XX(WX,"Set");rL.exports=ZX});var oL=S(($ye,sL)=>{"use strict";var JX=_s(),eW=Si(),tW=JX(eW,"WeakMap");sL.exports=tW});var Fo=S((Vye,hL)=>{"use strict";var fS=tL(),dS=Lm(),hS=iL(),pS=uS(),mS=oL(),dL=Ho(),$a=Wx(),lL="[object Map]",nW="[object Object]",aL="[object Promise]",cL="[object Set]",uL="[object WeakMap]",fL="[object DataView]",iW=$a(fS),rW=$a(dS),sW=$a(hS),oW=$a(pS),lW=$a(mS),Uo=dL;(fS&&Uo(new fS(new ArrayBuffer(1)))!=fL||dS&&Uo(new dS)!=lL||hS&&Uo(hS.resolve())!=aL||pS&&Uo(new pS)!=cL||mS&&Uo(new mS)!=uL)&&(Uo=function(t){var e=dL(t),n=e==nW?t.constructor:void 0,i=n?$a(n):"";if(i)switch(i){case iW:return fL;case rW:return lL;case sW:return aL;case oW:return cL;case lW:return uL}return e});hL.exports=Uo});var mL=S((jye,pL)=>{"use strict";var aW=Object.prototype,cW=aW.hasOwnProperty;function uW(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&cW.call(t,"index")&&(n.index=t.index,n.input=t.input),n}pL.exports=uW});var gS=S((Yye,gL)=>{"use strict";var fW=Si(),dW=fW.Uint8Array;gL.exports=dW});var jm=S((Kye,bL)=>{"use strict";var yL=gS();function hW(t){var e=new t.constructor(t.byteLength);return new yL(e).set(new yL(t)),e}bL.exports=hW});var xL=S((Gye,vL)=>{"use strict";var pW=jm();function mW(t,e){var n=e?pW(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}vL.exports=mW});var wL=S((Qye,SL)=>{"use strict";var gW=/\w*$/;function yW(t){var e=new t.constructor(t.source,gW.exec(t));return e.lastIndex=t.lastIndex,e}SL.exports=yW});var TL=S((Xye,OL)=>{"use strict";var kL=zo(),AL=kL?kL.prototype:void 0,CL=AL?AL.valueOf:void 0;function bW(t){return CL?Object(CL.call(t)):{}}OL.exports=bW});var DL=S((Wye,EL)=>{"use strict";var vW=jm();function xW(t,e){var n=e?vW(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}EL.exports=xW});var RL=S((Zye,ML)=>{"use strict";var SW=jm(),wW=xL(),kW=wL(),AW=TL(),CW=DL(),OW="[object Boolean]",TW="[object Date]",EW="[object Map]",DW="[object Number]",MW="[object RegExp]",RW="[object Set]",NW="[object String]",LW="[object Symbol]",IW="[object ArrayBuffer]",_W="[object DataView]",BW="[object Float32Array]",qW="[object Float64Array]",PW="[object Int8Array]",zW="[object Int16Array]",HW="[object Int32Array]",UW="[object Uint8Array]",FW="[object Uint8ClampedArray]",$W="[object Uint16Array]",VW="[object Uint32Array]";function jW(t,e,n){var i=t.constructor;switch(e){case IW:return SW(t);case OW:case TW:return new i(+t);case _W:return wW(t,n);case BW:case qW:case PW:case zW:case HW:case UW:case FW:case $W:case VW:return CW(t,n);case EW:return new i;case DW:case NW:return new i(t);case MW:return kW(t);case RW:return new i;case LW:return AW(t)}}ML.exports=jW});var yS=S((Jye,LL)=>{"use strict";var YW=Is(),NL=Object.create,KW=(function(){function t(){}return function(e){if(!YW(e))return{};if(NL)return NL(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();LL.exports=KW});var _L=S((e0e,IL)=>{"use strict";var GW=yS(),QW=Vm(),XW=Nf();function WW(t){return typeof t.constructor=="function"&&!XW(t)?GW(QW(t)):{}}IL.exports=WW});var qL=S((t0e,BL)=>{"use strict";var ZW=Fo(),JW=Gi(),eZ="[object Map]";function tZ(t){return JW(t)&&ZW(t)==eZ}BL.exports=tZ});var UL=S((n0e,HL)=>{"use strict";var nZ=qL(),iZ=Pm(),PL=zm(),zL=PL&&PL.isMap,rZ=zL?iZ(zL):nZ;HL.exports=rZ});var $L=S((i0e,FL)=>{"use strict";var sZ=Fo(),oZ=Gi(),lZ="[object Set]";function aZ(t){return oZ(t)&&sZ(t)==lZ}FL.exports=aZ});var KL=S((r0e,YL)=>{"use strict";var cZ=$L(),uZ=Pm(),VL=zm(),jL=VL&&VL.isSet,fZ=jL?uZ(jL):cZ;YL.exports=fZ});var ZL=S((s0e,WL)=>{"use strict";var dZ=_m(),hZ=Bm(),pZ=eS(),mZ=AN(),gZ=RN(),yZ=BN(),bZ=PN(),vZ=VN(),xZ=QN(),SZ=cS(),wZ=JN(),kZ=Fo(),AZ=mL(),CZ=RL(),OZ=_L(),TZ=ut(),EZ=Ha(),DZ=UL(),MZ=Is(),RZ=KL(),NZ=qs(),LZ=Um(),IZ=1,_Z=2,BZ=4,GL="[object Arguments]",qZ="[object Array]",PZ="[object Boolean]",zZ="[object Date]",HZ="[object Error]",QL="[object Function]",UZ="[object GeneratorFunction]",FZ="[object Map]",$Z="[object Number]",XL="[object Object]",VZ="[object RegExp]",jZ="[object Set]",YZ="[object String]",KZ="[object Symbol]",GZ="[object WeakMap]",QZ="[object ArrayBuffer]",XZ="[object DataView]",WZ="[object Float32Array]",ZZ="[object Float64Array]",JZ="[object Int8Array]",eJ="[object Int16Array]",tJ="[object Int32Array]",nJ="[object Uint8Array]",iJ="[object Uint8ClampedArray]",rJ="[object Uint16Array]",sJ="[object Uint32Array]",Re={};Re[GL]=Re[qZ]=Re[QZ]=Re[XZ]=Re[PZ]=Re[zZ]=Re[WZ]=Re[ZZ]=Re[JZ]=Re[eJ]=Re[tJ]=Re[FZ]=Re[$Z]=Re[XL]=Re[VZ]=Re[jZ]=Re[YZ]=Re[KZ]=Re[nJ]=Re[iJ]=Re[rJ]=Re[sJ]=!0;Re[HZ]=Re[QL]=Re[GZ]=!1;function Ym(t,e,n,i,r,s){var o,l=e&IZ,a=e&_Z,c=e&BZ;if(n&&(o=r?n(t,i,r,s):n(t)),o!==void 0)return o;if(!MZ(t))return t;var u=TZ(t);if(u){if(o=AZ(t),!l)return bZ(t,o)}else{var f=kZ(t),d=f==QL||f==UZ;if(EZ(t))return yZ(t,l);if(f==XL||f==GL||d&&!r){if(o=a||d?{}:OZ(t),!l)return a?xZ(t,gZ(o,t)):vZ(t,mZ(o,t))}else{if(!Re[f])return r?t:{};o=CZ(t,f,l)}}s||(s=new dZ);var h=s.get(t);if(h)return h;s.set(t,o),RZ(t)?t.forEach(function(b){o.add(Ym(b,e,n,b,t,s))}):DZ(t)&&t.forEach(function(b,p){o.set(p,Ym(b,e,n,p,t,s))});var m=c?a?wZ:SZ:a?LZ:NZ,g=u?void 0:m(t);return hZ(g||t,function(b,p){g&&(p=b,b=t[p]),pZ(o,p,Ym(b,e,n,p,t,s))}),o}WL.exports=Ym});var e4=S((o0e,JL)=>{"use strict";var oJ=ZL(),lJ=4;function aJ(t){return oJ(t,lJ)}JL.exports=aJ});var bS=S((l0e,t4)=>{"use strict";function cJ(t){return function(){return t}}t4.exports=cJ});var i4=S((a0e,n4)=>{"use strict";function uJ(t){return function(e,n,i){for(var r=-1,s=Object(e),o=i(e),l=o.length;l--;){var a=o[t?l:++r];if(n(s[a],a,s)===!1)break}return e}}n4.exports=uJ});var s4=S((c0e,r4)=>{"use strict";var fJ=i4(),dJ=fJ();r4.exports=dJ});var vS=S((u0e,o4)=>{"use strict";var hJ=s4(),pJ=qs();function mJ(t,e){return t&&hJ(t,e,pJ)}o4.exports=mJ});var a4=S((f0e,l4)=>{"use strict";var gJ=Bs();function yJ(t,e){return function(n,i){if(n==null)return n;if(!gJ(n))return t(n,i);for(var r=n.length,s=e?r:-1,o=Object(n);(e?s--:++s<r)&&i(o[s],s,o)!==!1;);return n}}l4.exports=yJ});var If=S((d0e,c4)=>{"use strict";var bJ=vS(),vJ=a4(),xJ=vJ(bJ);c4.exports=xJ});var _f=S((h0e,u4)=>{"use strict";function SJ(t){return t}u4.exports=SJ});var d4=S((p0e,f4)=>{"use strict";var wJ=_f();function kJ(t){return typeof t=="function"?t:wJ}f4.exports=kJ});var p4=S((m0e,h4)=>{"use strict";var AJ=Bm(),CJ=If(),OJ=d4(),TJ=ut();function EJ(t,e){var n=TJ(t)?AJ:CJ;return n(t,OJ(e))}h4.exports=EJ});var g4=S((g0e,m4)=>{"use strict";m4.exports=p4()});var b4=S((y0e,y4)=>{"use strict";var DJ=If();function MJ(t,e){var n=[];return DJ(t,function(i,r,s){e(i,r,s)&&n.push(i)}),n}y4.exports=MJ});var x4=S((b0e,v4)=>{"use strict";var RJ="__lodash_hash_undefined__";function NJ(t){return this.__data__.set(t,RJ),this}v4.exports=NJ});var w4=S((v0e,S4)=>{"use strict";function LJ(t){return this.__data__.has(t)}S4.exports=LJ});var xS=S((x0e,k4)=>{"use strict";var IJ=Im(),_J=x4(),BJ=w4();function Km(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new IJ;++e<n;)this.add(t[e])}Km.prototype.add=Km.prototype.push=_J;Km.prototype.has=BJ;k4.exports=Km});var C4=S((S0e,A4)=>{"use strict";function qJ(t,e){for(var n=-1,i=t==null?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}A4.exports=qJ});var SS=S((w0e,O4)=>{"use strict";function PJ(t,e){return t.has(e)}O4.exports=PJ});var wS=S((k0e,T4)=>{"use strict";var zJ=xS(),HJ=C4(),UJ=SS(),FJ=1,$J=2;function VJ(t,e,n,i,r,s){var o=n&FJ,l=t.length,a=e.length;if(l!=a&&!(o&&a>l))return!1;var c=s.get(t),u=s.get(e);if(c&&u)return c==e&&u==t;var f=-1,d=!0,h=n&$J?new zJ:void 0;for(s.set(t,e),s.set(e,t);++f<l;){var m=t[f],g=e[f];if(i)var b=o?i(g,m,f,e,t,s):i(m,g,f,t,e,s);if(b!==void 0){if(b)continue;d=!1;break}if(h){if(!HJ(e,function(p,y){if(!UJ(h,y)&&(m===p||r(m,p,n,i,s)))return h.push(y)})){d=!1;break}}else if(!(m===g||r(m,g,n,i,s))){d=!1;break}}return s.delete(t),s.delete(e),d}T4.exports=VJ});var D4=S((A0e,E4)=>{"use strict";function jJ(t){var e=-1,n=Array(t.size);return t.forEach(function(i,r){n[++e]=[r,i]}),n}E4.exports=jJ});var Gm=S((C0e,M4)=>{"use strict";function YJ(t){var e=-1,n=Array(t.size);return t.forEach(function(i){n[++e]=i}),n}M4.exports=YJ});var _4=S((O0e,I4)=>{"use strict";var R4=zo(),N4=gS(),KJ=Nm(),GJ=wS(),QJ=D4(),XJ=Gm(),WJ=1,ZJ=2,JJ="[object Boolean]",eee="[object Date]",tee="[object Error]",nee="[object Map]",iee="[object Number]",ree="[object RegExp]",see="[object Set]",oee="[object String]",lee="[object Symbol]",aee="[object ArrayBuffer]",cee="[object DataView]",L4=R4?R4.prototype:void 0,kS=L4?L4.valueOf:void 0;function uee(t,e,n,i,r,s,o){switch(n){case cee:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case aee:return!(t.byteLength!=e.byteLength||!s(new N4(t),new N4(e)));case JJ:case eee:case iee:return KJ(+t,+e);case tee:return t.name==e.name&&t.message==e.message;case ree:case oee:return t==e+"";case nee:var l=QJ;case see:var a=i&WJ;if(l||(l=XJ),t.size!=e.size&&!a)return!1;var c=o.get(t);if(c)return c==e;i|=ZJ,o.set(t,e);var u=GJ(l(t),l(e),i,r,s,o);return o.delete(t),u;case lee:if(kS)return kS.call(t)==kS.call(e)}return!1}I4.exports=uee});var P4=S((T0e,q4)=>{"use strict";var B4=cS(),fee=1,dee=Object.prototype,hee=dee.hasOwnProperty;function pee(t,e,n,i,r,s){var o=n&fee,l=B4(t),a=l.length,c=B4(e),u=c.length;if(a!=u&&!o)return!1;for(var f=a;f--;){var d=l[f];if(!(o?d in e:hee.call(e,d)))return!1}var h=s.get(t),m=s.get(e);if(h&&m)return h==e&&m==t;var g=!0;s.set(t,e),s.set(e,t);for(var b=o;++f<a;){d=l[f];var p=t[d],y=e[d];if(i)var v=o?i(y,p,d,e,t,s):i(p,y,d,t,e,s);if(!(v===void 0?p===y||r(p,y,n,i,s):v)){g=!1;break}b||(b=d=="constructor")}if(g&&!b){var x=t.constructor,k=e.constructor;x!=k&&"constructor"in t&&"constructor"in e&&!(typeof x=="function"&&x instanceof x&&typeof k=="function"&&k instanceof k)&&(g=!1)}return s.delete(t),s.delete(e),g}q4.exports=pee});var Y4=S((E0e,j4)=>{"use strict";var AS=_m(),mee=wS(),gee=_4(),yee=P4(),z4=Fo(),H4=ut(),U4=Ha(),bee=Rf(),vee=1,F4="[object Arguments]",$4="[object Array]",Qm="[object Object]",xee=Object.prototype,V4=xee.hasOwnProperty;function See(t,e,n,i,r,s){var o=H4(t),l=H4(e),a=o?$4:z4(t),c=l?$4:z4(e);a=a==F4?Qm:a,c=c==F4?Qm:c;var u=a==Qm,f=c==Qm,d=a==c;if(d&&U4(t)){if(!U4(e))return!1;o=!0,u=!1}if(d&&!u)return s||(s=new AS),o||bee(t)?mee(t,e,n,i,r,s):gee(t,e,a,n,i,r,s);if(!(n&vee)){var h=u&&V4.call(t,"__wrapped__"),m=f&&V4.call(e,"__wrapped__");if(h||m){var g=h?t.value():t,b=m?e.value():e;return s||(s=new AS),r(g,b,n,i,s)}}return d?(s||(s=new AS),yee(t,e,n,i,r,s)):!1}j4.exports=See});var CS=S((D0e,Q4)=>{"use strict";var wee=Y4(),K4=Gi();function G4(t,e,n,i,r){return t===e?!0:t==null||e==null||!K4(t)&&!K4(e)?t!==t&&e!==e:wee(t,e,n,i,G4,r)}Q4.exports=G4});var W4=S((M0e,X4)=>{"use strict";var kee=_m(),Aee=CS(),Cee=1,Oee=2;function Tee(t,e,n,i){var r=n.length,s=r,o=!i;if(t==null)return!s;for(t=Object(t);r--;){var l=n[r];if(o&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++r<s;){l=n[r];var a=l[0],c=t[a],u=l[1];if(o&&l[2]){if(c===void 0&&!(a in t))return!1}else{var f=new kee;if(i)var d=i(c,u,a,t,e,f);if(!(d===void 0?Aee(u,c,Cee|Oee,i,f):d))return!1}}return!0}X4.exports=Tee});var OS=S((R0e,Z4)=>{"use strict";var Eee=Is();function Dee(t){return t===t&&!Eee(t)}Z4.exports=Dee});var e6=S((N0e,J4)=>{"use strict";var Mee=OS(),Ree=qs();function Nee(t){for(var e=Ree(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,Mee(r)]}return e}J4.exports=Nee});var TS=S((L0e,t6)=>{"use strict";function Lee(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}t6.exports=Lee});var i6=S((I0e,n6)=>{"use strict";var Iee=W4(),_ee=e6(),Bee=TS();function qee(t){var e=_ee(t);return e.length==1&&e[0][2]?Bee(e[0][0],e[0][1]):function(n){return n===t||Iee(n,t,e)}}n6.exports=qee});var Xm=S((_0e,r6)=>{"use strict";var Pee=Ho(),zee=Gi(),Hee="[object Symbol]";function Uee(t){return typeof t=="symbol"||zee(t)&&Pee(t)==Hee}r6.exports=Uee});var Wm=S((B0e,s6)=>{"use strict";var Fee=ut(),$ee=Xm(),Vee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jee=/^\w*$/;function Yee(t,e){if(Fee(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||$ee(t)?!0:jee.test(t)||!Vee.test(t)||e!=null&&t in Object(e)}s6.exports=Yee});var a6=S((q0e,l6)=>{"use strict";var o6=Im(),Kee="Expected a function";function ES(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Kee);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(ES.Cache||o6),n}ES.Cache=o6;l6.exports=ES});var u6=S((P0e,c6)=>{"use strict";var Gee=a6(),Qee=500;function Xee(t){var e=Gee(t,function(i){return n.size===Qee&&n.clear(),i}),n=e.cache;return e}c6.exports=Xee});var d6=S((z0e,f6)=>{"use strict";var Wee=u6(),Zee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jee=/\\(\\)?/g,ete=Wee(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Zee,function(n,i,r,s){e.push(r?s.replace(Jee,"$1"):i||n)}),e});f6.exports=ete});var Zm=S((H0e,h6)=>{"use strict";function tte(t,e){for(var n=-1,i=t==null?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}h6.exports=tte});var v6=S((U0e,b6)=>{"use strict";var p6=zo(),nte=Zm(),ite=ut(),rte=Xm(),ste=1/0,m6=p6?p6.prototype:void 0,g6=m6?m6.toString:void 0;function y6(t){if(typeof t=="string")return t;if(ite(t))return nte(t,y6)+"";if(rte(t))return g6?g6.call(t):"";var e=t+"";return e=="0"&&1/t==-ste?"-0":e}b6.exports=y6});var S6=S((F0e,x6)=>{"use strict";var ote=v6();function lte(t){return t==null?"":ote(t)}x6.exports=lte});var DS=S(($0e,w6)=>{"use strict";var ate=ut(),cte=Wm(),ute=d6(),fte=S6();function dte(t,e){return ate(t)?t:cte(t,e)?[t]:ute(fte(t))}w6.exports=dte});var Bf=S((V0e,k6)=>{"use strict";var hte=Xm(),pte=1/0;function mte(t){if(typeof t=="string"||hte(t))return t;var e=t+"";return e=="0"&&1/t==-pte?"-0":e}k6.exports=mte});var MS=S((j0e,A6)=>{"use strict";var gte=DS(),yte=Bf();function bte(t,e){e=gte(e,t);for(var n=0,i=e.length;t!=null&&n<i;)t=t[yte(e[n++])];return n&&n==i?t:void 0}A6.exports=bte});var O6=S((Y0e,C6)=>{"use strict";var vte=MS();function xte(t,e,n){var i=t==null?void 0:vte(t,e);return i===void 0?n:i}C6.exports=xte});var E6=S((K0e,T6)=>{"use strict";function Ste(t,e){return t!=null&&e in Object(t)}T6.exports=Ste});var RS=S((G0e,D6)=>{"use strict";var wte=DS(),kte=Tf(),Ate=ut(),Cte=tS(),Ote=qm(),Tte=Bf();function Ete(t,e,n){e=wte(e,t);for(var i=-1,r=e.length,s=!1;++i<r;){var o=Tte(e[i]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++i!=r?s:(r=t==null?0:t.length,!!r&&Ote(r)&&Cte(o,r)&&(Ate(t)||kte(t)))}D6.exports=Ete});var R6=S((Q0e,M6)=>{"use strict";var Dte=E6(),Mte=RS();function Rte(t,e){return t!=null&&Mte(t,e,Dte)}M6.exports=Rte});var L6=S((X0e,N6)=>{"use strict";var Nte=CS(),Lte=O6(),Ite=R6(),_te=Wm(),Bte=OS(),qte=TS(),Pte=Bf(),zte=1,Hte=2;function Ute(t,e){return _te(t)&&Bte(e)?qte(Pte(t),e):function(n){var i=Lte(n,t);return i===void 0&&i===e?Ite(n,t):Nte(e,i,zte|Hte)}}N6.exports=Ute});var NS=S((W0e,I6)=>{"use strict";function Fte(t){return function(e){return e?.[t]}}I6.exports=Fte});var B6=S((Z0e,_6)=>{"use strict";var $te=MS();function Vte(t){return function(e){return $te(e,t)}}_6.exports=Vte});var P6=S((J0e,q6)=>{"use strict";var jte=NS(),Yte=B6(),Kte=Wm(),Gte=Bf();function Qte(t){return Kte(t)?jte(Gte(t)):Yte(t)}q6.exports=Qte});var qf=S((ebe,z6)=>{"use strict";var Xte=i6(),Wte=L6(),Zte=_f(),Jte=ut(),ene=P6();function tne(t){return typeof t=="function"?t:t==null?Zte:typeof t=="object"?Jte(t)?Wte(t[0],t[1]):Xte(t):ene(t)}z6.exports=tne});var U6=S((tbe,H6)=>{"use strict";var nne=sS(),ine=b4(),rne=qf(),sne=ut();function one(t,e){var n=sne(t)?nne:ine;return n(t,rne(e,3))}H6.exports=one});var $6=S((nbe,F6)=>{"use strict";var lne=Object.prototype,ane=lne.hasOwnProperty;function cne(t,e){return t!=null&&ane.call(t,e)}F6.exports=cne});var j6=S((ibe,V6)=>{"use strict";var une=$6(),fne=RS();function dne(t,e){return t!=null&&fne(t,e,une)}V6.exports=dne});var K6=S((rbe,Y6)=>{"use strict";var hne=Hm(),pne=Fo(),mne=Tf(),gne=ut(),yne=Bs(),bne=Ha(),vne=Nf(),xne=Rf(),Sne="[object Map]",wne="[object Set]",kne=Object.prototype,Ane=kne.hasOwnProperty;function Cne(t){if(t==null)return!0;if(yne(t)&&(gne(t)||typeof t=="string"||typeof t.splice=="function"||bne(t)||xne(t)||mne(t)))return!t.length;var e=pne(t);if(e==Sne||e==wne)return!t.size;if(vne(t))return!hne(t).length;for(var n in t)if(Ane.call(t,n))return!1;return!0}Y6.exports=Cne});var Q6=S((sbe,G6)=>{"use strict";function One(t){return t===void 0}G6.exports=One});var W6=S((obe,X6)=>{"use strict";var Tne=If(),Ene=Bs();function Dne(t,e){var n=-1,i=Ene(t)?Array(t.length):[];return Tne(t,function(r,s,o){i[++n]=e(r,s,o)}),i}X6.exports=Dne});var J6=S((lbe,Z6)=>{"use strict";var Mne=Zm(),Rne=qf(),Nne=W6(),Lne=ut();function Ine(t,e){var n=Lne(t)?Mne:Nne;return n(t,Rne(e,3))}Z6.exports=Ine});var t8=S((abe,e8)=>{"use strict";function _ne(t,e,n,i){var r=-1,s=t==null?0:t.length;for(i&&s&&(n=t[++r]);++r<s;)n=e(n,t[r],r,t);return n}e8.exports=_ne});var i8=S((cbe,n8)=>{"use strict";function Bne(t,e,n,i,r){return r(t,function(s,o,l){n=i?(i=!1,s):e(n,s,o,l)}),n}n8.exports=Bne});var s8=S((ube,r8)=>{"use strict";var qne=t8(),Pne=If(),zne=qf(),Hne=i8(),Une=ut();function Fne(t,e,n){var i=Une(t)?qne:Hne,r=arguments.length<3;return i(t,zne(e,4),n,r,Pne)}r8.exports=Fne});var l8=S((fbe,o8)=>{"use strict";var $ne=Ho(),Vne=ut(),jne=Gi(),Yne="[object String]";function Kne(t){return typeof t=="string"||!Vne(t)&&jne(t)&&$ne(t)==Yne}o8.exports=Kne});var c8=S((dbe,a8)=>{"use strict";var Gne=NS(),Qne=Gne("length");a8.exports=Qne});var f8=S((hbe,u8)=>{"use strict";var Xne="\\ud800-\\udfff",Wne="\\u0300-\\u036f",Zne="\\ufe20-\\ufe2f",Jne="\\u20d0-\\u20ff",eie=Wne+Zne+Jne,tie="\\ufe0e\\ufe0f",nie="\\u200d",iie=RegExp("["+nie+Xne+eie+tie+"]");function rie(t){return iie.test(t)}u8.exports=rie});var x8=S((pbe,v8)=>{"use strict";var h8="\\ud800-\\udfff",sie="\\u0300-\\u036f",oie="\\ufe20-\\ufe2f",lie="\\u20d0-\\u20ff",aie=sie+oie+lie,cie="\\ufe0e\\ufe0f",uie="["+h8+"]",LS="["+aie+"]",IS="\\ud83c[\\udffb-\\udfff]",fie="(?:"+LS+"|"+IS+")",p8="[^"+h8+"]",m8="(?:\\ud83c[\\udde6-\\uddff]){2}",g8="[\\ud800-\\udbff][\\udc00-\\udfff]",die="\\u200d",y8=fie+"?",b8="["+cie+"]?",hie="(?:"+die+"(?:"+[p8,m8,g8].join("|")+")"+b8+y8+")*",pie=b8+y8+hie,mie="(?:"+[p8+LS+"?",LS,m8,g8,uie].join("|")+")",d8=RegExp(IS+"(?="+IS+")|"+mie+pie,"g");function gie(t){for(var e=d8.lastIndex=0;d8.test(t);)++e;return e}v8.exports=gie});var w8=S((mbe,S8)=>{"use strict";var yie=c8(),bie=f8(),vie=x8();function xie(t){return bie(t)?vie(t):yie(t)}S8.exports=xie});var A8=S((gbe,k8)=>{"use strict";var Sie=Hm(),wie=Fo(),kie=Bs(),Aie=l8(),Cie=w8(),Oie="[object Map]",Tie="[object Set]";function Eie(t){if(t==null)return 0;if(kie(t))return Aie(t)?Cie(t):t.length;var e=wie(t);return e==Oie||e==Tie?t.size:Sie(t).length}k8.exports=Eie});var O8=S((ybe,C8)=>{"use strict";var Die=Bm(),Mie=yS(),Rie=vS(),Nie=qf(),Lie=Vm(),Iie=ut(),_ie=Ha(),Bie=kf(),qie=Is(),Pie=Rf();function zie(t,e,n){var i=Iie(t),r=i||_ie(t)||Pie(t);if(e=Nie(e,4),n==null){var s=t&&t.constructor;r?n=i?new s:[]:qie(t)?n=Bie(s)?Mie(Lie(t)):{}:n={}}return(r?Die:Rie)(t,function(o,l,a){return e(n,o,l,a)}),n}C8.exports=zie});var M8=S((bbe,D8)=>{"use strict";var T8=zo(),Hie=Tf(),Uie=ut(),E8=T8?T8.isConcatSpreadable:void 0;function Fie(t){return Uie(t)||Hie(t)||!!(E8&&t&&t[E8])}D8.exports=Fie});var L8=S((vbe,N8)=>{"use strict";var $ie=$m(),Vie=M8();function R8(t,e,n,i,r){var s=-1,o=t.length;for(n||(n=Vie),r||(r=[]);++s<o;){var l=t[s];e>0&&n(l)?e>1?R8(l,e-1,n,i,r):$ie(r,l):i||(r[r.length]=l)}return r}N8.exports=R8});var _8=S((xbe,I8)=>{"use strict";function jie(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}I8.exports=jie});var P8=S((Sbe,q8)=>{"use strict";var Yie=_8(),B8=Math.max;function Kie(t,e,n){return e=B8(e===void 0?t.length-1:e,0),function(){for(var i=arguments,r=-1,s=B8(i.length-e,0),o=Array(s);++r<s;)o[r]=i[e+r];r=-1;for(var l=Array(e+1);++r<e;)l[r]=i[r];return l[e]=n(o),Yie(t,this,l)}}q8.exports=Kie});var U8=S((wbe,H8)=>{"use strict";var Gie=bS(),z8=Zx(),Qie=_f(),Xie=z8?function(t,e){return z8(t,"toString",{configurable:!0,enumerable:!1,value:Gie(e),writable:!0})}:Qie;H8.exports=Xie});var $8=S((kbe,F8)=>{"use strict";var Wie=800,Zie=16,Jie=Date.now;function ere(t){var e=0,n=0;return function(){var i=Jie(),r=Zie-(i-n);if(n=i,r>0){if(++e>=Wie)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}F8.exports=ere});var j8=S((Abe,V8)=>{"use strict";var tre=U8(),nre=$8(),ire=nre(tre);V8.exports=ire});var K8=S((Cbe,Y8)=>{"use strict";var rre=_f(),sre=P8(),ore=j8();function lre(t,e){return ore(sre(t,e,rre),t+"")}Y8.exports=lre});var Q8=S((Obe,G8)=>{"use strict";function are(t,e,n,i){for(var r=t.length,s=n+(i?1:-1);i?s--:++s<r;)if(e(t[s],s,t))return s;return-1}G8.exports=are});var W8=S((Tbe,X8)=>{"use strict";function cre(t){return t!==t}X8.exports=cre});var J8=S((Ebe,Z8)=>{"use strict";function ure(t,e,n){for(var i=n-1,r=t.length;++i<r;)if(t[i]===e)return i;return-1}Z8.exports=ure});var tI=S((Dbe,eI)=>{"use strict";var fre=Q8(),dre=W8(),hre=J8();function pre(t,e,n){return e===e?hre(t,e,n):fre(t,dre,n)}eI.exports=pre});var iI=S((Mbe,nI)=>{"use strict";var mre=tI();function gre(t,e){var n=t==null?0:t.length;return!!n&&mre(t,e,0)>-1}nI.exports=gre});var sI=S((Rbe,rI)=>{"use strict";function yre(t,e,n){for(var i=-1,r=t==null?0:t.length;++i<r;)if(n(e,t[i]))return!0;return!1}rI.exports=yre});var lI=S((Nbe,oI)=>{"use strict";function bre(){}oI.exports=bre});var cI=S((Lbe,aI)=>{"use strict";var _S=uS(),vre=lI(),xre=Gm(),Sre=1/0,wre=_S&&1/xre(new _S([,-0]))[1]==Sre?function(t){return new _S(t)}:vre;aI.exports=wre});var fI=S((Ibe,uI)=>{"use strict";var kre=xS(),Are=iI(),Cre=sI(),Ore=SS(),Tre=cI(),Ere=Gm(),Dre=200;function Mre(t,e,n){var i=-1,r=Are,s=t.length,o=!0,l=[],a=l;if(n)o=!1,r=Cre;else if(s>=Dre){var c=e?null:Tre(t);if(c)return Ere(c);o=!1,r=Ore,a=new kre}else a=e?[]:l;e:for(;++i<s;){var u=t[i],f=e?e(u):u;if(u=n||u!==0?u:0,o&&f===f){for(var d=a.length;d--;)if(a[d]===f)continue e;e&&a.push(f),l.push(u)}else r(a,f,n)||(a!==l&&a.push(f),l.push(u))}return l}uI.exports=Mre});var hI=S((_be,dI)=>{"use strict";var Rre=Bs(),Nre=Gi();function Lre(t){return Nre(t)&&Rre(t)}dI.exports=Lre});var mI=S((Bbe,pI)=>{"use strict";var Ire=L8(),_re=K8(),Bre=fI(),qre=hI(),Pre=_re(function(t){return Bre(Ire(t,1,qre,!0))});pI.exports=Pre});var yI=S((qbe,gI)=>{"use strict";var zre=Zm();function Hre(t,e){return zre(e,function(n){return t[n]})}gI.exports=Hre});var vI=S((Pbe,bI)=>{"use strict";var Ure=yI(),Fre=qs();function $re(t){return t==null?[]:Ure(t,Fre(t))}bI.exports=$re});var En=S((zbe,xI)=>{"use strict";var Jm;if(typeof ZS=="function")try{Jm={clone:e4(),constant:bS(),each:g4(),filter:U6(),has:j6(),isArray:ut(),isEmpty:K6(),isFunction:kf(),isUndefined:Q6(),keys:qs(),map:J6(),reduce:s8(),size:A8(),transform:O8(),union:mI(),values:vI()}}catch{}Jm||(Jm=window._);xI.exports=Jm});var eg=S((Ube,AI)=>{"use strict";var Q=En();AI.exports=ie;var Vre="\0",$o="\0",SI="";function ie(t){this._isDirected=Q.has(t,"directed")?t.directed:!0,this._isMultigraph=Q.has(t,"multigraph")?t.multigraph:!1,this._isCompound=Q.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Q.constant(void 0),this._defaultEdgeLabelFn=Q.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[$o]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}ie.prototype._nodeCount=0;ie.prototype._edgeCount=0;ie.prototype.isDirected=function(){return this._isDirected};ie.prototype.isMultigraph=function(){return this._isMultigraph};ie.prototype.isCompound=function(){return this._isCompound};ie.prototype.setGraph=function(t){return this._label=t,this};ie.prototype.graph=function(){return this._label};ie.prototype.setDefaultNodeLabel=function(t){return Q.isFunction(t)||(t=Q.constant(t)),this._defaultNodeLabelFn=t,this};ie.prototype.nodeCount=function(){return this._nodeCount};ie.prototype.nodes=function(){return Q.keys(this._nodes)};ie.prototype.sources=function(){var t=this;return Q.filter(this.nodes(),function(e){return Q.isEmpty(t._in[e])})};ie.prototype.sinks=function(){var t=this;return Q.filter(this.nodes(),function(e){return Q.isEmpty(t._out[e])})};ie.prototype.setNodes=function(t,e){var n=arguments,i=this;return Q.each(t,function(r){n.length>1?i.setNode(r,e):i.setNode(r)}),this};ie.prototype.setNode=function(t,e){return Q.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=$o,this._children[t]={},this._children[$o][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};ie.prototype.node=function(t){return this._nodes[t]};ie.prototype.hasNode=function(t){return Q.has(this._nodes,t)};ie.prototype.removeNode=function(t){var e=this;if(Q.has(this._nodes,t)){var n=function(i){e.removeEdge(e._edgeObjs[i])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],Q.each(this.children(t),function(i){e.setParent(i)}),delete this._children[t]),Q.each(Q.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],Q.each(Q.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};ie.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Q.isUndefined(e))e=$o;else{e+="";for(var n=e;!Q.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this};ie.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};ie.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==$o)return e}};ie.prototype.children=function(t){if(Q.isUndefined(t)&&(t=$o),this._isCompound){var e=this._children[t];if(e)return Q.keys(e)}else{if(t===$o)return this.nodes();if(this.hasNode(t))return[]}};ie.prototype.predecessors=function(t){var e=this._preds[t];if(e)return Q.keys(e)};ie.prototype.successors=function(t){var e=this._sucs[t];if(e)return Q.keys(e)};ie.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return Q.union(e,this.successors(t))};ie.prototype.isLeaf=function(t){var e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0};ie.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;Q.each(this._nodes,function(s,o){t(o)&&e.setNode(o,s)}),Q.each(this._edgeObjs,function(s){e.hasNode(s.v)&&e.hasNode(s.w)&&e.setEdge(s,n.edge(s))});var i={};function r(s){var o=n.parent(s);return o===void 0||e.hasNode(o)?(i[s]=o,o):o in i?i[o]:r(o)}return this._isCompound&&Q.each(e.nodes(),function(s){e.setParent(s,r(s))}),e};ie.prototype.setDefaultEdgeLabel=function(t){return Q.isFunction(t)||(t=Q.constant(t)),this._defaultEdgeLabelFn=t,this};ie.prototype.edgeCount=function(){return this._edgeCount};ie.prototype.edges=function(){return Q.values(this._edgeObjs)};ie.prototype.setPath=function(t,e){var n=this,i=arguments;return Q.reduce(t,function(r,s){return i.length>1?n.setEdge(r,s,e):n.setEdge(r,s),s}),this};ie.prototype.setEdge=function(){var t,e,n,i,r=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(t=s.v,e=s.w,n=s.name,arguments.length===2&&(i=arguments[1],r=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),t=""+t,e=""+e,Q.isUndefined(n)||(n=""+n);var o=Pf(this._isDirected,t,e,n);if(Q.has(this._edgeLabels,o))return r&&(this._edgeLabels[o]=i),this;if(!Q.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[o]=r?i:this._defaultEdgeLabelFn(t,e,n);var l=jre(this._isDirected,t,e,n);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[o]=l,wI(this._preds[e],t),wI(this._sucs[t],e),this._in[e][o]=l,this._out[t][o]=l,this._edgeCount++,this};ie.prototype.edge=function(t,e,n){var i=arguments.length===1?BS(this._isDirected,arguments[0]):Pf(this._isDirected,t,e,n);return this._edgeLabels[i]};ie.prototype.hasEdge=function(t,e,n){var i=arguments.length===1?BS(this._isDirected,arguments[0]):Pf(this._isDirected,t,e,n);return Q.has(this._edgeLabels,i)};ie.prototype.removeEdge=function(t,e,n){var i=arguments.length===1?BS(this._isDirected,arguments[0]):Pf(this._isDirected,t,e,n),r=this._edgeObjs[i];return r&&(t=r.v,e=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],kI(this._preds[e],t),kI(this._sucs[t],e),delete this._in[e][i],delete this._out[t][i],this._edgeCount--),this};ie.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=Q.values(n);return e?Q.filter(i,function(r){return r.v===e}):i}};ie.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=Q.values(n);return e?Q.filter(i,function(r){return r.w===e}):i}};ie.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};function wI(t,e){t[e]?t[e]++:t[e]=1}function kI(t,e){--t[e]||delete t[e]}function Pf(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var o=r;r=s,s=o}return r+SI+s+SI+(Q.isUndefined(i)?Vre:i)}function jre(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var o=r;r=s,s=o}var l={v:r,w:s};return i&&(l.name=i),l}function BS(t,e){return Pf(t,e.v,e.w,e.name)}});var OI=S((Fbe,CI)=>{"use strict";CI.exports="2.1.8"});var EI=S(($be,TI)=>{"use strict";TI.exports={Graph:eg(),version:OI()}});var MI=S((Vbe,DI)=>{"use strict";var Qi=En(),Yre=eg();DI.exports={write:Kre,read:Xre};function Kre(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:Gre(t),edges:Qre(t)};return Qi.isUndefined(t.graph())||(e.value=Qi.clone(t.graph())),e}function Gre(t){return Qi.map(t.nodes(),function(e){var n=t.node(e),i=t.parent(e),r={v:e};return Qi.isUndefined(n)||(r.value=n),Qi.isUndefined(i)||(r.parent=i),r})}function Qre(t){return Qi.map(t.edges(),function(e){var n=t.edge(e),i={v:e.v,w:e.w};return Qi.isUndefined(e.name)||(i.name=e.name),Qi.isUndefined(n)||(i.value=n),i})}function Xre(t){var e=new Yre(t.options).setGraph(t.value);return Qi.each(t.nodes,function(n){e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),Qi.each(t.edges,function(n){e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}});var NI=S((jbe,RI)=>{"use strict";var tg=En();RI.exports=Wre;function Wre(t){var e={},n=[],i;function r(s){tg.has(e,s)||(e[s]=!0,i.push(s),tg.each(t.successors(s),r),tg.each(t.predecessors(s),r))}return tg.each(t.nodes(),function(s){i=[],r(s),i.length&&n.push(i)}),n}});var qS=S((Ybe,II)=>{"use strict";var LI=En();II.exports=Xn;function Xn(){this._arr=[],this._keyIndices={}}Xn.prototype.size=function(){return this._arr.length};Xn.prototype.keys=function(){return this._arr.map(function(t){return t.key})};Xn.prototype.has=function(t){return LI.has(this._keyIndices,t)};Xn.prototype.priority=function(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority};Xn.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};Xn.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!LI.has(n,t)){var i=this._arr,r=i.length;return n[t]=r,i.push({key:t,priority:e}),this._decrease(r),!0}return!1};Xn.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key};Xn.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)};Xn.prototype._heapify=function(t){var e=this._arr,n=2*t,i=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,i<e.length&&(r=e[i].priority<e[r].priority?i:r),r!==t&&(this._swap(t,r),this._heapify(r)))};Xn.prototype._decrease=function(t){for(var e=this._arr,n=e[t].priority,i;t!==0&&(i=t>>1,!(e[i].priority<n));)this._swap(t,i),t=i};Xn.prototype._swap=function(t,e){var n=this._arr,i=this._keyIndices,r=n[t],s=n[e];n[t]=s,n[e]=r,i[s.key]=t,i[r.key]=e}});var PS=S((Kbe,_I)=>{"use strict";var Zre=En(),Jre=qS();_I.exports=tse;var ese=Zre.constant(1);function tse(t,e,n,i){return nse(t,String(e),n||ese,i||function(r){return t.outEdges(r)})}function nse(t,e,n,i){var r={},s=new Jre,o,l,a=function(c){var u=c.v!==o?c.v:c.w,f=r[u],d=n(c),h=l.distance+d;if(d<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+d);h<f.distance&&(f.distance=h,f.predecessor=o,s.decrease(u,h))};for(t.nodes().forEach(function(c){var u=c===e?0:Number.POSITIVE_INFINITY;r[c]={distance:u},s.add(c,u)});s.size()>0&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(a);return r}});var qI=S((Gbe,BI)=>{"use strict";var ise=PS(),rse=En();BI.exports=sse;function sse(t,e,n){return rse.transform(t.nodes(),function(i,r){i[r]=ise(t,r,e,n)},{})}});var zS=S((Qbe,zI)=>{"use strict";var PI=En();zI.exports=ose;function ose(t){var e=0,n=[],i={},r=[];function s(o){var l=i[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),t.successors(o).forEach(function(u){PI.has(i,u)?i[u].onStack&&(l.lowlink=Math.min(l.lowlink,i[u].index)):(s(u),l.lowlink=Math.min(l.lowlink,i[u].lowlink))}),l.lowlink===l.index){var a=[],c;do c=n.pop(),i[c].onStack=!1,a.push(c);while(o!==c);r.push(a)}}return t.nodes().forEach(function(o){PI.has(i,o)||s(o)}),r}});var UI=S((Xbe,HI)=>{"use strict";var lse=En(),ase=zS();HI.exports=cse;function cse(t){return lse.filter(ase(t),function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}});var $I=S((Wbe,FI)=>{"use strict";var use=En();FI.exports=dse;var fse=use.constant(1);function dse(t,e,n){return hse(t,e||fse,n||function(i){return t.outEdges(i)})}function hse(t,e,n){var i={},r=t.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY})}),n(s).forEach(function(o){var l=o.v===s?o.w:o.v,a=e(o);i[s][l]={distance:a,predecessor:s}})}),r.forEach(function(s){var o=i[s];r.forEach(function(l){var a=i[l];r.forEach(function(c){var u=a[s],f=o[c],d=a[c],h=u.distance+f.distance;h<d.distance&&(d.distance=h,d.predecessor=f.predecessor)})})}),i}});var HS=S((Zbe,jI)=>{"use strict";var zf=En();jI.exports=VI;VI.CycleException=ng;function VI(t){var e={},n={},i=[];function r(s){if(zf.has(n,s))throw new ng;zf.has(e,s)||(n[s]=!0,e[s]=!0,zf.each(t.predecessors(s),r),delete n[s],i.push(s))}if(zf.each(t.sinks(),r),zf.size(e)!==t.nodeCount())throw new ng;return i}function ng(){}ng.prototype=new Error});var GI=S((Jbe,KI)=>{"use strict";var YI=HS();KI.exports=pse;function pse(t){try{YI(t)}catch(e){if(e instanceof YI.CycleException)return!1;throw e}return!0}});var US=S((e1e,XI)=>{"use strict";var ig=En();XI.exports=mse;function mse(t,e,n){ig.isArray(e)||(e=[e]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),r=[],s={};return ig.each(e,function(o){if(!t.hasNode(o))throw new Error("Graph does not have node: "+o);QI(t,o,n==="post",s,i,r)}),r}function QI(t,e,n,i,r,s){ig.has(i,e)||(i[e]=!0,n||s.push(e),ig.each(r(e),function(o){QI(t,o,n,i,r,s)}),n&&s.push(e))}});var ZI=S((t1e,WI)=>{"use strict";var gse=US();WI.exports=yse;function yse(t,e){return gse(t,e,"post")}});var e_=S((n1e,JI)=>{"use strict";var bse=US();JI.exports=vse;function vse(t,e){return bse(t,e,"pre")}});var i_=S((i1e,n_)=>{"use strict";var t_=En(),xse=eg(),Sse=qS();n_.exports=wse;function wse(t,e){var n=new xse,i={},r=new Sse,s;function o(a){var c=a.v===s?a.w:a.v,u=r.priority(c);if(u!==void 0){var f=e(a);f<u&&(i[c]=s,r.decrease(c,f))}}if(t.nodeCount()===0)return n;t_.each(t.nodes(),function(a){r.add(a,Number.POSITIVE_INFINITY),n.setNode(a)}),r.decrease(t.nodes()[0],0);for(var l=!1;r.size()>0;){if(s=r.removeMin(),t_.has(i,s))n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(s).forEach(o)}return n}});var s_=S((r1e,r_)=>{"use strict";r_.exports={components:NI(),dijkstra:PS(),dijkstraAll:qI(),findCycles:UI(),floydWarshall:$I(),isAcyclic:GI(),postorder:ZI(),preorder:e_(),prim:i_(),tarjan:zS(),topsort:HS()}});var a_=S((s1e,l_)=>{"use strict";var o_=EI();l_.exports={Graph:o_.Graph,json:MI(),alg:s_(),version:o_.version}});var Rse={};A_(Rse,{CnDCore:()=>m_,CndLayoutStateManager:()=>Hs,DataAPI:()=>ja,ErrorAPI:()=>Nr,InstanceStateManager:()=>Lr,getCurrentCNDSpecFromReact:()=>Mse,getCurrentInstanceFromReact:()=>Dse,globalErrorManager:()=>Wn,mountCndLayoutInterface:()=>YS,mountErrorMessageModal:()=>KS,mountEvaluatorRepl:()=>GS,mountRelationHighlighter:()=>QS,unmountCndLayoutInterface:()=>og});var et=X(Et()),Uf=X(IC());var bf=X(Et());var qC="#000000";function cs(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function W(t){return t==null?"":String(t)}function _C(t){return Array.isArray(t)?t.map(e=>W(e)).filter(e=>e.length>0):t==null||t===""?[]:[W(t)]}function K0(t){return t==null||t===""}function G0(t,e,n="error"){return{severity:n,message:e,fieldKey:t,source:"structure"}}var PC=["above","below","left","right","directlyAbove","directlyBelow","directlyLeft","directlyRight"],zC=["clockwise","counterclockwise"],HC=["horizontal","vertical"],Q0=["solid","dashed","dotted"],g7=["full","badge"],y7=["small","normal","large"],tu=[{key:"size",kind:"enum",options:y7,label:"Size"},{key:"color",kind:"color",label:"Color"}],b7=["none","togroup","fromgroup"];function BC(t){return t&&typeof t=="object"&&(t=t.points),t===!0||t==="togroup"?"togroup":t==="fromgroup"?"fromgroup":"none"}var v7=["hideDisconnected","hideDisconnectedBuiltIns"],x7={kind:"constraint",type:"orientation",label:"Orientation",description:"Specify the relative positioning of elements.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary",placeholder:"e.g. parent",help:"Binary selector; orientation applies from the source end to the target end of each tuple."},{key:"directions",kind:"enum",label:"Directions",required:!0,multiple:!0,options:PC,help:"Where the target sits relative to the source."}],summary(t){let e=_C(t.directions),n=W(t.selector),i=e.length>0?e.join(", "):"no directions";return n?`target ${i} of source \xB7 ${n}`:`target ${i} of source`},validate(t){let e=[],n=_C(t.directions),i=r=>n.includes(r);return i("above")&&i("below")&&e.push(G0("directions","Cannot be both above and below.")),i("left")&&i("right")&&e.push(G0("directions","Cannot be both left and right.")),e}},S7={kind:"constraint",type:"cyclic",label:"Cyclic",description:"Arrange elements along the perimeter of a circle.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"direction",kind:"enum",label:"Direction",options:zC,default:"clockwise"}],summary(t){let e=W(t.direction)||"clockwise",n=W(t.selector);return n?`${e} \xB7 ${n}`:e}},w7={kind:"constraint",type:"align",label:"Align",description:"Ensure elements are aligned horizontally or vertically.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"direction",kind:"enum",label:"Direction",required:!0,options:HC,default:"horizontal"}],summary(t){let e=W(t.direction)||"horizontal",n=W(t.selector);return n?`${e} \xB7 ${n}`:e}},k7={kind:"constraint",type:"groupselector",label:"Group (by selector)",description:"Group elements based on a selector.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"name",kind:"text",label:"Group name",placeholder:"e.g. cluster"},{key:"showLabel",kind:"boolean",label:"Show label",default:!0},{key:"addEdge",kind:"enum",label:"Add edge",options:b7,default:"none",help:'Draw an edge between the group key and the group: "togroup" points key \u2192 group, "fromgroup" points group \u2192 key, "none" draws nothing. (To style that connector, author addEdge as a block \u2014 { points, lineStyle, textStyle } \u2014 in YAML.)'},{key:"textStyle",kind:"group",label:"Label text style",children:[{key:"color",kind:"color",label:"Color"}]}],summary(t){let e=W(t.selector),n=W(t.name),i=n?`group "${n}"`:"group";return e?`${i} \xB7 ${e}`:i},toYamlNode(t){let e={selector:W(t.selector)};K0(t.name)||(e.name=W(t.name));let n=BC(t.addEdge);if(typeof t.showLabel=="boolean"&&(e.showLabel=t.showLabel),n!=="none"&&(e.addEdge=n),cs(t.textStyle)){let i={};for(let[r,s]of Object.entries(t.textStyle))s!=null&&s!==""&&(i[r]=s);Object.keys(i).length>0&&(e.textStyle=i)}return t.hold!==void 0&&(e.hold=t.hold),cs(t.source)&&(e.source={...t.source}),{group:e}},fromYamlNode(t){if(!cs(t))return null;let e=t.group;if(!cs(e)||e.field!==void 0)return null;let n={selector:W(e.selector),addEdge:BC(e.addEdge)};return e.name!==void 0&&(n.name=W(e.name)),typeof e.showLabel=="boolean"&&(n.showLabel=e.showLabel),cs(e.textStyle)&&(n.textStyle={...e.textStyle}),e.hold!==void 0&&(n.hold=e.hold),cs(e.source)&&(n.source={...e.source}),n}},A7={kind:"constraint",type:"size",label:"Size",description:"Set the width and height of elements matching the selector.",alsoAcceptedIn:["directive"],fields:[{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"width",kind:"number",label:"Width",required:!0,default:100},{key:"height",kind:"number",label:"Height",required:!0,default:60}],summary(t){let e=K0(t.width)?"?":W(t.width),n=K0(t.height)?"?":W(t.height),i=W(t.selector);return i?`${e}\xD7${n} \xB7 ${i}`:`${e}\xD7${n}`},validate(t){let e=[];for(let n of["width","height"]){let i=t[n];typeof i=="number"&&(Number.isNaN(i)||i<=0)&&e.push(G0(n,`${n} must be greater than 0.`))}return e}},C7={kind:"constraint",type:"hideAtom",label:"Hide atom",description:"Hide elements matching the selector from the visualization.",alsoAcceptedIn:["directive"],fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"unary"}],summary(t){let e=W(t.selector);return e?`hide \xB7 ${e}`:"hide"}},O7={kind:"directive",type:"flag",label:"Flag",description:"Toggle a built-in rendering flag, e.g. hideDisconnectedBuiltIns.",fields:[{key:"flag",kind:"enum",options:v7,label:"Flag",required:!0,default:"hideDisconnected",help:"hideDisconnected hides disconnected atoms; hideDisconnectedBuiltIns hides only disconnected built-in atoms."}],summary(t){return W(t.flag)||"(no flag)"},toYamlNode(t){return{flag:W(t.flag)}},fromYamlNode(t){if(!cs(t))return null;let e=t.flag;return typeof e=="string"?{flag:e}:cs(e)&&typeof e.flag=="string"?{flag:e.flag}:null}},T7={kind:"directive",type:"attribute",label:"Attribute",description:"Render a field as an inline attribute on its source atom.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary",help:"Optional n-ary selector \u2014 apply only to matching (source, target) tuples."},{key:"textStyle",kind:"group",label:"Text style",children:tu}],summary(t){let e=W(t.field),n=W(t.selector),i=e||"(no field)";return n?`${i} \xB7 ${n}`:i}},E7={kind:"directive",type:"hideField",label:"Hide field",description:"Hide a relation/field from the visualization.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary",help:"Optional n-ary selector \u2014 hide only matching (source, target) tuples."}],summary(t){let e=W(t.field),n=W(t.selector),i=e?`hide ${e}`:"hide field";return n?`${i} \xB7 ${n}`:i}},D7={kind:"directive",type:"icon",label:"Icon",description:"Deprecated \u2014 use Atom style (atomStyle) with an 'iconStyle' block. Still parsed/rendered for back-compat (showLabels splits into showLabel + iconStyle.placement).",deprecated:!0,deprecatedInFavorOf:"atomStyle",fields:[{key:"path",kind:"text",label:"Path / URL",required:!0,placeholder:"e.g. https://\u2026 or assets/foo.svg"},{key:"showLabels",kind:"boolean",label:"Show labels",default:!1},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=W(t.path),n=W(t.selector),i=e||"(no path)";return n?`${i} \xB7 ${n}`:i}},M7={kind:"directive",type:"atomColor",label:"Atom color",description:"Deprecated \u2014 use Atom style (atomStyle). Still parsed/rendered for back-compat (value \u2192 border color).",deprecated:!0,deprecatedInFavorOf:"atomStyle",fields:[{key:"value",kind:"color",label:"Color",required:!0,default:qC},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=W(t.value),n=W(t.selector),i=e||"(no color)";return n?`${i} \xB7 ${n}`:i}},UC=[{key:"color",kind:"color",label:"Color"},{key:"pattern",kind:"enum",options:Q0,label:"Pattern"},{key:"weight",kind:"number",label:"Weight"},{key:"highlight",kind:"color",label:"Highlight"}],R7=[{key:"color",kind:"color",label:"Color"}],N7=[{key:"color",kind:"color",label:"Color"},{key:"width",kind:"number",label:"Width"}],L7=[{key:"path",kind:"iconPath",label:"Icon",placeholder:"e.g. person, bi:person-fill, https://\u2026"},{key:"placement",kind:"enum",options:g7,label:"Placement"},{key:"opacity",kind:"number",label:"Opacity",help:"0\u20131. Fade a full-bleed icon to use it as a watermark behind the label."}],I7={kind:"directive",type:"edgeStyle",label:"Edge style",description:"Style the edges of a field/relation \u2014 line and label.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary"},{key:"lineStyle",kind:"group",label:"Line style",children:UC},{key:"textStyle",kind:"group",label:"Text style",children:tu},{key:"showLabel",kind:"boolean",label:"Show label"},{key:"hidden",kind:"boolean",label:"Hidden"}],summary(t){let e=W(t.field),n=t.lineStyle??{},i=W(n.color),r=e?i?`${e}: ${i}`:e:i||"edge",s=W(t.selector);return s?`${r} \xB7 ${s}`:r}},_7={kind:"directive",type:"atomStyle",label:"Atom style",description:"Style matching atoms \u2014 fill, border, icon, and label.",fields:[{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"fillStyle",kind:"group",label:"Fill style",children:R7},{key:"borderStyle",kind:"group",label:"Border style",children:N7},{key:"iconStyle",kind:"group",label:"Icon style",children:L7},{key:"textStyle",kind:"group",label:"Text style",children:tu},{key:"showLabel",kind:"boolean",label:"Show label"}],summary(t){let e=t.fillStyle??{},n=t.borderStyle??{},i=W(e.color)||W(n.color),r=W(t.selector),s=i||"atom";return r?`${s} \xB7 ${r}`:s}},B7={kind:"directive",type:"edgeColor",label:"Edge color",description:"Deprecated \u2014 use Edge style (edgeStyle). Still parsed/rendered for back-compat.",deprecated:!0,deprecatedInFavorOf:"edgeStyle",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"value",kind:"color",label:"Color",required:!0,default:qC},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"style",kind:"enum",label:"Style",options:Q0},{key:"weight",kind:"number",label:"Weight"}],summary(t){let e=W(t.field),n=W(t.value),i=e?`${e}: ${n||"edge"}`:n||"edge",r=W(t.selector);return r?`${i} \xB7 ${r}`:i}},q7={kind:"directive",type:"inferredEdge",label:"Inferred edge",description:"Draw an inferred edge from a selector \u2014 line and label.",fields:[{key:"name",kind:"text",label:"Name",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"binary"},{key:"draw",kind:"text",label:"Draw",help:"Endpoint interpretation: '<end> -> <end>', each end '_' (the atom itself) or a group constraint name (attach to that group's hull \u2014 a keyed group picks by the end's atom; a unary group is a single group and attaches directly). E.g. 'regions -> regions' or '_ -> regions'."},{key:"lineStyle",kind:"group",label:"Line style",children:UC},{key:"textStyle",kind:"group",label:"Text style",children:tu}],summary(t){let e=W(t.name),n=W(t.selector),i=t.lineStyle??{},r=W(i.color),s=e||"(no name)",o=r?`${s}: ${r}`:s;return n?`${o} \xB7 ${n}`:o}},P7={kind:"directive",type:"tag",label:"Tag",description:"Add computed attributes to nodes based on selector evaluation.",fields:[{key:"toTag",kind:"selector",label:"To tag (selector)",required:!0,selectorArity:"unary",help:"Selects which atoms get the tag."},{key:"name",kind:"text",label:"Name",required:!0,help:"The attribute name to display."},{key:"value",kind:"selector",label:"Value (selector)",required:!0,help:"Selector whose result becomes the attribute value."},{key:"textStyle",kind:"group",label:"Text style",children:tu}],summary(t){let e=W(t.name),n=W(t.toTag),i=e||"(no name)";return n?`${i} \xB7 ${n}`:i}},X0=[x7,S7,w7,k7,A7,C7,O7,T7,E7,D7,_7,M7,I7,B7,q7,P7],W0=new Map(X0.map(t=>[t.type,t])),z7={groupselector:"group"};function H7(t){return z7[t]??t}var Z0=(()=>{let t=new Map;for(let e of X0){let n=H7(e.type),i=t.get(n);i?i.push(e):t.set(n,[e])}return t})();function J0(t){return Z0.get(t)??[]}function bh(t){return Z0.has(t)}function vh(t){let e=[];for(let[n,i]of Z0)(!t||i.some(r=>r.kind===t))&&e.push(n);return e}function Ft(t){return W0.get(t)}function eb(t){return W0.has(t)}function tb(t,e={}){let n=e.includeDeprecated??!1;return X0.filter(i=>i.kind===t&&(n||!i.deprecated))}function nb(t){let e=W0.get(t);if(!e)return{};let n={};for(let i of e.fields)i.default!==void 0&&(n[i.key]=i.default);return n}function iO(t){return typeof t>"u"||t===null}function U7(t){return typeof t=="object"&&t!==null}function F7(t){return Array.isArray(t)?t:iO(t)?[]:[t]}function $7(t,e){var n,i,r,s;if(e)for(s=Object.keys(e),n=0,i=s.length;n<i;n+=1)r=s[n],t[r]=e[r];return t}function V7(t,e){var n="",i;for(i=0;i<e;i+=1)n+=t;return n}function j7(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var Y7=iO,K7=U7,G7=F7,Q7=V7,X7=j7,W7=$7,at={isNothing:Y7,isObject:K7,toArray:G7,repeat:Q7,isNegativeZero:X7,extend:W7};function rO(t,e){var n="",i=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(n+=`
|
|
10
10
|
|
|
11
|
-
`+t.mark.snippet),i+" "+n):i}function iu(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=rO(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}iu.prototype=Object.create(Error.prototype);iu.prototype.constructor=iu;iu.prototype.toString=function(e){return this.name+": "+rO(this,e)};var
|
|
11
|
+
`+t.mark.snippet),i+" "+n):i}function iu(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=rO(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}iu.prototype=Object.create(Error.prototype);iu.prototype.constructor=iu;iu.prototype.toString=function(e){return this.name+": "+rO(this,e)};var $t=iu;function ib(t,e,n,i,r){var s="",o="",l=Math.floor(r/2)-1;return i-e>l&&(s=" ... ",e=i-l+s.length),n-i>l&&(o=" ...",n=i+l-o.length),{str:s+t.slice(e,n).replace(/\t/g,"\u2192")+o,pos:i-e+s.length}}function rb(t,e){return at.repeat(" ",e-t.length)+t}function Z7(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var n=/\r?\n|\r|\0/g,i=[0],r=[],s,o=-1;s=n.exec(t.buffer);)r.push(s.index),i.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var l="",a,c,u=Math.min(t.line+e.linesAfter,r.length).toString().length,f=e.maxLength-(e.indent+u+3);for(a=1;a<=e.linesBefore&&!(o-a<0);a++)c=ib(t.buffer,i[o-a],r[o-a],t.position-(i[o]-i[o-a]),f),l=at.repeat(" ",e.indent)+rb((t.line-a+1).toString(),u)+" | "+c.str+`
|
|
12
12
|
`+l;for(c=ib(t.buffer,i[o],r[o],t.position,f),l+=at.repeat(" ",e.indent)+rb((t.line+1).toString(),u)+" | "+c.str+`
|
|
13
13
|
`,l+=at.repeat("-",e.indent+u+3+c.pos)+`^
|
|
14
14
|
`,a=1;a<=e.linesAfter&&!(o+a>=r.length);a++)c=ib(t.buffer,i[o+a],r[o+a],t.position-(i[o]-i[o+a]),f),l+=at.repeat(" ",e.indent)+rb((t.line+a+1).toString(),u)+" | "+c.str+`
|
|
15
|
-
`;return l.replace(/\n$/,"")}var J7=Z7,eq=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],tq=["scalar","sequence","mapping"];function nq(t){var e={};return t!==null&&Object.keys(t).forEach(function(n){t[n].forEach(function(i){e[String(i)]=n})}),e}function iq(t,e){if(e=e||{},Object.keys(e).forEach(function(n){if(eq.indexOf(n)===-1)throw new
|
|
16
|
-
\r`;function Tq(t){if(t===null)return!1;var e,n,i=0,r=t.length,s=fb;for(n=0;n<r;n++)if(e=s.indexOf(t.charAt(n)),!(e>64)){if(e<0)return!1;i+=6}return i%8===0}function Eq(t){var e,n,i=t.replace(/[\r\n=]/g,""),r=i.length,s=fb,o=0,l=[];for(e=0;e<r;e++)e%4===0&&e&&(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)),o=o<<6|s.indexOf(i.charAt(e));return n=r%4*6,n===0?(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)):n===18?(l.push(o>>10&255),l.push(o>>2&255)):n===12&&l.push(o>>4&255),new Uint8Array(l)}function Dq(t){var e="",n=0,i,r,s=t.length,o=fb;for(i=0;i<s;i++)i%3===0&&i&&(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]),n=(n<<8)+t[i];return r=s%3,r===0?(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]):r===2?(e+=o[n>>10&63],e+=o[n>>4&63],e+=o[n<<2&63],e+=o[64]):r===1&&(e+=o[n>>2&63],e+=o[n<<4&63],e+=o[64],e+=o[64]),e}function Mq(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var xO=new
|
|
17
|
-
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function Gq(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function EO(t,e,n){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:n}):t[e]=n}var DO=new Array(256),MO=new Array(256);for(lo=0;lo<256;lo++)DO[lo]=jC(lo)?1:0,MO[lo]=jC(lo);var lo;function Qq(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||db,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function RO(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=J7(n),new
|
|
18
|
-
`,e-1))}function Xq(t,e,n){var i,r,s,o,l,a,c,u,f=t.kind,d=t.result,h;if(h=t.input.charCodeAt(t.position),nn(h)||$l(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(r=t.input.charCodeAt(t.position+1),nn(r)||n&&$l(r)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,l=!1;h!==0;){if(h===58){if(r=t.input.charCodeAt(t.position+1),nn(r)||n&&$l(r))break}else if(h===35){if(i=t.input.charCodeAt(t.position-1),nn(i))break}else{if(t.position===t.lineStart&&Ch(t)||n&&$l(h))break;if(Ni(h))if(a=t.line,c=t.lineStart,u=t.lineIndent,it(t,!1,-1),t.lineIndent>=e){l=!0,h=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=a,t.lineStart=c,t.lineIndent=u;break}}l&&(us(t,s,o,!1),pb(t,t.line-a),s=o=t.position,l=!1),ao(h)||(o=t.position+1),h=t.input.charCodeAt(++t.position)}return us(t,s,o,!1),t.result?!0:(t.kind=f,t.result=d,!1)}function Wq(t,e){var n,i,r;if(n=t.input.charCodeAt(t.position),n!==39)return!1;for(t.kind="scalar",t.result="",t.position++,i=r=t.position;(n=t.input.charCodeAt(t.position))!==0;)if(n===39)if(us(t,i,t.position,!0),n=t.input.charCodeAt(++t.position),n===39)i=t.position,t.position++,r=t.position;else return!0;else Ni(n)?(us(t,i,r,!0),pb(t,it(t,!1,e)),i=r=t.position):t.position===t.lineStart&&Ch(t)?H(t,"unexpected end of the document within a single quoted scalar"):(t.position++,r=t.position);H(t,"unexpected end of the stream within a single quoted scalar")}function Zq(t,e){var n,i,r,s,o,l;if(l=t.input.charCodeAt(t.position),l!==34)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(l=t.input.charCodeAt(t.position))!==0;){if(l===34)return us(t,n,t.position,!0),t.position++,!0;if(l===92){if(us(t,n,t.position,!0),l=t.input.charCodeAt(++t.position),Ni(l))it(t,!1,e);else if(l<256&&DO[l])t.result+=MO[l],t.position++;else if((o=Yq(l))>0){for(r=o,s=0;r>0;r--)l=t.input.charCodeAt(++t.position),(o=jq(l))>=0?s=(s<<4)+o:H(t,"expected hexadecimal character");t.result+=Gq(s),t.position++}else H(t,"unknown escape sequence");n=i=t.position}else Ni(l)?(us(t,n,i,!0),pb(t,it(t,!1,e)),n=i=t.position):t.position===t.lineStart&&Ch(t)?H(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}H(t,"unexpected end of the stream within a double quoted scalar")}function Jq(t,e){var n=!0,i,r,s,o=t.tag,l,a=t.anchor,c,u,f,d,h,
|
|
15
|
+
`;return l.replace(/\n$/,"")}var J7=Z7,eq=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],tq=["scalar","sequence","mapping"];function nq(t){var e={};return t!==null&&Object.keys(t).forEach(function(n){t[n].forEach(function(i){e[String(i)]=n})}),e}function iq(t,e){if(e=e||{},Object.keys(e).forEach(function(n){if(eq.indexOf(n)===-1)throw new $t('Unknown option "'+n+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(n){return n},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=nq(e.styleAliases||null),tq.indexOf(this.kind)===-1)throw new $t('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var kt=iq;function FC(t,e){var n=[];return t[e].forEach(function(i){var r=n.length;n.forEach(function(s,o){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(r=o)}),n[r]=i}),n}function rq(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,n;function i(r){r.multi?(t.multi[r.kind].push(r),t.multi.fallback.push(r)):t[r.kind][r.tag]=t.fallback[r.tag]=r}for(e=0,n=arguments.length;e<n;e+=1)arguments[e].forEach(i);return t}function ob(t){return this.extend(t)}ob.prototype.extend=function(e){var n=[],i=[];if(e instanceof kt)i.push(e);else if(Array.isArray(e))i=i.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(n=n.concat(e.implicit)),e.explicit&&(i=i.concat(e.explicit));else throw new $t("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof kt))throw new $t("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new $t("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new $t("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof kt))throw new $t("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(ob.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=FC(r,"implicit"),r.compiledExplicit=FC(r,"explicit"),r.compiledTypeMap=rq(r.compiledImplicit,r.compiledExplicit),r};var sO=ob,oO=new kt("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),lO=new kt("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),aO=new kt("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),cO=new sO({explicit:[oO,lO,aO]});function sq(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function oq(){return null}function lq(t){return t===null}var uO=new kt("tag:yaml.org,2002:null",{kind:"scalar",resolve:sq,construct:oq,predicate:lq,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function aq(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function cq(t){return t==="true"||t==="True"||t==="TRUE"}function uq(t){return Object.prototype.toString.call(t)==="[object Boolean]"}var fO=new kt("tag:yaml.org,2002:bool",{kind:"scalar",resolve:aq,construct:cq,predicate:uq,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function fq(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function dq(t){return 48<=t&&t<=55}function hq(t){return 48<=t&&t<=57}function pq(t){if(t===null)return!1;var e=t.length,n=0,i=!1,r;if(!e)return!1;if(r=t[n],(r==="-"||r==="+")&&(r=t[++n]),r==="0"){if(n+1===e)return!0;if(r=t[++n],r==="b"){for(n++;n<e;n++)if(r=t[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;i=!0}return i&&r!=="_"}if(r==="x"){for(n++;n<e;n++)if(r=t[n],r!=="_"){if(!fq(t.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<e;n++)if(r=t[n],r!=="_"){if(!dq(t.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<e;n++)if(r=t[n],r!=="_"){if(!hq(t.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function mq(t){var e=t,n=1,i;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),i=e[0],(i==="-"||i==="+")&&(i==="-"&&(n=-1),e=e.slice(1),i=e[0]),e==="0")return 0;if(i==="0"){if(e[1]==="b")return n*parseInt(e.slice(2),2);if(e[1]==="x")return n*parseInt(e.slice(2),16);if(e[1]==="o")return n*parseInt(e.slice(2),8)}return n*parseInt(e,10)}function gq(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!at.isNegativeZero(t)}var dO=new kt("tag:yaml.org,2002:int",{kind:"scalar",resolve:pq,construct:mq,predicate:gq,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),yq=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function bq(t){return!(t===null||!yq.test(t)||t[t.length-1]==="_")}function vq(t){var e,n;return e=t.replace(/_/g,"").toLowerCase(),n=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:n*parseFloat(e,10)}var xq=/^[-+]?[0-9]+e/;function Sq(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(at.isNegativeZero(t))return"-0.0";return n=t.toString(10),xq.test(n)?n.replace("e",".e"):n}function wq(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||at.isNegativeZero(t))}var hO=new kt("tag:yaml.org,2002:float",{kind:"scalar",resolve:bq,construct:vq,predicate:wq,represent:Sq,defaultStyle:"lowercase"}),pO=cO.extend({implicit:[uO,fO,dO,hO]}),mO=pO,gO=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),yO=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function kq(t){return t===null?!1:gO.exec(t)!==null||yO.exec(t)!==null}function Aq(t){var e,n,i,r,s,o,l,a=0,c=null,u,f,d;if(e=gO.exec(t),e===null&&(e=yO.exec(t)),e===null)throw new Error("Date resolve error");if(n=+e[1],i=+e[2]-1,r=+e[3],!e[4])return new Date(Date.UTC(n,i,r));if(s=+e[4],o=+e[5],l=+e[6],e[7]){for(a=e[7].slice(0,3);a.length<3;)a+="0";a=+a}return e[9]&&(u=+e[10],f=+(e[11]||0),c=(u*60+f)*6e4,e[9]==="-"&&(c=-c)),d=new Date(Date.UTC(n,i,r,s,o,l,a)),c&&d.setTime(d.getTime()-c),d}function Cq(t){return t.toISOString()}var bO=new kt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:kq,construct:Aq,instanceOf:Date,represent:Cq});function Oq(t){return t==="<<"||t===null}var vO=new kt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Oq}),fb=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
16
|
+
\r`;function Tq(t){if(t===null)return!1;var e,n,i=0,r=t.length,s=fb;for(n=0;n<r;n++)if(e=s.indexOf(t.charAt(n)),!(e>64)){if(e<0)return!1;i+=6}return i%8===0}function Eq(t){var e,n,i=t.replace(/[\r\n=]/g,""),r=i.length,s=fb,o=0,l=[];for(e=0;e<r;e++)e%4===0&&e&&(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)),o=o<<6|s.indexOf(i.charAt(e));return n=r%4*6,n===0?(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)):n===18?(l.push(o>>10&255),l.push(o>>2&255)):n===12&&l.push(o>>4&255),new Uint8Array(l)}function Dq(t){var e="",n=0,i,r,s=t.length,o=fb;for(i=0;i<s;i++)i%3===0&&i&&(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]),n=(n<<8)+t[i];return r=s%3,r===0?(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]):r===2?(e+=o[n>>10&63],e+=o[n>>4&63],e+=o[n<<2&63],e+=o[64]):r===1&&(e+=o[n>>2&63],e+=o[n<<4&63],e+=o[64],e+=o[64]),e}function Mq(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var xO=new kt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Tq,construct:Eq,predicate:Mq,represent:Dq}),Rq=Object.prototype.hasOwnProperty,Nq=Object.prototype.toString;function Lq(t){if(t===null)return!0;var e=[],n,i,r,s,o,l=t;for(n=0,i=l.length;n<i;n+=1){if(r=l[n],o=!1,Nq.call(r)!=="[object Object]")return!1;for(s in r)if(Rq.call(r,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}function Iq(t){return t!==null?t:[]}var SO=new kt("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Lq,construct:Iq}),_q=Object.prototype.toString;function Bq(t){if(t===null)return!0;var e,n,i,r,s,o=t;for(s=new Array(o.length),e=0,n=o.length;e<n;e+=1){if(i=o[e],_q.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;s[e]=[r[0],i[r[0]]]}return!0}function qq(t){if(t===null)return[];var e,n,i,r,s,o=t;for(s=new Array(o.length),e=0,n=o.length;e<n;e+=1)i=o[e],r=Object.keys(i),s[e]=[r[0],i[r[0]]];return s}var wO=new kt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Bq,construct:qq}),Pq=Object.prototype.hasOwnProperty;function zq(t){if(t===null)return!0;var e,n=t;for(e in n)if(Pq.call(n,e)&&n[e]!==null)return!1;return!0}function Hq(t){return t!==null?t:{}}var kO=new kt("tag:yaml.org,2002:set",{kind:"mapping",resolve:zq,construct:Hq}),db=mO.extend({implicit:[bO,vO],explicit:[xO,SO,wO,kO]}),fs=Object.prototype.hasOwnProperty,xh=1,AO=2,CO=3,Sh=4,sb=1,Uq=2,$C=3,Fq=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,$q=/[\x85\u2028\u2029]/,Vq=/[,\[\]\{\}]/,OO=/^(?:!|!!|![a-z\-]+!)$/i,TO=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function VC(t){return Object.prototype.toString.call(t)}function Ni(t){return t===10||t===13}function ao(t){return t===9||t===32}function nn(t){return t===9||t===32||t===10||t===13}function $l(t){return t===44||t===91||t===93||t===123||t===125}function jq(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}function Yq(t){return t===120?2:t===117?4:t===85?8:0}function Kq(t){return 48<=t&&t<=57?t-48:-1}function jC(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
|
|
17
|
+
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function Gq(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function EO(t,e,n){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:n}):t[e]=n}var DO=new Array(256),MO=new Array(256);for(lo=0;lo<256;lo++)DO[lo]=jC(lo)?1:0,MO[lo]=jC(lo);var lo;function Qq(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||db,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function RO(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=J7(n),new $t(e,n)}function H(t,e){throw RO(t,e)}function wh(t,e){t.onWarning&&t.onWarning.call(null,RO(t,e))}var YC={YAML:function(e,n,i){var r,s,o;e.version!==null&&H(e,"duplication of %YAML directive"),i.length!==1&&H(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&H(e,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),o=parseInt(r[2],10),s!==1&&H(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&wh(e,"unsupported YAML version of the document")},TAG:function(e,n,i){var r,s;i.length!==2&&H(e,"TAG directive accepts exactly two arguments"),r=i[0],s=i[1],OO.test(r)||H(e,"ill-formed tag handle (first argument) of the TAG directive"),fs.call(e.tagMap,r)&&H(e,'there is a previously declared suffix for "'+r+'" tag handle'),TO.test(s)||H(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{H(e,"tag prefix is malformed: "+s)}e.tagMap[r]=s}};function us(t,e,n,i){var r,s,o,l;if(e<n){if(l=t.input.slice(e,n),i)for(r=0,s=l.length;r<s;r+=1)o=l.charCodeAt(r),o===9||32<=o&&o<=1114111||H(t,"expected valid JSON character");else Fq.test(l)&&H(t,"the stream contains non-printable characters");t.result+=l}}function KC(t,e,n,i){var r,s,o,l;for(at.isObject(n)||H(t,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),o=0,l=r.length;o<l;o+=1)s=r[o],fs.call(e,s)||(EO(e,s,n[s]),i[s]=!0)}function Vl(t,e,n,i,r,s,o,l,a){var c,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),c=0,u=r.length;c<u;c+=1)Array.isArray(r[c])&&H(t,"nested arrays are not supported inside keys"),typeof r=="object"&&VC(r[c])==="[object Object]"&&(r[c]="[object Object]");if(typeof r=="object"&&VC(r)==="[object Object]"&&(r="[object Object]"),r=String(r),e===null&&(e={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,u=s.length;c<u;c+=1)KC(t,e,s[c],n);else KC(t,e,s,n);else!t.json&&!fs.call(n,r)&&fs.call(e,r)&&(t.line=o||t.line,t.lineStart=l||t.lineStart,t.position=a||t.position,H(t,"duplicated mapping key")),EO(e,r,s),delete n[r];return e}function hb(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):H(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function it(t,e,n){for(var i=0,r=t.input.charCodeAt(t.position);r!==0;){for(;ao(r);)r===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),r=t.input.charCodeAt(++t.position);if(e&&r===35)do r=t.input.charCodeAt(++t.position);while(r!==10&&r!==13&&r!==0);if(Ni(r))for(hb(t),r=t.input.charCodeAt(t.position),i++,t.lineIndent=0;r===32;)t.lineIndent++,r=t.input.charCodeAt(++t.position);else break}return n!==-1&&i!==0&&t.lineIndent<n&&wh(t,"deficient indentation"),i}function Ch(t){var e=t.position,n;return n=t.input.charCodeAt(e),!!((n===45||n===46)&&n===t.input.charCodeAt(e+1)&&n===t.input.charCodeAt(e+2)&&(e+=3,n=t.input.charCodeAt(e),n===0||nn(n)))}function pb(t,e){e===1?t.result+=" ":e>1&&(t.result+=at.repeat(`
|
|
18
|
+
`,e-1))}function Xq(t,e,n){var i,r,s,o,l,a,c,u,f=t.kind,d=t.result,h;if(h=t.input.charCodeAt(t.position),nn(h)||$l(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(r=t.input.charCodeAt(t.position+1),nn(r)||n&&$l(r)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,l=!1;h!==0;){if(h===58){if(r=t.input.charCodeAt(t.position+1),nn(r)||n&&$l(r))break}else if(h===35){if(i=t.input.charCodeAt(t.position-1),nn(i))break}else{if(t.position===t.lineStart&&Ch(t)||n&&$l(h))break;if(Ni(h))if(a=t.line,c=t.lineStart,u=t.lineIndent,it(t,!1,-1),t.lineIndent>=e){l=!0,h=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=a,t.lineStart=c,t.lineIndent=u;break}}l&&(us(t,s,o,!1),pb(t,t.line-a),s=o=t.position,l=!1),ao(h)||(o=t.position+1),h=t.input.charCodeAt(++t.position)}return us(t,s,o,!1),t.result?!0:(t.kind=f,t.result=d,!1)}function Wq(t,e){var n,i,r;if(n=t.input.charCodeAt(t.position),n!==39)return!1;for(t.kind="scalar",t.result="",t.position++,i=r=t.position;(n=t.input.charCodeAt(t.position))!==0;)if(n===39)if(us(t,i,t.position,!0),n=t.input.charCodeAt(++t.position),n===39)i=t.position,t.position++,r=t.position;else return!0;else Ni(n)?(us(t,i,r,!0),pb(t,it(t,!1,e)),i=r=t.position):t.position===t.lineStart&&Ch(t)?H(t,"unexpected end of the document within a single quoted scalar"):(t.position++,r=t.position);H(t,"unexpected end of the stream within a single quoted scalar")}function Zq(t,e){var n,i,r,s,o,l;if(l=t.input.charCodeAt(t.position),l!==34)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(l=t.input.charCodeAt(t.position))!==0;){if(l===34)return us(t,n,t.position,!0),t.position++,!0;if(l===92){if(us(t,n,t.position,!0),l=t.input.charCodeAt(++t.position),Ni(l))it(t,!1,e);else if(l<256&&DO[l])t.result+=MO[l],t.position++;else if((o=Yq(l))>0){for(r=o,s=0;r>0;r--)l=t.input.charCodeAt(++t.position),(o=jq(l))>=0?s=(s<<4)+o:H(t,"expected hexadecimal character");t.result+=Gq(s),t.position++}else H(t,"unknown escape sequence");n=i=t.position}else Ni(l)?(us(t,n,i,!0),pb(t,it(t,!1,e)),n=i=t.position):t.position===t.lineStart&&Ch(t)?H(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}H(t,"unexpected end of the stream within a double quoted scalar")}function Jq(t,e){var n=!0,i,r,s,o=t.tag,l,a=t.anchor,c,u,f,d,h,m=Object.create(null),g,b,p,y;if(y=t.input.charCodeAt(t.position),y===91)u=93,h=!1,l=[];else if(y===123)u=125,h=!0,l={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=l),y=t.input.charCodeAt(++t.position);y!==0;){if(it(t,!0,e),y=t.input.charCodeAt(t.position),y===u)return t.position++,t.tag=o,t.anchor=a,t.kind=h?"mapping":"sequence",t.result=l,!0;n?y===44&&H(t,"expected the node content, but found ','"):H(t,"missed comma between flow collection entries"),b=g=p=null,f=d=!1,y===63&&(c=t.input.charCodeAt(t.position+1),nn(c)&&(f=d=!0,t.position++,it(t,!0,e))),i=t.line,r=t.lineStart,s=t.position,jl(t,e,xh,!1,!0),b=t.tag,g=t.result,it(t,!0,e),y=t.input.charCodeAt(t.position),(d||t.line===i)&&y===58&&(f=!0,y=t.input.charCodeAt(++t.position),it(t,!0,e),jl(t,e,xh,!1,!0),p=t.result),h?Vl(t,l,m,b,g,p,i,r,s):f?l.push(Vl(t,null,m,b,g,p,i,r,s)):l.push(g),it(t,!0,e),y=t.input.charCodeAt(t.position),y===44?(n=!0,y=t.input.charCodeAt(++t.position)):n=!1}H(t,"unexpected end of the stream within a flow collection")}function eP(t,e){var n,i,r=sb,s=!1,o=!1,l=e,a=0,c=!1,u,f;if(f=t.input.charCodeAt(t.position),f===124)i=!1;else if(f===62)i=!0;else return!1;for(t.kind="scalar",t.result="";f!==0;)if(f=t.input.charCodeAt(++t.position),f===43||f===45)sb===r?r=f===43?$C:Uq:H(t,"repeat of a chomping mode identifier");else if((u=Kq(f))>=0)u===0?H(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?H(t,"repeat of an indentation width identifier"):(l=e+u-1,o=!0);else break;if(ao(f)){do f=t.input.charCodeAt(++t.position);while(ao(f));if(f===35)do f=t.input.charCodeAt(++t.position);while(!Ni(f)&&f!==0)}for(;f!==0;){for(hb(t),t.lineIndent=0,f=t.input.charCodeAt(t.position);(!o||t.lineIndent<l)&&f===32;)t.lineIndent++,f=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>l&&(l=t.lineIndent),Ni(f)){a++;continue}if(t.lineIndent<l){r===$C?t.result+=at.repeat(`
|
|
19
19
|
`,s?1+a:a):r===sb&&s&&(t.result+=`
|
|
20
20
|
`);break}for(i?ao(f)?(c=!0,t.result+=at.repeat(`
|
|
21
21
|
`,s?1+a:a)):c?(c=!1,t.result+=at.repeat(`
|
|
22
22
|
`,a+1)):a===0?s&&(t.result+=" "):t.result+=at.repeat(`
|
|
23
23
|
`,a):t.result+=at.repeat(`
|
|
24
|
-
`,s?1+a:a),s=!0,o=!0,a=0,n=t.position;!Ni(f)&&f!==0;)f=t.input.charCodeAt(++t.position);us(t,n,t.position,!1)}return!0}function GC(t,e){var n,i=t.tag,r=t.anchor,s=[],o,l=!1,a;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),a=t.input.charCodeAt(t.position);a!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,H(t,"tab characters must not be used in indentation")),!(a!==45||(o=t.input.charCodeAt(t.position+1),!nn(o))));){if(l=!0,t.position++,it(t,!0,-1)&&t.lineIndent<=e){s.push(null),a=t.input.charCodeAt(t.position);continue}if(n=t.line,jl(t,e,CO,!1,!0),s.push(t.result),it(t,!0,-1),a=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&a!==0)H(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return l?(t.tag=i,t.anchor=r,t.kind="sequence",t.result=s,!0):!1}function tP(t,e,n){var i,r,s,o,l,a,c=t.tag,u=t.anchor,f={},d=Object.create(null),h=null,
|
|
25
|
-
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var n=new Qq(t,e),i=t.indexOf("\0");for(i!==-1&&(n.position=i,H(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)sP(n);return n.documents}function oP(t,e,n){e!==null&&typeof e=="object"&&typeof n>"u"&&(n=e,e=null);var i=NO(t,n);if(typeof e!="function")return i;for(var r=0,s=i.length;r<s;r+=1)e(i[r])}function lP(t,e){var n=NO(t,e);if(n.length!==0){if(n.length===1)return n[0];throw new
|
|
24
|
+
`,s?1+a:a),s=!0,o=!0,a=0,n=t.position;!Ni(f)&&f!==0;)f=t.input.charCodeAt(++t.position);us(t,n,t.position,!1)}return!0}function GC(t,e){var n,i=t.tag,r=t.anchor,s=[],o,l=!1,a;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),a=t.input.charCodeAt(t.position);a!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,H(t,"tab characters must not be used in indentation")),!(a!==45||(o=t.input.charCodeAt(t.position+1),!nn(o))));){if(l=!0,t.position++,it(t,!0,-1)&&t.lineIndent<=e){s.push(null),a=t.input.charCodeAt(t.position);continue}if(n=t.line,jl(t,e,CO,!1,!0),s.push(t.result),it(t,!0,-1),a=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&a!==0)H(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return l?(t.tag=i,t.anchor=r,t.kind="sequence",t.result=s,!0):!1}function tP(t,e,n){var i,r,s,o,l,a,c=t.tag,u=t.anchor,f={},d=Object.create(null),h=null,m=null,g=null,b=!1,p=!1,y;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=f),y=t.input.charCodeAt(t.position);y!==0;){if(!b&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,H(t,"tab characters must not be used in indentation")),i=t.input.charCodeAt(t.position+1),s=t.line,(y===63||y===58)&&nn(i))y===63?(b&&(Vl(t,f,d,h,m,null,o,l,a),h=m=g=null),p=!0,b=!0,r=!0):b?(b=!1,r=!0):H(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,y=i;else{if(o=t.line,l=t.lineStart,a=t.position,!jl(t,n,AO,!1,!0))break;if(t.line===s){for(y=t.input.charCodeAt(t.position);ao(y);)y=t.input.charCodeAt(++t.position);if(y===58)y=t.input.charCodeAt(++t.position),nn(y)||H(t,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Vl(t,f,d,h,m,null,o,l,a),h=m=g=null),p=!0,b=!1,r=!1,h=t.tag,m=t.result;else if(p)H(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=c,t.anchor=u,!0}else if(p)H(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=c,t.anchor=u,!0}if((t.line===s||t.lineIndent>e)&&(b&&(o=t.line,l=t.lineStart,a=t.position),jl(t,e,Sh,!0,r)&&(b?m=t.result:g=t.result),b||(Vl(t,f,d,h,m,g,o,l,a),h=m=g=null),it(t,!0,-1),y=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&y!==0)H(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return b&&Vl(t,f,d,h,m,null,o,l,a),p&&(t.tag=c,t.anchor=u,t.kind="mapping",t.result=f),p}function nP(t){var e,n=!1,i=!1,r,s,o;if(o=t.input.charCodeAt(t.position),o!==33)return!1;if(t.tag!==null&&H(t,"duplication of a tag property"),o=t.input.charCodeAt(++t.position),o===60?(n=!0,o=t.input.charCodeAt(++t.position)):o===33?(i=!0,r="!!",o=t.input.charCodeAt(++t.position)):r="!",e=t.position,n){do o=t.input.charCodeAt(++t.position);while(o!==0&&o!==62);t.position<t.length?(s=t.input.slice(e,t.position),o=t.input.charCodeAt(++t.position)):H(t,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!nn(o);)o===33&&(i?H(t,"tag suffix cannot contain exclamation marks"):(r=t.input.slice(e-1,t.position+1),OO.test(r)||H(t,"named tag handle cannot contain such characters"),i=!0,e=t.position+1)),o=t.input.charCodeAt(++t.position);s=t.input.slice(e,t.position),Vq.test(s)&&H(t,"tag suffix cannot contain flow indicator characters")}s&&!TO.test(s)&&H(t,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{H(t,"tag name is malformed: "+s)}return n?t.tag=s:fs.call(t.tagMap,r)?t.tag=t.tagMap[r]+s:r==="!"?t.tag="!"+s:r==="!!"?t.tag="tag:yaml.org,2002:"+s:H(t,'undeclared tag handle "'+r+'"'),!0}function iP(t){var e,n;if(n=t.input.charCodeAt(t.position),n!==38)return!1;for(t.anchor!==null&&H(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;n!==0&&!nn(n)&&!$l(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&H(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function rP(t){var e,n,i;if(i=t.input.charCodeAt(t.position),i!==42)return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;i!==0&&!nn(i)&&!$l(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&H(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),fs.call(t.anchorMap,n)||H(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],it(t,!0,-1),!0}function jl(t,e,n,i,r){var s,o,l,a=1,c=!1,u=!1,f,d,h,m,g,b;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s=o=l=Sh===n||CO===n,i&&it(t,!0,-1)&&(c=!0,t.lineIndent>e?a=1:t.lineIndent===e?a=0:t.lineIndent<e&&(a=-1)),a===1)for(;nP(t)||iP(t);)it(t,!0,-1)?(c=!0,l=s,t.lineIndent>e?a=1:t.lineIndent===e?a=0:t.lineIndent<e&&(a=-1)):l=!1;if(l&&(l=c||r),(a===1||Sh===n)&&(xh===n||AO===n?g=e:g=e+1,b=t.position-t.lineStart,a===1?l&&(GC(t,b)||tP(t,b,g))||Jq(t,g)?u=!0:(o&&eP(t,g)||Wq(t,g)||Zq(t,g)?u=!0:rP(t)?(u=!0,(t.tag!==null||t.anchor!==null)&&H(t,"alias node should not have any properties")):Xq(t,g,xh===n)&&(u=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):a===0&&(u=l&&GC(t,b))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&H(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),f=0,d=t.implicitTypes.length;f<d;f+=1)if(m=t.implicitTypes[f],m.resolve(t.result)){t.result=m.construct(t.result),t.tag=m.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(fs.call(t.typeMap[t.kind||"fallback"],t.tag))m=t.typeMap[t.kind||"fallback"][t.tag];else for(m=null,h=t.typeMap.multi[t.kind||"fallback"],f=0,d=h.length;f<d;f+=1)if(t.tag.slice(0,h[f].tag.length)===h[f].tag){m=h[f];break}m||H(t,"unknown tag !<"+t.tag+">"),t.result!==null&&m.kind!==t.kind&&H(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+m.kind+'", not "'+t.kind+'"'),m.resolve(t.result,t.tag)?(t.result=m.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):H(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||u}function sP(t){var e=t.position,n,i,r,s=!1,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(it(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(s=!0,o=t.input.charCodeAt(++t.position),n=t.position;o!==0&&!nn(o);)o=t.input.charCodeAt(++t.position);for(i=t.input.slice(n,t.position),r=[],i.length<1&&H(t,"directive name must not be less than one character in length");o!==0;){for(;ao(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!Ni(o));break}if(Ni(o))break;for(n=t.position;o!==0&&!nn(o);)o=t.input.charCodeAt(++t.position);r.push(t.input.slice(n,t.position))}o!==0&&hb(t),fs.call(YC,i)?YC[i](t,i,r):wh(t,'unknown document directive "'+i+'"')}if(it(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,it(t,!0,-1)):s&&H(t,"directives end mark is expected"),jl(t,t.lineIndent-1,Sh,!1,!0),it(t,!0,-1),t.checkLineBreaks&&$q.test(t.input.slice(e,t.position))&&wh(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Ch(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,it(t,!0,-1));return}if(t.position<t.length-1)H(t,"end of the stream or a document separator is expected");else return}function NO(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
|
|
25
|
+
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var n=new Qq(t,e),i=t.indexOf("\0");for(i!==-1&&(n.position=i,H(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)sP(n);return n.documents}function oP(t,e,n){e!==null&&typeof e=="object"&&typeof n>"u"&&(n=e,e=null);var i=NO(t,n);if(typeof e!="function")return i;for(var r=0,s=i.length;r<s;r+=1)e(i[r])}function lP(t,e){var n=NO(t,e);if(n.length!==0){if(n.length===1)return n[0];throw new $t("expected a single document in the stream, but found more")}}var aP=oP,cP=lP,LO={loadAll:aP,load:cP},IO=Object.prototype.toString,_O=Object.prototype.hasOwnProperty,mb=65279,uP=9,ru=10,fP=13,dP=32,hP=33,pP=34,lb=35,mP=37,gP=38,yP=39,bP=42,BO=44,vP=45,kh=58,xP=61,SP=62,wP=63,kP=64,qO=91,PO=93,AP=96,zO=123,CP=124,HO=125,Nt={};Nt[0]="\\0";Nt[7]="\\a";Nt[8]="\\b";Nt[9]="\\t";Nt[10]="\\n";Nt[11]="\\v";Nt[12]="\\f";Nt[13]="\\r";Nt[27]="\\e";Nt[34]='\\"';Nt[92]="\\\\";Nt[133]="\\N";Nt[160]="\\_";Nt[8232]="\\L";Nt[8233]="\\P";var OP=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],TP=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function EP(t,e){var n,i,r,s,o,l,a;if(e===null)return{};for(n={},i=Object.keys(e),r=0,s=i.length;r<s;r+=1)o=i[r],l=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),a=t.compiledTypeMap.fallback[o],a&&_O.call(a.styleAliases,l)&&(l=a.styleAliases[l]),n[o]=l;return n}function DP(t){var e,n,i;if(e=t.toString(16).toUpperCase(),t<=255)n="x",i=2;else if(t<=65535)n="u",i=4;else if(t<=4294967295)n="U",i=8;else throw new $t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+at.repeat("0",i-e.length)+e}var MP=1,su=2;function RP(t){this.schema=t.schema||db,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=at.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=EP(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?su:MP,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function QC(t,e){for(var n=at.repeat(" ",e),i=0,r=-1,s="",o,l=t.length;i<l;)r=t.indexOf(`
|
|
26
26
|
`,i),r===-1?(o=t.slice(i),i=l):(o=t.slice(i,r+1),i=r+1),o.length&&o!==`
|
|
27
27
|
`&&(s+=n),s+=o;return s}function ab(t,e){return`
|
|
28
|
-
`+at.repeat(" ",t.indent*e)}function NP(t,e){var n,i,r;for(n=0,i=t.implicitTypes.length;n<i;n+=1)if(r=t.implicitTypes[n],r.resolve(e))return!0;return!1}function Ah(t){return t===dP||t===uP}function ou(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==mb||65536<=t&&t<=1114111}function XC(t){return ou(t)&&t!==mb&&t!==fP&&t!==ru}function WC(t,e,n){var i=XC(t),r=i&&!Ah(t);return(n?i:i&&t!==BO&&t!==qO&&t!==PO&&t!==zO&&t!==HO)&&t!==lb&&!(e===kh&&!r)||XC(e)&&!Ah(e)&&t===lb||e===kh&&r}function LP(t){return ou(t)&&t!==mb&&!Ah(t)&&t!==vP&&t!==wP&&t!==kh&&t!==BO&&t!==qO&&t!==PO&&t!==zO&&t!==HO&&t!==lb&&t!==gP&&t!==bP&&t!==hP&&t!==CP&&t!==xP&&t!==SP&&t!==yP&&t!==pP&&t!==mP&&t!==kP&&t!==AP}function IP(t){return!Ah(t)&&t!==kh}function nu(t,e){var n=t.charCodeAt(e),i;return n>=55296&&n<=56319&&e+1<t.length&&(i=t.charCodeAt(e+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function UO(t){var e=/^\n* /;return e.test(t)}var FO=1,cb=2,$O=3,VO=4,Fl=5;function _P(t,e,n,i,r,s,o,l){var a,c=0,u=null,f=!1,d=!1,h=i!==-1,
|
|
28
|
+
`+at.repeat(" ",t.indent*e)}function NP(t,e){var n,i,r;for(n=0,i=t.implicitTypes.length;n<i;n+=1)if(r=t.implicitTypes[n],r.resolve(e))return!0;return!1}function Ah(t){return t===dP||t===uP}function ou(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==mb||65536<=t&&t<=1114111}function XC(t){return ou(t)&&t!==mb&&t!==fP&&t!==ru}function WC(t,e,n){var i=XC(t),r=i&&!Ah(t);return(n?i:i&&t!==BO&&t!==qO&&t!==PO&&t!==zO&&t!==HO)&&t!==lb&&!(e===kh&&!r)||XC(e)&&!Ah(e)&&t===lb||e===kh&&r}function LP(t){return ou(t)&&t!==mb&&!Ah(t)&&t!==vP&&t!==wP&&t!==kh&&t!==BO&&t!==qO&&t!==PO&&t!==zO&&t!==HO&&t!==lb&&t!==gP&&t!==bP&&t!==hP&&t!==CP&&t!==xP&&t!==SP&&t!==yP&&t!==pP&&t!==mP&&t!==kP&&t!==AP}function IP(t){return!Ah(t)&&t!==kh}function nu(t,e){var n=t.charCodeAt(e),i;return n>=55296&&n<=56319&&e+1<t.length&&(i=t.charCodeAt(e+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function UO(t){var e=/^\n* /;return e.test(t)}var FO=1,cb=2,$O=3,VO=4,Fl=5;function _P(t,e,n,i,r,s,o,l){var a,c=0,u=null,f=!1,d=!1,h=i!==-1,m=-1,g=LP(nu(t,0))&&IP(nu(t,t.length-1));if(e||o)for(a=0;a<t.length;c>=65536?a+=2:a++){if(c=nu(t,a),!ou(c))return Fl;g=g&&WC(c,u,l),u=c}else{for(a=0;a<t.length;c>=65536?a+=2:a++){if(c=nu(t,a),c===ru)f=!0,h&&(d=d||a-m-1>i&&t[m+1]!==" ",m=a);else if(!ou(c))return Fl;g=g&&WC(c,u,l),u=c}d=d||h&&a-m-1>i&&t[m+1]!==" "}return!f&&!d?g&&!o&&!r(t)?FO:s===su?Fl:cb:n>9&&UO(t)?Fl:o?s===su?Fl:cb:d?VO:$O}function BP(t,e,n,i,r){t.dump=(function(){if(e.length===0)return t.quotingType===su?'""':"''";if(!t.noCompatMode&&(OP.indexOf(e)!==-1||TP.test(e)))return t.quotingType===su?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,n),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),l=i||t.flowLevel>-1&&n>=t.flowLevel;function a(c){return NP(t,c)}switch(_P(e,l,t.indent,o,a,t.quotingType,t.forceQuotes&&!i,r)){case FO:return e;case cb:return"'"+e.replace(/'/g,"''")+"'";case $O:return"|"+ZC(e,t.indent)+JC(QC(e,s));case VO:return">"+ZC(e,t.indent)+JC(QC(qP(e,o),s));case Fl:return'"'+PP(e)+'"';default:throw new $t("impossible error: invalid scalar style")}})()}function ZC(t,e){var n=UO(t)?String(e):"",i=t[t.length-1]===`
|
|
29
29
|
`,r=i&&(t[t.length-2]===`
|
|
30
30
|
`||t===`
|
|
31
31
|
`),s=r?"+":i?"":"-";return n+s+`
|
|
@@ -36,31 +36,31 @@ Error generating stack: `+n.message+`
|
|
|
36
36
|
`:"")+eO(a,e),r=s}return i}function eO(t,e){if(t===""||t[0]===" ")return t;for(var n=/ [^ ]/g,i,r=0,s,o=0,l=0,a="";i=n.exec(t);)l=i.index,l-r>e&&(s=o>r?o:l,a+=`
|
|
37
37
|
`+t.slice(r,s),r=s+1),o=l;return a+=`
|
|
38
38
|
`,t.length-r>e&&o>r?a+=t.slice(r,o)+`
|
|
39
|
-
`+t.slice(o+1):a+=t.slice(r),a.slice(1)}function PP(t){for(var e="",n=0,i,r=0;r<t.length;n>=65536?r+=2:r++)n=nu(t,r),i=
|
|
40
|
-
`:""}var VP=$P,jP={dump:VP};function gb(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var YP=
|
|
39
|
+
`+t.slice(o+1):a+=t.slice(r),a.slice(1)}function PP(t){for(var e="",n=0,i,r=0;r<t.length;n>=65536?r+=2:r++)n=nu(t,r),i=Nt[n],!i&&ou(n)?(e+=t[r],n>=65536&&(e+=t[r+1])):e+=i||DP(n);return e}function zP(t,e,n){var i="",r=t.tag,s,o,l;for(s=0,o=n.length;s<o;s+=1)l=n[s],t.replacer&&(l=t.replacer.call(n,String(s),l)),(yr(t,e,l,!1,!1)||typeof l>"u"&&yr(t,e,null,!1,!1))&&(i!==""&&(i+=","+(t.condenseFlow?"":" ")),i+=t.dump);t.tag=r,t.dump="["+i+"]"}function tO(t,e,n,i){var r="",s=t.tag,o,l,a;for(o=0,l=n.length;o<l;o+=1)a=n[o],t.replacer&&(a=t.replacer.call(n,String(o),a)),(yr(t,e+1,a,!0,!0,!1,!0)||typeof a>"u"&&yr(t,e+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=ab(t,e)),t.dump&&ru===t.dump.charCodeAt(0)?r+="-":r+="- ",r+=t.dump);t.tag=s,t.dump=r||"[]"}function HP(t,e,n){var i="",r=t.tag,s=Object.keys(n),o,l,a,c,u;for(o=0,l=s.length;o<l;o+=1)u="",i!==""&&(u+=", "),t.condenseFlow&&(u+='"'),a=s[o],c=n[a],t.replacer&&(c=t.replacer.call(n,a,c)),yr(t,e,a,!1,!1)&&(t.dump.length>1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),yr(t,e,c,!1,!1)&&(u+=t.dump,i+=u));t.tag=r,t.dump="{"+i+"}"}function UP(t,e,n,i){var r="",s=t.tag,o=Object.keys(n),l,a,c,u,f,d;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new $t("sortKeys must be a boolean or a function");for(l=0,a=o.length;l<a;l+=1)d="",(!i||r!=="")&&(d+=ab(t,e)),c=o[l],u=n[c],t.replacer&&(u=t.replacer.call(n,c,u)),yr(t,e+1,c,!0,!0,!0)&&(f=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,f&&(t.dump&&ru===t.dump.charCodeAt(0)?d+="?":d+="? "),d+=t.dump,f&&(d+=ab(t,e)),yr(t,e+1,u,!0,f)&&(t.dump&&ru===t.dump.charCodeAt(0)?d+=":":d+=": ",d+=t.dump,r+=d));t.tag=s,t.dump=r||"{}"}function nO(t,e,n){var i,r,s,o,l,a;for(r=n?t.explicitTypes:t.implicitTypes,s=0,o=r.length;s<o;s+=1)if(l=r[s],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof e=="object"&&e instanceof l.instanceOf)&&(!l.predicate||l.predicate(e))){if(n?l.multi&&l.representName?t.tag=l.representName(e):t.tag=l.tag:t.tag="?",l.represent){if(a=t.styleMap[l.tag]||l.defaultStyle,IO.call(l.represent)==="[object Function]")i=l.represent(e,a);else if(_O.call(l.represent,a))i=l.represent[a](e,a);else throw new $t("!<"+l.tag+'> tag resolver accepts not "'+a+'" style');t.dump=i}return!0}return!1}function yr(t,e,n,i,r,s,o){t.tag=null,t.dump=n,nO(t,n,!1)||nO(t,n,!0);var l=IO.call(t.dump),a=i,c;i&&(i=t.flowLevel<0||t.flowLevel>e);var u=l==="[object Object]"||l==="[object Array]",f,d;if(u&&(f=t.duplicates.indexOf(n),d=f!==-1),(t.tag!==null&&t.tag!=="?"||d||t.indent!==2&&e>0)&&(r=!1),d&&t.usedDuplicates[f])t.dump="*ref_"+f;else{if(u&&d&&!t.usedDuplicates[f]&&(t.usedDuplicates[f]=!0),l==="[object Object]")i&&Object.keys(t.dump).length!==0?(UP(t,e,t.dump,r),d&&(t.dump="&ref_"+f+t.dump)):(HP(t,e,t.dump),d&&(t.dump="&ref_"+f+" "+t.dump));else if(l==="[object Array]")i&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?tO(t,e-1,t.dump,r):tO(t,e,t.dump,r),d&&(t.dump="&ref_"+f+t.dump)):(zP(t,e,t.dump),d&&(t.dump="&ref_"+f+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&BP(t,t.dump,e,s,a);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new $t("unacceptable kind of an object to dump "+l)}t.tag!==null&&t.tag!=="?"&&(c=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",t.dump=c+" "+t.dump)}return!0}function FP(t,e){var n=[],i=[],r,s;for(ub(t,n,i),r=0,s=i.length;r<s;r+=1)e.duplicates.push(n[i[r]]);e.usedDuplicates=new Array(s)}function ub(t,e,n){var i,r,s;if(t!==null&&typeof t=="object")if(r=e.indexOf(t),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(e.push(t),Array.isArray(t))for(r=0,s=t.length;r<s;r+=1)ub(t[r],e,n);else for(i=Object.keys(t),r=0,s=i.length;r<s;r+=1)ub(t[i[r]],e,n)}function $P(t,e){e=e||{};var n=new RP(e);n.noRefs||FP(t,n);var i=t;return n.replacer&&(i=n.replacer.call({"":i},"",i)),yr(n,0,i,!0,!0)?n.dump+`
|
|
40
|
+
`:""}var VP=$P,jP={dump:VP};function gb(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var YP=kt,KP=sO,GP=cO,QP=pO,XP=mO,WP=db,jO=LO.load,ZP=LO.loadAll,JP=jP.dump,ez=$t,tz={binary:xO,float:hO,map:aO,null:uO,pairs:wO,set:kO,timestamp:bO,bool:fO,int:dO,merge:vO,omap:SO,seq:lO,str:oO},nz=gb("safeLoad","load"),iz=gb("safeLoadAll","loadAll"),rz=gb("safeDump","dump"),co={Type:YP,Schema:KP,FAILSAFE_SCHEMA:GP,JSON_SCHEMA:QP,CORE_SCHEMA:XP,DEFAULT_SCHEMA:WP,load:jO,loadAll:ZP,dump:JP,YAMLException:ez,types:tz,safeLoad:nz,safeLoadAll:iz,safeDump:rz};function ii(){let t=globalThis.crypto;if(t&&typeof t.randomUUID=="function")return t.randomUUID();let e=Date.now().toString(36),n=Math.random().toString(36).slice(2,12),i=Math.random().toString(36).slice(2,12);return`${e}-${n}-${i}`}var ds=class t extends Error{constructor(e,n,i){super(e),this.name="SpecParseError",this.line=n,this.column=i,Object.setPrototypeOf(this,t.prototype)}};function Yl(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function YO(t){return Array.isArray(t)?t:Yl(t)?Object.entries(t).map(([e,n])=>({[e]:n})):[]}function oz(t){if(typeof t=="string"||!Yl(t))return;let e=Object.keys(t);return e.length>0?e[0]:void 0}function KO(t,e){let n=new Map,i=t.split(`
|
|
41
41
|
`),r=!1,s="",o=-1,l=a=>{s&&(n.set(a,s),s="")};for(let a of i){let c=a.trim();if(!r){c===`${e}:`&&(r=!0);continue}if(c.length>0&&!c.startsWith("#")&&!c.startsWith("-")&&/^[A-Za-z_]/.test(a)&&c.endsWith(":"))break;if(c.startsWith("#")){let u=c.slice(1).trim();s=s?`${s}
|
|
42
42
|
${u}`:u;continue}if(c.startsWith("-")){o+=1,l(o);let u=lz(a);if(u){let f=n.get(o);n.set(o,f?`${f}
|
|
43
43
|
${u}`:u)}}}return n}function lz(t){let e=0,n=!0;for(;e<t.length;){let i=t[e];if(i===" "||i===" "){e+=1;continue}if((i==="'"||i==='"')&&n){e=az(t,e,i),n=!1;continue}if(i==="#"){if(e===0||/\s/.test(t[e-1]))return t.slice(e+1).trim();e+=1;continue}n=i===":"||i===","||i==="["||i==="{",e+=1}}function az(t,e,n){let i=e+1;for(;i<t.length;){let r=t[i];if(n==="'"){if(r==="'"){if(t[i+1]==="'"){i+=2;continue}return i+1}}else{if(r==="\\"){i+=2;continue}if(r==='"')return i+1}i+=1}return i}function cz(t){let e=t.split(`
|
|
44
44
|
`),n=[];for(let i of e){let r=i.trim();if(r!==""){if(r.startsWith("#")){n.push(r.slice(1).trim());continue}break}}return n.length>0?n.join(`
|
|
45
|
-
`):void 0}function GO(t,e){let n=oz(t);if(n===void 0)return null;if(!bh(n))return{id:ii(),kind:e,type:n,params:{},raw:t};let i=J0(n);for(let o of i){if(!o.fromYamlNode)continue;let l=o.fromYamlNode(t);if(l!==null){let a={id:ii(),kind:e,type:o.type,params:l},c=t[n];return Yl(c)&&(a.sourceBody=c),a}}let r=i.find(o=>!o.fromYamlNode);if(r){let o=t[n],l=Yl(o)?{...o}:{};return{id:ii(),kind:e,type:r.type,params:l}}let s=i[0]?.type??n;return{id:ii(),kind:e,type:s,params:{},raw:t}}function hs(t){let e;try{e=t.trim()===""?{}:co.load(t)}catch(d){if(d instanceof co.YAMLException){let h=d.mark?.line!==void 0?d.mark.line+1:void 0,
|
|
45
|
+
`):void 0}function GO(t,e){let n=oz(t);if(n===void 0)return null;if(!bh(n))return{id:ii(),kind:e,type:n,params:{},raw:t};let i=J0(n);for(let o of i){if(!o.fromYamlNode)continue;let l=o.fromYamlNode(t);if(l!==null){let a={id:ii(),kind:e,type:o.type,params:l},c=t[n];return Yl(c)&&(a.sourceBody=c),a}}let r=i.find(o=>!o.fromYamlNode);if(r){let o=t[n],l=Yl(o)?{...o}:{};return{id:ii(),kind:e,type:r.type,params:l}}let s=i[0]?.type??n;return{id:ii(),kind:e,type:s,params:{},raw:t}}function hs(t){let e;try{e=t.trim()===""?{}:co.load(t)}catch(d){if(d instanceof co.YAMLException){let h=d.mark?.line!==void 0?d.mark.line+1:void 0,m=d.mark?.column!==void 0?d.mark.column+1:void 0;throw new ds(d.reason||d.message,h,m)}throw new ds(d.message)}let n=Yl(e)?e:{},i=YO(n.constraints),r=YO(n.directives),s=KO(t,"constraints"),o=KO(t,"directives"),l=[];i.forEach((d,h)=>{let m=GO(d,"constraint");if(!m)return;let g=s.get(h);g&&(m.comment=g),l.push(m)});let a=[];r.forEach((d,h)=>{let m=GO(d,"directive");if(!m)return;let g=o.get(h);g&&(m.comment=g),a.push(m)});let c={constraints:l,directives:a},u=cz(t);u&&(c.headerComment=u);let f=Object.entries(n).filter(([d])=>d!=="constraints"&&d!=="directives").map(([d,h])=>({key:d,value:h}));return f.length>0&&(c.otherSections=f),c}function uz(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function WO(t){let e={};for(let[n,i]of Object.entries(t))if(i!==void 0)if(uz(i)){let r=WO(i);Object.keys(r).length>0&&(e[n]=r)}else e[n]=i;return e}function fz(t){if(t.raw!==void 0)return t.raw;let e=Ft(t.type);return e?.toYamlNode?e.toYamlNode(t.params):{[t.type]:WO(t.params)}}var dz=/^[A-Za-z0-9_.-]+$/;function hz(t){if(!dz.test(t))return!1;try{return co.load(t)===t}catch{return!1}}function QO(t){let e=fz(t);return t.type==="flag"&&Yl(e)&&typeof e.flag=="string"&&hz(e.flag)?[` - flag: ${e.flag}`]:co.dump([e],{flowLevel:2,lineWidth:-1,sortKeys:!1}).trimEnd().split(`
|
|
46
46
|
`).map(i=>` ${i}`)}function XO(t){return t.split(`
|
|
47
47
|
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>` # ${e}`)}function lu(t){let e=[];if(t.headerComment){let n=t.headerComment.split(`
|
|
48
48
|
`).map(i=>i.trim()).filter(i=>i.length>0);for(let i of n)e.push(`# ${i}`);n.length>0&&e.push("")}if(t.constraints.length>0){e.push("constraints:");for(let n of t.constraints)n.comment&&e.push(...XO(n.comment)),e.push(...QO(n))}if(t.directives.length>0){t.constraints.length>0&&e.push(""),e.push("directives:");for(let n of t.directives)n.comment&&e.push(...XO(n.comment)),e.push(...QO(n))}for(let n of t.otherSections??[]){e.length>0&&e.push("");let i=co.dump({[n.key]:n.value},{lineWidth:-1,sortKeys:!1}).trimEnd();e.push(...i.split(`
|
|
49
49
|
`))}return e.length>0?`${e.join(`
|
|
50
50
|
`)}
|
|
51
51
|
`:""}var eT=new Set(["univ","iden","none","Int","seq/Int","String","this","true","false","all","some","no","one","lone","set","sum","let","disj","two","in","and","or","not","implies","iff","else","ni"]),pz=new Set(["all","some","no","one","lone","set","sum","let","disj"]),ZO=/[A-Za-z_][A-Za-z0-9_/]*/g,mz=/^-?\d+$/;function gz(t){let e="",n=0,i=t.length;for(;n<i;){let r=t[n];if(r==="/"&&t[n+1]==="/"||r==="-"&&t[n+1]==="-"){for(;n<i&&t[n]!==`
|
|
52
|
-
`;)e+=" ",n+=1;continue}if(r==='"'||r==="'"){let s=r;for(e+=" ",n+=1;n<i&&t[n]!==s;)e+=" ",n+=1;n<i&&(e+=" ",n+=1);continue}e+=r,n+=1}return e}function yz(t){let e=new Set;for(let n=0;n<t.length;n+=1){let i=t[n];if(!(i.kind!=="word"||!pz.has(i.value)))for(let r=n+1;r<t.length;r+=1){let s=t[r];if(s.kind==="delim"&&(s.value===":"||s.value==="|"||s.value==="="))break;s.kind==="word"&&!eT.has(s.value)&&e.add(s.value)}}return e}function bz(t){let e=gz(t),n=[],i=0,r=e.length;for(;i<r;){let s=e[i];if(/[A-Za-z_]/.test(s)){ZO.lastIndex=i;let o=ZO.exec(e);if(o&&o.index===i){n.push({kind:"word",value:o[0]}),i+=o[0].length;continue}}if(s===":"||s==="|"||s==="="){n.push({kind:"delim",value:s}),i+=1;continue}n.push({kind:"other",value:s}),i+=1}return n}function tT(t){if(typeof t!="string"||t.trim().length===0)return[];let e=bz(t),n=yz(e),i=[],r=new Set;for(let s of e){if(s.kind!=="word")continue;let o=s.value;eT.has(o)||mz.test(o)||n.has(o)||r.has(o)||(r.add(o),i.push(o))}return i}function vz(t){let e=new Set,n=new Set,i=new Set;for(let r of t.types){e.add(r.name);for(let s of r.atoms)i.add(s)}for(let r of t.relations)n.add(r.name);return{types:e,relations:n,atoms:i}}function xz(t,e){return t.types.has(e)||t.relations.has(e)||t.atoms.has(e)}function yb(t,e,n){let i={severity:"warning",message:t,itemId:e,source:"domain"};return n!==void 0&&(i.fieldKey=n),i}function bb(t,e){let n=t.params[e.key];if(typeof n!="string")return;let i=n.trim();return i.length>0?i:void 0}function JO(t,e){let n=
|
|
52
|
+
`;)e+=" ",n+=1;continue}if(r==='"'||r==="'"){let s=r;for(e+=" ",n+=1;n<i&&t[n]!==s;)e+=" ",n+=1;n<i&&(e+=" ",n+=1);continue}e+=r,n+=1}return e}function yz(t){let e=new Set;for(let n=0;n<t.length;n+=1){let i=t[n];if(!(i.kind!=="word"||!pz.has(i.value)))for(let r=n+1;r<t.length;r+=1){let s=t[r];if(s.kind==="delim"&&(s.value===":"||s.value==="|"||s.value==="="))break;s.kind==="word"&&!eT.has(s.value)&&e.add(s.value)}}return e}function bz(t){let e=gz(t),n=[],i=0,r=e.length;for(;i<r;){let s=e[i];if(/[A-Za-z_]/.test(s)){ZO.lastIndex=i;let o=ZO.exec(e);if(o&&o.index===i){n.push({kind:"word",value:o[0]}),i+=o[0].length;continue}}if(s===":"||s==="|"||s==="="){n.push({kind:"delim",value:s}),i+=1;continue}n.push({kind:"other",value:s}),i+=1}return n}function tT(t){if(typeof t!="string"||t.trim().length===0)return[];let e=bz(t),n=yz(e),i=[],r=new Set;for(let s of e){if(s.kind!=="word")continue;let o=s.value;eT.has(o)||mz.test(o)||n.has(o)||r.has(o)||(r.add(o),i.push(o))}return i}function vz(t){let e=new Set,n=new Set,i=new Set;for(let r of t.types){e.add(r.name);for(let s of r.atoms)i.add(s)}for(let r of t.relations)n.add(r.name);return{types:e,relations:n,atoms:i}}function xz(t,e){return t.types.has(e)||t.relations.has(e)||t.atoms.has(e)}function yb(t,e,n){let i={severity:"warning",message:t,itemId:e,source:"domain"};return n!==void 0&&(i.fieldKey=n),i}function bb(t,e){let n=t.params[e.key];if(typeof n!="string")return;let i=n.trim();return i.length>0?i:void 0}function JO(t,e){let n=Ft(t.type);if(!n)return[];let i=[];for(let r of n.fields)if(r.kind==="relationName"){let s=bb(t,r);s!==void 0&&!e.relations.has(s)&&i.push(yb(`Relation "${s}" is not in this instance.`,t.id,r.key))}else if(r.kind==="typeName"){let s=bb(t,r);s!==void 0&&!e.types.has(s)&&i.push(yb(`Type "${s}" is not in this instance.`,t.id,r.key))}else if(r.kind==="selector"){let s=bb(t,r);if(s!==void 0)for(let o of tT(s))xz(e,o)||i.push(yb(`"${o}" is not a type, relation, or atom in this instance.`,t.id,r.key))}return i}function vb(t,e){let n=vz(e),i=[];for(let r of t.constraints)i.push(...JO(r,n));for(let r of t.directives)i.push(...JO(r,n));return i}function nT(t){return t==null?!0:typeof t=="string"?t.trim()==="":Array.isArray(t)?t.length===0:!1}function iT(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}var Sz=["hold"],wz=["source"],kz={edgeColor:["highlight","showLabel","hidden","filter"]},Az=new Map([["inferredEdge",new Map([["color","lineStyle.color"],["style","lineStyle.pattern"],["weight","lineStyle.weight"],["highlight","lineStyle.highlight"]])]]);function Cz(t,e){let n=t.length,i=e.length,r=new Array(i+1),s=new Array(i+1);for(let o=0;o<=i;o++)r[o]=o;for(let o=1;o<=n;o++){s[0]=o;for(let l=1;l<=i;l++){let a=t[o-1]===e[l-1]?0:1;s[l]=Math.min(r[l]+1,s[l-1]+1,r[l-1]+a)}for(let l=0;l<=i;l++)r[l]=s[l]}return r[i]}function Oz(t,e){let n,i=1/0,r=t.toLowerCase();for(let s of e){let o=Cz(r,s.toLowerCase());o<i&&(i=o,n=s)}return n!==void 0&&i<=2&&i<t.length?n:void 0}function rT(t,e,n,i,r=t){let s=Oz(t,e),o=s?` Did you mean "${s}"?`:e.length>0?` Known fields: ${e.join(", ")}.`:"";return{severity:"warning",code:"unknown-key",message:`Unknown field "${t}" in ${n}.${o}`,itemId:i,fieldKey:r,source:"structure"}}function Tz(t,e){let n=[],i=e.fields.map(l=>l.key),r=new Set(i);if(t.kind==="constraint")for(let l of Sz)r.add(l);for(let l of wz)r.add(l);for(let l of kz[t.type]??[])r.add(l);let s=Az.get(t.type),o=iT(t.sourceBody)?t.sourceBody:t.params;for(let l of Object.keys(o)){let a=s?.get(l);if(a!==void 0){n.push({severity:"warning",code:"deprecated",message:`"${l}" on ${e.label} is deprecated. Use "${a}" instead.`,itemId:t.id,source:"structure"});continue}r.has(l)||n.push(rT(l,i,e.label,t.id))}for(let l of e.fields){if(l.kind!=="group"||!l.children)continue;let a=t.params[l.key];if(!iT(a))continue;let c=l.children.map(f=>f.key),u=new Set(c);for(let f of Object.keys(a))u.has(f)||n.push(rT(f,c,l.label,t.id,`${l.key}.${f}`))}return n}function xb(t){let e=[];if(t.raw!==void 0&&Ft(t.type)===void 0)return e.push({severity:"warning",code:"unknown-type",message:`Unknown ${t.kind} type "${t.type}". It is preserved as-is but the builder cannot edit it.`,itemId:t.id,source:"structure"}),e;let n=Ft(t.type);if(!n)return e.push({severity:"warning",code:"unknown-type",message:`Unknown ${t.kind} type "${t.type}".`,itemId:t.id,source:"structure"}),e;if(t.kind!==n.kind){let i=n.alsoAcceptedIn?.includes(t.kind)??!1;e.push(i?{severity:"warning",code:"deprecated",message:`"${n.label}" is a ${n.kind}. Writing it under "${t.kind}s" is deprecated \u2014 move it to the "${n.kind}s" section.`,itemId:t.id,source:"structure"}:{severity:"error",code:"wrong-section",message:`"${n.label}" is a ${n.kind} and is ignored under "${t.kind}s". Move it to the "${n.kind}s" section.`,itemId:t.id,source:"structure"})}if(n.deprecated){let i=n.deprecatedInFavorOf?` Use "${n.deprecatedInFavorOf}" instead.`:"";e.push({severity:"warning",code:"deprecated",message:`"${n.label}" is deprecated.${i}`,itemId:t.id,source:"structure"})}for(let i of n.fields){let r=t.params[i.key];if(i.required&&nT(r)){e.push({severity:"error",code:"missing-required",message:`Missing required field "${i.label}".`,itemId:t.id,fieldKey:i.key,source:"structure"});continue}if(i.kind==="enum"&&i.options&&!nT(r)){let s=new Set(i.options),o=i.multiple?Array.isArray(r)?r.map(l=>String(l)):[String(r)]:[String(r)];for(let l of o)s.has(l)||e.push({severity:"error",code:"invalid-value",message:`Invalid value "${l}" for "${i.label}". Allowed: ${i.options.join(", ")}.`,itemId:t.id,fieldKey:i.key,source:"structure"})}}if(e.push(...Tz(t,n)),n.validate)for(let i of n.validate(t.params))e.push(i.itemId?i:{...i,itemId:t.id});return e}function Ez(t){let e=[],n=new Map;for(let i of t){if(i.type!=="cyclic")continue;let r=String(i.params.selector??""),s=String(i.params.direction??"");if(!r||!s)continue;let o=n.get(r);o&&o.direction!==s?e.push({severity:"error",message:`Inconsistent cyclic directions for selector "${r}" (${o.direction} vs ${s}) \u2014 the layout engine rejects this spec.`,itemId:i.id,fieldKey:"direction",source:"structure"}):o||n.set(r,{direction:s,itemId:i.id})}return e}function au(t,e){let n=[];for(let i of t.constraints)n.push(...xb(i));for(let i of t.directives)n.push(...xb(i));return n.push(...Ez(t.constraints)),e&&n.push(...vb(t,e)),n}function Dz(t){if(t===void 0)return;let e=t.split(`
|
|
53
53
|
`).map(n=>n.trim()).filter(n=>n.length>0);return e.length>0?e.join(`
|
|
54
|
-
`):void 0}function uu(t){return{id:t.id,kind:t.kind,type:t.type,params:fu(t.params),...t.comment!==void 0?{comment:t.comment}:{},...t.raw!==void 0?{raw:fu(t.raw)}:{}}}function fu(t){if(Array.isArray(t))return t.map(e=>fu(e));if(t!==null&&typeof t=="object"){let e={};for(let[n,i]of Object.entries(t))e[n]=fu(i);return e}return t}function cu(t){return{constraints:t.constraints.map(uu),directives:t.directives.map(uu),...t.headerComment!==void 0?{headerComment:t.headerComment}:{},...t.otherSections!==void 0?{otherSections:t.otherSections.map(e=>({key:e.key,value:fu(e.value)}))}:{}}}function Mz(t){return t.constraints.forEach(e=>{Object.freeze(e.params),Object.freeze(e)}),t.directives.forEach(e=>{Object.freeze(e.params),Object.freeze(e)}),Object.freeze(t.constraints),Object.freeze(t.directives),t.otherSections!==void 0&&(t.otherSections.forEach(e=>Object.freeze(e)),Object.freeze(t.otherSections)),Object.freeze(t)}var Kl=class t{constructor(e){this.undoStack=[];this.redoStack=[];this.listeners=new Set;this.state=e?cu(e):{constraints:[],directives:[]}}static fromYaml(e){let n=hs(e);return new t(n)}toYaml(){return lu(this.state)}getState(){return this.frozen||(this.frozen=Mz(cu(this.state))),this.frozen}addItem(e,n){let i=
|
|
55
|
-
`)}};Bi.defaultYaml={explicit:!1,version:"1.2"};Bi.defaultTags={"!!":"tag:yaml.org,2002:"};function Mh(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function wb(t){let e=new Set;return _i(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}function kb(t,e){for(let n=1;;++n){let i=`${t}${n}`;if(!e.has(i))return i}}function cT(t,e){let n=[],i=new Map,r=null;return{onAnchor:s=>{n.push(s),r??(r=wb(t));let o=kb(e,r);return r.add(o),o},setAnchors:()=>{for(let s of n){let o=i.get(s);if(typeof o=="object"&&o.anchor&&(K(o.node)||be(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function ps(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){let o=i[r],l=ps(t,i,String(r),o);l===void 0?delete i[r]:l!==o&&(i[r]=l)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let s=i.get(r),o=ps(t,i,r,s);o===void 0?i.delete(r):o!==s&&i.set(r,o)}else if(i instanceof Set)for(let r of Array.from(i)){let s=ps(t,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(let[r,s]of Object.entries(i)){let o=ps(t,i,r,s);o===void 0?delete i[r]:o!==s&&(i[r]=o)}return t.call(e,n,i)}function ct(t,e,n){if(Array.isArray(t))return t.map((i,r)=>ct(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!Eh(t))return t.toJSON(e,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=s=>{i.res=s,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}var ms=class{constructor(e){Object.defineProperty(this
|
|
56
|
-
`)?
|
|
54
|
+
`):void 0}function uu(t){return{id:t.id,kind:t.kind,type:t.type,params:fu(t.params),...t.comment!==void 0?{comment:t.comment}:{},...t.raw!==void 0?{raw:fu(t.raw)}:{}}}function fu(t){if(Array.isArray(t))return t.map(e=>fu(e));if(t!==null&&typeof t=="object"){let e={};for(let[n,i]of Object.entries(t))e[n]=fu(i);return e}return t}function cu(t){return{constraints:t.constraints.map(uu),directives:t.directives.map(uu),...t.headerComment!==void 0?{headerComment:t.headerComment}:{},...t.otherSections!==void 0?{otherSections:t.otherSections.map(e=>({key:e.key,value:fu(e.value)}))}:{}}}function Mz(t){return t.constraints.forEach(e=>{Object.freeze(e.params),Object.freeze(e)}),t.directives.forEach(e=>{Object.freeze(e.params),Object.freeze(e)}),Object.freeze(t.constraints),Object.freeze(t.directives),t.otherSections!==void 0&&(t.otherSections.forEach(e=>Object.freeze(e)),Object.freeze(t.otherSections)),Object.freeze(t)}var Kl=class t{constructor(e){this.undoStack=[];this.redoStack=[];this.listeners=new Set;this.state=e?cu(e):{constraints:[],directives:[]}}static fromYaml(e){let n=hs(e);return new t(n)}toYaml(){return lu(this.state)}getState(){return this.frozen||(this.frozen=Mz(cu(this.state))),this.frozen}addItem(e,n){let i=Ft(n);if(!i)throw new Error(`Cannot add unknown ${e} type "${n}".`);if(i.kind!==e)throw new Error(`Type "${n}" is a ${i.kind}, not a ${e}.`);this.pushUndo();let r={id:ii(),kind:e,type:n,params:nb(n)};return e==="constraint"?this.state.constraints.push(r):this.state.directives.push(r),this.commit(),uu(r)}updateItem(e,n){let i=this.find(e);if(!i)return;this.pushUndo();let{item:r}=i;if(n.type!==void 0&&(r.type=n.type),n.params!==void 0){let s={...r.params};for(let[o,l]of Object.entries(n.params))l===void 0?delete s[o]:s[o]=l;r.params=s}if("comment"in n){let s=Dz(n.comment);s===void 0?delete r.comment:r.comment=s}this.commit()}duplicateItem(e){let n=this.find(e);if(!n)return null;this.pushUndo();let i={...uu(n.item),id:ii()};return(n.kind==="constraint"?this.state.constraints:this.state.directives).splice(n.index+1,0,i),this.commit(),uu(i)}removeItem(e){let n=this.find(e);if(!n)return;this.pushUndo(),(n.kind==="constraint"?this.state.constraints:this.state.directives).splice(n.index,1),this.commit()}moveItem(e,n){let i=this.find(e);if(!i)return;let r=i.kind==="constraint"?this.state.constraints:this.state.directives,s=Math.max(0,Math.min(n,r.length-1));if(s===i.index)return;this.pushUndo();let[o]=r.splice(i.index,1);r.splice(s,0,o),this.commit()}replaceFromYaml(e){let n=hs(e);this.pushUndo(),this.state=n,this.commit()}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}undo(){let e=this.undoStack.pop();e&&(this.redoStack.push(cu(this.state)),this.state=e,this.commit())}redo(){let e=this.redoStack.pop();e&&(this.undoStack.push(cu(this.state)),this.state=e,this.commit())}validate(e){return au(this.state,e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}pushUndo(){this.undoStack.push(cu(this.state)),this.redoStack.length=0}commit(){this.frozen=void 0;let e=this.getState();for(let n of this.listeners)n(e)}find(e){let n=this.state.constraints.findIndex(r=>r.id===e);if(n!==-1)return{item:this.state.constraints[n],index:n,kind:"constraint"};let i=this.state.directives.findIndex(r=>r.id===e);if(i!==-1)return{item:this.state.directives[i],index:i,kind:"directive"}}};var Oh=Symbol.for("yaml.alias"),Th=Symbol.for("yaml.document"),ri=Symbol.for("yaml.map"),Sb=Symbol.for("yaml.pair"),Sn=Symbol.for("yaml.scalar"),br=Symbol.for("yaml.seq"),Vt=Symbol.for("yaml.node.type"),si=t=>!!t&&typeof t=="object"&&t[Vt]===Oh,Li=t=>!!t&&typeof t=="object"&&t[Vt]===Th,jt=t=>!!t&&typeof t=="object"&&t[Vt]===ri,le=t=>!!t&&typeof t=="object"&&t[Vt]===Sb,K=t=>!!t&&typeof t=="object"&&t[Vt]===Sn,Yt=t=>!!t&&typeof t=="object"&&t[Vt]===br;function be(t){if(t&&typeof t=="object")switch(t[Vt]){case ri:case br:return!0}return!1}function ae(t){if(t&&typeof t=="object")switch(t[Vt]){case Oh:case ri:case Sn:case br:return!0}return!1}var Eh=t=>(K(t)||be(t))&&!!t.anchor;var rn=Symbol("break visit"),sT=Symbol("skip children"),Ii=Symbol("remove node");function _i(t,e){let n=oT(e);Li(t)?Gl(null,t.contents,n,Object.freeze([t]))===Ii&&(t.contents=null):Gl(null,t,n,Object.freeze([]))}_i.BREAK=rn;_i.SKIP=sT;_i.REMOVE=Ii;function Gl(t,e,n,i){let r=lT(t,e,n,i);if(ae(r)||le(r))return aT(t,i,r),Gl(t,r,n,i);if(typeof r!="symbol"){if(be(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=Gl(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===rn)return rn;o===Ii&&(e.items.splice(s,1),s-=1)}}}else if(le(e)){i=Object.freeze(i.concat(e));let s=Gl("key",e.key,n,i);if(s===rn)return rn;s===Ii&&(e.key=null);let o=Gl("value",e.value,n,i);if(o===rn)return rn;o===Ii&&(e.value=null)}}return r}async function Dh(t,e){let n=oT(e);Li(t)?await Ql(null,t.contents,n,Object.freeze([t]))===Ii&&(t.contents=null):await Ql(null,t,n,Object.freeze([]))}Dh.BREAK=rn;Dh.SKIP=sT;Dh.REMOVE=Ii;async function Ql(t,e,n,i){let r=await lT(t,e,n,i);if(ae(r)||le(r))return aT(t,i,r),Ql(t,r,n,i);if(typeof r!="symbol"){if(be(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=await Ql(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===rn)return rn;o===Ii&&(e.items.splice(s,1),s-=1)}}}else if(le(e)){i=Object.freeze(i.concat(e));let s=await Ql("key",e.key,n,i);if(s===rn)return rn;s===Ii&&(e.key=null);let o=await Ql("value",e.value,n,i);if(o===rn)return rn;o===Ii&&(e.value=null)}}return r}function oT(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function lT(t,e,n,i){if(typeof n=="function")return n(t,e,i);if(jt(e))return n.Map?.(t,e,i);if(Yt(e))return n.Seq?.(t,e,i);if(le(e))return n.Pair?.(t,e,i);if(K(e))return n.Scalar?.(t,e,i);if(si(e))return n.Alias?.(t,e,i)}function aT(t,e,n){let i=e[e.length-1];if(be(i))i.items[t]=n;else if(le(i))t==="key"?i.key=n:i.value=n;else if(Li(i))i.contents=n;else{let r=si(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}var Rz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Nz=t=>t.replace(/[!,[\]{}]/g,e=>Rz[e]),Bi=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,i]of Object.entries(this.tags))if(e.startsWith(i))return n+Nz(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&ae(e.contents)){let s={};_i(e.contents,(o,l)=>{ae(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(let[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
|
|
55
|
+
`)}};Bi.defaultYaml={explicit:!1,version:"1.2"};Bi.defaultTags={"!!":"tag:yaml.org,2002:"};function Mh(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function wb(t){let e=new Set;return _i(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}function kb(t,e){for(let n=1;;++n){let i=`${t}${n}`;if(!e.has(i))return i}}function cT(t,e){let n=[],i=new Map,r=null;return{onAnchor:s=>{n.push(s),r??(r=wb(t));let o=kb(e,r);return r.add(o),o},setAnchors:()=>{for(let s of n){let o=i.get(s);if(typeof o=="object"&&o.anchor&&(K(o.node)||be(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function ps(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){let o=i[r],l=ps(t,i,String(r),o);l===void 0?delete i[r]:l!==o&&(i[r]=l)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let s=i.get(r),o=ps(t,i,r,s);o===void 0?i.delete(r):o!==s&&i.set(r,o)}else if(i instanceof Set)for(let r of Array.from(i)){let s=ps(t,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(let[r,s]of Object.entries(i)){let o=ps(t,i,r,s);o===void 0?delete i[r]:o!==s&&(i[r]=o)}return t.call(e,n,i)}function ct(t,e,n){if(Array.isArray(t))return t.map((i,r)=>ct(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!Eh(t))return t.toJSON(e,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=s=>{i.res=s,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}var ms=class{constructor(e){Object.defineProperty(this,Vt,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!Li(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=ct(this,"",o);if(typeof r=="function")for(let{count:a,res:c}of o.anchors.values())r(c,a);return typeof s=="function"?ps(s,{"":l},"",l):l}};var vr=class extends ms{constructor(e){super(Oh),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],_i(e,{Node:(s,o)=>{(si(o)||Eh(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(let s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(e,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=i.get(o);if(l||(ct(o,null,n),l=i.get(o)),l?.res===void 0){let a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=Rh(r,o,i)),l.count*l.aliasCount>s)){let a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return l.res}toString(e,n,i){let r=`*${this.source}`;if(e){if(Mh(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}};function Rh(t,e,n){if(si(e)){let i=e.resolve(t),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(be(e)){let i=0;for(let r of e.items){let s=Rh(t,r,n);s>i&&(i=s)}return i}else if(le(e)){let i=Rh(t,e.key,n),r=Rh(t,e.value,n);return Math.max(i,r)}return 1}var Nh=t=>!t||typeof t!="function"&&typeof t!="object",q=class extends ms{constructor(e){super(Sn),this.value=e}toJSON(e,n){return n?.keep?this.value:ct(this.value,e,n)}toString(){return String(this.value)}};q.BLOCK_FOLDED="BLOCK_FOLDED";q.BLOCK_LITERAL="BLOCK_LITERAL";q.PLAIN="PLAIN";q.QUOTE_DOUBLE="QUOTE_DOUBLE";q.QUOTE_SINGLE="QUOTE_SINGLE";var Lz="tag:yaml.org,2002:";function Iz(t,e,n){if(e){let i=n.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(i=>i.identify?.(t)&&!i.format)}function xr(t,e,n){if(Li(t)&&(t=t.contents),ae(t))return t;if(le(t)){let f=n.schema[ri].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:l}=n,a;if(i&&t&&typeof t=="object"){if(a=l.get(t),a)return a.anchor??(a.anchor=r(t)),new vr(a.anchor);a={anchor:null,node:null},l.set(t,a)}e?.startsWith("!!")&&(e=Lz+e.slice(2));let c=Iz(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new q(t);return a&&(a.node=f),f}c=t instanceof Map?o[ri]:Symbol.iterator in Object(t)?o[br]:o[ri]}s&&(s(c),delete n.onTagObj);let u=c?.createNode?c.createNode(n.schema,t,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,t,n):new q(t);return e?u.tag=e:c.default||(u.tag=c.tag),a&&(a.node=u),u}function du(t,e,n){let i=n;for(let r=e.length-1;r>=0;--r){let s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return xr(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Wl=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Xl=class extends ms{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(i=>ae(i)||le(i)?i.clone(e):i),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Wl(e))this.add(n);else{let[i,...r]=e,s=this.get(i,!0);if(be(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,du(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[n,...i]=e;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(be(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(e,n){let[i,...r]=e,s=this.get(i,!0);return r.length===0?!n&&K(s)?s.value:s:be(s)?s.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!le(n))return!1;let i=n.value;return i==null||e&&K(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[n,...i]=e;if(i.length===0)return this.has(n);let r=this.get(n,!0);return be(r)?r.hasIn(i):!1}setIn(e,n){let[i,...r]=e;if(r.length===0)this.set(i,n);else{let s=this.get(i,!0);if(be(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,du(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};var uT=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Hn(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var qi=(t,e,n)=>t.endsWith(`
|
|
56
|
+
`)?Hn(n,e):n.includes(`
|
|
57
57
|
`)?`
|
|
58
|
-
`+
|
|
58
|
+
`+Hn(n,e):(t.endsWith(" ")?"":" ")+n;var Ab="flow",Lh="block",hu="quoted";function pu(t,e,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return t;r<s&&(s=0);let a=Math.max(1+s,1+r-e.length);if(t.length<=a)return t;let c=[],u={},f=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?c.push(0):f=r-i);let d,h,m=!1,g=-1,b=-1,p=-1;n===Lh&&(g=fT(t,g,e.length),g!==-1&&(f=g+a));for(let v;v=t[g+=1];){if(n===hu&&v==="\\"){switch(b=g,t[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}p=g}if(v===`
|
|
59
59
|
`)n===Lh&&(g=fT(t,g,e.length)),f=g+e.length+a,d=void 0;else{if(v===" "&&h&&h!==" "&&h!==`
|
|
60
60
|
`&&h!==" "){let x=t[g+1];x&&x!==" "&&x!==`
|
|
61
|
-
`&&x!==" "&&(d=g)}if(g>=f)if(d)c.push(d),f=d+a,d=void 0;else if(n===hu){for(;h===" "||h===" ";)h=v,v=t[g+=1],
|
|
62
|
-
${e}${t.slice(0,
|
|
63
|
-
${e}${t.slice(x+1,
|
|
61
|
+
`&&x!==" "&&(d=g)}if(g>=f)if(d)c.push(d),f=d+a,d=void 0;else if(n===hu){for(;h===" "||h===" ";)h=v,v=t[g+=1],m=!0;let x=g>p+1?g-2:b-1;if(u[x])return t;c.push(x),u[x]=!0,f=x+a,d=void 0}else m=!0}h=v}if(m&&l&&l(),c.length===0)return t;o&&o();let y=t.slice(0,c[0]);for(let v=0;v<c.length;++v){let x=c[v],k=c[v+1]||t.length;x===0?y=`
|
|
62
|
+
${e}${t.slice(0,k)}`:(n===hu&&u[x]&&(y+=`${t[x]}\\`),y+=`
|
|
63
|
+
${e}${t.slice(x+1,k)}`)}return y}function fT(t,e,n){let i=e,r=e+1,s=t[r];for(;s===" "||s===" ";)if(e<r+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
|
|
64
64
|
`);i=e,r=e+1,s=t[r]}return i}var _h=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Bh=t=>/^(%|---|\.\.\.)/m.test(t);function _z(t,e,n){if(!e||e<0)return!1;let i=e-n,r=t.length;if(r<=i)return!1;for(let s=0,o=0;s<r;++s)if(t[s]===`
|
|
65
65
|
`){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function mu(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Bh(t)?" ":""),o="",l=0;for(let a=0,c=n[a];c;c=n[++a])if(c===" "&&n[a+1]==="\\"&&n[a+2]==="n"&&(o+=n.slice(l,a)+"\\ ",a+=1,l=a,c="\\"),c==="\\")switch(n[a+1]){case"u":{o+=n.slice(l,a);let u=n.substr(a+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(a,6)}a+=5,l=a+1}break;case"n":if(i||n[a+2]==='"'||n.length<r)a+=1;else{for(o+=n.slice(l,a)+`
|
|
66
66
|
|
|
@@ -72,69 +72,69 @@ ${n}`)+"'";return e.implicitKey?i:pu(i,n,Ab,_h(e,!1))}function Zl(t,e){let{singl
|
|
|
72
72
|
+(?!
|
|
73
73
|
|$)`,"g")}catch{Ob=/\n+(?!\n|$)/g}function Ih({comment:t,type:e,value:n},i,r,s){let{blockQuote:o,commentString:l,lineWidth:a}=i.options;if(!o||/\n[\t ]+$/.test(n))return Zl(n,i);let c=i.indent||(i.forceBlockIndent||Bh(n)?" ":""),u=o==="literal"?!0:o==="folded"||e===q.BLOCK_FOLDED?!1:e===q.BLOCK_LITERAL?!0:!_z(n,a,c.length);if(!n)return u?`|
|
|
74
74
|
`:`>
|
|
75
|
-
`;let f,d;for(d=n.length;d>0;--d){let
|
|
76
|
-
`&&
|
|
77
|
-
`);
|
|
78
|
-
`&&(h=h.slice(0,-1)),h=h.replace(Ob,`$&${c}`));let g=!1,b,
|
|
79
|
-
`)
|
|
80
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),
|
|
81
|
-
${c}${
|
|
75
|
+
`;let f,d;for(d=n.length;d>0;--d){let k=n[d-1];if(k!==`
|
|
76
|
+
`&&k!==" "&&k!==" ")break}let h=n.substring(d),m=h.indexOf(`
|
|
77
|
+
`);m===-1?f="-":n===h||m!==h.length-1?(f="+",s&&s()):f="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
|
|
78
|
+
`&&(h=h.slice(0,-1)),h=h.replace(Ob,`$&${c}`));let g=!1,b,p=-1;for(b=0;b<n.length;++b){let k=n[b];if(k===" ")g=!0;else if(k===`
|
|
79
|
+
`)p=b;else break}let y=n.substring(0,p<b?p+1:b);y&&(n=n.substring(y.length),y=y.replace(/\n+/g,`$&${c}`));let x=(g?c?"2":"1":"")+f;if(t&&(x+=" "+l(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let k=n.replace(/\n+/g,`
|
|
80
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),C=!1,w=_h(i,!0);o!=="folded"&&e!==q.BLOCK_FOLDED&&(w.onOverflow=()=>{C=!0});let A=pu(`${y}${k}${h}`,c,Lh,w);if(!C)return`>${x}
|
|
81
|
+
${c}${A}`}return n=n.replace(/\n+/g,`$&${c}`),`|${x}
|
|
82
82
|
${c}${y}${n}${h}`}function Bz(t,e,n,i){let{type:r,value:s}=t,{actualString:o,implicitKey:l,indent:a,indentStep:c,inFlow:u}=e;if(l&&s.includes(`
|
|
83
83
|
`)||u&&/[[\]{},]/.test(s))return Zl(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||u||!s.includes(`
|
|
84
84
|
`)?Zl(s,e):Ih(t,e,n,i);if(!l&&!u&&r!==q.PLAIN&&s.includes(`
|
|
85
85
|
`))return Ih(t,e,n,i);if(Bh(s)){if(a==="")return e.forceBlockIndent=!0,Ih(t,e,n,i);if(l&&a===c)return Zl(s,e)}let f=s.replace(/\n+/g,`$&
|
|
86
|
-
${a}`);if(o){let d=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(f),{compat:h,tags:
|
|
87
|
-
${e.indent}${l}`:l}function dT({key:t,value:e},n,i,r){let{allNullValues:s,doc:o,indent:l,indentStep:a,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n,d=
|
|
88
|
-
${l}:`):(b=`${b}:`,d&&(b+=qi(b,n.indent,c(d))));let
|
|
89
|
-
`:"",y){let
|
|
90
|
-
${
|
|
91
|
-
`&&v&&(
|
|
86
|
+
${a}`);if(o){let d=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(f),{compat:h,tags:m}=e.doc.schema;if(m.some(d)||h?.some(d))return Zl(s,e)}return l?f:pu(f,a,Ab,_h(e,!1))}function uo(t,e,n,i){let{implicitKey:r,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==q.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=q.QUOTE_DOUBLE);let a=u=>{switch(u){case q.BLOCK_FOLDED:case q.BLOCK_LITERAL:return r||s?Zl(o.value,e):Ih(o,e,n,i);case q.QUOTE_DOUBLE:return mu(o.value,e);case q.QUOTE_SINGLE:return Cb(o.value,e);case q.PLAIN:return Bz(o,e,n,i);default:return null}},c=a(l);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=r&&u||f;if(c=a(d),c===null)throw new Error(`Unsupported default string type ${d}`)}return c}function qh(t,e){let n=Object.assign({blockQuote:!0,commentString:uT,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,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function qz(t,e){if(e.tag){let r=t.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let n,i;if(K(e)){i=e.value;let r=t.filter(s=>s.identify?.(i));if(r.length>1){let s=r.filter(o=>o.test);s.length>0&&(r=s)}n=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,n=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function Pz(t,e,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],s=(K(t)||be(t))&&t.anchor;s&&Mh(s)&&(n.add(s),r.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function Sr(t,e,n,i){if(le(t))return t.toString(e,n,i);if(si(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,s=ae(t)?t:e.doc.createNode(t,{onTagObj:a=>r=a});r??(r=qz(e.doc.schema.tags,s));let o=Pz(s,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let l=typeof r.stringify=="function"?r.stringify(s,e,n,i):K(s)?uo(s,e,n,i):s.toString(e,n,i);return o?K(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
|
|
87
|
+
${e.indent}${l}`:l}function dT({key:t,value:e},n,i,r){let{allNullValues:s,doc:o,indent:l,indentStep:a,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n,d=ae(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(be(t)||!ae(t)&&typeof t=="object"){let w="With simple keys, collection cannot be used as a key value";throw new Error(w)}}let h=!f&&(!t||d&&e==null&&!n.inFlow||be(t)||(K(t)?t.type===q.BLOCK_FOLDED||t.type===q.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(f||!s),indent:l+a});let m=!1,g=!1,b=Sr(t,n,()=>m=!0,()=>g=!0);if(!h&&!n.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||e==null)return m&&i&&i(),b===""?"?":h?`? ${b}`:b}else if(s&&!f||e==null&&h)return b=`? ${b}`,d&&!m?b+=qi(b,n.indent,c(d)):g&&r&&r(),b;m&&(d=null),h?(d&&(b+=qi(b,n.indent,c(d))),b=`? ${b}
|
|
88
|
+
${l}:`):(b=`${b}:`,d&&(b+=qi(b,n.indent,c(d))));let p,y,v;ae(e)?(p=!!e.spaceBefore,y=e.commentBefore,v=e.comment):(p=!1,y=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!h&&!d&&K(e)&&(n.indentAtStart=b.length+1),g=!1,!u&&a.length>=2&&!n.inFlow&&!h&&Yt(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let x=!1,k=Sr(e,n,()=>x=!0,()=>g=!0),C=" ";if(d||p||y){if(C=p?`
|
|
89
|
+
`:"",y){let w=c(y);C+=`
|
|
90
|
+
${Hn(w,n.indent)}`}k===""&&!n.inFlow?C===`
|
|
91
|
+
`&&v&&(C=`
|
|
92
92
|
|
|
93
|
-
`):
|
|
94
|
-
${n.indent}`}else if(!h&&be(e)){let k
|
|
95
|
-
`),O=
|
|
96
|
-
${n.indent}`)}}else(
|
|
97
|
-
`)&&(
|
|
93
|
+
`):C+=`
|
|
94
|
+
${n.indent}`}else if(!h&&be(e)){let w=k[0],A=k.indexOf(`
|
|
95
|
+
`),O=A!==-1,D=n.inFlow??e.flow??e.items.length===0;if(O||!D){let I=!1;if(O&&(w==="&"||w==="!")){let M=k.indexOf(" ");w==="&"&&M!==-1&&M<A&&k[M+1]==="!"&&(M=k.indexOf(" ",M+1)),(M===-1||A<M)&&(I=!0)}I||(C=`
|
|
96
|
+
${n.indent}`)}}else(k===""||k[0]===`
|
|
97
|
+
`)&&(C="");return b+=C+k,n.inFlow?x&&i&&i():v&&!x?b+=qi(b,n.indent,c(v)):g&&r&&r(),b}function Tb(t,e){(t==="debug"||t==="warn")&&console.warn(e)}var Ph="<<",oi={identify:t=>t===Ph||typeof t=="symbol"&&t.description===Ph,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new q(Symbol(Ph)),{addToJSMap:Db}),stringify:()=>Ph},hT=(t,e)=>(oi.identify(e)||K(e)&&(!e.type||e.type===q.PLAIN)&&oi.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===oi.tag&&n.default);function Db(t,e,n){let i=pT(t,n);if(Yt(i))for(let r of i.items)Eb(t,e,r);else if(Array.isArray(i))for(let r of i)Eb(t,e,r);else Eb(t,e,i)}function Eb(t,e,n){let i=pT(t,n);if(!jt(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,t,Map);for(let[s,o]of r)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function pT(t,e){return t&&si(e)?e.resolve(t.doc,t):e}function zh(t,e,{key:n,value:i}){if(ae(n)&&n.addToJSMap)n.addToJSMap(t,e,i);else if(hT(t,n))Db(t,e,i);else{let r=ct(n,"",t);if(e instanceof Map)e.set(r,ct(i,r,t));else if(e instanceof Set)e.add(r);else{let s=zz(n,r,t),o=ct(i,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function zz(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(ae(t)&&n?.doc){let i=qh(n.doc,{});i.anchors=new Set;for(let s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=t.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),Tb(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}function Jl(t,e,n){let i=xr(t,void 0,n),r=xr(e,void 0,n);return new Ke(i,r)}var Ke=class t{constructor(e,n=null){Object.defineProperty(this,Vt,{value:Sb}),this.key=e,this.value=n}clone(e){let{key:n,value:i}=this;return ae(n)&&(n=n.clone(e)),ae(i)&&(i=i.clone(e)),new t(n,i)}toJSON(e,n){let i=n?.mapAsMap?new Map:{};return zh(n,i,this)}toString(e,n,i){return e?.doc?dT(this,e,n,i):JSON.stringify(this)}};function Uh(t,e,n){return(e.inFlow??t.flow?Uz:Hz)(t,e,n)}function Hz({comment:t,items:e},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:a,options:{commentString:c}}=n,u=Object.assign({},n,{indent:s,type:null}),f=!1,d=[];for(let m=0;m<e.length;++m){let g=e[m],b=null;if(ae(g))!f&&g.spaceBefore&&d.push(""),Hh(n,d,g.commentBefore,f),g.comment&&(b=g.comment);else if(le(g)){let y=ae(g.key)?g.key:null;y&&(!f&&y.spaceBefore&&d.push(""),Hh(n,d,y.commentBefore,f))}f=!1;let p=Sr(g,u,()=>b=null,()=>f=!0);b&&(p+=qi(p,s,c(b))),f&&b&&(f=!1),d.push(i+p)}let h;if(d.length===0)h=r.start+r.end;else{h=d[0];for(let m=1;m<d.length;++m){let g=d[m];h+=g?`
|
|
98
98
|
${a}${g}`:`
|
|
99
99
|
`}}return t?(h+=`
|
|
100
|
-
`+
|
|
101
|
-
`)),
|
|
100
|
+
`+Hn(c(t),a),l&&l()):f&&o&&o(),h}function Uz({items:t},e,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=e;i+=s;let a=Object.assign({},e,{indent:i,inFlow:!0,type:null}),c=!1,u=0,f=[];for(let m=0;m<t.length;++m){let g=t[m],b=null;if(ae(g))g.spaceBefore&&f.push(""),Hh(e,f,g.commentBefore,!1),g.comment&&(b=g.comment);else if(le(g)){let y=ae(g.key)?g.key:null;y&&(y.spaceBefore&&f.push(""),Hh(e,f,y.commentBefore,!1),y.comment&&(c=!0));let v=ae(g.value)?g.value:null;v?(v.comment&&(b=v.comment),v.commentBefore&&(c=!0)):g.value==null&&y?.comment&&(b=y.comment)}b&&(c=!0);let p=Sr(g,a,()=>b=null);c||(c=f.length>u||p.includes(`
|
|
101
|
+
`)),m<t.length-1?p+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((y,v)=>y+v.length+2,2)+(p.length+2)>e.options.lineWidth)),c&&(p+=",")),b&&(p+=qi(p,i,l(b))),f.push(p),u=f.length}let{start:d,end:h}=n;if(f.length===0)return d+h;if(!c){let m=f.reduce((g,b)=>g+b.length+2,2);c=e.options.lineWidth>0&&m>e.options.lineWidth}if(c){let m=d;for(let g of f)m+=g?`
|
|
102
102
|
${s}${r}${g}`:`
|
|
103
|
-
`;return`${
|
|
104
|
-
${r}${h}`}else return`${d}${o}${f.join(" ")}${o}${h}`}function Hh({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=
|
|
105
|
-
`:" ")}return uo({comment:t,type:e,value:l},i,r,s)}};function Rb(t,e){if(
|
|
103
|
+
`;return`${m}
|
|
104
|
+
${r}${h}`}else return`${d}${o}${f.join(" ")}${o}${h}`}function Hh({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=Hn(e(i),t);n.push(s.trimStart())}}function gs(t,e){let n=K(e)?e.value:e;for(let i of t)if(le(i)&&(i.key===e||i.key===n||K(i.key)&&i.key.value===n))return i}var Ze=class extends Xl{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ri,e),this.items=[]}static from(e,n,i){let{keepUndefined:r,replacer:s}=i,o=new this(e),l=(a,c)=>{if(typeof s=="function")c=s.call(n,a,c);else if(Array.isArray(s)&&!s.includes(a))return;(c!==void 0||r)&&o.items.push(Jl(a,c,i))};if(n instanceof Map)for(let[a,c]of n)l(a,c);else if(n&&typeof n=="object")for(let a of Object.keys(n))l(a,n[a]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let i;le(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Ke(e,e?.value):i=new Ke(e.key,e.value);let r=gs(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);K(r.value)&&Nh(i.value)?r.value.value=i.value:r.value=i.value}else if(s){let o=this.items.findIndex(l=>s(i,l)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let n=gs(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=gs(this.items,e)?.value;return(!n&&K(r)?r.value:r)??void 0}has(e){return!!gs(this.items,e)}set(e,n){this.add(new Ke(e,n),!0)}toJSON(e,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let s of this.items)zh(n,r,s);return r}toString(e,n,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!le(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Uh(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:n})}};var li={collection:"map",default:!0,nodeClass:Ze,tag:"tag:yaml.org,2002:map",resolve(t,e){return jt(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Ze.from(t,e,n)};var Lt=class extends Xl{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(br,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=Fh(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let i=Fh(e);if(typeof i!="number")return;let r=this.items[i];return!n&&K(r)?r.value:r}has(e){let n=Fh(e);return typeof n=="number"&&n<this.items.length}set(e,n){let i=Fh(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];K(r)&&Nh(n)?r.value=n:this.items[i]=n}toJSON(e,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let s of this.items)i.push(ct(s,String(r++),n));return i}toString(e,n,i){return e?Uh(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let l of n){if(typeof r=="function"){let a=n instanceof Set?l:String(o++);l=r.call(n,a,l)}s.items.push(xr(l,void 0,i))}}return s}};function Fh(t){let e=K(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}var ai={collection:"seq",default:!0,nodeClass:Lt,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Yt(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Lt.from(t,e,n)};var ys={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,i){return e=Object.assign({actualString:!0},e),uo(t,e,n,i)}};var fo={identify:t=>t==null,createNode:()=>new q(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new q(null),stringify:({source:t},e)=>typeof t=="string"&&fo.test.test(t)?t:e.options.nullStr};var gu={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new q(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&gu.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?n.options.trueStr:n.options.falseStr}};function It({format:t,minFractionDigits:e,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=e-(s.length-o-1);for(;l-- >0;)s+="0"}return s}var $h={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:It},Vh={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():It(t)}},jh={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new q(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:It};var Yh=t=>typeof t=="bigint"||Number.isInteger(t),Mb=(t,e,n,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),n);function mT(t,e,n){let{value:i}=t;return Yh(i)&&i>=0?n+i.toString(e):It(t)}var Kh={identify:t=>Yh(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>Mb(t,2,8,n),stringify:t=>mT(t,8,"0o")},Gh={identify:Yh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>Mb(t,0,10,n),stringify:It},Qh={identify:t=>Yh(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>Mb(t,2,16,n),stringify:t=>mT(t,16,"0x")};var gT=[li,ai,ys,fo,gu,Kh,Gh,Qh,$h,Vh,jh];function yT(t){return typeof t=="bigint"||Number.isInteger(t)}var Xh=({value:t})=>JSON.stringify(t),Fz=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Xh},{identify:t=>t==null,createNode:()=>new q(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Xh},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Xh},{identify:yT,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>yT(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Xh}],$z={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},bT=[li,ai].concat(Fz,$z);var yu={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},i,r,s){if(!n)return"";let o=n,l;if(typeof btoa=="function"){let a="";for(let c=0;c<o.length;++c)a+=String.fromCharCode(o[c]);l=btoa(a)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=q.BLOCK_LITERAL),e!==q.QUOTE_DOUBLE){let a=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),c=Math.ceil(l.length/a),u=new Array(c);for(let f=0,d=0;f<c;++f,d+=a)u[f]=l.substr(d,a);l=u.join(e===q.BLOCK_LITERAL?`
|
|
105
|
+
`:" ")}return uo({comment:t,type:e,value:l},i,r,s)}};function Rb(t,e){if(Yt(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!le(i)){if(jt(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new Ke(new q(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
|
|
106
106
|
${r.key.commentBefore}`:i.commentBefore),i.comment){let s=r.value??r.key;s.comment=s.comment?`${i.comment}
|
|
107
|
-
${s.comment}`:i.comment}i=r}t.items[n]=le(i)?i:new Ke(i)}}else e("Expected a sequence for this tag");return t}function Nb(t,e,n){let{replacer:i}=n,r=new
|
|
108
|
-
`)?(n.push("..."),n.push(
|
|
107
|
+
${s.comment}`:i.comment}i=r}t.items[n]=le(i)?i:new Ke(i)}}else e("Expected a sequence for this tag");return t}function Nb(t,e,n){let{replacer:i}=n,r=new Lt(t);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let l,a;if(Array.isArray(o))if(o.length===2)l=o[0],a=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)l=c[0],a=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;r.items.push(Jl(l,a,n))}return r}var bu={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Rb,createNode:Nb};var ea=class t extends Lt{constructor(){super(),this.add=Ze.prototype.add.bind(this),this.delete=Ze.prototype.delete.bind(this),this.get=Ze.prototype.get.bind(this),this.has=Ze.prototype.has.bind(this),this.set=Ze.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let s,o;if(le(r)?(s=ct(r.key,"",n),o=ct(r.value,s,n)):s=ct(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,n,i){let r=Nb(e,n,i),s=new this;return s.items=r.items,s}};ea.tag="tag:yaml.org,2002:omap";var vu={collection:"seq",identify:t=>t instanceof Map,nodeClass:ea,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=Rb(t,e),i=[];for(let{key:r}of n.items)K(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new ea,n)},createNode:(t,e,n)=>ea.from(t,e,n)};function vT({value:t,source:e},n){return e&&(t?Lb:Ib).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var Lb={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new q(!0),stringify:vT},Ib={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new q(!1),stringify:vT};var xT={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:It},ST={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():It(t)}},wT={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new q(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let i=t.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:It};var xu=t=>typeof t=="bigint"||Number.isInteger(t);function Wh(t,e,n,{intAsBigInt:i}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return r==="-"?BigInt(-1)*o:o}let s=parseInt(t,n);return r==="-"?-1*s:s}function _b(t,e,n){let{value:i}=t;if(xu(i)){let r=i.toString(e);return i<0?"-"+n+r.substr(1):n+r}return It(t)}var kT={identify:xu,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Wh(t,2,2,n),stringify:t=>_b(t,2,"0b")},AT={identify:xu,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Wh(t,1,8,n),stringify:t=>_b(t,8,"0")},CT={identify:xu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Wh(t,0,10,n),stringify:It},OT={identify:xu,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Wh(t,2,16,n),stringify:t=>_b(t,16,"0x")};var ta=class t extends Ze{constructor(e){super(e),this.tag=t.tag}add(e){let n;le(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new Ke(e.key,null):n=new Ke(e,null),gs(this.items,n.key)||this.items.push(n)}get(e,n){let i=gs(this.items,e);return!n&&le(i)?K(i.key)?i.key.value:i.key:i}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=gs(this.items,e);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new Ke(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(Jl(o,null,i));return s}};ta.tag="tag:yaml.org,2002:set";var Su={collection:"map",identify:t=>t instanceof Set,nodeClass:ta,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>ta.from(t,e,n),resolve(t,e){if(jt(t)){if(t.hasAllNullValues(!0))return Object.assign(new ta,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function Bb(t,e){let n=t[0],i=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function TT(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return It(t);let i="";e<0&&(i="-",e*=n(-1));let r=n(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Zh={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>Bb(t,n),stringify:TT},Jh={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Bb(t,!1),stringify:TT},na={identify:t=>t 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(t){let e=t.match(na.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,s,o,l]=e.map(Number),a=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(n,i-1,r,s||0,o||0,l||0,a),u=e[8];if(u&&u!=="Z"){let f=Bb(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};var qb=[li,ai,ys,fo,Lb,Ib,kT,AT,CT,OT,xT,ST,wT,yu,oi,vu,bu,Su,Zh,Jh,na];var ET=new Map([["core",gT],["failsafe",[li,ai,ys]],["json",bT],["yaml11",qb],["yaml-1.1",qb]]),DT={binary:yu,bool:gu,float:jh,floatExp:Vh,floatNaN:$h,floatTime:Jh,int:Gh,intHex:Qh,intOct:Kh,intTime:Zh,map:li,merge:oi,null:fo,omap:vu,pairs:bu,seq:ai,set:Su,timestamp:na},MT={"tag:yaml.org,2002:binary":yu,"tag:yaml.org,2002:merge":oi,"tag:yaml.org,2002:omap":vu,"tag:yaml.org,2002:pairs":bu,"tag:yaml.org,2002:set":Su,"tag:yaml.org,2002:timestamp":na};function ep(t,e,n){let i=ET.get(e);if(i&&!t)return n&&!i.includes(oi)?i.concat(oi):i.slice();let r=i;if(!r)if(Array.isArray(t))r=[];else{let s=Array.from(ET.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)r=r.concat(s);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(oi)),r.reduce((s,o)=>{let l=typeof o=="string"?DT[o]:o;if(!l){let a=JSON.stringify(o),c=Object.keys(DT).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${a}; use one of ${c}`)}return s.includes(l)||s.push(l),s},[])}var Vz=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,wu=class t{constructor({compat:e,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?ep(e,"compat"):e?ep(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?MT:{},this.tags=ep(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,ri,{value:li}),Object.defineProperty(this,Sn,{value:ys}),Object.defineProperty(this,br,{value:ai}),this.sortMapEntries=typeof o=="function"?o:o===!0?Vz:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function RT(t,e){let n=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let a=t.directives.toString(t);a?(n.push(a),i=!0):t.directives.docStart&&(i=!0)}i&&n.push("---");let r=qh(t,e),{commentString:s}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let a=s(t.commentBefore);n.unshift(Hn(a,""))}let o=!1,l=null;if(t.contents){if(ae(t.contents)){if(t.contents.spaceBefore&&i&&n.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);n.push(Hn(u,""))}r.forceBlockIndent=!!t.comment,l=t.contents.comment}let a=l?void 0:()=>o=!0,c=Sr(t.contents,r,()=>l=null,a);l&&(c+=qi(c,"",s(l))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(Sr(t.contents,r));if(t.directives?.docEnd)if(t.comment){let a=s(t.comment);a.includes(`
|
|
108
|
+
`)?(n.push("..."),n.push(Hn(a,""))):n.push(`... ${a}`)}else n.push("...");else{let a=t.comment;a&&o&&(a=a.replace(/^\n+/,"")),a&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Hn(s(a),"")))}return n.join(`
|
|
109
109
|
`)+`
|
|
110
|
-
`}var bs=class t{constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this
|
|
110
|
+
`}var bs=class t{constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Vt,{value:Th});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Bi({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(t.prototype,{[Vt]:{value:Th}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=ae(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ia(this.contents)&&this.contents.add(e)}addIn(e,n){ia(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let i=wb(this);e.anchor=!n||i.has(n)?kb(n||"a",i):n}return new vr(e.anchor)}createNode(e,n,i){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let b=y=>typeof y=="number"||y instanceof String||y instanceof Number,p=n.filter(b).map(String);p.length>0&&(n=n.concat(p)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:a,onTagObj:c,tag:u}=i??{},{onAnchor:f,setAnchors:d,sourceObjects:h}=cT(this,o||"a"),m={aliasDuplicateObjects:s??!0,keepUndefined:a??!1,onAnchor:f,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:h},g=xr(e,u,m);return l&&be(g)&&(g.flow=!0),d(),g}createPair(e,n,i={}){let r=this.createNode(e,null,i),s=this.createNode(n,null,i);return new Ke(r,s)}delete(e){return ia(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Wl(e)?this.contents==null?!1:(this.contents=null,!0):ia(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return be(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Wl(e)?!n&&K(this.contents)?this.contents.value:this.contents:be(this.contents)?this.contents.getIn(e,n):void 0}has(e){return be(this.contents)?this.contents.has(e):!1}hasIn(e){return Wl(e)?this.contents!==void 0:be(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=du(this.schema,[e],n):ia(this.contents)&&this.contents.set(e,n)}setIn(e,n){Wl(e)?this.contents=n:this.contents==null?this.contents=du(this.schema,Array.from(e),n):ia(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Bi({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Bi({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new wu(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=ct(this.contents,n??"",l);if(typeof s=="function")for(let{count:c,res:u}of l.anchors.values())s(u,c);return typeof o=="function"?ps(o,{"":a},"",a):a}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return RT(this,e)}};function ia(t){if(be(t))return!0;throw new Error("Expected a YAML collection as document contents")}var ku=class extends Error{constructor(e,n,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=n}},ci=class extends ku{constructor(e,n,i){super("YAMLParseError",e,n,i)}},Au=class extends ku{constructor(e,n,i){super("YAMLWarning",e,n,i)}},Pb=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>e.linePos(l));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let l=Math.min(s-39,o.length-79);o="\u2026"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(o.substring(0,s))){let l=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
|
|
111
111
|
`),o=l+o}if(/[^ ]/.test(o)){let l=1,a=n.linePos[1];a?.line===i&&a.col>r&&(l=Math.max(1,Math.min(a.col-r,80-s)));let c=" ".repeat(s)+"^".repeat(l);n.message+=`:
|
|
112
112
|
|
|
113
113
|
${o}
|
|
114
114
|
${c}
|
|
115
|
-
`}};function Pi(t,{flow:e,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:l}){let a=!1,c=l,u=l,f="",d="",h=!1,
|
|
116
|
-
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(vs(e.key)||vs(e.value))return!0}return!1;default:return!0}}function Cu(t,e,n){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&vs(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function tp(t,e,n){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,o)=>s===o||K(s)&&K(o)&&s.value===o.value;return e.some(s=>r(s.key,n))}var NT="All mapping items must start at the same column";function LT({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??
|
|
117
|
-
`+g.comment:l.comment=g.comment);continue}(g.newlineAfterProp||vs(d))&&r(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==i.indent&&r(a,"BAD_INDENT",NT);n.atKey=!0;let
|
|
118
|
-
`+v.comment:y.comment=v.comment);let x=new Ke(y);n.options.keepSourceTokens&&(x.srcToken=u),l.items.push(x)}}return c&&c<a&&r(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[i.offset,a,c??a],l}function IT({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??
|
|
119
|
-
`+
|
|
120
|
-
`+
|
|
121
|
-
`+O.comment:
|
|
122
|
-
`+b.comment:c.comment=b.comment),c.range=[i.offset,g,b.offset]}else c.range=[i.offset,g,g];return c}function Ub(t,e,n,i,r,s){let o=n.type==="block-map"?LT(t,e,n,i,s):n.type==="block-seq"?IT(t,e,n,i,s):_T(t,e,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function BT(t,e,n,i,r){let s=i.tag,o=s?e.directives.tagName(s.source,d=>r(s,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){let{anchor:d,newlineAfterProp:h}=i,
|
|
123
|
-
`.repeat(Math.max(1,o.length-1)):"",b=i+r.length;return e.source&&(b+=e.source.length),{value:g,type:s,comment:r.comment,range:[i,b,b]}}let a=e.indent+r.indent,c=e.offset+r.length,u=0;for(let g=0;g<l;++g){let[b,
|
|
124
|
-
`;for(let g=u;g<l;++g){let[b,
|
|
125
|
-
`):b.length>a||
|
|
115
|
+
`}};function Pi(t,{flow:e,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:l}){let a=!1,c=l,u=l,f="",d="",h=!1,m=!1,g=null,b=null,p=null,y=null,v=null,x=null,k=null;for(let A of t)switch(m&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&s(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),g&&(c&&A.type!=="comment"&&A.type!=="newline"&&s(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),A.type){case"space":!e&&(n!=="doc-start"||i?.type!=="flow-collection")&&A.source.includes(" ")&&(g=A),u=!0;break;case"comment":{u||s(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let O=A.source.substring(1)||" ";f?f+=d+O:f=O,d="",c=!1;break}case"newline":c?f?f+=A.source:(!x||n!=="seq-item-ind")&&(a=!0):d+=A.source,c=!0,h=!0,(b||p)&&(y=A),u=!0;break;case"anchor":b&&s(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&s(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=A,k??(k=A.offset),c=!1,u=!1,m=!0;break;case"tag":{p&&s(A,"MULTIPLE_TAGS","A node can have at most one tag"),p=A,k??(k=A.offset),c=!1,u=!1,m=!0;break}case n:(b||p)&&s(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),x&&s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),x=A,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){v&&s(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=A,c=!1,u=!1;break}default:s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),c=!1,u=!1}let C=t[t.length-1],w=C?C.offset+C.source.length:r;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(c&&g.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&s(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:x,spaceBefore:a,comment:f,hasNewline:h,anchor:b,tag:p,newlineAfterProp:y,end:w,start:k??w}}function vs(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
116
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(vs(e.key)||vs(e.value))return!0}return!1;default:return!0}}function Cu(t,e,n){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&vs(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function tp(t,e,n){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,o)=>s===o||K(s)&&K(o)&&s.value===o.value;return e.some(s=>r(s.key,n))}var NT="All mapping items must start at the same column";function LT({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??Ze,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let a=i.offset,c=null;for(let u of i.items){let{start:f,key:d,sep:h,value:m}=u,g=Pi(f,{indicator:"explicit-key-ind",next:d??h?.[0],offset:a,onError:r,parentIndent:i.indent,startOnNewline:!0}),b=!g.found;if(b){if(d&&(d.type==="block-seq"?r(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==i.indent&&r(a,"BAD_INDENT",NT)),!g.anchor&&!g.tag&&!h){c=g.end,g.comment&&(l.comment?l.comment+=`
|
|
117
|
+
`+g.comment:l.comment=g.comment);continue}(g.newlineAfterProp||vs(d))&&r(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==i.indent&&r(a,"BAD_INDENT",NT);n.atKey=!0;let p=g.end,y=d?t(n,d,g,r):e(n,p,f,null,g,r);n.schema.compat&&Cu(i.indent,d,r),n.atKey=!1,tp(n,l.items,y)&&r(p,"DUPLICATE_KEY","Map keys must be unique");let v=Pi(h??[],{indicator:"map-value-ind",next:m,offset:y.range[2],onError:r,parentIndent:i.indent,startOnNewline:!d||d.type==="block-scalar"});if(a=v.end,v.found){b&&(m?.type==="block-map"&&!v.hasNewline&&r(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start<v.found.offset-1024&&r(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let x=m?t(n,m,v,r):e(n,a,h,null,v,r);n.schema.compat&&Cu(i.indent,m,r),a=x.range[2];let k=new Ke(y,x);n.options.keepSourceTokens&&(k.srcToken=u),l.items.push(k)}else{b&&r(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(y.comment?y.comment+=`
|
|
118
|
+
`+v.comment:y.comment=v.comment);let x=new Ke(y);n.options.keepSourceTokens&&(x.srcToken=u),l.items.push(x)}}return c&&c<a&&r(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[i.offset,a,c??a],l}function IT({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??Lt,l=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let a=i.offset,c=null;for(let{start:u,value:f}of i.items){let d=Pi(u,{indicator:"seq-item-ind",next:f,offset:a,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?r(d.end,"BAD_INDENT","All sequence items must start at the same column"):r(a,"MISSING_CHAR","Sequence item without - indicator");else{c=d.end,d.comment&&(l.comment=d.comment);continue}let h=f?t(n,f,d,r):e(n,d.end,u,null,d,r);n.schema.compat&&Cu(i.indent,f,r),a=h.range[2],l.items.push(h)}return l.range=[i.offset,a,c??a],l}function zi(t,e,n,i){let r="";if(t){let s=!1,o="";for(let l of t){let{source:a,type:c}=l;switch(c){case"space":s=!0;break;case"comment":{n&&!s&&i(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=a.substring(1)||" ";r?r+=o+u:r=u,o="";break}case"newline":r&&(o+=a),s=!0;break;default:i(l,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=a.length}}return{comment:r,offset:e}}var zb="Block collections are not allowed within flow collections",Hb=t=>t&&(t.type==="block-map"||t.type==="block-seq");function _T({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=i.start.source==="{",l=o?"flow map":"flow sequence",a=s?.nodeClass??(o?Ze:Lt),c=new a(n.schema);c.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let b=0;b<i.items.length;++b){let p=i.items[b],{start:y,key:v,sep:x,value:k}=p,C=Pi(y,{flow:l,indicator:"explicit-key-ind",next:v??x?.[0],offset:f,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!x&&!k){b===0&&C.comma?r(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):b<i.items.length-1&&r(C.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),C.comment&&(c.comment?c.comment+=`
|
|
119
|
+
`+C.comment:c.comment=C.comment),f=C.end;continue}!o&&n.options.strict&&vs(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(b===0)C.comma&&r(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(C.comma||r(C.start,"MISSING_CHAR",`Missing , between ${l} items`),C.comment){let w="";e:for(let A of y)switch(A.type){case"comma":case"space":break;case"comment":w=A.source.substring(1);break e;default:break e}if(w){let A=c.items[c.items.length-1];le(A)&&(A=A.value??A.key),A.comment?A.comment+=`
|
|
120
|
+
`+w:A.comment=w,C.comment=C.comment.substring(w.length+1)}}if(!o&&!x&&!C.found){let w=k?t(n,k,C,r):e(n,C.end,x,null,C,r);c.items.push(w),f=w.range[2],Hb(k)&&r(w.range,"BLOCK_IN_FLOW",zb)}else{n.atKey=!0;let w=C.end,A=v?t(n,v,C,r):e(n,w,y,null,C,r);Hb(v)&&r(A.range,"BLOCK_IN_FLOW",zb),n.atKey=!1;let O=Pi(x??[],{flow:l,indicator:"map-value-ind",next:k,offset:A.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(O.found){if(!o&&!C.found&&n.options.strict){if(x)for(let M of x){if(M===O.found)break;if(M.type==="newline"){r(M,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}C.start<O.found.offset-1024&&r(O.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else k&&("source"in k&&k.source?.[0]===":"?r(k,"MISSING_CHAR",`Missing space after : in ${l}`):r(O.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let D=k?t(n,k,O,r):O.found?e(n,O.end,x,null,O,r):null;D?Hb(k)&&r(D.range,"BLOCK_IN_FLOW",zb):O.comment&&(A.comment?A.comment+=`
|
|
121
|
+
`+O.comment:A.comment=O.comment);let I=new Ke(A,D);if(n.options.keepSourceTokens&&(I.srcToken=p),o){let M=c;tp(n,M.items,A)&&r(w,"DUPLICATE_KEY","Map keys must be unique"),M.items.push(I)}else{let M=new Ze(n.schema);M.flow=!0,M.items.push(I);let $=(D??A).range;M.range=[A.range[0],$[1],$[2]],c.items.push(M)}f=D?D.range[2]:O.end}}let d=o?"}":"]",[h,...m]=i.end,g=f;if(h?.source===d)g=h.offset+h.source.length;else{let b=l[0].toUpperCase()+l.substring(1),p=u?`${b} must end with a ${d}`:`${b} in block collection must be sufficiently indented and end with a ${d}`;r(f,u?"MISSING_CHAR":"BAD_INDENT",p),h&&h.source.length!==1&&m.unshift(h)}if(m.length>0){let b=zi(m,g,n.options.strict,r);b.comment&&(c.comment?c.comment+=`
|
|
122
|
+
`+b.comment:c.comment=b.comment),c.range=[i.offset,g,b.offset]}else c.range=[i.offset,g,g];return c}function Ub(t,e,n,i,r,s){let o=n.type==="block-map"?LT(t,e,n,i,s):n.type==="block-seq"?IT(t,e,n,i,s):_T(t,e,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function BT(t,e,n,i,r){let s=i.tag,o=s?e.directives.tagName(s.source,d=>r(s,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){let{anchor:d,newlineAfterProp:h}=i,m=d&&s?d.offset>s.offset?d:s:d??s;m&&(!h||h.offset<m.offset)&&r(m,"MISSING_CHAR","Missing newline after block sequence props")}let l=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===Ze.tagName&&l==="map"||o===Lt.tagName&&l==="seq")return Ub(t,e,n,r,o);let a=e.schema.tags.find(d=>d.tag===o&&d.collection===l);if(!a){let d=e.schema.knownTags[o];if(d?.collection===l)e.schema.tags.push(Object.assign({},d,{default:!1})),a=d;else return d?r(s,"BAD_COLLECTION_TYPE",`${d.tag} used for ${l} collection, but expects ${d.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ub(t,e,n,r,o)}let c=Ub(t,e,n,r,o,a),u=a.resolve?.(c,d=>r(s,"TAG_RESOLVE_FAILED",d),e.options)??c,f=ae(u)?u:new q(u);return f.range=c.range,f.tag=o,a?.format&&(f.format=a.format),f}function Fb(t,e,n){let i=e.offset,r=jz(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let s=r.mode===">"?q.BLOCK_FOLDED:q.BLOCK_LITERAL,o=e.source?Yz(e.source):[],l=o.length;for(let g=o.length-1;g>=0;--g){let b=o[g][1];if(b===""||b==="\r")l=g;else break}if(l===0){let g=r.chomp==="+"&&o.length>0?`
|
|
123
|
+
`.repeat(Math.max(1,o.length-1)):"",b=i+r.length;return e.source&&(b+=e.source.length),{value:g,type:s,comment:r.comment,range:[i,b,b]}}let a=e.indent+r.indent,c=e.offset+r.length,u=0;for(let g=0;g<l;++g){let[b,p]=o[g];if(p===""||p==="\r")r.indent===0&&b.length>a&&(a=b.length);else{b.length<a&&n(c+b.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(a=b.length),u=g,a===0&&!t.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=b.length+p.length+1}for(let g=o.length-1;g>=l;--g)o[g][0].length>a&&(l=g+1);let f="",d="",h=!1;for(let g=0;g<u;++g)f+=o[g][0].slice(a)+`
|
|
124
|
+
`;for(let g=u;g<l;++g){let[b,p]=o[g];c+=b.length+p.length+1;let y=p[p.length-1]==="\r";if(y&&(p=p.slice(0,-1)),p&&b.length<a){let x=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(c-p.length-(y?2:1),"BAD_INDENT",x),b=""}s===q.BLOCK_LITERAL?(f+=d+b.slice(a)+p,d=`
|
|
125
|
+
`):b.length>a||p[0]===" "?(d===" "?d=`
|
|
126
126
|
`:!h&&d===`
|
|
127
127
|
`&&(d=`
|
|
128
128
|
|
|
129
|
-
`),f+=d+b.slice(a)+
|
|
130
|
-
`,h=!0):
|
|
129
|
+
`),f+=d+b.slice(a)+p,d=`
|
|
130
|
+
`,h=!0):p===""?d===`
|
|
131
131
|
`?f+=`
|
|
132
132
|
`:d=`
|
|
133
|
-
`:(f+=d+
|
|
133
|
+
`:(f+=d+p,d=" ",h=!1)}switch(r.chomp){case"-":break;case"+":for(let g=l;g<o.length;++g)f+=`
|
|
134
134
|
`+o[g][0].slice(a);f[f.length-1]!==`
|
|
135
135
|
`&&(f+=`
|
|
136
136
|
`);break;default:f+=`
|
|
137
|
-
`}let
|
|
137
|
+
`}let m=i+r.length+e.source.length;return{value:f,type:s,comment:r.comment,range:[i,m,m]}}function jz({offset:t,props:e},n,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],s=r[0],o=0,l="",a=-1;for(let d=1;d<r.length;++d){let h=r[d];if(!l&&(h==="-"||h==="+"))l=h;else{let m=Number(h);!o&&m?o=m:a===-1&&(a=t+d)}}a!==-1&&i(a,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,u="",f=r.length;for(let d=1;d<e.length;++d){let h=e[d];switch(h.type){case"space":c=!0;case"newline":f+=h.source.length;break;case"comment":n&&!c&&i(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,u=h.source.substring(1);break;case"error":i(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{let m=`Unexpected token in block scalar header: ${h.type}`;i(h,"UNEXPECTED_TOKEN",m);let g=h.source;g&&typeof g=="string"&&(f+=g.length)}}}return{mode:s,indent:o,chomp:l,comment:u,length:f}}function Yz(t){let e=t.split(/\n( *)/),n=e[0],i=n.match(/^( *)/),s=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}function $b(t,e,n){let{offset:i,type:r,source:s,end:o}=t,l,a,c=(d,h,m)=>n(i+d,h,m);switch(r){case"scalar":l=q.PLAIN,a=Kz(s,c);break;case"single-quoted-scalar":l=q.QUOTE_SINGLE,a=Gz(s,c);break;case"double-quoted-scalar":l=q.QUOTE_DOUBLE,a=Qz(s,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}let u=i+s.length,f=zi(o,u,e,n);return{value:a,type:l,comment:f.comment,range:[i,u,f.offset]}}function Kz(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),qT(t)}function Gz(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),qT(t.slice(1,-1)).replace(/''/g,"'")}function qT(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
138
138
|
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
139
139
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let r=i[1],s=" ",o=e.lastIndex;for(n.lastIndex=o;i=n.exec(t);)i[1]===""?s===`
|
|
140
140
|
`?r+=s:s=`
|
|
@@ -149,7 +149,7 @@ ${c}
|
|
|
149
149
|
`);)i===`
|
|
150
150
|
`&&(n+=`
|
|
151
151
|
`),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}var Wz={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
152
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Zz(t,e,n,i){let r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let l=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function Vb(t,e,n,i){let{value:r,type:s,comment:o,range:l}=e.type==="block-scalar"?Fb(t,e,i):$b(e,t.options.strict,i),a=n?t.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[
|
|
152
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Zz(t,e,n,i){let r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let l=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function Vb(t,e,n,i){let{value:r,type:s,comment:o,range:l}=e.type==="block-scalar"?Fb(t,e,i):$b(e,t.options.strict,i),a=n?t.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[Sn]:a?c=Jz(t.schema,r,a,n,i):e.type==="scalar"?c=eH(t,r,e,i):c=t.schema[Sn];let u;try{let f=c.resolve(r,d=>i(n??e,"TAG_RESOLVE_FAILED",d),t.options);u=K(f)?f:new q(f)}catch(f){let d=f instanceof Error?f.message:String(f);i(n??e,"TAG_RESOLVE_FAILED",d),u=new q(r)}return u.range=l,u.source=r,s&&(u.type=s),a&&(u.tag=a),c.format&&(u.format=c.format),o&&(u.comment=o),u}function Jz(t,e,n,i,r){if(n==="!")return t[Sn];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Sn])}function eH({atKey:t,directives:e,schema:n},i,r,s){let o=n.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(i))||n[Sn];if(n.compat){let l=n.compat.find(a=>a.default&&a.test?.test(i))??n[Sn];if(o.tag!==l.tag){let a=e.tagString(o.tag),c=e.tagString(l.tag),u=`Value may be parsed as either ${a} or ${c}`;s(r,"TAG_RESOLVE_FAILED",u,!0)}}return o}function PT(t,e,n){if(e){n??(n=e.length);for(let i=n-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++i];r?.type==="space";)t+=r.source.length,r=e[++i];break}}return t}var tH={composeNode:jb,composeEmptyNode:np};function jb(t,e,n,i){let r=t.atKey,{spaceBefore:s,comment:o,anchor:l,tag:a}=n,c,u=!0;switch(e.type){case"alias":c=nH(t,e,i),(l||a)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Vb(t,e,a,i),l&&(c.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=BT(tH,t,e,n,i),l&&(c.anchor=l.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);i(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=np(t,e.offset,void 0,null,n,i)),l&&c.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!K(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(a??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&u&&(c.srcToken=e),c}function np(t,e,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:a},c){let u={type:"scalar",offset:PT(e,n,i),indent:-1,source:""},f=Vb(t,u,l,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=a),f}function nH({options:t},{offset:e,source:n,end:i},r){let s=new vr(n.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,l=zi(i,o,t.strict,r);return s.range=[e,o,l.offset],l.comment&&(s.comment=l.comment),s}function zT(t,e,{offset:n,start:i,value:r,end:s},o){let l=Object.assign({_directives:e},t),a=new bs(void 0,l),c={atKey:!1,atRoot:!0,directives:a.directives,options:a.options,schema:a.schema},u=Pi(i,{indicator:"doc-start",next:r??s?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(a.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),a.contents=r?jb(c,r,u,o):np(c,u.end,i,null,u,o);let f=a.contents.range[2],d=zi(s,f,!1,o);return d.comment&&(a.comment=d.comment),a.range=[n,f,d.offset],a}function Ou(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function HT(t){let e="",n=!1,i=!1;for(let r=0;r<t.length;++r){let s=t[r];switch(s[0]){case"#":e+=(e===""?"":i?`
|
|
153
153
|
|
|
154
154
|
`:`
|
|
155
155
|
`)+(s.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}var Tu=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{let o=Ou(n);s?this.warnings.push(new Au(o,i,r)):this.errors.push(new ci(o,i,r))},this.directives=new Bi({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:i,afterEmptyLine:r}=HT(this.prelude);if(i){let s=e.contents;if(n)e.comment=e.comment?`${e.comment}
|
|
@@ -182,26 +182,26 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
182
182
|
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){op(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(r&&n.sep&&!n.value){let o=[];for(let l=0;l<n.sep.length;++l){let a=n.sep[l];switch(a.type){case"newline":o.push(l);break;case"space":break;case"comment":a.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(s.push(this.sourceToken),e.items.push({start:s,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(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(xs(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(KT(n.key)&&!xs(n.sep,"newline")){let o=ra(n.start),l=n.key,a=n.sep;a.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:a}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(xs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=ra(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):xs(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||n.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!xs(n.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 i&&e.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){op(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||xs(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=sp(i),s=ra(r);YT(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
|
|
183
183
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
184
184
|
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=sp(e),i=ra(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=sp(e),i=ra(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function lH(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Du||null,prettyErrors:e}}function Wb(t,e={}){let{lineCounter:n,prettyErrors:i}=lH(e),r=new Mu(n?.addNewLine),s=new Tu(e),o=null;for(let l of s.compose(r.parse(t),!0,t.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new ci(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(Pb(t,n)),o.warnings.forEach(Pb(t,n))),o}function cH(t){let e=[0];for(let n=0;n<t.length;n++)t[n]===`
|
|
185
|
-
`&&e.push(n+1);return e}function uH(t,e,n,i){let r=Math.min(Math.max(t-1,0),n.length-1);return Math.min(n[r]+Math.max(e-1,0),i)}function fH(t){if(
|
|
185
|
+
`&&e.push(n+1);return e}function uH(t,e,n,i){let r=Math.min(Math.max(t-1,0),n.length-1);return Math.min(n[r]+Math.max(e-1,0),i)}function fH(t){if(jt(t)&&t.items.length>0){let e=t.items[0].key;if(K(e)&&e.range)return[e.range[0],e.range[1]]}return null}function Zb(t,e){if(jt(t)){for(let n of t.items)if(K(n.key)&&String(n.key.value)===e&&n.key.range)return[n.key.range[0],n.key.range[1]];for(let n of t.items){let i=Zb(n.value,e);if(i)return i}}else if(Yt(t))for(let n of t.items){let i=Zb(n,e);if(i)return i}return null}function lp(t,e){if(e.length===0)return null;if(e.length===1)return Zb(t,e[0]);let[n,...i]=e;if(jt(t)){for(let r of t.items)if(K(r.key)&&String(r.key.value)===n){let s=lp(r.value,i);if(s)return s}for(let r of t.items){let s=lp(r.value,e);if(s)return s}}else if(Yt(t))for(let r of t.items){let s=lp(r,e);if(s)return s}return null}function dH(t,e,n,i,r){if(t.itemId&&n){let s=e.get(t.itemId);if(s){let o=n.get(s.section);if(Yt(o)){let l=o.items[s.index];if(l!==void 0){if(t.fieldKey){let c=lp(l,t.fieldKey.split("."));if(c)return c}let a=fH(l);if(a)return a}}}}if(t.line!==void 0){let s=uH(t.line,t.column??1,i,r);return[s,Math.min(s+1,r)]}return null}function Jb(t,e,n){let i=new Map;e.constraints.forEach((l,a)=>i.set(l.id,{section:"constraints",index:a})),e.directives.forEach((l,a)=>i.set(l.id,{section:"directives",index:a}));let r=null;try{r=Wb(t)}catch{r=null}let s=cH(t),o=t.length;return n.map(l=>{let a=dH(l,i,r,s,o);if(!a)return{...l};let c=Math.max(0,Math.min(a[0],o)),u=Math.max(c,Math.min(a[1],o));return{...l,from:c,to:u}})}function e1(t,e){if(t.trim()==="")return[];let n;try{n=hs(t)}catch(r){let s=r,o={severity:"error",code:"yaml-syntax",source:"yaml",message:`YAML syntax error: ${s.message}`,...s.line!==void 0?{line:s.line}:{},...s.column!==void 0?{column:s.column}:{}};return Jb(t,{constraints:[],directives:[]},[o])}let i=au(n,e).filter(r=>r.severity==="error"||r.severity==="warning");return Jb(t,n,i)}var GT={types:[],relations:[]},QT=new Set(["univ","Int","seq/Int","iden","none","String"]);function hH(t){return t.isBuiltin===!0?!0:QT.has(t.id)}function pH(t){return t.length===0?!1:t.every(e=>QT.has(e))}function mH(t){let e;try{e=t.getTypes()}catch{return[]}if(!Array.isArray(e))return[];let n=[],i=new Set;for(let r of e)try{if(!r||typeof r.id!="string"||r.id.length===0||hH(r)||i.has(r.id))continue;i.add(r.id);let s=[],o=new Set;if(Array.isArray(r.atoms))for(let l of r.atoms){let a=l&&typeof l.label=="string"&&l.label.length>0?l.label:l&&typeof l.id=="string"?l.id:void 0;a!==void 0&&!o.has(a)&&(o.add(a),s.push(a))}n.push({name:r.id,atoms:s})}catch{continue}return n}function gH(t){let e;try{e=t.getRelations()}catch{return[]}if(!Array.isArray(e))return[];let n=[],i=new Set;for(let r of e)try{let s=r&&typeof r.name=="string"&&r.name.length>0?r.name:void 0;if(s===void 0)continue;let o=Array.isArray(r.types)?r.types.filter(c=>typeof c=="string"):[];if(pH(o))continue;let l=`${s}\0${o.join("\0")}`;if(i.has(l))continue;i.add(l);let a={name:s};o.length>0&&(a.arity=o.length,a.typeSignature=o),n.push(a)}catch{continue}return n}function t1(t){if(t==null)return GT;try{return{types:mH(t),relations:gH(t)}}catch{return GT}}var yH=["univ","none","iden","Int"],bH=["all","some","no","one","lone","set","sum","let","disj"],vH=["in","and","or","not","implies","iff","else"],xH=[{insert:".",detail:"join"},{insert:"->",detail:"product"},{insert:"+",detail:"union"},{insert:"&",detail:"intersection"},{insert:"-",detail:"difference"},{insert:"~",detail:"transpose"},{insert:"^",detail:"transitive closure"},{insert:"*",detail:"reflexive-transitive closure"},{insert:"#",detail:"cardinality"}],n1;function WT(){if(n1)return n1.map(e=>({...e}));let t=[];for(let e of yH)t.push({label:e,kind:"keyword",detail:"built-in"});for(let e of bH)t.push({label:e,kind:"keyword",detail:"quantifier"});for(let e of vH)t.push({label:e,kind:"keyword",detail:"operator"});for(let e of xH)t.push({label:e.insert,insertText:e.insert,kind:"snippet",detail:e.detail});return n1=t,t.map(e=>({...e}))}function ZT(t){let e=[];for(let s of t.types)e.push({label:s.name,kind:"type",detail:"type"});for(let s of t.relations)e.push({label:s.name,kind:"relation",detail:s.arity!==void 0?`relation \xB7 arity ${s.arity}`:"relation"});let n=new Set(t.types.map(s=>s.name)),i=new Set,r=0;for(let s of t.types){if(r>=200)break;for(let o of s.atoms){if(r>=200)break;i.has(o)||n.has(o)||(i.add(o),e.push({label:o,kind:"atom",detail:`atom \xB7 ${s.name}`}),r+=1)}}return e}function SH(t,e){if(e.length===0)return 0;let n=t.toLowerCase(),i=e.toLowerCase();return n.startsWith(i)?0:n.includes(i)?1:2}function XT(t){switch(t){case"type":return 0;case"relation":return 1;case"atom":return 2;case"keyword":return 3;case"snippet":return 4;default:return 5}}function wH(t){return`${t.label}\0${t.insertText??t.label}`}function i1(t){let e=[];t&&e.push(...ZT(t)),e.push(...WT());let n=JT(e);return i=>{let r=[];return n.forEach((s,o)=>{let l=SH(s.label,i);l<2&&r.push({c:s,rank:l,idx:o})}),r.sort((s,o)=>{if(s.rank!==o.rank)return s.rank-o.rank;let l=XT(s.c.kind),a=XT(o.c.kind);return l!==a?l-a:s.c.label.length!==o.c.label.length?s.c.label.length-o.c.label.length:s.idx-o.idx}),r.map(s=>s.c)}}function r1(...t){let e=[];for(let n of t)for(let i of n)e.push(i);return JT(e)}function JT(t){let e=new Set,n=[];for(let i of t){let r=wH(i);e.has(r)||(e.add(r),n.push(i))}return n}var tE={accent:"#b5431a",accentText:"#fdf6ec",surface:"#faf8f2",surfaceRaised:"#f1ecdf",border:"#d9d2c0",text:"#221d14",textMuted:"#6e6553",danger:"#a32014",warning:"#8a6200",success:"#2f6c43",fontFamily:"'Avenir Next', 'Avenir', 'Seravek', 'Segoe UI Variable', 'Segoe UI', 'Trebuchet MS', sans-serif",monoFontFamily:"ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:"14px",radius:"2px",spacing:"8px",synKeyword:"#6d28a8",synType:"#0e6b6b",synRelation:"#1f4f9e",synOperator:"#b5431a",synString:"#7a5901",synComment:"#8a8170"},nE={accent:"#e08a3c",accentText:"#16100a",surface:"#12161e",surfaceRaised:"#1a202b",border:"#2d3645",text:"#e7e2d3",textMuted:"#94865f",danger:"#e06c5d",warning:"#d4a843",success:"#5fb98a",fontFamily:"'Avenir Next', 'Avenir', 'Seravek', 'Segoe UI Variable', 'Segoe UI', 'Trebuchet MS', sans-serif",monoFontFamily:"ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:"14px",radius:"2px",spacing:"8px",synKeyword:"#b48ee0",synType:"#5fb3a1",synRelation:"#7ba3e8",synOperator:"#e08a3c",synString:"#cfa75e",synComment:"#6e7889"},eE={accent:"--spytial-ed-accent",accentText:"--spytial-ed-accent-text",surface:"--spytial-ed-surface",surfaceRaised:"--spytial-ed-surface-raised",border:"--spytial-ed-border",text:"--spytial-ed-text",textMuted:"--spytial-ed-text-muted",danger:"--spytial-ed-danger",warning:"--spytial-ed-warning",success:"--spytial-ed-success",fontFamily:"--spytial-ed-font-family",monoFontFamily:"--spytial-ed-mono-font-family",fontSize:"--spytial-ed-font-size",radius:"--spytial-ed-radius",spacing:"--spytial-ed-spacing",synKeyword:"--spytial-ed-syn-keyword",synType:"--spytial-ed-syn-type",synRelation:"--spytial-ed-syn-relation",synOperator:"--spytial-ed-syn-operator",synString:"--spytial-ed-syn-string",synComment:"--spytial-ed-syn-comment"};function s1(t){let e={};return Object.keys(eE).forEach(n=>{let i=t[n];i!=null&&(e[eE[n]]=i)}),e}var kH=new Map([["light",tE],["dark",nE]]);function o1(t){if(t!==void 0)return typeof t=="string"?kH.get(t):t}var AH=new Set(["univ","none","iden","all","some","no","one","lone","set","sum","let","disj","count","and","or","not","implies","else","in","ni"]),CH=["->","<:",":>","<=",">=","=<","=>","!=","++"],OH=new Set(["+","-","&","~","*","^",".","<",">","=","!","#"]);var TH=/[A-Za-z_$]/,EH=/[A-Za-z0-9_$]/,ap=/[0-9]/,iE=/\s/;function l1(t){let e=[],n=t.length,i=0,r=(s,o,l)=>{e.push({kind:s,text:t.slice(o,l),start:o,end:l})};for(;i<n;){let s=t[i];if(iE.test(s)){let l=i;for(;i<n&&iE.test(t[i]);)i++;r("whitespace",l,i);continue}if(s==="-"&&t[i+1]==="-"||s==="/"&&t[i+1]==="/"){let l=i;for(i+=2;i<n&&t[i]!==`
|
|
186
186
|
`;)i++;r("comment",l,i);continue}if(s==='"'||s==="'"){let l=s,a=i;for(i++;i<n&&t[i]!==l&&t[i]!==`
|
|
187
187
|
`;)t[i]==="\\"&&i+1<n?i+=2:i++;i<n&&t[i]===l&&i++,r("string",a,i);continue}if(ap.test(s)){let l=i;for(;i<n&&ap.test(t[i]);)i++;if(i<n&&t[i]==="."&&i+1<n&&ap.test(t[i+1]))for(i++;i<n&&ap.test(t[i]);)i++;r("number",l,i);continue}if(s==="`"){let l=i;for(i++;i<n&&t[i]!=="`"&&t[i]!==`
|
|
188
|
-
`;)i++;i<n&&t[i]==="`"&&i++,r("identifier",l,i);continue}if(TH.test(s)){let l=i;for(i++;i<n&&EH.test(t[i]);)i++;let a=t.slice(l,i);r(AH.has(a)?"keyword":"identifier",l,i);continue}let o=t.slice(i,i+2);if(CH.includes(o)){r("operator",i,i+2),i+=2;continue}if(OH.has(s)){r("operator",i,i+1),i++;continue}r("punctuation",i,i+1),i++}return e}function a1(t){switch(t){case"keyword":return"spytial-ed-syn-keyword";case"operator":return"spytial-ed-syn-operator";case"string":return"spytial-ed-syn-string";case"number":return"spytial-ed-syn-number";case"identifier":return"spytial-ed-syn-identifier";case"comment":return"spytial-ed-syn-comment";default:return}}var ee=X(
|
|
189
|
-
`)?"\u200B":null]})},c1=({value:t,onChange:e,placeholder:n,disabled:i=!1,selectorArity:r,complete:s,synthesize:o,diagnostics:l,highlight:a=!0,className:c,"aria-label":u,"aria-labelledby":f})=>{let d=(0,ee.useRef)(null),h=(0,ee.useRef)(null),p=(0,ee.useId)(),g=`${p}-listbox`,b=U=>`${p}-opt-${U}`,m=`${p}-diag`,[y,v]=(0,ee.useState)(!1),[x,A]=(0,ee.useState)([]),[w,k]=(0,ee.useState)(0),C=(0,ee.useRef)(0),O=(0,ee.useRef)(null),M=(0,ee.useRef)(0),[_,D]=(0,ee.useState)(!1),[F,V]=(0,ee.useState)(""),[ae,$e]=(0,ee.useState)(!1),[Xt,he]=(0,ee.useState)(null),[et,Wn]=(0,ee.useState)(null),At=(0,ee.useRef)(null),Ve=LH(l),yt=(0,ee.useCallback)(()=>{let U=d.current,re=h.current;!U||!re||(re.scrollTop=U.scrollTop,re.scrollLeft=U.scrollLeft)},[]),bt=(0,ee.useRef)(0),cn=(0,ee.useCallback)(()=>{let U=d.current;if(U){if(U.value===""){U.style.height="",bt.current=0;return}if(U.clientWidth<60){bt.current<10&&(bt.current+=1,requestAnimationFrame(cn));return}bt.current=0,U.style.height="auto",U.style.height=`${U.scrollHeight}px`}},[]);(0,ee.useEffect)(()=>{cn(),yt()},[t,cn,yt]);let un=(0,ee.useCallback)((U,re)=>{if(!s)return;let{prefix:Wi,start:Ir}=IH(U,re);M.current=Ir,O.current&&clearTimeout(O.current);let Go=++C.current;O.current=setTimeout(()=>{let Us;try{Us=s(Wi)}catch{return}Promise.resolve(Us).then(wi=>{if(Go===C.current){if(!wi||wi.length===0){A([]),v(!1);return}A(wi),k(0),v(!0)}}).catch(()=>{Go===C.current&&(A([]),v(!1))})},RH)},[s]),Zn=(0,ee.useCallback)(()=>{C.current++,O.current&&clearTimeout(O.current),v(!1),A([])},[]),Jn=(0,ee.useCallback)(U=>{let re=d.current,Wi=re?re.selectionStart:t.length,Ir=U.insertText??U.label,Go=t.slice(0,M.current)+Ir+t.slice(Wi);e(Go),Zn();let Us=M.current+Ir.length;requestAnimationFrame(()=>{let wi=d.current;wi&&(wi.focus(),wi.setSelectionRange(Us,Us))})},[t,e,Zn]),jo=(0,ee.useCallback)(U=>{let re=U.target.value;e(re),un(re,U.target.selectionStart)},[e,un]),Yo=(0,ee.useCallback)(U=>{if(U.code==="Space"&&(U.ctrlKey||U.metaKey)){U.preventDefault();let re=d.current;re&&un(re.value,re.selectionStart);return}if(!(!y||x.length===0))switch(U.key){case"ArrowDown":U.preventDefault(),k(re=>(re+1)%x.length);break;case"ArrowUp":U.preventDefault(),k(re=>(re-1+x.length)%x.length);break;case"Enter":case"Tab":U.preventDefault(),Jn(x[w]);break;case"Escape":U.preventDefault(),Zn();break;default:break}},[y,x,w,Jn,Zn,un]),Ka=(0,ee.useCallback)(U=>{let re=U.relatedTarget;re&&h.current?.parentElement?.contains(re)||Zn()},[Zn]),lg=(0,ee.useCallback)(()=>{D(!0),he(null),Wn(null),requestAnimationFrame(()=>At.current?.focus())},[]),Ko=(0,ee.useCallback)(()=>{D(!1),$e(!1),he(null),Wn(null),V("")},[]),Ff=(0,ee.useCallback)(async()=>{if(!o||ae)return;let U=F.trim();if(U){$e(!0),he(null),Wn(null);try{let re=await o(U);Wn(re)}catch(re){he(re instanceof Error?re.message:"Synthesis failed. Try again.")}finally{$e(!1)}}},[o,ae,F]),ag=(0,ee.useCallback)(()=>{et&&(e(et.value),Ko(),requestAnimationFrame(()=>d.current?.focus()))},[et,e,Ko]);(0,ee.useEffect)(()=>()=>{O.current&&clearTimeout(O.current)},[]);let cg=n??(r==="binary"?"binary selector, e.g. parent":r==="unary"?"unary selector, e.g. Node":"selector expression"),ug=l&&l.length>0?m:void 0,fg=po(y&&x.length>0,d,{align:"stretch",estimatedHeight:224});return(0,ue.jsxs)("div",{className:`spytial-ed-selector${Ve?` spytial-ed-selector--${Ve}`:""}${c?` ${c}`:""}`,children:[(0,ue.jsxs)("div",{className:`spytial-ed-selector-input-wrap${o?" spytial-ed-selector-input-wrap--with-synth":""}`,children:[a?(0,ue.jsx)("pre",{ref:h,className:"spytial-ed-selector-mirror","aria-hidden":"true",children:(0,ue.jsx)(lE,{value:t})}):null,(0,ue.jsx)("textarea",{ref:d,className:`spytial-ed-selector-textarea${a?"":" spytial-ed-selector-textarea--plain"}`,value:t,onChange:jo,onScroll:yt,onKeyDown:Yo,onBlur:Ka,placeholder:cg,disabled:i,rows:1,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off",wrap:"soft",role:"combobox","aria-expanded":y,"aria-controls":g,"aria-autocomplete":"list","aria-activedescendant":y&&x.length>0?b(w):void 0,"aria-label":u,"aria-labelledby":f,"aria-describedby":ug,"aria-invalid":Ve==="error"||void 0}),o?(0,ue.jsx)("button",{type:"button",className:"spytial-ed-selector-synth-btn",onClick:lg,disabled:i,"aria-label":"Generate selector from a description","aria-haspopup":"dialog","aria-expanded":_,title:"Generate selector from a description",children:(0,ue.jsx)("span",{"aria-hidden":"true",children:"\u2728"})}):null,y&&x.length>0?(0,ue.jsx)("ul",{className:"spytial-ed-autocomplete",style:fg,id:g,role:"listbox","aria-label":"Selector completions",children:x.map((U,re)=>(0,ue.jsxs)("li",{id:b(re),role:"option","aria-selected":re===w,className:`spytial-ed-autocomplete-item${re===w?" spytial-ed-autocomplete-item--active":""}`,onMouseDown:Wi=>{Wi.preventDefault(),Jn(U)},onMouseEnter:()=>k(re),children:[(0,ue.jsx)("span",{className:`spytial-ed-autocomplete-kind spytial-ed-kind-${U.kind}`,"aria-hidden":"true"}),(0,ue.jsx)("span",{className:"spytial-ed-autocomplete-label",children:U.label}),U.detail?(0,ue.jsx)("span",{className:"spytial-ed-autocomplete-detail",children:U.detail}):null]},`${U.label}-${re}`))}):null]}),_?(0,ue.jsxs)("div",{className:"spytial-ed-synth-popover",role:"dialog","aria-label":"Generate selector",children:[(0,ue.jsxs)("div",{className:"spytial-ed-synth-row",children:[(0,ue.jsx)("input",{ref:At,type:"text",className:"spytial-ed-synth-input",value:F,placeholder:"Describe the selector you want\u2026",disabled:ae,"aria-label":"Selector description",onChange:U=>V(U.target.value),onKeyDown:U=>{U.key==="Enter"?(U.preventDefault(),Ff()):U.key==="Escape"&&(U.preventDefault(),Ko())}}),(0,ue.jsx)("button",{type:"button",className:"spytial-ed-synth-generate",onClick:()=>{Ff()},disabled:ae||F.trim().length===0,children:ae?"Generating\u2026":"Generate"})]}),Xt?(0,ue.jsx)("div",{className:"spytial-ed-synth-error",role:"alert",children:Xt}):null,et?(0,ue.jsxs)("div",{className:"spytial-ed-synth-result",children:[(0,ue.jsx)("pre",{className:"spytial-ed-synth-preview","aria-label":"Proposed selector",children:(0,ue.jsx)(lE,{value:et.value})}),et.explanation?(0,ue.jsx)("p",{className:"spytial-ed-synth-explanation",children:et.explanation}):null,(0,ue.jsxs)("div",{className:"spytial-ed-synth-actions",children:[(0,ue.jsx)("button",{type:"button",className:"spytial-ed-synth-accept",onClick:ag,children:"Accept"}),(0,ue.jsx)("button",{type:"button",className:"spytial-ed-synth-dismiss",onClick:Ko,children:"Dismiss"})]})]}):null]}):null,l&&l.length>0?(0,ue.jsx)("ul",{className:"spytial-ed-diagnostics",id:m,children:l.map((U,re)=>(0,ue.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${U.severity}`,children:[(0,ue.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,ue.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:U.message})]},re))}):null]})};var hE=X(Tt());var sn=X(Tt());var u1={person:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z"/></svg>')}`,"person-fill":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/></svg>')}`,people:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M15 14s1 0 1-1-1-4-5-4-5 3-5 4 1 1 1 1zm-7.978-1L7 12.996c.001-.264.167-1.03.76-1.72C8.312 10.629 9.282 10 11 10c1.717 0 2.687.63 3.24 1.276.593.69.758 1.457.76 1.72l-.008.002-.014.002zM11 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4m3-2a3 3 0 1 1-6 0 3 3 0 0 1 6 0M6.936 9.28a6 6 0 0 0-1.23-.247A7 7 0 0 0 5 9c-4 0-5 3-5 4q0 1 1 1h4.216A2.24 2.24 0 0 1 5 13c0-1.01.377-2.042 1.09-2.904.243-.294.526-.569.846-.816M4.92 10A5.5 5.5 0 0 0 4 13H1c0-.26.164-1.03.76-1.724.545-.636 1.492-1.256 3.16-1.275ZM1.5 5.5a3 3 0 1 1 6 0 3 3 0 0 1-6 0m3-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4"/></svg>')}`,home:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293zM13 7.207V13.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V7.207l5-5z"/></svg>')}`,house:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293zM13 7.207V13.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V7.207l5-5z"/></svg>')}`,building:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M4 2.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm3 0a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm3.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM4 5.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zM7.5 5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm2.5.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zM4.5 8a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm2.5.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm3.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5z"/><path d="M2 1a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1zm11 0H3v14h3v-2.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5V15h3z"/></svg>')}`,star:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M2.866 14.85c-.078.444.36.791.746.593l4.39-2.256 4.389 2.256c.386.198.824-.149.746-.592l-.83-4.73 3.522-3.356c.33-.314.16-.888-.282-.95l-4.898-.696L8.465.792a.513.513 0 0 0-.927 0L5.354 5.12l-4.898.696c-.441.062-.612.636-.283.95l3.523 3.356-.83 4.73zm4.905-2.767-3.686 1.894.694-3.957a.56.56 0 0 0-.163-.505L1.71 6.745l4.052-.576a.53.53 0 0 0 .393-.288L8 2.223l1.847 3.658a.53.53 0 0 0 .393.288l4.052.575-2.906 2.77a.56.56 0 0 0-.163.506l.694 3.957-3.686-1.894a.5.5 0 0 0-.461 0z"/></svg>')}`,"star-fill":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/></svg>')}`,heart:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143q.09.083.176.171a3 3 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15"/></svg>')}`,"heart-fill":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314"/></svg>')}`,circle:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><circle cx="8" cy="8" r="8"/></svg>')}`,square:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><rect width="16" height="16"/></svg>')}`,triangle:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M7.022 1.566a1.13 1.13 0 0 1 1.96 0l6.857 11.667c.457.778-.092 1.767-.98 1.767H1.144c-.889 0-1.437-.99-.98-1.767z"/></svg>')}`,"tic-x":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="2" y1="2" x2="14" y2="14"/><line x1="14" y1="2" x2="2" y2="14"/></svg>')}`,"tic-o":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><circle cx="8" cy="8" r="6"/></svg>')}`,"arrow-right":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"/></svg>')}`,"arrow-left":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8"/></svg>')}`,"arrow-up":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5"/></svg>')}`,"arrow-down":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1"/></svg>')}`,check:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"/></svg>')}`,x:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"/></svg>')}`,plus:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/></svg>')}`,minus:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8"/></svg>')}`,warning:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M7.938 2.016A.13.13 0 0 1 8.002 2a.13.13 0 0 1 .063.016.15.15 0 0 1 .054.057l6.857 11.667c.036.06.035.124.002.183a.2.2 0 0 1-.054.06.1.1 0 0 1-.066.017H1.146a.1.1 0 0 1-.066-.017.2.2 0 0 1-.054-.06.18.18 0 0 1 .002-.183L7.884 2.073a.15.15 0 0 1 .054-.057m1.044-.45a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767z"/><path d="M7.002 12a1 1 0 1 1 2 0 1 1 0 0 1-2 0M7.1 5.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z"/></svg>')}`,info:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/><path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/></svg>')}`,gear:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492M5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0"/><path d="M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115z"/></svg>')}`,database:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M4.318 2.687C5.234 2.271 6.536 2 8 2s2.766.27 3.682.687C12.644 3.125 13 3.627 13 4c0 .374-.356.875-1.318 1.313C10.766 5.729 9.464 6 8 6s-2.766-.27-3.682-.687C3.356 4.875 3 4.373 3 4c0-.374.356-.875 1.318-1.313M13 5.698V7c0 .374-.356.875-1.318 1.313C10.766 8.729 9.464 9 8 9s-2.766-.27-3.682-.687C3.356 7.875 3 7.373 3 7V5.698c.271.202.58.378.904.525C4.978 6.711 6.427 7 8 7s3.022-.289 4.096-.777A5 5 0 0 0 13 5.698M14 4c0-1.007-.875-1.755-1.904-2.223C11.022 1.289 9.573 1 8 1s-3.022.289-4.096.777C2.875 2.245 2 2.993 2 4v9c0 1.007.875 1.755 1.904 2.223C4.978 15.71 6.427 16 8 16s3.022-.289 4.096-.777C13.125 14.755 14 14.007 14 13zm-1 4.698V10c0 .374-.356.875-1.318 1.313C10.766 11.729 9.464 12 8 12s-2.766-.27-3.682-.687C3.356 10.875 3 10.373 3 10V8.698c.271.202.58.378.904.525C4.978 9.71 6.427 10 8 10s3.022-.289 4.096-.777A5 5 0 0 0 13 8.698m0 3V13c0 .374-.356.875-1.318 1.313C10.766 14.729 9.464 15 8 15s-2.766-.27-3.682-.687C3.356 13.875 3 13.373 3 13v-1.302c.271.202.58.378.904.525C4.978 12.71 6.427 13 8 13s3.022-.289 4.096-.777c.324-.147.633-.323.904-.525"/></svg>')}`,folder:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3H14.5A1.5 1.5 0 0 1 16 4.5v1.384l-.195-.131a1 1 0 0 0-.163-.084l-.022-.01-.053-.021A.5.5 0 0 0 15.5 5H.5a.5.5 0 0 0-.5.5v.01c.053-.01.108-.017.164-.022L.162 5.5zm-.11 2.13H15.57a.5.5 0 0 1 .49.6l-1.037 5.184A1.5 1.5 0 0 1 13.549 13H2.451a1.5 1.5 0 0 1-1.474-1.22L-.06 6.6a.5.5 0 0 1 .49-.6"/></svg>')}`,file:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm0 1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1"/></svg>')}`,tree:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8.416.223a.5.5 0 0 0-.832 0l-3 4.5A.5.5 0 0 0 5 5.5h.098L3.076 8.735A.5.5 0 0 0 3.5 9.5h.191l-1.638 3.276a.5.5 0 0 0 .447.724H7V16h2v-2.5h4.5a.5.5 0 0 0 .447-.724L12.31 9.5h.191a.5.5 0 0 0 .424-.765L10.902 5.5H11a.5.5 0 0 0 .416-.777z"/></svg>')}`,flower:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 1a4 4 0 0 0-4 4v.2A4.5 4.5 0 0 0 5.52 14h4.96A4.5 4.5 0 0 0 12 5.2V5a4 4 0 0 0-4-4"/></svg>')}`,car:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M2.52 3.515A2.5 2.5 0 0 1 4.82 2h6.36a2.5 2.5 0 0 1 2.3 1.515l1.34 3.147a.5.5 0 0 1-.068.51A.5.5 0 0 1 14.5 7H14v3a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-.5H5V10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7h-.5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .034-.18zM4 8.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1m8 0a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1M4.82 3a1.5 1.5 0 0 0-1.38.91L2.46 6h11.08l-.98-2.09A1.5 1.5 0 0 0 11.18 3z"/></svg>')}`,envelope:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1zm13 2.383-4.708 2.825L15 11.105zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741M1 11.105l4.708-2.897L1 5.383z"/></svg>')}`,phone:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M3.654 1.328a.678.678 0 0 0-1.015-.063L1.605 2.3c-.483.484-.661 1.169-.45 1.77a17.6 17.6 0 0 0 4.168 6.608 17.6 17.6 0 0 0 6.608 4.168c.601.211 1.286.033 1.77-.45l1.034-1.034a.678.678 0 0 0-.063-1.015l-2.307-1.794a.68.68 0 0 0-.58-.122l-2.19.547a1.75 1.75 0 0 1-1.657-.459L5.482 8.062a1.75 1.75 0 0 1-.46-1.657l.548-2.19a.68.68 0 0 0-.122-.58zM1.884.511a1.745 1.745 0 0 1 2.612.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.68.68 0 0 0 .178.643l2.457 2.457a.68.68 0 0 0 .644.178l2.189-.547a1.75 1.75 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.6 18.6 0 0 1-7.01-4.42 18.6 18.6 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877z"/></svg>')}`,flag:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M14.778.085A.5.5 0 0 1 15 .5V8a.5.5 0 0 1-.314.464L14.5 8l.186.464-.003.001-.006.003-.023.009a12 12 0 0 1-.397.15c-.264.095-.631.223-1.047.35-.816.252-1.879.523-2.71.523-.847 0-1.548-.28-2.158-.525l-.028-.01C7.68 8.71 7.14 8.5 6.5 8.5c-.7 0-1.638.23-2.437.477A20 20 0 0 0 3 9.342V15.5a.5.5 0 0 1-1 0V.5a.5.5 0 0 1 1 0v.282c.226-.079.496-.17.79-.26C4.606.272 5.67 0 6.5 0c.84 0 1.524.277 2.121.519l.043.018C9.286.788 9.828 1 10.5 1c.7 0 1.638-.23 2.437-.477a20 20 0 0 0 1.349-.476l.019-.007.004-.002h.001"/></svg>')}`,lock:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2m3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2M5 8h6a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1"/></svg>')}`,key:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M0 8a4 4 0 0 1 7.465-2H14a.5.5 0 0 1 .354.146l1.5 1.5a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0L13 9.207l-.646.647a.5.5 0 0 1-.708 0L11 9.207l-.646.647a.5.5 0 0 1-.708 0L9 9.207l-.646.647A.5.5 0 0 1 8 10h-.535A4 4 0 0 1 0 8m4-3a3 3 0 1 0 2.712 4.285A.5.5 0 0 1 7.163 9h.63l.853-.854a.5.5 0 0 1 .708 0l.646.647.646-.647a.5.5 0 0 1 .708 0l.646.647.646-.647a.5.5 0 0 1 .708 0l.646.647.793-.793-1-1h-6.63a.5.5 0 0 1-.451-.285A3 3 0 0 0 4 5m-1.5 3a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0"/></svg>')}`},_H=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.5" y="2.5" width="13" height="11" rx="1.5"/><line x1="2" y1="13" x2="14" y2="3" stroke-dasharray="2 1.5"/></svg>')}`,BH={bi:t=>`https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/icons/${t}.svg`,fa:t=>`https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/svgs/solid/${t}.svg`,"fa-solid":t=>`https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/svgs/solid/${t}.svg`,"fa-regular":t=>`https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/svgs/regular/${t}.svg`,"fa-brands":t=>`https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/svgs/brands/${t}.svg`,lucide:t=>`https://cdn.jsdelivr.net/npm/lucide-static@0.300.0/icons/${t}.svg`,heroicons:t=>`https://cdn.jsdelivr.net/npm/heroicons@2.1.1/24/outline/${t}.svg`,"heroicons-solid":t=>`https://cdn.jsdelivr.net/npm/heroicons@2.1.1/24/solid/${t}.svg`,tabler:t=>`https://cdn.jsdelivr.net/npm/@tabler/icons@2.44.0/icons/${t}.svg`,simple:t=>`https://cdn.jsdelivr.net/npm/simple-icons@10.4.0/icons/${t}.svg`};function aE(){return Object.keys(u1)}var qH={bi:"Bootstrap Icons",fa:"FontAwesome (solid)","fa-solid":"FontAwesome (solid)","fa-regular":"FontAwesome (regular)","fa-brands":"FontAwesome (brands)",lucide:"Lucide",heroicons:"Heroicons (outline)","heroicons-solid":"Heroicons (solid)",tabler:"Tabler Icons",simple:"Simple Icons (brands)"};function cE(){return Object.keys(BH).map(t=>({prefix:t,label:qH[t]??t,example:`${t}:${t.startsWith("fa")||t==="bi"?"person":"home"}`}))}var uE="data:image/svg+xml,";function f1(t){let e=u1[t];if(e)return decodeURIComponent(e.slice(uE.length))}var ide=new Map([...Object.values(u1),_H].map(t=>[t,decodeURIComponent(t.slice(uE.length))]));var Le=X(Ce()),fE=({name:t,className:e})=>{let n=f1(t);return n?(0,Le.jsx)("span",{className:e,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:n}}):null},dE=({value:t,onChange:e,placeholder:n,disabled:i,id:r,"aria-describedby":s,"aria-invalid":o})=>{let[l,a]=(0,sn.useState)(!1),[c,u]=(0,sn.useState)(""),f=(0,sn.useRef)(null),d=(0,sn.useRef)(null),h=(0,sn.useId)(),p=po(l,d,{align:"end",estimatedHeight:340}),g=(0,sn.useMemo)(()=>aE(),[]),b=(0,sn.useMemo)(()=>cE(),[]),m=(0,sn.useMemo)(()=>{let x=c.trim().toLowerCase();return x?g.filter(A=>A.includes(x)):g},[g,c]);(0,sn.useEffect)(()=>{if(!l)return;let x=A=>{f.current&&!f.current.contains(A.target)&&a(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[l]);let y=x=>{e(x),a(!1)},v=!!t&&!!f1(t);return(0,Le.jsxs)("div",{className:"spytial-ed-icon",ref:f,children:[(0,Le.jsxs)("div",{className:"spytial-ed-icon-row",children:[v?(0,Le.jsx)(fE,{name:t,className:"spytial-ed-icon-preview"}):null,(0,Le.jsx)("input",{id:r,type:"text",className:"spytial-ed-input",value:t,placeholder:n,disabled:i,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","aria-describedby":s,"aria-invalid":o||void 0,onChange:x=>e(x.target.value)}),(0,Le.jsx)("button",{ref:d,type:"button",className:"spytial-ed-icon-btn","aria-haspopup":"dialog","aria-expanded":l,"aria-controls":l?h:void 0,"aria-label":"Browse built-in icons",title:"Browse built-in icons",disabled:i,onClick:()=>a(x=>!x),children:(0,Le.jsx)("span",{"aria-hidden":"true",children:"\u2606"})})]}),l?(0,Le.jsxs)("div",{id:h,className:"spytial-ed-icon-pop",style:p,role:"dialog","aria-label":"Built-in icons",onKeyDown:x=>{x.key==="Escape"&&(x.stopPropagation(),a(!1),d.current?.focus())},children:[(0,Le.jsx)("input",{type:"text",className:"spytial-ed-input spytial-ed-icon-search",placeholder:`Filter ${g.length} bundled icons\u2026`,value:c,spellCheck:!1,"aria-label":"Filter bundled icons",onChange:x=>u(x.target.value)}),(0,Le.jsx)("p",{className:"spytial-ed-icon-note",children:"Bundled icons need no network. You can also type any image URL or path."}),m.length>0?(0,Le.jsx)("div",{className:"spytial-ed-icon-grid",role:"listbox","aria-label":"Bundled icons",children:m.map(x=>(0,Le.jsxs)("button",{type:"button",role:"option","aria-selected":t===x,className:`spytial-ed-icon-cell${t===x?" spytial-ed-icon-cell--active":""}`,title:x,onClick:()=>y(x),children:[(0,Le.jsx)(fE,{name:x,className:"spytial-ed-icon-cell-glyph"}),(0,Le.jsx)("span",{className:"spytial-ed-icon-cell-name",children:x})]},x))}):(0,Le.jsxs)("p",{className:"spytial-ed-icon-empty",children:["No bundled icon matches \u201C",c.trim(),"\u201D. Try an icon pack below, or paste a URL."]}),(0,Le.jsxs)("div",{className:"spytial-ed-icon-packs",children:[(0,Le.jsxs)("p",{className:"spytial-ed-icon-note",children:["Icon packs \u2014 write ",(0,Le.jsx)("code",{children:"prefix:name"}),". These load from a CDN at render time, so they need a connection and aren\u2019t previewed here."]}),(0,Le.jsx)("ul",{children:b.map(x=>(0,Le.jsxs)("li",{children:[(0,Le.jsxs)("code",{children:[x.prefix,":"]})," ",x.label," ",(0,Le.jsxs)("span",{className:"spytial-ed-icon-pack-eg",children:["e.g. ",(0,Le.jsx)("code",{children:x.example})]})]},x.prefix))})]})]}):null]})};var te=X(Ce());function mo(t){return t==null?"":String(t)}function PH(t){return Array.isArray(t)?t.map(e=>String(e)):t==null||t===""?[]:[String(t)]}function zH(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var HH=(t,e)=>(t??[]).filter(n=>n.fieldKey===e),UH=t=>{if(t.length!==0)return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"},FH=({diagnostics:t,id:e})=>t.length>0?(0,te.jsx)("ul",{className:"spytial-ed-diagnostics",id:e,children:t.map((n,i)=>(0,te.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${n.severity}`,children:[(0,te.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,te.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:n.message})]},i))}):null,fp=({fields:t,values:e,onChange:n,diagnostics:i,options:r,selectorProps:s,disabled:o=!1,className:l})=>{let a=(0,hE.useId)();return(0,te.jsx)("div",{className:`spytial-ed-fields${l?` ${l}`:""}`,children:t.map(c=>{if(c.kind==="group")return(0,te.jsx)($H,{field:c,value:e[c.key],onChange:n,options:r,selectorProps:s,diagnostics:i,disabled:o},c.key);let u=`${a}-${c.key}`,f=`${u}-label`,d=`${u}-diag`,h=HH(i,c.key),p=UH(h),g=e[c.key];return(0,te.jsxs)("div",{className:`spytial-ed-field spytial-ed-field--${c.kind}${p?` spytial-ed-field--${p}`:""}`,children:[(0,te.jsxs)("label",{id:f,htmlFor:c.kind==="selector"?void 0:u,className:"spytial-ed-field-label",title:c.help,children:[c.label,c.required?(0,te.jsxs)("span",{className:"spytial-ed-field-required","aria-hidden":"true",title:"required",children:[" ","*"]}):null]}),(0,te.jsxs)("div",{className:"spytial-ed-field-control",children:[VH(c,g,{fieldId:u,labelId:f,diagId:d,hasDiagnostics:h.length>0,disabled:o,onChange:n,options:r,selectorProps:s,diagnostics:h}),c.kind==="selector"?null:(0,te.jsx)(FH,{diagnostics:h,id:d})]})]},c.key)})})};function $H({field:t,value:e,onChange:n,options:i,selectorProps:r,diagnostics:s,disabled:o}){let l=zH(e)?e:void 0,a=!t.required;if(l===void 0)return(0,te.jsxs)("button",{type:"button",className:"spytial-ed-group-add",onClick:()=>n(t.key,{}),disabled:o,title:t.help,children:["+ ",t.label]});let c=(u,f)=>{let d={...l};f===void 0||f===""||Array.isArray(f)&&f.length===0?delete d[u]:d[u]=f,n(t.key,d)};return(0,te.jsxs)("fieldset",{className:"spytial-ed-group",children:[(0,te.jsxs)("legend",{className:"spytial-ed-group-legend",children:[(0,te.jsx)("span",{children:t.label}),a?(0,te.jsx)("button",{type:"button",className:"spytial-ed-group-remove",onClick:()=>n(t.key,void 0),disabled:o,"aria-label":`Remove ${t.label}`,title:`Remove ${t.label}`,children:"\xD7"}):null]}),(0,te.jsx)(fp,{fields:t.children??[],values:l,onChange:c,options:i,selectorProps:r,diagnostics:s,disabled:o})]})}function VH(t,e,n){let{fieldId:i,labelId:r,diagId:s,hasDiagnostics:o,disabled:l,onChange:a,options:c,selectorProps:u,diagnostics:f}=n,d=o?s:void 0;switch(t.kind){case"selector":{let h=u?.(t)??{};return(0,te.jsx)(c1,{value:mo(e),onChange:p=>a(t.key,p),placeholder:t.placeholder,disabled:l,selectorArity:t.selectorArity,"aria-labelledby":r,diagnostics:f,complete:h.complete,synthesize:h.synthesize,highlight:h.highlight})}case"relationName":case"typeName":{let h=t.kind==="relationName"?c?.relationNames:c?.typeNames,p=`${i}-list`,g=!!h&&h.length>0;return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)("input",{id:i,type:"text",className:"spytial-ed-input spytial-ed-combo",value:mo(e),placeholder:t.placeholder,disabled:l,list:g?p:void 0,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","aria-describedby":d,"aria-invalid":f.some(b=>b.severity==="error")||void 0,onChange:b=>a(t.key,b.target.value)}),g?(0,te.jsx)("datalist",{id:p,children:h.map(b=>(0,te.jsx)("option",{value:b},b))}):null]})}case"enum":{let h=t.options??[];if(t.multiple){let g=PH(e);return(0,te.jsx)("div",{className:"spytial-ed-pills",role:"group","aria-labelledby":r,"aria-describedby":d,children:h.map(b=>{let m=g.includes(b);return(0,te.jsx)("button",{type:"button",className:`spytial-ed-pill${m?" spytial-ed-pill--active":""}`,"aria-pressed":m,disabled:l,onClick:()=>{let y=m?g.filter(v=>v!==b):[...g,b];a(t.key,y)},children:b},b)})})}let p=mo(e);return(0,te.jsx)("div",{className:"spytial-ed-pills",role:"radiogroup","aria-labelledby":r,"aria-describedby":d,children:h.map(g=>{let b=p===g;return(0,te.jsx)("button",{type:"button",className:`spytial-ed-pill${b?" spytial-ed-pill--active":""}`,role:"radio","aria-checked":b,disabled:l,onClick:()=>a(t.key,g),children:g},g)})})}case"number":{let h=e,p=h==null||h===""?"":String(h);return(0,te.jsx)("input",{id:i,type:"number",className:"spytial-ed-input spytial-ed-input--number",value:p,placeholder:t.placeholder,disabled:l,"aria-describedby":d,"aria-invalid":f.some(g=>g.severity==="error")||void 0,onChange:g=>{let b=g.target.value;a(t.key,b===""?"":Number(b))}})}case"color":{let h=mo(e)||"#000000";return(0,te.jsxs)("div",{className:"spytial-ed-color",children:[(0,te.jsx)("input",{id:i,type:"color",className:"spytial-ed-color-swatch",value:jH(h),disabled:l,"aria-describedby":d,"aria-label":`${t.label} color`,onChange:p=>a(t.key,p.target.value)}),(0,te.jsx)("input",{type:"text",className:"spytial-ed-input spytial-ed-color-text",value:mo(e),placeholder:t.placeholder??"#rrggbb",disabled:l,spellCheck:!1,"aria-label":`${t.label} hex value`,onChange:p=>a(t.key,p.target.value)})]})}case"boolean":{let h=e===!0||e==="true";return(0,te.jsx)("button",{id:i,type:"button",role:"switch","aria-checked":h,"aria-describedby":d,className:`spytial-ed-switch${h?" spytial-ed-switch--on":""}`,disabled:l,onClick:()=>a(t.key,!h),children:(0,te.jsx)("span",{className:"spytial-ed-switch-thumb","aria-hidden":"true"})})}case"iconPath":return(0,te.jsx)(dE,{id:i,value:mo(e),onChange:h=>a(t.key,h),placeholder:t.placeholder,disabled:l,"aria-describedby":d,"aria-invalid":f.some(h=>h.severity==="error")});default:return(0,te.jsx)("input",{id:i,type:"text",className:"spytial-ed-input",value:mo(e),placeholder:t.placeholder,disabled:l,"aria-describedby":d,"aria-invalid":f.some(h=>h.severity==="error")||void 0,onChange:h=>a(t.key,h.target.value)})}}function jH(t){let e=t.trim();return/^#[0-9a-fA-F]{6}$/.test(e)?e:/^#[0-9a-fA-F]{3}$/.test(e)?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:"#000000"}var an=X(Tt());var h1=[],yE=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?yE:h1).push(n=n+t[e])})();function YH(t){if(t<768)return!1;for(let e=0,n=h1.length;;){let i=e+n>>1;if(t<h1[i])n=i;else if(t>=yE[i])e=i+1;else return!0;if(e==n)return!1}}function pE(t){return t>=127462&&t<=127487}var mE=8205;function bE(t,e,n=!0,i=!0){return(n?vE:KH)(t,e,i)}function vE(t,e,n){if(e==t.length)return e;e&&xE(t.charCodeAt(e))&&SE(t.charCodeAt(e-1))&&e--;let i=d1(t,e);for(e+=gE(i);e<t.length;){let r=d1(t,e);if(i==mE||r==mE||n&&YH(r))e+=gE(r),i=r;else if(pE(r)){let s=0,o=e-2;for(;o>=0&&pE(d1(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function KH(t,e,n){for(;e>1;){let i=vE(t,e-2,n);if(i<e)return i;e--}return 0}function d1(t,e){let n=t.charCodeAt(e);if(!SE(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return xE(i)?(n-55296<<10)+(i-56320)+65536:n}function xE(t){return t>=56320&&t<57344}function SE(t){return t>=55296&&t<56320}function gE(t){return t<65536?1:2}var fe=class t{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,i){[e,n]=aa(this,e,n);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),sa.from(r,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=aa(this,e,n);let i=[];return this.decompose(e,n,i,0),sa.from(i,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new vo(this),s=new vo(e);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new vo(this,e)}iterRange(e,n=this.length){return new gp(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new yp(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?t.empty:e.length<=32?new Sn(e):sa.from(Sn.split(e,[]))}},Sn=class t extends fe{constructor(e,n=GH(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=e)return new m1(r,l,i,o);r=l+1,i++}}decompose(e,n,i,r){let s=e<=0&&n>=this.length?this:new t(wE(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),l=mp(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new t(l,o.length+s.length));else{let a=l.length>>1;i.push(new t(l.slice(0,a)),new t(l.slice(a)))}}else i.push(s)}replace(e,n,i){if(!(i instanceof t))return super.replace(e,n,i);[e,n]=aa(this,e,n);let r=mp(this.text,mp(i.text,wE(this.text,0,e)),n),s=this.length+i.length-(n-e);return r.length<=32?new t(r,s):sa.from(t.split(r,[]),s)}sliceString(e,n=this.length,i=`
|
|
190
|
-
`){[e,n]=aa(this,e,n);let r="";for(let s=0,o=0;s<=n&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=i),e<a&&n>s&&(r+=l.slice(Math.max(0,e-s),n-s)),s=a+1}return r}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(n.push(new t(i,r)),i=[],r=-1);return r>-1&&n.push(new t(i,r)),n}},sa=class t extends
|
|
191
|
-
`){[e,n]=aa(this,e,n);let r="";for(let s=0,o=0;s<this.children.length&&o<=n;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=i),e<a&&n>o&&(r+=l.sliceString(e-o,n-o,i)),o=a+1}return r}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof t))return 0;let i=0,[r,s,o,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==l)return i;let a=this.children[r],c=e.children[s];if(a!=c)return i+a.scanIdentical(c,n);i+=a.length+1}}static from(e,n=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let h of e)i+=h.lines;if(i<32){let h=[];for(let
|
|
192
|
-
`,this;e--}else if(r instanceof Sn){let a=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=n,a.length>Math.max(0,e))return this.value=e==0?a:n>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(n<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(n>0?1:(a instanceof Sn?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},gp=class{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new vo(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},yp=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(fe.prototype[Symbol.iterator]=function(){return this.iter()},vo.prototype[Symbol.iterator]=gp.prototype[Symbol.iterator]=yp.prototype[Symbol.iterator]=function(){return this});var m1=class{constructor(e,n,i,r){this.from=e,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function aa(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function gt(t,e,n=!0,i=!0){return bE(t,e,n,i)}function QH(t){return t>=56320&&t<57344}function XH(t){return t>=55296&&t<56320}function TE(t,e){let n=t.charCodeAt(e);if(!XH(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return QH(i)?(n-55296<<10)+(i-56320)+65536:n}function EE(t){return t<65536?1:2}var g1=/\r\n?|\n/,Yt=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Yt||(Yt={})),wr=class t{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n+1];e+=i<0?this.sections[n]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,i=0,r=0;n<this.sections.length;){let s=this.sections[n++],o=this.sections[n++];o<0?(e(i,r,s),r+=s):r+=o,i+=s}}iterChangedRanges(e,n=!1){y1(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];r<0?e.push(i,r):e.push(r,i)}return new t(e)}composeDesc(e){return this.empty?e:e.empty?this:DE(this,e)}mapDesc(e,n=!1){return e.empty?this:b1(this,e,n)}mapPos(e,n=-1,i=Yt.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=r+l;if(a<0){if(c>e)return s+(e-r);s+=l}else{if(i!=Yt.Simple&&c>=e&&(i==Yt.TrackDel&&r<e&&c>e||i==Yt.TrackBefore&&r<e||i==Yt.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!l)return e==r||n<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,n=e){for(let i=0,r=0;i<this.sections.length&&r<=n;){let s=this.sections[i++],o=this.sections[i++],l=r+s;if(o>=0&&r<=n&&l>=e)return r<e&&l>n?"cover":!0;r=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new t(e)}static create(e){return new t(e)}},Kt=class t extends wr{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return y1(this,(n,i,r,s,o)=>e=e.replace(r,r+(i-n),o),!1),e}mapDesc(e,n=!1){return b1(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let r=0,s=0;r<n.length;r+=2){let o=n[r],l=n[r+1];if(l>=0){n[r]=l,n[r+1]=o;let a=r>>1;for(;i.length<a;)i.push(fe.empty);i.push(o?e.slice(s,s+o):fe.empty)}s+=o}return new t(n,i)}compose(e){return this.empty?e:e.empty?this:DE(this,e,!0)}map(e,n=!1){return e.empty?this:b1(this,e,n,!0)}iterChanges(e,n=!1){y1(this,e,n)}get desc(){return wr.create(this.sections)}filter(e){let n=[],i=[],r=[],s=new xo(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,a-l);It(r,u,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;It(n,u,f),f>0&&Ss(i,n,s.text),s.forward(u),l+=u}let c=e[o++];for(;l<c;){if(s.done)break e;let u=Math.min(s.len,c-l);It(n,u,-1),It(r,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),l+=u}}return{changes:new t(n,i),filtered:wr.create(r)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],r=this.sections[n+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,i){let r=[],s=[],o=0,l=null;function a(u=!1){if(!u&&!r.length)return;o<n&&It(r,n-o,-1);let f=new t(r,s);l=l?l.compose(f.map(l)):f,r=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let f of u)c(f);else if(u instanceof t){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);a(),l=l?l.compose(u.map(l)):u}else{let{from:f,to:d=f,insert:h}=u;if(f>d||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?fe.of(h.split(i||g1)):h:fe.empty,g=p.length;if(f==d&&g==0)return;f<o&&a(),f>o&&It(r,f-o,-1),It(r,d-f,g),Ss(s,r,p),o=d}}return c(e),a(!l),l}static empty(e){return new t(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length<r;)i.push(fe.empty);i[r]=fe.of(s.slice(1)),n.push(s[0],i[r].length)}}}return new t(n,i)}static createSet(e,n){return new t(e,n)}};function It(t,e,n,i=!1){if(e==0&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function Ss(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(fe.empty);t.push(n)}}function y1(t,e,n){let i=t.inserted;for(let r=0,s=0,o=0;o<t.sections.length;){let l=t.sections[o++],a=t.sections[o++];if(a<0)r+=l,s+=l;else{let c=r,u=s,f=fe.empty;for(;c+=l,u+=a,a&&i&&(f=f.append(i[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(r,c,s,u,f),r=c,s=u}}}function b1(t,e,n,i=!1){let r=[],s=i?[]:null,o=new xo(t),l=new xo(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);It(r,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!n))){let c=l.len;for(It(r,l.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=u&&(It(r,0,o.ins),s&&Ss(s,r,o.text),a=o.i),o.forward(u),c-=u}l.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(l.ins==-1){let f=Math.min(u,l.len);c+=f,u-=f,l.forward(f)}else if(l.ins==0&&l.len<u)u-=l.len,l.next();else break;It(r,c,a<o.i?o.ins:0),s&&a<o.i&&Ss(s,r,o.text),a=o.i,o.forward(o.len-u)}else{if(o.done&&l.done)return s?Kt.createSet(r,s):wr.create(r);throw new Error("Mismatched change set lengths")}}}function DE(t,e,n=!1){let i=[],r=n?[]:null,s=new xo(t),o=new xo(e);for(let l=!1;;){if(s.done&&o.done)return r?Kt.createSet(i,r):wr.create(i);if(s.ins==0)It(i,s.len,0,l),s.next();else if(o.len==0&&!o.done)It(i,0,o.ins,l),r&&Ss(r,i,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),c=i.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;It(i,a,u,l),r&&u&&Ss(r,i,o.text)}else o.ins==-1?(It(i,s.off?0:s.len,a,l),r&&Ss(r,i,s.textBit(a))):(It(i,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&Ss(r,i,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>c),s.forward2(a),o.forward(a)}}}}var xo=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?fe.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?fe.empty:n[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},go=class t{constructor(e,n,i,r){this.from=e,this.to=n,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,n=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new t(i,r,this.flags,this.goalColumn)}extend(e,n=e,i=0){if(e<=this.anchor&&n>=this.anchor)return R.range(e,n,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return R.range(this.anchor,r,void 0,void 0,i)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return R.range(e.anchor,e.head)}static create(e,n,i,r){return new t(e,n,i,r)}},R=class t{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:t.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new t([this.main],0)}addRange(e,n=!0){return t.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let i=this.ranges.slice();return i[n]=e,t.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new t(e.ranges.map(n=>go.fromJSON(n)),e.main)}static single(e,n=e){return new t([t.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return t.normalized(e.slice(),n);i=s.to}return new t(e,n)}static cursor(e,n=0,i,r){return go.create(e,e,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i)),r)}static range(e,n,i,r,s){let o=r==null?7:Math.min(6,r);return!s&&e!=n&&(s=n<e?1:-1),s&&(o|=s<0?8:16),n<e?go.create(n,e,o|32,i):go.create(e,n,o,i)}static undirectionalRange(e,n){return go.create(e,n,64,void 0)}static normalized(e,n=0){let i=e[n];e.sort((r,s)=>r.from-s.from),n=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);r<=n&&n--,e.splice(--r,2,s.anchor>s.head?t.range(a,l):t.range(l,a))}}return new t(e,n)}};function ME(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}var E1=0,I=class t{constructor(e,n,i,r,s){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=E1++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new t(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:D1),!!e.static,e.enables)}of(e){return new oa([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new oa(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new oa(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}};function D1(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}var oa=class{constructor(e,n,i,r){this.dependencies=e,this.facet=n,this.type=i,this.value=r,this.id=E1++}dynamicSlot(e){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:(((n=e[f.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,d){if(a&&d.docChanged||c&&(d.docChanged||d.selection)||v1(f,u)){let h=i(f);if(l?!kE(h,f.values[o],r):!r(h,f.values[o]))return f.values[o]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[s];if(p!=null){let g=xp(d,p);if(this.dependencies.every(b=>b instanceof I?d.facet(b)===f.facet(b):b instanceof _t?d.field(b,!1)==f.field(b,!1):!0)||(l?kE(h=i(f),g,r):r(h=i(f),g)))return f.values[o]=g,0}else h=i(f);return f.values[o]=h,1}}}get extension(){return this}};function kE(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function v1(t,e){let n=!1;for(let i of e)Nu(t,i)&1&&(n=!0);return n}function WH(t,e,n){let i=n.map(a=>t[a.id]),r=n.map(a=>a.type),s=i.filter(a=>!(a&1)),o=t[e.id]>>1;function l(a){let c=[];for(let u=0;u<i.length;u++){let f=xp(a,i[u]);if(r[u]==2)for(let d of f)c.push(d);else c.push(f)}return e.combine(c)}return{create(a){for(let c of i)Nu(a,c);return a.values[o]=l(a),1},update(a,c){if(!v1(a,s))return 0;let u=l(a);return e.compare(u,a.values[o])?0:(a.values[o]=u,1)},reconfigure(a,c){let u=v1(a,i),f=c.config.facets[e.id],d=c.facet(e);if(f&&!u&&D1(n,f))return a.values[o]=d,0;let h=l(a);return e.compare(h,d)?(a.values[o]=d,0):(a.values[o]=h,1)}}}var dp=I.define({static:!0}),_t=class t{constructor(e,n,i,r,s){this.id=e,this.createF=n,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let n=new t(E1++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(dp).find(i=>i.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(dp),o=r.facet(dp),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,dp.of({field:this,create:e})]}get extension(){return this}},yo={lowest:4,low:3,default:2,high:1,highest:0};function Ru(t){return e=>new bp(e,t)}var Bu={highest:Ru(yo.highest),high:Ru(yo.high),default:Ru(yo.default),low:Ru(yo.low),lowest:Ru(yo.lowest)},bp=class{constructor(e,n){this.inner=e,this.prec=n}get extension(){return this}},ca=class t{of(e){return new Lu(this,e)}reconfigure(e){return t.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},Lu=class{constructor(e,n){this.compartment=e,this.inner=n}get extension(){return this}},vp=class t{constructor(e,n,i,r,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,i){let r=[],s=Object.create(null),o=new Map;for(let d of ZH(e,n,o))d instanceof _t?r.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let l=Object.create(null),a=[],c=[];for(let d of r)l[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=i?.config.facets;for(let d in s){let h=s[d],p=h[0].facet,g=u&&u[d]||[];if(h.every(b=>b.type==0))if(l[p.id]=a.length<<1|1,D1(g,h))a.push(i.facet(p));else{let b=p.combine(h.map(m=>m.value));a.push(i&&p.compare(b,i.facet(p))?i.facet(p):b)}else{for(let b of h)b.type==0?(l[b.id]=a.length<<1|1,a.push(b.value)):(l[b.id]=c.length<<1,c.push(m=>b.dynamicSlot(m)));l[p.id]=c.length<<1,c.push(b=>WH(b,p,h))}}let f=c.map(d=>d(l));return new t(e,o,f,l,a,s)}};function ZH(t,e,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof Lu&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let c of o)s(c,l);else if(o instanceof Lu){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;n.set(o.compartment,c),s(c,l)}else if(o instanceof bp)s(o.inner,o.prec);else if(o instanceof _t)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof oa)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,yo.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(c==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,l)}}return s(t,yo.default),i.reduce((o,l)=>o.concat(l))}function Nu(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function xp(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}var RE=I.define(),x1=I.define({combine:t=>t.some(e=>e),static:!0}),NE=I.define({combine:t=>t.length?t[0]:void 0,static:!0}),LE=I.define(),IE=I.define(),_E=I.define(),BE=I.define({combine:t=>t.length?t[0]:!1}),Hn=class{constructor(e,n){this.type=e,this.value=n}static define(){return new S1}},S1=class{of(e){return new Hn(this,e)}},w1=class{constructor(e){this.map=e}of(e){return new pe(this,e)}},pe=class t{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new t(this.type,n)}is(e){return this.type==e}static define(e={}){return new w1(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(n);s&&i.push(s)}return i}};pe.reconfigure=pe.define();pe.appendConfig=pe.define();var mt=class t{constructor(e,n,i,r,s,o){this.startState=e,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&ME(i,n.newLength),s.some(l=>l.type==t.time)||(this.annotations=s.concat(t.time.of(Date.now())))}static create(e,n,i,r,s,o){return new t(e,n,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(t.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}};mt.time=Hn.define();mt.userEvent=Hn.define();mt.addToHistory=Hn.define();mt.remote=Hn.define();function JH(t,e){let n=[];for(let i=0,r=0;;){let s,o;if(i<t.length&&(r==e.length||e[r]>=t[i]))s=t[i++],o=t[i++];else if(r<e.length)s=e[r++],o=e[r++];else return n;!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function qE(t,e,n){var i;let r,s,o;return n?(r=e.changes,s=Kt.empty(e.changes.length),o=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(i=t.selection)===null||i===void 0?void 0:i.map(r),effects:pe.mapEffects(t.effects,r).concat(pe.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function k1(t,e,n){let i=e.selection,r=la(e.annotations);return e.userEvent&&(r=r.concat(mt.userEvent.of(e.userEvent))),{changes:e.changes instanceof Kt?e.changes:Kt.of(e.changes||[],n,t.facet(NE)),selection:i&&(i instanceof R?i:R.single(i.anchor,i.head)),effects:la(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function PE(t,e,n){let i=k1(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let o=!!e[s].sequential;i=qE(i,k1(t,e[s],o?i.changes.newLength:t.doc.length),o)}let r=mt.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return tU(n?eU(r):r)}function eU(t){let e=t.startState,n=!0;for(let r of e.facet(LE)){let s=r(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:JH(n,s))}if(n!==!0){let r,s;if(n===!1)s=t.changes.invertedDesc,r=Kt.empty(e.doc.length);else{let o=t.changes.filter(n);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=mt.create(e,r,t.selection&&t.selection.map(s),pe.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(IE);for(let r=i.length-1;r>=0;r--){let s=i[r](t);s instanceof mt?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof mt?t=s[0]:t=PE(e,la(s),!1)}return t}function tU(t){let e=t.startState,n=e.facet(_E),i=t;for(let r=n.length-1;r>=0;r--){let s=n[r](t);s&&Object.keys(s).length&&(i=qE(i,k1(e,s,t.changes.newLength),!0))}return i==t?t:mt.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}var nU=[];function la(t){return t==null?nU:Array.isArray(t)?t:[t]}var fi=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(fi||(fi={})),iU=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,A1;try{A1=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function rU(t){if(A1)return A1.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||iU.test(n)))return!0}return!1}function sU(t){return e=>{if(!/\S/.test(e))return fi.Space;if(rU(e))return fi.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return fi.Word;return fi.Other}}var De=class t{constructor(e,n,i,r,s,o){this.config=e,this.doc=n,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Nu(this,l<<1);this.computeSlot=null}field(e,n=!0){let i=this.config.address[e.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return Nu(this,i),xp(this,i)}update(...e){return PE(this,e,!0)}applyTransaction(e){let n=this.config,{base:i,compartments:r}=n;for(let l of e.effects)l.is(ca.reconfigure)?(n&&(r=new Map,n.compartments.forEach((a,c)=>r.set(c,a)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(pe.reconfigure)?(n=null,i=l.value):l.is(pe.appendConfig)&&(n=null,i=la(i).concat(l.value));let s;n?s=e.startState.values.slice():(n=vp.resolve(i,r,this),s=new t(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(x1)?e.newSelection:e.newSelection.asSingle();new t(n,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:R.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=la(i.effects);for(let l=1;l<n.ranges.length;l++){let a=e(n.ranges[l]),c=this.changes(a.changes),u=c.map(r);for(let d=0;d<l;d++)s[d]=s[d].map(u);let f=r.mapDesc(c,!0);s.push(a.range.map(f)),r=r.compose(u),o=pe.mapEffects(o,u).concat(pe.mapEffects(la(a.effects),f))}return{changes:r,selection:R.create(s,n.mainIndex),effects:o}}changes(e=[]){return e instanceof Kt?e:Kt.of(e,this.doc.length,this.facet(t.lineSeparator))}toText(e){return fe.of(e.split(this.facet(t.lineSeparator)||g1))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Nu(this,n),xp(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof _t&&this.config.address[r.id]!=null&&(n[i]=r.spec.toJSON(this.field(e[i]),this))}return n}static fromJSON(e,n={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let o=i[s],l=e[s];r.push(o.init(a=>o.spec.fromJSON(l,a)))}}return t.create({doc:e.doc,selection:R.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=vp.resolve(e.extensions||[],new Map),i=e.doc instanceof fe?e.doc:fe.of((e.doc||"").split(n.staticFacet(t.lineSeparator)||g1)),r=e.selection?e.selection instanceof R?e.selection:R.single(e.selection.anchor,e.selection.head):R.single(0);return ME(r,i.length),n.staticFacet(x1)||(r=r.asSingle()),new t(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(t.tabSize)}get lineBreak(){return this.facet(t.lineSeparator)||`
|
|
193
|
-
`}get readOnly(){return this.facet(BE)}phrase(e,...n){for(let i of this.facet(t.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),e}languageDataAt(e,n,i=-1){let r=[];for(let s of this.facet(RE))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return sU(n.length?n[0]:"")}wordAt(e){let{text:n,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=gt(n,o,!1);if(s(n.slice(a,o))!=fi.Word)break;o=a}for(;l<r;){let a=gt(n,l);if(s(n.slice(l,a))!=fi.Word)break;l=a}return o==l?null:R.range(o+i,l+i)}};De.allowMultipleSelections=x1;De.tabSize=I.define({combine:t=>t.length?t[0]:4});De.lineSeparator=NE;De.readOnly=BE;De.phrases=I.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(r=>t[r]==e[r])}});De.languageData=RE;De.changeFilter=LE;De.transactionFilter=IE;De.transactionExtender=_E;ca.reconfigure=pe.define();function ws(t,e,n={}){let i={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}var Hi=class{eq(e){return this==e}range(e,n=e){return Iu.create(e,n,this)}};Hi.prototype.startSide=Hi.prototype.endSide=0;Hi.prototype.point=!1;Hi.prototype.mapMode=Yt.TrackDel;function M1(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}var Iu=class t{constructor(e,n,i){this.from=e,this.to=n,this.value=i}static create(e,n,i){return new t(e,n,i)}};function C1(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}var O1=class t{constructor(e,n,i,r){this.from=e,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-n;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let i=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],u=this.from[a]+e,f=this.to[a]+e,d,h;if(u==f){let p=n.mapPos(u,c.startSide,c.mapMode);if(p==null||(d=h=p,c.startSide!=c.endSide&&(h=n.mapPos(u,c.endSide),h<d)))continue}else if(d=n.mapPos(u,c.startSide),h=n.mapPos(f,c.endSide),d>h||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(l=Math.max(l,h-d)),i.push(c),r.push(d-o),s.push(h-o))}return{mapped:i.length?new t(r,s,i,l):null,pos:o}}},me=class t{constructor(e,n,i,r){this.chunkPos=e,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(e,n,i,r){return new t(e,n,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(C1)),this.isEmpty)return n.length?t.of(n):this;let l=new Sp(this,null,-1).goto(0),a=0,c=[],u=new kr;for(;l.value||a<n.length;)if(a<n.length&&(l.from-n[a].from||l.startSide-n[a].value.startSide)>=0){let f=n[a++];u.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==n.length||this.chunkEnd(l.chunkIndex)<n[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&u.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(u.addInner(l.from,l.to,l.value)||c.push(Iu.create(l.from,l.to,l.value))),l.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?t.empty:this.nextLayer.update({add:c,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],i=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)r=Math.max(r,a.maxPoint),n.push(a),i.push(e.mapPos(l));else if(c===!0){let{mapped:u,pos:f}=a.map(l,e);u&&(r=Math.max(r,u.maxPoint),n.push(u),i.push(f))}}let s=this.nextLayer.map(e);return n.length==0?s:new t(i,n,s||t.empty,r)}between(e,n,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(n>=s&&e<=s+o.length&&o.between(s,e-s,n-s,i)===!1)return}this.nextLayer.between(e,n,i)}}iter(e=0){return _u.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return _u.from(e).goto(n)}static compare(e,n,i,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=AE(o,l,i),c=new bo(o,a,s),u=new bo(l,a,s);i.iterGaps((f,d,h)=>CE(c,f,u,d,h,r)),i.empty&&i.length==0&&CE(c,0,u,0,0,r)}static eq(e,n,i=0,r){r==null&&(r=999999999);let s=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),o=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=AE(s,o),a=new bo(s,l,0).goto(i),c=new bo(o,l,0).goto(i);for(;;){if(a.to!=c.to||!T1(a.active,c.active)||a.point&&(!c.point||!M1(a.point,c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,n,i,r,s=-1){let o=new bo(e,null,s).goto(n),l=n,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let u=o.activeForPoint(o.to),f=o.pointFrom<n?u.length+1:o.point.startSide<0?u.length:Math.min(u.length,a);r.point(l,c,o.point,u,f,o.pointRank),a=Math.min(o.openEnd(c),u.length)}else c>l&&(r.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,n=!1){let i=new kr;for(let r of e instanceof Iu?[e]:n?oU(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return t.empty;let n=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=t.empty;r=r.nextLayer)n=new t(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}};me.empty=new me([],[],null,-1);function oU(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(C1(e,i)>0)return t.slice().sort(C1);e=i}return t}me.empty.nextLayer=me.empty;var kr=class t{finishChunk(e){this.chunks.push(new O1(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,i){this.addInner(e,n,i)||(this.nextLayer||(this.nextLayer=new t)).add(e,n,i)}addInner(e,n,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+e,this.lastTo=n.to[i]+e,!0}finish(){return this.finishInner(me.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=me.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}};function AE(t,e,n){let i=new Map;for(let s of t)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&i.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=i.get(s.chunk[o]);l!=null&&(n?n.mapPos(l):l)==s.chunkPos[o]&&!n?.touchesRange(l,l+s.chunk[o].length)&&r.add(s.chunk[o])}return r}var Sp=class{constructor(e,n,i,r=0){this.layer=e,this.skip=n,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],i=e+n.from[this.rangeIndex];if(this.from=i,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},_u=class t{constructor(e){this.heap=e}static from(e,n=null,i=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&r.push(new Sp(o,n,i,s));return r.length==1?r[0]:new t(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let i of this.heap)i.goto(e,n);for(let i=this.heap.length>>1;i>=0;i--)p1(this.heap,i);return this.next(),this}forward(e,n){for(let i of this.heap)i.forward(e,n);for(let i=this.heap.length>>1;i>=0;i--)p1(this.heap,i);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),p1(this.heap,0)}}};function p1(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let r=t[i];if(i+1<t.length&&r.compare(t[i+1])>=0&&(r=t[i+1],i++),n.compare(r)<0)break;t[i]=n,t[e]=r,e=i}}var bo=class{constructor(e,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=_u.from(e,n,i)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){hp(this.active,e),hp(this.activeTo,e),hp(this.activeRank,e),this.minActive=OE(this.active,this.activeTo)}addActive(e){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||r-this.activeTo[n])>0;)n++;pp(this.active,n,i),pp(this.activeTo,n,r),pp(this.activeRank,n,s),e&&pp(e,n,this.cursor.from),this.minActive=OE(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&hp(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(e){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)n++;return n}};function CE(t,e,n,i,r,s){t.goto(e),n.goto(i);let o=i+r,l=i,a=i-e,c=!!s.boundChange;for(let u=!1;;){let f=t.to+a-n.to,d=f||t.endSide-n.endSide,h=d<0?t.to+a:n.to,p=Math.min(h,o);if(t.point||n.point?(t.point&&n.point&&M1(t.point,n.point)&&T1(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,p,t.point,n.point),u=!1):(u&&s.boundChange(l),p>l&&!T1(t.active,n.active)&&s.compareRange(l,p,t.active,n.active),c&&p<o&&(f||t.openEnd(h)!=n.openEnd(h))&&(u=!0)),h>o)break;l=h,d<=0&&t.next(),d>=0&&n.next()}}function T1(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!M1(t[n],e[n]))return!1;return!0}function hp(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function pp(t,e,n){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=n}function OE(t,e){let n=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||t[r].endSide-t[n].endSide)<0&&(n=r,i=e[r]);return n}function So(t,e,n=t.length){let i=0;for(let r=0;r<n&&r<t.length;)t.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=gt(t,r));return i}function zE(t,e,n,i){for(let r=0,s=0;;){if(s>=e)return r;if(r==t.length)break;s+=t.charCodeAt(r)==9?n-s%n:1,r=gt(t,r)}return i===!0?-1:t.length}var HE=typeof Symbol>"u"?"__\u037C":Symbol.for("\u037C"),R1=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),UE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Un=class{constructor(e,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,c){let u=[],f=/^@(\w+)\b/.exec(o[0]),d=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let h in l){let p=l[h];if(/&/.test(h))s(h.split(/,\s*/).map(g=>o.map(b=>g.replace(/&/,b))).reduce((g,b)=>g.concat(b)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");s(r(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(u.length||d)&&a.push((i&&!f&&!c?o.map(i):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
188
|
+
`;)i++;i<n&&t[i]==="`"&&i++,r("identifier",l,i);continue}if(TH.test(s)){let l=i;for(i++;i<n&&EH.test(t[i]);)i++;let a=t.slice(l,i);r(AH.has(a)?"keyword":"identifier",l,i);continue}let o=t.slice(i,i+2);if(CH.includes(o)){r("operator",i,i+2),i+=2;continue}if(OH.has(s)){r("operator",i,i+1),i++;continue}r("punctuation",i,i+1),i++}return e}function a1(t){switch(t){case"keyword":return"spytial-ed-syn-keyword";case"operator":return"spytial-ed-syn-operator";case"string":return"spytial-ed-syn-string";case"number":return"spytial-ed-syn-number";case"identifier":return"spytial-ed-syn-identifier";case"comment":return"spytial-ed-syn-comment";default:return}}var ee=X(Et());var cp=X(Et());function po(t,e,n){let{align:i="start",gap:r=2,estimatedHeight:s=280}=n??{},[o,l]=(0,cp.useState)({});return(0,cp.useLayoutEffect)(()=>{if(!t){l({});return}let a=()=>{let c=e.current;if(!c)return;let u=c.getBoundingClientRect(),f=window.innerWidth||document.documentElement.clientWidth,d=window.innerHeight||document.documentElement.clientHeight,h=d-u.bottom-r,m=u.top-r,g=h<s&&m>h,b={maxHeight:Math.max(120,(g?m:h)-8)};g?b.bottom=d-u.top+r:b.top=u.bottom+r,i==="end"?b.right=Math.max(8,f-u.right):i==="stretch"?(b.left=u.left,b.width=u.width):b.left=u.left,l(b)};return a(),window.addEventListener("resize",a),document.addEventListener("scroll",a,!0),()=>{window.removeEventListener("resize",a),document.removeEventListener("scroll",a,!0)}},[t,e,i,r,s]),o}var ce=X(Ce()),RH=150,NH=/[A-Za-z0-9_$]/;function LH(t){if(!(!t||t.length===0))return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"}function IH(t,e){let n=e;for(;n>0&&NH.test(t[n-1]);)n--;return{prefix:t.slice(n,e),start:n}}var lE=({value:t})=>{let e=(0,ee.useMemo)(()=>l1(t),[t]);return(0,ce.jsxs)(ce.Fragment,{children:[e.map((n,i)=>{let r=a1(n.kind);return r?(0,ce.jsx)("span",{className:r,children:n.text},i):(0,ce.jsx)(ee.default.Fragment,{children:n.text},i)}),t.endsWith(`
|
|
189
|
+
`)?"\u200B":null]})},c1=({value:t,onChange:e,placeholder:n,disabled:i=!1,selectorArity:r,complete:s,synthesize:o,diagnostics:l,highlight:a=!0,className:c,"aria-label":u,"aria-labelledby":f})=>{let d=(0,ee.useRef)(null),h=(0,ee.useRef)(null),m=(0,ee.useId)(),g=`${m}-listbox`,b=F=>`${m}-opt-${F}`,p=`${m}-diag`,[y,v]=(0,ee.useState)(!1),[x,k]=(0,ee.useState)([]),[C,w]=(0,ee.useState)(0),A=(0,ee.useRef)(0),O=(0,ee.useRef)(null),D=(0,ee.useRef)(0),[I,M]=(0,ee.useState)(!1),[$,U]=(0,ee.useState)(""),[he,Fe]=(0,ee.useState)(!1),[ft,fe]=(0,ee.useState)(null),[Qe,cn]=(0,ee.useState)(null),Ct=(0,ee.useRef)(null),Ve=LH(l),bt=(0,ee.useCallback)(()=>{let F=d.current,re=h.current;!F||!re||(re.scrollTop=F.scrollTop,re.scrollLeft=F.scrollLeft)},[]),vt=(0,ee.useRef)(0),un=(0,ee.useCallback)(()=>{let F=d.current;if(F){if(F.value===""){F.style.height="",vt.current=0;return}if(F.clientWidth<60){vt.current<10&&(vt.current+=1,requestAnimationFrame(un));return}vt.current=0,F.style.height="auto",F.style.height=`${F.scrollHeight}px`}},[]);(0,ee.useEffect)(()=>{un(),bt()},[t,un,bt]);let fn=(0,ee.useCallback)((F,re)=>{if(!s)return;let{prefix:Wi,start:Ir}=IH(F,re);D.current=Ir,O.current&&clearTimeout(O.current);let Go=++A.current;O.current=setTimeout(()=>{let Us;try{Us=s(Wi)}catch{return}Promise.resolve(Us).then(wi=>{if(Go===A.current){if(!wi||wi.length===0){k([]),v(!1);return}k(wi),w(0),v(!0)}}).catch(()=>{Go===A.current&&(k([]),v(!1))})},RH)},[s]),Zn=(0,ee.useCallback)(()=>{A.current++,O.current&&clearTimeout(O.current),v(!1),k([])},[]),Jn=(0,ee.useCallback)(F=>{let re=d.current,Wi=re?re.selectionStart:t.length,Ir=F.insertText??F.label,Go=t.slice(0,D.current)+Ir+t.slice(Wi);e(Go),Zn();let Us=D.current+Ir.length;requestAnimationFrame(()=>{let wi=d.current;wi&&(wi.focus(),wi.setSelectionRange(Us,Us))})},[t,e,Zn]),jo=(0,ee.useCallback)(F=>{let re=F.target.value;e(re),fn(re,F.target.selectionStart)},[e,fn]),Yo=(0,ee.useCallback)(F=>{if(F.code==="Space"&&(F.ctrlKey||F.metaKey)){F.preventDefault();let re=d.current;re&&fn(re.value,re.selectionStart);return}if(!(!y||x.length===0))switch(F.key){case"ArrowDown":F.preventDefault(),w(re=>(re+1)%x.length);break;case"ArrowUp":F.preventDefault(),w(re=>(re-1+x.length)%x.length);break;case"Enter":case"Tab":F.preventDefault(),Jn(x[C]);break;case"Escape":F.preventDefault(),Zn();break;default:break}},[y,x,C,Jn,Zn,fn]),Ka=(0,ee.useCallback)(F=>{let re=F.relatedTarget;re&&h.current?.parentElement?.contains(re)||Zn()},[Zn]),lg=(0,ee.useCallback)(()=>{M(!0),fe(null),cn(null),requestAnimationFrame(()=>Ct.current?.focus())},[]),Ko=(0,ee.useCallback)(()=>{M(!1),Fe(!1),fe(null),cn(null),U("")},[]),Ff=(0,ee.useCallback)(async()=>{if(!o||he)return;let F=$.trim();if(F){Fe(!0),fe(null),cn(null);try{let re=await o(F);cn(re)}catch(re){fe(re instanceof Error?re.message:"Synthesis failed. Try again.")}finally{Fe(!1)}}},[o,he,$]),ag=(0,ee.useCallback)(()=>{Qe&&(e(Qe.value),Ko(),requestAnimationFrame(()=>d.current?.focus()))},[Qe,e,Ko]);(0,ee.useEffect)(()=>()=>{O.current&&clearTimeout(O.current)},[]);let cg=n??(r==="binary"?"binary selector, e.g. parent":r==="unary"?"unary selector, e.g. Node":"selector expression"),ug=l&&l.length>0?p:void 0,fg=po(y&&x.length>0,d,{align:"stretch",estimatedHeight:224});return(0,ce.jsxs)("div",{className:`spytial-ed-selector${Ve?` spytial-ed-selector--${Ve}`:""}${c?` ${c}`:""}`,children:[(0,ce.jsxs)("div",{className:`spytial-ed-selector-input-wrap${o?" spytial-ed-selector-input-wrap--with-synth":""}`,children:[a?(0,ce.jsx)("pre",{ref:h,className:"spytial-ed-selector-mirror","aria-hidden":"true",children:(0,ce.jsx)(lE,{value:t})}):null,(0,ce.jsx)("textarea",{ref:d,className:`spytial-ed-selector-textarea${a?"":" spytial-ed-selector-textarea--plain"}`,value:t,onChange:jo,onScroll:bt,onKeyDown:Yo,onBlur:Ka,placeholder:cg,disabled:i,rows:1,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off",wrap:"soft",role:"combobox","aria-expanded":y,"aria-controls":g,"aria-autocomplete":"list","aria-activedescendant":y&&x.length>0?b(C):void 0,"aria-label":u,"aria-labelledby":f,"aria-describedby":ug,"aria-invalid":Ve==="error"||void 0}),o?(0,ce.jsx)("button",{type:"button",className:"spytial-ed-selector-synth-btn",onClick:lg,disabled:i,"aria-label":"Generate selector from a description","aria-haspopup":"dialog","aria-expanded":I,title:"Generate selector from a description",children:(0,ce.jsx)("span",{"aria-hidden":"true",children:"\u2728"})}):null,y&&x.length>0?(0,ce.jsx)("ul",{className:"spytial-ed-autocomplete",style:fg,id:g,role:"listbox","aria-label":"Selector completions",children:x.map((F,re)=>(0,ce.jsxs)("li",{id:b(re),role:"option","aria-selected":re===C,className:`spytial-ed-autocomplete-item${re===C?" spytial-ed-autocomplete-item--active":""}`,onMouseDown:Wi=>{Wi.preventDefault(),Jn(F)},onMouseEnter:()=>w(re),children:[(0,ce.jsx)("span",{className:`spytial-ed-autocomplete-kind spytial-ed-kind-${F.kind}`,"aria-hidden":"true"}),(0,ce.jsx)("span",{className:"spytial-ed-autocomplete-label",children:F.label}),F.detail?(0,ce.jsx)("span",{className:"spytial-ed-autocomplete-detail",children:F.detail}):null]},`${F.label}-${re}`))}):null]}),I?(0,ce.jsxs)("div",{className:"spytial-ed-synth-popover",role:"dialog","aria-label":"Generate selector",children:[(0,ce.jsxs)("div",{className:"spytial-ed-synth-row",children:[(0,ce.jsx)("input",{ref:Ct,type:"text",className:"spytial-ed-synth-input",value:$,placeholder:"Describe the selector you want\u2026",disabled:he,"aria-label":"Selector description",onChange:F=>U(F.target.value),onKeyDown:F=>{F.key==="Enter"?(F.preventDefault(),Ff()):F.key==="Escape"&&(F.preventDefault(),Ko())}}),(0,ce.jsx)("button",{type:"button",className:"spytial-ed-synth-generate",onClick:()=>{Ff()},disabled:he||$.trim().length===0,children:he?"Generating\u2026":"Generate"})]}),ft?(0,ce.jsx)("div",{className:"spytial-ed-synth-error",role:"alert",children:ft}):null,Qe?(0,ce.jsxs)("div",{className:"spytial-ed-synth-result",children:[(0,ce.jsx)("pre",{className:"spytial-ed-synth-preview","aria-label":"Proposed selector",children:(0,ce.jsx)(lE,{value:Qe.value})}),Qe.explanation?(0,ce.jsx)("p",{className:"spytial-ed-synth-explanation",children:Qe.explanation}):null,(0,ce.jsxs)("div",{className:"spytial-ed-synth-actions",children:[(0,ce.jsx)("button",{type:"button",className:"spytial-ed-synth-accept",onClick:ag,children:"Accept"}),(0,ce.jsx)("button",{type:"button",className:"spytial-ed-synth-dismiss",onClick:Ko,children:"Dismiss"})]})]}):null]}):null,l&&l.length>0?(0,ce.jsx)("ul",{className:"spytial-ed-diagnostics",id:p,children:l.map((F,re)=>(0,ce.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${F.severity}`,children:[(0,ce.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,ce.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:F.message})]},re))}):null]})};var hE=X(Et());var sn=X(Et());var u1={person:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z"/></svg>')}`,"person-fill":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/></svg>')}`,people:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M15 14s1 0 1-1-1-4-5-4-5 3-5 4 1 1 1 1zm-7.978-1L7 12.996c.001-.264.167-1.03.76-1.72C8.312 10.629 9.282 10 11 10c1.717 0 2.687.63 3.24 1.276.593.69.758 1.457.76 1.72l-.008.002-.014.002zM11 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4m3-2a3 3 0 1 1-6 0 3 3 0 0 1 6 0M6.936 9.28a6 6 0 0 0-1.23-.247A7 7 0 0 0 5 9c-4 0-5 3-5 4q0 1 1 1h4.216A2.24 2.24 0 0 1 5 13c0-1.01.377-2.042 1.09-2.904.243-.294.526-.569.846-.816M4.92 10A5.5 5.5 0 0 0 4 13H1c0-.26.164-1.03.76-1.724.545-.636 1.492-1.256 3.16-1.275ZM1.5 5.5a3 3 0 1 1 6 0 3 3 0 0 1-6 0m3-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4"/></svg>')}`,home:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293zM13 7.207V13.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V7.207l5-5z"/></svg>')}`,house:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293zM13 7.207V13.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V7.207l5-5z"/></svg>')}`,building:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M4 2.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm3 0a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm3.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM4 5.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zM7.5 5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm2.5.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zM4.5 8a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm2.5.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm3.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5z"/><path d="M2 1a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1zm11 0H3v14h3v-2.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5V15h3z"/></svg>')}`,star:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M2.866 14.85c-.078.444.36.791.746.593l4.39-2.256 4.389 2.256c.386.198.824-.149.746-.592l-.83-4.73 3.522-3.356c.33-.314.16-.888-.282-.95l-4.898-.696L8.465.792a.513.513 0 0 0-.927 0L5.354 5.12l-4.898.696c-.441.062-.612.636-.283.95l3.523 3.356-.83 4.73zm4.905-2.767-3.686 1.894.694-3.957a.56.56 0 0 0-.163-.505L1.71 6.745l4.052-.576a.53.53 0 0 0 .393-.288L8 2.223l1.847 3.658a.53.53 0 0 0 .393.288l4.052.575-2.906 2.77a.56.56 0 0 0-.163.506l.694 3.957-3.686-1.894a.5.5 0 0 0-.461 0z"/></svg>')}`,"star-fill":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/></svg>')}`,heart:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143q.09.083.176.171a3 3 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15"/></svg>')}`,"heart-fill":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314"/></svg>')}`,circle:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><circle cx="8" cy="8" r="8"/></svg>')}`,square:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><rect width="16" height="16"/></svg>')}`,triangle:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M7.022 1.566a1.13 1.13 0 0 1 1.96 0l6.857 11.667c.457.778-.092 1.767-.98 1.767H1.144c-.889 0-1.437-.99-.98-1.767z"/></svg>')}`,"tic-x":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="2" y1="2" x2="14" y2="14"/><line x1="14" y1="2" x2="2" y2="14"/></svg>')}`,"tic-o":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><circle cx="8" cy="8" r="6"/></svg>')}`,"arrow-right":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"/></svg>')}`,"arrow-left":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8"/></svg>')}`,"arrow-up":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5"/></svg>')}`,"arrow-down":`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1"/></svg>')}`,check:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"/></svg>')}`,x:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"/></svg>')}`,plus:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/></svg>')}`,minus:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8"/></svg>')}`,warning:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M7.938 2.016A.13.13 0 0 1 8.002 2a.13.13 0 0 1 .063.016.15.15 0 0 1 .054.057l6.857 11.667c.036.06.035.124.002.183a.2.2 0 0 1-.054.06.1.1 0 0 1-.066.017H1.146a.1.1 0 0 1-.066-.017.2.2 0 0 1-.054-.06.18.18 0 0 1 .002-.183L7.884 2.073a.15.15 0 0 1 .054-.057m1.044-.45a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767z"/><path d="M7.002 12a1 1 0 1 1 2 0 1 1 0 0 1-2 0M7.1 5.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0z"/></svg>')}`,info:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/><path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/></svg>')}`,gear:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492M5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0"/><path d="M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115z"/></svg>')}`,database:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M4.318 2.687C5.234 2.271 6.536 2 8 2s2.766.27 3.682.687C12.644 3.125 13 3.627 13 4c0 .374-.356.875-1.318 1.313C10.766 5.729 9.464 6 8 6s-2.766-.27-3.682-.687C3.356 4.875 3 4.373 3 4c0-.374.356-.875 1.318-1.313M13 5.698V7c0 .374-.356.875-1.318 1.313C10.766 8.729 9.464 9 8 9s-2.766-.27-3.682-.687C3.356 7.875 3 7.373 3 7V5.698c.271.202.58.378.904.525C4.978 6.711 6.427 7 8 7s3.022-.289 4.096-.777A5 5 0 0 0 13 5.698M14 4c0-1.007-.875-1.755-1.904-2.223C11.022 1.289 9.573 1 8 1s-3.022.289-4.096.777C2.875 2.245 2 2.993 2 4v9c0 1.007.875 1.755 1.904 2.223C4.978 15.71 6.427 16 8 16s3.022-.289 4.096-.777C13.125 14.755 14 14.007 14 13zm-1 4.698V10c0 .374-.356.875-1.318 1.313C10.766 11.729 9.464 12 8 12s-2.766-.27-3.682-.687C3.356 10.875 3 10.373 3 10V8.698c.271.202.58.378.904.525C4.978 9.71 6.427 10 8 10s3.022-.289 4.096-.777A5 5 0 0 0 13 8.698m0 3V13c0 .374-.356.875-1.318 1.313C10.766 14.729 9.464 15 8 15s-2.766-.27-3.682-.687C3.356 13.875 3 13.373 3 13v-1.302c.271.202.58.378.904.525C4.978 12.71 6.427 13 8 13s3.022-.289 4.096-.777c.324-.147.633-.323.904-.525"/></svg>')}`,folder:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3H14.5A1.5 1.5 0 0 1 16 4.5v1.384l-.195-.131a1 1 0 0 0-.163-.084l-.022-.01-.053-.021A.5.5 0 0 0 15.5 5H.5a.5.5 0 0 0-.5.5v.01c.053-.01.108-.017.164-.022L.162 5.5zm-.11 2.13H15.57a.5.5 0 0 1 .49.6l-1.037 5.184A1.5 1.5 0 0 1 13.549 13H2.451a1.5 1.5 0 0 1-1.474-1.22L-.06 6.6a.5.5 0 0 1 .49-.6"/></svg>')}`,file:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm0 1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1"/></svg>')}`,tree:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8.416.223a.5.5 0 0 0-.832 0l-3 4.5A.5.5 0 0 0 5 5.5h.098L3.076 8.735A.5.5 0 0 0 3.5 9.5h.191l-1.638 3.276a.5.5 0 0 0 .447.724H7V16h2v-2.5h4.5a.5.5 0 0 0 .447-.724L12.31 9.5h.191a.5.5 0 0 0 .424-.765L10.902 5.5H11a.5.5 0 0 0 .416-.777z"/></svg>')}`,flower:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 1a4 4 0 0 0-4 4v.2A4.5 4.5 0 0 0 5.52 14h4.96A4.5 4.5 0 0 0 12 5.2V5a4 4 0 0 0-4-4"/></svg>')}`,car:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M2.52 3.515A2.5 2.5 0 0 1 4.82 2h6.36a2.5 2.5 0 0 1 2.3 1.515l1.34 3.147a.5.5 0 0 1-.068.51A.5.5 0 0 1 14.5 7H14v3a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-.5H5V10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7h-.5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .034-.18zM4 8.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1m8 0a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1M4.82 3a1.5 1.5 0 0 0-1.38.91L2.46 6h11.08l-.98-2.09A1.5 1.5 0 0 0 11.18 3z"/></svg>')}`,envelope:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1zm13 2.383-4.708 2.825L15 11.105zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741M1 11.105l4.708-2.897L1 5.383z"/></svg>')}`,phone:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M3.654 1.328a.678.678 0 0 0-1.015-.063L1.605 2.3c-.483.484-.661 1.169-.45 1.77a17.6 17.6 0 0 0 4.168 6.608 17.6 17.6 0 0 0 6.608 4.168c.601.211 1.286.033 1.77-.45l1.034-1.034a.678.678 0 0 0-.063-1.015l-2.307-1.794a.68.68 0 0 0-.58-.122l-2.19.547a1.75 1.75 0 0 1-1.657-.459L5.482 8.062a1.75 1.75 0 0 1-.46-1.657l.548-2.19a.68.68 0 0 0-.122-.58zM1.884.511a1.745 1.745 0 0 1 2.612.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.68.68 0 0 0 .178.643l2.457 2.457a.68.68 0 0 0 .644.178l2.189-.547a1.75 1.75 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.6 18.6 0 0 1-7.01-4.42 18.6 18.6 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877z"/></svg>')}`,flag:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M14.778.085A.5.5 0 0 1 15 .5V8a.5.5 0 0 1-.314.464L14.5 8l.186.464-.003.001-.006.003-.023.009a12 12 0 0 1-.397.15c-.264.095-.631.223-1.047.35-.816.252-1.879.523-2.71.523-.847 0-1.548-.28-2.158-.525l-.028-.01C7.68 8.71 7.14 8.5 6.5 8.5c-.7 0-1.638.23-2.437.477A20 20 0 0 0 3 9.342V15.5a.5.5 0 0 1-1 0V.5a.5.5 0 0 1 1 0v.282c.226-.079.496-.17.79-.26C4.606.272 5.67 0 6.5 0c.84 0 1.524.277 2.121.519l.043.018C9.286.788 9.828 1 10.5 1c.7 0 1.638-.23 2.437-.477a20 20 0 0 0 1.349-.476l.019-.007.004-.002h.001"/></svg>')}`,lock:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M8 1a2 2 0 0 1 2 2v4H6V3a2 2 0 0 1 2-2m3 6V3a3 3 0 0 0-6 0v4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2M5 8h6a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1"/></svg>')}`,key:`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor"><path d="M0 8a4 4 0 0 1 7.465-2H14a.5.5 0 0 1 .354.146l1.5 1.5a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0L13 9.207l-.646.647a.5.5 0 0 1-.708 0L11 9.207l-.646.647a.5.5 0 0 1-.708 0L9 9.207l-.646.647A.5.5 0 0 1 8 10h-.535A4 4 0 0 1 0 8m4-3a3 3 0 1 0 2.712 4.285A.5.5 0 0 1 7.163 9h.63l.853-.854a.5.5 0 0 1 .708 0l.646.647.646-.647a.5.5 0 0 1 .708 0l.646.647.646-.647a.5.5 0 0 1 .708 0l.646.647.793-.793-1-1h-6.63a.5.5 0 0 1-.451-.285A3 3 0 0 0 4 5m-1.5 3a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0"/></svg>')}`},_H=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1.5" y="2.5" width="13" height="11" rx="1.5"/><line x1="2" y1="13" x2="14" y2="3" stroke-dasharray="2 1.5"/></svg>')}`,BH={bi:t=>`https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/icons/${t}.svg`,fa:t=>`https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/svgs/solid/${t}.svg`,"fa-solid":t=>`https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/svgs/solid/${t}.svg`,"fa-regular":t=>`https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/svgs/regular/${t}.svg`,"fa-brands":t=>`https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/svgs/brands/${t}.svg`,lucide:t=>`https://cdn.jsdelivr.net/npm/lucide-static@0.300.0/icons/${t}.svg`,heroicons:t=>`https://cdn.jsdelivr.net/npm/heroicons@2.1.1/24/outline/${t}.svg`,"heroicons-solid":t=>`https://cdn.jsdelivr.net/npm/heroicons@2.1.1/24/solid/${t}.svg`,tabler:t=>`https://cdn.jsdelivr.net/npm/@tabler/icons@2.44.0/icons/${t}.svg`,simple:t=>`https://cdn.jsdelivr.net/npm/simple-icons@10.4.0/icons/${t}.svg`};function aE(){return Object.keys(u1)}var qH={bi:"Bootstrap Icons",fa:"FontAwesome (solid)","fa-solid":"FontAwesome (solid)","fa-regular":"FontAwesome (regular)","fa-brands":"FontAwesome (brands)",lucide:"Lucide",heroicons:"Heroicons (outline)","heroicons-solid":"Heroicons (solid)",tabler:"Tabler Icons",simple:"Simple Icons (brands)"};function cE(){return Object.keys(BH).map(t=>({prefix:t,label:qH[t]??t,example:`${t}:${t.startsWith("fa")||t==="bi"?"person":"home"}`}))}var uE="data:image/svg+xml,";function f1(t){let e=u1[t];if(e)return decodeURIComponent(e.slice(uE.length))}var ide=new Map([...Object.values(u1),_H].map(t=>[t,decodeURIComponent(t.slice(uE.length))]));var Le=X(Ce()),fE=({name:t,className:e})=>{let n=f1(t);return n?(0,Le.jsx)("span",{className:e,"aria-hidden":"true",dangerouslySetInnerHTML:{__html:n}}):null},dE=({value:t,onChange:e,placeholder:n,disabled:i,id:r,"aria-describedby":s,"aria-invalid":o})=>{let[l,a]=(0,sn.useState)(!1),[c,u]=(0,sn.useState)(""),f=(0,sn.useRef)(null),d=(0,sn.useRef)(null),h=(0,sn.useId)(),m=po(l,d,{align:"end",estimatedHeight:340}),g=(0,sn.useMemo)(()=>aE(),[]),b=(0,sn.useMemo)(()=>cE(),[]),p=(0,sn.useMemo)(()=>{let x=c.trim().toLowerCase();return x?g.filter(k=>k.includes(x)):g},[g,c]);(0,sn.useEffect)(()=>{if(!l)return;let x=k=>{f.current&&!f.current.contains(k.target)&&a(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[l]);let y=x=>{e(x),a(!1)},v=!!t&&!!f1(t);return(0,Le.jsxs)("div",{className:"spytial-ed-icon",ref:f,children:[(0,Le.jsxs)("div",{className:"spytial-ed-icon-row",children:[v?(0,Le.jsx)(fE,{name:t,className:"spytial-ed-icon-preview"}):null,(0,Le.jsx)("input",{id:r,type:"text",className:"spytial-ed-input",value:t,placeholder:n,disabled:i,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","aria-describedby":s,"aria-invalid":o||void 0,onChange:x=>e(x.target.value)}),(0,Le.jsx)("button",{ref:d,type:"button",className:"spytial-ed-icon-btn","aria-haspopup":"dialog","aria-expanded":l,"aria-controls":l?h:void 0,"aria-label":"Browse built-in icons",title:"Browse built-in icons",disabled:i,onClick:()=>a(x=>!x),children:(0,Le.jsx)("span",{"aria-hidden":"true",children:"\u2606"})})]}),l?(0,Le.jsxs)("div",{id:h,className:"spytial-ed-icon-pop",style:m,role:"dialog","aria-label":"Built-in icons",onKeyDown:x=>{x.key==="Escape"&&(x.stopPropagation(),a(!1),d.current?.focus())},children:[(0,Le.jsx)("input",{type:"text",className:"spytial-ed-input spytial-ed-icon-search",placeholder:`Filter ${g.length} bundled icons\u2026`,value:c,spellCheck:!1,"aria-label":"Filter bundled icons",onChange:x=>u(x.target.value)}),(0,Le.jsx)("p",{className:"spytial-ed-icon-note",children:"Bundled icons need no network. You can also type any image URL or path."}),p.length>0?(0,Le.jsx)("div",{className:"spytial-ed-icon-grid",role:"listbox","aria-label":"Bundled icons",children:p.map(x=>(0,Le.jsxs)("button",{type:"button",role:"option","aria-selected":t===x,className:`spytial-ed-icon-cell${t===x?" spytial-ed-icon-cell--active":""}`,title:x,onClick:()=>y(x),children:[(0,Le.jsx)(fE,{name:x,className:"spytial-ed-icon-cell-glyph"}),(0,Le.jsx)("span",{className:"spytial-ed-icon-cell-name",children:x})]},x))}):(0,Le.jsxs)("p",{className:"spytial-ed-icon-empty",children:["No bundled icon matches \u201C",c.trim(),"\u201D. Try an icon pack below, or paste a URL."]}),(0,Le.jsxs)("div",{className:"spytial-ed-icon-packs",children:[(0,Le.jsxs)("p",{className:"spytial-ed-icon-note",children:["Icon packs \u2014 write ",(0,Le.jsx)("code",{children:"prefix:name"}),". These load from a CDN at render time, so they need a connection and aren\u2019t previewed here."]}),(0,Le.jsx)("ul",{children:b.map(x=>(0,Le.jsxs)("li",{children:[(0,Le.jsxs)("code",{children:[x.prefix,":"]})," ",x.label," ",(0,Le.jsxs)("span",{className:"spytial-ed-icon-pack-eg",children:["e.g. ",(0,Le.jsx)("code",{children:x.example})]})]},x.prefix))})]})]}):null]})};var te=X(Ce());function mo(t){return t==null?"":String(t)}function PH(t){return Array.isArray(t)?t.map(e=>String(e)):t==null||t===""?[]:[String(t)]}function zH(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var HH=(t,e)=>(t??[]).filter(n=>n.fieldKey===e),UH=t=>{if(t.length!==0)return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"},FH=({diagnostics:t,id:e})=>t.length>0?(0,te.jsx)("ul",{className:"spytial-ed-diagnostics",id:e,children:t.map((n,i)=>(0,te.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${n.severity}`,children:[(0,te.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,te.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:n.message})]},i))}):null,fp=({fields:t,values:e,onChange:n,diagnostics:i,options:r,selectorProps:s,disabled:o=!1,className:l})=>{let a=(0,hE.useId)();return(0,te.jsx)("div",{className:`spytial-ed-fields${l?` ${l}`:""}`,children:t.map(c=>{if(c.kind==="group")return(0,te.jsx)($H,{field:c,value:e[c.key],onChange:n,options:r,selectorProps:s,diagnostics:i,disabled:o},c.key);let u=`${a}-${c.key}`,f=`${u}-label`,d=`${u}-diag`,h=HH(i,c.key),m=UH(h),g=e[c.key];return(0,te.jsxs)("div",{className:`spytial-ed-field spytial-ed-field--${c.kind}${m?` spytial-ed-field--${m}`:""}`,children:[(0,te.jsxs)("label",{id:f,htmlFor:c.kind==="selector"?void 0:u,className:"spytial-ed-field-label",title:c.help,children:[c.label,c.required?(0,te.jsxs)("span",{className:"spytial-ed-field-required","aria-hidden":"true",title:"required",children:[" ","*"]}):null]}),(0,te.jsxs)("div",{className:"spytial-ed-field-control",children:[VH(c,g,{fieldId:u,labelId:f,diagId:d,hasDiagnostics:h.length>0,disabled:o,onChange:n,options:r,selectorProps:s,diagnostics:h}),c.kind==="selector"?null:(0,te.jsx)(FH,{diagnostics:h,id:d})]})]},c.key)})})};function $H({field:t,value:e,onChange:n,options:i,selectorProps:r,diagnostics:s,disabled:o}){let l=zH(e)?e:void 0,a=!t.required;if(l===void 0)return(0,te.jsxs)("button",{type:"button",className:"spytial-ed-group-add",onClick:()=>n(t.key,{}),disabled:o,title:t.help,children:["+ ",t.label]});let c=(u,f)=>{let d={...l};f===void 0||f===""||Array.isArray(f)&&f.length===0?delete d[u]:d[u]=f,n(t.key,d)};return(0,te.jsxs)("fieldset",{className:"spytial-ed-group",children:[(0,te.jsxs)("legend",{className:"spytial-ed-group-legend",children:[(0,te.jsx)("span",{children:t.label}),a?(0,te.jsx)("button",{type:"button",className:"spytial-ed-group-remove",onClick:()=>n(t.key,void 0),disabled:o,"aria-label":`Remove ${t.label}`,title:`Remove ${t.label}`,children:"\xD7"}):null]}),(0,te.jsx)(fp,{fields:t.children??[],values:l,onChange:c,options:i,selectorProps:r,diagnostics:s,disabled:o})]})}function VH(t,e,n){let{fieldId:i,labelId:r,diagId:s,hasDiagnostics:o,disabled:l,onChange:a,options:c,selectorProps:u,diagnostics:f}=n,d=o?s:void 0;switch(t.kind){case"selector":{let h=u?.(t)??{};return(0,te.jsx)(c1,{value:mo(e),onChange:m=>a(t.key,m),placeholder:t.placeholder,disabled:l,selectorArity:t.selectorArity,"aria-labelledby":r,diagnostics:f,complete:h.complete,synthesize:h.synthesize,highlight:h.highlight})}case"relationName":case"typeName":{let h=t.kind==="relationName"?c?.relationNames:c?.typeNames,m=`${i}-list`,g=!!h&&h.length>0;return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)("input",{id:i,type:"text",className:"spytial-ed-input spytial-ed-combo",value:mo(e),placeholder:t.placeholder,disabled:l,list:g?m:void 0,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","aria-describedby":d,"aria-invalid":f.some(b=>b.severity==="error")||void 0,onChange:b=>a(t.key,b.target.value)}),g?(0,te.jsx)("datalist",{id:m,children:h.map(b=>(0,te.jsx)("option",{value:b},b))}):null]})}case"enum":{let h=t.options??[];if(t.multiple){let g=PH(e);return(0,te.jsx)("div",{className:"spytial-ed-pills",role:"group","aria-labelledby":r,"aria-describedby":d,children:h.map(b=>{let p=g.includes(b);return(0,te.jsx)("button",{type:"button",className:`spytial-ed-pill${p?" spytial-ed-pill--active":""}`,"aria-pressed":p,disabled:l,onClick:()=>{let y=p?g.filter(v=>v!==b):[...g,b];a(t.key,y)},children:b},b)})})}let m=mo(e);return(0,te.jsx)("div",{className:"spytial-ed-pills",role:"radiogroup","aria-labelledby":r,"aria-describedby":d,children:h.map(g=>{let b=m===g;return(0,te.jsx)("button",{type:"button",className:`spytial-ed-pill${b?" spytial-ed-pill--active":""}`,role:"radio","aria-checked":b,disabled:l,onClick:()=>a(t.key,g),children:g},g)})})}case"number":{let h=e,m=h==null||h===""?"":String(h);return(0,te.jsx)("input",{id:i,type:"number",className:"spytial-ed-input spytial-ed-input--number",value:m,placeholder:t.placeholder,disabled:l,"aria-describedby":d,"aria-invalid":f.some(g=>g.severity==="error")||void 0,onChange:g=>{let b=g.target.value;a(t.key,b===""?"":Number(b))}})}case"color":{let h=mo(e)||"#000000";return(0,te.jsxs)("div",{className:"spytial-ed-color",children:[(0,te.jsx)("input",{id:i,type:"color",className:"spytial-ed-color-swatch",value:jH(h),disabled:l,"aria-describedby":d,"aria-label":`${t.label} color`,onChange:m=>a(t.key,m.target.value)}),(0,te.jsx)("input",{type:"text",className:"spytial-ed-input spytial-ed-color-text",value:mo(e),placeholder:t.placeholder??"#rrggbb",disabled:l,spellCheck:!1,"aria-label":`${t.label} hex value`,onChange:m=>a(t.key,m.target.value)})]})}case"boolean":{let h=e===!0||e==="true";return(0,te.jsx)("button",{id:i,type:"button",role:"switch","aria-checked":h,"aria-describedby":d,className:`spytial-ed-switch${h?" spytial-ed-switch--on":""}`,disabled:l,onClick:()=>a(t.key,!h),children:(0,te.jsx)("span",{className:"spytial-ed-switch-thumb","aria-hidden":"true"})})}case"iconPath":return(0,te.jsx)(dE,{id:i,value:mo(e),onChange:h=>a(t.key,h),placeholder:t.placeholder,disabled:l,"aria-describedby":d,"aria-invalid":f.some(h=>h.severity==="error")});default:return(0,te.jsx)("input",{id:i,type:"text",className:"spytial-ed-input",value:mo(e),placeholder:t.placeholder,disabled:l,"aria-describedby":d,"aria-invalid":f.some(h=>h.severity==="error")||void 0,onChange:h=>a(t.key,h.target.value)})}}function jH(t){let e=t.trim();return/^#[0-9a-fA-F]{6}$/.test(e)?e:/^#[0-9a-fA-F]{3}$/.test(e)?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:"#000000"}var an=X(Et());var h1=[],yE=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?yE:h1).push(n=n+t[e])})();function YH(t){if(t<768)return!1;for(let e=0,n=h1.length;;){let i=e+n>>1;if(t<h1[i])n=i;else if(t>=yE[i])e=i+1;else return!0;if(e==n)return!1}}function pE(t){return t>=127462&&t<=127487}var mE=8205;function bE(t,e,n=!0,i=!0){return(n?vE:KH)(t,e,i)}function vE(t,e,n){if(e==t.length)return e;e&&xE(t.charCodeAt(e))&&SE(t.charCodeAt(e-1))&&e--;let i=d1(t,e);for(e+=gE(i);e<t.length;){let r=d1(t,e);if(i==mE||r==mE||n&&YH(r))e+=gE(r),i=r;else if(pE(r)){let s=0,o=e-2;for(;o>=0&&pE(d1(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function KH(t,e,n){for(;e>1;){let i=vE(t,e-2,n);if(i<e)return i;e--}return 0}function d1(t,e){let n=t.charCodeAt(e);if(!SE(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return xE(i)?(n-55296<<10)+(i-56320)+65536:n}function xE(t){return t>=56320&&t<57344}function SE(t){return t>=55296&&t<56320}function gE(t){return t<65536?1:2}var ue=class t{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,i){[e,n]=aa(this,e,n);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),sa.from(r,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=aa(this,e,n);let i=[];return this.decompose(e,n,i,0),sa.from(i,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new vo(this),s=new vo(e);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new vo(this,e)}iterRange(e,n=this.length){return new gp(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new yp(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?t.empty:e.length<=32?new wn(e):sa.from(wn.split(e,[]))}},wn=class t extends ue{constructor(e,n=GH(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=e)return new m1(r,l,i,o);r=l+1,i++}}decompose(e,n,i,r){let s=e<=0&&n>=this.length?this:new t(wE(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),l=mp(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new t(l,o.length+s.length));else{let a=l.length>>1;i.push(new t(l.slice(0,a)),new t(l.slice(a)))}}else i.push(s)}replace(e,n,i){if(!(i instanceof t))return super.replace(e,n,i);[e,n]=aa(this,e,n);let r=mp(this.text,mp(i.text,wE(this.text,0,e)),n),s=this.length+i.length-(n-e);return r.length<=32?new t(r,s):sa.from(t.split(r,[]),s)}sliceString(e,n=this.length,i=`
|
|
190
|
+
`){[e,n]=aa(this,e,n);let r="";for(let s=0,o=0;s<=n&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=i),e<a&&n>s&&(r+=l.slice(Math.max(0,e-s),n-s)),s=a+1}return r}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(n.push(new t(i,r)),i=[],r=-1);return r>-1&&n.push(new t(i,r)),n}},sa=class t extends ue{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=i+o.lines-1;if((n?a:l)>=e)return o.lineInner(e,n,i,r);r=l+1,i=a+1}}decompose(e,n,i,r){for(let s=0,o=0;o<=n&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&n>=o){let c=r&((o<=e?1:0)|(a>=n?2:0));o>=e&&a<=n&&!c?i.push(l):l.decompose(e-o,n-o,i,c)}o=a+1}}replace(e,n,i){if([e,n]=aa(this,e,n),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&n<=l){let a=o.replace(e-s,n-s,i),c=this.lines-o.lines+a.lines;if(a.lines<c>>4&&a.lines>c>>6){let u=this.children.slice();return u[r]=a,new t(u,this.length-(n-e)+i.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,n,i)}sliceString(e,n=this.length,i=`
|
|
191
|
+
`){[e,n]=aa(this,e,n);let r="";for(let s=0,o=0;s<this.children.length&&o<=n;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=i),e<a&&n>o&&(r+=l.sliceString(e-o,n-o,i)),o=a+1}return r}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof t))return 0;let i=0,[r,s,o,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==l)return i;let a=this.children[r],c=e.children[s];if(a!=c)return i+a.scanIdentical(c,n);i+=a.length+1}}static from(e,n=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let h of e)i+=h.lines;if(i<32){let h=[];for(let m of e)m.flatten(h);return new wn(h,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],a=0,c=-1,u=[];function f(h){let m;if(h.lines>s&&h instanceof t)for(let g of h.children)f(g);else h.lines>o&&(a>o||!a)?(d(),l.push(h)):h instanceof wn&&a&&(m=u[u.length-1])instanceof wn&&h.lines+m.lines<=32?(a+=h.lines,c+=h.length+1,u[u.length-1]=new wn(m.text.concat(h.text),m.length+1+h.length)):(a+h.lines>r&&d(),a+=h.lines,c+=h.length+1,u.push(h))}function d(){a!=0&&(l.push(u.length==1?u[0]:t.from(u,c)),c=-1,a=u.length=0)}for(let h of e)f(h);return d(),l.length==1?l[0]:new t(l,n)}};ue.empty=new wn([""],0);function GH(t){let e=-1;for(let n of t)e+=n.length+1;return e}function mp(t,e,n=0,i=1e9){for(let r=0,s=0,o=!0;s<t.length&&r<=i;s++){let l=t[s],a=r+l.length;a>=n&&(a>i&&(l=l.slice(0,i-r)),r<n&&(l=l.slice(n-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}function wE(t,e,n){return mp(t,[""],e,n)}var vo=class{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof wn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof wn?r.text.length:r.children.length;if(o==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
192
|
+
`,this;e--}else if(r instanceof wn){let a=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=n,a.length>Math.max(0,e))return this.value=e==0?a:n>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(n<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(n>0?1:(a instanceof wn?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},gp=class{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new vo(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},yp=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(ue.prototype[Symbol.iterator]=function(){return this.iter()},vo.prototype[Symbol.iterator]=gp.prototype[Symbol.iterator]=yp.prototype[Symbol.iterator]=function(){return this});var m1=class{constructor(e,n,i,r){this.from=e,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function aa(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function yt(t,e,n=!0,i=!0){return bE(t,e,n,i)}function QH(t){return t>=56320&&t<57344}function XH(t){return t>=55296&&t<56320}function TE(t,e){let n=t.charCodeAt(e);if(!XH(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return QH(i)?(n-55296<<10)+(i-56320)+65536:n}function EE(t){return t<65536?1:2}var g1=/\r\n?|\n/,Kt=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Kt||(Kt={})),wr=class t{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n+1];e+=i<0?this.sections[n]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,i=0,r=0;n<this.sections.length;){let s=this.sections[n++],o=this.sections[n++];o<0?(e(i,r,s),r+=s):r+=o,i+=s}}iterChangedRanges(e,n=!1){y1(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];r<0?e.push(i,r):e.push(r,i)}return new t(e)}composeDesc(e){return this.empty?e:e.empty?this:DE(this,e)}mapDesc(e,n=!1){return e.empty?this:b1(this,e,n)}mapPos(e,n=-1,i=Kt.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=r+l;if(a<0){if(c>e)return s+(e-r);s+=l}else{if(i!=Kt.Simple&&c>=e&&(i==Kt.TrackDel&&r<e&&c>e||i==Kt.TrackBefore&&r<e||i==Kt.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!l)return e==r||n<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,n=e){for(let i=0,r=0;i<this.sections.length&&r<=n;){let s=this.sections[i++],o=this.sections[i++],l=r+s;if(o>=0&&r<=n&&l>=e)return r<e&&l>n?"cover":!0;r=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new t(e)}static create(e){return new t(e)}},Gt=class t extends wr{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return y1(this,(n,i,r,s,o)=>e=e.replace(r,r+(i-n),o),!1),e}mapDesc(e,n=!1){return b1(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let r=0,s=0;r<n.length;r+=2){let o=n[r],l=n[r+1];if(l>=0){n[r]=l,n[r+1]=o;let a=r>>1;for(;i.length<a;)i.push(ue.empty);i.push(o?e.slice(s,s+o):ue.empty)}s+=o}return new t(n,i)}compose(e){return this.empty?e:e.empty?this:DE(this,e,!0)}map(e,n=!1){return e.empty?this:b1(this,e,n,!0)}iterChanges(e,n=!1){y1(this,e,n)}get desc(){return wr.create(this.sections)}filter(e){let n=[],i=[],r=[],s=new xo(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,a-l);_t(r,u,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;_t(n,u,f),f>0&&Ss(i,n,s.text),s.forward(u),l+=u}let c=e[o++];for(;l<c;){if(s.done)break e;let u=Math.min(s.len,c-l);_t(n,u,-1),_t(r,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),l+=u}}return{changes:new t(n,i),filtered:wr.create(r)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],r=this.sections[n+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,i){let r=[],s=[],o=0,l=null;function a(u=!1){if(!u&&!r.length)return;o<n&&_t(r,n-o,-1);let f=new t(r,s);l=l?l.compose(f.map(l)):f,r=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let f of u)c(f);else if(u instanceof t){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);a(),l=l?l.compose(u.map(l)):u}else{let{from:f,to:d=f,insert:h}=u;if(f>d||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let m=h?typeof h=="string"?ue.of(h.split(i||g1)):h:ue.empty,g=m.length;if(f==d&&g==0)return;f<o&&a(),f>o&&_t(r,f-o,-1),_t(r,d-f,g),Ss(s,r,m),o=d}}return c(e),a(!l),l}static empty(e){return new t(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length<r;)i.push(ue.empty);i[r]=ue.of(s.slice(1)),n.push(s[0],i[r].length)}}}return new t(n,i)}static createSet(e,n){return new t(e,n)}};function _t(t,e,n,i=!1){if(e==0&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function Ss(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(ue.empty);t.push(n)}}function y1(t,e,n){let i=t.inserted;for(let r=0,s=0,o=0;o<t.sections.length;){let l=t.sections[o++],a=t.sections[o++];if(a<0)r+=l,s+=l;else{let c=r,u=s,f=ue.empty;for(;c+=l,u+=a,a&&i&&(f=f.append(i[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(r,c,s,u,f),r=c,s=u}}}function b1(t,e,n,i=!1){let r=[],s=i?[]:null,o=new xo(t),l=new xo(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);_t(r,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!n))){let c=l.len;for(_t(r,l.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=u&&(_t(r,0,o.ins),s&&Ss(s,r,o.text),a=o.i),o.forward(u),c-=u}l.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(l.ins==-1){let f=Math.min(u,l.len);c+=f,u-=f,l.forward(f)}else if(l.ins==0&&l.len<u)u-=l.len,l.next();else break;_t(r,c,a<o.i?o.ins:0),s&&a<o.i&&Ss(s,r,o.text),a=o.i,o.forward(o.len-u)}else{if(o.done&&l.done)return s?Gt.createSet(r,s):wr.create(r);throw new Error("Mismatched change set lengths")}}}function DE(t,e,n=!1){let i=[],r=n?[]:null,s=new xo(t),o=new xo(e);for(let l=!1;;){if(s.done&&o.done)return r?Gt.createSet(i,r):wr.create(i);if(s.ins==0)_t(i,s.len,0,l),s.next();else if(o.len==0&&!o.done)_t(i,0,o.ins,l),r&&Ss(r,i,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),c=i.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;_t(i,a,u,l),r&&u&&Ss(r,i,o.text)}else o.ins==-1?(_t(i,s.off?0:s.len,a,l),r&&Ss(r,i,s.textBit(a))):(_t(i,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&Ss(r,i,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>c),s.forward2(a),o.forward(a)}}}}var xo=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?ue.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?ue.empty:n[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},go=class t{constructor(e,n,i,r){this.from=e,this.to=n,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,n=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new t(i,r,this.flags,this.goalColumn)}extend(e,n=e,i=0){if(e<=this.anchor&&n>=this.anchor)return R.range(e,n,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return R.range(this.anchor,r,void 0,void 0,i)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return R.range(e.anchor,e.head)}static create(e,n,i,r){return new t(e,n,i,r)}},R=class t{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:t.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new t([this.main],0)}addRange(e,n=!0){return t.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let i=this.ranges.slice();return i[n]=e,t.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new t(e.ranges.map(n=>go.fromJSON(n)),e.main)}static single(e,n=e){return new t([t.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return t.normalized(e.slice(),n);i=s.to}return new t(e,n)}static cursor(e,n=0,i,r){return go.create(e,e,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i)),r)}static range(e,n,i,r,s){let o=r==null?7:Math.min(6,r);return!s&&e!=n&&(s=n<e?1:-1),s&&(o|=s<0?8:16),n<e?go.create(n,e,o|32,i):go.create(e,n,o,i)}static undirectionalRange(e,n){return go.create(e,n,64,void 0)}static normalized(e,n=0){let i=e[n];e.sort((r,s)=>r.from-s.from),n=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);r<=n&&n--,e.splice(--r,2,s.anchor>s.head?t.range(a,l):t.range(l,a))}}return new t(e,n)}};function ME(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}var E1=0,_=class t{constructor(e,n,i,r,s){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=E1++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new t(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:D1),!!e.static,e.enables)}of(e){return new oa([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new oa(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new oa(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}};function D1(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}var oa=class{constructor(e,n,i,r){this.dependencies=e,this.facet=n,this.type=i,this.value=r,this.id=E1++}dynamicSlot(e){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:(((n=e[f.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,d){if(a&&d.docChanged||c&&(d.docChanged||d.selection)||v1(f,u)){let h=i(f);if(l?!kE(h,f.values[o],r):!r(h,f.values[o]))return f.values[o]=h,1}return 0},reconfigure:(f,d)=>{let h,m=d.config.address[s];if(m!=null){let g=xp(d,m);if(this.dependencies.every(b=>b instanceof _?d.facet(b)===f.facet(b):b instanceof Bt?d.field(b,!1)==f.field(b,!1):!0)||(l?kE(h=i(f),g,r):r(h=i(f),g)))return f.values[o]=g,0}else h=i(f);return f.values[o]=h,1}}}get extension(){return this}};function kE(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function v1(t,e){let n=!1;for(let i of e)Nu(t,i)&1&&(n=!0);return n}function WH(t,e,n){let i=n.map(a=>t[a.id]),r=n.map(a=>a.type),s=i.filter(a=>!(a&1)),o=t[e.id]>>1;function l(a){let c=[];for(let u=0;u<i.length;u++){let f=xp(a,i[u]);if(r[u]==2)for(let d of f)c.push(d);else c.push(f)}return e.combine(c)}return{create(a){for(let c of i)Nu(a,c);return a.values[o]=l(a),1},update(a,c){if(!v1(a,s))return 0;let u=l(a);return e.compare(u,a.values[o])?0:(a.values[o]=u,1)},reconfigure(a,c){let u=v1(a,i),f=c.config.facets[e.id],d=c.facet(e);if(f&&!u&&D1(n,f))return a.values[o]=d,0;let h=l(a);return e.compare(h,d)?(a.values[o]=d,0):(a.values[o]=h,1)}}}var dp=_.define({static:!0}),Bt=class t{constructor(e,n,i,r,s){this.id=e,this.createF=n,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let n=new t(E1++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(dp).find(i=>i.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(dp),o=r.facet(dp),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,dp.of({field:this,create:e})]}get extension(){return this}},yo={lowest:4,low:3,default:2,high:1,highest:0};function Ru(t){return e=>new bp(e,t)}var Bu={highest:Ru(yo.highest),high:Ru(yo.high),default:Ru(yo.default),low:Ru(yo.low),lowest:Ru(yo.lowest)},bp=class{constructor(e,n){this.inner=e,this.prec=n}get extension(){return this}},ca=class t{of(e){return new Lu(this,e)}reconfigure(e){return t.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},Lu=class{constructor(e,n){this.compartment=e,this.inner=n}get extension(){return this}},vp=class t{constructor(e,n,i,r,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,i){let r=[],s=Object.create(null),o=new Map;for(let d of ZH(e,n,o))d instanceof Bt?r.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let l=Object.create(null),a=[],c=[];for(let d of r)l[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=i?.config.facets;for(let d in s){let h=s[d],m=h[0].facet,g=u&&u[d]||[];if(h.every(b=>b.type==0))if(l[m.id]=a.length<<1|1,D1(g,h))a.push(i.facet(m));else{let b=m.combine(h.map(p=>p.value));a.push(i&&m.compare(b,i.facet(m))?i.facet(m):b)}else{for(let b of h)b.type==0?(l[b.id]=a.length<<1|1,a.push(b.value)):(l[b.id]=c.length<<1,c.push(p=>b.dynamicSlot(p)));l[m.id]=c.length<<1,c.push(b=>WH(b,m,h))}}let f=c.map(d=>d(l));return new t(e,o,f,l,a,s)}};function ZH(t,e,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof Lu&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let c of o)s(c,l);else if(o instanceof Lu){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;n.set(o.compartment,c),s(c,l)}else if(o instanceof bp)s(o.inner,o.prec);else if(o instanceof Bt)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof oa)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,yo.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(c==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,l)}}return s(t,yo.default),i.reduce((o,l)=>o.concat(l))}function Nu(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function xp(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}var RE=_.define(),x1=_.define({combine:t=>t.some(e=>e),static:!0}),NE=_.define({combine:t=>t.length?t[0]:void 0,static:!0}),LE=_.define(),IE=_.define(),_E=_.define(),BE=_.define({combine:t=>t.length?t[0]:!1}),Un=class{constructor(e,n){this.type=e,this.value=n}static define(){return new S1}},S1=class{of(e){return new Un(this,e)}},w1=class{constructor(e){this.map=e}of(e){return new pe(this,e)}},pe=class t{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new t(this.type,n)}is(e){return this.type==e}static define(e={}){return new w1(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(n);s&&i.push(s)}return i}};pe.reconfigure=pe.define();pe.appendConfig=pe.define();var gt=class t{constructor(e,n,i,r,s,o){this.startState=e,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&ME(i,n.newLength),s.some(l=>l.type==t.time)||(this.annotations=s.concat(t.time.of(Date.now())))}static create(e,n,i,r,s,o){return new t(e,n,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(t.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}};gt.time=Un.define();gt.userEvent=Un.define();gt.addToHistory=Un.define();gt.remote=Un.define();function JH(t,e){let n=[];for(let i=0,r=0;;){let s,o;if(i<t.length&&(r==e.length||e[r]>=t[i]))s=t[i++],o=t[i++];else if(r<e.length)s=e[r++],o=e[r++];else return n;!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function qE(t,e,n){var i;let r,s,o;return n?(r=e.changes,s=Gt.empty(e.changes.length),o=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(i=t.selection)===null||i===void 0?void 0:i.map(r),effects:pe.mapEffects(t.effects,r).concat(pe.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function k1(t,e,n){let i=e.selection,r=la(e.annotations);return e.userEvent&&(r=r.concat(gt.userEvent.of(e.userEvent))),{changes:e.changes instanceof Gt?e.changes:Gt.of(e.changes||[],n,t.facet(NE)),selection:i&&(i instanceof R?i:R.single(i.anchor,i.head)),effects:la(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function PE(t,e,n){let i=k1(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let o=!!e[s].sequential;i=qE(i,k1(t,e[s],o?i.changes.newLength:t.doc.length),o)}let r=gt.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return tU(n?eU(r):r)}function eU(t){let e=t.startState,n=!0;for(let r of e.facet(LE)){let s=r(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:JH(n,s))}if(n!==!0){let r,s;if(n===!1)s=t.changes.invertedDesc,r=Gt.empty(e.doc.length);else{let o=t.changes.filter(n);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=gt.create(e,r,t.selection&&t.selection.map(s),pe.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(IE);for(let r=i.length-1;r>=0;r--){let s=i[r](t);s instanceof gt?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof gt?t=s[0]:t=PE(e,la(s),!1)}return t}function tU(t){let e=t.startState,n=e.facet(_E),i=t;for(let r=n.length-1;r>=0;r--){let s=n[r](t);s&&Object.keys(s).length&&(i=qE(i,k1(e,s,t.changes.newLength),!0))}return i==t?t:gt.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}var nU=[];function la(t){return t==null?nU:Array.isArray(t)?t:[t]}var fi=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(fi||(fi={})),iU=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,A1;try{A1=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function rU(t){if(A1)return A1.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||iU.test(n)))return!0}return!1}function sU(t){return e=>{if(!/\S/.test(e))return fi.Space;if(rU(e))return fi.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return fi.Word;return fi.Other}}var De=class t{constructor(e,n,i,r,s,o){this.config=e,this.doc=n,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Nu(this,l<<1);this.computeSlot=null}field(e,n=!0){let i=this.config.address[e.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return Nu(this,i),xp(this,i)}update(...e){return PE(this,e,!0)}applyTransaction(e){let n=this.config,{base:i,compartments:r}=n;for(let l of e.effects)l.is(ca.reconfigure)?(n&&(r=new Map,n.compartments.forEach((a,c)=>r.set(c,a)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(pe.reconfigure)?(n=null,i=l.value):l.is(pe.appendConfig)&&(n=null,i=la(i).concat(l.value));let s;n?s=e.startState.values.slice():(n=vp.resolve(i,r,this),s=new t(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(x1)?e.newSelection:e.newSelection.asSingle();new t(n,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:R.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=la(i.effects);for(let l=1;l<n.ranges.length;l++){let a=e(n.ranges[l]),c=this.changes(a.changes),u=c.map(r);for(let d=0;d<l;d++)s[d]=s[d].map(u);let f=r.mapDesc(c,!0);s.push(a.range.map(f)),r=r.compose(u),o=pe.mapEffects(o,u).concat(pe.mapEffects(la(a.effects),f))}return{changes:r,selection:R.create(s,n.mainIndex),effects:o}}changes(e=[]){return e instanceof Gt?e:Gt.of(e,this.doc.length,this.facet(t.lineSeparator))}toText(e){return ue.of(e.split(this.facet(t.lineSeparator)||g1))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Nu(this,n),xp(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof Bt&&this.config.address[r.id]!=null&&(n[i]=r.spec.toJSON(this.field(e[i]),this))}return n}static fromJSON(e,n={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let o=i[s],l=e[s];r.push(o.init(a=>o.spec.fromJSON(l,a)))}}return t.create({doc:e.doc,selection:R.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=vp.resolve(e.extensions||[],new Map),i=e.doc instanceof ue?e.doc:ue.of((e.doc||"").split(n.staticFacet(t.lineSeparator)||g1)),r=e.selection?e.selection instanceof R?e.selection:R.single(e.selection.anchor,e.selection.head):R.single(0);return ME(r,i.length),n.staticFacet(x1)||(r=r.asSingle()),new t(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(t.tabSize)}get lineBreak(){return this.facet(t.lineSeparator)||`
|
|
193
|
+
`}get readOnly(){return this.facet(BE)}phrase(e,...n){for(let i of this.facet(t.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),e}languageDataAt(e,n,i=-1){let r=[];for(let s of this.facet(RE))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return sU(n.length?n[0]:"")}wordAt(e){let{text:n,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=yt(n,o,!1);if(s(n.slice(a,o))!=fi.Word)break;o=a}for(;l<r;){let a=yt(n,l);if(s(n.slice(l,a))!=fi.Word)break;l=a}return o==l?null:R.range(o+i,l+i)}};De.allowMultipleSelections=x1;De.tabSize=_.define({combine:t=>t.length?t[0]:4});De.lineSeparator=NE;De.readOnly=BE;De.phrases=_.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(r=>t[r]==e[r])}});De.languageData=RE;De.changeFilter=LE;De.transactionFilter=IE;De.transactionExtender=_E;ca.reconfigure=pe.define();function ws(t,e,n={}){let i={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}var Hi=class{eq(e){return this==e}range(e,n=e){return Iu.create(e,n,this)}};Hi.prototype.startSide=Hi.prototype.endSide=0;Hi.prototype.point=!1;Hi.prototype.mapMode=Kt.TrackDel;function M1(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}var Iu=class t{constructor(e,n,i){this.from=e,this.to=n,this.value=i}static create(e,n,i){return new t(e,n,i)}};function C1(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}var O1=class t{constructor(e,n,i,r){this.from=e,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-n;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let i=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],u=this.from[a]+e,f=this.to[a]+e,d,h;if(u==f){let m=n.mapPos(u,c.startSide,c.mapMode);if(m==null||(d=h=m,c.startSide!=c.endSide&&(h=n.mapPos(u,c.endSide),h<d)))continue}else if(d=n.mapPos(u,c.startSide),h=n.mapPos(f,c.endSide),d>h||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(l=Math.max(l,h-d)),i.push(c),r.push(d-o),s.push(h-o))}return{mapped:i.length?new t(r,s,i,l):null,pos:o}}},me=class t{constructor(e,n,i,r){this.chunkPos=e,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(e,n,i,r){return new t(e,n,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(C1)),this.isEmpty)return n.length?t.of(n):this;let l=new Sp(this,null,-1).goto(0),a=0,c=[],u=new kr;for(;l.value||a<n.length;)if(a<n.length&&(l.from-n[a].from||l.startSide-n[a].value.startSide)>=0){let f=n[a++];u.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==n.length||this.chunkEnd(l.chunkIndex)<n[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&u.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(u.addInner(l.from,l.to,l.value)||c.push(Iu.create(l.from,l.to,l.value))),l.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?t.empty:this.nextLayer.update({add:c,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],i=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)r=Math.max(r,a.maxPoint),n.push(a),i.push(e.mapPos(l));else if(c===!0){let{mapped:u,pos:f}=a.map(l,e);u&&(r=Math.max(r,u.maxPoint),n.push(u),i.push(f))}}let s=this.nextLayer.map(e);return n.length==0?s:new t(i,n,s||t.empty,r)}between(e,n,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(n>=s&&e<=s+o.length&&o.between(s,e-s,n-s,i)===!1)return}this.nextLayer.between(e,n,i)}}iter(e=0){return _u.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return _u.from(e).goto(n)}static compare(e,n,i,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=AE(o,l,i),c=new bo(o,a,s),u=new bo(l,a,s);i.iterGaps((f,d,h)=>CE(c,f,u,d,h,r)),i.empty&&i.length==0&&CE(c,0,u,0,0,r)}static eq(e,n,i=0,r){r==null&&(r=999999999);let s=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),o=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=AE(s,o),a=new bo(s,l,0).goto(i),c=new bo(o,l,0).goto(i);for(;;){if(a.to!=c.to||!T1(a.active,c.active)||a.point&&(!c.point||!M1(a.point,c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,n,i,r,s=-1){let o=new bo(e,null,s).goto(n),l=n,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let u=o.activeForPoint(o.to),f=o.pointFrom<n?u.length+1:o.point.startSide<0?u.length:Math.min(u.length,a);r.point(l,c,o.point,u,f,o.pointRank),a=Math.min(o.openEnd(c),u.length)}else c>l&&(r.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,n=!1){let i=new kr;for(let r of e instanceof Iu?[e]:n?oU(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return t.empty;let n=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=t.empty;r=r.nextLayer)n=new t(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}};me.empty=new me([],[],null,-1);function oU(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(C1(e,i)>0)return t.slice().sort(C1);e=i}return t}me.empty.nextLayer=me.empty;var kr=class t{finishChunk(e){this.chunks.push(new O1(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,i){this.addInner(e,n,i)||(this.nextLayer||(this.nextLayer=new t)).add(e,n,i)}addInner(e,n,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=n,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+e,this.lastTo=n.to[i]+e,!0}finish(){return this.finishInner(me.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=me.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}};function AE(t,e,n){let i=new Map;for(let s of t)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&i.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=i.get(s.chunk[o]);l!=null&&(n?n.mapPos(l):l)==s.chunkPos[o]&&!n?.touchesRange(l,l+s.chunk[o].length)&&r.add(s.chunk[o])}return r}var Sp=class{constructor(e,n,i,r=0){this.layer=e,this.skip=n,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],i=e+n.from[this.rangeIndex];if(this.from=i,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},_u=class t{constructor(e){this.heap=e}static from(e,n=null,i=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&r.push(new Sp(o,n,i,s));return r.length==1?r[0]:new t(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let i of this.heap)i.goto(e,n);for(let i=this.heap.length>>1;i>=0;i--)p1(this.heap,i);return this.next(),this}forward(e,n){for(let i of this.heap)i.forward(e,n);for(let i=this.heap.length>>1;i>=0;i--)p1(this.heap,i);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),p1(this.heap,0)}}};function p1(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let r=t[i];if(i+1<t.length&&r.compare(t[i+1])>=0&&(r=t[i+1],i++),n.compare(r)<0)break;t[i]=n,t[e]=r,e=i}}var bo=class{constructor(e,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=_u.from(e,n,i)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){hp(this.active,e),hp(this.activeTo,e),hp(this.activeRank,e),this.minActive=OE(this.active,this.activeTo)}addActive(e){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||r-this.activeTo[n])>0;)n++;pp(this.active,n,i),pp(this.activeTo,n,r),pp(this.activeRank,n,s),e&&pp(e,n,this.cursor.from),this.minActive=OE(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&hp(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(e){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)n++;return n}};function CE(t,e,n,i,r,s){t.goto(e),n.goto(i);let o=i+r,l=i,a=i-e,c=!!s.boundChange;for(let u=!1;;){let f=t.to+a-n.to,d=f||t.endSide-n.endSide,h=d<0?t.to+a:n.to,m=Math.min(h,o);if(t.point||n.point?(t.point&&n.point&&M1(t.point,n.point)&&T1(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,m,t.point,n.point),u=!1):(u&&s.boundChange(l),m>l&&!T1(t.active,n.active)&&s.compareRange(l,m,t.active,n.active),c&&m<o&&(f||t.openEnd(h)!=n.openEnd(h))&&(u=!0)),h>o)break;l=h,d<=0&&t.next(),d>=0&&n.next()}}function T1(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!M1(t[n],e[n]))return!1;return!0}function hp(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function pp(t,e,n){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=n}function OE(t,e){let n=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||t[r].endSide-t[n].endSide)<0&&(n=r,i=e[r]);return n}function So(t,e,n=t.length){let i=0;for(let r=0;r<n&&r<t.length;)t.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=yt(t,r));return i}function zE(t,e,n,i){for(let r=0,s=0;;){if(s>=e)return r;if(r==t.length)break;s+=t.charCodeAt(r)==9?n-s%n:1,r=yt(t,r)}return i===!0?-1:t.length}var HE=typeof Symbol>"u"?"__\u037C":Symbol.for("\u037C"),R1=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),UE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Fn=class{constructor(e,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,c){let u=[],f=/^@(\w+)\b/.exec(o[0]),d=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let h in l){let m=l[h];if(/&/.test(h))s(h.split(/,\s*/).map(g=>o.map(b=>g.replace(/&/,b))).reduce((g,b)=>g.concat(b)),m,a);else if(m&&typeof m=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");s(r(h),m,u,d)}else m!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+m+";")}(u.length||d)&&a.push((i&&!f&&!c?o.map(i):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
194
194
|
`)}static newName(){let e=UE[HE]||1;return UE[HE]=e+1,"\u037C"+e.toString(36)}static mount(e,n,i){let r=e[R1],s=i&&i.nonce;r?s&&r.setNonce(s):r=new N1(e,s),r.mount(Array.isArray(n)?n:[n],e)}},FE=new Map,N1=class{constructor(e,n){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=FE.get(i);if(s)return e[R1]=s;this.sheet=new r.CSSStyleSheet,FE.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[R1]=this}mount(e,n){let i=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<s&&a>-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),i)for(let c=0;c<l.rules.length;c++)i.insertRule(l.rules[c],r++)}else{for(;s<a;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(i)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
|
|
195
|
-
`;this.styleTag.textContent=o;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var Ar={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ua={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},lU=typeof navigator<"u"&&/Mac/.test(navigator.platform),aU=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(rt=0;rt<10;rt++)Ar[48+rt]=Ar[96+rt]=String(rt);var rt;for(rt=1;rt<=24;rt++)Ar[rt+111]="F"+rt;var rt;for(rt=65;rt<=90;rt++)Ar[rt]=String.fromCharCode(rt+32),ua[rt]=String.fromCharCode(rt);var rt;for(wp in Ar)ua.hasOwnProperty(wp)||(ua[wp]=Ar[wp]);var wp;function $E(t){var e=lU&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||aU&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ua:Ar)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function wn(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?t.setAttribute(i,r):r!=null&&(t[i]=r)}e++}for(;e<arguments.length;e++)VE(t,arguments[e]);return t}function VE(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)VE(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}var Gt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},U1=typeof document<"u"?document:{documentElement:{style:{}}},F1=/Edge\/(\d+)/.exec(Gt.userAgent),AD=/MSIE \d/.test(Gt.userAgent),$1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Gt.userAgent),Jp=!!(AD||$1||F1),jE=!Jp&&/gecko\/(\d+)/i.test(Gt.userAgent),L1=!Jp&&/Chrome\/(\d+)/.exec(Gt.userAgent),YE="webkitFontSmoothing"in U1.documentElement.style,V1=!Jp&&/Apple Computer/.test(Gt.vendor),KE=V1&&(/Mobile\/\w+/.test(Gt.userAgent)||Gt.maxTouchPoints>2),L={mac:KE||/Mac/.test(Gt.platform),windows:/Win/.test(Gt.platform),linux:/Linux|X11/.test(Gt.platform),ie:Jp,ie_version:AD?U1.documentMode||6:$1?+$1[1]:F1?+F1[1]:0,gecko:jE,gecko_version:jE?+(/Firefox\/(\d+)/.exec(Gt.userAgent)||[0,0])[1]:0,chrome:!!L1,chrome_version:L1?+L1[1]:0,ios:KE,android:/Android\b/.test(Gt.userAgent),webkit:YE,webkit_version:YE?+(/\bAppleWebKit\/(\d+)/.exec(Gt.userAgent)||[0,0])[1]:0,safari:V1,safari_version:V1?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Gt.userAgent)||[0,0])[1]:0,tabSize:U1.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Dv(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}var Ip=Object.create(null);function Mv(t,e,n){if(t==e)return!0;t||(t=Ip),e||(e=Ip);let i=Object.keys(t),r=Object.keys(e);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function cU(t,e){for(let n=t.attributes.length-1;n>=0;n--){let i=t.attributes[n].name;e[i]==null&&t.removeAttribute(i)}for(let n in e){let i=e[n];n=="style"?t.style.cssText=i:t.getAttribute(n)!=i&&t.setAttribute(n,i)}}function GE(t,e,n){let i=!1;if(e)for(let r in e)n&&r in n||(i=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(i=!0,r=="style"?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return i}function uU(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=i.value}return e}var Tr=class{eq(e){return!1}updateDOM(e,n,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},ln=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(ln||(ln={})),Se=class extends Hi{constructor(e,n,i,r){super(),this.startSide=e,this.endSide=n,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Gu(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return n+=i&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Ao(e,n,n,i,e.widget||null,!1)}static replace(e){let n=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=CD(e,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new Ao(e,i,r,n,e.widget||null,!0)}static line(e){return new Qu(e)}static set(e,n=!1){return me.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};Se.none=me.empty;var Gu=class t extends Se{constructor(e){let{start:n,end:i}=CD(e);super(n?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Dv(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Ip}eq(e){return this==e||e instanceof t&&this.tagName==e.tagName&&Mv(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}};Gu.prototype.point=!1;var Qu=class t extends Se{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof t&&this.spec.class==e.spec.class&&Mv(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}};Qu.prototype.mapMode=Yt.TrackBefore;Qu.prototype.point=!0;var Ao=class t extends Se{constructor(e,n,i,r,s,o){super(n,i,s,e),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?Yt.TrackBefore:Yt.TrackAfter:Yt.TrackDel}get type(){return this.startSide!=this.endSide?ln.WidgetRange:this.startSide<=0?ln.WidgetBefore:ln.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof t&&fU(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}};Ao.prototype.point=!0;function CD(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return n==null&&(n=t.inclusive),i==null&&(i=t.inclusive),{start:n??e,end:i??e}}function fU(t,e){return t==e||!!(t&&e&&t.compare(e))}function ga(t,e,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=t?n[r]=Math.max(n[r],e):n.push(t,e)}var _p=class t extends Hi{constructor(e,n,i){super(),this.tagName=e,this.attributes=n,this.rank=i}eq(e){return e==this||e instanceof t&&this.tagName==e.tagName&&Mv(this.attributes,e.attributes)}static create(e){return new t(e.tagName,e.attributes||Ip,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return me.of(e,n)}};_p.prototype.startSide=_p.prototype.endSide=-1;function Xu(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function j1(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function zu(t,e){if(!e.anchorNode)return!1;try{return j1(t,e.anchorNode)}catch{return!1}}function Np(t){return t.nodeType==3?Wu(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Hu(t,e,n,i){return n?QE(t,e,n,i,-1)||QE(t,e,n,i,1):!1}function Cs(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Bp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function QE(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:Er(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=Cs(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?Er(t):0}else return!1}}function Er(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function qp(t,e){let{left:n,right:i}=t;if(n==i)return t;let r=e?n:i;return{left:r,right:r,top:t.top,bottom:t.bottom}}function dU(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function OD(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function hU(t,e,n,i,r,s,o,l){let a=t.ownerDocument,c=a.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==a.body,p=1,g=1;if(h)d=dU(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:p,scaleY:g}=OD(u,y)),d={left:y.left,right:y.left+u.clientWidth*p,top:y.top,bottom:y.top+u.clientHeight*g}}let b=0,m=0;if(r=="nearest")e.top<d.top+o?(m=e.top-(d.top+o),n>0&&e.bottom>d.bottom+m&&(m=e.bottom-d.bottom+o)):e.bottom>d.bottom-o&&(m=e.bottom-d.bottom+o,n<0&&e.top-m<d.top&&(m=e.top-(d.top+o)));else{let y=e.bottom-e.top,v=d.bottom-d.top;m=(r=="center"&&y<=v?e.top+y/2-v/2:r=="start"||r=="center"&&n<0?e.top-o:e.bottom-v+o)-d.top}if(i=="nearest"?e.left<d.left+s?(b=e.left-(d.left+s),n>0&&e.right>d.right+b&&(b=e.right-d.right+s)):e.right>d.right-s&&(b=e.right-d.right+s,n<0&&e.left<d.left+b&&(b=e.left-(d.left+s))):b=(i=="center"?e.left+(e.right-e.left)/2-(d.right-d.left)/2:i=="start"==l?e.left-s:e.right-(d.right-d.left)+s)-d.left,b||m)if(h)c.scrollBy(b,m);else{let y=0,v=0;if(m){let x=u.scrollTop;u.scrollTop+=m/g,v=(u.scrollTop-x)*g}if(b){let x=u.scrollLeft;u.scrollLeft+=b/p,y=(u.scrollLeft-x)*p}e={left:e.left-y,top:e.top-v,right:e.right-y,bottom:e.bottom-v},y&&Math.abs(y-b)<1&&(i="nearest"),v&&Math.abs(v-m)<1&&(r="nearest")}if(h)break;(e.top<d.top||e.bottom>d.bottom||e.left<d.left||e.right>d.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function TD(t,e=!0){let n=t.ownerDocument,i=null,r=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}var Y1=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:i}=e;this.set(n,Math.min(e.anchorOffset,n?Er(n):0),i,Math.min(e.focusOffset,i?Er(i):0))}set(e,n,i,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}},wo=null;L.safari&&L.safari_version>=26&&(wo=!1);function ED(t){if(t.setActive)return t.setActive();if(wo)return t.focus(wo);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(wo==null?{get preventScroll(){return wo={preventScroll:!0},!0}}:void 0),!wo){wo=!1;for(let n=0;n<e.length;){let i=e[n++],r=e[n++],s=e[n++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=s&&(i.scrollLeft=s)}}}var XE;function Wu(t,e,n=e){let i=XE||(XE=document.createRange());return i.setEnd(t,n),i.setStart(t,e),i}function ya(t,e,n,i){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function pU(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function mU(t,e){let n=e.focusNode,i=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=i)return!1;for(i=Math.min(i,Er(n));;)if(i){if(n.nodeType!=1)return!1;let r=n.childNodes[i-1];r.contentEditable=="false"?i--:(n=r,i=Er(n))}else{if(n==t)return!0;i=Cs(n),n=n.parentNode}}function DD(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function MD(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=Er(n)}else if(n.parentNode&&!Bp(n))i=Cs(n),n=n.parentNode;else return null}}function RD(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i<n.nodeValue.length)return{node:n,offset:i};if(n.nodeType==1&&i<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[i],i=0}else if(n.parentNode&&!Bp(n))i=Cs(n)+1,n=n.parentNode;else return null}}var Fi=class t{constructor(e,n,i=!0){this.node=e,this.offset=n,this.precise=i}static before(e,n){return new t(e.parentNode,Cs(e),n)}static after(e,n){return new t(e.parentNode,Cs(e)+1,n)}},Ie=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Ie||(Ie={})),Co=Ie.LTR,Rv=Ie.RTL;function ND(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}var gU=ND("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),yU=ND("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),K1=Object.create(null),Ui=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);K1[e]=n,K1[n]=-e}function LD(t){return t<=247?gU[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?yU[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}var bU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,Vn=class{get dir(){return this.level%2?Rv:Co}constructor(e,n,i){this.from=e,this.to=n,this.level=i}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,i,r){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=n&&l.to>=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.from<n:l.to>n:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function ID(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let i=t[n],r=e[n];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!ID(i.inner,r.inner))return!1}return!0}var Oe=[];function vU(t,e,n,i,r){for(let s=0;s<=i.length;s++){let o=s?i[s-1].to:e,l=s<i.length?i[s].from:n,a=s?256:r;for(let c=o,u=a,f=a;c<l;c++){let d=LD(t.charCodeAt(c));d==512?d=u:d==8&&f==4&&(d=16),Oe[c]=d==4?2:d,d&7&&(f=d),u=d}for(let c=o,u=a,f=a;c<l;c++){let d=Oe[c];if(d==128)c<l-1&&u==Oe[c+1]&&u&24?d=Oe[c]=u:Oe[c]=256;else if(d==64){let h=c+1;for(;h<l&&Oe[h]==64;)h++;let p=c&&u==8||h<n&&Oe[h]==8?f==1?1:8:256;for(let g=c;g<h;g++)Oe[g]=p;c=h-1}else d==8&&f==1&&(Oe[c]=1);u=d,d&7&&(f=d)}}}function xU(t,e,n,i,r){let s=r==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:e,u=o<i.length?i[o].from:n;for(let f=c,d,h,p;f<u;f++)if(h=K1[d=t.charCodeAt(f)])if(h<0){for(let g=l-3;g>=0;g-=3)if(Ui[g+1]==-h){let b=Ui[g+2],m=b&2?r:b&4?b&1?s:r:0;m&&(Oe[f]=Oe[Ui[g]]=m),l=g;break}}else{if(Ui.length==189)break;Ui[l++]=f,Ui[l++]=d,Ui[l++]=a}else if((p=Oe[f])==2||p==1){let g=p==r;a=g?0:1;for(let b=l-3;b>=0;b-=3){let m=Ui[b+2];if(m&2)break;if(g)Ui[b+2]|=2;else{if(m&4)break;Ui[b+2]|=4}}}}}function SU(t,e,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:t,l=r<n.length?n[r].from:e;for(let a=o;a<l;){let c=Oe[a];if(c==256){let u=a+1;for(;;)if(u==l){if(r==n.length)break;u=n[r++].to,l=r<n.length?n[r].from:e}else if(Oe[u]==256)u++;else break;let f=s==1,d=(u<e?Oe[u]:i)==1,h=f==d?f?1:2:i;for(let p=u,g=r,b=g?n[g-1].to:t;p>a;)p==b&&(p=n[--g].from,b=g?n[g-1].to:t),Oe[--p]=h;a=u}else s=c,a++}}}function G1(t,e,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let a=e,c=0;a<n;){let u=!0,f=!1;if(c==s.length||a<s[c].from){let g=Oe[a];g!=l&&(u=!1,f=g==16)}let d=!u&&l==1?[]:null,h=u?i:i+1,p=a;e:for(;;)if(c<s.length&&p==s[c].from){if(f)break e;let g=s[c];if(!u)for(let b=g.to,m=c+1;;){if(b==n)break e;if(m<s.length&&s[m].from==b)b=s[m++].to;else{if(Oe[b]==l)break e;break}}if(c++,d)d.push(g);else{g.from>a&&o.push(new Vn(a,g.from,h));let b=g.direction==Co!=!(h%2);Q1(t,b?i+1:i,r,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==n||(u?Oe[p]!=l:Oe[p]==l))break;p++}d?G1(t,a,p,i+1,r,d,o):a<p&&o.push(new Vn(a,p,h)),a=p}else for(let a=n,c=s.length;a>e;){let u=!0,f=!1;if(!c||a>s[c-1].to){let g=Oe[a-1];g!=l&&(u=!1,f=g==16)}let d=!u&&l==1?[]:null,h=u?i:i+1,p=a;e:for(;;)if(c&&p==s[c-1].to){if(f)break e;let g=s[--c];if(!u)for(let b=g.from,m=c;;){if(b==e)break e;if(m&&s[m-1].to==b)b=s[--m].from;else{if(Oe[b-1]==l)break e;break}}if(d)d.push(g);else{g.to<a&&o.push(new Vn(g.to,a,h));let b=g.direction==Co!=!(h%2);Q1(t,b?i+1:i,r,g.inner,g.from,g.to,o),a=g.from}p=g.from}else{if(p==e||(u?Oe[p-1]!=l:Oe[p-1]==l))break;p--}d?G1(t,p,a,i+1,r,d,o):p<a&&o.push(new Vn(p,a,h)),a=p}}function Q1(t,e,n,i,r,s,o){let l=e%2?2:1;vU(t,r,s,i,l),xU(t,r,s,i,l),SU(r,s,i,l),G1(t,r,s,e,n,i,o)}function wU(t,e,n){if(!t)return[new Vn(0,0,e==Rv?1:0)];if(e==Co&&!n.length&&!bU.test(t))return _D(t.length);if(n.length)for(;t.length>Oe.length;)Oe[Oe.length]=256;let i=[],r=e==Co?0:1;return Q1(t,r,r,n,0,t.length,i),i}function _D(t){return[new Vn(0,t,0)]}var BD="";function kU(t,e,n,i,r){var s;let o=i.head-t.from,l=Vn.find(e,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),a=e[l],c=a.side(r,n);if(o==c){let d=l+=r?1:-1;if(d<0||d>=e.length)return null;a=e[l=d],o=a.side(!r,n),c=a.side(r,n)}let u=gt(t.text,o,a.forward(r,n));(u<a.from||u>a.to)&&(u=c),BD=t.text.slice(Math.min(o,u),Math.max(o,u));let f=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return f&&u==c&&f.level+(r?0:1)<a.level?R.cursor(f.side(!r,n)+t.from,f.forward(r,n)?1:-1,f.level):R.cursor(u+t.from,a.forward(r,n)?-1:1,a.level)}function AU(t,e,n){for(let i=e;i<n;i++){let r=LD(t.charCodeAt(i));if(r==1)return Co;if(r==2||r==4)return Rv}return Co}var qD=I.define(),PD=I.define(),zD=I.define(),HD=I.define(),X1=I.define(),UD=I.define(),FD=I.define(),Nv=I.define(),Lv=I.define(),$D=I.define({combine:t=>t.some(e=>e)}),CU=I.define({combine:t=>t.some(e=>e)}),VD=I.define(),Uu=class t{constructor(e,n,i,r,s,o=!1){this.range=e,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new t(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new t(R.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},kp=pe.define({map:(t,e)=>t.map(e)}),jD=pe.define();function kn(t,e,n){let i=t.facet(HD);i.length?i[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}var Cr=I.define({combine:t=>t.length?t[0]:!0}),OU=0,da=I.define({combine(t){return t.filter((e,n)=>{for(let i=0;i<n;i++)if(t[i].plugin==e.plugin)return!1;return!0})}}),jn=class t{constructor(e,n,i,r,s){this.id=e,this.create=n,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(da.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(da.of({plugin:this,arg:e}))}static define(e,n){let{eventHandlers:i,eventObservers:r,provide:s,decorations:o}=n||{};return new t(OU++,e,i,r,l=>{let a=[];return o&&a.push(em.of(c=>{let u=c.plugin(l);return u?o(u):Se.none})),s&&a.push(s(l)),a})}static fromClass(e,n){return t.define((i,r)=>new e(i,r),n)}},Fu=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(kn(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){kn(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){kn(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},YD=I.define(),Iv=I.define(),em=I.define(),KD=I.define(),_v=I.define(),Zu=I.define(),GD=I.define();function WE(t,e){let n=t.state.facet(GD);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(t):s),r=[];return me.spans(i,e.from,e.to,{point(){},span(s,o,l,a){let c=s-e.from,u=o-e.from,f=r;for(let d=l.length-1;d>=0;d--,a--){let h=l[d].spec.bidiIsolate,p;if(h==null&&(h=AU(e.text,c,u)),a>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==h)p.to=u,f=p.inner;else{let g={from:c,to:u,direction:h,inner:[]};f.push(g),f=g.inner}}}}),r}var QD=I.define();function Bv(t){let e=0,n=0,i=0,r=0;for(let s of t.state.facet(QD)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:n,top:i,bottom:r}}var qu=I.define(),hi=class t{constructor(e,n,i,r){this.fromA=e,this.toA=n,this.fromB=i,this.toB=r}join(e){return new t(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,i=this;for(;n>0;n--){let r=e[n-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(n-1,1)}}return e.splice(n,0,i),e}static extendWithRanges(e,n){if(n.length==0)return e;let i=[];for(let r=0,s=0,o=0;;){let l=r<e.length?e[r].fromB:1e9,a=s<n.length?n[s]:1e9,c=Math.min(l,a);if(c==1e9)break;let u=c+o,f=c,d=u;for(;;)if(s<n.length&&n[s]<=f){let h=n[s+1];s+=2,f=Math.max(f,h);for(let p=r;p<e.length&&e[p].fromB<=f;p++)o=e[p].toA-e[p].toB;d=Math.max(d,h+o)}else if(r<e.length&&e[r].fromB<=f){let h=e[r++];f=Math.max(f,h.toB),d=Math.max(d,h.toA),o=h.toA-h.toB}else break;i.push(new t(u,d,c,f))}return i}},Pp=class t{constructor(e,n,i){this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Kt.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,a)=>r.push(new hi(s,o,l,a))),this.changedRanges=r}static create(e,n,i){return new t(e,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},TU=[],He=class{constructor(e,n,i=0){this.dom=e,this.length=n,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return TU}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&cU(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let i=n;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n,i){return null}domPosFor(e,n){let i=Cs(this.dom),r=this.length?e>0:n>0;return new Fi(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof va)return e;return null}static get(e){return e.cmTile}},ba=class extends He{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,i=null,r,s=e?.node==n?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=ZE(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=ZE(r);this.length=o}};function ZE(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var va=class extends ba{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=He.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof Or)n.push(r),i=o,r=0;else{let l=s+o.length,a=e(o,s);if(a!==void 0)return a;s=l+o.breakAfter}}}resolveBlock(e,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,a)=>{let c=a+l.length;if(e>=a&&e<=c){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(a<e||e==c&&(n<-1?l.length:l.covers(1)))&&(!i||!l.isWidget()&&i.isWidget())&&(i=l,r=e-a),(c>e||e==a&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-a)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}},Or=class t extends ba{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let i=new t(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}},xa=class t extends ba{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,i){let r=new t(n||document.createElement("div"),e);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,n,i){let r=null,s=-1,o=null,l=-1;function a(u,f){for(let d=0,h=0;d<u.children.length&&h<=f;d++){let p=u.children[d],g=h+p.length;g>=f&&(p.isComposite()?a(p,f-h):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&DU(o,p)))&&(g>f||p.flags&32)?(o=p,l=f-h):(h<f||p.flags&16&&!p.isHidden)&&(r=p,s=f-h)),h=g}}a(this,e);let c=(n<0?r:o)||r||o;return c?{tile:c,offset:c==r?s:l}:null}coordsIn(e,n,i){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n,i):EU(this)}domIn(e,n){let i=this.resolveInline(e,n);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new Fi(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:n);let o=i.tile.parent,l=!1;for(let a of o.children){if(l)return new Fi(a.dom,0);a==i.tile&&(l=!0)}}return new Fi(this.dom,0)}};function EU(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Np(e);return n[n.length-1]||null}function DU(t,e){let n=t.coordsIn(0,1),i=e.coordsIn(0,1);return n&&i&&i.top<n.bottom}var on=class t extends ba{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let i=new t(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}},ko=class t extends He{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n,i){let r=this.dom.nodeValue.length;e>r&&(e=r);let s=e,o=e,l=0;e==0&&n<0||e==r&&n>=0?L.chrome||L.gecko||(e?(s--,l=1):o<r&&(o++,l=-1)):n<0?s--:o<r&&o++;let a=Wu(this.dom,s,o).getClientRects();if(!a.length)return null;let c=a[(l?l<0:n>=0)?0:a.length-1];return L.safari&&!l&&c.width==0&&(c=Array.prototype.find.call(a,u=>u.width)||c),i==null?c:qp(c,(l?l>0:n<0)==i)}static of(e,n){let i=new t(n||document.createTextNode(e),e);return n||(i.flags|=2),i}},Oo=class t extends He{constructor(e,n,i,r){super(e,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,i){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(i)return qp(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top<o.bottom);a+=l?-1:1);return qp(o,!l)}}get overrideDOMText(){if(!this.length)return fe.empty;let{root:e}=this;if(!e)return fe.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,i,r,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new t(s,i,e,r)}},Sa=class extends He{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return fe.empty}coordsIn(e,n,i){let r=this.dom.getBoundingClientRect();return i==null?r:qp(r,n>0==i)}},W1=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||n>0;)if(r.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let a=r.children[s],c=a.breakAfter;(n>0?a.length<=e:a.length<e)&&(!i||i.skip(a,0,a.length)!==!1||!a.isComposite)?(o=!!c,s++,e-=a.length):(l.push({tile:r,index:s}),r=a,s=0,i&&a.isComposite()&&i.enter(a))}else if(s==r.length)o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++;else if(e){let a=Math.min(e,r.length-s);i&&i.skip(r,s,s+a),e-=a,s+=a}else break;return this.tile=r,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},Z1=class{constructor(e,n,i,r){this.from=e,this.to=n,this.wrapper=i,this.rank=r}},J1=class{constructor(e,n,i){this.cache=e,this.root=n,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,i,r){var s;this.flushBuffer();let o=this.ensureMarks(n,i),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let a=o.children[o.children.length-1]=new ko(l.dom,l.text+e);a.parent=o}else o.append(r||ko.of(e,(s=this.cache.find(ko))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let i=this.curLine;i.dom!=n.line.dom&&(i.setDOM(this.cache.reused.has(n.line)?I1(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let r=i;for(let l=n.marks.length-1;l>=0;l--){let a=n.marks[l],c=r.lastChild;if(c instanceof on&&c.mark.eq(a.mark))c.dom!=a.dom&&c.setDOM(I1(a.dom)),r=c;else{if(this.cache.reused.get(a)){let f=He.get(a.dom);f&&f.setDOM(I1(a.dom))}let u=on.of(a.mark,a.dom);r.append(u),r=u}this.cache.reused.set(a,2)}let s=He.get(e.text);s&&this.cache.reused.set(s,2);let o=new ko(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,n,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var i;e||(e=XD);let r=xa.start(e,n||((i=this.cache.find(xa))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(n>0&&(l=r.lastChild)&&l instanceof on&&l.mark.eq(o))r=l,n--;else{let a=on.of(o,(i=this.cache.find(on,c=>c.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(a),r=a,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!JE(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(L.ios&&JE(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(_1,0,32)||new Oo(_1.toDOM(),0,_1,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=e.rank*102+e.value.rank,i=new Z1(e.from,e.to,e.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.from<this.pos&&r instanceof Or&&r.wrapper.eq(i.wrapper))n=r;else{let s=Or.of(i.wrapper,(e=this.cache.find(Or,o=>o.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),i=this.cache.find(Sa,void 0,1);return i&&(i.flags=n),i||new Sa(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},ev=class{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,n);return this.textOff=n,i}},zp=[Oo,xa,ko,on,Sa,Or,va];for(let t=0;t<zp.length;t++)zp[t].bucket=t;var tv=class{constructor(e){this.view=e,this.buckets=zp.map(()=>[]),this.index=zp.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,i=this.buckets[n];i.length<6?i.push(e):i[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,i=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l<s.length;l++){let a=(l+o)%s.length,c=s[a];if((!n||n(c))&&!this.reused.has(c))return s.splice(a,1),a<o&&this.index[r]--,this.reused.set(c,i),c}return null}findWidget(e,n,i){let r=this.buckets[0];if(r.length)for(let s=0,o=0;;s++){if(s==r.length){if(o)return null;o=1,s=0}let l=r[s];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==n&&(l.flags&497)==i?(this.reused.set(l,1),l):(this.reused.set(l,2),new Oo(l.dom,n,e,l.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},nv=class{constructor(e,n,i,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new tv(e),this.text=new ev(e.state.doc),this.builder=new J1(this.cache,new va(e,e.contentDOM),me.iter(i)),this.cache.reused.set(n,2),this.old=new W1(n),this.reuseWalker={skip:(o,l,a)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=o<e.length?e[o++]:null,a=l?l.fromA:this.old.root.length;if(a>r){let c=a-r;this.preserve(c,!o,!l),r=a,s+=c}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,i),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,l.toA),this.emit(n.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,r=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,i){let r=NU(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(o,l,a)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let c=a>0||l<o.length?Oo.of(o.widget,this.view,a-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,r,s),s=r.length)}else if(o.isText())this.builder.ensureLine(null),!l&&a==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,r,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,a),r,s)),s=r.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof Sa)this.cache.add(o);else if(o instanceof on)this.builder.ensureLine(null),this.builder.addMark(o,r,s),this.cache.reused.set(o,1),s=r.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof on&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof on&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let i=null,r=this.builder,s=-1,o=me.spans(this.decorations,e,n,{point:(l,a,c,u,f,d)=>{if(c instanceof Ao){if(this.disallowBlockEffectsFor[d]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=u.length,f>u.length)r.continueWidget(a-l);else{let h=c.widget||(c.block?Os.block:Os.inline),p=MU(c),g=this.cache.findWidget(h,a-l,p)||Oo.of(h,this.view,a-l,p);c.block?(c.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(g)):(r.ensureLine(i),r.addInlineWidget(g,u,f))}i=null}else i=RU(i,c);a>l&&this.text.skip(a-l)},span:(l,a,c,u)=>{for(let f=l;f<a;){let d=this.text.next(Math.min(512,a-f));d==null?(r.addLineStartIfNotCovered(i),r.addBreak(),f++):(r.ensureLine(i),r.addText(d,c,f==l?u:c.length),f+=d.length),i=null}s=c.length}});s>-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(e,n,i=1){n-e<=10?this.old.advance(n-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let n=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=He.get(r);if(r==this.view.contentDOM)break;s instanceof on?n.push(s):s?.isLine()?i=s:s instanceof Or||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new xa(r,XD):i||n.push(on.of(new Gu({tagName:r.nodeName.toLowerCase(),attributes:uU(r)}),r)))}return{line:i,marks:n}}};function JE(t,e){let n=i=>{for(let r of i.children)if((e?r.isText():r.length)||n(r))return!0;return!1};return n(t)}function MU(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}var XD={class:"cm-line"};function RU(t,e){let n=e.spec.attributes,i=e.spec.class;return!n&&!i||(t||(t={class:"cm-line"}),n&&Dv(n,t),i&&(t.class+=" "+i)),t}function NU(t){let e=[];for(let n=t.parents.length;n>1;n--){let i=n==t.parents.length?t.tile:t.parents[n].tile;i instanceof on&&e.push(i.mark)}return e}function I1(t){let e=He.get(t);return e&&e.setDOM(t.cloneNode()),t}var Os=class extends Tr{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};Os.inline=new Os("span");Os.block=new Os("div");var _1=new class extends Tr{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}},Hp=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Se.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new va(e,e.contentDOM),this.updateInner([new hi(0,0,0,e.state.doc.length)],null)}update(e){var n;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:u,toA:f})=>f<this.minWidthFrom||u>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!HU(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?IU(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:f}=this.hasComposition;i=new hi(u,f,e.changes.mapPos(u,-1),e.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(L.ie||L.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=qU(o,this.decorations,e.changes);a.length&&(i=hi.extendWithRanges(i,a));let c=PU(l,this.blockWrappers,e.changes);return c.length&&(i=hi.extendWithRanges(i,c)),s&&!i.some(u=>u.fromA<=s.range.fromA&&u.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||e.length){let o=this.tile,l=new nv(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&He.get(n.text)&&l.cache.reused.set(He.get(n.text),2),this.tile=l.run(e,n),iv(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=L.chrome||L.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof $u&&r.push(s.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let i of n.effects)i.is(jD)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,s=r==i,o=!s&&!(this.view.state.facet(Cr)||i.tabIndex>-1)&&zu(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,c,u;if(a.empty?u=c=this.inlineDOMNearPos(a.anchor,a.assoc||1):(u=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),c=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),L.gecko&&a.empty&&!this.hasComposition&&LU(c)){let d=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(d,c.node.childNodes[c.offset]||null)),c=u=new Fi(d,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!Hu(c.node,c.offset,f.anchorNode,f.anchorOffset)||!Hu(u.node,u.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{L.android&&L.chrome&&i.contains(f.focusNode)&&zU(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let d=Xu(this.view.root);if(d)if(a.empty){if(L.gecko){let h=_U(c.node,c.offset);if(h&&h!=3){let p=(h==1?MD:RD)(c.node,c.offset);p&&(c=new Fi(p.node,p.offset))}}d.collapse(c.node,c.offset),a.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=a.bidiLevel)}else if(d.extend){d.collapse(c.node,c.offset);try{d.extend(u.node,u.offset)}catch{}}else{let h=document.createRange();a.anchor>a.head&&([c,u]=[u,c]),h.setEnd(u.node,u.offset),h.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(h)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new Fi(f.anchorNode,f.anchorOffset),this.impreciseHead=u.precise?null:new Fi(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Hu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,i=Xu(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let a=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!a||!c||a.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(u.node,u.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(e,n){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[n];else{let o=Er(e)==0?0:n==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!He.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let a=i.children[o];if(a.dom==s)return l;l+=a.length+a.breakAfter}}else return i.isText()?e==i.dom?r+n:r+(n?i.length:0):r}domAtPos(e,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(e,n){let i,r=-1,s=!1,o,l=-1,a=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(s=!0)}else{let f=u+c.length;if(u<=e&&(i=c,r=e-u,s=f<e),f>=e&&!o&&(o=c,l=e-u,a=u>e),u>e&&o)return!0}}),!i&&!o?this.domAtPos(e,n):(s&&o?i=null:a&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(e,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof $u?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(e,n){let{tile:i}=this.tile.resolveBlock(e,n);return i.isLine()?i:null}coordsForChar(e){let{tile:n,offset:i}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let a=r(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(s.isText()&&o<s.length){let l=gt(s.text,o);if(l==o)return null;let a=Wu(s.dom,o,l).getClientRects();for(let c=0;c<a.length;c++){let u=a[c];if(c==a.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return r(n,i)}measureVisibleLineHeights(e){let n=[],{from:i,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Ie.LTR,c=0,u=(f,d,h)=>{for(let p=0;p<f.children.length&&!(d>r);p++){let g=f.children[p],b=d+g.length,m=g.dom.getBoundingClientRect(),{height:y}=m;if(h&&!p&&(c+=m.top-h.top),g instanceof Or)b>i&&u(g,d,m);else if(d>=i&&(c>0&&n.push(-c),n.push(y+c),c=0,o)){let v=g.dom.lastChild,x=v?Np(v):[];if(x.length){let A=x[x.length-1],w=a?A.right-m.left:m.right-A.left;w>l&&(l=w,this.minWidth=s,this.minWidthFrom=d,this.minWidthTo=b)}}h&&p==f.children.length-1&&(c+=h.bottom-m.bottom),d=b+g.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?Ie.RTL:Ie.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let c of o.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=Np(c.dom);if(u.length!=1)return;l+=u[0].width,a=u[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=Np(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;e.push(Se.replace({widget:new $u(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return Se.set(e)}updateDeco(){let e=1,n=this.view.state.facet(em).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(_v).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,n.push(me.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(KD).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(VD))try{if(c(this.view,e.range,e))return!0}catch(u){kn(this.view.state,u,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=Bv(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(hU(this.view.scrollDOM,o,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==Ie.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(n.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=i=>i.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){iv(this.tile)}};function iv(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let i of t.children)iv(i,e)}}function LU(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function WD(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let i=MD(n.focusNode,n.focusOffset),r=RD(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=He.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(t.docView.lastCompositionAfterCursor){let a=He.get(i.node);!a||a.isText()&&a.text!=i.node.nodeValue||(s=r)}}if(t.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function IU(t,e,n){let i=WD(t,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc;return{range:new hi(a.mapPos(s),a.mapPos(o),s,o),text:r}}function _U(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}var BU=class{constructor(){this.changes=[]}compareRange(e,n){ga(e,n,this.changes)}comparePoint(e,n){ga(e,n,this.changes)}boundChange(e){ga(e,e,this.changes)}};function qU(t,e,n){let i=new BU;return me.compare(t,e,n,i),i.changes}var rv=class{constructor(){this.changes=[]}compareRange(e,n){ga(e,n,this.changes)}comparePoint(){}boundChange(e){ga(e,e,this.changes)}};function PU(t,e,n){let i=new rv;return me.compare(t,e,n,i),i.changes}function zU(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function HU(t,e){let n=!1;return e&&t.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(n=!0)}),n}var $u=class extends Tr{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function UU(t,e,n=1){let i=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(r.length==0)return R.cursor(e);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=gt(r.text,s,!1):l=gt(r.text,s);let a=i(r.text.slice(o,l));for(;o>0;){let c=gt(r.text,o,!1);if(i(r.text.slice(c,o))!=a)break;o=c}for(;l<r.length;){let c=gt(r.text,l);if(i(r.text.slice(l,c))!=a)break;l=c}return R.undirectionalRange(o+r.from,l+r.from)}function FU(t,e,n,i,r){let s=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,a=Math.floor((r-n.top-(t.defaultLineHeight-l)*.5)/l);s+=a*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+zE(o,s,t.state.tabSize)}function $U(t,e,n){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==ln.Text&&(r.type!=s.type||(n<0?s.from<e:s.to>e)))&&(r=s)}}return r||i}return i}function VU(t,e,n,i){let r=$U(t,e.head,e.assoc||-1),s=!i||r.type!=ln.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(r.from),a=t.posAtCoords({x:n==(l==Ie.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return R.cursor(a,n?-1:1)}return R.cursor(n?r.to:r.from,n?-1:1)}function eD(t,e,n,i){let r=t.state.doc.lineAt(e.head),s=t.bidiSpans(r),o=t.textDirectionAt(r.from);for(let l=e,a=null;;){let c=kU(r,s,o,l,n),u=BD;if(!c){if(r.number==(n?t.state.doc.lines:1))return l;u=`
|
|
196
|
-
`,r=t.state.doc.line(r.number+(n?1:-1)),s=t.bidiSpans(r),c=t.visualLineSide(r,!n)}if(a){if(!a(u))return l}else{if(!i)return c;a=i(u)}l=c}}function jU(t,e,n){let i=t.state.charCategorizer(e),r=i(n);return s=>{let o=i(s);return r==fi.Space&&(r=o),r==o}}function YU(t,e,n,i){let r=e.head,s=n?1:-1;if(r==(n?t.state.doc.length:0))return R.cursor(r,e.assoc);let o=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(r,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),u=t.documentTop;if(c)o==null&&(o=c.left-a.left),l=s<0?c.top:c.bottom;else{let p=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,t.defaultCharacterWidth*(r-p.from))),l=(s<0?p.top:p.bottom)+u}let f=a.left+o,d=t.viewState.heightOracle.textHeight>>1,h=i??d;for(let p=0;;p+=d){let g=l+(h+p)*s,b=sv(t,{x:f,y:g},!1,s);if(n?g>a.bottom:g<a.top)return R.cursor(b.pos,b.assoc);let m=t.coordsAtPos(b.pos,b.assoc),y=m?(m.top+m.bottom)/2:0;if(!m||(n?y>l:y<l))return R.cursor(b.pos,b.assoc,void 0,o)}}function Vu(t,e,n){for(;;){let i=0;for(let r of t)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=i||n||(e-s<o-e?-1:1);e=a<0?s:o,i=a}});if(!i)return e}}function ZD(t,e){let n=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],s=null;if(r.empty){let o=Vu(t,r.from,0);o!=r.from&&(s=R.cursor(o,-1))}else{let o=Vu(t,r.from,-1),l=Vu(t,r.to,1);(o!=r.from||l!=r.to)&&(r.undirectional?s=R.undirectionalRange(r.from,r.to):s=R.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(n||(n=e.ranges.slice()),n[i]=s)}return n?R.create(n,e.mainIndex):e}function B1(t,e,n){let i=Vu(t.state.facet(Zu).map(r=>r(t)),n.from,e.head>n.from?-1:1);return i==n.from?n:R.cursor(i,i<n.from?1:-1)}var $n=class{constructor(e,n){this.pos=e,this.assoc=n}};function sv(t,e,n,i){let r=t.contentDOM.getBoundingClientRect(),s=r.top+t.viewState.paddingTop,{x:o,y:l}=e,a=l-s,c;for(;;){if(a<0)return new $n(0,1);if(a>t.viewState.docHeight)return new $n(t.state.doc.length,-1);if(c=t.elementAtHeight(a),i==null)break;if(c.type==ln.Text){if(i<0?c.to<t.viewport.from:c.from>t.viewport.to)break;let d=t.docView.coordsAt(i<0?c.from:c.to,i>0?-1:1);if(d&&(i<0?d.top<=a+s:d.bottom>=a+s))break}let f=t.viewState.heightOracle.textHeight/2;a=i>0?c.bottom+f:c.top-f}if(t.viewport.from>=c.to||t.viewport.to<=c.from){if(n)return null;if(c.type==ln.Text){let f=FU(t,r,c,o,l);return new $n(f,f==c.from?1:-1)}}if(c.type!=ln.Text)return a<(c.top+c.bottom)/2?new $n(c.from,1):new $n(c.to,-1);let u=t.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=t.docView.lineAt(c.from,-2)),new ov(t,o,l,t.textDirectionAt(c.from)).scanTile(u,c.from)}var ov=class{constructor(e,n,i,r){this.view=e,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[Vn.find(r,e-i.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[Vn.find(r,e-i.from,-1,n)].dir}bidiIn(e,n){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<n)}scan(e,n,i=!1){let r=0,s=e.length-1,o=new Set,l=this.bidiIn(e[0],e[s]),a,c,u=-1,f=1e9,d;e:for(;r<s;){let p=s-r,g=r+s>>1;t:if(o.has(g)){let m=r+Math.floor(Math.random()*p);for(let y=0;y<p;y++){if(!o.has(m)){g=m;break t}m++,m==s&&(m=r)}break e}o.add(g);let b=n(g);if(b)for(let m=0;m<b.length;m++){let y=b[m],v=0;if(!(y.width==0&&b.length>1)){if(y.bottom<this.y)(!a||a.bottom<y.bottom)&&(a=y),v=1;else if(y.top>this.y)(!c||c.top>y.top)&&(c=y),v=-1;else{let x=y.left>this.x?this.x-y.left:y.right<this.x?this.x-y.right:0,A=Math.abs(x);A<f&&(u=g,f=A,d=y),x&&(v=x<0==(this.baseDir==Ie.LTR)?-1:1)}v==-1&&(!l||this.baseDirAt(e[g],1))?s=g:v==1&&(!l||this.baseDirAt(e[g+1],-1))&&(r=g+1)}}}if(!d){if(!c&&!a)return{i:e[0],after:!1};let p=a&&(!c||this.y-a.bottom<c.top-this.y)?a:c;return this.y=(p.top+p.bottom)/2,this.scan(e,n,!0)}if(f&&!i){let{top:p,bottom:g}=d;if(a&&a.bottom>(p+p+g)/3)return this.y=a.bottom-1,this.scan(e,n,!0);if(c&&c.top<(p+g+g)/3)return this.y=c.top+1,this.scan(e,n,!0)}let h=(l?this.dirAt(e[u],1):this.baseDir)==Ie.LTR;return{i:u,after:this.x>(d.left+d.right)/2==h}}scanText(e,n){let i=[];for(let s=0;s<e.length;s=gt(e.text,s))i.push(n+s);i.push(n+e.length);let r=this.scan(i,s=>{let o=i[s]-n,l=i[s+1]-n;return Wu(e.dom,o,l).getClientRects()});return r.after?new $n(i[r.i+1],-1):new $n(i[r.i],1)}scanTile(e,n){if(!e.length)return new $n(n,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,a=n;l<e.children.length;l++)i.push(a+=e.children[l].length);let r=this.scan(i,l=>{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:Wu(a.dom,0,a.length)).getClientRects()}),s=e.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new $n(i[r.i+1],-1):new $n(o,1)}},fa="\uFFFF",lv=class{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(De.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=fa}readRange(e,n){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=He.get(r),l=r.nextSibling;if(l==n){o?.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let a=He.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:Bp(r))||Bp(l)&&(r.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!GU(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(e){let n=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=s+o}}readNode(e){let n=He.get(e),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(e,n){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(KU(e,i.node,i.offset)?n:0))}};function KU(t,e,n){for(;;){if(!e||n<Er(e))return!1;if(e==t)return!0;n=Cs(e)+1,e=e.parentNode}}function GU(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let i=He.get(t);if(!i?.isWidget())return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r?.length)return!1}return!0}var Up=class{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}},av=class{constructor(e,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=JD(e.docView.tile,n,i,0))){let a=s||o?[]:XU(e),c=new lv(a,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=WU(a,this.bounds.from)}else{let a=e.observer.selectionRange,c=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!j1(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),u=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!j1(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if((L.ios||L.chrome)&&c!=u&&Math.min(c,u)<=l.main.from&&Math.max(c,u)>=l.main.to&&(f.from>0||f.to<e.state.doc.length)){let d=Math.min(c,u),h=Math.max(c,u),p=f.from-d,g=f.to-h;(p==0||p==1||d==0)&&(g==0||g==-1||h==e.state.doc.length)&&(c=0,u=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(R.range(u,c));else if(e.lineWrapping&&u==c&&!(l.main.empty&&l.main.head==c)&&e.inputState.lastTouchTime>Date.now()-100){let d=e.coordsAtPos(c,-1),h=0;d&&(h=e.inputState.lastTouchY<=d.bottom?-1:1),this.newSel=R.create([R.cursor(c,h)])}else this.newSel=R.single(u,c)}}};function JD(t,e,n,i){if(t.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let a=0,c=i,u=i;a<t.children.length;a++){let f=t.children[a],d=c+f.length;if(c<e&&d>n)return JD(f,e,n,c);if(d>=e&&r==-1&&(r=a,s=c),c>n&&f.dom.parentNode==t.dom){o=a,l=u;break}u=d,c=d+f.breakAfter}return{from:s,to:l<0?i+t.length:l,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function eM(t,e){let n,{newSel:i}=e,{state:r}=t,s=r.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,c=s.from,u=null;(o===8||L.android&&e.text.length<a-l)&&(c=s.to,u="end");let f=r.doc.sliceString(l,a,fa),d,h;!s.empty&&s.from>=l&&s.to<=a&&(e.typeOver||f!=e.text)&&f.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&f.slice(s.to-l)==e.text.slice(d=e.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:fe.of(e.text.slice(s.from-l,d).split(fa))}:(h=tM(f,e.text,c-l,u))&&(L.chrome&&o==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==fa+fa&&h.toB--,n={from:l+h.from,to:l+h.toA,insert:fe.of(e.text.slice(h.from,h.toB).split(fa))})}else i&&(!t.hasFocus&&r.facet(Cr)||Fp(i,s))&&(i=null);if(!n&&!i)return!1;if((L.mac||L.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=R.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:fe.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:r.toText(t.inputState.insertingText)}:L.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
|
|
197
|
-
`&&t.lineWrapping&&(i&&(i=R.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:fe.of([" "])}),n)return qv(t,n,i,o);if(i&&!Fp(i,s)){let l=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=ZD(r.facet(Zu).map(c=>c(t)),i))),t.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function qv(t,e,n,i=-1){if(L.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(L.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ya(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&ya(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&ya(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=QU(t,e,n));return t.state.facet(UD).some(a=>a(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function QU(t,e,n){let i,r=t.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let a=e.from<s.from?-1:1,c=a<0?s.from:s.to,u=Vu(r.facet(Zu).map(f=>f(t)),c,a);e.from==u&&(o=u)}if(o>-1)i={changes:e,selection:R.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=s.from<e.from?r.sliceDoc(s.from,e.from):"",c=s.to>e.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let a=r.changes(e),c=n&&n.main.to<=a.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let u=t.state.sliceDoc(e.from,e.to),f,d=n&&WD(t,n.main.head);if(d){let p=e.insert.length-(e.to-e.from);f={from:d.from,to:d.to-p}}else f=t.state.doc.lineAt(s.head);let h=s.to-e.to;i=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:a,range:c||p.map(a)};let g=p.to-h,b=g-u.length;if(t.state.sliceDoc(b,g)!=u||g>=f.from&&b<=f.to)return{range:p};let m=r.changes({from:b,to:g,insert:e.insert}),y=p.to-s.to;return{changes:m,range:c?R.range(Math.max(0,c.anchor+y),Math.max(0,c.head+y)):p.map(m)}})}else i={changes:a,selection:c&&r.selection.replaceRange(c)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function tM(t,e,n,i){let r=Math.min(t.length,e.length),s=0;for(;s<r&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,s-Math.min(o,l));n-=o+a-s}if(o<s&&t.length<e.length){let a=n<=s&&n>=o?s-n:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=n<=s&&n>=l?s-n:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function XU(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new Up(n,i)),(r!=n||s!=i)&&e.push(new Up(r,s))),e}function WU(t,e){if(t.length==0)return null;let n=t[0].pos,i=t.length==2?t[1].pos:n;return n>-1&&i>-1?R.single(n+e,i+e):null}function Fp(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}var cv=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,L.safari&&e.contentDOM.addEventListener("input",()=>null),L.gecko&&dF(e.contentDOM.ownerDocument)}handleEvent(e){!sF(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=JU(e),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&iM.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),L.android&&L.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(L.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(nM.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||eF.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&L.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&ZU(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,ya(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:L.safari&&!L.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function ZU(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function tD(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(r){kn(n.state,r)}}}function JU(t){let e=Object.create(null);function n(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of t){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&n(l).handlers.push(tD(i.value,a))}if(o)for(let l in o){let a=o[l];a&&n(l).observers.push(tD(i.value,a))}}for(let i in pi)n(i).handlers.push(pi[i]);for(let i in Qt)n(i).observers.push(Qt[i]);return e}var nM=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],eF="dthko",iM=[16,17,18,20,91,92,224,225],Ap=6;function Cp(t){return Math.max(0,t)*.7+8}function tF(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}var uv=class{constructor(e,n,i,r){this.view=e,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=TD(e.contentDOM),this.atoms=e.state.facet(Zu).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(De.allowMultipleSelections)&&nF(e,n),this.dragging=rF(e,n)&&oM(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&tF(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Bv(this.view);e.clientX-a.left<=r+Ap?n=-Cp(r-e.clientX):e.clientX+a.right>=o-Ap&&(n=Cp(e.clientX-o)),e.clientY-a.top<=s+Ap?i=-Cp(s-e.clientY):e.clientY+a.bottom>=l-Ap&&(i=Cp(e.clientY-l)),this.setScrollSpeed(n,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,i=ZD(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function nF(t,e){let n=t.state.facet(qD);return n.length?n[0](e):L.mac?e.metaKey:e.ctrlKey}function iF(t,e){let n=t.state.facet(PD);return n.length?n[0](e):L.mac?!e.altKey:!e.ctrlKey}function rF(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=Xu(t.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function sF(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,i;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=He.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}var pi=Object.create(null),Qt=Object.create(null),rM=L.ie&&L.ie_version<15||L.ios&&L.webkit_version<604;function oF(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),sM(t,n.value)},50)}function tm(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function sM(t,e){e=tm(t.state,Nv,e);let{state:n}=t,i,r=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(fv!=null&&n.selection.ranges.every(a=>a.empty)&&fv==s.toString()){let a=-1;i=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==a)return{range:c};a=u.from;let f=n.toText((o?s.line(r++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:R.cursor(c.from+f.length)}})}else o?i=n.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:R.cursor(a.from+c.length)}}):i=n.replaceSelection(s);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Qt.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,L.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};Qt.wheel=Qt.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};pi.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Qt.touchstart=(t,e)=>{let n=t.inputState,i=e.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};Qt.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Qt.touchend=(t,e)=>{t.inputState.touchActive=!1};pi.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet(zD))if(n=i(t,e),n)break;if(!n&&e.button==0&&(n=aF(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new uv(t,e,n,i)),i&&t.observer.ignore(()=>{ED(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function nD(t,e,n,i){if(i==1)return R.cursor(e,n);if(i==2)return UU(t.state,e,n);{let r=t.docView.lineAt(e,n),s=t.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,R.undirectionalRange(o,l)}}var lF=L.ie&&L.ie_version<=11,iD=null,rD=0,sD=0;function oM(t){if(!lF)return t.detail;let e=iD,n=sD;return iD=t,sD=Date.now(),rD=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(rD+1)%3:1}function aF(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=oM(e),r=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let a=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),c,u=nD(t,a.pos,a.assoc,i);if(n.pos!=a.pos&&!o){let f=nD(t,n.pos,n.assoc,i),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d<u.from?R.range(d,h,u.assoc):R.range(h,d,u.assoc)}return o?r.replaceRange(r.main.extend(u.from,u.to,u.assoc)):l&&i==1&&r.ranges.length>1&&(c=cF(r,a.pos))?c:l?r.addRange(u):R.create([u])}}}function cF(t,e){for(let n=0;n<t.ranges.length;n++){let{from:i,to:r}=t.ranges[n];if(i<=e&&r>=e)return R.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}pi.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=R.undirectionalRange(s,o))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",tm(t.state,Lv,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};pi.dragend=t=>(t.inputState.draggedContent=null,!1);function oD(t,e,n,i){if(n=tm(t.state,Nv,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=i&&s&&iF(t,e)?{from:s.from,to:s.to}:null,l={from:r,insert:n},a=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}pi.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&oD(t,e,i.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<n.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return oD(t,e,i,!0),!0}return!1};pi.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=rM?null:e.clipboardData;return n?(sM(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(oF(t),!1)};function uF(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),t.focus()},50)}function fF(t){let e=[],n=[],i=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),n.push(r));if(!e.length){let r=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>r&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}i=!0}return{text:tm(t,Lv,e.join(t.lineBreak)),ranges:n,linewise:i}}var fv=null;pi.copy=pi.cut=(t,e)=>{if(!zu(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=fF(t.state);if(!n&&!r)return!1;fv=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=rM?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(uF(t,n),!1)};var lM=Hn.define();function aM(t,e){let n=[];for(let i of t.facet(FD)){let r=i(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:lM.of(!0)}):null}function cM(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=aM(t.state,e);n?t.dispatch(n):t.update([])}},10)}Qt.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),cM(t)};Qt.blur=t=>{t.observer.clearSelectionRange(),cM(t)};Qt.compositionstart=Qt.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Qt.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,L.chrome&&L.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Qt.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};pi.beforeinput=(t,e)=>{var n,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=t.posAtDOM(l.startContainer,l.startOffset),c=t.posAtDOM(l.endContainer,l.endOffset);return qv(t,{from:a,to:c,insert:t.state.toText(s)},null),!0}}let r;if(L.chrome&&L.android&&(r=nM.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return L.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),L.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Qt.compositionend(t,e),20),!1};var lD=new Set;function dF(t){lD.has(t)||(lD.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}var aD=["pre-wrap","normal","pre-line","break-spaces"],wa=!1;function cD(){wa=!1}var dv=class{constructor(e){this.lineWrapping=e,this.doc=fe.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return aD.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(n=!0,this.heightSamples[Math.floor(r*10)]=!0)}return n}refresh(e,n,i,r,s,o){let l=aD.indexOf(e)>-1,a=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c<o.length;c++){let u=o[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return a}},hv=class{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}},di=class t{constructor(e,n,i,r,s){this.from=e,this.length=n,this.top=i,this.height=r,this._content=s}get type(){return typeof this._content=="number"?ln.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Ao?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new t(this.from,this.length+e.length,this.top,this.height+e.height,n)}},Me=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Me||(Me={})),Lp=.001,An=class t{constructor(e,n,i=2){this.length=e,this.height=n,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Lp&&(wa=!0),this.height=e)}replace(e,n,i){return t.of(i)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:u,toB:f}=r[l],d=s.lineAt(a,Me.ByPosNoHeight,i.setDoc(n),0,0),h=d.to>=c?d:s.lineAt(c,Me.ByPosNoHeight,i,0,0);for(f+=h.to-c,c=h.to;l>0&&d.from<=r[l-1].toA;)a=r[l-1].fromA,u=r[l-1].fromB,l--,a<d.from&&(d=s.lineAt(a,Me.ByPosNoHeight,i,0,0));u+=d.from-a,a=d.from;let p=mv.build(i.setDoc(o),e,u,f);s=$p(s,s.replace(a,c,p))}return s.updateHeight(i,0)}static empty(){return new Fn(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,i=e.length,r=0,s=0;for(;;)if(n==i)if(r>s*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[n++];l&&(r+=l.size)}else{let l=e[--i];l&&(s+=l.size)}let o=0;return e[n-1]==null?(o=1,n--):e[n]==null&&(o=1,i++),new pv(t.of(e.slice(0,n)),o,t.of(e.slice(i)))}};function $p(t,e){return t==e?t:(t.constructor!=e.constructor&&(wa=!0),e)}An.prototype.size=1;var hF=Se.replace({}),Vp=class extends An{constructor(e,n,i){super(e,n),this.deco=i,this.spaceAbove=0}mainBlock(e,n){return new di(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new di(r,0,i,this.spaceAbove,hF):this.mainBlock(i,r)}lineAt(e,n,i,r,s){let o=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,i,r,s).join(o):o}forEachLine(e,n,i,r,s,o){e<=s+this.length&&n>=s&&o(this.lineAt(0,Me.ByPos,i,r,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},Fn=class t extends Vp{constructor(e,n,i){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,n){return new di(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,i){let r=i[0];return i.length==1&&(r instanceof t||r instanceof As&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof As?r=new t(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):An.of(i)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},As=class t extends An{constructor(e){super(e,0)}heightMetrics(e,n){let i=e.doc.lineAt(n).number,r=e.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(e,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(n,r);if(n.lineWrapping){let c=r+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),u=n.doc.lineAt(c),f=l+u.length*a,d=Math.max(i,e-f/2);return new di(u.from,u.length,d,f,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-i)/l))),{from:u,length:f}=n.doc.line(s+c);return new di(u,f,i+l*c,l,0)}}lineAt(e,n,i,r,s){if(n==Me.ByHeight)return this.blockAt(e,i,r,s);if(n==Me.ByPosNoHeight){let{from:h,to:p}=i.doc.lineAt(e);return new di(h,p-h,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,s),c=i.doc.lineAt(e),u=l+c.length*a,f=c.number-o,d=r+l*f+a*(c.from-s-f);return new di(c.from,c.length,Math.max(r,Math.min(d,r+this.height-u)),u,0)}forEachLine(e,n,i,r,s,o){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,s);for(let u=e,f=r;u<=n;){let d=i.doc.lineAt(u);if(u==e){let p=d.number-l;f+=a*p+c*(e-s-p)}let h=a+c*d.length;o(new di(d.from,d.length,f,h,0)),f+=h,u=d.to+1}}replace(e,n,i){let r=this.length-n;if(r>0){let s=i[i.length-1];s instanceof t?i[i.length-1]=new t(s.length+r):i.push(null,new t(r-1))}if(e>0){let s=i[0];s instanceof t?i[0]=new t(e+s.length):i.unshift(new t(e-1),null)}return An.of(i)}decomposeLeft(e,n){n.push(new t(e-1),null)}decomposeRight(e,n){n.push(null,new t(this.length-e-1))}updateHeight(e,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),a=-1;for(r.from>n&&o.push(new t(r.from-n-1).updateHeight(e,n));l<=s&&r.more;){let u=e.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],d=0;f<0&&(d=-f,f=r.heights[r.index++]),a==-1?a=f:Math.abs(f-a)>=Lp&&(a=-2);let h=new Fn(u,f,d);h.outdated=!1,o.push(h),l+=u+1}l<=s&&o.push(null,new t(s-l).updateHeight(e,l));let c=An.of(o);return(a<0||Math.abs(c.height-this.height)>=Lp||Math.abs(a-this.heightMetrics(e,n).perLine)>=Lp)&&(wa=!0),$p(this,c)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},pv=class extends An{constructor(e,n,i){super(e.length+n+i.length,e.height+i.height,n|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,n,i,r){let s=i+this.left.height;return e<s?this.left.blockAt(e,n,i,r):this.right.blockAt(e,n,s,r+this.left.length+this.break)}lineAt(e,n,i,r,s){let o=r+this.left.height,l=s+this.left.length+this.break,a=n==Me.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,n,i,r,s):this.right.lineAt(e,n,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let u=n==Me.ByPosNoHeight?Me.ByPosNoHeight:Me.ByPos;return a?c.join(this.right.lineAt(l,u,i,o,l)):this.left.lineAt(l,u,i,r,s).join(c)}forEachLine(e,n,i,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,n,i,r,s,o),n>=a&&this.right.forEachLine(e,n,i,l,a,o);else{let c=this.lineAt(a,Me.ByPos,i,r,s);e<c.from&&this.left.forEachLine(e,c.from-1,i,r,s,o),c.to>=e&&c.from<=n&&o(c),n>c.to&&this.right.forEachLine(c.to+1,n,i,l,a,o)}}replace(e,n,i){let r=this.left.length+this.break;if(n<r)return this.balanced(this.left.replace(e,n,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,n-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of i)s.push(l);if(e>0&&uD(s,o-1),n<this.length){let l=s.length;this.decomposeRight(n,s),uD(s,l)}return An.of(s)}decomposeLeft(e,n){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(i++,e>=i&&n.push(null)),e>i&&this.right.decomposeLeft(e-i,n)}decomposeRight(e,n){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,n);e<i&&this.left.decomposeRight(e,n),this.break&&e<r&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?An.of(this.break?[e,null,n]:[e,n]):(this.left=$p(this.left,e),this.right=$p(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,a=null;return r&&r.from<=n+s.length&&r.more?a=s=s.updateHeight(e,n,i,r):s.updateHeight(e,n,i),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,i,r):o.updateHeight(e,l,i),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function uD(t,e){let n,i;t[e]==null&&(n=t[e-1])instanceof As&&(i=t[e+1])instanceof As&&t.splice(e-1,3,new As(n.length+1+i.length))}var pF=5,mv=class t{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Fn?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Fn(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,i){if(e<n||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=n-e;i.block?this.addBlock(new Vp(o,r,i)):(o||s||r>=pF)&&this.addLineDeco(r,s,o)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Fn(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let i=new As(n-e);return this.oracle.doc.lineAt(e).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Fn)return e;let n=new Fn(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Fn)&&!this.isCovered?this.nodes.push(new Fn(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof Fn&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,n,i,r){let s=new t(i,e);return me.spans(n,i,r,s,0),s.finish(i)}};function mF(t,e,n){let i=new gv;return me.compare(t,e,n,i,0),i.changes}var gv=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,i,r){(e<n||i&&i.heightRelevant||r&&r.heightRelevant)&&ga(e,n,this.changes,5)}};function gF(t,e){let n=t.getBoundingClientRect(),i=t.ownerDocument,r=i.defaultView||window,s=Math.max(0,n.left),o=Math.min(r.innerWidth,n.right),l=Math.max(0,n.top),a=Math.min(r.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=i.body;)if(c.nodeType==1){let u=c,f=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),l=Math.max(l,d.top),a=Math.min(c==t.parentNode?r.innerHeight:a,d.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+e),bottom:Math.max(l,a)-(n.top+e)}}function yF(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function bF(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}var ju=class{constructor(e,n,i,r){this.from=e,this.to=n,this.size=i,this.displaySize=r}static same(e,n){if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],s=n[i];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,n){return Se.replace({widget:new yv(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}},yv=class extends Tr{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}},jp=class{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=fD,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Ie.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=n.facet(Iv).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new dv(i),this.stateDeco=dD(n),this.heightMap=An.empty().applyChanges(this.stateDeco,fe.empty,this.heightOracle.setDoc(n.doc),[new hi(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Se.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new ha(s,o))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?fD:new bv(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Pu(e,this.scaler))})}update(e,n=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=dD(this.state);let r=e.changedRanges,s=hi.extendWithRanges(r,mF(i,this.stateDeco,e?e.changes:Kt.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);cD(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||wa)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<a.from||n.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,n));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(CU)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Ie.RTL:Ie.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,u=0;if(l.width&&l.height){let{scaleX:A,scaleY:w}=OD(n,l);(A>.005&&Math.abs(this.scaleX-A)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=A,this.scaleY=w,c|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,d=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let h=TD(this.view.contentDOM,!1).y;h!=this.scrollParent&&(this.scrollParent=h,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=DD(this.scrollParent||e.win);let g=(this.printing?bF:gF)(n,this.paddingTop),b=g.top-this.pixelViewport.top,m=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget&&!yF(e.dom))return 0;let v=l.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),a){let A=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(A)&&(o=!0),o||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:w,charWidth:k,textHeight:C}=e.docView.measureTextSize();o=w>0&&r.refresh(s,w,k,C,Math.max(5,v/k),A),o&&(e.docView.minWidth=0,c|=16)}b>0&&m>0?u=Math.max(b,m):b<0&&m<0&&(u=Math.min(b,m)),cD();for(let w of this.viewports){let k=w.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(w);this.heightMap=(o?An.empty().applyChanges(this.stateDeco,fe.empty,this.heightOracle,[new hi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new hv(w.from,k))}wa&&(c|=2)}let x=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return x&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new ha(r.lineAt(o-i*1e3,Me.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,Me.ByHeight,s,0,0).to);if(n){let{head:c}=n.range;if(c<a.from||c>a.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(c,Me.ByPos,s,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<a.from?d=f.top:d=f.bottom-u,a=new ha(r.lineAt(d-1e3/2,Me.ByHeight,s,0,0).from,r.lineAt(d+u+1e3/2,Me.ByHeight,s,0,0).to)}}return a}mapViewport(e,n){let i=n.mapPos(e.from,-1),r=n.mapPos(e.to,1);return new ha(this.heightMap.lineAt(i,Me.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Me.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Me.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,Me.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-i,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let i=[];for(let r of e)n.touchesRange(r.from,r.to)||i.push(new ju(n.mapPos(r.from),n.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,n){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=Ie.LTR&&!i)return[];let l=[],a=(u,f,d,h)=>{if(f-u<s)return;let p=this.state.selection.main,g=[p.from];p.empty||g.push(p.to);for(let m of g)if(m>u&&m<f){a(u,m-10,d,h),a(m+10,f,d,h);return}let b=xF(e,m=>m.from>=d.from&&m.to<=d.to&&Math.abs(m.from-u)<s&&Math.abs(m.to-f)<s&&!g.some(y=>m.from<y&&m.to>y));if(!b){if(f<d.to&&n&&i&&n.visibleRanges.some(v=>v.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(R.cursor(f),!1,!0).head;v>u&&(f=v)}let m=this.gapSize(d,u,f,h),y=i||m<2e6?m:2e6;b=new ju(u,f,m,y)}l.push(b)},c=u=>{if(u.length<o||u.type!=ln.Text)return;let f=vF(u.from,u.to,this.stateDeco);if(f.total<o)return;let d=this.scrollTarget?this.scrollTarget.range.head:null,h,p;if(i){let g=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,m;if(d!=null){let y=Tp(f,d),v=((this.visibleBottom-this.visibleTop)/2+g)/u.height;b=y-v,m=y+v}else b=(this.visibleTop-u.top-g)/u.height,m=(this.visibleBottom-u.top+g)/u.height;h=Op(f,b),p=Op(f,m)}else{let g=f.total*this.heightOracle.charWidth,b=r*this.heightOracle.charWidth,m=0;if(g>2e6)for(let w of e)w.from>=u.from&&w.from<u.to&&w.size!=w.displaySize&&w.from*this.heightOracle.charWidth+m<this.pixelViewport.left&&(m=w.size-w.displaySize);let y=this.pixelViewport.left+m,v=this.pixelViewport.right+m,x,A;if(d!=null){let w=Tp(f,d),k=((v-y)/2+b)/g;x=w-k,A=w+k}else x=(y-b)/g,A=(v+b)/g;h=Op(f,x),p=Op(f,A)}h>u.from&&a(u.from,h,u,f),p<u.to&&a(p,u.to,u,f)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return l}gapSize(e,n,i,r){let s=Tp(r,i)-Tp(r,n);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){ju.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Se.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];me.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s<i.length&&!(r&8);s++){let o=this.visibleRanges[s],l=i[s];(o.from!=l.from||o.to!=l.to)&&(r|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Pu(this.heightMap.lineAt(e,Me.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Pu(this.heightMap.lineAt(this.scaler.fromDOM(e),Me.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Pu(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},ha=class{constructor(e,n){this.from=e,this.to=n}};function vF(t,e,n){let i=[],r=t,s=0;return me.spans(n,t,e,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r<e&&(i.push({from:r,to:e}),s+=e-r),{total:s,ranges:i}}function Op({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(i<=l)return s+i;i-=l}}function Tp(t,e){let n=0;for(let{from:i,to:r}of t.ranges){if(e<=r){n+=e-i;break}n+=r-i}return n/t.total}function xF(t,e){for(let n of t)if(e(n))return n}var fD={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function dD(t){let e=t.facet(em).filter(i=>typeof i!="function"),n=t.facet(_v).filter(i=>typeof i!="function");return n.length&&e.push(me.join(n)),e}var bv=class t{constructor(e,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=n.lineAt(l,Me.ByPos,e,0,0).top,u=n.lineAt(a,Me.ByPos,e,0,0).bottom;return r+=u-c,{from:l,to:a,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return r+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,r=s.domBottom}}fromDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return i+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,r=s.domBottom}}eq(e){return e instanceof t?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,i)=>n.from==e.viewports[i].from&&n.to==e.viewports[i].to):!1}};function Pu(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new di(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map(r=>Pu(r,e)):t._content)}var Ep=I.define({combine:t=>t.join(" ")}),vv=I.define({combine:t=>t.indexOf(!0)>-1}),xv=Un.newName(),uM=Un.newName(),fM=Un.newName(),dM={"&light":"."+uM,"&dark":"."+fM};function Sv(t,e,n){return new Un(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return t;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):t+" "+i}})}var SF=Sv("."+xv,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},dM),wF={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},q1=L.ie&&L.ie_version<=11,wv=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Y1,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(L.ie&&L.ie_version<=11||L.ios&&e.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&L.android&&e.constructor.EDIT_CONTEXT!==!1&&!(L.chrome&&L.chrome_version<126)&&(this.editContext=new kv(e),e.state.facet(Cr)&&(e.contentDOM.editContext=this.editContext.editContext)),q1&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,i)=>n!=e[i]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(Cr)?i.root.activeElement!=this.dom:!zu(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(L.ie&&L.ie_version<=11||L.android&&L.chrome)&&!i.state.selection.main.empty&&r.focusNode&&Hu(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Xu(e.root);if(!n)return!1;let i=L.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&kF(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=zu(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&mU(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let i=this.dom;i;)if(i.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=n)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,wF),q1&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),q1&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var i;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&ya(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:e,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&zu(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new av(this.view,e,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=eM(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!Fp(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let i=hD(n,e.previousSibling||e.target.previousSibling,-1),r=hD(n,e.nextSibling||e.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Cr)!=e.state.facet(Cr)&&(e.view.contentDOM.editContext=e.state.facet(Cr)?this.editContext.editContext:null))}destroy(){var e,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function hD(t,e,n){for(;e;){let i=He.get(e);if(i&&i.parent==t)return i;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function pD(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return Hu(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function kF(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return pD(t,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?pD(t,n):null}var kv=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let c=a-l>i.text.length;l==this.from&&s<this.from?l=s:a==this.to&&s>this.to&&(a=s);let u=tM(e.state.sliceDoc(l,a),i.text,(c?r.from:r.to)-l,c?"end":null);if(!u){let d=R.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Fp(d,r)||e.dispatch({selection:d,userEvent:"select"});return}let f={from:u.from+l,to:u.toA+l,insert:fe.of(i.text.slice(u.from,u.toB).split(`
|
|
198
|
-
`))};if((L.mac||L.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:fe.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let d=this.to-this.from+(f.to-f.from+f.insert.length);qv(e,f,R.single(this.toEditorPos(i.selectionStart,d),this.toEditorPos(i.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from<f.to&&!f.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}n.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(a<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(Se.mark({attributes:{style:u}}).range(a,c))}}}e.dispatch({effects:jD.of(Se.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=Xu(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(i)return;let u=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,n+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}n+=u}),r&&!i&&this.revertPending(e.state),!i}update(e){let n=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},z=class t{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||pU(e.parent)||document,this.viewState=new jp(this,e.state||De.create(e)),e.scrollTo&&e.scrollTo.is(kp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(da).map(r=>new Fu(r));for(let r of this.plugins)r.update(this);this.observer=new wv(this),this.inputState=new cv(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Hp(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof mt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(d=>d.annotation(lM))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=aM(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(De.phrases)!=this.state.facet(De.phrases))return this.setState(s);r=Pp.create(this,s,e),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection,{x:p,y:g}=this.state.facet(t.cursorScrollMargin);f=new Uu(h.empty?h:R.cursor(h.head,h.head>h.anchor?-1:1),"nearest","nearest",g,p)}for(let h of d.effects)h.is(kp)&&(f=h.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=Yp.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(qu)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Ep)!=r.state.facet(Ep)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let d of this.state.facet(X1))try{d(r)}catch(h){kn(this.state,h,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!eM(this,u)&&c.force&&ya(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new jp(this,e),this.plugins=e.facet(da).map(i=>new Fu(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Hp(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(da),i=e.state.facet(da);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Fu(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);n!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(i){kn(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(DD(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(r);s=h.from,o=h.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return kn(this.state,p),mD}}),f=Pp.create(this,this.state,[]),d=!1;f.flags|=a,n?n.flags|=a:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h<c.length;h++)if(u[h]!=mD)try{let p=c[h];p.write&&p.write(u[h],this)}catch(p){kn(this.state,p)}if(d&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o)/this.scaleY;if((p>1||p<-1)&&!(L.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+p,i?i.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(X1))l(n)}get themeClasses(){return xv+" "+(this.state.facet(vv)?fM:uM)+" "+this.state.facet(Ep)}updateAttrs(){let e=gD(this,YD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Cr)?"true":"false",class:"cm-content",style:`${L.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),gD(this,Iv,n);let i=this.observer.ignore(()=>{let r=GE(this.contentDOM,this.contentAttrs,n),s=GE(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=n,i}showAnnouncements(e){let n=!0;for(let i of e)for(let r of i.effects)if(r.is(t.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(qu);let e=this.state.facet(t.cspNonce);Un.mount(this.root,this.styleModules.concat(SF).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(i=>i.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,i){return B1(this,e,eD(this,e,n,i))}moveByGroup(e,n){return B1(this,e,eD(this,e,n,i=>jU(this,e.head,i)))}visualLineSide(e,n){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[n?i.length-1:0];return R.cursor(s.side(n,r)+e.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,i=!0){return VU(this,e,n,i)}moveVertically(e,n,i){return B1(this,e,YU(this,e,n,i))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let i=sv(this,e,n);return i&&i.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),sv(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),s=r[Vn.find(r,e-i.from,-1,n)];return this.docView.coordsAt(e,n,s.dir==Ie.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet($D)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>AF)return _D(e.length);let n=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||ID(s.isolates,i=WE(this,e))))return s.order;i||(i=WE(this,e));let r=wU(e.text,n,i);return this.bidiCache.push(new Yp(e.from,e.to,n,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||L.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ED(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){var i,r,s,o;return kp.of(new Uu(typeof e=="number"?R.cursor(e):e,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return kp.of(new Uu(R.cursor(i.from),"start","start",i.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return jn.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return jn.define(()=>({}),{eventObservers:e})}static theme(e,n){let i=Un.newName(),r=[Ep.of(i),qu.of(Sv(`.${i}`,e))];return n&&n.dark&&r.push(vv.of(!0)),r}static baseTheme(e){return Bu.lowest(qu.of(Sv("."+xv,e,dM)))}static findFromDOM(e){var n;let i=e.querySelector(".cm-content"),r=i&&He.get(i)||He.get(e);return((n=r?.root)===null||n===void 0?void 0:n.view)||null}};z.styleModule=qu;z.inputHandler=UD;z.clipboardInputFilter=Nv;z.clipboardOutputFilter=Lv;z.scrollHandler=VD;z.focusChangeEffect=FD;z.perLineTextDirection=$D;z.exceptionSink=HD;z.updateListener=X1;z.editable=Cr;z.mouseSelectionStyle=zD;z.dragMovesSelection=PD;z.clickAddsSelectionRange=qD;z.decorations=em;z.blockWrappers=KD;z.outerDecorations=_v;z.atomicRanges=Zu;z.bidiIsolatedRanges=GD;z.cursorScrollMargin=I.define({combine:t=>{let e=5,n=5;for(let i of t)typeof i=="number"?e=n=i:{x:e,y:n}=i;return{x:e,y:n}}});z.scrollMargins=QD;z.darkTheme=vv;z.cspNonce=I.define({combine:t=>t.length?t[0]:""});z.contentAttributes=Iv;z.editorAttributes=YD;z.lineWrapping=z.contentAttributes.of({class:"cm-lineWrapping"});z.announce=pe.define();var AF=4096,mD={},Yp=class t{constructor(e,n,i,r,s,o){this.from=e,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:Ie.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!n.touchesRange(o.from,o.to)&&i.push(new t(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function gD(t,e,n){for(let i=t.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],o=typeof s=="function"?s(t):s;o&&Dv(o,n)}return n}var CF=L.mac?"mac":L.windows?"win":L.linux?"linux":"key";function OF(t,e){let n=t.split(/-(?!$)/),i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let a=0;a<n.length-1;++a){let c=n[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function Dp(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}var TF=Bu.default(z.domEventHandlers({keydown(t,e){return RF(EF(e.state),t,e,"editor")}})),Pv=I.define({enables:TF}),yD=new WeakMap;function EF(t){let e=t.facet(Pv),n=yD.get(e);return n||yD.set(e,n=MF(e.reduce((i,r)=>i.concat(r),[]))),n}var ks=null,DF=4e3;function MF(t,e=CF){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,c,u)=>{var f,d;let h=n[o]||(n[o]=Object.create(null)),p=l.split(/ (?!$)/).map(m=>OF(m,e));for(let m=1;m<p.length;m++){let y=p.slice(0,m).join(" ");r(y,!0),h[y]||(h[y]={preventDefault:!0,stopPropagation:!1,run:[v=>{let x=ks={view:v,prefix:y,scope:o};return setTimeout(()=>{ks==x&&(ks=null)},DF),!0}]})}let g=p.join(" ");r(g,!1);let b=h[g]||(h[g]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});a&&b.run.push(a),c&&(b.preventDefault=!0),u&&(b.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let d in u)u[d].run.push(h=>f(h,Av))}let a=o[e]||o.key;if(a)for(let c of l)s(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return n}var Av=null;function RF(t,e,n,i){Av=e;let r=$E(e),s=TE(r,0),o=EE(s)==r.length&&r!=" ",l="",a=!1,c=!1,u=!1;ks&&ks.view==n&&ks.scope==i&&(l=ks.prefix+" ",iM.indexOf(e.keyCode)<0&&(c=!0,ks=null));let f=new Set,d=b=>{if(b){for(let m of b.run)if(!f.has(m)&&(f.add(m),m(n)))return b.stopPropagation&&(u=!0),!0;b.preventDefault&&(b.stopPropagation&&(u=!0),c=!0)}return!1},h=t[i],p,g;return h&&(d(h[l+Dp(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(L.windows&&e.ctrlKey&&e.altKey)&&!(L.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=Ar[e.keyCode])&&p!=r?(d(h[l+Dp(p,e,!0)])||e.shiftKey&&(g=ua[e.keyCode])!=r&&g!=p&&d(h[l+Dp(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&d(h[l+Dp(r,e,!0)])&&(a=!0),!a&&d(h._any)&&(a=!0)),c&&(a=!0),a&&u&&e.stopPropagation(),Av=null,a}var Ade=/x/.unicode!=null?"gu":"g";var Mp="-10000px",Kp=class{constructor(e,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(e,n){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=n?[]:null;for(let a=0;a<s.length;a++){let c=s[a],u=-1;if(c){for(let f=0;f<this.tooltips.length;f++){let d=this.tooltips[f];d&&d.create==c.create&&(u=f)}if(u<0)o[a]=this.createTooltipView(c,a?o[a-1]:null),l&&(l[a]=!!c.above);else{let f=o[a]=this.tooltipViews[u];l&&(l[a]=n[u]),f.update&&f.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return n&&(l.forEach((a,c)=>n[c]=a),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}};function NF(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var P1=I.define({combine:t=>{var e,n,i;return{position:L.ios?"absolute":((e=t.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=t.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||NF}}}),bD=new WeakMap,hM=jn.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(P1);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Kp(t,nm,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,i=t.state.facet(P1);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),i=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=Mp,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(t=i.destroy)===null||t===void 0||t.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(L.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=Bv(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(P1).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=t,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:u}=c,f=t.pos[l],d=t.size[l];if(!f||a.clip!==!1&&(f.bottom<=Math.max(n.top,i.top)||f.top>=Math.min(n.bottom,i.bottom)||f.right<Math.max(n.left,i.left)-.1||f.left>Math.min(n.right,i.right)+.1)){u.style.top=Mp;continue}let h=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,g=d.right-d.left,b=(e=bD.get(c))!==null&&e!==void 0?e:d.bottom-d.top,m=c.offset||IF,y=this.view.textDirection==Ie.LTR,v=d.width>i.right-i.left?y?i.left:i.right-d.width:y?Math.max(i.left,Math.min(f.left-(h?14:0)+m.x,i.right-g)):Math.min(Math.max(i.left,f.left-g+(h?14:0)-m.x),i.right-g),x=this.above[l];!a.strictSide&&(x?f.top-b-p-m.y<i.top:f.bottom+b+p+m.y>i.bottom)&&x==i.bottom-f.bottom>f.top-i.top&&(x=this.above[l]=!x);let A=(x?f.top-i.top:i.bottom-f.bottom)-p;if(A<b&&c.resize!==!1){if(A<this.view.defaultLineHeight){u.style.top=Mp;continue}bD.set(c,b),u.style.height=(b=A)/s+"px"}else u.style.height&&(u.style.height="");let w=x?f.top-b-p-m.y:f.bottom+p+m.y,k=v+g;if(c.overlap!==!0)for(let C of o)C.left<k&&C.right>v&&C.top<w+b&&C.bottom>w&&(w=x?C.top-b-2-p:C.bottom+p+2);if(this.position=="absolute"?(u.style.top=(w-t.parent.top)/s+"px",vD(u,(v-t.parent.left)/r)):(u.style.top=w/s+"px",vD(u,v/r)),h){let C=f.left+(y?m.x:-m.x)-(v+14-7);h.style.left=C/r+"px"}c.overlap!==!0&&o.push({left:v,top:w,right:k,bottom:w+b}),u.classList.toggle("cm-tooltip-above",x),u.classList.toggle("cm-tooltip-below",!x),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Mp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function vD(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}var LF=z.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),IF={x:0,y:0},nm=I.define({enables:[hM,LF]}),Gp=I.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])}),Qp=class t{static create(e){return new t(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Kp(e,Gp,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(e,n){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}},_F=nm.compute([Gp],t=>{let e=t.facet(Gp);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:Qp.create,above:e[0].above,arrow:e.some(n=>n.arrow)}}),BF=I.define(),Cv=class{constructor(e,n,i,r,s,o){this.view=e,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,i=e.docView.tile.nearest(n.target);if(!i)return;let r,s=1;if(i.isWidget())r=i.posAtStart;else{if(r=e.posAtCoords(n),r==null)return;let o=e.coordsAtPos(r);if(!o||n.y<o.top||n.y>o.bottom||n.x<o.left-e.defaultCharacterWidth||n.x>o.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(c=>c.from<=r&&c.to>=r),a=l&&l.dir==Ie.RTL?-1:1;s=n.x<o.left?-a:a}this.activateHover(e,r,s)}activateHover(e,n,i,r){let s=this.source(e,n,i),o=l=>{if(l&&!(Array.isArray(l)&&!l.length)){let a=Array.isArray(l)?l:[l];r&&this.locked.set(a,r),e.dispatch({effects:this.setHover.of(a)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(a=>{this.pending==l&&(this.pending=null,o(a))},a=>kn(e.state,a,"hover tooltip"))}else o(s)}get tooltip(){let e=this.view.plugin(hM),n=e?e.manager.tooltips.findIndex(i=>i.create==Qp.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!qF(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!PF(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=i=>{e.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},Rp=4;function qF(t,e){let{left:n,right:i,top:r,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=n-Rp&&e.clientX<=i+Rp&&e.clientY>=r-Rp&&e.clientY<=s+Rp}function PF(t,e,n,i,r,s){let o=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,l)<r)return!1;let a=t.posAtCoords({x:i,y:r},!1);return a>=e&&a<=n}function pM(t,e={}){let n=pe.define(),i=new WeakMap,r=_t.define({create(){return[]},update(o,l){let a=i.get(o);if(o.length&&(e.hideOnChange&&(l.docChanged||l.selection)?o=[]:a&&a(l)?o=[]:e.hideOn&&(o=o.filter(c=>!e.hideOn(l,c)))),l.docChanged&&o.length){let c=[];for(let u of o){let f=l.changes.mapPos(u.pos,-1,Yt.TrackDel);if(f!=null){let d=Object.assign(Object.create(null),u);d.pos=f,d.end!=null&&(d.end=l.changes.mapPos(d.end)),c.push(d)}}o=c}for(let c of l.effects)c.is(n)&&(o=c.value,a=void 0),(c.is(zF)&&!c.value||c.value==r)&&(o=[]);return o.length&&a&&i.set(o,a),o},provide:o=>Gp.from(o)}),s=jn.define(o=>new Cv(o,t,r,i,n,e.hoverTime||300));return{active:r,extension:[r,s,BF.of(s),_F]}}var zF=pe.define();var xD=I.define({combine(t){let e,n;for(let i of t)e=e||i.topContainer,n=n||i.bottomContainer;return{topContainer:e,bottomContainer:n}}});var HF=jn.fromClass(class{constructor(t){this.input=t.state.facet(Xp),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(xD);this.top=new pa(t,!0,e.topContainer),this.bottom=new pa(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(xD);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new pa(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new pa(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Xp);if(n!=this.input){let i=n.filter(a=>a),r=[],s=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),u;c<0?(u=a(t.view),l.push(u)):(u=this.panels[c],u.update&&u.update(t)),r.push(u),(u.top?s:o).push(u)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>z.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),pa=class{constructor(e,n,i){this.view=e,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=SD(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=SD(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}};function SD(t){let e=t.nextSibling;return t.remove(),e}var Xp=I.define({enables:HF});var Yn=class extends Hi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Yn.prototype.elementClass="";Yn.prototype.toDOM=void 0;Yn.prototype.mapMode=Yt.TrackBefore;Yn.prototype.startSide=Yn.prototype.endSide=-1;Yn.prototype.point=!0;var z1=I.define(),UF=I.define(),FF={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>me.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Yu=I.define();function zv(t){return[mM(),Yu.of({...FF,...t})]}var Ov=I.define({combine:t=>t.some(e=>e)});function mM(t){let e=[$F];return t&&t.fixed===!1&&e.push(Ov.of(!0)),e}var $F=jn.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Yu).map(e=>new Wp(t,e)),this.fixed=!t.state.facet(Ov);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,i=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Ov)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=me.iter(this.view.state.facet(z1),this.view.viewport.from),i=[],r=this.gutters.map(s=>new Ev(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==ln.Text&&o){Tv(n,i,l.from);for(let a of r)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of r)a.widget(this.view,l)}else if(s.type==ln.Text){Tv(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Yu),n=t.state.facet(Yu),i=t.docChanged||t.heightChanged||t.viewportChanged||!me.eq(t.startState.facet(z1),t.state.facet(z1),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let r of this.gutters)r.update(t)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=e.indexOf(s);o<0?r.push(new Wp(this.view,s)):(this.gutters[o].update(t),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>z.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*e.scaleX,r=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Ie.LTR?{left:i,right:r}:{right:i,left:r}})});function wD(t){return Array.isArray(t)?t:[t]}function Tv(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}var Ev=class{constructor(e,n,i){this.gutter=e,this.height=i,this.i=0,this.cursor=me.iter(e.markers,n.from)}addElement(e,n,i){let{gutter:r}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==r.elements.length){let l=new Zp(e,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,o,s,i);this.height=n.bottom,this.i++}line(e,n,i){let r=[];Tv(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,r)}widget(e,n){let i=this.gutter.config.widgetMarker(e,n.widget,n),r=i?[i]:null;for(let s of e.state.facet(UF)){let o=s(e,n.widget,n);o&&(r||(r=[])).push(o)}r&&this.addElement(e,n,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}},Wp=class{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=r.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[i](e,l,r)&&r.preventDefault()});this.markers=wD(n.markers(e)),n.initialSpacer&&(this.spacer=new Zp(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=wD(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!me.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Zp=class{constructor(e,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,i,r)}update(e,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),VF(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,a=s<n.length?n[s++]:null,c=!1;if(a){let u=a.elementClass;u&&(i+=" "+u);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(a)){l=f,c=!0;break}}else l=this.markers.length;for(;o<l;){let u=this.markers[o++];if(u.toDOM){u.destroy(r);let f=r.nextSibling;r.remove(),r=f}}if(!a)break;a.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(a.toDOM(e),r)),c&&o++}this.dom.className=i,this.markers=n}destroy(){this.setMarkers(null,[])}};function VF(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}var jF=I.define(),YF=I.define(),ma=I.define({combine(t){return ws(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let i=Object.assign({},e);for(let r in n){let s=i[r],o=n[r];i[r]=s?(l,a,c)=>s(l,a,c)||o(l,a,c):o}return i}})}}),Ku=class extends Yn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function H1(t,e){return t.state.facet(ma).formatNumber(e,t.state)}var KF=Yu.compute([ma],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(jF)},lineMarker(e,n,i){return i.some(r=>r.toDOM)?null:new Ku(H1(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,i)=>{for(let r of e.state.facet(YF)){let s=r(e,n,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(ma)!=e.state.facet(ma),initialSpacer(e){return new Ku(H1(e,kD(e.state.doc.lines)))},updateSpacer(e,n){let i=H1(n.view,kD(n.view.state.doc.lines));return i==e.number?e:new Ku(i)},domEventHandlers:t.facet(ma).domEventHandlers,side:"before"}));function gM(t={}){return[ma.of(t),mM(),KF]}function kD(t){let e=9;for(;e<t;)e=e*10+9;return e}var GF=0,Ju=class{constructor(e,n){this.from=e,this.to=n}},G=class{constructor(e={}){this.id=GF++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Bt.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}};G.closedBy=new G({deserialize:t=>t.split(" ")});G.openedBy=new G({deserialize:t=>t.split(" ")});G.group=new G({deserialize:t=>t.split(" ")});G.isolate=new G({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});G.contextHash=new G({perNode:!0});G.lookAhead=new G({perNode:!0});G.mounted=new G({perNode:!0});var To=class{constructor(e,n,i,r=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[G.mounted.id]}},QF=Object.create(null),Bt=class t{constructor(e,n,i,r=0){this.name=e,this.props=n,this.id=i,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):QF,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new t(e.name||"",n,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(G.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let r of i.split(" "))n[r]=e[i];return i=>{for(let r=i.prop(G.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}};Bt.none=new Bt("",Object.create(null),0,8);var ef=class t{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let i of this.types){let r=null;for(let s of e){let o=s(i);if(o){r||(r=Object.assign({},i.props));let l=o[1],a=o[0];a.combine&&a.id in r&&(l=a.combine(r[a.id],l)),r[a.id]=l}}n.push(r?new Bt(i.name,r,i.id,i.flags):i)}return new t(n)}},im=new WeakMap,yM=new WeakMap,Ue;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(Ue||(Ue={}));var Ge=class t{constructor(e,n,i,r,s){if(this.type=e,this.children=n,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=To.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let i of this.children){let r=i.toString();r&&(n&&(n+=","),n+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new rf(this.topNode,e)}cursorAt(e,n=0,i=0){let r=im.get(this)||this.topNode,s=new rf(r);return s.moveTo(e,n),im.set(this,s._tree),s}get topNode(){return new $i(this,0,0,null)}resolve(e,n=0){let i=tf(im.get(this)||this.topNode,e,n,!1);return im.set(this,i),i}resolveInner(e,n=0){let i=tf(yM.get(this)||this.topNode,e,n,!0);return yM.set(this,i),i}resolveStack(e,n=0){return XF(this,e,n)}iterate(e){let{enter:n,leave:i,from:r=0,to:s=this.length}=e,o=e.mode||0,l=(o&Ue.IncludeAnonymous)>0;for(let a=this.cursor(o|Ue.IncludeAnonymous);;){let c=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||n(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:Yv(Bt.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new t(this.type,n,i,r,this.propValues),e.makeTree||((n,i,r)=>new t(Bt.none,n,i,r)))}static build(e){return WF(e)}};Ge.empty=new Ge(Bt.none,[],[],0);var Hv=class t{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new t(this.buffer,this.index)}},Ts=class t{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return Bt.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],i=this.buffer[e+3],r=this.set.types[n],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,n,i,r,s){let{buffer:o}=this,l=-1;for(let a=e;a!=n&&!(xM(s,r,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(e,n,i){let r=this.buffer,s=new Uint16Array(n-e),o=0;for(let l=e,a=0;l<n;){s[a++]=r[l++],s[a++]=r[l++]-i;let c=s[a++]=r[l++]-i;s[a++]=r[l++]-e,o=Math.max(o,c)}return new t(s,o,this.set)}};function xM(t,e,n,i){switch(t){case-2:return n<e;case-1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function tf(t,e,n,i){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let o=!i&&t instanceof $i&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=i?0:Ue.IgnoreOverlays;if(i)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof $i&&o.index<0&&((r=l.enter(e,n,s))===null||r===void 0?void 0:r.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,n,s);if(!o)return t;t=o}}var sm=class{cursor(e=0){return new rf(this,e)}getChild(e,n=null,i=null){let r=bM(this,e,n,i);return r.length?r[0]:null}getChildren(e,n=null,i=null){return bM(this,e,n,i)}resolve(e,n=0){return tf(this,e,n,!1)}resolveInner(e,n=0){return tf(this,e,n,!0)}matchContext(e){return Uv(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),i=this;for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(i=n,n=r.prevSibling):n=r}return i}get node(){return this}get next(){return this.parent}},$i=class t extends sm{constructor(e,n,i,r){super(),this._tree=e,this.from=n,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,i,r,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=n>0?l.length:-1;e!=c;e+=n){let u=l[e],f=a[e]+o.from,d;if(!(!(s&Ue.EnterBracketed&&u instanceof Ge&&(d=To.get(u))&&!d.overlay&&d.bracketed&&i>=f&&i<=f+u.length)&&!xM(r,i,f,f+u.length))){if(u instanceof Ts){if(s&Ue.ExcludeBuffers)continue;let h=u.findChild(0,u.buffer.length,n,i-f,r);if(h>-1)return new nf(new Fv(o,u,e,f),null,h)}else if(s&Ue.IncludeAnonymous||!u.type.isAnonymous||jv(u)){let h;if(!(s&Ue.IgnoreMounts)&&(h=To.get(u))&&!h.overlay)return new t(h.tree,f,e,o);let p=new t(u,f,e,o);return s&Ue.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?u.children.length-1:0,n,i,r,s)}}}if(s&Ue.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,i=0){let r;if(!(i&Ue.IgnoreOverlays)&&(r=To.get(this._tree))&&r.overlay){let s=e-this.from,o=i&Ue.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((n>0||o?l<=s:l<s)&&(n<0||o?a>=s:a>s))return new t(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function bM(t,e,n,i){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function Uv(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}var Fv=class{constructor(e,n,i,r){this.parent=e,this.buffer=n,this.index=i,this.start=r}},nf=class t extends sm{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,i);return s<0?null:new t(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,i=0){if(i&Ue.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new t(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new t(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new t(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),n.push(0)}return new Ge(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function SM(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let o=t[s];(o.from>n.from||o.to<n.to)&&(n=o,e=s)}let i=n instanceof $i&&n.index<0?null:n.parent,r=t.slice();return i?r[e]=i:r.splice(e,1),new $v(r,n)}var $v=class{constructor(e,n){this.heads=e,this.node=n}get next(){return SM(this.heads)}};function XF(t,e,n){let i=t.resolveInner(e,n),r=null;for(let s=i instanceof $i?i:i.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[i])).push(o.resolve(e,n)),s=o}else{let o=To.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new $i(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(tf(l,e,n,!1))}}return r?SM(r):i}var rf=class{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Ue.EnterBracketed,e instanceof $i)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof $i?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,i=this.mode){return this.buffer?i&Ue.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ue.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ue.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:i}=r)}else({index:n,_parent:i}=this._tree);for(;i;{index:n,_parent:i}=i)if(n>-1)for(let s=n+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let l=i._tree.children[s];if(this.mode&Ue.IncludeAnonymous||l instanceof Ts||!l.type.isAnonymous||jv(l))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)n=new nf(this.buffer,n,this.stack[r]);return this.bufferNode=new nf(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&n&&n(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return Uv(this.node.parent,e);let{buffer:n}=this.buffer,{types:i}=n.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return Uv(this._tree,e,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function jv(t){return t.children.some(e=>e instanceof Ts||!e.type.isAnonymous||jv(e))}function WF(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=i.types.length}=t,l=Array.isArray(n)?new Hv(n,n.length):n,a=i.types,c=0,u=0;function f(A,w,k,C,O,M){let{id:_,start:D,end:F,size:V}=l,ae=u,$e=c;if(V<0)if(l.next(),V==-1){let At=s[_];k.push(At),C.push(D-A);return}else if(V==-3){c=_;return}else if(V==-4){u=_;return}else throw new RangeError(`Unrecognized record size: ${V}`);let Xt=a[_],he,et,Wn=D-A;if(F-D<=r&&(et=b(l.pos-w,O))){let At=new Uint16Array(et.size-et.skip),Ve=l.pos-et.size,yt=At.length;for(;l.pos>Ve;)yt=m(et.start,At,yt);he=new Ts(At,F-et.start,i),Wn=et.start-A}else{let At=l.pos-V;l.next();let Ve=[],yt=[],bt=_>=o?_:-1,cn=0,un=F;for(;l.pos>At;)bt>=0&&l.id==bt&&l.size>=0?(l.end<=un-r&&(p(Ve,yt,D,cn,l.end,un,bt,ae,$e),cn=Ve.length,un=l.end),l.next()):M>2500?d(D,At,Ve,yt):f(D,At,Ve,yt,bt,M+1);if(bt>=0&&cn>0&&cn<Ve.length&&p(Ve,yt,D,cn,D,un,bt,ae,$e),Ve.reverse(),yt.reverse(),bt>-1&&cn>0){let Zn=h(Xt,$e);he=Yv(Xt,Ve,yt,0,Ve.length,0,F-D,Zn,Zn)}else he=g(Xt,Ve,yt,F-D,ae-F,$e)}k.push(he),C.push(Wn)}function d(A,w,k,C){let O=[],M=0,_=-1;for(;l.pos>w;){let{id:D,start:F,end:V,size:ae}=l;if(ae>4)l.next();else{if(_>-1&&F<_)break;_<0&&(_=V-r),O.push(D,F,V),M++,l.next()}}if(M){let D=new Uint16Array(M*4),F=O[O.length-2];for(let V=O.length-3,ae=0;V>=0;V-=3)D[ae++]=O[V],D[ae++]=O[V+1]-F,D[ae++]=O[V+2]-F,D[ae++]=ae;k.push(new Ts(D,O[2]-F,i)),C.push(F-A)}}function h(A,w){return(k,C,O)=>{let M=0,_=k.length-1,D,F;if(_>=0&&(D=k[_])instanceof Ge){if(!_&&D.type==A&&D.length==O)return D;(F=D.prop(G.lookAhead))&&(M=C[_]+D.length+F)}return g(A,k,C,O,M,w)}}function p(A,w,k,C,O,M,_,D,F){let V=[],ae=[];for(;A.length>C;)V.push(A.pop()),ae.push(w.pop()+k-O);A.push(g(i.types[_],V,ae,M-O,D-M,F)),w.push(O-k)}function g(A,w,k,C,O,M,_){if(M){let D=[G.contextHash,M];_=_?[D].concat(_):[D]}if(O>25){let D=[G.lookAhead,O];_=_?[D].concat(_):[D]}return new Ge(A,w,k,C,_)}function b(A,w){let k=l.fork(),C=0,O=0,M=0,_=k.end-r,D={size:0,start:0,skip:0};e:for(let F=k.pos-A;k.pos>F;){let V=k.size;if(k.id==w&&V>=0){D.size=C,D.start=O,D.skip=M,M+=4,C+=4,k.next();continue}let ae=k.pos-V;if(V<0||ae<F||k.start<_)break;let $e=k.id>=o?4:0,Xt=k.start;for(k.next();k.pos>ae;){if(k.size<0)if(k.size==-3||k.size==-4)$e+=4;else break e;else k.id>=o&&($e+=4);k.next()}O=Xt,C+=V,M+=$e}return(w<0||C==A)&&(D.size=C,D.start=O,D.skip=M),D.size>4?D:void 0}function m(A,w,k){let{id:C,start:O,end:M,size:_}=l;if(l.next(),_>=0&&C<o){let D=k;if(_>4){let F=l.pos-(_-4);for(;l.pos>F;)k=m(A,w,k)}w[--k]=D,w[--k]=M-A,w[--k]=O-A,w[--k]=C}else _==-3?c=C:_==-4&&(u=C);return k}let y=[],v=[];for(;l.pos>0;)f(t.start||0,t.bufferStart||0,y,v,-1,0);let x=(e=t.length)!==null&&e!==void 0?e:y.length?v[0]+y[0].length:0;return new Ge(a[t.topID],y.reverse(),v.reverse(),x)}var vM=new WeakMap;function rm(t,e){if(!t.isAnonymous||e instanceof Ts||e.type!=t)return 1;let n=vM.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof Ge)){n=1;break}n+=rm(t,i)}vM.set(e,n)}return n}function Yv(t,e,n,i,r,s,o,l,a){let c=0;for(let p=i;p<r;p++)c+=rm(t,e[p]);let u=Math.ceil(c*1.5/8),f=[],d=[];function h(p,g,b,m,y){for(let v=b;v<m;){let x=v,A=g[v],w=rm(t,p[v]);for(v++;v<m;v++){let k=rm(t,p[v]);if(w+k>=u)break;w+=k}if(v==x+1){if(w>u){let k=p[x];h(k.children,k.positions,0,k.children.length,g[x]+y);continue}f.push(p[x])}else{let k=g[v-1]+p[v-1].length-A;f.push(Yv(t,p,g,x,v,A,k,null,a))}d.push(A+y-s)}}return h(e,n,i,r,0),(l||a)(f,d,o)}var Eo=class t{constructor(e,n,i,r,s=!1,o=!1){this.from=e,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let r=[new t(0,e.length,e,0,!1,i)];for(let s of n)s.to>e.length&&r.push(s);return r}static applyChanges(e,n,i=128){if(!n.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let u=l<n.length?n[l]:null,f=u?u.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let d=o;if(a>=d.from||f<=d.to||c){let h=Math.max(d.from,a)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new t(h,p,d.tree,d.offset+c,l>0,!!u)}if(d&&r.push(d),o.to>f)break;o=s<e.length?e[s++]:null}if(!u)break;a=u.toA,c=u.toA-u.toB}return r}},ka=class{startParse(e,n,i){return typeof e=="string"&&(e=new Vv(e)),i=i?i.length?i.map(r=>new Ju(r.from,r.to)):[new Ju(0,0)]:[new Ju(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let r=this.startParse(e,n,i);for(;;){let s=r.advance();if(s)return s}}},Vv=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}};var Mde=new G({perNode:!0});var ZF=0,mi=class t{constructor(e,n,i,r){this.name=e,this.set=n,this.base=i,this.modified=r,this.id=ZF++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof t&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let r=new t(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(e){let n=new cm(e);return i=>i.modified.indexOf(n)>-1?i:cm.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},JF=0,cm=class t{constructor(e){this.name=e,this.instances=[],this.id=JF++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(l=>l.base==e&&e$(n,l.modified));if(i)return i;let r=[],s=new mi(e.name,r,e,n);for(let l of n)l.instances.push(s);let o=t$(n);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(t.get(l,a));return s}};function e$(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function t$(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(t[n]));return e.sort((n,i)=>i.length-n.length)}function Aa(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!d)throw new RangeError("Invalid path: "+r);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==r.length)break;let h=r[f++];if(f==r.length&&h=="!"){o=0;break}if(h!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let u=new Mo(i,o,a>0?s.slice(0,a):null);e[c]=u.sort(e[c])}}return AM.add(e)}var AM=new G({combine(t,e){let n,i,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new Mo(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}}),Mo=class{constructor(e,n,i,r){this.tags=e,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};Mo.empty=new Mo([],2,null);function Xv(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let o of s.tag)n[o.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let o=r;for(let l of s)for(let a of l.set){let c=n[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function n$(t,e){let n=null;for(let i of t){let r=i.style(e);r&&(n=n?n+" "+r:r)}return n}function CM(t,e,n,i=0,r=t.length){let s=new Gv(i,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),i,r,"",s.highlighters),s.flush(r)}var Gv=class{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,i,r,s){let{type:o,from:l,to:a}=e;if(l>=i||a<=n)return;o.isTop&&(s=this.highlighters.filter(h=>!h.scope||h.scope(o)));let c=r,u=i$(e)||Mo.empty,f=n$(s,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),c),u.opaque)return;let d=e.tree&&e.tree.prop(G.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+l,1),p=this.highlighters.filter(b=>!b.scope||b.scope(d.tree.type)),g=e.firstChild();for(let b=0,m=l;;b++){let y=b<d.overlay.length?d.overlay[b]:null,v=y?y.from+l:a,x=Math.max(n,m),A=Math.min(i,v);if(x<A&&g)for(;e.from<A&&(this.highlightRange(e,x,A,r,s),this.startSpan(Math.min(A,e.to),c),!(e.to>=v||!e.nextSibling())););if(!y||v>i)break;m=y.to+l,m>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+l),Math.min(i,m),"",p),this.startSpan(Math.min(i,m),c))}g&&e.parent()}else if(e.firstChild()){d&&(r="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,r,s),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}};function i$(t){let e=t.type.prop(AM);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}var N=mi.define,om=N(),Es=N(),wM=N(Es),kM=N(Es),Ds=N(),lm=N(Ds),Kv=N(Ds),Yi=N(),Do=N(Yi),Vi=N(),ji=N(),Qv=N(),sf=N(Qv),am=N(),T={comment:om,lineComment:N(om),blockComment:N(om),docComment:N(om),name:Es,variableName:N(Es),typeName:wM,tagName:N(wM),propertyName:kM,attributeName:N(kM),className:N(Es),labelName:N(Es),namespace:N(Es),macroName:N(Es),literal:Ds,string:lm,docString:N(lm),character:N(lm),attributeValue:N(lm),number:Kv,integer:N(Kv),float:N(Kv),bool:N(Ds),regexp:N(Ds),escape:N(Ds),color:N(Ds),url:N(Ds),keyword:Vi,self:N(Vi),null:N(Vi),atom:N(Vi),unit:N(Vi),modifier:N(Vi),operatorKeyword:N(Vi),controlKeyword:N(Vi),definitionKeyword:N(Vi),moduleKeyword:N(Vi),operator:ji,derefOperator:N(ji),arithmeticOperator:N(ji),logicOperator:N(ji),bitwiseOperator:N(ji),compareOperator:N(ji),updateOperator:N(ji),definitionOperator:N(ji),typeOperator:N(ji),controlOperator:N(ji),punctuation:Qv,separator:N(Qv),bracket:sf,angleBracket:N(sf),squareBracket:N(sf),paren:N(sf),brace:N(sf),content:Yi,heading:Do,heading1:N(Do),heading2:N(Do),heading3:N(Do),heading4:N(Do),heading5:N(Do),heading6:N(Do),contentSeparator:N(Yi),list:N(Yi),quote:N(Yi),emphasis:N(Yi),strong:N(Yi),link:N(Yi),monospace:N(Yi),strikethrough:N(Yi),inserted:N(),deleted:N(),changed:N(),invalid:N(),meta:am,documentMeta:N(am),annotation:N(am),processingInstruction:N(am),definition:mi.defineModifier("definition"),constant:mi.defineModifier("constant"),function:mi.defineModifier("function"),standard:mi.defineModifier("standard"),local:mi.defineModifier("local"),special:mi.defineModifier("special")};for(let t in T){let e=T[t];e instanceof mi&&(e.name=t)}var Lde=Xv([{tag:T.link,class:"tok-link"},{tag:T.heading,class:"tok-heading"},{tag:T.emphasis,class:"tok-emphasis"},{tag:T.strong,class:"tok-strong"},{tag:T.keyword,class:"tok-keyword"},{tag:T.atom,class:"tok-atom"},{tag:T.bool,class:"tok-bool"},{tag:T.url,class:"tok-url"},{tag:T.labelName,class:"tok-labelName"},{tag:T.inserted,class:"tok-inserted"},{tag:T.deleted,class:"tok-deleted"},{tag:T.literal,class:"tok-literal"},{tag:T.string,class:"tok-string"},{tag:T.number,class:"tok-number"},{tag:[T.regexp,T.escape,T.special(T.string)],class:"tok-string2"},{tag:T.variableName,class:"tok-variableName"},{tag:T.local(T.variableName),class:"tok-variableName tok-local"},{tag:T.definition(T.variableName),class:"tok-variableName tok-definition"},{tag:T.special(T.variableName),class:"tok-variableName2"},{tag:T.definition(T.propertyName),class:"tok-propertyName tok-definition"},{tag:T.typeName,class:"tok-typeName"},{tag:T.namespace,class:"tok-namespace"},{tag:T.className,class:"tok-className"},{tag:T.macroName,class:"tok-macroName"},{tag:T.propertyName,class:"tok-propertyName"},{tag:T.operator,class:"tok-operator"},{tag:T.comment,class:"tok-comment"},{tag:T.meta,class:"tok-meta"},{tag:T.invalid,class:"tok-invalid"},{tag:T.punctuation,class:"tok-punctuation"}]);var Wv,Ca=new G;function r$(t){return I.define({combine:t?e=>e.concat(t):void 0})}var s$=new G,Cn=class{constructor(e,n,i=[],r=""){this.data=e,this.name=r,De.prototype.hasOwnProperty("tree")||Object.defineProperty(De.prototype,"tree",{get(){return gi(this)}}),this.parser=n,this.extension=[Oa.of(this),De.languageData.of((s,o,l)=>{let a=OM(s,o,l),c=a.type.prop(Ca);if(!c)return[];let u=s.facet(c),f=a.type.prop(s$);if(f){let d=a.resolve(o-a.from,l);for(let h of f)if(h.test(d,s)){let p=s.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(i)}isActiveAt(e,n,i=-1){return OM(e,n,i).type.prop(Ca)==this.data}findRegions(e){let n=e.facet(Oa);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(Ca)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(G.mounted);if(l){if(l.tree.prop(Ca)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let a=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<s.children.length;a++){let c=s.children[a];c instanceof Ge&&r(c,s.positions[a]+o)}};return r(gi(e),0),i}get allowsNesting(){return!0}};Cn.setState=pe.define();function OM(t,e,n){let i=t.facet(Oa),r=gi(t).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,n,Ue.ExcludeBuffers|Ue.EnterBracketed))s.type.isTop&&(r=s);return r}var lf=class t extends Cn{constructor(e,n,i){super(e,n,[],i),this.parser=n}static define(e){let n=r$(e.languageData);return new t(n,e.parser.configure({props:[Ca.add(i=>i.isTop?n:void 0)]}),e.name)}configure(e,n){return new t(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function gi(t){let e=t.field(Cn.state,!1);return e?e.tree:Ge.empty}var tx=class{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let i=this.cursorPos-this.string.length;return e<i||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}},of=null,nx=class t{constructor(e,n,i=[],r,s,o,l,a){this.parser=e,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new t(e,n,[],Ge.empty,0,i,[],null)}startParse(){return this.parser.startParse(new tx(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ge.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Eo.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Eo.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=of;of=this;try{return e()}finally{of=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=TM(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,u,f,d)=>a.push({fromA:c,toA:u,fromB:f,toB:d})),i=Eo.applyChanges(i,a),r=Ge.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);u<f&&l.push({from:u,to:f})}}}return new t(this.parser,n,i,r,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=TM(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends ka{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=of;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new Ge(Bt.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return of}};function TM(t,e,n){return Eo.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}var af=class t{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new t(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=nx.create(e.facet(Oa).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new t(i)}};Cn.state=_t.define({create:af.init,update(t,e){for(let n of e.effects)if(n.is(Cn.setState))return n.value;return e.startState.facet(Oa)!=e.state.facet(Oa)?af.init(e.state):t.apply(e)}});var RM=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(RM=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});var Zv=typeof navigator<"u"&&(!((Wv=navigator.scheduling)===null||Wv===void 0)&&Wv.isInputPending)?()=>navigator.scheduling.isInputPending():null,o$=jn.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Cn.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Cn.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=RM(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,s=i.field(Cn.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Zv?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&i.doc.length>r+1e3,a=s.context.work(()=>Zv&&Zv()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Cn.setState.of(new af(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>kn(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Oa=I.define({combine(t){return t.length?t[0]:null},enables:t=>[Cn.state,o$,z.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),um=class{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}};var l$=I.define(),fm=I.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function cf(t){let e=t.facet(fm);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function uf(t,e){let n="",i=t.tabSize,r=t.facet(fm)[0];if(r==" "){for(;e>=i;)n+=" ",e-=i;r=" "}for(let s=0;s<e;s++)n+=r;return n}function ax(t,e){t instanceof De&&(t=new Ro(t));for(let i of t.state.facet(l$)){let r=i(t,e);if(r!==void 0)return r}let n=gi(t.state);return n.length>=e?a$(t,n,e):null}var Ro=class{constructor(e,n={}){this.state=e,this.options=n,this.unit=cf(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(n<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,n);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.countColumn(i,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,n=e.length){return So(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},cx=new G;function a$(t,e,n){let i=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return NM(i,t,n)}function NM(t,e,n){for(let i=t;i;i=i.next){let r=u$(i.node);if(r)return r(ix.create(e,n,i))}return 0}function c$(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function u$(t){let e=t.type.prop(cx);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(G.closedBy))){let r=t.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>LM(o,!0,1,void 0,s&&!c$(o)?r.from:void 0)}return t.parent==null?f$:null}function f$(){return 0}var ix=class t extends Ro{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new t(e,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(d$(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return NM(this.context.next,this.base,this.pos)}};function d$(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function h$(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+c}}l=a.to}}function ux({closing:t,align:e=!0,units:n=1}){return i=>LM(i,e,n,t)}function LM(t,e,n,i,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==t.pos+o,a=e?h$(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*n)}var IM=new G;function _M(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}var Ta=class t{constructor(e,n){this.specs=e;let i;function r(l){let a=Un.newName();return(i||(i=Object.create(null)))["."+a]=l,a}let s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof Cn?l=>l.prop(Ca)==o.data:o?l=>l==o:void 0,this.style=Xv(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new Un(i):null,this.themeType=n.themeType}static define(e,n){return new t(e,n||{})}},rx=I.define(),BM=I.define({combine(t){return t.length?[t[0]]:null}});function Jv(t){let e=t.facet(rx);return e.length?e:t.facet(BM)}function qM(t,e){let n=[p$],i;return t instanceof Ta&&(t.module&&n.push(z.styleModule.of(t.module)),i=t.themeType),e?.fallback?n.push(BM.of(t)):i?n.push(rx.computeN([z.darkTheme],r=>r.facet(z.darkTheme)==(i=="dark")?[t]:[])):n.push(rx.of(t)),n}var sx=class{constructor(e){this.markCache=Object.create(null),this.tree=gi(e.state),this.decorations=this.buildDeco(e,Jv(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=gi(e.state),i=Jv(e.state),r=i!=Jv(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!r&&n.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return Se.none;let i=new kr;for(let{from:r,to:s}of e.visibleRanges)CM(this.tree,n,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=Se.mark({class:a})))},r,s);return i.finish()}},p$=Bu.high(jn.fromClass(sx,{decorations:t=>t.decorations})),Ude=Ta.define([{tag:T.meta,color:"#404740"},{tag:T.link,textDecoration:"underline"},{tag:T.heading,textDecoration:"underline",fontWeight:"bold"},{tag:T.emphasis,fontStyle:"italic"},{tag:T.strong,fontWeight:"bold"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:T.keyword,color:"#708"},{tag:[T.atom,T.bool,T.url,T.contentSeparator,T.labelName],color:"#219"},{tag:[T.literal,T.inserted],color:"#164"},{tag:[T.string,T.deleted],color:"#a11"},{tag:[T.regexp,T.escape,T.special(T.string)],color:"#e40"},{tag:T.definition(T.variableName),color:"#00f"},{tag:T.local(T.variableName),color:"#30a"},{tag:[T.typeName,T.namespace],color:"#085"},{tag:T.className,color:"#167"},{tag:[T.special(T.variableName),T.macroName],color:"#256"},{tag:T.definition(T.propertyName),color:"#00c"},{tag:T.comment,color:"#940"},{tag:T.invalid,color:"#f00"}]);var m$=1e4,g$="()[]{}";var y$=new G;function ox(t,e,n){let i=t.prop(e<0?G.openedBy:G.closedBy);if(i)return i;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function lx(t){let e=t.type.prop(y$);return e?e(t.node):t}function No(t,e,n,i={}){let r=i.maxScanDistance||m$,s=i.brackets||g$,o=gi(t),l=o.resolveInner(e,n);for(let a=l;a;a=a.parent){let c=ox(a.type,n,s);if(c&&a.from<a.to){let u=lx(a);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return b$(t,e,n,a,u,c,s)}}return v$(t,e,n,o,l.type,r,s)}function b$(t,e,n,i,r,s,o){let l=i.parent,a={from:r.from,to:r.to},c=0,u=l?.cursor();if(u&&(n<0?u.childBefore(i.from):u.childAfter(i.to)))do if(n<0?u.to<=i.from:u.from>=i.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let f=lx(u);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(ox(u.type,n,o))c++;else if(ox(u.type,-n,o)){if(c==0){let f=lx(u);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:a,matched:!1}}function v$(t,e,n,i,r,s,o){if(n<0?!e:e==t.doc.length)return null;let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=s;){let h=u.value;n<0&&(d+=h.length);let p=e+d*n;for(let g=n>0?0:h.length-1,b=n>0?h.length:-1;g!=b;g+=n){let m=o.indexOf(h[g]);if(!(m<0||i.resolveInner(p+g,1).type!=r))if(m%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:m>>1==a>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}var x$=Object.create(null),EM=[Bt.none];var DM=[],MM=Object.create(null),S$=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])S$[t]=w$(x$,e);function ex(t,e){DM.indexOf(t)>-1||(DM.push(t),console.warn(e))}function w$(t,e){let n=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=t[c]||T[c];u?typeof u=="function"?a.length?a=a.map(u):ex(c,`Modifier ${c} used at start of tag`):a.length?ex(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:ex(c,`Unknown highlighting tag ${c}`)}for(let c of a)n.push(c)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=MM[r];if(s)return s.id;let o=MM[r]=Bt.define({id:EM.length,name:i,props:[Aa({[i]:n})]});return EM.push(o),o.id}var Fde={rtl:Se.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:Ie.RTL}),ltr:Se.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:Ie.LTR}),auto:Se.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var k$=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=yx(t.state,n.from);return i.line?A$(t):i.block?O$(t):!1};function gx(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(i(n.update(r)),!0):!1}}var A$=gx(D$,0);var C$=gx(YM,0);var O$=gx((t,e)=>YM(t,e,E$(e)),0);function yx(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}var ff=50;function T$(t,{open:e,close:n},i,r){let s=t.sliceDoc(i-ff,i),o=t.sliceDoc(r,r+ff),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,c=s.length-l;if(s.slice(c-e.length,c)==e&&o.slice(a,a+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let u,f;r-i<=2*ff?u=f=t.sliceDoc(i,r):(u=t.sliceDoc(i,i+ff),f=t.sliceDoc(r-ff,r));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-n.length;return u.slice(d,d+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:i+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:r-h-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function E$(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function YM(t,e,n=e.selection.ranges){let i=n.map(s=>yx(e,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>T$(e,i[o],s.from,s.to));if(t!=2&&!r.every(s=>s))return{changes:e.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(t!=1&&r.some(s=>s)){let s=[];for(let o=0,l;o<r.length;o++)if(l=r[o]){let a=i[o],{open:c,close:u}=l;s.push({from:c.pos-a.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+a.close.length})}return{changes:s}}return null}function D$(t,e,n=e.selection.ranges){let i=[],r=-1;e:for(let{from:s,to:o}of n){let l=i.length,a=1e9,c;for(let u=s;u<=o;){let f=e.doc.lineAt(u);if(c==null&&(c=yx(e,f.from).line,!c))continue e;if(f.from>r&&(s==o||o>f.from)){r=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+c.length)==c?d:-1;d<f.text.length&&d<a&&(a=d),i.push({line:f,comment:p,token:c,indent:d,empty:h,single:!1})}u=f.to+1}if(a<1e9)for(let u=l;u<i.length;u++)i[u].indent<i[u].line.text.length&&(i[u].indent=a);i.length==l+1&&(i[l].single=!0)}if(t!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:c,empty:u,single:f}of i)(f||!u)&&s.push({from:l.from+c,insert:a+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,u=c+a.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}var dx=Hn.define(),M$=Hn.define(),R$=I.define(),KM=I.define({combine(t){return ws(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,r)=>e(i,r)||n(i,r)})}}),GM=_t.define({create(){return Lo.empty},update(t,e){let n=e.state.facet(KM),i=e.annotation(dx);if(i){let a=yi.fromTransaction(e,i.selection),c=i.side,u=c==0?t.undone:t.done;return a?u=hm(u,u.length,n.minDepth,a):u=ZM(u,e.startState.selection),new Lo(c==0?i.rest:u,c==0?u:i.rest)}let r=e.annotation(M$);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(mt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=yi.fromTransaction(e),o=e.annotation(mt.time),l=e.annotation(mt.userEvent);return s?t=t.addChanges(s,o,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Lo(t.done.map(yi.fromJSON),t.undone.map(yi.fromJSON))}});function QM(t={}){return[GM,KM.of(t),z.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?XM:e.inputType=="historyRedo"?hx:null;return i?(e.preventDefault(),i(n)):!1}})]}function pm(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(GM,!1);if(!r)return!1;let s=r.pop(t,n,e);return s?(i(s),!0):!1}}var XM=pm(0,!1),hx=pm(1,!1),N$=pm(0,!0),L$=pm(1,!0);var yi=class t{constructor(e,n,i,r,s){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new t(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new t(e.changes&&Kt.fromJSON(e.changes),[],e.mapped&&wr.fromJSON(e.mapped),e.startSelection&&R.fromJSON(e.startSelection),e.selectionsAfter.map(R.fromJSON))}static fromTransaction(e,n){let i=Kn;for(let r of e.startState.facet(R$)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new t(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,Kn)}static selection(e){return new t(void 0,Kn,void 0,void 0,e)}};function hm(t,e,n,i){let r=e+1>n+20?e-n-1:0,s=t.slice(r,e);return s.push(i),s}function I$(t,e){let n=[],i=!1;return t.iterChangedRanges((r,s)=>n.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let a=0;a<n.length;){let c=n[a++],u=n[a++];l>=c&&o<=u&&(i=!0)}}),i}function _$(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function WM(t,e){return t.length?e.length?t.concat(e):t:e}var Kn=[],B$=200;function ZM(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-B$));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),hm(t,t.length-1,1e9,n.setSelAfter(i)))}else return[yi.selection([e])]}function q$(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function fx(t,e){if(!t.length)return t;let n=t.length,i=Kn;for(;n;){let r=P$(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,n);return s[n-1]=r,s}else e=r.mapped,n--,i=r.selectionsAfter}return i.length?[yi.selection(i)]:Kn}function P$(t,e,n){let i=WM(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):Kn,n);if(!t.changes)return yi.selection(i);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new yi(r,pe.mapEffects(t.effects,e),o,t.startSelection.map(s),i)}var z$=/^(input\.type|delete)($|\.)/,Lo=class t{constructor(e,n,i=0,r=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new t(this.done,this.undone):this}addChanges(e,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||z$.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,I$(l.changes,e.changes))||i=="input.type.compose")?o=hm(o,o.length-1,r.minDepth,new yi(e.changes.compose(l.changes),WM(pe.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Kn)):o=hm(o,o.length,r.minDepth,e),new t(o,Kn,n,i)}addSelection(e,n,i,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Kn;return s.length>0&&n-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&_$(s[s.length-1],e)?this:new t(ZM(this.done,e),this.undone,n,i)}addMapping(e){return new t(fx(this.done,e),fx(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(i&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:dx.of({side:e,rest:q$(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=r.length==1?Kn:r.slice(0,r.length-1);return s.mapped&&(l=fx(l,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:dx.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}};Lo.empty=new Lo(Kn,Kn);var JM=[{key:"Mod-z",run:XM,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:hx,preventDefault:!0},{linux:"Ctrl-Shift-z",run:hx,preventDefault:!0},{key:"Mod-u",run:N$,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:L$,preventDefault:!0}];function Ea(t,e){return R.create(t.ranges.map(e),t.mainIndex)}function bi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function vi({state:t,dispatch:e},n){let i=Ea(t.selection,n);return i.eq(t.selection,!0)?!1:(e(bi(t,i)),!0)}function mm(t,e){return R.cursor(e?t.to:t.from)}function e5(t,e){return vi(t,n=>n.empty?t.moveByChar(n,e):mm(n,e))}function qt(t){return t.textDirectionAt(t.state.selection.main.head)==Ie.LTR}var t5=t=>e5(t,!qt(t)),n5=t=>e5(t,qt(t));function i5(t,e){return vi(t,n=>n.empty?t.moveByGroup(n,e):mm(n,e))}var H$=t=>i5(t,!qt(t)),U$=t=>i5(t,qt(t));var Qde=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function F$(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function gm(t,e,n){let i=gi(t).resolveInner(e.head),r=n?G.closedBy:G.openedBy;for(let a=e.head;;){let c=n?i.childAfter(a):i.childBefore(a);if(!c)break;F$(t,c,r)?i=c:a=n?c.to:c.from}let s=i.type.prop(r),o,l;return s&&(o=n?No(t,i.from,1):No(t,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,R.cursor(l,n?-1:1)}var $$=t=>vi(t,e=>gm(t.state,e,!qt(t))),V$=t=>vi(t,e=>gm(t.state,e,qt(t)));function r5(t,e){return vi(t,n=>{if(!n.empty)return mm(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}var s5=t=>r5(t,!1),o5=t=>r5(t,!0);function l5(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,r;if(e){for(let s of t.state.facet(z.scrollMargins)){let o=s(t);o?.top&&(n=Math.max(o?.top,n)),o?.bottom&&(i=Math.max(o?.bottom,i))}r=t.scrollDOM.clientHeight-n-i}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function a5(t,e){let n=l5(t),{state:i}=t,r=Ea(i.selection,o=>o.empty?t.moveVertically(o,e,n.height):mm(o,e));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(i.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),a=l.top+n.marginTop,c=l.bottom-n.marginBottom;o&&o.top>a&&o.bottom<c&&(s=z.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-a}))}return t.dispatch(bi(i,r),{effects:s}),!0}var PM=t=>a5(t,!1),px=t=>a5(t,!0);function Ms(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=R.cursor(i.from+s))}return r}var j$=t=>vi(t,e=>Ms(t,e,!0)),Y$=t=>vi(t,e=>Ms(t,e,!1)),K$=t=>vi(t,e=>Ms(t,e,!qt(t))),G$=t=>vi(t,e=>Ms(t,e,qt(t))),Q$=t=>vi(t,e=>R.cursor(t.lineBlockAt(e.head).from,1)),X$=t=>vi(t,e=>R.cursor(t.lineBlockAt(e.head).to,-1));function W$(t,e,n){let i=!1,r=Ea(t.selection,s=>{let o=No(t,s.head,-1)||No(t,s.head,1)||s.head>0&&No(t,s.head-1,1)||s.head<t.doc.length&&No(t,s.head+1,-1);if(!o||!o.end)return s;i=!0;let l=o.start.from==s.head?o.end.to:o.end.from;return n?R.range(s.anchor,l):R.cursor(l)});return i?(e(bi(t,r)),!0):!1}var Z$=({state:t,dispatch:e})=>W$(t,e,!1);function Gn(t,e,n){let i=Ea(t.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=R.range(r.head,r.anchor));let s=n(r);return R.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(t.state.selection)?!1:(t.dispatch(bi(t.state,i)),!0)}function c5(t,e){return Gn(t,e,n=>t.moveByChar(n,e))}var u5=t=>c5(t,!qt(t)),f5=t=>c5(t,qt(t));function d5(t,e){return Gn(t,e,n=>t.moveByGroup(n,e))}var J$=t=>d5(t,!qt(t)),eV=t=>d5(t,qt(t));var tV=t=>{let e=!qt(t);return Gn(t,e,n=>gm(t.state,n,e))},nV=t=>{let e=qt(t);return Gn(t,e,n=>gm(t.state,n,e))};function h5(t,e){return Gn(t,e,n=>t.moveVertically(n,e))}var p5=t=>h5(t,!1),m5=t=>h5(t,!0);function g5(t,e){return Gn(t,e,n=>t.moveVertically(n,e,l5(t).height))}var zM=t=>g5(t,!1),HM=t=>g5(t,!0),iV=t=>Gn(t,!0,e=>Ms(t,e,!0)),rV=t=>Gn(t,!1,e=>Ms(t,e,!1)),sV=t=>{let e=!qt(t);return Gn(t,e,n=>Ms(t,n,e))},oV=t=>{let e=qt(t);return Gn(t,e,n=>Ms(t,n,e))},lV=t=>Gn(t,!1,e=>R.cursor(t.lineBlockAt(e.head).from)),aV=t=>Gn(t,!0,e=>R.cursor(t.lineBlockAt(e.head).to)),UM=({state:t,dispatch:e})=>(e(bi(t,{anchor:0})),!0),FM=({state:t,dispatch:e})=>(e(bi(t,{anchor:t.doc.length})),!0),$M=({state:t,dispatch:e})=>(e(bi(t,{anchor:t.selection.main.anchor,head:0})),!0),VM=({state:t,dispatch:e})=>(e(bi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),cV=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),uV=({state:t,dispatch:e})=>{let n=ym(t).map(({from:i,to:r})=>R.range(i,Math.min(r+1,t.doc.length)));return e(t.update({selection:R.create(n),userEvent:"select"})),!0},fV=({state:t,dispatch:e})=>{let n=Ea(t.selection,i=>{let r=gi(t),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return R.range(l.to,l.from)}return i});return n.eq(t.selection)?!1:(e(bi(t,n)),!0)};function y5(t,e){let{state:n}=t,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=s;;){let a=t.moveVertically(l,e);if(a.head<o.from||a.head>o.to){r.some(c=>c.head==a.head)||r.push(a);break}else{if(a.head==l.head)break;l=a}}}return r.length==i.ranges.length?!1:(t.dispatch(bi(n,R.create(r,r.length-1))),!0)}var dV=t=>y5(t,!1),hV=t=>y5(t,!0),pV=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=R.create([n.main]):n.main.empty||(i=R.create([R.cursor(n.main.head)])),i?(e(bi(t,i)),!0):!1};function df(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);a<o?(n="delete.backward",a=dm(t,a,!1)):a>o&&(n="delete.forward",a=dm(t,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=dm(t,o,!1),l=dm(t,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:R.cursor(o,o<s.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?z.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function dm(t,e,n){if(t instanceof z)for(let i of t.state.facet(z.atomicRanges).map(r=>r(t)))i.between(e,e,(r,s)=>{r<e&&s>e&&(e=n?s:r)});return e}var b5=(t,e,n)=>df(t,i=>{let r=i.from,{state:s}=t,o=s.doc.lineAt(r),l,a;if(n&&!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,r-o.from))){if(l[l.length-1]==" ")return r-1;let c=So(l,s.tabSize),u=c%cf(s)||cf(s);for(let f=0;f<u&&l[l.length-1-f]==" ";f++)r--;a=r}else a=gt(o.text,r-o.from,e,e)+o.from,a==r&&o.number!=(e?s.doc.lines:1)?a+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,r-o.from))&&(a=gt(o.text,a-o.from,!1,!1)+o.from);return a}),mx=t=>b5(t,!1,!0);var v5=t=>b5(t,!0,!1),x5=(t,e)=>df(t,n=>{let i=n.head,{state:r}=t,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(e?s.to:s.from)){i==n.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=gt(s.text,i-s.from,e)+s.from,c=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),u=o(c);if(l!=null&&u!=l)break;(c!=" "||i!=n.head)&&(l=u),i=a}return i}),S5=t=>x5(t,!1),mV=t=>x5(t,!0);var gV=t=>df(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)});var yV=t=>df(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),bV=t=>df(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)});var vV=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:fe.of(["",""])},range:R.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},xV=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let r=i.from,s=t.doc.lineAt(r),o=r==s.from?r-1:gt(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:gt(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(o,r))},range:R.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ym(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),s=t.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=t.doc.lineAt(i.to-1)),n>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return e}function w5(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let s of ym(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let a of s.ranges)r.push(R.range(Math.min(t.doc.length,a.anchor+l),Math.min(t.doc.length,a.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let a of s.ranges)r.push(R.range(a.anchor-l,a.head-l))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:R.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}var SV=({state:t,dispatch:e})=>w5(t,e,!1),wV=({state:t,dispatch:e})=>w5(t,e,!0);function k5(t,e,n){if(t.readOnly)return!1;let i=[];for(let s of ym(t))n?i.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):i.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let r=t.changes(i);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var kV=({state:t,dispatch:e})=>k5(t,e,!1),AV=({state:t,dispatch:e})=>k5(t,e,!0),CV=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(ym(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),i=Ea(e.selection,r=>{let s;if(t.lineWrapping){let o=t.lineBlockAt(r.head),l=t.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,s)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function OV(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=gi(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(G.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}var jM=A5(!1),TV=A5(!0);function A5(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),a=!t&&s==o&&OV(e,s);t&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let c=new Ro(e,{simulateBreak:s,simulateDoubleBreak:!!a}),u=ax(c,s);for(u==null&&(u=So(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:s,to:o}=a:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let f=["",uf(e,u)];return a&&f.push(uf(e,c.lineIndent(l.from,-1))),{changes:{from:s,to:o,insert:fe.of(f)},range:R.cursor(s+1+f[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function bx(t,e){let n=-1;return t.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let l=t.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(e(l,r,i),n=l.number),o=l.to+1}let s=t.changes(r);return{changes:r,range:R.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}var EV=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new Ro(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=bx(t,(s,o,l)=>{let a=ax(i,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let c=/^\s*/.exec(s.text)[0],u=uf(t,a);(c!=u||l.from<s.from+c.length)&&(n[s.from]=a,o.push({from:s.from,to:s.from+c.length,insert:u}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},DV=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(bx(t,(n,i)=>{i.push({from:n.from,insert:t.facet(fm)})}),{userEvent:"input.indent"})),!0),MV=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(bx(t,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=So(r,t.tabSize),o=0,l=uf(t,Math.max(0,s-cf(t)));for(;o<r.length&&o<l.length&&r.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:n.from+o,to:n.from+r.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),RV=t=>(t.setTabFocusMode(),!0);var NV=[{key:"Ctrl-b",run:t5,shift:u5,preventDefault:!0},{key:"Ctrl-f",run:n5,shift:f5},{key:"Ctrl-p",run:s5,shift:p5},{key:"Ctrl-n",run:o5,shift:m5},{key:"Ctrl-a",run:Q$,shift:lV},{key:"Ctrl-e",run:X$,shift:aV},{key:"Ctrl-d",run:v5},{key:"Ctrl-h",run:mx},{key:"Ctrl-k",run:gV},{key:"Ctrl-Alt-h",run:S5},{key:"Ctrl-o",run:vV},{key:"Ctrl-t",run:xV},{key:"Ctrl-v",run:px}],LV=[{key:"ArrowLeft",run:t5,shift:u5,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:H$,shift:J$,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:K$,shift:sV,preventDefault:!0},{key:"ArrowRight",run:n5,shift:f5,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:U$,shift:eV,preventDefault:!0},{mac:"Cmd-ArrowRight",run:G$,shift:oV,preventDefault:!0},{key:"ArrowUp",run:s5,shift:p5,preventDefault:!0},{mac:"Cmd-ArrowUp",run:UM,shift:$M},{mac:"Ctrl-ArrowUp",run:PM,shift:zM},{key:"ArrowDown",run:o5,shift:m5,preventDefault:!0},{mac:"Cmd-ArrowDown",run:FM,shift:VM},{mac:"Ctrl-ArrowDown",run:px,shift:HM},{key:"PageUp",run:PM,shift:zM},{key:"PageDown",run:px,shift:HM},{key:"Home",run:Y$,shift:rV,preventDefault:!0},{key:"Mod-Home",run:UM,shift:$M},{key:"End",run:j$,shift:iV,preventDefault:!0},{key:"Mod-End",run:FM,shift:VM},{key:"Enter",run:jM,shift:jM},{key:"Mod-a",run:cV},{key:"Backspace",run:mx,shift:mx,preventDefault:!0},{key:"Delete",run:v5,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:S5,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:mV,preventDefault:!0},{mac:"Mod-Backspace",run:yV,preventDefault:!0},{mac:"Mod-Delete",run:bV,preventDefault:!0}].concat(NV.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),C5=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:$$,shift:tV},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:V$,shift:nV},{key:"Alt-ArrowUp",run:SV},{key:"Shift-Alt-ArrowUp",run:kV},{key:"Alt-ArrowDown",run:wV},{key:"Shift-Alt-ArrowDown",run:AV},{key:"Mod-Alt-ArrowUp",run:dV},{key:"Mod-Alt-ArrowDown",run:hV},{key:"Escape",run:pV},{key:"Mod-Enter",run:TV},{key:"Alt-l",mac:"Ctrl-l",run:uV},{key:"Mod-i",run:fV,preventDefault:!0},{key:"Mod-[",run:MV},{key:"Mod-]",run:DV},{key:"Mod-Alt-\\",run:EV},{key:"Shift-Mod-k",run:CV},{key:"Shift-Mod-\\",run:Z$},{key:"Mod-/",run:k$},{key:"Alt-A",run:C$},{key:"Ctrl-m",mac:"Shift-Alt-m",run:RV}].concat(LV);var Sx=class t{constructor(e,n,i,r,s,o,l,a,c,u=0,f){this.p=e,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,i=0){let r=e.parser.context;return new t(e,[],n,i,i,0,[],0,r?new bm(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let i=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(r);if(l&&(this.score+=l),i==0){r<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let a=this.stack.length-(i-1)*3-(e&262144?6:0),c=a?this.stack[a-2]:this.p.ranges[0].from;r<s.minRepeatTerm&&c==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let f=a?this.stack[a-1]:0,d=this.bufferBase+this.buffer.length-f;if(r<s.minRepeatTerm||e&131072){let h=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,c,h,d+4,!0)}if(e&262144)this.state=this.stack[a];else{let h=this.stack[a-3];this.state=s.getGoto(h,r,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,n,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this.buffer.length;if(o>0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(e,n,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}else this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4)}apply(e,n,i,r){e&65536?this.reduce(e):this.shift(e,n,i,r)}useNode(e,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(n&&e.buffer[n-4]==0&&(n-=4);n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let i=e.buffer.slice(n),r=e.bufferBase+n;for(;e&&r==e.bufferBase;)e=e.parent;return new t(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new wx(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(i==0)return!1;if((i&65536)==0)return!0;n.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,o;s<n.length;s+=2)(o=n[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(n[s],o);if(this.stack.length<120)for(let s=0;r.length<8&&s<n.length;s+=2){let o=n[s+1];r.some((l,a)=>a&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r<n.length&&i.length<4;r+=2){let s=n[r+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(n[r],this.pos),o.reducePos=this.pos,o.score-=200,i.push(o)}return i}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let i=n>>19,r=n&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,c=this.stack.length-l*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new bm(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},bm=class{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}},wx=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}},kx=class t{constructor(e,n,i){this.stack=e,this.pos=n,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new t(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new t(this.stack,this.pos,this.index)}};function hf(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let i=0,r=0;i<t.length;){let s=0;for(;;){let o=t.charCodeAt(i++),l=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}n?n[r++]=s:n=new e(s)}return n}var Da=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},O5=new Da,Ax=class{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=O5,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let i=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<i.from;){if(!r)return null;let o=this.ranges[--r];s-=i.from-o.to,i=o}for(;n<0?s>i.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,i,r;if(n>=0&&n<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(i=s,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=i;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=O5,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,n)))}return i}},Rs=class{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:i}=n.p;R5(this.data,e,n,this.id,i.data,i.tokenPrecTable)}};Rs.prototype.contextual=Rs.prototype.fallback=Rs.prototype.extend=!1;var Cx=class{constructor(e,n,i){this.precTable=n,this.elseToken=i,this.data=typeof e=="string"?hf(e):e}token(e,n){let i=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(R5(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}};Cx.prototype.contextual=Rs.prototype.fallback=Rs.prototype.extend=!1;var Io=class{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}};function R5(t,e,n,i,r,s){let o=0,l=1<<i,{dialect:a}=n.p.parser;e:for(;(l&t[o])!=0;){let c=t[o+1];for(let h=o+3;h<c;h+=2)if((t[h+1]&l)>0){let p=t[h];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||_V(p,e.token.value,r,s))){e.acceptToken(p);break}}let u=e.next,f=0,d=t[o+2];if(e.next<0&&d>f&&t[c+d*3-3]==65535){o=t[c+d*3-1];continue e}for(;f<d;){let h=f+d>>1,p=c+h+(h<<1),g=t[p],b=t[p+1]||65536;if(u<g)d=h;else if(u>=b)f=h+1;else{o=t[p+2],e.advance();continue e}}break}}function T5(t,e,n){for(let i=e,r;(r=t[i])!=65535;i++)if(r==n)return i-e;return-1}function _V(t,e,n,i){let r=T5(n,i,e);return r<0||T5(n,i,t)<r}var On=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG),vx=null;function E5(t,e,n){let i=t.cursor(Ue.IncludeAnonymous);for(i.moveTo(e);;)if(!(n<0?i.childBefore(e):i.childAfter(e)))for(;;){if((n<0?i.to<e:i.from>e)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:t.length}}var Ox=class{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?E5(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?E5(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let i=this.trees[n],r=this.index[n];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[r],o=this.start[n]+i.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof Ge){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let a=s.prop(G.lookAhead);if(!a||l+a<this.fragment.to)return s}}this.index[n]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}},Tx=class{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Da)}getActions(e){let n=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let c=0;c<s.length;c++){if((1<<c&o)==0)continue;let u=s[c],f=this.tokens[c];if(!(i&&!u.fallback)&&((u.contextual||f.start!=e.pos||f.mask!=o||f.context!=l)&&(this.updateCachedToken(f,u,e),f.mask=o,f.context=l),f.lookAhead>f.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let d=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!u.extend&&(i=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new Da,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,n=this.addActions(e,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Da,{pos:i,p:r}=e;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(e,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let l=s.specializers[o](this.stream.read(e.start,e.end),i);if(l>=0&&i.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,n,i,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=n,this.actions[r++]=i,r}addActions(e,n,i,r){let{state:s}=e,{parser:o}=e.p,{data:l}=o;for(let a=0;a<2;a++)for(let c=o.stateSlot(s,a?2:1);;c+=3){if(l[c]==65535)if(l[c+1]==1)c=Dr(l,c+2);else{r==0&&l[c+1]==2&&(r=this.putAction(Dr(l,c+2),n,i,r));break}l[c]==n&&(r=this.putAction(Dr(l,c+1),n,i,r))}return r}},Ex=class{constructor(e,n,i,r){this.parser=e,this.input=n,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Ax(n,r),this.tokens=new Tx(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[Sx.start(this,e.top[0],s)],this.fragments=i.length&&this.stream.end-s>e.bufferLength*4?new Ox(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>n)i.push(l);else{if(this.advanceStack(l,i,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!i.length){let o=r&&BV(r);if(o)return On&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw On&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return On&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o<i.length-1;o++){let l=i[o];for(let a=o+1;a<i.length;a++){let c=i[a];if(l.sameState(c)||l.buffer.length>500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o<i.length;o++)i[o].pos<this.minStackPos&&(this.minStackPos=i[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,i){let r=e.pos,{parser:s}=this,o=On?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(G.contextHash)||0)==u))return e.useNode(f,d),On&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Ge)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof Ge&&f.positions[0]==0)f=h;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),On&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;c<a.length;){let u=a[c++],f=a[c++],d=a[c++],h=c==a.length||!i,p=h?e:e.split(),g=this.tokens.mainToken;if(p.apply(u,f,g?g.start:p.pos,d),On&&console.log(o+this.stackID(p)+` (via ${(u&65536)==0?"shift":`reduce of ${s.getName(u&65535)}`} for ${s.getName(f)} @ ${r}${p==e?"":", split"})`),h)return!0;p.pos>r?n.push(p):i.push(p)}return!1}advanceFully(e,n){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return D5(e,n),!0}}runRecovery(e,n,i){let r=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],a=n[o<<1],c=n[(o<<1)+1],u=On?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),On&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),d=u;for(let h=0;h<10&&f.forceReduce()&&(On&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));h++)On&&(d=this.stackID(f)+" -> ");for(let h of l.recoverByInsert(a))On&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,i);this.stream.end>l.pos?(c==l.pos&&(c++,a=0),l.recoverByDelete(a,c),On&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),D5(l,i)):(!r||r.score<f.score)&&(r=f)}return r}stackToTree(e){return e.close(),Ge.build({buffer:kx.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(vx||(vx=new WeakMap)).get(e);return n||vx.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}};function D5(t,e){for(let n=0;n<e.length;n++){let i=e[n];if(i.pos==t.pos&&i.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}var Dx=class{constructor(e,n,i){this.source=e,this.flags=n,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}},xx=t=>t,vm=class{constructor(e){this.start=e.start,this.shift=e.shift||xx,this.reduce=e.reduce||xx,this.reuse=e.reuse||xx,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},Ma=class t extends ka{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;l<e.repeatNodeCount;l++)n.push("");let i=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<n.length;l++)r.push([]);function s(l,a,c){r[l].push([a,a.deserialize(String(c))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a=="string"&&(a=G[a]);for(let c=1;c<l.length;){let u=l[c++];if(u>=0)s(u,a,l[c++]);else{let f=l[c+-u];for(let d=-u;d>0;d--)s(l[c++],a,f);c++}}}this.nodeSet=new ef(n.map((l,a)=>Bt.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=hf(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(M5),this.states=hf(e.states,Uint32Array),this.data=hf(e.stateData),this.goto=hf(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Rs(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,i){let r=new Ex(this,e,n,i);for(let s of this.wrappers)r=s(r,e,n,i);return r}getGoto(e,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&i)return a;for(let c=s+(o>>1);s<c;s++)if(r[s]==e)return a;if(l)return-1}}hasAction(e,n){let i=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),o;;s+=3){if((o=i[s])==65535)if(i[s+1]==1)o=i[s=Dr(i,s+2)];else{if(i[s+1]==2)return Dr(i,s+2);break}if(o==n||o==0)return Dr(i,s+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,i=>i==n?!0:null)}allActions(e,n){let i=this.stateSlot(e,4),r=i?n(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Dr(this.data,s+2);else break;r=n(Dr(this.data,s+1))}return r}nextStates(e){let n=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Dr(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(e){let n=Object.assign(Object.create(t.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=i}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=M5(o),o})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;s<n.length;s++)if(!i[s])for(let o=this.dialects[n[s]],l;(l=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new Dx(e,i,r)}static deserialize(e){return new t(e)}};function Dr(t,e){return t[e]|t[e+1]<<16}function BV(t){let e=null;for(let n of t){let i=n.p.stoppedAt;(n.pos==n.p.stream.end||i!=null&&n.pos>i)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function M5(t){if(t.external){let e=t.extend?1:0;return(n,i)=>t.external(n,i)<<1|e}return t.get}var Ra=63,N5=64,qV=1,PV=2,_5=3,zV=4,B5=5,HV=6,UV=7,q5=65,FV=66,$V=8,VV=9,jV=10,YV=11,KV=12,P5=13,GV=19,QV=20,XV=29,WV=33,ZV=34,JV=47,ej=0,_x=1,Rx=2,mf=3,Nx=4,Mr=class{constructor(e,n,i){this.parent=e,this.depth=n,this.type=i,this.hash=(e?e.hash+e.hash<<8:0)+n+(n<<4)+i}};Mr.top=new Mr(null,-1,ej);function pf(t,e){for(let n=0,i=e-t.pos-1;;i--,n++){let r=t.peek(i);if(Rr(r)||r==-1)return n}}function Lx(t){return t==32||t==9}function Rr(t){return t==10||t==13}function z5(t){return Lx(t)||Rr(t)}function _o(t){return t<0||z5(t)}var tj=new vm({start:Mr.top,reduce(t,e){return t.type==mf&&(e==QV||e==ZV)?t.parent:t},shift(t,e,n,i){if(e==_5)return new Mr(t,pf(i,i.pos),_x);if(e==q5||e==B5)return new Mr(t,pf(i,i.pos),Rx);if(e==Ra)return t.parent;if(e==GV||e==WV)return new Mr(t,0,mf);if(e==P5&&t.type==Nx)return t.parent;if(e==JV){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new Mr(t,t.depth+ +r[0],Nx)}return t},hash(t){return t.hash}});function Na(t,e,n=0){return t.peek(n)==e&&t.peek(n+1)==e&&t.peek(n+2)==e&&_o(t.peek(n+3))}var nj=new Io((t,e)=>{if(t.next==-1&&e.canShift(N5))return t.acceptToken(N5);let n=t.peek(-1);if((Rr(n)||n<0)&&e.context.type!=mf){if(Na(t,45))if(e.canShift(Ra))t.acceptToken(Ra);else return t.acceptToken(qV,3);if(Na(t,46))if(e.canShift(Ra))t.acceptToken(Ra);else return t.acceptToken(PV,3);let i=0;for(;t.next==32;)i++,t.advance();(i<e.context.depth||i==e.context.depth&&e.context.type==_x&&(t.next!=45||!_o(t.peek(1))))&&t.next!=-1&&!Rr(t.next)&&t.next!=35&&t.acceptToken(Ra,-i)}},{contextual:!0}),ij=new Io((t,e)=>{if(e.context.type==mf){t.next==63&&(t.advance(),_o(t.next)&&t.acceptToken(UV));return}if(t.next==45)t.advance(),_o(t.next)&&t.acceptToken(e.context.type==_x&&e.context.depth==pf(t,t.pos-1)?zV:_5);else if(t.next==63)t.advance(),_o(t.next)&&t.acceptToken(e.context.type==Rx&&e.context.depth==pf(t,t.pos-1)?HV:B5);else{let n=t.pos;for(;;)if(Lx(t.next)){if(t.pos==n)return;t.advance()}else if(t.next==33)H5(t);else if(t.next==38)Ix(t);else if(t.next==42){Ix(t);break}else if(t.next==39||t.next==34){if(Bx(t,!0))break;return}else if(t.next==91||t.next==123){if(!sj(t))return;break}else{U5(t,!0,!1,0);break}for(;Lx(t.next);)t.advance();if(t.next==58){if(t.pos==n&&e.canShift(XV))return;let i=t.peek(1);_o(i)&&t.acceptTokenTo(e.context.type==Rx&&e.context.depth==pf(t,n)?FV:q5,n)}}},{contextual:!0});function rj(t){return t>32&&t<127&&t!=34&&t!=37&&t!=44&&t!=60&&t!=62&&t!=92&&t!=94&&t!=96&&t!=123&&t!=124&&t!=125}function L5(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function I5(t,e){return t.next==37?(t.advance(),L5(t.next)&&t.advance(),L5(t.next)&&t.advance(),!0):rj(t.next)||e&&t.next==44?(t.advance(),!0):!1}function H5(t){if(t.advance(),t.next==60){for(t.advance();;)if(!I5(t,!0)){t.next==62&&t.advance();break}}else for(;I5(t,!1););}function Ix(t){for(t.advance();!_o(t.next)&&xm(t.next)!="f";)t.advance()}function Bx(t,e){let n=t.next,i=!1,r=t.pos;for(t.advance();;){let s=t.next;if(s<0)break;if(t.advance(),s==n)if(s==39)if(t.next==39)t.advance();else break;else break;else if(s==92&&n==34)t.next>=0&&t.advance();else if(Rr(s)){if(e)return!1;i=!0}else if(e&&t.pos>=r+1024)return!1}return!i}function sj(t){for(let e=[],n=t.pos+1024;;)if(t.next==91||t.next==123)e.push(t.next),t.advance();else if(t.next==39||t.next==34){if(!Bx(t,!0))return!1}else if(t.next==93||t.next==125){if(e[e.length-1]!=t.next-2)return!1;if(e.pop(),t.advance(),!e.length)return!0}else{if(t.next<0||t.pos>n||Rr(t.next))return!1;t.advance()}}var oj="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function xm(t){return t<33?"u":t>125?"s":oj[t-33]}function Mx(t,e){let n=xm(t);return n!="u"&&!(e&&n=="f")}function U5(t,e,n,i){if(xm(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&Mx(t.peek(1),n))t.advance();else return!1;let r=t.pos;for(;;){let s=t.next,o=0,l=i+1;for(;z5(s);){if(Rr(s)){if(e)return!1;l=0}else l++;s=t.peek(++o)}if(!(s>=0&&(s==58?Mx(t.peek(o+1),n):s==35?t.peek(o-1)!=32:Mx(s,n)))||!n&&l<=i||l==0&&!n&&(Na(t,45,o)||Na(t,46,o)))break;if(e&&xm(s)=="f")return!1;for(let c=o;c>=0;c--)t.advance();if(e&&t.pos>r+1024)return!1}return!0}var lj=new Io((t,e)=>{if(t.next==33)H5(t),t.acceptToken(KV);else if(t.next==38||t.next==42){let n=t.next==38?jV:YV;Ix(t),t.acceptToken(n)}else t.next==39||t.next==34?(Bx(t,!1),t.acceptToken(VV)):U5(t,!1,e.context.type==mf,e.context.depth)&&t.acceptToken($V)}),aj=new Io((t,e)=>{let n=e.context.type==Nx?e.context.depth:-1,i=t.pos;e:for(;;){let r=0,s=t.next;for(;s==32;)s=t.peek(++r);if(!r&&(Na(t,45,r)||Na(t,46,r))||!Rr(s)&&(n<0&&(n=Math.max(e.context.depth+1,r)),r<n))break;for(;;){if(t.next<0)break e;let o=Rr(t.next);if(t.advance(),o)continue e;i=t.pos}}t.acceptTokenTo(P5,i)}),cj=Aa({DirectiveName:T.keyword,DirectiveContent:T.attributeValue,"DirectiveEnd DocEnd":T.meta,QuotedLiteral:T.string,BlockLiteralHeader:T.special(T.string),BlockLiteralContent:T.content,Literal:T.content,"Key/Literal Key/QuotedLiteral":T.definition(T.propertyName),"Anchor Alias":T.labelName,Tag:T.typeName,Comment:T.lineComment,": , -":T.separator,"?":T.punctuation,"[ ]":T.squareBracket,"{ }":T.brace}),F5=Ma.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"\u26A0 DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:tj,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[cj],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[nj,ij,lj,aj,0,1],topRules:{Stream:[0,15]},tokenPrec:0});var uj=Ma.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"\u26A0 Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),fj=lf.define({name:"yaml",parser:F5.configure({props:[cx.add({Stream:t=>{for(let e=t.node.resolve(t.pos,-1);e&&e.to>=t.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return t.baseIndentFor(e);if(e.name=="BlockLiteral")return t.baseIndentFor(e)+t.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return t.column(e.firstChild.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let n=t.column(e.from,1);if(n==t.lineIndent(e.from,1))return n;if(e.to>t.pos)return null}}return null},FlowMapping:ux({closing:"}"}),FlowSequence:ux({closing:"]"})}),IM.add({"FlowMapping FlowSequence":_M,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function $5(){return new um(fj)}var ahe=lf.define({name:"yaml-frontmatter",parser:uj.configure({props:[Aa({DashLine:T.meta})]})});var km=class{constructor(e,n,i){this.from=e,this.to=n,this.diagnostic=i}},Bo=class t{constructor(e,n,i){this.diagnostics=e,this.panel=n,this.selected=i}static init(e,n,i){let r=i.facet(gf).markerFilter;r&&(e=r(e,i));let s=e.slice().sort((h,p)=>h.from-p.from||h.to-p.to),o=new kr,l=[],a=0,c=i.doc.iter(),u=0,f=i.doc.length;for(let h=0;;){let p=h==s.length?null:s[h];if(!p&&!l.length)break;let g,b;if(l.length)g=a,b=l.reduce((v,x)=>Math.min(v,x.to),p&&p.from>g?p.from:1e8);else{if(g=p.from,g>f)break;b=p.to,l.push(p),h++}for(;h<s.length;){let v=s[h];if(v.from==g&&(v.to>v.from||v.to==g))l.push(v),h++,b=Math.min(v.to,b);else{b=Math.min(v.from,b);break}}b=Math.min(b,f);let m=!1;if(l.some(v=>v.from==g&&(v.to==b||b==f))&&(m=g==b,!m&&b-g<10)){let v=g-(u+c.value.length);v>0&&(c.next(v),u=g);for(let x=g;;){if(x>=b){m=!0;break}if(!c.lineBreak&&u+c.value.length>x)break;x=u+c.value.length,u+=c.value.length,c.next()}}let y=J5(l);if(m)o.add(g,g,Se.widget({widget:new qx(y),diagnostics:l.slice()}));else{let v=l.reduce((x,A)=>A.markClass?x+" "+A.markClass:x,"");o.add(g,b,Se.mark({class:"cm-lintRange cm-lintRange-"+y+v,diagnostics:l.slice(),inclusiveEnd:l.some(x=>x.to>b)}))}if(a=b,a==f)break;for(let v=0;v<l.length;v++)l[v].to<=a&&l.splice(v--,1)}let d=o.finish();return new t(d,n,La(d))}};function La(t,e=null,n=0){let i=null;return t.between(n,1e9,(r,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new km(r,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new km(i.from,s,i.diagnostic)}}),i}function Y5(t,e){let n=e.pos,i=e.end||n,r=t.state.facet(gf).hideOn(t,n,i);if(r!=null)return r;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(Tm))||t.changes.touchesRange(s.from,Math.max(s.to,i)))}function dj(t,e){return t.field(xi,!1)?e:e.concat(pe.appendConfig.of(kj))}function K5(t,e){return{effects:dj(t,[Tm.of(e)])}}var Tm=pe.define(),G5=pe.define(),Q5=pe.define(),xi=_t.define({create(){return new Bo(Se.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),i=null,r=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);i=La(n,t.selected.diagnostic,s)||La(n,null,s)}!n.size&&r&&e.state.facet(gf).autoPanel&&(r=null),t=new Bo(n,r,i)}for(let n of e.effects)if(n.is(Tm)){let i=e.state.facet(gf).autoPanel?n.value.length?Cm.open:null:t.panel;t=Bo.init(n.value,i,e.state)}else n.is(G5)?t=new Bo(t.diagnostics,n.value?Cm.open:null,t.selected):n.is(Q5)&&(t=new Bo(t.diagnostics,t.panel,n.value));return t},provide:t=>[Xp.from(t,e=>e.panel),z.decorations.from(t,e=>e.diagnostics)]});var hj=Se.mark({class:"cm-lintRange cm-lintRange-active"});function pj(t,e,n){let{diagnostics:i}=t.state.field(xi),r,s=-1,o=-1;i.between(e-(n<0?1:0),e+(n>0?1:0),(a,c,{spec:u})=>{if(e>=a&&e<=c&&(a==c||(e>a||n>0)&&(e<c||n<0)))return r=u.diagnostics,s=a,o=c,!1});let l=t.state.facet(gf).tooltipFilter;return r&&l&&(r=l(r,t.state)),r?{pos:s,end:o,above:!0,create(){return{dom:X5(t,r)}}}:null}function X5(t,e){return wn("ul",{class:"cm-tooltip-lint"},e.map(n=>Z5(t,n,!1)))}var V5=t=>{let e=t.state.field(xi,!1);return!e||!e.panel?!1:(t.dispatch({effects:G5.of(!1)}),!0)};var gf=I.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...ws(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:j5,tooltipFilter:j5,needsRefresh:(e,n)=>e?n?i=>e(i)||n(i):e:n,hideOn:(e,n)=>e?n?(i,r,s)=>e(i,r,s)||n(i,r,s):e:n,autoPanel:(e,n)=>e||n})}}});function j5(t,e){return t?e?(n,i)=>e(t(n,i),i):t:e}function W5(t){let e=[];if(t)e:for(let{name:n}of t){for(let i=0;i<n.length;i++){let r=n[i];if(/[a-zA-Z]/.test(r)&&!e.some(s=>s.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function Z5(t,e,n){var i;let r=n?W5(e.actions):[];return wn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},wn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,a=h=>{if(h.preventDefault(),l)return;l=!0;let p=La(t.state.field(xi).diagnostics,e);p&&s.apply(t,p.from,p.to)},{name:c}=s,u=r[o]?c.indexOf(r[o]):-1,f=u<0?c:[c.slice(0,u),wn("u",c.slice(u,u+1)),c.slice(u+1)],d=s.markClass?" "+s.markClass:"";return wn("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:a,onmousedown:a,"aria-label":` Action: ${c}${u<0?"":` (access key "${r[o]})"`}.`},f)}),e.source&&wn("div",{class:"cm-diagnosticSource"},e.source))}var qx=class extends Tr{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return wn("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}},Am=class{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Z5(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},Cm=class t{constructor(e){this.view=e,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)V5(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=W5(s.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==r.keyCode){let a=La(this.view.state.field(xi).diagnostics,s);a&&s.actions[l].apply(e,a.from,a.to)}}else return;r.preventDefault()}},i=r=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(r.target)&&this.moveSelection(s)};this.list=wn("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:i}),this.dom=wn("div",{class:"cm-panel-lint"},this.list,wn("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>V5(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(xi).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(xi),i=0,r=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,a,{spec:c})=>{for(let u of c.diagnostics){if(o.has(u))continue;o.add(u);let f=-1,d;for(let h=i;h<this.items.length;h++)if(this.items[h].diagnostic==u){f=h;break}f<0?(d=new Am(this.view,u),this.items.splice(i,0,d),r=!0):(d=this.items[f],f>i&&(this.items.splice(i,f-i),r=!0)),n&&d.diagnostic==n.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),s=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new Am(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let c=a.height/this.list.offsetHeight;l.top<a.top?this.list.scrollTop-=(a.top-l.top)/c:l.bottom>a.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function n(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)n();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(xi),i=La(n.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:Q5.of(i)})}static open(e){return new t(e)}};function wm(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function Sm(t){return wm(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}var mj=z.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Sm("#f11")},".cm-lintRange-warning":{backgroundImage:Sm("orange")},".cm-lintRange-info":{backgroundImage:Sm("#999")},".cm-lintRange-hint":{backgroundImage:Sm("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function gj(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function J5(t){let e="hint",n=1;for(let i of t){let r=gj(i.severity);r>n&&(n=r,e=i.severity)}return e}var Om=class extends Yn{constructor(e){super(),this.diagnostics=e,this.severity=J5(e)}toDOM(e){let n=document.createElement("div");n.className="cm-lint-marker cm-lint-marker-"+this.severity;let i=this.diagnostics,r=e.state.facet(Em).tooltipFilter;return r&&(i=r(i,e.state)),i.length&&(n.onmouseover=()=>bj(e,n,i)),n}};function yj(t,e){let n=i=>{let r=e.getBoundingClientRect();if(!(i.clientX>r.left-10&&i.clientX<r.right+10&&i.clientY>r.top-10&&i.clientY<r.bottom+10)){for(let s=i.target;s;s=s.parentNode)if(s.nodeType==1&&s.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",n),t.state.field(eR)&&t.dispatch({effects:zx.of(null)})}};window.addEventListener("mousemove",n)}function bj(t,e,n){function i(){let o=t.elementAtHeight(e.getBoundingClientRect().top+5-t.documentTop);t.coordsAtPos(o.from)&&t.dispatch({effects:zx.of({pos:o.from,above:!1,clip:!1,create(){return{dom:X5(t,n),getCoords:()=>e.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,yj(t,e)}let{hoverTime:r}=t.state.facet(Em),s=setTimeout(i,r);e.onmouseout=()=>{clearTimeout(s),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(s),s=setTimeout(i,r)}}function vj(t,e){let n=Object.create(null);for(let r of e){let s=t.lineAt(r.from);(n[s.from]||(n[s.from]=[])).push(r)}let i=[];for(let r in n)i.push(new Om(n[r]).range(+r));return me.of(i,!0)}var xj=zv({class:"cm-gutter-lint",markers:t=>t.state.field(Px),widgetMarker:(t,e,n)=>{let i=[];return t.state.field(Px).between(n.from,n.to,(r,s,o)=>{r>n.from&&r<n.to&&i.push(...o.diagnostics)}),i.length?new Om(i):null}}),Px=_t.define({create(){return me.empty},update(t,e){t=t.map(e.changes);let n=e.state.facet(Em).markerFilter;for(let i of e.effects)if(i.is(Tm)){let r=i.value;n&&(r=n(r||[],e.state)),t=vj(e.state.doc,r.slice(0))}return t}}),zx=pe.define(),eR=_t.define({create(){return null},update(t,e){return t&&e.docChanged&&(t=Y5(e,t)?null:{...t,pos:e.changes.mapPos(t.pos)}),e.effects.reduce((n,i)=>i.is(zx)?i.value:n,t)},provide:t=>nm.from(t)}),Sj=z.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:wm('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:wm('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:wm('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),wj=pM(pj,{hideOn:Y5}),kj=[xi,z.decorations.compute([xi],t=>{let{selected:e,panel:n}=t.field(xi);return!e||!n||e.from==e.to?Se.none:Se.set([hj.range(e.from,e.to)])}),wj,mj],Em=I.define({combine(t){return ws(t,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function tR(t={}){return[Em.of(t),Px,xj,Sj,eR]}var Ki=X(Ce()),nR={error:0,warning:1,info:2},Aj=Ta.define([{tag:T.comment,color:"var(--spytial-ed-syn-comment, #8a8170)",fontStyle:"italic"},{tag:[T.string,T.special(T.string)],color:"var(--spytial-ed-syn-string, #7a5901)"},{tag:[T.number,T.bool,T.null],color:"var(--spytial-ed-syn-number, #7a5901)"},{tag:[T.propertyName,T.definition(T.propertyName),T.keyword,T.atom],color:"var(--spytial-ed-syn-keyword, #6d28a8)"},{tag:[T.punctuation,T.separator],color:"var(--spytial-ed-text-muted, #6e6553)"}]),Cj=z.theme({"&":{fontSize:"0.85em",color:"var(--spytial-ed-text, #221d14)",backgroundColor:"var(--spytial-ed-surface, #faf8f2)",border:"1px solid var(--spytial-ed-border, #d9d2c0)",borderRadius:"var(--spytial-ed-radius, 2px)",minHeight:"12rem"},"&.cm-focused":{outline:"2px solid var(--spytial-ed-accent, #b5431a)",outlineOffset:"-1px"},".cm-scroller":{fontFamily:"var(--spytial-ed-mono-font-family, ui-monospace, monospace)",lineHeight:"1.5",overflow:"auto"},".cm-content":{padding:"0.5em 0",caretColor:"var(--spytial-ed-accent, #b5431a)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--spytial-ed-accent, #b5431a)"},".cm-gutters":{backgroundColor:"var(--spytial-ed-surface-raised, #f1ecdf)",color:"var(--spytial-ed-text-muted, #6e6553)",border:"none",borderInlineEnd:"1px solid var(--spytial-ed-border, #d9d2c0)"},".cm-lineNumbers .cm-gutterElement":{padding:"0 0.5em 0 0.6em"},"&.cm-editor .cm-selectionBackground, & .cm-selectionBackground, & .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--spytial-ed-accent, #b5431a) 22%, transparent)"},".cm-tooltip":{border:"1px solid var(--spytial-ed-border, #d9d2c0)",backgroundColor:"var(--spytial-ed-surface-raised, #f1ecdf)",color:"var(--spytial-ed-text, #221d14)",borderRadius:"var(--spytial-ed-radius, 2px)",fontSize:"0.85em"}});function Oj(t,e){if(!t)return[];let n=[];for(let i of t){if(i.from===void 0||i.to===void 0)continue;let r=Math.max(0,Math.min(i.from,e)),s=Math.max(r,Math.min(i.to,e));n.push({from:r,to:s,severity:i.severity,message:i.message,source:i.code})}return n.sort((i,r)=>i.from-r.from),n}var Hx=({value:t,onChange:e,diagnostics:n,hasUnappliedEdits:i=!1,showLineNumbers:r=!0,syntaxHighlighting:s=!0,disabled:o=!1,"aria-label":l="Layout specification YAML",className:a})=>{let c=(0,an.useRef)(null),u=(0,an.useRef)(null),f=(0,an.useRef)(e);f.current=e;let d=(0,an.useRef)(new ca),p=`${(0,an.useId)()}-diag`;(0,an.useEffect)(()=>{let b=c.current;if(!b)return;let m=[QM(),Pv.of([...C5,...JM]),...r?[gM()]:[],...s?[$5(),qM(Aj)]:[],tR(),Cj,d.current.of([z.editable.of(!o),De.readOnly.of(o)]),z.contentAttributes.of({"aria-label":l,"aria-describedby":p}),z.updateListener.of(v=>{v.docChanged&&f.current(v.state.doc.toString())})],y=new z({state:De.create({doc:t,extensions:m}),parent:b});return u.current=y,()=>{y.destroy(),u.current=null}},[]),(0,an.useEffect)(()=>{let b=u.current;if(!b)return;let m=b.state.doc.toString();m!==t&&b.dispatch({changes:{from:0,to:m.length,insert:t}})},[t]),(0,an.useEffect)(()=>{let b=u.current;b&&b.dispatch(K5(b.state,Oj(n,b.state.doc.length)))},[n]),(0,an.useEffect)(()=>{let b=u.current;b&&b.dispatch({effects:d.current.reconfigure([z.editable.of(!o),De.readOnly.of(o)])})},[o]);let g=(0,an.useMemo)(()=>!n||n.length===0?[]:[...n].sort((b,m)=>{let y=nR[b.severity]-nR[m.severity];return y!==0?y:(b.line??1/0)-(m.line??1/0)}),[n]);return(0,Ki.jsxs)("div",{className:`spytial-ed-code${a?` ${a}`:""}`,children:[i?(0,Ki.jsx)("div",{className:"spytial-ed-code-notice",role:"status",children:"Text has unapplied edits \u2014 fix the error below to update the builder."}):null,(0,Ki.jsx)("div",{ref:c,className:`spytial-ed-code-cm${o?" spytial-ed-code-cm--disabled":""}`}),g.length>0?(0,Ki.jsx)("ul",{className:"spytial-ed-code-diagnostics",id:p,children:g.map((b,m)=>(0,Ki.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${b.severity}`,children:[(0,Ki.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),b.line!==void 0?(0,Ki.jsx)("span",{className:"spytial-ed-code-diagnostic-loc",children:b.column!==void 0?`Ln ${b.line}, Col ${b.column}`:`Ln ${b.line}`}):null,(0,Ki.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:b.message})]},m))}):null]})};var ne=X(Tt());var B=X(Ce()),Tj=new Set(["orientation","cyclic","align","groupselector"]),Ux=({constraints:t,directives:e,diagnostics:n,options:i,selectorProps:r,onAddItem:s,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:d=!1,className:h})=>{let[p,g]=(0,ne.useState)(null),b=(0,ne.useCallback)(x=>{g(A=>A===x?null:x)},[]),m=(0,ne.useCallback)(x=>g(null),[]),y=(0,ne.useCallback)((x,A)=>{let w=s(x,A);return w&&typeof w=="object"&&"id"in w&&g(w.id),w},[s]),v=t.length===0&&e.length===0;return(0,B.jsxs)("div",{className:`spytial-ed-builder${h?` ${h}`:""}`,children:[(0,B.jsx)(iR,{title:"Constraints",kind:"constraint",items:t,diagnostics:n,options:i,selectorProps:r,expandedId:p,onToggleExpand:b,onCollapse:m,onAddItem:y,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:d}),(0,B.jsx)(iR,{title:"Directives",kind:"directive",items:e,diagnostics:n,options:i,selectorProps:r,expandedId:p,onToggleExpand:b,onCollapse:m,onAddItem:y,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:d}),v?(0,B.jsx)("p",{className:"spytial-ed-builder-empty",children:"No constraints or directives yet \u2014 add one to start shaping the layout."}):null]})},iR=({title:t,kind:e,items:n,diagnostics:i,options:r,selectorProps:s,expandedId:o,onToggleExpand:l,onCollapse:a,onAddItem:c,onUpdateParam:u,onUpdateComment:f,onToggleNegate:d,onDuplicate:h,onRemove:p,onMove:g,disabled:b})=>{let m=`${t} List`,y=(0,ne.useRef)(new Map),v=(0,ne.useRef)(null),x=(0,ne.useRef)(null),A=(0,ne.useCallback)((k,C)=>{C?y.current.set(k,C):y.current.delete(k)},[]),w=(0,ne.useCallback)(k=>{let C=n.findIndex(_=>_.id===k),O=n[C+1],M=n[C-1];x.current=O?.id??M?.id??"__add__",p(k)},[n,p]);return(0,ne.useEffect)(()=>{let k=x.current;if(k!==null){if(x.current=null,k==="__add__"){v.current?.focus();return}y.current.get(k)?.focus()}},[n]),(0,B.jsxs)("section",{className:"spytial-ed-section","aria-label":t,children:[(0,B.jsxs)("div",{className:"spytial-ed-section-head",children:[(0,B.jsx)("h3",{className:"spytial-ed-section-title",children:t}),(0,B.jsx)(Mj,{kind:e,onAdd:c,disabled:b,triggerRef:v})]}),(0,B.jsx)("ul",{className:"spytial-ed-rows","aria-label":m,children:n.map((k,C)=>(0,B.jsx)(Ej,{item:k,index:C,count:n.length,diagnostics:i,options:r,selectorProps:s,expanded:o===k.id,onToggleExpand:l,onCollapse:a,registerToggle:A,onUpdateParam:u,onUpdateComment:f,onToggleNegate:d,onDuplicate:h,onRemove:w,onMove:g,disabled:b},k.id))})]})},Ej=({item:t,index:e,count:n,diagnostics:i,options:r,selectorProps:s,expanded:o,onToggleExpand:l,onCollapse:a,registerToggle:c,onUpdateParam:u,onUpdateComment:f,onToggleNegate:d,onDuplicate:h,onRemove:p,onMove:g,disabled:b})=>{let m=(0,ne.useId)(),y=`${m}-panel`,v=Ut(t.type),x=(0,ne.useRef)(null),A=t.id;(0,ne.useEffect)(()=>(c(A,x.current),()=>c(A,null)),[A,c]);let w=(0,ne.useMemo)(()=>(i??[]).filter(D=>D.itemId===t.id),[i,t.id]),k=Nj(w),C=(0,ne.useMemo)(()=>w.filter(D=>D.fieldKey===void 0),[w]);if(!v)return(0,B.jsx)("li",{className:"spytial-ed-row spytial-ed-row--unknown",children:(0,B.jsxs)("div",{className:"spytial-ed-row-main",children:[(0,B.jsx)("span",{className:"spytial-ed-row-type",children:t.type}),(0,B.jsx)("span",{className:"spytial-ed-row-summary spytial-ed-row-summary--muted",children:"preserved as written"})]})});let O=(()=>{try{return v.summary(t.params)}catch{return""}})(),M=Tj.has(t.type),_=t.params.hold==="never";return(0,B.jsxs)("li",{className:`spytial-ed-row${o?" spytial-ed-row--expanded":""}${k?` spytial-ed-row--${k}`:""}`,children:[(0,B.jsxs)("div",{className:"spytial-ed-row-main",children:[(0,B.jsxs)("button",{ref:x,type:"button",className:"spytial-ed-row-toggle","aria-expanded":o,"aria-controls":y,disabled:b,onClick:()=>l(t.id),children:[(0,B.jsx)("span",{className:"spytial-ed-row-type",children:v.label}),_?(0,B.jsx)("span",{className:"spytial-ed-row-negated",role:"img","aria-label":"should not hold",title:"should not hold (hold: never)",children:"\xAC"}):null,(0,B.jsx)("span",{className:"spytial-ed-row-summary",children:O}),k?(0,B.jsx)("span",{className:`spytial-ed-row-dot spytial-ed-row-dot--${k}`,role:"img","aria-label":`${k}: ${w.length} issue${w.length===1?"":"s"}`}):null]}),(0,B.jsx)(Dj,{item:t,index:e,count:n,disabled:b,onDuplicate:h,onRemove:p,onMove:g,onAddComment:()=>l(t.id)})]}),o?(0,B.jsxs)("div",{className:"spytial-ed-row-panel",id:y,onKeyDown:D=>{D.key==="Escape"&&(D.stopPropagation(),a(t.id),x.current?.focus())},children:[C.length>0?(0,B.jsx)("ul",{className:"spytial-ed-diagnostics spytial-ed-diagnostics--item",children:C.map((D,F)=>(0,B.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${D.severity}`,children:[(0,B.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,B.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:D.message})]},F))}):null,(0,B.jsx)(fp,{fields:Rj(v.fields),values:t.params,diagnostics:w,options:r,disabled:b,onChange:(D,F)=>u(t.id,D,F),selectorProps:s?D=>s(t,D):void 0}),M?(0,B.jsxs)("div",{className:"spytial-ed-field spytial-ed-field--hold",children:[(0,B.jsx)("span",{className:"spytial-ed-field-label",id:`${m}-hold-label`,title:"Whether this constraint must hold, or must NOT hold (hold: never), in the layout.",children:"Condition"}),(0,B.jsx)("div",{className:"spytial-ed-field-control",children:(0,B.jsxs)("div",{className:"spytial-ed-pills",role:"radiogroup","aria-labelledby":`${m}-hold-label`,children:[(0,B.jsx)("button",{type:"button",role:"radio","aria-checked":!_,className:`spytial-ed-pill${_?"":" spytial-ed-pill--active"}`,disabled:b,onClick:()=>d(t.id,!1),children:"Should hold"}),(0,B.jsx)("button",{type:"button",role:"radio","aria-checked":_,className:`spytial-ed-pill${_?" spytial-ed-pill--active spytial-ed-pill--negated":""}`,disabled:b,onClick:()=>d(t.id,!0),children:"Should not hold"})]})})]}):null,(0,B.jsxs)("div",{className:"spytial-ed-field spytial-ed-field--text",children:[(0,B.jsx)("label",{className:"spytial-ed-field-label",htmlFor:`${m}-comment`,children:"Comment"}),(0,B.jsx)("div",{className:"spytial-ed-field-control",children:(0,B.jsx)("input",{id:`${m}-comment`,type:"text",className:"spytial-ed-input",value:t.comment??"",placeholder:"Optional note (round-trips as a YAML comment)",disabled:b,onChange:D=>f(t.id,D.target.value)})})]})]}):null]})},Dj=({item:t,index:e,count:n,disabled:i,onDuplicate:r,onRemove:s,onMove:o,onAddComment:l})=>{let[a,c]=(0,ne.useState)(!1),u=(0,ne.useRef)(null),f=(0,ne.useRef)(null),d=po(a,f,{align:"end",estimatedHeight:220}),h=Ut(t.type)?.label??t.type;(0,ne.useEffect)(()=>{if(!a)return;let b=m=>{u.current&&!u.current.contains(m.target)&&c(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a]);let p=(0,ne.useCallback)(()=>c(!1),[]),g=(0,ne.useCallback)(b=>{b(),p()},[p]);return(0,B.jsxs)("div",{className:"spytial-ed-overflow",ref:u,children:[(0,B.jsx)("button",{ref:f,type:"button",className:"spytial-ed-overflow-btn","aria-haspopup":"menu","aria-expanded":a,"aria-label":`Actions for ${h}`,disabled:i,onClick:()=>c(b=>!b),children:(0,B.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})}),a?(0,B.jsxs)("ul",{className:"spytial-ed-overflow-menu",style:d,role:"menu","aria-label":`Actions for ${h}`,onKeyDown:b=>{b.key==="Escape"&&(b.stopPropagation(),p())},children:[(0,B.jsx)("li",{role:"none",children:(0,B.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",onClick:()=>g(l),children:"Add comment"})}),(0,B.jsx)("li",{role:"none",children:(0,B.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",onClick:()=>g(()=>r(t.id)),children:"Duplicate"})}),(0,B.jsx)("li",{role:"none",children:(0,B.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",disabled:e===0,onClick:()=>g(()=>o(t.id,-1)),children:"Move up"})}),(0,B.jsx)("li",{role:"none",children:(0,B.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",disabled:e>=n-1,onClick:()=>g(()=>o(t.id,1)),children:"Move down"})}),(0,B.jsx)("li",{role:"none",children:(0,B.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item spytial-ed-overflow-item--danger","aria-label":`Remove ${h} ${t.kind}`,onClick:()=>g(()=>s(t.id)),children:"Delete"})})]}):null]})},Mj=({kind:t,onAdd:e,disabled:n,triggerRef:i})=>{let[r,s]=(0,ne.useState)(!1),[o,l]=(0,ne.useState)(""),a=(0,ne.useRef)(null),c=(0,ne.useRef)(null),u=(0,ne.useRef)(null),f=(0,ne.useCallback)(y=>{u.current=y,typeof i=="function"?i(y):i&&typeof i=="object"&&(i.current=y)},[i]),d=po(r,u,{align:"end",estimatedHeight:320}),h=(0,ne.useMemo)(()=>tb(t),[t]),p=(0,ne.useMemo)(()=>{let y=o.trim().toLowerCase();return y?h.filter(v=>v.label.toLowerCase().includes(y)||v.type.toLowerCase().includes(y)||(v.description??"").toLowerCase().includes(y)):h},[h,o]);(0,ne.useEffect)(()=>{if(!r)return;requestAnimationFrame(()=>c.current?.focus());let y=v=>{a.current&&!a.current.contains(v.target)&&s(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[r]);let g=(0,ne.useCallback)(()=>{s(!1),l("")},[]),b=(0,ne.useCallback)(y=>{e(t,y),g()},[e,t,g]),m=t==="constraint"?"Add constraint":"Add directive";return(0,B.jsxs)("div",{className:"spytial-ed-add",ref:a,children:[(0,B.jsxs)("button",{ref:f,type:"button",className:"spytial-ed-add-btn","aria-haspopup":"menu","aria-expanded":r,disabled:n,onClick:()=>s(y=>!y),children:["+ ",m]}),r?(0,B.jsxs)("div",{className:"spytial-ed-add-menu",style:d,role:"menu","aria-label":m,onKeyDown:y=>{y.key==="Escape"&&(y.preventDefault(),g())},children:[(0,B.jsx)("input",{ref:c,type:"text",className:"spytial-ed-add-search",value:o,placeholder:"Search types\u2026","aria-label":`Search ${t} types`,onChange:y=>l(y.target.value)}),(0,B.jsx)("ul",{className:"spytial-ed-add-list",children:p.length===0?(0,B.jsx)("li",{className:"spytial-ed-add-empty",children:"No matching types."}):p.map(y=>(0,B.jsx)("li",{role:"none",children:(0,B.jsxs)("button",{type:"button",role:"menuitem",className:"spytial-ed-add-item",onClick:()=>b(y.type),children:[(0,B.jsx)("span",{className:"spytial-ed-add-item-label",children:y.label}),y.description?(0,B.jsx)("span",{className:"spytial-ed-add-item-desc",children:y.description}):null]})},y.type))})]}):null]})};function Rj(t){return t.filter(e=>e.key!=="hold")}function Nj(t){if(t.length!==0)return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"}var kt=X(Ce()),Fx=({result:t,onDismiss:e})=>{let n=t.suggestions??[],i=t.notes??[];return(0,kt.jsxs)("div",{className:"spytial-ed-suggestions",role:"region","aria-label":"Layout suggestions",children:[(0,kt.jsxs)("div",{className:"spytial-ed-suggestions-head",children:[(0,kt.jsx)("span",{className:"spytial-ed-suggestions-title",children:n.length>0?`${n.length} suggestion${n.length===1?"":"s"}`:"Suggestion applied"}),(0,kt.jsx)("button",{type:"button",className:"spytial-ed-suggestions-dismiss","aria-label":"Dismiss suggestions",title:"Dismiss",onClick:e,children:(0,kt.jsx)("span",{"aria-hidden":"true",children:"\xD7"})})]}),n.length>0?(0,kt.jsx)("ul",{className:"spytial-ed-suggestions-list",children:n.map(r=>(0,kt.jsx)(Lj,{suggestion:r},r.id))}):null,i.length>0?(0,kt.jsx)("ul",{className:"spytial-ed-suggestions-notes",children:i.map((r,s)=>(0,kt.jsx)("li",{children:r},s))}):null]})},Lj=({suggestion:t})=>{let{id:e,rationale:n,confidence:i,outcome:r}=t;return(0,kt.jsxs)("li",{className:`spytial-ed-suggestion${r==="omitted"?" spytial-ed-suggestion--omitted":""}`,children:[(0,kt.jsxs)("div",{className:"spytial-ed-suggestion-head",children:[(0,kt.jsx)("span",{className:"spytial-ed-suggestion-text",children:n||e}),i?(0,kt.jsx)("span",{className:`spytial-ed-suggestion-chip spytial-ed-suggestion-chip--${i}`,title:`${i} confidence`,children:i}):null,r?(0,kt.jsx)("span",{className:`spytial-ed-suggestion-chip spytial-ed-suggestion-chip--${r}`,title:`Outcome: ${r}`,children:r}):null]}),n?(0,kt.jsx)("code",{className:"spytial-ed-suggestion-id",children:e}):null]})};var $=X(Tt());var Ze=X(Ce()),Ij=300,_j=400,Vx=({value:t,onChange:e,instance:n,domain:i,theme:r,selectorAssistant:s,layoutAssistant:o,density:l="compact",syntaxHighlighting:a=!0,defaultView:c="builder",view:u,onViewChange:f,className:d,disabled:h=!1,"aria-label":p="Layout specification editor",onDiagnostics:g})=>{let b=(0,$.useRef)(null);b.current===null&&(b.current=Bj(t));let m=b.current.doc,[,y]=(0,$.useReducer)(P=>P+1,0),v=(0,$.useRef)(t),x=(0,$.useRef)(0),[A,w]=(0,$.useState)(c),k=u??A,C=(0,$.useRef)(null),O=(0,$.useRef)(null),M=(0,$.useRef)(()=>{}),_=(0,$.useCallback)(P=>{M.current(),u===void 0&&w(P),f?.(P)},[u,f]),[D,F]=(0,$.useState)(()=>b.current?.error??null),V=(0,$.useMemo)(()=>{if(i)return i;if(n)return t1(n)},[i,n]),ae=(0,$.useMemo)(()=>i1(V),[V]),$e=(0,$.useMemo)(()=>V?.relations.map(P=>P.name)??[],[V]),Xt=(0,$.useMemo)(()=>V?.types.map(P=>P.name)??[],[V]),he=(0,$.useCallback)(()=>{let P=m.toYaml();v.current=P,x.current+=1,F(null),e(P)},[m,e]),[et,Wn]=(0,$.useState)([]),At=(0,$.useRef)(0),Ve=(0,$.useRef)(null),yt=(0,$.useMemo)(()=>m.validate(V),[m,V,t]),bt=(0,$.useMemo)(()=>[...yt,...et],[yt,et]),cn=(0,$.useRef)("");(0,$.useEffect)(()=>{if(!g)return;let P=qj(bt);P!==cn.current&&(cn.current=P,g(bt))},[bt,g]),(0,$.useEffect)(()=>{if(t===v.current)return;let P;try{P=m.toYaml()}catch{P=""}if(t===P){v.current=t;return}try{m.replaceFromYaml(t),v.current=t,x.current+=1,F(null),y()}catch(Te){F($x(Te))}},[t,m]),(0,$.useEffect)(()=>m.subscribe(()=>y()),[m]);let un=(0,$.useCallback)(()=>{C.current&&(clearTimeout(C.current),C.current=null);let P=O.current;if(O.current=null,!!P&&x.current===P.seq)try{m.replaceFromYaml(P.text),F(null),y()}catch(Te){F($x(Te))}},[m]);M.current=un;let Zn=(0,$.useCallback)(P=>{h||(v.current=P,e(P),C.current&&clearTimeout(C.current),O.current={text:P,seq:x.current},C.current=setTimeout(un,Ij))},[h,e,un]);(0,$.useEffect)(()=>()=>{Ka.current=!1,C.current&&clearTimeout(C.current),Ve.current&&clearTimeout(Ve.current)},[]);let[Jn,jo]=(0,$.useState)({running:!1,result:null,error:null}),Yo=(0,$.useRef)(0),Ka=(0,$.useRef)(!0),lg=(0,$.useCallback)(()=>{let P=o?.suggest;if(!P||h)return;M.current();let Te=++Yo.current;jo({running:!0,result:null,error:null});let Ct={domain:V,instance:n,currentYaml:t};Promise.resolve().then(()=>P(Ct)).then(En=>{Te!==Yo.current||!Ka.current||(m.replaceFromYaml(En.yaml),he(),jo({running:!1,result:En,error:null}))}).catch(En=>{Te!==Yo.current||!Ka.current||jo({running:!1,result:null,error:En instanceof Error?En.message:String(En)})})},[o,h,V,n,t,m,he]),Ko=(0,$.useCallback)(()=>{Yo.current+=1,jo({running:!1,result:null,error:null})},[]),Ff=(0,$.useCallback)((P,Te)=>{if(h)return;let Ct=m.addItem(P,Te);return he(),Ct},[h,m,he]),ag=(0,$.useCallback)((P,Te,Ct)=>{if(h)return;let En=Ct===""?void 0:Ct;m.updateItem(P,{params:{[Te]:En}}),he()},[h,m,he]),cg=(0,$.useCallback)((P,Te)=>{h||(m.updateItem(P,{comment:Te}),he())},[h,m,he]),ug=(0,$.useCallback)((P,Te)=>{h||(m.updateItem(P,{params:{hold:Te?"never":void 0}}),he())},[h,m,he]),fg=(0,$.useCallback)(P=>{h||!m.duplicateItem(P)||he()},[h,m,he]),U=(0,$.useCallback)(P=>{h||(m.removeItem(P),he())},[h,m,he]),re=(0,$.useCallback)((P,Te)=>{if(h)return;let Ct=m.getState(),_r=(Ct.constraints.some(Ot=>Ot.id===P)?Ct.constraints:Ct.directives).findIndex(Ot=>Ot.id===P);_r!==-1&&(m.moveItem(P,_r+Te),he())},[h,m,he]),Wi=(0,$.useCallback)(()=>{h||!m.canUndo()||(m.undo(),he())},[h,m,he]),Ir=(0,$.useCallback)(()=>{h||!m.canRedo()||(m.redo(),he())},[h,m,he]),Go=(0,$.useCallback)(P=>{!(P.metaKey||P.ctrlKey)||P.key.toLowerCase()!=="z"||(P.preventDefault(),P.shiftKey?Ir():Wi())},[Wi,Ir]),Us=(0,$.useCallback)((P,Te)=>{if(Te.kind!=="selector")return;let Ct={itemKind:P.kind,itemType:P.type,fieldKey:Te.key,domain:V,specYaml:v.current},_r={complete:Ot=>{let Zi=ae(Ot),Ji=s?.complete;if(!Ji)return Zi;let Ga={...Ct,currentValue:String(P.params[Te.key]??"")},$f;try{$f=Ji(Ga,Ot)??[]}catch{return Zi}return Promise.resolve($f).then(dg=>r1(dg??[],Zi)).catch(()=>Zi)},highlight:a};if(s?.synthesize){let Ot=s.synthesize;_r.synthesize=Zi=>{let Ji={...Ct,currentValue:String(P.params[Te.key]??"")};return Ot(Ji,Zi)}}return _r},[V,ae,s,a]);(0,$.useEffect)(()=>{let P=s?.review;if(!P){Wn([]);return}Ve.current&&clearTimeout(Ve.current);let Te=++At.current;Ve.current=setTimeout(()=>{let Ct=m.getState(),En=[...Ct.constraints,...Ct.directives],_r=[];for(let Ot of En){let Zi=Ut(Ot.type);if(Zi)for(let Ji of Zi.fields){if(Ji.kind!=="selector")continue;let Ga=String(Ot.params[Ji.key]??"");if(Ga.trim()==="")continue;let $f={itemKind:Ot.kind,itemType:Ot.type,fieldKey:Ji.key,currentValue:Ga,domain:V,specYaml:v.current};_r.push(Promise.resolve().then(()=>P($f,Ga)).then(dg=>(dg??[]).map(b_=>({...b_,itemId:Ot.id,fieldKey:Ji.key,source:"assistant"}))).catch(()=>[]))}}Promise.all(_r).then(Ot=>{Te===At.current&&Wn(Ot.flat())}).catch(()=>{Te===At.current&&Wn([])})},_j)},[s,V,t,m]);let wi=m.getState(),XS=D!==null,g_=["spytial-ed",l==="compact"?"spytial-ed--compact":"",d??""].filter(Boolean).join(" "),y_=(0,$.useMemo)(()=>e1(t,V),[t,V]),WS=o1(r);return(0,Ze.jsxs)("section",{className:g_,style:WS?s1(WS):void 0,"aria-label":p,onKeyDown:Go,children:[(0,Ze.jsxs)("div",{className:"spytial-ed-toolbar",children:[(0,Ze.jsxs)("div",{className:"spytial-ed-viewtoggle",role:"tablist","aria-label":"Editor view",children:[(0,Ze.jsxs)("button",{type:"button",role:"tab","aria-selected":k==="builder",className:`spytial-ed-viewtoggle-btn${k==="builder"?" spytial-ed-viewtoggle-btn--active":""}`,disabled:h,onClick:()=>_("builder"),children:["Builder",XS?(0,Ze.jsx)("span",{className:"spytial-ed-diagnostic-badge spytial-ed-diagnostic-badge--warning",title:"Text has unapplied edits","aria-label":"Text has unapplied edits",children:"!"}):null]}),(0,Ze.jsx)("button",{type:"button",role:"tab","aria-selected":k==="code",className:`spytial-ed-viewtoggle-btn${k==="code"?" spytial-ed-viewtoggle-btn--active":""}`,disabled:h,onClick:()=>_("code"),children:"Code"})]}),(0,Ze.jsxs)("div",{className:"spytial-ed-toolbar-actions",children:[o?.suggest?(0,Ze.jsxs)("button",{type:"button",className:"spytial-ed-suggest-btn",title:"Suggest a layout for the current data",disabled:h||Jn.running,"aria-busy":Jn.running,onClick:lg,children:[(0,Ze.jsx)("span",{"aria-hidden":"true",children:"\u2726"}),Jn.running?"Analyzing\u2026":"Suggest"]}):null,(0,Ze.jsxs)("div",{className:"spytial-ed-history",children:[(0,Ze.jsx)("button",{type:"button",className:"spytial-ed-history-btn","aria-label":"Undo",title:"Undo (Cmd/Ctrl+Z)",disabled:h||!m.canUndo(),onClick:Wi,children:(0,Ze.jsx)("span",{"aria-hidden":"true",children:"\u21B6"})}),(0,Ze.jsx)("button",{type:"button",className:"spytial-ed-history-btn","aria-label":"Redo",title:"Redo (Shift+Cmd/Ctrl+Z)",disabled:h||!m.canRedo(),onClick:Ir,children:(0,Ze.jsx)("span",{"aria-hidden":"true",children:"\u21B7"})})]})]})]}),Jn.error!==null?(0,Ze.jsx)("p",{className:"spytial-ed-suggest-error",role:"alert",children:Jn.error}):null,Jn.result!==null?(0,Ze.jsx)(Fx,{result:Jn.result,onDismiss:Ko}):null,(0,Ze.jsx)("div",{className:"spytial-ed-body",children:k==="builder"?(0,Ze.jsx)(Ux,{constraints:wi.constraints,directives:wi.directives,diagnostics:bt,options:{relationNames:$e,typeNames:Xt},selectorProps:Us,onAddItem:Ff,onUpdateParam:ag,onUpdateComment:cg,onToggleNegate:ug,onDuplicate:fg,onRemove:U,onMove:re,disabled:h}):(0,Ze.jsx)(Hx,{value:t,onChange:Zn,diagnostics:y_,hasUnappliedEdits:XS,syntaxHighlighting:a,disabled:h})})]})};function Bj(t){try{return{doc:Kl.fromYaml(t),error:null}}catch(e){return{doc:new Kl,error:$x(e)}}}function $x(t){return t instanceof ds?{severity:"error",message:t.message,source:"yaml",...t.line!==void 0?{line:t.line}:{},...t.column!==void 0?{column:t.column}:{}}:{severity:"error",message:t instanceof Error?t.message:String(t),source:"yaml"}}function qj(t){return t.map(e=>`${e.severity}|${e.source}|${e.itemId??""}|${e.fieldKey??""}|${e.line??""}|${e.column??""}|${e.message}`).join(`
|
|
199
|
-
`)}function rR(t){return{id:t.id,type:t.type,params:{...t.params},...t.comment!==void 0?{comment:t.comment}:{}}}function yf(t){let e=hs(t);return{constraints:e.constraints.map(n=>rR(n)),directives:e.directives.map(n=>rR(n))}}function sR(t,e){let n={id:t.id||ii(),kind:e,type:t.type,params:{...t.params??{}}};return t.comment!==void 0&&(n.comment=t.comment),eb(t.type)||(n.raw={[t.type]:{...t.params??{}}}),n}function jx(t,e){let n={constraints:(t??[]).map(i=>sR(i,"constraint")),directives:(e??[]).map(i=>sR(i,"directive"))};return lu(n)}var Xpe=vh("constraint"),Wpe=[...vh("directive"),"size","hideAtom"];var lR=X(Ce()),oR=({yamlValue:t,value:e,onChange:n,isNoCodeView:i,onViewChange:r,constraints:s,setConstraints:o,directives:l,setDirectives:a,instance:c,domain:u,theme:f,selectorAssistant:d,layoutAssistant:h,density:
|
|
200
|
-
`)}for(let
|
|
201
|
-
`:e+=`no ${
|
|
195
|
+
`;this.styleTag.textContent=o;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var Ar={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ua={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},lU=typeof navigator<"u"&&/Mac/.test(navigator.platform),aU=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(rt=0;rt<10;rt++)Ar[48+rt]=Ar[96+rt]=String(rt);var rt;for(rt=1;rt<=24;rt++)Ar[rt+111]="F"+rt;var rt;for(rt=65;rt<=90;rt++)Ar[rt]=String.fromCharCode(rt+32),ua[rt]=String.fromCharCode(rt);var rt;for(wp in Ar)ua.hasOwnProperty(wp)||(ua[wp]=Ar[wp]);var wp;function $E(t){var e=lU&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||aU&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ua:Ar)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function kn(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?t.setAttribute(i,r):r!=null&&(t[i]=r)}e++}for(;e<arguments.length;e++)VE(t,arguments[e]);return t}function VE(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)VE(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}var Qt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},U1=typeof document<"u"?document:{documentElement:{style:{}}},F1=/Edge\/(\d+)/.exec(Qt.userAgent),AD=/MSIE \d/.test(Qt.userAgent),$1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qt.userAgent),Jp=!!(AD||$1||F1),jE=!Jp&&/gecko\/(\d+)/i.test(Qt.userAgent),L1=!Jp&&/Chrome\/(\d+)/.exec(Qt.userAgent),YE="webkitFontSmoothing"in U1.documentElement.style,V1=!Jp&&/Apple Computer/.test(Qt.vendor),KE=V1&&(/Mobile\/\w+/.test(Qt.userAgent)||Qt.maxTouchPoints>2),L={mac:KE||/Mac/.test(Qt.platform),windows:/Win/.test(Qt.platform),linux:/Linux|X11/.test(Qt.platform),ie:Jp,ie_version:AD?U1.documentMode||6:$1?+$1[1]:F1?+F1[1]:0,gecko:jE,gecko_version:jE?+(/Firefox\/(\d+)/.exec(Qt.userAgent)||[0,0])[1]:0,chrome:!!L1,chrome_version:L1?+L1[1]:0,ios:KE,android:/Android\b/.test(Qt.userAgent),webkit:YE,webkit_version:YE?+(/\bAppleWebKit\/(\d+)/.exec(Qt.userAgent)||[0,0])[1]:0,safari:V1,safari_version:V1?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Qt.userAgent)||[0,0])[1]:0,tabSize:U1.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Dv(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}var Ip=Object.create(null);function Mv(t,e,n){if(t==e)return!0;t||(t=Ip),e||(e=Ip);let i=Object.keys(t),r=Object.keys(e);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function cU(t,e){for(let n=t.attributes.length-1;n>=0;n--){let i=t.attributes[n].name;e[i]==null&&t.removeAttribute(i)}for(let n in e){let i=e[n];n=="style"?t.style.cssText=i:t.getAttribute(n)!=i&&t.setAttribute(n,i)}}function GE(t,e,n){let i=!1;if(e)for(let r in e)n&&r in n||(i=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(i=!0,r=="style"?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return i}function uU(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=i.value}return e}var Tr=class{eq(e){return!1}updateDOM(e,n,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},ln=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(ln||(ln={})),Se=class extends Hi{constructor(e,n,i,r){super(),this.startSide=e,this.endSide=n,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Gu(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return n+=i&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Ao(e,n,n,i,e.widget||null,!1)}static replace(e){let n=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=CD(e,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new Ao(e,i,r,n,e.widget||null,!0)}static line(e){return new Qu(e)}static set(e,n=!1){return me.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};Se.none=me.empty;var Gu=class t extends Se{constructor(e){let{start:n,end:i}=CD(e);super(n?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Dv(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Ip}eq(e){return this==e||e instanceof t&&this.tagName==e.tagName&&Mv(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}};Gu.prototype.point=!1;var Qu=class t extends Se{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof t&&this.spec.class==e.spec.class&&Mv(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}};Qu.prototype.mapMode=Kt.TrackBefore;Qu.prototype.point=!0;var Ao=class t extends Se{constructor(e,n,i,r,s,o){super(n,i,s,e),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?Kt.TrackBefore:Kt.TrackAfter:Kt.TrackDel}get type(){return this.startSide!=this.endSide?ln.WidgetRange:this.startSide<=0?ln.WidgetBefore:ln.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof t&&fU(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}};Ao.prototype.point=!0;function CD(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return n==null&&(n=t.inclusive),i==null&&(i=t.inclusive),{start:n??e,end:i??e}}function fU(t,e){return t==e||!!(t&&e&&t.compare(e))}function ga(t,e,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=t?n[r]=Math.max(n[r],e):n.push(t,e)}var _p=class t extends Hi{constructor(e,n,i){super(),this.tagName=e,this.attributes=n,this.rank=i}eq(e){return e==this||e instanceof t&&this.tagName==e.tagName&&Mv(this.attributes,e.attributes)}static create(e){return new t(e.tagName,e.attributes||Ip,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return me.of(e,n)}};_p.prototype.startSide=_p.prototype.endSide=-1;function Xu(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function j1(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function zu(t,e){if(!e.anchorNode)return!1;try{return j1(t,e.anchorNode)}catch{return!1}}function Np(t){return t.nodeType==3?Wu(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Hu(t,e,n,i){return n?QE(t,e,n,i,-1)||QE(t,e,n,i,1):!1}function Cs(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Bp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function QE(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:Er(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=Cs(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?Er(t):0}else return!1}}function Er(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function qp(t,e){let{left:n,right:i}=t;if(n==i)return t;let r=e?n:i;return{left:r,right:r,top:t.top,bottom:t.bottom}}function dU(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function OD(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function hU(t,e,n,i,r,s,o,l){let a=t.ownerDocument,c=a.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==a.body,m=1,g=1;if(h)d=dU(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:m,scaleY:g}=OD(u,y)),d={left:y.left,right:y.left+u.clientWidth*m,top:y.top,bottom:y.top+u.clientHeight*g}}let b=0,p=0;if(r=="nearest")e.top<d.top+o?(p=e.top-(d.top+o),n>0&&e.bottom>d.bottom+p&&(p=e.bottom-d.bottom+o)):e.bottom>d.bottom-o&&(p=e.bottom-d.bottom+o,n<0&&e.top-p<d.top&&(p=e.top-(d.top+o)));else{let y=e.bottom-e.top,v=d.bottom-d.top;p=(r=="center"&&y<=v?e.top+y/2-v/2:r=="start"||r=="center"&&n<0?e.top-o:e.bottom-v+o)-d.top}if(i=="nearest"?e.left<d.left+s?(b=e.left-(d.left+s),n>0&&e.right>d.right+b&&(b=e.right-d.right+s)):e.right>d.right-s&&(b=e.right-d.right+s,n<0&&e.left<d.left+b&&(b=e.left-(d.left+s))):b=(i=="center"?e.left+(e.right-e.left)/2-(d.right-d.left)/2:i=="start"==l?e.left-s:e.right-(d.right-d.left)+s)-d.left,b||p)if(h)c.scrollBy(b,p);else{let y=0,v=0;if(p){let x=u.scrollTop;u.scrollTop+=p/g,v=(u.scrollTop-x)*g}if(b){let x=u.scrollLeft;u.scrollLeft+=b/m,y=(u.scrollLeft-x)*m}e={left:e.left-y,top:e.top-v,right:e.right-y,bottom:e.bottom-v},y&&Math.abs(y-b)<1&&(i="nearest"),v&&Math.abs(v-p)<1&&(r="nearest")}if(h)break;(e.top<d.top||e.bottom>d.bottom||e.left<d.left||e.right>d.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function TD(t,e=!0){let n=t.ownerDocument,i=null,r=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}var Y1=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:i}=e;this.set(n,Math.min(e.anchorOffset,n?Er(n):0),i,Math.min(e.focusOffset,i?Er(i):0))}set(e,n,i,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}},wo=null;L.safari&&L.safari_version>=26&&(wo=!1);function ED(t){if(t.setActive)return t.setActive();if(wo)return t.focus(wo);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(wo==null?{get preventScroll(){return wo={preventScroll:!0},!0}}:void 0),!wo){wo=!1;for(let n=0;n<e.length;){let i=e[n++],r=e[n++],s=e[n++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=s&&(i.scrollLeft=s)}}}var XE;function Wu(t,e,n=e){let i=XE||(XE=document.createRange());return i.setEnd(t,n),i.setStart(t,e),i}function ya(t,e,n,i){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function pU(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function mU(t,e){let n=e.focusNode,i=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=i)return!1;for(i=Math.min(i,Er(n));;)if(i){if(n.nodeType!=1)return!1;let r=n.childNodes[i-1];r.contentEditable=="false"?i--:(n=r,i=Er(n))}else{if(n==t)return!0;i=Cs(n),n=n.parentNode}}function DD(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function MD(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=Er(n)}else if(n.parentNode&&!Bp(n))i=Cs(n),n=n.parentNode;else return null}}function RD(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i<n.nodeValue.length)return{node:n,offset:i};if(n.nodeType==1&&i<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[i],i=0}else if(n.parentNode&&!Bp(n))i=Cs(n)+1,n=n.parentNode;else return null}}var Fi=class t{constructor(e,n,i=!0){this.node=e,this.offset=n,this.precise=i}static before(e,n){return new t(e.parentNode,Cs(e),n)}static after(e,n){return new t(e.parentNode,Cs(e)+1,n)}},Ie=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(Ie||(Ie={})),Co=Ie.LTR,Rv=Ie.RTL;function ND(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}var gU=ND("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),yU=ND("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),K1=Object.create(null),Ui=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);K1[e]=n,K1[n]=-e}function LD(t){return t<=247?gU[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?yU[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}var bU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,jn=class{get dir(){return this.level%2?Rv:Co}constructor(e,n,i){this.from=e,this.to=n,this.level=i}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,i,r){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=n&&l.to>=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.from<n:l.to>n:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function ID(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let i=t[n],r=e[n];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!ID(i.inner,r.inner))return!1}return!0}var Oe=[];function vU(t,e,n,i,r){for(let s=0;s<=i.length;s++){let o=s?i[s-1].to:e,l=s<i.length?i[s].from:n,a=s?256:r;for(let c=o,u=a,f=a;c<l;c++){let d=LD(t.charCodeAt(c));d==512?d=u:d==8&&f==4&&(d=16),Oe[c]=d==4?2:d,d&7&&(f=d),u=d}for(let c=o,u=a,f=a;c<l;c++){let d=Oe[c];if(d==128)c<l-1&&u==Oe[c+1]&&u&24?d=Oe[c]=u:Oe[c]=256;else if(d==64){let h=c+1;for(;h<l&&Oe[h]==64;)h++;let m=c&&u==8||h<n&&Oe[h]==8?f==1?1:8:256;for(let g=c;g<h;g++)Oe[g]=m;c=h-1}else d==8&&f==1&&(Oe[c]=1);u=d,d&7&&(f=d)}}}function xU(t,e,n,i,r){let s=r==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:e,u=o<i.length?i[o].from:n;for(let f=c,d,h,m;f<u;f++)if(h=K1[d=t.charCodeAt(f)])if(h<0){for(let g=l-3;g>=0;g-=3)if(Ui[g+1]==-h){let b=Ui[g+2],p=b&2?r:b&4?b&1?s:r:0;p&&(Oe[f]=Oe[Ui[g]]=p),l=g;break}}else{if(Ui.length==189)break;Ui[l++]=f,Ui[l++]=d,Ui[l++]=a}else if((m=Oe[f])==2||m==1){let g=m==r;a=g?0:1;for(let b=l-3;b>=0;b-=3){let p=Ui[b+2];if(p&2)break;if(g)Ui[b+2]|=2;else{if(p&4)break;Ui[b+2]|=4}}}}}function SU(t,e,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:t,l=r<n.length?n[r].from:e;for(let a=o;a<l;){let c=Oe[a];if(c==256){let u=a+1;for(;;)if(u==l){if(r==n.length)break;u=n[r++].to,l=r<n.length?n[r].from:e}else if(Oe[u]==256)u++;else break;let f=s==1,d=(u<e?Oe[u]:i)==1,h=f==d?f?1:2:i;for(let m=u,g=r,b=g?n[g-1].to:t;m>a;)m==b&&(m=n[--g].from,b=g?n[g-1].to:t),Oe[--m]=h;a=u}else s=c,a++}}}function G1(t,e,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let a=e,c=0;a<n;){let u=!0,f=!1;if(c==s.length||a<s[c].from){let g=Oe[a];g!=l&&(u=!1,f=g==16)}let d=!u&&l==1?[]:null,h=u?i:i+1,m=a;e:for(;;)if(c<s.length&&m==s[c].from){if(f)break e;let g=s[c];if(!u)for(let b=g.to,p=c+1;;){if(b==n)break e;if(p<s.length&&s[p].from==b)b=s[p++].to;else{if(Oe[b]==l)break e;break}}if(c++,d)d.push(g);else{g.from>a&&o.push(new jn(a,g.from,h));let b=g.direction==Co!=!(h%2);Q1(t,b?i+1:i,r,g.inner,g.from,g.to,o),a=g.to}m=g.to}else{if(m==n||(u?Oe[m]!=l:Oe[m]==l))break;m++}d?G1(t,a,m,i+1,r,d,o):a<m&&o.push(new jn(a,m,h)),a=m}else for(let a=n,c=s.length;a>e;){let u=!0,f=!1;if(!c||a>s[c-1].to){let g=Oe[a-1];g!=l&&(u=!1,f=g==16)}let d=!u&&l==1?[]:null,h=u?i:i+1,m=a;e:for(;;)if(c&&m==s[c-1].to){if(f)break e;let g=s[--c];if(!u)for(let b=g.from,p=c;;){if(b==e)break e;if(p&&s[p-1].to==b)b=s[--p].from;else{if(Oe[b-1]==l)break e;break}}if(d)d.push(g);else{g.to<a&&o.push(new jn(g.to,a,h));let b=g.direction==Co!=!(h%2);Q1(t,b?i+1:i,r,g.inner,g.from,g.to,o),a=g.from}m=g.from}else{if(m==e||(u?Oe[m-1]!=l:Oe[m-1]==l))break;m--}d?G1(t,m,a,i+1,r,d,o):m<a&&o.push(new jn(m,a,h)),a=m}}function Q1(t,e,n,i,r,s,o){let l=e%2?2:1;vU(t,r,s,i,l),xU(t,r,s,i,l),SU(r,s,i,l),G1(t,r,s,e,n,i,o)}function wU(t,e,n){if(!t)return[new jn(0,0,e==Rv?1:0)];if(e==Co&&!n.length&&!bU.test(t))return _D(t.length);if(n.length)for(;t.length>Oe.length;)Oe[Oe.length]=256;let i=[],r=e==Co?0:1;return Q1(t,r,r,n,0,t.length,i),i}function _D(t){return[new jn(0,t,0)]}var BD="";function kU(t,e,n,i,r){var s;let o=i.head-t.from,l=jn.find(e,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),a=e[l],c=a.side(r,n);if(o==c){let d=l+=r?1:-1;if(d<0||d>=e.length)return null;a=e[l=d],o=a.side(!r,n),c=a.side(r,n)}let u=yt(t.text,o,a.forward(r,n));(u<a.from||u>a.to)&&(u=c),BD=t.text.slice(Math.min(o,u),Math.max(o,u));let f=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return f&&u==c&&f.level+(r?0:1)<a.level?R.cursor(f.side(!r,n)+t.from,f.forward(r,n)?1:-1,f.level):R.cursor(u+t.from,a.forward(r,n)?-1:1,a.level)}function AU(t,e,n){for(let i=e;i<n;i++){let r=LD(t.charCodeAt(i));if(r==1)return Co;if(r==2||r==4)return Rv}return Co}var qD=_.define(),PD=_.define(),zD=_.define(),HD=_.define(),X1=_.define(),UD=_.define(),FD=_.define(),Nv=_.define(),Lv=_.define(),$D=_.define({combine:t=>t.some(e=>e)}),CU=_.define({combine:t=>t.some(e=>e)}),VD=_.define(),Uu=class t{constructor(e,n,i,r,s,o=!1){this.range=e,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new t(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new t(R.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},kp=pe.define({map:(t,e)=>t.map(e)}),jD=pe.define();function An(t,e,n){let i=t.facet(HD);i.length?i[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}var Cr=_.define({combine:t=>t.length?t[0]:!0}),OU=0,da=_.define({combine(t){return t.filter((e,n)=>{for(let i=0;i<n;i++)if(t[i].plugin==e.plugin)return!1;return!0})}}),Yn=class t{constructor(e,n,i,r,s){this.id=e,this.create=n,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(da.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(da.of({plugin:this,arg:e}))}static define(e,n){let{eventHandlers:i,eventObservers:r,provide:s,decorations:o}=n||{};return new t(OU++,e,i,r,l=>{let a=[];return o&&a.push(em.of(c=>{let u=c.plugin(l);return u?o(u):Se.none})),s&&a.push(s(l)),a})}static fromClass(e,n){return t.define((i,r)=>new e(i,r),n)}},Fu=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(An(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){An(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(i){An(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},YD=_.define(),Iv=_.define(),em=_.define(),KD=_.define(),_v=_.define(),Zu=_.define(),GD=_.define();function WE(t,e){let n=t.state.facet(GD);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(t):s),r=[];return me.spans(i,e.from,e.to,{point(){},span(s,o,l,a){let c=s-e.from,u=o-e.from,f=r;for(let d=l.length-1;d>=0;d--,a--){let h=l[d].spec.bidiIsolate,m;if(h==null&&(h=AU(e.text,c,u)),a>0&&f.length&&(m=f[f.length-1]).to==c&&m.direction==h)m.to=u,f=m.inner;else{let g={from:c,to:u,direction:h,inner:[]};f.push(g),f=g.inner}}}}),r}var QD=_.define();function Bv(t){let e=0,n=0,i=0,r=0;for(let s of t.state.facet(QD)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:n,top:i,bottom:r}}var qu=_.define(),hi=class t{constructor(e,n,i,r){this.fromA=e,this.toA=n,this.fromB=i,this.toB=r}join(e){return new t(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,i=this;for(;n>0;n--){let r=e[n-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(n-1,1)}}return e.splice(n,0,i),e}static extendWithRanges(e,n){if(n.length==0)return e;let i=[];for(let r=0,s=0,o=0;;){let l=r<e.length?e[r].fromB:1e9,a=s<n.length?n[s]:1e9,c=Math.min(l,a);if(c==1e9)break;let u=c+o,f=c,d=u;for(;;)if(s<n.length&&n[s]<=f){let h=n[s+1];s+=2,f=Math.max(f,h);for(let m=r;m<e.length&&e[m].fromB<=f;m++)o=e[m].toA-e[m].toB;d=Math.max(d,h+o)}else if(r<e.length&&e[r].fromB<=f){let h=e[r++];f=Math.max(f,h.toB),d=Math.max(d,h.toA),o=h.toA-h.toB}else break;i.push(new t(u,d,c,f))}return i}},Pp=class t{constructor(e,n,i){this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Gt.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,a)=>r.push(new hi(s,o,l,a))),this.changedRanges=r}static create(e,n,i){return new t(e,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},TU=[],He=class{constructor(e,n,i=0){this.dom=e,this.length=n,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return TU}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&cU(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let i=n;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n,i){return null}domPosFor(e,n){let i=Cs(this.dom),r=this.length?e>0:n>0;return new Fi(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof va)return e;return null}static get(e){return e.cmTile}},ba=class extends He{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,i=null,r,s=e?.node==n?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=ZE(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=ZE(r);this.length=o}};function ZE(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var va=class extends ba{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=He.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof Or)n.push(r),i=o,r=0;else{let l=s+o.length,a=e(o,s);if(a!==void 0)return a;s=l+o.breakAfter}}}resolveBlock(e,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,a)=>{let c=a+l.length;if(e>=a&&e<=c){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(a<e||e==c&&(n<-1?l.length:l.covers(1)))&&(!i||!l.isWidget()&&i.isWidget())&&(i=l,r=e-a),(c>e||e==a&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-a)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}},Or=class t extends ba{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let i=new t(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}},xa=class t extends ba{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,i){let r=new t(n||document.createElement("div"),e);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,n,i){let r=null,s=-1,o=null,l=-1;function a(u,f){for(let d=0,h=0;d<u.children.length&&h<=f;d++){let m=u.children[d],g=h+m.length;g>=f&&(m.isComposite()?a(m,f-h):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&DU(o,m)))&&(g>f||m.flags&32)?(o=m,l=f-h):(h<f||m.flags&16&&!m.isHidden)&&(r=m,s=f-h)),h=g}}a(this,e);let c=(n<0?r:o)||r||o;return c?{tile:c,offset:c==r?s:l}:null}coordsIn(e,n,i){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n,i):EU(this)}domIn(e,n){let i=this.resolveInline(e,n);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new Fi(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:n);let o=i.tile.parent,l=!1;for(let a of o.children){if(l)return new Fi(a.dom,0);a==i.tile&&(l=!0)}}return new Fi(this.dom,0)}};function EU(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Np(e);return n[n.length-1]||null}function DU(t,e){let n=t.coordsIn(0,1),i=e.coordsIn(0,1);return n&&i&&i.top<n.bottom}var on=class t extends ba{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let i=new t(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}},ko=class t extends He{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n,i){let r=this.dom.nodeValue.length;e>r&&(e=r);let s=e,o=e,l=0;e==0&&n<0||e==r&&n>=0?L.chrome||L.gecko||(e?(s--,l=1):o<r&&(o++,l=-1)):n<0?s--:o<r&&o++;let a=Wu(this.dom,s,o).getClientRects();if(!a.length)return null;let c=a[(l?l<0:n>=0)?0:a.length-1];return L.safari&&!l&&c.width==0&&(c=Array.prototype.find.call(a,u=>u.width)||c),i==null?c:qp(c,(l?l>0:n<0)==i)}static of(e,n){let i=new t(n||document.createTextNode(e),e);return n||(i.flags|=2),i}},Oo=class t extends He{constructor(e,n,i,r){super(e,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,i){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(i)return qp(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top<o.bottom);a+=l?-1:1);return qp(o,!l)}}get overrideDOMText(){if(!this.length)return ue.empty;let{root:e}=this;if(!e)return ue.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,i,r,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new t(s,i,e,r)}},Sa=class extends He{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return ue.empty}coordsIn(e,n,i){let r=this.dom.getBoundingClientRect();return i==null?r:qp(r,n>0==i)}},W1=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||n>0;)if(r.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let a=r.children[s],c=a.breakAfter;(n>0?a.length<=e:a.length<e)&&(!i||i.skip(a,0,a.length)!==!1||!a.isComposite)?(o=!!c,s++,e-=a.length):(l.push({tile:r,index:s}),r=a,s=0,i&&a.isComposite()&&i.enter(a))}else if(s==r.length)o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++;else if(e){let a=Math.min(e,r.length-s);i&&i.skip(r,s,s+a),e-=a,s+=a}else break;return this.tile=r,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},Z1=class{constructor(e,n,i,r){this.from=e,this.to=n,this.wrapper=i,this.rank=r}},J1=class{constructor(e,n,i){this.cache=e,this.root=n,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,i,r){var s;this.flushBuffer();let o=this.ensureMarks(n,i),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let a=o.children[o.children.length-1]=new ko(l.dom,l.text+e);a.parent=o}else o.append(r||ko.of(e,(s=this.cache.find(ko))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let i=this.curLine;i.dom!=n.line.dom&&(i.setDOM(this.cache.reused.has(n.line)?I1(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let r=i;for(let l=n.marks.length-1;l>=0;l--){let a=n.marks[l],c=r.lastChild;if(c instanceof on&&c.mark.eq(a.mark))c.dom!=a.dom&&c.setDOM(I1(a.dom)),r=c;else{if(this.cache.reused.get(a)){let f=He.get(a.dom);f&&f.setDOM(I1(a.dom))}let u=on.of(a.mark,a.dom);r.append(u),r=u}this.cache.reused.set(a,2)}let s=He.get(e.text);s&&this.cache.reused.set(s,2);let o=new ko(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,n,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var i;e||(e=XD);let r=xa.start(e,n||((i=this.cache.find(xa))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(n>0&&(l=r.lastChild)&&l instanceof on&&l.mark.eq(o))r=l,n--;else{let a=on.of(o,(i=this.cache.find(on,c=>c.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(a),r=a,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!JE(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(L.ios&&JE(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(_1,0,32)||new Oo(_1.toDOM(),0,_1,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=e.rank*102+e.value.rank,i=new Z1(e.from,e.to,e.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.from<this.pos&&r instanceof Or&&r.wrapper.eq(i.wrapper))n=r;else{let s=Or.of(i.wrapper,(e=this.cache.find(Or,o=>o.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),i=this.cache.find(Sa,void 0,1);return i&&(i.flags=n),i||new Sa(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},ev=class{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,n);return this.textOff=n,i}},zp=[Oo,xa,ko,on,Sa,Or,va];for(let t=0;t<zp.length;t++)zp[t].bucket=t;var tv=class{constructor(e){this.view=e,this.buckets=zp.map(()=>[]),this.index=zp.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,i=this.buckets[n];i.length<6?i.push(e):i[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,i=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l<s.length;l++){let a=(l+o)%s.length,c=s[a];if((!n||n(c))&&!this.reused.has(c))return s.splice(a,1),a<o&&this.index[r]--,this.reused.set(c,i),c}return null}findWidget(e,n,i){let r=this.buckets[0];if(r.length)for(let s=0,o=0;;s++){if(s==r.length){if(o)return null;o=1,s=0}let l=r[s];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==n&&(l.flags&497)==i?(this.reused.set(l,1),l):(this.reused.set(l,2),new Oo(l.dom,n,e,l.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},nv=class{constructor(e,n,i,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new tv(e),this.text=new ev(e.state.doc),this.builder=new J1(this.cache,new va(e,e.contentDOM),me.iter(i)),this.cache.reused.set(n,2),this.old=new W1(n),this.reuseWalker={skip:(o,l,a)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=o<e.length?e[o++]:null,a=l?l.fromA:this.old.root.length;if(a>r){let c=a-r;this.preserve(c,!o,!l),r=a,s+=c}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,i),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,l.toA),this.emit(n.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,r=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,i){let r=NU(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(o,l,a)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let c=a>0||l<o.length?Oo.of(o.widget,this.view,a-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,r,s),s=r.length)}else if(o.isText())this.builder.ensureLine(null),!l&&a==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,r,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,a),r,s)),s=r.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof Sa)this.cache.add(o);else if(o instanceof on)this.builder.ensureLine(null),this.builder.addMark(o,r,s),this.cache.reused.set(o,1),s=r.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof on&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof on&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let i=null,r=this.builder,s=-1,o=me.spans(this.decorations,e,n,{point:(l,a,c,u,f,d)=>{if(c instanceof Ao){if(this.disallowBlockEffectsFor[d]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=u.length,f>u.length)r.continueWidget(a-l);else{let h=c.widget||(c.block?Os.block:Os.inline),m=MU(c),g=this.cache.findWidget(h,a-l,m)||Oo.of(h,this.view,a-l,m);c.block?(c.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(g)):(r.ensureLine(i),r.addInlineWidget(g,u,f))}i=null}else i=RU(i,c);a>l&&this.text.skip(a-l)},span:(l,a,c,u)=>{for(let f=l;f<a;){let d=this.text.next(Math.min(512,a-f));d==null?(r.addLineStartIfNotCovered(i),r.addBreak(),f++):(r.ensureLine(i),r.addText(d,c,f==l?u:c.length),f+=d.length),i=null}s=c.length}});s>-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(e,n,i=1){n-e<=10?this.old.advance(n-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let n=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=He.get(r);if(r==this.view.contentDOM)break;s instanceof on?n.push(s):s?.isLine()?i=s:s instanceof Or||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new xa(r,XD):i||n.push(on.of(new Gu({tagName:r.nodeName.toLowerCase(),attributes:uU(r)}),r)))}return{line:i,marks:n}}};function JE(t,e){let n=i=>{for(let r of i.children)if((e?r.isText():r.length)||n(r))return!0;return!1};return n(t)}function MU(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}var XD={class:"cm-line"};function RU(t,e){let n=e.spec.attributes,i=e.spec.class;return!n&&!i||(t||(t={class:"cm-line"}),n&&Dv(n,t),i&&(t.class+=" "+i)),t}function NU(t){let e=[];for(let n=t.parents.length;n>1;n--){let i=n==t.parents.length?t.tile:t.parents[n].tile;i instanceof on&&e.push(i.mark)}return e}function I1(t){let e=He.get(t);return e&&e.setDOM(t.cloneNode()),t}var Os=class extends Tr{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};Os.inline=new Os("span");Os.block=new Os("div");var _1=new class extends Tr{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}},Hp=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Se.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new va(e,e.contentDOM),this.updateInner([new hi(0,0,0,e.state.doc.length)],null)}update(e){var n;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:u,toA:f})=>f<this.minWidthFrom||u>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!HU(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?IU(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:f}=this.hasComposition;i=new hi(u,f,e.changes.mapPos(u,-1),e.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(L.ie||L.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=qU(o,this.decorations,e.changes);a.length&&(i=hi.extendWithRanges(i,a));let c=PU(l,this.blockWrappers,e.changes);return c.length&&(i=hi.extendWithRanges(i,c)),s&&!i.some(u=>u.fromA<=s.range.fromA&&u.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||e.length){let o=this.tile,l=new nv(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&He.get(n.text)&&l.cache.reused.set(He.get(n.text),2),this.tile=l.run(e,n),iv(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=L.chrome||L.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof $u&&r.push(s.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let i of n.effects)i.is(jD)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,s=r==i,o=!s&&!(this.view.state.facet(Cr)||i.tabIndex>-1)&&zu(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,c,u;if(a.empty?u=c=this.inlineDOMNearPos(a.anchor,a.assoc||1):(u=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),c=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),L.gecko&&a.empty&&!this.hasComposition&&LU(c)){let d=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(d,c.node.childNodes[c.offset]||null)),c=u=new Fi(d,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!Hu(c.node,c.offset,f.anchorNode,f.anchorOffset)||!Hu(u.node,u.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{L.android&&L.chrome&&i.contains(f.focusNode)&&zU(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let d=Xu(this.view.root);if(d)if(a.empty){if(L.gecko){let h=_U(c.node,c.offset);if(h&&h!=3){let m=(h==1?MD:RD)(c.node,c.offset);m&&(c=new Fi(m.node,m.offset))}}d.collapse(c.node,c.offset),a.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=a.bidiLevel)}else if(d.extend){d.collapse(c.node,c.offset);try{d.extend(u.node,u.offset)}catch{}}else{let h=document.createRange();a.anchor>a.head&&([c,u]=[u,c]),h.setEnd(u.node,u.offset),h.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(h)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new Fi(f.anchorNode,f.anchorOffset),this.impreciseHead=u.precise?null:new Fi(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Hu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,i=Xu(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let a=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!a||!c||a.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(u.node,u.offset),i.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&i.collapse(r,s)}posFromDOM(e,n){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[n];else{let o=Er(e)==0?0:n==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!He.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let a=i.children[o];if(a.dom==s)return l;l+=a.length+a.breakAfter}}else return i.isText()?e==i.dom?r+n:r+(n?i.length:0):r}domAtPos(e,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(e,n){let i,r=-1,s=!1,o,l=-1,a=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(s=!0)}else{let f=u+c.length;if(u<=e&&(i=c,r=e-u,s=f<e),f>=e&&!o&&(o=c,l=e-u,a=u>e),u>e&&o)return!0}}),!i&&!o?this.domAtPos(e,n):(s&&o?i=null:a&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(e,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof $u?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(e,n){let{tile:i}=this.tile.resolveBlock(e,n);return i.isLine()?i:null}coordsForChar(e){let{tile:n,offset:i}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let a=r(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(s.isText()&&o<s.length){let l=yt(s.text,o);if(l==o)return null;let a=Wu(s.dom,o,l).getClientRects();for(let c=0;c<a.length;c++){let u=a[c];if(c==a.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return r(n,i)}measureVisibleLineHeights(e){let n=[],{from:i,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Ie.LTR,c=0,u=(f,d,h)=>{for(let m=0;m<f.children.length&&!(d>r);m++){let g=f.children[m],b=d+g.length,p=g.dom.getBoundingClientRect(),{height:y}=p;if(h&&!m&&(c+=p.top-h.top),g instanceof Or)b>i&&u(g,d,p);else if(d>=i&&(c>0&&n.push(-c),n.push(y+c),c=0,o)){let v=g.dom.lastChild,x=v?Np(v):[];if(x.length){let k=x[x.length-1],C=a?k.right-p.left:p.right-k.left;C>l&&(l=C,this.minWidth=s,this.minWidthFrom=d,this.minWidthTo=b)}}h&&m==f.children.length-1&&(c+=h.bottom-p.bottom),d=b+g.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?Ie.RTL:Ie.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let c of o.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=Np(c.dom);if(u.length!=1)return;l+=u[0].width,a=u[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=Np(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;e.push(Se.replace({widget:new $u(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return Se.set(e)}updateDeco(){let e=1,n=this.view.state.facet(em).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(_v).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,n.push(me.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(KD).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(VD))try{if(c(this.view,e.range,e))return!0}catch(u){An(this.view.state,u,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=Bv(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(hU(this.view.scrollDOM,o,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==Ie.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(n.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=i=>i.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){iv(this.tile)}};function iv(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let i of t.children)iv(i,e)}}function LU(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function WD(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let i=MD(n.focusNode,n.focusOffset),r=RD(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=He.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(t.docView.lastCompositionAfterCursor){let a=He.get(i.node);!a||a.isText()&&a.text!=i.node.nodeValue||(s=r)}}if(t.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function IU(t,e,n){let i=WD(t,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc;return{range:new hi(a.mapPos(s),a.mapPos(o),s,o),text:r}}function _U(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}var BU=class{constructor(){this.changes=[]}compareRange(e,n){ga(e,n,this.changes)}comparePoint(e,n){ga(e,n,this.changes)}boundChange(e){ga(e,e,this.changes)}};function qU(t,e,n){let i=new BU;return me.compare(t,e,n,i),i.changes}var rv=class{constructor(){this.changes=[]}compareRange(e,n){ga(e,n,this.changes)}comparePoint(){}boundChange(e){ga(e,e,this.changes)}};function PU(t,e,n){let i=new rv;return me.compare(t,e,n,i),i.changes}function zU(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function HU(t,e){let n=!1;return e&&t.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(n=!0)}),n}var $u=class extends Tr{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function UU(t,e,n=1){let i=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(r.length==0)return R.cursor(e);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=yt(r.text,s,!1):l=yt(r.text,s);let a=i(r.text.slice(o,l));for(;o>0;){let c=yt(r.text,o,!1);if(i(r.text.slice(c,o))!=a)break;o=c}for(;l<r.length;){let c=yt(r.text,l);if(i(r.text.slice(l,c))!=a)break;l=c}return R.undirectionalRange(o+r.from,l+r.from)}function FU(t,e,n,i,r){let s=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,a=Math.floor((r-n.top-(t.defaultLineHeight-l)*.5)/l);s+=a*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+zE(o,s,t.state.tabSize)}function $U(t,e,n){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==ln.Text&&(r.type!=s.type||(n<0?s.from<e:s.to>e)))&&(r=s)}}return r||i}return i}function VU(t,e,n,i){let r=$U(t,e.head,e.assoc||-1),s=!i||r.type!=ln.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(r.from),a=t.posAtCoords({x:n==(l==Ie.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return R.cursor(a,n?-1:1)}return R.cursor(n?r.to:r.from,n?-1:1)}function eD(t,e,n,i){let r=t.state.doc.lineAt(e.head),s=t.bidiSpans(r),o=t.textDirectionAt(r.from);for(let l=e,a=null;;){let c=kU(r,s,o,l,n),u=BD;if(!c){if(r.number==(n?t.state.doc.lines:1))return l;u=`
|
|
196
|
+
`,r=t.state.doc.line(r.number+(n?1:-1)),s=t.bidiSpans(r),c=t.visualLineSide(r,!n)}if(a){if(!a(u))return l}else{if(!i)return c;a=i(u)}l=c}}function jU(t,e,n){let i=t.state.charCategorizer(e),r=i(n);return s=>{let o=i(s);return r==fi.Space&&(r=o),r==o}}function YU(t,e,n,i){let r=e.head,s=n?1:-1;if(r==(n?t.state.doc.length:0))return R.cursor(r,e.assoc);let o=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(r,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),u=t.documentTop;if(c)o==null&&(o=c.left-a.left),l=s<0?c.top:c.bottom;else{let m=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,t.defaultCharacterWidth*(r-m.from))),l=(s<0?m.top:m.bottom)+u}let f=a.left+o,d=t.viewState.heightOracle.textHeight>>1,h=i??d;for(let m=0;;m+=d){let g=l+(h+m)*s,b=sv(t,{x:f,y:g},!1,s);if(n?g>a.bottom:g<a.top)return R.cursor(b.pos,b.assoc);let p=t.coordsAtPos(b.pos,b.assoc),y=p?(p.top+p.bottom)/2:0;if(!p||(n?y>l:y<l))return R.cursor(b.pos,b.assoc,void 0,o)}}function Vu(t,e,n){for(;;){let i=0;for(let r of t)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=i||n||(e-s<o-e?-1:1);e=a<0?s:o,i=a}});if(!i)return e}}function ZD(t,e){let n=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],s=null;if(r.empty){let o=Vu(t,r.from,0);o!=r.from&&(s=R.cursor(o,-1))}else{let o=Vu(t,r.from,-1),l=Vu(t,r.to,1);(o!=r.from||l!=r.to)&&(r.undirectional?s=R.undirectionalRange(r.from,r.to):s=R.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(n||(n=e.ranges.slice()),n[i]=s)}return n?R.create(n,e.mainIndex):e}function B1(t,e,n){let i=Vu(t.state.facet(Zu).map(r=>r(t)),n.from,e.head>n.from?-1:1);return i==n.from?n:R.cursor(i,i<n.from?1:-1)}var Vn=class{constructor(e,n){this.pos=e,this.assoc=n}};function sv(t,e,n,i){let r=t.contentDOM.getBoundingClientRect(),s=r.top+t.viewState.paddingTop,{x:o,y:l}=e,a=l-s,c;for(;;){if(a<0)return new Vn(0,1);if(a>t.viewState.docHeight)return new Vn(t.state.doc.length,-1);if(c=t.elementAtHeight(a),i==null)break;if(c.type==ln.Text){if(i<0?c.to<t.viewport.from:c.from>t.viewport.to)break;let d=t.docView.coordsAt(i<0?c.from:c.to,i>0?-1:1);if(d&&(i<0?d.top<=a+s:d.bottom>=a+s))break}let f=t.viewState.heightOracle.textHeight/2;a=i>0?c.bottom+f:c.top-f}if(t.viewport.from>=c.to||t.viewport.to<=c.from){if(n)return null;if(c.type==ln.Text){let f=FU(t,r,c,o,l);return new Vn(f,f==c.from?1:-1)}}if(c.type!=ln.Text)return a<(c.top+c.bottom)/2?new Vn(c.from,1):new Vn(c.to,-1);let u=t.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=t.docView.lineAt(c.from,-2)),new ov(t,o,l,t.textDirectionAt(c.from)).scanTile(u,c.from)}var ov=class{constructor(e,n,i,r){this.view=e,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[jn.find(r,e-i.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[jn.find(r,e-i.from,-1,n)].dir}bidiIn(e,n){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<n)}scan(e,n,i=!1){let r=0,s=e.length-1,o=new Set,l=this.bidiIn(e[0],e[s]),a,c,u=-1,f=1e9,d;e:for(;r<s;){let m=s-r,g=r+s>>1;t:if(o.has(g)){let p=r+Math.floor(Math.random()*m);for(let y=0;y<m;y++){if(!o.has(p)){g=p;break t}p++,p==s&&(p=r)}break e}o.add(g);let b=n(g);if(b)for(let p=0;p<b.length;p++){let y=b[p],v=0;if(!(y.width==0&&b.length>1)){if(y.bottom<this.y)(!a||a.bottom<y.bottom)&&(a=y),v=1;else if(y.top>this.y)(!c||c.top>y.top)&&(c=y),v=-1;else{let x=y.left>this.x?this.x-y.left:y.right<this.x?this.x-y.right:0,k=Math.abs(x);k<f&&(u=g,f=k,d=y),x&&(v=x<0==(this.baseDir==Ie.LTR)?-1:1)}v==-1&&(!l||this.baseDirAt(e[g],1))?s=g:v==1&&(!l||this.baseDirAt(e[g+1],-1))&&(r=g+1)}}}if(!d){if(!c&&!a)return{i:e[0],after:!1};let m=a&&(!c||this.y-a.bottom<c.top-this.y)?a:c;return this.y=(m.top+m.bottom)/2,this.scan(e,n,!0)}if(f&&!i){let{top:m,bottom:g}=d;if(a&&a.bottom>(m+m+g)/3)return this.y=a.bottom-1,this.scan(e,n,!0);if(c&&c.top<(m+g+g)/3)return this.y=c.top+1,this.scan(e,n,!0)}let h=(l?this.dirAt(e[u],1):this.baseDir)==Ie.LTR;return{i:u,after:this.x>(d.left+d.right)/2==h}}scanText(e,n){let i=[];for(let s=0;s<e.length;s=yt(e.text,s))i.push(n+s);i.push(n+e.length);let r=this.scan(i,s=>{let o=i[s]-n,l=i[s+1]-n;return Wu(e.dom,o,l).getClientRects()});return r.after?new Vn(i[r.i+1],-1):new Vn(i[r.i],1)}scanTile(e,n){if(!e.length)return new Vn(n,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,a=n;l<e.children.length;l++)i.push(a+=e.children[l].length);let r=this.scan(i,l=>{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:Wu(a.dom,0,a.length)).getClientRects()}),s=e.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new Vn(i[r.i+1],-1):new Vn(o,1)}},fa="\uFFFF",lv=class{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(De.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=fa}readRange(e,n){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=He.get(r),l=r.nextSibling;if(l==n){o?.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let a=He.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:Bp(r))||Bp(l)&&(r.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!GU(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(e){let n=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=s+o}}readNode(e){let n=He.get(e),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(e,n){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(KU(e,i.node,i.offset)?n:0))}};function KU(t,e,n){for(;;){if(!e||n<Er(e))return!1;if(e==t)return!0;n=Cs(e)+1,e=e.parentNode}}function GU(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let i=He.get(t);if(!i?.isWidget())return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r?.length)return!1}return!0}var Up=class{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}},av=class{constructor(e,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=JD(e.docView.tile,n,i,0))){let a=s||o?[]:XU(e),c=new lv(a,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=WU(a,this.bounds.from)}else{let a=e.observer.selectionRange,c=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!j1(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),u=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!j1(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if((L.ios||L.chrome)&&c!=u&&Math.min(c,u)<=l.main.from&&Math.max(c,u)>=l.main.to&&(f.from>0||f.to<e.state.doc.length)){let d=Math.min(c,u),h=Math.max(c,u),m=f.from-d,g=f.to-h;(m==0||m==1||d==0)&&(g==0||g==-1||h==e.state.doc.length)&&(c=0,u=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(R.range(u,c));else if(e.lineWrapping&&u==c&&!(l.main.empty&&l.main.head==c)&&e.inputState.lastTouchTime>Date.now()-100){let d=e.coordsAtPos(c,-1),h=0;d&&(h=e.inputState.lastTouchY<=d.bottom?-1:1),this.newSel=R.create([R.cursor(c,h)])}else this.newSel=R.single(u,c)}}};function JD(t,e,n,i){if(t.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let a=0,c=i,u=i;a<t.children.length;a++){let f=t.children[a],d=c+f.length;if(c<e&&d>n)return JD(f,e,n,c);if(d>=e&&r==-1&&(r=a,s=c),c>n&&f.dom.parentNode==t.dom){o=a,l=u;break}u=d,c=d+f.breakAfter}return{from:s,to:l<0?i+t.length:l,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function e5(t,e){let n,{newSel:i}=e,{state:r}=t,s=r.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,c=s.from,u=null;(o===8||L.android&&e.text.length<a-l)&&(c=s.to,u="end");let f=r.doc.sliceString(l,a,fa),d,h;!s.empty&&s.from>=l&&s.to<=a&&(e.typeOver||f!=e.text)&&f.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&f.slice(s.to-l)==e.text.slice(d=e.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:ue.of(e.text.slice(s.from-l,d).split(fa))}:(h=t5(f,e.text,c-l,u))&&(L.chrome&&o==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==fa+fa&&h.toB--,n={from:l+h.from,to:l+h.toA,insert:ue.of(e.text.slice(h.from,h.toB).split(fa))})}else i&&(!t.hasFocus&&r.facet(Cr)||Fp(i,s))&&(i=null);if(!n&&!i)return!1;if((L.mac||L.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=R.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:ue.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:r.toText(t.inputState.insertingText)}:L.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
|
|
197
|
+
`&&t.lineWrapping&&(i&&(i=R.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:ue.of([" "])}),n)return qv(t,n,i,o);if(i&&!Fp(i,s)){let l=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=ZD(r.facet(Zu).map(c=>c(t)),i))),t.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function qv(t,e,n,i=-1){if(L.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(L.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ya(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&ya(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&ya(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=QU(t,e,n));return t.state.facet(UD).some(a=>a(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function QU(t,e,n){let i,r=t.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let a=e.from<s.from?-1:1,c=a<0?s.from:s.to,u=Vu(r.facet(Zu).map(f=>f(t)),c,a);e.from==u&&(o=u)}if(o>-1)i={changes:e,selection:R.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=s.from<e.from?r.sliceDoc(s.from,e.from):"",c=s.to>e.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let a=r.changes(e),c=n&&n.main.to<=a.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let u=t.state.sliceDoc(e.from,e.to),f,d=n&&WD(t,n.main.head);if(d){let m=e.insert.length-(e.to-e.from);f={from:d.from,to:d.to-m}}else f=t.state.doc.lineAt(s.head);let h=s.to-e.to;i=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:a,range:c||m.map(a)};let g=m.to-h,b=g-u.length;if(t.state.sliceDoc(b,g)!=u||g>=f.from&&b<=f.to)return{range:m};let p=r.changes({from:b,to:g,insert:e.insert}),y=m.to-s.to;return{changes:p,range:c?R.range(Math.max(0,c.anchor+y),Math.max(0,c.head+y)):m.map(p)}})}else i={changes:a,selection:c&&r.selection.replaceRange(c)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function t5(t,e,n,i){let r=Math.min(t.length,e.length),s=0;for(;s<r&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,s-Math.min(o,l));n-=o+a-s}if(o<s&&t.length<e.length){let a=n<=s&&n>=o?s-n:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=n<=s&&n>=l?s-n:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function XU(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new Up(n,i)),(r!=n||s!=i)&&e.push(new Up(r,s))),e}function WU(t,e){if(t.length==0)return null;let n=t[0].pos,i=t.length==2?t[1].pos:n;return n>-1&&i>-1?R.single(n+e,i+e):null}function Fp(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}var cv=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,L.safari&&e.contentDOM.addEventListener("input",()=>null),L.gecko&&dF(e.contentDOM.ownerDocument)}handleEvent(e){!sF(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=JU(e),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&i5.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),L.android&&L.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(L.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(n5.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||eF.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&L.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&ZU(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,ya(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:L.safari&&!L.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function ZU(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function tD(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(r){An(n.state,r)}}}function JU(t){let e=Object.create(null);function n(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of t){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&n(l).handlers.push(tD(i.value,a))}if(o)for(let l in o){let a=o[l];a&&n(l).observers.push(tD(i.value,a))}}for(let i in pi)n(i).handlers.push(pi[i]);for(let i in Xt)n(i).observers.push(Xt[i]);return e}var n5=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],eF="dthko",i5=[16,17,18,20,91,92,224,225],Ap=6;function Cp(t){return Math.max(0,t)*.7+8}function tF(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}var uv=class{constructor(e,n,i,r){this.view=e,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=TD(e.contentDOM),this.atoms=e.state.facet(Zu).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(De.allowMultipleSelections)&&nF(e,n),this.dragging=rF(e,n)&&o5(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&tF(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Bv(this.view);e.clientX-a.left<=r+Ap?n=-Cp(r-e.clientX):e.clientX+a.right>=o-Ap&&(n=Cp(e.clientX-o)),e.clientY-a.top<=s+Ap?i=-Cp(s-e.clientY):e.clientY+a.bottom>=l-Ap&&(i=Cp(e.clientY-l)),this.setScrollSpeed(n,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,i=ZD(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function nF(t,e){let n=t.state.facet(qD);return n.length?n[0](e):L.mac?e.metaKey:e.ctrlKey}function iF(t,e){let n=t.state.facet(PD);return n.length?n[0](e):L.mac?!e.altKey:!e.ctrlKey}function rF(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=Xu(t.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function sF(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,i;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=He.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}var pi=Object.create(null),Xt=Object.create(null),r5=L.ie&&L.ie_version<15||L.ios&&L.webkit_version<604;function oF(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),s5(t,n.value)},50)}function tm(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function s5(t,e){e=tm(t.state,Nv,e);let{state:n}=t,i,r=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(fv!=null&&n.selection.ranges.every(a=>a.empty)&&fv==s.toString()){let a=-1;i=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==a)return{range:c};a=u.from;let f=n.toText((o?s.line(r++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:R.cursor(c.from+f.length)}})}else o?i=n.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:R.cursor(a.from+c.length)}}):i=n.replaceSelection(s);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Xt.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,L.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};Xt.wheel=Xt.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};pi.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Xt.touchstart=(t,e)=>{let n=t.inputState,i=e.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};Xt.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Xt.touchend=(t,e)=>{t.inputState.touchActive=!1};pi.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet(zD))if(n=i(t,e),n)break;if(!n&&e.button==0&&(n=aF(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new uv(t,e,n,i)),i&&t.observer.ignore(()=>{ED(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function nD(t,e,n,i){if(i==1)return R.cursor(e,n);if(i==2)return UU(t.state,e,n);{let r=t.docView.lineAt(e,n),s=t.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,R.undirectionalRange(o,l)}}var lF=L.ie&&L.ie_version<=11,iD=null,rD=0,sD=0;function o5(t){if(!lF)return t.detail;let e=iD,n=sD;return iD=t,sD=Date.now(),rD=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(rD+1)%3:1}function aF(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=o5(e),r=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let a=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),c,u=nD(t,a.pos,a.assoc,i);if(n.pos!=a.pos&&!o){let f=nD(t,n.pos,n.assoc,i),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d<u.from?R.range(d,h,u.assoc):R.range(h,d,u.assoc)}return o?r.replaceRange(r.main.extend(u.from,u.to,u.assoc)):l&&i==1&&r.ranges.length>1&&(c=cF(r,a.pos))?c:l?r.addRange(u):R.create([u])}}}function cF(t,e){for(let n=0;n<t.ranges.length;n++){let{from:i,to:r}=t.ranges[n];if(i<=e&&r>=e)return R.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}pi.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=R.undirectionalRange(s,o))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",tm(t.state,Lv,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};pi.dragend=t=>(t.inputState.draggedContent=null,!1);function oD(t,e,n,i){if(n=tm(t.state,Nv,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=i&&s&&iF(t,e)?{from:s.from,to:s.to}:null,l={from:r,insert:n},a=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}pi.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&oD(t,e,i.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<n.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return oD(t,e,i,!0),!0}return!1};pi.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=r5?null:e.clipboardData;return n?(s5(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(oF(t),!1)};function uF(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),t.focus()},50)}function fF(t){let e=[],n=[],i=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),n.push(r));if(!e.length){let r=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>r&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}i=!0}return{text:tm(t,Lv,e.join(t.lineBreak)),ranges:n,linewise:i}}var fv=null;pi.copy=pi.cut=(t,e)=>{if(!zu(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=fF(t.state);if(!n&&!r)return!1;fv=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=r5?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(uF(t,n),!1)};var l5=Un.define();function a5(t,e){let n=[];for(let i of t.facet(FD)){let r=i(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:l5.of(!0)}):null}function c5(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=a5(t.state,e);n?t.dispatch(n):t.update([])}},10)}Xt.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),c5(t)};Xt.blur=t=>{t.observer.clearSelectionRange(),c5(t)};Xt.compositionstart=Xt.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Xt.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,L.chrome&&L.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Xt.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};pi.beforeinput=(t,e)=>{var n,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=t.posAtDOM(l.startContainer,l.startOffset),c=t.posAtDOM(l.endContainer,l.endOffset);return qv(t,{from:a,to:c,insert:t.state.toText(s)},null),!0}}let r;if(L.chrome&&L.android&&(r=n5.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return L.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),L.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Xt.compositionend(t,e),20),!1};var lD=new Set;function dF(t){lD.has(t)||(lD.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}var aD=["pre-wrap","normal","pre-line","break-spaces"],wa=!1;function cD(){wa=!1}var dv=class{constructor(e){this.lineWrapping=e,this.doc=ue.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return aD.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(n=!0,this.heightSamples[Math.floor(r*10)]=!0)}return n}refresh(e,n,i,r,s,o){let l=aD.indexOf(e)>-1,a=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c<o.length;c++){let u=o[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return a}},hv=class{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}},di=class t{constructor(e,n,i,r,s){this.from=e,this.length=n,this.top=i,this.height=r,this._content=s}get type(){return typeof this._content=="number"?ln.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Ao?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new t(this.from,this.length+e.length,this.top,this.height+e.height,n)}},Me=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Me||(Me={})),Lp=.001,Cn=class t{constructor(e,n,i=2){this.length=e,this.height=n,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Lp&&(wa=!0),this.height=e)}replace(e,n,i){return t.of(i)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:u,toB:f}=r[l],d=s.lineAt(a,Me.ByPosNoHeight,i.setDoc(n),0,0),h=d.to>=c?d:s.lineAt(c,Me.ByPosNoHeight,i,0,0);for(f+=h.to-c,c=h.to;l>0&&d.from<=r[l-1].toA;)a=r[l-1].fromA,u=r[l-1].fromB,l--,a<d.from&&(d=s.lineAt(a,Me.ByPosNoHeight,i,0,0));u+=d.from-a,a=d.from;let m=mv.build(i.setDoc(o),e,u,f);s=$p(s,s.replace(a,c,m))}return s.updateHeight(i,0)}static empty(){return new $n(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,i=e.length,r=0,s=0;for(;;)if(n==i)if(r>s*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),i+=1+l.break,r-=l.size}else if(s>r*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[n++];l&&(r+=l.size)}else{let l=e[--i];l&&(s+=l.size)}let o=0;return e[n-1]==null?(o=1,n--):e[n]==null&&(o=1,i++),new pv(t.of(e.slice(0,n)),o,t.of(e.slice(i)))}};function $p(t,e){return t==e?t:(t.constructor!=e.constructor&&(wa=!0),e)}Cn.prototype.size=1;var hF=Se.replace({}),Vp=class extends Cn{constructor(e,n,i){super(e,n),this.deco=i,this.spaceAbove=0}mainBlock(e,n){return new di(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new di(r,0,i,this.spaceAbove,hF):this.mainBlock(i,r)}lineAt(e,n,i,r,s){let o=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,i,r,s).join(o):o}forEachLine(e,n,i,r,s,o){e<=s+this.length&&n>=s&&o(this.lineAt(0,Me.ByPos,i,r,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},$n=class t extends Vp{constructor(e,n,i){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,n){return new di(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,i){let r=i[0];return i.length==1&&(r instanceof t||r instanceof As&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof As?r=new t(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Cn.of(i)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},As=class t extends Cn{constructor(e){super(e,0)}heightMetrics(e,n){let i=e.doc.lineAt(n).number,r=e.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(e,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(n,r);if(n.lineWrapping){let c=r+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),u=n.doc.lineAt(c),f=l+u.length*a,d=Math.max(i,e-f/2);return new di(u.from,u.length,d,f,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-i)/l))),{from:u,length:f}=n.doc.line(s+c);return new di(u,f,i+l*c,l,0)}}lineAt(e,n,i,r,s){if(n==Me.ByHeight)return this.blockAt(e,i,r,s);if(n==Me.ByPosNoHeight){let{from:h,to:m}=i.doc.lineAt(e);return new di(h,m-h,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,s),c=i.doc.lineAt(e),u=l+c.length*a,f=c.number-o,d=r+l*f+a*(c.from-s-f);return new di(c.from,c.length,Math.max(r,Math.min(d,r+this.height-u)),u,0)}forEachLine(e,n,i,r,s,o){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,s);for(let u=e,f=r;u<=n;){let d=i.doc.lineAt(u);if(u==e){let m=d.number-l;f+=a*m+c*(e-s-m)}let h=a+c*d.length;o(new di(d.from,d.length,f,h,0)),f+=h,u=d.to+1}}replace(e,n,i){let r=this.length-n;if(r>0){let s=i[i.length-1];s instanceof t?i[i.length-1]=new t(s.length+r):i.push(null,new t(r-1))}if(e>0){let s=i[0];s instanceof t?i[0]=new t(e+s.length):i.unshift(new t(e-1),null)}return Cn.of(i)}decomposeLeft(e,n){n.push(new t(e-1),null)}decomposeRight(e,n){n.push(null,new t(this.length-e-1))}updateHeight(e,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),a=-1;for(r.from>n&&o.push(new t(r.from-n-1).updateHeight(e,n));l<=s&&r.more;){let u=e.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],d=0;f<0&&(d=-f,f=r.heights[r.index++]),a==-1?a=f:Math.abs(f-a)>=Lp&&(a=-2);let h=new $n(u,f,d);h.outdated=!1,o.push(h),l+=u+1}l<=s&&o.push(null,new t(s-l).updateHeight(e,l));let c=Cn.of(o);return(a<0||Math.abs(c.height-this.height)>=Lp||Math.abs(a-this.heightMetrics(e,n).perLine)>=Lp)&&(wa=!0),$p(this,c)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},pv=class extends Cn{constructor(e,n,i){super(e.length+n+i.length,e.height+i.height,n|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,n,i,r){let s=i+this.left.height;return e<s?this.left.blockAt(e,n,i,r):this.right.blockAt(e,n,s,r+this.left.length+this.break)}lineAt(e,n,i,r,s){let o=r+this.left.height,l=s+this.left.length+this.break,a=n==Me.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,n,i,r,s):this.right.lineAt(e,n,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let u=n==Me.ByPosNoHeight?Me.ByPosNoHeight:Me.ByPos;return a?c.join(this.right.lineAt(l,u,i,o,l)):this.left.lineAt(l,u,i,r,s).join(c)}forEachLine(e,n,i,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,n,i,r,s,o),n>=a&&this.right.forEachLine(e,n,i,l,a,o);else{let c=this.lineAt(a,Me.ByPos,i,r,s);e<c.from&&this.left.forEachLine(e,c.from-1,i,r,s,o),c.to>=e&&c.from<=n&&o(c),n>c.to&&this.right.forEachLine(c.to+1,n,i,l,a,o)}}replace(e,n,i){let r=this.left.length+this.break;if(n<r)return this.balanced(this.left.replace(e,n,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,n-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of i)s.push(l);if(e>0&&uD(s,o-1),n<this.length){let l=s.length;this.decomposeRight(n,s),uD(s,l)}return Cn.of(s)}decomposeLeft(e,n){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(i++,e>=i&&n.push(null)),e>i&&this.right.decomposeLeft(e-i,n)}decomposeRight(e,n){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,n);e<i&&this.left.decomposeRight(e,n),this.break&&e<r&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?Cn.of(this.break?[e,null,n]:[e,n]):(this.left=$p(this.left,e),this.right=$p(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,a=null;return r&&r.from<=n+s.length&&r.more?a=s=s.updateHeight(e,n,i,r):s.updateHeight(e,n,i),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,i,r):o.updateHeight(e,l,i),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function uD(t,e){let n,i;t[e]==null&&(n=t[e-1])instanceof As&&(i=t[e+1])instanceof As&&t.splice(e-1,3,new As(n.length+1+i.length))}var pF=5,mv=class t{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof $n?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new $n(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,i){if(e<n||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=n-e;i.block?this.addBlock(new Vp(o,r,i)):(o||s||r>=pF)&&this.addLineDeco(r,s,o)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new $n(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let i=new As(n-e);return this.oracle.doc.lineAt(e).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof $n)return e;let n=new $n(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof $n)&&!this.isCovered?this.nodes.push(new $n(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof $n&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,n,i,r){let s=new t(i,e);return me.spans(n,i,r,s,0),s.finish(i)}};function mF(t,e,n){let i=new gv;return me.compare(t,e,n,i,0),i.changes}var gv=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,i,r){(e<n||i&&i.heightRelevant||r&&r.heightRelevant)&&ga(e,n,this.changes,5)}};function gF(t,e){let n=t.getBoundingClientRect(),i=t.ownerDocument,r=i.defaultView||window,s=Math.max(0,n.left),o=Math.min(r.innerWidth,n.right),l=Math.max(0,n.top),a=Math.min(r.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=i.body;)if(c.nodeType==1){let u=c,f=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),l=Math.max(l,d.top),a=Math.min(c==t.parentNode?r.innerHeight:a,d.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+e),bottom:Math.max(l,a)-(n.top+e)}}function yF(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function bF(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}var ju=class{constructor(e,n,i,r){this.from=e,this.to=n,this.size=i,this.displaySize=r}static same(e,n){if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],s=n[i];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,n){return Se.replace({widget:new yv(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}},yv=class extends Tr{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}},jp=class{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=fD,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Ie.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=n.facet(Iv).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new dv(i),this.stateDeco=dD(n),this.heightMap=Cn.empty().applyChanges(this.stateDeco,ue.empty,this.heightOracle.setDoc(n.doc),[new hi(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Se.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new ha(s,o))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?fD:new bv(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Pu(e,this.scaler))})}update(e,n=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=dD(this.state);let r=e.changedRanges,s=hi.extendWithRanges(r,mF(i,this.stateDeco,e?e.changes:Gt.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);cD(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||wa)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<a.from||n.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,n));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(CU)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Ie.RTL:Ie.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,u=0;if(l.width&&l.height){let{scaleX:k,scaleY:C}=OD(n,l);(k>.005&&Math.abs(this.scaleX-k)>.005||C>.005&&Math.abs(this.scaleY-C)>.005)&&(this.scaleX=k,this.scaleY=C,c|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,d=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let h=TD(this.view.contentDOM,!1).y;h!=this.scrollParent&&(this.scrollParent=h,this.scrollAnchorHeight=-1,this.scrollOffset=0);let m=this.getScrollOffset();this.scrollOffset!=m&&(this.scrollAnchorHeight=-1,this.scrollOffset=m),this.scrolledToBottom=DD(this.scrollParent||e.win);let g=(this.printing?bF:gF)(n,this.paddingTop),b=g.top-this.pixelViewport.top,p=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget&&!yF(e.dom))return 0;let v=l.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),a){let k=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(k)&&(o=!0),o||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:C,charWidth:w,textHeight:A}=e.docView.measureTextSize();o=C>0&&r.refresh(s,C,w,A,Math.max(5,v/w),k),o&&(e.docView.minWidth=0,c|=16)}b>0&&p>0?u=Math.max(b,p):b<0&&p<0&&(u=Math.min(b,p)),cD();for(let C of this.viewports){let w=C.from==this.viewport.from?k:e.docView.measureVisibleLineHeights(C);this.heightMap=(o?Cn.empty().applyChanges(this.stateDeco,ue.empty,this.heightOracle,[new hi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new hv(C.from,w))}wa&&(c|=2)}let x=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return x&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new ha(r.lineAt(o-i*1e3,Me.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,Me.ByHeight,s,0,0).to);if(n){let{head:c}=n.range;if(c<a.from||c>a.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(c,Me.ByPos,s,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<a.from?d=f.top:d=f.bottom-u,a=new ha(r.lineAt(d-1e3/2,Me.ByHeight,s,0,0).from,r.lineAt(d+u+1e3/2,Me.ByHeight,s,0,0).to)}}return a}mapViewport(e,n){let i=n.mapPos(e.from,-1),r=n.mapPos(e.to,1);return new ha(this.heightMap.lineAt(i,Me.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Me.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Me.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,Me.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-i,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let i=[];for(let r of e)n.touchesRange(r.from,r.to)||i.push(new ju(n.mapPos(r.from),n.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,n){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=Ie.LTR&&!i)return[];let l=[],a=(u,f,d,h)=>{if(f-u<s)return;let m=this.state.selection.main,g=[m.from];m.empty||g.push(m.to);for(let p of g)if(p>u&&p<f){a(u,p-10,d,h),a(p+10,f,d,h);return}let b=xF(e,p=>p.from>=d.from&&p.to<=d.to&&Math.abs(p.from-u)<s&&Math.abs(p.to-f)<s&&!g.some(y=>p.from<y&&p.to>y));if(!b){if(f<d.to&&n&&i&&n.visibleRanges.some(v=>v.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(R.cursor(f),!1,!0).head;v>u&&(f=v)}let p=this.gapSize(d,u,f,h),y=i||p<2e6?p:2e6;b=new ju(u,f,p,y)}l.push(b)},c=u=>{if(u.length<o||u.type!=ln.Text)return;let f=vF(u.from,u.to,this.stateDeco);if(f.total<o)return;let d=this.scrollTarget?this.scrollTarget.range.head:null,h,m;if(i){let g=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,p;if(d!=null){let y=Tp(f,d),v=((this.visibleBottom-this.visibleTop)/2+g)/u.height;b=y-v,p=y+v}else b=(this.visibleTop-u.top-g)/u.height,p=(this.visibleBottom-u.top+g)/u.height;h=Op(f,b),m=Op(f,p)}else{let g=f.total*this.heightOracle.charWidth,b=r*this.heightOracle.charWidth,p=0;if(g>2e6)for(let C of e)C.from>=u.from&&C.from<u.to&&C.size!=C.displaySize&&C.from*this.heightOracle.charWidth+p<this.pixelViewport.left&&(p=C.size-C.displaySize);let y=this.pixelViewport.left+p,v=this.pixelViewport.right+p,x,k;if(d!=null){let C=Tp(f,d),w=((v-y)/2+b)/g;x=C-w,k=C+w}else x=(y-b)/g,k=(v+b)/g;h=Op(f,x),m=Op(f,k)}h>u.from&&a(u.from,h,u,f),m<u.to&&a(m,u.to,u,f)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return l}gapSize(e,n,i,r){let s=Tp(r,i)-Tp(r,n);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){ju.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Se.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];me.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s<i.length&&!(r&8);s++){let o=this.visibleRanges[s],l=i[s];(o.from!=l.from||o.to!=l.to)&&(r|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Pu(this.heightMap.lineAt(e,Me.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Pu(this.heightMap.lineAt(this.scaler.fromDOM(e),Me.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Pu(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},ha=class{constructor(e,n){this.from=e,this.to=n}};function vF(t,e,n){let i=[],r=t,s=0;return me.spans(n,t,e,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r<e&&(i.push({from:r,to:e}),s+=e-r),{total:s,ranges:i}}function Op({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(i<=l)return s+i;i-=l}}function Tp(t,e){let n=0;for(let{from:i,to:r}of t.ranges){if(e<=r){n+=e-i;break}n+=r-i}return n/t.total}function xF(t,e){for(let n of t)if(e(n))return n}var fD={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function dD(t){let e=t.facet(em).filter(i=>typeof i!="function"),n=t.facet(_v).filter(i=>typeof i!="function");return n.length&&e.push(me.join(n)),e}var bv=class t{constructor(e,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=n.lineAt(l,Me.ByPos,e,0,0).top,u=n.lineAt(a,Me.ByPos,e,0,0).bottom;return r+=u-c,{from:l,to:a,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return r+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,r=s.domBottom}}fromDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return i+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,r=s.domBottom}}eq(e){return e instanceof t?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,i)=>n.from==e.viewports[i].from&&n.to==e.viewports[i].to):!1}};function Pu(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new di(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map(r=>Pu(r,e)):t._content)}var Ep=_.define({combine:t=>t.join(" ")}),vv=_.define({combine:t=>t.indexOf(!0)>-1}),xv=Fn.newName(),u5=Fn.newName(),f5=Fn.newName(),d5={"&light":"."+u5,"&dark":"."+f5};function Sv(t,e,n){return new Fn(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return t;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):t+" "+i}})}var SF=Sv("."+xv,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},d5),wF={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},q1=L.ie&&L.ie_version<=11,wv=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Y1,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(L.ie&&L.ie_version<=11||L.ios&&e.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&L.android&&e.constructor.EDIT_CONTEXT!==!1&&!(L.chrome&&L.chrome_version<126)&&(this.editContext=new kv(e),e.state.facet(Cr)&&(e.contentDOM.editContext=this.editContext.editContext)),q1&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,i)=>n!=e[i]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(Cr)?i.root.activeElement!=this.dom:!zu(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(L.ie&&L.ie_version<=11||L.android&&L.chrome)&&!i.state.selection.main.empty&&r.focusNode&&Hu(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Xu(e.root);if(!n)return!1;let i=L.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&kF(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=zu(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&mU(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let i=this.dom;i;)if(i.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=n)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,wF),q1&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),q1&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var i;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&ya(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:e,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&zu(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new av(this.view,e,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=e5(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!Fp(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let i=hD(n,e.previousSibling||e.target.previousSibling,-1),r=hD(n,e.nextSibling||e.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Cr)!=e.state.facet(Cr)&&(e.view.contentDOM.editContext=e.state.facet(Cr)?this.editContext.editContext:null))}destroy(){var e,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function hD(t,e,n){for(;e;){let i=He.get(e);if(i&&i.parent==t)return i;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function pD(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return Hu(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function kF(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return pD(t,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?pD(t,n):null}var kv=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let c=a-l>i.text.length;l==this.from&&s<this.from?l=s:a==this.to&&s>this.to&&(a=s);let u=t5(e.state.sliceDoc(l,a),i.text,(c?r.from:r.to)-l,c?"end":null);if(!u){let d=R.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Fp(d,r)||e.dispatch({selection:d,userEvent:"select"});return}let f={from:u.from+l,to:u.toA+l,insert:ue.of(i.text.slice(u.from,u.toB).split(`
|
|
198
|
+
`))};if((L.mac||L.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:ue.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let d=this.to-this.from+(f.to-f.from+f.insert.length);qv(e,f,R.single(this.toEditorPos(i.selectionStart,d),this.toEditorPos(i.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from<f.to&&!f.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}n.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(a<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(Se.mark({attributes:{style:u}}).range(a,c))}}}e.dispatch({effects:jD.of(Se.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=Xu(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(i)return;let u=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,n+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}n+=u}),r&&!i&&this.revertPending(e.state),!i}update(e){let n=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},z=class t{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||pU(e.parent)||document,this.viewState=new jp(this,e.state||De.create(e)),e.scrollTo&&e.scrollTo.is(kp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(da).map(r=>new Fu(r));for(let r of this.plugins)r.update(this);this.observer=new wv(this),this.inputState=new cv(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Hp(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof gt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,i=!1,r,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(d=>d.annotation(l5))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=a5(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(De.phrases)!=this.state.facet(De.phrases))return this.setState(s);r=Pp.create(this,s,e),r.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection,{x:m,y:g}=this.state.facet(t.cursorScrollMargin);f=new Uu(h.empty?h:R.cursor(h.head,h.head>h.anchor?-1:1),"nearest","nearest",g,m)}for(let h of d.effects)h.is(kp)&&(f=h.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=Yp.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(qu)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Ep)!=r.state.facet(Ep)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let d of this.state.facet(X1))try{d(r)}catch(h){An(this.state,h,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!e5(this,u)&&c.force&&ya(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new jp(this,e),this.plugins=e.facet(da).map(i=>new Fu(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Hp(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(da),i=e.state.facet(da);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Fu(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);n!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(i){An(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(DD(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(r);s=h.from,o=h.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(m){return An(this.state,m),mD}}),f=Pp.create(this,this.state,[]),d=!1;f.flags|=a,n?n.flags|=a:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h<c.length;h++)if(u[h]!=mD)try{let m=c[h];m.write&&m.write(u[h],this)}catch(m){An(this.state,m)}if(d&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let m=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o)/this.scaleY;if((m>1||m<-1)&&!(L.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+m,i?i.scrollTop+=m:this.win.scrollBy(0,m),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(X1))l(n)}get themeClasses(){return xv+" "+(this.state.facet(vv)?f5:u5)+" "+this.state.facet(Ep)}updateAttrs(){let e=gD(this,YD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Cr)?"true":"false",class:"cm-content",style:`${L.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),gD(this,Iv,n);let i=this.observer.ignore(()=>{let r=GE(this.contentDOM,this.contentAttrs,n),s=GE(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=n,i}showAnnouncements(e){let n=!0;for(let i of e)for(let r of i.effects)if(r.is(t.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(qu);let e=this.state.facet(t.cspNonce);Fn.mount(this.root,this.styleModules.concat(SF).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(i=>i.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,i){return B1(this,e,eD(this,e,n,i))}moveByGroup(e,n){return B1(this,e,eD(this,e,n,i=>jU(this,e.head,i)))}visualLineSide(e,n){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[n?i.length-1:0];return R.cursor(s.side(n,r)+e.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,i=!0){return VU(this,e,n,i)}moveVertically(e,n,i){return B1(this,e,YU(this,e,n,i))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let i=sv(this,e,n);return i&&i.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),sv(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),s=r[jn.find(r,e-i.from,-1,n)];return this.docView.coordsAt(e,n,s.dir==Ie.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet($D)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>AF)return _D(e.length);let n=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||ID(s.isolates,i=WE(this,e))))return s.order;i||(i=WE(this,e));let r=wU(e.text,n,i);return this.bidiCache.push(new Yp(e.from,e.to,n,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||L.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{ED(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){var i,r,s,o;return kp.of(new Uu(typeof e=="number"?R.cursor(e):e,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return kp.of(new Uu(R.cursor(i.from),"start","start",i.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Yn.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Yn.define(()=>({}),{eventObservers:e})}static theme(e,n){let i=Fn.newName(),r=[Ep.of(i),qu.of(Sv(`.${i}`,e))];return n&&n.dark&&r.push(vv.of(!0)),r}static baseTheme(e){return Bu.lowest(qu.of(Sv("."+xv,e,d5)))}static findFromDOM(e){var n;let i=e.querySelector(".cm-content"),r=i&&He.get(i)||He.get(e);return((n=r?.root)===null||n===void 0?void 0:n.view)||null}};z.styleModule=qu;z.inputHandler=UD;z.clipboardInputFilter=Nv;z.clipboardOutputFilter=Lv;z.scrollHandler=VD;z.focusChangeEffect=FD;z.perLineTextDirection=$D;z.exceptionSink=HD;z.updateListener=X1;z.editable=Cr;z.mouseSelectionStyle=zD;z.dragMovesSelection=PD;z.clickAddsSelectionRange=qD;z.decorations=em;z.blockWrappers=KD;z.outerDecorations=_v;z.atomicRanges=Zu;z.bidiIsolatedRanges=GD;z.cursorScrollMargin=_.define({combine:t=>{let e=5,n=5;for(let i of t)typeof i=="number"?e=n=i:{x:e,y:n}=i;return{x:e,y:n}}});z.scrollMargins=QD;z.darkTheme=vv;z.cspNonce=_.define({combine:t=>t.length?t[0]:""});z.contentAttributes=Iv;z.editorAttributes=YD;z.lineWrapping=z.contentAttributes.of({class:"cm-lineWrapping"});z.announce=pe.define();var AF=4096,mD={},Yp=class t{constructor(e,n,i,r,s,o){this.from=e,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:Ie.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!n.touchesRange(o.from,o.to)&&i.push(new t(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function gD(t,e,n){for(let i=t.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],o=typeof s=="function"?s(t):s;o&&Dv(o,n)}return n}var CF=L.mac?"mac":L.windows?"win":L.linux?"linux":"key";function OF(t,e){let n=t.split(/-(?!$)/),i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let a=0;a<n.length-1;++a){let c=n[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function Dp(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}var TF=Bu.default(z.domEventHandlers({keydown(t,e){return RF(EF(e.state),t,e,"editor")}})),Pv=_.define({enables:TF}),yD=new WeakMap;function EF(t){let e=t.facet(Pv),n=yD.get(e);return n||yD.set(e,n=MF(e.reduce((i,r)=>i.concat(r),[]))),n}var ks=null,DF=4e3;function MF(t,e=CF){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,c,u)=>{var f,d;let h=n[o]||(n[o]=Object.create(null)),m=l.split(/ (?!$)/).map(p=>OF(p,e));for(let p=1;p<m.length;p++){let y=m.slice(0,p).join(" ");r(y,!0),h[y]||(h[y]={preventDefault:!0,stopPropagation:!1,run:[v=>{let x=ks={view:v,prefix:y,scope:o};return setTimeout(()=>{ks==x&&(ks=null)},DF),!0}]})}let g=m.join(" ");r(g,!1);let b=h[g]||(h[g]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});a&&b.run.push(a),c&&(b.preventDefault=!0),u&&(b.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let d in u)u[d].run.push(h=>f(h,Av))}let a=o[e]||o.key;if(a)for(let c of l)s(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return n}var Av=null;function RF(t,e,n,i){Av=e;let r=$E(e),s=TE(r,0),o=EE(s)==r.length&&r!=" ",l="",a=!1,c=!1,u=!1;ks&&ks.view==n&&ks.scope==i&&(l=ks.prefix+" ",i5.indexOf(e.keyCode)<0&&(c=!0,ks=null));let f=new Set,d=b=>{if(b){for(let p of b.run)if(!f.has(p)&&(f.add(p),p(n)))return b.stopPropagation&&(u=!0),!0;b.preventDefault&&(b.stopPropagation&&(u=!0),c=!0)}return!1},h=t[i],m,g;return h&&(d(h[l+Dp(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(L.windows&&e.ctrlKey&&e.altKey)&&!(L.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(m=Ar[e.keyCode])&&m!=r?(d(h[l+Dp(m,e,!0)])||e.shiftKey&&(g=ua[e.keyCode])!=r&&g!=m&&d(h[l+Dp(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&d(h[l+Dp(r,e,!0)])&&(a=!0),!a&&d(h._any)&&(a=!0)),c&&(a=!0),a&&u&&e.stopPropagation(),Av=null,a}var Ade=/x/.unicode!=null?"gu":"g";var Mp="-10000px",Kp=class{constructor(e,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(e,n){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=n?[]:null;for(let a=0;a<s.length;a++){let c=s[a],u=-1;if(c){for(let f=0;f<this.tooltips.length;f++){let d=this.tooltips[f];d&&d.create==c.create&&(u=f)}if(u<0)o[a]=this.createTooltipView(c,a?o[a-1]:null),l&&(l[a]=!!c.above);else{let f=o[a]=this.tooltipViews[u];l&&(l[a]=n[u]),f.update&&f.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return n&&(l.forEach((a,c)=>n[c]=a),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}};function NF(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var P1=_.define({combine:t=>{var e,n,i;return{position:L.ios?"absolute":((e=t.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=t.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||NF}}}),bD=new WeakMap,h5=Yn.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(P1);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Kp(t,nm,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,i=t.state.facet(P1);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),i=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=Mp,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(t=i.destroy)===null||t===void 0||t.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(L.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=Bv(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(P1).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:n,space:i,scaleX:r,scaleY:s}=t,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:u}=c,f=t.pos[l],d=t.size[l];if(!f||a.clip!==!1&&(f.bottom<=Math.max(n.top,i.top)||f.top>=Math.min(n.bottom,i.bottom)||f.right<Math.max(n.left,i.left)-.1||f.left>Math.min(n.right,i.right)+.1)){u.style.top=Mp;continue}let h=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=h?7:0,g=d.right-d.left,b=(e=bD.get(c))!==null&&e!==void 0?e:d.bottom-d.top,p=c.offset||IF,y=this.view.textDirection==Ie.LTR,v=d.width>i.right-i.left?y?i.left:i.right-d.width:y?Math.max(i.left,Math.min(f.left-(h?14:0)+p.x,i.right-g)):Math.min(Math.max(i.left,f.left-g+(h?14:0)-p.x),i.right-g),x=this.above[l];!a.strictSide&&(x?f.top-b-m-p.y<i.top:f.bottom+b+m+p.y>i.bottom)&&x==i.bottom-f.bottom>f.top-i.top&&(x=this.above[l]=!x);let k=(x?f.top-i.top:i.bottom-f.bottom)-m;if(k<b&&c.resize!==!1){if(k<this.view.defaultLineHeight){u.style.top=Mp;continue}bD.set(c,b),u.style.height=(b=k)/s+"px"}else u.style.height&&(u.style.height="");let C=x?f.top-b-m-p.y:f.bottom+m+p.y,w=v+g;if(c.overlap!==!0)for(let A of o)A.left<w&&A.right>v&&A.top<C+b&&A.bottom>C&&(C=x?A.top-b-2-m:A.bottom+m+2);if(this.position=="absolute"?(u.style.top=(C-t.parent.top)/s+"px",vD(u,(v-t.parent.left)/r)):(u.style.top=C/s+"px",vD(u,v/r)),h){let A=f.left+(y?p.x:-p.x)-(v+14-7);h.style.left=A/r+"px"}c.overlap!==!0&&o.push({left:v,top:C,right:w,bottom:C+b}),u.classList.toggle("cm-tooltip-above",x),u.classList.toggle("cm-tooltip-below",!x),c.positioned&&c.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Mp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function vD(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}var LF=z.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),IF={x:0,y:0},nm=_.define({enables:[h5,LF]}),Gp=_.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])}),Qp=class t{static create(e){return new t(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Kp(e,Gp,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(e,n){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}},_F=nm.compute([Gp],t=>{let e=t.facet(Gp);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:Qp.create,above:e[0].above,arrow:e.some(n=>n.arrow)}}),BF=_.define(),Cv=class{constructor(e,n,i,r,s,o){this.view=e,this.source=n,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,i=e.docView.tile.nearest(n.target);if(!i)return;let r,s=1;if(i.isWidget())r=i.posAtStart;else{if(r=e.posAtCoords(n),r==null)return;let o=e.coordsAtPos(r);if(!o||n.y<o.top||n.y>o.bottom||n.x<o.left-e.defaultCharacterWidth||n.x>o.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(c=>c.from<=r&&c.to>=r),a=l&&l.dir==Ie.RTL?-1:1;s=n.x<o.left?-a:a}this.activateHover(e,r,s)}activateHover(e,n,i,r){let s=this.source(e,n,i),o=l=>{if(l&&!(Array.isArray(l)&&!l.length)){let a=Array.isArray(l)?l:[l];r&&this.locked.set(a,r),e.dispatch({effects:this.setHover.of(a)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(a=>{this.pending==l&&(this.pending=null,o(a))},a=>An(e.state,a,"hover tooltip"))}else o(s)}get tooltip(){let e=this.view.plugin(h5),n=e?e.manager.tooltips.findIndex(i=>i.create==Qp.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!qF(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!PF(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=i=>{e.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},Rp=4;function qF(t,e){let{left:n,right:i,top:r,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=n-Rp&&e.clientX<=i+Rp&&e.clientY>=r-Rp&&e.clientY<=s+Rp}function PF(t,e,n,i,r,s){let o=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,l)<r)return!1;let a=t.posAtCoords({x:i,y:r},!1);return a>=e&&a<=n}function p5(t,e={}){let n=pe.define(),i=new WeakMap,r=Bt.define({create(){return[]},update(o,l){let a=i.get(o);if(o.length&&(e.hideOnChange&&(l.docChanged||l.selection)?o=[]:a&&a(l)?o=[]:e.hideOn&&(o=o.filter(c=>!e.hideOn(l,c)))),l.docChanged&&o.length){let c=[];for(let u of o){let f=l.changes.mapPos(u.pos,-1,Kt.TrackDel);if(f!=null){let d=Object.assign(Object.create(null),u);d.pos=f,d.end!=null&&(d.end=l.changes.mapPos(d.end)),c.push(d)}}o=c}for(let c of l.effects)c.is(n)&&(o=c.value,a=void 0),(c.is(zF)&&!c.value||c.value==r)&&(o=[]);return o.length&&a&&i.set(o,a),o},provide:o=>Gp.from(o)}),s=Yn.define(o=>new Cv(o,t,r,i,n,e.hoverTime||300));return{active:r,extension:[r,s,BF.of(s),_F]}}var zF=pe.define();var xD=_.define({combine(t){let e,n;for(let i of t)e=e||i.topContainer,n=n||i.bottomContainer;return{topContainer:e,bottomContainer:n}}});var HF=Yn.fromClass(class{constructor(t){this.input=t.state.facet(Xp),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(xD);this.top=new pa(t,!0,e.topContainer),this.bottom=new pa(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(xD);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new pa(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new pa(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Xp);if(n!=this.input){let i=n.filter(a=>a),r=[],s=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),u;c<0?(u=a(t.view),l.push(u)):(u=this.panels[c],u.update&&u.update(t)),r.push(u),(u.top?s:o).push(u)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>z.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),pa=class{constructor(e,n,i){this.view=e,this.top=n,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=SD(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=SD(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}};function SD(t){let e=t.nextSibling;return t.remove(),e}var Xp=_.define({enables:HF});var Kn=class extends Hi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Kn.prototype.elementClass="";Kn.prototype.toDOM=void 0;Kn.prototype.mapMode=Kt.TrackBefore;Kn.prototype.startSide=Kn.prototype.endSide=-1;Kn.prototype.point=!0;var z1=_.define(),UF=_.define(),FF={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>me.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Yu=_.define();function zv(t){return[m5(),Yu.of({...FF,...t})]}var Ov=_.define({combine:t=>t.some(e=>e)});function m5(t){let e=[$F];return t&&t.fixed===!1&&e.push(Ov.of(!0)),e}var $F=Yn.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Yu).map(e=>new Wp(t,e)),this.fixed=!t.state.facet(Ov);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,i=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Ov)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=me.iter(this.view.state.facet(z1),this.view.viewport.from),i=[],r=this.gutters.map(s=>new Ev(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==ln.Text&&o){Tv(n,i,l.from);for(let a of r)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of r)a.widget(this.view,l)}else if(s.type==ln.Text){Tv(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Yu),n=t.state.facet(Yu),i=t.docChanged||t.heightChanged||t.viewportChanged||!me.eq(t.startState.facet(z1),t.state.facet(z1),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let r of this.gutters)r.update(t)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=e.indexOf(s);o<0?r.push(new Wp(this.view,s)):(this.gutters[o].update(t),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>z.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*e.scaleX,r=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Ie.LTR?{left:i,right:r}:{right:i,left:r}})});function wD(t){return Array.isArray(t)?t:[t]}function Tv(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}var Ev=class{constructor(e,n,i){this.gutter=e,this.height=i,this.i=0,this.cursor=me.iter(e.markers,n.from)}addElement(e,n,i){let{gutter:r}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==r.elements.length){let l=new Zp(e,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,o,s,i);this.height=n.bottom,this.i++}line(e,n,i){let r=[];Tv(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,r)}widget(e,n){let i=this.gutter.config.widgetMarker(e,n.widget,n),r=i?[i]:null;for(let s of e.state.facet(UF)){let o=s(e,n.widget,n);o&&(r||(r=[])).push(o)}r&&this.addElement(e,n,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}},Wp=class{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=r.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[i](e,l,r)&&r.preventDefault()});this.markers=wD(n.markers(e)),n.initialSpacer&&(this.spacer=new Zp(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=wD(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!me.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Zp=class{constructor(e,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,i,r)}update(e,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),VF(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,a=s<n.length?n[s++]:null,c=!1;if(a){let u=a.elementClass;u&&(i+=" "+u);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(a)){l=f,c=!0;break}}else l=this.markers.length;for(;o<l;){let u=this.markers[o++];if(u.toDOM){u.destroy(r);let f=r.nextSibling;r.remove(),r=f}}if(!a)break;a.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(a.toDOM(e),r)),c&&o++}this.dom.className=i,this.markers=n}destroy(){this.setMarkers(null,[])}};function VF(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}var jF=_.define(),YF=_.define(),ma=_.define({combine(t){return ws(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let i=Object.assign({},e);for(let r in n){let s=i[r],o=n[r];i[r]=s?(l,a,c)=>s(l,a,c)||o(l,a,c):o}return i}})}}),Ku=class extends Kn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function H1(t,e){return t.state.facet(ma).formatNumber(e,t.state)}var KF=Yu.compute([ma],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(jF)},lineMarker(e,n,i){return i.some(r=>r.toDOM)?null:new Ku(H1(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,i)=>{for(let r of e.state.facet(YF)){let s=r(e,n,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(ma)!=e.state.facet(ma),initialSpacer(e){return new Ku(H1(e,kD(e.state.doc.lines)))},updateSpacer(e,n){let i=H1(n.view,kD(n.view.state.doc.lines));return i==e.number?e:new Ku(i)},domEventHandlers:t.facet(ma).domEventHandlers,side:"before"}));function g5(t={}){return[ma.of(t),m5(),KF]}function kD(t){let e=9;for(;e<t;)e=e*10+9;return e}var GF=0,Ju=class{constructor(e,n){this.from=e,this.to=n}},G=class{constructor(e={}){this.id=GF++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=qt.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}};G.closedBy=new G({deserialize:t=>t.split(" ")});G.openedBy=new G({deserialize:t=>t.split(" ")});G.group=new G({deserialize:t=>t.split(" ")});G.isolate=new G({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});G.contextHash=new G({perNode:!0});G.lookAhead=new G({perNode:!0});G.mounted=new G({perNode:!0});var To=class{constructor(e,n,i,r=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[G.mounted.id]}},QF=Object.create(null),qt=class t{constructor(e,n,i,r=0){this.name=e,this.props=n,this.id=i,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):QF,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new t(e.name||"",n,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(G.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let r of i.split(" "))n[r]=e[i];return i=>{for(let r=i.prop(G.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}};qt.none=new qt("",Object.create(null),0,8);var ef=class t{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let i of this.types){let r=null;for(let s of e){let o=s(i);if(o){r||(r=Object.assign({},i.props));let l=o[1],a=o[0];a.combine&&a.id in r&&(l=a.combine(r[a.id],l)),r[a.id]=l}}n.push(r?new qt(i.name,r,i.id,i.flags):i)}return new t(n)}},im=new WeakMap,y5=new WeakMap,Ue;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(Ue||(Ue={}));var Ge=class t{constructor(e,n,i,r,s){if(this.type=e,this.children=n,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=To.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let i of this.children){let r=i.toString();r&&(n&&(n+=","),n+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new rf(this.topNode,e)}cursorAt(e,n=0,i=0){let r=im.get(this)||this.topNode,s=new rf(r);return s.moveTo(e,n),im.set(this,s._tree),s}get topNode(){return new $i(this,0,0,null)}resolve(e,n=0){let i=tf(im.get(this)||this.topNode,e,n,!1);return im.set(this,i),i}resolveInner(e,n=0){let i=tf(y5.get(this)||this.topNode,e,n,!0);return y5.set(this,i),i}resolveStack(e,n=0){return XF(this,e,n)}iterate(e){let{enter:n,leave:i,from:r=0,to:s=this.length}=e,o=e.mode||0,l=(o&Ue.IncludeAnonymous)>0;for(let a=this.cursor(o|Ue.IncludeAnonymous);;){let c=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||n(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:Yv(qt.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new t(this.type,n,i,r,this.propValues),e.makeTree||((n,i,r)=>new t(qt.none,n,i,r)))}static build(e){return WF(e)}};Ge.empty=new Ge(qt.none,[],[],0);var Hv=class t{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new t(this.buffer,this.index)}},Ts=class t{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return qt.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],i=this.buffer[e+3],r=this.set.types[n],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,n,i,r,s){let{buffer:o}=this,l=-1;for(let a=e;a!=n&&!(x5(s,r,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(e,n,i){let r=this.buffer,s=new Uint16Array(n-e),o=0;for(let l=e,a=0;l<n;){s[a++]=r[l++],s[a++]=r[l++]-i;let c=s[a++]=r[l++]-i;s[a++]=r[l++]-e,o=Math.max(o,c)}return new t(s,o,this.set)}};function x5(t,e,n,i){switch(t){case-2:return n<e;case-1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function tf(t,e,n,i){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let o=!i&&t instanceof $i&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=i?0:Ue.IgnoreOverlays;if(i)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof $i&&o.index<0&&((r=l.enter(e,n,s))===null||r===void 0?void 0:r.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,n,s);if(!o)return t;t=o}}var sm=class{cursor(e=0){return new rf(this,e)}getChild(e,n=null,i=null){let r=b5(this,e,n,i);return r.length?r[0]:null}getChildren(e,n=null,i=null){return b5(this,e,n,i)}resolve(e,n=0){return tf(this,e,n,!1)}resolveInner(e,n=0){return tf(this,e,n,!0)}matchContext(e){return Uv(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),i=this;for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(i=n,n=r.prevSibling):n=r}return i}get node(){return this}get next(){return this.parent}},$i=class t extends sm{constructor(e,n,i,r){super(),this._tree=e,this.from=n,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,i,r,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=n>0?l.length:-1;e!=c;e+=n){let u=l[e],f=a[e]+o.from,d;if(!(!(s&Ue.EnterBracketed&&u instanceof Ge&&(d=To.get(u))&&!d.overlay&&d.bracketed&&i>=f&&i<=f+u.length)&&!x5(r,i,f,f+u.length))){if(u instanceof Ts){if(s&Ue.ExcludeBuffers)continue;let h=u.findChild(0,u.buffer.length,n,i-f,r);if(h>-1)return new nf(new Fv(o,u,e,f),null,h)}else if(s&Ue.IncludeAnonymous||!u.type.isAnonymous||jv(u)){let h;if(!(s&Ue.IgnoreMounts)&&(h=To.get(u))&&!h.overlay)return new t(h.tree,f,e,o);let m=new t(u,f,e,o);return s&Ue.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(n<0?u.children.length-1:0,n,i,r,s)}}}if(s&Ue.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,i=0){let r;if(!(i&Ue.IgnoreOverlays)&&(r=To.get(this._tree))&&r.overlay){let s=e-this.from,o=i&Ue.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((n>0||o?l<=s:l<s)&&(n<0||o?a>=s:a>s))return new t(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function b5(t,e,n,i){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function Uv(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}var Fv=class{constructor(e,n,i,r){this.parent=e,this.buffer=n,this.index=i,this.start=r}},nf=class t extends sm{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,i);return s<0?null:new t(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,i=0){if(i&Ue.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new t(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new t(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new t(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),n.push(0)}return new Ge(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function S5(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let o=t[s];(o.from>n.from||o.to<n.to)&&(n=o,e=s)}let i=n instanceof $i&&n.index<0?null:n.parent,r=t.slice();return i?r[e]=i:r.splice(e,1),new $v(r,n)}var $v=class{constructor(e,n){this.heads=e,this.node=n}get next(){return S5(this.heads)}};function XF(t,e,n){let i=t.resolveInner(e,n),r=null;for(let s=i instanceof $i?i:i.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[i])).push(o.resolve(e,n)),s=o}else{let o=To.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new $i(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(tf(l,e,n,!1))}}return r?S5(r):i}var rf=class{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Ue.EnterBracketed,e instanceof $i)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof $i?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,i=this.mode){return this.buffer?i&Ue.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ue.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ue.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:i}=r)}else({index:n,_parent:i}=this._tree);for(;i;{index:n,_parent:i}=i)if(n>-1)for(let s=n+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let l=i._tree.children[s];if(this.mode&Ue.IncludeAnonymous||l instanceof Ts||!l.type.isAnonymous||jv(l))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)n=new nf(this.buffer,n,this.stack[r]);return this.bufferNode=new nf(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&n&&n(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return Uv(this.node.parent,e);let{buffer:n}=this.buffer,{types:i}=n.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return Uv(this._tree,e,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function jv(t){return t.children.some(e=>e instanceof Ts||!e.type.isAnonymous||jv(e))}function WF(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=i.types.length}=t,l=Array.isArray(n)?new Hv(n,n.length):n,a=i.types,c=0,u=0;function f(k,C,w,A,O,D){let{id:I,start:M,end:$,size:U}=l,he=u,Fe=c;if(U<0)if(l.next(),U==-1){let Ct=s[I];w.push(Ct),A.push(M-k);return}else if(U==-3){c=I;return}else if(U==-4){u=I;return}else throw new RangeError(`Unrecognized record size: ${U}`);let ft=a[I],fe,Qe,cn=M-k;if($-M<=r&&(Qe=b(l.pos-C,O))){let Ct=new Uint16Array(Qe.size-Qe.skip),Ve=l.pos-Qe.size,bt=Ct.length;for(;l.pos>Ve;)bt=p(Qe.start,Ct,bt);fe=new Ts(Ct,$-Qe.start,i),cn=Qe.start-k}else{let Ct=l.pos-U;l.next();let Ve=[],bt=[],vt=I>=o?I:-1,un=0,fn=$;for(;l.pos>Ct;)vt>=0&&l.id==vt&&l.size>=0?(l.end<=fn-r&&(m(Ve,bt,M,un,l.end,fn,vt,he,Fe),un=Ve.length,fn=l.end),l.next()):D>2500?d(M,Ct,Ve,bt):f(M,Ct,Ve,bt,vt,D+1);if(vt>=0&&un>0&&un<Ve.length&&m(Ve,bt,M,un,M,fn,vt,he,Fe),Ve.reverse(),bt.reverse(),vt>-1&&un>0){let Zn=h(ft,Fe);fe=Yv(ft,Ve,bt,0,Ve.length,0,$-M,Zn,Zn)}else fe=g(ft,Ve,bt,$-M,he-$,Fe)}w.push(fe),A.push(cn)}function d(k,C,w,A){let O=[],D=0,I=-1;for(;l.pos>C;){let{id:M,start:$,end:U,size:he}=l;if(he>4)l.next();else{if(I>-1&&$<I)break;I<0&&(I=U-r),O.push(M,$,U),D++,l.next()}}if(D){let M=new Uint16Array(D*4),$=O[O.length-2];for(let U=O.length-3,he=0;U>=0;U-=3)M[he++]=O[U],M[he++]=O[U+1]-$,M[he++]=O[U+2]-$,M[he++]=he;w.push(new Ts(M,O[2]-$,i)),A.push($-k)}}function h(k,C){return(w,A,O)=>{let D=0,I=w.length-1,M,$;if(I>=0&&(M=w[I])instanceof Ge){if(!I&&M.type==k&&M.length==O)return M;($=M.prop(G.lookAhead))&&(D=A[I]+M.length+$)}return g(k,w,A,O,D,C)}}function m(k,C,w,A,O,D,I,M,$){let U=[],he=[];for(;k.length>A;)U.push(k.pop()),he.push(C.pop()+w-O);k.push(g(i.types[I],U,he,D-O,M-D,$)),C.push(O-w)}function g(k,C,w,A,O,D,I){if(D){let M=[G.contextHash,D];I=I?[M].concat(I):[M]}if(O>25){let M=[G.lookAhead,O];I=I?[M].concat(I):[M]}return new Ge(k,C,w,A,I)}function b(k,C){let w=l.fork(),A=0,O=0,D=0,I=w.end-r,M={size:0,start:0,skip:0};e:for(let $=w.pos-k;w.pos>$;){let U=w.size;if(w.id==C&&U>=0){M.size=A,M.start=O,M.skip=D,D+=4,A+=4,w.next();continue}let he=w.pos-U;if(U<0||he<$||w.start<I)break;let Fe=w.id>=o?4:0,ft=w.start;for(w.next();w.pos>he;){if(w.size<0)if(w.size==-3||w.size==-4)Fe+=4;else break e;else w.id>=o&&(Fe+=4);w.next()}O=ft,A+=U,D+=Fe}return(C<0||A==k)&&(M.size=A,M.start=O,M.skip=D),M.size>4?M:void 0}function p(k,C,w){let{id:A,start:O,end:D,size:I}=l;if(l.next(),I>=0&&A<o){let M=w;if(I>4){let $=l.pos-(I-4);for(;l.pos>$;)w=p(k,C,w)}C[--w]=M,C[--w]=D-k,C[--w]=O-k,C[--w]=A}else I==-3?c=A:I==-4&&(u=A);return w}let y=[],v=[];for(;l.pos>0;)f(t.start||0,t.bufferStart||0,y,v,-1,0);let x=(e=t.length)!==null&&e!==void 0?e:y.length?v[0]+y[0].length:0;return new Ge(a[t.topID],y.reverse(),v.reverse(),x)}var v5=new WeakMap;function rm(t,e){if(!t.isAnonymous||e instanceof Ts||e.type!=t)return 1;let n=v5.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof Ge)){n=1;break}n+=rm(t,i)}v5.set(e,n)}return n}function Yv(t,e,n,i,r,s,o,l,a){let c=0;for(let m=i;m<r;m++)c+=rm(t,e[m]);let u=Math.ceil(c*1.5/8),f=[],d=[];function h(m,g,b,p,y){for(let v=b;v<p;){let x=v,k=g[v],C=rm(t,m[v]);for(v++;v<p;v++){let w=rm(t,m[v]);if(C+w>=u)break;C+=w}if(v==x+1){if(C>u){let w=m[x];h(w.children,w.positions,0,w.children.length,g[x]+y);continue}f.push(m[x])}else{let w=g[v-1]+m[v-1].length-k;f.push(Yv(t,m,g,x,v,k,w,null,a))}d.push(k+y-s)}}return h(e,n,i,r,0),(l||a)(f,d,o)}var Eo=class t{constructor(e,n,i,r,s=!1,o=!1){this.from=e,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let r=[new t(0,e.length,e,0,!1,i)];for(let s of n)s.to>e.length&&r.push(s);return r}static applyChanges(e,n,i=128){if(!n.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let u=l<n.length?n[l]:null,f=u?u.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let d=o;if(a>=d.from||f<=d.to||c){let h=Math.max(d.from,a)-c,m=Math.min(d.to,f)-c;d=h>=m?null:new t(h,m,d.tree,d.offset+c,l>0,!!u)}if(d&&r.push(d),o.to>f)break;o=s<e.length?e[s++]:null}if(!u)break;a=u.toA,c=u.toA-u.toB}return r}},ka=class{startParse(e,n,i){return typeof e=="string"&&(e=new Vv(e)),i=i?i.length?i.map(r=>new Ju(r.from,r.to)):[new Ju(0,0)]:[new Ju(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let r=this.startParse(e,n,i);for(;;){let s=r.advance();if(s)return s}}},Vv=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}};var Mde=new G({perNode:!0});var ZF=0,mi=class t{constructor(e,n,i,r){this.name=e,this.set=n,this.base=i,this.modified=r,this.id=ZF++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof t&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let r=new t(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(e){let n=new cm(e);return i=>i.modified.indexOf(n)>-1?i:cm.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},JF=0,cm=class t{constructor(e){this.name=e,this.instances=[],this.id=JF++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(l=>l.base==e&&e$(n,l.modified));if(i)return i;let r=[],s=new mi(e.name,r,e,n);for(let l of n)l.instances.push(s);let o=t$(n);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(t.get(l,a));return s}};function e$(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function t$(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(t[n]));return e.sort((n,i)=>i.length-n.length)}function Aa(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!d)throw new RangeError("Invalid path: "+r);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==r.length)break;let h=r[f++];if(f==r.length&&h=="!"){o=0;break}if(h!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let u=new Mo(i,o,a>0?s.slice(0,a):null);e[c]=u.sort(e[c])}}return A5.add(e)}var A5=new G({combine(t,e){let n,i,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new Mo(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}}),Mo=class{constructor(e,n,i,r){this.tags=e,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};Mo.empty=new Mo([],2,null);function Xv(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let o of s.tag)n[o.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let o=r;for(let l of s)for(let a of l.set){let c=n[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function n$(t,e){let n=null;for(let i of t){let r=i.style(e);r&&(n=n?n+" "+r:r)}return n}function C5(t,e,n,i=0,r=t.length){let s=new Gv(i,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),i,r,"",s.highlighters),s.flush(r)}var Gv=class{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,i,r,s){let{type:o,from:l,to:a}=e;if(l>=i||a<=n)return;o.isTop&&(s=this.highlighters.filter(h=>!h.scope||h.scope(o)));let c=r,u=i$(e)||Mo.empty,f=n$(s,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),c),u.opaque)return;let d=e.tree&&e.tree.prop(G.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+l,1),m=this.highlighters.filter(b=>!b.scope||b.scope(d.tree.type)),g=e.firstChild();for(let b=0,p=l;;b++){let y=b<d.overlay.length?d.overlay[b]:null,v=y?y.from+l:a,x=Math.max(n,p),k=Math.min(i,v);if(x<k&&g)for(;e.from<k&&(this.highlightRange(e,x,k,r,s),this.startSpan(Math.min(k,e.to),c),!(e.to>=v||!e.nextSibling())););if(!y||v>i)break;p=y.to+l,p>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+l),Math.min(i,p),"",m),this.startSpan(Math.min(i,p),c))}g&&e.parent()}else if(e.firstChild()){d&&(r="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,r,s),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}};function i$(t){let e=t.type.prop(A5);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}var N=mi.define,om=N(),Es=N(),w5=N(Es),k5=N(Es),Ds=N(),lm=N(Ds),Kv=N(Ds),Yi=N(),Do=N(Yi),Vi=N(),ji=N(),Qv=N(),sf=N(Qv),am=N(),T={comment:om,lineComment:N(om),blockComment:N(om),docComment:N(om),name:Es,variableName:N(Es),typeName:w5,tagName:N(w5),propertyName:k5,attributeName:N(k5),className:N(Es),labelName:N(Es),namespace:N(Es),macroName:N(Es),literal:Ds,string:lm,docString:N(lm),character:N(lm),attributeValue:N(lm),number:Kv,integer:N(Kv),float:N(Kv),bool:N(Ds),regexp:N(Ds),escape:N(Ds),color:N(Ds),url:N(Ds),keyword:Vi,self:N(Vi),null:N(Vi),atom:N(Vi),unit:N(Vi),modifier:N(Vi),operatorKeyword:N(Vi),controlKeyword:N(Vi),definitionKeyword:N(Vi),moduleKeyword:N(Vi),operator:ji,derefOperator:N(ji),arithmeticOperator:N(ji),logicOperator:N(ji),bitwiseOperator:N(ji),compareOperator:N(ji),updateOperator:N(ji),definitionOperator:N(ji),typeOperator:N(ji),controlOperator:N(ji),punctuation:Qv,separator:N(Qv),bracket:sf,angleBracket:N(sf),squareBracket:N(sf),paren:N(sf),brace:N(sf),content:Yi,heading:Do,heading1:N(Do),heading2:N(Do),heading3:N(Do),heading4:N(Do),heading5:N(Do),heading6:N(Do),contentSeparator:N(Yi),list:N(Yi),quote:N(Yi),emphasis:N(Yi),strong:N(Yi),link:N(Yi),monospace:N(Yi),strikethrough:N(Yi),inserted:N(),deleted:N(),changed:N(),invalid:N(),meta:am,documentMeta:N(am),annotation:N(am),processingInstruction:N(am),definition:mi.defineModifier("definition"),constant:mi.defineModifier("constant"),function:mi.defineModifier("function"),standard:mi.defineModifier("standard"),local:mi.defineModifier("local"),special:mi.defineModifier("special")};for(let t in T){let e=T[t];e instanceof mi&&(e.name=t)}var Lde=Xv([{tag:T.link,class:"tok-link"},{tag:T.heading,class:"tok-heading"},{tag:T.emphasis,class:"tok-emphasis"},{tag:T.strong,class:"tok-strong"},{tag:T.keyword,class:"tok-keyword"},{tag:T.atom,class:"tok-atom"},{tag:T.bool,class:"tok-bool"},{tag:T.url,class:"tok-url"},{tag:T.labelName,class:"tok-labelName"},{tag:T.inserted,class:"tok-inserted"},{tag:T.deleted,class:"tok-deleted"},{tag:T.literal,class:"tok-literal"},{tag:T.string,class:"tok-string"},{tag:T.number,class:"tok-number"},{tag:[T.regexp,T.escape,T.special(T.string)],class:"tok-string2"},{tag:T.variableName,class:"tok-variableName"},{tag:T.local(T.variableName),class:"tok-variableName tok-local"},{tag:T.definition(T.variableName),class:"tok-variableName tok-definition"},{tag:T.special(T.variableName),class:"tok-variableName2"},{tag:T.definition(T.propertyName),class:"tok-propertyName tok-definition"},{tag:T.typeName,class:"tok-typeName"},{tag:T.namespace,class:"tok-namespace"},{tag:T.className,class:"tok-className"},{tag:T.macroName,class:"tok-macroName"},{tag:T.propertyName,class:"tok-propertyName"},{tag:T.operator,class:"tok-operator"},{tag:T.comment,class:"tok-comment"},{tag:T.meta,class:"tok-meta"},{tag:T.invalid,class:"tok-invalid"},{tag:T.punctuation,class:"tok-punctuation"}]);var Wv,Ca=new G;function r$(t){return _.define({combine:t?e=>e.concat(t):void 0})}var s$=new G,On=class{constructor(e,n,i=[],r=""){this.data=e,this.name=r,De.prototype.hasOwnProperty("tree")||Object.defineProperty(De.prototype,"tree",{get(){return gi(this)}}),this.parser=n,this.extension=[Oa.of(this),De.languageData.of((s,o,l)=>{let a=O5(s,o,l),c=a.type.prop(Ca);if(!c)return[];let u=s.facet(c),f=a.type.prop(s$);if(f){let d=a.resolve(o-a.from,l);for(let h of f)if(h.test(d,s)){let m=s.facet(h.facet);return h.type=="replace"?m:m.concat(u)}}return u})].concat(i)}isActiveAt(e,n,i=-1){return O5(e,n,i).type.prop(Ca)==this.data}findRegions(e){let n=e.facet(Oa);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(Ca)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(G.mounted);if(l){if(l.tree.prop(Ca)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let a=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<s.children.length;a++){let c=s.children[a];c instanceof Ge&&r(c,s.positions[a]+o)}};return r(gi(e),0),i}get allowsNesting(){return!0}};On.setState=pe.define();function O5(t,e,n){let i=t.facet(Oa),r=gi(t).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,n,Ue.ExcludeBuffers|Ue.EnterBracketed))s.type.isTop&&(r=s);return r}var lf=class t extends On{constructor(e,n,i){super(e,n,[],i),this.parser=n}static define(e){let n=r$(e.languageData);return new t(n,e.parser.configure({props:[Ca.add(i=>i.isTop?n:void 0)]}),e.name)}configure(e,n){return new t(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function gi(t){let e=t.field(On.state,!1);return e?e.tree:Ge.empty}var tx=class{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let i=this.cursorPos-this.string.length;return e<i||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}},of=null,nx=class t{constructor(e,n,i=[],r,s,o,l,a){this.parser=e,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new t(e,n,[],Ge.empty,0,i,[],null)}startParse(){return this.parser.startParse(new tx(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ge.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Eo.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Eo.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=of;of=this;try{return e()}finally{of=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=T5(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,u,f,d)=>a.push({fromA:c,toA:u,fromB:f,toB:d})),i=Eo.applyChanges(i,a),r=Ge.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);u<f&&l.push({from:u,to:f})}}}return new t(this.parser,n,i,r,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=T5(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends ka{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=of;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new Ge(qt.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return of}};function T5(t,e,n){return Eo.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}var af=class t{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new t(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=nx.create(e.facet(Oa).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new t(i)}};On.state=Bt.define({create:af.init,update(t,e){for(let n of e.effects)if(n.is(On.setState))return n.value;return e.startState.facet(Oa)!=e.state.facet(Oa)?af.init(e.state):t.apply(e)}});var R5=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(R5=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});var Zv=typeof navigator<"u"&&(!((Wv=navigator.scheduling)===null||Wv===void 0)&&Wv.isInputPending)?()=>navigator.scheduling.isInputPending():null,o$=Yn.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(On.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(On.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=R5(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,s=i.field(On.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Zv?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&i.doc.length>r+1e3,a=s.context.work(()=>Zv&&Zv()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:On.setState.of(new af(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>An(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Oa=_.define({combine(t){return t.length?t[0]:null},enables:t=>[On.state,o$,z.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),um=class{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}};var l$=_.define(),fm=_.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function cf(t){let e=t.facet(fm);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function uf(t,e){let n="",i=t.tabSize,r=t.facet(fm)[0];if(r==" "){for(;e>=i;)n+=" ",e-=i;r=" "}for(let s=0;s<e;s++)n+=r;return n}function ax(t,e){t instanceof De&&(t=new Ro(t));for(let i of t.state.facet(l$)){let r=i(t,e);if(r!==void 0)return r}let n=gi(t.state);return n.length>=e?a$(t,n,e):null}var Ro=class{constructor(e,n={}){this.state=e,this.options=n,this.unit=cf(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(n<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,n);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.countColumn(i,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,n=e.length){return So(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},cx=new G;function a$(t,e,n){let i=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return N5(i,t,n)}function N5(t,e,n){for(let i=t;i;i=i.next){let r=u$(i.node);if(r)return r(ix.create(e,n,i))}return 0}function c$(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function u$(t){let e=t.type.prop(cx);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(G.closedBy))){let r=t.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>L5(o,!0,1,void 0,s&&!c$(o)?r.from:void 0)}return t.parent==null?f$:null}function f$(){return 0}var ix=class t extends Ro{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new t(e,n,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(d$(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return N5(this.context.next,this.base,this.pos)}};function d$(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function h$(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+c}}l=a.to}}function ux({closing:t,align:e=!0,units:n=1}){return i=>L5(i,e,n,t)}function L5(t,e,n,i,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==t.pos+o,a=e?h$(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*n)}var I5=new G;function _5(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}var Ta=class t{constructor(e,n){this.specs=e;let i;function r(l){let a=Fn.newName();return(i||(i=Object.create(null)))["."+a]=l,a}let s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof On?l=>l.prop(Ca)==o.data:o?l=>l==o:void 0,this.style=Xv(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new Fn(i):null,this.themeType=n.themeType}static define(e,n){return new t(e,n||{})}},rx=_.define(),B5=_.define({combine(t){return t.length?[t[0]]:null}});function Jv(t){let e=t.facet(rx);return e.length?e:t.facet(B5)}function q5(t,e){let n=[p$],i;return t instanceof Ta&&(t.module&&n.push(z.styleModule.of(t.module)),i=t.themeType),e?.fallback?n.push(B5.of(t)):i?n.push(rx.computeN([z.darkTheme],r=>r.facet(z.darkTheme)==(i=="dark")?[t]:[])):n.push(rx.of(t)),n}var sx=class{constructor(e){this.markCache=Object.create(null),this.tree=gi(e.state),this.decorations=this.buildDeco(e,Jv(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=gi(e.state),i=Jv(e.state),r=i!=Jv(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!r&&n.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return Se.none;let i=new kr;for(let{from:r,to:s}of e.visibleRanges)C5(this.tree,n,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=Se.mark({class:a})))},r,s);return i.finish()}},p$=Bu.high(Yn.fromClass(sx,{decorations:t=>t.decorations})),Ude=Ta.define([{tag:T.meta,color:"#404740"},{tag:T.link,textDecoration:"underline"},{tag:T.heading,textDecoration:"underline",fontWeight:"bold"},{tag:T.emphasis,fontStyle:"italic"},{tag:T.strong,fontWeight:"bold"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:T.keyword,color:"#708"},{tag:[T.atom,T.bool,T.url,T.contentSeparator,T.labelName],color:"#219"},{tag:[T.literal,T.inserted],color:"#164"},{tag:[T.string,T.deleted],color:"#a11"},{tag:[T.regexp,T.escape,T.special(T.string)],color:"#e40"},{tag:T.definition(T.variableName),color:"#00f"},{tag:T.local(T.variableName),color:"#30a"},{tag:[T.typeName,T.namespace],color:"#085"},{tag:T.className,color:"#167"},{tag:[T.special(T.variableName),T.macroName],color:"#256"},{tag:T.definition(T.propertyName),color:"#00c"},{tag:T.comment,color:"#940"},{tag:T.invalid,color:"#f00"}]);var m$=1e4,g$="()[]{}";var y$=new G;function ox(t,e,n){let i=t.prop(e<0?G.openedBy:G.closedBy);if(i)return i;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function lx(t){let e=t.type.prop(y$);return e?e(t.node):t}function No(t,e,n,i={}){let r=i.maxScanDistance||m$,s=i.brackets||g$,o=gi(t),l=o.resolveInner(e,n);for(let a=l;a;a=a.parent){let c=ox(a.type,n,s);if(c&&a.from<a.to){let u=lx(a);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return b$(t,e,n,a,u,c,s)}}return v$(t,e,n,o,l.type,r,s)}function b$(t,e,n,i,r,s,o){let l=i.parent,a={from:r.from,to:r.to},c=0,u=l?.cursor();if(u&&(n<0?u.childBefore(i.from):u.childAfter(i.to)))do if(n<0?u.to<=i.from:u.from>=i.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let f=lx(u);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(ox(u.type,n,o))c++;else if(ox(u.type,-n,o)){if(c==0){let f=lx(u);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:a,matched:!1}}function v$(t,e,n,i,r,s,o){if(n<0?!e:e==t.doc.length)return null;let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=s;){let h=u.value;n<0&&(d+=h.length);let m=e+d*n;for(let g=n>0?0:h.length-1,b=n>0?h.length:-1;g!=b;g+=n){let p=o.indexOf(h[g]);if(!(p<0||i.resolveInner(m+g,1).type!=r))if(p%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:m+g,to:m+g+1},matched:p>>1==a>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}var x$=Object.create(null),E5=[qt.none];var D5=[],M5=Object.create(null),S$=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])S$[t]=w$(x$,e);function ex(t,e){D5.indexOf(t)>-1||(D5.push(t),console.warn(e))}function w$(t,e){let n=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=t[c]||T[c];u?typeof u=="function"?a.length?a=a.map(u):ex(c,`Modifier ${c} used at start of tag`):a.length?ex(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:ex(c,`Unknown highlighting tag ${c}`)}for(let c of a)n.push(c)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=M5[r];if(s)return s.id;let o=M5[r]=qt.define({id:E5.length,name:i,props:[Aa({[i]:n})]});return E5.push(o),o.id}var Fde={rtl:Se.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:Ie.RTL}),ltr:Se.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:Ie.LTR}),auto:Se.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var k$=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=yx(t.state,n.from);return i.line?A$(t):i.block?O$(t):!1};function gx(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(i(n.update(r)),!0):!1}}var A$=gx(D$,0);var C$=gx(Y5,0);var O$=gx((t,e)=>Y5(t,e,E$(e)),0);function yx(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}var ff=50;function T$(t,{open:e,close:n},i,r){let s=t.sliceDoc(i-ff,i),o=t.sliceDoc(r,r+ff),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,c=s.length-l;if(s.slice(c-e.length,c)==e&&o.slice(a,a+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let u,f;r-i<=2*ff?u=f=t.sliceDoc(i,r):(u=t.sliceDoc(i,i+ff),f=t.sliceDoc(r-ff,r));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,m=f.length-h-n.length;return u.slice(d,d+e.length)==e&&f.slice(m,m+n.length)==n?{open:{pos:i+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:r-h-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function E$(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function Y5(t,e,n=e.selection.ranges){let i=n.map(s=>yx(e,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>T$(e,i[o],s.from,s.to));if(t!=2&&!r.every(s=>s))return{changes:e.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(t!=1&&r.some(s=>s)){let s=[];for(let o=0,l;o<r.length;o++)if(l=r[o]){let a=i[o],{open:c,close:u}=l;s.push({from:c.pos-a.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+a.close.length})}return{changes:s}}return null}function D$(t,e,n=e.selection.ranges){let i=[],r=-1;e:for(let{from:s,to:o}of n){let l=i.length,a=1e9,c;for(let u=s;u<=o;){let f=e.doc.lineAt(u);if(c==null&&(c=yx(e,f.from).line,!c))continue e;if(f.from>r&&(s==o||o>f.from)){r=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,m=f.text.slice(d,d+c.length)==c?d:-1;d<f.text.length&&d<a&&(a=d),i.push({line:f,comment:m,token:c,indent:d,empty:h,single:!1})}u=f.to+1}if(a<1e9)for(let u=l;u<i.length;u++)i[u].indent<i[u].line.text.length&&(i[u].indent=a);i.length==l+1&&(i[l].single=!0)}if(t!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:c,empty:u,single:f}of i)(f||!u)&&s.push({from:l.from+c,insert:a+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,u=c+a.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}var dx=Un.define(),M$=Un.define(),R$=_.define(),K5=_.define({combine(t){return ws(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,r)=>e(i,r)||n(i,r)})}}),G5=Bt.define({create(){return Lo.empty},update(t,e){let n=e.state.facet(K5),i=e.annotation(dx);if(i){let a=yi.fromTransaction(e,i.selection),c=i.side,u=c==0?t.undone:t.done;return a?u=hm(u,u.length,n.minDepth,a):u=Z5(u,e.startState.selection),new Lo(c==0?i.rest:u,c==0?u:i.rest)}let r=e.annotation(M$);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(gt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=yi.fromTransaction(e),o=e.annotation(gt.time),l=e.annotation(gt.userEvent);return s?t=t.addChanges(s,o,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Lo(t.done.map(yi.fromJSON),t.undone.map(yi.fromJSON))}});function Q5(t={}){return[G5,K5.of(t),z.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?X5:e.inputType=="historyRedo"?hx:null;return i?(e.preventDefault(),i(n)):!1}})]}function pm(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(G5,!1);if(!r)return!1;let s=r.pop(t,n,e);return s?(i(s),!0):!1}}var X5=pm(0,!1),hx=pm(1,!1),N$=pm(0,!0),L$=pm(1,!0);var yi=class t{constructor(e,n,i,r,s){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new t(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new t(e.changes&&Gt.fromJSON(e.changes),[],e.mapped&&wr.fromJSON(e.mapped),e.startSelection&&R.fromJSON(e.startSelection),e.selectionsAfter.map(R.fromJSON))}static fromTransaction(e,n){let i=Gn;for(let r of e.startState.facet(R$)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new t(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,Gn)}static selection(e){return new t(void 0,Gn,void 0,void 0,e)}};function hm(t,e,n,i){let r=e+1>n+20?e-n-1:0,s=t.slice(r,e);return s.push(i),s}function I$(t,e){let n=[],i=!1;return t.iterChangedRanges((r,s)=>n.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let a=0;a<n.length;){let c=n[a++],u=n[a++];l>=c&&o<=u&&(i=!0)}}),i}function _$(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function W5(t,e){return t.length?e.length?t.concat(e):t:e}var Gn=[],B$=200;function Z5(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-B$));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),hm(t,t.length-1,1e9,n.setSelAfter(i)))}else return[yi.selection([e])]}function q$(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function fx(t,e){if(!t.length)return t;let n=t.length,i=Gn;for(;n;){let r=P$(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,n);return s[n-1]=r,s}else e=r.mapped,n--,i=r.selectionsAfter}return i.length?[yi.selection(i)]:Gn}function P$(t,e,n){let i=W5(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):Gn,n);if(!t.changes)return yi.selection(i);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new yi(r,pe.mapEffects(t.effects,e),o,t.startSelection.map(s),i)}var z$=/^(input\.type|delete)($|\.)/,Lo=class t{constructor(e,n,i=0,r=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new t(this.done,this.undone):this}addChanges(e,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||z$.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,I$(l.changes,e.changes))||i=="input.type.compose")?o=hm(o,o.length-1,r.minDepth,new yi(e.changes.compose(l.changes),W5(pe.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Gn)):o=hm(o,o.length,r.minDepth,e),new t(o,Gn,n,i)}addSelection(e,n,i,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Gn;return s.length>0&&n-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&_$(s[s.length-1],e)?this:new t(Z5(this.done,e),this.undone,n,i)}addMapping(e){return new t(fx(this.done,e),fx(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(i&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:dx.of({side:e,rest:q$(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=r.length==1?Gn:r.slice(0,r.length-1);return s.mapped&&(l=fx(l,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:dx.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}};Lo.empty=new Lo(Gn,Gn);var J5=[{key:"Mod-z",run:X5,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:hx,preventDefault:!0},{linux:"Ctrl-Shift-z",run:hx,preventDefault:!0},{key:"Mod-u",run:N$,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:L$,preventDefault:!0}];function Ea(t,e){return R.create(t.ranges.map(e),t.mainIndex)}function bi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function vi({state:t,dispatch:e},n){let i=Ea(t.selection,n);return i.eq(t.selection,!0)?!1:(e(bi(t,i)),!0)}function mm(t,e){return R.cursor(e?t.to:t.from)}function eM(t,e){return vi(t,n=>n.empty?t.moveByChar(n,e):mm(n,e))}function Pt(t){return t.textDirectionAt(t.state.selection.main.head)==Ie.LTR}var tM=t=>eM(t,!Pt(t)),nM=t=>eM(t,Pt(t));function iM(t,e){return vi(t,n=>n.empty?t.moveByGroup(n,e):mm(n,e))}var H$=t=>iM(t,!Pt(t)),U$=t=>iM(t,Pt(t));var Qde=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function F$(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function gm(t,e,n){let i=gi(t).resolveInner(e.head),r=n?G.closedBy:G.openedBy;for(let a=e.head;;){let c=n?i.childAfter(a):i.childBefore(a);if(!c)break;F$(t,c,r)?i=c:a=n?c.to:c.from}let s=i.type.prop(r),o,l;return s&&(o=n?No(t,i.from,1):No(t,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,R.cursor(l,n?-1:1)}var $$=t=>vi(t,e=>gm(t.state,e,!Pt(t))),V$=t=>vi(t,e=>gm(t.state,e,Pt(t)));function rM(t,e){return vi(t,n=>{if(!n.empty)return mm(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}var sM=t=>rM(t,!1),oM=t=>rM(t,!0);function lM(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,r;if(e){for(let s of t.state.facet(z.scrollMargins)){let o=s(t);o?.top&&(n=Math.max(o?.top,n)),o?.bottom&&(i=Math.max(o?.bottom,i))}r=t.scrollDOM.clientHeight-n-i}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function aM(t,e){let n=lM(t),{state:i}=t,r=Ea(i.selection,o=>o.empty?t.moveVertically(o,e,n.height):mm(o,e));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(i.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),a=l.top+n.marginTop,c=l.bottom-n.marginBottom;o&&o.top>a&&o.bottom<c&&(s=z.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-a}))}return t.dispatch(bi(i,r),{effects:s}),!0}var P5=t=>aM(t,!1),px=t=>aM(t,!0);function Ms(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=R.cursor(i.from+s))}return r}var j$=t=>vi(t,e=>Ms(t,e,!0)),Y$=t=>vi(t,e=>Ms(t,e,!1)),K$=t=>vi(t,e=>Ms(t,e,!Pt(t))),G$=t=>vi(t,e=>Ms(t,e,Pt(t))),Q$=t=>vi(t,e=>R.cursor(t.lineBlockAt(e.head).from,1)),X$=t=>vi(t,e=>R.cursor(t.lineBlockAt(e.head).to,-1));function W$(t,e,n){let i=!1,r=Ea(t.selection,s=>{let o=No(t,s.head,-1)||No(t,s.head,1)||s.head>0&&No(t,s.head-1,1)||s.head<t.doc.length&&No(t,s.head+1,-1);if(!o||!o.end)return s;i=!0;let l=o.start.from==s.head?o.end.to:o.end.from;return n?R.range(s.anchor,l):R.cursor(l)});return i?(e(bi(t,r)),!0):!1}var Z$=({state:t,dispatch:e})=>W$(t,e,!1);function Qn(t,e,n){let i=Ea(t.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=R.range(r.head,r.anchor));let s=n(r);return R.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(t.state.selection)?!1:(t.dispatch(bi(t.state,i)),!0)}function cM(t,e){return Qn(t,e,n=>t.moveByChar(n,e))}var uM=t=>cM(t,!Pt(t)),fM=t=>cM(t,Pt(t));function dM(t,e){return Qn(t,e,n=>t.moveByGroup(n,e))}var J$=t=>dM(t,!Pt(t)),eV=t=>dM(t,Pt(t));var tV=t=>{let e=!Pt(t);return Qn(t,e,n=>gm(t.state,n,e))},nV=t=>{let e=Pt(t);return Qn(t,e,n=>gm(t.state,n,e))};function hM(t,e){return Qn(t,e,n=>t.moveVertically(n,e))}var pM=t=>hM(t,!1),mM=t=>hM(t,!0);function gM(t,e){return Qn(t,e,n=>t.moveVertically(n,e,lM(t).height))}var z5=t=>gM(t,!1),H5=t=>gM(t,!0),iV=t=>Qn(t,!0,e=>Ms(t,e,!0)),rV=t=>Qn(t,!1,e=>Ms(t,e,!1)),sV=t=>{let e=!Pt(t);return Qn(t,e,n=>Ms(t,n,e))},oV=t=>{let e=Pt(t);return Qn(t,e,n=>Ms(t,n,e))},lV=t=>Qn(t,!1,e=>R.cursor(t.lineBlockAt(e.head).from)),aV=t=>Qn(t,!0,e=>R.cursor(t.lineBlockAt(e.head).to)),U5=({state:t,dispatch:e})=>(e(bi(t,{anchor:0})),!0),F5=({state:t,dispatch:e})=>(e(bi(t,{anchor:t.doc.length})),!0),$5=({state:t,dispatch:e})=>(e(bi(t,{anchor:t.selection.main.anchor,head:0})),!0),V5=({state:t,dispatch:e})=>(e(bi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),cV=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),uV=({state:t,dispatch:e})=>{let n=ym(t).map(({from:i,to:r})=>R.range(i,Math.min(r+1,t.doc.length)));return e(t.update({selection:R.create(n),userEvent:"select"})),!0},fV=({state:t,dispatch:e})=>{let n=Ea(t.selection,i=>{let r=gi(t),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return R.range(l.to,l.from)}return i});return n.eq(t.selection)?!1:(e(bi(t,n)),!0)};function yM(t,e){let{state:n}=t,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=s;;){let a=t.moveVertically(l,e);if(a.head<o.from||a.head>o.to){r.some(c=>c.head==a.head)||r.push(a);break}else{if(a.head==l.head)break;l=a}}}return r.length==i.ranges.length?!1:(t.dispatch(bi(n,R.create(r,r.length-1))),!0)}var dV=t=>yM(t,!1),hV=t=>yM(t,!0),pV=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=R.create([n.main]):n.main.empty||(i=R.create([R.cursor(n.main.head)])),i?(e(bi(t,i)),!0):!1};function df(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);a<o?(n="delete.backward",a=dm(t,a,!1)):a>o&&(n="delete.forward",a=dm(t,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=dm(t,o,!1),l=dm(t,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:R.cursor(o,o<s.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?z.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function dm(t,e,n){if(t instanceof z)for(let i of t.state.facet(z.atomicRanges).map(r=>r(t)))i.between(e,e,(r,s)=>{r<e&&s>e&&(e=n?s:r)});return e}var bM=(t,e,n)=>df(t,i=>{let r=i.from,{state:s}=t,o=s.doc.lineAt(r),l,a;if(n&&!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,r-o.from))){if(l[l.length-1]==" ")return r-1;let c=So(l,s.tabSize),u=c%cf(s)||cf(s);for(let f=0;f<u&&l[l.length-1-f]==" ";f++)r--;a=r}else a=yt(o.text,r-o.from,e,e)+o.from,a==r&&o.number!=(e?s.doc.lines:1)?a+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,r-o.from))&&(a=yt(o.text,a-o.from,!1,!1)+o.from);return a}),mx=t=>bM(t,!1,!0);var vM=t=>bM(t,!0,!1),xM=(t,e)=>df(t,n=>{let i=n.head,{state:r}=t,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(e?s.to:s.from)){i==n.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=yt(s.text,i-s.from,e)+s.from,c=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),u=o(c);if(l!=null&&u!=l)break;(c!=" "||i!=n.head)&&(l=u),i=a}return i}),SM=t=>xM(t,!1),mV=t=>xM(t,!0);var gV=t=>df(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)});var yV=t=>df(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),bV=t=>df(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)});var vV=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:ue.of(["",""])},range:R.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},xV=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let r=i.from,s=t.doc.lineAt(r),o=r==s.from?r-1:yt(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:yt(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(o,r))},range:R.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ym(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),s=t.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=t.doc.lineAt(i.to-1)),n>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return e}function wM(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let s of ym(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let a of s.ranges)r.push(R.range(Math.min(t.doc.length,a.anchor+l),Math.min(t.doc.length,a.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let a of s.ranges)r.push(R.range(a.anchor-l,a.head-l))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:R.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}var SV=({state:t,dispatch:e})=>wM(t,e,!1),wV=({state:t,dispatch:e})=>wM(t,e,!0);function kM(t,e,n){if(t.readOnly)return!1;let i=[];for(let s of ym(t))n?i.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):i.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let r=t.changes(i);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var kV=({state:t,dispatch:e})=>kM(t,e,!1),AV=({state:t,dispatch:e})=>kM(t,e,!0),CV=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(ym(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),i=Ea(e.selection,r=>{let s;if(t.lineWrapping){let o=t.lineBlockAt(r.head),l=t.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,s)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function OV(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=gi(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(G.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}var j5=AM(!1),TV=AM(!0);function AM(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),a=!t&&s==o&&OV(e,s);t&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let c=new Ro(e,{simulateBreak:s,simulateDoubleBreak:!!a}),u=ax(c,s);for(u==null&&(u=So(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:s,to:o}=a:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let f=["",uf(e,u)];return a&&f.push(uf(e,c.lineIndent(l.from,-1))),{changes:{from:s,to:o,insert:ue.of(f)},range:R.cursor(s+1+f[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function bx(t,e){let n=-1;return t.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let l=t.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(e(l,r,i),n=l.number),o=l.to+1}let s=t.changes(r);return{changes:r,range:R.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}var EV=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new Ro(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=bx(t,(s,o,l)=>{let a=ax(i,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let c=/^\s*/.exec(s.text)[0],u=uf(t,a);(c!=u||l.from<s.from+c.length)&&(n[s.from]=a,o.push({from:s.from,to:s.from+c.length,insert:u}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},DV=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(bx(t,(n,i)=>{i.push({from:n.from,insert:t.facet(fm)})}),{userEvent:"input.indent"})),!0),MV=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(bx(t,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=So(r,t.tabSize),o=0,l=uf(t,Math.max(0,s-cf(t)));for(;o<r.length&&o<l.length&&r.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:n.from+o,to:n.from+r.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),RV=t=>(t.setTabFocusMode(),!0);var NV=[{key:"Ctrl-b",run:tM,shift:uM,preventDefault:!0},{key:"Ctrl-f",run:nM,shift:fM},{key:"Ctrl-p",run:sM,shift:pM},{key:"Ctrl-n",run:oM,shift:mM},{key:"Ctrl-a",run:Q$,shift:lV},{key:"Ctrl-e",run:X$,shift:aV},{key:"Ctrl-d",run:vM},{key:"Ctrl-h",run:mx},{key:"Ctrl-k",run:gV},{key:"Ctrl-Alt-h",run:SM},{key:"Ctrl-o",run:vV},{key:"Ctrl-t",run:xV},{key:"Ctrl-v",run:px}],LV=[{key:"ArrowLeft",run:tM,shift:uM,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:H$,shift:J$,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:K$,shift:sV,preventDefault:!0},{key:"ArrowRight",run:nM,shift:fM,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:U$,shift:eV,preventDefault:!0},{mac:"Cmd-ArrowRight",run:G$,shift:oV,preventDefault:!0},{key:"ArrowUp",run:sM,shift:pM,preventDefault:!0},{mac:"Cmd-ArrowUp",run:U5,shift:$5},{mac:"Ctrl-ArrowUp",run:P5,shift:z5},{key:"ArrowDown",run:oM,shift:mM,preventDefault:!0},{mac:"Cmd-ArrowDown",run:F5,shift:V5},{mac:"Ctrl-ArrowDown",run:px,shift:H5},{key:"PageUp",run:P5,shift:z5},{key:"PageDown",run:px,shift:H5},{key:"Home",run:Y$,shift:rV,preventDefault:!0},{key:"Mod-Home",run:U5,shift:$5},{key:"End",run:j$,shift:iV,preventDefault:!0},{key:"Mod-End",run:F5,shift:V5},{key:"Enter",run:j5,shift:j5},{key:"Mod-a",run:cV},{key:"Backspace",run:mx,shift:mx,preventDefault:!0},{key:"Delete",run:vM,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:SM,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:mV,preventDefault:!0},{mac:"Mod-Backspace",run:yV,preventDefault:!0},{mac:"Mod-Delete",run:bV,preventDefault:!0}].concat(NV.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),CM=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:$$,shift:tV},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:V$,shift:nV},{key:"Alt-ArrowUp",run:SV},{key:"Shift-Alt-ArrowUp",run:kV},{key:"Alt-ArrowDown",run:wV},{key:"Shift-Alt-ArrowDown",run:AV},{key:"Mod-Alt-ArrowUp",run:dV},{key:"Mod-Alt-ArrowDown",run:hV},{key:"Escape",run:pV},{key:"Mod-Enter",run:TV},{key:"Alt-l",mac:"Ctrl-l",run:uV},{key:"Mod-i",run:fV,preventDefault:!0},{key:"Mod-[",run:MV},{key:"Mod-]",run:DV},{key:"Mod-Alt-\\",run:EV},{key:"Shift-Mod-k",run:CV},{key:"Shift-Mod-\\",run:Z$},{key:"Mod-/",run:k$},{key:"Alt-A",run:C$},{key:"Ctrl-m",mac:"Shift-Alt-m",run:RV}].concat(LV);var Sx=class t{constructor(e,n,i,r,s,o,l,a,c,u=0,f){this.p=e,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,i=0){let r=e.parser.context;return new t(e,[],n,i,i,0,[],0,r?new bm(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let i=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(r);if(l&&(this.score+=l),i==0){r<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let a=this.stack.length-(i-1)*3-(e&262144?6:0),c=a?this.stack[a-2]:this.p.ranges[0].from;r<s.minRepeatTerm&&c==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let f=a?this.stack[a-1]:0,d=this.bufferBase+this.buffer.length-f;if(r<s.minRepeatTerm||e&131072){let h=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,c,h,d+4,!0)}if(e&262144)this.state=this.stack[a];else{let h=this.stack[a-3];this.state=s.getGoto(h,r,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,n,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this.buffer.length;if(o>0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(e,n,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}else this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4)}apply(e,n,i,r){e&65536?this.reduce(e):this.shift(e,n,i,r)}useNode(e,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(n&&e.buffer[n-4]==0&&(n-=4);n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let i=e.buffer.slice(n),r=e.bufferBase+n;for(;e&&r==e.bufferBase;)e=e.parent;return new t(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new wx(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(i==0)return!1;if((i&65536)==0)return!0;n.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let s=0,o;s<n.length;s+=2)(o=n[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(n[s],o);if(this.stack.length<120)for(let s=0;r.length<8&&s<n.length;s+=2){let o=n[s+1];r.some((l,a)=>a&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r<n.length&&i.length<4;r+=2){let s=n[r+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(n[r],this.pos),o.reducePos=this.pos,o.score-=200,i.push(o)}return i}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let i=n>>19,r=n&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,c=this.stack.length-l*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new bm(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},bm=class{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}},wx=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}},kx=class t{constructor(e,n,i){this.stack=e,this.pos=n,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new t(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new t(this.stack,this.pos,this.index)}};function hf(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let i=0,r=0;i<t.length;){let s=0;for(;;){let o=t.charCodeAt(i++),l=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}n?n[r++]=s:n=new e(s)}return n}var Da=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},OM=new Da,Ax=class{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=OM,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let i=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<i.from;){if(!r)return null;let o=this.ranges[--r];s-=i.from-o.to,i=o}for(;n<0?s>i.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,i,r;if(n>=0&&n<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(i=s,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=i;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=OM,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let i="";for(let r of this.ranges){if(r.from>=n)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,n)))}return i}},Rs=class{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:i}=n.p;RM(this.data,e,n,this.id,i.data,i.tokenPrecTable)}};Rs.prototype.contextual=Rs.prototype.fallback=Rs.prototype.extend=!1;var Cx=class{constructor(e,n,i){this.precTable=n,this.elseToken=i,this.data=typeof e=="string"?hf(e):e}token(e,n){let i=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(RM(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}};Cx.prototype.contextual=Rs.prototype.fallback=Rs.prototype.extend=!1;var Io=class{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}};function RM(t,e,n,i,r,s){let o=0,l=1<<i,{dialect:a}=n.p.parser;e:for(;(l&t[o])!=0;){let c=t[o+1];for(let h=o+3;h<c;h+=2)if((t[h+1]&l)>0){let m=t[h];if(a.allows(m)&&(e.token.value==-1||e.token.value==m||_V(m,e.token.value,r,s))){e.acceptToken(m);break}}let u=e.next,f=0,d=t[o+2];if(e.next<0&&d>f&&t[c+d*3-3]==65535){o=t[c+d*3-1];continue e}for(;f<d;){let h=f+d>>1,m=c+h+(h<<1),g=t[m],b=t[m+1]||65536;if(u<g)d=h;else if(u>=b)f=h+1;else{o=t[m+2],e.advance();continue e}}break}}function TM(t,e,n){for(let i=e,r;(r=t[i])!=65535;i++)if(r==n)return i-e;return-1}function _V(t,e,n,i){let r=TM(n,i,e);return r<0||TM(n,i,t)<r}var Tn=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG),vx=null;function EM(t,e,n){let i=t.cursor(Ue.IncludeAnonymous);for(i.moveTo(e);;)if(!(n<0?i.childBefore(e):i.childAfter(e)))for(;;){if((n<0?i.to<e:i.from>e)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:t.length}}var Ox=class{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?EM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?EM(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let i=this.trees[n],r=this.index[n];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[r],o=this.start[n]+i.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof Ge){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let a=s.prop(G.lookAhead);if(!a||l+a<this.fragment.to)return s}}this.index[n]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}},Tx=class{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Da)}getActions(e){let n=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let c=0;c<s.length;c++){if((1<<c&o)==0)continue;let u=s[c],f=this.tokens[c];if(!(i&&!u.fallback)&&((u.contextual||f.start!=e.pos||f.mask!=o||f.context!=l)&&(this.updateCachedToken(f,u,e),f.mask=o,f.context=l),f.lookAhead>f.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let d=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!u.extend&&(i=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new Da,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,n=this.addActions(e,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Da,{pos:i,p:r}=e;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(e,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let l=s.specializers[o](this.stream.read(e.start,e.end),i);if(l>=0&&i.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,n,i,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=n,this.actions[r++]=i,r}addActions(e,n,i,r){let{state:s}=e,{parser:o}=e.p,{data:l}=o;for(let a=0;a<2;a++)for(let c=o.stateSlot(s,a?2:1);;c+=3){if(l[c]==65535)if(l[c+1]==1)c=Dr(l,c+2);else{r==0&&l[c+1]==2&&(r=this.putAction(Dr(l,c+2),n,i,r));break}l[c]==n&&(r=this.putAction(Dr(l,c+1),n,i,r))}return r}},Ex=class{constructor(e,n,i,r){this.parser=e,this.input=n,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Ax(n,r),this.tokens=new Tx(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[Sx.start(this,e.top[0],s)],this.fragments=i.length&&this.stream.end-s>e.bufferLength*4?new Ox(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>n)i.push(l);else{if(this.advanceStack(l,i,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!i.length){let o=r&&BV(r);if(o)return Tn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Tn&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return Tn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o<i.length-1;o++){let l=i[o];for(let a=o+1;a<i.length;a++){let c=i[a];if(l.sameState(c)||l.buffer.length>500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o<i.length;o++)i[o].pos<this.minStackPos&&(this.minStackPos=i[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,i){let r=e.pos,{parser:s}=this,o=Tn?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(G.contextHash)||0)==u))return e.useNode(f,d),Tn&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Ge)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof Ge&&f.positions[0]==0)f=h;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Tn&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;c<a.length;){let u=a[c++],f=a[c++],d=a[c++],h=c==a.length||!i,m=h?e:e.split(),g=this.tokens.mainToken;if(m.apply(u,f,g?g.start:m.pos,d),Tn&&console.log(o+this.stackID(m)+` (via ${(u&65536)==0?"shift":`reduce of ${s.getName(u&65535)}`} for ${s.getName(f)} @ ${r}${m==e?"":", split"})`),h)return!0;m.pos>r?n.push(m):i.push(m)}return!1}advanceFully(e,n){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return DM(e,n),!0}}runRecovery(e,n,i){let r=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],a=n[o<<1],c=n[(o<<1)+1],u=Tn?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Tn&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),d=u;for(let h=0;h<10&&f.forceReduce()&&(Tn&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));h++)Tn&&(d=this.stackID(f)+" -> ");for(let h of l.recoverByInsert(a))Tn&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,i);this.stream.end>l.pos?(c==l.pos&&(c++,a=0),l.recoverByDelete(a,c),Tn&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),DM(l,i)):(!r||r.score<f.score)&&(r=f)}return r}stackToTree(e){return e.close(),Ge.build({buffer:kx.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(vx||(vx=new WeakMap)).get(e);return n||vx.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}};function DM(t,e){for(let n=0;n<e.length;n++){let i=e[n];if(i.pos==t.pos&&i.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}var Dx=class{constructor(e,n,i){this.source=e,this.flags=n,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}},xx=t=>t,vm=class{constructor(e){this.start=e.start,this.shift=e.shift||xx,this.reduce=e.reduce||xx,this.reuse=e.reuse||xx,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},Ma=class t extends ka{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;l<e.repeatNodeCount;l++)n.push("");let i=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<n.length;l++)r.push([]);function s(l,a,c){r[l].push([a,a.deserialize(String(c))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a=="string"&&(a=G[a]);for(let c=1;c<l.length;){let u=l[c++];if(u>=0)s(u,a,l[c++]);else{let f=l[c+-u];for(let d=-u;d>0;d--)s(l[c++],a,f);c++}}}this.nodeSet=new ef(n.map((l,a)=>qt.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=hf(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(MM),this.states=hf(e.states,Uint32Array),this.data=hf(e.stateData),this.goto=hf(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Rs(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,i){let r=new Ex(this,e,n,i);for(let s of this.wrappers)r=s(r,e,n,i);return r}getGoto(e,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&i)return a;for(let c=s+(o>>1);s<c;s++)if(r[s]==e)return a;if(l)return-1}}hasAction(e,n){let i=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),o;;s+=3){if((o=i[s])==65535)if(i[s+1]==1)o=i[s=Dr(i,s+2)];else{if(i[s+1]==2)return Dr(i,s+2);break}if(o==n||o==0)return Dr(i,s+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,i=>i==n?!0:null)}allActions(e,n){let i=this.stateSlot(e,4),r=i?n(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Dr(this.data,s+2);else break;r=n(Dr(this.data,s+1))}return r}nextStates(e){let n=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Dr(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(e){let n=Object.assign(Object.create(t.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=i}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=MM(o),o})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),i=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;s<n.length;s++)if(!i[s])for(let o=this.dialects[n[s]],l;(l=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new Dx(e,i,r)}static deserialize(e){return new t(e)}};function Dr(t,e){return t[e]|t[e+1]<<16}function BV(t){let e=null;for(let n of t){let i=n.p.stoppedAt;(n.pos==n.p.stream.end||i!=null&&n.pos>i)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function MM(t){if(t.external){let e=t.extend?1:0;return(n,i)=>t.external(n,i)<<1|e}return t.get}var Ra=63,NM=64,qV=1,PV=2,_M=3,zV=4,BM=5,HV=6,UV=7,qM=65,FV=66,$V=8,VV=9,jV=10,YV=11,KV=12,PM=13,GV=19,QV=20,XV=29,WV=33,ZV=34,JV=47,ej=0,_x=1,Rx=2,mf=3,Nx=4,Mr=class{constructor(e,n,i){this.parent=e,this.depth=n,this.type=i,this.hash=(e?e.hash+e.hash<<8:0)+n+(n<<4)+i}};Mr.top=new Mr(null,-1,ej);function pf(t,e){for(let n=0,i=e-t.pos-1;;i--,n++){let r=t.peek(i);if(Rr(r)||r==-1)return n}}function Lx(t){return t==32||t==9}function Rr(t){return t==10||t==13}function zM(t){return Lx(t)||Rr(t)}function _o(t){return t<0||zM(t)}var tj=new vm({start:Mr.top,reduce(t,e){return t.type==mf&&(e==QV||e==ZV)?t.parent:t},shift(t,e,n,i){if(e==_M)return new Mr(t,pf(i,i.pos),_x);if(e==qM||e==BM)return new Mr(t,pf(i,i.pos),Rx);if(e==Ra)return t.parent;if(e==GV||e==WV)return new Mr(t,0,mf);if(e==PM&&t.type==Nx)return t.parent;if(e==JV){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new Mr(t,t.depth+ +r[0],Nx)}return t},hash(t){return t.hash}});function Na(t,e,n=0){return t.peek(n)==e&&t.peek(n+1)==e&&t.peek(n+2)==e&&_o(t.peek(n+3))}var nj=new Io((t,e)=>{if(t.next==-1&&e.canShift(NM))return t.acceptToken(NM);let n=t.peek(-1);if((Rr(n)||n<0)&&e.context.type!=mf){if(Na(t,45))if(e.canShift(Ra))t.acceptToken(Ra);else return t.acceptToken(qV,3);if(Na(t,46))if(e.canShift(Ra))t.acceptToken(Ra);else return t.acceptToken(PV,3);let i=0;for(;t.next==32;)i++,t.advance();(i<e.context.depth||i==e.context.depth&&e.context.type==_x&&(t.next!=45||!_o(t.peek(1))))&&t.next!=-1&&!Rr(t.next)&&t.next!=35&&t.acceptToken(Ra,-i)}},{contextual:!0}),ij=new Io((t,e)=>{if(e.context.type==mf){t.next==63&&(t.advance(),_o(t.next)&&t.acceptToken(UV));return}if(t.next==45)t.advance(),_o(t.next)&&t.acceptToken(e.context.type==_x&&e.context.depth==pf(t,t.pos-1)?zV:_M);else if(t.next==63)t.advance(),_o(t.next)&&t.acceptToken(e.context.type==Rx&&e.context.depth==pf(t,t.pos-1)?HV:BM);else{let n=t.pos;for(;;)if(Lx(t.next)){if(t.pos==n)return;t.advance()}else if(t.next==33)HM(t);else if(t.next==38)Ix(t);else if(t.next==42){Ix(t);break}else if(t.next==39||t.next==34){if(Bx(t,!0))break;return}else if(t.next==91||t.next==123){if(!sj(t))return;break}else{UM(t,!0,!1,0);break}for(;Lx(t.next);)t.advance();if(t.next==58){if(t.pos==n&&e.canShift(XV))return;let i=t.peek(1);_o(i)&&t.acceptTokenTo(e.context.type==Rx&&e.context.depth==pf(t,n)?FV:qM,n)}}},{contextual:!0});function rj(t){return t>32&&t<127&&t!=34&&t!=37&&t!=44&&t!=60&&t!=62&&t!=92&&t!=94&&t!=96&&t!=123&&t!=124&&t!=125}function LM(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function IM(t,e){return t.next==37?(t.advance(),LM(t.next)&&t.advance(),LM(t.next)&&t.advance(),!0):rj(t.next)||e&&t.next==44?(t.advance(),!0):!1}function HM(t){if(t.advance(),t.next==60){for(t.advance();;)if(!IM(t,!0)){t.next==62&&t.advance();break}}else for(;IM(t,!1););}function Ix(t){for(t.advance();!_o(t.next)&&xm(t.next)!="f";)t.advance()}function Bx(t,e){let n=t.next,i=!1,r=t.pos;for(t.advance();;){let s=t.next;if(s<0)break;if(t.advance(),s==n)if(s==39)if(t.next==39)t.advance();else break;else break;else if(s==92&&n==34)t.next>=0&&t.advance();else if(Rr(s)){if(e)return!1;i=!0}else if(e&&t.pos>=r+1024)return!1}return!i}function sj(t){for(let e=[],n=t.pos+1024;;)if(t.next==91||t.next==123)e.push(t.next),t.advance();else if(t.next==39||t.next==34){if(!Bx(t,!0))return!1}else if(t.next==93||t.next==125){if(e[e.length-1]!=t.next-2)return!1;if(e.pop(),t.advance(),!e.length)return!0}else{if(t.next<0||t.pos>n||Rr(t.next))return!1;t.advance()}}var oj="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function xm(t){return t<33?"u":t>125?"s":oj[t-33]}function Mx(t,e){let n=xm(t);return n!="u"&&!(e&&n=="f")}function UM(t,e,n,i){if(xm(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&Mx(t.peek(1),n))t.advance();else return!1;let r=t.pos;for(;;){let s=t.next,o=0,l=i+1;for(;zM(s);){if(Rr(s)){if(e)return!1;l=0}else l++;s=t.peek(++o)}if(!(s>=0&&(s==58?Mx(t.peek(o+1),n):s==35?t.peek(o-1)!=32:Mx(s,n)))||!n&&l<=i||l==0&&!n&&(Na(t,45,o)||Na(t,46,o)))break;if(e&&xm(s)=="f")return!1;for(let c=o;c>=0;c--)t.advance();if(e&&t.pos>r+1024)return!1}return!0}var lj=new Io((t,e)=>{if(t.next==33)HM(t),t.acceptToken(KV);else if(t.next==38||t.next==42){let n=t.next==38?jV:YV;Ix(t),t.acceptToken(n)}else t.next==39||t.next==34?(Bx(t,!1),t.acceptToken(VV)):UM(t,!1,e.context.type==mf,e.context.depth)&&t.acceptToken($V)}),aj=new Io((t,e)=>{let n=e.context.type==Nx?e.context.depth:-1,i=t.pos;e:for(;;){let r=0,s=t.next;for(;s==32;)s=t.peek(++r);if(!r&&(Na(t,45,r)||Na(t,46,r))||!Rr(s)&&(n<0&&(n=Math.max(e.context.depth+1,r)),r<n))break;for(;;){if(t.next<0)break e;let o=Rr(t.next);if(t.advance(),o)continue e;i=t.pos}}t.acceptTokenTo(PM,i)}),cj=Aa({DirectiveName:T.keyword,DirectiveContent:T.attributeValue,"DirectiveEnd DocEnd":T.meta,QuotedLiteral:T.string,BlockLiteralHeader:T.special(T.string),BlockLiteralContent:T.content,Literal:T.content,"Key/Literal Key/QuotedLiteral":T.definition(T.propertyName),"Anchor Alias":T.labelName,Tag:T.typeName,Comment:T.lineComment,": , -":T.separator,"?":T.punctuation,"[ ]":T.squareBracket,"{ }":T.brace}),FM=Ma.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"\u26A0 DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:tj,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[cj],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[nj,ij,lj,aj,0,1],topRules:{Stream:[0,15]},tokenPrec:0});var uj=Ma.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"\u26A0 Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),fj=lf.define({name:"yaml",parser:FM.configure({props:[cx.add({Stream:t=>{for(let e=t.node.resolve(t.pos,-1);e&&e.to>=t.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return t.baseIndentFor(e);if(e.name=="BlockLiteral")return t.baseIndentFor(e)+t.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return t.column(e.firstChild.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let n=t.column(e.from,1);if(n==t.lineIndent(e.from,1))return n;if(e.to>t.pos)return null}}return null},FlowMapping:ux({closing:"}"}),FlowSequence:ux({closing:"]"})}),I5.add({"FlowMapping FlowSequence":_5,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function $M(){return new um(fj)}var ahe=lf.define({name:"yaml-frontmatter",parser:uj.configure({props:[Aa({DashLine:T.meta})]})});var km=class{constructor(e,n,i){this.from=e,this.to=n,this.diagnostic=i}},Bo=class t{constructor(e,n,i){this.diagnostics=e,this.panel=n,this.selected=i}static init(e,n,i){let r=i.facet(gf).markerFilter;r&&(e=r(e,i));let s=e.slice().sort((h,m)=>h.from-m.from||h.to-m.to),o=new kr,l=[],a=0,c=i.doc.iter(),u=0,f=i.doc.length;for(let h=0;;){let m=h==s.length?null:s[h];if(!m&&!l.length)break;let g,b;if(l.length)g=a,b=l.reduce((v,x)=>Math.min(v,x.to),m&&m.from>g?m.from:1e8);else{if(g=m.from,g>f)break;b=m.to,l.push(m),h++}for(;h<s.length;){let v=s[h];if(v.from==g&&(v.to>v.from||v.to==g))l.push(v),h++,b=Math.min(v.to,b);else{b=Math.min(v.from,b);break}}b=Math.min(b,f);let p=!1;if(l.some(v=>v.from==g&&(v.to==b||b==f))&&(p=g==b,!p&&b-g<10)){let v=g-(u+c.value.length);v>0&&(c.next(v),u=g);for(let x=g;;){if(x>=b){p=!0;break}if(!c.lineBreak&&u+c.value.length>x)break;x=u+c.value.length,u+=c.value.length,c.next()}}let y=JM(l);if(p)o.add(g,g,Se.widget({widget:new qx(y),diagnostics:l.slice()}));else{let v=l.reduce((x,k)=>k.markClass?x+" "+k.markClass:x,"");o.add(g,b,Se.mark({class:"cm-lintRange cm-lintRange-"+y+v,diagnostics:l.slice(),inclusiveEnd:l.some(x=>x.to>b)}))}if(a=b,a==f)break;for(let v=0;v<l.length;v++)l[v].to<=a&&l.splice(v--,1)}let d=o.finish();return new t(d,n,La(d))}};function La(t,e=null,n=0){let i=null;return t.between(n,1e9,(r,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new km(r,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new km(i.from,s,i.diagnostic)}}),i}function YM(t,e){let n=e.pos,i=e.end||n,r=t.state.facet(gf).hideOn(t,n,i);if(r!=null)return r;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(Tm))||t.changes.touchesRange(s.from,Math.max(s.to,i)))}function dj(t,e){return t.field(xi,!1)?e:e.concat(pe.appendConfig.of(kj))}function KM(t,e){return{effects:dj(t,[Tm.of(e)])}}var Tm=pe.define(),GM=pe.define(),QM=pe.define(),xi=Bt.define({create(){return new Bo(Se.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),i=null,r=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);i=La(n,t.selected.diagnostic,s)||La(n,null,s)}!n.size&&r&&e.state.facet(gf).autoPanel&&(r=null),t=new Bo(n,r,i)}for(let n of e.effects)if(n.is(Tm)){let i=e.state.facet(gf).autoPanel?n.value.length?Cm.open:null:t.panel;t=Bo.init(n.value,i,e.state)}else n.is(GM)?t=new Bo(t.diagnostics,n.value?Cm.open:null,t.selected):n.is(QM)&&(t=new Bo(t.diagnostics,t.panel,n.value));return t},provide:t=>[Xp.from(t,e=>e.panel),z.decorations.from(t,e=>e.diagnostics)]});var hj=Se.mark({class:"cm-lintRange cm-lintRange-active"});function pj(t,e,n){let{diagnostics:i}=t.state.field(xi),r,s=-1,o=-1;i.between(e-(n<0?1:0),e+(n>0?1:0),(a,c,{spec:u})=>{if(e>=a&&e<=c&&(a==c||(e>a||n>0)&&(e<c||n<0)))return r=u.diagnostics,s=a,o=c,!1});let l=t.state.facet(gf).tooltipFilter;return r&&l&&(r=l(r,t.state)),r?{pos:s,end:o,above:!0,create(){return{dom:XM(t,r)}}}:null}function XM(t,e){return kn("ul",{class:"cm-tooltip-lint"},e.map(n=>ZM(t,n,!1)))}var VM=t=>{let e=t.state.field(xi,!1);return!e||!e.panel?!1:(t.dispatch({effects:GM.of(!1)}),!0)};var gf=_.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...ws(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:jM,tooltipFilter:jM,needsRefresh:(e,n)=>e?n?i=>e(i)||n(i):e:n,hideOn:(e,n)=>e?n?(i,r,s)=>e(i,r,s)||n(i,r,s):e:n,autoPanel:(e,n)=>e||n})}}});function jM(t,e){return t?e?(n,i)=>e(t(n,i),i):t:e}function WM(t){let e=[];if(t)e:for(let{name:n}of t){for(let i=0;i<n.length;i++){let r=n[i];if(/[a-zA-Z]/.test(r)&&!e.some(s=>s.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function ZM(t,e,n){var i;let r=n?WM(e.actions):[];return kn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},kn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,a=h=>{if(h.preventDefault(),l)return;l=!0;let m=La(t.state.field(xi).diagnostics,e);m&&s.apply(t,m.from,m.to)},{name:c}=s,u=r[o]?c.indexOf(r[o]):-1,f=u<0?c:[c.slice(0,u),kn("u",c.slice(u,u+1)),c.slice(u+1)],d=s.markClass?" "+s.markClass:"";return kn("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:a,onmousedown:a,"aria-label":` Action: ${c}${u<0?"":` (access key "${r[o]})"`}.`},f)}),e.source&&kn("div",{class:"cm-diagnosticSource"},e.source))}var qx=class extends Tr{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return kn("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}},Am=class{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=ZM(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},Cm=class t{constructor(e){this.view=e,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)VM(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=WM(s.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==r.keyCode){let a=La(this.view.state.field(xi).diagnostics,s);a&&s.actions[l].apply(e,a.from,a.to)}}else return;r.preventDefault()}},i=r=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(r.target)&&this.moveSelection(s)};this.list=kn("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:i}),this.dom=kn("div",{class:"cm-panel-lint"},this.list,kn("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>VM(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(xi).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(xi),i=0,r=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,a,{spec:c})=>{for(let u of c.diagnostics){if(o.has(u))continue;o.add(u);let f=-1,d;for(let h=i;h<this.items.length;h++)if(this.items[h].diagnostic==u){f=h;break}f<0?(d=new Am(this.view,u),this.items.splice(i,0,d),r=!0):(d=this.items[f],f>i&&(this.items.splice(i,f-i),r=!0)),n&&d.diagnostic==n.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),s=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new Am(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let c=a.height/this.list.offsetHeight;l.top<a.top?this.list.scrollTop-=(a.top-l.top)/c:l.bottom>a.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function n(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)n();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(xi),i=La(n.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:QM.of(i)})}static open(e){return new t(e)}};function wm(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function Sm(t){return wm(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}var mj=z.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Sm("#f11")},".cm-lintRange-warning":{backgroundImage:Sm("orange")},".cm-lintRange-info":{backgroundImage:Sm("#999")},".cm-lintRange-hint":{backgroundImage:Sm("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function gj(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function JM(t){let e="hint",n=1;for(let i of t){let r=gj(i.severity);r>n&&(n=r,e=i.severity)}return e}var Om=class extends Kn{constructor(e){super(),this.diagnostics=e,this.severity=JM(e)}toDOM(e){let n=document.createElement("div");n.className="cm-lint-marker cm-lint-marker-"+this.severity;let i=this.diagnostics,r=e.state.facet(Em).tooltipFilter;return r&&(i=r(i,e.state)),i.length&&(n.onmouseover=()=>bj(e,n,i)),n}};function yj(t,e){let n=i=>{let r=e.getBoundingClientRect();if(!(i.clientX>r.left-10&&i.clientX<r.right+10&&i.clientY>r.top-10&&i.clientY<r.bottom+10)){for(let s=i.target;s;s=s.parentNode)if(s.nodeType==1&&s.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",n),t.state.field(eR)&&t.dispatch({effects:zx.of(null)})}};window.addEventListener("mousemove",n)}function bj(t,e,n){function i(){let o=t.elementAtHeight(e.getBoundingClientRect().top+5-t.documentTop);t.coordsAtPos(o.from)&&t.dispatch({effects:zx.of({pos:o.from,above:!1,clip:!1,create(){return{dom:XM(t,n),getCoords:()=>e.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,yj(t,e)}let{hoverTime:r}=t.state.facet(Em),s=setTimeout(i,r);e.onmouseout=()=>{clearTimeout(s),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(s),s=setTimeout(i,r)}}function vj(t,e){let n=Object.create(null);for(let r of e){let s=t.lineAt(r.from);(n[s.from]||(n[s.from]=[])).push(r)}let i=[];for(let r in n)i.push(new Om(n[r]).range(+r));return me.of(i,!0)}var xj=zv({class:"cm-gutter-lint",markers:t=>t.state.field(Px),widgetMarker:(t,e,n)=>{let i=[];return t.state.field(Px).between(n.from,n.to,(r,s,o)=>{r>n.from&&r<n.to&&i.push(...o.diagnostics)}),i.length?new Om(i):null}}),Px=Bt.define({create(){return me.empty},update(t,e){t=t.map(e.changes);let n=e.state.facet(Em).markerFilter;for(let i of e.effects)if(i.is(Tm)){let r=i.value;n&&(r=n(r||[],e.state)),t=vj(e.state.doc,r.slice(0))}return t}}),zx=pe.define(),eR=Bt.define({create(){return null},update(t,e){return t&&e.docChanged&&(t=YM(e,t)?null:{...t,pos:e.changes.mapPos(t.pos)}),e.effects.reduce((n,i)=>i.is(zx)?i.value:n,t)},provide:t=>nm.from(t)}),Sj=z.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:wm('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:wm('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:wm('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),wj=p5(pj,{hideOn:YM}),kj=[xi,z.decorations.compute([xi],t=>{let{selected:e,panel:n}=t.field(xi);return!e||!n||e.from==e.to?Se.none:Se.set([hj.range(e.from,e.to)])}),wj,mj],Em=_.define({combine(t){return ws(t,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function tR(t={}){return[Em.of(t),Px,xj,Sj,eR]}var Ki=X(Ce()),nR={error:0,warning:1,info:2},Aj=Ta.define([{tag:T.comment,color:"var(--spytial-ed-syn-comment, #8a8170)",fontStyle:"italic"},{tag:[T.string,T.special(T.string)],color:"var(--spytial-ed-syn-string, #7a5901)"},{tag:[T.number,T.bool,T.null],color:"var(--spytial-ed-syn-number, #7a5901)"},{tag:[T.propertyName,T.definition(T.propertyName),T.keyword,T.atom],color:"var(--spytial-ed-syn-keyword, #6d28a8)"},{tag:[T.punctuation,T.separator],color:"var(--spytial-ed-text-muted, #6e6553)"}]),Cj=z.theme({"&":{fontSize:"0.85em",color:"var(--spytial-ed-text, #221d14)",backgroundColor:"var(--spytial-ed-surface, #faf8f2)",border:"1px solid var(--spytial-ed-border, #d9d2c0)",borderRadius:"var(--spytial-ed-radius, 2px)",minHeight:"12rem"},"&.cm-focused":{outline:"2px solid var(--spytial-ed-accent, #b5431a)",outlineOffset:"-1px"},".cm-scroller":{fontFamily:"var(--spytial-ed-mono-font-family, ui-monospace, monospace)",lineHeight:"1.5",overflow:"auto"},".cm-content":{padding:"0.5em 0",caretColor:"var(--spytial-ed-accent, #b5431a)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--spytial-ed-accent, #b5431a)"},".cm-gutters":{backgroundColor:"var(--spytial-ed-surface-raised, #f1ecdf)",color:"var(--spytial-ed-text-muted, #6e6553)",border:"none",borderInlineEnd:"1px solid var(--spytial-ed-border, #d9d2c0)"},".cm-lineNumbers .cm-gutterElement":{padding:"0 0.5em 0 0.6em"},"&.cm-editor .cm-selectionBackground, & .cm-selectionBackground, & .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--spytial-ed-accent, #b5431a) 22%, transparent)"},".cm-tooltip":{border:"1px solid var(--spytial-ed-border, #d9d2c0)",backgroundColor:"var(--spytial-ed-surface-raised, #f1ecdf)",color:"var(--spytial-ed-text, #221d14)",borderRadius:"var(--spytial-ed-radius, 2px)",fontSize:"0.85em"}});function Oj(t,e){if(!t)return[];let n=[];for(let i of t){if(i.from===void 0||i.to===void 0)continue;let r=Math.max(0,Math.min(i.from,e)),s=Math.max(r,Math.min(i.to,e));n.push({from:r,to:s,severity:i.severity,message:i.message,source:i.code})}return n.sort((i,r)=>i.from-r.from),n}var Hx=({value:t,onChange:e,diagnostics:n,hasUnappliedEdits:i=!1,showLineNumbers:r=!0,syntaxHighlighting:s=!0,disabled:o=!1,"aria-label":l="Layout specification YAML",className:a})=>{let c=(0,an.useRef)(null),u=(0,an.useRef)(null),f=(0,an.useRef)(e);f.current=e;let d=(0,an.useRef)(new ca),m=`${(0,an.useId)()}-diag`;(0,an.useEffect)(()=>{let b=c.current;if(!b)return;let p=[Q5(),Pv.of([...CM,...J5]),...r?[g5()]:[],...s?[$M(),q5(Aj)]:[],tR(),Cj,d.current.of([z.editable.of(!o),De.readOnly.of(o)]),z.contentAttributes.of({"aria-label":l,"aria-describedby":m}),z.updateListener.of(v=>{v.docChanged&&f.current(v.state.doc.toString())})],y=new z({state:De.create({doc:t,extensions:p}),parent:b});return u.current=y,()=>{y.destroy(),u.current=null}},[]),(0,an.useEffect)(()=>{let b=u.current;if(!b)return;let p=b.state.doc.toString();p!==t&&b.dispatch({changes:{from:0,to:p.length,insert:t}})},[t]),(0,an.useEffect)(()=>{let b=u.current;b&&b.dispatch(KM(b.state,Oj(n,b.state.doc.length)))},[n]),(0,an.useEffect)(()=>{let b=u.current;b&&b.dispatch({effects:d.current.reconfigure([z.editable.of(!o),De.readOnly.of(o)])})},[o]);let g=(0,an.useMemo)(()=>!n||n.length===0?[]:[...n].sort((b,p)=>{let y=nR[b.severity]-nR[p.severity];return y!==0?y:(b.line??1/0)-(p.line??1/0)}),[n]);return(0,Ki.jsxs)("div",{className:`spytial-ed-code${a?` ${a}`:""}`,children:[i?(0,Ki.jsx)("div",{className:"spytial-ed-code-notice",role:"status",children:"Text has unapplied edits \u2014 fix the error below to update the builder."}):null,(0,Ki.jsx)("div",{ref:c,className:`spytial-ed-code-cm${o?" spytial-ed-code-cm--disabled":""}`}),g.length>0?(0,Ki.jsx)("ul",{className:"spytial-ed-code-diagnostics",id:m,children:g.map((b,p)=>(0,Ki.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${b.severity}`,children:[(0,Ki.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),b.line!==void 0?(0,Ki.jsx)("span",{className:"spytial-ed-code-diagnostic-loc",children:b.column!==void 0?`Ln ${b.line}, Col ${b.column}`:`Ln ${b.line}`}):null,(0,Ki.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:b.message})]},p))}):null]})};var ne=X(Et());var B=X(Ce()),Tj=new Set(["orientation","cyclic","align","groupselector"]),Ux=({constraints:t,directives:e,diagnostics:n,options:i,selectorProps:r,onAddItem:s,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:d=!1,className:h})=>{let[m,g]=(0,ne.useState)(null),b=(0,ne.useCallback)(x=>{g(k=>k===x?null:x)},[]),p=(0,ne.useCallback)(x=>g(null),[]),y=(0,ne.useCallback)((x,k)=>{let C=s(x,k);return C&&typeof C=="object"&&"id"in C&&g(C.id),C},[s]),v=t.length===0&&e.length===0;return(0,B.jsxs)("div",{className:`spytial-ed-builder${h?` ${h}`:""}`,children:[(0,B.jsx)(iR,{title:"Constraints",kind:"constraint",items:t,diagnostics:n,options:i,selectorProps:r,expandedId:m,onToggleExpand:b,onCollapse:p,onAddItem:y,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:d}),(0,B.jsx)(iR,{title:"Directives",kind:"directive",items:e,diagnostics:n,options:i,selectorProps:r,expandedId:m,onToggleExpand:b,onCollapse:p,onAddItem:y,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:d}),v?(0,B.jsx)("p",{className:"spytial-ed-builder-empty",children:"No constraints or directives yet \u2014 add one to start shaping the layout."}):null]})},iR=({title:t,kind:e,items:n,diagnostics:i,options:r,selectorProps:s,expandedId:o,onToggleExpand:l,onCollapse:a,onAddItem:c,onUpdateParam:u,onUpdateComment:f,onToggleNegate:d,onDuplicate:h,onRemove:m,onMove:g,disabled:b})=>{let p=`${t} List`,y=(0,ne.useRef)(new Map),v=(0,ne.useRef)(null),x=(0,ne.useRef)(null),k=(0,ne.useCallback)((w,A)=>{A?y.current.set(w,A):y.current.delete(w)},[]),C=(0,ne.useCallback)(w=>{let A=n.findIndex(I=>I.id===w),O=n[A+1],D=n[A-1];x.current=O?.id??D?.id??"__add__",m(w)},[n,m]);return(0,ne.useEffect)(()=>{let w=x.current;if(w!==null){if(x.current=null,w==="__add__"){v.current?.focus();return}y.current.get(w)?.focus()}},[n]),(0,B.jsxs)("section",{className:"spytial-ed-section","aria-label":t,children:[(0,B.jsxs)("div",{className:"spytial-ed-section-head",children:[(0,B.jsx)("h3",{className:"spytial-ed-section-title",children:t}),(0,B.jsx)(Mj,{kind:e,onAdd:c,disabled:b,triggerRef:v})]}),(0,B.jsx)("ul",{className:"spytial-ed-rows","aria-label":p,children:n.map((w,A)=>(0,B.jsx)(Ej,{item:w,index:A,count:n.length,diagnostics:i,options:r,selectorProps:s,expanded:o===w.id,onToggleExpand:l,onCollapse:a,registerToggle:k,onUpdateParam:u,onUpdateComment:f,onToggleNegate:d,onDuplicate:h,onRemove:C,onMove:g,disabled:b},w.id))})]})},Ej=({item:t,index:e,count:n,diagnostics:i,options:r,selectorProps:s,expanded:o,onToggleExpand:l,onCollapse:a,registerToggle:c,onUpdateParam:u,onUpdateComment:f,onToggleNegate:d,onDuplicate:h,onRemove:m,onMove:g,disabled:b})=>{let p=(0,ne.useId)(),y=`${p}-panel`,v=Ft(t.type),x=(0,ne.useRef)(null),k=t.id;(0,ne.useEffect)(()=>(c(k,x.current),()=>c(k,null)),[k,c]);let C=(0,ne.useMemo)(()=>(i??[]).filter(M=>M.itemId===t.id),[i,t.id]),w=Nj(C),A=(0,ne.useMemo)(()=>C.filter(M=>M.fieldKey===void 0),[C]);if(!v)return(0,B.jsx)("li",{className:"spytial-ed-row spytial-ed-row--unknown",children:(0,B.jsxs)("div",{className:"spytial-ed-row-main",children:[(0,B.jsx)("span",{className:"spytial-ed-row-type",children:t.type}),(0,B.jsx)("span",{className:"spytial-ed-row-summary spytial-ed-row-summary--muted",children:"preserved as written"})]})});let O=(()=>{try{return v.summary(t.params)}catch{return""}})(),D=Tj.has(t.type),I=t.params.hold==="never";return(0,B.jsxs)("li",{className:`spytial-ed-row${o?" spytial-ed-row--expanded":""}${w?` spytial-ed-row--${w}`:""}`,children:[(0,B.jsxs)("div",{className:"spytial-ed-row-main",children:[(0,B.jsxs)("button",{ref:x,type:"button",className:"spytial-ed-row-toggle","aria-expanded":o,"aria-controls":y,disabled:b,onClick:()=>l(t.id),children:[(0,B.jsx)("span",{className:"spytial-ed-row-type",children:v.label}),I?(0,B.jsx)("span",{className:"spytial-ed-row-negated",role:"img","aria-label":"should not hold",title:"should not hold (hold: never)",children:"\xAC"}):null,(0,B.jsx)("span",{className:"spytial-ed-row-summary",children:O}),w?(0,B.jsx)("span",{className:`spytial-ed-row-dot spytial-ed-row-dot--${w}`,role:"img","aria-label":`${w}: ${C.length} issue${C.length===1?"":"s"}`}):null]}),(0,B.jsx)(Dj,{item:t,index:e,count:n,disabled:b,onDuplicate:h,onRemove:m,onMove:g,onAddComment:()=>l(t.id)})]}),o?(0,B.jsxs)("div",{className:"spytial-ed-row-panel",id:y,onKeyDown:M=>{M.key==="Escape"&&(M.stopPropagation(),a(t.id),x.current?.focus())},children:[A.length>0?(0,B.jsx)("ul",{className:"spytial-ed-diagnostics spytial-ed-diagnostics--item",children:A.map((M,$)=>(0,B.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${M.severity}`,children:[(0,B.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,B.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:M.message})]},$))}):null,(0,B.jsx)(fp,{fields:Rj(v.fields),values:t.params,diagnostics:C,options:r,disabled:b,onChange:(M,$)=>u(t.id,M,$),selectorProps:s?M=>s(t,M):void 0}),D?(0,B.jsxs)("div",{className:"spytial-ed-field spytial-ed-field--hold",children:[(0,B.jsx)("span",{className:"spytial-ed-field-label",id:`${p}-hold-label`,title:"Whether this constraint must hold, or must NOT hold (hold: never), in the layout.",children:"Condition"}),(0,B.jsx)("div",{className:"spytial-ed-field-control",children:(0,B.jsxs)("div",{className:"spytial-ed-pills",role:"radiogroup","aria-labelledby":`${p}-hold-label`,children:[(0,B.jsx)("button",{type:"button",role:"radio","aria-checked":!I,className:`spytial-ed-pill${I?"":" spytial-ed-pill--active"}`,disabled:b,onClick:()=>d(t.id,!1),children:"Should hold"}),(0,B.jsx)("button",{type:"button",role:"radio","aria-checked":I,className:`spytial-ed-pill${I?" spytial-ed-pill--active spytial-ed-pill--negated":""}`,disabled:b,onClick:()=>d(t.id,!0),children:"Should not hold"})]})})]}):null,(0,B.jsxs)("div",{className:"spytial-ed-field spytial-ed-field--text",children:[(0,B.jsx)("label",{className:"spytial-ed-field-label",htmlFor:`${p}-comment`,children:"Comment"}),(0,B.jsx)("div",{className:"spytial-ed-field-control",children:(0,B.jsx)("input",{id:`${p}-comment`,type:"text",className:"spytial-ed-input",value:t.comment??"",placeholder:"Optional note (round-trips as a YAML comment)",disabled:b,onChange:M=>f(t.id,M.target.value)})})]})]}):null]})},Dj=({item:t,index:e,count:n,disabled:i,onDuplicate:r,onRemove:s,onMove:o,onAddComment:l})=>{let[a,c]=(0,ne.useState)(!1),u=(0,ne.useRef)(null),f=(0,ne.useRef)(null),d=po(a,f,{align:"end",estimatedHeight:220}),h=Ft(t.type)?.label??t.type;(0,ne.useEffect)(()=>{if(!a)return;let b=p=>{u.current&&!u.current.contains(p.target)&&c(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a]);let m=(0,ne.useCallback)(()=>c(!1),[]),g=(0,ne.useCallback)(b=>{b(),m()},[m]);return(0,B.jsxs)("div",{className:"spytial-ed-overflow",ref:u,children:[(0,B.jsx)("button",{ref:f,type:"button",className:"spytial-ed-overflow-btn","aria-haspopup":"menu","aria-expanded":a,"aria-label":`Actions for ${h}`,disabled:i,onClick:()=>c(b=>!b),children:(0,B.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})}),a?(0,B.jsxs)("ul",{className:"spytial-ed-overflow-menu",style:d,role:"menu","aria-label":`Actions for ${h}`,onKeyDown:b=>{b.key==="Escape"&&(b.stopPropagation(),m())},children:[(0,B.jsx)("li",{role:"none",children:(0,B.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",onClick:()=>g(l),children:"Add comment"})}),(0,B.jsx)("li",{role:"none",children:(0,B.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",onClick:()=>g(()=>r(t.id)),children:"Duplicate"})}),(0,B.jsx)("li",{role:"none",children:(0,B.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",disabled:e===0,onClick:()=>g(()=>o(t.id,-1)),children:"Move up"})}),(0,B.jsx)("li",{role:"none",children:(0,B.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",disabled:e>=n-1,onClick:()=>g(()=>o(t.id,1)),children:"Move down"})}),(0,B.jsx)("li",{role:"none",children:(0,B.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item spytial-ed-overflow-item--danger","aria-label":`Remove ${h} ${t.kind}`,onClick:()=>g(()=>s(t.id)),children:"Delete"})})]}):null]})},Mj=({kind:t,onAdd:e,disabled:n,triggerRef:i})=>{let[r,s]=(0,ne.useState)(!1),[o,l]=(0,ne.useState)(""),a=(0,ne.useRef)(null),c=(0,ne.useRef)(null),u=(0,ne.useRef)(null),f=(0,ne.useCallback)(y=>{u.current=y,typeof i=="function"?i(y):i&&typeof i=="object"&&(i.current=y)},[i]),d=po(r,u,{align:"end",estimatedHeight:320}),h=(0,ne.useMemo)(()=>tb(t),[t]),m=(0,ne.useMemo)(()=>{let y=o.trim().toLowerCase();return y?h.filter(v=>v.label.toLowerCase().includes(y)||v.type.toLowerCase().includes(y)||(v.description??"").toLowerCase().includes(y)):h},[h,o]);(0,ne.useEffect)(()=>{if(!r)return;requestAnimationFrame(()=>c.current?.focus());let y=v=>{a.current&&!a.current.contains(v.target)&&s(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[r]);let g=(0,ne.useCallback)(()=>{s(!1),l("")},[]),b=(0,ne.useCallback)(y=>{e(t,y),g()},[e,t,g]),p=t==="constraint"?"Add constraint":"Add directive";return(0,B.jsxs)("div",{className:"spytial-ed-add",ref:a,children:[(0,B.jsxs)("button",{ref:f,type:"button",className:"spytial-ed-add-btn","aria-haspopup":"menu","aria-expanded":r,disabled:n,onClick:()=>s(y=>!y),children:["+ ",p]}),r?(0,B.jsxs)("div",{className:"spytial-ed-add-menu",style:d,role:"menu","aria-label":p,onKeyDown:y=>{y.key==="Escape"&&(y.preventDefault(),g())},children:[(0,B.jsx)("input",{ref:c,type:"text",className:"spytial-ed-add-search",value:o,placeholder:"Search types\u2026","aria-label":`Search ${t} types`,onChange:y=>l(y.target.value)}),(0,B.jsx)("ul",{className:"spytial-ed-add-list",children:m.length===0?(0,B.jsx)("li",{className:"spytial-ed-add-empty",children:"No matching types."}):m.map(y=>(0,B.jsx)("li",{role:"none",children:(0,B.jsxs)("button",{type:"button",role:"menuitem",className:"spytial-ed-add-item",onClick:()=>b(y.type),children:[(0,B.jsx)("span",{className:"spytial-ed-add-item-label",children:y.label}),y.description?(0,B.jsx)("span",{className:"spytial-ed-add-item-desc",children:y.description}):null]})},y.type))})]}):null]})};function Rj(t){return t.filter(e=>e.key!=="hold")}function Nj(t){if(t.length!==0)return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"}var At=X(Ce()),Fx=({result:t,onDismiss:e})=>{let n=t.suggestions??[],i=t.notes??[];return(0,At.jsxs)("div",{className:"spytial-ed-suggestions",role:"region","aria-label":"Layout suggestions",children:[(0,At.jsxs)("div",{className:"spytial-ed-suggestions-head",children:[(0,At.jsx)("span",{className:"spytial-ed-suggestions-title",children:n.length>0?`${n.length} suggestion${n.length===1?"":"s"}`:"Suggestion applied"}),(0,At.jsx)("button",{type:"button",className:"spytial-ed-suggestions-dismiss","aria-label":"Dismiss suggestions",title:"Dismiss",onClick:e,children:(0,At.jsx)("span",{"aria-hidden":"true",children:"\xD7"})})]}),n.length>0?(0,At.jsx)("ul",{className:"spytial-ed-suggestions-list",children:n.map(r=>(0,At.jsx)(Lj,{suggestion:r},r.id))}):null,i.length>0?(0,At.jsx)("ul",{className:"spytial-ed-suggestions-notes",children:i.map((r,s)=>(0,At.jsx)("li",{children:r},s))}):null]})},Lj=({suggestion:t})=>{let{id:e,rationale:n,confidence:i,outcome:r}=t;return(0,At.jsxs)("li",{className:`spytial-ed-suggestion${r==="omitted"?" spytial-ed-suggestion--omitted":""}`,children:[(0,At.jsxs)("div",{className:"spytial-ed-suggestion-head",children:[(0,At.jsx)("span",{className:"spytial-ed-suggestion-text",children:n||e}),i?(0,At.jsx)("span",{className:`spytial-ed-suggestion-chip spytial-ed-suggestion-chip--${i}`,title:`${i} confidence`,children:i}):null,r?(0,At.jsx)("span",{className:`spytial-ed-suggestion-chip spytial-ed-suggestion-chip--${r}`,title:`Outcome: ${r}`,children:r}):null]}),n?(0,At.jsx)("code",{className:"spytial-ed-suggestion-id",children:e}):null]})};var V=X(Et());var Je=X(Ce()),Ij=300,_j=400,Vx=({value:t,onChange:e,instance:n,domain:i,theme:r,selectorAssistant:s,layoutAssistant:o,density:l="compact",syntaxHighlighting:a=!0,defaultView:c="builder",view:u,onViewChange:f,className:d,disabled:h=!1,"aria-label":m="Layout specification editor",onDiagnostics:g})=>{let b=(0,V.useRef)(null);b.current===null&&(b.current=Bj(t));let p=b.current.doc,[,y]=(0,V.useReducer)(P=>P+1,0),v=(0,V.useRef)(t),x=(0,V.useRef)(0),[k,C]=(0,V.useState)(c),w=u??k,A=(0,V.useRef)(null),O=(0,V.useRef)(null),D=(0,V.useRef)(()=>{}),I=(0,V.useCallback)(P=>{D.current(),u===void 0&&C(P),f?.(P)},[u,f]),[M,$]=(0,V.useState)(()=>b.current?.error??null),U=(0,V.useMemo)(()=>{if(i)return i;if(n)return t1(n)},[i,n]),he=(0,V.useMemo)(()=>i1(U),[U]),Fe=(0,V.useMemo)(()=>U?.relations.map(P=>P.name)??[],[U]),ft=(0,V.useMemo)(()=>U?.types.map(P=>P.name)??[],[U]),fe=(0,V.useCallback)(()=>{let P=p.toYaml();v.current=P,x.current+=1,$(null),e(P)},[p,e]),[Qe,cn]=(0,V.useState)([]),Ct=(0,V.useRef)(0),Ve=(0,V.useRef)(null),bt=(0,V.useMemo)(()=>p.validate(U),[p,U,t]),vt=(0,V.useMemo)(()=>[...bt,...Qe],[bt,Qe]),un=(0,V.useRef)("");(0,V.useEffect)(()=>{if(!g)return;let P=qj(vt);P!==un.current&&(un.current=P,g(vt))},[vt,g]),(0,V.useEffect)(()=>{if(t===v.current)return;let P;try{P=p.toYaml()}catch{P=""}if(t===P){v.current=t;return}try{p.replaceFromYaml(t),v.current=t,x.current+=1,$(null),y()}catch(Te){$($x(Te))}},[t,p]),(0,V.useEffect)(()=>p.subscribe(()=>y()),[p]);let fn=(0,V.useCallback)(()=>{A.current&&(clearTimeout(A.current),A.current=null);let P=O.current;if(O.current=null,!!P&&x.current===P.seq)try{p.replaceFromYaml(P.text),$(null),y()}catch(Te){$($x(Te))}},[p]);D.current=fn;let Zn=(0,V.useCallback)(P=>{h||(v.current=P,e(P),A.current&&clearTimeout(A.current),O.current={text:P,seq:x.current},A.current=setTimeout(fn,Ij))},[h,e,fn]);(0,V.useEffect)(()=>()=>{Ka.current=!1,A.current&&clearTimeout(A.current),Ve.current&&clearTimeout(Ve.current)},[]);let[Jn,jo]=(0,V.useState)({running:!1,result:null,error:null}),Yo=(0,V.useRef)(0),Ka=(0,V.useRef)(!0),lg=(0,V.useCallback)(()=>{let P=o?.suggest;if(!P||h)return;D.current();let Te=++Yo.current;jo({running:!0,result:null,error:null});let Ot={domain:U,instance:n,currentYaml:t};Promise.resolve().then(()=>P(Ot)).then(Dn=>{Te!==Yo.current||!Ka.current||(p.replaceFromYaml(Dn.yaml),fe(),jo({running:!1,result:Dn,error:null}))}).catch(Dn=>{Te!==Yo.current||!Ka.current||jo({running:!1,result:null,error:Dn instanceof Error?Dn.message:String(Dn)})})},[o,h,U,n,t,p,fe]),Ko=(0,V.useCallback)(()=>{Yo.current+=1,jo({running:!1,result:null,error:null})},[]),Ff=(0,V.useCallback)((P,Te)=>{if(h)return;let Ot=p.addItem(P,Te);return fe(),Ot},[h,p,fe]),ag=(0,V.useCallback)((P,Te,Ot)=>{if(h)return;let Dn=Ot===""?void 0:Ot;p.updateItem(P,{params:{[Te]:Dn}}),fe()},[h,p,fe]),cg=(0,V.useCallback)((P,Te)=>{h||(p.updateItem(P,{comment:Te}),fe())},[h,p,fe]),ug=(0,V.useCallback)((P,Te)=>{h||(p.updateItem(P,{params:{hold:Te?"never":void 0}}),fe())},[h,p,fe]),fg=(0,V.useCallback)(P=>{h||!p.duplicateItem(P)||fe()},[h,p,fe]),F=(0,V.useCallback)(P=>{h||(p.removeItem(P),fe())},[h,p,fe]),re=(0,V.useCallback)((P,Te)=>{if(h)return;let Ot=p.getState(),_r=(Ot.constraints.some(Tt=>Tt.id===P)?Ot.constraints:Ot.directives).findIndex(Tt=>Tt.id===P);_r!==-1&&(p.moveItem(P,_r+Te),fe())},[h,p,fe]),Wi=(0,V.useCallback)(()=>{h||!p.canUndo()||(p.undo(),fe())},[h,p,fe]),Ir=(0,V.useCallback)(()=>{h||!p.canRedo()||(p.redo(),fe())},[h,p,fe]),Go=(0,V.useCallback)(P=>{!(P.metaKey||P.ctrlKey)||P.key.toLowerCase()!=="z"||(P.preventDefault(),P.shiftKey?Ir():Wi())},[Wi,Ir]),Us=(0,V.useCallback)((P,Te)=>{if(Te.kind!=="selector")return;let Ot={itemKind:P.kind,itemType:P.type,fieldKey:Te.key,domain:U,specYaml:v.current},_r={complete:Tt=>{let Zi=he(Tt),Ji=s?.complete;if(!Ji)return Zi;let Ga={...Ot,currentValue:String(P.params[Te.key]??"")},$f;try{$f=Ji(Ga,Tt)??[]}catch{return Zi}return Promise.resolve($f).then(dg=>r1(dg??[],Zi)).catch(()=>Zi)},highlight:a};if(s?.synthesize){let Tt=s.synthesize;_r.synthesize=Zi=>{let Ji={...Ot,currentValue:String(P.params[Te.key]??"")};return Tt(Ji,Zi)}}return _r},[U,he,s,a]);(0,V.useEffect)(()=>{let P=s?.review;if(!P){cn([]);return}Ve.current&&clearTimeout(Ve.current);let Te=++Ct.current;Ve.current=setTimeout(()=>{let Ot=p.getState(),Dn=[...Ot.constraints,...Ot.directives],_r=[];for(let Tt of Dn){let Zi=Ft(Tt.type);if(Zi)for(let Ji of Zi.fields){if(Ji.kind!=="selector")continue;let Ga=String(Tt.params[Ji.key]??"");if(Ga.trim()==="")continue;let $f={itemKind:Tt.kind,itemType:Tt.type,fieldKey:Ji.key,currentValue:Ga,domain:U,specYaml:v.current};_r.push(Promise.resolve().then(()=>P($f,Ga)).then(dg=>(dg??[]).map(b_=>({...b_,itemId:Tt.id,fieldKey:Ji.key,source:"assistant"}))).catch(()=>[]))}}Promise.all(_r).then(Tt=>{Te===Ct.current&&cn(Tt.flat())}).catch(()=>{Te===Ct.current&&cn([])})},_j)},[s,U,t,p]);let wi=p.getState(),XS=M!==null,g_=["spytial-ed",l==="compact"?"spytial-ed--compact":"",d??""].filter(Boolean).join(" "),y_=(0,V.useMemo)(()=>e1(t,U),[t,U]),WS=o1(r);return(0,Je.jsxs)("section",{className:g_,style:WS?s1(WS):void 0,"aria-label":m,onKeyDown:Go,children:[(0,Je.jsxs)("div",{className:"spytial-ed-toolbar",children:[(0,Je.jsxs)("div",{className:"spytial-ed-viewtoggle",role:"tablist","aria-label":"Editor view",children:[(0,Je.jsxs)("button",{type:"button",role:"tab","aria-selected":w==="builder",className:`spytial-ed-viewtoggle-btn${w==="builder"?" spytial-ed-viewtoggle-btn--active":""}`,disabled:h,onClick:()=>I("builder"),children:["Builder",XS?(0,Je.jsx)("span",{className:"spytial-ed-diagnostic-badge spytial-ed-diagnostic-badge--warning",title:"Text has unapplied edits","aria-label":"Text has unapplied edits",children:"!"}):null]}),(0,Je.jsx)("button",{type:"button",role:"tab","aria-selected":w==="code",className:`spytial-ed-viewtoggle-btn${w==="code"?" spytial-ed-viewtoggle-btn--active":""}`,disabled:h,onClick:()=>I("code"),children:"Code"})]}),(0,Je.jsxs)("div",{className:"spytial-ed-toolbar-actions",children:[o?.suggest?(0,Je.jsxs)("button",{type:"button",className:"spytial-ed-suggest-btn",title:"Suggest a layout for the current data",disabled:h||Jn.running,"aria-busy":Jn.running,onClick:lg,children:[(0,Je.jsx)("span",{"aria-hidden":"true",children:"\u2726"}),Jn.running?"Analyzing\u2026":"Suggest"]}):null,(0,Je.jsxs)("div",{className:"spytial-ed-history",children:[(0,Je.jsx)("button",{type:"button",className:"spytial-ed-history-btn","aria-label":"Undo",title:"Undo (Cmd/Ctrl+Z)",disabled:h||!p.canUndo(),onClick:Wi,children:(0,Je.jsx)("span",{"aria-hidden":"true",children:"\u21B6"})}),(0,Je.jsx)("button",{type:"button",className:"spytial-ed-history-btn","aria-label":"Redo",title:"Redo (Shift+Cmd/Ctrl+Z)",disabled:h||!p.canRedo(),onClick:Ir,children:(0,Je.jsx)("span",{"aria-hidden":"true",children:"\u21B7"})})]})]})]}),Jn.error!==null?(0,Je.jsx)("p",{className:"spytial-ed-suggest-error",role:"alert",children:Jn.error}):null,Jn.result!==null?(0,Je.jsx)(Fx,{result:Jn.result,onDismiss:Ko}):null,(0,Je.jsx)("div",{className:"spytial-ed-body",children:w==="builder"?(0,Je.jsx)(Ux,{constraints:wi.constraints,directives:wi.directives,diagnostics:vt,options:{relationNames:Fe,typeNames:ft},selectorProps:Us,onAddItem:Ff,onUpdateParam:ag,onUpdateComment:cg,onToggleNegate:ug,onDuplicate:fg,onRemove:F,onMove:re,disabled:h}):(0,Je.jsx)(Hx,{value:t,onChange:Zn,diagnostics:y_,hasUnappliedEdits:XS,syntaxHighlighting:a,disabled:h})})]})};function Bj(t){try{return{doc:Kl.fromYaml(t),error:null}}catch(e){return{doc:new Kl,error:$x(e)}}}function $x(t){return t instanceof ds?{severity:"error",message:t.message,source:"yaml",...t.line!==void 0?{line:t.line}:{},...t.column!==void 0?{column:t.column}:{}}:{severity:"error",message:t instanceof Error?t.message:String(t),source:"yaml"}}function qj(t){return t.map(e=>`${e.severity}|${e.source}|${e.itemId??""}|${e.fieldKey??""}|${e.line??""}|${e.column??""}|${e.message}`).join(`
|
|
199
|
+
`)}function rR(t){return{id:t.id,type:t.type,params:{...t.params},...t.comment!==void 0?{comment:t.comment}:{}}}function yf(t){let e=hs(t);return{constraints:e.constraints.map(n=>rR(n)),directives:e.directives.map(n=>rR(n))}}function sR(t,e){let n={id:t.id||ii(),kind:e,type:t.type,params:{...t.params??{}}};return t.comment!==void 0&&(n.comment=t.comment),eb(t.type)||(n.raw={[t.type]:{...t.params??{}}}),n}function jx(t,e){let n={constraints:(t??[]).map(i=>sR(i,"constraint")),directives:(e??[]).map(i=>sR(i,"directive"))};return lu(n)}var Xpe=vh("constraint"),Wpe=[...vh("directive"),"size","hideAtom"];var lR=X(Ce()),oR=({yamlValue:t,value:e,onChange:n,isNoCodeView:i,onViewChange:r,constraints:s,setConstraints:o,directives:l,setDirectives:a,instance:c,domain:u,theme:f,selectorAssistant:d,layoutAssistant:h,density:m,syntaxHighlighting:g,onDiagnostics:b,className:p,disabled:y=!1,"aria-label":v="CND Layout Specification Interface"})=>{let x=e??t??"",k=i===void 0?void 0:i?"builder":"code",C=(0,bf.useCallback)(O=>{r?.(O==="builder")},[r]),w=(0,bf.useCallback)(O=>{if(n(O),o||a)try{let D=yf(O);o?.(()=>D.constraints),a?.(()=>D.directives)}catch{}},[n,o,a]),A=(0,bf.useMemo)(()=>{let O={value:x,onChange:w,defaultView:"builder",disabled:y,"aria-label":v};return k!==void 0&&(O.view=k,O.onViewChange=C),c!==void 0&&(O.instance=c),u!==void 0&&(O.domain=u),f!==void 0&&(O.theme=f),d!==void 0&&(O.selectorAssistant=d),h!==void 0&&(O.layoutAssistant=h),m!==void 0&&(O.density=m),g!==void 0&&(O.syntaxHighlighting=g),b!==void 0&&(O.onDiagnostics=b),p!==void 0&&(O.className=p),O},[x,w,k,C,c,u,f,d,h,m,g,b,p,y,v]);return(0,lR.jsx)(Vx,{...A})};var Dm=class{constructor(){this.eventListeners=new Map}addEventListener(e,n){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(n)}removeEventListener(e,n){this.eventListeners.get(e)?.delete(n)}emitEvent(e){let n=this.eventListeners.get(e.type);if(n)for(let i of n)try{i(e)}catch(r){console.error("Error in data instance event listener:",r)}}};function aR(t,e,n){let i=t.atoms.length,r=Array.isArray(e?.types)?e.types:[],o=(e?.tuples?.length??0)>0&&r.length!==i;if(!o&&r.length===i)return{tuple:{...t,types:[...r]},relationTypes:[...r]};let l=Array.isArray(t.types)?t.types:[],a=t.atoms.map((c,u)=>n(c)??l[u]??"untyped");return{tuple:{...t,types:a},relationTypes:o?[]:a}}function Mm(t){return t.tuples}function cR(t){return t.atoms}function Ns(t){return t.meta!==void 0&&t.meta.builtin===!0}function Ls(t,e){let n=qo(t).find(i=>i.id===e);if(!n)throw new Error(`Could not find atom with id ${e}`);return n}function qo(t){return Rm(t).map(cR).reduce((e,n)=>e.concat(n),[])}function uR(t,e){let n=Ls(t,e),i={...t.types},r={...t.relations},s={...t.skolems},o=t.types[n.type];if(o){let l=o.atoms.filter(a=>a.id!==e);l.length===0?delete i[o.id]:i[n.type]={...o,atoms:l};for(let[a,c]of Object.entries(t.relations)){let u=c.tuples.filter(f=>!f.atoms.includes(e));r[a]={...c,tuples:u}}for(let[a,c]of Object.entries(t.skolems)){let u=c.tuples.filter(f=>!f.atoms.includes(e));s[a]={...c,tuples:u}}return{types:i,relations:r,skolems:s}}else throw new Error(`Could not find type for atom ${e}`)}function fR(t,e){let n={...t.types},i=n[e.type];if(i)n[e.type]={...i,atoms:[...i.atoms,e]};else{let r={_:"type",id:e.type,types:[e.type,"univ"],atoms:[e]};n[r.id]=r}return{...t,types:n}}function dR(t,e,n){let i=t.relations[e];if(!i)throw new Error(`Could not find relation ID ${e}`);let r={...t.relations},s={...t.skolems},o=(a,c)=>a.atoms.length===c.atoms.length&&a.atoms.every((u,f)=>u===c.atoms[f]),l=i.tuples.filter(a=>!o(a,n));r[i.id]={...i,tuples:l};for(let[a,c]of Object.entries(t.skolems)){let u=c.tuples.filter(f=>!o(f,n));u.length===0?delete s[a]:s[a]={...c,tuples:u}}return{...t,relations:r,skolems:s}}function hR(t,e,n){let i=t.relations[e],r={...t.relations},s={...t.skolems};return i?r[i.id]={...i,tuples:[...i.tuples,n]}:r[e]={id:e,name:e,tuples:[n],types:n.types,_:"relation"},{...t,relations:r,skolems:s}}function Ia(t){return Object.values(t.relations)}function vf(t,e){let n=[];for(let i of Object.values(t.skolems))for(let r of i.tuples)if(r.atoms.includes(e)){n.push(i.name);break}return n}function Yx(t,e){let n=t.types[e];if(!n)throw new Error(`Could not find type with id ${e}`);return n}function Rm(t){return Object.values(t.types)}function pR(t,e){return typeof e=="string"&&(e=Ls(t,e)),Kx(t,e).types.map(r=>Yx(t,r)).some(Ns)}function Kx(t,e){if(typeof e=="string"&&(e=Ls(t,e)),!t.types[e.type])throw new Error(`The atom's type is not part of the instance: ${e.type}`);return t.types[e.type]}function Po(t){return t.id}function Gx(t,e){let n=t.id,i=e.atoms;return`${n}:${i.join("->")}`}var c_=X(a_());function kse(t,e){return e<2?[0,0]:[0,e-1]}function u_(t,e,n){let i=new c_.Graph({directed:!0,multigraph:!0}),{nodeIds:r,edgeIds:s}=Ase(t,e,n);return qo(t).forEach(o=>{let l=Po(o);r.has(l)&&i.setNode(l,l)}),Ia(t).forEach(o=>{Mm(o).forEach(a=>{let c=Gx(o,a),u=a.atoms,[f,d]=kse(o.id,u.length),h=f?u[f]:u[0],m=d?u[d]:u[u.length-1];if(h&&m&&s.has(c)){let g=u.slice(1,-1).join(","),b=g.length>0?`[${g}]`:"",p=o.name+b,y=Po(Ls(t,h)),v=Po(Ls(t,m));i.setEdge(y,v,p,c)}})}),i}function Ase(t,e,n){let i=new Set,r=new Set;return Ia(t).forEach(s=>{Mm(s).forEach(o=>{let l=o.atoms.map(u=>Ls(t,u)),[a,c]=Cse(s,l);a&&c&&(i.add(Po(a)),i.add(Po(c)),r.add(Gx(s,o)))})}),qo(t).forEach(s=>{let o=Po(s);i.has(o)||e||(!pR(t,s)||!n)&&i.add(o)}),{nodeIds:i,edgeIds:r}}function Cse(t,e){let n=e[0],i=e[e.length-1];return[n,i]}var rg=class extends Dm{constructor(e){super(),this.alloyInstance=e,this.declaredTypeIds=new Set(Object.keys(e.types)),this.declaredRelationNames=new Set(Object.values(e.relations).map(n=>n.name))}isValidForgeIdentifier(e){return/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)}sanitizeForgeIdentifier(e,n){let i=e.replace(/[^A-Za-z0-9_$]/g,"_");i||(i="_"),/^[A-Za-z_$]/.test(i)||(i=`_${i}`);let r=i,s=1;for(;n.has(r);)r=`${i}_${s}`,s++;return n.add(r),r}getAtomType(e){let n=Kx(this.alloyInstance,e);return{id:n.id,types:n.types,atoms:n.atoms.map(i=>{let r=vf(this.alloyInstance,i.id);return{id:i.id,label:i.id,type:i.type,labels:r.length>0?{skolems:r}:void 0}}),isBuiltin:Ns(n)}}getTypes(){return Rm(this.alloyInstance).map(n=>({id:n.id,types:n.types,atoms:n.atoms.map(i=>{let r=vf(this.alloyInstance,i.id);return{id:i.id,type:i.type,label:i.id,labels:r.length>0?{skolems:r}:void 0}}),isBuiltin:Ns(n)}))}getAtoms(){return qo(this.alloyInstance).map(n=>{let i=vf(this.alloyInstance,n.id);return{id:n.id,type:n.type,label:n.id,labels:i.length>0?{skolems:i}:void 0}})}getRelations(){return Ia(this.alloyInstance).map(n=>({id:n.id,name:n.name,types:n.types,tuples:n.tuples.map(i=>({atoms:i.atoms,types:i.types}))}))}generateGraph(e,n){return u_(this.alloyInstance,e,n)}getAlloyInstance(){return this.alloyInstance}reify(){let e="",i="inst builtinstance {",r="}",s=this.alloyInstance.types,o=new Set,l=new Map,a=[],c=[],u=new Set,f=new Set,d=new Set,h=p=>{let y=l.get(p);if(y)return y;let v=this.sanitizeForgeIdentifier(p,o);return l.set(p,v),v!==p&&a.push(`${p} -> ${v}`),v},m={};for(let p in s){let y=s[p];if(Ns(y))continue;if(!this.declaredTypeIds.has(p)){y.atoms.length>0&&c.push(p);continue}let v=y.atoms;m[p]=v.map(x=>(d.add(x.id),`\`${h(x.id)}`))}let g=this.alloyInstance.relations,b={};for(let p in g){let y=g[p];if(!this.declaredRelationNames.has(y.name)||!this.isValidForgeIdentifier(y.name)){y.tuples.length>0&&u.add(y.name);continue}let x=y.tuples.filter(C=>{let w=C.atoms.every((A,O)=>{let D=s[C.types[O]];return D&&Ns(D)||d.has(A)});return w||f.add(y.name),w}).map(C=>`(${C.atoms.map((A,O)=>{let D=s[C.types[O]];return D&&Ns(D)?A:`\`${h(A)}`}).join("->")})`),k=y.name;b[k]=(b[k]??[]).concat(x)}for(let p in m){let y=m[p];y.length>0&&(e+=`${p} = ${y.join("+")}
|
|
200
|
+
`)}for(let p in b){let y=b[p];y.length>0?e+=`${p} = ${y.join("+")}
|
|
201
|
+
`:e+=`no ${p}
|
|
202
202
|
`}return c.length>0&&console.warn(`AlloyDataInstance.reify: dropped ${c.length} sig(s) not declared in the parsed spec (${c.join(", ")}); their atoms were omitted from the inst.`),u.size>0&&console.warn(`AlloyDataInstance.reify: dropped ${u.size} field(s) not declared in the parsed spec or not a valid Forge identifier (${[...u].join(", ")}); their tuples were omitted from the inst.`),f.size>0&&console.warn(`AlloyDataInstance.reify: dropped tuple(s) from declared field(s) (${[...f].join(", ")}) that referenced unbound atoms (atoms of a dropped/undeclared sig); they were omitted to avoid a dangling reference.`),a.length>0&&console.warn(`AlloyDataInstance.reify: rewrote ${a.length} atom id(s) to valid Forge identifiers (${a.join(", ")}).`),`${i}
|
|
203
203
|
${e}
|
|
204
|
-
${r}`}removeAtom(e){this.alloyInstance=uR(this.alloyInstance,e),this.emitEvent({type:"atomRemoved",data:{atomId:e}})}addAtom(e){let n={_:"atom",id:e.id,type:e.type};this.alloyInstance=fR(this.alloyInstance,n),this.emitEvent({type:"atomAdded",data:{atom:e}})}addRelationTuple(e,n){let i=this.getAtoms(),r=this.getRelations().find(l=>l.id===e),s=aR(n,r,l=>i.find(a=>a.id===l)?.type),o={_:"tuple",atoms:s.tuple.atoms,types:s.tuple.types};this.alloyInstance=hR(this.alloyInstance,e,o),this.emitEvent({type:"relationTupleAdded",data:{relationId:e,tuple:s.tuple}})}removeRelationTuple(e,n){let i={_:"tuple",atoms:n.atoms,types:n.types};this.alloyInstance=dR(this.alloyInstance,e,i),this.emitEvent({type:"relationTupleRemoved",data:{relationId:e,tuple:n}})}addFromDataInstance(e,n){if(!Ose(e))return!1;let i=e.getAlloyInstance(),r=new Map;return qo(i).forEach(s=>{let o=this.getAtomType(s.id).isBuiltin;if(n&&o){let a=this.getAtoms().find(c=>c.type===s.type&&c.label===s.id);if(a){r.set(s.id,a.id);return}}let l=`atom_${this.getAtoms().length+1}`;r.set(s.id,l),this.addAtom({id:l,type:s.type,label:s.id})}),Ia(i).forEach(s=>{s.tuples.forEach(o=>{let l={atoms:o.atoms.map(a=>r.get(a)||a),types:o.types};this.addRelationTuple(s.id,l)})}),Rm(i).forEach(s=>{this.getTypes().find(l=>l.id===s.id)||(this.alloyInstance.types[s.id]={_:"type",id:s.id,types:s.types,atoms:s.atoms.map(l=>({_:"atom",id:r.get(l.id)||l.id,type:l.type})),meta:{builtin:!1,abstract:!1,enum:!1,one:!1,private:!1}})}),!0}};function Ose(t){return t instanceof rg}function f_(){let e={types:{univ:{_:"type",id:"univ",types:[],atoms:[],meta:{builtin:!0,abstract:!1,enum:!1,one:!1,private:!1}},Int:{_:"type",id:"Int",types:["Int","univ"],atoms:[],meta:{builtin:!0,abstract:!1,enum:!1,one:!1,private:!1}},"seq/Int":{_:"type",id:"seq/Int",types:["seq/Int","univ"],atoms:[],meta:{builtin:!0,abstract:!1,enum:!1,one:!1,private:!1}}},relations:{},skolems:{}};return new rg(e)}var Ps=X(Tt());var Y=X(Ce()),FS=({systemError:t,graphElementId:e})=>{let[n,i]=(0,Ps.useState)({ids:[],source:null}),[r,s]=(0,Ps.useState)(!1),o=w=>{if(!e)return;let k=document.getElementById(e);if(!k||typeof k.highlightNodes!="function")return;let C=Array.from(w.querySelectorAll("[data-node-id]")).map(O=>O.getAttribute("data-node-id")).filter(O=>!!O);C.length>0&&k.highlightNodes(Array.from(new Set(C)))},l=()=>{if(!e)return;let w=document.getElementById(e);w&&typeof w.clearNodeHighlights=="function"&&w.clearNodeHighlights()},a=(w,k)=>{if(k.length===0)return;let O=w.closest(".constraint-columns")?.querySelector(`[data-constraint-id="${k[0]}"]`);O&&typeof O.scrollIntoView=="function"&&O.scrollIntoView({block:"nearest"})},c=(w,k,C)=>{i({ids:[k.id,...k.relatedIds],source:C}),o(w.currentTarget),a(w.currentTarget,k.relatedIds)},u=()=>{i({ids:[],source:null}),l()},f=w=>n.ids.includes(w)?n.source==="source"?"highlight-source":"highlight-diagram":"",d=t&&(t.type==="parse-error"||t.type==="general-error"||t.type==="group-overlap-error"),h=t&&(t.type==="positional-error"||t.type==="hidden-node-conflict")&&t.messages,p=t&&t.type==="hidden-node-conflict",g=t&&t.type==="selector-error"&&t.errors?.length>0;if(!d&&!h&&!g)return console.error("Cannot display the following error:",t),null;let b=(0,Ps.useMemo)(()=>{let w=t.type;return w==="parse-error"?`Parse Error ${t.source?`(${t.source})`:""}`:w==="group-overlap-error"?`Group Overlap Error ${t.source?`(${t.source})`:""}`:w==="selector-error"?`Selector Error${t.errors.length>1?"s":""} (${t.errors.length})`:"Error"},[t]),m=(0,Ps.useMemo)(()=>{let w=h?t.messages:void 0;if(!w)return{sourceConstraints:[],diagramConstraints:[]};function k(D){let F=new Map;return D.minimalConflictingConstraints.forEach((V,ae)=>{F.has(ae)||F.set(ae,new Set),V.forEach($e=>F.get(ae).add($e))}),F.has(D.conflictingSourceConstraint)?F.get(D.conflictingSourceConstraint).add(D.conflictingConstraint):F.set(D.conflictingSourceConstraint,new Set([D.conflictingConstraint])),F}let C=k(w),O=[],M=[],_=new Map;return[...C.values()].forEach((D,F)=>{[...D.values()].map((V,ae)=>{let $e=`diagram-${F}-${ae}`;_.set(V,$e),M.push({id:$e,content:V,relatedIds:[]})})}),[...C.entries()].forEach(([D,F],V)=>{let ae=`source-${V}`,$e=[...F.values()].map(Xt=>_.get(Xt));O.push({id:ae,content:D,relatedIds:$e}),$e.forEach(Xt=>{let he=M.find(et=>et.id===Xt);he&&he.relatedIds.push(ae)})}),{sourceConstraints:O,diagramConstraints:M}},[t]),{sourceConstraints:y,diagramConstraints:v}=m,x=(0,Ps.useMemo)(()=>g?"Selector Evaluation Error":d?"Error":p?"Hidden Node Conflict":"Could not satisfy all constraints",[g,d,p]),A=(0,Ps.useMemo)(()=>g?"One or more selectors in your layout specification could not be evaluated.":d?"An error occurred while processing your data.":p?"Some layout constraints reference atoms hidden by a hideAtom directive. An atom cannot be both hidden and placed, so this layout is unsatisfiable. The diagram shows what the layout would look like if those atoms were not hidden \u2014 they are outlined with a dashed border.":"Your data causes the following visualization constraints to conflict.",[g,d,p]);return(0,Y.jsxs)("div",{id:"error-message-modal",className:"mt-3 d-flex flex-column overflow-x-auto p-3 rounded border border-danger border-2",children:[(0,Y.jsxs)("div",{className:"error-modal-header d-flex justify-content-between align-items-center",children:[(0,Y.jsx)("h4",{className:"mb-0",style:{color:"var(--bs-danger)"},children:x}),(0,Y.jsx)("button",{type:"button",className:"error-modal-toggle","aria-expanded":!r,"aria-label":r?"Expand error details":"Collapse error details",title:r?"Expand error details":"Collapse error details",onClick:()=>s(w=>!w),children:r?"\u25B8":"\u25BE"})]}),!r&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("p",{children:A}),d&&(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)("div",{className:"card error-card",children:[(0,Y.jsx)("div",{className:"card-header bg-light",children:(0,Y.jsx)("strong",{children:b})}),(0,Y.jsx)("div",{className:"card-body",children:(0,Y.jsx)("code",{dangerouslySetInnerHTML:{__html:t.message}})})]})}),h&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)("p",{id:"hover-instructions",children:["Hover over the ",p?"constraints":"conflicting constraints"," to see the corresponding diagram elements",p?" that were affected":" that cannot be visualized",". "]}),(0,Y.jsx)("div",{className:"constraint-relationship-table",children:(0,Y.jsxs)("div",{className:"constraint-columns",children:[(0,Y.jsxs)("div",{className:"constraint-column",children:[(0,Y.jsx)("div",{className:"constraint-column-header",children:"Source Constraints"}),(0,Y.jsx)("div",{className:"constraint-column-body source-constraints-cell",children:y.map(w=>(0,Y.jsx)("div",{"data-constraint-id":w.id,className:`constraint-item ${f(w.id)}`,onMouseEnter:k=>c(k,w,"source"),onMouseLeave:u,children:(0,Y.jsx)("code",{dangerouslySetInnerHTML:{__html:w.content}})},w.id))})]}),(0,Y.jsxs)("div",{className:"constraint-column",children:[(0,Y.jsx)("div",{className:"constraint-column-header",children:"Diagram Elements"}),(0,Y.jsx)("div",{className:"constraint-column-body diagram-constraints-cell",children:v.map(w=>(0,Y.jsx)("div",{"data-constraint-id":w.id,className:`constraint-item ${f(w.id)}`,onMouseEnter:k=>c(k,w,"diagram"),onMouseLeave:u,children:(0,Y.jsx)("code",{dangerouslySetInnerHTML:{__html:w.content}})},w.id))})]})]})})]}),g&&(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)("div",{className:"card error-card",children:[(0,Y.jsx)("div",{className:"card-header bg-light",children:(0,Y.jsx)("strong",{children:b})}),(0,Y.jsxs)("div",{className:"card-body",children:[(0,Y.jsx)("p",{className:"mb-2",children:"The following selectors failed to evaluate. Check your selector syntax."}),(0,Y.jsx)("ul",{className:"list-unstyled mb-0",children:t.errors.map((w,k)=>(0,Y.jsxs)("li",{className:"mb-2 p-2 bg-light rounded",children:[(0,Y.jsxs)("div",{children:[(0,Y.jsx)("strong",{children:"Selector:"})," ",(0,Y.jsx)("code",{children:w.selector})]}),(0,Y.jsxs)("div",{children:[(0,Y.jsx)("strong",{children:"Context:"})," ",w.context]}),(0,Y.jsxs)("div",{className:"text-danger",children:[(0,Y.jsx)("strong",{children:"Error:"})," ",w.errorMessage]})]},k))})]})]})})]})]})};var sg=X(Tt());var $S=X(Ce()),VS=({errorManager:t,className:e="",graphElementId:n})=>{let[i,r]=(0,sg.useState)(t.getCurrentError());if((0,sg.useEffect)(()=>{let o=l=>{console.log("ErrorMessageContainer received error change:",l),r(l)};t.onErrorChange(o),console.log("ErrorMessageContainer subscribed to error changes")},[t]),console.log("ErrorMessageContainer rendering, currentError:",i),!i)return null;let s=`error-message-container ${e}`.trim();return(0,$S.jsx)("div",{className:s,children:(0,$S.jsx)(FS,{systemError:i,graphElementId:n})})};var Va=class{constructor(){this.currentError=null;this.errorCallbacks=[]}setError(e){this.currentError=e,this.notifyCallbacks()}clearError(){this.currentError=null,this.notifyCallbacks()}getCurrentError(){return this.currentError}onErrorChange(e){this.errorCallbacks.push(e)}hasError(){return this.currentError!==null}notifyCallbacks(){this.errorCallbacks.forEach(e=>e(this.currentError))}};var Hf=X(Tt());var zs=X(Ce()),d_=({evaluator:t,instanceNumber:e})=>{let[n,i]=Hf.default.useState(""),[r,s]=Hf.default.useState([]);return Hf.default.useEffect(()=>{i(""),s([])},[t,e]),(0,zs.jsxs)("div",{id:"evaluator-repl-container",children:[(0,zs.jsx)("input",{className:"code-input",id:"evaluator-input",type:"text",placeholder:"Enter expression to evaluate...",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{if(l.key==="Enter"){l.preventDefault();let a=t.evaluate(n,{instanceIndex:e});s(c=>[[n,a.prettyPrint()],...c]),i("")}}}),(0,zs.jsx)("div",{id:"repl-output",children:r.map(([l,a],c)=>(0,zs.jsxs)(Hf.default.Fragment,{children:[(0,zs.jsx)("p",{className:"repl-output-line",children:`> ${l}`}),(0,zs.jsx)("p",{className:"repl-output-line",children:a})]},c))})]})};var Vo=X(Tt());var Xi=X(Ce()),h_=({graphElementId:t})=>{let[e,n]=(0,Vo.useState)([]),[i,r]=(0,Vo.useState)(!0),s=(0,Vo.useRef)(null);(0,Vo.useEffect)(()=>{let c=document.getElementById(t);if(s.current=c,!s.current){console.warn(`RelationHighlighter: Element with id "${t}" not found`);return}let u=f=>{let d=f,{relations:h}=d.detail;n(h||[])};return s.current.addEventListener("relations-available",u),()=>{s.current&&s.current.removeEventListener("relations-available",u)}},[t]);let o=(c,u)=>{let d=c.currentTarget.parentElement;if(!d)return;let h=d.getBoundingClientRect(),p=c.clientX-h.left,g=c.clientY-h.top;p>=0&&p<=d.clientWidth&&g>=0&&g<=d.clientHeight&&s.current&&typeof s.current.highlightRelation=="function"&&s.current.highlightRelation(u)},l=c=>{s.current&&typeof s.current.clearHighlightRelation=="function"&&s.current.clearHighlightRelation(c)};return(0,Xi.jsxs)("div",{className:"relation-highlighter",children:[(0,Xi.jsxs)("div",{className:"relation-highlighter-header",onClick:()=>{r(c=>!c)},children:[(0,Xi.jsxs)("h3",{className:"relation-highlighter-title",children:["Relations (",e.length,")"]}),(0,Xi.jsx)("button",{className:`collapse-toggle ${i?"collapsed":""}`,"aria-label":i?"Expand relations":"Collapse relations",children:"\u25BC"})]}),(0,Xi.jsx)("div",{className:`relation-highlighter-content ${i?"collapsed":""}`,children:e.length===0?(0,Xi.jsx)("p",{className:"no-relations",children:"No relations available"}):(0,Xi.jsx)("ul",{className:"relation-list",children:e.map(c=>(0,Xi.jsx)("li",{className:"relation-item",onMouseEnter:u=>o(u,c),onMouseLeave:()=>l(c),children:c},c))})})]})};function Tse(t){return[t.spytialcore,t.CnDCore,t.CndCore].find(n=>!!n&&typeof n=="object")}function p_(t,e){t.spytialComponents=e,t.CnDComponents=e,t.CndComponents=e;let n=Tse(t);if(n)return Object.assign(n,e),t.spytialcore=n,t.CnDCore=n,t.CndCore=n,n}var Ya=X(Ce()),Hs=class t{constructor(){this.constraints=[];this.directives=[];this.yamlValue="";this.isNoCodeView=!1;this.yamlChangeCallbacks=[]}static getInstance(){return t.instance||(t.instance=new t),t.instance}initializeWithConfig(e){e.initialYamlValue!==void 0&&(this.yamlValue=e.initialYamlValue),e.initialIsNoCodeView!==void 0&&(this.isNoCodeView=e.initialIsNoCodeView),e.initialConstraints!==void 0&&(this.constraints=[...e.initialConstraints]),e.initialDirectives!==void 0&&(this.directives=[...e.initialDirectives])}setConstraints(e){this.constraints=e}setDirectives(e){this.directives=e}setYamlValue(e){this.yamlValue=e}updateYamlValue(e){this.yamlValue=e,this.yamlChangeCallbacks.forEach(n=>{try{n(e)}catch(i){console.error("Error in YAML change callback:",i)}})}onYamlValueChange(e){return this.yamlChangeCallbacks.push(e),()=>{this.yamlChangeCallbacks=this.yamlChangeCallbacks.filter(n=>n!==e)}}setIsNoCodeView(e){this.isNoCodeView=e}getIsNoCodeView(){return this.isNoCodeView}getConstraints(){return[...this.constraints]}getDirectives(){return[...this.directives]}getYamlValue(){return this.yamlValue}generateCurrentYamlSpec(){try{return jx(this.constraints,this.directives)}catch(e){return console.error("Failed to generate YAML spec from state:",e),""}}getCurrentCndSpec(){return this.isNoCodeView?this.generateCurrentYamlSpec().trim():this.yamlValue.trim()}},Lr=class t{constructor(){this.instanceChangeCallbacks=[];this.currentInstance=f_()}static getInstance(){return t.instance||(t.instance=new t),t.instance}getCurrentInstance(){return this.currentInstance}setCurrentInstance(e){this.currentInstance=e,this.notifyInstanceChange()}onInstanceChange(e){return this.instanceChangeCallbacks.push(e),()=>{this.instanceChangeCallbacks=this.instanceChangeCallbacks.filter(n=>n!==e)}}notifyInstanceChange(){this.instanceChangeCallbacks.forEach(e=>{try{e(this.currentInstance)}catch(n){console.error("Error in instance change callback:",n)}})}},Xn=new Va,Ese=({config:t})=>{let e=(0,Je.useMemo)(()=>Hs.getInstance(),[]),[n,i]=(0,Je.useState)(()=>t?.initialYamlValue!==void 0?t.initialYamlValue:e.getYamlValue()),[r,s]=(0,Je.useState)(()=>t?.initialIsNoCodeView!==void 0?t.initialIsNoCodeView:e.getIsNoCodeView()),[o,l]=(0,Je.useState)(()=>t?.initialConstraints!==void 0?[...t.initialConstraints]:e.getConstraints()),[a,c]=(0,Je.useState)(()=>t?.initialDirectives!==void 0?[...t.initialDirectives]:e.getDirectives()),[u,f]=(0,Je.useState)(()=>Lr.getInstance().getCurrentInstance());(0,Je.useEffect)(()=>Lr.getInstance().onInstanceChange(f),[]),(0,Je.useEffect)(()=>e.onYamlValueChange(b=>{i(b);try{let m=yf(b);l(m.constraints),c(m.directives)}catch{}window.dispatchEvent(new CustomEvent("cnd-spec-changed",{detail:b}))}),[e]),(0,Je.useEffect)(()=>{t&&e.initializeWithConfig(t)},[t,e]),(0,Je.useEffect)(()=>{e.setConstraints(o)},[o,e]),(0,Je.useEffect)(()=>{e.setDirectives(a)},[a,e]),(0,Je.useEffect)(()=>{e.setYamlValue(n)},[n,e]),(0,Je.useEffect)(()=>{e.setIsNoCodeView(r)},[r,e]);let d=(0,Je.useCallback)(b=>{i(b),window.dispatchEvent(new CustomEvent("cnd-spec-changed",{detail:b}))},[]),h=(0,Je.useCallback)(b=>{s(b),console.log(`Switched to ${b?"No Code":"Code"} View`)},[]),p=(0,Je.useCallback)(b=>{l(b)},[]),g=(0,Je.useCallback)(b=>{c(b)},[]);return(0,Ya.jsx)(oR,{yamlValue:n,onChange:d,isNoCodeView:r,onViewChange:h,constraints:o,setConstraints:p,directives:a,setDirectives:g,instance:u,"aria-label":"CND Layout Specification Editor"})},jS=new Map;function YS(t="webcola-cnd-container",e){let n=document.getElementById(t);if(!n)return console.error(`CnD Layout Interface: Container '${t}' not found`),!1;function i(r){return!0}if(e?.initialYamlValue&&!i(e.initialYamlValue))return console.error("Invalid YAML value provided in configuration"),!1;try{og(t);let r=(0,Uf.createRoot)(n);return jS.set(t,r),r.render((0,Ya.jsx)(Ese,{config:e})),e?console.log(`CnD Layout Interface mounted to #${t} with initial config:`,{yamlValue:e.initialYamlValue?`${e.initialYamlValue.length} characters`:"none",isNoCodeView:e.initialIsNoCodeView??"default",constraints:e.initialConstraints?.length??0,directives:e.initialDirectives?.length??0}):console.log(`CnD Layout Interface mounted to #${t}`),!0}catch(r){return console.error("Failed to mount CnD Layout Interface:",r),!1}}function og(t="webcola-cnd-container"){let e=jS.get(t);if(!e)return!1;jS.delete(t);try{e.unmount()}catch(n){console.error("Failed to unmount CnD Layout Interface:",n)}return!0}function Dse(){try{return Lr.getInstance().getCurrentInstance()}catch(t){console.error("Error accessing the current data instance:",t);return}}function Mse(){try{let e=Hs.getInstance().generateCurrentYamlSpec();if(e.trim())return e;let n=document.querySelector("#webcola-cnd-container textarea");if(n&&n instanceof HTMLTextAreaElement)return n.value.trim();console.warn("CndLayoutInterface textarea not found")}catch(t){console.error("Error accessing CndLayoutInterface instance:",t)}}function KS(t="error-messages",e="graph-container"){let n=document.getElementById(t);if(!n)return console.error(`Error Modal: Container '${t}' not found`),!1;try{return(0,Uf.createRoot)(n).render((0,Ya.jsx)(VS,{errorManager:Xn,graphElementId:e})),console.log(`Error Modal mounted to #${t}`),!0}catch(i){return console.error("Failed to mount Error Modal:",i),!1}}function GS(t,e,n){let i=document.getElementById(t);if(!i)return console.error(`Evaluator REPL: Container '${t}' not found`),!1;if(!e)return console.error("Evaluator REPL: No evaluator provided"),!1;try{return(0,Uf.createRoot)(i).render((0,Ya.jsx)(d_,{evaluator:e,instanceNumber:n})),console.log(`Evaluator REPL mounted to #${t}`),!0}catch(r){return console.error("Failed to mount Evaluator REPL:",r),!1}}function QS(t,e){let n=document.getElementById(t);if(!n)return console.error(`Relation Highlighter: Container '${t}' not found`),!1;try{return(0,Uf.createRoot)(n).render((0,Ya.jsx)(h_,{graphElementId:e})),console.log(`Relation Highlighter mounted to #${t}`),!0}catch(i){return console.error("Failed to mount Relation Highlighter:",i),!1}}var Nr={showParseError:(t,e)=>{Xn.setError({type:"parse-error",message:t,source:e})},showGroupOverlapError:(t,e)=>{Xn.setError({type:"group-overlap-error",message:t,source:e})},showConstraintError:t=>{Xn.setError({type:"positional-error",messages:t})},showHiddenNodeConflict:t=>{Xn.setError({type:"hidden-node-conflict",messages:t})},showGeneralError:t=>{Xn.setError({type:"general-error",message:t})},showSelectorErrors:t=>{if(console.log("showSelectorErrors called with",t.length,"errors"),t.length===0)return;let e=new Set,n=t.filter(r=>{let s=`${r.selector}|${r.context}|${r.errorMessage}`;return e.has(s)?!1:(e.add(s),!0)});console.log("After dedup:",n.length,"unique errors");let i={type:"selector-error",errors:n};console.log("Setting error:",i),Xn.setError(i),console.log("Error set, current error:",Xn.getCurrentError())},clearAllErrors:()=>{Xn.clearError()},hasActiveErrors:()=>Xn.hasError()},ja={getCurrentCndSpec:()=>{try{let e=Hs.getInstance().getCurrentCndSpec();if(e.trim())return e;let n=document.querySelector("#webcola-cnd-container textarea");if(n instanceof HTMLTextAreaElement)return n.value.trim();console.warn("CndLayoutInterface not found or empty");return}catch(t){console.error("Error accessing CND specification:",t);return}},getCurrentInstance:()=>{try{return Lr.getInstance().getCurrentInstance()}catch(t){console.error("Error accessing current instance:",t);return}},updateInstance:t=>{try{Lr.getInstance().setCurrentInstance(t)}catch(e){console.error("Error updating instance:",e)}},updateSpec:t=>{try{Hs.getInstance().updateYamlValue(t)}catch(e){console.error("Error updating CND spec:",e)}}},m_={mountCndLayoutInterface:YS,unmountCndLayoutInterface:og,mountErrorMessageModal:KS,mountEvaluatorRepl:GS,mountRelationHighlighter:QS,CndLayoutStateManager:Hs,InstanceStateManager:Lr,globalErrorManager:Xn,ErrorAPI:Nr,DataAPI:ja};if(typeof window<"u"){let t=window;p_(t,m_),t.mountCndLayoutInterface=YS,t.unmountCndLayoutInterface=og,t.mountErrorMessageModal=KS,t.mountEvaluatorRepl=GS,t.mountRelationHighlighter=QS,t.getCurrentCNDSpecFromReact=ja.getCurrentCndSpec,t.getCurrentInstanceFromReact=ja.getCurrentInstance,t.updateInstanceFromReact=ja.updateInstance,t.updateSpecFromReact=ja.updateSpec,t.showParseError=Nr.showParseError,t.showGroupOverlapError=Nr.showGroupOverlapError,t.showPositionalError=Nr.showConstraintError,t.showHiddenNodeConflict=Nr.showHiddenNodeConflict,t.showGeneralError=Nr.showGeneralError,t.showSelectorErrors=Nr.showSelectorErrors,t.clearAllErrors=Nr.clearAllErrors,console.log("spytial-core component integration ready. Mount APIs are available on window.spytialComponents and are merged into window.spytialcore when the runtime bundle is loaded.")}return C_(Rse);})();
|
|
204
|
+
${r}`}removeAtom(e){this.alloyInstance=uR(this.alloyInstance,e),this.emitEvent({type:"atomRemoved",data:{atomId:e}})}addAtom(e){let n={_:"atom",id:e.id,type:e.type};this.alloyInstance=fR(this.alloyInstance,n),this.emitEvent({type:"atomAdded",data:{atom:e}})}addRelationTuple(e,n){let i=this.getAtoms(),r=this.getRelations().find(l=>l.id===e),s=aR(n,r,l=>i.find(a=>a.id===l)?.type),o={_:"tuple",atoms:s.tuple.atoms,types:s.tuple.types};this.alloyInstance=hR(this.alloyInstance,e,o),this.emitEvent({type:"relationTupleAdded",data:{relationId:e,tuple:s.tuple}})}removeRelationTuple(e,n){let i={_:"tuple",atoms:n.atoms,types:n.types};this.alloyInstance=dR(this.alloyInstance,e,i),this.emitEvent({type:"relationTupleRemoved",data:{relationId:e,tuple:n}})}addFromDataInstance(e,n){if(!Ose(e))return!1;let i=e.getAlloyInstance(),r=new Map;return qo(i).forEach(s=>{let o=this.getAtomType(s.id).isBuiltin;if(n&&o){let a=this.getAtoms().find(c=>c.type===s.type&&c.label===s.id);if(a){r.set(s.id,a.id);return}}let l=`atom_${this.getAtoms().length+1}`;r.set(s.id,l),this.addAtom({id:l,type:s.type,label:s.id})}),Ia(i).forEach(s=>{s.tuples.forEach(o=>{let l={atoms:o.atoms.map(a=>r.get(a)||a),types:o.types};this.addRelationTuple(s.id,l)})}),Rm(i).forEach(s=>{this.getTypes().find(l=>l.id===s.id)||(this.alloyInstance.types[s.id]={_:"type",id:s.id,types:s.types,atoms:s.atoms.map(l=>({_:"atom",id:r.get(l.id)||l.id,type:l.type})),meta:{builtin:!1,abstract:!1,enum:!1,one:!1,private:!1}})}),!0}};function Ose(t){return t instanceof rg}function f_(){let e={types:{univ:{_:"type",id:"univ",types:[],atoms:[],meta:{builtin:!0,abstract:!1,enum:!1,one:!1,private:!1}},Int:{_:"type",id:"Int",types:["Int","univ"],atoms:[],meta:{builtin:!0,abstract:!1,enum:!1,one:!1,private:!1}},"seq/Int":{_:"type",id:"seq/Int",types:["seq/Int","univ"],atoms:[],meta:{builtin:!0,abstract:!1,enum:!1,one:!1,private:!1}}},relations:{},skolems:{}};return new rg(e)}var Ps=X(Et());var j=X(Ce()),FS=({systemError:t,graphElementId:e,defaultCollapsed:n=!1})=>{let[i,r]=(0,Ps.useState)({ids:[],source:null}),[s,o]=(0,Ps.useState)(n),l=w=>{if(!e)return;let A=document.getElementById(e);if(!A||typeof A.highlightNodes!="function")return;let O=Array.from(w.querySelectorAll("[data-node-id]")).map(D=>D.getAttribute("data-node-id")).filter(D=>!!D);O.length>0&&A.highlightNodes(Array.from(new Set(O)))},a=()=>{if(!e)return;let w=document.getElementById(e);w&&typeof w.clearNodeHighlights=="function"&&w.clearNodeHighlights()},c=(w,A)=>{if(A.length===0)return;let D=w.closest(".constraint-columns")?.querySelector(`[data-constraint-id="${A[0]}"]`);D&&typeof D.scrollIntoView=="function"&&D.scrollIntoView({block:"nearest"})},u=(w,A,O)=>{r({ids:[A.id,...A.relatedIds],source:O}),l(w.currentTarget),c(w.currentTarget,A.relatedIds)},f=()=>{r({ids:[],source:null}),a()},d=w=>i.ids.includes(w)?i.source==="source"?"highlight-source":"highlight-diagram":"",h=t&&(t.type==="parse-error"||t.type==="general-error"||t.type==="group-overlap-error"),m=t&&(t.type==="positional-error"||t.type==="hidden-node-conflict")&&t.messages,g=t&&t.type==="hidden-node-conflict",b=t&&t.type==="selector-error"&&t.errors?.length>0;if(!h&&!m&&!b)return console.error("Cannot display the following error:",t),null;let p=(0,Ps.useMemo)(()=>{let w=t.type;return w==="parse-error"?`Parse Error ${t.source?`(${t.source})`:""}`:w==="group-overlap-error"?`Group Overlap Error ${t.source?`(${t.source})`:""}`:w==="selector-error"?`Selector Error${t.errors.length>1?"s":""} (${t.errors.length})`:"Error"},[t]),y=(0,Ps.useMemo)(()=>{let w=m?t.messages:void 0;if(!w)return{sourceConstraints:[],diagramConstraints:[]};function A($){let U=new Map;return $.minimalConflictingConstraints.forEach((he,Fe)=>{U.has(Fe)||U.set(Fe,new Set),he.forEach(ft=>U.get(Fe).add(ft))}),U.has($.conflictingSourceConstraint)?U.get($.conflictingSourceConstraint).add($.conflictingConstraint):U.set($.conflictingSourceConstraint,new Set([$.conflictingConstraint])),U}let O=A(w),D=[],I=[],M=new Map;return[...O.values()].forEach(($,U)=>{[...$.values()].map((he,Fe)=>{let ft=`diagram-${U}-${Fe}`;M.set(he,ft),I.push({id:ft,content:he,relatedIds:[]})})}),[...O.entries()].forEach(([$,U],he)=>{let Fe=`source-${he}`,ft=[...U.values()].map(fe=>M.get(fe));D.push({id:Fe,content:$,relatedIds:ft}),ft.forEach(fe=>{let Qe=I.find(cn=>cn.id===fe);Qe&&Qe.relatedIds.push(Fe)})}),{sourceConstraints:D,diagramConstraints:I}},[t]),{sourceConstraints:v,diagramConstraints:x}=y,k=(0,Ps.useMemo)(()=>b?"Selector Evaluation Error":h?"Error":g?"Hidden Node Conflict":"Could not satisfy all constraints",[b,h,g]),C=(0,Ps.useMemo)(()=>b?"One or more selectors in your layout specification could not be evaluated.":h?"An error occurred while processing your data.":g?"Some layout constraints reference atoms hidden by a hideAtom directive. An atom cannot be both hidden and placed, so this layout is unsatisfiable. The diagram shows what the layout would look like if those atoms were not hidden \u2014 they are outlined with a dashed border.":"Your data causes the following visualization constraints to conflict.",[b,h,g]);return(0,j.jsxs)("div",{id:"error-message-modal",className:"mt-3 d-flex flex-column overflow-x-auto p-3 rounded border border-danger border-2",children:[(0,j.jsxs)("div",{className:"error-modal-header d-flex justify-content-between align-items-center",children:[(0,j.jsx)("h4",{className:"mb-0",style:{color:"var(--bs-danger)"},children:k}),(0,j.jsxs)("button",{type:"button",className:"error-modal-toggle","aria-expanded":!s,onClick:()=>o(w=>!w),children:[(0,j.jsx)("span",{children:s?"Show details":"Hide details"}),(0,j.jsx)("svg",{className:"error-modal-chevron",viewBox:"0 0 20 20",width:"20",height:"20","aria-hidden":"true",focusable:"false",children:(0,j.jsx)("path",{d:"m5 7.5 5 5 5-5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),!s&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("p",{children:C}),h&&(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{className:"card error-card",children:[(0,j.jsx)("div",{className:"card-header bg-light",children:(0,j.jsx)("strong",{children:p})}),(0,j.jsx)("div",{className:"card-body",children:(0,j.jsx)("code",{dangerouslySetInnerHTML:{__html:t.message}})})]})}),m&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("p",{id:"hover-instructions",children:["Hover over the ",g?"constraints":"conflicting constraints"," to see the corresponding diagram elements",g?" that were affected":" that cannot be visualized",". "]}),(0,j.jsx)("div",{className:"constraint-relationship-table",children:(0,j.jsxs)("div",{className:"constraint-columns",children:[(0,j.jsxs)("div",{className:"constraint-column",children:[(0,j.jsx)("div",{className:"constraint-column-header",children:"Source Constraints"}),(0,j.jsx)("div",{className:"constraint-column-body source-constraints-cell",children:v.map(w=>(0,j.jsx)("div",{"data-constraint-id":w.id,className:`constraint-item ${d(w.id)}`,onMouseEnter:A=>u(A,w,"source"),onMouseLeave:f,children:(0,j.jsx)("code",{dangerouslySetInnerHTML:{__html:w.content}})},w.id))})]}),(0,j.jsxs)("div",{className:"constraint-column",children:[(0,j.jsx)("div",{className:"constraint-column-header",children:"Diagram Elements"}),(0,j.jsx)("div",{className:"constraint-column-body diagram-constraints-cell",children:x.map(w=>(0,j.jsx)("div",{"data-constraint-id":w.id,className:`constraint-item ${d(w.id)}`,onMouseEnter:A=>u(A,w,"diagram"),onMouseLeave:f,children:(0,j.jsx)("code",{dangerouslySetInnerHTML:{__html:w.content}})},w.id))})]})]})})]}),b&&(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{className:"card error-card",children:[(0,j.jsx)("div",{className:"card-header bg-light",children:(0,j.jsx)("strong",{children:p})}),(0,j.jsxs)("div",{className:"card-body",children:[(0,j.jsx)("p",{className:"mb-2",children:"The following selectors failed to evaluate. Check your selector syntax."}),(0,j.jsx)("ul",{className:"list-unstyled mb-0",children:t.errors.map((w,A)=>(0,j.jsxs)("li",{className:"mb-2 p-2 bg-light rounded",children:[(0,j.jsxs)("div",{children:[(0,j.jsx)("strong",{children:"Selector:"})," ",(0,j.jsx)("code",{children:w.selector})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("strong",{children:"Context:"})," ",w.context]}),(0,j.jsxs)("div",{className:"text-danger",children:[(0,j.jsx)("strong",{children:"Error:"})," ",w.errorMessage]})]},A))})]})]})})]})]})};var sg=X(Et());var $S=X(Ce()),VS=({errorManager:t,className:e="",graphElementId:n,defaultCollapsed:i})=>{let[r,s]=(0,sg.useState)(t.getCurrentError());if((0,sg.useEffect)(()=>{let l=a=>{console.log("ErrorMessageContainer received error change:",a),s(a)};t.onErrorChange(l),console.log("ErrorMessageContainer subscribed to error changes")},[t]),console.log("ErrorMessageContainer rendering, currentError:",r),!r)return null;let o=`error-message-container ${e}`.trim();return(0,$S.jsx)("div",{className:o,children:(0,$S.jsx)(FS,{systemError:r,graphElementId:n,defaultCollapsed:i})})};var Va=class{constructor(){this.currentError=null;this.errorCallbacks=[]}setError(e){this.currentError=e,this.notifyCallbacks()}clearError(){this.currentError=null,this.notifyCallbacks()}getCurrentError(){return this.currentError}onErrorChange(e){this.errorCallbacks.push(e)}hasError(){return this.currentError!==null}notifyCallbacks(){this.errorCallbacks.forEach(e=>e(this.currentError))}};var Hf=X(Et());var zs=X(Ce()),d_=({evaluator:t,instanceNumber:e})=>{let[n,i]=Hf.default.useState(""),[r,s]=Hf.default.useState([]);return Hf.default.useEffect(()=>{i(""),s([])},[t,e]),(0,zs.jsxs)("div",{id:"evaluator-repl-container",children:[(0,zs.jsx)("input",{className:"code-input",id:"evaluator-input",type:"text",placeholder:"Enter expression to evaluate...",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{if(l.key==="Enter"){l.preventDefault();let a=t.evaluate(n,{instanceIndex:e});s(c=>[[n,a.prettyPrint()],...c]),i("")}}}),(0,zs.jsx)("div",{id:"repl-output",children:r.map(([l,a],c)=>(0,zs.jsxs)(Hf.default.Fragment,{children:[(0,zs.jsx)("p",{className:"repl-output-line",children:`> ${l}`}),(0,zs.jsx)("p",{className:"repl-output-line",children:a})]},c))})]})};var Vo=X(Et());var Xi=X(Ce()),h_=({graphElementId:t})=>{let[e,n]=(0,Vo.useState)([]),[i,r]=(0,Vo.useState)(!0),s=(0,Vo.useRef)(null);(0,Vo.useEffect)(()=>{let c=document.getElementById(t);if(s.current=c,!s.current){console.warn(`RelationHighlighter: Element with id "${t}" not found`);return}let u=f=>{let d=f,{relations:h}=d.detail;n(h||[])};return s.current.addEventListener("relations-available",u),()=>{s.current&&s.current.removeEventListener("relations-available",u)}},[t]);let o=(c,u)=>{let d=c.currentTarget.parentElement;if(!d)return;let h=d.getBoundingClientRect(),m=c.clientX-h.left,g=c.clientY-h.top;m>=0&&m<=d.clientWidth&&g>=0&&g<=d.clientHeight&&s.current&&typeof s.current.highlightRelation=="function"&&s.current.highlightRelation(u)},l=c=>{s.current&&typeof s.current.clearHighlightRelation=="function"&&s.current.clearHighlightRelation(c)};return(0,Xi.jsxs)("div",{className:"relation-highlighter",children:[(0,Xi.jsxs)("div",{className:"relation-highlighter-header",onClick:()=>{r(c=>!c)},children:[(0,Xi.jsxs)("h3",{className:"relation-highlighter-title",children:["Relations (",e.length,")"]}),(0,Xi.jsx)("button",{className:`collapse-toggle ${i?"collapsed":""}`,"aria-label":i?"Expand relations":"Collapse relations",children:"\u25BC"})]}),(0,Xi.jsx)("div",{className:`relation-highlighter-content ${i?"collapsed":""}`,children:e.length===0?(0,Xi.jsx)("p",{className:"no-relations",children:"No relations available"}):(0,Xi.jsx)("ul",{className:"relation-list",children:e.map(c=>(0,Xi.jsx)("li",{className:"relation-item",onMouseEnter:u=>o(u,c),onMouseLeave:()=>l(c),children:c},c))})})]})};function Tse(t){return[t.spytialcore,t.CnDCore,t.CndCore].find(n=>!!n&&typeof n=="object")}function p_(t,e){t.spytialComponents=e,t.CnDComponents=e,t.CndComponents=e;let n=Tse(t);if(n)return Object.assign(n,e),t.spytialcore=n,t.CnDCore=n,t.CndCore=n,n}var Ya=X(Ce()),Hs=class t{constructor(){this.constraints=[];this.directives=[];this.yamlValue="";this.isNoCodeView=!1;this.yamlChangeCallbacks=[]}static getInstance(){return t.instance||(t.instance=new t),t.instance}initializeWithConfig(e){e.initialYamlValue!==void 0&&(this.yamlValue=e.initialYamlValue),e.initialIsNoCodeView!==void 0&&(this.isNoCodeView=e.initialIsNoCodeView),e.initialConstraints!==void 0&&(this.constraints=[...e.initialConstraints]),e.initialDirectives!==void 0&&(this.directives=[...e.initialDirectives])}setConstraints(e){this.constraints=e}setDirectives(e){this.directives=e}setYamlValue(e){this.yamlValue=e}updateYamlValue(e){this.yamlValue=e,this.yamlChangeCallbacks.forEach(n=>{try{n(e)}catch(i){console.error("Error in YAML change callback:",i)}})}onYamlValueChange(e){return this.yamlChangeCallbacks.push(e),()=>{this.yamlChangeCallbacks=this.yamlChangeCallbacks.filter(n=>n!==e)}}setIsNoCodeView(e){this.isNoCodeView=e}getIsNoCodeView(){return this.isNoCodeView}getConstraints(){return[...this.constraints]}getDirectives(){return[...this.directives]}getYamlValue(){return this.yamlValue}generateCurrentYamlSpec(){try{return jx(this.constraints,this.directives)}catch(e){return console.error("Failed to generate YAML spec from state:",e),""}}getCurrentCndSpec(){return this.isNoCodeView?this.generateCurrentYamlSpec().trim():this.yamlValue.trim()}},Lr=class t{constructor(){this.instanceChangeCallbacks=[];this.currentInstance=f_()}static getInstance(){return t.instance||(t.instance=new t),t.instance}getCurrentInstance(){return this.currentInstance}setCurrentInstance(e){this.currentInstance=e,this.notifyInstanceChange()}onInstanceChange(e){return this.instanceChangeCallbacks.push(e),()=>{this.instanceChangeCallbacks=this.instanceChangeCallbacks.filter(n=>n!==e)}}notifyInstanceChange(){this.instanceChangeCallbacks.forEach(e=>{try{e(this.currentInstance)}catch(n){console.error("Error in instance change callback:",n)}})}},Wn=new Va,Ese=({config:t})=>{let e=(0,et.useMemo)(()=>Hs.getInstance(),[]),[n,i]=(0,et.useState)(()=>t?.initialYamlValue!==void 0?t.initialYamlValue:e.getYamlValue()),[r,s]=(0,et.useState)(()=>t?.initialIsNoCodeView!==void 0?t.initialIsNoCodeView:e.getIsNoCodeView()),[o,l]=(0,et.useState)(()=>t?.initialConstraints!==void 0?[...t.initialConstraints]:e.getConstraints()),[a,c]=(0,et.useState)(()=>t?.initialDirectives!==void 0?[...t.initialDirectives]:e.getDirectives()),[u,f]=(0,et.useState)(()=>Lr.getInstance().getCurrentInstance());(0,et.useEffect)(()=>Lr.getInstance().onInstanceChange(f),[]),(0,et.useEffect)(()=>e.onYamlValueChange(b=>{i(b);try{let p=yf(b);l(p.constraints),c(p.directives)}catch{}window.dispatchEvent(new CustomEvent("cnd-spec-changed",{detail:b}))}),[e]),(0,et.useEffect)(()=>{t&&e.initializeWithConfig(t)},[t,e]),(0,et.useEffect)(()=>{e.setConstraints(o)},[o,e]),(0,et.useEffect)(()=>{e.setDirectives(a)},[a,e]),(0,et.useEffect)(()=>{e.setYamlValue(n)},[n,e]),(0,et.useEffect)(()=>{e.setIsNoCodeView(r)},[r,e]);let d=(0,et.useCallback)(b=>{i(b),window.dispatchEvent(new CustomEvent("cnd-spec-changed",{detail:b}))},[]),h=(0,et.useCallback)(b=>{s(b),console.log(`Switched to ${b?"No Code":"Code"} View`)},[]),m=(0,et.useCallback)(b=>{l(b)},[]),g=(0,et.useCallback)(b=>{c(b)},[]);return(0,Ya.jsx)(oR,{yamlValue:n,onChange:d,isNoCodeView:r,onViewChange:h,constraints:o,setConstraints:m,directives:a,setDirectives:g,instance:u,"aria-label":"CND Layout Specification Editor"})},jS=new Map;function YS(t="webcola-cnd-container",e){let n=document.getElementById(t);if(!n)return console.error(`CnD Layout Interface: Container '${t}' not found`),!1;function i(r){return!0}if(e?.initialYamlValue&&!i(e.initialYamlValue))return console.error("Invalid YAML value provided in configuration"),!1;try{og(t);let r=(0,Uf.createRoot)(n);return jS.set(t,r),r.render((0,Ya.jsx)(Ese,{config:e})),e?console.log(`CnD Layout Interface mounted to #${t} with initial config:`,{yamlValue:e.initialYamlValue?`${e.initialYamlValue.length} characters`:"none",isNoCodeView:e.initialIsNoCodeView??"default",constraints:e.initialConstraints?.length??0,directives:e.initialDirectives?.length??0}):console.log(`CnD Layout Interface mounted to #${t}`),!0}catch(r){return console.error("Failed to mount CnD Layout Interface:",r),!1}}function og(t="webcola-cnd-container"){let e=jS.get(t);if(!e)return!1;jS.delete(t);try{e.unmount()}catch(n){console.error("Failed to unmount CnD Layout Interface:",n)}return!0}function Dse(){try{return Lr.getInstance().getCurrentInstance()}catch(t){console.error("Error accessing the current data instance:",t);return}}function Mse(){try{let e=Hs.getInstance().generateCurrentYamlSpec();if(e.trim())return e;let n=document.querySelector("#webcola-cnd-container textarea");if(n&&n instanceof HTMLTextAreaElement)return n.value.trim();console.warn("CndLayoutInterface textarea not found")}catch(t){console.error("Error accessing CndLayoutInterface instance:",t)}}function KS(t="error-messages",e="graph-container",n=!1){let i=document.getElementById(t);if(!i)return console.error(`Error Modal: Container '${t}' not found`),!1;try{return(0,Uf.createRoot)(i).render((0,Ya.jsx)(VS,{errorManager:Wn,graphElementId:e,defaultCollapsed:n})),console.log(`Error Modal mounted to #${t}`),!0}catch(r){return console.error("Failed to mount Error Modal:",r),!1}}function GS(t,e,n){let i=document.getElementById(t);if(!i)return console.error(`Evaluator REPL: Container '${t}' not found`),!1;if(!e)return console.error("Evaluator REPL: No evaluator provided"),!1;try{return(0,Uf.createRoot)(i).render((0,Ya.jsx)(d_,{evaluator:e,instanceNumber:n})),console.log(`Evaluator REPL mounted to #${t}`),!0}catch(r){return console.error("Failed to mount Evaluator REPL:",r),!1}}function QS(t,e){let n=document.getElementById(t);if(!n)return console.error(`Relation Highlighter: Container '${t}' not found`),!1;try{return(0,Uf.createRoot)(n).render((0,Ya.jsx)(h_,{graphElementId:e})),console.log(`Relation Highlighter mounted to #${t}`),!0}catch(i){return console.error("Failed to mount Relation Highlighter:",i),!1}}var Nr={showParseError:(t,e)=>{Wn.setError({type:"parse-error",message:t,source:e})},showGroupOverlapError:(t,e)=>{Wn.setError({type:"group-overlap-error",message:t,source:e})},showConstraintError:t=>{Wn.setError({type:"positional-error",messages:t})},showHiddenNodeConflict:t=>{Wn.setError({type:"hidden-node-conflict",messages:t})},showGeneralError:t=>{Wn.setError({type:"general-error",message:t})},showSelectorErrors:t=>{if(console.log("showSelectorErrors called with",t.length,"errors"),t.length===0)return;let e=new Set,n=t.filter(r=>{let s=`${r.selector}|${r.context}|${r.errorMessage}`;return e.has(s)?!1:(e.add(s),!0)});console.log("After dedup:",n.length,"unique errors");let i={type:"selector-error",errors:n};console.log("Setting error:",i),Wn.setError(i),console.log("Error set, current error:",Wn.getCurrentError())},clearAllErrors:()=>{Wn.clearError()},hasActiveErrors:()=>Wn.hasError()},ja={getCurrentCndSpec:()=>{try{let e=Hs.getInstance().getCurrentCndSpec();if(e.trim())return e;let n=document.querySelector("#webcola-cnd-container textarea");if(n instanceof HTMLTextAreaElement)return n.value.trim();console.warn("CndLayoutInterface not found or empty");return}catch(t){console.error("Error accessing CND specification:",t);return}},getCurrentInstance:()=>{try{return Lr.getInstance().getCurrentInstance()}catch(t){console.error("Error accessing current instance:",t);return}},updateInstance:t=>{try{Lr.getInstance().setCurrentInstance(t)}catch(e){console.error("Error updating instance:",e)}},updateSpec:t=>{try{Hs.getInstance().updateYamlValue(t)}catch(e){console.error("Error updating CND spec:",e)}}},m_={mountCndLayoutInterface:YS,unmountCndLayoutInterface:og,mountErrorMessageModal:KS,mountEvaluatorRepl:GS,mountRelationHighlighter:QS,CndLayoutStateManager:Hs,InstanceStateManager:Lr,globalErrorManager:Wn,ErrorAPI:Nr,DataAPI:ja};if(typeof window<"u"){let t=window;p_(t,m_),t.mountCndLayoutInterface=YS,t.unmountCndLayoutInterface=og,t.mountErrorMessageModal=KS,t.mountEvaluatorRepl=GS,t.mountRelationHighlighter=QS,t.getCurrentCNDSpecFromReact=ja.getCurrentCndSpec,t.getCurrentInstanceFromReact=ja.getCurrentInstance,t.updateInstanceFromReact=ja.updateInstance,t.updateSpecFromReact=ja.updateSpec,t.showParseError=Nr.showParseError,t.showGroupOverlapError=Nr.showGroupOverlapError,t.showPositionalError=Nr.showConstraintError,t.showHiddenNodeConflict=Nr.showHiddenNodeConflict,t.showGeneralError=Nr.showGeneralError,t.showSelectorErrors=Nr.showSelectorErrors,t.clearAllErrors=Nr.clearAllErrors,console.log("spytial-core component integration ready. Mount APIs are available on window.spytialComponents and are merged into window.spytialcore when the runtime bundle is loaded.")}return C_(Rse);})();
|
|
205
205
|
/*! Bundled license information:
|
|
206
206
|
|
|
207
207
|
react/cjs/react.production.js:
|