function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = ["./any-language-editor-D-Oj6-AZ.js","./index-B5p9-YL9.js","./index-C2cu4p0i.js","./index-VL9hpEEh.js","./index-9x0-cKu4.js","./index-Bj7JCWn6.js","./index-B8ssAYfT.js","./index-D_62SrFD.js","./index-DIiBDiRV.js","./index-B63hZ2rY.js","./index-Ic0tloZN.js","./index-DQiRLb70.js","./index-BdkLV6x2.js","./index-BgR-ektG.js","./apl-B4CMkyY2.js","./asciiarmor-Df11BRmG.js","./asterisk-B-8jnY81.js","./brainfuck-C4LP7Hcl.js","./clike-DWq2Y8ae.js","./cmake-BQqOBYOt.js","./cobol-XrqhtCFE.js","./coffeescript-S37ZYGWr.js","./commonlisp-5jcOZwOE.js","./crystal-Bqrh1sWW.js","./cypher-C_CwsFkJ.js","./d-pRatUO7H.js","./diff-DbItnlRl.js","./dockerfile-CUtPLAxz.js","./simple-mode-CycmGRFK.js","./dtd-DF_7sFjM.js","./dylan-DwRh75JA.js","./ebnf-CDyGwa7X.js","./ecl-Cabwm37j.js","./eiffel-Bgzt68ye.js","./elm-vLlmbW-K.js","./erlang-BNw1qcRV.js","./factor-d5JhjZd4.js","./fcl-Kvtd6kyn.js","./forth-Ffai-XNe.js","./fortran-DYz_wnZ1.js","./gas-Bneqetm1.js","./gherkin-heZmZLOM.js","./go-CTD25R5P.js","./groovy-DKLxxR9y.js","./haskell-BWDZoCOh.js","./haxe-pv4rovob.js","./http-DBlCnlav.js","./idl-BEugSyMb.js","./jinja2-C4DGRd-O.js","./julia-DuME0IfC.js","./livescript-k3uCVVjK.js","./lua-BgMRiT3U.js","./mathematica-DTrFuWx2.js","./mbox-CNhZ1qSd.js","./mirc-CjQqDB4T.js","./modelica-Dc1JOy9r.js","./mscgen-BA5vi2Kp.js","./mumps-BT43cFF4.js","./nginx-DdIZxoE0.js","./nsis-DmB9U-bu.js","./ntriples-BfvgReVJ.js","./octave-Ck1zUtKM.js","./oz-BzwKVEFT.js","./pascal-B1wCu0_E.js","./perl-CdXCOZ3F.js","./pig-CevX1Tat.js","./powershell-CFHJl5sT.js","./properties-C78fOPTZ.js","./protobuf-ChK-085T.js","./puppet-DMA9R1ak.js","./q-ZnEupP5q.js","./r-DUYO_cvP.js","./ruby-B2Rjki9n.js","./sas-B4kiWyti.js","./scheme-C41bIUwD.js","./shell-CjFT_Tl9.js","./sieve-C3Gn_uJK.js","./smalltalk-CnHTOXQT.js","./solr-DwvJdyUN.js","./sparql-DkYu6x3z.js","./spreadsheet-BCZA_wO0.js","./stex-C3f8Ysf7.js","./stylus-Bj4jd1Fz.js","./swift-BzpIVaGY.js","./tcl-DVfN8rqt.js","./textile-CnDTJFAw.js","./tiddlywiki-DO-Gjzrf.js","./tiki-DGYXhP31.js","./toml-BXUEaScT.js","./troff-wAsdV37c.js","./ttcn-CiGrtVSZ.js","./turtle-B1tBg_DP.js","./vb-CmGdzxic.js","./vbscript-BuJXcnF6.js","./velocity-D8B20fx6.js","./verilog-C6RDOZhf.js","./vhdl-lSbBsy5d.js","./webidl-ZXfAyPTL.js","./xquery-WRlm2TX8.js","./yacas-BJ4BC0dw.js","./z80-Hz9HOZM7.js"]
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
var $ct=Object.defineProperty;var Tct=(e,t,n)=>t in e?$ct(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ve=(e,t,n)=>(Tct(e,typeof t!="symbol"?t+"":t,n),n);function Pct(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var ft=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cu(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var MRe={exports:{}},I7={},NRe={exports:{}},In={};/**
 * @license React
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var iR=Symbol.for("react.element"),Act=Symbol.for("react.portal"),Rct=Symbol.for("react.fragment"),Dct=Symbol.for("react.strict_mode"),Mct=Symbol.for("react.profiler"),Nct=Symbol.for("react.provider"),Ict=Symbol.for("react.context"),Lct=Symbol.for("react.forward_ref"),jct=Symbol.for("react.suspense"),Fct=Symbol.for("react.memo"),zct=Symbol.for("react.lazy"),Eme=Symbol.iterator;function Qct(e){return e===null||typeof e!="object"?null:(e=Eme&&e[Eme]||e["@@iterator"],typeof e=="function"?e:null)}var IRe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},LRe=Object.assign,jRe={};function MC(e,t,n){this.props=e,this.context=t,this.refs=jRe,this.updater=n||IRe}MC.prototype.isReactComponent={};MC.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};MC.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function FRe(){}FRe.prototype=MC.prototype;function qne(e,t,n){this.props=e,this.context=t,this.refs=jRe,this.updater=n||IRe}var Vne=qne.prototype=new FRe;Vne.constructor=qne;LRe(Vne,MC.prototype);Vne.isPureReactComponent=!0;var Cme=Array.isArray,zRe=Object.prototype.hasOwnProperty,Une={current:null},QRe={key:!0,ref:!0,__self:!0,__source:!0};function BRe(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)zRe.call(t,r)&&!QRe.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:iR,type:e,key:o,ref:s,props:i,_owner:Une.current}}function Bct(e,t){return{$$typeof:iR,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Hne(e){return typeof e=="object"&&e!==null&&e.$$typeof===iR}function Wct(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var _me=/\/+/g;function KB(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Wct(""+e.key):t.toString(36)}function a5(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case iR:case Act:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+KB(s,0):r,Cme(i)?(n="",e!=null&&(n=e.replace(_me,"$&/")+"/"),a5(i,t,n,"",function(c){return c})):i!=null&&(Hne(i)&&(i=Bct(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(_me,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",Cme(e))for(var a=0;a<e.length;a++){o=e[a];var l=r+KB(o,a);s+=a5(o,t,n,l,i)}else if(l=Qct(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=r+KB(o,a++),s+=a5(o,t,n,l,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function hM(e,t,n){if(e==null)return e;var r=[],i=0;return a5(e,r,"","",function(o){return t.call(n,o,i++)}),r}function qct(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Cl={current:null},l5={transition:null},Vct={ReactCurrentDispatcher:Cl,ReactCurrentBatchConfig:l5,ReactCurrentOwner:Une};In.Children={map:hM,forEach:function(e,t,n){hM(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return hM(e,function(){t++}),t},toArray:function(e){return hM(e,function(t){return t})||[]},only:function(e){if(!Hne(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};In.Component=MC;In.Fragment=Rct;In.Profiler=Mct;In.PureComponent=qne;In.StrictMode=Dct;In.Suspense=jct;In.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Vct;In.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=LRe({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=Une.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)zRe.call(t,l)&&!QRe.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:iR,type:e.type,key:i,ref:o,props:r,_owner:s}};In.createContext=function(e){return e={$$typeof:Ict,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Nct,_context:e},e.Consumer=e};In.createElement=BRe;In.createFactory=function(e){var t=BRe.bind(null,e);return t.type=e,t};In.createRef=function(){return{current:null}};In.forwardRef=function(e){return{$$typeof:Lct,render:e}};In.isValidElement=Hne;In.lazy=function(e){return{$$typeof:zct,_payload:{_status:-1,_result:e},_init:qct}};In.memo=function(e,t){return{$$typeof:Fct,type:e,compare:t===void 0?null:t}};In.startTransition=function(e){var t=l5.transition;l5.transition={};try{e()}finally{l5.transition=t}};In.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};In.useCallback=function(e,t){return Cl.current.useCallback(e,t)};In.useContext=function(e){return Cl.current.useContext(e)};In.useDebugValue=function(){};In.useDeferredValue=function(e){return Cl.current.useDeferredValue(e)};In.useEffect=function(e,t){return Cl.current.useEffect(e,t)};In.useId=function(){return Cl.current.useId()};In.useImperativeHandle=function(e,t,n){return Cl.current.useImperativeHandle(e,t,n)};In.useInsertionEffect=function(e,t){return Cl.current.useInsertionEffect(e,t)};In.useLayoutEffect=function(e,t){return Cl.current.useLayoutEffect(e,t)};In.useMemo=function(e,t){return Cl.current.useMemo(e,t)};In.useReducer=function(e,t,n){return Cl.current.useReducer(e,t,n)};In.useRef=function(e){return Cl.current.useRef(e)};In.useState=function(e){return Cl.current.useState(e)};In.useSyncExternalStore=function(e,t,n){return Cl.current.useSyncExternalStore(e,t,n)};In.useTransition=function(){return Cl.current.useTransition()};In.version="18.2.0";NRe.exports=In;var x=NRe.exports;const ie=wf(x),YS=Pct({__proto__:null,default:ie},[x]);/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Uct=x,Hct=Symbol.for("react.element"),Xct=Symbol.for("react.fragment"),Zct=Object.prototype.hasOwnProperty,Yct=Uct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Gct={key:!0,ref:!0,__self:!0,__source:!0};function WRe(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Zct.call(t,r)&&!Gct.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Hct,type:e,key:o,ref:s,props:i,_owner:Yct.current}}I7.Fragment=Xct;I7.jsx=WRe;I7.jsxs=WRe;MRe.exports=I7;var b=MRe.exports,BL={},qRe={exports:{}},uu={},VRe={exports:{}},URe={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(e){function t(W,F){var q=W.length;W.push(F);e:for(;0<q;){var U=q-1>>>1,V=W[U];if(0<i(V,F))W[U]=F,W[q]=V,q=U;else break e}}function n(W){return W.length===0?null:W[0]}function r(W){if(W.length===0)return null;var F=W[0],q=W.pop();if(q!==F){W[0]=q;e:for(var U=0,V=W.length,H=V>>>1;U<H;){var Z=2*(U+1)-1,ee=W[Z],se=Z+1,fe=W[se];if(0>i(ee,q))se<V&&0>i(fe,ee)?(W[U]=fe,W[se]=q,U=se):(W[U]=ee,W[Z]=q,U=Z);else if(se<V&&0>i(fe,q))W[U]=fe,W[se]=q,U=se;else break e}}return F}function i(W,F){var q=W.sortIndex-F.sortIndex;return q!==0?q:W.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,d=3,h=!1,p=!1,g=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(W){for(var F=n(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=W)r(c),F.sortIndex=F.expirationTime,t(l,F);else break;F=n(c)}}function w(W){if(g=!1,m(W),!p)if(n(l)!==null)p=!0,j(S);else{var F=n(c);F!==null&&z(w,F.startTime-W)}}function S(W,F){p=!1,g&&(g=!1,y(k),k=-1),h=!0;var q=d;try{for(m(F),f=n(l);f!==null&&(!(f.expirationTime>F)||W&&!M());){var U=f.callback;if(typeof U=="function"){f.callback=null,d=f.priorityLevel;var V=U(f.expirationTime<=F);F=e.unstable_now(),typeof V=="function"?f.callback=V:f===n(l)&&r(l),m(F)}else r(l);f=n(l)}if(f!==null)var H=!0;else{var Z=n(c);Z!==null&&z(w,Z.startTime-F),H=!1}return H}finally{f=null,d=q,h=!1}}var E=!1,C=null,k=-1,P=5,D=-1;function M(){return!(e.unstable_now()-D<P)}function L(){if(C!==null){var W=e.unstable_now();D=W;var F=!0;try{F=C(!0,W)}finally{F?A():(E=!1,C=null)}}else E=!1}var A;if(typeof O=="function")A=function(){O(L)};else if(typeof MessageChannel<"u"){var T=new MessageChannel,N=T.port2;T.port1.onmessage=L,A=function(){N.postMessage(null)}}else A=function(){v(L,0)};function j(W){C=W,E||(E=!0,A())}function z(W,F){k=v(function(){W(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(W){W.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,j(S))},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(W){switch(d){case 1:case 2:case 3:var F=3;break;default:F=d}var q=d;d=F;try{return W()}finally{d=q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(W,F){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var q=d;d=W;try{return F()}finally{d=q}},e.unstable_scheduleCallback=function(W,F,q){var U=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?U+q:U):q=U,W){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=q+V,W={id:u++,callback:F,priorityLevel:W,startTime:q,expirationTime:V,sortIndex:-1},q>U?(W.sortIndex=q,t(c,W),n(l)===null&&W===n(c)&&(g?(y(k),k=-1):g=!0,z(w,q-U))):(W.sortIndex=V,t(l,W),p||h||(p=!0,j(S))),W},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(W){var F=d;return function(){var q=d;d=F;try{return W.apply(this,arguments)}finally{d=q}}}})(URe);VRe.exports=URe;var Kct=VRe.exports;/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var HRe=x,eu=Kct;function Ge(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var XRe=new Set,b2={};function zO(e,t){GS(e,t),GS(e+"Capture",t)}function GS(e,t){for(b2[e]=t,e=0;e<t.length;e++)XRe.add(t[e])}var Fg=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xX=Object.prototype.hasOwnProperty,Jct=/^[: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]*$/,kme={},$me={};function eut(e){return xX.call($me,e)?!0:xX.call(kme,e)?!1:Jct.test(e)?$me[e]=!0:(kme[e]=!0,!1)}function tut(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function nut(e,t,n,r){if(t===null||typeof t>"u"||tut(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function _l(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Hs={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Hs[e]=new _l(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Hs[t]=new _l(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Hs[e]=new _l(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Hs[e]=new _l(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Hs[e]=new _l(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Hs[e]=new _l(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Hs[e]=new _l(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Hs[e]=new _l(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Hs[e]=new _l(e,5,!1,e.toLowerCase(),null,!1,!1)});var Xne=/[\-:]([a-z])/g;function Zne(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Xne,Zne);Hs[t]=new _l(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Xne,Zne);Hs[t]=new _l(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Xne,Zne);Hs[t]=new _l(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Hs[e]=new _l(e,1,!1,e.toLowerCase(),null,!1,!1)});Hs.xlinkHref=new _l("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Hs[e]=new _l(e,1,!1,e.toLowerCase(),null,!0,!0)});function Yne(e,t,n,r){var i=Hs.hasOwnProperty(t)?Hs[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(nut(t,n,i,r)&&(n=null),r||i===null?eut(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var am=HRe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,pM=Symbol.for("react.element"),Pw=Symbol.for("react.portal"),Aw=Symbol.for("react.fragment"),Gne=Symbol.for("react.strict_mode"),wX=Symbol.for("react.profiler"),ZRe=Symbol.for("react.provider"),YRe=Symbol.for("react.context"),Kne=Symbol.for("react.forward_ref"),SX=Symbol.for("react.suspense"),EX=Symbol.for("react.suspense_list"),Jne=Symbol.for("react.memo"),ey=Symbol.for("react.lazy"),GRe=Symbol.for("react.offscreen"),Tme=Symbol.iterator;function Z_(e){return e===null||typeof e!="object"?null:(e=Tme&&e[Tme]||e["@@iterator"],typeof e=="function"?e:null)}var Di=Object.assign,JB;function g$(e){if(JB===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);JB=t&&t[1]||""}return`
`+JB+e}var eW=!1;function tW(e,t){if(!e||eW)return"";eW=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
`),o=r.stack.split(`
`),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var l=`
`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{eW=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?g$(e):""}function rut(e){switch(e.tag){case 5:return g$(e.type);case 16:return g$("Lazy");case 13:return g$("Suspense");case 19:return g$("SuspenseList");case 0:case 2:case 15:return e=tW(e.type,!1),e;case 11:return e=tW(e.type.render,!1),e;case 1:return e=tW(e.type,!0),e;default:return""}}function CX(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Aw:return"Fragment";case Pw:return"Portal";case wX:return"Profiler";case Gne:return"StrictMode";case SX:return"Suspense";case EX:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case YRe:return(e.displayName||"Context")+".Consumer";case ZRe:return(e._context.displayName||"Context")+".Provider";case Kne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Jne:return t=e.displayName||null,t!==null?t:CX(e.type)||"Memo";case ey:t=e._payload,e=e._init;try{return CX(e(t))}catch{}}return null}function iut(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return CX(t);case 8:return t===Gne?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function x0(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function KRe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function out(e){var t=KRe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gM(e){e._valueTracker||(e._valueTracker=out(e))}function JRe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=KRe(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function WL(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _X(e,t){var n=t.checked;return Di({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Pme(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=x0(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function eDe(e,t){t=t.checked,t!=null&&Yne(e,"checked",t,!1)}function kX(e,t){eDe(e,t);var n=x0(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$X(e,t.type,n):t.hasOwnProperty("defaultValue")&&$X(e,t.type,x0(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ame(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function $X(e,t,n){(t!=="number"||WL(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var m$=Array.isArray;function aS(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+x0(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function TX(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Ge(91));return Di({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Rme(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Ge(92));if(m$(n)){if(1<n.length)throw Error(Ge(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:x0(n)}}function tDe(e,t){var n=x0(t.value),r=x0(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Dme(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function nDe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function PX(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?nDe(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var mM,rDe=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(mM=mM||document.createElement("div"),mM.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=mM.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function O2(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dT={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},sut=["Webkit","ms","Moz","O"];Object.keys(dT).forEach(function(e){sut.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),dT[t]=dT[e]})});function iDe(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||dT.hasOwnProperty(e)&&dT[e]?(""+t).trim():t+"px"}function oDe(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=iDe(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var aut=Di({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function AX(e,t){if(t){if(aut[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ge(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ge(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ge(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ge(62))}}function RX(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var DX=null;function ere(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var MX=null,lS=null,cS=null;function Mme(e){if(e=aR(e)){if(typeof MX!="function")throw Error(Ge(280));var t=e.stateNode;t&&(t=Q7(t),MX(e.stateNode,e.type,t))}}function sDe(e){lS?cS?cS.push(e):cS=[e]:lS=e}function aDe(){if(lS){var e=lS,t=cS;if(cS=lS=null,Mme(e),t)for(e=0;e<t.length;e++)Mme(t[e])}}function lDe(e,t){return e(t)}function cDe(){}var nW=!1;function uDe(e,t,n){if(nW)return e(t,n);nW=!0;try{return lDe(e,t,n)}finally{nW=!1,(lS!==null||cS!==null)&&(cDe(),aDe())}}function x2(e,t){var n=e.stateNode;if(n===null)return null;var r=Q7(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Ge(231,t,typeof n));return n}var NX=!1;if(Fg)try{var Y_={};Object.defineProperty(Y_,"passive",{get:function(){NX=!0}}),window.addEventListener("test",Y_,Y_),window.removeEventListener("test",Y_,Y_)}catch{NX=!1}function lut(e,t,n,r,i,o,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var hT=!1,qL=null,VL=!1,IX=null,cut={onError:function(e){hT=!0,qL=e}};function uut(e,t,n,r,i,o,s,a,l){hT=!1,qL=null,lut.apply(cut,arguments)}function fut(e,t,n,r,i,o,s,a,l){if(uut.apply(this,arguments),hT){if(hT){var c=qL;hT=!1,qL=null}else throw Error(Ge(198));VL||(VL=!0,IX=c)}}function QO(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function fDe(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Nme(e){if(QO(e)!==e)throw Error(Ge(188))}function dut(e){var t=e.alternate;if(!t){if(t=QO(e),t===null)throw Error(Ge(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Nme(i),e;if(o===r)return Nme(i),t;o=o.sibling}throw Error(Ge(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s)throw Error(Ge(189))}}if(n.alternate!==r)throw Error(Ge(190))}if(n.tag!==3)throw Error(Ge(188));return n.stateNode.current===n?e:t}function dDe(e){return e=dut(e),e!==null?hDe(e):null}function hDe(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=hDe(e);if(t!==null)return t;e=e.sibling}return null}var pDe=eu.unstable_scheduleCallback,Ime=eu.unstable_cancelCallback,hut=eu.unstable_shouldYield,put=eu.unstable_requestPaint,io=eu.unstable_now,gut=eu.unstable_getCurrentPriorityLevel,tre=eu.unstable_ImmediatePriority,gDe=eu.unstable_UserBlockingPriority,UL=eu.unstable_NormalPriority,mut=eu.unstable_LowPriority,mDe=eu.unstable_IdlePriority,L7=null,Nh=null;function yut(e){if(Nh&&typeof Nh.onCommitFiberRoot=="function")try{Nh.onCommitFiberRoot(L7,e,void 0,(e.current.flags&128)===128)}catch{}}var ld=Math.clz32?Math.clz32:Out,vut=Math.log,but=Math.LN2;function Out(e){return e>>>=0,e===0?32:31-(vut(e)/but|0)|0}var yM=64,vM=4194304;function y$(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function HL(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=y$(a):(o&=s,o!==0&&(r=y$(o)))}else s=n&~i,s!==0?r=y$(s):o!==0&&(r=y$(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ld(t),i=1<<n,r|=e[n],t&=~i;return r}function xut(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wut(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-ld(o),a=1<<s,l=i[s];l===-1?(!(a&n)||a&r)&&(i[s]=xut(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function LX(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function yDe(){var e=yM;return yM<<=1,!(yM&4194240)&&(yM=64),e}function rW(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function oR(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ld(t),e[t]=n}function Sut(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-ld(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function nre(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ld(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var _r=0;function vDe(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var bDe,rre,ODe,xDe,wDe,jX=!1,bM=[],Vy=null,Uy=null,Hy=null,w2=new Map,S2=new Map,fy=[],Eut="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 submit".split(" ");function Lme(e,t){switch(e){case"focusin":case"focusout":Vy=null;break;case"dragenter":case"dragleave":Uy=null;break;case"mouseover":case"mouseout":Hy=null;break;case"pointerover":case"pointerout":w2.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":S2.delete(t.pointerId)}}function G_(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=aR(t),t!==null&&rre(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Cut(e,t,n,r,i){switch(t){case"focusin":return Vy=G_(Vy,e,t,n,r,i),!0;case"dragenter":return Uy=G_(Uy,e,t,n,r,i),!0;case"mouseover":return Hy=G_(Hy,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return w2.set(o,G_(w2.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,S2.set(o,G_(S2.get(o)||null,e,t,n,r,i)),!0}return!1}function SDe(e){var t=M1(e.target);if(t!==null){var n=QO(t);if(n!==null){if(t=n.tag,t===13){if(t=fDe(n),t!==null){e.blockedOn=t,wDe(e.priority,function(){ODe(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function c5(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=FX(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);DX=r,n.target.dispatchEvent(r),DX=null}else return t=aR(n),t!==null&&rre(t),e.blockedOn=n,!1;t.shift()}return!0}function jme(e,t,n){c5(e)&&n.delete(t)}function _ut(){jX=!1,Vy!==null&&c5(Vy)&&(Vy=null),Uy!==null&&c5(Uy)&&(Uy=null),Hy!==null&&c5(Hy)&&(Hy=null),w2.forEach(jme),S2.forEach(jme)}function K_(e,t){e.blockedOn===t&&(e.blockedOn=null,jX||(jX=!0,eu.unstable_scheduleCallback(eu.unstable_NormalPriority,_ut)))}function E2(e){function t(i){return K_(i,e)}if(0<bM.length){K_(bM[0],e);for(var n=1;n<bM.length;n++){var r=bM[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Vy!==null&&K_(Vy,e),Uy!==null&&K_(Uy,e),Hy!==null&&K_(Hy,e),w2.forEach(t),S2.forEach(t),n=0;n<fy.length;n++)r=fy[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<fy.length&&(n=fy[0],n.blockedOn===null);)SDe(n),n.blockedOn===null&&fy.shift()}var uS=am.ReactCurrentBatchConfig,XL=!0;function kut(e,t,n,r){var i=_r,o=uS.transition;uS.transition=null;try{_r=1,ire(e,t,n,r)}finally{_r=i,uS.transition=o}}function $ut(e,t,n,r){var i=_r,o=uS.transition;uS.transition=null;try{_r=4,ire(e,t,n,r)}finally{_r=i,uS.transition=o}}function ire(e,t,n,r){if(XL){var i=FX(e,t,n,r);if(i===null)hW(e,t,r,ZL,n),Lme(e,r);else if(Cut(i,e,t,n,r))r.stopPropagation();else if(Lme(e,r),t&4&&-1<Eut.indexOf(e)){for(;i!==null;){var o=aR(i);if(o!==null&&bDe(o),o=FX(e,t,n,r),o===null&&hW(e,t,r,ZL,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else hW(e,t,r,null,n)}}var ZL=null;function FX(e,t,n,r){if(ZL=null,e=ere(r),e=M1(e),e!==null)if(t=QO(e),t===null)e=null;else if(n=t.tag,n===13){if(e=fDe(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ZL=e,null}function EDe(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(gut()){case tre:return 1;case gDe:return 4;case UL:case mut:return 16;case mDe:return 536870912;default:return 16}default:return 16}}var xy=null,ore=null,u5=null;function CDe(){if(u5)return u5;var e,t=ore,n=t.length,r,i="value"in xy?xy.value:xy.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return u5=i.slice(e,1<r?1-r:void 0)}function f5(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function OM(){return!0}function Fme(){return!1}function fu(e){function t(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?OM:Fme,this.isPropagationStopped=Fme,this}return Di(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=OM)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=OM)},persist:function(){},isPersistent:OM}),t}var NC={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sre=fu(NC),sR=Di({},NC,{view:0,detail:0}),Tut=fu(sR),iW,oW,J_,j7=Di({},sR,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:are,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==J_&&(J_&&e.type==="mousemove"?(iW=e.screenX-J_.screenX,oW=e.screenY-J_.screenY):oW=iW=0,J_=e),iW)},movementY:function(e){return"movementY"in e?e.movementY:oW}}),zme=fu(j7),Put=Di({},j7,{dataTransfer:0}),Aut=fu(Put),Rut=Di({},sR,{relatedTarget:0}),sW=fu(Rut),Dut=Di({},NC,{animationName:0,elapsedTime:0,pseudoElement:0}),Mut=fu(Dut),Nut=Di({},NC,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Iut=fu(Nut),Lut=Di({},NC,{data:0}),Qme=fu(Lut),jut={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Fut={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"},zut={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qut(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zut[e])?!!t[e]:!1}function are(){return Qut}var But=Di({},sR,{key:function(e){if(e.key){var t=jut[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=f5(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Fut[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:are,charCode:function(e){return e.type==="keypress"?f5(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?f5(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Wut=fu(But),qut=Di({},j7,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bme=fu(qut),Vut=Di({},sR,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:are}),Uut=fu(Vut),Hut=Di({},NC,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xut=fu(Hut),Zut=Di({},j7,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Yut=fu(Zut),Gut=[9,13,27,32],lre=Fg&&"CompositionEvent"in window,pT=null;Fg&&"documentMode"in document&&(pT=document.documentMode);var Kut=Fg&&"TextEvent"in window&&!pT,_De=Fg&&(!lre||pT&&8<pT&&11>=pT),Wme=" ",qme=!1;function kDe(e,t){switch(e){case"keyup":return Gut.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $De(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rw=!1;function Jut(e,t){switch(e){case"compositionend":return $De(t);case"keypress":return t.which!==32?null:(qme=!0,Wme);case"textInput":return e=t.data,e===Wme&&qme?null:e;default:return null}}function eft(e,t){if(Rw)return e==="compositionend"||!lre&&kDe(e,t)?(e=CDe(),u5=ore=xy=null,Rw=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return _De&&t.locale!=="ko"?null:t.data;default:return null}}var tft={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 Vme(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tft[e.type]:t==="textarea"}function TDe(e,t,n,r){sDe(r),t=YL(t,"onChange"),0<t.length&&(n=new sre("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var gT=null,C2=null;function nft(e){zDe(e,0)}function F7(e){var t=Nw(e);if(JRe(t))return e}function rft(e,t){if(e==="change")return t}var PDe=!1;if(Fg){var aW;if(Fg){var lW="oninput"in document;if(!lW){var Ume=document.createElement("div");Ume.setAttribute("oninput","return;"),lW=typeof Ume.oninput=="function"}aW=lW}else aW=!1;PDe=aW&&(!document.documentMode||9<document.documentMode)}function Hme(){gT&&(gT.detachEvent("onpropertychange",ADe),C2=gT=null)}function ADe(e){if(e.propertyName==="value"&&F7(C2)){var t=[];TDe(t,C2,e,ere(e)),uDe(nft,t)}}function ift(e,t,n){e==="focusin"?(Hme(),gT=t,C2=n,gT.attachEvent("onpropertychange",ADe)):e==="focusout"&&Hme()}function oft(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return F7(C2)}function sft(e,t){if(e==="click")return F7(t)}function aft(e,t){if(e==="input"||e==="change")return F7(t)}function lft(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var md=typeof Object.is=="function"?Object.is:lft;function _2(e,t){if(md(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!xX.call(t,i)||!md(e[i],t[i]))return!1}return!0}function Xme(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zme(e,t){var n=Xme(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Xme(n)}}function RDe(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?RDe(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function DDe(){for(var e=window,t=WL();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=WL(e.document)}return t}function cre(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function cft(e){var t=DDe(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&RDe(n.ownerDocument.documentElement,n)){if(r!==null&&cre(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Zme(n,o);var s=Zme(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uft=Fg&&"documentMode"in document&&11>=document.documentMode,Dw=null,zX=null,mT=null,QX=!1;function Yme(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;QX||Dw==null||Dw!==WL(r)||(r=Dw,"selectionStart"in r&&cre(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),mT&&_2(mT,r)||(mT=r,r=YL(zX,"onSelect"),0<r.length&&(t=new sre("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Dw)))}function xM(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Mw={animationend:xM("Animation","AnimationEnd"),animationiteration:xM("Animation","AnimationIteration"),animationstart:xM("Animation","AnimationStart"),transitionend:xM("Transition","TransitionEnd")},cW={},MDe={};Fg&&(MDe=document.createElement("div").style,"AnimationEvent"in window||(delete Mw.animationend.animation,delete Mw.animationiteration.animation,delete Mw.animationstart.animation),"TransitionEvent"in window||delete Mw.transitionend.transition);function z7(e){if(cW[e])return cW[e];if(!Mw[e])return e;var t=Mw[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in MDe)return cW[e]=t[n];return e}var NDe=z7("animationend"),IDe=z7("animationiteration"),LDe=z7("animationstart"),jDe=z7("transitionend"),FDe=new Map,Gme="abort auxClick 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(" ");function fv(e,t){FDe.set(e,t),zO(t,[e])}for(var uW=0;uW<Gme.length;uW++){var fW=Gme[uW],fft=fW.toLowerCase(),dft=fW[0].toUpperCase()+fW.slice(1);fv(fft,"on"+dft)}fv(NDe,"onAnimationEnd");fv(IDe,"onAnimationIteration");fv(LDe,"onAnimationStart");fv("dblclick","onDoubleClick");fv("focusin","onFocus");fv("focusout","onBlur");fv(jDe,"onTransitionEnd");GS("onMouseEnter",["mouseout","mouseover"]);GS("onMouseLeave",["mouseout","mouseover"]);GS("onPointerEnter",["pointerout","pointerover"]);GS("onPointerLeave",["pointerout","pointerover"]);zO("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));zO("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));zO("onBeforeInput",["compositionend","keypress","textInput","paste"]);zO("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));zO("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));zO("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var v$="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(" "),hft=new Set("cancel close invalid load scroll toggle".split(" ").concat(v$));function Kme(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,fut(r,t,void 0,e),e.currentTarget=null}function zDe(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;Kme(i,a,c),o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;Kme(i,a,c),o=l}}}if(VL)throw e=IX,VL=!1,IX=null,e}function oi(e,t){var n=t[UX];n===void 0&&(n=t[UX]=new Set);var r=e+"__bubble";n.has(r)||(QDe(t,e,2,!1),n.add(r))}function dW(e,t,n){var r=0;t&&(r|=4),QDe(n,e,r,t)}var wM="_reactListening"+Math.random().toString(36).slice(2);function k2(e){if(!e[wM]){e[wM]=!0,XRe.forEach(function(n){n!=="selectionchange"&&(hft.has(n)||dW(n,!1,e),dW(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wM]||(t[wM]=!0,dW("selectionchange",!1,t))}}function QDe(e,t,n,r){switch(EDe(t)){case 1:var i=kut;break;case 4:i=$ut;break;default:i=ire}n=i.bind(null,t,n,e),i=void 0,!NX||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function hW(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;s=s.return}for(;a!==null;){if(s=M1(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}uDe(function(){var c=o,u=ere(n),f=[];e:{var d=FDe.get(e);if(d!==void 0){var h=sre,p=e;switch(e){case"keypress":if(f5(n)===0)break e;case"keydown":case"keyup":h=Wut;break;case"focusin":p="focus",h=sW;break;case"focusout":p="blur",h=sW;break;case"beforeblur":case"afterblur":h=sW;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=zme;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=Aut;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Uut;break;case NDe:case IDe:case LDe:h=Mut;break;case jDe:h=Xut;break;case"scroll":h=Tut;break;case"wheel":h=Yut;break;case"copy":case"cut":case"paste":h=Iut;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Bme}var g=(t&4)!==0,v=!g&&e==="scroll",y=g?d!==null?d+"Capture":null:d;g=[];for(var O=c,m;O!==null;){m=O;var w=m.stateNode;if(m.tag===5&&w!==null&&(m=w,y!==null&&(w=x2(O,y),w!=null&&g.push($2(O,w,m)))),v)break;O=O.return}0<g.length&&(d=new h(d,p,null,n,u),f.push({event:d,listeners:g}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&n!==DX&&(p=n.relatedTarget||n.fromElement)&&(M1(p)||p[zg]))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?M1(p):null,p!==null&&(v=QO(p),p!==v||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=c),h!==p)){if(g=zme,w="onMouseLeave",y="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(g=Bme,w="onPointerLeave",y="onPointerEnter",O="pointer"),v=h==null?d:Nw(h),m=p==null?d:Nw(p),d=new g(w,O+"leave",h,n,u),d.target=v,d.relatedTarget=m,w=null,M1(u)===c&&(g=new g(y,O+"enter",p,n,u),g.target=m,g.relatedTarget=v,w=g),v=w,h&&p)t:{for(g=h,y=p,O=0,m=g;m;m=Ex(m))O++;for(m=0,w=y;w;w=Ex(w))m++;for(;0<O-m;)g=Ex(g),O--;for(;0<m-O;)y=Ex(y),m--;for(;O--;){if(g===y||y!==null&&g===y.alternate)break t;g=Ex(g),y=Ex(y)}g=null}else g=null;h!==null&&Jme(f,d,h,g,!1),p!==null&&v!==null&&Jme(f,v,p,g,!0)}}e:{if(d=c?Nw(c):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var S=rft;else if(Vme(d))if(PDe)S=aft;else{S=oft;var E=ift}else(h=d.nodeName)&&h.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(S=sft);if(S&&(S=S(e,c))){TDe(f,S,n,u);break e}E&&E(e,d,c),e==="focusout"&&(E=d._wrapperState)&&E.controlled&&d.type==="number"&&$X(d,"number",d.value)}switch(E=c?Nw(c):window,e){case"focusin":(Vme(E)||E.contentEditable==="true")&&(Dw=E,zX=c,mT=null);break;case"focusout":mT=zX=Dw=null;break;case"mousedown":QX=!0;break;case"contextmenu":case"mouseup":case"dragend":QX=!1,Yme(f,n,u);break;case"selectionchange":if(uft)break;case"keydown":case"keyup":Yme(f,n,u)}var C;if(lre)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Rw?kDe(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(_De&&n.locale!=="ko"&&(Rw||k!=="onCompositionStart"?k==="onCompositionEnd"&&Rw&&(C=CDe()):(xy=u,ore="value"in xy?xy.value:xy.textContent,Rw=!0)),E=YL(c,k),0<E.length&&(k=new Qme(k,e,null,n,u),f.push({event:k,listeners:E}),C?k.data=C:(C=$De(n),C!==null&&(k.data=C)))),(C=Kut?Jut(e,n):eft(e,n))&&(c=YL(c,"onBeforeInput"),0<c.length&&(u=new Qme("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=C))}zDe(f,t)})}function $2(e,t,n){return{instance:e,listener:t,currentTarget:n}}function YL(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=x2(e,n),o!=null&&r.unshift($2(e,o,i)),o=x2(e,t),o!=null&&r.push($2(e,o,i))),e=e.return}return r}function Ex(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Jme(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=x2(n,o),l!=null&&s.unshift($2(n,l,a))):i||(l=x2(n,o),l!=null&&s.push($2(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var pft=/\r\n?/g,gft=/\u0000|\uFFFD/g;function eye(e){return(typeof e=="string"?e:""+e).replace(pft,`
`).replace(gft,"")}function SM(e,t,n){if(t=eye(t),eye(e)!==t&&n)throw Error(Ge(425))}function GL(){}var BX=null,WX=null;function qX(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var VX=typeof setTimeout=="function"?setTimeout:void 0,mft=typeof clearTimeout=="function"?clearTimeout:void 0,tye=typeof Promise=="function"?Promise:void 0,yft=typeof queueMicrotask=="function"?queueMicrotask:typeof tye<"u"?function(e){return tye.resolve(null).then(e).catch(vft)}:VX;function vft(e){setTimeout(function(){throw e})}function pW(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),E2(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);E2(t)}function Xy(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function nye(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var IC=Math.random().toString(36).slice(2),bh="__reactFiber$"+IC,T2="__reactProps$"+IC,zg="__reactContainer$"+IC,UX="__reactEvents$"+IC,bft="__reactListeners$"+IC,Oft="__reactHandles$"+IC;function M1(e){var t=e[bh];if(t)return t;for(var n=e.parentNode;n;){if(t=n[zg]||n[bh]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=nye(e);e!==null;){if(n=e[bh])return n;e=nye(e)}return t}e=n,n=e.parentNode}return null}function aR(e){return e=e[bh]||e[zg],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Nw(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Ge(33))}function Q7(e){return e[T2]||null}var HX=[],Iw=-1;function dv(e){return{current:e}}function fi(e){0>Iw||(e.current=HX[Iw],HX[Iw]=null,Iw--)}function ei(e,t){Iw++,HX[Iw]=e.current,e.current=t}var w0={},Fa=dv(w0),Ul=dv(!1),Eb=w0;function KS(e,t){var n=e.type.contextTypes;if(!n)return w0;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Hl(e){return e=e.childContextTypes,e!=null}function KL(){fi(Ul),fi(Fa)}function rye(e,t,n){if(Fa.current!==w0)throw Error(Ge(168));ei(Fa,t),ei(Ul,n)}function BDe(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Ge(108,iut(e)||"Unknown",i));return Di({},n,r)}function JL(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||w0,Eb=Fa.current,ei(Fa,e),ei(Ul,Ul.current),!0}function iye(e,t,n){var r=e.stateNode;if(!r)throw Error(Ge(169));n?(e=BDe(e,t,Eb),r.__reactInternalMemoizedMergedChildContext=e,fi(Ul),fi(Fa),ei(Fa,e)):fi(Ul),ei(Ul,n)}var tg=null,B7=!1,gW=!1;function WDe(e){tg===null?tg=[e]:tg.push(e)}function xft(e){B7=!0,WDe(e)}function hv(){if(!gW&&tg!==null){gW=!0;var e=0,t=_r;try{var n=tg;for(_r=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}tg=null,B7=!1}catch(i){throw tg!==null&&(tg=tg.slice(e+1)),pDe(tre,hv),i}finally{_r=t,gW=!1}}return null}var Lw=[],jw=0,ej=null,tj=0,Cu=[],_u=0,Cb=null,hg=1,pg="";function c1(e,t){Lw[jw++]=tj,Lw[jw++]=ej,ej=e,tj=t}function qDe(e,t,n){Cu[_u++]=hg,Cu[_u++]=pg,Cu[_u++]=Cb,Cb=e;var r=hg;e=pg;var i=32-ld(r)-1;r&=~(1<<i),n+=1;var o=32-ld(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,hg=1<<32-ld(t)+i|n<<i|r,pg=o+e}else hg=1<<o|n<<i|r,pg=e}function ure(e){e.return!==null&&(c1(e,1),qDe(e,1,0))}function fre(e){for(;e===ej;)ej=Lw[--jw],Lw[jw]=null,tj=Lw[--jw],Lw[jw]=null;for(;e===Cb;)Cb=Cu[--_u],Cu[_u]=null,pg=Cu[--_u],Cu[_u]=null,hg=Cu[--_u],Cu[_u]=null}var Hc=null,zc=null,vi=!1,Hf=null;function VDe(e,t){var n=Bu(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function oye(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Hc=e,zc=Xy(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Hc=e,zc=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Cb!==null?{id:hg,overflow:pg}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Bu(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Hc=e,zc=null,!0):!1;default:return!1}}function XX(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ZX(e){if(vi){var t=zc;if(t){var n=t;if(!oye(e,t)){if(XX(e))throw Error(Ge(418));t=Xy(n.nextSibling);var r=Hc;t&&oye(e,t)?VDe(r,n):(e.flags=e.flags&-4097|2,vi=!1,Hc=e)}}else{if(XX(e))throw Error(Ge(418));e.flags=e.flags&-4097|2,vi=!1,Hc=e}}}function sye(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Hc=e}function EM(e){if(e!==Hc)return!1;if(!vi)return sye(e),vi=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!qX(e.type,e.memoizedProps)),t&&(t=zc)){if(XX(e))throw UDe(),Error(Ge(418));for(;t;)VDe(e,t),t=Xy(t.nextSibling)}if(sye(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ge(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){zc=Xy(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}zc=null}}else zc=Hc?Xy(e.stateNode.nextSibling):null;return!0}function UDe(){for(var e=zc;e;)e=Xy(e.nextSibling)}function JS(){zc=Hc=null,vi=!1}function dre(e){Hf===null?Hf=[e]:Hf.push(e)}var wft=am.ReactCurrentBatchConfig;function Bf(e,t){if(e&&e.defaultProps){t=Di({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var nj=dv(null),rj=null,Fw=null,hre=null;function pre(){hre=Fw=rj=null}function gre(e){var t=nj.current;fi(nj),e._currentValue=t}function YX(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function fS(e,t){rj=e,hre=Fw=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ql=!0),e.firstContext=null)}function af(e){var t=e._currentValue;if(hre!==e)if(e={context:e,memoizedValue:t,next:null},Fw===null){if(rj===null)throw Error(Ge(308));Fw=e,rj.dependencies={lanes:0,firstContext:e}}else Fw=Fw.next=e;return t}var N1=null;function mre(e){N1===null?N1=[e]:N1.push(e)}function HDe(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,mre(t)):(n.next=i.next,i.next=n),t.interleaved=n,Qg(e,r)}function Qg(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ty=!1;function yre(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function XDe(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Cg(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Zy(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Un&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Qg(e,n)}return i=r.interleaved,i===null?(t.next=t,mre(r)):(t.next=i.next,i.next=t),r.interleaved=t,Qg(e,n)}function d5(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nre(e,n)}}function aye(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ij(e,t,n,r){var i=e.updateQueue;ty=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,u=c=l=null,a=o;do{var d=a.lane,h=a.eventTime;if((r&d)===d){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,g=a;switch(d=t,h=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){f=p.call(h,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(h,f,d):p,d==null)break e;f=Di({},f,d);break e;case 2:ty=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,d=i.effects,d===null?i.effects=[a]:d.push(a))}else h={eventTime:h,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,s|=d;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;d=a,a=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);kb|=s,e.lanes=s,e.memoizedState=f}}function lye(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Ge(191,i));i.call(r)}}}var ZDe=new HRe.Component().refs;function GX(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Di({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var W7={isMounted:function(e){return(e=e._reactInternals)?QO(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=fl(),i=Gy(e),o=Cg(r,i);o.payload=t,n!=null&&(o.callback=n),t=Zy(e,o,i),t!==null&&(cd(t,e,i,r),d5(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=fl(),i=Gy(e),o=Cg(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Zy(e,o,i),t!==null&&(cd(t,e,i,r),d5(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=fl(),r=Gy(e),i=Cg(n,r);i.tag=2,t!=null&&(i.callback=t),t=Zy(e,i,r),t!==null&&(cd(t,e,r,n),d5(t,e,r))}};function cye(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!_2(n,r)||!_2(i,o):!0}function YDe(e,t,n){var r=!1,i=w0,o=t.contextType;return typeof o=="object"&&o!==null?o=af(o):(i=Hl(t)?Eb:Fa.current,r=t.contextTypes,o=(r=r!=null)?KS(e,i):w0),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=W7,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function uye(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&W7.enqueueReplaceState(t,t.state,null)}function KX(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=ZDe,yre(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=af(o):(o=Hl(t)?Eb:Fa.current,i.context=KS(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(GX(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&W7.enqueueReplaceState(i,i.state,null),ij(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ek(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Ge(309));var r=n.stateNode}if(!r)throw Error(Ge(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(s){var a=i.refs;a===ZDe&&(a=i.refs={}),s===null?delete a[o]:a[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(Ge(284));if(!n._owner)throw Error(Ge(290,e))}return e}function CM(e,t){throw e=Object.prototype.toString.call(t),Error(Ge(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function fye(e){var t=e._init;return t(e._payload)}function GDe(e){function t(y,O){if(e){var m=y.deletions;m===null?(y.deletions=[O],y.flags|=16):m.push(O)}}function n(y,O){if(!e)return null;for(;O!==null;)t(y,O),O=O.sibling;return null}function r(y,O){for(y=new Map;O!==null;)O.key!==null?y.set(O.key,O):y.set(O.index,O),O=O.sibling;return y}function i(y,O){return y=Ky(y,O),y.index=0,y.sibling=null,y}function o(y,O,m){return y.index=m,e?(m=y.alternate,m!==null?(m=m.index,m<O?(y.flags|=2,O):m):(y.flags|=2,O)):(y.flags|=1048576,O)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,O,m,w){return O===null||O.tag!==6?(O=wW(m,y.mode,w),O.return=y,O):(O=i(O,m),O.return=y,O)}function l(y,O,m,w){var S=m.type;return S===Aw?u(y,O,m.props.children,w,m.key):O!==null&&(O.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ey&&fye(S)===O.type)?(w=i(O,m.props),w.ref=ek(y,O,m),w.return=y,w):(w=v5(m.type,m.key,m.props,null,y.mode,w),w.ref=ek(y,O,m),w.return=y,w)}function c(y,O,m,w){return O===null||O.tag!==4||O.stateNode.containerInfo!==m.containerInfo||O.stateNode.implementation!==m.implementation?(O=SW(m,y.mode,w),O.return=y,O):(O=i(O,m.children||[]),O.return=y,O)}function u(y,O,m,w,S){return O===null||O.tag!==7?(O=eb(m,y.mode,w,S),O.return=y,O):(O=i(O,m),O.return=y,O)}function f(y,O,m){if(typeof O=="string"&&O!==""||typeof O=="number")return O=wW(""+O,y.mode,m),O.return=y,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case pM:return m=v5(O.type,O.key,O.props,null,y.mode,m),m.ref=ek(y,null,O),m.return=y,m;case Pw:return O=SW(O,y.mode,m),O.return=y,O;case ey:var w=O._init;return f(y,w(O._payload),m)}if(m$(O)||Z_(O))return O=eb(O,y.mode,m,null),O.return=y,O;CM(y,O)}return null}function d(y,O,m,w){var S=O!==null?O.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return S!==null?null:a(y,O,""+m,w);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case pM:return m.key===S?l(y,O,m,w):null;case Pw:return m.key===S?c(y,O,m,w):null;case ey:return S=m._init,d(y,O,S(m._payload),w)}if(m$(m)||Z_(m))return S!==null?null:u(y,O,m,w,null);CM(y,m)}return null}function h(y,O,m,w,S){if(typeof w=="string"&&w!==""||typeof w=="number")return y=y.get(m)||null,a(O,y,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case pM:return y=y.get(w.key===null?m:w.key)||null,l(O,y,w,S);case Pw:return y=y.get(w.key===null?m:w.key)||null,c(O,y,w,S);case ey:var E=w._init;return h(y,O,m,E(w._payload),S)}if(m$(w)||Z_(w))return y=y.get(m)||null,u(O,y,w,S,null);CM(O,w)}return null}function p(y,O,m,w){for(var S=null,E=null,C=O,k=O=0,P=null;C!==null&&k<m.length;k++){C.index>k?(P=C,C=null):P=C.sibling;var D=d(y,C,m[k],w);if(D===null){C===null&&(C=P);break}e&&C&&D.alternate===null&&t(y,C),O=o(D,O,k),E===null?S=D:E.sibling=D,E=D,C=P}if(k===m.length)return n(y,C),vi&&c1(y,k),S;if(C===null){for(;k<m.length;k++)C=f(y,m[k],w),C!==null&&(O=o(C,O,k),E===null?S=C:E.sibling=C,E=C);return vi&&c1(y,k),S}for(C=r(y,C);k<m.length;k++)P=h(C,y,k,m[k],w),P!==null&&(e&&P.alternate!==null&&C.delete(P.key===null?k:P.key),O=o(P,O,k),E===null?S=P:E.sibling=P,E=P);return e&&C.forEach(function(M){return t(y,M)}),vi&&c1(y,k),S}function g(y,O,m,w){var S=Z_(m);if(typeof S!="function")throw Error(Ge(150));if(m=S.call(m),m==null)throw Error(Ge(151));for(var E=S=null,C=O,k=O=0,P=null,D=m.next();C!==null&&!D.done;k++,D=m.next()){C.index>k?(P=C,C=null):P=C.sibling;var M=d(y,C,D.value,w);if(M===null){C===null&&(C=P);break}e&&C&&M.alternate===null&&t(y,C),O=o(M,O,k),E===null?S=M:E.sibling=M,E=M,C=P}if(D.done)return n(y,C),vi&&c1(y,k),S;if(C===null){for(;!D.done;k++,D=m.next())D=f(y,D.value,w),D!==null&&(O=o(D,O,k),E===null?S=D:E.sibling=D,E=D);return vi&&c1(y,k),S}for(C=r(y,C);!D.done;k++,D=m.next())D=h(C,y,k,D.value,w),D!==null&&(e&&D.alternate!==null&&C.delete(D.key===null?k:D.key),O=o(D,O,k),E===null?S=D:E.sibling=D,E=D);return e&&C.forEach(function(L){return t(y,L)}),vi&&c1(y,k),S}function v(y,O,m,w){if(typeof m=="object"&&m!==null&&m.type===Aw&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case pM:e:{for(var S=m.key,E=O;E!==null;){if(E.key===S){if(S=m.type,S===Aw){if(E.tag===7){n(y,E.sibling),O=i(E,m.props.children),O.return=y,y=O;break e}}else if(E.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ey&&fye(S)===E.type){n(y,E.sibling),O=i(E,m.props),O.ref=ek(y,E,m),O.return=y,y=O;break e}n(y,E);break}else t(y,E);E=E.sibling}m.type===Aw?(O=eb(m.props.children,y.mode,w,m.key),O.return=y,y=O):(w=v5(m.type,m.key,m.props,null,y.mode,w),w.ref=ek(y,O,m),w.return=y,y=w)}return s(y);case Pw:e:{for(E=m.key;O!==null;){if(O.key===E)if(O.tag===4&&O.stateNode.containerInfo===m.containerInfo&&O.stateNode.implementation===m.implementation){n(y,O.sibling),O=i(O,m.children||[]),O.return=y,y=O;break e}else{n(y,O);break}else t(y,O);O=O.sibling}O=SW(m,y.mode,w),O.return=y,y=O}return s(y);case ey:return E=m._init,v(y,O,E(m._payload),w)}if(m$(m))return p(y,O,m,w);if(Z_(m))return g(y,O,m,w);CM(y,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,O!==null&&O.tag===6?(n(y,O.sibling),O=i(O,m),O.return=y,y=O):(n(y,O),O=wW(m,y.mode,w),O.return=y,y=O),s(y)):n(y,O)}return v}var eE=GDe(!0),KDe=GDe(!1),lR={},Ih=dv(lR),P2=dv(lR),A2=dv(lR);function I1(e){if(e===lR)throw Error(Ge(174));return e}function vre(e,t){switch(ei(A2,t),ei(P2,e),ei(Ih,lR),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:PX(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=PX(t,e)}fi(Ih),ei(Ih,t)}function tE(){fi(Ih),fi(P2),fi(A2)}function JDe(e){I1(A2.current);var t=I1(Ih.current),n=PX(t,e.type);t!==n&&(ei(P2,e),ei(Ih,n))}function bre(e){P2.current===e&&(fi(Ih),fi(P2))}var Ai=dv(0);function oj(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mW=[];function Ore(){for(var e=0;e<mW.length;e++)mW[e]._workInProgressVersionPrimary=null;mW.length=0}var h5=am.ReactCurrentDispatcher,yW=am.ReactCurrentBatchConfig,_b=0,Ri=null,Fo=null,is=null,sj=!1,yT=!1,R2=0,Sft=0;function ra(){throw Error(Ge(321))}function xre(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!md(e[n],t[n]))return!1;return!0}function wre(e,t,n,r,i,o){if(_b=o,Ri=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,h5.current=e===null||e.memoizedState===null?kft:$ft,e=n(r,i),yT){o=0;do{if(yT=!1,R2=0,25<=o)throw Error(Ge(301));o+=1,is=Fo=null,t.updateQueue=null,h5.current=Tft,e=n(r,i)}while(yT)}if(h5.current=aj,t=Fo!==null&&Fo.next!==null,_b=0,is=Fo=Ri=null,sj=!1,t)throw Error(Ge(300));return e}function Sre(){var e=R2!==0;return R2=0,e}function ch(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return is===null?Ri.memoizedState=is=e:is=is.next=e,is}function lf(){if(Fo===null){var e=Ri.alternate;e=e!==null?e.memoizedState:null}else e=Fo.next;var t=is===null?Ri.memoizedState:is.next;if(t!==null)is=t,Fo=e;else{if(e===null)throw Error(Ge(310));Fo=e,e={memoizedState:Fo.memoizedState,baseState:Fo.baseState,baseQueue:Fo.baseQueue,queue:Fo.queue,next:null},is===null?Ri.memoizedState=is=e:is=is.next=e}return is}function D2(e,t){return typeof t=="function"?t(e):t}function vW(e){var t=lf(),n=t.queue;if(n===null)throw Error(Ge(311));n.lastRenderedReducer=e;var r=Fo,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var a=s=null,l=null,c=o;do{var u=c.lane;if((_b&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,Ri.lanes|=u,kb|=u}c=c.next}while(c!==null&&c!==o);l===null?s=r:l.next=a,md(r,t.memoizedState)||(Ql=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,Ri.lanes|=o,kb|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function bW(e){var t=lf(),n=t.queue;if(n===null)throw Error(Ge(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);md(o,t.memoizedState)||(Ql=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function eMe(){}function tMe(e,t){var n=Ri,r=lf(),i=t(),o=!md(r.memoizedState,i);if(o&&(r.memoizedState=i,Ql=!0),r=r.queue,Ere(iMe.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||is!==null&&is.memoizedState.tag&1){if(n.flags|=2048,M2(9,rMe.bind(null,n,r,i,t),void 0,null),ps===null)throw Error(Ge(349));_b&30||nMe(n,t,i)}return i}function nMe(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ri.updateQueue,t===null?(t={lastEffect:null,stores:null},Ri.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function rMe(e,t,n,r){t.value=n,t.getSnapshot=r,oMe(t)&&sMe(e)}function iMe(e,t,n){return n(function(){oMe(t)&&sMe(e)})}function oMe(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!md(e,n)}catch{return!0}}function sMe(e){var t=Qg(e,1);t!==null&&cd(t,e,1,-1)}function dye(e){var t=ch();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:D2,lastRenderedState:e},t.queue=e,e=e.dispatch=_ft.bind(null,Ri,e),[t.memoizedState,e]}function M2(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ri.updateQueue,t===null?(t={lastEffect:null,stores:null},Ri.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function aMe(){return lf().memoizedState}function p5(e,t,n,r){var i=ch();Ri.flags|=e,i.memoizedState=M2(1|t,n,void 0,r===void 0?null:r)}function q7(e,t,n,r){var i=lf();r=r===void 0?null:r;var o=void 0;if(Fo!==null){var s=Fo.memoizedState;if(o=s.destroy,r!==null&&xre(r,s.deps)){i.memoizedState=M2(t,n,o,r);return}}Ri.flags|=e,i.memoizedState=M2(1|t,n,o,r)}function hye(e,t){return p5(8390656,8,e,t)}function Ere(e,t){return q7(2048,8,e,t)}function lMe(e,t){return q7(4,2,e,t)}function cMe(e,t){return q7(4,4,e,t)}function uMe(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fMe(e,t,n){return n=n!=null?n.concat([e]):null,q7(4,4,uMe.bind(null,t,e),n)}function Cre(){}function dMe(e,t){var n=lf();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&xre(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hMe(e,t){var n=lf();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&xre(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function pMe(e,t,n){return _b&21?(md(n,t)||(n=yDe(),Ri.lanes|=n,kb|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ql=!0),e.memoizedState=n)}function Eft(e,t){var n=_r;_r=n!==0&&4>n?n:4,e(!0);var r=yW.transition;yW.transition={};try{e(!1),t()}finally{_r=n,yW.transition=r}}function gMe(){return lf().memoizedState}function Cft(e,t,n){var r=Gy(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},mMe(e))yMe(t,n);else if(n=HDe(e,t,n,r),n!==null){var i=fl();cd(n,e,r,i),vMe(n,t,r)}}function _ft(e,t,n){var r=Gy(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(mMe(e))yMe(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,md(a,s)){var l=t.interleaved;l===null?(i.next=i,mre(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=HDe(e,t,i,r),n!==null&&(i=fl(),cd(n,e,r,i),vMe(n,t,r))}}function mMe(e){var t=e.alternate;return e===Ri||t!==null&&t===Ri}function yMe(e,t){yT=sj=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vMe(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nre(e,n)}}var aj={readContext:af,useCallback:ra,useContext:ra,useEffect:ra,useImperativeHandle:ra,useInsertionEffect:ra,useLayoutEffect:ra,useMemo:ra,useReducer:ra,useRef:ra,useState:ra,useDebugValue:ra,useDeferredValue:ra,useTransition:ra,useMutableSource:ra,useSyncExternalStore:ra,useId:ra,unstable_isNewReconciler:!1},kft={readContext:af,useCallback:function(e,t){return ch().memoizedState=[e,t===void 0?null:t],e},useContext:af,useEffect:hye,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,p5(4194308,4,uMe.bind(null,t,e),n)},useLayoutEffect:function(e,t){return p5(4194308,4,e,t)},useInsertionEffect:function(e,t){return p5(4,2,e,t)},useMemo:function(e,t){var n=ch();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ch();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Cft.bind(null,Ri,e),[r.memoizedState,e]},useRef:function(e){var t=ch();return e={current:e},t.memoizedState=e},useState:dye,useDebugValue:Cre,useDeferredValue:function(e){return ch().memoizedState=e},useTransition:function(){var e=dye(!1),t=e[0];return e=Eft.bind(null,e[1]),ch().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ri,i=ch();if(vi){if(n===void 0)throw Error(Ge(407));n=n()}else{if(n=t(),ps===null)throw Error(Ge(349));_b&30||nMe(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,hye(iMe.bind(null,r,o,e),[e]),r.flags|=2048,M2(9,rMe.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=ch(),t=ps.identifierPrefix;if(vi){var n=pg,r=hg;n=(r&~(1<<32-ld(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=R2++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Sft++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},$ft={readContext:af,useCallback:dMe,useContext:af,useEffect:Ere,useImperativeHandle:fMe,useInsertionEffect:lMe,useLayoutEffect:cMe,useMemo:hMe,useReducer:vW,useRef:aMe,useState:function(){return vW(D2)},useDebugValue:Cre,useDeferredValue:function(e){var t=lf();return pMe(t,Fo.memoizedState,e)},useTransition:function(){var e=vW(D2)[0],t=lf().memoizedState;return[e,t]},useMutableSource:eMe,useSyncExternalStore:tMe,useId:gMe,unstable_isNewReconciler:!1},Tft={readContext:af,useCallback:dMe,useContext:af,useEffect:Ere,useImperativeHandle:fMe,useInsertionEffect:lMe,useLayoutEffect:cMe,useMemo:hMe,useReducer:bW,useRef:aMe,useState:function(){return bW(D2)},useDebugValue:Cre,useDeferredValue:function(e){var t=lf();return Fo===null?t.memoizedState=e:pMe(t,Fo.memoizedState,e)},useTransition:function(){var e=bW(D2)[0],t=lf().memoizedState;return[e,t]},useMutableSource:eMe,useSyncExternalStore:tMe,useId:gMe,unstable_isNewReconciler:!1};function nE(e,t){try{var n="",r=t;do n+=rut(r),r=r.return;while(r);var i=n}catch(o){i=`
Error generating stack: `+o.message+`
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function OW(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function JX(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Pft=typeof WeakMap=="function"?WeakMap:Map;function bMe(e,t,n){n=Cg(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){cj||(cj=!0,cZ=r),JX(e,t)},n}function OMe(e,t,n){n=Cg(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){JX(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){JX(e,t),typeof r!="function"&&(Yy===null?Yy=new Set([this]):Yy.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function pye(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pft;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=qft.bind(null,e,t,n),t.then(e,e))}function gye(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function mye(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Cg(-1,1),t.tag=2,Zy(n,t,1))),n.lanes|=1),e)}var Aft=am.ReactCurrentOwner,Ql=!1;function Ja(e,t,n,r){t.child=e===null?KDe(t,null,n,r):eE(t,e.child,n,r)}function yye(e,t,n,r,i){n=n.render;var o=t.ref;return fS(t,i),r=wre(e,t,n,r,o,i),n=Sre(),e!==null&&!Ql?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Bg(e,t,i)):(vi&&n&&ure(t),t.flags|=1,Ja(e,t,r,i),t.child)}function vye(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!Dre(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,xMe(e,t,o,r,i)):(e=v5(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:_2,n(s,r)&&e.ref===t.ref)return Bg(e,t,i)}return t.flags|=1,e=Ky(o,r),e.ref=t.ref,e.return=t,t.child=e}function xMe(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(_2(o,r)&&e.ref===t.ref)if(Ql=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(Ql=!0);else return t.lanes=e.lanes,Bg(e,t,i)}return eZ(e,t,n,r,i)}function wMe(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ei(Qw,kc),kc|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ei(Qw,kc),kc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ei(Qw,kc),kc|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ei(Qw,kc),kc|=r;return Ja(e,t,i,n),t.child}function SMe(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function eZ(e,t,n,r,i){var o=Hl(n)?Eb:Fa.current;return o=KS(t,o),fS(t,i),n=wre(e,t,n,r,o,i),r=Sre(),e!==null&&!Ql?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Bg(e,t,i)):(vi&&r&&ure(t),t.flags|=1,Ja(e,t,n,i),t.child)}function bye(e,t,n,r,i){if(Hl(n)){var o=!0;JL(t)}else o=!1;if(fS(t,i),t.stateNode===null)g5(e,t),YDe(t,n,r),KX(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=af(c):(c=Hl(n)?Eb:Fa.current,c=KS(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&uye(t,s,r,c),ty=!1;var d=t.memoizedState;s.state=d,ij(t,r,s,i),l=t.memoizedState,a!==r||d!==l||Ul.current||ty?(typeof u=="function"&&(GX(t,n,u,r),l=t.memoizedState),(a=ty||cye(t,n,a,r,d,l,c))?(f||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"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,XDe(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Bf(t.type,a),s.props=c,f=t.pendingProps,d=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=af(l):(l=Hl(n)?Eb:Fa.current,l=KS(t,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||d!==l)&&uye(t,s,r,l),ty=!1,d=t.memoizedState,s.state=d,ij(t,r,s,i);var p=t.memoizedState;a!==f||d!==p||Ul.current||ty?(typeof h=="function"&&(GX(t,n,h,r),p=t.memoizedState),(c=ty||cye(t,n,c,r,d,p,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,p,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,p,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),s.props=r,s.state=p,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return tZ(e,t,n,r,o,i)}function tZ(e,t,n,r,i,o){SMe(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&iye(t,n,!1),Bg(e,t,o);r=t.stateNode,Aft.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=eE(t,e.child,null,o),t.child=eE(t,null,a,o)):Ja(e,t,a,o),t.memoizedState=r.state,i&&iye(t,n,!0),t.child}function EMe(e){var t=e.stateNode;t.pendingContext?rye(e,t.pendingContext,t.pendingContext!==t.context):t.context&&rye(e,t.context,!1),vre(e,t.containerInfo)}function Oye(e,t,n,r,i){return JS(),dre(i),t.flags|=256,Ja(e,t,n,r),t.child}var nZ={dehydrated:null,treeContext:null,retryLane:0};function rZ(e){return{baseLanes:e,cachePool:null,transitions:null}}function CMe(e,t,n){var r=t.pendingProps,i=Ai.current,o=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ei(Ai,i&1),e===null)return ZX(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=H7(s,r,0,null),e=eb(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=rZ(n),t.memoizedState=nZ,e):_re(t,s));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return Rft(e,t,s,r,a,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Ky(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=Ky(a,o):(o=eb(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?rZ(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=nZ,r}return o=e.child,e=o.sibling,r=Ky(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function _re(e,t){return t=H7({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function _M(e,t,n,r){return r!==null&&dre(r),eE(t,e.child,null,n),e=_re(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rft(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=OW(Error(Ge(422))),_M(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=H7({mode:"visible",children:r.children},i,0,null),o=eb(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&eE(t,e.child,null,s),t.child.memoizedState=rZ(s),t.memoizedState=nZ,o);if(!(t.mode&1))return _M(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(Ge(419)),r=OW(o,r,void 0),_M(e,t,s,r)}if(a=(s&e.childLanes)!==0,Ql||a){if(r=ps,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Qg(e,i),cd(r,e,i,-1))}return Rre(),r=OW(Error(Ge(421))),_M(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Vft.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,zc=Xy(i.nextSibling),Hc=t,vi=!0,Hf=null,e!==null&&(Cu[_u++]=hg,Cu[_u++]=pg,Cu[_u++]=Cb,hg=e.id,pg=e.overflow,Cb=t),t=_re(t,r.children),t.flags|=4096,t)}function xye(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),YX(e.return,t,n)}function xW(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function _Me(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Ja(e,t,r.children,n),r=Ai.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xye(e,n,t);else if(e.tag===19)xye(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ei(Ai,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&oj(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),xW(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&oj(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}xW(t,!0,n,null,o);break;case"together":xW(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function g5(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Bg(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),kb|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Ge(153));if(t.child!==null){for(e=t.child,n=Ky(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ky(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dft(e,t,n){switch(t.tag){case 3:EMe(t),JS();break;case 5:JDe(t);break;case 1:Hl(t.type)&&JL(t);break;case 4:vre(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ei(nj,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ei(Ai,Ai.current&1),t.flags|=128,null):n&t.child.childLanes?CMe(e,t,n):(ei(Ai,Ai.current&1),e=Bg(e,t,n),e!==null?e.sibling:null);ei(Ai,Ai.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return _Me(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ei(Ai,Ai.current),r)break;return null;case 22:case 23:return t.lanes=0,wMe(e,t,n)}return Bg(e,t,n)}var kMe,iZ,$Me,TMe;kMe=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};iZ=function(){};$Me=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,I1(Ih.current);var o=null;switch(n){case"input":i=_X(e,i),r=_X(e,r),o=[];break;case"select":i=Di({},i,{value:void 0}),r=Di({},r,{value:void 0}),o=[];break;case"textarea":i=TX(e,i),r=TX(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=GL)}AX(n,r);var s;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(b2.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(b2.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&oi("scroll",e),o||a===l||(o=[])):(o=o||[]).push(c,l))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};TMe=function(e,t,n,r){n!==r&&(t.flags|=4)};function tk(e,t){if(!vi)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ia(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Mft(e,t,n){var r=t.pendingProps;switch(fre(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ia(t),null;case 1:return Hl(t.type)&&KL(),ia(t),null;case 3:return r=t.stateNode,tE(),fi(Ul),fi(Fa),Ore(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(EM(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Hf!==null&&(dZ(Hf),Hf=null))),iZ(e,t),ia(t),null;case 5:bre(t);var i=I1(A2.current);if(n=t.type,e!==null&&t.stateNode!=null)$Me(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Ge(166));return ia(t),null}if(e=I1(Ih.current),EM(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[bh]=t,r[T2]=o,e=(t.mode&1)!==0,n){case"dialog":oi("cancel",r),oi("close",r);break;case"iframe":case"object":case"embed":oi("load",r);break;case"video":case"audio":for(i=0;i<v$.length;i++)oi(v$[i],r);break;case"source":oi("error",r);break;case"img":case"image":case"link":oi("error",r),oi("load",r);break;case"details":oi("toggle",r);break;case"input":Pme(r,o),oi("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},oi("invalid",r);break;case"textarea":Rme(r,o),oi("invalid",r)}AX(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&SM(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&SM(r.textContent,a,e),i=["children",""+a]):b2.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&oi("scroll",r)}switch(n){case"input":gM(r),Ame(r,o,!0);break;case"textarea":gM(r),Dme(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=GL)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=nDe(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[bh]=t,e[T2]=r,kMe(e,t,!1,!1),t.stateNode=e;e:{switch(s=RX(n,r),n){case"dialog":oi("cancel",e),oi("close",e),i=r;break;case"iframe":case"object":case"embed":oi("load",e),i=r;break;case"video":case"audio":for(i=0;i<v$.length;i++)oi(v$[i],e);i=r;break;case"source":oi("error",e),i=r;break;case"img":case"image":case"link":oi("error",e),oi("load",e),i=r;break;case"details":oi("toggle",e),i=r;break;case"input":Pme(e,r),i=_X(e,r),oi("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Di({},r,{value:void 0}),oi("invalid",e);break;case"textarea":Rme(e,r),i=TX(e,r),oi("invalid",e);break;default:i=r}AX(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?oDe(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&rDe(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&O2(e,l):typeof l=="number"&&O2(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(b2.hasOwnProperty(o)?l!=null&&o==="onScroll"&&oi("scroll",e):l!=null&&Yne(e,o,l,s))}switch(n){case"input":gM(e),Ame(e,r,!1);break;case"textarea":gM(e),Dme(e);break;case"option":r.value!=null&&e.setAttribute("value",""+x0(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?aS(e,!!r.multiple,o,!1):r.defaultValue!=null&&aS(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=GL)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ia(t),null;case 6:if(e&&t.stateNode!=null)TMe(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Ge(166));if(n=I1(A2.current),I1(Ih.current),EM(t)){if(r=t.stateNode,n=t.memoizedProps,r[bh]=t,(o=r.nodeValue!==n)&&(e=Hc,e!==null))switch(e.tag){case 3:SM(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&SM(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[bh]=t,t.stateNode=r}return ia(t),null;case 13:if(fi(Ai),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(vi&&zc!==null&&t.mode&1&&!(t.flags&128))UDe(),JS(),t.flags|=98560,o=!1;else if(o=EM(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(Ge(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Ge(317));o[bh]=t}else JS(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ia(t),o=!1}else Hf!==null&&(dZ(Hf),Hf=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ai.current&1?Uo===0&&(Uo=3):Rre())),t.updateQueue!==null&&(t.flags|=4),ia(t),null);case 4:return tE(),iZ(e,t),e===null&&k2(t.stateNode.containerInfo),ia(t),null;case 10:return gre(t.type._context),ia(t),null;case 17:return Hl(t.type)&&KL(),ia(t),null;case 19:if(fi(Ai),o=t.memoizedState,o===null)return ia(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)tk(o,!1);else{if(Uo!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=oj(e),s!==null){for(t.flags|=128,tk(o,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ei(Ai,Ai.current&1|2),t.child}e=e.sibling}o.tail!==null&&io()>rE&&(t.flags|=128,r=!0,tk(o,!1),t.lanes=4194304)}else{if(!r)if(e=oj(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),tk(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!vi)return ia(t),null}else 2*io()-o.renderingStartTime>rE&&n!==1073741824&&(t.flags|=128,r=!0,tk(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=io(),t.sibling=null,n=Ai.current,ei(Ai,r?n&1|2:n&1),t):(ia(t),null);case 22:case 23:return Are(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?kc&1073741824&&(ia(t),t.subtreeFlags&6&&(t.flags|=8192)):ia(t),null;case 24:return null;case 25:return null}throw Error(Ge(156,t.tag))}function Nft(e,t){switch(fre(t),t.tag){case 1:return Hl(t.type)&&KL(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return tE(),fi(Ul),fi(Fa),Ore(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bre(t),null;case 13:if(fi(Ai),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ge(340));JS()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fi(Ai),null;case 4:return tE(),null;case 10:return gre(t.type._context),null;case 22:case 23:return Are(),null;case 24:return null;default:return null}}var kM=!1,wa=!1,Ift=typeof WeakSet=="function"?WeakSet:Set,vt=null;function zw(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){qi(e,t,r)}else n.current=null}function oZ(e,t,n){try{n()}catch(r){qi(e,t,r)}}var wye=!1;function Lft(e,t){if(BX=XL,e=DDe(),cre(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=e,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++c===i&&(a=s),d===o&&++u===r&&(l=s),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(WX={focusedElem:e,selectionRange:n},XL=!1,vt=t;vt!==null;)if(t=vt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,vt=e;else for(;vt!==null;){t=vt;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,v=p.memoizedState,y=t.stateNode,O=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:Bf(t.type,g),v);y.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ge(163))}}catch(w){qi(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,vt=e;break}vt=t.return}return p=wye,wye=!1,p}function vT(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&oZ(t,n,o)}i=i.next}while(i!==r)}}function V7(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function sZ(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function PMe(e){var t=e.alternate;t!==null&&(e.alternate=null,PMe(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bh],delete t[T2],delete t[UX],delete t[bft],delete t[Oft])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function AMe(e){return e.tag===5||e.tag===3||e.tag===4}function Sye(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||AMe(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function aZ(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=GL));else if(r!==4&&(e=e.child,e!==null))for(aZ(e,t,n),e=e.sibling;e!==null;)aZ(e,t,n),e=e.sibling}function lZ(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(lZ(e,t,n),e=e.sibling;e!==null;)lZ(e,t,n),e=e.sibling}var $s=null,qf=!1;function Rm(e,t,n){for(n=n.child;n!==null;)RMe(e,t,n),n=n.sibling}function RMe(e,t,n){if(Nh&&typeof Nh.onCommitFiberUnmount=="function")try{Nh.onCommitFiberUnmount(L7,n)}catch{}switch(n.tag){case 5:wa||zw(n,t);case 6:var r=$s,i=qf;$s=null,Rm(e,t,n),$s=r,qf=i,$s!==null&&(qf?(e=$s,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):$s.removeChild(n.stateNode));break;case 18:$s!==null&&(qf?(e=$s,n=n.stateNode,e.nodeType===8?pW(e.parentNode,n):e.nodeType===1&&pW(e,n),E2(e)):pW($s,n.stateNode));break;case 4:r=$s,i=qf,$s=n.stateNode.containerInfo,qf=!0,Rm(e,t,n),$s=r,qf=i;break;case 0:case 11:case 14:case 15:if(!wa&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&oZ(n,t,s),i=i.next}while(i!==r)}Rm(e,t,n);break;case 1:if(!wa&&(zw(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){qi(n,t,a)}Rm(e,t,n);break;case 21:Rm(e,t,n);break;case 22:n.mode&1?(wa=(r=wa)||n.memoizedState!==null,Rm(e,t,n),wa=r):Rm(e,t,n);break;default:Rm(e,t,n)}}function Eye(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ift),t.forEach(function(r){var i=Uft.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Mf(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:$s=a.stateNode,qf=!1;break e;case 3:$s=a.stateNode.containerInfo,qf=!0;break e;case 4:$s=a.stateNode.containerInfo,qf=!0;break e}a=a.return}if($s===null)throw Error(Ge(160));RMe(o,s,i),$s=null,qf=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){qi(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)DMe(t,e),t=t.sibling}function DMe(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Mf(t,e),Gd(e),r&4){try{vT(3,e,e.return),V7(3,e)}catch(g){qi(e,e.return,g)}try{vT(5,e,e.return)}catch(g){qi(e,e.return,g)}}break;case 1:Mf(t,e),Gd(e),r&512&&n!==null&&zw(n,n.return);break;case 5:if(Mf(t,e),Gd(e),r&512&&n!==null&&zw(n,n.return),e.flags&32){var i=e.stateNode;try{O2(i,"")}catch(g){qi(e,e.return,g)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&eDe(i,o),RX(a,s);var c=RX(a,o);for(s=0;s<l.length;s+=2){var u=l[s],f=l[s+1];u==="style"?oDe(i,f):u==="dangerouslySetInnerHTML"?rDe(i,f):u==="children"?O2(i,f):Yne(i,u,f,c)}switch(a){case"input":kX(i,o);break;case"textarea":tDe(i,o);break;case"select":var d=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?aS(i,!!o.multiple,h,!1):d!==!!o.multiple&&(o.defaultValue!=null?aS(i,!!o.multiple,o.defaultValue,!0):aS(i,!!o.multiple,o.multiple?[]:"",!1))}i[T2]=o}catch(g){qi(e,e.return,g)}}break;case 6:if(Mf(t,e),Gd(e),r&4){if(e.stateNode===null)throw Error(Ge(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(g){qi(e,e.return,g)}}break;case 3:if(Mf(t,e),Gd(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{E2(t.containerInfo)}catch(g){qi(e,e.return,g)}break;case 4:Mf(t,e),Gd(e);break;case 13:Mf(t,e),Gd(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(Tre=io())),r&4&&Eye(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(wa=(c=wa)||u,Mf(t,e),wa=c):Mf(t,e),Gd(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(vt=e,u=e.child;u!==null;){for(f=vt=u;vt!==null;){switch(d=vt,h=d.child,d.tag){case 0:case 11:case 14:case 15:vT(4,d,d.return);break;case 1:zw(d,d.return);var p=d.stateNode;if(typeof p.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(g){qi(r,n,g)}}break;case 5:zw(d,d.return);break;case 22:if(d.memoizedState!==null){_ye(f);continue}}h!==null?(h.return=d,vt=h):_ye(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{i=f.stateNode,c?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=iDe("display",s))}catch(g){qi(e,e.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){qi(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Mf(t,e),Gd(e),r&4&&Eye(e);break;case 21:break;default:Mf(t,e),Gd(e)}}function Gd(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(AMe(n)){var r=n;break e}n=n.return}throw Error(Ge(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(O2(i,""),r.flags&=-33);var o=Sye(e);lZ(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=Sye(e);aZ(e,a,s);break;default:throw Error(Ge(161))}}catch(l){qi(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function jft(e,t,n){vt=e,MMe(e)}function MMe(e,t,n){for(var r=(e.mode&1)!==0;vt!==null;){var i=vt,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||kM;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||wa;a=kM;var c=wa;if(kM=s,(wa=l)&&!c)for(vt=i;vt!==null;)s=vt,l=s.child,s.tag===22&&s.memoizedState!==null?kye(i):l!==null?(l.return=s,vt=l):kye(i);for(;o!==null;)vt=o,MMe(o),o=o.sibling;vt=i,kM=a,wa=c}Cye(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,vt=o):Cye(e)}}function Cye(e){for(;vt!==null;){var t=vt;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:wa||V7(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!wa)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Bf(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&lye(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}lye(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&E2(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Ge(163))}wa||t.flags&512&&sZ(t)}catch(d){qi(t,t.return,d)}}if(t===e){vt=null;break}if(n=t.sibling,n!==null){n.return=t.return,vt=n;break}vt=t.return}}function _ye(e){for(;vt!==null;){var t=vt;if(t===e){vt=null;break}var n=t.sibling;if(n!==null){n.return=t.return,vt=n;break}vt=t.return}}function kye(e){for(;vt!==null;){var t=vt;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{V7(4,t)}catch(l){qi(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){qi(t,i,l)}}var o=t.return;try{sZ(t)}catch(l){qi(t,o,l)}break;case 5:var s=t.return;try{sZ(t)}catch(l){qi(t,s,l)}}}catch(l){qi(t,t.return,l)}if(t===e){vt=null;break}var a=t.sibling;if(a!==null){a.return=t.return,vt=a;break}vt=t.return}}var Fft=Math.ceil,lj=am.ReactCurrentDispatcher,kre=am.ReactCurrentOwner,Ku=am.ReactCurrentBatchConfig,Un=0,ps=null,So=null,Ws=0,kc=0,Qw=dv(0),Uo=0,N2=null,kb=0,U7=0,$re=0,bT=null,Nl=null,Tre=0,rE=1/0,Yp=null,cj=!1,cZ=null,Yy=null,$M=!1,wy=null,uj=0,OT=0,uZ=null,m5=-1,y5=0;function fl(){return Un&6?io():m5!==-1?m5:m5=io()}function Gy(e){return e.mode&1?Un&2&&Ws!==0?Ws&-Ws:wft.transition!==null?(y5===0&&(y5=yDe()),y5):(e=_r,e!==0||(e=window.event,e=e===void 0?16:EDe(e.type)),e):1}function cd(e,t,n,r){if(50<OT)throw OT=0,uZ=null,Error(Ge(185));oR(e,n,r),(!(Un&2)||e!==ps)&&(e===ps&&(!(Un&2)&&(U7|=n),Uo===4&&dy(e,Ws)),Xl(e,r),n===1&&Un===0&&!(t.mode&1)&&(rE=io()+500,B7&&hv()))}function Xl(e,t){var n=e.callbackNode;wut(e,t);var r=HL(e,e===ps?Ws:0);if(r===0)n!==null&&Ime(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ime(n),t===1)e.tag===0?xft($ye.bind(null,e)):WDe($ye.bind(null,e)),yft(function(){!(Un&6)&&hv()}),n=null;else{switch(vDe(r)){case 1:n=tre;break;case 4:n=gDe;break;case 16:n=UL;break;case 536870912:n=mDe;break;default:n=UL}n=BMe(n,NMe.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function NMe(e,t){if(m5=-1,y5=0,Un&6)throw Error(Ge(327));var n=e.callbackNode;if(dS()&&e.callbackNode!==n)return null;var r=HL(e,e===ps?Ws:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=fj(e,r);else{t=r;var i=Un;Un|=2;var o=LMe();(ps!==e||Ws!==t)&&(Yp=null,rE=io()+500,J1(e,t));do try{Bft();break}catch(a){IMe(e,a)}while(!0);pre(),lj.current=o,Un=i,So!==null?t=0:(ps=null,Ws=0,t=Uo)}if(t!==0){if(t===2&&(i=LX(e),i!==0&&(r=i,t=fZ(e,i))),t===1)throw n=N2,J1(e,0),dy(e,r),Xl(e,io()),n;if(t===6)dy(e,r);else{if(i=e.current.alternate,!(r&30)&&!zft(i)&&(t=fj(e,r),t===2&&(o=LX(e),o!==0&&(r=o,t=fZ(e,o))),t===1))throw n=N2,J1(e,0),dy(e,r),Xl(e,io()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Ge(345));case 2:u1(e,Nl,Yp);break;case 3:if(dy(e,r),(r&130023424)===r&&(t=Tre+500-io(),10<t)){if(HL(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){fl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=VX(u1.bind(null,e,Nl,Yp),t);break}u1(e,Nl,Yp);break;case 4:if(dy(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-ld(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=io()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Fft(r/1960))-r,10<r){e.timeoutHandle=VX(u1.bind(null,e,Nl,Yp),r);break}u1(e,Nl,Yp);break;case 5:u1(e,Nl,Yp);break;default:throw Error(Ge(329))}}}return Xl(e,io()),e.callbackNode===n?NMe.bind(null,e):null}function fZ(e,t){var n=bT;return e.current.memoizedState.isDehydrated&&(J1(e,t).flags|=256),e=fj(e,t),e!==2&&(t=Nl,Nl=n,t!==null&&dZ(t)),e}function dZ(e){Nl===null?Nl=e:Nl.push.apply(Nl,e)}function zft(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!md(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function dy(e,t){for(t&=~$re,t&=~U7,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ld(t),r=1<<n;e[n]=-1,t&=~r}}function $ye(e){if(Un&6)throw Error(Ge(327));dS();var t=HL(e,0);if(!(t&1))return Xl(e,io()),null;var n=fj(e,t);if(e.tag!==0&&n===2){var r=LX(e);r!==0&&(t=r,n=fZ(e,r))}if(n===1)throw n=N2,J1(e,0),dy(e,t),Xl(e,io()),n;if(n===6)throw Error(Ge(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,u1(e,Nl,Yp),Xl(e,io()),null}function Pre(e,t){var n=Un;Un|=1;try{return e(t)}finally{Un=n,Un===0&&(rE=io()+500,B7&&hv())}}function $b(e){wy!==null&&wy.tag===0&&!(Un&6)&&dS();var t=Un;Un|=1;var n=Ku.transition,r=_r;try{if(Ku.transition=null,_r=1,e)return e()}finally{_r=r,Ku.transition=n,Un=t,!(Un&6)&&hv()}}function Are(){kc=Qw.current,fi(Qw)}function J1(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,mft(n)),So!==null)for(n=So.return;n!==null;){var r=n;switch(fre(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&KL();break;case 3:tE(),fi(Ul),fi(Fa),Ore();break;case 5:bre(r);break;case 4:tE();break;case 13:fi(Ai);break;case 19:fi(Ai);break;case 10:gre(r.type._context);break;case 22:case 23:Are()}n=n.return}if(ps=e,So=e=Ky(e.current,null),Ws=kc=t,Uo=0,N2=null,$re=U7=kb=0,Nl=bT=null,N1!==null){for(t=0;t<N1.length;t++)if(n=N1[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}N1=null}return e}function IMe(e,t){do{var n=So;try{if(pre(),h5.current=aj,sj){for(var r=Ri.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}sj=!1}if(_b=0,is=Fo=Ri=null,yT=!1,R2=0,kre.current=null,n===null||n.return===null){Uo=1,N2=t,So=null;break}e:{var o=e,s=n.return,a=n,l=t;if(t=Ws,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var d=u.alternate;d?(u.updateQueue=d.updateQueue,u.memoizedState=d.memoizedState,u.lanes=d.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=gye(s);if(h!==null){h.flags&=-257,mye(h,s,a,o,t),h.mode&1&&pye(o,c,t),t=h,l=c;var p=t.updateQueue;if(p===null){var g=new Set;g.add(l),t.updateQueue=g}else p.add(l);break e}else{if(!(t&1)){pye(o,c,t),Rre();break e}l=Error(Ge(426))}}else if(vi&&a.mode&1){var v=gye(s);if(v!==null){!(v.flags&65536)&&(v.flags|=256),mye(v,s,a,o,t),dre(nE(l,a));break e}}o=l=nE(l,a),Uo!==4&&(Uo=2),bT===null?bT=[o]:bT.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var y=bMe(o,l,t);aye(o,y);break e;case 1:a=l;var O=o.type,m=o.stateNode;if(!(o.flags&128)&&(typeof O.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Yy===null||!Yy.has(m)))){o.flags|=65536,t&=-t,o.lanes|=t;var w=OMe(o,a,t);aye(o,w);break e}}o=o.return}while(o!==null)}FMe(n)}catch(S){t=S,So===n&&n!==null&&(So=n=n.return);continue}break}while(!0)}function LMe(){var e=lj.current;return lj.current=aj,e===null?aj:e}function Rre(){(Uo===0||Uo===3||Uo===2)&&(Uo=4),ps===null||!(kb&268435455)&&!(U7&268435455)||dy(ps,Ws)}function fj(e,t){var n=Un;Un|=2;var r=LMe();(ps!==e||Ws!==t)&&(Yp=null,J1(e,t));do try{Qft();break}catch(i){IMe(e,i)}while(!0);if(pre(),Un=n,lj.current=r,So!==null)throw Error(Ge(261));return ps=null,Ws=0,Uo}function Qft(){for(;So!==null;)jMe(So)}function Bft(){for(;So!==null&&!hut();)jMe(So)}function jMe(e){var t=QMe(e.alternate,e,kc);e.memoizedProps=e.pendingProps,t===null?FMe(e):So=t,kre.current=null}function FMe(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Nft(n,t),n!==null){n.flags&=32767,So=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Uo=6,So=null;return}}else if(n=Mft(n,t,kc),n!==null){So=n;return}if(t=t.sibling,t!==null){So=t;return}So=t=e}while(t!==null);Uo===0&&(Uo=5)}function u1(e,t,n){var r=_r,i=Ku.transition;try{Ku.transition=null,_r=1,Wft(e,t,n,r)}finally{Ku.transition=i,_r=r}return null}function Wft(e,t,n,r){do dS();while(wy!==null);if(Un&6)throw Error(Ge(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Ge(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Sut(e,o),e===ps&&(So=ps=null,Ws=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||$M||($M=!0,BMe(UL,function(){return dS(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Ku.transition,Ku.transition=null;var s=_r;_r=1;var a=Un;Un|=4,kre.current=null,Lft(e,n),DMe(n,e),cft(WX),XL=!!BX,WX=BX=null,e.current=n,jft(n),put(),Un=a,_r=s,Ku.transition=o}else e.current=n;if($M&&($M=!1,wy=e,uj=i),o=e.pendingLanes,o===0&&(Yy=null),yut(n.stateNode),Xl(e,io()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(cj)throw cj=!1,e=cZ,cZ=null,e;return uj&1&&e.tag!==0&&dS(),o=e.pendingLanes,o&1?e===uZ?OT++:(OT=0,uZ=e):OT=0,hv(),null}function dS(){if(wy!==null){var e=vDe(uj),t=Ku.transition,n=_r;try{if(Ku.transition=null,_r=16>e?16:e,wy===null)var r=!1;else{if(e=wy,wy=null,uj=0,Un&6)throw Error(Ge(331));var i=Un;for(Un|=4,vt=e.current;vt!==null;){var o=vt,s=o.child;if(vt.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(vt=c;vt!==null;){var u=vt;switch(u.tag){case 0:case 11:case 15:vT(8,u,o)}var f=u.child;if(f!==null)f.return=u,vt=f;else for(;vt!==null;){u=vt;var d=u.sibling,h=u.return;if(PMe(u),u===c){vt=null;break}if(d!==null){d.return=h,vt=d;break}vt=h}}}var p=o.alternate;if(p!==null){var g=p.child;if(g!==null){p.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(g!==null)}}vt=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,vt=s;else e:for(;vt!==null;){if(o=vt,o.flags&2048)switch(o.tag){case 0:case 11:case 15:vT(9,o,o.return)}var y=o.sibling;if(y!==null){y.return=o.return,vt=y;break e}vt=o.return}}var O=e.current;for(vt=O;vt!==null;){s=vt;var m=s.child;if(s.subtreeFlags&2064&&m!==null)m.return=s,vt=m;else e:for(s=O;vt!==null;){if(a=vt,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:V7(9,a)}}catch(S){qi(a,a.return,S)}if(a===s){vt=null;break e}var w=a.sibling;if(w!==null){w.return=a.return,vt=w;break e}vt=a.return}}if(Un=i,hv(),Nh&&typeof Nh.onPostCommitFiberRoot=="function")try{Nh.onPostCommitFiberRoot(L7,e)}catch{}r=!0}return r}finally{_r=n,Ku.transition=t}}return!1}function Tye(e,t,n){t=nE(n,t),t=bMe(e,t,1),e=Zy(e,t,1),t=fl(),e!==null&&(oR(e,1,t),Xl(e,t))}function qi(e,t,n){if(e.tag===3)Tye(e,e,n);else for(;t!==null;){if(t.tag===3){Tye(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Yy===null||!Yy.has(r))){e=nE(n,e),e=OMe(t,e,1),t=Zy(t,e,1),e=fl(),t!==null&&(oR(t,1,e),Xl(t,e));break}}t=t.return}}function qft(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=fl(),e.pingedLanes|=e.suspendedLanes&n,ps===e&&(Ws&n)===n&&(Uo===4||Uo===3&&(Ws&130023424)===Ws&&500>io()-Tre?J1(e,0):$re|=n),Xl(e,t)}function zMe(e,t){t===0&&(e.mode&1?(t=vM,vM<<=1,!(vM&130023424)&&(vM=4194304)):t=1);var n=fl();e=Qg(e,t),e!==null&&(oR(e,t,n),Xl(e,n))}function Vft(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),zMe(e,n)}function Uft(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Ge(314))}r!==null&&r.delete(t),zMe(e,n)}var QMe;QMe=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ul.current)Ql=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ql=!1,Dft(e,t,n);Ql=!!(e.flags&131072)}else Ql=!1,vi&&t.flags&1048576&&qDe(t,tj,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;g5(e,t),e=t.pendingProps;var i=KS(t,Fa.current);fS(t,n),i=wre(null,t,r,e,i,n);var o=Sre();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Hl(r)?(o=!0,JL(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,yre(t),i.updater=W7,t.stateNode=i,i._reactInternals=t,KX(t,r,e,n),t=tZ(null,t,r,!0,o,n)):(t.tag=0,vi&&o&&ure(t),Ja(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(g5(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Xft(r),e=Bf(r,e),i){case 0:t=eZ(null,t,r,e,n);break e;case 1:t=bye(null,t,r,e,n);break e;case 11:t=yye(null,t,r,e,n);break e;case 14:t=vye(null,t,r,Bf(r.type,e),n);break e}throw Error(Ge(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bf(r,i),eZ(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bf(r,i),bye(e,t,r,i,n);case 3:e:{if(EMe(t),e===null)throw Error(Ge(387));r=t.pendingProps,o=t.memoizedState,i=o.element,XDe(e,t),ij(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=nE(Error(Ge(423)),t),t=Oye(e,t,r,n,i);break e}else if(r!==i){i=nE(Error(Ge(424)),t),t=Oye(e,t,r,n,i);break e}else for(zc=Xy(t.stateNode.containerInfo.firstChild),Hc=t,vi=!0,Hf=null,n=KDe(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(JS(),r===i){t=Bg(e,t,n);break e}Ja(e,t,r,n)}t=t.child}return t;case 5:return JDe(t),e===null&&ZX(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,qX(r,i)?s=null:o!==null&&qX(r,o)&&(t.flags|=32),SMe(e,t),Ja(e,t,s,n),t.child;case 6:return e===null&&ZX(t),null;case 13:return CMe(e,t,n);case 4:return vre(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=eE(t,null,r,n):Ja(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bf(r,i),yye(e,t,r,i,n);case 7:return Ja(e,t,t.pendingProps,n),t.child;case 8:return Ja(e,t,t.pendingProps.children,n),t.child;case 12:return Ja(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,ei(nj,r._currentValue),r._currentValue=s,o!==null)if(md(o.value,s)){if(o.children===i.children&&!Ul.current){t=Bg(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Cg(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),YX(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Ge(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),YX(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ja(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,fS(t,n),i=af(i),r=r(i),t.flags|=1,Ja(e,t,r,n),t.child;case 14:return r=t.type,i=Bf(r,t.pendingProps),i=Bf(r.type,i),vye(e,t,r,i,n);case 15:return xMe(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Bf(r,i),g5(e,t),t.tag=1,Hl(r)?(e=!0,JL(t)):e=!1,fS(t,n),YDe(t,r,i),KX(t,r,i,n),tZ(null,t,r,!0,e,n);case 19:return _Me(e,t,n);case 22:return wMe(e,t,n)}throw Error(Ge(156,t.tag))};function BMe(e,t){return pDe(e,t)}function Hft(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bu(e,t,n,r){return new Hft(e,t,n,r)}function Dre(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xft(e){if(typeof e=="function")return Dre(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Kne)return 11;if(e===Jne)return 14}return 2}function Ky(e,t){var n=e.alternate;return n===null?(n=Bu(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function v5(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")Dre(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Aw:return eb(n.children,i,o,t);case Gne:s=8,i|=8;break;case wX:return e=Bu(12,n,t,i|2),e.elementType=wX,e.lanes=o,e;case SX:return e=Bu(13,n,t,i),e.elementType=SX,e.lanes=o,e;case EX:return e=Bu(19,n,t,i),e.elementType=EX,e.lanes=o,e;case GRe:return H7(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ZRe:s=10;break e;case YRe:s=9;break e;case Kne:s=11;break e;case Jne:s=14;break e;case ey:s=16,r=null;break e}throw Error(Ge(130,e==null?e:typeof e,""))}return t=Bu(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function eb(e,t,n,r){return e=Bu(7,e,r,t),e.lanes=n,e}function H7(e,t,n,r){return e=Bu(22,e,r,t),e.elementType=GRe,e.lanes=n,e.stateNode={isHidden:!1},e}function wW(e,t,n){return e=Bu(6,e,null,t),e.lanes=n,e}function SW(e,t,n){return t=Bu(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Zft(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=rW(0),this.expirationTimes=rW(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rW(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Mre(e,t,n,r,i,o,s,a,l){return e=new Zft(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Bu(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},yre(o),e}function Yft(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Pw,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function WMe(e){if(!e)return w0;e=e._reactInternals;e:{if(QO(e)!==e||e.tag!==1)throw Error(Ge(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Hl(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Ge(171))}if(e.tag===1){var n=e.type;if(Hl(n))return BDe(e,n,t)}return t}function qMe(e,t,n,r,i,o,s,a,l){return e=Mre(n,r,!0,e,i,o,s,a,l),e.context=WMe(null),n=e.current,r=fl(),i=Gy(n),o=Cg(r,i),o.callback=t??null,Zy(n,o,i),e.current.lanes=i,oR(e,i,r),Xl(e,r),e}function X7(e,t,n,r){var i=t.current,o=fl(),s=Gy(i);return n=WMe(n),t.context===null?t.context=n:t.pendingContext=n,t=Cg(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Zy(i,t,s),e!==null&&(cd(e,i,s,o),d5(e,i,s)),s}function dj(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Pye(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Nre(e,t){Pye(e,t),(e=e.alternate)&&Pye(e,t)}function Gft(){return null}var VMe=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ire(e){this._internalRoot=e}Z7.prototype.render=Ire.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Ge(409));X7(e,t,null,null)};Z7.prototype.unmount=Ire.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$b(function(){X7(null,e,null,null)}),t[zg]=null}};function Z7(e){this._internalRoot=e}Z7.prototype.unstable_scheduleHydration=function(e){if(e){var t=xDe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<fy.length&&t!==0&&t<fy[n].priority;n++);fy.splice(n,0,e),n===0&&SDe(e)}};function Lre(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Y7(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Aye(){}function Kft(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var c=dj(s);o.call(c)}}var s=qMe(t,r,e,0,null,!1,!1,"",Aye);return e._reactRootContainer=s,e[zg]=s.current,k2(e.nodeType===8?e.parentNode:e),$b(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=dj(l);a.call(c)}}var l=Mre(e,0,!1,null,null,!1,!1,"",Aye);return e._reactRootContainer=l,e[zg]=l.current,k2(e.nodeType===8?e.parentNode:e),$b(function(){X7(t,l,n,r)}),l}function G7(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var l=dj(s);a.call(l)}}X7(t,s,e,i)}else s=Kft(n,t,e,i,r);return dj(s)}bDe=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=y$(t.pendingLanes);n!==0&&(nre(t,n|1),Xl(t,io()),!(Un&6)&&(rE=io()+500,hv()))}break;case 13:$b(function(){var r=Qg(e,1);if(r!==null){var i=fl();cd(r,e,1,i)}}),Nre(e,1)}};rre=function(e){if(e.tag===13){var t=Qg(e,134217728);if(t!==null){var n=fl();cd(t,e,134217728,n)}Nre(e,134217728)}};ODe=function(e){if(e.tag===13){var t=Gy(e),n=Qg(e,t);if(n!==null){var r=fl();cd(n,e,t,r)}Nre(e,t)}};xDe=function(){return _r};wDe=function(e,t){var n=_r;try{return _r=e,t()}finally{_r=n}};MX=function(e,t,n){switch(t){case"input":if(kX(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Q7(r);if(!i)throw Error(Ge(90));JRe(r),kX(r,i)}}}break;case"textarea":tDe(e,n);break;case"select":t=n.value,t!=null&&aS(e,!!n.multiple,t,!1)}};lDe=Pre;cDe=$b;var Jft={usingClientEntryPoint:!1,Events:[aR,Nw,Q7,sDe,aDe,Pre]},nk={findFiberByHostInstance:M1,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},edt={bundleType:nk.bundleType,version:nk.version,rendererPackageName:nk.rendererPackageName,rendererConfig:nk.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:am.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=dDe(e),e===null?null:e.stateNode},findFiberByHostInstance:nk.findFiberByHostInstance||Gft,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var TM=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!TM.isDisabled&&TM.supportsFiber)try{L7=TM.inject(edt),Nh=TM}catch{}}uu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jft;uu.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Lre(t))throw Error(Ge(200));return Yft(e,t,null,n)};uu.createRoot=function(e,t){if(!Lre(e))throw Error(Ge(299));var n=!1,r="",i=VMe;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Mre(e,1,!1,null,null,n,!1,r,i),e[zg]=t.current,k2(e.nodeType===8?e.parentNode:e),new Ire(t)};uu.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Ge(188)):(e=Object.keys(e).join(","),Error(Ge(268,e)));return e=dDe(t),e=e===null?null:e.stateNode,e};uu.flushSync=function(e){return $b(e)};uu.hydrate=function(e,t,n){if(!Y7(t))throw Error(Ge(200));return G7(null,e,t,!0,n)};uu.hydrateRoot=function(e,t,n){if(!Lre(e))throw Error(Ge(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=VMe;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=qMe(t,null,e,1,n??null,i,!1,o,s),e[zg]=t.current,k2(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Z7(t)};uu.render=function(e,t,n){if(!Y7(t))throw Error(Ge(200));return G7(null,e,t,!1,n)};uu.unmountComponentAtNode=function(e){if(!Y7(e))throw Error(Ge(40));return e._reactRootContainer?($b(function(){G7(null,null,e,!1,function(){e._reactRootContainer=null,e[zg]=null})}),!0):!1};uu.unstable_batchedUpdates=Pre;uu.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Y7(n))throw Error(Ge(200));if(e==null||e._reactInternals===void 0)throw Error(Ge(38));return G7(e,t,n,!1,r)};uu.version="18.2.0-next-9e3b772b8-20220608";function UMe(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(UMe)}catch(e){console.error(e)}}UMe(),qRe.exports=uu;var as=qRe.exports;const HMe=wf(as);var Rye=as;BL.createRoot=Rye.createRoot,BL.hydrateRoot=Rye.hydrateRoot;var Io={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let tdt=0;function hn(e,t){const n=`atom${++tdt}`,r={toString:()=>n};return typeof e=="function"?r.read=e:(r.init=e,r.read=ndt,r.write=rdt),t&&(r.write=t),r}function ndt(e){return e(this)}function rdt(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const EW=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,CW=e=>"init"in e,_W=e=>!!e.write,hj=new WeakMap,idt=(e,t)=>{hj.set(e,t),e.catch(()=>{}).finally(()=>hj.delete(e))},Dye=(e,t)=>{const n=hj.get(e);n&&(hj.delete(e),n(t))},Mye=(e,t)=>{e.status="fulfilled",e.value=t},Nye=(e,t)=>{e.status="rejected",e.reason=t},odt=e=>typeof(e==null?void 0:e.then)=="function",rk=(e,t)=>!!e&&"v"in e&&"v"in t&&Object.is(e.v,t.v),Iye=(e,t)=>!!e&&"e"in e&&"e"in t&&Object.is(e.e,t.e),Cx=e=>!!e&&"v"in e&&e.v instanceof Promise,sdt=(e,t)=>"v"in e&&"v"in t&&e.v.orig&&e.v.orig===t.v.orig,PM=e=>{if("e"in e)throw e.e;return e.v},K7=()=>{const e=new WeakMap,t=new WeakMap,n=new Map;let r,i;(Io?"production":void 0)!=="production"&&(r=new Set,i=new Set);const o=k=>e.get(k),s=(k,P)=>{(Io?"production":void 0)!=="production"&&Object.freeze(P);const D=o(k);if(e.set(k,P),n.has(k)||n.set(k,D),Cx(D)){const M="v"in P?P.v instanceof Promise?P.v:Promise.resolve(P.v):Promise.reject(P.e);D.v!==M&&Dye(D.v,M)}},a=(k,P,D,M)=>{const L=new Map(M?P.d:null);let A=!1;D.forEach((T,N)=>{!T&&EW(k,N)&&(T=P),T?(L.set(N,T),P.d.get(N)!==T&&(A=!0)):(Io?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(A||P.d.size!==L.size)&&(P.d=L)},l=(k,P,D,M)=>{const L=o(k),A={d:(L==null?void 0:L.d)||new Map,v:P};if(D&&a(k,A,D,M),rk(L,A)&&L.d===A.d)return L;if(Cx(L)&&Cx(A)&&sdt(L,A)){if(L.d===A.d)return L;A.v=L.v}return s(k,A),A},c=(k,P,D,M)=>{if(odt(P)){let L;const A=()=>{const N=o(k);if(!Cx(N)||N.v!==T)return;const j=l(k,T,D);t.has(k)&&N.d!==j.d&&S(k,j,N.d)},T=new Promise((N,j)=>{let z=!1;P.then(W=>{z||(z=!0,Mye(T,W),N(W),A())},W=>{z||(z=!0,Nye(T,W),j(W),A())}),L=W=>{z||(z=!0,W.then(F=>Mye(T,F),F=>Nye(T,F)),N(W))}});return T.orig=P,T.status="pending",idt(T,N=>{N&&L(N),M==null||M()}),l(k,T,D,!0)}return l(k,P,D)},u=(k,P,D)=>{const M=o(k),L={d:(M==null?void 0:M.d)||new Map,e:P};return D&&a(k,L,D),Iye(M,L)&&M.d===L.d?M:(s(k,L),L)},f=(k,P)=>{const D=o(k);if(!P&&D&&(t.has(k)||Array.from(D.d).every(([z,W])=>{if(z===k)return!0;const F=f(z);return F===W||rk(F,W)})))return D;const M=new Map;let L=!0;const A=z=>{if(EW(k,z)){const F=o(z);if(F)return M.set(z,F),PM(F);if(CW(z))return M.set(z,void 0),z.init;throw new Error("no atom init")}const W=f(z);return M.set(z,W),PM(W)};let T,N;const j={get signal(){return T||(T=new AbortController),T.signal},get setSelf(){return(Io?"production":void 0)!=="production"&&!_W(k)&&console.warn("setSelf function cannot be used with read-only atom"),!N&&_W(k)&&(N=(...z)=>{if((Io?"production":void 0)!=="production"&&L&&console.warn("setSelf function cannot be called in sync"),!L)return O(k,...z)}),N}};try{const z=k.read(A,j);return c(k,z,M,()=>T==null?void 0:T.abort())}catch(z){return u(k,z,M)}finally{L=!1}},d=k=>PM(f(k)),h=k=>{let P=t.get(k);return P||(P=m(k)),P},p=(k,P)=>!P.l.size&&(!P.t.size||P.t.size===1&&P.t.has(k)),g=k=>{const P=t.get(k);P&&p(k,P)&&w(k)},v=k=>{const P=T=>{var N;const j=new Set((N=t.get(T))==null?void 0:N.t);return n.forEach((z,W)=>{var F;(F=o(W))!=null&&F.d.has(T)&&j.add(W)}),j},D=new Array,M=new Set,L=T=>{if(!M.has(T)){M.add(T);for(const N of P(T))T!==N&&L(N);D.push(T)}};L(k);const A=new Set([k]);for(let T=D.length-1;T>=0;--T){const N=D[T],j=o(N);if(!j)continue;let z=!1;for(const W of j.d.keys())if(W!==N&&A.has(W)){z=!0;break}if(z){const W=f(N,!0);rk(j,W)||A.add(N)}}},y=(k,...P)=>{let D=!0;const M=T=>PM(f(T)),L=(T,...N)=>{let j;if(EW(k,T)){if(!CW(T))throw new Error("atom not writable");const z=o(T),W=c(T,N[0]);rk(z,W)||v(T)}else j=y(T,...N);if(!D){const z=E();(Io?"production":void 0)!=="production"&&r.forEach(W=>W({type:"async-write",flushed:z}))}return j},A=k.write(M,L,...P);return D=!1,A},O=(k,...P)=>{const D=y(k,...P),M=E();return(Io?"production":void 0)!=="production"&&r.forEach(L=>L({type:"write",flushed:M})),D},m=(k,P,D)=>{var M;const L=D||[];(M=o(k))==null||M.d.forEach((T,N)=>{const j=t.get(N);j?j.t.add(k):N!==k&&m(N,k,L)}),f(k);const A={t:new Set(P&&[P]),l:new Set};if(t.set(k,A),(Io?"production":void 0)!=="production"&&i.add(k),_W(k)&&k.onMount){const{onMount:T}=k;L.push(()=>{const N=T((...j)=>O(k,...j));N&&(A.u=N)})}return D||L.forEach(T=>T()),A},w=k=>{var P;const D=(P=t.get(k))==null?void 0:P.u;D&&D(),t.delete(k),(Io?"production":void 0)!=="production"&&i.delete(k);const M=o(k);M?(Cx(M)&&Dye(M.v),M.d.forEach((L,A)=>{if(A!==k){const T=t.get(A);T&&(T.t.delete(k),p(A,T)&&w(A))}})):(Io?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",k)},S=(k,P,D)=>{const M=new Set(P.d.keys()),L=new Set;D==null||D.forEach((A,T)=>{if(M.has(T)){M.delete(T);return}L.add(T);const N=t.get(T);N&&N.t.delete(k)}),M.forEach(A=>{const T=t.get(A);T?T.t.add(k):t.has(k)&&m(A,k)}),L.forEach(A=>{const T=t.get(A);T&&p(A,T)&&w(A)})},E=()=>{let k;for((Io?"production":void 0)!=="production"&&(k=new Set);n.size;){const P=Array.from(n);n.clear(),P.forEach(([D,M])=>{const L=o(D);if(L){const A=t.get(D);A&&L.d!==(M==null?void 0:M.d)&&S(D,L,M==null?void 0:M.d),A&&!(!Cx(M)&&(rk(M,L)||Iye(M,L)))&&(A.l.forEach(T=>T()),(Io?"production":void 0)!=="production"&&k.add(D))}else(Io?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((Io?"production":void 0)!=="production")return k},C=(k,P)=>{const D=h(k),M=E(),L=D.l;return L.add(P),(Io?"production":void 0)!=="production"&&r.forEach(A=>A({type:"sub",flushed:M})),()=>{L.delete(P),g(k),(Io?"production":void 0)!=="production"&&r.forEach(A=>A({type:"unsub"}))}};return(Io?"production":void 0)!=="production"?{get:d,set:O,sub:C,dev_subscribe_store:(k,P)=>{if(P!==2)throw new Error("The current StoreListener revision is 2.");return r.add(k),()=>{r.delete(k)}},dev_get_mounted_atoms:()=>i.values(),dev_get_atom_state:k=>e.get(k),dev_get_mounted:k=>t.get(k),dev_restore_atoms:k=>{for(const[D,M]of k)CW(D)&&(c(D,M),v(D));const P=E();r.forEach(D=>D({type:"restore",flushed:P}))}}:{get:d,set:O,sub:C}};let kW;(Io?"production":void 0)!=="production"&&(typeof globalThis.__NUMBER_OF_JOTAI_INSTANCES__=="number"?++globalThis.__NUMBER_OF_JOTAI_INSTANCES__:globalThis.__NUMBER_OF_JOTAI_INSTANCES__=1);const adt=()=>(kW||((Io?"production":void 0)!=="production"&&globalThis.__NUMBER_OF_JOTAI_INSTANCES__!==1&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"),kW=K7()),kW);var ldt={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const XMe=x.createContext(void 0),ZMe=e=>{const t=x.useContext(XMe);return(e==null?void 0:e.store)||t||adt()},YMe=({children:e,store:t})=>{const n=x.useRef();return!t&&!n.current&&(n.current=K7()),x.createElement(XMe.Provider,{value:t||n.current},e)},cdt=e=>typeof(e==null?void 0:e.then)=="function",udt=ie.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)});function Gi(e,t){const n=ZMe(t),[[r,i,o],s]=x.useReducer(c=>{const u=n.get(e);return Object.is(c[0],u)&&c[1]===n&&c[2]===e?c:[u,n,e]},void 0,()=>[n.get(e),n,e]);let a=r;(i!==n||o!==e)&&(s(),a=n.get(e));const l=t==null?void 0:t.delay;return x.useEffect(()=>{const c=n.sub(e,()=>{if(typeof l=="number"){setTimeout(s,l);return}s()});return s(),c},[n,e,l]),x.useDebugValue(a),cdt(a)?udt(a):a}function vl(e,t){const n=ZMe(t);return x.useCallback((...i)=>{if((ldt?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...i)},[n,e])}function tc(e,t){return[Gi(e,t),vl(e,t)]}const Tn=K7();async function fdt(e,t){return t(Tn.get(e))?Tn.get(e):new Promise(n=>{const r=Tn.sub(e,()=>{const i=Tn.get(e);t(i)&&(r(),n(i))})})}var Yn;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Yn||(Yn={}));var hZ;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(hZ||(hZ={}));const gt=Yn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hy=e=>{switch(typeof e){case"undefined":return gt.undefined;case"string":return gt.string;case"number":return isNaN(e)?gt.nan:gt.number;case"boolean":return gt.boolean;case"function":return gt.function;case"bigint":return gt.bigint;case"symbol":return gt.symbol;case"object":return Array.isArray(e)?gt.array:e===null?gt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?gt.promise:typeof Map<"u"&&e instanceof Map?gt.map:typeof Set<"u"&&e instanceof Set?gt.set:typeof Date<"u"&&e instanceof Date?gt.date:gt.object;default:return gt.unknown}},et=Yn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ddt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ju extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Yn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ju.create=e=>new Ju(e);const I2=(e,t)=>{let n;switch(e.code){case et.invalid_type:e.received===gt.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case et.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Yn.jsonStringifyReplacer)}`;break;case et.unrecognized_keys:n=`Unrecognized key(s) in object: ${Yn.joinValues(e.keys,", ")}`;break;case et.invalid_union:n="Invalid input";break;case et.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Yn.joinValues(e.options)}`;break;case et.invalid_enum_value:n=`Invalid enum value. Expected ${Yn.joinValues(e.options)}, received '${e.received}'`;break;case et.invalid_arguments:n="Invalid function arguments";break;case et.invalid_return_type:n="Invalid function return type";break;case et.invalid_date:n="Invalid date";break;case et.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Yn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case et.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case et.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case et.custom:n="Invalid input";break;case et.invalid_intersection_types:n="Intersection results could not be merged";break;case et.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case et.not_finite:n="Number must be finite";break;default:n=t.defaultError,Yn.assertNever(e)}return{message:n}};let GMe=I2;function hdt(e){GMe=e}function pj(){return GMe}const gj=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:t,defaultError:a}).message;return{...i,path:o,message:i.message||a}},pdt=[];function yt(e,t){const n=gj({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,pj(),I2].filter(r=>!!r)});e.common.issues.push(n)}class za{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return tn;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return za.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return tn;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const tn=Object.freeze({status:"aborted"}),KMe=e=>({status:"dirty",value:e}),bl=e=>({status:"valid",value:e}),pZ=e=>e.status==="aborted",gZ=e=>e.status==="dirty",L2=e=>e.status==="valid",mj=e=>typeof Promise<"u"&&e instanceof Promise;var Ft;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ft||(Ft={}));class Zh{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Lye=(e,t)=>{if(L2(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ju(e.common.issues);return this._error=n,this._error}}};function sn(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class mn{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return hy(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:hy(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new za,ctx:{common:t.parent.common,data:t.data,parsedType:hy(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(mj(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:hy(t)},o=this._parseSync({data:t,path:i.path,parent:i});return Lye(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:hy(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(mj(i)?i:Promise.resolve(i));return Lye(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),a=()=>o.addIssue({code:et.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new yd({schema:this,typeName:qt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return _g.create(this,this._def)}nullable(){return Ab.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ud.create(this,this._def)}promise(){return oE.create(this,this._def)}or(t){return Q2.create([this,t],this._def)}and(t){return B2.create(this,t,this._def)}transform(t){return new yd({...sn(this._def),schema:this,typeName:qt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new H2({...sn(this._def),innerType:this,defaultValue:n,typeName:qt.ZodDefault})}brand(){return new eNe({typeName:qt.ZodBranded,type:this,...sn(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Oj({...sn(this._def),innerType:this,catchValue:n,typeName:qt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return cR.create(this,t)}readonly(){return wj.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const gdt=/^c[^\s-]{8,}$/i,mdt=/^[a-z][a-z0-9]*$/,ydt=/^[0-9A-HJKMNP-TV-Z]{26}$/,vdt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,bdt=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Odt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $W;const xdt=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,wdt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Sdt=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Edt(e,t){return!!((t==="v4"||!t)&&xdt.test(e)||(t==="v6"||!t)&&wdt.test(e))}class td extends mn{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==gt.string){const o=this._getOrReturnCtx(t);return yt(o,{code:et.invalid_type,expected:gt.string,received:o.parsedType}),tn}const r=new za;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),yt(i,{code:et.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),yt(i,{code:et.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?yt(i,{code:et.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&yt(i,{code:et.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")bdt.test(t.data)||(i=this._getOrReturnCtx(t,i),yt(i,{validation:"email",code:et.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")$W||($W=new RegExp(Odt,"u")),$W.test(t.data)||(i=this._getOrReturnCtx(t,i),yt(i,{validation:"emoji",code:et.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")vdt.test(t.data)||(i=this._getOrReturnCtx(t,i),yt(i,{validation:"uuid",code:et.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")gdt.test(t.data)||(i=this._getOrReturnCtx(t,i),yt(i,{validation:"cuid",code:et.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")mdt.test(t.data)||(i=this._getOrReturnCtx(t,i),yt(i,{validation:"cuid2",code:et.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")ydt.test(t.data)||(i=this._getOrReturnCtx(t,i),yt(i,{validation:"ulid",code:et.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),yt(i,{validation:"url",code:et.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),yt(i,{validation:"regex",code:et.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),yt(i,{code:et.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),yt(i,{code:et.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),yt(i,{code:et.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Sdt(o).test(t.data)||(i=this._getOrReturnCtx(t,i),yt(i,{code:et.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Edt(t.data,o.version)||(i=this._getOrReturnCtx(t,i),yt(i,{validation:"ip",code:et.invalid_string,message:o.message}),r.dirty()):Yn.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:et.invalid_string,...Ft.errToObj(r)})}_addCheck(t){return new td({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ft.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ft.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ft.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ft.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ft.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ft.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ft.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ft.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Ft.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ft.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ft.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ft.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ft.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ft.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ft.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ft.errToObj(n)})}nonempty(t){return this.min(1,Ft.errToObj(t))}trim(){return new td({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new td({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new td({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}td.create=e=>{var t;return new td({checks:[],typeName:qt.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...sn(e)})};function Cdt(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),s=parseInt(t.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}class S0 extends mn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==gt.number){const o=this._getOrReturnCtx(t);return yt(o,{code:et.invalid_type,expected:gt.number,received:o.parsedType}),tn}let r;const i=new za;for(const o of this._def.checks)o.kind==="int"?Yn.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),yt(r,{code:et.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:et.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:et.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Cdt(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),yt(r,{code:et.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),yt(r,{code:et.not_finite,message:o.message}),i.dirty()):Yn.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ft.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ft.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ft.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ft.toString(n))}setLimit(t,n,r,i){return new S0({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ft.toString(i)}]})}_addCheck(t){return new S0({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ft.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ft.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ft.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ft.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ft.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ft.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ft.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ft.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ft.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Yn.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}S0.create=e=>new S0({checks:[],typeName:qt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...sn(e)});class E0 extends mn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==gt.bigint){const o=this._getOrReturnCtx(t);return yt(o,{code:et.invalid_type,expected:gt.bigint,received:o.parsedType}),tn}let r;const i=new za;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:et.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:et.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:et.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Yn.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ft.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ft.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ft.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ft.toString(n))}setLimit(t,n,r,i){return new E0({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ft.toString(i)}]})}_addCheck(t){return new E0({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ft.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ft.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ft.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ft.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ft.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}E0.create=e=>{var t;return new E0({checks:[],typeName:qt.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...sn(e)})};class j2 extends mn{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==gt.boolean){const r=this._getOrReturnCtx(t);return yt(r,{code:et.invalid_type,expected:gt.boolean,received:r.parsedType}),tn}return bl(t.data)}}j2.create=e=>new j2({typeName:qt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...sn(e)});class Tb extends mn{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==gt.date){const o=this._getOrReturnCtx(t);return yt(o,{code:et.invalid_type,expected:gt.date,received:o.parsedType}),tn}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return yt(o,{code:et.invalid_date}),tn}const r=new za;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),yt(i,{code:et.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),yt(i,{code:et.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Yn.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Tb({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ft.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ft.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Tb.create=e=>new Tb({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:qt.ZodDate,...sn(e)});class yj extends mn{_parse(t){if(this._getType(t)!==gt.symbol){const r=this._getOrReturnCtx(t);return yt(r,{code:et.invalid_type,expected:gt.symbol,received:r.parsedType}),tn}return bl(t.data)}}yj.create=e=>new yj({typeName:qt.ZodSymbol,...sn(e)});class F2 extends mn{_parse(t){if(this._getType(t)!==gt.undefined){const r=this._getOrReturnCtx(t);return yt(r,{code:et.invalid_type,expected:gt.undefined,received:r.parsedType}),tn}return bl(t.data)}}F2.create=e=>new F2({typeName:qt.ZodUndefined,...sn(e)});class z2 extends mn{_parse(t){if(this._getType(t)!==gt.null){const r=this._getOrReturnCtx(t);return yt(r,{code:et.invalid_type,expected:gt.null,received:r.parsedType}),tn}return bl(t.data)}}z2.create=e=>new z2({typeName:qt.ZodNull,...sn(e)});class iE extends mn{constructor(){super(...arguments),this._any=!0}_parse(t){return bl(t.data)}}iE.create=e=>new iE({typeName:qt.ZodAny,...sn(e)});class tb extends mn{constructor(){super(...arguments),this._unknown=!0}_parse(t){return bl(t.data)}}tb.create=e=>new tb({typeName:qt.ZodUnknown,...sn(e)});class Wg extends mn{_parse(t){const n=this._getOrReturnCtx(t);return yt(n,{code:et.invalid_type,expected:gt.never,received:n.parsedType}),tn}}Wg.create=e=>new Wg({typeName:qt.ZodNever,...sn(e)});class vj extends mn{_parse(t){if(this._getType(t)!==gt.undefined){const r=this._getOrReturnCtx(t);return yt(r,{code:et.invalid_type,expected:gt.void,received:r.parsedType}),tn}return bl(t.data)}}vj.create=e=>new vj({typeName:qt.ZodVoid,...sn(e)});class ud extends mn{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==gt.array)return yt(n,{code:et.invalid_type,expected:gt.array,received:n.parsedType}),tn;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(yt(n,{code:s?et.too_big:et.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(yt(n,{code:et.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(yt(n,{code:et.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Zh(n,s,n.path,a)))).then(s=>za.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new Zh(n,s,n.path,a)));return za.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new ud({...this._def,minLength:{value:t,message:Ft.toString(n)}})}max(t,n){return new ud({...this._def,maxLength:{value:t,message:Ft.toString(n)}})}length(t,n){return new ud({...this._def,exactLength:{value:t,message:Ft.toString(n)}})}nonempty(t){return this.min(1,t)}}ud.create=(e,t)=>new ud({type:e,minLength:null,maxLength:null,exactLength:null,typeName:qt.ZodArray,...sn(t)});function vw(e){if(e instanceof Pi){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=_g.create(vw(r))}return new Pi({...e._def,shape:()=>t})}else return e instanceof ud?new ud({...e._def,type:vw(e.element)}):e instanceof _g?_g.create(vw(e.unwrap())):e instanceof Ab?Ab.create(vw(e.unwrap())):e instanceof Yh?Yh.create(e.items.map(t=>vw(t))):e}class Pi extends mn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Yn.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==gt.object){const c=this._getOrReturnCtx(t);return yt(c,{code:et.invalid_type,expected:gt.object,received:c.parsedType}),tn}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Wg&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const u=o[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Zh(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Wg){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(yt(i,{code:et.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Zh(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key;c.push({key:f,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>za.mergeObjectSync(r,c)):za.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Ft.errToObj,new Pi({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const l=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ft.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Pi({...this._def,unknownKeys:"strip"})}passthrough(){return new Pi({...this._def,unknownKeys:"passthrough"})}extend(t){return new Pi({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Pi({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:qt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Pi({...this._def,catchall:t})}pick(t){const n={};return Yn.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Pi({...this._def,shape:()=>n})}omit(t){const n={};return Yn.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Pi({...this._def,shape:()=>n})}deepPartial(){return vw(this)}partial(t){const n={};return Yn.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Pi({...this._def,shape:()=>n})}required(t){const n={};return Yn.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof _g;)o=o._def.innerType;n[r]=o}}),new Pi({...this._def,shape:()=>n})}keyof(){return JMe(Yn.objectKeys(this.shape))}}Pi.create=(e,t)=>new Pi({shape:()=>e,unknownKeys:"strip",catchall:Wg.create(),typeName:qt.ZodObject,...sn(t)});Pi.strictCreate=(e,t)=>new Pi({shape:()=>e,unknownKeys:"strict",catchall:Wg.create(),typeName:qt.ZodObject,...sn(t)});Pi.lazycreate=(e,t)=>new Pi({shape:e,unknownKeys:"strip",catchall:Wg.create(),typeName:qt.ZodObject,...sn(t)});class Q2 extends mn{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Ju(a.ctx.common.issues));return yt(n,{code:et.invalid_union,unionErrors:s}),tn}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(l=>new Ju(l));return yt(n,{code:et.invalid_union,unionErrors:a}),tn}}get options(){return this._def.options}}Q2.create=(e,t)=>new Q2({options:e,typeName:qt.ZodUnion,...sn(t)});const b5=e=>e instanceof q2?b5(e.schema):e instanceof yd?b5(e.innerType()):e instanceof V2?[e.value]:e instanceof C0?e.options:e instanceof U2?Object.keys(e.enum):e instanceof H2?b5(e._def.innerType):e instanceof F2?[void 0]:e instanceof z2?[null]:null;class J7 extends mn{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==gt.object)return yt(n,{code:et.invalid_type,expected:gt.object,received:n.parsedType}),tn;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(yt(n,{code:et.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),tn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const s=b5(o.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,o)}}return new J7({typeName:qt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...sn(r)})}}function mZ(e,t){const n=hy(e),r=hy(t);if(e===t)return{valid:!0,data:e};if(n===gt.object&&r===gt.object){const i=Yn.objectKeys(t),o=Yn.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const l=mZ(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===gt.array&&r===gt.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],a=t[o],l=mZ(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===gt.date&&r===gt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class B2 extends mn{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(pZ(o)||pZ(s))return tn;const a=mZ(o.value,s.value);return a.valid?((gZ(o)||gZ(s))&&n.dirty(),{status:n.value,value:a.data}):(yt(r,{code:et.invalid_intersection_types}),tn)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}B2.create=(e,t,n)=>new B2({left:e,right:t,typeName:qt.ZodIntersection,...sn(n)});class Yh extends mn{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==gt.array)return yt(r,{code:et.invalid_type,expected:gt.array,received:r.parsedType}),tn;if(r.data.length<this._def.items.length)return yt(r,{code:et.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),tn;!this._def.rest&&r.data.length>this._def.items.length&&(yt(r,{code:et.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Zh(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>za.mergeArray(n,s)):za.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Yh({...this._def,rest:t})}}Yh.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yh({items:e,typeName:qt.ZodTuple,rest:null,...sn(t)})};class W2 extends mn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==gt.object)return yt(r,{code:et.invalid_type,expected:gt.object,received:r.parsedType}),tn;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new Zh(r,a,r.path,a)),value:s._parse(new Zh(r,r.data[a],r.path,a))});return r.common.async?za.mergeObjectAsync(n,i):za.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof mn?new W2({keyType:t,valueType:n,typeName:qt.ZodRecord,...sn(r)}):new W2({keyType:td.create(),valueType:t,typeName:qt.ZodRecord,...sn(n)})}}class bj extends mn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==gt.map)return yt(r,{code:et.invalid_type,expected:gt.map,received:r.parsedType}),tn;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new Zh(r,a,r.path,[c,"key"])),value:o._parse(new Zh(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return tn;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return tn;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}bj.create=(e,t,n)=>new bj({valueType:t,keyType:e,typeName:qt.ZodMap,...sn(n)});class Pb extends mn{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==gt.set)return yt(r,{code:et.invalid_type,expected:gt.set,received:r.parsedType}),tn;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(yt(r,{code:et.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(yt(r,{code:et.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return tn;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>o._parse(new Zh(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,n){return new Pb({...this._def,minSize:{value:t,message:Ft.toString(n)}})}max(t,n){return new Pb({...this._def,maxSize:{value:t,message:Ft.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Pb.create=(e,t)=>new Pb({valueType:e,minSize:null,maxSize:null,typeName:qt.ZodSet,...sn(t)});class hS extends mn{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==gt.function)return yt(n,{code:et.invalid_type,expected:gt.function,received:n.parsedType}),tn;function r(a,l){return gj({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,pj(),I2].filter(c=>!!c),issueData:{code:et.invalid_arguments,argumentsError:l}})}function i(a,l){return gj({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,pj(),I2].filter(c=>!!c),issueData:{code:et.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof oE){const a=this;return bl(async function(...l){const c=new Ju([]),u=await a._def.args.parseAsync(l,o).catch(h=>{throw c.addIssue(r(l,h)),c}),f=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(f,o).catch(h=>{throw c.addIssue(i(f,h)),c})})}else{const a=this;return bl(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new Ju([r(l,c.error)]);const u=Reflect.apply(s,this,c.data),f=a._def.returns.safeParse(u,o);if(!f.success)throw new Ju([i(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new hS({...this._def,args:Yh.create(t).rest(tb.create())})}returns(t){return new hS({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new hS({args:t||Yh.create([]).rest(tb.create()),returns:n||tb.create(),typeName:qt.ZodFunction,...sn(r)})}}class q2 extends mn{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}q2.create=(e,t)=>new q2({getter:e,typeName:qt.ZodLazy,...sn(t)});class V2 extends mn{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return yt(n,{received:n.data,code:et.invalid_literal,expected:this._def.value}),tn}return{status:"valid",value:t.data}}get value(){return this._def.value}}V2.create=(e,t)=>new V2({value:e,typeName:qt.ZodLiteral,...sn(t)});function JMe(e,t){return new C0({values:e,typeName:qt.ZodEnum,...sn(t)})}class C0 extends mn{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return yt(n,{expected:Yn.joinValues(r),received:n.parsedType,code:et.invalid_type}),tn}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return yt(n,{received:n.data,code:et.invalid_enum_value,options:r}),tn}return bl(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return C0.create(t)}exclude(t){return C0.create(this.options.filter(n=>!t.includes(n)))}}C0.create=JMe;class U2 extends mn{_parse(t){const n=Yn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==gt.string&&r.parsedType!==gt.number){const i=Yn.objectValues(n);return yt(r,{expected:Yn.joinValues(i),received:r.parsedType,code:et.invalid_type}),tn}if(n.indexOf(t.data)===-1){const i=Yn.objectValues(n);return yt(r,{received:r.data,code:et.invalid_enum_value,options:i}),tn}return bl(t.data)}get enum(){return this._def.values}}U2.create=(e,t)=>new U2({values:e,typeName:qt.ZodNativeEnum,...sn(t)});class oE extends mn{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==gt.promise&&n.common.async===!1)return yt(n,{code:et.invalid_type,expected:gt.promise,received:n.parsedType}),tn;const r=n.parsedType===gt.promise?n.data:Promise.resolve(n.data);return bl(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}oE.create=(e,t)=>new oE({type:e,typeName:qt.ZodPromise,...sn(t)});class yd extends mn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===qt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{yt(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(i.type==="refinement"){const s=a=>{const l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?tn:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?tn:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!L2(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>L2(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);Yn.assertNever(i)}}yd.create=(e,t,n)=>new yd({schema:e,typeName:qt.ZodEffects,effect:t,...sn(n)});yd.createWithPreprocess=(e,t,n)=>new yd({schema:t,effect:{type:"preprocess",transform:e},typeName:qt.ZodEffects,...sn(n)});class _g extends mn{_parse(t){return this._getType(t)===gt.undefined?bl(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}_g.create=(e,t)=>new _g({innerType:e,typeName:qt.ZodOptional,...sn(t)});class Ab extends mn{_parse(t){return this._getType(t)===gt.null?bl(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ab.create=(e,t)=>new Ab({innerType:e,typeName:qt.ZodNullable,...sn(t)});class H2 extends mn{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===gt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}H2.create=(e,t)=>new H2({innerType:e,typeName:qt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...sn(t)});class Oj extends mn{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return mj(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ju(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ju(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Oj.create=(e,t)=>new Oj({innerType:e,typeName:qt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...sn(t)});class xj extends mn{_parse(t){if(this._getType(t)!==gt.nan){const r=this._getOrReturnCtx(t);return yt(r,{code:et.invalid_type,expected:gt.nan,received:r.parsedType}),tn}return{status:"valid",value:t.data}}}xj.create=e=>new xj({typeName:qt.ZodNaN,...sn(e)});const _dt=Symbol("zod_brand");class eNe extends mn{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class cR extends mn{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?tn:o.status==="dirty"?(n.dirty(),KMe(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?tn:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new cR({in:t,out:n,typeName:qt.ZodPipeline})}}class wj extends mn{_parse(t){const n=this._def.innerType._parse(t);return L2(n)&&(n.value=Object.freeze(n.value)),n}}wj.create=(e,t)=>new wj({innerType:e,typeName:qt.ZodReadonly,...sn(t)});const tNe=(e,t={},n)=>e?iE.create().superRefine((r,i)=>{var o,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:l})}}):iE.create(),kdt={object:Pi.lazycreate};var qt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(qt||(qt={}));const $dt=(e,t={message:`Input not instance of ${e.name}`})=>tNe(n=>n instanceof e,t),nNe=td.create,rNe=S0.create,Tdt=xj.create,Pdt=E0.create,iNe=j2.create,Adt=Tb.create,Rdt=yj.create,Ddt=F2.create,Mdt=z2.create,Ndt=iE.create,Idt=tb.create,Ldt=Wg.create,jdt=vj.create,Fdt=ud.create,zdt=Pi.create,Qdt=Pi.strictCreate,Bdt=Q2.create,Wdt=J7.create,qdt=B2.create,Vdt=Yh.create,Udt=W2.create,Hdt=bj.create,Xdt=Pb.create,Zdt=hS.create,Ydt=q2.create,Gdt=V2.create,Kdt=C0.create,Jdt=U2.create,eht=oE.create,jye=yd.create,tht=_g.create,nht=Ab.create,rht=yd.createWithPreprocess,iht=cR.create,oht=()=>nNe().optional(),sht=()=>rNe().optional(),aht=()=>iNe().optional(),lht={string:e=>td.create({...e,coerce:!0}),number:e=>S0.create({...e,coerce:!0}),boolean:e=>j2.create({...e,coerce:!0}),bigint:e=>E0.create({...e,coerce:!0}),date:e=>Tb.create({...e,coerce:!0})},cht=tn;var Y=Object.freeze({__proto__:null,defaultErrorMap:I2,setErrorMap:hdt,getErrorMap:pj,makeIssue:gj,EMPTY_PATH:pdt,addIssueToContext:yt,ParseStatus:za,INVALID:tn,DIRTY:KMe,OK:bl,isAborted:pZ,isDirty:gZ,isValid:L2,isAsync:mj,get util(){return Yn},get objectUtil(){return hZ},ZodParsedType:gt,getParsedType:hy,ZodType:mn,ZodString:td,ZodNumber:S0,ZodBigInt:E0,ZodBoolean:j2,ZodDate:Tb,ZodSymbol:yj,ZodUndefined:F2,ZodNull:z2,ZodAny:iE,ZodUnknown:tb,ZodNever:Wg,ZodVoid:vj,ZodArray:ud,ZodObject:Pi,ZodUnion:Q2,ZodDiscriminatedUnion:J7,ZodIntersection:B2,ZodTuple:Yh,ZodRecord:W2,ZodMap:bj,ZodSet:Pb,ZodFunction:hS,ZodLazy:q2,ZodLiteral:V2,ZodEnum:C0,ZodNativeEnum:U2,ZodPromise:oE,ZodEffects:yd,ZodTransformer:yd,ZodOptional:_g,ZodNullable:Ab,ZodDefault:H2,ZodCatch:Oj,ZodNaN:xj,BRAND:_dt,ZodBranded:eNe,ZodPipeline:cR,ZodReadonly:wj,custom:tNe,Schema:mn,ZodSchema:mn,late:kdt,get ZodFirstPartyTypeKind(){return qt},coerce:lht,any:Ndt,array:Fdt,bigint:Pdt,boolean:iNe,date:Adt,discriminatedUnion:Wdt,effect:jye,enum:Kdt,function:Zdt,instanceof:$dt,intersection:qdt,lazy:Ydt,literal:Gdt,map:Hdt,nan:Tdt,nativeEnum:Jdt,never:Ldt,null:Mdt,nullable:nht,number:rNe,object:zdt,oboolean:aht,onumber:sht,optional:tht,ostring:oht,pipeline:iht,preprocess:rht,promise:eht,record:Udt,set:Xdt,strictObject:Qdt,string:nNe,symbol:Rdt,transformer:jye,tuple:Vdt,undefined:Ddt,union:Bdt,unknown:Idt,void:jdt,NEVER:cht,ZodIssueCode:et,quotelessJson:ddt,ZodError:Ju});const Fye={debug:(...e)=>{},log:(...e)=>{console.log(...e)},warn:(...e)=>{console.warn(...e)},error:(...e)=>{console.error(...e)}};function uht(){return typeof window<"u"&&window.Logger||Fye}const At=uht();function bi(e,t){if(!e)throw new Error(t)}function jre(){return e6("marimo-version","version")}function fht(){return e6("marimo-server-token","token")}function dht(){return e6("marimo-app-config","config")}function hht(){return e6("marimo-user-config","config")}function pht(){const e=document.querySelector("marimo-code");bi(e,"internal-error: marimo-code not tag not found");const t=e.innerHTML;return decodeURIComponent(t).trim()}function e6(e,t){const n=document.querySelector(e);bi(n!==null&&n instanceof HTMLElement,`internal-error: ${e} tag not found`);const r=n.dataset[t];return bi(r!==void 0,`internal-error: ${e} tag does not have ${t}`),r}const Fre=["pip","uv","rye","poetry","pixi"],Sj=Y.object({completion:Y.object({activate_on_typing:Y.boolean().default(!0),copilot:Y.boolean().default(!1)}).default({}),save:Y.object({autosave:Y.enum(["off","after_delay"]).default("after_delay"),autosave_delay:Y.number().nonnegative().transform(e=>Math.max(e,1e3)).default(1e3),format_on_save:Y.boolean().default(!1)}).default({}),formatting:Y.object({line_length:Y.number().nonnegative().default(79).transform(e=>Math.min(e,1e3))}).default({}),keymap:Y.object({preset:Y.enum(["default","vim"]).default("default")}).default({}),runtime:Y.object({auto_instantiate:Y.boolean().default(!0)}).default({}),display:Y.object({theme:Y.enum(["light","dark","system"]).default("light"),code_editor_font_size:Y.number().nonnegative().default(14),cell_output:Y.enum(["above","below"]).default("above")}).default({}),package_management:Y.object({manager:Y.enum(Fre).default("pip")}).default({manager:"pip"}),ai:Y.object({open_ai:Y.object({api_key:Y.string().optional(),base_url:Y.string().optional(),model:Y.string().optional()}).optional()}).default({}),experimental:Y.object({}).passthrough().default({})}).passthrough().default({completion:{},save:{},formatting:{},keymap:{},runtime:{},display:{},experimental:{}}),zre=["normal","medium","full"],yZ=Y.object({width:Y.enum(zre).default("normal")}).default({width:"normal"});function ght(){try{return yZ.parse(JSON.parse(dht()))}catch(e){return At.error(`Marimo got an unexpected value in the configuration file: ${e}`),yZ.parse({})}}function mht(){try{const e=Sj.parse(JSON.parse(hht()));for(const[t,n]of Object.entries(e.experimental))n===!0&&At.log(`🧪 Experimental feature "${t}" is enabled.`);return e}catch(e){return At.error(`Marimo got an unexpected value in the configuration file: ${e}`),Sj.parse({})}}const uR=hn(mht());function fR(){return tc(uR)}function oNe(){return Tn.get(uR)}const yht=hn(e=>{var t;return!!((t=e(uR).ai.open_ai)!=null&&t.api_key)}),vht=hn(ght());function Qre(){return tc(vht)}const bht=["light","dark","system"],Oht=hn(e=>e(uR).display.theme),vZ=hn(!1);function xht(){if(typeof window>"u")return;const e=window.matchMedia("(prefers-color-scheme: dark)");Tn.set(vZ,e.matches),e.addEventListener("change",t=>{Tn.set(vZ,t.matches)})}xht();const wht=hn(e=>{const t=e(Oht),n=e(vZ);return t==="system"?n?"dark":"light":t});function mp(){return{theme:Gi(wht,{store:Tn})}}const sNe=x.memo(({children:e})=>{const{theme:t}=mp();return x.useLayoutEffect(()=>(document.body.classList.add(t,`${t}-theme`),()=>{document.body.classList.remove(t,`${t}-theme`)}),[t]),e});sNe.displayName="ThemeProvider";const Sht=({variables:e,children:t})=>b.jsx("div",{className:"contents",style:e,children:t}),aNe=x.createContext(null),TW={didCatch:!1,error:null};let Eht=class extends x.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=TW}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(TW)}}componentDidCatch(t,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&Cht(t.resetKeys,i)){var o,s;(o=(s=this.props).onReset)===null||o===void 0||o.call(s,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(TW)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:s}=this.state;let a=t;if(o){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=x.createElement(r,l);else if(i===null||x.isValidElement(i))a=i;else throw s}return x.createElement(aNe.Provider,{value:{didCatch:o,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}};function Cht(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function _ht(e){if(e==null||typeof e.didCatch!="boolean"||typeof e.resetErrorBoundary!="function")throw new Error("ErrorBoundaryContext not found")}function kht(){const e=x.useContext(aNe);_ht(e);const[t,n]=x.useState({error:null,hasError:!1}),r=x.useMemo(()=>({resetBoundary:()=>{e.resetErrorBoundary(),n({error:null,hasError:!1})},showBoundary:i=>n({error:i,hasError:!0})}),[e.resetErrorBoundary]);if(t.hasError)throw t.error;return r}function oe(){return oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oe.apply(this,arguments)}function $ht(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function t6(...e){return t=>e.forEach(n=>$ht(n,t))}function Yt(...e){return x.useCallback(t6(...e),e)}const vd=x.forwardRef((e,t)=>{const{children:n,...r}=e,i=x.Children.toArray(n),o=i.find(Tht);if(o){const s=o.props.children,a=i.map(l=>l===o?x.Children.count(s)>1?x.Children.only(null):x.isValidElement(s)?s.props.children:null:l);return x.createElement(bZ,oe({},r,{ref:t}),x.isValidElement(s)?x.cloneElement(s,void 0,a):null)}return x.createElement(bZ,oe({},r,{ref:t}),n)});vd.displayName="Slot";const bZ=x.forwardRef((e,t)=>{const{children:n,...r}=e;return x.isValidElement(n)?x.cloneElement(n,{...Pht(r,n.props),ref:t?t6(t,n.ref):n.ref}):x.Children.count(n)>1?x.Children.only(null):null});bZ.displayName="SlotClone";const Bre=({children:e})=>x.createElement(x.Fragment,null,e);function Tht(e){return x.isValidElement(e)&&e.type===Bre}function Pht(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function lNe(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=lNe(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Aht(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=lNe(e))&&(r&&(r+=" "),r+=t);return r}const zye=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Qye=Aht,Ao=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Qye(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],f=o==null?void 0:o[c];if(u===null)return null;const d=zye(u)||zye(f);return i[c][d]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,d]=u;return d===void 0||(c[f]=d),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:d,...h}=u;return Object.entries(h).every(p=>{let[g,v]=p;return Array.isArray(v)?v.includes({...o,...a}[g]):{...o,...a}[g]===v})?[...c,f,d]:c},[]);return Qye(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)};function cNe(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=cNe(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function bd(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=cNe(e))&&(r&&(r+=" "),r+=t);return r}const Wre="-";function Rht(e){const t=Mht(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function i(s){const a=s.split(Wre);return a[0]===""&&a.length!==1&&a.shift(),uNe(a,t)||Dht(s)}function o(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function uNe(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?uNe(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Wre);return(s=t.validators.find(({validator:a})=>a(o)))==null?void 0:s.classGroupId}const Bye=/^\[(.+)\]$/;function Dht(e){if(Bye.test(e)){const t=Bye.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function Mht(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Iht(Object.entries(e.classGroups),n).forEach(([o,s])=>{OZ(s,r,o,t)}),r}function OZ(e,t,n,r){e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Wye(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Nht(i)){OZ(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{OZ(s,Wye(t,o),n,r)})})}function Wye(e,t){let n=e;return t.split(Wre).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function Nht(e){return e.isThemeGetter}function Iht(e,t){return t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,a])=>[t+s,a])):o);return[n,i]}):e}function Lht(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function i(o,s){n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}}const fNe="!";function jht(e){const t=e.separator,n=t.length===1,r=t[0],i=t.length;return function(s){const a=[];let l=0,c=0,u;for(let g=0;g<s.length;g++){let v=s[g];if(l===0){if(v===r&&(n||s.slice(g,g+i)===t)){a.push(s.slice(c,g)),c=g+i;continue}if(v==="/"){u=g;continue}}v==="["?l++:v==="]"&&l--}const f=a.length===0?s:s.substring(c),d=f.startsWith(fNe),h=d?f.substring(1):f,p=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}}}function Fht(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function zht(e){return{cache:Lht(e.cacheSize),splitModifiers:jht(e),...Rht(e)}}const Qht=/\s+/;function Bht(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=new Set;return e.trim().split(Qht).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let f=r(u?c.substring(0,u):c),d=!!u;if(!f){if(!u)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};d=!1}const h=Fht(a).join(":");return{isTailwindClass:!0,modifierId:l?h+fNe:h,classGroupId:f,originalClassName:s,hasPostfixModifier:d}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return o.has(u)?!1:(o.add(u),i(l,c).forEach(f=>o.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function Wht(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=dNe(t))&&(r&&(r+=" "),r+=n);return r}function dNe(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=dNe(e[r]))&&(n&&(n+=" "),n+=t);return n}function qht(e,...t){let n,r,i,o=s;function s(l){const c=t.reduce((u,f)=>f(u),e());return n=zht(c),r=n.cache.get,i=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=Bht(l,n);return i(l,u),u}return function(){return o(Wht.apply(null,arguments))}}function ii(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const hNe=/^\[(?:([a-z-]+):)?(.+)\]$/i,Vht=/^\d+\/\d+$/,Uht=new Set(["px","full","screen"]),Hht=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xht=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Zht=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Yht=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ght=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function zp(e){return L1(e)||Uht.has(e)||Vht.test(e)}function Dm(e){return LC(e,"length",opt)}function L1(e){return!!e&&!Number.isNaN(Number(e))}function AM(e){return LC(e,"number",L1)}function ik(e){return!!e&&Number.isInteger(Number(e))}function Kht(e){return e.endsWith("%")&&L1(e.slice(0,-1))}function un(e){return hNe.test(e)}function Mm(e){return Hht.test(e)}const Jht=new Set(["length","size","percentage"]);function ept(e){return LC(e,Jht,pNe)}function tpt(e){return LC(e,"position",pNe)}const npt=new Set(["image","url"]);function rpt(e){return LC(e,npt,apt)}function ipt(e){return LC(e,"",spt)}function ok(){return!0}function LC(e,t,n){const r=hNe.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function opt(e){return Xht.test(e)&&!Zht.test(e)}function pNe(){return!1}function spt(e){return Yht.test(e)}function apt(e){return Ght.test(e)}function lpt(){const e=ii("colors"),t=ii("spacing"),n=ii("blur"),r=ii("brightness"),i=ii("borderColor"),o=ii("borderRadius"),s=ii("borderSpacing"),a=ii("borderWidth"),l=ii("contrast"),c=ii("grayscale"),u=ii("hueRotate"),f=ii("invert"),d=ii("gap"),h=ii("gradientColorStops"),p=ii("gradientColorStopPositions"),g=ii("inset"),v=ii("margin"),y=ii("opacity"),O=ii("padding"),m=ii("saturate"),w=ii("scale"),S=ii("sepia"),E=ii("skew"),C=ii("space"),k=ii("translate"),P=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",un,t],L=()=>[un,t],A=()=>["",zp,Dm],T=()=>["auto",L1,un],N=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],W=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",un],q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[L1,AM],V=()=>[L1,un];return{cacheSize:500,separator:":",theme:{colors:[ok],spacing:[zp,Dm],blur:["none","",Mm,un],brightness:U(),borderColor:[e],borderRadius:["none","","full",Mm,un],borderSpacing:L(),borderWidth:A(),contrast:U(),grayscale:F(),hueRotate:V(),invert:F(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[Kht,Dm],inset:M(),margin:M(),opacity:U(),padding:L(),saturate:U(),scale:U(),sepia:F(),skew:V(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",un]}],container:["container"],columns:[{columns:[Mm]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...N(),un]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ik,un]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",un]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",ik,un]}],"grid-cols":[{"grid-cols":[ok]}],"col-start-end":[{col:["auto",{span:["full",ik,un]},un]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[ok]}],"row-start-end":[{row:["auto",{span:[ik,un]},un]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",un]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",un]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...W()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...W(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...W(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[O]}],px:[{px:[O]}],py:[{py:[O]}],ps:[{ps:[O]}],pe:[{pe:[O]}],pt:[{pt:[O]}],pr:[{pr:[O]}],pb:[{pb:[O]}],pl:[{pl:[O]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",un,t]}],"min-w":[{"min-w":[un,t,"min","max","fit"]}],"max-w":[{"max-w":[un,t,"none","full","min","max","fit","prose",{screen:[Mm]},Mm]}],h:[{h:[un,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[un,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[un,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[un,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Mm,Dm]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",AM]}],"font-family":[{font:[ok]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",un]}],"line-clamp":[{"line-clamp":["none",L1,AM]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",zp,un]}],"list-image":[{"list-image":["none",un]}],"list-style-type":[{list:["none","disc","decimal",un]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",zp,Dm]}],"underline-offset":[{"underline-offset":["auto",zp,un]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",un]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",un]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...N(),tpt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ept]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},rpt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:j()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[zp,un]}],"outline-w":[{outline:[zp,Dm]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[zp,Dm]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Mm,ipt]}],"shadow-color":[{shadow:[ok]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":z()}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Mm,un]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[m]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",un]}],duration:[{duration:V()}],ease:[{ease:["linear","in","out","in-out",un]}],delay:[{delay:V()}],animate:[{animate:["none","spin","ping","pulse","bounce",un]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[ik,un]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",un]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",un]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",un]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[zp,Dm,AM]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const cpt=qht(lpt);function be(...e){return cpt(bd(e))}const Nm="active:shadow-xsSolid",pv=Ao(be("disabled:opacity-50 disabled:pointer-events-none","inline-flex mb-1 items-center justify-center rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background"),{variants:{variant:{default:be("bg-primary text-primary-foreground hover:bg-primary/90 shadow-smSolid border border-primary",Nm),destructive:be("border shadow-smSolid","bg-[var(--red-9)] hover:bg-[var(--red-10)] dark:bg-[var(--red-6)] dark:hover:bg-[var(--red-7)]","text-[var(--red-1)] dark:text-[var(--red-12)]","border-[var(--red-11)]",Nm),success:be("border shadow-smSolid","bg-[var(--grass-9)] hover:bg-[var(--grass-10)] dark:bg-[var(--grass-6)] dark:hover:bg-[var(--grass-7)]","text-[var(--grass-1)] dark:text-[var(--grass-12)]","border-[var(--grass-11)]",Nm),warn:be("border shadow-smSolid","bg-[var(--yellow-9)] hover:bg-[var(--yellow-10)] dark:bg-[var(--yellow-6)] dark:hover:bg-[var(--yellow-7)]","text-[var(--yellow-12)]","border-[var(--yellow-11)]",Nm),action:be("bg-action text-action-foreground shadow-smSolid","hover:bg-action-hover border border-action",Nm),outline:be("border border-slate-300 shadow-smSolid","hover:bg-accent hover:text-accent-foreground","hover:border-primary",Nm),secondary:be("bg-secondary text-secondary-foreground hover:bg-secondary/80","border border-input shadow-smSolid",Nm),text:be("opacity-80 hover:opacity-100","active:opacity-100"),ghost:be("hover:bg-accent hover:text-accent-foreground hover:shadow-smSolid border border-transparent",Nm,"active:text-accent-foreground"),link:"underline-offset-4 hover:underline text-link"},size:{default:"h-10 py-2 px-4",xs:"h-7 px-2 rounded-md text-xs",sm:"h-9 px-3 rounded-md",lg:"h-11 px-8 rounded-md",icon:"h-6 w-6 mb-0"},disabled:{true:"opacity-50 pointer-events-none"}},defaultVariants:{variant:"default",size:"sm"}}),St=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?vd:"button";return b.jsx(s,{className:be(pv({variant:t,size:n,className:e,disabled:i.disabled})),ref:o,...i})});St.displayName="Button";const qre={issuesPage:"https://github.com/marimo-team/marimo/issues"},Vre=e=>b.jsx(Eht,{FallbackComponent:upt,children:e.children}),upt=e=>{var t;return b.jsxs("div",{className:"flex-1 flex items-center justify-center flex-col space-y-4 max-w-2xl mx-auto",children:[b.jsx("h1",{className:"text-2xl font-bold",children:"Something went wrong"}),b.jsx("pre",{className:"text-xs bg-muted/40 border rounded-md p-4",children:(t=e.error)==null?void 0:t.message}),b.jsxs("div",{children:["If this is an issue with marimo, please report it on"," ",b.jsx("a",{href:qre.issuesPage,target:"_blank",rel:"noreferrer",className:"underline",children:"GitHub"}),"."]}),b.jsx(St,{"data-testid":"reset-error-boundary-button",onClick:e.resetErrorBoundary,variant:"outline",children:"Try again"})]})};/**
* (c) Iconify
*
* For the full copyright and license information, please view the license.txt
* files at https://github.com/iconify/iconify
*
* Licensed under MIT.
*
* @license MIT
* @version 1.0.8
*/const gNe=Object.freeze({left:0,top:0,width:16,height:16}),Ej=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),dR=Object.freeze({...gNe,...Ej}),xZ=Object.freeze({...dR,body:"",hidden:!1}),fpt=Object.freeze({width:null,height:null}),mNe=Object.freeze({...fpt,...Ej});function dpt(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let o=parseFloat(e.slice(0,e.length-n.length));return isNaN(o)?0:(o=o/i,o%1===0?r(o):0)}}return t}const hpt=/[\s,]+/;function ppt(e,t){t.split(hpt).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const yNe={...mNe,preserveAspectRatio:""};function qye(e){const t={...yNe},n=(r,i)=>e.getAttribute(r)||i;return t.width=n("width",null),t.height=n("height",null),t.rotate=dpt(n("rotate","")),ppt(t,n("flip","")),t.preserveAspectRatio=n("preserveAspectRatio",n("preserveaspectratio","")),t}function gpt(e,t){for(const n in yNe)if(e[n]!==t[n])return!0;return!1}const xT=/^[a-z0-9]+(-[a-z0-9]+)*$/,hR=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const a=i.pop(),l=i.pop(),c={provider:i.length>0?i[0]:r,prefix:l,name:a};return t&&!O5(c)?null:c}const o=i[0],s=o.split("-");if(s.length>1){const a={provider:r,prefix:s.shift(),name:s.join("-")};return t&&!O5(a)?null:a}if(n&&r===""){const a={provider:r,prefix:"",name:o};return t&&!O5(a,n)?null:a}return null},O5=(e,t)=>e?!!((e.provider===""||e.provider.match(xT))&&(t&&e.prefix===""||e.prefix.match(xT))&&e.name.match(xT)):!1;function mpt(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Vye(e,t){const n=mpt(e,t);for(const r in xZ)r in Ej?r in e&&!(r in n)&&(n[r]=Ej[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ypt(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function o(s){if(n[s])return i[s]=[];if(!(s in i)){i[s]=null;const a=r[s]&&r[s].parent,l=a&&o(a);l&&(i[s]=[a].concat(l))}return i[s]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(o),i}function vpt(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let o={};function s(a){o=Vye(r[a]||i[a],o)}return s(t),n.forEach(s),Vye(e,o)}function vNe(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=ypt(e);for(const i in r){const o=r[i];o&&(t(i,vpt(e,i,o)),n.push(i))}return n}const bpt={provider:"",aliases:{},not_found:{},...gNe};function PW(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function bNe(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!PW(e,bpt))return null;const n=t.icons;for(const i in n){const o=n[i];if(!i.match(xT)||typeof o.body!="string"||!PW(o,xZ))return null}const r=t.aliases||Object.create(null);for(const i in r){const o=r[i],s=o.parent;if(!i.match(xT)||typeof s!="string"||!n[s]&&!r[s]||!PW(o,xZ))return null}return t}const Cj=Object.create(null);function Opt(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function _0(e,t){const n=Cj[e]||(Cj[e]=Object.create(null));return n[t]||(n[t]=Opt(e,t))}function Ure(e,t){return bNe(t)?vNe(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function xpt(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function wpt(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(Cj)).forEach(i=>{(typeof i=="string"&&typeof t=="string"?[t]:Object.keys(Cj[i]||{})).forEach(s=>{const a=_0(i,s);n=n.concat(Object.keys(a.icons).map(l=>(i!==""?"@"+i+":":"")+s+":"+l))})}),n}let X2=!1;function ONe(e){return typeof e=="boolean"&&(X2=e),X2}function Z2(e){const t=typeof e=="string"?hR(e,!0,X2):e;if(t){const n=_0(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function xNe(e,t){const n=hR(e,!0,X2);if(!n)return!1;const r=_0(n.provider,n.prefix);return xpt(r,n.name,t)}function Uye(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),X2&&!t&&!e.prefix){let i=!1;return bNe(e)&&(e.prefix="",vNe(e,(o,s)=>{s&&xNe(o,s)&&(i=!0)})),i}const n=e.prefix;if(!O5({provider:t,prefix:n,name:"a"}))return!1;const r=_0(t,n);return!!Ure(r,e)}function Spt(e){return!!Z2(e)}function Ept(e){const t=Z2(e);return t?{...dR,...t}:null}function Cpt(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,o)=>i.provider!==o.provider?i.provider.localeCompare(o.provider):i.prefix!==o.prefix?i.prefix.localeCompare(o.prefix):i.name.localeCompare(o.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const o=i.provider,s=i.prefix,a=i.name,l=n[o]||(n[o]=Object.create(null)),c=l[s]||(l[s]=_0(o,s));let u;a in c.icons?u=t.loaded:s===""||c.missing.has(a)?u=t.missing:u=t.pending;const f={provider:o,prefix:s,name:a};u.push(f)}),t}function wNe(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function _pt(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(o=>{const s=o.icons,a=s.pending.length;s.pending=s.pending.filter(l=>{if(l.prefix!==i)return!0;const c=l.name;if(e.icons[c])s.loaded.push({provider:r,prefix:i,name:c});else if(e.missing.has(c))s.missing.push({provider:r,prefix:i,name:c});else return n=!0,!0;return!1}),s.pending.length!==a&&(n||wNe([e],o.id),o.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),o.abort))})}))}let kpt=0;function $pt(e,t,n){const r=kpt++,i=wNe.bind(null,n,r);if(!t.pending.length)return i;const o={id:r,icons:t,callback:e,abort:i};return n.forEach(s=>{(s.loaderCallbacks||(s.loaderCallbacks=[])).push(o)}),i}const wZ=Object.create(null);function Hye(e,t){wZ[e]=t}function SZ(e){return wZ[e]||wZ[""]}function Tpt(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const o=typeof i=="string"?hR(i,t,n):i;o&&r.push(o)}),r}var Ppt={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Apt(e,t,n,r){const i=e.resources.length,o=e.random?Math.floor(Math.random()*i):e.index;let s;if(e.random){let E=e.resources.slice(0);for(s=[];E.length>1;){const C=Math.floor(Math.random()*E.length);s.push(E[C]),E=E.slice(0,C).concat(E.slice(C+1))}s=s.concat(E)}else s=e.resources.slice(o).concat(e.resources.slice(0,o));const a=Date.now();let l="pending",c=0,u,f=null,d=[],h=[];typeof r=="function"&&h.push(r);function p(){f&&(clearTimeout(f),f=null)}function g(){l==="pending"&&(l="aborted"),p(),d.forEach(E=>{E.status==="pending"&&(E.status="aborted")}),d=[]}function v(E,C){C&&(h=[]),typeof E=="function"&&h.push(E)}function y(){return{startTime:a,payload:t,status:l,queriesSent:c,queriesPending:d.length,subscribe:v,abort:g}}function O(){l="failed",h.forEach(E=>{E(void 0,u)})}function m(){d.forEach(E=>{E.status==="pending"&&(E.status="aborted")}),d=[]}function w(E,C,k){const P=C!=="success";switch(d=d.filter(D=>D!==E),l){case"pending":break;case"failed":if(P||!e.dataAfterTimeout)return;break;default:return}if(C==="abort"){u=k,O();return}if(P){u=k,d.length||(s.length?S():O());return}if(p(),m(),!e.random){const D=e.resources.indexOf(E.resource);D!==-1&&D!==e.index&&(e.index=D)}l="completed",h.forEach(D=>{D(k)})}function S(){if(l!=="pending")return;p();const E=s.shift();if(E===void 0){if(d.length){f=setTimeout(()=>{p(),l==="pending"&&(m(),O())},e.timeout);return}O();return}const C={status:"pending",resource:E,callback:(k,P)=>{w(C,k,P)}};d.push(C),c++,f=setTimeout(S,e.rotate),n(E,t,C.callback)}return setTimeout(S),y}function SNe(e){const t={...Ppt,...e};let n=[];function r(){n=n.filter(a=>a().status==="pending")}function i(a,l,c){const u=Apt(t,a,l,(f,d)=>{r(),c&&c(f,d)});return n.push(u),u}function o(a){return n.find(l=>a(l))||null}return{query:i,find:o,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:r}}function Hre(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const n6=Object.create(null),sk=["https://api.simplesvg.com","https://api.unisvg.com"],x5=[];for(;sk.length>0;)sk.length===1||Math.random()>.5?x5.push(sk.shift()):x5.push(sk.pop());n6[""]=Hre({resources:["https://api.iconify.design"].concat(x5)});function Xye(e,t){const n=Hre(t);return n===null?!1:(n6[e]=n,!0)}function r6(e){return n6[e]}function Rpt(){return Object.keys(n6)}function Zye(){}const AW=Object.create(null);function Dpt(e){if(!AW[e]){const t=r6(e);if(!t)return;const n=SNe(t),r={config:t,redundancy:n};AW[e]=r}return AW[e]}function ENe(e,t,n){let r,i;if(typeof e=="string"){const o=SZ(e);if(!o)return n(void 0,424),Zye;i=o.send;const s=Dpt(e);s&&(r=s.redundancy)}else{const o=Hre(e);if(o){r=SNe(o);const s=e.resources?e.resources[0]:"",a=SZ(s);a&&(i=a.send)}}return!r||!i?(n(void 0,424),Zye):r.query(t,i,n)().abort}const Yye="iconify2",Y2="iconify",CNe=Y2+"-count",Gye=Y2+"-version",_Ne=36e5,Mpt=168;function EZ(e,t){try{return e.getItem(t)}catch{}}function Xre(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Kye(e,t){try{e.removeItem(t)}catch{}}function CZ(e,t){return Xre(e,CNe,t.toString())}function _Z(e){return parseInt(EZ(e,CNe))||0}const nb={local:!0,session:!0},kNe={local:new Set,session:new Set};let Zre=!1;function Npt(e){Zre=e}let RM=typeof window>"u"?{}:window;function $Ne(e){const t=e+"Storage";try{if(RM&&RM[t]&&typeof RM[t].length=="number")return RM[t]}catch{}nb[e]=!1}function TNe(e,t){const n=$Ne(e);if(!n)return;const r=EZ(n,Gye);if(r!==Yye){if(r){const a=_Z(n);for(let l=0;l<a;l++)Kye(n,Y2+l.toString())}Xre(n,Gye,Yye),CZ(n,0);return}const i=Math.floor(Date.now()/_Ne)-Mpt,o=a=>{const l=Y2+a.toString(),c=EZ(n,l);if(typeof c=="string"){try{const u=JSON.parse(c);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>i&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}Kye(n,l)}};let s=_Z(n);for(let a=s-1;a>=0;a--)o(a)||(a===s-1?(s--,CZ(n,s)):kNe[e].add(a))}function PNe(){if(!Zre){Npt(!0);for(const e in nb)TNe(e,t=>{const n=t.data,r=t.provider,i=n.prefix,o=_0(r,i);if(!Ure(o,n).length)return!1;const s=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,s):s,!0})}}function Ipt(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in nb)TNe(r,i=>{const o=i.data;return i.provider!==e.provider||o.prefix!==e.prefix||o.lastModified===t});return!0}function Lpt(e,t){Zre||PNe();function n(r){let i;if(!nb[r]||!(i=$Ne(r)))return;const o=kNe[r];let s;if(o.size)o.delete(s=Array.from(o).shift());else if(s=_Z(i),!CZ(i,s+1))return;const a={cached:Math.floor(Date.now()/_Ne),provider:e.provider,data:t};return Xre(i,Y2+s.toString(),JSON.stringify(a))}t.lastModified&&!Ipt(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Jye(){}function jpt(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,_pt(e)}))}function Fpt(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;delete e.iconsToLoad;let o;if(!i||!(o=SZ(n)))return;o.prepare(n,r,i).forEach(a=>{ENe(n,a,l=>{if(typeof l!="object")a.icons.forEach(c=>{e.missing.add(c)});else try{const c=Ure(e,l);if(!c.length)return;const u=e.pendingIcons;u&&c.forEach(f=>{u.delete(f)}),Lpt(e,l)}catch(c){console.error(c)}jpt(e)})})}))}const Yre=(e,t)=>{const n=Tpt(e,!0,ONe()),r=Cpt(n);if(!r.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(r.loaded,r.missing,r.pending,Jye)}),()=>{l=!1}}const i=Object.create(null),o=[];let s,a;return r.pending.forEach(l=>{const{provider:c,prefix:u}=l;if(u===a&&c===s)return;s=c,a=u,o.push(_0(c,u));const f=i[c]||(i[c]=Object.create(null));f[u]||(f[u]=[])}),r.pending.forEach(l=>{const{provider:c,prefix:u,name:f}=l,d=_0(c,u),h=d.pendingIcons||(d.pendingIcons=new Set);h.has(f)||(h.add(f),i[c][u].push(f))}),o.forEach(l=>{const{provider:c,prefix:u}=l;i[c][u].length&&Fpt(l,i[c][u])}),t?$pt(t,r,o):Jye},zpt=e=>new Promise((t,n)=>{const r=typeof e=="string"?hR(e,!0):e;if(!r){n(e);return}Yre([r||e],i=>{if(i.length&&r){const o=Z2(r);if(o){t({...dR,...o});return}}n(e)})});function Qpt(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function Bpt(e,t){const n=typeof e=="string"?hR(e,!0,!0):null;if(!n){const o=Qpt(e);return{value:e,data:o}}const r=Z2(n);if(r!==void 0||!n.prefix)return{value:e,name:n,data:r};const i=Yre([n],()=>t(e,n,Z2(n)));return{value:e,name:n,loading:i}}function RW(e){return e.hasAttribute("inline")}let ANe=!1;try{ANe=navigator.vendor.indexOf("Apple")===0}catch{}function Wpt(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(ANe||e.indexOf("<a")===-1)?"svg":e.indexOf("currentColor")===-1?"bg":"mask"}const qpt=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Vpt=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function kZ(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(qpt);if(r===null||!r.length)return e;const i=[];let o=r.shift(),s=Vpt.test(o);for(;;){if(s){const a=parseFloat(o);isNaN(a)?i.push(o):i.push(Math.ceil(a*t*n)/n)}else i.push(o);if(o=r.shift(),o===void 0)return i.join("");s=!s}}const Upt=e=>e==="unset"||e==="undefined"||e==="none";function RNe(e,t){const n={...dR,...e},r={...mNe,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let o=n.body;[n,r].forEach(p=>{const g=[],v=p.hFlip,y=p.vFlip;let O=p.rotate;v?y?O+=2:(g.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),g.push("scale(-1 1)"),i.top=i.left=0):y&&(g.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),g.push("scale(1 -1)"),i.top=i.left=0);let m;switch(O<0&&(O-=Math.floor(O/4)*4),O=O%4,O){case 1:m=i.height/2+i.top,g.unshift("rotate(90 "+m.toString()+" "+m.toString()+")");break;case 2:g.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:m=i.width/2+i.left,g.unshift("rotate(-90 "+m.toString()+" "+m.toString()+")");break}O%2===1&&(i.left!==i.top&&(m=i.left,i.left=i.top,i.top=m),i.width!==i.height&&(m=i.width,i.width=i.height,i.height=m)),g.length&&(o='<g transform="'+g.join(" ")+'">'+o+"</g>")});const s=r.width,a=r.height,l=i.width,c=i.height;let u,f;s===null?(f=a===null?"1em":a==="auto"?c:a,u=kZ(f,l/c)):(u=s==="auto"?l:s,f=a===null?kZ(u,c/l):a==="auto"?c:a);const d={},h=(p,g)=>{Upt(g)||(d[p]=g.toString())};return h("width",u),h("height",f),d.viewBox=i.left.toString()+" "+i.top.toString()+" "+l.toString()+" "+c.toString(),{attributes:d,body:o}}const Hpt=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let _j=Hpt();function Xpt(e){_j=e}function Zpt(){return _j}function Ypt(e,t){const n=r6(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(s=>{i=Math.max(i,s.length)});const o=t+".json?icons=";r=n.maxURL-i-n.path.length-o.length}return r}function Gpt(e){return e===404}const Kpt=(e,t,n)=>{const r=[],i=Ypt(e,t),o="icons";let s={type:o,provider:e,prefix:t,icons:[]},a=0;return n.forEach((l,c)=>{a+=l.length+1,a>=i&&c>0&&(r.push(s),s={type:o,provider:e,prefix:t,icons:[]},a=l.length),s.icons.push(l)}),r.push(s),r};function Jpt(e){if(typeof e=="string"){const t=r6(e);if(t)return t.path}return"/"}const egt=(e,t,n)=>{if(!_j){n("abort",424);return}let r=Jpt(t.provider);switch(t.type){case"icons":{const o=t.prefix,a=t.icons.join(","),l=new URLSearchParams({icons:a});r+=o+".json?"+l.toString();break}case"custom":{const o=t.uri;r+=o.slice(0,1)==="/"?o.slice(1):o;break}default:n("abort",400);return}let i=503;_j(e+r).then(o=>{const s=o.status;if(s!==200){setTimeout(()=>{n(Gpt(s)?"abort":"next",s)});return}return i=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?n("abort",o):n("next",i)});return}setTimeout(()=>{n("success",o)})}).catch(()=>{n("next",i)})},tgt={prepare:Kpt,send:egt};function e0e(e,t){switch(e){case"local":case"session":nb[e]=t;break;case"all":for(const n in nb)nb[n]=t;break}}const DW="data-style";let DNe="";function ngt(e){DNe=e}function t0e(e,t){let n=Array.from(e.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(DW));n||(n=document.createElement("style"),n.setAttribute(DW,DW),e.appendChild(n)),n.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+DNe}function MNe(){Hye("",tgt),ONe(!0);let e;try{e=window}catch{}if(e){if(PNe(),e.IconifyPreload!==void 0){const n=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof n=="object"&&n!==null&&(n instanceof Array?n:[n]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Uye(i))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const n=e.IconifyProviders;if(typeof n=="object"&&n!==null)for(const r in n){const i="IconifyProviders["+r+"] is invalid.";try{const o=n[r];if(typeof o!="object"||!o||o.resources===void 0)continue;Xye(r,o)||console.error(i)}catch{console.error(i)}}}}return{enableCache:n=>e0e(n,!0),disableCache:n=>e0e(n,!1),iconExists:Spt,getIcon:Ept,listIcons:wpt,addIcon:xNe,addCollection:Uye,calculateSize:kZ,buildIcon:RNe,loadIcons:Yre,loadIcon:zpt,addAPIProvider:Xye,appendCustomStyle:ngt,_api:{getAPIConfig:r6,setAPIModule:Hye,sendAPIQuery:ENe,setFetch:Xpt,getFetch:Zpt,listAPIProviders:Rpt}}}function NNe(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function rgt(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function igt(e){return"data:image/svg+xml,"+rgt(e)}function ogt(e){return'url("'+igt(e)+'")'}const $Z={"background-color":"currentColor"},INe={"background-color":"transparent"},n0e={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},r0e={"-webkit-mask":$Z,mask:$Z,background:INe};for(const e in r0e){const t=r0e[e];for(const n in n0e)t[e+"-"+n]=n0e[n]}function i0e(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function sgt(e,t,n){const r=document.createElement("span");let i=e.body;i.indexOf("<a")!==-1&&(i+="<!-- "+Date.now()+" -->");const o=e.attributes,s=NNe(i,{...o,width:t.width+"",height:t.height+""}),a=ogt(s),l=r.style,c={"--svg":a,width:i0e(o.width),height:i0e(o.height),...n?$Z:INe};for(const u in c)l.setProperty(u,c[u]);return r}let wT;function agt(){try{wT=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{wT=null}}function lgt(e){return wT===void 0&&agt(),wT?wT.createHTML(e):e}function cgt(e){const t=document.createElement("span"),n=e.attributes;let r="";n.width||(r="width: inherit;"),n.height||(r+="height: inherit;"),r&&(n.style=r);const i=NNe(e.body,n);return t.innerHTML=lgt(i),t.firstChild}function o0e(e,t){const n=t.icon.data,r=t.customisations,i=RNe(n,r);r.preserveAspectRatio&&(i.attributes.preserveAspectRatio=r.preserveAspectRatio);const o=t.renderedMode;let s;switch(o){case"svg":s=cgt(i);break;default:s=sgt(i,{...dR,...n},o==="mask")}const a=Array.from(e.childNodes).find(l=>{const c=l.tagName&&l.tagName.toUpperCase();return c==="SPAN"||c==="SVG"});a?s.tagName==="SPAN"&&a.tagName===s.tagName?a.setAttribute("style",s.getAttribute("style")):e.replaceChild(s,a):e.appendChild(s)}function s0e(e,t,n){const r=n&&(n.rendered?n:n.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:r}}function ugt(e="iconify-icon"){let t,n;try{t=window.customElements,n=window.HTMLElement}catch{return}if(!t||!n)return;const r=t.get(e);if(r)return r;const i=["icon","mode","inline","width","height","rotate","flip"],o=class extends n{constructor(){super();ve(this,"_shadowRoot");ve(this,"_state");ve(this,"_checkQueued",!1);const l=this._shadowRoot=this.attachShadow({mode:"open"}),c=RW(this);t0e(l,c),this._state=s0e({value:""},c),this._queueCheck()}static get observedAttributes(){return i.slice(0)}attributeChangedCallback(l){if(l==="inline"){const c=RW(this),u=this._state;c!==u.inline&&(u.inline=c,t0e(this._shadowRoot,c))}else this._queueCheck()}get icon(){const l=this.getAttribute("icon");if(l&&l.slice(0,1)==="{")try{return JSON.parse(l)}catch{}return l}set icon(l){typeof l=="object"&&(l=JSON.stringify(l)),this.setAttribute("icon",l)}get inline(){return RW(this)}set inline(l){l?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const l=this._state;if(l.rendered){const c=this._shadowRoot;if(l.renderedMode==="svg")try{c.lastChild.setCurrentTime(0);return}catch{}o0e(c,l)}}get status(){const l=this._state;return l.rendered?"rendered":l.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const l=this._state,c=this.getAttribute("icon");if(c!==l.icon.value){this._iconChanged(c);return}if(!l.rendered)return;const u=this.getAttribute("mode"),f=qye(this);(l.attrMode!==u||gpt(l.customisations,f))&&this._renderIcon(l.icon,f,u)}_iconChanged(l){const c=Bpt(l,(u,f,d)=>{const h=this._state;if(h.rendered||this.getAttribute("icon")!==u)return;const p={value:u,name:f,data:d};p.data?this._gotIconData(p):h.icon=p});c.data?this._gotIconData(c):this._state=s0e(c,this._state.inline,this._state)}_gotIconData(l){this._checkQueued=!1,this._renderIcon(l,qye(this),this.getAttribute("mode"))}_renderIcon(l,c,u){const f=Wpt(l.data.body,u),d=this._state.inline;o0e(this._shadowRoot,this._state={rendered:!0,icon:l,inline:d,customisations:c,attrMode:u,renderedMode:f})}};i.forEach(a=>{a in o.prototype||Object.defineProperty(o.prototype,a,{get:function(){return this.getAttribute(a)},set:function(l){l!==null?this.setAttribute(a,l):this.removeAttribute(a)}})});const s=MNe();for(const a in s)o[a]=o.prototype[a]=s[a];return t.define(e,o),o}ugt()||MNe();const Rb="marimo-value-input",TZ="marimo-value-update",PZ="marimo-value-ready";function LNe(e,t){return new CustomEvent(Rb,{bubbles:!0,composed:!0,detail:{value:e,element:t}})}function jNe(e,t){if(!(window!=null&&window.customElements)){At.warn("Custom elements not supported");return}if(window.customElements.get(e)){At.warn(`Custom element ${e} already defined`);return}window.customElements.define(e,t)}function fgt(e,t){if(e==null)throw t?new Error(t):new Error(`Expected value but got ${e}`)}function Gre(e,t){if(typeof window>"u")return;const n=`__marimo__${t}`;window[n]&&At.warn(`Overwriting existing debug object ${n}`),window[n]=e}const m2=class m2{constructor(){ve(this,"entries");Gre(m2.INSTANCE,"UIElementRegistry"),this.entries=new Map}has(t){return this.entries.has(t)}set(t,n){if(this.entries.has(t))throw new Error(`UIElement ${t} already registered`);this.entries.set(t,{objectId:t,value:n,elements:new Set})}registerInstance(t,n){const r=this.entries.get(t);r===void 0?this.entries.set(t,{objectId:t,value:QNe(n),elements:new Set([n])}):r.elements.add(n)}removeInstance(t,n){const r=this.entries.get(t);r!==void 0&&r.elements.has(n)&&r.elements.delete(n)}removeElementsByCell(t){[...this.entries.keys()].filter(r=>r.startsWith(`${t}-`)).forEach(r=>{this.entries.delete(r)})}lookupValue(t){const n=this.entries.get(t);return n===void 0?void 0:n.value}broadcastValueUpdate(t,n,r){const i=this.entries.get(n);i!==void 0&&(i.value=r,i.elements.forEach(o=>{o!==t&&o.dispatchEvent(new CustomEvent(TZ,{bubbles:!1,composed:!0,detail:{value:r,element:o}}))}),document.dispatchEvent(new CustomEvent(PZ,{bubbles:!0,composed:!0,detail:{objectId:n}})))}};ve(m2,"INSTANCE",new m2);let AZ=m2;const ef=AZ.INSTANCE;function FNe(e){try{return JSON.parse(e)}catch{}const t="◐";if(e==null||e==="")return{};try{return e=e??"",e=e.replaceAll(new RegExp(`(?<=\\s|^|\\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\\\]*(\\\\.|'([^'\\\\]*\\\\.)*[^'\\\\]*'|"([^"\\\\]*\\\\.)*[^"\\\\]*"))*[^"']*$)`,"g"),`"${t}$1${t}"`),JSON.parse(e,(n,r)=>typeof r!="string"?r:r===`${t}NaN${t}`?Number.NaN:r===`${t}Infinity${t}`?Number.POSITIVE_INFINITY:r===`${t}-Infinity${t}`?Number.NEGATIVE_INFINITY:r)}catch{return{}}}const pn={EMPTY:Object.freeze({}),mapValues(e,t){return e&&pn.fromEntries(pn.entries(e).map(([n,r])=>[n,t(r,n)]))},fromEntries(e){return Object.fromEntries(e)},entries(e){return Object.entries(e)},keys(e){return Object.keys(e)},keyBy(e,t){const n={};for(const r of e){const i=t(r);i!==void 0&&(n[i]=r)}return n},groupBy(e,t,n){const r={};for(const i of e){const o=t(i);if(o===void 0)continue;const s=n(i);o in r?r[o].push(s):r[o]=[s]}return r},filter(e,t){const n={};for(const[r,i]of pn.entries(e))t(i,r)&&(n[r]=e[r]);return n}},zNe="abcdefghijklmnopqrstuvwxyz",dgt=zNe.toUpperCase(),a0e=zNe+dgt,DM={create(){let e="";for(let t=0;t<4;t++)e+=a0e[Math.floor(Math.random()*a0e.length)];return e}},Od={create(e){return bi(e!=null,"cellId is required"),`cell-${e}`},parse(e){return e.slice(5)},findElement(e){return e.closest('div[id^="cell-"]')}},rb={parse(e){return e.getAttribute("object-id")},parseOrThrow(e){const t=rb.parse(e);return bi(t,"<marimo-ui-element/> missing object-id attribute"),t}};function yp(){return document.querySelector("marimo-wasm")!==null}class hgt{getFilename(){return this.getSearchParam("filename")}setFilename(t){this.setSearchParam("filename",t)}getCodeFromSearchParam(){return this.getSearchParam("code")}getCodeFromHash(){const t=window.location.hash,n="#code/";return t.startsWith(n)?t.slice(n.length):null}setCodeForHash(t){window.location.hash=`#code/${t}`}setSearchParam(t,n){const r=new URL(window.location.href);r.searchParams.set(t,n),window.history.replaceState({},"",r.toString())}getSearchParam(t){return new URL(window.location.href).searchParams.get(t)}}const pS=new hgt;function i6(e){return FNe(e??"")}function MW(e){return pn.mapValues(e.dataset,t=>typeof t=="string"?i6(t):t)}function QNe(e){const t=e.parentElement?rb.parse(e.parentElement):void 0;return t&&ef.has(t)?ef.lookupValue(t):i6(e.dataset.initialValue)}function BNe(){if(yp()){const n=pS.getFilename();if(n)return n}const e=document.querySelector("marimo-filename");fgt(e,"marimo-filename tag not found");const t=e.innerHTML;return t.length===0?null:t}const pgt=Ao("relative w-full rounded-lg border p-4 [&>svg]:absolute [&>svg]:text-foreground [&>svg]:left-4 [&>svg]:top-4 [&>svg+div]:translate-y-[-3px] [&:has(svg)]:pl-11",{variants:{variant:{default:"bg-background text-foreground",destructive:"text-destructive border-destructive/50 dark:border-destructive [&>svg]:text-destructive text-destructive"}},defaultVariants:{variant:"default"}}),pR=x.forwardRef(({className:e,variant:t,...n},r)=>b.jsx("div",{ref:r,role:"alert",className:be(pgt({variant:t}),e),...n}));pR.displayName="Alert";const gR=x.forwardRef(({className:e,children:t,...n},r)=>b.jsx("h5",{ref:r,className:be("mb-1 font-medium leading-none tracking-tight",e),...n,children:t}));gR.displayName="AlertTitle";const ggt=x.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:be("text-sm [&_p]:leading-relaxed",e),...t}));ggt.displayName="AlertDescription";function mgt(e,t){const n=x.createContext(t);function r(o){const{children:s,...a}=o,l=x.useMemo(()=>a,Object.values(a));return x.createElement(n.Provider,{value:l},s)}function i(o){const s=x.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,i]}function uo(e,t=[]){let n=[];function r(o,s){const a=x.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:d,children:h,...p}=f,g=(d==null?void 0:d[e][l])||a,v=x.useMemo(()=>p,Object.values(p));return x.createElement(g.Provider,{value:v},h)}function u(f,d){const h=(d==null?void 0:d[e][l])||a,p=x.useContext(h);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,u]}const i=()=>{const o=n.map(s=>x.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,ygt(i,...t)]}function ygt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function jC(e){const t=e+"CollectionProvider",[n,r]=uo(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:p,children:g}=h,v=ie.useRef(null),y=ie.useRef(new Map).current;return ie.createElement(i,{scope:p,itemMap:y,collectionRef:v},g)},a=e+"CollectionSlot",l=ie.forwardRef((h,p)=>{const{scope:g,children:v}=h,y=o(a,g),O=Yt(p,y.collectionRef);return ie.createElement(vd,{ref:O},v)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=ie.forwardRef((h,p)=>{const{scope:g,children:v,...y}=h,O=ie.useRef(null),m=Yt(p,O),w=o(c,g);return ie.useEffect(()=>(w.itemMap.set(O,{ref:O,...y}),()=>void w.itemMap.delete(O))),ie.createElement(vd,{[u]:"",ref:m},v)});function d(h){const p=o(e+"CollectionConsumer",h);return ie.useCallback(()=>{const v=p.collectionRef.current;if(!v)return[];const y=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((w,S)=>y.indexOf(w.ref.current)-y.indexOf(S.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},d,r]}function Xe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Xs(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function ko({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=vgt({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=Xs(n),l=x.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else i(c)},[o,e,i,a]);return[s,l]}function vgt({defaultProp:e,onChange:t}){const n=x.useState(e),[r]=n,i=x.useRef(r),o=Xs(t);return x.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const bgt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ot=bgt.reduce((e,t)=>{const n=x.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?vd:t;return x.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),x.createElement(a,oe({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Kre(e,t){e&&as.flushSync(()=>e.dispatchEvent(t))}const Qa=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{};function Ogt(e,t){return x.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const Gs=e=>{const{present:t,children:n}=e,r=xgt(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),o=Yt(r.ref,i.ref);return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:o}):null};Gs.displayName="Presence";function xgt(e){const[t,n]=x.useState(),r=x.useRef({}),i=x.useRef(e),o=x.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Ogt(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const c=MM(r.current);o.current=a==="mounted"?c:"none"},[a]),Qa(()=>{const c=r.current,u=i.current;if(u!==e){const d=o.current,h=MM(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Qa(()=>{if(t){const c=f=>{const h=MM(r.current).includes(f.animationName);f.target===t&&h&&as.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(o.current=MM(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:x.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function MM(e){return(e==null?void 0:e.animationName)||"none"}const wgt=YS.useId||(()=>{});let Sgt=0;function Ra(e){const[t,n]=x.useState(wgt());return Qa(()=>{e||n(r=>r??String(Sgt++))},[e]),e||(t?`radix-${t}`:"")}const WNe="Collapsible",[Egt,qNe]=uo(WNe),[Cgt,Jre]=Egt(WNe),_gt=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l=!1,c]=ko({prop:r,defaultProp:i,onChange:s});return x.createElement(Cgt,{scope:n,disabled:o,contentId:Ra(),open:l,onOpenToggle:x.useCallback(()=>c(u=>!u),[c])},x.createElement(Ot.div,oe({"data-state":eie(l),"data-disabled":o?"":void 0},a,{ref:t})))}),kgt="CollapsibleTrigger",$gt=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Jre(kgt,n);return x.createElement(Ot.button,oe({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":eie(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Xe(e.onClick,i.onOpenToggle)}))}),VNe="CollapsibleContent",Tgt=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Jre(VNe,e.__scopeCollapsible);return x.createElement(Gs,{present:n||i.open},({present:o})=>x.createElement(Pgt,oe({},r,{ref:t,present:o})))}),Pgt=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=Jre(VNe,n),[a,l]=x.useState(r),c=x.useRef(null),u=Yt(t,c),f=x.useRef(0),d=f.current,h=x.useRef(0),p=h.current,g=s.open||a,v=x.useRef(g),y=x.useRef();return x.useEffect(()=>{const O=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(O)},[]),Qa(()=>{const O=c.current;if(O){y.current=y.current||{transitionDuration:O.style.transitionDuration,animationName:O.style.animationName},O.style.transitionDuration="0s",O.style.animationName="none";const m=O.getBoundingClientRect();f.current=m.height,h.current=m.width,v.current||(O.style.transitionDuration=y.current.transitionDuration,O.style.animationName=y.current.animationName),l(r)}},[s.open,r]),x.createElement(Ot.div,oe({"data-state":eie(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!g},o,{ref:u,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style}}),g&&i)});function eie(e){return e?"open":"closed"}const Agt=_gt,Rgt=$gt,Dgt=Tgt,Mgt=x.createContext(void 0);function BO(e){const t=x.useContext(Mgt);return e||t||"ltr"}const gv="Accordion",Ngt=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[tie,Igt,Lgt]=jC(gv),[o6,fGn]=uo(gv,[Lgt,qNe]),nie=qNe(),rie=ie.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,o=r;return ie.createElement(tie.Provider,{scope:e.__scopeAccordion},n==="multiple"?ie.createElement(Qgt,oe({},o,{ref:t})):ie.createElement(zgt,oe({},i,{ref:t})))});rie.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[UNe,jgt]=o6(gv),[HNe,Fgt]=o6(gv,{collapsible:!1}),zgt=ie.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...s}=e,[a,l]=ko({prop:n,defaultProp:r,onChange:i});return ie.createElement(UNe,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:ie.useCallback(()=>o&&l(""),[o,l])},ie.createElement(HNe,{scope:e.__scopeAccordion,collapsible:o},ie.createElement(XNe,oe({},s,{ref:t}))))}),Qgt=ie.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[s=[],a]=ko({prop:n,defaultProp:r,onChange:i}),l=ie.useCallback(u=>a((f=[])=>[...f,u]),[a]),c=ie.useCallback(u=>a((f=[])=>f.filter(d=>d!==u)),[a]);return ie.createElement(UNe,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},ie.createElement(HNe,{scope:e.__scopeAccordion,collapsible:!0},ie.createElement(XNe,oe({},o,{ref:t}))))}),[Bgt,s6]=o6(gv),XNe=ie.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...s}=e,a=ie.useRef(null),l=Yt(a,t),c=Igt(n),f=BO(i)==="ltr",d=Xe(e.onKeyDown,h=>{var p;if(!Ngt.includes(h.key))return;const g=h.target,v=c().filter(P=>{var D;return!((D=P.ref.current)!==null&&D!==void 0&&D.disabled)}),y=v.findIndex(P=>P.ref.current===g),O=v.length;if(y===-1)return;h.preventDefault();let m=y;const w=0,S=O-1,E=()=>{m=y+1,m>S&&(m=w)},C=()=>{m=y-1,m<w&&(m=S)};switch(h.key){case"Home":m=w;break;case"End":m=S;break;case"ArrowRight":o==="horizontal"&&(f?E():C());break;case"ArrowDown":o==="vertical"&&E();break;case"ArrowLeft":o==="horizontal"&&(f?C():E());break;case"ArrowUp":o==="vertical"&&C();break}const k=m%O;(p=v[k].ref.current)===null||p===void 0||p.focus()});return ie.createElement(Bgt,{scope:n,disabled:r,direction:i,orientation:o},ie.createElement(tie.Slot,{scope:n},ie.createElement(Ot.div,oe({},s,{"data-orientation":o,ref:l,onKeyDown:r?void 0:d}))))}),RZ="AccordionItem",[Wgt,iie]=o6(RZ),ZNe=ie.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,o=s6(RZ,n),s=jgt(RZ,n),a=nie(n),l=Ra(),c=r&&s.value.includes(r)||!1,u=o.disabled||e.disabled;return ie.createElement(Wgt,{scope:n,open:c,disabled:u,triggerId:l},ie.createElement(Agt,oe({"data-orientation":o.orientation,"data-state":KNe(c)},a,i,{ref:t,disabled:u,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),qgt="AccordionHeader",Vgt=ie.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=s6(gv,n),o=iie(qgt,n);return ie.createElement(Ot.h3,oe({"data-orientation":i.orientation,"data-state":KNe(o.open),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),l0e="AccordionTrigger",YNe=ie.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=s6(gv,n),o=iie(l0e,n),s=Fgt(l0e,n),a=nie(n);return ie.createElement(tie.ItemSlot,{scope:n},ie.createElement(Rgt,oe({"aria-disabled":o.open&&!s.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId},a,r,{ref:t})))}),Ugt="AccordionContent",GNe=ie.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=s6(gv,n),o=iie(Ugt,n),s=nie(n);return ie.createElement(Dgt,oe({role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function KNe(e){return e?"open":"closed"}const Hgt=rie,Xgt=ZNe,Zgt=Vgt,JNe=YNe,eIe=GNe,Ygt={black:"#000",white:"#fff"},G2=Ygt,Ggt={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},_x=Ggt,Kgt={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},kx=Kgt,Jgt={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},$x=Jgt,emt={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Tx=emt,tmt={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Px=tmt,nmt={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},ak=nmt,rmt={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},imt=rmt;function sE(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}const omt=Object.freeze(Object.defineProperty({__proto__:null,default:sE},Symbol.toStringTag,{value:"Module"})),aE="$$material";function $o(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function tIe(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var smt=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,amt=tIe(function(e){return smt.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function lmt(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function cmt(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var umt=function(){function e(n){var r=this;this._insertTag=function(i){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,o),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(cmt(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=lmt(i);try{o.insertRule(r,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){return r.parentNode&&r.parentNode.removeChild(r)}),this.tags=[],this.ctr=0},e}(),ua="-ms-",kj="-moz-",cr="-webkit-",nIe="comm",oie="rule",sie="decl",fmt="@import",rIe="@keyframes",dmt="@layer",hmt=Math.abs,a6=String.fromCharCode,pmt=Object.assign;function gmt(e,t){return As(e,0)^45?(((t<<2^As(e,0))<<2^As(e,1))<<2^As(e,2))<<2^As(e,3):0}function iIe(e){return e.trim()}function mmt(e,t){return(e=t.exec(e))?e[0]:e}function ur(e,t,n){return e.replace(t,n)}function DZ(e,t){return e.indexOf(t)}function As(e,t){return e.charCodeAt(t)|0}function K2(e,t,n){return e.slice(t,n)}function ph(e){return e.length}function aie(e){return e.length}function NM(e,t){return t.push(e),e}function ymt(e,t){return e.map(t).join("")}var l6=1,lE=1,oIe=0,nc=0,wo=0,FC="";function c6(e,t,n,r,i,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:l6,column:lE,length:s,return:""}}function lk(e,t){return pmt(c6("",null,null,"",null,null,0),e,{length:-e.length},t)}function vmt(){return wo}function bmt(){return wo=nc>0?As(FC,--nc):0,lE--,wo===10&&(lE=1,l6--),wo}function Xc(){return wo=nc<oIe?As(FC,nc++):0,lE++,wo===10&&(lE=1,l6++),wo}function Lh(){return As(FC,nc)}function w5(){return nc}function mR(e,t){return K2(FC,e,t)}function J2(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function sIe(e){return l6=lE=1,oIe=ph(FC=e),nc=0,[]}function aIe(e){return FC="",e}function S5(e){return iIe(mR(nc-1,MZ(e===91?e+2:e===40?e+1:e)))}function Omt(e){for(;(wo=Lh())&&wo<33;)Xc();return J2(e)>2||J2(wo)>3?"":" "}function xmt(e,t){for(;--t&&Xc()&&!(wo<48||wo>102||wo>57&&wo<65||wo>70&&wo<97););return mR(e,w5()+(t<6&&Lh()==32&&Xc()==32))}function MZ(e){for(;Xc();)switch(wo){case e:return nc;case 34:case 39:e!==34&&e!==39&&MZ(wo);break;case 40:e===41&&MZ(e);break;case 92:Xc();break}return nc}function wmt(e,t){for(;Xc()&&e+wo!==57;)if(e+wo===84&&Lh()===47)break;return"/*"+mR(t,nc-1)+"*"+a6(e===47?e:Xc())}function Smt(e){for(;!J2(Lh());)Xc();return mR(e,nc)}function Emt(e){return aIe(E5("",null,null,null,[""],e=sIe(e),0,[0],e))}function E5(e,t,n,r,i,o,s,a,l){for(var c=0,u=0,f=s,d=0,h=0,p=0,g=1,v=1,y=1,O=0,m="",w=i,S=o,E=r,C=m;v;)switch(p=O,O=Xc()){case 40:if(p!=108&&As(C,f-1)==58){DZ(C+=ur(S5(O),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:C+=S5(O);break;case 9:case 10:case 13:case 32:C+=Omt(p);break;case 92:C+=xmt(w5()-1,7);continue;case 47:switch(Lh()){case 42:case 47:NM(Cmt(wmt(Xc(),w5()),t,n),l);break;default:C+="/"}break;case 123*g:a[c++]=ph(C)*y;case 125*g:case 59:case 0:switch(O){case 0:case 125:v=0;case 59+u:y==-1&&(C=ur(C,/\f/g,"")),h>0&&ph(C)-f&&NM(h>32?u0e(C+";",r,n,f-1):u0e(ur(C," ","")+";",r,n,f-2),l);break;case 59:C+=";";default:if(NM(E=c0e(C,t,n,c,u,i,a,m,w=[],S=[],f),o),O===123)if(u===0)E5(C,t,E,E,w,o,f,a,S);else switch(d===99&&As(C,3)===110?100:d){case 100:case 108:case 109:case 115:E5(e,E,E,r&&NM(c0e(e,E,E,0,0,i,a,m,i,w=[],f),S),i,S,f,a,r?w:S);break;default:E5(C,E,E,E,[""],S,0,a,S)}}c=u=h=0,g=y=1,m=C="",f=s;break;case 58:f=1+ph(C),h=p;default:if(g<1){if(O==123)--g;else if(O==125&&g++==0&&bmt()==125)continue}switch(C+=a6(O),O*g){case 38:y=u>0?1:(C+="\f",-1);break;case 44:a[c++]=(ph(C)-1)*y,y=1;break;case 64:Lh()===45&&(C+=S5(Xc())),d=Lh(),u=f=ph(m=C+=Smt(w5())),O++;break;case 45:p===45&&ph(C)==2&&(g=0)}}return o}function c0e(e,t,n,r,i,o,s,a,l,c,u){for(var f=i-1,d=i===0?o:[""],h=aie(d),p=0,g=0,v=0;p<r;++p)for(var y=0,O=K2(e,f+1,f=hmt(g=s[p])),m=e;y<h;++y)(m=iIe(g>0?d[y]+" "+O:ur(O,/&\f/g,d[y])))&&(l[v++]=m);return c6(e,t,n,i===0?oie:a,l,c,u)}function Cmt(e,t,n){return c6(e,t,n,nIe,a6(vmt()),K2(e,2,-2),0)}function u0e(e,t,n,r){return c6(e,t,n,sie,K2(e,0,r),K2(e,r+1,-1),r)}function gS(e,t){for(var n="",r=aie(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function _mt(e,t,n,r){switch(e.type){case dmt:if(e.children.length)break;case fmt:case sie:return e.return=e.return||e.value;case nIe:return"";case rIe:return e.return=e.value+"{"+gS(e.children,r)+"}";case oie:e.value=e.props.join(",")}return ph(n=gS(e.children,r))?e.return=e.value+"{"+n+"}":""}function kmt(e){var t=aie(e);return function(n,r,i,o){for(var s="",a=0;a<t;a++)s+=e[a](n,r,i,o)||"";return s}}function $mt(e){return function(t){t.root||(t=t.return)&&e(t)}}var Tmt=function(t,n,r){for(var i=0,o=0;i=o,o=Lh(),i===38&&o===12&&(n[r]=1),!J2(o);)Xc();return mR(t,nc)},Pmt=function(t,n){var r=-1,i=44;do switch(J2(i)){case 0:i===38&&Lh()===12&&(n[r]=1),t[r]+=Tmt(nc-1,n,r);break;case 2:t[r]+=S5(i);break;case 4:if(i===44){t[++r]=Lh()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=a6(i)}while(i=Xc());return t},Amt=function(t,n){return aIe(Pmt(sIe(t),n))},f0e=new WeakMap,Rmt=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!f0e.get(r))&&!i){f0e.set(t,!0);for(var o=[],s=Amt(n,o),a=r.props,l=0,c=0;l<s.length;l++)for(var u=0;u<a.length;u++,c++)t.props[c]=o[l]?s[l].replace(/&\f/g,a[u]):a[u]+" "+s[l]}}},Dmt=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function lIe(e,t){switch(gmt(e,t)){case 5103:return cr+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return cr+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return cr+e+kj+e+ua+e+e;case 6828:case 4268:return cr+e+ua+e+e;case 6165:return cr+e+ua+"flex-"+e+e;case 5187:return cr+e+ur(e,/(\w+).+(:[^]+)/,cr+"box-$1$2"+ua+"flex-$1$2")+e;case 5443:return cr+e+ua+"flex-item-"+ur(e,/flex-|-self/,"")+e;case 4675:return cr+e+ua+"flex-line-pack"+ur(e,/align-content|flex-|-self/,"")+e;case 5548:return cr+e+ua+ur(e,"shrink","negative")+e;case 5292:return cr+e+ua+ur(e,"basis","preferred-size")+e;case 6060:return cr+"box-"+ur(e,"-grow","")+cr+e+ua+ur(e,"grow","positive")+e;case 4554:return cr+ur(e,/([^-])(transform)/g,"$1"+cr+"$2")+e;case 6187:return ur(ur(ur(e,/(zoom-|grab)/,cr+"$1"),/(image-set)/,cr+"$1"),e,"")+e;case 5495:case 3959:return ur(e,/(image-set\([^]*)/,cr+"$1$`$1");case 4968:return ur(ur(e,/(.+:)(flex-)?(.*)/,cr+"box-pack:$3"+ua+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+cr+e+e;case 4095:case 3583:case 4068:case 2532:return ur(e,/(.+)-inline(.+)/,cr+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ph(e)-1-t>6)switch(As(e,t+1)){case 109:if(As(e,t+4)!==45)break;case 102:return ur(e,/(.+:)(.+)-([^]+)/,"$1"+cr+"$2-$3$1"+kj+(As(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~DZ(e,"stretch")?lIe(ur(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(As(e,t+1)!==115)break;case 6444:switch(As(e,ph(e)-3-(~DZ(e,"!important")&&10))){case 107:return ur(e,":",":"+cr)+e;case 101:return ur(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+cr+(As(e,14)===45?"inline-":"")+"box$3$1"+cr+"$2$3$1"+ua+"$2box$3")+e}break;case 5936:switch(As(e,t+11)){case 114:return cr+e+ua+ur(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return cr+e+ua+ur(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return cr+e+ua+ur(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return cr+e+ua+e+e}return e}var Mmt=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case sie:t.return=lIe(t.value,t.length);break;case rIe:return gS([lk(t,{value:ur(t.value,"@","@"+cr)})],i);case oie:if(t.length)return ymt(t.props,function(o){switch(mmt(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return gS([lk(t,{props:[ur(o,/:(read-\w+)/,":"+kj+"$1")]})],i);case"::placeholder":return gS([lk(t,{props:[ur(o,/:(plac\w+)/,":"+cr+"input-$1")]}),lk(t,{props:[ur(o,/:(plac\w+)/,":"+kj+"$1")]}),lk(t,{props:[ur(o,/:(plac\w+)/,ua+"input-$1")]})],i)}return""})}},Nmt=[Mmt],$j=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var v=g.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var i=t.stylisPlugins||Nmt,o={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var v=g.getAttribute("data-emotion").split(" "),y=1;y<v.length;y++)o[v[y]]=!0;a.push(g)});var l,c=[Rmt,Dmt];{var u,f=[_mt,$mt(function(g){u.insert(g)})],d=kmt(c.concat(i,f)),h=function(v){return gS(Emt(v),d)};l=function(v,y,O,m){u=O,h(v?v+"{"+y.styles+"}":y.styles),m&&(p.inserted[y.name]=!0)}}var p={key:n,sheet:new umt({key:n,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return p.sheet.hydrate(a),p},cIe={exports:{}},$r={};/** @license React v16.13.1
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ys=typeof Symbol=="function"&&Symbol.for,lie=ys?Symbol.for("react.element"):60103,cie=ys?Symbol.for("react.portal"):60106,u6=ys?Symbol.for("react.fragment"):60107,f6=ys?Symbol.for("react.strict_mode"):60108,d6=ys?Symbol.for("react.profiler"):60114,h6=ys?Symbol.for("react.provider"):60109,p6=ys?Symbol.for("react.context"):60110,uie=ys?Symbol.for("react.async_mode"):60111,g6=ys?Symbol.for("react.concurrent_mode"):60111,m6=ys?Symbol.for("react.forward_ref"):60112,y6=ys?Symbol.for("react.suspense"):60113,Imt=ys?Symbol.for("react.suspense_list"):60120,v6=ys?Symbol.for("react.memo"):60115,b6=ys?Symbol.for("react.lazy"):60116,Lmt=ys?Symbol.for("react.block"):60121,jmt=ys?Symbol.for("react.fundamental"):60117,Fmt=ys?Symbol.for("react.responder"):60118,zmt=ys?Symbol.for("react.scope"):60119;function du(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case lie:switch(e=e.type,e){case uie:case g6:case u6:case d6:case f6:case y6:return e;default:switch(e=e&&e.$$typeof,e){case p6:case m6:case b6:case v6:case h6:return e;default:return t}}case cie:return t}}}function uIe(e){return du(e)===g6}$r.AsyncMode=uie;$r.ConcurrentMode=g6;$r.ContextConsumer=p6;$r.ContextProvider=h6;$r.Element=lie;$r.ForwardRef=m6;$r.Fragment=u6;$r.Lazy=b6;$r.Memo=v6;$r.Portal=cie;$r.Profiler=d6;$r.StrictMode=f6;$r.Suspense=y6;$r.isAsyncMode=function(e){return uIe(e)||du(e)===uie};$r.isConcurrentMode=uIe;$r.isContextConsumer=function(e){return du(e)===p6};$r.isContextProvider=function(e){return du(e)===h6};$r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===lie};$r.isForwardRef=function(e){return du(e)===m6};$r.isFragment=function(e){return du(e)===u6};$r.isLazy=function(e){return du(e)===b6};$r.isMemo=function(e){return du(e)===v6};$r.isPortal=function(e){return du(e)===cie};$r.isProfiler=function(e){return du(e)===d6};$r.isStrictMode=function(e){return du(e)===f6};$r.isSuspense=function(e){return du(e)===y6};$r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===u6||e===g6||e===d6||e===f6||e===y6||e===Imt||typeof e=="object"&&e!==null&&(e.$$typeof===b6||e.$$typeof===v6||e.$$typeof===h6||e.$$typeof===p6||e.$$typeof===m6||e.$$typeof===jmt||e.$$typeof===Fmt||e.$$typeof===zmt||e.$$typeof===Lmt)};$r.typeOf=du;cIe.exports=$r;var Qmt=cIe.exports,fIe=Qmt,Bmt={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Wmt={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},dIe={};dIe[fIe.ForwardRef]=Bmt;dIe[fIe.Memo]=Wmt;var qmt=!0;function Vmt(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var hIe=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||qmt===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},pIe=function(t,n,r){hIe(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+i:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function Umt(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Hmt={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Xmt=/[A-Z]|^ms/g,Zmt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,gIe=function(t){return t.charCodeAt(1)===45},d0e=function(t){return t!=null&&typeof t!="boolean"},NW=tIe(function(e){return gIe(e)?e:e.replace(Xmt,"-$&").toLowerCase()}),h0e=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Zmt,function(r,i,o){return gh={name:i,styles:o,next:gh},i})}return Hmt[t]!==1&&!gIe(t)&&typeof n=="number"&&n!==0?n+"px":n};function eP(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return gh={name:n.name,styles:n.styles,next:gh},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)gh={name:r.name,styles:r.styles,next:gh},r=r.next;var i=n.styles+";";return i}return Ymt(e,t,n)}case"function":{if(e!==void 0){var o=gh,s=n(e);return gh=o,eP(e,t,s)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function Ymt(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=eP(e,t,n[i])+";";else for(var o in n){var s=n[o];if(typeof s!="object")t!=null&&t[s]!==void 0?r+=o+"{"+t[s]+"}":d0e(s)&&(r+=NW(o)+":"+h0e(o,s)+";");else if(Array.isArray(s)&&typeof s[0]=="string"&&(t==null||t[s[0]]===void 0))for(var a=0;a<s.length;a++)d0e(s[a])&&(r+=NW(o)+":"+h0e(o,s[a])+";");else{var l=eP(e,t,s);switch(o){case"animation":case"animationName":{r+=NW(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}return r}var p0e=/label:\s*([^\s;\n{]+)\s*(;|$)/g,gh,fie=function(t,n,r){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var i=!0,o="";gh=void 0;var s=t[0];s==null||s.raw===void 0?(i=!1,o+=eP(r,n,s)):o+=s[0];for(var a=1;a<t.length;a++)o+=eP(r,n,t[a]),i&&(o+=s[a]);p0e.lastIndex=0;for(var l="",c;(c=p0e.exec(o))!==null;)l+="-"+c[1];var u=Umt(o)+l;return{name:u,styles:o,next:gh}},Gmt=function(t){return t()},mIe=YS.useInsertionEffect?YS.useInsertionEffect:!1,Kmt=mIe||Gmt,g0e=mIe||x.useLayoutEffect,yIe=x.createContext(typeof HTMLElement<"u"?$j({key:"css"}):null),vIe=yIe.Provider,bIe=function(t){return x.forwardRef(function(n,r){var i=x.useContext(yIe);return t(n,i,r)})},yR=x.createContext({}),Jmt=bIe(function(e,t){var n=e.styles,r=fie([n],void 0,x.useContext(yR)),i=x.useRef();return g0e(function(){var o=t.key+"-global",s=new t.sheet.constructor({key:o,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),a=!1,l=document.querySelector('style[data-emotion="'+o+" "+r.name+'"]');return t.sheet.tags.length&&(s.before=t.sheet.tags[0]),l!==null&&(a=!0,l.setAttribute("data-emotion",o),s.hydrate([l])),i.current=[s,a],function(){s.flush()}},[t]),g0e(function(){var o=i.current,s=o[0],a=o[1];if(a){o[1]=!1;return}if(r.next!==void 0&&pIe(t,r.next,!0),s.tags.length){var l=s.tags[s.tags.length-1].nextElementSibling;s.before=l,s.flush()}t.insert("",r,s,!1)},[t,r.name]),null});function OIe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return fie(t)}var eyt=function(){var t=OIe.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},tyt=amt,nyt=function(t){return t!=="theme"},m0e=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?tyt:nyt},y0e=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(s){return t.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},ryt=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return hIe(n,r,i),Kmt(function(){return pIe(n,r,i)}),null},iyt=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,s;n!==void 0&&(o=n.label,s=n.target);var a=y0e(t,n,r),l=a||m0e(i),c=!l("as");return function(){var u=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{f.push(u[0][0]);for(var d=u.length,h=1;h<d;h++)f.push(u[h],u[0][h])}var p=bIe(function(g,v,y){var O=c&&g.as||i,m="",w=[],S=g;if(g.theme==null){S={};for(var E in g)S[E]=g[E];S.theme=x.useContext(yR)}typeof g.className=="string"?m=Vmt(v.registered,w,g.className):g.className!=null&&(m=g.className+" ");var C=fie(f.concat(w),v.registered,S);m+=v.key+"-"+C.name,s!==void 0&&(m+=" "+s);var k=c&&a===void 0?m0e(O):l,P={};for(var D in g)c&&D==="as"||k(D)&&(P[D]=g[D]);return P.className=m,P.ref=y,x.createElement(x.Fragment,null,x.createElement(ryt,{cache:v,serialized:C,isStringTag:typeof O=="string"}),x.createElement(O,P))});return p.displayName=o!==void 0?o:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",p.defaultProps=t.defaultProps,p.__emotion_real=p,p.__emotion_base=i,p.__emotion_styles=f,p.__emotion_forwardProp=a,Object.defineProperty(p,"toString",{value:function(){return"."+s}}),p.withComponent=function(g,v){return e(g,oe({},n,v,{shouldForwardProp:y0e(p,v,!0)})).apply(void 0,f)},p}},oyt=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],NZ=iyt.bind();oyt.forEach(function(e){NZ[e]=NZ(e)});var xIe={exports:{}},syt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ayt=syt,lyt=ayt;function wIe(){}function SIe(){}SIe.resetWarningCache=wIe;var cyt=function(){function e(r,i,o,s,a,l){if(l!==lyt){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:SIe,resetWarningCache:wIe};return n.PropTypes=n,n};xIe.exports=cyt();var lm=xIe.exports;const Or=wf(lm);let IZ;typeof document=="object"&&(IZ=$j({key:"css",prepend:!0}));function uyt(e){const{injectFirst:t,children:n}=e;return t&&IZ?b.jsx(vIe,{value:IZ,children:n}):n}function fyt(e){return e==null||Object.keys(e).length===0}function EIe(e){const{styles:t,defaultTheme:n={}}=e,r=typeof t=="function"?i=>t(fyt(i)?n:i):t;return b.jsx(Jmt,{styles:r})}function CIe(e,t){return NZ(e,t)}const dyt=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},hyt=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:EIe,StyledEngineProvider:uyt,ThemeContext:yR,css:OIe,default:CIe,internal_processStyles:dyt,keyframes:eyt},Symbol.toStringTag,{value:"Module"}));function py(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function _Ie(e){if(!py(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=_Ie(e[n])}),t}function jh(e,t,n={clone:!0}){const r=n.clone?oe({},e):e;return py(e)&&py(t)&&Object.keys(t).forEach(i=>{i!=="__proto__"&&(py(t[i])&&i in e&&py(e[i])?r[i]=jh(e[i],t[i],n):n.clone?r[i]=py(t[i])?_Ie(t[i]):t[i]:r[i]=t[i])}),r}const pyt=Object.freeze(Object.defineProperty({__proto__:null,default:jh,isPlainObject:py},Symbol.toStringTag,{value:"Module"})),gyt=["values","unit","step"],myt=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>oe({},n,{[r.key]:r.val}),{})};function kIe(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=e,i=$o(e,gyt),o=myt(t),s=Object.keys(o);function a(d){return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n})`}function l(d){return`@media (max-width:${(typeof t[d]=="number"?t[d]:d)-r/100}${n})`}function c(d,h){const p=s.indexOf(h);return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${n}) and (max-width:${(p!==-1&&typeof t[s[p]]=="number"?t[s[p]]:h)-r/100}${n})`}function u(d){return s.indexOf(d)+1<s.length?c(d,s[s.indexOf(d)+1]):a(d)}function f(d){const h=s.indexOf(d);return h===0?a(s[1]):h===s.length-1?l(s[h]):c(d,s[s.indexOf(d)+1]).replace("@media","@media not all and")}return oe({keys:s,values:o,up:a,down:l,between:c,only:u,not:f,unit:n},i)}const yyt={borderRadius:4},vyt=yyt;function ST(e,t){return t?jh(e,t,{clone:!1}):e}const die={xs:0,sm:600,md:900,lg:1200,xl:1536},v0e={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${die[e]}px)`};function qg(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||v0e;return t.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(t[l]),s),{})}if(typeof t=="object"){const o=r.breakpoints||v0e;return Object.keys(t).reduce((s,a)=>{if(Object.keys(o.values||die).indexOf(a)!==-1){const l=o.up(a);s[l]=n(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return n(t)}function byt(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function Oyt(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Gh(e){if(typeof e!="string")throw new Error(sE(7));return e.charAt(0).toUpperCase()+e.slice(1)}const xyt=Object.freeze(Object.defineProperty({__proto__:null,default:Gh},Symbol.toStringTag,{value:"Module"}));function O6(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function Tj(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=O6(e,n)||r,t&&(i=t(i,r,e)),i}function fo(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=O6(l,r)||{};return qg(s,a,f=>{let d=Tj(c,i,f);return f===d&&typeof f=="string"&&(d=Tj(c,i,`${t}${f==="default"?"":Gh(f)}`,f)),n===!1?d:{[n]:d}})};return o.propTypes={},o.filterProps=[t],o}function wyt(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const Syt={m:"margin",p:"padding"},Eyt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},b0e={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Cyt=wyt(e=>{if(e.length>2)if(b0e[e])e=b0e[e];else return[e];const[t,n]=e.split(""),r=Syt[t],i=Eyt[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),hie=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],pie=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...hie,...pie];function vR(e,t,n,r){var i;const o=(i=O6(e,t,!1))!=null?i:n;return typeof o=="number"?s=>typeof s=="string"?s:o*s:Array.isArray(o)?s=>typeof s=="string"?s:o[s]:typeof o=="function"?o:()=>{}}function $Ie(e){return vR(e,"spacing",8)}function bR(e,t){if(typeof t=="string"||t==null)return t;const n=Math.abs(t),r=e(n);return t>=0?r:typeof r=="number"?-r:`-${r}`}function _yt(e,t){return n=>e.reduce((r,i)=>(r[i]=bR(t,n),r),{})}function kyt(e,t,n,r){if(t.indexOf(n)===-1)return null;const i=Cyt(n),o=_yt(i,r),s=e[n];return qg(e,s,o)}function TIe(e,t){const n=$Ie(e.theme);return Object.keys(e).map(r=>kyt(e,t,r,n)).reduce(ST,{})}function Fi(e){return TIe(e,hie)}Fi.propTypes={};Fi.filterProps=hie;function zi(e){return TIe(e,pie)}zi.propTypes={};zi.filterProps=pie;function $yt(e=8){if(e.mui)return e;const t=$Ie({spacing:e}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=t(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function x6(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?ST(i,t[o](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function ku(e){return typeof e!="number"?e:`${e}px solid`}function Sf(e,t){return fo({prop:e,themeKey:"borders",transform:t})}const Tyt=Sf("border",ku),Pyt=Sf("borderTop",ku),Ayt=Sf("borderRight",ku),Ryt=Sf("borderBottom",ku),Dyt=Sf("borderLeft",ku),Myt=Sf("borderColor"),Nyt=Sf("borderTopColor"),Iyt=Sf("borderRightColor"),Lyt=Sf("borderBottomColor"),jyt=Sf("borderLeftColor"),Fyt=Sf("outline",ku),zyt=Sf("outlineColor"),w6=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=vR(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:bR(t,r)});return qg(e,e.borderRadius,n)}return null};w6.propTypes={};w6.filterProps=["borderRadius"];x6(Tyt,Pyt,Ayt,Ryt,Dyt,Myt,Nyt,Iyt,Lyt,jyt,w6,Fyt,zyt);const S6=e=>{if(e.gap!==void 0&&e.gap!==null){const t=vR(e.theme,"spacing",8),n=r=>({gap:bR(t,r)});return qg(e,e.gap,n)}return null};S6.propTypes={};S6.filterProps=["gap"];const E6=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=vR(e.theme,"spacing",8),n=r=>({columnGap:bR(t,r)});return qg(e,e.columnGap,n)}return null};E6.propTypes={};E6.filterProps=["columnGap"];const C6=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=vR(e.theme,"spacing",8),n=r=>({rowGap:bR(t,r)});return qg(e,e.rowGap,n)}return null};C6.propTypes={};C6.filterProps=["rowGap"];const Qyt=fo({prop:"gridColumn"}),Byt=fo({prop:"gridRow"}),Wyt=fo({prop:"gridAutoFlow"}),qyt=fo({prop:"gridAutoColumns"}),Vyt=fo({prop:"gridAutoRows"}),Uyt=fo({prop:"gridTemplateColumns"}),Hyt=fo({prop:"gridTemplateRows"}),Xyt=fo({prop:"gridTemplateAreas"}),Zyt=fo({prop:"gridArea"});x6(S6,E6,C6,Qyt,Byt,Wyt,qyt,Vyt,Uyt,Hyt,Xyt,Zyt);function mS(e,t){return t==="grey"?t:e}const Yyt=fo({prop:"color",themeKey:"palette",transform:mS}),Gyt=fo({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:mS}),Kyt=fo({prop:"backgroundColor",themeKey:"palette",transform:mS});x6(Yyt,Gyt,Kyt);function Lc(e){return e<=1&&e!==0?`${e*100}%`:e}const Jyt=fo({prop:"width",transform:Lc}),gie=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var r,i;const o=((r=e.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||die[n];return o?((i=e.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:Lc(n)}};return qg(e,e.maxWidth,t)}return null};gie.filterProps=["maxWidth"];const e0t=fo({prop:"minWidth",transform:Lc}),t0t=fo({prop:"height",transform:Lc}),n0t=fo({prop:"maxHeight",transform:Lc}),r0t=fo({prop:"minHeight",transform:Lc});fo({prop:"size",cssProperty:"width",transform:Lc});fo({prop:"size",cssProperty:"height",transform:Lc});const i0t=fo({prop:"boxSizing"});x6(Jyt,gie,e0t,t0t,n0t,r0t,i0t);const o0t={border:{themeKey:"borders",transform:ku},borderTop:{themeKey:"borders",transform:ku},borderRight:{themeKey:"borders",transform:ku},borderBottom:{themeKey:"borders",transform:ku},borderLeft:{themeKey:"borders",transform:ku},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ku},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:w6},color:{themeKey:"palette",transform:mS},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:mS},backgroundColor:{themeKey:"palette",transform:mS},p:{style:zi},pt:{style:zi},pr:{style:zi},pb:{style:zi},pl:{style:zi},px:{style:zi},py:{style:zi},padding:{style:zi},paddingTop:{style:zi},paddingRight:{style:zi},paddingBottom:{style:zi},paddingLeft:{style:zi},paddingX:{style:zi},paddingY:{style:zi},paddingInline:{style:zi},paddingInlineStart:{style:zi},paddingInlineEnd:{style:zi},paddingBlock:{style:zi},paddingBlockStart:{style:zi},paddingBlockEnd:{style:zi},m:{style:Fi},mt:{style:Fi},mr:{style:Fi},mb:{style:Fi},ml:{style:Fi},mx:{style:Fi},my:{style:Fi},margin:{style:Fi},marginTop:{style:Fi},marginRight:{style:Fi},marginBottom:{style:Fi},marginLeft:{style:Fi},marginX:{style:Fi},marginY:{style:Fi},marginInline:{style:Fi},marginInlineStart:{style:Fi},marginInlineEnd:{style:Fi},marginBlock:{style:Fi},marginBlockStart:{style:Fi},marginBlockEnd:{style:Fi},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:S6},rowGap:{style:C6},columnGap:{style:E6},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Lc},maxWidth:{style:gie},minWidth:{transform:Lc},height:{transform:Lc},maxHeight:{transform:Lc},minHeight:{transform:Lc},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},OR=o0t;function s0t(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function a0t(e,t){return typeof e=="function"?e(t):e}function PIe(){function e(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const d=O6(i,c)||{};return f?f(s):qg(s,r,p=>{let g=Tj(d,u,p);return p===g&&typeof p=="string"&&(g=Tj(d,u,`${n}${p==="default"?"":Gh(p)}`,p)),l===!1?g:{[l]:g}})}function t(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const s=(r=o.unstable_sxConfig)!=null?r:OR;function a(l){let c=l;if(typeof l=="function")c=l(o);else if(typeof l!="object")return l;if(!c)return null;const u=byt(o.breakpoints),f=Object.keys(u);let d=u;return Object.keys(c).forEach(h=>{const p=a0t(c[h],o);if(p!=null)if(typeof p=="object")if(s[h])d=ST(d,e(h,p,o,s));else{const g=qg({theme:o},p,v=>({[h]:v}));s0t(g,p)?d[h]=t({sx:p,theme:o}):d=ST(d,g)}else d=ST(d,e(h,p,o,s))}),Oyt(f,d)}return Array.isArray(i)?i.map(a):a(i)}return t}const xR=PIe();xR.filterProps=["sx"];function AIe(e,t){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:t}:n.palette.mode===e?t:{}}const l0t=["breakpoints","palette","spacing","shape"];function mie(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=e,s=$o(e,l0t),a=kIe(n),l=$yt(i);let c=jh({breakpoints:a,direction:"ltr",components:{},palette:oe({mode:"light"},r),spacing:l,shape:oe({},vyt,o)},s);return c.applyStyles=AIe,c=t.reduce((u,f)=>jh(u,f),c),c.unstable_sxConfig=oe({},OR,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(f){return xR({sx:f,theme:this})},c}const c0t=Object.freeze(Object.defineProperty({__proto__:null,default:mie,private_createBreakpoints:kIe,unstable_applyStyles:AIe},Symbol.toStringTag,{value:"Module"}));function u0t(e){return Object.keys(e).length===0}function RIe(e=null){const t=x.useContext(yR);return!t||u0t(t)?e:t}const f0t=mie();function yie(e=f0t){return RIe(e)}function d0t({styles:e,themeId:t,defaultTheme:n={}}){const r=yie(n),i=typeof e=="function"?e(t&&r[t]||r):e;return b.jsx(EIe,{styles:i})}const h0t=["sx"],p0t=e=>{var t,n;const r={systemProps:{},otherProps:{}},i=(t=e==null||(n=e.theme)==null?void 0:n.unstable_sxConfig)!=null?t:OR;return Object.keys(e).forEach(o=>{i[o]?r.systemProps[o]=e[o]:r.otherProps[o]=e[o]}),r};function DIe(e){const{sx:t}=e,n=$o(e,h0t),{systemProps:r,otherProps:i}=p0t(n);let o;return Array.isArray(t)?o=[r,...t]:typeof t=="function"?o=(...s)=>{const a=t(...s);return py(a)?oe({},r,a):r}:o=oe({},r,t),oe({},i,{sx:o})}const g0t=Object.freeze(Object.defineProperty({__proto__:null,default:xR,extendSxProp:DIe,unstable_createStyleFunctionSx:PIe,unstable_defaultSxConfig:OR},Symbol.toStringTag,{value:"Module"})),O0e=e=>e,m0t=()=>{let e=O0e;return{configure(t){e=t},generate(t){return e(t)},reset(){e=O0e}}},y0t=m0t(),MIe=y0t,v0t=["className","component"];function b0t(e={}){const{themeId:t,defaultTheme:n,defaultClassName:r="MuiBox-root",generateClassName:i}=e,o=CIe("div",{shouldForwardProp:a=>a!=="theme"&&a!=="sx"&&a!=="as"})(xR);return x.forwardRef(function(l,c){const u=yie(n),f=DIe(l),{className:d,component:h="div"}=f,p=$o(f,v0t);return b.jsx(o,oe({as:h,ref:c,className:bd(d,i?i(r):r),theme:t&&u[t]||u},p))})}const O0t={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function _6(e,t,n="Mui"){const r=O0t[t];return r?`${n}-${r}`:`${MIe.generate(e)}-${t}`}function k6(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=_6(e,i,n)}),r}var NIe={exports:{}},Tr={};/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var vie=Symbol.for("react.element"),bie=Symbol.for("react.portal"),$6=Symbol.for("react.fragment"),T6=Symbol.for("react.strict_mode"),P6=Symbol.for("react.profiler"),A6=Symbol.for("react.provider"),R6=Symbol.for("react.context"),x0t=Symbol.for("react.server_context"),D6=Symbol.for("react.forward_ref"),M6=Symbol.for("react.suspense"),N6=Symbol.for("react.suspense_list"),I6=Symbol.for("react.memo"),L6=Symbol.for("react.lazy"),w0t=Symbol.for("react.offscreen"),IIe;IIe=Symbol.for("react.module.reference");function Ef(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case vie:switch(e=e.type,e){case $6:case P6:case T6:case M6:case N6:return e;default:switch(e=e&&e.$$typeof,e){case x0t:case R6:case D6:case L6:case I6:case A6:return e;default:return t}}case bie:return t}}}Tr.ContextConsumer=R6;Tr.ContextProvider=A6;Tr.Element=vie;Tr.ForwardRef=D6;Tr.Fragment=$6;Tr.Lazy=L6;Tr.Memo=I6;Tr.Portal=bie;Tr.Profiler=P6;Tr.StrictMode=T6;Tr.Suspense=M6;Tr.SuspenseList=N6;Tr.isAsyncMode=function(){return!1};Tr.isConcurrentMode=function(){return!1};Tr.isContextConsumer=function(e){return Ef(e)===R6};Tr.isContextProvider=function(e){return Ef(e)===A6};Tr.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===vie};Tr.isForwardRef=function(e){return Ef(e)===D6};Tr.isFragment=function(e){return Ef(e)===$6};Tr.isLazy=function(e){return Ef(e)===L6};Tr.isMemo=function(e){return Ef(e)===I6};Tr.isPortal=function(e){return Ef(e)===bie};Tr.isProfiler=function(e){return Ef(e)===P6};Tr.isStrictMode=function(e){return Ef(e)===T6};Tr.isSuspense=function(e){return Ef(e)===M6};Tr.isSuspenseList=function(e){return Ef(e)===N6};Tr.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===$6||e===P6||e===T6||e===M6||e===N6||e===w0t||typeof e=="object"&&e!==null&&(e.$$typeof===L6||e.$$typeof===I6||e.$$typeof===A6||e.$$typeof===R6||e.$$typeof===D6||e.$$typeof===IIe||e.getModuleId!==void 0)};Tr.typeOf=Ef;NIe.exports=Tr;var x0e=NIe.exports;const S0t=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function LIe(e){const t=`${e}`.match(S0t);return t&&t[1]||""}function jIe(e,t=""){return e.displayName||e.name||LIe(e)||t}function w0e(e,t,n){const r=jIe(t);return e.displayName||(r!==""?`${n}(${r})`:n)}function E0t(e){if(e!=null){if(typeof e=="string")return e;if(typeof e=="function")return jIe(e,"Component");if(typeof e=="object")switch(e.$$typeof){case x0e.ForwardRef:return w0e(e,e.render,"ForwardRef");case x0e.Memo:return w0e(e,e.type,"memo");default:return}}}const C0t=Object.freeze(Object.defineProperty({__proto__:null,default:E0t,getFunctionName:LIe},Symbol.toStringTag,{value:"Module"}));function FIe(e,t){const n=oe({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=oe({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=e[r]||{},o=t[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=oe({},o),Object.keys(i).forEach(s=>{n[r][s]=FIe(i[s],o[s])}))}else n[r]===void 0&&(n[r]=e[r])}),n}function _0t(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:FIe(t.components[n].defaultProps,r)}function k0t({props:e,name:t,defaultTheme:n,themeId:r}){let i=yie(n);return r&&(i=i[r]||i),_0t({theme:i,name:t,props:e})}const Pj=typeof window<"u"?x.useLayoutEffect:x.useEffect;function $0t(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const T0t=Object.freeze(Object.defineProperty({__proto__:null,default:$0t},Symbol.toStringTag,{value:"Module"}));function P0t(e,t=166){let n;function r(...i){const o=()=>{e.apply(this,i)};clearTimeout(n),n=setTimeout(o,t)}return r.clear=()=>{clearTimeout(n)},r}function A0t(e){return e&&e.ownerDocument||document}function S0e(e){return A0t(e).defaultView||window}function R0t(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function zIe(...e){return x.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{R0t(n,t)})},e)}function Oie(e,t,n=void 0){const r={};return Object.keys(e).forEach(i=>{r[i]=e[i].reduce((o,s)=>{if(s){const a=t(s);a!==""&&o.push(a),n&&n[s]&&o.push(n[s])}return o},[]).join(" ")}),r}const D0t=x.createContext(null),QIe=D0t;function BIe(){return x.useContext(QIe)}const M0t=typeof Symbol=="function"&&Symbol.for,N0t=M0t?Symbol.for("mui.nested"):"__THEME_NESTED__";function I0t(e,t){return typeof t=="function"?t(e):oe({},e,t)}function L0t(e){const{children:t,theme:n}=e,r=BIe(),i=x.useMemo(()=>{const o=r===null?n:I0t(r,n);return o!=null&&(o[N0t]=r!==null),o},[n,r]);return b.jsx(QIe.Provider,{value:i,children:t})}const j0t=["value"],F0t=x.createContext();function z0t(e){let{value:t}=e,n=$o(e,j0t);return b.jsx(F0t.Provider,oe({value:t??!0},n))}const E0e={};function C0e(e,t,n,r=!1){return x.useMemo(()=>{const i=e&&t[e]||t;if(typeof n=="function"){const o=n(i),s=e?oe({},t,{[e]:o}):o;return r?()=>s:s}return e?oe({},t,{[e]:n}):oe({},t,n)},[e,t,n,r])}function Q0t(e){const{children:t,theme:n,themeId:r}=e,i=RIe(E0e),o=BIe()||E0e,s=C0e(r,i,n),a=C0e(r,o,n,!0),l=s.direction==="rtl";return b.jsx(L0t,{theme:a,children:b.jsx(yR.Provider,{value:s,children:b.jsx(z0t,{value:l,children:t})})})}function B0t(e,t){return oe({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}var ho={},WIe={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(WIe);var qIe=WIe.exports;const W0t=cu(omt),q0t=cu(T0t);var VIe=qIe;Object.defineProperty(ho,"__esModule",{value:!0});var _0e=ho.alpha=ZIe;ho.blend=rvt;ho.colorChannel=void 0;var V0t=ho.darken=wie;ho.decomposeColor=cf;ho.emphasize=nvt;var U0t=ho.getContrastRatio=K0t;ho.getLuminance=Aj;ho.hexToRgb=UIe;ho.hslToRgb=XIe;var H0t=ho.lighten=Sie;ho.private_safeAlpha=J0t;ho.private_safeColorChannel=void 0;ho.private_safeDarken=evt;ho.private_safeEmphasize=YIe;ho.private_safeLighten=tvt;ho.recomposeColor=zC;ho.rgbToHex=G0t;var k0e=VIe(W0t),X0t=VIe(q0t);function xie(e,t=0,n=1){return(0,X0t.default)(e,t,n)}function UIe(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Z0t(e){const t=e.toString(16);return t.length===1?`0${t}`:t}function cf(e){if(e.type)return e;if(e.charAt(0)==="#")return cf(UIe(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,k0e.default)(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error((0,k0e.default)(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const HIe=e=>{const t=cf(e);return t.values.slice(0,3).map((n,r)=>t.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};ho.colorChannel=HIe;const Y0t=(e,t)=>{try{return HIe(e)}catch{return e}};ho.private_safeColorChannel=Y0t;function zC(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):t.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function G0t(e){if(e.indexOf("#")===0)return e;const{values:t}=cf(e);return`#${t.map((n,r)=>Z0t(r===3?Math.round(255*n):n)).join("")}`}function XIe(e){e=cf(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),s=(c,u=(c+n/30)%12)=>i-o*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),zC({type:a,values:l})}function Aj(e){e=cf(e);let t=e.type==="hsl"||e.type==="hsla"?cf(XIe(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function K0t(e,t){const n=Aj(e),r=Aj(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ZIe(e,t){return e=cf(e),t=xie(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,zC(e)}function J0t(e,t,n){try{return ZIe(e,t)}catch{return e}}function wie(e,t){if(e=cf(e),t=xie(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]*=1-t;return zC(e)}function evt(e,t,n){try{return wie(e,t)}catch{return e}}function Sie(e,t){if(e=cf(e),t=xie(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return zC(e)}function tvt(e,t,n){try{return Sie(e,t)}catch{return e}}function nvt(e,t=.15){return Aj(e)>.5?wie(e,t):Sie(e,t)}function YIe(e,t,n){try{return YIe(e,t)}catch{return e}}function rvt(e,t,n,r=1){const i=(l,c)=>Math.round((l**(1/r)*(1-n)+c**(1/r)*n)**r),o=cf(e),s=cf(t),a=[i(o.values[0],s.values[0]),i(o.values[1],s.values[1]),i(o.values[2],s.values[2])];return zC({type:"rgb",values:a})}const ivt=["mode","contrastThreshold","tonalOffset"],$0e={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:G2.white,default:G2.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},IW={text:{primary:G2.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:G2.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function T0e(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=H0t(e.main,i):t==="dark"&&(e.dark=V0t(e.main,o)))}function ovt(e="light"){return e==="dark"?{main:$x[200],light:$x[50],dark:$x[400]}:{main:$x[700],light:$x[400],dark:$x[800]}}function svt(e="light"){return e==="dark"?{main:kx[200],light:kx[50],dark:kx[400]}:{main:kx[500],light:kx[300],dark:kx[700]}}function avt(e="light"){return e==="dark"?{main:_x[500],light:_x[300],dark:_x[700]}:{main:_x[700],light:_x[400],dark:_x[800]}}function lvt(e="light"){return e==="dark"?{main:Tx[400],light:Tx[300],dark:Tx[700]}:{main:Tx[700],light:Tx[500],dark:Tx[900]}}function cvt(e="light"){return e==="dark"?{main:Px[400],light:Px[300],dark:Px[700]}:{main:Px[800],light:Px[500],dark:Px[900]}}function uvt(e="light"){return e==="dark"?{main:ak[400],light:ak[300],dark:ak[700]}:{main:"#ed6c02",light:ak[500],dark:ak[900]}}function fvt(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2}=e,i=$o(e,ivt),o=e.primary||ovt(t),s=e.secondary||svt(t),a=e.error||avt(t),l=e.info||lvt(t),c=e.success||cvt(t),u=e.warning||uvt(t);function f(g){return U0t(g,IW.text.primary)>=n?IW.text.primary:$0e.text.primary}const d=({color:g,name:v,mainShade:y=500,lightShade:O=300,darkShade:m=700})=>{if(g=oe({},g),!g.main&&g[y]&&(g.main=g[y]),!g.hasOwnProperty("main"))throw new Error(sE(11,v?` (${v})`:"",y));if(typeof g.main!="string")throw new Error(sE(12,v?` (${v})`:"",JSON.stringify(g.main)));return T0e(g,"light",O,r),T0e(g,"dark",m,r),g.contrastText||(g.contrastText=f(g.main)),g},h={dark:IW,light:$0e};return jh(oe({common:oe({},G2),mode:t,primary:d({color:o,name:"primary"}),secondary:d({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:a,name:"error"}),warning:d({color:u,name:"warning"}),info:d({color:l,name:"info"}),success:d({color:c,name:"success"}),grey:imt,contrastThreshold:n,getContrastText:f,augmentColor:d,tonalOffset:r},h[t]),i)}const dvt=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function hvt(e){return Math.round(e*1e5)/1e5}const P0e={textTransform:"uppercase"},A0e='"Roboto", "Helvetica", "Arial", sans-serif';function pvt(e,t){const n=typeof t=="function"?t(e):t,{fontFamily:r=A0e,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:f}=n,d=$o(n,dvt),h=i/14,p=f||(y=>`${y/c*h}rem`),g=(y,O,m,w,S)=>oe({fontFamily:r,fontWeight:y,fontSize:p(O),lineHeight:m},r===A0e?{letterSpacing:`${hvt(w/O)}em`}:{},S,u),v={h1:g(o,96,1.167,-1.5),h2:g(o,60,1.2,-.5),h3:g(s,48,1.167,0),h4:g(s,34,1.235,.25),h5:g(s,24,1.334,0),h6:g(a,20,1.6,.15),subtitle1:g(s,16,1.75,.15),subtitle2:g(a,14,1.57,.1),body1:g(s,16,1.5,.15),body2:g(s,14,1.43,.15),button:g(a,14,1.75,.4,P0e),caption:g(s,12,1.66,.4),overline:g(s,12,2.66,1,P0e),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return jh(oe({htmlFontSize:c,pxToRem:p,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},v),d,{clone:!1})}const gvt=.2,mvt=.14,yvt=.12;function gi(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${gvt})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${mvt})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${yvt})`].join(",")}const vvt=["none",gi(0,2,1,-1,0,1,1,0,0,1,3,0),gi(0,3,1,-2,0,2,2,0,0,1,5,0),gi(0,3,3,-2,0,3,4,0,0,1,8,0),gi(0,2,4,-1,0,4,5,0,0,1,10,0),gi(0,3,5,-1,0,5,8,0,0,1,14,0),gi(0,3,5,-1,0,6,10,0,0,1,18,0),gi(0,4,5,-2,0,7,10,1,0,2,16,1),gi(0,5,5,-3,0,8,10,1,0,3,14,2),gi(0,5,6,-3,0,9,12,1,0,3,16,2),gi(0,6,6,-3,0,10,14,1,0,4,18,3),gi(0,6,7,-4,0,11,15,1,0,4,20,3),gi(0,7,8,-4,0,12,17,2,0,5,22,4),gi(0,7,8,-4,0,13,19,2,0,5,24,4),gi(0,7,9,-4,0,14,21,2,0,5,26,4),gi(0,8,9,-5,0,15,22,2,0,6,28,5),gi(0,8,10,-5,0,16,24,2,0,6,30,5),gi(0,8,11,-5,0,17,26,2,0,6,32,5),gi(0,9,11,-5,0,18,28,2,0,7,34,6),gi(0,9,12,-6,0,19,29,2,0,7,36,6),gi(0,10,13,-6,0,20,31,3,0,8,38,7),gi(0,10,13,-6,0,21,33,3,0,8,40,7),gi(0,10,14,-6,0,22,35,3,0,8,42,7),gi(0,11,14,-7,0,23,36,3,0,9,44,8),gi(0,11,15,-7,0,24,38,3,0,9,46,8)],bvt=["duration","easing","delay"],Ovt={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},xvt={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function R0e(e){return`${Math.round(e)}ms`}function wvt(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function Svt(e){const t=oe({},Ovt,e.easing),n=oe({},xvt,e.duration);return oe({getAutoHeightDuration:wvt,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=t.easeInOut,delay:l=0}=o;return $o(o,bvt),(Array.isArray(i)?i:[i]).map(c=>`${c} ${typeof s=="string"?s:R0e(s)} ${a} ${typeof l=="string"?l:R0e(l)}`).join(",")}},e,{easing:t,duration:n})}const Evt={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},Cvt=Evt,_vt=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function Eie(e={},...t){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=e,s=$o(e,_vt);if(e.vars)throw new Error(sE(18));const a=fvt(r),l=mie(e);let c=jh(l,{mixins:B0t(l.breakpoints,n),palette:a,shadows:vvt.slice(),typography:pvt(a,o),transitions:Svt(i),zIndex:oe({},Cvt)});return c=jh(c,s),c=t.reduce((u,f)=>jh(u,f),c),c.unstable_sxConfig=oe({},OR,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(f){return xR({sx:f,theme:this})},c}const kvt=Eie(),Cie=kvt;function _ie({props:e,name:t}){return k0t({props:e,name:t,defaultTheme:Cie,themeId:aE})}var wR={},LW={exports:{}},D0e;function $vt(){return D0e||(D0e=1,function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(LW)),LW.exports}var jW={exports:{}},M0e;function Tvt(){return M0e||(M0e=1,function(e){function t(n,r){if(n==null)return{};var i={},o=Object.keys(n),s,a;for(a=0;a<o.length;a++)s=o[a],!(r.indexOf(s)>=0)&&(i[s]=n[s]);return i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(jW)),jW.exports}const Pvt=cu(hyt),Avt=cu(pyt),Rvt=cu(xyt),Dvt=cu(C0t),Mvt=cu(c0t),Nvt=cu(g0t);var QC=qIe;Object.defineProperty(wR,"__esModule",{value:!0});var Ivt=wR.default=Zvt;wR.shouldForwardProp=C5;wR.systemDefaultTheme=void 0;var wu=QC($vt()),LZ=QC(Tvt()),N0e=Wvt(Pvt),Lvt=Avt;QC(Rvt);QC(Dvt);var jvt=QC(Mvt),Fvt=QC(Nvt);const zvt=["ownerState"],Qvt=["variants"],Bvt=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function GIe(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(GIe=function(r){return r?n:t})(e)}function Wvt(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=GIe(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function qvt(e){return Object.keys(e).length===0}function Vvt(e){return typeof e=="string"&&e.charCodeAt(0)>96}function C5(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Uvt=wR.systemDefaultTheme=(0,jvt.default)(),Hvt=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function IM({defaultTheme:e,theme:t,themeId:n}){return qvt(t)?e:t[n]||t}function Xvt(e){return e?(t,n)=>n[e]:null}function _5(e,t){let{ownerState:n}=t,r=(0,LZ.default)(t,zvt);const i=typeof e=="function"?e((0,wu.default)({ownerState:n},r)):e;if(Array.isArray(i))return i.flatMap(o=>_5(o,(0,wu.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let a=(0,LZ.default)(i,Qvt);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props((0,wu.default)({ownerState:n},r,n)):Object.keys(l.props).forEach(u=>{(n==null?void 0:n[u])!==l.props[u]&&r[u]!==l.props[u]&&(c=!1)}),c&&(Array.isArray(a)||(a=[a]),a.push(typeof l.style=="function"?l.style((0,wu.default)({ownerState:n},r,n)):l.style))}),a}return i}function Zvt(e={}){const{themeId:t,defaultTheme:n=Uvt,rootShouldForwardProp:r=C5,slotShouldForwardProp:i=C5}=e,o=s=>(0,Fvt.default)((0,wu.default)({},s,{theme:IM((0,wu.default)({},s,{defaultTheme:n,themeId:t}))}));return o.__mui_systemSx=!0,(s,a={})=>{(0,N0e.internal_processStyles)(s,S=>S.filter(E=>!(E!=null&&E.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:d=Xvt(Hvt(c))}=a,h=(0,LZ.default)(a,Bvt),p=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,g=f||!1;let v,y=C5;c==="Root"||c==="root"?y=r:c?y=i:Vvt(s)&&(y=void 0);const O=(0,N0e.default)(s,(0,wu.default)({shouldForwardProp:y,label:v},h)),m=S=>typeof S=="function"&&S.__emotion_real!==S||(0,Lvt.isPlainObject)(S)?E=>_5(S,(0,wu.default)({},E,{theme:IM({theme:E.theme,defaultTheme:n,themeId:t})})):S,w=(S,...E)=>{let C=m(S);const k=E?E.map(m):[];l&&d&&k.push(M=>{const L=IM((0,wu.default)({},M,{defaultTheme:n,themeId:t}));if(!L.components||!L.components[l]||!L.components[l].styleOverrides)return null;const A=L.components[l].styleOverrides,T={};return Object.entries(A).forEach(([N,j])=>{T[N]=_5(j,(0,wu.default)({},M,{theme:L}))}),d(M,T)}),l&&!p&&k.push(M=>{var L;const A=IM((0,wu.default)({},M,{defaultTheme:n,themeId:t})),T=A==null||(L=A.components)==null||(L=L[l])==null?void 0:L.variants;return _5({variants:T},(0,wu.default)({},M,{theme:A}))}),g||k.push(o);const P=k.length-E.length;if(Array.isArray(S)&&P>0){const M=new Array(P).fill("");C=[...S,...M],C.raw=[...S.raw,...M]}const D=O(C,...k);return s.muiName&&(D.muiName=s.muiName),D};return O.withConfig&&(w.withConfig=O.withConfig),w}}function Yvt(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Gvt=e=>Yvt(e)&&e!=="classes",Kvt=Gvt,j6=Ivt({themeId:aE,defaultTheme:Cie,rootShouldForwardProp:Kvt}),Jvt=["theme"];function e1t(e){let{theme:t}=e,n=$o(e,Jvt);const r=t[aE];return b.jsx(Q0t,oe({},n,{themeId:r?aE:void 0,theme:r||t}))}const I0e=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)};function t1t(e){return _6("MuiSvgIcon",e)}k6("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const n1t=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],r1t=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Gh(t)}`,`fontSize${Gh(n)}`]};return Oie(i,t1t,r)},i1t=j6("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Gh(n.color)}`],t[`fontSize${Gh(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,i,o,s,a,l,c,u,f,d,h,p;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=e.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(i=e.transitions)==null||(i=i.duration)==null?void 0:i.shorter}),fontSize:{inherit:"inherit",small:((o=e.typography)==null||(s=o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem",medium:((a=e.typography)==null||(l=a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem",large:((c=e.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}[t.fontSize],color:(f=(d=(e.vars||e).palette)==null||(d=d[t.color])==null?void 0:d.main)!=null?f:{action:(h=(e.vars||e).palette)==null||(h=h.action)==null?void 0:h.active,disabled:(p=(e.vars||e).palette)==null||(p=p.action)==null?void 0:p.disabled,inherit:void 0}[t.color]}}),KIe=x.forwardRef(function(t,n){const r=_ie({props:t,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:d="0 0 24 24"}=r,h=$o(r,n1t),p=x.isValidElement(i)&&i.type==="svg",g=oe({},r,{color:s,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:d,hasSvgAsChild:p}),v={};u||(v.viewBox=d);const y=r1t(g);return b.jsxs(i1t,oe({as:a,className:bd(y.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n},v,h,p&&i.props,{ownerState:g,children:[p?i.props.children:i,f?b.jsx("title",{children:f}):null]}))});KIe.muiName="SvgIcon";const o1t=KIe;function jZ(e,t){return jZ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},jZ(e,t)}function s1t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,jZ(e,t)}function L0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a1t(e){return _6("MuiPaper",e)}k6("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const l1t=["className","component","elevation","square","variant"],c1t=e=>{const{square:t,elevation:n,variant:r,classes:i}=e,o={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Oie(o,a1t,i)},u1t=j6("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return oe({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&oe({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${_0e("#fff",I0e(t.elevation))}, ${_0e("#fff",I0e(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),f1t=x.forwardRef(function(t,n){const r=_ie({props:t,name:"MuiPaper"}),{className:i,component:o="div",elevation:s=1,square:a=!1,variant:l="elevation"}=r,c=$o(r,l1t),u=oe({},r,{component:o,elevation:s,square:a,variant:l}),f=c1t(u);return b.jsx(u1t,oe({as:o,ownerState:u,className:bd(f.root,i),ref:n},c))}),d1t=f1t;function j0e(e){return typeof e=="string"}const h1t=["top","right","bottom","left"],k0=Math.min,Dc=Math.max,Rj=Math.round,LM=Math.floor,$0=e=>({x:e,y:e}),p1t={left:"right",right:"left",bottom:"top",top:"bottom"},g1t={start:"end",end:"start"};function FZ(e,t,n){return Dc(e,k0(t,n))}function Vg(e,t){return typeof e=="function"?e(t):e}function Ug(e){return e.split("-")[0]}function BC(e){return e.split("-")[1]}function kie(e){return e==="x"?"y":"x"}function $ie(e){return e==="y"?"height":"width"}function WC(e){return["top","bottom"].includes(Ug(e))?"y":"x"}function Tie(e){return kie(WC(e))}function m1t(e,t,n){n===void 0&&(n=!1);const r=BC(e),i=Tie(e),o=$ie(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Dj(s)),[s,Dj(s)]}function y1t(e){const t=Dj(e);return[zZ(e),t,zZ(t)]}function zZ(e){return e.replace(/start|end/g,t=>g1t[t])}function v1t(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function b1t(e,t,n,r){const i=BC(e);let o=v1t(Ug(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(zZ)))),o}function Dj(e){return e.replace(/left|right|bottom|top/g,t=>p1t[t])}function O1t(e){return{top:0,right:0,bottom:0,left:0,...e}}function JIe(e){return typeof e!="number"?O1t(e):{top:e,right:e,bottom:e,left:e}}function Mj(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function F0e(e,t,n){let{reference:r,floating:i}=e;const o=WC(t),s=Tie(t),a=$ie(s),l=Ug(t),c=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(BC(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const x1t=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:f}=F0e(c,r,l),d=r,h={},p=0;for(let g=0;g<a.length;g++){const{name:v,fn:y}=a[g],{x:O,y:m,data:w,reset:S}=await y({x:u,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=O??u,f=m??f,h={...h,[v]:{...h[v],...w}},S&&p<=50&&(p++,typeof S=="object"&&(S.placement&&(d=S.placement),S.rects&&(c=S.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):S.rects),{x:u,y:f}=F0e(c,d,l)),g=-1)}return{x:u,y:f,placement:d,strategy:i,middlewareData:h}};async function tP(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Vg(t,e),p=JIe(h),v=a[d?f==="floating"?"reference":"floating":f],y=Mj(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),O=f==="floating"?{...s.floating,x:r,y:i}:s.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),w=await(o.isElement==null?void 0:o.isElement(m))?await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1}:{x:1,y:1},S=Mj(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:O,offsetParent:m,strategy:l}):O);return{top:(y.top-S.top+p.top)/w.y,bottom:(S.bottom-y.bottom+p.bottom)/w.y,left:(y.left-S.left+p.left)/w.x,right:(S.right-y.right+p.right)/w.x}}const w1t=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Vg(e,t)||{};if(c==null)return{};const f=JIe(u),d={x:n,y:r},h=Tie(i),p=$ie(h),g=await s.getDimensions(c),v=h==="y",y=v?"top":"left",O=v?"bottom":"right",m=v?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[h]-d[h]-o.floating[p],S=d[h]-o.reference[h],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let C=E?E[m]:0;(!C||!await(s.isElement==null?void 0:s.isElement(E)))&&(C=a.floating[m]||o.floating[p]);const k=w/2-S/2,P=C/2-g[p]/2-1,D=k0(f[y],P),M=k0(f[O],P),L=D,A=C-g[p]-M,T=C/2-g[p]/2+k,N=FZ(L,T,A),j=!l.arrow&&BC(i)!=null&&T!==N&&o.reference[p]/2-(T<L?D:M)-g[p]/2<0,z=j?T<L?T-L:T-A:0;return{[h]:d[h]+z,data:{[h]:N,centerOffset:T-N-z,...j&&{alignmentOffset:z}},reset:j}}}),S1t=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...v}=Vg(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const y=Ug(i),O=Ug(a)===a,m=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=d||(O||!g?[Dj(a)]:y1t(a));!d&&p!=="none"&&w.push(...b1t(a,g,p,m));const S=[a,...w],E=await tP(t,v),C=[];let k=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&C.push(E[y]),f){const L=m1t(i,s,m);C.push(E[L[0]],E[L[1]])}if(k=[...k,{placement:i,overflows:C}],!C.every(L=>L<=0)){var P,D;const L=(((P=o.flip)==null?void 0:P.index)||0)+1,A=S[L];if(A)return{data:{index:L,overflows:k},reset:{placement:A}};let T=(D=k.filter(N=>N.overflows[0]<=0).sort((N,j)=>N.overflows[1]-j.overflows[1])[0])==null?void 0:D.placement;if(!T)switch(h){case"bestFit":{var M;const N=(M=k.map(j=>[j.placement,j.overflows.filter(z=>z>0).reduce((z,W)=>z+W,0)]).sort((j,z)=>j[1]-z[1])[0])==null?void 0:M[0];N&&(T=N);break}case"initialPlacement":T=a;break}if(i!==T)return{reset:{placement:T}}}return{}}}};function z0e(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Q0e(e){return h1t.some(t=>e[t]>=0)}const E1t=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Vg(e,t);switch(r){case"referenceHidden":{const o=await tP(t,{...i,elementContext:"reference"}),s=z0e(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Q0e(s)}}}case"escaped":{const o=await tP(t,{...i,altBoundary:!0}),s=z0e(o,n.floating);return{data:{escapedOffsets:s,escaped:Q0e(s)}}}default:return{}}}}};async function C1t(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Ug(n),a=BC(n),l=WC(n)==="y",c=["left","top"].includes(s)?-1:1,u=o&&l?-1:1,f=Vg(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const _1t=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await C1t(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},k1t=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:v=>{let{x:y,y:O}=v;return{x:y,y:O}}},...l}=Vg(e,t),c={x:n,y:r},u=await tP(t,l),f=WC(Ug(i)),d=kie(f);let h=c[d],p=c[f];if(o){const v=d==="y"?"top":"left",y=d==="y"?"bottom":"right",O=h+u[v],m=h-u[y];h=FZ(O,h,m)}if(s){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",O=p+u[v],m=p-u[y];p=FZ(O,p,m)}const g=a.fn({...t,[d]:h,[f]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},$1t=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Vg(e,t),u={x:n,y:r},f=WC(i),d=kie(f);let h=u[d],p=u[f];const g=Vg(a,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const m=d==="y"?"height":"width",w=o.reference[d]-o.floating[m]+v.mainAxis,S=o.reference[d]+o.reference[m]-v.mainAxis;h<w?h=w:h>S&&(h=S)}if(c){var y,O;const m=d==="y"?"width":"height",w=["top","left"].includes(Ug(i)),S=o.reference[f]-o.floating[m]+(w&&((y=s.offset)==null?void 0:y[f])||0)+(w?0:v.crossAxis),E=o.reference[f]+o.reference[m]+(w?0:((O=s.offset)==null?void 0:O[f])||0)-(w?v.crossAxis:0);p<S?p=S:p>E&&(p=E)}return{[d]:h,[f]:p}}}},T1t=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:s=()=>{},...a}=Vg(e,t),l=await tP(t,a),c=Ug(n),u=BC(n),f=WC(n)==="y",{width:d,height:h}=r.floating;let p,g;c==="top"||c==="bottom"?(p=c,g=u===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,p=u==="end"?"top":"bottom");const v=h-l[p],y=d-l[g],O=!t.middlewareData.shift;let m=v,w=y;if(f){const E=d-l.left-l.right;w=u||O?k0(y,E):E}else{const E=h-l.top-l.bottom;m=u||O?k0(v,E):E}if(O&&!u){const E=Dc(l.left,0),C=Dc(l.right,0),k=Dc(l.top,0),P=Dc(l.bottom,0);f?w=d-2*(E!==0||C!==0?E+C:Dc(l.left,l.right)):m=h-2*(k!==0||P!==0?k+P:Dc(l.top,l.bottom))}await s({...t,availableWidth:w,availableHeight:m});const S=await i.getDimensions(o.floating);return d!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}};function T0(e){return e5e(e)?(e.nodeName||"").toLowerCase():"#document"}function Zc(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function cm(e){var t;return(t=(e5e(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function e5e(e){return e instanceof Node||e instanceof Zc(e).Node}function Hg(e){return e instanceof Element||e instanceof Zc(e).Element}function Kh(e){return e instanceof HTMLElement||e instanceof Zc(e).HTMLElement}function B0e(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zc(e).ShadowRoot}function SR(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=uf(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function P1t(e){return["table","td","th"].includes(T0(e))}function Pie(e){const t=Aie(),n=uf(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function A1t(e){let t=cE(e);for(;Kh(t)&&!F6(t);){if(Pie(t))return t;t=cE(t)}return null}function Aie(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function F6(e){return["html","body","#document"].includes(T0(e))}function uf(e){return Zc(e).getComputedStyle(e)}function z6(e){return Hg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function cE(e){if(T0(e)==="html")return e;const t=e.assignedSlot||e.parentNode||B0e(e)&&e.host||cm(e);return B0e(t)?t.host:t}function t5e(e){const t=cE(e);return F6(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kh(t)&&SR(t)?t:t5e(t)}function nP(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=t5e(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Zc(i);return o?t.concat(s,s.visualViewport||[],SR(i)?i:[],s.frameElement&&n?nP(s.frameElement):[]):t.concat(i,nP(i,[],n))}function n5e(e){const t=uf(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Kh(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=Rj(n)!==o||Rj(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Rie(e){return Hg(e)?e:e.contextElement}function yS(e){const t=Rie(e);if(!Kh(t))return $0(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=n5e(t);let s=(o?Rj(n.width):n.width)/r,a=(o?Rj(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const R1t=$0(0);function r5e(e){const t=Zc(e);return!Aie()||!t.visualViewport?R1t:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function D1t(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zc(e)?!1:t}function Db(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Rie(e);let s=$0(1);t&&(r?Hg(r)&&(s=yS(r)):s=yS(e));const a=D1t(o,n,r)?r5e(o):$0(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const d=Zc(o),h=r&&Hg(r)?Zc(r):r;let p=d,g=p.frameElement;for(;g&&r&&h!==p;){const v=yS(g),y=g.getBoundingClientRect(),O=uf(g),m=y.left+(g.clientLeft+parseFloat(O.paddingLeft))*v.x,w=y.top+(g.clientTop+parseFloat(O.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,f*=v.y,l+=m,c+=w,p=Zc(g),g=p.frameElement}}return Mj({width:u,height:f,x:l,y:c})}const M1t=[":popover-open",":modal"];function i5e(e){return M1t.some(t=>{try{return e.matches(t)}catch{return!1}})}function N1t(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=cm(r),a=t?i5e(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=$0(1);const u=$0(0),f=Kh(r);if((f||!f&&!o)&&((T0(r)!=="body"||SR(s))&&(l=z6(r)),Kh(r))){const d=Db(r);c=yS(r),u.x=d.x+r.clientLeft,u.y=d.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function I1t(e){return Array.from(e.getClientRects())}function o5e(e){return Db(cm(e)).left+z6(e).scrollLeft}function L1t(e){const t=cm(e),n=z6(e),r=e.ownerDocument.body,i=Dc(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Dc(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+o5e(e);const a=-n.scrollTop;return uf(r).direction==="rtl"&&(s+=Dc(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function j1t(e,t){const n=Zc(e),r=cm(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=Aie();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function F1t(e,t){const n=Db(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Kh(e)?yS(e):$0(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function W0e(e,t,n){let r;if(t==="viewport")r=j1t(e,n);else if(t==="document")r=L1t(cm(e));else if(Hg(t))r=F1t(t,n);else{const i=r5e(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Mj(r)}function s5e(e,t){const n=cE(e);return n===t||!Hg(n)||F6(n)?!1:uf(n).position==="fixed"||s5e(n,t)}function z1t(e,t){const n=t.get(e);if(n)return n;let r=nP(e,[],!1).filter(a=>Hg(a)&&T0(a)!=="body"),i=null;const o=uf(e).position==="fixed";let s=o?cE(e):e;for(;Hg(s)&&!F6(s);){const a=uf(s),l=Pie(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||SR(s)&&!l&&s5e(e,s))?r=r.filter(u=>u!==s):i=a,s=cE(s)}return t.set(e,r),r}function Q1t(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?z1t(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=W0e(t,u,i);return c.top=Dc(f.top,c.top),c.right=k0(f.right,c.right),c.bottom=k0(f.bottom,c.bottom),c.left=Dc(f.left,c.left),c},W0e(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function B1t(e){const{width:t,height:n}=n5e(e);return{width:t,height:n}}function W1t(e,t,n){const r=Kh(t),i=cm(t),o=n==="fixed",s=Db(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=$0(0);if(r||!r&&!o)if((T0(t)!=="body"||SR(i))&&(a=z6(t)),r){const f=Db(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=o5e(i));const c=s.left+a.scrollLeft-l.x,u=s.top+a.scrollTop-l.y;return{x:c,y:u,width:s.width,height:s.height}}function q0e(e,t){return!Kh(e)||uf(e).position==="fixed"?null:t?t(e):e.offsetParent}function a5e(e,t){const n=Zc(e);if(!Kh(e)||i5e(e))return n;let r=q0e(e,t);for(;r&&P1t(r)&&uf(r).position==="static";)r=q0e(r,t);return r&&(T0(r)==="html"||T0(r)==="body"&&uf(r).position==="static"&&!Pie(r))?n:r||A1t(e)||n}const q1t=async function(e){const t=this.getOffsetParent||a5e,n=this.getDimensions;return{reference:W1t(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function V1t(e){return uf(e).direction==="rtl"}const U1t={convertOffsetParentRelativeRectToViewportRelativeRect:N1t,getDocumentElement:cm,getClippingRect:Q1t,getOffsetParent:a5e,getElementRects:q1t,getClientRects:I1t,getDimensions:B1t,getScale:yS,isElement:Hg,isRTL:V1t};function H1t(e,t){let n=null,r;const i=cm(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(a||t(),!f||!d)return;const h=LM(u),p=LM(i.clientWidth-(c+f)),g=LM(i.clientHeight-(u+d)),v=LM(c),O={rootMargin:-h+"px "+-p+"px "+-g+"px "+-v+"px",threshold:Dc(0,k0(1,l))||1};let m=!0;function w(S){const E=S[0].intersectionRatio;if(E!==l){if(!m)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},100)}m=!1}try{n=new IntersectionObserver(w,{...O,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,O)}n.observe(e)}return s(!0),o}function X1t(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Rie(e),u=i||o?[...c?nP(c):[],...nP(t)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),o&&y.addEventListener("resize",n)});const f=c&&a?H1t(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(y=>{let[O]=y;O&&O.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var m;(m=h)==null||m.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let p,g=l?Db(e):null;l&&v();function v(){const y=Db(e);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&n(),g=y,p=requestAnimationFrame(v)}return n(),()=>{var y;u.forEach(O=>{i&&O.removeEventListener("scroll",n),o&&O.removeEventListener("resize",n)}),f==null||f(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const Z1t=k1t,Y1t=S1t,G1t=T1t,K1t=E1t,V0e=w1t,J1t=$1t,ebt=(e,t,n)=>{const r=new Map,i={platform:U1t,...n},o={...i.platform,_c:r};return x1t(e,t,{...i,platform:o})},tbt=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?V0e({element:r.current,padding:i}).fn(n):{}:r?V0e({element:r,padding:i}).fn(n):{}}}};var k5=typeof document<"u"?x.useLayoutEffect:x.useEffect;function Nj(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Nj(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Nj(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function l5e(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function U0e(e,t){const n=l5e(e);return Math.round(t*n)/n}function H0e(e){const t=x.useRef(e);return k5(()=>{t.current=e}),t}function nbt(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=x.useState(r);Nj(d,r)||h(r);const[p,g]=x.useState(null),[v,y]=x.useState(null),O=x.useCallback(z=>{z!==E.current&&(E.current=z,g(z))},[]),m=x.useCallback(z=>{z!==C.current&&(C.current=z,y(z))},[]),w=o||p,S=s||v,E=x.useRef(null),C=x.useRef(null),k=x.useRef(u),P=l!=null,D=H0e(l),M=H0e(i),L=x.useCallback(()=>{if(!E.current||!C.current)return;const z={placement:t,strategy:n,middleware:d};M.current&&(z.platform=M.current),ebt(E.current,C.current,z).then(W=>{const F={...W,isPositioned:!0};A.current&&!Nj(k.current,F)&&(k.current=F,as.flushSync(()=>{f(F)}))})},[d,t,n,M]);k5(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(z=>({...z,isPositioned:!1})))},[c]);const A=x.useRef(!1);k5(()=>(A.current=!0,()=>{A.current=!1}),[]),k5(()=>{if(w&&(E.current=w),S&&(C.current=S),w&&S){if(D.current)return D.current(w,S,L);L()}},[w,S,L,D,P]);const T=x.useMemo(()=>({reference:E,floating:C,setReference:O,setFloating:m}),[O,m]),N=x.useMemo(()=>({reference:w,floating:S}),[w,S]),j=x.useMemo(()=>{const z={position:n,left:0,top:0};if(!N.floating)return z;const W=U0e(N.floating,u.x),F=U0e(N.floating,u.y);return a?{...z,transform:"translate("+W+"px, "+F+"px)",...l5e(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:F}},[n,a,N.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:L,refs:T,elements:N,floatingStyles:j}),[u,L,T,N,j])}function Die(e){const{children:t,defer:n=!1,fallback:r=null}=e,[i,o]=x.useState(!1);return Pj(()=>{n||o(!0)},[n]),x.useEffect(()=>{n&&o(!0)},[n]),b.jsx(x.Fragment,{children:i?t:r})}const rbt=["onChange","maxRows","minRows","style","value"];function jM(e){return parseInt(e,10)||0}const ibt={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function obt(e){return e==null||Object.keys(e).length===0||e.outerHeightStyle===0&&!e.overflowing}const sbt=x.forwardRef(function(t,n){const{onChange:r,maxRows:i,minRows:o=1,style:s,value:a}=t,l=$o(t,rbt),{current:c}=x.useRef(a!=null),u=x.useRef(null),f=zIe(n,u),d=x.useRef(null),h=x.useCallback(()=>{const v=u.current,O=S0e(v).getComputedStyle(v);if(O.width==="0px")return{outerHeightStyle:0,overflowing:!1};const m=d.current;m.style.width=O.width,m.value=v.value||t.placeholder||"x",m.value.slice(-1)===`
`&&(m.value+=" ");const w=O.boxSizing,S=jM(O.paddingBottom)+jM(O.paddingTop),E=jM(O.borderBottomWidth)+jM(O.borderTopWidth),C=m.scrollHeight;m.value="x";const k=m.scrollHeight;let P=C;o&&(P=Math.max(Number(o)*k,P)),i&&(P=Math.min(Number(i)*k,P)),P=Math.max(P,k);const D=P+(w==="border-box"?S+E:0),M=Math.abs(P-C)<=1;return{outerHeightStyle:D,overflowing:M}},[i,o,t.placeholder]),p=x.useCallback(()=>{const v=h();if(obt(v))return;const y=u.current;y.style.height=`${v.outerHeightStyle}px`,y.style.overflow=v.overflowing?"hidden":""},[h]);Pj(()=>{const v=()=>{p()};let y;const O=P0t(v),m=u.current,w=S0e(m);w.addEventListener("resize",O);let S;return typeof ResizeObserver<"u"&&(S=new ResizeObserver(v),S.observe(m)),()=>{O.clear(),cancelAnimationFrame(y),w.removeEventListener("resize",O),S&&S.disconnect()}},[h,p]),Pj(()=>{p()});const g=v=>{c||p(),r&&r(v)};return b.jsxs(x.Fragment,{children:[b.jsx("textarea",oe({value:a,onChange:g,ref:f,rows:o,style:s},l)),b.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:d,tabIndex:-1,style:oe({},ibt.shadow,s,{paddingTop:0,paddingBottom:0})})]})});function abt({props:e,states:t,muiFormControl:n}){return t.reduce((r,i)=>(r[i]=e[i],n&&typeof e[i]>"u"&&(r[i]=n[i]),r),{})}const lbt=x.createContext(void 0),c5e=lbt;function cbt(){return x.useContext(c5e)}function ubt(e){return b.jsx(d0t,oe({},e,{defaultTheme:Cie,themeId:aE}))}function X0e(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function fbt(e,t=!1){return e&&(X0e(e.value)&&e.value!==""||t&&X0e(e.defaultValue)&&e.defaultValue!=="")}function dbt(e){return _6("MuiInputBase",e)}const hbt=k6("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),QZ=hbt,pbt=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],gbt=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${Gh(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},mbt=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},ybt=e=>{const{classes:t,color:n,disabled:r,error:i,endAdornment:o,focused:s,formControl:a,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:d,startAdornment:h,type:p}=e,g={root:["root",`color${Gh(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",d&&d!=="medium"&&`size${Gh(d)}`,u&&"multiline",h&&"adornedStart",o&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",p==="search"&&"inputTypeSearch",u&&"inputMultiline",d==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",h&&"inputAdornedStart",o&&"inputAdornedEnd",f&&"readOnly"]};return Oie(g,dbt,t)},vbt=j6("div",{name:"MuiInputBase",slot:"Root",overridesResolver:gbt})(({theme:e,ownerState:t})=>oe({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${QZ.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},t.multiline&&oe({padding:"4px 0 5px"},t.size==="small"&&{paddingTop:1}),t.fullWidth&&{width:"100%"})),bbt=j6("input",{name:"MuiInputBase",slot:"Input",overridesResolver:mbt})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light",r=oe({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),i={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return oe({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${QZ.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${QZ.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},t.size==="small"&&{paddingTop:1},t.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},t.type==="search"&&{MozAppearance:"textfield"})}),Obt=b.jsx(ubt,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),xbt=x.forwardRef(function(t,n){var r;const i=_ie({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:s,autoFocus:a,className:l,components:c={},componentsProps:u={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:h,endAdornment:p,fullWidth:g=!1,id:v,inputComponent:y="input",inputProps:O={},inputRef:m,maxRows:w,minRows:S,multiline:E=!1,name:C,onBlur:k,onChange:P,onClick:D,onFocus:M,onKeyDown:L,onKeyUp:A,placeholder:T,readOnly:N,renderSuffix:j,rows:z,slotProps:W={},slots:F={},startAdornment:q,type:U="text",value:V}=i,H=$o(i,pbt),Z=O.value!=null?O.value:V,{current:ee}=x.useRef(Z!=null),se=x.useRef(),fe=x.useCallback(ht=>{},[]),ce=zIe(se,m,O.ref,fe),[ae,de]=x.useState(!1),me=cbt(),te=abt({props:i,muiFormControl:me,states:["color","disabled","error","hiddenLabel","size","required","filled"]});te.focused=me?me.focused:ae,x.useEffect(()=>{!me&&d&&ae&&(de(!1),k&&k())},[me,d,ae,k]);const Ee=me&&me.onFilled,we=me&&me.onEmpty,ke=x.useCallback(ht=>{fbt(ht)?Ee&&Ee():we&&we()},[Ee,we]);Pj(()=>{ee&&ke({value:Z})},[Z,ke,ee]);const je=ht=>{if(te.disabled){ht.stopPropagation();return}M&&M(ht),O.onFocus&&O.onFocus(ht),me&&me.onFocus?me.onFocus(ht):de(!0)},nt=ht=>{k&&k(ht),O.onBlur&&O.onBlur(ht),me&&me.onBlur?me.onBlur(ht):de(!1)},Re=(ht,..._t)=>{if(!ee){const yn=ht.target||se.current;if(yn==null)throw new Error(sE(1));ke({value:yn.value})}O.onChange&&O.onChange(ht,..._t),P&&P(ht,..._t)};x.useEffect(()=>{ke(se.current)},[]);const G=ht=>{se.current&&ht.currentTarget===ht.target&&se.current.focus(),D&&D(ht)};let le=y,Oe=O;E&&le==="input"&&(z?Oe=oe({type:void 0,minRows:z,maxRows:z},Oe):Oe=oe({type:void 0,maxRows:w,minRows:S},Oe),le=sbt);const Ue=ht=>{ke(ht.animationName==="mui-auto-fill-cancel"?se.current:{value:"x"})};x.useEffect(()=>{me&&me.setAdornedStart(!!q)},[me,q]);const Fe=oe({},i,{color:te.color||"primary",disabled:te.disabled,endAdornment:p,error:te.error,focused:te.focused,formControl:me,fullWidth:g,hiddenLabel:te.hiddenLabel,multiline:E,size:te.size,startAdornment:q,type:U}),ye=ybt(Fe),Me=F.root||c.Root||vbt,pt=W.root||u.root||{},at=F.input||c.Input||bbt;return Oe=oe({},Oe,(r=W.input)!=null?r:u.input),b.jsxs(x.Fragment,{children:[!h&&Obt,b.jsxs(Me,oe({},pt,!j0e(Me)&&{ownerState:oe({},Fe,pt.ownerState)},{ref:n,onClick:G},H,{className:bd(ye.root,pt.className,l,N&&"MuiInputBase-readOnly"),children:[q,b.jsx(c5e.Provider,{value:null,children:b.jsx(at,oe({ownerState:Fe,"aria-invalid":te.error,"aria-describedby":o,autoComplete:s,autoFocus:a,defaultValue:f,disabled:te.disabled,id:v,onAnimationStart:Ue,name:C,placeholder:T,readOnly:N,required:te.required,rows:z,value:Z,onKeyDown:L,onKeyUp:A,type:U},Oe,!j0e(at)&&{as:le,ownerState:oe({},Fe,Oe.ownerState)},{ref:ce,className:bd(ye.input,Oe.className,N&&"MuiInputBase-readOnly"),onBlur:nt,onChange:Re,onFocus:je}))}),p,j?j(oe({},te,{startAdornment:q})):null]}))]})}),wbt=xbt,Sbt=k6("MuiBox",["root"]),Ebt=Sbt,Cbt=Eie(),_bt=b0t({themeId:aE,defaultTheme:Cbt,defaultClassName:Ebt.root,generateClassName:MIe.generate}),ao=_bt;var kbt={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Z0e=e=>{let t;const n=new Set,r=(u,f)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const h=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(p=>p(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(kbt?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,i,l);return l},Mie=e=>e?Z0e(e):Z0e;var u5e={exports:{}},f5e={},d5e={exports:{}},h5e={};/**
 * @license React
 * use-sync-external-store-shim.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var uE=x;function $bt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tbt=typeof Object.is=="function"?Object.is:$bt,Pbt=uE.useState,Abt=uE.useEffect,Rbt=uE.useLayoutEffect,Dbt=uE.useDebugValue;function Mbt(e,t){var n=t(),r=Pbt({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return Rbt(function(){i.value=n,i.getSnapshot=t,FW(i)&&o({inst:i})},[e,n,t]),Abt(function(){return FW(i)&&o({inst:i}),e(function(){FW(i)&&o({inst:i})})},[e]),Dbt(n),n}function FW(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tbt(e,n)}catch{return!0}}function Nbt(e,t){return t()}var Ibt=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Nbt:Mbt;h5e.useSyncExternalStore=uE.useSyncExternalStore!==void 0?uE.useSyncExternalStore:Ibt;d5e.exports=h5e;var Nie=d5e.exports;/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Q6=x,Lbt=Nie;function jbt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fbt=typeof Object.is=="function"?Object.is:jbt,zbt=Lbt.useSyncExternalStore,Qbt=Q6.useRef,Bbt=Q6.useEffect,Wbt=Q6.useMemo,qbt=Q6.useDebugValue;f5e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Qbt(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Wbt(function(){function l(h){if(!c){if(c=!0,u=h,h=r(h),i!==void 0&&s.hasValue){var p=s.value;if(i(p,h))return f=p}return f=h}if(p=f,Fbt(u,h))return p;var g=r(h);return i!==void 0&&i(p,g)?p:(u=h,f=g)}var c=!1,u,f,d=n===void 0?null:n;return[function(){return l(t())},d===null?void 0:function(){return l(d())}]},[t,n,r,i]);var a=zbt(e,o[0],o[1]);return Bbt(function(){s.hasValue=!0,s.value=a},[a]),qbt(a),a};u5e.exports=f5e;var Vbt=u5e.exports;const p5e=wf(Vbt);var g5e={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:Ubt}=ie,{useSyncExternalStoreWithSelector:Hbt}=p5e;let Y0e=!1;const Xbt=e=>e;function Iie(e,t=Xbt,n){(g5e?"production":void 0)!=="production"&&n&&!Y0e&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Y0e=!0);const r=Hbt(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Ubt(r),r}const G0e=e=>{(g5e?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Mie(e):e,n=(r,i)=>Iie(t,r,i);return Object.assign(n,t),n},Zbt=e=>e?G0e(e):G0e;var Ybt=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(i){e.addRange(i)}),t&&t.focus()}},Gbt=Ybt,K0e={"text/plain":"Text","text/html":"Url",default:"Text"},Kbt="Copy to clipboard: #{key}, Enter";function Jbt(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function eOt(e,t){var n,r,i,o,s,a,l=!1;t||(t={}),n=t.debug||!1;try{i=Gbt(),o=document.createRange(),s=document.getSelection(),a=document.createElement("span"),a.textContent=e,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(u){if(u.stopPropagation(),t.format)if(u.preventDefault(),typeof u.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=K0e[t.format]||K0e.default;window.clipboardData.setData(f,e)}else u.clipboardData.clearData(),u.clipboardData.setData(t.format,e);t.onCopy&&(u.preventDefault(),t.onCopy(u.clipboardData))}),document.body.appendChild(a),o.selectNodeContents(a),s.addRange(o);var c=document.execCommand("copy");if(!c)throw new Error("copy command was unsuccessful");l=!0}catch(u){n&&console.error("unable to copy using execCommand: ",u),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(f){n&&console.error("unable to copy using clipboardData: ",f),n&&console.error("falling back to prompt"),r=Jbt("message"in t?t.message:Kbt),window.prompt(r,e)}}finally{s&&(typeof s.removeRange=="function"?s.removeRange(o):s.removeAllRanges()),a&&document.body.removeChild(a),i()}return l}var tOt=eOt;const nOt=wf(tOt);function m5e(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=m5e(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function rOt(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=m5e(e))&&(r&&(r+=" "),r+=t);return r}const Ij={scheme:"Light Theme",author:"mac gainor (https://github.com/mac-s-g)",base00:"rgba(0, 0, 0, 0)",base01:"rgb(245, 245, 245)",base02:"rgb(235, 235, 235)",base03:"#93a1a1",base04:"rgba(0, 0, 0, 0.3)",base05:"#586e75",base06:"#073642",base07:"#002b36",base08:"#d33682",base09:"#cb4b16",base0A:"#ffd500",base0B:"#859900",base0C:"#6c71c4",base0D:"#586e75",base0E:"#2aa198",base0F:"#268bd2"},BZ={scheme:"Dark Theme",author:"Chris Kempson (http://chriskempson.com)",base00:"#181818",base01:"#282828",base02:"#383838",base03:"#585858",base04:"#b8b8b8",base05:"#d8d8d8",base06:"#e8e8e8",base07:"#f8f8f8",base08:"#ab4642",base09:"#dc9656",base0A:"#f7ca88",base0B:"#a1b56c",base0C:"#86c1b9",base0D:"#7cafc2",base0E:"#ba8baf",base0F:"#a16946"},y5e=()=>null;y5e.when=()=>!1;const iOt=e=>{var t,n,r,i,o,s,a,l,c,u,f,d,h,p,g,v,y,O,m,w,S,E;return Zbt()((C,k)=>({rootName:(t=e.rootName)!==null&&t!==void 0?t:"root",indentWidth:(n=e.indentWidth)!==null&&n!==void 0?n:3,keyRenderer:(r=e.keyRenderer)!==null&&r!==void 0?r:y5e,enableAdd:(i=e.enableAdd)!==null&&i!==void 0?i:!1,enableDelete:(o=e.enableDelete)!==null&&o!==void 0?o:!1,enableClipboard:(s=e.enableClipboard)!==null&&s!==void 0?s:!0,editable:(a=e.editable)!==null&&a!==void 0?a:!1,onChange:(l=e.onChange)!==null&&l!==void 0?l:()=>{},onCopy:(c=e.onCopy)!==null&&c!==void 0?c:void 0,onSelect:(u=e.onSelect)!==null&&u!==void 0?u:void 0,onAdd:(f=e.onAdd)!==null&&f!==void 0?f:void 0,onDelete:(d=e.onDelete)!==null&&d!==void 0?d:void 0,defaultInspectDepth:(h=e.defaultInspectDepth)!==null&&h!==void 0?h:5,defaultInspectControl:(p=e.defaultInspectControl)!==null&&p!==void 0?p:void 0,maxDisplayLength:(g=e.maxDisplayLength)!==null&&g!==void 0?g:30,groupArraysAfterLength:(v=e.groupArraysAfterLength)!==null&&v!==void 0?v:100,collapseStringsAfterLength:e.collapseStringsAfterLength===!1?Number.MAX_VALUE:(y=e.collapseStringsAfterLength)!==null&&y!==void 0?y:50,objectSortKeys:(O=e.objectSortKeys)!==null&&O!==void 0?O:!1,quotesOnKeys:(m=e.quotesOnKeys)!==null&&m!==void 0?m:!0,displayDataTypes:(w=e.displayDataTypes)!==null&&w!==void 0?w:!0,displaySize:(S=e.displaySize)!==null&&S!==void 0?S:!0,highlightUpdates:(E=e.highlightUpdates)!==null&&E!==void 0?E:!1,inspectCache:{},hoverPath:null,colorspace:Ij,value:e.value,prevValue:void 0,getInspectCache:(P,D)=>{const M=D!==void 0?P.join(".")+"[".concat(D,"]nt"):P.join(".");return k().inspectCache[M]},setInspectCache:(P,D,M)=>{const L=M!==void 0?P.join(".")+"[".concat(M,"]nt"):P.join(".");C(A=>({inspectCache:{...A.inspectCache,[L]:typeof D=="function"?D(A.inspectCache[L]):D}}))},setHover:(P,D)=>{C({hoverPath:P?{path:P,nestedIndex:D}:null})}}))},ER=x.createContext(void 0);ER.Provider;const en=(e,t)=>{const n=x.useContext(ER);return Iie(n,e,t)},B6=()=>en(e=>e.colorspace.base07),oOt=Object.prototype.constructor.toString();function sOt(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===oOt}const aOt=(e,t,n)=>{if(e===null||n===null||typeof e!="object"||typeof n!="object")return!1;if(Object.is(e,n)&&t.length!==0)return"";const r=[],i=[...t];let o=e;for(;o!==n||i.length!==0;){if(typeof o!="object"||o===null)return!1;if(Object.is(o,n))return r.reduce((a,l,c)=>typeof l=="number"?a+"[".concat(l,"]"):a+"".concat(c===0?"":".").concat(l),"");const s=i.shift();r.push(s),o=o[s]}return!1};function CR(e){return e===null?0:Array.isArray(e)?e.length:e instanceof Map||e instanceof Set?e.size:e instanceof Date?1:typeof e=="object"?Object.keys(e).length:typeof e=="string"?e.length:1}function J0e(e,t){const n=[];let r=0;for(;r<e.length;)n.push(e.slice(r,r+t)),r+=t;return n}function lOt(e,t){const n=[];function r(i,o){if(typeof o=="bigint")return o.toString();if(o instanceof Map){if("toJSON"in o&&typeof o.toJSON=="function")return o.toJSON();if(o.size===0)return{};if(n.includes(o))return"[Circular]";n.push(o);const s=Array.from(o.entries());return s.every(a=>{let[l]=a;return typeof l=="string"||typeof l=="number"})?Object.fromEntries(s):{}}if(o instanceof Set)return"toJSON"in o&&typeof o.toJSON=="function"?o.toJSON():n.includes(o)?"[Circular]":(n.push(o),Array.from(o.values()));if(typeof o=="object"&&o!==null&&Object.keys(o).length){const s=n.length;if(s){for(let a=s-1;a>=0&&n[a][i]!==o;--a)n.pop();if(n.includes(o))return"[Circular]"}n.push(o)}return o}return JSON.stringify(e,r,t)}async function WZ(e){if("clipboard"in navigator)try{await navigator.clipboard.writeText(e)}catch{}nOt(e)}function cOt(){let{timeout:e=2e3}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const[t,n]=x.useState(!1),r=x.useRef(null),i=x.useCallback(l=>{const c=r.current;c&&window.clearTimeout(c),r.current=window.setTimeout(()=>n(!1),e),n(l)},[e]),o=en(l=>l.onCopy),s=x.useCallback(async(l,c)=>{if(typeof o=="function")try{await o(l,c,WZ),i(!0)}catch(u){console.error("error when copy ".concat(l.length===0?"src":"src[".concat(l.join(".")),"]"),u)}else try{const u=lOt(typeof c=="function"?c.toString():c,"  ");await WZ(u),i(!0)}catch(u){console.error("error when copy ".concat(l.length===0?"src":"src[".concat(l.join(".")),"]"),u)}},[i,o]),a=x.useCallback(()=>{n(!1),r.current&&clearTimeout(r.current)},[]);return{copy:s,reset:a,copied:t}}function Lie(e,t){const n=en(r=>r.value);return x.useMemo(()=>aOt(n,e,t),[e,t,n])}function uOt(e,t,n){const r=e.length,i=Lie(e,t),o=en(d=>d.getInspectCache),s=en(d=>d.setInspectCache),a=en(d=>d.defaultInspectDepth),l=en(d=>d.defaultInspectControl);x.useEffect(()=>{if(o(e,n)!==void 0)return;if(n!==void 0){s(e,!1,n);return}const h=i?!1:typeof l=="function"?l(e,t):r<a;s(e,h)},[a,l,r,o,i,n,e,t,s]);const[c,u]=x.useState(()=>{const d=o(e,n);return d!==void 0?d:n!==void 0||i?!1:typeof l=="function"?l(e,t):r<a}),f=x.useCallback(d=>{u(h=>{const p=typeof d=="boolean"?d:d(h);return s(e,p,n),p})},[n,e,s]);return[c,f]}const Jy=e=>b.jsx(ao,{component:"div",...e,sx:{display:"inline-block",...e.sx}}),v5e=e=>{let{dataType:t,enable:n=!0}=e;return n?b.jsx(Jy,{className:"data-type-label",sx:{mx:.5,fontSize:"0.7rem",opacity:.8,userSelect:"none"},children:t}):null};function um(e){let{is:t,serialize:n,deserialize:r,type:i,colorKey:o,displayTypeLabel:s=!0,Renderer:a}=e;const l=x.memo(a),c=f=>{const d=en(g=>g.displayDataTypes),h=en(g=>g.colorspace[o]),p=en(g=>g.onSelect);return b.jsxs(Jy,{onClick:()=>{var g;return(g=p)===null||g===void 0?void 0:g(f.path,f.value)},sx:{color:h},children:[s&&d&&b.jsx(v5e,{dataType:i}),b.jsx(Jy,{className:"".concat(i,"-value"),children:b.jsx(l,{path:f.path,inspect:f.inspect,setInspect:f.setInspect,value:f.value,prevValue:f.prevValue})})]})};if(c.displayName="easy-".concat(i,"-type"),!n||!r)return{is:t,Component:c};const u=f=>{let{value:d,setValue:h,abortEditing:p,commitEditing:g}=f;const v=en(m=>m.colorspace[o]),y=x.useCallback(m=>{m.key==="Enter"&&(m.preventDefault(),g(d)),m.key==="Escape"&&(m.preventDefault(),p())},[p,g,d]),O=x.useCallback(m=>{h(m.target.value)},[h]);return b.jsx(wbt,{autoFocus:!0,value:d,onChange:O,onKeyDown:y,size:"small",multiline:!0,sx:{color:v,padding:.5,borderStyle:"solid",borderColor:"black",borderWidth:1,fontSize:"0.8rem",fontFamily:"monospace",display:"inline-flex"}})};return u.displayName="easy-".concat(i,"-type-editor"),{is:t,serialize:n,deserialize:r,Component:c,Editor:u}}const fOt=um({is:e=>typeof e=="boolean",type:"bool",colorKey:"base0E",serialize:e=>e.toString(),deserialize:e=>{if(e==="true")return!0;if(e==="false")return!1;throw new Error("Invalid boolean value")},Renderer:e=>{let{value:t}=e;return b.jsx(b.Fragment,{children:t?"true":"false"})}}),dOt={weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"},hOt=um({is:e=>e instanceof Date,type:"date",colorKey:"base0D",Renderer:e=>{let{value:t}=e;return b.jsx(b.Fragment,{children:t.toLocaleTimeString("en-us",dOt)})}}),pOt=e=>{const t=e.toString();let n=!0;const r=t.indexOf(")"),i=t.indexOf("=>");return i!==-1&&i>r&&(n=!1),n?t.substring(t.indexOf("{",r)+1,t.lastIndexOf("}")):t.substring(t.indexOf("=>")+2)},gOt=e=>{const t=e.toString();return t.indexOf("function")!==-1?t.substring(8,t.indexOf("{")).trim():t.substring(0,t.indexOf("=>")+2).trim()},mOt="{",yOt="}",vOt=e=>b.jsxs(Die,{children:[b.jsx(v5e,{dataType:"function"}),b.jsxs(ao,{component:"span",className:"data-function-start",sx:{letterSpacing:.5},children:[gOt(e.value)," ",mOt]})]}),bOt=()=>b.jsx(Die,{children:b.jsx(ao,{component:"span",className:"data-function-end",children:yOt})}),OOt=e=>{const t=en(n=>n.colorspace.base05);return b.jsx(Die,{children:b.jsx(ao,{className:"data-function",sx:{display:e.inspect?"block":"inline-block",pl:e.inspect?2:0,color:t},children:e.inspect?pOt(e.value):b.jsx(ao,{component:"span",className:"data-function-body",onClick:()=>e.setInspect(!0),sx:{"&:hover":{cursor:"pointer"},padding:.5},children:"…"})})})},xOt={is:e=>typeof e=="function",Component:OOt,PreComponent:vOt,PostComponent:bOt},wOt=um({is:e=>e===null,type:"null",colorKey:"base08",displayTypeLabel:!1,Renderer:()=>{const e=en(t=>t.colorspace.base02);return b.jsx(ao,{sx:{fontSize:"0.8rem",backgroundColor:e,fontWeight:"bold",borderRadius:"3px",padding:"0.5px 2px"},children:"NULL"})}}),b5e=e=>e%1===0,SOt=um({is:e=>typeof e=="number"&&isNaN(e),type:"NaN",colorKey:"base08",displayTypeLabel:!1,serialize:()=>"NaN",deserialize:e=>parseFloat(e),Renderer:()=>{const e=en(t=>t.colorspace.base02);return b.jsx(ao,{sx:{backgroundColor:e,fontSize:"0.8rem",fontWeight:"bold",borderRadius:"3px",padding:"0.5px 2px"},children:"NaN"})}}),EOt=um({is:e=>typeof e=="number"&&!b5e(e)&&!isNaN(e),type:"float",colorKey:"base0B",serialize:e=>e.toString(),deserialize:e=>parseFloat(e),Renderer:e=>{let{value:t}=e;return b.jsx(b.Fragment,{children:t})}}),COt=um({is:e=>typeof e=="number"&&b5e(e),type:"int",colorKey:"base0F",serialize:e=>e.toString(),deserialize:e=>parseFloat(e),Renderer:e=>{let{value:t}=e;return b.jsx(b.Fragment,{children:t})}}),_Ot=um({is:e=>typeof e=="bigint",type:"bigint",colorKey:"base0F",serialize:e=>e.toString(),deserialize:e=>BigInt(e.replace(/\D/g,"")),Renderer:e=>{let{value:t}=e;return b.jsx(b.Fragment,{children:"".concat(t,"n")})}}),fm=e=>{let{d:t,...n}=e;return b.jsx(o1t,{...n,children:b.jsx("path",{d:t})})},kOt="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V5h14zm-8-2h2v-4h4v-2h-4V7h-2v4H7v2h4z",$Ot="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z",TOt="M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",POt="M 12 2 C 10.615 1.998 9.214625 2.2867656 7.890625 2.8847656 L 8.9003906 4.6328125 C 9.9043906 4.2098125 10.957 3.998 12 4 C 15.080783 4 17.738521 5.7633175 19.074219 8.3222656 L 17.125 9 L 21.25 11 L 22.875 7 L 20.998047 7.6523438 C 19.377701 4.3110398 15.95585 2 12 2 z M 6.5097656 4.4882812 L 2.2324219 5.0820312 L 3.734375 6.3808594 C 1.6515335 9.4550558 1.3615962 13.574578 3.3398438 17 C 4.0308437 18.201 4.9801562 19.268234 6.1601562 20.115234 L 7.1699219 18.367188 C 6.3019219 17.710187 5.5922656 16.904 5.0722656 16 C 3.5320014 13.332354 3.729203 10.148679 5.2773438 7.7128906 L 6.8398438 9.0625 L 6.5097656 4.4882812 z M 19.929688 13 C 19.794687 14.08 19.450734 15.098 18.927734 16 C 17.386985 18.668487 14.531361 20.090637 11.646484 19.966797 L 12.035156 17.9375 L 8.2402344 20.511719 L 10.892578 23.917969 L 11.265625 21.966797 C 14.968963 22.233766 18.681899 20.426323 20.660156 17 C 21.355156 15.801 21.805219 14.445 21.949219 13 L 19.929688 13 z",AOt="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",ROt="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",DOt="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z",MOt="M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z",NOt="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5l-1-1h-5l-1 1H5v2h14V4z",IOt=e=>b.jsx(fm,{d:kOt,...e}),eve=e=>b.jsx(fm,{d:$Ot,...e}),LOt=e=>b.jsx(fm,{d:TOt,...e}),jOt=e=>b.jsx(fm,{d:POt,...e}),FOt=e=>b.jsx(fm,{d:AOt,...e}),zOt=e=>b.jsx(fm,{d:ROt,...e}),QOt=e=>b.jsx(fm,{d:DOt,...e}),BOt=e=>b.jsx(fm,{d:MOt,...e}),WOt=e=>b.jsx(fm,{d:NOt,...e}),qOt="{",VOt="[",UOt="}",HOt="]";function O5e(e){const t=CR(e);let n="";return(e instanceof Map||e instanceof Set)&&(n=e[Symbol.toStringTag]),Object.prototype.hasOwnProperty.call(e,Symbol.toStringTag)&&(n=e[Symbol.toStringTag]),"".concat(t," Items").concat(n?" (".concat(n,")"):"")}const XOt=e=>{const t=en(c=>c.colorspace.base04),n=B6(),r=x.useMemo(()=>Array.isArray(e.value),[e.value]),i=x.useMemo(()=>CR(e.value)===0,[e.value]),o=x.useMemo(()=>O5e(e.value),[e.value]),s=en(c=>c.displaySize),a=x.useMemo(()=>typeof s=="function"?s(e.path,e.value):s,[s,e.path,e.value]),l=Lie(e.path,e.value);return b.jsxs(ao,{component:"span",className:"data-object-start",sx:{letterSpacing:.5},children:[r?VOt:qOt,a&&e.inspect&&!i&&b.jsx(ao,{component:"span",sx:{pl:.5,fontStyle:"italic",color:t,userSelect:"none"},children:o}),l&&!e.inspect&&b.jsxs(b.Fragment,{children:[b.jsx(jOt,{sx:{fontSize:12,color:n,mx:.5}}),l]})]})},ZOt=e=>{const t=en(l=>l.colorspace.base04),n=B6(),r=x.useMemo(()=>Array.isArray(e.value),[e.value]),i=x.useMemo(()=>CR(e.value)===0,[e.value]),o=x.useMemo(()=>O5e(e.value),[e.value]),s=en(l=>l.displaySize),a=x.useMemo(()=>typeof s=="function"?s(e.path,e.value):s,[s,e.path,e.value]);return b.jsxs(ao,{component:"span",className:"data-object-end",sx:{lineHeight:1.5,color:n,letterSpacing:.5,opacity:.8},children:[r?HOt:UOt,a&&(i||!e.inspect)?b.jsx(ao,{component:"span",sx:{pl:.5,fontStyle:"italic",color:t,userSelect:"none"},children:o}):null]})};function YOt(e){var t;return typeof((t=e)===null||t===void 0?void 0:t[Symbol.iterator])=="function"}const GOt=e=>{const t=B6(),n=en(h=>h.colorspace.base02),r=en(h=>h.groupArraysAfterLength),i=Lie(e.path,e.value),[o,s]=x.useState(en(h=>h.maxDisplayLength)),a=en(h=>h.objectSortKeys),l=x.useMemo(()=>{if(!e.inspect)return null;const h=e.value;if(YOt(h)&&!Array.isArray(h)){const y=[];if(h instanceof Map)h.forEach((O,m)=>{const w=m.toString(),S=[...e.path,w];y.push(b.jsx(bw,{path:S,value:O,prevValue:e.prevValue instanceof Map?e.prevValue.get(m):void 0,editable:!1},w))});else{const O=h[Symbol.iterator]();let m=O.next(),w=0;for(;!m.done;)y.push(b.jsx(bw,{path:[...e.path,"iterator:".concat(w)],value:m.value,nestedIndex:w,editable:!1},w)),w++,m=O.next()}return y}if(Array.isArray(h)){if(h.length<=r){const m=h.slice(0,o).map((w,S)=>{const E=e.nestedIndex?e.nestedIndex*r+S:S,C=[...e.path,E];return b.jsx(bw,{path:C,value:w,prevValue:Array.isArray(e.prevValue)?e.prevValue[E]:void 0},E)});if(h.length>o){const w=h.length-o;m.push(b.jsxs(Jy,{sx:{cursor:"pointer",lineHeight:1.5,color:t,letterSpacing:.5,opacity:.8,userSelect:"none"},onClick:()=>s(S=>S*2),children:["hidden ",w," items…"]},"last"))}return m}const y=J0e(h,r),O=Array.isArray(e.prevValue)?J0e(e.prevValue,r):void 0;return y.map((m,w)=>{var S;return b.jsx(bw,{path:e.path,value:m,nestedIndex:w,prevValue:(S=O)===null||S===void 0?void 0:S[w]},w)})}let g=Object.entries(h);a&&(g=a===!0?g.sort((y,O)=>{let[m]=y,[w]=O;return m.localeCompare(w)}):g.sort((y,O)=>{let[m]=y,[w]=O;return a(m,w)}));const v=g.slice(0,o).map(y=>{let[O,m]=y;var w;const S=[...e.path,O];return b.jsx(bw,{path:S,value:m,prevValue:(w=e.prevValue)===null||w===void 0?void 0:w[O]},O)});if(g.length>o){const y=g.length-o;v.push(b.jsxs(Jy,{sx:{cursor:"pointer",lineHeight:1.5,color:t,letterSpacing:.5,opacity:.8,userSelect:"none"},onClick:()=>s(O=>O*2),children:["hidden ",y," items…"]},"last"))}return v},[e.inspect,e.value,e.prevValue,e.path,e.nestedIndex,r,o,t,a]),c=e.inspect?.6:0,u=en(h=>h.indentWidth),f=e.inspect?u-c:u;return x.useMemo(()=>CR(e.value)===0,[e.value])?null:b.jsx(ao,{className:"data-object",sx:{display:e.inspect?"block":"inline-block",pl:e.inspect?f-.6:0,marginLeft:c,color:t,borderLeft:e.inspect?"1px solid ".concat(n):"none"},children:e.inspect?l:!i&&b.jsx(ao,{component:"span",className:"data-object-body",onClick:()=>e.setInspect(!0),sx:{"&:hover":{cursor:"pointer"},padding:.5,userSelect:"none"},children:"…"})})},KOt={is:e=>typeof e=="object",Component:GOt,PreComponent:XOt,PostComponent:ZOt},JOt=um({is:e=>typeof e=="string",type:"string",colorKey:"base09",serialize:e=>e,deserialize:e=>e,Renderer:e=>{const[t,n]=x.useState(!1),r=en(s=>s.collapseStringsAfterLength),i=t?e.value:e.value.slice(0,r),o=e.value.length>r;return b.jsxs(ao,{component:"span",sx:{overflowWrap:"anywhere",cursor:o?"pointer":"inherit"},onClick:()=>{var s;((s=window.getSelection())===null||s===void 0?void 0:s.type)!=="Range"&&o&&n(a=>!a)},children:['"',i,o&&!t&&b.jsx(ao,{component:"span",sx:{padding:.5},children:"…"}),'"']})}}),ext=um({is:e=>e===void 0,type:"undefined",colorKey:"base05",displayTypeLabel:!1,Renderer:()=>{const e=en(t=>t.colorspace.base02);return b.jsx(ao,{sx:{fontSize:"0.7rem",backgroundColor:e,borderRadius:"3px",padding:"0.5px 2px"},children:"undefined"})}}),txt=()=>Mie()(e=>({registry:[],registerTypes:t=>{e(n=>({registry:typeof t=="function"?t(n.registry):t}))}})),jie=x.createContext(void 0);jie.Provider;const x5e=(e,t)=>{const n=x.useContext(jie);return Iie(n,e,t)};function nxt(e,t,n){let r;for(const i of n)i.is(e,t)&&(r=i);if(r===void 0){if(typeof e=="object")return KOt;throw new Error("No type matched for value: ".concat(e))}return r}function rxt(e,t){const n=x5e(r=>r.registry);return x.useMemo(()=>nxt(e,t,n),[e,t,n])}function Kd(e){function t(n,r){var i,o;return Object.is(n.value,r.value)&&n.inspect&&r.inspect&&((i=n.path)===null||i===void 0?void 0:i.join("."))===((o=r.path)===null||o===void 0?void 0:o.join("."))}return e.Component=x.memo(e.Component,t),e.Editor&&(e.Editor=x.memo(e.Editor,function(r,i){return Object.is(r.value,i.value)})),e.PreComponent&&(e.PreComponent=x.memo(e.PreComponent,t)),e.PostComponent&&(e.PostComponent=x.memo(e.PostComponent,t)),e}const FM=[Kd(fOt),Kd(hOt),Kd(wOt),Kd(ext),Kd(JOt),Kd(xOt),Kd(SOt),Kd(COt),Kd(EOt),Kd(_Ot)],Ax=e=>b.jsx(ao,{component:"span",...e,sx:{cursor:"pointer",paddingLeft:"0.7rem",...e.sx}}),bw=e=>{const{value:t,prevValue:n,path:r,nestedIndex:i}=e,{Component:o,PreComponent:s,PostComponent:a,Editor:l,serialize:c,deserialize:u}=rxt(t,r);var f;const d=(f=e.editable)!==null&&f!==void 0?f:void 0,h=en(G=>G.editable),p=x.useMemo(()=>h===!1||d===!1?!1:typeof h=="function"?!!h(r,t):h,[r,d,h,t]),[g,v]=x.useState(""),y=r.length,O=r[y-1],m=en(G=>G.hoverPath),w=x.useMemo(()=>m&&r.every((G,le)=>G===m.path[le]&&i===m.nestedIndex),[m,r,i]),S=en(G=>G.setHover),E=en(G=>G.value),[C,k]=uOt(r,t,i),[P,D]=x.useState(!1),M=en(G=>G.onChange),L=B6(),A=en(G=>G.colorspace.base0C),T=en(G=>G.colorspace.base0A),N=en(G=>G.quotesOnKeys),j=en(G=>G.rootName),z=E===t,W=Number.isInteger(Number(O)),F=en(G=>G.enableAdd),q=en(G=>G.onAdd),U=x.useMemo(()=>!q||i!==void 0||F===!1||d===!1?!1:typeof F=="function"?!!F(r,t):!!(Array.isArray(t)||sOt(t)),[q,i,r,F,d,t]),V=en(G=>G.enableDelete),H=en(G=>G.onDelete),Z=x.useMemo(()=>!H||i!==void 0||z||V===!1||d===!1?!1:typeof V=="function"?!!V(r,t):V,[H,i,z,r,V,d,t]),ee=en(G=>G.enableClipboard),{copy:se,copied:fe}=cOt(),ce=en(G=>G.highlightUpdates),ae=x.useMemo(()=>!ce||n===void 0?!1:typeof t!=typeof n?!0:typeof t=="number"?isNaN(t)&&isNaN(n)?!1:t!==n:Array.isArray(t)!==Array.isArray(n)?!0:typeof t=="object"||typeof t=="function"?!1:t!==n,[ce,n,t]),de=x.useRef();x.useEffect(()=>{de.current&&ae&&"animate"in de.current&&de.current.animate([{backgroundColor:T},{backgroundColor:""}],{duration:1e3,easing:"ease-in"})},[T,ae,n,t]);const me=x.useCallback(G=>{G.preventDefault(),c&&v(c(t)),D(!0)},[c,t]),te=x.useCallback(()=>{D(!1),v("")},[D,v]),Ee=x.useCallback(G=>{if(D(!1),!!u)try{M(r,t,u(G))}catch{}},[D,u,M,r,t]),we=x.useMemo(()=>P?b.jsxs(b.Fragment,{children:[b.jsx(Ax,{children:b.jsx(FOt,{sx:{fontSize:".8rem"},onClick:te})}),b.jsx(Ax,{children:b.jsx(eve,{sx:{fontSize:".8rem"},onClick:()=>Ee(g)})})]}):b.jsxs(b.Fragment,{children:[ee&&b.jsx(Ax,{onClick:G=>{G.preventDefault();try{se(r,t,WZ)}catch(le){console.error(le)}},children:fe?b.jsx(eve,{sx:{fontSize:".8rem"}}):b.jsx(zOt,{sx:{fontSize:".8rem"}})}),l&&p&&c&&u&&b.jsx(Ax,{onClick:me,children:b.jsx(QOt,{sx:{fontSize:".8rem"}})}),U&&b.jsx(Ax,{onClick:G=>{var le;G.preventDefault(),(le=q)===null||le===void 0||le(r)},children:b.jsx(IOt,{sx:{fontSize:".8rem"}})}),Z&&b.jsx(Ax,{onClick:G=>{var le;G.preventDefault(),(le=H)===null||le===void 0||le(r,t)},children:b.jsx(WOt,{sx:{fontSize:".9rem"}})})]}),[l,c,u,fe,se,p,P,ee,U,Z,g,r,t,q,H,me,te,Ee]),ke=x.useMemo(()=>CR(t)===0,[t]),je=!ke&&!!(s&&a),nt=en(G=>G.keyRenderer),Re=x.useMemo(()=>({path:r,inspect:C,setInspect:k,value:t,prevValue:n,nestedIndex:i}),[C,r,k,t,n,i]);return b.jsxs(ao,{className:"data-key-pair","data-testid":"data-key-pair"+r.join("."),sx:{userSelect:"text"},onMouseEnter:x.useCallback(()=>S(r,i),[S,r,i]),children:[b.jsxs(Jy,{component:"span",className:"data-key",sx:{lineHeight:1.5,color:L,letterSpacing:.5,opacity:.8},onClick:x.useCallback(G=>{G.isDefaultPrevented()||ke||k(le=>!le)},[ke,k]),children:[je?C?b.jsx(BOt,{sx:{fontSize:".8rem","&:hover":{cursor:"pointer"}}}):b.jsx(LOt,{sx:{fontSize:".8rem","&:hover":{cursor:"pointer"}}}):null,b.jsx(ao,{ref:de,component:"span",children:z&&y===0?j!==!1?N?b.jsxs(b.Fragment,{children:['"',j,'"']}):b.jsx(b.Fragment,{children:j}):null:nt.when(Re)?b.jsx(nt,{...Re}):i===void 0&&(W?b.jsx(ao,{component:"span",style:{color:A},children:O}):N?b.jsxs(b.Fragment,{children:['"',O,'"']}):b.jsx(b.Fragment,{children:O}))}),z?j!==!1&&b.jsx(Jy,{sx:{mr:.5},children:":"}):i===void 0&&b.jsx(Jy,{sx:{mr:.5},children:":"}),s&&b.jsx(s,{...Re}),w&&je&&C&&we]}),P&&p?l&&b.jsx(l,{value:g,setValue:v,abortEditing:te,commitEditing:Ee}):o?b.jsx(o,{...Re}):b.jsx(ao,{component:"span",className:"data-value-fallback",children:"fallback: ".concat(t)}),a&&b.jsx(a,{...Re}),w&&je&&!C&&we,w&&!je&&we,!w&&P&&we]})},tve="(prefers-color-scheme: dark)";function ixt(){const[e,t]=x.useState(!1);return x.useEffect(()=>{const n=i=>t(i.matches);t(window.matchMedia(tve).matches);const r=window.matchMedia(tve);return r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),e}function Cs(e,t){const{setState:n}=x.useContext(ER);x.useEffect(()=>{t!==void 0&&n({[e]:t})},[e,t,n])}const oxt=e=>{const{setState:t}=x.useContext(ER);x.useEffect(()=>{t(u=>({prevValue:u.value,value:e.value}))},[e.value,t]),Cs("rootName",e.rootName),Cs("indentWidth",e.indentWidth),Cs("keyRenderer",e.keyRenderer),Cs("enableAdd",e.enableAdd),Cs("enableDelete",e.enableDelete),Cs("enableClipboard",e.enableClipboard),Cs("editable",e.editable),Cs("onChange",e.onChange),Cs("onCopy",e.onCopy),Cs("onSelect",e.onSelect),Cs("onAdd",e.onAdd),Cs("onDelete",e.onDelete),Cs("maxDisplayLength",e.maxDisplayLength),Cs("groupArraysAfterLength",e.groupArraysAfterLength),Cs("displayDataTypes",e.displayDataTypes),Cs("displaySize",e.displaySize),Cs("highlightUpdates",e.highlightUpdates),x.useEffect(()=>{e.theme==="light"?t({colorspace:Ij}):e.theme==="dark"?t({colorspace:BZ}):typeof e.theme=="object"&&t({colorspace:e.theme})},[t,e.theme]);const n=x.useMemo(()=>typeof e.theme=="object"?"json-viewer-theme-custom":e.theme==="dark"?"json-viewer-theme-dark":"json-viewer-theme-light",[e.theme]),r=x.useRef(!0),i=x5e(u=>u.registerTypes);if(r.current){const u=e.valueTypes?[...FM,...e.valueTypes]:[...FM];i(u),r.current=!1}x.useEffect(()=>{const u=e.valueTypes?[...FM,...e.valueTypes]:[...FM];i(u)},[e.valueTypes,i]);const o=en(u=>u.value),s=en(u=>u.prevValue),a=x.useMemo(()=>[],[]),l=en(u=>u.setHover),c=x.useCallback(()=>l(null),[l]);return b.jsx(d1t,{elevation:0,className:rOt(n,e.className),style:e.style,sx:{fontFamily:"monospace",userSelect:"none",contentVisibility:"auto",...e.sx},onMouseLeave:c,children:b.jsx(bw,{value:o,prevValue:s,path:a})})},sxt=function(t){const n=ixt();var r;const i=x.useMemo(()=>t.theme==="auto"?n?"light":"dark":(r=t.theme)!==null&&r!==void 0?r:"light",[n,t.theme]),o=x.useMemo(()=>{const c=typeof i=="object"?i.base00:i==="dark"?BZ.base00:Ij.base00,u=typeof i=="object"?i.base07:i==="dark"?BZ.base07:Ij.base07;return Eie({components:{MuiPaper:{styleOverrides:{root:{backgroundColor:c,color:u}}}},palette:{mode:i==="dark"?"dark":"light",background:{default:c}}})},[i]),s={...t,theme:i},a=x.useMemo(()=>iOt(t),[]),l=x.useMemo(()=>txt(),[]);return b.jsx(e1t,{theme:o,children:b.jsx(jie.Provider,{value:l,children:b.jsx(ER.Provider,{value:a,children:b.jsx(oxt,{...s})})})})};var Fie={},zie={},Qie={};Object.defineProperty(Qie,"__esModule",{value:!0});var nve="html",rve="head",zM="body",axt=/<([a-zA-Z]+[0-9]?)/,ive=/<head[^]*>/i,ove=/<body[^]*>/i,Lj=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},qZ=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},sve=typeof window=="object"&&window.DOMParser;if(typeof sve=="function"){var lxt=new sve,cxt="text/html";qZ=function(e,t){return t&&(e="<".concat(t,">").concat(e,"</").concat(t,">")),lxt.parseFromString(e,cxt)},Lj=qZ}if(typeof document=="object"&&document.implementation){var QM=document.implementation.createHTMLDocument();Lj=function(e,t){if(t){var n=QM.documentElement.querySelector(t);return n&&(n.innerHTML=e),QM}return QM.documentElement.innerHTML=e,QM}}var BM=typeof document=="object"&&document.createElement("template"),VZ;BM&&BM.content&&(VZ=function(e){return BM.innerHTML=e,BM.content.childNodes});function uxt(e){var t,n,r=e.match(axt),i=r&&r[1]?r[1].toLowerCase():"";switch(i){case nve:{var o=qZ(e);if(!ive.test(e)){var s=o.querySelector(rve);(t=s==null?void 0:s.parentNode)===null||t===void 0||t.removeChild(s)}if(!ove.test(e)){var s=o.querySelector(zM);(n=s==null?void 0:s.parentNode)===null||n===void 0||n.removeChild(s)}return o.querySelectorAll(nve)}case rve:case zM:{var a=Lj(e).querySelectorAll(i);return ove.test(e)&&ive.test(e)?a[0].parentNode.childNodes:a}default:{if(VZ)return VZ(e);var s=Lj(e,zM).querySelector(zM);return s.childNodes}}}Qie.default=uxt;var fE={},Bie={},Wie={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Doctype=e.CDATA=e.Tag=e.Style=e.Script=e.Comment=e.Directive=e.Text=e.Root=e.isTag=e.ElementType=void 0;var t;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(t=e.ElementType||(e.ElementType={}));function n(r){return r.type===t.Tag||r.type===t.Script||r.type===t.Style}e.isTag=n,e.Root=t.Root,e.Text=t.Text,e.Directive=t.Directive,e.Comment=t.Comment,e.Script=t.Script,e.Style=t.Style,e.Tag=t.Tag,e.CDATA=t.CDATA,e.Doctype=t.Doctype})(Wie);var $n={},mv=ft&&ft.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ET=ft&&ft.__assign||function(){return ET=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ET.apply(this,arguments)};Object.defineProperty($n,"__esModule",{value:!0});$n.cloneNode=$n.hasChildren=$n.isDocument=$n.isDirective=$n.isComment=$n.isText=$n.isCDATA=$n.isTag=$n.Element=$n.Document=$n.CDATA=$n.NodeWithChildren=$n.ProcessingInstruction=$n.Comment=$n.Text=$n.DataNode=$n.Node=void 0;var Zl=Wie,qie=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(t){this.parent=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(t){this.prev=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(t){this.next=t},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){return t===void 0&&(t=!1),Vie(this,t)},e}();$n.Node=qie;var W6=function(e){mv(t,e);function t(n){var r=e.call(this)||this;return r.data=n,r}return Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(n){this.data=n},enumerable:!1,configurable:!0}),t}(qie);$n.DataNode=W6;var w5e=function(e){mv(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=Zl.ElementType.Text,n}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(W6);$n.Text=w5e;var S5e=function(e){mv(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=Zl.ElementType.Comment,n}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(W6);$n.Comment=S5e;var E5e=function(e){mv(t,e);function t(n,r){var i=e.call(this,r)||this;return i.name=n,i.type=Zl.ElementType.Directive,i}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(W6);$n.ProcessingInstruction=E5e;var q6=function(e){mv(t,e);function t(n){var r=e.call(this)||this;return r.children=n,r}return Object.defineProperty(t.prototype,"firstChild",{get:function(){var n;return(n=this.children[0])!==null&&n!==void 0?n:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(n){this.children=n},enumerable:!1,configurable:!0}),t}(qie);$n.NodeWithChildren=q6;var C5e=function(e){mv(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=Zl.ElementType.CDATA,n}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(q6);$n.CDATA=C5e;var _5e=function(e){mv(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=Zl.ElementType.Root,n}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(q6);$n.Document=_5e;var k5e=function(e){mv(t,e);function t(n,r,i,o){i===void 0&&(i=[]),o===void 0&&(o=n==="script"?Zl.ElementType.Script:n==="style"?Zl.ElementType.Style:Zl.ElementType.Tag);var s=e.call(this,i)||this;return s.name=n,s.attribs=r,s.type=o,s}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(n){this.name=n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var n=this;return Object.keys(this.attribs).map(function(r){var i,o;return{name:r,value:n.attribs[r],namespace:(i=n["x-attribsNamespace"])===null||i===void 0?void 0:i[r],prefix:(o=n["x-attribsPrefix"])===null||o===void 0?void 0:o[r]}})},enumerable:!1,configurable:!0}),t}(q6);$n.Element=k5e;function $5e(e){return(0,Zl.isTag)(e)}$n.isTag=$5e;function T5e(e){return e.type===Zl.ElementType.CDATA}$n.isCDATA=T5e;function P5e(e){return e.type===Zl.ElementType.Text}$n.isText=P5e;function A5e(e){return e.type===Zl.ElementType.Comment}$n.isComment=A5e;function R5e(e){return e.type===Zl.ElementType.Directive}$n.isDirective=R5e;function D5e(e){return e.type===Zl.ElementType.Root}$n.isDocument=D5e;function fxt(e){return Object.prototype.hasOwnProperty.call(e,"children")}$n.hasChildren=fxt;function Vie(e,t){t===void 0&&(t=!1);var n;if(P5e(e))n=new w5e(e.data);else if(A5e(e))n=new S5e(e.data);else if($5e(e)){var r=t?zW(e.children):[],i=new k5e(e.name,ET({},e.attribs),r);r.forEach(function(l){return l.parent=i}),e.namespace!=null&&(i.namespace=e.namespace),e["x-attribsNamespace"]&&(i["x-attribsNamespace"]=ET({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(i["x-attribsPrefix"]=ET({},e["x-attribsPrefix"])),n=i}else if(T5e(e)){var r=t?zW(e.children):[],o=new C5e(r);r.forEach(function(c){return c.parent=o}),n=o}else if(D5e(e)){var r=t?zW(e.children):[],s=new _5e(r);r.forEach(function(c){return c.parent=s}),e["x-mode"]&&(s["x-mode"]=e["x-mode"]),n=s}else if(R5e(e)){var a=new E5e(e.name,e.data);e["x-name"]!=null&&(a["x-name"]=e["x-name"],a["x-publicId"]=e["x-publicId"],a["x-systemId"]=e["x-systemId"]),n=a}else throw new Error("Not implemented yet: ".concat(e.type));return n.startIndex=e.startIndex,n.endIndex=e.endIndex,e.sourceCodeLocation!=null&&(n.sourceCodeLocation=e.sourceCodeLocation),n}$n.cloneNode=Vie;function zW(e){for(var t=e.map(function(r){return Vie(r,!0)}),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}(function(e){var t=ft&&ft.__createBinding||(Object.create?function(a,l,c,u){u===void 0&&(u=c);var f=Object.getOwnPropertyDescriptor(l,c);(!f||("get"in f?!l.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return l[c]}}),Object.defineProperty(a,u,f)}:function(a,l,c,u){u===void 0&&(u=c),a[u]=l[c]}),n=ft&&ft.__exportStar||function(a,l){for(var c in a)c!=="default"&&!Object.prototype.hasOwnProperty.call(l,c)&&t(l,a,c)};Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=void 0;var r=Wie,i=$n;n($n,e);var o={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},s=function(){function a(l,c,u){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof c=="function"&&(u=c,c=o),typeof l=="object"&&(c=l,l=void 0),this.callback=l??null,this.options=c??o,this.elementCB=u??null}return a.prototype.onparserinit=function(l){this.parser=l},a.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},a.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},a.prototype.onerror=function(l){this.handleCallback(l)},a.prototype.onclosetag=function(){this.lastNode=null;var l=this.tagStack.pop();this.options.withEndIndices&&(l.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(l)},a.prototype.onopentag=function(l,c){var u=this.options.xmlMode?r.ElementType.Tag:void 0,f=new i.Element(l,c,void 0,u);this.addNode(f),this.tagStack.push(f)},a.prototype.ontext=function(l){var c=this.lastNode;if(c&&c.type===r.ElementType.Text)c.data+=l,this.options.withEndIndices&&(c.endIndex=this.parser.endIndex);else{var u=new i.Text(l);this.addNode(u),this.lastNode=u}},a.prototype.oncomment=function(l){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=l;return}var c=new i.Comment(l);this.addNode(c),this.lastNode=c},a.prototype.oncommentend=function(){this.lastNode=null},a.prototype.oncdatastart=function(){var l=new i.Text(""),c=new i.CDATA([l]);this.addNode(c),l.parent=c,this.lastNode=l},a.prototype.oncdataend=function(){this.lastNode=null},a.prototype.onprocessinginstruction=function(l,c){var u=new i.ProcessingInstruction(l,c);this.addNode(u)},a.prototype.handleCallback=function(l){if(typeof this.callback=="function")this.callback(l,this.dom);else if(l)throw l},a.prototype.addNode=function(l){var c=this.tagStack[this.tagStack.length-1],u=c.children[c.children.length-1];this.options.withStartIndices&&(l.startIndex=this.parser.startIndex),this.options.withEndIndices&&(l.endIndex=this.parser.endIndex),c.children.push(l),u&&(l.prev=u,u.next=l),l.parent=c,this.lastNode=null},a}();e.DomHandler=s,e.default=s})(Bie);var M5e={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES=void 0,e.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],e.CASE_SENSITIVE_TAG_NAMES_MAP=e.CASE_SENSITIVE_TAG_NAMES.reduce(function(t,n){return t[n.toLowerCase()]=n,t},{})})(M5e);Object.defineProperty(fE,"__esModule",{value:!0});fE.formatDOM=fE.formatAttributes=void 0;var WM=Bie,dxt=M5e;function hxt(e){return dxt.CASE_SENSITIVE_TAG_NAMES_MAP[e]}function N5e(e){for(var t={},n=0,r=e.length;n<r;n++){var i=e[n];t[i.name]=i.value}return t}fE.formatAttributes=N5e;function pxt(e){e=e.toLowerCase();var t=hxt(e);return t||e}function I5e(e,t,n){t===void 0&&(t=null);for(var r=[],i,o=0,s=e.length;o<s;o++){var a=e[o];switch(a.nodeType){case 1:{var l=pxt(a.nodeName);i=new WM.Element(l,N5e(a.attributes)),i.children=I5e(l==="template"?a.content.childNodes:a.childNodes,i);break}case 3:i=new WM.Text(a.nodeValue);break;case 8:i=new WM.Comment(a.nodeValue);break;default:continue}var c=r[o-1]||null;c&&(c.next=i),i.parent=t,i.prev=c,i.next=null,r.push(i)}return n&&(i=new WM.ProcessingInstruction(n.substring(0,n.indexOf(" ")).toLowerCase(),n),i.next=r[0]||null,i.parent=t,r.unshift(i),r[1]&&(r[1].prev=r[0])),r}fE.formatDOM=I5e;var gxt=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zie,"__esModule",{value:!0});var mxt=gxt(Qie),yxt=fE,vxt=/<(![a-zA-Z\s]+)>/;function bxt(e){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];var t=e.match(vxt),n=t?t[1]:void 0;return(0,yxt.formatDOM)((0,mxt.default)(e),null,n)}zie.default=bxt;var V6={},Id={},U6={},Oxt=0;U6.SAME=Oxt;var xxt=1;U6.CAMELCASE=xxt;U6.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};const L5e=0,yv=1,H6=2,X6=3,Uie=4,j5e=5,F5e=6;function wxt(e){return Zs.hasOwnProperty(e)?Zs[e]:null}function kl(e,t,n,r,i,o,s){this.acceptsBooleans=t===H6||t===X6||t===Uie,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}const Zs={},Sxt=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];Sxt.forEach(e=>{Zs[e]=new kl(e,L5e,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([e,t])=>{Zs[e]=new kl(e,yv,!1,t,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(e=>{Zs[e]=new kl(e,H6,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(e=>{Zs[e]=new kl(e,H6,!1,e,null,!1,!1)});["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(e=>{Zs[e]=new kl(e,X6,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(e=>{Zs[e]=new kl(e,X6,!0,e,null,!1,!1)});["capture","download"].forEach(e=>{Zs[e]=new kl(e,Uie,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(e=>{Zs[e]=new kl(e,F5e,!1,e,null,!1,!1)});["rowSpan","start"].forEach(e=>{Zs[e]=new kl(e,j5e,!1,e.toLowerCase(),null,!1,!1)});const Hie=/[\-\:]([a-z])/g,Xie=e=>e[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(e=>{const t=e.replace(Hie,Xie);Zs[t]=new kl(t,yv,!1,e,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(e=>{const t=e.replace(Hie,Xie);Zs[t]=new kl(t,yv,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(e=>{const t=e.replace(Hie,Xie);Zs[t]=new kl(t,yv,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(e=>{Zs[e]=new kl(e,yv,!1,e.toLowerCase(),null,!1,!1)});const Ext="xlinkHref";Zs[Ext]=new kl("xlinkHref",yv,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(e=>{Zs[e]=new kl(e,yv,!1,e.toLowerCase(),null,!0,!0)});const{CAMELCASE:Cxt,SAME:_xt,possibleStandardNames:ave}=U6,kxt=":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",$xt=kxt+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Txt=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+$xt+"]*$")),Pxt=Object.keys(ave).reduce((e,t)=>{const n=ave[t];return n===_xt?e[t]=t:n===Cxt?e[t.toLowerCase()]=t:e[t]=n,e},{});Id.BOOLEAN=X6;Id.BOOLEANISH_STRING=H6;Id.NUMERIC=j5e;Id.OVERLOADED_BOOLEAN=Uie;Id.POSITIVE_NUMERIC=F5e;Id.RESERVED=L5e;Id.STRING=yv;Id.getPropertyInfo=wxt;Id.isCustomAttribute=Txt;Id.possibleStandardNames=Pxt;var Zie={},Yie={},Gie={},lve=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Axt=/\n/g,Rxt=/^\s*/,Dxt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Mxt=/^:\s*/,Nxt=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ixt=/^[;\s]*/,Lxt=/^\s+|\s+$/g,jxt=`
`,cve="/",uve="*",O1="",Fxt="comment",zxt="declaration",Qxt=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var g=p.match(Axt);g&&(n+=g.length);var v=p.lastIndexOf(jxt);r=~v?p.length-v:r+p.length}function o(){var p={line:n,column:r};return function(g){return g.position=new s(p),c(),g}}function s(p){this.start=p,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(p){var g=new Error(t.source+":"+n+":"+r+": "+p);if(g.reason=p,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(p){var g=p.exec(e);if(g){var v=g[0];return i(v),e=e.slice(v.length),g}}function c(){l(Rxt)}function u(p){var g;for(p=p||[];g=f();)g!==!1&&p.push(g);return p}function f(){var p=o();if(!(cve!=e.charAt(0)||uve!=e.charAt(1))){for(var g=2;O1!=e.charAt(g)&&(uve!=e.charAt(g)||cve!=e.charAt(g+1));)++g;if(g+=2,O1===e.charAt(g-1))return a("End of comment missing");var v=e.slice(2,g-2);return r+=2,i(v),e=e.slice(g),r+=2,p({type:Fxt,comment:v})}}function d(){var p=o(),g=l(Dxt);if(g){if(f(),!l(Mxt))return a("property missing ':'");var v=l(Nxt),y=p({type:zxt,property:fve(g[0].replace(lve,O1)),value:v?fve(v[0].replace(lve,O1)):O1});return l(Ixt),y}}function h(){var p=[];u(p);for(var g;g=d();)g!==!1&&(p.push(g),u(p));return p}return c(),h()};function fve(e){return e?e.replace(Lxt,O1):O1}var Bxt=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gie,"__esModule",{value:!0});var Wxt=Bxt(Qxt);function qxt(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Wxt.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,a=o.value;i?t(s,a,o):a&&(n=n||{},n[s]=a)}}),n}Gie.default=qxt;var Z6={};Object.defineProperty(Z6,"__esModule",{value:!0});Z6.camelCase=void 0;var Vxt=/^--[a-zA-Z0-9-]+$/,Uxt=/-([a-z])/g,Hxt=/^[^-]+$/,Xxt=/^-(webkit|moz|ms|o|khtml)-/,Zxt=/^-(ms)-/,Yxt=function(e){return!e||Hxt.test(e)||Vxt.test(e)},Gxt=function(e,t){return t.toUpperCase()},dve=function(e,t){return"".concat(t,"-")},Kxt=function(e,t){return t===void 0&&(t={}),Yxt(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Zxt,dve):e=e.replace(Xxt,dve),e.replace(Uxt,Gxt))};Z6.camelCase=Kxt;var Jxt=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yie,"__esModule",{value:!0});var ewt=Jxt(Gie),twt=Z6;function nwt(e,t){var n={};return!e||typeof e!="string"||(0,ewt.default)(e,function(r,i){r&&i&&(n[(0,twt.camelCase)(r,t)]=i)}),n}Yie.default=nwt;(function(e){var t=ft&&ft.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.returnFirstArg=e.canTextBeChildOfNode=e.ELEMENTS_WITH_NO_TEXT_CHILDREN=e.PRESERVE_CUSTOM_ATTRIBUTES=e.setStyleProp=e.isCustomComponent=void 0;var n=x,r=t(Yie),i=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function o(u,f){return u.includes("-")?!i.has(u):!!(f&&typeof f.is=="string")}e.isCustomComponent=o;var s={reactCompat:!0};function a(u,f){if(typeof u=="string"){if(!u.trim()){f.style={};return}try{f.style=(0,r.default)(u,s)}catch{f.style={}}}}e.setStyleProp=a,e.PRESERVE_CUSTOM_ATTRIBUTES=Number(n.version.split(".")[0])>=16,e.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]);var l=function(u){return!e.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(u.name)};e.canTextBeChildOfNode=l;var c=function(u){return u};e.returnFirstArg=c})(Zie);Object.defineProperty(V6,"__esModule",{value:!0});var b$=Id,hve=Zie,rwt=["checked","value"],iwt=["input","select","textarea"],owt={reset:!0,submit:!0};function swt(e,t){e===void 0&&(e={});var n={},r=!!(e.type&&owt[e.type]);for(var i in e){var o=e[i];if((0,b$.isCustomAttribute)(i)){n[i]=o;continue}var s=i.toLowerCase(),a=pve(s);if(a){var l=(0,b$.getPropertyInfo)(a);switch(rwt.includes(a)&&iwt.includes(t)&&!r&&(a=pve("default"+s)),n[a]=o,l&&l.type){case b$.BOOLEAN:n[a]=!0;break;case b$.OVERLOADED_BOOLEAN:o===""&&(n[a]=!0);break}continue}hve.PRESERVE_CUSTOM_ATTRIBUTES&&(n[i]=o)}return(0,hve.setStyleProp)(e.style,n),n}V6.default=swt;function pve(e){return b$.possibleStandardNames[e]}var Kie={},awt=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kie,"__esModule",{value:!0});var QW=x,lwt=awt(V6),CT=Zie,cwt={cloneElement:QW.cloneElement,createElement:QW.createElement,isValidElement:QW.isValidElement};function z5e(e,t){t===void 0&&(t={});for(var n=[],r=typeof t.replace=="function",i=t.transform||CT.returnFirstArg,o=t.library||cwt,s=o.cloneElement,a=o.createElement,l=o.isValidElement,c=e.length,u=0;u<c;u++){var f=e[u];if(r){var d=t.replace(f,u);if(l(d)){c>1&&(d=s(d,{key:d.key||u})),n.push(i(d,f,u));continue}}if(f.type==="text"){var h=!f.data.trim().length;if(h&&f.parent&&!(0,CT.canTextBeChildOfNode)(f.parent)||t.trim&&h)continue;n.push(i(f.data,f,u));continue}var p=f,g={};uwt(p)?((0,CT.setStyleProp)(p.attribs.style,p.attribs),g=p.attribs):p.attribs&&(g=(0,lwt.default)(p.attribs,p.name));var v=void 0;switch(f.type){case"script":case"style":f.children[0]&&(g.dangerouslySetInnerHTML={__html:f.children[0].data});break;case"tag":f.name==="textarea"&&f.children[0]?g.defaultValue=f.children[0].data:f.children&&f.children.length&&(v=z5e(f.children,t));break;default:continue}c>1&&(g.key=u),n.push(i(a(f.name,g,v),f,u))}return n.length===1?n[0]:n}Kie.default=z5e;function uwt(e){return CT.PRESERVE_CUSTOM_ATTRIBUTES&&e.type==="tag"&&(0,CT.isCustomComponent)(e.name,e.attribs)}(function(e){var t=ft&&ft.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlToDOM=e.domToReact=e.attributesToProps=e.Text=e.ProcessingInstruction=e.Element=e.Comment=void 0;var n=t(zie);e.htmlToDOM=n.default;var r=t(V6);e.attributesToProps=r.default;var i=t(Kie);e.domToReact=i.default;var o=Bie;Object.defineProperty(e,"Comment",{enumerable:!0,get:function(){return o.Comment}}),Object.defineProperty(e,"Element",{enumerable:!0,get:function(){return o.Element}}),Object.defineProperty(e,"ProcessingInstruction",{enumerable:!0,get:function(){return o.ProcessingInstruction}}),Object.defineProperty(e,"Text",{enumerable:!0,get:function(){return o.Text}});var s={lowerCaseAttributeNames:!1};function a(l,c){if(typeof l!="string")throw new TypeError("First argument must be a string");return l?(0,i.default)((0,n.default)(l,(c==null?void 0:c.htmlparser2)||s),c):[]}e.default=a})(Fie);const gve=wf(Fie),fwt=gve.default||gve,Da=({html:e})=>fwt(e,{replace:t=>{if(t instanceof Fie.Element&&t.attribs&&t.name==="iframe"){const n=document.createElement("iframe");return Object.entries(t.attribs).forEach(([r,i])=>{n.setAttribute(r,i)}),b.jsx("div",{dangerouslySetInnerHTML:{__html:n.outerHTML}})}return t}}),Y6=x.memo(({html:e,inline:t=!1,className:n})=>e?b.jsx("div",{className:be(n,{"inline-flex":t,block:!t}),children:Da({html:e})}):null);Y6.displayName="HtmlOutput";const Q5e=({src:e,alt:t="",width:n,height:r,className:i})=>b.jsx("span",{className:i,children:b.jsx("img",{src:e,alt:t,width:n,height:r})});var BW=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},Qr;(function(e){e[e.EOS=0]="EOS",e[e.Text=1]="Text",e[e.Incomplete=2]="Incomplete",e[e.ESC=3]="ESC",e[e.Unknown=4]="Unknown",e[e.SGR=5]="SGR",e[e.OSCURL=6]="OSCURL"})(Qr||(Qr={}));class B5e{constructor(){this.VERSION="6.0.2",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle="font-weight:bold",this.faintStyle="opacity:0.7",this.italicStyle="font-style:italic",this.underlineStyle="text-decoration:underline"}set use_classes(t){this._use_classes=t}get use_classes(){return this._use_classes}set url_allowlist(t){this._url_allowlist=t}get url_allowlist(){return this._url_allowlist}set escape_html(t){this._escape_html=t}get escape_html(){return this._escape_html}set boldStyle(t){this._boldStyle=t}get boldStyle(){return this._boldStyle}set faintStyle(t){this._faintStyle=t}get faintStyle(){return this._faintStyle}set italicStyle(t){this._italicStyle=t}get italicStyle(){return this._italicStyle}set underlineStyle(t){this._underlineStyle=t}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(r=>{r.forEach(i=>{this.palette_256.push(i)})});let t=[0,95,135,175,215,255];for(let r=0;r<6;++r)for(let i=0;i<6;++i)for(let o=0;o<6;++o){let s={rgb:[t[r],t[i],t[o]],class_name:"truecolor"};this.palette_256.push(s)}let n=8;for(let r=0;r<24;++r,n+=10){let i={rgb:[n,n,n],class_name:"truecolor"};this.palette_256.push(i)}}escape_txt_for_html(t){return this._escape_html?t.replace(/[&<>"']/gm,n=>{if(n==="&")return"&amp;";if(n==="<")return"&lt;";if(n===">")return"&gt;";if(n==='"')return"&quot;";if(n==="'")return"&#x27;"}):t}append_buffer(t){var n=this._buffer+t;this._buffer=n}get_next_packet(){var t={kind:Qr.EOS,text:"",url:""},n=this._buffer.length;if(n==0)return t;var r=this._buffer.indexOf("\x1B");if(r==-1)return t.kind=Qr.Text,t.text=this._buffer,this._buffer="",t;if(r>0)return t.kind=Qr.Text,t.text=this._buffer.slice(0,r),this._buffer=this._buffer.slice(r),t;if(r==0){if(n<3)return t.kind=Qr.Incomplete,t;var i=this._buffer.charAt(1);if(i!="["&&i!="]"&&i!="(")return t.kind=Qr.ESC,t.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),t;if(i=="["){this._csi_regex||(this._csi_regex=mve(yve||(yve=BW([`
                        ^                           # beginning of line
                                                    #
                                                    # First attempt
                        (?:                         # legal sequence
                          \x1B[                      # CSI
                          ([<-?]?)              # private-mode char
                          ([d;]*)                    # any digits or semicolons
                          ([ -/]?               # an intermediate modifier
                          [@-~])                # the command
                        )
                        |                           # alternate (second attempt)
                        (?:                         # illegal sequence
                          \x1B[                      # CSI
                          [ -~]*                # anything legal
                          ([\0-:])              # anything illegal
                        )
                    `],[`
                        ^                           # beginning of line
                                                    #
                                                    # First attempt
                        (?:                         # legal sequence
                          \\x1b\\[                      # CSI
                          ([\\x3c-\\x3f]?)              # private-mode char
                          ([\\d;]*)                    # any digits or semicolons
                          ([\\x20-\\x2f]?               # an intermediate modifier
                          [\\x40-\\x7e])                # the command
                        )
                        |                           # alternate (second attempt)
                        (?:                         # illegal sequence
                          \\x1b\\[                      # CSI
                          [\\x20-\\x7e]*                # anything legal
                          ([\\x00-\\x1f:])              # anything illegal
                        )
                    `]))));let s=this._buffer.match(this._csi_regex);if(s===null)return t.kind=Qr.Incomplete,t;if(s[4])return t.kind=Qr.ESC,t.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),t;s[1]!=""||s[3]!="m"?t.kind=Qr.Unknown:t.kind=Qr.SGR,t.text=s[2];var o=s[0].length;return this._buffer=this._buffer.slice(o),t}else if(i=="]"){if(n<4)return t.kind=Qr.Incomplete,t;if(this._buffer.charAt(2)!="8"||this._buffer.charAt(3)!=";")return t.kind=Qr.ESC,t.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),t;this._osc_st||(this._osc_st=dwt(vve||(vve=BW([`
                        (?:                         # legal sequence
                          (\x1B\\)                    # ESC                           |                           # alternate
                          (\x07)                      # BEL (what xterm did)
                        )
                        |                           # alternate (second attempt)
                        (                           # illegal sequence
                          [\0-]                 # anything illegal
                          |                           # alternate
                          [\b-]                 # anything illegal
                          |                           # alternate
                          [-]                 # anything illegal
                        )
                    `],[`
                        (?:                         # legal sequence
                          (\\x1b\\\\)                    # ESC \\
                          |                           # alternate
                          (\\x07)                      # BEL (what xterm did)
                        )
                        |                           # alternate (second attempt)
                        (                           # illegal sequence
                          [\\x00-\\x06]                 # anything illegal
                          |                           # alternate
                          [\\x08-\\x1a]                 # anything illegal
                          |                           # alternate
                          [\\x1c-\\x1f]                 # anything illegal
                        )
                    `])))),this._osc_st.lastIndex=0;{let l=this._osc_st.exec(this._buffer);if(l===null)return t.kind=Qr.Incomplete,t;if(l[3])return t.kind=Qr.ESC,t.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),t}{let l=this._osc_st.exec(this._buffer);if(l===null)return t.kind=Qr.Incomplete,t;if(l[3])return t.kind=Qr.ESC,t.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),t}this._osc_regex||(this._osc_regex=mve(bve||(bve=BW([`
                        ^                           # beginning of line
                                                    #
                        \x1B]8;                    # OSC Hyperlink
                        [ -:<-~]*       # params (excluding ;)
                        ;                           # end of params
                        ([!-~]{0,512})        # URL capture
                        (?:                         # ST
                          (?:\x1B\\)                  # ESC                           |                           # alternate
                          (?:\x07)                    # BEL (what xterm did)
                        )
                        ([ -~]+)              # TEXT capture
                        \x1B]8;;                   # OSC Hyperlink End
                        (?:                         # ST
                          (?:\x1B\\)                  # ESC                           |                           # alternate
                          (?:\x07)                    # BEL (what xterm did)
                        )
                    `],[`
                        ^                           # beginning of line
                                                    #
                        \\x1b\\]8;                    # OSC Hyperlink
                        [\\x20-\\x3a\\x3c-\\x7e]*       # params (excluding ;)
                        ;                           # end of params
                        ([\\x21-\\x7e]{0,512})        # URL capture
                        (?:                         # ST
                          (?:\\x1b\\\\)                  # ESC \\
                          |                           # alternate
                          (?:\\x07)                    # BEL (what xterm did)
                        )
                        ([\\x20-\\x7e]+)              # TEXT capture
                        \\x1b\\]8;;                   # OSC Hyperlink End
                        (?:                         # ST
                          (?:\\x1b\\\\)                  # ESC \\
                          |                           # alternate
                          (?:\\x07)                    # BEL (what xterm did)
                        )
                    `]))));let s=this._buffer.match(this._osc_regex);if(s===null)return t.kind=Qr.ESC,t.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),t;t.kind=Qr.OSCURL,t.url=s[1],t.text=s[2];var o=s[0].length;return this._buffer=this._buffer.slice(o),t}else if(i=="(")return t.kind=Qr.Unknown,this._buffer=this._buffer.slice(3),t}}ansi_to_html(t){this.append_buffer(t);for(var n=[];;){var r=this.get_next_packet();if(r.kind==Qr.EOS||r.kind==Qr.Incomplete)break;r.kind==Qr.ESC||r.kind==Qr.Unknown||(r.kind==Qr.Text?n.push(this.transform_to_html(this.with_state(r))):r.kind==Qr.SGR?this.process_ansi(r):r.kind==Qr.OSCURL&&n.push(this.process_hyperlink(r)))}return n.join("")}with_state(t){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:t.text}}process_ansi(t){let n=t.text.split(";");for(;n.length>0;){let r=n.shift(),i=parseInt(r,10);if(isNaN(i)||i===0)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(i===1)this.bold=!0;else if(i===2)this.faint=!0;else if(i===3)this.italic=!0;else if(i===4)this.underline=!0;else if(i===21)this.bold=!1;else if(i===22)this.faint=!1,this.bold=!1;else if(i===23)this.italic=!1;else if(i===24)this.underline=!1;else if(i===39)this.fg=null;else if(i===49)this.bg=null;else if(i>=30&&i<38)this.fg=this.ansi_colors[0][i-30];else if(i>=40&&i<48)this.bg=this.ansi_colors[0][i-40];else if(i>=90&&i<98)this.fg=this.ansi_colors[1][i-90];else if(i>=100&&i<108)this.bg=this.ansi_colors[1][i-100];else if((i===38||i===48)&&n.length>0){let o=i===38,s=n.shift();if(s==="5"&&n.length>0){let a=parseInt(n.shift(),10);a>=0&&a<=255&&(o?this.fg=this.palette_256[a]:this.bg=this.palette_256[a])}if(s==="2"&&n.length>2){let a=parseInt(n.shift(),10),l=parseInt(n.shift(),10),c=parseInt(n.shift(),10);if(a>=0&&a<=255&&l>=0&&l<=255&&c>=0&&c<=255){let u={rgb:[a,l,c],class_name:"truecolor"};o?this.fg=u:this.bg=u}}}}}transform_to_html(t){let n=t.text;if(n.length===0||(n=this.escape_txt_for_html(n),!t.bold&&!t.italic&&!t.underline&&t.fg===null&&t.bg===null))return n;let r=[],i=[],o=t.fg,s=t.bg;t.bold&&r.push(this._boldStyle),t.faint&&r.push(this._faintStyle),t.italic&&r.push(this._italicStyle),t.underline&&r.push(this._underlineStyle),this._use_classes?(o&&(o.class_name!=="truecolor"?i.push(`${o.class_name}-fg`):r.push(`color:rgb(${o.rgb.join(",")})`)),s&&(s.class_name!=="truecolor"?i.push(`${s.class_name}-bg`):r.push(`background-color:rgb(${s.rgb.join(",")})`))):(o&&r.push(`color:rgb(${o.rgb.join(",")})`),s&&r.push(`background-color:rgb(${s.rgb})`));let a="",l="";return i.length&&(a=` class="${i.join(" ")}"`),r.length&&(l=` style="${r.join(";")}"`),`<span${l}${a}>${n}</span>`}process_hyperlink(t){let n=t.url.split(":");return n.length<1||!this._url_allowlist[n[0]]?"":`<a href="${this.escape_txt_for_html(t.url)}">${this.escape_txt_for_html(t.text)}</a>`}}function mve(e,...t){let n=e.raw[0],r=/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,i=n.replace(r,"");return new RegExp(i)}function dwt(e,...t){let n=e.raw[0],r=/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm,i=n.replace(r,"");return new RegExp(i,"g")}var yve,vve,bve;const hwt=new B5e,Jie=({text:e,channel:t})=>{const n=t==="stdout",r=i=>b.jsx("span",{dangerouslySetInnerHTML:{__html:hwt.ansi_to_html(i)}});return b.jsx("span",{className:be("whitespace-pre",t==="output"&&"font-prose",t),children:n?r(e):e})},W5e=({src:e,className:t})=>b.jsx("iframe",{className:t,src:e});function Ld(e){return At.warn(`Unexpected object: ${JSON.stringify(e)}`),e}const G6=x.memo(({data:e,format:t="auto",name:n=!1,className:r})=>{const{theme:i}=mp();switch(t==="auto"&&(t=pwt(e)),t){case"tree":return b.jsx(sxt,{className:"marimo-json-output",rootName:n,theme:i,value:e,style:{backgroundColor:"transparent"},valueTypes:mwt,groupArraysAfterLength:1e6,enableClipboard:!1});case"raw":return b.jsx("pre",{className:r,children:JSON.stringify(e,null,2)});default:return Ld(t),b.jsx("pre",{className:r,children:JSON.stringify(e,null,2)})}});G6.displayName="JsonOutput";function pwt(e){return typeof e=="object"&&e!==null?"tree":"raw"}const gwt={"image/":e=>b.jsx(Q5e,{src:e}),"video/":e=>b.jsx(W5e,{src:e}),"text/html":e=>b.jsx(Y6,{html:e,inline:!0}),"text/plain":e=>b.jsx(Jie,{text:e})},mwt=Object.entries(gwt).map(([e,t])=>({is:n=>typeof n=="string"&&n.startsWith(e),Component:n=>vwt(n.value,t)}));function ywt(e){const t=e.indexOf(":");if(t===-1)throw new Error("Invalid leaf");return e.slice(t+1)}function vwt(e,t){try{return t(ywt(e))}catch{return b.jsx(Jie,{text:"Invalid leaf: {leaf}"})}}const q5e=({container:e,children:t})=>{const n=x.useMemo(()=>{if(!e)return $j({key:"mo",prepend:!0});let r=e.querySelector("style");return r||(r=document.createElement("style"),e.append(r)),$j({key:"mo",prepend:!0,container:r})},[e]);return b.jsx(vIe,{value:n,children:t})},bwt=({error:e,badData:t,shadowRoot:n})=>e instanceof Ju?b.jsxs(pR,{variant:"destructive",children:[b.jsx(gR,{children:"Bad Data"}),b.jsx("div",{className:"text-md",children:b.jsx("ul",{children:e.issues.map(r=>{const i=r.path.join(".");return b.jsxs("li",{children:[b.jsx("span",{className:"font-bold",children:i}),": ",r.message]},i)})})}),b.jsx(rie,{type:"single",collapsible:!0,children:b.jsxs(ZNe,{value:"item-1",className:"text-muted-foreground border-muted-foreground-20",children:[b.jsx(YNe,{className:"py-2 text-[0.84375rem]",children:"View Data:"}),b.jsx(GNe,{className:"text-[0.84375rem]",children:b.jsx(q5e,{container:n,children:b.jsx(G6,{data:t})})})]})})]}):b.jsx("div",{children:e.message});function Owt(e,t,n){return b.jsx(bwt,{error:e,badData:t,shadowRoot:n})}class V5e{constructor(t,n){this.key=t,this.defaultValue=n}get(){try{const t=window.localStorage.getItem(this.key);return t?JSON.parse(t):this.defaultValue}catch{return this.defaultValue}}set(t){window.localStorage.setItem(this.key,JSON.stringify(t))}}var eoe={exports:{}};eoe.exports;(function(e){var t=function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={};function s(l,c){if(!o[l]){o[l]={};for(var u=0;u<l.length;u++)o[l][l.charAt(u)]=u}return o[l][c]}var a={compressToBase64:function(l){if(l==null)return"";var c=a._compress(l,6,function(u){return r.charAt(u)});switch(c.length%4){default:case 0:return c;case 1:return c+"===";case 2:return c+"==";case 3:return c+"="}},decompressFromBase64:function(l){return l==null?"":l==""?null:a._decompress(l.length,32,function(c){return s(r,l.charAt(c))})},compressToUTF16:function(l){return l==null?"":a._compress(l,15,function(c){return n(c+32)})+" "},decompressFromUTF16:function(l){return l==null?"":l==""?null:a._decompress(l.length,16384,function(c){return l.charCodeAt(c)-32})},compressToUint8Array:function(l){for(var c=a.compress(l),u=new Uint8Array(c.length*2),f=0,d=c.length;f<d;f++){var h=c.charCodeAt(f);u[f*2]=h>>>8,u[f*2+1]=h%256}return u},decompressFromUint8Array:function(l){if(l==null)return a.decompress(l);for(var c=new Array(l.length/2),u=0,f=c.length;u<f;u++)c[u]=l[u*2]*256+l[u*2+1];var d=[];return c.forEach(function(h){d.push(n(h))}),a.decompress(d.join(""))},compressToEncodedURIComponent:function(l){return l==null?"":a._compress(l,6,function(c){return i.charAt(c)})},decompressFromEncodedURIComponent:function(l){return l==null?"":l==""?null:(l=l.replace(/ /g,"+"),a._decompress(l.length,32,function(c){return s(i,l.charAt(c))}))},compress:function(l){return a._compress(l,16,function(c){return n(c)})},_compress:function(l,c,u){if(l==null)return"";var f,d,h={},p={},g="",v="",y="",O=2,m=3,w=2,S=[],E=0,C=0,k;for(k=0;k<l.length;k+=1)if(g=l.charAt(k),Object.prototype.hasOwnProperty.call(h,g)||(h[g]=m++,p[g]=!0),v=y+g,Object.prototype.hasOwnProperty.call(h,v))y=v;else{if(Object.prototype.hasOwnProperty.call(p,y)){if(y.charCodeAt(0)<256){for(f=0;f<w;f++)E=E<<1,C==c-1?(C=0,S.push(u(E)),E=0):C++;for(d=y.charCodeAt(0),f=0;f<8;f++)E=E<<1|d&1,C==c-1?(C=0,S.push(u(E)),E=0):C++,d=d>>1}else{for(d=1,f=0;f<w;f++)E=E<<1|d,C==c-1?(C=0,S.push(u(E)),E=0):C++,d=0;for(d=y.charCodeAt(0),f=0;f<16;f++)E=E<<1|d&1,C==c-1?(C=0,S.push(u(E)),E=0):C++,d=d>>1}O--,O==0&&(O=Math.pow(2,w),w++),delete p[y]}else for(d=h[y],f=0;f<w;f++)E=E<<1|d&1,C==c-1?(C=0,S.push(u(E)),E=0):C++,d=d>>1;O--,O==0&&(O=Math.pow(2,w),w++),h[v]=m++,y=String(g)}if(y!==""){if(Object.prototype.hasOwnProperty.call(p,y)){if(y.charCodeAt(0)<256){for(f=0;f<w;f++)E=E<<1,C==c-1?(C=0,S.push(u(E)),E=0):C++;for(d=y.charCodeAt(0),f=0;f<8;f++)E=E<<1|d&1,C==c-1?(C=0,S.push(u(E)),E=0):C++,d=d>>1}else{for(d=1,f=0;f<w;f++)E=E<<1|d,C==c-1?(C=0,S.push(u(E)),E=0):C++,d=0;for(d=y.charCodeAt(0),f=0;f<16;f++)E=E<<1|d&1,C==c-1?(C=0,S.push(u(E)),E=0):C++,d=d>>1}O--,O==0&&(O=Math.pow(2,w),w++),delete p[y]}else for(d=h[y],f=0;f<w;f++)E=E<<1|d&1,C==c-1?(C=0,S.push(u(E)),E=0):C++,d=d>>1;O--,O==0&&(O=Math.pow(2,w),w++)}for(d=2,f=0;f<w;f++)E=E<<1|d&1,C==c-1?(C=0,S.push(u(E)),E=0):C++,d=d>>1;for(;;)if(E=E<<1,C==c-1){S.push(u(E));break}else C++;return S.join("")},decompress:function(l){return l==null?"":l==""?null:a._decompress(l.length,32768,function(c){return l.charCodeAt(c)})},_decompress:function(l,c,u){var f=[],d=4,h=4,p=3,g="",v=[],y,O,m,w,S,E,C,k={val:u(0),position:c,index:1};for(y=0;y<3;y+=1)f[y]=y;for(m=0,S=Math.pow(2,2),E=1;E!=S;)w=k.val&k.position,k.position>>=1,k.position==0&&(k.position=c,k.val=u(k.index++)),m|=(w>0?1:0)*E,E<<=1;switch(m){case 0:for(m=0,S=Math.pow(2,8),E=1;E!=S;)w=k.val&k.position,k.position>>=1,k.position==0&&(k.position=c,k.val=u(k.index++)),m|=(w>0?1:0)*E,E<<=1;C=n(m);break;case 1:for(m=0,S=Math.pow(2,16),E=1;E!=S;)w=k.val&k.position,k.position>>=1,k.position==0&&(k.position=c,k.val=u(k.index++)),m|=(w>0?1:0)*E,E<<=1;C=n(m);break;case 2:return""}for(f[3]=C,O=C,v.push(C);;){if(k.index>l)return"";for(m=0,S=Math.pow(2,p),E=1;E!=S;)w=k.val&k.position,k.position>>=1,k.position==0&&(k.position=c,k.val=u(k.index++)),m|=(w>0?1:0)*E,E<<=1;switch(C=m){case 0:for(m=0,S=Math.pow(2,8),E=1;E!=S;)w=k.val&k.position,k.position>>=1,k.position==0&&(k.position=c,k.val=u(k.index++)),m|=(w>0?1:0)*E,E<<=1;f[h++]=n(m),C=h-1,d--;break;case 1:for(m=0,S=Math.pow(2,16),E=1;E!=S;)w=k.val&k.position,k.position>>=1,k.position==0&&(k.position=c,k.val=u(k.index++)),m|=(w>0?1:0)*E,E<<=1;f[h++]=n(m),C=h-1,d--;break;case 2:return v.join("")}if(d==0&&(d=Math.pow(2,p),p++),f[C])g=f[C];else if(C===h)g=O+O.charAt(0);else return null;v.push(g),f[h++]=O+g.charAt(0),d--,O=g,d==0&&(d=Math.pow(2,p),p++)}}};return a}();e!=null?e.exports=t:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return t})})(eoe);var UZ=eoe.exports;const Ove=new V5e("marimo:file",null),xwt={saveFile(e){Ove.set(e)},readFile(){return Ove.get()}},wwt={saveFile(e){pS.setCodeForHash(UZ.compressToEncodedURIComponent(e))},readFile(){const e=pS.getCodeFromHash()||pS.getCodeFromSearchParam();return e?UZ.decompressFromEncodedURIComponent(e):null}},Swt={saveFile(e){},readFile(){const e=document.querySelector("marimo-code");return e?decodeURIComponent(e.textContent||"").trim():null}},Ewt={saveFile(e){},readFile(){const e=document.baseURI;return fetch(`${e}files/wasm-intro.py`).then(t=>t.text()).catch(()=>null)}},Cwt={saveFile(e){},readFile(){return["import marimo","app = marimo.App()","","@app.cell","def __():","  return","",'if __name__ == "__main__":',"  app.run()"].join(`
`)}};class U5e{constructor(t){this.stores=t}saveFile(t){this.stores.forEach(n=>n.saveFile(t))}readFile(){for(const t of this.stores){const n=t.readFile();if(n)return n}return null}}const WW=new U5e([Swt,wwt]),qW=new U5e([xwt,Ewt,Cwt]);class H5e{constructor(){ve(this,"promise");ve(this,"resolve");ve(this,"reject");this.promise=new Promise((t,n)=>{this.reject=n,this.resolve=t})}}function toe(e){const{code:t,baseUrl:n="https://marimo.app"}=e,r=new URL(n);if(t){const i=UZ.compressToEncodedURIComponent(t);r.hash=`#code/${i}`}return r.href}const _wt=1e10,kwt=1e3;function qM(e,t){const n=e.map(r=>`"${r}"`).join(", ");return new Error(`This RPC instance cannot ${t} because the transport did not provide one or more of these methods: ${n}`)}function $wt(e={}){let t={};function n(k){t=k}let r={};function i(k){var P;r.unregisterHandler&&r.unregisterHandler(),r=k,(P=r.registerHandler)==null||P.call(r,E)}let o;function s(k){if(typeof k=="function"){o=k;return}o=(P,D)=>{const M=k[P];if(M)return M(D);const L=k._;if(!L)throw new Error(`The requested method has no handler: ${P}`);return L(P,D)}}const{maxRequestTime:a=kwt}=e;e.transport&&i(e.transport),e.requestHandler&&s(e.requestHandler),e._debugHooks&&n(e._debugHooks);let l=0;function c(){return l<=_wt?++l:l=0}const u=new Map,f=new Map;function d(k,...P){const D=P[0];return new Promise((M,L)=>{var N;if(!r.send)throw qM(["send"],"make requests");const A=c(),T={type:"request",id:A,method:k,params:D};u.set(A,{resolve:M,reject:L}),a!==1/0&&f.set(A,setTimeout(()=>{f.delete(A),L(new Error("RPC request timed out."))},a)),(N=t.onSend)==null||N.call(t,T),r.send(T)})}const h=new Proxy(d,{get:(k,P,D)=>P in k?Reflect.get(k,P,D):M=>d(P,M)}),p=h;function g(k,...P){var L;const D=P[0];if(!r.send)throw qM(["send"],"send messages");const M={type:"message",id:k,payload:D};(L=t.onSend)==null||L.call(t,M),r.send(M)}const v=new Proxy(g,{get:(k,P,D)=>P in k?Reflect.get(k,P,D):M=>g(P,M)}),y=v,O=new Map,m=new Set;function w(k,P){var D;if(!r.registerHandler)throw qM(["registerHandler"],"register message listeners");if(k==="*"){m.add(P);return}O.has(k)||O.set(k,new Set),(D=O.get(k))==null||D.add(P)}function S(k,P){var D,M;if(k==="*"){m.delete(P);return}(D=O.get(k))==null||D.delete(P),((M=O.get(k))==null?void 0:M.size)===0&&O.delete(k)}async function E(k){var P,D;if((P=t.onReceive)==null||P.call(t,k),!("type"in k))throw new Error("Message does not contain a type.");if(k.type==="request"){if(!r.send||!o)throw qM(["send","requestHandler"],"handle requests");const{id:M,method:L,params:A}=k;let T;try{T={type:"response",id:M,success:!0,payload:await o(L,A)}}catch(N){if(!(N instanceof Error))throw N;T={type:"response",id:M,success:!1,error:N.message}}(D=t.onSend)==null||D.call(t,T),r.send(T);return}if(k.type==="response"){const M=f.get(k.id);M!=null&&clearTimeout(M);const{resolve:L,reject:A}=u.get(k.id)??{};k.success?L==null||L(k.payload):A==null||A(new Error(k.error));return}if(k.type==="message"){for(const L of m)L(k.id,k.payload);const M=O.get(k.id);if(!M)return;for(const L of M)L(k.payload);return}throw new Error(`Unexpected RPC message type: ${k.type}`)}return{setTransport:i,setRequestHandler:s,request:h,requestProxy:p,send:v,sendProxy:y,addMessageListener:w,removeMessageListener:S,proxy:{send:y,request:p},_setDebugHooks:n}}function Twt(e){return $wt(e)}const X5e="[transport-id]";function Pwt(e,t){const{transportId:n}=t;return n!=null?{[X5e]:n,data:e}:e}function Awt(e,t){const{transportId:n,filter:r}=t,i=r==null?void 0:r();if(n!=null&&i!=null)throw new Error("Cannot use both `transportId` and `filter` at the same time");let o=e;if(n){if(e[X5e]!==n)return[!0];o=e.data}return i===!1?[!0]:[!1,o]}function Rwt(e,t={}){const{transportId:n,filter:r,remotePort:i}=t,o=e,s=i??e;let a;return{send(l){s.postMessage(Pwt(l,{transportId:n}))},registerHandler(l){a=c=>{const u=c.data,[f,d]=Awt(u,{transportId:n,filter:()=>r==null?void 0:r(c)});f||l(d)},o.addEventListener("message",a)},unregisterHandler(){a&&o.removeEventListener("message",a)}}}function Dwt(e,t){return Rwt(e,t)}const Mwt="marimo-transport";function Nwt(e){return Twt({transport:Dwt(e,{transportId:Mwt}),maxRequestTime:2e4,_debugHooks:{onSend:t=>{At.debug("[rpc] Parent -> Worker",t)},onReceive:t=>{At.debug("[rpc] Worker -> Parent",t)}}})}function K6(e){let t,n=!1;return function(...r){return n||(n=!0,t=e.apply(this,r)),t}}function J6(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,function(e){const t=Math.trunc(Math.random()*16);return(e==="x"?t:t&3|8).toString(16)})}const Iwt=J6();function Z5e(){return Iwt}const Lwt=K6(()=>fht()),Nr={post(e,t,n={}){const i=`${n.baseUrl??document.baseURI}api${e}`;return fetch(i,{method:"POST",headers:{"Content-Type":"application/json",...Nr.headers(),...n.headers},body:JSON.stringify(t)}).then(o=>{var s;if(o.ok)return(s=o.headers.get("Content-Type"))!=null&&s.startsWith("application/json")?o.json():null;throw new Error(o.statusText)}).catch(o=>{throw At.error(`Error requesting ${i}`,o),o})},headers(){return{"Marimo-Session-Id":Z5e(),"Marimo-Server-Token":Lwt()}}},N7=class N7{constructor(){ve(this,"rpc");ve(this,"interruptBuffer");ve(this,"messageConsumer");ve(this,"initialized",new H5e);ve(this,"sendRename",async t=>(t===null||(pS.setFilename(t),await this.rpc.proxy.request.bridge({functionName:"rename_file",payload:t})),null));ve(this,"sendSave",async t=>{await this.rpc.proxy.request.bridge({functionName:"save",payload:t});const n=await this.readCode();return n.contents&&(WW.saveFile(n.contents),qW.saveFile(n.contents)),null});ve(this,"sendStdin",async t=>(await this.rpc.proxy.request.bridge({functionName:"put_input",payload:t.text}),null));ve(this,"sendRun",async(t,n)=>(await this.rpc.proxy.request.loadPackages(n.join(`
`)),await this.putControlRequest({execution_requests:t.map((r,i)=>({cell_id:r,code:n[i]}))}),null));ve(this,"sendInterrupt",async()=>(this.interruptBuffer!==void 0&&(this.interruptBuffer[0]=2),null));ve(this,"sendShutdown",async()=>(window.close(),null));ve(this,"sendFormat",async t=>(await this.rpc.proxy.request.bridge({functionName:"format",payload:t})).codes);ve(this,"sendDeleteCell",async t=>(await this.putControlRequest({cell_id:t}),null));ve(this,"sendInstallMissingPackages",async t=>(this.putControlRequest(t),null));ve(this,"sendCodeCompletionRequest",async t=>(await this.rpc.proxy.request.bridge({functionName:"code_complete",payload:t}),null));ve(this,"saveUserConfig",async t=>Nr.post("/kernel/save_user_config",t,{baseUrl:"/"}));ve(this,"saveAppConfig",async t=>(await this.rpc.proxy.request.bridge({functionName:"save_app_config",payload:t}),null));ve(this,"saveCellConfig",async t=>(await this.putControlRequest({configs:t.configs}),null));ve(this,"sendRestart",async()=>{const t=await this.readCode();return t.contents&&(WW.saveFile(t.contents),qW.saveFile(t.contents)),window.location.reload(),null});ve(this,"readCode",async()=>await this.rpc.proxy.request.bridge({functionName:"read_code",payload:void 0}));ve(this,"openFile",async t=>{const n=toe({code:null,baseUrl:window.location.origin});return window.open(n,"_blank"),null});ve(this,"sendListFiles",async t=>await this.rpc.proxy.request.bridge({functionName:"list_files",payload:t}));ve(this,"sendComponentValues",async t=>(await this.putControlRequest({ids_and_values:t.map(n=>[n.objectId,n.value])}),null));ve(this,"sendInstantiate",async t=>null);ve(this,"sendFunctionRequest",async t=>(await this.putControlRequest(t),null));ve(this,"sendCreateFileOrFolder",async t=>await this.rpc.proxy.request.bridge({functionName:"create_file_or_directory",payload:t}));ve(this,"sendDeleteFileOrFolder",async t=>await this.rpc.proxy.request.bridge({functionName:"delete_file_or_directory",payload:t}));ve(this,"sendRenameFileOrFolder",async t=>await this.rpc.proxy.request.bridge({functionName:"move_file_or_directory",payload:t}));ve(this,"sendUpdateFile",async t=>await this.rpc.proxy.request.bridge({functionName:"update_file",payload:t}));ve(this,"sendFileDetails",async t=>await this.rpc.proxy.request.bridge({functionName:"file_details",payload:t}));if(yp()){const t=new Worker(new URL(""+new URL("worker-BjwfQA8O.js",import.meta.url).href,import.meta.url),{type:"module",name:jre()});this.rpc=Nwt(t),this.rpc.addMessageListener("ready",()=>{this.startSession()}),this.rpc.addMessageListener("initialized",()=>{this.setInterruptBuffer(),this.initialized.resolve()}),this.rpc.addMessageListener("initializedError",({error:n})=>{this.initialized.reject(new Error(n))}),this.rpc.addMessageListener("kernelMessage",({message:n})=>{var r;(r=this.messageConsumer)==null||r.call(this,n)})}}async startSession(){const t=await WW.readFile(),n=await qW.readFile(),r=pS.getFilename(),i={},o=new URLSearchParams(window.location.search);for(const s of o.keys()){const a=o.getAll(s);i[s]=a.length===1?a[0]:a}await this.rpc.proxy.request.startSession({queryParameters:i,code:t,fallbackCode:n||"",filename:r})}setInterruptBuffer(){crossOriginIsolated?(this.interruptBuffer=new Uint8Array(new SharedArrayBuffer(1)),this.rpc.proxy.request.setInterruptBuffer(this.interruptBuffer)):At.warn("Not running in a secure context; interrupts are not available.")}consumeMessages(t){this.messageConsumer=t,this.rpc.proxy.send.consumerReady({})}async putControlRequest(t){await this.rpc.proxy.request.bridge({functionName:"put_control_request",payload:t})}};ve(N7,"INSTANCE",new N7);let rP=N7;class jwt{constructor(t){ve(this,"CONNECTING",WebSocket.CONNECTING);ve(this,"OPEN",WebSocket.OPEN);ve(this,"CLOSING",WebSocket.CLOSING);ve(this,"CLOSED",WebSocket.CLOSED);ve(this,"binaryType","blob");ve(this,"bufferedAmount",0);ve(this,"extensions","");ve(this,"protocol","");ve(this,"url","");ve(this,"onclose",null);ve(this,"onerror",null);ve(this,"onmessage",null);ve(this,"onopen",null);ve(this,"openSubscriptions",new Set);ve(this,"closeSubscriptions",new Set);ve(this,"messageSubscriptions",new Set);ve(this,"errorSubscriptions",new Set);ve(this,"readyState",WebSocket.OPEN);ve(this,"retryCount",0);ve(this,"shouldReconnect",!1);this.bridge=t}consumeMessages(){this.bridge.consumeMessages(t=>{this.messageSubscriptions.forEach(n=>{n({data:t})})})}addEventListener(t,n,r){switch(t){case"open":this.openSubscriptions.add(n),n();break;case"close":this.closeSubscriptions.add(n);break;case"message":this.messageSubscriptions.add(n),this.consumeMessages();break;case"error":this.errorSubscriptions.add(n);break}}removeEventListener(t,n,r){switch(t){case"open":this.openSubscriptions.delete(n);break;case"close":this.closeSubscriptions.delete(n);break;case"message":this.messageSubscriptions.delete(n);break;case"error":this.errorSubscriptions.delete(n);break}}dispatchEvent(t){throw new Error("Method not implemented.")}reconnect(t,n){throw new Error("Method not implemented.")}send(t){throw new Error("Method not implemented.")}close(){}}function Fwt(){return bi(window.__MARIMO_STATIC__!==void 0,"Not a static notebook"),window.__MARIMO_STATIC__.notebookState}function Jh(){return(window==null?void 0:window.__MARIMO_STATIC__)!==void 0}function zwt(){return bi(window.__MARIMO_STATIC__!==void 0,"Not a static notebook"),window.__MARIMO_STATIC__.assetUrl}function Y5e(){return bi(window.__MARIMO_STATIC__!==void 0,"Not a static notebook"),window.__MARIMO_STATIC__.files}function Qwt(){return{sendComponentValues:e=>{const t=[],n=[];for(const r of e)t.push(r.objectId),n.push(r.value);return Nr.post("/kernel/set_ui_element_value",{objectIds:t,values:n})},sendRestart:()=>Nr.post("/kernel/restart_session",{}),sendRename:e=>Nr.post("/kernel/rename",{filename:e}),sendSave:e=>(bi(e.cellIds.length===e.codes.length,"cell ids and codes must be the same length"),bi(e.codes.length===e.names.length,"cell ids and names must be the same length"),bi(e.codes.length===e.configs.length,"cell ids and configs must be the same length"),Nr.post("/kernel/save",e)),sendFormat:e=>Nr.post("/kernel/format",e).then(t=>t.codes),sendInterrupt:()=>Nr.post("/kernel/interrupt",{}),sendShutdown:()=>Nr.post("/kernel/shutdown",{}),sendRun:(e,t)=>(bi(e.length===t.length,"must be the same length"),Nr.post("/kernel/run",{cellIds:e,codes:t})),sendInstantiate:e=>(bi(e.objectIds.length===e.values.length,"must be the same length"),Nr.post("/kernel/instantiate",e)),sendDeleteCell:e=>Nr.post("/kernel/delete",{cellId:e}),sendCodeCompletionRequest:e=>Nr.post("/kernel/code_autocomplete",e),saveUserConfig:e=>Nr.post("/kernel/save_user_config",e),saveAppConfig:e=>Nr.post("/kernel/save_app_config",e),saveCellConfig:e=>Nr.post("/kernel/set_cell_config",e),sendFunctionRequest:e=>Nr.post("/kernel/function_call",e),sendStdin:e=>Nr.post("/kernel/stdin",e),sendInstallMissingPackages:e=>Nr.post("/kernel/install_missing_packages",e),readCode:()=>Nr.post("/kernel/read_code",{}),openFile:async e=>(await Nr.post("/kernel/open",e),await G5e(),window.location.reload(),null),sendListFiles:e=>Nr.post("/files/list_files",e),sendCreateFileOrFolder:e=>Nr.post("/files/create",e),sendDeleteFileOrFolder:e=>Nr.post("/files/delete",e),sendRenameFileOrFolder:e=>Nr.post("/files/move",e),sendUpdateFile:e=>Nr.post("/files/update",e),sendFileDetails:e=>Nr.post("/files/file_details",e)}}const Bwt=1,Wwt=1e4;let VW=0;function qwt(){return VW=(VW+1)%Number.MAX_VALUE,VW.toString()}const UW=new Map,xve=e=>{if(UW.has(e))return;const t=setTimeout(()=>{UW.delete(e),_T({type:"REMOVE_TOAST",toastId:e})},Wwt);UW.set(e,t)},Vwt=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Bwt)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?xve(n):e.toasts.forEach(r=>{xve(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},HZ=new Set;let $5={toasts:[]};function _T(e){$5=Vwt($5,e),HZ.forEach(t=>{t($5)})}function yr({...e}){const t=qwt(),n=i=>_T({type:"UPDATE_TOAST",toast:{...i,id:t}}),r=()=>_T({type:"DISMISS_TOAST",toastId:t});return _T({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function Uwt(){const[e,t]=x.useState($5);return x.useEffect(()=>(HZ.add(t),()=>{HZ.delete(t)}),[e]),{...e,dismiss:n=>_T({type:"DISMISS_TOAST",toastId:n})}}function Hwt(){const e=()=>{throw new Error("Unreachable. Expected to be in run mode")};return{sendComponentValues:async t=>(yr({title:"Static notebook",description:"This notebook is not connected to a kernel. Any interactive elements will not work."}),At.log("Updating UI elements is not supported in static mode"),null),sendInstantiate:async t=>(At.log("Viewing as static notebook"),null),sendFunctionRequest:async t=>(yr({title:"Static notebook",description:"This notebook is not connected to a kernel. Any interactive elements will not work."}),At.log("Function requests are not supported in static mode"),null),sendRestart:e,sendRun:e,sendRename:e,sendSave:e,sendInterrupt:e,sendShutdown:e,sendFormat:e,sendDeleteCell:e,sendCodeCompletionRequest:e,saveUserConfig:e,saveAppConfig:e,saveCellConfig:e,sendStdin:e,readCode:e,openFile:e,sendListFiles:e,sendCreateFileOrFolder:e,sendDeleteFileOrFolder:e,sendRenameFileOrFolder:e,sendUpdateFile:e,sendFileDetails:e,sendInstallMissingPackages:e}}function _R(e){if(!e)return"Unknown error";if(e instanceof Error)return Xwt(e.message);try{return JSON.stringify(e)}catch{return String(e)}}function Xwt(e){try{const t=JSON.parse(e);if(!t)return e;if(typeof t=="object"&&"detail"in t&&typeof t.detail=="string")return t.detail}catch{}return e}function Zwt(e){const t={sendComponentValues:"Failed update value",sendInstantiate:"Failed to instantiate",sendFunctionRequest:"Failed to send function request",sendRestart:"Failed to restart",sendRun:"Failed to run",sendRename:"Failed to rename",sendSave:"Failed to save",sendInterrupt:"Failed to interrupt",sendShutdown:"Failed to shutdown",sendFormat:"Failed to format",sendDeleteCell:"Failed to delete cell",sendCodeCompletionRequest:"Failed to complete code",saveUserConfig:"Failed to save user config",saveAppConfig:"Failed to save app config",saveCellConfig:"Failed to save cell config",sendStdin:"Failed to send stdin",readCode:"Failed to read code",openFile:"Failed to open file",sendListFiles:"Failed to list files",sendCreateFileOrFolder:"Failed to create file or folder",sendDeleteFileOrFolder:"Failed to delete file or folder",sendRenameFileOrFolder:"Failed to rename file or folder",sendUpdateFile:"Failed to update file",sendFileDetails:"Failed to get file details",sendInstallMissingPackages:"Failed to install missing packages"},n={};for(const[r,i]of Object.entries(e)){const o=r;n[o]=async(...s)=>{try{return await i(...s)}catch(a){const l=_R(a);throw yr({title:t[o],description:l,variant:"danger"}),At.error(`Failed to handle request: ${r}`,a),a}}}return n}function Ywt(){const e=yp()?rP.INSTANCE:Jh()?Hwt():Qwt();return Zwt(e)}const{sendComponentValues:Gwt,sendRename:Kwt,sendRestart:G5e,sendSave:Jwt,sendStdin:eSt,sendFormat:tSt,sendInterrupt:XZ,sendShutdown:nSt,sendRun:K5e,sendInstantiate:rSt,sendDeleteCell:J5e,sendCodeCompletionRequest:iSt,saveUserConfig:noe,saveAppConfig:eLe,saveCellConfig:Mb,sendFunctionRequest:oSt,sendInstallMissingPackages:sSt,readCode:T5,openFile:aSt,sendListFiles:tLe,sendCreateFileOrFolder:nLe,sendDeleteFileOrFolder:lSt,sendRenameFileOrFolder:cSt,sendUpdateFile:uSt,sendFileDetails:fSt}=Ywt(),y2=class y2{constructor(t,n){ve(this,"runningCount");ve(this,"componentsToUpdate");ve(this,"handleReadyEvent",t=>{const n=t.detail.objectId;this.uiElementRegistry.has(n)&&(this.componentsToUpdate.add(n),this.running()||this.flushUpdates())});this.uiElementRegistry=t,this.opts=n,this.runningCount=0,this.componentsToUpdate=new Set,Gre(y2.INSTANCE,"RuntimeState")}start(){document.addEventListener(PZ,this.handleReadyEvent)}stop(){document.removeEventListener(PZ,this.handleReadyEvent)}registerRunStart(){this.runningCount+=1}registerRunEnd(){this.runningCount=Math.max(this.runningCount-1,0)}running(){return this.runningCount>0&&!Jh()}flushUpdates(){if(this.componentsToUpdate.size>0){this.registerRunStart();const t=new Set(this.componentsToUpdate);this.opts.sendComponentValues(Array.from(this.componentsToUpdate.values(),n=>({objectId:n,value:this.uiElementRegistry.lookupValue(n)})).filter(n=>n.value!==void 0)).catch(()=>{this.registerRunEnd(),t.forEach(n=>this.componentsToUpdate.add(n))}),this.componentsToUpdate.clear()}}};ve(y2,"INSTANCE",new y2(ef,{sendComponentValues:Gwt}));let Sa=y2;const dSt={create(){return J6()}};class rLe{constructor(t,n,r={}){ve(this,"requests",new Map);this.operation=t,this.makeRequest=n,this.opts=r}async request(t){if(this.opts.resolveExistingRequests){const i=this.opts.resolveExistingRequests();this.requests.forEach(o=>o.resolve(i)),this.requests.clear()}const n=dSt.create(),r=new H5e;return this.requests.set(n,r),await this.makeRequest(n,t).catch(i=>{r.reject(i),this.requests.delete(n)}),r.promise}resolve(t,n){const r=this.requests.get(t);r!==void 0&&(r.resolve(n),this.requests.delete(t))}reject(t,n){const r=this.requests.get(t);r!==void 0&&(r.reject(n),this.requests.delete(t))}}const iLe=new rLe("function-call-result",async(e,t)=>{Sa.INSTANCE.registerRunStart(),await oSt({functionCallId:e,...t}).catch(n=>{throw Sa.INSTANCE.registerRunEnd(),n})}),hSt=typeof window<"u"?ie.useInsertionEffect||ie.useLayoutEffect:()=>{};function Jn(e){const t=ie.useRef(pSt);hSt(()=>{t.current=e},[e]);const n=ie.useRef(null);return n.current||(n.current=function(){return t.current.apply(this,arguments)}),n.current}function pSt(){throw new Error("INVALID_USEEVENT_INVOCATION: the callback from useEvent cannot be invoked before the component has mounted.")}const Yc={NOOP:()=>{},ASYNC_NOOP:async()=>{},THROW:()=>{throw new Error("Should not be called")},asUpdater:e=>typeof e=="function"?e:()=>e};function gSt({hostElement:e,plugin:t,children:n,getInitialValue:r},i){const[o,s]=x.useState(n),[a,l]=x.useState(r()),{theme:c}=mp(),[u,f]=x.useState(()=>t.validator.safeParse(MW(e)));x.useImperativeHandle(i,()=>({reset:()=>{l(r()),f(t.validator.safeParse(MW(e)))},setChildren:p=>{s(p)}})),x.useEffect(()=>{const p=v=>{v.detail.element===e&&l(v.detail.value)},g=new MutationObserver(v=>{v.some(O=>{var m;return O.type==="attributes"&&((m=O.attributeName)==null?void 0:m.startsWith("data-"))})&&f(t.validator.safeParse(MW(e)))});return e.addEventListener(TZ,p),g.observe(e,{attributes:!0}),()=>{e.removeEventListener(TZ,p),g.disconnect()}},[e,t.validator]);const d=Jn(p=>{l(g=>{const y=Yc.asUpdater(p)(g);return e.dispatchEvent(LNe(y,e)),y})}),h=x.useMemo(()=>{if(!t.functions)return{};const p={};for(const[g,v]of pn.entries(t.functions)){const{input:y,output:O}=v;p[g]=async(...m)=>{bi(m.length<=1,`Plugin functions only supports a single argument. Called ${g}`);const w=roe(e);bi(w,"Object ID should exist");const S=await iLe.request({args:y.parse(m[0]),functionName:g,namespace:w});if(S.status.code!=="ok")throw At.error(S.status),new Error(S.status.message);return O.parse(S.return_value)}}return p},[t.functions,e]);return u.success?b.jsx("div",{className:`contents ${c}`,children:b.jsx(x.Suspense,{fallback:b.jsx("div",{}),children:t.render({setValue:d,value:a,data:u.data,children:o,host:e,functions:h})})}):Owt(u.error,pn.mapValues(e.dataset,p=>typeof p=="string"?i6(p):p),e.shadowRoot)}const mSt=ie.forwardRef(gSt),HW=new Map,oLe="__custom_marimo_element__";function wve(e){const t=class extends HTMLElement{constructor(){super();ve(this,"observer");ve(this,"root");ve(this,"mounted",!1);ve(this,"pluginRef",x.createRef());ve(this,"__type__",oLe);this.attachShadow({mode:"open"}),this.copyStyles(),this.observer=new MutationObserver(()=>{var r;(r=this.pluginRef.current)==null||r.setChildren(this.getChildren())})}connectedCallback(){this.mounted||(bi(this.shadowRoot,"Shadow root should exist"),this.root&&this.root.unmount(),this.root=BL.createRoot(this.shadowRoot),this.mountReactComponent()),this.observer.observe(this,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}disconnectedCallback(){var r;this.observer.disconnect(),(r=this.root)==null||r.unmount(),this.mounted&&(this.mounted=!1)}reset(){this.dispatchEvent(LNe(i6(this.dataset.initialValue),this)),this.rerender()}rerender(){var r;(r=this.pluginRef.current)==null||r.reset()}getChildren(){return Da({html:this.innerHTML})}async mountReactComponent(){this.mounted=!0,bi(this.root,"Root must be defined"),this.root.render(b.jsx(mSt,{hostElement:this,plugin:e,ref:this.pluginRef,getInitialValue:()=>QNe(this),children:this.getChildren()}))}async copyStyles(){const r=this.shadowRoot;if(bi(r,"Shadow root should exist"),!this.isAdoptedStyleSheetsSupported()){this.copyStylesFallback();return}const i=Array.from(document.styleSheets).filter(o=>o.ownerNode instanceof HTMLElement&&o.ownerNode.dataset.viteDevId?!0:Sve(o));for(const o of i){const s=o.href??(o.ownerNode instanceof HTMLElement?o.ownerNode.dataset.viteDevId:void 0);if(s&&!HW.has(s)){const a=new CSSStyleSheet;a.replaceSync(Array.from(o.cssRules).map(l=>l.cssText.includes("@import")?"":l.cssText).join(`
`)),HW.set(s,a)}}if(r.adoptedStyleSheets=[...HW.values()],e.cssStyles){const o=document.createElement("style");o.textContent=e.cssStyles.join(`
`),r.append(o)}}copyStylesFallback(){const r=this.shadowRoot;bi(r,"Shadow root should exist"),At.warn("adoptedStyleSheets not supported, copying stylesheets in a less performance way. Please consider upgrading your browser.");const i=Array.from(document.styleSheets).flatMap(o=>{if(!Sve(o))return[];const s=document.createElement("style");return s.textContent=Array.from(o.cssRules).map(a=>a.cssText).join(`
`),[s]});r.append(...i)}isAdoptedStyleSheetsSupported(){return"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype}};jNe(e.tagName,t)}function Sve(e){return e.href?Jh()?e.href.startsWith(zwt()):e.href.includes("@marimo-team/frontend")?!0:e.href.startsWith(window.location.origin):!1}function Eve(e){return!e||!(e instanceof HTMLElement)?!1:"__type__"in e&&e.__type__===oLe}const jj="MARIMO-UI-ELEMENT";function ySt(){class e extends HTMLElement{constructor(){super(...arguments);ve(this,"initialized",!1);ve(this,"inputListener",Yc.NOOP)}init(){if(this.initialized)return;const r=rb.parseOrThrow(this);this.inputListener=o=>{r!==null&&o.detail.element===this.firstElementChild&&ef.broadcastValueUpdate(i,r,o.detail.value)};const i=this.firstElementChild;if(r===null){At.error("[marimo-ui-element] missing object-id attribute");return}else if(i===null){At.error("[marimo-ui-element] has no child");return}else if(!(i instanceof HTMLElement)){At.error("[marimo-ui-element] first child must be instance of HTMLElement");return}this.initialized=!0}connectedCallback(){if(this.init(),this.initialized){const r=rb.parseOrThrow(this),i=this.firstElementChild;ef.registerInstance(r,i),document.addEventListener(Rb,this.inputListener)}}disconnectedCallback(){if(this.initialized){document.removeEventListener(Rb,this.inputListener);const r=rb.parseOrThrow(this);ef.removeInstance(r,this.firstElementChild)}}reset(){const r=this.firstElementChild;Eve(r)?r.reset():At.error("[marimo-ui-element] first child must have a reset method")}static get observedAttributes(){return["random-id"]}attributeChangedCallback(r,i,o){if(this.initialized&&r==="random-id"&&i!==o){this.disconnectedCallback();const a=this.firstElementChild;Eve(a)?a.rerender():At.error("[marimo-ui-element] first child must have a rerender method"),this.initialized=!1,this.connectedCallback()}}}jNe(jj.toLowerCase(),e)}function roe(e){if(!e)return null;if(e.nodeName===jj)return rb.parseOrThrow(e);const t=e.parentElement;return(t==null?void 0:t.nodeName)===jj?rb.parseOrThrow(t):null}function vSt(e){return e.tagName===jj}const sLe=Y.enum(["neutral","success","warn","danger","info","alert"]).default("neutral");function bSt(e,t=globalThis==null?void 0:globalThis.document){const n=Xs(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const ZZ="dismissableLayer.update",OSt="dismissableLayer.pointerDownOutside",xSt="dismissableLayer.focusOutside";let Cve;const aLe=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qC=x.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=x.useContext(aLe),[f,d]=x.useState(null),h=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,p]=x.useState({}),g=Yt(t,k=>d(k)),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),O=v.indexOf(y),m=f?v.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=m>=O,E=SSt(k=>{const P=k.target,D=[...u.branches].some(M=>M.contains(P));!S||D||(o==null||o(k),a==null||a(k),k.defaultPrevented||l==null||l())},h),C=ESt(k=>{const P=k.target;[...u.branches].some(M=>M.contains(P))||(s==null||s(k),a==null||a(k),k.defaultPrevented||l==null||l())},h);return bSt(k=>{m===u.layers.size-1&&(i==null||i(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},h),x.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Cve=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),_ve(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Cve)}},[f,h,r,u]),x.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),_ve())},[f,u]),x.useEffect(()=>{const k=()=>p({});return document.addEventListener(ZZ,k),()=>document.removeEventListener(ZZ,k)},[]),x.createElement(Ot.div,oe({},c,{ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Xe(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Xe(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Xe(e.onPointerDownCapture,E.onPointerDownCapture)}))}),wSt=x.forwardRef((e,t)=>{const n=x.useContext(aLe),r=x.useRef(null),i=Yt(t,r);return x.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),x.createElement(Ot.div,oe({},e,{ref:i}))});function SSt(e,t=globalThis==null?void 0:globalThis.document){const n=Xs(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){lLe(OSt,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function ESt(e,t=globalThis==null?void 0:globalThis.document){const n=Xs(e),r=x.useRef(!1);return x.useEffect(()=>{const i=o=>{o.target&&!r.current&&lLe(xSt,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _ve(){const e=new CustomEvent(ZZ);document.dispatchEvent(e)}function lLe(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Kre(i,o):i.dispatchEvent(o)}const CSt=qC,_St=wSt;function kR(e){const[t,n]=x.useState(void 0);return Qa(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const cLe="Popper",[uLe,vv]=uo(cLe),[kSt,fLe]=uLe(cLe),$St=e=>{const{__scopePopper:t,children:n}=e,[r,i]=x.useState(null);return x.createElement(kSt,{scope:t,anchor:r,onAnchorChange:i},n)},TSt="PopperAnchor",PSt=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=fLe(TSt,n),s=x.useRef(null),a=Yt(t,s);return x.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:x.createElement(Ot.div,oe({},i,{ref:a}))}),dLe="PopperContent",[ASt,dGn]=uLe(dLe),RSt=x.forwardRef((e,t)=>{var n,r,i,o,s,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:y=[],collisionPadding:O=0,sticky:m="partial",hideWhenDetached:w=!1,updatePositionStrategy:S="optimized",onPlaced:E,...C}=e,k=fLe(dLe,u),[P,D]=x.useState(null),M=Yt(t,ke=>D(ke)),[L,A]=x.useState(null),T=kR(L),N=(n=T==null?void 0:T.width)!==null&&n!==void 0?n:0,j=(r=T==null?void 0:T.height)!==null&&r!==void 0?r:0,z=f+(h!=="center"?"-"+h:""),W=typeof O=="number"?O:{top:0,right:0,bottom:0,left:0,...O},F=Array.isArray(y)?y:[y],q=F.length>0,U={padding:W,boundary:F.filter(DSt),altBoundary:q},{refs:V,floatingStyles:H,placement:Z,isPositioned:ee,middlewareData:se}=nbt({strategy:"fixed",placement:z,whileElementsMounted:(...ke)=>X1t(...ke,{animationFrame:S==="always"}),elements:{reference:k.anchor},middleware:[_1t({mainAxis:d+j,alignmentAxis:p}),v&&Z1t({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?J1t():void 0,...U}),v&&Y1t({...U}),G1t({...U,apply:({elements:ke,rects:je,availableWidth:nt,availableHeight:Re})=>{const{width:G,height:le}=je.reference,Oe=ke.floating.style;Oe.setProperty("--radix-popper-available-width",`${nt}px`),Oe.setProperty("--radix-popper-available-height",`${Re}px`),Oe.setProperty("--radix-popper-anchor-width",`${G}px`),Oe.setProperty("--radix-popper-anchor-height",`${le}px`)}}),L&&tbt({element:L,padding:g}),MSt({arrowWidth:N,arrowHeight:j}),w&&K1t({strategy:"referenceHidden",...U})]}),[fe,ce]=hLe(Z),ae=Xs(E);Qa(()=>{ee&&(ae==null||ae())},[ee,ae]);const de=(i=se.arrow)===null||i===void 0?void 0:i.x,me=(o=se.arrow)===null||o===void 0?void 0:o.y,te=((s=se.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Ee,we]=x.useState();return Qa(()=>{P&&we(window.getComputedStyle(P).zIndex)},[P]),x.createElement("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:ee?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ee,"--radix-popper-transform-origin":[(a=se.transformOrigin)===null||a===void 0?void 0:a.x,(l=se.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},x.createElement(ASt,{scope:u,placedSide:fe,onArrowChange:A,arrowX:de,arrowY:me,shouldHideArrow:te},x.createElement(Ot.div,oe({"data-side":fe,"data-align":ce},C,{ref:M,style:{...C.style,animation:ee?void 0:"none",opacity:(c=se.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function DSt(e){return e!==null}const MSt=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,d=f?0:e.arrowWidth,h=f?0:e.arrowHeight,[p,g]=hLe(a),v={start:"0%",center:"50%",end:"100%"}[g],y=((r=(i=c.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+d/2,O=((o=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:0)+h/2;let m="",w="";return p==="bottom"?(m=f?v:`${y}px`,w=`${-h}px`):p==="top"?(m=f?v:`${y}px`,w=`${l.floating.height+h}px`):p==="right"?(m=`${-h}px`,w=f?v:`${O}px`):p==="left"&&(m=`${l.floating.width+h}px`,w=f?v:`${O}px`),{data:{x:m,y:w}}}});function hLe(e){const[t,n="center"]=e.split("-");return[t,n]}const $R=$St,ez=PSt,tz=RSt,VC=x.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?HMe.createPortal(x.createElement(Ot.div,oe({},i,{ref:t})),r):null}),nz=x.forwardRef((e,t)=>x.createElement(Ot.span,oe({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),NSt=nz,[rz,hGn]=uo("Tooltip",[vv]),ioe=vv(),ISt="TooltipProvider",LSt=700,YZ="tooltip.open",[jSt,ooe]=rz(ISt),FSt=e=>{const{__scopeTooltip:t,delayDuration:n=LSt,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[s,a]=x.useState(!0),l=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),x.createElement(jSt,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(u=>{l.current=u},[]),disableHoverableContent:i},o)},soe="Tooltip",[zSt,TR]=rz(soe),QSt=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:s,delayDuration:a}=e,l=ooe(soe,e.__scopeTooltip),c=ioe(t),[u,f]=x.useState(null),d=Ra(),h=x.useRef(0),p=s??l.disableHoverableContent,g=a??l.delayDuration,v=x.useRef(!1),[y=!1,O]=ko({prop:r,defaultProp:i,onChange:C=>{C?(l.onOpen(),document.dispatchEvent(new CustomEvent(YZ))):l.onClose(),o==null||o(C)}}),m=x.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),w=x.useCallback(()=>{window.clearTimeout(h.current),v.current=!1,O(!0)},[O]),S=x.useCallback(()=>{window.clearTimeout(h.current),O(!1)},[O]),E=x.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,O(!0)},g)},[g,O]);return x.useEffect(()=>()=>window.clearTimeout(h.current),[]),x.createElement($R,c,x.createElement(zSt,{scope:t,contentId:d,open:y,stateAttribute:m,trigger:u,onTriggerChange:f,onTriggerEnter:x.useCallback(()=>{l.isOpenDelayed?E():w()},[l.isOpenDelayed,E,w]),onTriggerLeave:x.useCallback(()=>{p?S():window.clearTimeout(h.current)},[S,p]),onOpen:w,onClose:S,disableHoverableContent:p},n))},kve="TooltipTrigger",BSt=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=TR(kve,n),o=ooe(kve,n),s=ioe(n),a=x.useRef(null),l=Yt(t,a,i.onTriggerChange),c=x.useRef(!1),u=x.useRef(!1),f=x.useCallback(()=>c.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),x.createElement(ez,oe({asChild:!0},s),x.createElement(Ot.button,oe({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:Xe(e.onPointerMove,d=>{d.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Xe(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Xe(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Xe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Xe(e.onBlur,i.onClose),onClick:Xe(e.onClick,i.onClose)})))}),pLe="TooltipPortal",[WSt,qSt]=rz(pLe,{forceMount:void 0}),gLe=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=TR(pLe,t);return x.createElement(WSt,{scope:t,forceMount:n},x.createElement(Gs,{present:n||o.open},x.createElement(VC,{asChild:!0,container:i},r)))},iP="TooltipContent",VSt=x.forwardRef((e,t)=>{const n=qSt(iP,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=TR(iP,e.__scopeTooltip);return x.createElement(Gs,{present:r||s.open},s.disableHoverableContent?x.createElement(mLe,oe({side:i},o,{ref:t})):x.createElement(USt,oe({side:i},o,{ref:t})))}),USt=x.forwardRef((e,t)=>{const n=TR(iP,e.__scopeTooltip),r=ooe(iP,e.__scopeTooltip),i=x.useRef(null),o=Yt(t,i),[s,a]=x.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:f}=r,d=x.useCallback(()=>{a(null),f(!1)},[f]),h=x.useCallback((p,g)=>{const v=p.currentTarget,y={x:p.clientX,y:p.clientY},O=XSt(y,v.getBoundingClientRect()),m=ZSt(y,O),w=YSt(g.getBoundingClientRect()),S=KSt([...m,...w]);a(S),f(!0)},[f]);return x.useEffect(()=>()=>d(),[d]),x.useEffect(()=>{if(l&&u){const p=v=>h(v,u),g=v=>h(v,l);return l.addEventListener("pointerleave",p),u.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",p),u.removeEventListener("pointerleave",g)}}},[l,u,h,d]),x.useEffect(()=>{if(s){const p=g=>{const v=g.target,y={x:g.clientX,y:g.clientY},O=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),m=!GSt(y,s);O?d():m&&(d(),c())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,u,s,c,d]),x.createElement(mLe,oe({},e,{ref:o}))}),[HSt,pGn]=rz(soe,{isInside:!1}),mLe=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=e,l=TR(iP,n),c=ioe(n),{onClose:u}=l;return x.useEffect(()=>(document.addEventListener(YZ,u),()=>document.removeEventListener(YZ,u)),[u]),x.useEffect(()=>{if(l.trigger){const f=d=>{const h=d.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),x.createElement(qC,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u},x.createElement(tz,oe({"data-state":l.stateAttribute},c,a,{ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),x.createElement(Bre,null,r),x.createElement(HSt,{scope:n,isInside:!0},x.createElement(NSt,{id:l.contentId,role:"tooltip"},i||r))))});function XSt(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function ZSt(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function YSt(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function GSt(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(i=!i)}return i}function KSt(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),JSt(t)}function JSt(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],s=n[n.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const eEt=FSt,tEt=QSt,nEt=BSt,yLe=VSt,UC=eEt,aoe=tEt,loe=nEt,oP=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>b.jsx(yLe,{ref:r,sideOffset:t,className:be("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-xs data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",e),...n}));oP.displayName=yLe.displayName;const Wt=({content:e,children:t,usePortal:n=!0,asChild:r=!0,tabIndex:i,side:o,...s})=>b.jsxs(aoe,{disableHoverableContent:!0,...s,children:[b.jsx(loe,{asChild:r,tabIndex:i,children:t}),n?b.jsx(gLe,{children:b.jsx(oP,{side:o,children:e})}):b.jsx(oP,{side:o,children:e})]});class rEt{constructor(){ve(this,"tagName","marimo-button");ve(this,"validator",Y.object({label:Y.string(),kind:sLe,disabled:Y.boolean().default(!1),fullWidth:Y.boolean().default(!1),tooltip:Y.string().optional()}))}render(t){const{data:{disabled:n,kind:r,label:i,fullWidth:o,tooltip:s}}=t,a=b.jsx(St,{"data-testid":"marimo-plugin-button",variant:iEt(r),disabled:n,size:"xs",className:be({"w-full":o}),onClick:()=>{n||t.setValue(l=>l+1)},type:"submit",children:Da({html:i})});return s?b.jsx(UC,{children:b.jsx(Wt,{content:s,children:a})}):a}}function iEt(e){switch(e){case"neutral":return"secondary";case"danger":return"destructive";case"warn":return"warn";case"success":return"success"}}function PR(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const vLe="Checkbox",[oEt,gGn]=uo(vLe),[sEt,aEt]=oEt(vLe),lEt=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,d]=x.useState(null),h=Yt(t,m=>d(m)),p=x.useRef(!1),g=f?!!f.closest("form"):!0,[v=!1,y]=ko({prop:i,defaultProp:o,onChange:c}),O=x.useRef(v);return x.useEffect(()=>{const m=f==null?void 0:f.form;if(m){const w=()=>y(O.current);return m.addEventListener("reset",w),()=>m.removeEventListener("reset",w)}},[f,y]),x.createElement(sEt,{scope:n,state:v,disabled:a},x.createElement(Ot.button,oe({type:"button",role:"checkbox","aria-checked":ib(v)?"mixed":v,"aria-required":s,"data-state":bLe(v),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:h,onKeyDown:Xe(e.onKeyDown,m=>{m.key==="Enter"&&m.preventDefault()}),onClick:Xe(e.onClick,m=>{y(w=>ib(w)?!0:!w),g&&(p.current=m.isPropagationStopped(),p.current||m.stopPropagation())})})),g&&x.createElement(fEt,{control:f,bubbles:!p.current,name:r,value:l,checked:v,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),cEt="CheckboxIndicator",uEt=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=aEt(cEt,n);return x.createElement(Gs,{present:r||ib(o.state)||o.state===!0},x.createElement(Ot.span,oe({"data-state":bLe(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))}),fEt=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=x.useRef(null),s=PR(n),a=kR(t);return x.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const d=new Event("click",{bubbles:r});l.indeterminate=ib(n),f.call(l,ib(n)?!1:n),l.dispatchEvent(d)}},[s,n,r]),x.createElement("input",oe({type:"checkbox","aria-hidden":!0,defaultChecked:ib(n)?!1:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ib(e){return e==="indeterminate"}function bLe(e){return ib(e)?"indeterminate":e?"checked":"unchecked"}const OLe=lEt,dEt=uEt;/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var hEt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pEt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Qe=(e,t)=>{const n=x.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:o=2,absoluteStrokeWidth:s,className:a="",children:l,...c},u)=>x.createElement("svg",{ref:u,...hEt,width:i,height:i,stroke:r,strokeWidth:s?Number(o)*24/Number(i):o,className:["lucide",`lucide-${pEt(e)}`,a].join(" "),...c},[...t.map(([f,d])=>x.createElement(f,d)),...Array.isArray(l)?l:[l]]));return n.displayName=`${e}`,n};/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xLe=Qe("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wLe=Qe("AlignEndVertical",[["rect",{width:"16",height:"6",x:"2",y:"4",rx:"2",key:"10wcwx"}],["rect",{width:"9",height:"6",x:"9",y:"14",rx:"2",key:"4p5bwg"}],["path",{d:"M22 22V2",key:"12ipfv"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gEt=Qe("AlignHorizontalSpaceAround",[["rect",{width:"6",height:"10",x:"9",y:"7",rx:"2",key:"yn7j0q"}],["path",{d:"M4 22V2",key:"tsjzd3"}],["path",{d:"M20 22V2",key:"1bnhr8"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SLe=Qe("AlignStartVertical",[["rect",{width:"9",height:"6",x:"6",y:"14",rx:"2",key:"lpm2y7"}],["rect",{width:"16",height:"6",x:"6",y:"4",rx:"2",key:"rdj6ps"}],["path",{d:"M2 2v20",key:"1ivd8o"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mEt=Qe("ArrowDown01",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["rect",{x:"15",y:"4",width:"4",height:"6",ry:"2",key:"1bwicg"}],["path",{d:"M17 20v-6h-2",key:"1qp1so"}],["path",{d:"M15 20h4",key:"1j968p"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yEt=Qe("ArrowDown10",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M17 10V4h-2",key:"zcsr5x"}],["path",{d:"M15 10h4",key:"id2lce"}],["rect",{x:"15",y:"14",width:"4",height:"6",ry:"2",key:"33xykx"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vEt=Qe("ArrowDownNarrowWide",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h4",key:"6d7r33"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h10",key:"1438ji"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bEt=Qe("ArrowDownWideNarrow",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ELe=Qe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OEt=Qe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xEt=Qe("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wEt=Qe("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VM=Qe("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SEt=Qe("BarChartBig",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["rect",{width:"4",height:"7",x:"7",y:"10",rx:"1",key:"14u6mf"}],["rect",{width:"4",height:"12",x:"15",y:"5",rx:"1",key:"b3pek6"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EEt=Qe("Binary",[["rect",{x:"14",y:"14",width:"4",height:"6",rx:"2",key:"p02svl"}],["rect",{x:"6",y:"4",width:"4",height:"6",rx:"2",key:"xm4xkj"}],["path",{d:"M6 20h4",key:"1i6q5t"}],["path",{d:"M14 10h4",key:"ru81e7"}],["path",{d:"M6 14h2v6",key:"16z9wg"}],["path",{d:"M14 4h2v6",key:"1idq9u"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const coe=Qe("BookMarked",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["polyline",{points:"10 2 10 10 13 7 16 10 16 2",key:"13o6vz"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CLe=Qe("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CEt=Qe("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _Le=Qe("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kLe=Qe("CaseSensitive",[["path",{d:"m3 15 4-8 4 8",key:"1vwr6u"}],["path",{d:"M4 13h6",key:"1r9ots"}],["circle",{cx:"18",cy:"12",r:"3",key:"1kchzo"}],["path",{d:"M21 9v6",key:"anns31"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dm=Qe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const P0=Qe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _Et=Qe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uoe=Qe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GZ=Qe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kEt=Qe("ChevronsDownUp",[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $Et=Qe("ChevronsDown",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TEt=Qe("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PEt=Qe("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KZ=Qe("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AEt=Qe("ChevronsUp",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fj=Qe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const REt=Qe("ClipboardCopy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DEt=Qe("ClipboardPaste",[["path",{d:"M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z",key:"1pp7kr"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10",key:"2ik1ml"}],["path",{d:"m17 10 4 4-4 4",key:"vp2hj1"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const foe=Qe("Code2",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MEt=Qe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NEt=Qe("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IEt=Qe("Combine",[["rect",{width:"8",height:"8",x:"2",y:"2",rx:"2",key:"z1hh3n"}],["path",{d:"M14 2c1.1 0 2 .9 2 2v4c0 1.1-.9 2-2 2",key:"83orz6"}],["path",{d:"M20 2c1.1 0 2 .9 2 2v4c0 1.1-.9 2-2 2",key:"k86dmt"}],["path",{d:"M10 18H5c-1.7 0-3-1.3-3-3v-1",key:"6vokjl"}],["polyline",{points:"7 21 10 18 7 15",key:"1k02g0"}],["rect",{width:"8",height:"8",x:"14",y:"14",rx:"2",key:"1fa9i4"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $Le=Qe("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WO=Qe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LEt=Qe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const doe=Qe("DownloadCloud",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M12 12v9",key:"192myk"}],["path",{d:"m8 17 4 4 4-4",key:"1ul180"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iz=Qe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jEt=Qe("EqualSquare",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M7 14h10",key:"1mhdw3"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FEt=Qe("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TLe=Qe("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $ve=Qe("FileCode",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 13-2 2 2 2",key:"17smn8"}],["path",{d:"m14 17 2-2-2-2",key:"14mezr"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zEt=Qe("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hoe=Qe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QEt=Qe("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BEt=Qe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WEt=Qe("FolderDown",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m15 13-3 3-3-3",key:"6j2sf0"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qEt=Qe("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VEt=Qe("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oz=Qe("FunctionSquare",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PLe=Qe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UEt=Qe("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HEt=Qe("GripHorizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XEt=Qe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZEt=Qe("Group",[["path",{d:"M3 7V5c0-1.1.9-2 2-2h2",key:"adw53z"}],["path",{d:"M17 3h2c1.1 0 2 .9 2 2v2",key:"an4l38"}],["path",{d:"M21 17v2c0 1.1-.9 2-2 2h-2",key:"144t0e"}],["path",{d:"M7 21H5c-1.1 0-2-.9-2-2v-2",key:"rtnfgi"}],["rect",{width:"7",height:"5",x:"7",y:"7",rx:"1",key:"1eyiv7"}],["rect",{width:"7",height:"5",x:"10",y:"12",rx:"1",key:"1qlmkx"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YEt=Qe("HardDriveDownload",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GEt=Qe("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KEt=Qe("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sz=Qe("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JEt=Qe("Keyboard",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",ry:"2",key:"15u882"}],["path",{d:"M6 8h.001",key:"1ej0i3"}],["path",{d:"M10 8h.001",key:"1x2st2"}],["path",{d:"M14 8h.001",key:"1vkmyp"}],["path",{d:"M18 8h.001",key:"kfsenl"}],["path",{d:"M8 12h.001",key:"1sjpby"}],["path",{d:"M12 12h.001",key:"al75ts"}],["path",{d:"M16 12h.001",key:"931bgk"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eCt=Qe("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tCt=Qe("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nCt=Qe("ListFilter",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rCt=Qe("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iCt=Qe("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nb=Qe("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ALe=Qe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oCt=Qe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sCt=Qe("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aCt=Qe("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lCt=Qe("MoreVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cCt=Qe("MousePointerSquareDashed",[["path",{d:"M5 3a2 2 0 0 0-2 2",key:"y57alp"}],["path",{d:"M19 3a2 2 0 0 1 2 2",key:"18rm91"}],["path",{d:"m12 12 4 10 1.7-4.3L22 16Z",key:"64ilsv"}],["path",{d:"M5 21a2 2 0 0 1-2-2",key:"sbafld"}],["path",{d:"M9 3h1",key:"1yesri"}],["path",{d:"M9 21h2",key:"1qve2z"}],["path",{d:"M14 3h1",key:"1ec4yj"}],["path",{d:"M3 9v1",key:"1r0deq"}],["path",{d:"M21 9v2",key:"p14lih"}],["path",{d:"M3 14v1",key:"vnatye"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uCt=Qe("MousePointerSquare",[["path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6",key:"14rsvq"}],["path",{d:"m12 12 4 10 1.7-4.3L22 16Z",key:"64ilsv"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fCt=Qe("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dCt=Qe("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RLe=Qe("PackageX",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["path",{d:"m17 13 5 5m-5 0 5-5",key:"im3w4b"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hCt=Qe("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pCt=Qe("PartyPopper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12v0c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"bpx1uq"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11v0c-.11.7-.72 1.22-1.43 1.22H17",key:"1pd0s7"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98v0C9.52 4.9 9 5.52 9 6.23V7",key:"zq5xbz"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gCt=Qe("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mCt=Qe("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yCt=Qe("PlaySquare",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sP=Qe("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tve=Qe("PlusCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const poe=Qe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vCt=Qe("PowerSquare",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 7v5",key:"ma6bk"}],["path",{d:"M8 9a5.14 5.14 0 0 0 4 8 4.95 4.95 0 0 0 4-8",key:"15eubv"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DLe=Qe("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const P5=Qe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bCt=Qe("Regex",[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OCt=Qe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const goe=Qe("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xCt=Qe("Scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MLe=Qe("ScrollText",[["path",{d:"M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4",key:"13a6an"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M15 12h-5",key:"r7krc0"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wCt=Qe("Scroll",[["path",{d:"M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4",key:"13a6an"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SCt=Qe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ECt=Qe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CCt=Qe("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _Ct=Qe("Shuffle",[["path",{d:"M2 18h1.4c1.3 0 2.5-.6 3.3-1.7l6.1-8.6c.7-1.1 2-1.7 3.3-1.7H22",key:"1wmou1"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 6h1.9c1.5 0 2.9.9 3.6 2.2",key:"10bdb2"}],["path",{d:"M22 18h-5.9c-1.3 0-2.6-.7-3.3-1.8l-.5-.8",key:"vgxac0"}],["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NLe=Qe("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ILe=Qe("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z",key:"1lpok0"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const az=Qe("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kCt=Qe("TextCursorInput",[["path",{d:"M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1",key:"18xjzo"}],["path",{d:"M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5",key:"fj48gi"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M9 7v10",key:"1vc8ob"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LLe=Qe("ToggleLeft",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AR=Qe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pve=Qe("Triangle",[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $Ct=Qe("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TCt=Qe("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5v0a5.5 5.5 0 0 1-5.5 5.5H11",key:"llx8ln"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PCt=Qe("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jLe=Qe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ACt=Qe("View",[["path",{d:"M5 12s2.545-5 7-5c4.454 0 7 5 7 5s-2.546 5-7 5c-4.455 0-7-5-7-5z",key:"vptub8"}],["path",{d:"M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2z",key:"10lhjs"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RCt=Qe("WholeWord",[["circle",{cx:"7",cy:"12",r:"3",key:"12clwm"}],["path",{d:"M10 9v6",key:"17i7lo"}],["circle",{cx:"17",cy:"12",r:"3",key:"gl7c2s"}],["path",{d:"M14 7v8",key:"dl84cr"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FLe=Qe("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zLe=Qe("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rc=Qe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QLe=Qe("ZapOff",[["polyline",{points:"12.41 6.75 13 2 10.57 4.92",key:"122m05"}],["polyline",{points:"18.57 12.91 21 10 15.66 10",key:"16r43o"}],["polyline",{points:"8 8 3 14 12 14 11 22 16 16",key:"tmh4bc"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
 * @license lucide-react v0.338.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BLe=Qe("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),kh=x.forwardRef(({className:e,...t},n)=>b.jsx(OLe,{ref:n,className:be("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:b.jsx(dEt,{className:be("flex items-center justify-center text-current max-h-[14px] overflow-hidden"),children:b.jsx(dm,{className:"h-4 w-4"})})}));kh.displayName=OLe.displayName;const DCt=x.forwardRef((e,t)=>x.createElement(Ot.label,oe({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),WLe=DCt,MCt=Ao("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ls=x.forwardRef(({className:e,...t},n)=>b.jsx(WLe,{ref:n,className:be(MCt(),e),...t}));Ls.displayName=WLe.displayName;const fc=({label:e,children:t,align:n="left",className:r,labelClassName:i,fullWidth:o,id:s})=>{if(o&&(n="top"),!e)return n==="top"?t:b.jsx("div",{className:be("inline-flex",r),children:t});const a=b.jsx(Ls,{htmlFor:s,className:be("font-prose",i),children:Da({html:e})});return b.jsxs("div",{className:be("mo-label inline-flex","pt-0 pb-0 pl-0",n==="top"&&"flex-col items-start gap-y-2",n==="left"&&"flex-row items-center gap-x-1.5 pr-2",n==="right"&&"flex-row-reverse items-center gap-x-1.5 pr-2",o&&"block space-y-2",r),children:[a,t]})};class NCt{constructor(){ve(this,"tagName","marimo-checkbox");ve(this,"validator",Y.object({initialValue:Y.boolean(),label:Y.string().nullable()}))}render(t){return b.jsx(ICt,{...t})}}const ICt=({value:e,setValue:t,data:n})=>{const r=o=>{o!=="indeterminate"&&t(o)},i=x.useId();return b.jsx(fc,{label:n.label,align:"right",id:i,children:b.jsx(kh,{"data-testid":"marimo-plugin-checkbox",checked:e,onCheckedChange:r,id:i})})};var qLe=typeof global=="object"&&global&&global.Object===Object&&global,LCt=typeof self=="object"&&self&&self.Object===Object&&self,vp=qLe||LCt||Function("return this")(),ep=vp.Symbol,VLe=Object.prototype,jCt=VLe.hasOwnProperty,FCt=VLe.toString,ck=ep?ep.toStringTag:void 0;function zCt(e){var t=jCt.call(e,ck),n=e[ck];try{e[ck]=void 0;var r=!0}catch{}var i=FCt.call(e);return r&&(t?e[ck]=n:delete e[ck]),i}var QCt=Object.prototype,BCt=QCt.toString;function WCt(e){return BCt.call(e)}var qCt="[object Null]",VCt="[object Undefined]",Ave=ep?ep.toStringTag:void 0;function qO(e){return e==null?e===void 0?VCt:qCt:Ave&&Ave in Object(e)?zCt(e):WCt(e)}function Ib(e){return e!=null&&typeof e=="object"}var UCt="[object Symbol]";function dE(e){return typeof e=="symbol"||Ib(e)&&qO(e)==UCt}function A5(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var xd=Array.isArray,HCt=1/0,Rve=ep?ep.prototype:void 0,Dve=Rve?Rve.toString:void 0;function ULe(e){if(typeof e=="string")return e;if(xd(e))return A5(e,ULe)+"";if(dE(e))return Dve?Dve.call(e):"";var t=e+"";return t=="0"&&1/e==-HCt?"-0":t}var XCt=/\s/;function ZCt(e){for(var t=e.length;t--&&XCt.test(e.charAt(t)););return t}var YCt=/^\s+/;function GCt(e){return e&&e.slice(0,ZCt(e)+1).replace(YCt,"")}function Lb(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Mve=NaN,KCt=/^[-+]0x[0-9a-f]+$/i,JCt=/^0b[01]+$/i,e_t=/^0o[0-7]+$/i,t_t=parseInt;function JZ(e){if(typeof e=="number")return e;if(dE(e))return Mve;if(Lb(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Lb(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=GCt(e);var n=JCt.test(e);return n||e_t.test(e)?t_t(e.slice(2),n?2:8):KCt.test(e)?Mve:+e}var Nve=1/0,n_t=17976931348623157e292;function r_t(e){if(!e)return e===0?e:0;if(e=JZ(e),e===Nve||e===-Nve){var t=e<0?-1:1;return t*n_t}return e===e?e:0}function i_t(e){var t=r_t(e),n=t%1;return t===t?n?t-n:t:0}function lz(e){return e}var o_t="[object AsyncFunction]",s_t="[object Function]",a_t="[object GeneratorFunction]",l_t="[object Proxy]";function HLe(e){if(!Lb(e))return!1;var t=qO(e);return t==s_t||t==a_t||t==o_t||t==l_t}var XW=vp["__core-js_shared__"],Ive=function(){var e=/[^.]+$/.exec(XW&&XW.keys&&XW.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function c_t(e){return!!Ive&&Ive in e}var u_t=Function.prototype,f_t=u_t.toString;function VO(e){if(e!=null){try{return f_t.call(e)}catch{}try{return e+""}catch{}}return""}var d_t=/[\\^$.*+?()[\]{}|]/g,h_t=/^\[object .+?Constructor\]$/,p_t=Function.prototype,g_t=Object.prototype,m_t=p_t.toString,y_t=g_t.hasOwnProperty,v_t=RegExp("^"+m_t.call(y_t).replace(d_t,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function b_t(e){if(!Lb(e)||c_t(e))return!1;var t=HLe(e)?v_t:h_t;return t.test(VO(e))}function O_t(e,t){return e==null?void 0:e[t]}function UO(e,t){var n=O_t(e,t);return b_t(n)?n:void 0}var eY=UO(vp,"WeakMap");function x_t(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function w_t(){}var S_t=800,E_t=16,C_t=Date.now;function __t(e){var t=0,n=0;return function(){var r=C_t(),i=E_t-(r-n);if(n=r,i>0){if(++t>=S_t)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function k_t(e){return function(){return e}}var Lve=function(){try{var e=UO(Object,"defineProperty");return e({},"",{}),e}catch{}}(),$_t=Lve?function(e,t){return Lve(e,"toString",{configurable:!0,enumerable:!1,value:k_t(t),writable:!0})}:lz;const T_t=$_t;var P_t=__t(T_t);function A_t(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function R_t(e){return e!==e}function D_t(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function M_t(e,t,n){return t===t?D_t(e,t,n):A_t(e,R_t,n)}function N_t(e,t){var n=e==null?0:e.length;return!!n&&M_t(e,t,0)>-1}var I_t=9007199254740991,L_t=/^(?:0|[1-9]\d*)$/;function moe(e,t){var n=typeof e;return t=t??I_t,!!t&&(n=="number"||n!="symbol"&&L_t.test(e))&&e>-1&&e%1==0&&e<t}function yoe(e,t){return e===t||e!==e&&t!==t}var jve=Math.max;function j_t(e,t,n){return t=jve(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=jve(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),x_t(e,this,a)}}function F_t(e,t){return P_t(j_t(e,t,lz),e+"")}var z_t=9007199254740991;function voe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=z_t}function cz(e){return e!=null&&voe(e.length)&&!HLe(e)}function Fve(e,t,n){if(!Lb(n))return!1;var r=typeof t;return(r=="number"?cz(n)&&moe(t,n.length):r=="string"&&t in n)?yoe(n[t],e):!1}var Q_t=Object.prototype;function B_t(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Q_t;return e===n}function W_t(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var q_t="[object Arguments]";function zve(e){return Ib(e)&&qO(e)==q_t}var XLe=Object.prototype,V_t=XLe.hasOwnProperty,U_t=XLe.propertyIsEnumerable,boe=zve(function(){return arguments}())?zve:function(e){return Ib(e)&&V_t.call(e,"callee")&&!U_t.call(e,"callee")};function H_t(){return!1}var ZLe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qve=ZLe&&typeof module=="object"&&module&&!module.nodeType&&module,X_t=Qve&&Qve.exports===ZLe,Bve=X_t?vp.Buffer:void 0,Z_t=Bve?Bve.isBuffer:void 0,tY=Z_t||H_t,Y_t="[object Arguments]",G_t="[object Array]",K_t="[object Boolean]",J_t="[object Date]",ekt="[object Error]",tkt="[object Function]",nkt="[object Map]",rkt="[object Number]",ikt="[object Object]",okt="[object RegExp]",skt="[object Set]",akt="[object String]",lkt="[object WeakMap]",ckt="[object ArrayBuffer]",ukt="[object DataView]",fkt="[object Float32Array]",dkt="[object Float64Array]",hkt="[object Int8Array]",pkt="[object Int16Array]",gkt="[object Int32Array]",mkt="[object Uint8Array]",ykt="[object Uint8ClampedArray]",vkt="[object Uint16Array]",bkt="[object Uint32Array]",si={};si[fkt]=si[dkt]=si[hkt]=si[pkt]=si[gkt]=si[mkt]=si[ykt]=si[vkt]=si[bkt]=!0;si[Y_t]=si[G_t]=si[ckt]=si[K_t]=si[ukt]=si[J_t]=si[ekt]=si[tkt]=si[nkt]=si[rkt]=si[ikt]=si[okt]=si[skt]=si[akt]=si[lkt]=!1;function Okt(e){return Ib(e)&&voe(e.length)&&!!si[qO(e)]}function YLe(e){return function(t){return e(t)}}var GLe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kT=GLe&&typeof module=="object"&&module&&!module.nodeType&&module,xkt=kT&&kT.exports===GLe,ZW=xkt&&qLe.process,Wve=function(){try{var e=kT&&kT.require&&kT.require("util").types;return e||ZW&&ZW.binding&&ZW.binding("util")}catch{}}(),qve=Wve&&Wve.isTypedArray,KLe=qve?YLe(qve):Okt,wkt=Object.prototype,Skt=wkt.hasOwnProperty;function Ekt(e,t){var n=xd(e),r=!n&&boe(e),i=!n&&!r&&tY(e),o=!n&&!r&&!i&&KLe(e),s=n||r||i||o,a=s?W_t(e.length,String):[],l=a.length;for(var c in e)(t||Skt.call(e,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||moe(c,l)))&&a.push(c);return a}function Ckt(e,t){return function(n){return e(t(n))}}var _kt=Ckt(Object.keys,Object),kkt=Object.prototype,$kt=kkt.hasOwnProperty;function Tkt(e){if(!B_t(e))return _kt(e);var t=[];for(var n in Object(e))$kt.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ooe(e){return cz(e)?Ekt(e):Tkt(e)}var Pkt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Akt=/^\w*$/;function xoe(e,t){if(xd(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||dE(e)?!0:Akt.test(e)||!Pkt.test(e)||t!=null&&e in Object(t)}var aP=UO(Object,"create");function Rkt(){this.__data__=aP?aP(null):{},this.size=0}function Dkt(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Mkt="__lodash_hash_undefined__",Nkt=Object.prototype,Ikt=Nkt.hasOwnProperty;function Lkt(e){var t=this.__data__;if(aP){var n=t[e];return n===Mkt?void 0:n}return Ikt.call(t,e)?t[e]:void 0}var jkt=Object.prototype,Fkt=jkt.hasOwnProperty;function zkt(e){var t=this.__data__;return aP?t[e]!==void 0:Fkt.call(t,e)}var Qkt="__lodash_hash_undefined__";function Bkt(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=aP&&t===void 0?Qkt:t,this}function jb(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jb.prototype.clear=Rkt;jb.prototype.delete=Dkt;jb.prototype.get=Lkt;jb.prototype.has=zkt;jb.prototype.set=Bkt;function Wkt(){this.__data__=[],this.size=0}function uz(e,t){for(var n=e.length;n--;)if(yoe(e[n][0],t))return n;return-1}var qkt=Array.prototype,Vkt=qkt.splice;function Ukt(e){var t=this.__data__,n=uz(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Vkt.call(t,n,1),--this.size,!0}function Hkt(e){var t=this.__data__,n=uz(t,e);return n<0?void 0:t[n][1]}function Xkt(e){return uz(this.__data__,e)>-1}function Zkt(e,t){var n=this.__data__,r=uz(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function hm(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}hm.prototype.clear=Wkt;hm.prototype.delete=Ukt;hm.prototype.get=Hkt;hm.prototype.has=Xkt;hm.prototype.set=Zkt;var lP=UO(vp,"Map");function Ykt(){this.size=0,this.__data__={hash:new jb,map:new(lP||hm),string:new jb}}function Gkt(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function fz(e,t){var n=e.__data__;return Gkt(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Kkt(e){var t=fz(this,e).delete(e);return this.size-=t?1:0,t}function Jkt(e){return fz(this,e).get(e)}function e$t(e){return fz(this,e).has(e)}function t$t(e,t){var n=fz(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function pm(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pm.prototype.clear=Ykt;pm.prototype.delete=Kkt;pm.prototype.get=Jkt;pm.prototype.has=e$t;pm.prototype.set=t$t;var n$t="Expected a function";function woe(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(n$t);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(woe.Cache||pm),n}woe.Cache=pm;var r$t=500;function i$t(e){var t=woe(e,function(r){return n.size===r$t&&n.clear(),r}),n=t.cache;return t}var o$t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,s$t=/\\(\\)?/g,a$t=i$t(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(o$t,function(n,r,i,o){t.push(i?o.replace(s$t,"$1"):r||n)}),t});function dz(e){return e==null?"":ULe(e)}function JLe(e,t){return xd(e)?e:xoe(e,t)?[e]:a$t(dz(e))}var l$t=1/0;function hz(e){if(typeof e=="string"||dE(e))return e;var t=e+"";return t=="0"&&1/e==-l$t?"-0":t}function Soe(e,t){t=JLe(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[hz(t[n++])];return n&&n==r?e:void 0}function eje(e,t,n){var r=e==null?void 0:Soe(e,t);return r===void 0?n:r}function tje(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Vve=ep?ep.isConcatSpreadable:void 0;function c$t(e){return xd(e)||boe(e)||!!(Vve&&e&&e[Vve])}function nje(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=c$t),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?nje(a,t-1,n,r,i):tje(i,a):r||(i[i.length]=a)}return i}var u$t="Expected a function";function f$t(e,t){var n;if(typeof t!="function")throw new TypeError(u$t);return e=i_t(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}function d$t(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}function h$t(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:d$t(e,t,n)}var p$t="\\ud800-\\udfff",g$t="\\u0300-\\u036f",m$t="\\ufe20-\\ufe2f",y$t="\\u20d0-\\u20ff",v$t=g$t+m$t+y$t,b$t="\\ufe0e\\ufe0f",O$t="\\u200d",x$t=RegExp("["+O$t+p$t+v$t+b$t+"]");function rje(e){return x$t.test(e)}function w$t(e){return e.split("")}var ije="\\ud800-\\udfff",S$t="\\u0300-\\u036f",E$t="\\ufe20-\\ufe2f",C$t="\\u20d0-\\u20ff",_$t=S$t+E$t+C$t,k$t="\\ufe0e\\ufe0f",$$t="["+ije+"]",nY="["+_$t+"]",rY="\\ud83c[\\udffb-\\udfff]",T$t="(?:"+nY+"|"+rY+")",oje="[^"+ije+"]",sje="(?:\\ud83c[\\udde6-\\uddff]){2}",aje="[\\ud800-\\udbff][\\udc00-\\udfff]",P$t="\\u200d",lje=T$t+"?",cje="["+k$t+"]?",A$t="(?:"+P$t+"(?:"+[oje,sje,aje].join("|")+")"+cje+lje+")*",R$t=cje+lje+A$t,D$t="(?:"+[oje+nY+"?",nY,sje,aje,$$t].join("|")+")",M$t=RegExp(rY+"(?="+rY+")|"+D$t+R$t,"g");function N$t(e){return e.match(M$t)||[]}function I$t(e){return rje(e)?N$t(e):w$t(e)}function L$t(e){return function(t){t=dz(t);var n=rje(t)?I$t(t):void 0,r=n?n[0]:t.charAt(0),i=n?h$t(n,1).join(""):t.slice(1);return r[e]()+i}}var j$t=L$t("toUpperCase");function F$t(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function z$t(e){return function(t){return e==null?void 0:e[t]}}var Q$t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"},B$t=z$t(Q$t);const W$t=B$t;var q$t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,V$t="\\u0300-\\u036f",U$t="\\ufe20-\\ufe2f",H$t="\\u20d0-\\u20ff",X$t=V$t+U$t+H$t,Z$t="["+X$t+"]",Y$t=RegExp(Z$t,"g");function G$t(e){return e=dz(e),e&&e.replace(q$t,W$t).replace(Y$t,"")}var K$t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function J$t(e){return e.match(K$t)||[]}var eTt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function tTt(e){return eTt.test(e)}var uje="\\ud800-\\udfff",nTt="\\u0300-\\u036f",rTt="\\ufe20-\\ufe2f",iTt="\\u20d0-\\u20ff",oTt=nTt+rTt+iTt,fje="\\u2700-\\u27bf",dje="a-z\\xdf-\\xf6\\xf8-\\xff",sTt="\\xac\\xb1\\xd7\\xf7",aTt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",lTt="\\u2000-\\u206f",cTt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",hje="A-Z\\xc0-\\xd6\\xd8-\\xde",uTt="\\ufe0e\\ufe0f",pje=sTt+aTt+lTt+cTt,gje="['’]",Uve="["+pje+"]",fTt="["+oTt+"]",mje="\\d+",dTt="["+fje+"]",yje="["+dje+"]",vje="[^"+uje+pje+mje+fje+dje+hje+"]",hTt="\\ud83c[\\udffb-\\udfff]",pTt="(?:"+fTt+"|"+hTt+")",gTt="[^"+uje+"]",bje="(?:\\ud83c[\\udde6-\\uddff]){2}",Oje="[\\ud800-\\udbff][\\udc00-\\udfff]",Ow="["+hje+"]",mTt="\\u200d",Hve="(?:"+yje+"|"+vje+")",yTt="(?:"+Ow+"|"+vje+")",Xve="(?:"+gje+"(?:d|ll|m|re|s|t|ve))?",Zve="(?:"+gje+"(?:D|LL|M|RE|S|T|VE))?",xje=pTt+"?",wje="["+uTt+"]?",vTt="(?:"+mTt+"(?:"+[gTt,bje,Oje].join("|")+")"+wje+xje+")*",bTt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",OTt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",xTt=wje+xje+vTt,wTt="(?:"+[dTt,bje,Oje].join("|")+")"+xTt,STt=RegExp([Ow+"?"+yje+"+"+Xve+"(?="+[Uve,Ow,"$"].join("|")+")",yTt+"+"+Zve+"(?="+[Uve,Ow+Hve,"$"].join("|")+")",Ow+"?"+Hve+"+"+Xve,Ow+"+"+Zve,OTt,bTt,mje,wTt].join("|"),"g");function ETt(e){return e.match(STt)||[]}function CTt(e,t,n){return e=dz(e),t=n?void 0:t,t===void 0?tTt(e)?ETt(e):J$t(e):e.match(t)||[]}var _Tt="['’]",kTt=RegExp(_Tt,"g");function $Tt(e){return function(t){return F$t(CTt(G$t(t).replace(kTt,"")),e,"")}}function TTt(){this.__data__=new hm,this.size=0}function PTt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ATt(e){return this.__data__.get(e)}function RTt(e){return this.__data__.has(e)}var DTt=200;function MTt(e,t){var n=this.__data__;if(n instanceof hm){var r=n.__data__;if(!lP||r.length<DTt-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new pm(r)}return n.set(e,t),this.size=n.size,this}function kg(e){var t=this.__data__=new hm(e);this.size=t.size}kg.prototype.clear=TTt;kg.prototype.delete=PTt;kg.prototype.get=ATt;kg.prototype.has=RTt;kg.prototype.set=MTt;function NTt(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function ITt(){return[]}var LTt=Object.prototype,jTt=LTt.propertyIsEnumerable,Yve=Object.getOwnPropertySymbols,FTt=Yve?function(e){return e==null?[]:(e=Object(e),NTt(Yve(e),function(t){return jTt.call(e,t)}))}:ITt;const zTt=FTt;function QTt(e,t,n){var r=t(e);return xd(e)?r:tje(r,n(e))}function Gve(e){return QTt(e,Ooe,zTt)}var iY=UO(vp,"DataView"),oY=UO(vp,"Promise"),vS=UO(vp,"Set"),Kve="[object Map]",BTt="[object Object]",Jve="[object Promise]",e1e="[object Set]",t1e="[object WeakMap]",n1e="[object DataView]",WTt=VO(iY),qTt=VO(lP),VTt=VO(oY),UTt=VO(vS),HTt=VO(eY),f1=qO;(iY&&f1(new iY(new ArrayBuffer(1)))!=n1e||lP&&f1(new lP)!=Kve||oY&&f1(oY.resolve())!=Jve||vS&&f1(new vS)!=e1e||eY&&f1(new eY)!=t1e)&&(f1=function(e){var t=qO(e),n=t==BTt?e.constructor:void 0,r=n?VO(n):"";if(r)switch(r){case WTt:return n1e;case qTt:return Kve;case VTt:return Jve;case UTt:return e1e;case HTt:return t1e}return t});const r1e=f1;var XTt=vp.Uint8Array;const i1e=XTt;var ZTt="__lodash_hash_undefined__";function YTt(e){return this.__data__.set(e,ZTt),this}function GTt(e){return this.__data__.has(e)}function cP(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new pm;++t<n;)this.add(e[t])}cP.prototype.add=cP.prototype.push=YTt;cP.prototype.has=GTt;function KTt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Sje(e,t){return e.has(t)}var JTt=1,e2t=2;function Eje(e,t,n,r,i,o){var s=n&JTt,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var f=-1,d=!0,h=n&e2t?new cP:void 0;for(o.set(e,t),o.set(t,e);++f<a;){var p=e[f],g=t[f];if(r)var v=s?r(g,p,f,t,e,o):r(p,g,f,e,t,o);if(v!==void 0){if(v)continue;d=!1;break}if(h){if(!KTt(t,function(y,O){if(!Sje(h,O)&&(p===y||i(p,y,n,r,o)))return h.push(O)})){d=!1;break}}else if(!(p===g||i(p,g,n,r,o))){d=!1;break}}return o.delete(e),o.delete(t),d}function t2t(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function Eoe(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var n2t=1,r2t=2,i2t="[object Boolean]",o2t="[object Date]",s2t="[object Error]",a2t="[object Map]",l2t="[object Number]",c2t="[object RegExp]",u2t="[object Set]",f2t="[object String]",d2t="[object Symbol]",h2t="[object ArrayBuffer]",p2t="[object DataView]",o1e=ep?ep.prototype:void 0,YW=o1e?o1e.valueOf:void 0;function g2t(e,t,n,r,i,o,s){switch(n){case p2t:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case h2t:return!(e.byteLength!=t.byteLength||!o(new i1e(e),new i1e(t)));case i2t:case o2t:case l2t:return yoe(+e,+t);case s2t:return e.name==t.name&&e.message==t.message;case c2t:case f2t:return e==t+"";case a2t:var a=t2t;case u2t:var l=r&n2t;if(a||(a=Eoe),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=r2t,s.set(e,t);var u=Eje(a(e),a(t),r,i,o,s);return s.delete(e),u;case d2t:if(YW)return YW.call(e)==YW.call(t)}return!1}var m2t=1,y2t=Object.prototype,v2t=y2t.hasOwnProperty;function b2t(e,t,n,r,i,o){var s=n&m2t,a=Gve(e),l=a.length,c=Gve(t),u=c.length;if(l!=u&&!s)return!1;for(var f=l;f--;){var d=a[f];if(!(s?d in t:v2t.call(t,d)))return!1}var h=o.get(e),p=o.get(t);if(h&&p)return h==t&&p==e;var g=!0;o.set(e,t),o.set(t,e);for(var v=s;++f<l;){d=a[f];var y=e[d],O=t[d];if(r)var m=s?r(O,y,d,t,e,o):r(y,O,d,e,t,o);if(!(m===void 0?y===O||i(y,O,n,r,o):m)){g=!1;break}v||(v=d=="constructor")}if(g&&!v){var w=e.constructor,S=t.constructor;w!=S&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof S=="function"&&S instanceof S)&&(g=!1)}return o.delete(e),o.delete(t),g}var O2t=1,s1e="[object Arguments]",a1e="[object Array]",UM="[object Object]",x2t=Object.prototype,l1e=x2t.hasOwnProperty;function w2t(e,t,n,r,i,o){var s=xd(e),a=xd(t),l=s?a1e:r1e(e),c=a?a1e:r1e(t);l=l==s1e?UM:l,c=c==s1e?UM:c;var u=l==UM,f=c==UM,d=l==c;if(d&&tY(e)){if(!tY(t))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new kg),s||KLe(e)?Eje(e,t,n,r,i,o):g2t(e,t,l,n,r,i,o);if(!(n&O2t)){var h=u&&l1e.call(e,"__wrapped__"),p=f&&l1e.call(t,"__wrapped__");if(h||p){var g=h?e.value():e,v=p?t.value():t;return o||(o=new kg),i(g,v,n,r,o)}}return d?(o||(o=new kg),b2t(e,t,n,r,i,o)):!1}function pz(e,t,n,r,i){return e===t?!0:e==null||t==null||!Ib(e)&&!Ib(t)?e!==e&&t!==t:w2t(e,t,n,r,pz,i)}var S2t=1,E2t=2;function C2t(e,t,n,r){var i=n.length,o=i,s=!r;if(e==null)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=n[i];var l=a[0],c=e[l],u=a[1];if(s&&a[2]){if(c===void 0&&!(l in e))return!1}else{var f=new kg;if(r)var d=r(c,u,l,e,t,f);if(!(d===void 0?pz(u,c,S2t|E2t,r,f):d))return!1}}return!0}function Cje(e){return e===e&&!Lb(e)}function _2t(e){for(var t=Ooe(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Cje(i)]}return t}function _je(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function k2t(e){var t=_2t(e);return t.length==1&&t[0][2]?_je(t[0][0],t[0][1]):function(n){return n===e||C2t(n,e,t)}}function $2t(e,t){return e!=null&&t in Object(e)}function T2t(e,t,n){t=JLe(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=hz(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&voe(i)&&moe(s,i)&&(xd(e)||boe(e)))}function P2t(e,t){return e!=null&&T2t(e,t,$2t)}var A2t=1,R2t=2;function D2t(e,t){return xoe(e)&&Cje(t)?_je(hz(e),t):function(n){var r=eje(n,e);return r===void 0&&r===t?P2t(n,e):pz(t,r,A2t|R2t)}}function M2t(e){return function(t){return t==null?void 0:t[e]}}function N2t(e){return function(t){return Soe(t,e)}}function I2t(e){return xoe(e)?M2t(hz(e)):N2t(e)}function L2t(e){return typeof e=="function"?e:e==null?lz:typeof e=="object"?xd(e)?D2t(e[0],e[1]):k2t(e):I2t(e)}function j2t(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(n(o[l],l,o)===!1)break}return t}}var F2t=j2t();function z2t(e,t){return e&&F2t(e,t,Ooe)}function Q2t(e,t){return function(n,r){if(n==null)return n;if(!cz(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Object(n);(t?o--:++o<i)&&r(s[o],o,s)!==!1;);return n}}var B2t=Q2t(z2t),GW=function(){return vp.Date.now()},W2t="Expected a function",q2t=Math.max,V2t=Math.min;function Coe(e,t,n){var r,i,o,s,a,l,c=0,u=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(W2t);t=JZ(t)||0,Lb(n)&&(u=!!n.leading,f="maxWait"in n,o=f?q2t(JZ(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d);function h(E){var C=r,k=i;return r=i=void 0,c=E,s=e.apply(k,C),s}function p(E){return c=E,a=setTimeout(y,t),u?h(E):s}function g(E){var C=E-l,k=E-c,P=t-C;return f?V2t(P,o-k):P}function v(E){var C=E-l,k=E-c;return l===void 0||C>=t||C<0||f&&k>=o}function y(){var E=GW();if(v(E))return O(E);a=setTimeout(y,g(E))}function O(E){return a=void 0,d&&r?h(E):(r=i=void 0,s)}function m(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function w(){return a===void 0?s:O(GW())}function S(){var E=GW(),C=v(E);if(r=arguments,i=this,l=E,C){if(a===void 0)return p(l);if(f)return clearTimeout(a),a=setTimeout(y,t),h(l)}return a===void 0&&(a=setTimeout(y,t)),s}return S.cancel=m,S.flush=w,S}function U2t(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function H2t(e,t){var n=-1,r=cz(e)?Array(e.length):[];return B2t(e,function(i,o,s){r[++n]=t(i,o,s)}),r}function c1e(e,t){return pz(e,t)}var X2t="[object Number]";function Z2t(e){return typeof e=="number"||Ib(e)&&qO(e)==X2t}function Y2t(e){return f$t(2,e)}function G2t(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function K2t(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,o=dE(e),s=t!==void 0,a=t===null,l=t===t,c=dE(t);if(!a&&!c&&!o&&e>t||o&&s&&l&&!a&&!c||r&&s&&l||!n&&l||!i)return 1;if(!r&&!o&&!c&&e<t||c&&n&&i&&!r&&!o||a&&n&&i||!s&&i||!l)return-1}return 0}function J2t(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var l=K2t(i[r],o[r]);if(l){if(r>=a)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return e.index-t.index}function ePt(e,t,n){t.length?t=A5(t,function(o){return xd(o)?function(s){return Soe(s,o.length===1?o[0]:o)}:o}):t=[lz];var r=-1;t=A5(t,YLe(L2t));var i=H2t(e,function(o,s,a){var l=A5(t,function(c){return c(o)});return{criteria:l,index:++r,value:o}});return G2t(i,function(o,s){return J2t(o,s,n)})}var KW=F_t(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Fve(e,t[0],t[1])?t=[]:n>2&&Fve(t[0],t[1],t[2])&&(t=[t[0]]),ePt(e,nje(t,1),[])}),RR=$Tt(function(e,t,n){return e+(n?" ":"")+j$t(t)}),tPt=1/0,nPt=vS&&1/Eoe(new vS([,-0]))[1]==tPt?function(e){return new vS(e)}:w_t,rPt=200;function iPt(e,t,n){var r=-1,i=N_t,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=U2t;else if(o>=rPt){var c=t?null:nPt(e);if(c)return Eoe(c);s=!1,i=Sje,l=new cP}else l=t?[]:a;e:for(;++r<o;){var u=e[r],f=t?t(u):u;if(u=n||u!==0?u:0,s&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue e;t&&l.push(f),a.push(u)}else i(l,f,n)||(l!==a&&l.push(f),a.push(u))}return a}function oPt(e){return e&&e.length?iPt(e):[]}function sPt(e,t){const[n,r]=x.useState(e);return x.useEffect(()=>{const i=setTimeout(()=>r(e),t);return()=>{clearTimeout(i)}},[e,t]),n}function _oe(e){const{initialValue:t,onChange:n,delay:r,disabled:i}=e,[o,s]=x.useState(t),a=sPt(o,r||200),l=Jn(n);return x.useEffect(()=>{s(t)},[t]),x.useEffect(()=>{i||l(a)},[a,i,l]),i?{value:o,debouncedValue:o,onChange:n}:{value:o,debouncedValue:a,onChange:c=>{s(c)}}}function aPt(e,t){const n=Jn(e);return x.useMemo(()=>Coe(n,t),[n,t])}const tp={stopPropagation:e=>t=>{t.stopPropagation(),e&&e(t)},onEnter:e=>t=>{t.key==="Enter"&&e&&e(t)}},Wo=x.forwardRef(({className:e,type:t,endAdornment:n,...r},i)=>{const o=r.icon;return t==="hidden"?b.jsx("input",{type:"hidden",ref:i,...r}):b.jsxs("div",{className:"relative",children:[o&&b.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-[6px] pointer-events-none text-muted-foreground h-6",children:o}),b.jsx("input",{type:t,className:be("shadow-xsSolid hover:shadow-smSolid disabled:shadow-xsSolid focus-visible:shadow-mdSolid","flex h-6 w-full mb-1 rounded-sm border border-input bg-background px-1.5 py-1 text-sm font-code ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-primary disabled:cursor-not-allowed disabled:opacity-50",o&&"pl-7",n&&"pr-10",e),ref:i,onClick:tp.stopPropagation(),...r}),n&&b.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-[6px] pointer-events-none text-muted-foreground h-6",children:n})]})});Wo.displayName="Input";const koe=x.forwardRef(({className:e,onValueChange:t,...n},r)=>{const{value:i,onChange:o}=_oe({initialValue:n.value,delay:200,onChange:t});return b.jsx(Wo,{ref:r,className:e,...n,onChange:s=>o(s.target.value),value:i})});koe.displayName="DebouncedInput";const kje=x.forwardRef(({className:e,onValueChange:t,...n},r)=>{const{value:i,onChange:o}=_oe({initialValue:n.value,delay:200,onChange:t});return b.jsx(Wo,{ref:r,type:"number",className:e,...n,onChange:s=>o(s.target.valueAsNumber),value:i})});kje.displayName="DebouncedNumberInput";class lPt{constructor(){ve(this,"tagName","marimo-date-picker");ve(this,"validator",Y.object({initialValue:Y.string(),label:Y.string().nullable(),start:Y.string(),stop:Y.string(),step:Y.string().optional(),fullWidth:Y.boolean().default(!1)}))}render(t){return b.jsx(cPt,{...t.data,value:t.value,setValue:t.setValue})}}const cPt=e=>{const t=x.useRef(null),n=()=>{const i=t.current;if(i!=null&&i.valueAsDate){let o=i.valueAsDate;const s=new Date(e.start);o=o<s?s:o;const a=new Date(e.stop);o=o>a?a:o;const l=o.toISOString(),c=l.slice(0,l.indexOf("T"));e.setValue(c)}},r=x.useId();return b.jsx(fc,{label:e.label,id:r,fullWidth:e.fullWidth,children:b.jsx(Wo,{"data-testid":"marimo-plugin-date-picker",ref:t,type:"date",className:be({"w-full":e.fullWidth}),min:e.start,max:e.stop,value:e.value,onInput:n,id:r})})};class uPt{constructor(){ve(this,"tagName","marimo-dict");ve(this,"validator",Y.object({label:Y.string().nullable(),elementIds:Y.record(Y.string(),Y.string())}))}render(t){return b.jsx(fPt,{...t.data,value:t.value,setValue:t.setValue,children:t.children})}}const fPt=({elementIds:e,setValue:t,children:n})=>(x.useEffect(()=>{const r=i=>{const o=i.detail.element;if(o===null||!(o instanceof Node))return;const s=roe(o);if(s===null)return;const a=e[s];a!==void 0&&t(l=>{const c=l?{...l}:{};return c[a]=i.detail.value,c})};return document.addEventListener(Rb,r),()=>{document.removeEventListener(Rb,r)}},[e,t]),n),$je=Ao("flex h-6 w-fit mb-1 items-center justify-between rounded-sm bg-background px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer",{variants:{variant:{default:"shadow-xsSolid border border-input hover:shadow-smSolid focus:border-primary focus:shadow-mdSolid disabled:hover:shadow-xsSolid",ghost:"opacity-70 hover:opacity-100 focus:opacity-100"}},defaultVariants:{variant:"default"}}),$h=x.forwardRef(({className:e,children:t,...n},r)=>b.jsx("select",{ref:r,onClick:tp.stopPropagation(),className:be($je({}),e),...n,children:t}));$h.displayName="NativeSelect";class dPt{constructor(){ve(this,"tagName","marimo-dropdown");ve(this,"validator",Y.object({initialValue:Y.array(Y.string()),label:Y.string().nullable(),options:Y.array(Y.string()),allowSelectNone:Y.boolean(),fullWidth:Y.boolean().default(!1)}))}render(t){return b.jsx(hPt,{...t.data,value:t.value,setValue:t.setValue})}}const JW="--",hPt=e=>{const{label:t,options:n,value:r,setValue:i,allowSelectNone:o,fullWidth:s}=e,a=x.useId(),l=o?JW:n[0],c=r.length===0?l:r[0];return b.jsx(fc,{label:t,id:a,fullWidth:s,children:b.jsxs($h,{"data-testid":"marimo-plugin-dropdown",onChange:u=>{const f=u.target.value;i(f===JW?[]:[f])},className:be({"w-full":s}),value:c,id:a,children:[o?b.jsx("option",{value:JW,selected:r.length===0,children:"--"}):null,n.map(u=>b.jsx("option",{value:u,selected:r.includes(u),children:u},u))]})})};var Ea=function(){return Ea=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ea.apply(this,arguments)};function $oe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function HC(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(f){s(f)}}function l(u){try{c(r.throw(u))}catch(f){s(f)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}function XC(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function u1e(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function zj(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var pPt=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function DR(e,t){var n=gPt(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function gPt(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=pPt.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var mPt=[".DS_Store","Thumbs.db"];function yPt(e){return HC(this,void 0,void 0,function(){return XC(this,function(t){return Qj(e)&&vPt(e.dataTransfer)?[2,wPt(e.dataTransfer,e.type)]:bPt(e)?[2,OPt(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,xPt(e)]:[2,[]]})})}function vPt(e){return Qj(e)}function bPt(e){return Qj(e)&&Qj(e.target)}function Qj(e){return typeof e=="object"&&e!==null}function OPt(e){return sY(e.target.files).map(function(t){return DR(t)})}function xPt(e){return HC(this,void 0,void 0,function(){var t;return XC(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return DR(r)})]}})})}function wPt(e,t){return HC(this,void 0,void 0,function(){var n,r;return XC(this,function(i){switch(i.label){case 0:return e.items?(n=sY(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(SPt))]):[3,2];case 1:return r=i.sent(),[2,f1e(Tje(r))];case 2:return[2,f1e(sY(e.files).map(function(o){return DR(o)}))]}})})}function f1e(e){return e.filter(function(t){return mPt.indexOf(t.name)===-1})}function sY(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function SPt(e){if(typeof e.webkitGetAsEntry!="function")return d1e(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Pje(t):d1e(e)}function Tje(e){return e.reduce(function(t,n){return zj(zj([],u1e(t),!1),u1e(Array.isArray(n)?Tje(n):[n]),!1)},[])}function d1e(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=DR(t);return Promise.resolve(n)}function EPt(e){return HC(this,void 0,void 0,function(){return XC(this,function(t){return[2,e.isDirectory?Pje(e):CPt(e)]})})}function Pje(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var s=this;t.readEntries(function(a){return HC(s,void 0,void 0,function(){var l,c,u;return XC(this,function(f){switch(f.label){case 0:if(a.length)return[3,5];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=f.sent(),n(l),[3,4];case 3:return c=f.sent(),r(c),[3,4];case 4:return[3,6];case 5:u=Promise.all(a.map(EPt)),i.push(u),o(),f.label=6;case 6:return[2]}})})},function(a){r(a)})}o()})}function CPt(e){return HC(this,void 0,void 0,function(){return XC(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=DR(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var _Pt=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?o===a.replace(/\/.*$/,""):i===a})}return!0};function h1e(e){return TPt(e)||$Pt(e)||Rje(e)||kPt()}function kPt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $Pt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TPt(e){if(Array.isArray(e))return aY(e)}function p1e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function g1e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?p1e(Object(n),!0).forEach(function(r){Aje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p1e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Aje(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uP(e,t){return RPt(e)||APt(e,t)||Rje(e,t)||PPt()}function PPt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rje(e,t){if(e){if(typeof e=="string")return aY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aY(e,t)}}function aY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function APt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function RPt(e){if(Array.isArray(e))return e}var DPt="file-invalid-type",MPt="file-too-large",NPt="file-too-small",IPt="too-many-files",LPt=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:DPt,message:"File type must be ".concat(n)}},m1e=function(t){return{code:MPt,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},y1e=function(t){return{code:NPt,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},jPt={code:IPt,message:"Too many files"};function Dje(e,t){var n=e.type==="application/x-moz-file"||_Pt(e,t);return[n,n?null:LPt(t)]}function Mje(e,t,n){if(x1(e.size))if(x1(t)&&x1(n)){if(e.size>n)return[!1,m1e(n)];if(e.size<t)return[!1,y1e(t)]}else{if(x1(t)&&e.size<t)return[!1,y1e(t)];if(x1(n)&&e.size>n)return[!1,m1e(n)]}return[!0,null]}function x1(e){return e!=null}function FPt(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,a=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(l){var c=Dje(l,n),u=uP(c,1),f=u[0],d=Mje(l,r,i),h=uP(d,1),p=h[0],g=a?a(l):null;return f&&p&&!g})}function Bj(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function HM(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function v1e(e){e.preventDefault()}function zPt(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function QPt(e){return e.indexOf("Edge/")!==-1}function BPt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return zPt(e)||QPt(e)}function Jd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return t.some(function(a){return!Bj(r)&&a&&a.apply(void 0,[r].concat(o)),Bj(r)})}}function WPt(){return"showOpenFilePicker"in window}function qPt(e){if(x1(e)){var t=Object.entries(e).filter(function(n){var r=uP(n,2),i=r[0],o=r[1],s=!0;return Nje(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(o)||!o.every(Ije))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var i=uP(r,2),o=i[0],s=i[1];return g1e(g1e({},n),{},Aje({},o,s))},{});return[{description:"Files",accept:t}]}return e}function VPt(e){if(x1(e))return Object.entries(e).reduce(function(t,n){var r=uP(n,2),i=r[0],o=r[1];return[].concat(h1e(t),[i],h1e(o))},[]).filter(function(t){return Nje(t)||Ije(t)}).join(",")}function UPt(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function HPt(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Nje(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Ije(e){return/^.*\.[\w]+$/.test(e)}var XPt=["children"],ZPt=["open"],YPt=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],GPt=["refKey","onChange","onClick"];function KPt(e){return tAt(e)||eAt(e)||Lje(e)||JPt()}function JPt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eAt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function tAt(e){if(Array.isArray(e))return lY(e)}function eq(e,t){return iAt(e)||rAt(e,t)||Lje(e,t)||nAt()}function nAt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lje(e,t){if(e){if(typeof e=="string")return lY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lY(e,t)}}function lY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rAt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function iAt(e){if(Array.isArray(e))return e}function b1e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ki(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b1e(Object(n),!0).forEach(function(r){cY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b1e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cY(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wj(e,t){if(e==null)return{};var n=oAt(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function oAt(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Toe=x.forwardRef(function(e,t){var n=e.children,r=Wj(e,XPt),i=Poe(r),o=i.open,s=Wj(i,ZPt);return x.useImperativeHandle(t,function(){return{open:o}},[o]),ie.createElement(x.Fragment,null,n(ki(ki({},s),{},{open:o})))});Toe.displayName="Dropzone";var jje={disabled:!1,getFilesFromEvent:yPt,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Toe.defaultProps=jje;Toe.propTypes={children:Or.func,accept:Or.objectOf(Or.arrayOf(Or.string)),multiple:Or.bool,preventDropOnDocument:Or.bool,noClick:Or.bool,noKeyboard:Or.bool,noDrag:Or.bool,noDragEventsBubbling:Or.bool,minSize:Or.number,maxSize:Or.number,maxFiles:Or.number,disabled:Or.bool,getFilesFromEvent:Or.func,onFileDialogCancel:Or.func,onFileDialogOpen:Or.func,useFsAccessApi:Or.bool,autoFocus:Or.bool,onDragEnter:Or.func,onDragLeave:Or.func,onDragOver:Or.func,onDrop:Or.func,onDropAccepted:Or.func,onDropRejected:Or.func,onError:Or.func,validator:Or.func};var uY={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Poe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=ki(ki({},jje),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,a=t.multiple,l=t.maxFiles,c=t.onDragEnter,u=t.onDragLeave,f=t.onDragOver,d=t.onDrop,h=t.onDropAccepted,p=t.onDropRejected,g=t.onFileDialogCancel,v=t.onFileDialogOpen,y=t.useFsAccessApi,O=t.autoFocus,m=t.preventDropOnDocument,w=t.noClick,S=t.noKeyboard,E=t.noDrag,C=t.noDragEventsBubbling,k=t.onError,P=t.validator,D=x.useMemo(function(){return VPt(n)},[n]),M=x.useMemo(function(){return qPt(n)},[n]),L=x.useMemo(function(){return typeof v=="function"?v:O1e},[v]),A=x.useMemo(function(){return typeof g=="function"?g:O1e},[g]),T=x.useRef(null),N=x.useRef(null),j=x.useReducer(sAt,uY),z=eq(j,2),W=z[0],F=z[1],q=W.isFocused,U=W.isFileDialogActive,V=x.useRef(typeof window<"u"&&window.isSecureContext&&y&&WPt()),H=function(){!V.current&&U&&setTimeout(function(){if(N.current){var Me=N.current.files;Me.length||(F({type:"closeDialog"}),A())}},300)};x.useEffect(function(){return window.addEventListener("focus",H,!1),function(){window.removeEventListener("focus",H,!1)}},[N,U,A,V]);var Z=x.useRef([]),ee=function(Me){T.current&&T.current.contains(Me.target)||(Me.preventDefault(),Z.current=[])};x.useEffect(function(){return m&&(document.addEventListener("dragover",v1e,!1),document.addEventListener("drop",ee,!1)),function(){m&&(document.removeEventListener("dragover",v1e),document.removeEventListener("drop",ee))}},[T,m]),x.useEffect(function(){return!r&&O&&T.current&&T.current.focus(),function(){}},[T,O,r]);var se=x.useCallback(function(ye){k?k(ye):console.error(ye)},[k]),fe=x.useCallback(function(ye){ye.preventDefault(),ye.persist(),le(ye),Z.current=[].concat(KPt(Z.current),[ye.target]),HM(ye)&&Promise.resolve(i(ye)).then(function(Me){if(!(Bj(ye)&&!C)){var pt=Me.length,at=pt>0&&FPt({files:Me,accept:D,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:P}),ht=pt>0&&!at;F({isDragAccept:at,isDragReject:ht,isDragActive:!0,type:"setDraggedFiles"}),c&&c(ye)}}).catch(function(Me){return se(Me)})},[i,c,se,C,D,s,o,a,l,P]),ce=x.useCallback(function(ye){ye.preventDefault(),ye.persist(),le(ye);var Me=HM(ye);if(Me&&ye.dataTransfer)try{ye.dataTransfer.dropEffect="copy"}catch{}return Me&&f&&f(ye),!1},[f,C]),ae=x.useCallback(function(ye){ye.preventDefault(),ye.persist(),le(ye);var Me=Z.current.filter(function(at){return T.current&&T.current.contains(at)}),pt=Me.indexOf(ye.target);pt!==-1&&Me.splice(pt,1),Z.current=Me,!(Me.length>0)&&(F({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),HM(ye)&&u&&u(ye))},[T,u,C]),de=x.useCallback(function(ye,Me){var pt=[],at=[];ye.forEach(function(ht){var _t=Dje(ht,D),yn=eq(_t,2),_n=yn[0],ri=yn[1],hi=Mje(ht,s,o),Qt=eq(hi,2),An=Qt[0],Ht=Qt[1],rr=P?P(ht):null;if(_n&&An&&!rr)pt.push(ht);else{var Ci=[ri,Ht];rr&&(Ci=Ci.concat(rr)),at.push({file:ht,errors:Ci.filter(function(xs){return xs})})}}),(!a&&pt.length>1||a&&l>=1&&pt.length>l)&&(pt.forEach(function(ht){at.push({file:ht,errors:[jPt]})}),pt.splice(0)),F({acceptedFiles:pt,fileRejections:at,type:"setFiles"}),d&&d(pt,at,Me),at.length>0&&p&&p(at,Me),pt.length>0&&h&&h(pt,Me)},[F,a,D,s,o,l,d,h,p,P]),me=x.useCallback(function(ye){ye.preventDefault(),ye.persist(),le(ye),Z.current=[],HM(ye)&&Promise.resolve(i(ye)).then(function(Me){Bj(ye)&&!C||de(Me,ye)}).catch(function(Me){return se(Me)}),F({type:"reset"})},[i,de,se,C]),te=x.useCallback(function(){if(V.current){F({type:"openDialog"}),L();var ye={multiple:a,types:M};window.showOpenFilePicker(ye).then(function(Me){return i(Me)}).then(function(Me){de(Me,null),F({type:"closeDialog"})}).catch(function(Me){UPt(Me)?(A(Me),F({type:"closeDialog"})):HPt(Me)?(V.current=!1,N.current?(N.current.value=null,N.current.click()):se(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):se(Me)});return}N.current&&(F({type:"openDialog"}),L(),N.current.value=null,N.current.click())},[F,L,A,y,de,se,M,a]),Ee=x.useCallback(function(ye){!T.current||!T.current.isEqualNode(ye.target)||(ye.key===" "||ye.key==="Enter"||ye.keyCode===32||ye.keyCode===13)&&(ye.preventDefault(),te())},[T,te]),we=x.useCallback(function(){F({type:"focus"})},[]),ke=x.useCallback(function(){F({type:"blur"})},[]),je=x.useCallback(function(){w||(BPt()?setTimeout(te,0):te())},[w,te]),nt=function(Me){return r?null:Me},Re=function(Me){return S?null:nt(Me)},G=function(Me){return E?null:nt(Me)},le=function(Me){C&&Me.stopPropagation()},Oe=x.useMemo(function(){return function(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Me=ye.refKey,pt=Me===void 0?"ref":Me,at=ye.role,ht=ye.onKeyDown,_t=ye.onFocus,yn=ye.onBlur,_n=ye.onClick,ri=ye.onDragEnter,hi=ye.onDragOver,Qt=ye.onDragLeave,An=ye.onDrop,Ht=Wj(ye,YPt);return ki(ki(cY({onKeyDown:Re(Jd(ht,Ee)),onFocus:Re(Jd(_t,we)),onBlur:Re(Jd(yn,ke)),onClick:nt(Jd(_n,je)),onDragEnter:G(Jd(ri,fe)),onDragOver:G(Jd(hi,ce)),onDragLeave:G(Jd(Qt,ae)),onDrop:G(Jd(An,me)),role:typeof at=="string"&&at!==""?at:"presentation"},pt,T),!r&&!S?{tabIndex:0}:{}),Ht)}},[T,Ee,we,ke,je,fe,ce,ae,me,S,E,r]),Ue=x.useCallback(function(ye){ye.stopPropagation()},[]),Fe=x.useMemo(function(){return function(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Me=ye.refKey,pt=Me===void 0?"ref":Me,at=ye.onChange,ht=ye.onClick,_t=Wj(ye,GPt),yn=cY({accept:D,multiple:a,type:"file",style:{display:"none"},onChange:nt(Jd(at,me)),onClick:nt(Jd(ht,Ue)),tabIndex:-1},pt,N);return ki(ki({},yn),_t)}},[N,n,a,me,r]);return ki(ki({},W),{},{isFocused:q&&!r,getRootProps:Oe,getInputProps:Fe,rootRef:T,inputRef:N,open:nt(te)})}function sAt(e,t){switch(t.type){case"focus":return ki(ki({},e),{},{isFocused:!0});case"blur":return ki(ki({},e),{},{isFocused:!1});case"openDialog":return ki(ki({},uY),{},{isFileDialogActive:!0});case"closeDialog":return ki(ki({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ki(ki({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ki(ki({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return ki({},uY);default:return e}}function O1e(){}function Fje(e){return new Promise(t=>{const n=new FileReader;n.readAsDataURL(e),n.onload=r=>{var i;if((i=r.target)!=null&&i.result){const o=r.target.result,s=o.slice(o.indexOf(",")+1);t(s)}}})}function aAt(e){return Promise.all(e.map(t=>Fje(t).then(n=>[t.name,n])))}class lAt{constructor(){ve(this,"tagName","marimo-file");ve(this,"validator",Y.object({filetypes:Y.array(Y.string()),multiple:Y.boolean(),kind:Y.enum(["button","area"]),label:Y.string().nullable()}))}render(t){return b.jsx(fAt,{label:t.data.label,filetypes:t.data.filetypes,multiple:t.data.multiple,kind:t.data.kind,value:t.value,setValue:t.setValue})}}function cAt(e){const t={},n=(r,i)=>{Object.hasOwnProperty.call(t,r)?t[r].push(i):t[r]=[i]};return e.forEach(r=>{switch(r){case".png":case".jpg":case".jpeg":case".gif":case".avif":case".bmp":case".ico":case".svg":case".tiff":case".webp":n("image/*",r);break;case".avi":case".mp4":case".mpeg":case".ogg":case".webm":n("video/*",r);break;case".pdf":n("application/pdf",r);break;case".csv":n("text/csv",r);break;default:n("text/plain",r)}}),t}const uAt=1e8,fAt=e=>{const t=cAt(e.filetypes),{setValue:n,kind:r,multiple:i,value:o}=e,{getRootProps:s,getInputProps:a,isFocused:l,isDragAccept:c,isDragReject:u}=Poe({accept:t,multiple:i,maxSize:uAt,onError:p=>{console.error(p),yr({title:"File upload failed",description:p.message,variant:"danger"})},onDropRejected:p=>{yr({title:"File upload failed",description:b.jsx("div",{className:"flex flex-col gap-1",children:p.map(g=>b.jsxs("div",{children:[g.file.name," (",g.errors.map(v=>v.message).join(", "),")"]},g.file.name))}),variant:"danger"})},onDrop:p=>{aAt(p).then(g=>{n(g)}).catch(g=>{console.error(g),yr({title:"File upload failed",description:"Failed to convert file to base64.",variant:"danger"})})}});if(r==="button"){const p=e.label??"Upload";return b.jsxs(b.Fragment,{children:[b.jsxs("button",{"data-testid":"marimo-plugin-file-upload-button",...s({}),className:pv({variant:"secondary",size:"xs"}),children:[Da({html:p}),b.jsx(jLe,{size:14,className:"ml-2"})]}),b.jsx("input",{...a({}),type:"file"})]})}const f=o.map(([p,g])=>b.jsx("li",{children:p},p)),d=f.length>0,h=e.label??"Drag and drop files here, or click to open file browser";return b.jsxs("section",{children:[b.jsxs("div",{className:be("mt-3 mb-2 w-full flex flex-col items-center justify-center ","px-6 py-6 sm:px-8 sm:py-8 md:py-10 md:px-16","border rounded-sm","text-sm text-muted-foreground","shadow-smSolid","hover:bg-muted/60","hover:cursor-pointer","active:shadow-xsSolid","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-accent",!l&&"bg-muted border-input/60",l&&"bg-muted/60 border-accent/40",c&&"bg-muted/60 border-accent/40 shadow-xsSolid",u&&"bg-muted/60 border-destructive/60 shadow-xsSolid"),...s(),children:[b.jsx("input",{...a()}),d?b.jsxs("span",{children:["To re-upload: ",Da({html:h})]}):b.jsx("span",{className:"mt-0",children:Da({html:h})})]}),b.jsx("aside",{children:d?b.jsxs("span",{className:"markdown",children:[b.jsx("strong",{children:"Uploaded files"}),b.jsx("ul",{style:{margin:0},children:f})]}):null})]})};function MR(e){return{withData(t){return{withFunctions(n){return{renderer(r){return{tagName:e,validator:t,functions:n,render:r}}}},renderer(n){return{tagName:e,validator:t,render:n}}}}}}const fP={input(e){return{output(t){return{input:e,output:t}}}}},tq="focusScope.autoFocusOnMount",nq="focusScope.autoFocusOnUnmount",x1e={bubbles:!1,cancelable:!0},gz=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=x.useState(null),c=Xs(i),u=Xs(o),f=x.useRef(null),d=Yt(t,g=>l(g)),h=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let g=function(m){if(h.paused||!a)return;const w=m.target;a.contains(w)?f.current=w:Hm(f.current,{select:!0})},v=function(m){if(h.paused||!a)return;const w=m.relatedTarget;w!==null&&(a.contains(w)||Hm(f.current,{select:!0}))},y=function(m){if(document.activeElement===document.body)for(const S of m)S.removedNodes.length>0&&Hm(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",v);const O=new MutationObserver(y);return a&&O.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v),O.disconnect()}}},[r,a,h.paused]),x.useEffect(()=>{if(a){S1e.add(h);const g=document.activeElement;if(!a.contains(g)){const y=new CustomEvent(tq,x1e);a.addEventListener(tq,c),a.dispatchEvent(y),y.defaultPrevented||(dAt(yAt(zje(a)),{select:!0}),document.activeElement===g&&Hm(a))}return()=>{a.removeEventListener(tq,c),setTimeout(()=>{const y=new CustomEvent(nq,x1e);a.addEventListener(nq,u),a.dispatchEvent(y),y.defaultPrevented||Hm(g??document.body,{select:!0}),a.removeEventListener(nq,u),S1e.remove(h)},0)}}},[a,c,u,h]);const p=x.useCallback(g=>{if(!n&&!r||h.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(v&&y){const O=g.currentTarget,[m,w]=hAt(O);m&&w?!g.shiftKey&&y===w?(g.preventDefault(),n&&Hm(m,{select:!0})):g.shiftKey&&y===m&&(g.preventDefault(),n&&Hm(w,{select:!0})):y===O&&g.preventDefault()}},[n,r,h.paused]);return x.createElement(Ot.div,oe({tabIndex:-1},s,{ref:d,onKeyDown:p}))});function dAt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Hm(r,{select:t}),document.activeElement!==n)return}function hAt(e){const t=zje(e),n=w1e(t,e),r=w1e(t.reverse(),e);return[n,r]}function zje(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function w1e(e,t){for(const n of e)if(!pAt(n,{upTo:t}))return n}function pAt(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gAt(e){return e instanceof HTMLInputElement&&"select"in e}function Hm(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gAt(e)&&t&&e.select()}}const S1e=mAt();function mAt(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=E1e(e,t),e.unshift(t)},remove(t){var n;e=E1e(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function E1e(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yAt(e){return e.filter(t=>t.tagName!=="A")}let rq=0;function mz(){x.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:C1e()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:C1e()),rq++,()=>{rq===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),rq--}},[])}function C1e(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var $T="right-scroll-bar-position",TT="width-before-scroll-bar",vAt="with-scroll-bars-hidden",bAt="--removed-body-scroll-bar-size";function OAt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function xAt(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function Qje(e,t){return xAt(t||null,function(n){return e.forEach(function(r){return OAt(r,n)})})}function wAt(e){return e}function SAt(e,t){t===void 0&&(t=wAt);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var u=s;s=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return i}function Bje(e){e===void 0&&(e={});var t=SAt(null);return t.options=Ea({async:!0,ssr:!1},e),t}var Wje=function(e){var t=e.sideCar,n=$oe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Ea({},n))};Wje.isSideCarExport=!0;function qje(e,t){return e.useMedium(t),Wje}var Vje=Bje(),iq=function(){},yz=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:iq,onWheelCapture:iq,onTouchMoveCapture:iq}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,d=e.sideCar,h=e.noIsolation,p=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,O=$oe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),m=d,w=Qje([n,t]),S=Ea(Ea({},O),i);return x.createElement(x.Fragment,null,u&&x.createElement(m,{sideCar:Vje,removeScrollBar:c,shards:f,noIsolation:h,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:n}),s?x.cloneElement(x.Children.only(a),Ea(Ea({},S),{ref:w})):x.createElement(y,Ea({},S,{className:l,ref:w}),a))});yz.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yz.classNames={fullWidth:TT,zeroRight:$T};var EAt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function CAt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=EAt();return t&&e.setAttribute("nonce",t),e}function _At(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kAt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $At=function(){var e=0,t=null;return{add:function(n){e==0&&(t=CAt())&&(_At(t,n),kAt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},TAt=function(){var e=$At();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Aoe=function(){var e=TAt(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},PAt={left:0,top:0,right:0,gap:0},oq=function(e){return parseInt(e||"",10)||0},AAt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[oq(n),oq(r),oq(i)]},RAt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return PAt;var t=AAt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},DAt=Aoe(),MAt=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(vAt,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(a,"px ").concat(r,`;
  }
  body {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(o,`px;
    padding-right: `).concat(s,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(a,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat($T,` {
    right: `).concat(a,"px ").concat(r,`;
  }
  
  .`).concat(TT,` {
    margin-right: `).concat(a,"px ").concat(r,`;
  }
  
  .`).concat($T," .").concat($T,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(TT," .").concat(TT,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body {
    `).concat(bAt,": ").concat(a,`px;
  }
`)},Uje=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=x.useMemo(function(){return RAt(i)},[i]);return x.createElement(DAt,{styles:MAt(o,!t,i,n?"":"!important")})},fY=!1;if(typeof window<"u")try{var XM=Object.defineProperty({},"passive",{get:function(){return fY=!0,!0}});window.addEventListener("test",XM,XM),window.removeEventListener("test",XM,XM)}catch{fY=!1}var Rx=fY?{passive:!1}:!1,NAt=function(e){return e.tagName==="TEXTAREA"},Hje=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!NAt(e)&&n[t]==="visible")},IAt=function(e){return Hje(e,"overflowY")},LAt=function(e){return Hje(e,"overflowX")},_1e=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Xje(e,n);if(r){var i=Zje(e,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},jAt=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},FAt=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Xje=function(e,t){return e==="v"?IAt(t):LAt(t)},Zje=function(e,t){return e==="v"?jAt(t):FAt(t)},zAt=function(e,t){return e==="h"&&t==="rtl"?-1:1},QAt=function(e,t,n,r,i){var o=zAt(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,d=0;do{var h=Zje(e,a),p=h[0],g=h[1],v=h[2],y=g-v-o*p;(p||y)&&Xje(e,a)&&(f+=y,d+=p),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(i&&f===0||!i&&s>f)||!u&&(i&&d===0||!i&&-s>d))&&(c=!0),c},ZM=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},k1e=function(e){return[e.deltaX,e.deltaY]},$1e=function(e){return e&&"current"in e?e.current:e},BAt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},WAt=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},qAt=0,Dx=[];function VAt(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(qAt++)[0],o=x.useState(function(){return Aoe()})[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=zj([e.lockRef.current],(e.shards||[]).map($1e),!0).filter(Boolean);return g.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=x.useCallback(function(g,v){if("touches"in g&&g.touches.length===2)return!s.current.allowPinchZoom;var y=ZM(g),O=n.current,m="deltaX"in g?g.deltaX:O[0]-y[0],w="deltaY"in g?g.deltaY:O[1]-y[1],S,E=g.target,C=Math.abs(m)>Math.abs(w)?"h":"v";if("touches"in g&&C==="h"&&E.type==="range")return!1;var k=_1e(C,E);if(!k)return!0;if(k?S=C:(S=C==="v"?"h":"v",k=_1e(C,E)),!k)return!1;if(!r.current&&"changedTouches"in g&&(m||w)&&(r.current=S),!S)return!0;var P=r.current||S;return QAt(P,v,g,P==="h"?m:w,!0)},[]),l=x.useCallback(function(g){var v=g;if(!(!Dx.length||Dx[Dx.length-1]!==o)){var y="deltaY"in v?k1e(v):ZM(v),O=t.current.filter(function(S){return S.name===v.type&&S.target===v.target&&BAt(S.delta,y)})[0];if(O&&O.should){v.cancelable&&v.preventDefault();return}if(!O){var m=(s.current.shards||[]).map($1e).filter(Boolean).filter(function(S){return S.contains(v.target)}),w=m.length>0?a(v,m[0]):!s.current.noIsolation;w&&v.cancelable&&v.preventDefault()}}},[]),c=x.useCallback(function(g,v,y,O){var m={name:g,delta:v,target:y,should:O};t.current.push(m),setTimeout(function(){t.current=t.current.filter(function(w){return w!==m})},1)},[]),u=x.useCallback(function(g){n.current=ZM(g),r.current=void 0},[]),f=x.useCallback(function(g){c(g.type,k1e(g),g.target,a(g,e.lockRef.current))},[]),d=x.useCallback(function(g){c(g.type,ZM(g),g.target,a(g,e.lockRef.current))},[]);x.useEffect(function(){return Dx.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,Rx),document.addEventListener("touchmove",l,Rx),document.addEventListener("touchstart",u,Rx),function(){Dx=Dx.filter(function(g){return g!==o}),document.removeEventListener("wheel",l,Rx),document.removeEventListener("touchmove",l,Rx),document.removeEventListener("touchstart",u,Rx)}},[]);var h=e.removeScrollBar,p=e.inert;return x.createElement(x.Fragment,null,p?x.createElement(o,{styles:WAt(i)}):null,h?x.createElement(Uje,{gapMode:"margin"}):null)}const UAt=qje(Vje,VAt);var Yje=x.forwardRef(function(e,t){return x.createElement(yz,Ea({},e,{ref:t,sideCar:UAt}))});Yje.classNames=yz.classNames;const vz=Yje;var HAt=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mx=new WeakMap,YM=new WeakMap,GM={},sq=0,NR=function(e,t,n){t===void 0&&(t=HAt(e)),n===void 0&&(n="data-aria-hidden");var r=Array.isArray(e)?e:[e];GM[n]||(GM[n]=new WeakMap);var i=GM[n],o=[],s=new Set,a=function(c){!c||s.has(c)||(s.add(c),a(c.parentNode))};r.forEach(a);var l=function(c){!c||r.indexOf(c)>=0||Array.prototype.forEach.call(c.children,function(u){if(s.has(u))l(u);else{var f=u.getAttribute("aria-hidden"),d=f!==null&&f!=="false",h=(Mx.get(u)||0)+1,p=(i.get(u)||0)+1;Mx.set(u,h),i.set(u,p),o.push(u),h===1&&d&&YM.set(u,!0),p===1&&u.setAttribute(n,"true"),d||u.setAttribute("aria-hidden","true")}})};return l(t),s.clear(),sq++,function(){o.forEach(function(c){var u=Mx.get(c)-1,f=i.get(c)-1;Mx.set(c,u),i.set(c,f),u||(YM.has(c)||c.removeAttribute("aria-hidden"),YM.delete(c)),f||c.removeAttribute(n)}),sq--,sq||(Mx=new WeakMap,Mx=new WeakMap,YM=new WeakMap,GM={})}};const Gje="Dialog",[Kje,Jje]=uo(Gje),[XAt,jd]=Kje(Gje),ZAt=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=x.useRef(null),l=x.useRef(null),[c=!1,u]=ko({prop:r,defaultProp:i,onChange:o});return x.createElement(XAt,{scope:t,triggerRef:a,contentRef:l,contentId:Ra(),titleId:Ra(),descriptionId:Ra(),open:c,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(f=>!f),[u]),modal:s},n)},YAt="DialogTrigger",GAt=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jd(YAt,n),o=Yt(t,i.triggerRef);return x.createElement(Ot.button,oe({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Roe(i.open)},r,{ref:o,onClick:Xe(e.onClick,i.onOpenToggle)}))}),e3e="DialogPortal",[KAt,t3e]=Kje(e3e,{forceMount:void 0}),JAt=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=jd(e3e,t);return x.createElement(KAt,{scope:t,forceMount:n},x.Children.map(r,s=>x.createElement(Gs,{present:n||o.open},x.createElement(VC,{asChild:!0,container:i},s))))},dY="DialogOverlay",eRt=x.forwardRef((e,t)=>{const n=t3e(dY,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=jd(dY,e.__scopeDialog);return o.modal?x.createElement(Gs,{present:r||o.open},x.createElement(tRt,oe({},i,{ref:t}))):null}),tRt=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jd(dY,n);return x.createElement(vz,{as:vd,allowPinchZoom:!0,shards:[i.contentRef]},x.createElement(Ot.div,oe({"data-state":Roe(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),hE="DialogContent",nRt=x.forwardRef((e,t)=>{const n=t3e(hE,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=jd(hE,e.__scopeDialog);return x.createElement(Gs,{present:r||o.open},o.modal?x.createElement(rRt,oe({},i,{ref:t})):x.createElement(iRt,oe({},i,{ref:t})))}),rRt=x.forwardRef((e,t)=>{const n=jd(hE,e.__scopeDialog),r=x.useRef(null),i=Yt(t,n.contentRef,r);return x.useEffect(()=>{const o=r.current;if(o)return NR(o)},[]),x.createElement(n3e,oe({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Xe(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Xe(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Xe(e.onFocusOutside,o=>o.preventDefault())}))}),iRt=x.forwardRef((e,t)=>{const n=jd(hE,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return x.createElement(n3e,oe({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),n3e=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=jd(hE,n),l=x.useRef(null),c=Yt(t,l);return mz(),x.createElement(x.Fragment,null,x.createElement(gz,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},x.createElement(qC,oe({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Roe(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),r3e="DialogTitle",oRt=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jd(r3e,n);return x.createElement(Ot.h2,oe({id:i.titleId},r,{ref:t}))}),sRt="DialogDescription",aRt=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jd(sRt,n);return x.createElement(Ot.p,oe({id:i.descriptionId},r,{ref:t}))}),lRt="DialogClose",cRt=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=jd(lRt,n);return x.createElement(Ot.button,oe({type:"button"},r,{ref:t,onClick:Xe(e.onClick,()=>i.onOpenChange(!1))}))});function Roe(e){return e?"open":"closed"}const uRt="DialogTitleWarning",[fRt,mGn]=mgt(uRt,{contentName:hE,titleName:r3e,docsSlug:"dialog"}),i3e=ZAt,dRt=GAt,Doe=JAt,Moe=eRt,Noe=nRt,Ioe=oRt,Loe=aRt,joe=cRt,hRt="AlertDialog",[pRt,yGn]=uo(hRt,[Jje]),bv=Jje(),gRt=e=>{const{__scopeAlertDialog:t,...n}=e,r=bv(t);return x.createElement(i3e,oe({},r,n,{modal:!0}))},mRt=e=>{const{__scopeAlertDialog:t,...n}=e,r=bv(t);return x.createElement(Doe,oe({},r,n))},yRt=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bv(n);return x.createElement(Moe,oe({},i,r,{ref:t}))}),o3e="AlertDialogContent",[vRt,bRt]=pRt(o3e),ORt=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=bv(n),s=x.useRef(null),a=Yt(t,s),l=x.useRef(null);return x.createElement(fRt,{contentName:o3e,titleName:xRt,docsSlug:"alert-dialog"},x.createElement(vRt,{scope:n,cancelRef:l},x.createElement(Noe,oe({role:"alertdialog"},o,i,{ref:a,onOpenAutoFocus:Xe(i.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)===null||u===void 0||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault()}),x.createElement(Bre,null,r),!1)))}),xRt="AlertDialogTitle",wRt=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bv(n);return x.createElement(Ioe,oe({},i,r,{ref:t}))}),SRt=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bv(n);return x.createElement(Loe,oe({},i,r,{ref:t}))}),ERt=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=bv(n);return x.createElement(joe,oe({},i,r,{ref:t}))}),CRt="AlertDialogCancel",_Rt=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=bRt(CRt,n),o=bv(n),s=Yt(t,i);return x.createElement(joe,oe({},o,r,{ref:s}))}),kRt=gRt,s3e=mRt,a3e=yRt,l3e=ORt,Foe=ERt,c3e=_Rt,u3e=wRt,f3e=SRt;function zoe(){const[e,t]=x.useState(null);return{onOpenAutoFocus:()=>{t(document.activeElement)},onCloseAutoFocus:i=>{document.activeElement===document.body&&(e instanceof HTMLElement&&e.focus(),i.preventDefault())}}}const hY=kRt,d3e=({children:e,...t})=>b.jsx(s3e,{...t,children:b.jsx("div",{className:"fixed inset-0 z-50 flex items-end justify-center sm:items-start sm:top-[15%]",children:e})});d3e.displayName=s3e.displayName;const h3e=x.forwardRef(({className:e,children:t,...n},r)=>b.jsx(a3e,{className:be("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm transition-opacity animate-in fade-in",e),...n,ref:r}));h3e.displayName=a3e.displayName;const qj=x.forwardRef(({className:e,...t},n)=>{const r=zoe();return b.jsxs(d3e,{children:[b.jsx(h3e,{}),b.jsx(l3e,{ref:n,className:be("fixed z-50 grid w-full max-w-2xl scale-100 gap-4 border bg-background p-6 opacity-100 shadow-sm animate-in fade-in-90 slide-in-from-bottom-10 sm:rounded-lg sm:zoom-in-90 sm:slide-in-from-bottom-0 md:w-full",e),...r,...t})]})});qj.displayName=l3e.displayName;const bz=({className:e,...t})=>b.jsx("div",{className:be("flex flex-col space-y-2 text-center sm:text-left",e),...t});bz.displayName="AlertDialogHeader";const Vj=({className:e,...t})=>b.jsx("div",{className:be("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Vj.displayName="AlertDialogFooter";const Oz=x.forwardRef(({className:e,...t},n)=>b.jsx(u3e,{ref:n,className:be("text-lg font-semibold",e),...t}));Oz.displayName=u3e.displayName;const Qoe=x.forwardRef(({className:e,...t},n)=>b.jsx(f3e,{ref:n,className:be("text-muted-foreground",e),...t}));Qoe.displayName=f3e.displayName;const xz=x.forwardRef(({className:e,...t},n)=>b.jsx(Foe,{ref:n,className:be(pv(),e),...t}));xz.displayName=Foe.displayName;const wz=x.forwardRef(({className:e,...t},n)=>b.jsx(Foe,{ref:n,className:be(pv({variant:"destructive"}),e),...t}));wz.displayName="AlertDialogDestructiveAction";const p3e=x.forwardRef(({className:e,...t},n)=>b.jsx(c3e,{ref:n,className:be(pv({variant:"secondary"}),"mt-2 sm:mt-0",e),...t}));p3e.displayName=c3e.displayName;const pE=({error:e,className:t})=>{const[n,r]=x.useState(!1);if(!e)return null;const i=_R(e);return b.jsxs(b.Fragment,{children:[b.jsx(gE,{className:t,clickable:!0,onClick:()=>r(!0),children:b.jsx("span",{className:"line-clamp-4",children:i})}),b.jsx(hY,{open:n,onOpenChange:r,children:b.jsxs(qj,{className:"max-w-[80%] max-h-[80%] overflow-hidden flex flex-col",children:[b.jsx(bz,{children:b.jsx(Oz,{className:"text-error",children:"Error"})}),b.jsx("pre",{className:"text-error text-sm p-2 font-mono overflow-auto",children:i}),b.jsx(Vj,{children:b.jsx(xz,{autoFocus:!0,onClick:()=>r(!1),children:"Ok"})})]})})]})},$Rt=Ao("text-sm p-2 border whitespace-pre-wrap",{variants:{kind:{danger:"text-error border-[var(--red-6)] shadow-smError bg-[var(--red-1)]",info:"text-primary border-[var(--blue-6)] shadow-smAccent bg-[var(--blue-1)]",warn:"text-warning border-[var(--yellow-6)] bg-[var(--yellow-2)]"},clickable:{true:"cursor-pointer"}},compoundVariants:[{clickable:!0,kind:"danger",className:"hover:bg-[var(--red-3)]"},{clickable:!0,kind:"info",className:"hover:bg-[var(--blue-3)]"},{clickable:!0,kind:"warn",className:"hover:bg-[var(--yellow-3)]"}],defaultVariants:{kind:"info"}}),gE=({kind:e,clickable:t,className:n,children:r,...i})=>b.jsx("div",{className:be($Rt({kind:e,clickable:t}),n),...i,children:r}),TRt=MR("marimo-form").withData(Y.object({label:Y.string().nullable(),elementId:Y.string(),bordered:Y.boolean().default(!0),loading:Y.boolean().default(!1),submitButtonLabel:Y.string().default("Submit"),submitButtonTooltip:Y.string().optional(),submitButtonDisabled:Y.boolean().default(!1),clearOnSubmit:Y.boolean().default(!1),showClearButton:Y.boolean().default(!1),clearButtonLabel:Y.string().default("Clear"),clearButtonTooltip:Y.string().optional(),shouldValidate:Y.boolean().optional()})).withFunctions({validate:fP.input(Y.object({value:Y.unknown()})).output(Y.string().nullish())}).renderer(({data:e,functions:t,...n})=>b.jsx(UC,{children:b.jsx(ARt,{...e,...n,...t})})),PRt=({children:e,currentValue:t,newValue:n,setValue:r,label:i,bordered:o,loading:s,submitButtonLabel:a,submitButtonTooltip:l,submitButtonDisabled:c,clearOnSubmit:u,showClearButton:f,clearButtonLabel:d,clearButtonTooltip:h,validate:p,shouldValidate:g})=>{const v=x.useRef(null),y=n===t,O=y?"secondary":"action",[m,w]=x.useState(null),S=()=>{v.current&&pY(v.current)};return b.jsx("form",{className:"contents",ref:v,onSubmit:async E=>{if(E.preventDefault(),g){const C=await p({value:n}).catch(k=>{w(k.message??"Error validating")});if(C!=null){w(C);return}}w(null),r(n),u&&S()},children:b.jsxs("div",{className:be("flex flex-col gap-4 rounded-lg py-4 px-8",{"bg-[var(--gray-1)] shadow-md border border-input":o,"bg-[var(--amber-1)] border-[var(--amber-7)]":!y&&o}),onKeyDown:E=>{E.key==="Enter"&&(E.ctrlKey||E.metaKey)&&(E.preventDefault(),E.stopPropagation(),r(n))},children:[i===null?null:b.jsx("div",{className:"text-center",children:Da({html:i})}),m!=null&&b.jsx(gE,{kind:"danger",className:"rounded",children:m??"Invalid input"}),b.jsx("div",{children:e}),b.jsxs("div",{className:"flex justify-end gap-2 font-code",children:[f&&T1e(b.jsx(St,{"data-testid":"marimo-plugin-form-clear-button",variant:"text",onClick:E=>{E.preventDefault(),S()},children:d}),h),T1e(b.jsxs(St,{"data-testid":"marimo-plugin-form-submit-button",variant:O,disabled:c||s,type:"submit",children:[s&&b.jsx(Nb,{className:"h-4 w-4 mr-2 animate-spin"}),a]}),l)]})]})})},ARt=({elementId:e,value:t,setValue:n,children:r,validate:i,...o})=>{const[s,a]=x.useState(ef.lookupValue(e));x.useEffect(()=>{a(ef.lookupValue(e))},[e]);const l=ef.lookupValue(e);return l!==s&&a(l),x.useEffect(()=>{const c=u=>{const f=u.detail.element;if(f===null||!(f instanceof Node))return;roe(f)===e&&a(u.detail.value)};return document.addEventListener(Rb,c),()=>{document.removeEventListener(Rb,c)}},[e,n]),b.jsx(PRt,{currentValue:t,newValue:s,setValue:n,validate:i,...o,children:r})};function T1e(e,t){return t?b.jsx(Wt,{content:t,children:e}):e}function pY(e){e instanceof HTMLElement&&(e.shadowRoot&&[...e.shadowRoot.children].forEach(pY),[...e.children].forEach(pY),vSt(e)&&e.reset())}var P1e=1,RRt=.9,DRt=.8,MRt=.17,aq=.1,lq=.999,NRt=.9999,IRt=.99,LRt=/[\\\/_+.#"@\[\(\{&]/,jRt=/[\\\/_+.#"@\[\(\{&]/g,FRt=/[\s-]/,g3e=/[\s-]/g;function gY(e,t,n,r,i,o,s){if(o===t.length)return i===e.length?P1e:IRt;var a=`${i},${o}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(o),c=n.indexOf(l,i),u=0,f,d,h,p;c>=0;)f=gY(e,t,n,r,c+1,o+1,s),f>u&&(c===i?f*=P1e:LRt.test(e.charAt(c-1))?(f*=DRt,h=e.slice(i,c-1).match(jRt),h&&i>0&&(f*=Math.pow(lq,h.length))):FRt.test(e.charAt(c-1))?(f*=RRt,p=e.slice(i,c-1).match(g3e),p&&i>0&&(f*=Math.pow(lq,p.length))):(f*=MRt,i>0&&(f*=Math.pow(lq,c-i))),e.charAt(c)!==t.charAt(o)&&(f*=NRt)),(f<aq&&n.charAt(c-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(c-1)!==r.charAt(o))&&(d=gY(e,t,n,r,c+1,o+2,s),d*aq>f&&(f=d*aq)),f>u&&(u=f),c=n.indexOf(l,c+1);return s[a]=u,u}function A1e(e){return e.toLowerCase().replace(g3e," ")}function zRt(e,t){return gY(e,t,A1e(e),A1e(t),0,0,{})}function bS(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function QRt(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function m3e(...e){return t=>e.forEach(n=>QRt(n,t))}function IR(...e){return x.useCallback(m3e(...e),e)}function BRt(e,t=[]){let n=[];function r(o,s){const a=x.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:d,children:h,...p}=f,g=(d==null?void 0:d[e][l])||a,v=x.useMemo(()=>p,Object.values(p));return x.createElement(g.Provider,{value:v},h)}function u(f,d){const h=(d==null?void 0:d[e][l])||a,p=x.useContext(h);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,u]}const i=()=>{const o=n.map(s=>x.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,WRt(i,...t)]}function WRt(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const mY=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},qRt=YS.useId||(()=>{});let VRt=0;function cq(e){const[t,n]=x.useState(qRt());return mY(()=>{e||n(r=>r??String(VRt++))},[e]),e||(t?`radix-${t}`:"")}function Fb(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function URt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=HRt({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=Fb(n),l=x.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else i(c)},[o,e,i,a]);return[s,l]}function HRt({defaultProp:e,onChange:t}){const n=x.useState(e),[r]=n,i=x.useRef(r),o=Fb(t);return x.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const Boe=x.forwardRef((e,t)=>{const{children:n,...r}=e,i=x.Children.toArray(n),o=i.find(ZRt);if(o){const s=o.props.children,a=i.map(l=>l===o?x.Children.count(s)>1?x.Children.only(null):x.isValidElement(s)?s.props.children:null:l);return x.createElement(yY,oe({},r,{ref:t}),x.isValidElement(s)?x.cloneElement(s,void 0,a):null)}return x.createElement(yY,oe({},r,{ref:t}),n)});Boe.displayName="Slot";const yY=x.forwardRef((e,t)=>{const{children:n,...r}=e;return x.isValidElement(n)?x.cloneElement(n,{...YRt(r,n.props),ref:m3e(t,n.ref)}):x.Children.count(n)>1?x.Children.only(null):null});yY.displayName="SlotClone";const XRt=({children:e})=>x.createElement(x.Fragment,null,e);function ZRt(e){return x.isValidElement(e)&&e.type===XRt}function YRt(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?n[r]=(...a)=>{o==null||o(...a),i==null||i(...a)}:r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const GRt=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"],Sz=GRt.reduce((e,t)=>{const n=x.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?Boe:t;return x.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),x.createElement(a,oe({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function KRt(e,t){e&&as.flushSync(()=>e.dispatchEvent(t))}function JRt(e){const t=Fb(e);x.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const vY="dismissableLayer.update",eDt="dismissableLayer.pointerDownOutside",tDt="dismissableLayer.focusOutside";let R1e;const nDt=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rDt=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,c=x.useContext(nDt),[u,f]=x.useState(null),[,d]=x.useState({}),h=IR(t,E=>f(E)),p=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(g),y=u?p.indexOf(u):-1,O=c.layersWithOutsidePointerEventsDisabled.size>0,m=y>=v,w=iDt(E=>{const C=E.target,k=[...c.branches].some(P=>P.contains(C));!m||k||(i==null||i(E),s==null||s(E),E.defaultPrevented||a==null||a())}),S=oDt(E=>{const C=E.target;[...c.branches].some(P=>P.contains(C))||(o==null||o(E),s==null||s(E),E.defaultPrevented||a==null||a())});return JRt(E=>{y===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))}),x.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(R1e=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),D1e(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=R1e)}},[u,n,c]),x.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),D1e())},[u,c]),x.useEffect(()=>{const E=()=>d({});return document.addEventListener(vY,E),()=>document.removeEventListener(vY,E)},[]),x.createElement(Sz.div,oe({},l,{ref:h,style:{pointerEvents:O?m?"auto":"none":void 0,...e.style},onFocusCapture:bS(e.onFocusCapture,S.onFocusCapture),onBlurCapture:bS(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:bS(e.onPointerDownCapture,w.onPointerDownCapture)}))});function iDt(e){const t=Fb(e),n=x.useRef(!1),r=x.useRef(()=>{});return x.useEffect(()=>{const i=s=>{if(s.target&&!n.current){let l=function(){y3e(eDt,t,a,{discrete:!0})};const a={originalEvent:s};s.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=l,document.addEventListener("click",r.current,{once:!0})):l()}n.current=!1},o=window.setTimeout(()=>{document.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),document.removeEventListener("pointerdown",i),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function oDt(e){const t=Fb(e),n=x.useRef(!1);return x.useEffect(()=>{const r=i=>{i.target&&!n.current&&y3e(tDt,t,{originalEvent:i},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function D1e(){const e=new CustomEvent(vY);document.dispatchEvent(e)}function y3e(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?KRt(i,o):i.dispatchEvent(o)}const uq="focusScope.autoFocusOnMount",fq="focusScope.autoFocusOnUnmount",M1e={bubbles:!1,cancelable:!0},sDt=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=x.useState(null),c=Fb(i),u=Fb(o),f=x.useRef(null),d=IR(t,g=>l(g)),h=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let g=function(y){if(h.paused||!a)return;const O=y.target;a.contains(O)?f.current=O:d1(f.current,{select:!0})},v=function(y){h.paused||!a||a.contains(y.relatedTarget)||d1(f.current,{select:!0})};return document.addEventListener("focusin",g),document.addEventListener("focusout",v),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",v)}}},[r,a,h.paused]),x.useEffect(()=>{if(a){I1e.add(h);const g=document.activeElement;if(!a.contains(g)){const y=new CustomEvent(uq,M1e);a.addEventListener(uq,c),a.dispatchEvent(y),y.defaultPrevented||(aDt(dDt(v3e(a)),{select:!0}),document.activeElement===g&&d1(a))}return()=>{a.removeEventListener(uq,c),setTimeout(()=>{const y=new CustomEvent(fq,M1e);a.addEventListener(fq,u),a.dispatchEvent(y),y.defaultPrevented||d1(g??document.body,{select:!0}),a.removeEventListener(fq,u),I1e.remove(h)},0)}}},[a,c,u,h]);const p=x.useCallback(g=>{if(!n&&!r||h.paused)return;const v=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,y=document.activeElement;if(v&&y){const O=g.currentTarget,[m,w]=lDt(O);m&&w?!g.shiftKey&&y===w?(g.preventDefault(),n&&d1(m,{select:!0})):g.shiftKey&&y===m&&(g.preventDefault(),n&&d1(w,{select:!0})):y===O&&g.preventDefault()}},[n,r,h.paused]);return x.createElement(Sz.div,oe({tabIndex:-1},s,{ref:d,onKeyDown:p}))});function aDt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(d1(r,{select:t}),document.activeElement!==n)return}function lDt(e){const t=v3e(e),n=N1e(t,e),r=N1e(t.reverse(),e);return[n,r]}function v3e(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function N1e(e,t){for(const n of e)if(!cDt(n,{upTo:t}))return n}function cDt(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function uDt(e){return e instanceof HTMLInputElement&&"select"in e}function d1(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&uDt(e)&&t&&e.select()}}const I1e=fDt();function fDt(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=L1e(e,t),e.unshift(t)},remove(t){var n;e=L1e(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function L1e(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dDt(e){return e.filter(t=>t.tagName!=="A")}const hDt=x.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=e;return r?HMe.createPortal(x.createElement(Sz.div,oe({},i,{ref:t})),r):null});function pDt(e,t){return x.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const Ez=e=>{const{present:t,children:n}=e,r=gDt(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),o=IR(r.ref,i.ref);return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:o}):null};Ez.displayName="Presence";function gDt(e){const[t,n]=x.useState(),r=x.useRef({}),i=x.useRef(e),o=x.useRef("none"),s=e?"mounted":"unmounted",[a,l]=pDt(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const c=KM(r.current);o.current=a==="mounted"?c:"none"},[a]),mY(()=>{const c=r.current,u=i.current;if(u!==e){const d=o.current,h=KM(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),mY(()=>{if(t){const c=f=>{const h=KM(r.current).includes(f.animationName);f.target===t&&h&&as.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(o.current=KM(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:x.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function KM(e){return(e==null?void 0:e.animationName)||"none"}let dq=0;function mDt(){x.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:j1e()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:j1e()),dq++,()=>{dq===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),dq--}},[])}function j1e(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var b3e=Bje(),hq=function(){},Cz=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:hq,onWheelCapture:hq,onTouchMoveCapture:hq}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,d=e.sideCar,h=e.noIsolation,p=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,O=$oe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),m=d,w=Qje([n,t]),S=Ea(Ea({},O),i);return x.createElement(x.Fragment,null,u&&x.createElement(m,{sideCar:b3e,removeScrollBar:c,shards:f,noIsolation:h,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:n}),s?x.cloneElement(x.Children.only(a),Ea(Ea({},S),{ref:w})):x.createElement(y,Ea({},S,{className:l,ref:w}),a))});Cz.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Cz.classNames={fullWidth:TT,zeroRight:$T};var bY=!1;if(typeof window<"u")try{var JM=Object.defineProperty({},"passive",{get:function(){return bY=!0,!0}});window.addEventListener("test",JM,JM),window.removeEventListener("test",JM,JM)}catch{bY=!1}var Nx=bY?{passive:!1}:!1,yDt=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},vDt=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},F1e=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=O3e(e,n);if(r){var i=x3e(e,n),o=i[1],s=i[2];if(o>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},bDt=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ODt=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},O3e=function(e,t){return e==="v"?yDt(t):vDt(t)},x3e=function(e,t){return e==="v"?bDt(t):ODt(t)},xDt=function(e,t){return e==="h"&&t==="rtl"?-1:1},wDt=function(e,t,n,r,i){var o=xDt(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,d=0;do{var h=x3e(e,a),p=h[0],g=h[1],v=h[2],y=g-v-o*p;(p||y)&&O3e(e,a)&&(f+=y,d+=p),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(i&&f===0||!i&&s>f)||!u&&(i&&d===0||!i&&-s>d))&&(c=!0),c},eN=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},z1e=function(e){return[e.deltaX,e.deltaY]},Q1e=function(e){return e&&"current"in e?e.current:e},SDt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},EDt=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},CDt=0,Ix=[];function _Dt(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(CDt++)[0],o=x.useState(function(){return Aoe()})[0],s=x.useRef(e);x.useEffect(function(){s.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=zj([e.lockRef.current],(e.shards||[]).map(Q1e),!0).filter(Boolean);return g.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=x.useCallback(function(g,v){if("touches"in g&&g.touches.length===2)return!s.current.allowPinchZoom;var y=eN(g),O=n.current,m="deltaX"in g?g.deltaX:O[0]-y[0],w="deltaY"in g?g.deltaY:O[1]-y[1],S,E=g.target,C=Math.abs(m)>Math.abs(w)?"h":"v";if("touches"in g&&C==="h"&&E.type==="range")return!1;var k=F1e(C,E);if(!k)return!0;if(k?S=C:(S=C==="v"?"h":"v",k=F1e(C,E)),!k)return!1;if(!r.current&&"changedTouches"in g&&(m||w)&&(r.current=S),!S)return!0;var P=r.current||S;return wDt(P,v,g,P==="h"?m:w,!0)},[]),l=x.useCallback(function(g){var v=g;if(!(!Ix.length||Ix[Ix.length-1]!==o)){var y="deltaY"in v?z1e(v):eN(v),O=t.current.filter(function(S){return S.name===v.type&&S.target===v.target&&SDt(S.delta,y)})[0];if(O&&O.should){v.preventDefault();return}if(!O){var m=(s.current.shards||[]).map(Q1e).filter(Boolean).filter(function(S){return S.contains(v.target)}),w=m.length>0?a(v,m[0]):!s.current.noIsolation;w&&v.preventDefault()}}},[]),c=x.useCallback(function(g,v,y,O){var m={name:g,delta:v,target:y,should:O};t.current.push(m),setTimeout(function(){t.current=t.current.filter(function(w){return w!==m})},1)},[]),u=x.useCallback(function(g){n.current=eN(g),r.current=void 0},[]),f=x.useCallback(function(g){c(g.type,z1e(g),g.target,a(g,e.lockRef.current))},[]),d=x.useCallback(function(g){c(g.type,eN(g),g.target,a(g,e.lockRef.current))},[]);x.useEffect(function(){return Ix.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,Nx),document.addEventListener("touchmove",l,Nx),document.addEventListener("touchstart",u,Nx),function(){Ix=Ix.filter(function(g){return g!==o}),document.removeEventListener("wheel",l,Nx),document.removeEventListener("touchmove",l,Nx),document.removeEventListener("touchstart",u,Nx)}},[]);var h=e.removeScrollBar,p=e.inert;return x.createElement(x.Fragment,null,p?x.createElement(o,{styles:EDt(i)}):null,h?x.createElement(Uje,{gapMode:"margin"}):null)}const kDt=qje(b3e,_Dt);var w3e=x.forwardRef(function(e,t){return x.createElement(Cz,Ea({},e,{ref:t,sideCar:kDt}))});w3e.classNames=Cz.classNames;const $Dt=w3e,S3e="Dialog",[E3e,vGn]=BRt(S3e),[TDt,HO]=E3e(S3e),PDt=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=x.useRef(null),l=x.useRef(null),[c=!1,u]=URt({prop:r,defaultProp:i,onChange:o});return x.createElement(TDt,{scope:t,triggerRef:a,contentRef:l,contentId:cq(),titleId:cq(),descriptionId:cq(),open:c,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(f=>!f),[u]),modal:s},n)},C3e="DialogPortal",[ADt,_3e]=E3e(C3e,{forceMount:void 0}),RDt=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=HO(C3e,t);return x.createElement(ADt,{scope:t,forceMount:n},x.Children.map(r,s=>x.createElement(Ez,{present:n||o.open},x.createElement(hDt,{asChild:!0,container:i},s))))},OY="DialogOverlay",DDt=x.forwardRef((e,t)=>{const n=_3e(OY,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=HO(OY,e.__scopeDialog);return o.modal?x.createElement(Ez,{present:r||o.open},x.createElement(MDt,oe({},i,{ref:t}))):null}),MDt=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=HO(OY,n);return x.createElement($Dt,{as:Boe,allowPinchZoom:!0,shards:[i.contentRef]},x.createElement(Sz.div,oe({"data-state":$3e(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),dP="DialogContent",NDt=x.forwardRef((e,t)=>{const n=_3e(dP,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=HO(dP,e.__scopeDialog);return x.createElement(Ez,{present:r||o.open},o.modal?x.createElement(IDt,oe({},i,{ref:t})):x.createElement(LDt,oe({},i,{ref:t})))}),IDt=x.forwardRef((e,t)=>{const n=HO(dP,e.__scopeDialog),r=x.useRef(null),i=IR(t,n.contentRef,r);return x.useEffect(()=>{const o=r.current;if(o)return NR(o)},[]),x.createElement(k3e,oe({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bS(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:bS(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:bS(e.onFocusOutside,o=>o.preventDefault())}))}),LDt=x.forwardRef((e,t)=>{const n=HO(dP,e.__scopeDialog),r=x.useRef(!1);return x.createElement(k3e,oe({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o;if((o=e.onCloseAutoFocus)===null||o===void 0||o.call(e,i),!i.defaultPrevented){var s;r.current||(s=n.triggerRef.current)===null||s===void 0||s.focus(),i.preventDefault()}r.current=!1},onInteractOutside:i=>{var o,s;(o=e.onInteractOutside)===null||o===void 0||o.call(e,i),i.defaultPrevented||(r.current=!0);const a=i.target;((s=n.triggerRef.current)===null||s===void 0?void 0:s.contains(a))&&i.preventDefault()}}))}),k3e=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=HO(dP,n),l=x.useRef(null),c=IR(t,l);return mDt(),x.createElement(x.Fragment,null,x.createElement(sDt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},x.createElement(rDt,oe({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":$3e(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)});function $3e(e){return e?"open":"closed"}const jDt=PDt,FDt=RDt,zDt=DDt,QDt=NDt;var BDt='[cmdk-list-sizer=""]',uk='[cmdk-group=""]',pq='[cmdk-group-items=""]',WDt='[cmdk-group-heading=""]',Woe='[cmdk-item=""]',B1e=`${Woe}:not([aria-disabled="true"])`,xY="cmdk-item-select",Gp="data-value",qDt=(e,t)=>zRt(e,t),T3e=x.createContext(void 0),LR=()=>x.useContext(T3e),P3e=x.createContext(void 0),qoe=()=>x.useContext(P3e),A3e=x.createContext(void 0),R3e=x.forwardRef((e,t)=>{let n=x.useRef(null),r=xw(()=>{var q,U,V;return{search:"",value:(V=(U=e.value)!=null?U:(q=e.defaultValue)==null?void 0:q.toLowerCase())!=null?V:"",filtered:{count:0,items:new Map,groups:new Set}}}),i=xw(()=>new Set),o=xw(()=>new Map),s=xw(()=>new Map),a=xw(()=>new Set),l=D3e(e),{label:c,children:u,value:f,onValueChange:d,filter:h,shouldFilter:p,vimBindings:g=!0,...v}=e,y=x.useId(),O=x.useId(),m=x.useId(),w=tMt();ZC(()=>{if(f!==void 0){let q=f.trim().toLowerCase();r.current.value=q,w(6,M),S.emit()}},[f]);let S=x.useMemo(()=>({subscribe:q=>(a.current.add(q),()=>a.current.delete(q)),snapshot:()=>r.current,setState:(q,U,V)=>{var H,Z,ee;if(!Object.is(r.current[q],U)){if(r.current[q]=U,q==="search")D(),k(),w(1,P);else if(q==="value")if(((H=l.current)==null?void 0:H.value)!==void 0){let se=U??"";(ee=(Z=l.current).onValueChange)==null||ee.call(Z,se);return}else V||w(5,M);S.emit()}},emit:()=>{a.current.forEach(q=>q())}}),[]),E=x.useMemo(()=>({value:(q,U)=>{U!==s.current.get(q)&&(s.current.set(q,U),r.current.filtered.items.set(q,C(U)),w(2,()=>{k(),S.emit()}))},item:(q,U)=>(i.current.add(q),U&&(o.current.has(U)?o.current.get(U).add(q):o.current.set(U,new Set([q]))),w(3,()=>{D(),k(),r.current.value||P(),S.emit()}),()=>{s.current.delete(q),i.current.delete(q),r.current.filtered.items.delete(q);let V=L();w(4,()=>{D(),(V==null?void 0:V.getAttribute("id"))===q&&P(),S.emit()})}),group:q=>(o.current.has(q)||o.current.set(q,new Set),()=>{s.current.delete(q),o.current.delete(q)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],commandRef:n,listId:y,inputId:m,labelId:O}),[]);function C(q){var U,V;let H=(V=(U=l.current)==null?void 0:U.filter)!=null?V:qDt;return q?H(q,r.current.search):0}function k(){if(!n.current||!r.current.search||l.current.shouldFilter===!1)return;let q=r.current.filtered.items,U=[];r.current.filtered.groups.forEach(H=>{let Z=o.current.get(H),ee=0;Z.forEach(se=>{let fe=q.get(se);ee=Math.max(fe,ee)}),U.push([H,ee])});let V=n.current.querySelector(BDt);A().sort((H,Z)=>{var ee,se;let fe=H.getAttribute(Gp),ce=Z.getAttribute(Gp);return((ee=q.get(ce))!=null?ee:0)-((se=q.get(fe))!=null?se:0)}).forEach(H=>{let Z=H.closest(pq);Z?Z.appendChild(H.parentElement===Z?H:H.closest(`${pq} > *`)):V.appendChild(H.parentElement===V?H:H.closest(`${pq} > *`))}),U.sort((H,Z)=>Z[1]-H[1]).forEach(H=>{let Z=n.current.querySelector(`${uk}[${Gp}="${H[0]}"]`);Z==null||Z.parentElement.appendChild(Z)})}function P(){let q=A().find(V=>!V.ariaDisabled),U=q==null?void 0:q.getAttribute(Gp);S.setState("value",U||void 0)}function D(){if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=i.current.size;return}r.current.filtered.groups=new Set;let q=0;for(let U of i.current){let V=s.current.get(U),H=C(V);r.current.filtered.items.set(U,H),H>0&&q++}for(let[U,V]of o.current)for(let H of V)if(r.current.filtered.items.get(H)>0){r.current.filtered.groups.add(U);break}r.current.filtered.count=q}function M(){var q,U,V;let H=L();H&&(((q=H.parentElement)==null?void 0:q.firstChild)===H&&((V=(U=H.closest(uk))==null?void 0:U.querySelector(WDt))==null||V.scrollIntoView({block:"nearest"})),H.scrollIntoView({block:"nearest"}))}function L(){var q;return(q=n.current)==null?void 0:q.querySelector(`${Woe}[aria-selected="true"]`)}function A(){return Array.from(n.current.querySelectorAll(B1e))}function T(q){let U=A()[q];U&&S.setState("value",U.getAttribute(Gp))}function N(q){var U;let V=L(),H=A(),Z=H.findIndex(se=>se===V),ee=H[Z+q];(U=l.current)!=null&&U.loop&&(ee=Z+q<0?H[H.length-1]:Z+q===H.length?H[0]:H[Z+q]),ee&&S.setState("value",ee.getAttribute(Gp))}function j(q){let U=L(),V=U==null?void 0:U.closest(uk),H;for(;V&&!H;)V=q>0?JDt(V,uk):eMt(V,uk),H=V==null?void 0:V.querySelector(B1e);H?S.setState("value",H.getAttribute(Gp)):N(q)}let z=()=>T(A().length-1),W=q=>{q.preventDefault(),q.metaKey?z():q.altKey?j(1):N(1)},F=q=>{q.preventDefault(),q.metaKey?T(0):q.altKey?j(-1):N(-1)};return x.createElement("div",{ref:jR([n,t]),...v,"cmdk-root":"",onKeyDown:q=>{var U;if((U=v.onKeyDown)==null||U.call(v,q),!q.defaultPrevented)switch(q.key){case"n":case"j":{g&&q.ctrlKey&&W(q);break}case"ArrowDown":{W(q);break}case"p":case"k":{g&&q.ctrlKey&&F(q);break}case"ArrowUp":{F(q);break}case"Home":{q.preventDefault(),T(0);break}case"End":{q.preventDefault(),z();break}case"Enter":if(!q.nativeEvent.isComposing){q.preventDefault();let V=L();if(V){let H=new Event(xY);V.dispatchEvent(H)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:nMt},c),x.createElement(P3e.Provider,{value:S},x.createElement(T3e.Provider,{value:E},u)))}),VDt=x.forwardRef((e,t)=>{var n,r;let i=x.useId(),o=x.useRef(null),s=x.useContext(A3e),a=LR(),l=D3e(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;ZC(()=>a.item(i,s==null?void 0:s.id),[]);let u=M3e(i,o,[e.value,e.children,o]),f=qoe(),d=zb(S=>S.value&&S.value===u.current),h=zb(S=>c||a.filter()===!1?!0:S.search?S.filtered.items.get(i)>0:!0);x.useEffect(()=>{let S=o.current;if(!(!S||e.disabled))return S.addEventListener(xY,p),()=>S.removeEventListener(xY,p)},[h,e.onSelect,e.disabled]);function p(){var S,E;g(),(E=(S=l.current).onSelect)==null||E.call(S,u.current)}function g(){f.setState("value",u.current,!0)}if(!h)return null;let{disabled:v,value:y,onSelect:O,forceMount:m,...w}=e;return x.createElement("div",{ref:jR([o,t]),...w,id:i,"cmdk-item":"",role:"option","aria-disabled":v||void 0,"aria-selected":d||void 0,"data-disabled":v||void 0,"data-selected":d||void 0,onPointerMove:v?void 0:g,onClick:v?void 0:p},e.children)}),UDt=x.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,s=x.useId(),a=x.useRef(null),l=x.useRef(null),c=x.useId(),u=LR(),f=zb(p=>i||u.filter()===!1?!0:p.search?p.filtered.groups.has(s):!0);ZC(()=>u.group(s),[]),M3e(s,a,[e.value,e.heading,l]);let d=x.useMemo(()=>({id:s,forceMount:i}),[i]),h=x.createElement(A3e.Provider,{value:d},r);return x.createElement("div",{ref:jR([a,t]),...o,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&x.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},h))}),HDt=x.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=x.useRef(null),o=zb(s=>!s.search);return!n&&!o?null:x.createElement("div",{ref:jR([i,t]),...r,"cmdk-separator":"",role:"separator"})}),XDt=x.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=qoe(),s=zb(u=>u.search),a=zb(u=>u.value),l=LR(),c=x.useMemo(()=>{var u;let f=(u=l.commandRef.current)==null?void 0:u.querySelector(`${Woe}[${Gp}="${a}"]`);return f==null?void 0:f.getAttribute("id")},[a,l.commandRef]);return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:i?e.value:s,onChange:u=>{i||o.setState("search",u.target.value),n==null||n(u.target.value)}})}),ZDt=x.forwardRef((e,t)=>{let{children:n,...r}=e,i=x.useRef(null),o=x.useRef(null),s=LR();return x.useEffect(()=>{if(o.current&&i.current){let a=o.current,l=i.current,c,u=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let f=a.offsetHeight;l.style.setProperty("--cmdk-list-height",f.toFixed(1)+"px")})});return u.observe(a),()=>{cancelAnimationFrame(c),u.unobserve(a)}}},[]),x.createElement("div",{ref:jR([i,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:s.listId,"aria-labelledby":s.inputId},x.createElement("div",{ref:o,"cmdk-list-sizer":""},n))}),YDt=x.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:s,...a}=e;return x.createElement(jDt,{open:n,onOpenChange:r},x.createElement(FDt,{container:s},x.createElement(zDt,{"cmdk-overlay":"",className:i}),x.createElement(QDt,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(R3e,{ref:t,...a}))))}),GDt=x.forwardRef((e,t)=>{let n=x.useRef(!0),r=zb(i=>i.filtered.count===0);return x.useEffect(()=>{n.current=!1},[]),n.current||!r?null:x.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),KDt=x.forwardRef((e,t)=>{let{progress:n,children:r,...i}=e;return x.createElement("div",{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},x.createElement("div",{"aria-hidden":!0},r))}),dc=Object.assign(R3e,{List:ZDt,Item:VDt,Input:XDt,Group:UDt,Separator:HDt,Dialog:YDt,Empty:GDt,Loading:KDt});function JDt(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function eMt(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function D3e(e){let t=x.useRef(e);return ZC(()=>{t.current=e}),t}var ZC=typeof window>"u"?x.useEffect:x.useLayoutEffect;function xw(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function jR(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function zb(e){let t=qoe(),n=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,n,n)}function M3e(e,t,n){let r=x.useRef(),i=LR();return ZC(()=>{var o;let s=(()=>{var a;for(let l of n){if(typeof l=="string")return l.trim().toLowerCase();if(typeof l=="object"&&"current"in l)return l.current?(a=l.current.textContent)==null?void 0:a.trim().toLowerCase():r.current}})();i.value(e,s),(o=t.current)==null||o.setAttribute(Gp,s),r.current=s}),r}var tMt=()=>{let[e,t]=x.useState(),n=xw(()=>new Map);return ZC(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}},nMt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const _z=i3e,rMt=dRt,Voe=({className:e,children:t,...n})=>b.jsx(Doe,{...n,children:b.jsx("div",{className:be("fixed inset-0 z-50 flex items-start justify-center sm:items-start sm:top-[15%]",e),children:t})});Voe.displayName=Doe.displayName;const Uoe=x.forwardRef(({className:e,...t},n)=>b.jsx(Moe,{ref:n,className:be("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm transition-all duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in",e),...t}));Uoe.displayName=Moe.displayName;const gm=x.forwardRef(({className:e,children:t,usePortal:n=!0,...r},i)=>{const o=zoe(),s=b.jsxs(Noe,{ref:i,className:be("fixed z-50 grid w-full gap-4 rounded-b-lg border bg-background p-6 shadow-sm animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10 sm:max-w-lg sm:rounded-lg sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0",e),...o,...r,children:[t,b.jsxs(joe,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[b.jsx(rc,{className:"h-4 w-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]});return n?b.jsxs(Voe,{children:[b.jsx(Uoe,{}),s]}):s});gm.displayName=Noe.displayName;const YC=({className:e,...t})=>b.jsx("div",{className:be("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});YC.displayName="DialogHeader";const FR=({className:e,...t})=>b.jsx("div",{className:be("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});FR.displayName="DialogFooter";const Ov=x.forwardRef(({className:e,...t},n)=>b.jsx(Ioe,{ref:n,className:be("text-lg font-semibold leading-none tracking-tight",e),...t}));Ov.displayName=Ioe.displayName;const mE=x.forwardRef(({className:e,...t},n)=>b.jsx(Loe,{ref:n,className:be("text-sm text-muted-foreground",e),...t}));mE.displayName=Loe.displayName;const kz=Ao("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",{variants:{subcontent:{true:"shadow-lg"}}}),N3e=Ao("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",{variants:{inset:{true:"pl-8"}}}),I3e=Ao("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{}}),yE=Ao("absolute left-2 flex h-3.5 w-3.5 items-center justify-center",{variants:{}}),L3e=Ao("px-2 py-1.5 text-sm font-semibold",{variants:{inset:{true:"pl-8"}}}),Hoe=Ao("menu-item relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",{variants:{inset:{true:"pl-8"},variant:{default:"focus:bg-accent focus:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",danger:"focus:bg-[var(--red-5)] focus:text-[var(--red-12)] aria-selected:bg-[var(--red-5)] aria-selected:text-[var(--red-12)]"}},defaultVariants:{variant:"default"}}),Xoe=Ao("-mx-1 my-1 h-px bg-border",{variants:{}}),Zoe=({className:e,...t})=>b.jsx("span",{className:be("ml-auto text-xs tracking-widest opacity-60",e),...t});Zoe.displayName="MenuShortcut";const $z=x.forwardRef(({className:e,...t},n)=>b.jsx(dc,{ref:n,className:be("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));$z.displayName=dc.displayName;const iMt=({children:e,...t})=>b.jsx(_z,{...t,children:b.jsx(gm,{className:"overflow-hidden p-0 shadow-2xl",usePortal:!0,children:b.jsx($z,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Tz=x.forwardRef(({className:e,rootClassName:t,...n},r)=>b.jsxs("div",{className:be("flex items-center border-b px-3",t),"cmdk-input-wrapper":"",children:[b.jsx(SCt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),b.jsx(dc.Input,{ref:r,className:be("placeholder:text-foreground-muted flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...n})]}));Tz.displayName=dc.Input.displayName;const Yoe=x.forwardRef(({className:e,...t},n)=>b.jsx(dc.List,{ref:n,className:be("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Yoe.displayName=dc.List.displayName;const Pz=x.forwardRef((e,t)=>b.jsx(dc.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Pz.displayName=dc.Empty.displayName;const Uj=x.forwardRef(({className:e,...t},n)=>b.jsx(dc.Group,{ref:n,className:be("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Uj.displayName=dc.Group.displayName;const Goe=x.forwardRef(({className:e,...t},n)=>b.jsx(dc.Separator,{ref:n,className:Xoe({className:e}),...t}));Goe.displayName=dc.Separator.displayName;const hP=x.forwardRef(({className:e,variant:t,inset:n,...r},i)=>b.jsx(dc.Item,{ref:i,className:Hoe({className:e,variant:t,inset:n}),...r}));hP.displayName=dc.Item.displayName;const W1e=Zoe,j3e="Popover",[F3e,bGn]=uo(j3e,[vv]),Koe=vv(),[oMt,GC]=F3e(j3e),sMt=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=Koe(t),l=x.useRef(null),[c,u]=x.useState(!1),[f=!1,d]=ko({prop:r,defaultProp:i,onChange:o});return x.createElement($R,a,x.createElement(oMt,{scope:t,contentId:Ra(),triggerRef:l,open:f,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(h=>!h),[d]),hasCustomAnchor:c,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:s},n))},aMt="PopoverTrigger",lMt=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=GC(aMt,n),o=Koe(n),s=Yt(t,i.triggerRef),a=x.createElement(Ot.button,oe({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":B3e(i.open)},r,{ref:s,onClick:Xe(e.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:x.createElement(ez,oe({asChild:!0},o),a)}),z3e="PopoverPortal",[cMt,uMt]=F3e(z3e,{forceMount:void 0}),fMt=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=GC(z3e,t);return x.createElement(cMt,{scope:t,forceMount:n},x.createElement(Gs,{present:n||o.open},x.createElement(VC,{asChild:!0,container:i},r)))},pP="PopoverContent",dMt=x.forwardRef((e,t)=>{const n=uMt(pP,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=GC(pP,e.__scopePopover);return x.createElement(Gs,{present:r||o.open},o.modal?x.createElement(hMt,oe({},i,{ref:t})):x.createElement(pMt,oe({},i,{ref:t})))}),hMt=x.forwardRef((e,t)=>{const n=GC(pP,e.__scopePopover),r=x.useRef(null),i=Yt(t,r),o=x.useRef(!1);return x.useEffect(()=>{const s=r.current;if(s)return NR(s)},[]),x.createElement(vz,{as:vd,allowPinchZoom:!0},x.createElement(Q3e,oe({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Xe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Xe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Xe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),pMt=x.forwardRef((e,t)=>{const n=GC(pP,e.__scopePopover),r=x.useRef(!1),i=x.useRef(!1);return x.createElement(Q3e,oe({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:o=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}}))}),Q3e=x.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,d=GC(pP,n),h=Koe(n);return mz(),x.createElement(gz,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o},x.createElement(qC,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>d.onOpenChange(!1)},x.createElement(tz,oe({"data-state":B3e(d.open),role:"dialog",id:d.contentId},h,f,{ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function B3e(e){return e?"open":"closed"}const gMt=sMt,mMt=lMt,yMt=fMt,W3e=dMt,Joe=gMt,ese=mMt,Az=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>b.jsx(yMt,{children:b.jsx(W3e,{ref:i,align:t,sideOffset:n,className:be("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Az.displayName=W3e.displayName;const vMt=Ao("inline-flex items-center border rounded-full px-2 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary hover:bg-primary/60 border-transparent text-primary-foreground",defaultOutline:"bg-[var(--blue-2)] border-[var(--blue-8)] text-[var(--blue-11)]",secondary:"bg-secondary hover:bg-secondary/80 border-transparent text-secondary-foreground",destructive:"bg-[var(--red-2)] border-[var(--red-6)] text-[var(--red-9)] hover:bg-[var(--red-3)]",success:"bg-[var(--grass-2)] border-[var(--grass-5)] text-[var(--grass-9)] hover:bg-[var(--grass-3)]",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),tse=({className:e,variant:t,...n})=>b.jsx("div",{className:be(vMt({variant:t}),e),...n}),q3e=x.createContext({isSelected:()=>!1,onSelect:Yc.NOOP}),zR=({children:e,displayValue:t,className:n,placeholder:r,value:i,defaultValue:o,onValueChange:s,multiple:a=!1,shouldFilter:l=!0,filterFn:c,open:u,defaultOpen:f,onOpenChange:d,inputPlaceholder:h="Search...",search:p,onSearchChange:g,emptyState:v="Nothing found.",chips:y=!1,chipsClassName:O,keepPopoverOpenOnSelect:m})=>{const[w=!1,S]=ko({prop:u,defaultProp:f,onChange:d}),[E,C]=ko({prop:i,defaultProp:o,onChange:M=>{s==null||s(M)}}),k=M=>Array.isArray(E)?E.includes(M):E===M,P=M=>{let L=M;if(a)if(Array.isArray(E))if(E.includes(L)){const T=E.filter(N=>N!==M);L=T.length>0?T:[]}else L=[...E,L];else L=[L];else E===M&&(L=null);C(L),(m??a)||S(!1)},D=()=>a&&y&&r?r:E?Array.isArray(E)?E.length===0?r??"--":E.length===1&&t!==void 0?t(E[0]):`${E.length} selected`:t!==void 0?t(E):r??"--":r??"--";return b.jsxs("div",{className:be("relative"),children:[b.jsxs(Joe,{open:w,onOpenChange:S,children:[b.jsx(ese,{asChild:!0,children:b.jsxs("div",{className:be("flex h-6 w-fit mb-1 shadow-xsSolid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-smSolid focus:outline-none focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-mdSolid disabled:cursor-not-allowed disabled:opacity-50",n),"aria-expanded":w,children:[D()," ",b.jsx(P0,{className:"ml-3 w-4 h-4 opacity-50"})]})}),b.jsx(Az,{className:"w-full min-w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:b.jsxs($z,{filter:c,shouldFilter:l,children:[b.jsx(Tz,{placeholder:h,rootClassName:"px-1 h-8",autoFocus:!0,value:p,onValueChange:g}),b.jsxs(Yoe,{className:"max-h-60 py-.5",children:[b.jsx(Pz,{children:v}),b.jsx(q3e.Provider,{value:{isSelected:k,onSelect:P},children:e})]})]})})]}),a&&y&&b.jsx("div",{className:be("flex flex-col gap-1 items-start",O),children:Array.isArray(E)&&E.map(M=>M?b.jsxs(tse,{variant:"secondary",children:[(t==null?void 0:t(M))??String(M),b.jsx(zLe,{onClick:()=>{P(M)},className:"w-3 h-3 opacity-50 hover:opacity-100 ml-1 cursor-pointer"})]},String(M)):null)})]})},KC=ie.forwardRef(({children:e,className:t,value:n,onSelect:r},i)=>{const o=typeof n=="object"&&"value"in n?n.value:String(n),s=x.useContext(q3e);return b.jsxs(hP,{ref:i,className:be("pl-6 m-1 py-1",t),role:"option",value:o,onSelect:()=>{s.onSelect(n),r==null||r(n)},children:[s.isSelected(n)&&b.jsx(dm,{className:"absolute left-1 h-4 w-4"}),e]})});KC.displayName="ComboboxItem";class bMt{constructor(){ve(this,"tagName","marimo-multiselect");ve(this,"validator",Y.object({initialValue:Y.array(Y.string()),label:Y.string().nullable(),options:Y.array(Y.string()),fullWidth:Y.boolean().default(!1),maxSelections:Y.number().optional()}))}render(t){return b.jsx(OMt,{...t.data,value:t.value,setValue:t.setValue})}}const OMt=e=>{const t=x.useId();function n(r){e.maxSelections!=null&&r.length>e.maxSelections||e.setValue(r)}return b.jsx(fc,{label:e.label,id:t,fullWidth:e.fullWidth,children:b.jsx(zR,{displayValue:r=>r,placeholder:"Select...",multiple:!0,filterFn:xMt,className:be({"w-full":e.fullWidth}),value:e.value,onValueChange:r=>n(r||[]),children:e.options.map(r=>b.jsx(KC,{value:r,children:r},r))})})};function xMt(e,t){return t.split(/\s+/).every(i=>e.toLowerCase().includes(i.toLowerCase()))?1:0}class wMt{constructor(){ve(this,"tagName","marimo-number");ve(this,"validator",Y.object({initialValue:Y.number(),label:Y.string().nullable(),start:Y.number(),stop:Y.number(),step:Y.number().optional(),debounce:Y.boolean().default(!1),fullWidth:Y.boolean().default(!1)}))}render(t){return b.jsx(SMt,{...t.data,value:t.value,setValue:t.setValue})}}const SMt=e=>{const t=x.useRef(null),n=x.useId(),{value:r,onChange:i}=_oe({initialValue:e.value,delay:200,disabled:!e.debounce,onChange:e.setValue});return b.jsx(fc,{label:e.label,id:n,fullWidth:e.fullWidth,children:b.jsx(Wo,{"data-testid":"marimo-plugin-number-input",className:be("min-w-[3em]",e.fullWidth&&"w-full"),ref:t,type:"number",min:e.start,max:e.stop,step:e.step,value:r,onWheel:o=>{o.currentTarget.blur(),o.preventDefault()},onChange:o=>{i(o.target.valueAsNumber)},id:n})})},gq="rovingFocusGroup.onEntryFocus",EMt={bubbles:!1,cancelable:!0},nse="RovingFocusGroup",[wY,V3e,CMt]=jC(nse),[_Mt,JC]=uo(nse,[CMt]),[kMt,$Mt]=_Mt(nse),TMt=x.forwardRef((e,t)=>x.createElement(wY.Provider,{scope:e.__scopeRovingFocusGroup},x.createElement(wY.Slot,{scope:e.__scopeRovingFocusGroup},x.createElement(PMt,oe({},e,{ref:t}))))),PMt=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=x.useRef(null),d=Yt(t,f),h=BO(o),[p=null,g]=ko({prop:s,defaultProp:a,onChange:l}),[v,y]=x.useState(!1),O=Xs(c),m=V3e(n),w=x.useRef(!1),[S,E]=x.useState(0);return x.useEffect(()=>{const C=f.current;if(C)return C.addEventListener(gq,O),()=>C.removeEventListener(gq,O)},[O]),x.createElement(kMt,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:p,onItemFocus:x.useCallback(C=>g(C),[g]),onItemShiftTab:x.useCallback(()=>y(!0),[]),onFocusableItemAdd:x.useCallback(()=>E(C=>C+1),[]),onFocusableItemRemove:x.useCallback(()=>E(C=>C-1),[])},x.createElement(Ot.div,oe({tabIndex:v||S===0?-1:0,"data-orientation":r},u,{ref:d,style:{outline:"none",...e.style},onMouseDown:Xe(e.onMouseDown,()=>{w.current=!0}),onFocus:Xe(e.onFocus,C=>{const k=!w.current;if(C.target===C.currentTarget&&k&&!v){const P=new CustomEvent(gq,EMt);if(C.currentTarget.dispatchEvent(P),!P.defaultPrevented){const D=m().filter(N=>N.focusable),M=D.find(N=>N.active),L=D.find(N=>N.id===p),T=[M,L,...D].filter(Boolean).map(N=>N.ref.current);U3e(T)}}w.current=!1}),onBlur:Xe(e.onBlur,()=>y(!1))})))}),AMt="RovingFocusGroupItem",RMt=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=Ra(),l=o||a,c=$Mt(AMt,n),u=c.currentTabStopId===l,f=V3e(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=c;return x.useEffect(()=>{if(r)return d(),()=>h()},[r,d,h]),x.createElement(wY.ItemSlot,{scope:n,id:l,focusable:r,active:i},x.createElement(Ot.span,oe({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Xe(e.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:Xe(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Xe(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const g=NMt(p,c.orientation,c.dir);if(g!==void 0){p.preventDefault();let y=f().filter(O=>O.focusable).map(O=>O.ref.current);if(g==="last")y.reverse();else if(g==="prev"||g==="next"){g==="prev"&&y.reverse();const O=y.indexOf(p.currentTarget);y=c.loop?IMt(y,O+1):y.slice(O+1)}setTimeout(()=>U3e(y))}})})))}),DMt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function MMt(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function NMt(e,t,n){const r=MMt(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return DMt[r]}function U3e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function IMt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const rse=TMt,ise=RMt,H3e="Radio",[LMt,X3e]=uo(H3e),[jMt,FMt]=LMt(H3e),zMt=x.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:o,disabled:s,value:a="on",onCheck:l,...c}=e,[u,f]=x.useState(null),d=Yt(t,g=>f(g)),h=x.useRef(!1),p=u?!!u.closest("form"):!0;return x.createElement(jMt,{scope:n,checked:i,disabled:s},x.createElement(Ot.button,oe({type:"button",role:"radio","aria-checked":i,"data-state":Z3e(i),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:d,onClick:Xe(e.onClick,g=>{i||l==null||l(),p&&(h.current=g.isPropagationStopped(),h.current||g.stopPropagation())})})),p&&x.createElement(WMt,{control:u,bubbles:!h.current,name:r,value:a,checked:i,required:o,disabled:s,style:{transform:"translateX(-100%)"}}))}),QMt="RadioIndicator",BMt=x.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,o=FMt(QMt,n);return x.createElement(Gs,{present:r||o.checked},x.createElement(Ot.span,oe({"data-state":Z3e(o.checked),"data-disabled":o.disabled?"":void 0},i,{ref:t})))}),WMt=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=x.useRef(null),s=PR(n),a=kR(t);return x.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const d=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(d)}},[s,n,r]),x.createElement("input",oe({type:"radio","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Z3e(e){return e?"checked":"unchecked"}const qMt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Y3e="RadioGroup",[VMt,OGn]=uo(Y3e,[JC,X3e]),G3e=JC(),K3e=X3e(),[UMt,HMt]=VMt(Y3e),XMt=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:o,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:f,...d}=e,h=G3e(n),p=BO(c),[g,v]=ko({prop:o,defaultProp:i,onChange:f});return x.createElement(UMt,{scope:n,name:r,required:s,disabled:a,value:g,onValueChange:v},x.createElement(rse,oe({asChild:!0},h,{orientation:l,dir:p,loop:u}),x.createElement(Ot.div,oe({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:p},d,{ref:t}))))}),ZMt="RadioGroupItem",YMt=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,o=HMt(ZMt,n),s=o.disabled||r,a=G3e(n),l=K3e(n),c=x.useRef(null),u=Yt(t,c),f=o.value===i.value,d=x.useRef(!1);return x.useEffect(()=>{const h=g=>{qMt.includes(g.key)&&(d.current=!0)},p=()=>d.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),x.createElement(ise,oe({asChild:!0},a,{focusable:!s,active:f}),x.createElement(zMt,oe({disabled:s,required:o.required,checked:f},l,i,{name:o.name,ref:u,onCheck:()=>o.onValueChange(i.value),onKeyDown:Xe(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Xe(i.onFocus,()=>{var h;d.current&&((h=c.current)===null||h===void 0||h.click())})})))}),GMt=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=K3e(n);return x.createElement(BMt,oe({},i,r,{ref:t}))}),J3e=XMt,eFe=YMt,KMt=GMt,ose=x.forwardRef(({className:e,...t},n)=>b.jsx(J3e,{className:be("grid gap-2",e),...t,ref:n}));ose.displayName=J3e.displayName;const sse=x.forwardRef(({className:e,children:t,...n},r)=>b.jsx(eFe,{ref:r,className:be("h-[16px] w-[16px] transition-shadow data-[state=unchecked]:shadow-xsSolid rounded-full border border-input text-primary ring-offset-background focus:outline-none focus:shadow-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:shadow-none",e),...n,children:b.jsx(KMt,{className:"flex items-center justify-center",children:b.jsx(Fj,{className:"h-[10px] w-[10px] fill-primary text-current"})})}));sse.displayName=eFe.displayName;class JMt{constructor(){ve(this,"tagName","marimo-radio");ve(this,"validator",Y.object({initialValue:Y.string().nullable(),inline:Y.boolean().default(!1),label:Y.string().nullable(),options:Y.array(Y.string())}))}render(t){return b.jsx(eNt,{...t.data,value:t.value,setValue:t.setValue})}}const eNt=e=>{const t=x.useId();return b.jsx(fc,{label:e.label,id:t,align:e.inline?"left":"top",children:b.jsx(ose,{"data-testid":"marimo-plugin-radio",value:e.value??"",onValueChange:e.setValue,className:be(e.inline&&"grid-flow-col gap-4"),"aria-label":"Radio Group",children:e.options.map((n,r)=>b.jsxs("div",{className:"flex items-center space-x-2",children:[b.jsx(sse,{value:n,id:`${t}-${r.toString()}`}),b.jsx(Ls,{htmlFor:`${t}-${r.toString()}`,className:bd("text-md",n===e.value?"font-semibold":""),children:n})]},r))})})};function Hj(e,[t,n]){return Math.min(n,Math.max(t,e))}const tFe=["PageUp","PageDown"],nFe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],rFe={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},QR="Slider",[SY,tNt,nNt]=jC(QR),[iFe,xGn]=uo(QR,[nNt]),[rNt,Rz]=iFe(QR),iNt=x.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:s="horizontal",disabled:a=!1,minStepsBetweenThumbs:l=0,defaultValue:c=[r],value:u,onValueChange:f=()=>{},onValueCommit:d=()=>{},inverted:h=!1,...p}=e,[g,v]=x.useState(null),y=Yt(t,T=>v(T)),O=x.useRef(new Set),m=x.useRef(0),w=s==="horizontal",S=g?!!g.closest("form"):!0,E=w?oNt:sNt,[C=[],k]=ko({prop:u,defaultProp:c,onChange:T=>{var N;(N=[...O.current][m.current])===null||N===void 0||N.focus(),f(T)}}),P=x.useRef(C);function D(T){const N=gNt(C,T);A(T,N)}function M(T){A(T,m.current)}function L(){const T=P.current[m.current];C[m.current]!==T&&d(C)}function A(T,N,{commit:j}={commit:!1}){const z=bNt(o),W=ONt(Math.round((T-r)/o)*o+r,z),F=Hj(W,[r,i]);k((q=[])=>{const U=hNt(q,F,N);if(vNt(U,l*o)){m.current=U.indexOf(F);const V=String(U)!==String(q);return V&&j&&d(U),V?U:q}else return q})}return x.createElement(rNt,{scope:e.__scopeSlider,disabled:a,min:r,max:i,valueIndexToChangeRef:m,thumbs:O.current,values:C,orientation:s},x.createElement(SY.Provider,{scope:e.__scopeSlider},x.createElement(SY.Slot,{scope:e.__scopeSlider},x.createElement(E,oe({"aria-disabled":a,"data-disabled":a?"":void 0},p,{ref:y,onPointerDown:Xe(p.onPointerDown,()=>{a||(P.current=C)}),min:r,max:i,inverted:h,onSlideStart:a?void 0:D,onSlideMove:a?void 0:M,onSlideEnd:a?void 0:L,onHomeKeyDown:()=>!a&&A(r,0,{commit:!0}),onEndKeyDown:()=>!a&&A(i,C.length-1,{commit:!0}),onStepKeyDown:({event:T,direction:N})=>{if(!a){const W=tFe.includes(T.key)||T.shiftKey&&nFe.includes(T.key)?10:1,F=m.current,q=C[F],U=o*W*N;A(q+U,F,{commit:!0})}}})))),S&&C.map((T,N)=>x.createElement(dNt,{key:N,name:n?n+(C.length>1?"[]":""):void 0,value:T})))}),[oFe,sFe]=iFe(QR,{startEdge:"left",endEdge:"right",size:"width",direction:1}),oNt=x.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:s,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...u}=e,[f,d]=x.useState(null),h=Yt(t,m=>d(m)),p=x.useRef(),g=BO(i),v=g==="ltr",y=v&&!o||!v&&o;function O(m){const w=p.current||f.getBoundingClientRect(),S=[0,w.width],C=ase(S,y?[n,r]:[r,n]);return p.current=w,C(m-w.left)}return x.createElement(oFe,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width"},x.createElement(aFe,oe({dir:g,"data-orientation":"horizontal"},u,{ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:m=>{const w=O(m.clientX);s==null||s(w)},onSlideMove:m=>{const w=O(m.clientX);a==null||a(w)},onSlideEnd:()=>{p.current=void 0,l==null||l()},onStepKeyDown:m=>{const S=rFe[y?"from-left":"from-right"].includes(m.key);c==null||c({event:m,direction:S?-1:1})}})))}),sNt=x.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:s,onSlideEnd:a,onStepKeyDown:l,...c}=e,u=x.useRef(null),f=Yt(t,u),d=x.useRef(),h=!i;function p(g){const v=d.current||u.current.getBoundingClientRect(),y=[0,v.height],m=ase(y,h?[r,n]:[n,r]);return d.current=v,m(g-v.top)}return x.createElement(oFe,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1},x.createElement(aFe,oe({"data-orientation":"vertical"},c,{ref:f,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const v=p(g.clientY);o==null||o(v)},onSlideMove:g=>{const v=p(g.clientY);s==null||s(v)},onSlideEnd:()=>{d.current=void 0,a==null||a()},onStepKeyDown:g=>{const y=rFe[h?"from-bottom":"from-top"].includes(g.key);l==null||l({event:g,direction:y?-1:1})}})))}),aFe=x.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:s,onEndKeyDown:a,onStepKeyDown:l,...c}=e,u=Rz(QR,n);return x.createElement(Ot.span,oe({},c,{ref:t,onKeyDown:Xe(e.onKeyDown,f=>{f.key==="Home"?(s(f),f.preventDefault()):f.key==="End"?(a(f),f.preventDefault()):tFe.concat(nFe).includes(f.key)&&(l(f),f.preventDefault())}),onPointerDown:Xe(e.onPointerDown,f=>{const d=f.target;d.setPointerCapture(f.pointerId),f.preventDefault(),u.thumbs.has(d)?d.focus():r(f)}),onPointerMove:Xe(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&i(f)}),onPointerUp:Xe(e.onPointerUp,f=>{const d=f.target;d.hasPointerCapture(f.pointerId)&&(d.releasePointerCapture(f.pointerId),o(f))})}))}),aNt="SliderTrack",lNt=x.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Rz(aNt,n);return x.createElement(Ot.span,oe({"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation},r,{ref:t}))}),q1e="SliderRange",cNt=x.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=Rz(q1e,n),o=sFe(q1e,n),s=x.useRef(null),a=Yt(t,s),l=i.values.length,c=i.values.map(d=>lFe(d,i.min,i.max)),u=l>1?Math.min(...c):0,f=100-Math.max(...c);return x.createElement(Ot.span,oe({"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0},r,{ref:a,style:{...e.style,[o.startEdge]:u+"%",[o.endEdge]:f+"%"}}))}),V1e="SliderThumb",uNt=x.forwardRef((e,t)=>{const n=tNt(e.__scopeSlider),[r,i]=x.useState(null),o=Yt(t,a=>i(a)),s=x.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return x.createElement(fNt,oe({},e,{ref:o,index:s}))}),fNt=x.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,...i}=e,o=Rz(V1e,n),s=sFe(V1e,n),[a,l]=x.useState(null),c=Yt(t,v=>l(v)),u=kR(a),f=o.values[r],d=f===void 0?0:lFe(f,o.min,o.max),h=pNt(r,o.values.length),p=u==null?void 0:u[s.size],g=p?mNt(p,d,s.direction):0;return x.useEffect(()=>{if(a)return o.thumbs.add(a),()=>{o.thumbs.delete(a)}},[a,o.thumbs]),x.createElement("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${d}% + ${g}px)`}},x.createElement(SY.ItemSlot,{scope:e.__scopeSlider},x.createElement(Ot.span,oe({role:"slider","aria-label":e["aria-label"]||h,"aria-valuemin":o.min,"aria-valuenow":f,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0},i,{ref:c,style:f===void 0?{display:"none"}:e.style,onFocus:Xe(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})}))))}),dNt=e=>{const{value:t,...n}=e,r=x.useRef(null),i=PR(t);return x.useEffect(()=>{const o=r.current,s=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(s,"value").set;if(i!==t&&l){const c=new Event("input",{bubbles:!0});l.call(o,t),o.dispatchEvent(c)}},[i,t]),x.createElement("input",oe({style:{display:"none"}},n,{ref:r,defaultValue:t}))};function hNt(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function lFe(e,t,n){const o=100/(n-t)*(e-t);return Hj(o,[0,100])}function pNt(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function gNt(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}function mNt(e,t,n){const r=e/2,o=ase([0,50],[0,r]);return(r-o(t)*n)*n}function yNt(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function vNt(e,t){if(t>0){const n=yNt(e);return Math.min(...n)>=t}return!0}function ase(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function bNt(e){return(String(e).split(".")[1]||"").length}function ONt(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const cFe=iNt,xNt=lNt,wNt=cNt,SNt=uNt;function ENt(e){const[t,n]=x.useState(e);return[t,{setTrue:x.useCallback(r=>{var i;(i=r==null?void 0:r.stopPropagation)==null||i.call(r),n(!0)},[]),setFalse:x.useCallback(r=>{var i;(i=r==null?void 0:r.stopPropagation)==null||i.call(r),n(!1)},[]),toggle:x.useCallback(r=>{var i;(i=r==null?void 0:r.stopPropagation)==null||i.call(r),n(o=>!o)},[])}]}function uFe(e){return e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})}const fFe=x.forwardRef(({className:e,...t},n)=>{const[r,i]=ENt(!1);return b.jsxs(cFe,{ref:n,className:be("relative flex touch-none select-none hover:cursor-pointer","data-[orientation=horizontal]:w-full data-[orientation=horizontal]:items-center","data-[orientation=vertical]:h-full data-[orientation=vertical]:justify-center",e),...t,children:[b.jsx(xNt,{"data-testid":"track",className:be("relative grow overflow-hidden rounded-full bg-slate-200 dark:bg-accent/60","data-[orientation=horizontal]:h-2 data-[orientation=horizontal]:w-full","data-[orientation=vertical]:h-full data-[orientation=vertical]:w-2"),children:b.jsx(wNt,{"data-testid":"range",className:be("absolute bg-blue-500 dark:bg-primary","data-[orientation=horizontal]:h-full","data-[orientation=vertical]:w-full")})}),b.jsx(UC,{children:b.jsxs(aoe,{delayDuration:0,open:r,children:[b.jsx(loe,{asChild:!0,children:b.jsx(SNt,{"data-testid":"thumb",className:"block h-4 w-4 rounded-full shadow-xsSolid border border-blue-500 dark:border-primary dark:bg-accent bg-white hover:bg-blue-300 focus:bg-blue-300 transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",onFocus:i.setTrue,onBlur:i.setFalse,onMouseEnter:i.setTrue,onMouseLeave:i.setFalse})}),b.jsx(gLe,{children:t.value!=null&&t.value.length===1&&b.jsx(oP,{children:uFe(t.value[0])},t.value[0])})]})})]})});fFe.displayName=cFe.displayName;class CNt{constructor(){ve(this,"tagName","marimo-slider");ve(this,"validator",Y.object({initialValue:Y.number(),label:Y.string().nullable(),start:Y.number(),stop:Y.number(),step:Y.number().optional(),debounce:Y.boolean().default(!1),orientation:Y.enum(["horizontal","vertical"]).default("horizontal"),showValue:Y.boolean().default(!1)}))}render(t){return b.jsx(_Nt,{...t.data,value:t.value,setValue:t.setValue})}}const _Nt=({label:e,setValue:t,value:n,start:r,stop:i,step:o,debounce:s,orientation:a,showValue:l})=>{const c=x.useId(),[u,f]=x.useState(n);return x.useEffect(()=>{f(n)},[n]),b.jsx(fc,{label:e,id:c,align:a==="horizontal"?"left":"top",children:b.jsxs("div",{className:be("flex items-center gap-2",a==="vertical"&&"items-end inline-flex justify-center self-center mx-2"),children:[b.jsx(fFe,{id:c,className:be("relative flex items-center select-none","data-[orientation=horizontal]:w-36 data-[orientation=vertical]:h-36"),value:[u],min:r,max:i,step:o,orientation:a,onValueChange:([d])=>{f(d),s||t(d)},onValueCommit:([d])=>{s&&t(d)}}),l&&b.jsx("div",{className:"text-xs text-muted-foreground min-w-[16px]",children:uFe(u)})]})})},dFe="Switch",[kNt,wGn]=uo(dFe),[$Nt,TNt]=kNt(dFe),PNt=x.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,d]=x.useState(null),h=Yt(t,O=>d(O)),p=x.useRef(!1),g=f?!!f.closest("form"):!0,[v=!1,y]=ko({prop:i,defaultProp:o,onChange:c});return x.createElement($Nt,{scope:n,checked:v,disabled:a},x.createElement(Ot.button,oe({type:"button",role:"switch","aria-checked":v,"aria-required":s,"data-state":hFe(v),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:h,onClick:Xe(e.onClick,O=>{y(m=>!m),g&&(p.current=O.isPropagationStopped(),p.current||O.stopPropagation())})})),g&&x.createElement(DNt,{control:f,bubbles:!p.current,name:r,value:l,checked:v,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),ANt="SwitchThumb",RNt=x.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=TNt(ANt,n);return x.createElement(Ot.span,oe({"data-state":hFe(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),DNt=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,o=x.useRef(null),s=PR(n),a=kR(t);return x.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const d=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(d)}},[s,n,r]),x.createElement("input",oe({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function hFe(e){return e?"checked":"unchecked"}const pFe=PNt,MNt=RNt,NNt=Ao("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",{variants:{size:{default:"h-[1.5rem] w-[2.75rem] mb-1",sm:"h-[1.125rem] w-[2.125rem]"}},defaultVariants:{size:"default"}}),INt=Ao("pointer-events-none block rounded-full bg-background shadow-xs ring-0 transition-transform",{variants:{size:{default:"h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",sm:"h-3.5 w-3.5 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"}},defaultVariants:{size:"default"}}),Qb=x.forwardRef(({className:e,size:t,...n},r)=>b.jsx(pFe,{className:be(NNt({size:t}),e),...n,ref:r,children:b.jsx(MNt,{className:be(INt({size:t}))})}));Qb.displayName=pFe.displayName;class LNt{constructor(){ve(this,"tagName","marimo-switch");ve(this,"validator",Y.object({initialValue:Y.boolean(),label:Y.string().nullable()}))}render(t){return b.jsx(jNt,{...t})}}const jNt=({value:e,setValue:t,data:n})=>{const r=x.useId();return b.jsx(fc,{label:n.label,align:"right",id:r,labelClassName:"ml-1",children:b.jsx(Qb,{"data-testid":"marimo-plugin-switch",checked:e,onCheckedChange:t,id:r,className:"data-[state=unchecked]:hover:bg-input/80 mb-0"})})};class FNt{constructor(){ve(this,"tagName","marimo-text");ve(this,"validator",Y.object({initialValue:Y.string(),placeholder:Y.string(),label:Y.string().nullable(),kind:Y.enum(["text","password","email","url"]).default("text"),maxLength:Y.number().optional(),minLength:Y.number().optional(),fullWidth:Y.boolean().default(!1),disabled:Y.boolean().optional()}))}render(t){return b.jsx(zNt,{...t.data,value:t.value,setValue:t.setValue})}}const zNt=e=>{const[t,n]=x.useState(e.value),r=t??e.value,i=QNt(e.kind,r),o={text:null,password:b.jsx(ALe,{size:16}),email:b.jsx(wEt,{size:16}),url:b.jsx(PLe,{size:16})},s=e.maxLength?b.jsxs("span",{className:"text-muted-foreground text-xs font-medium",children:[e.value.length,"/",e.maxLength]}):null;return b.jsx(fc,{label:e.label,fullWidth:e.fullWidth,children:b.jsx(Wo,{"data-testid":"marimo-plugin-text-input",type:e.kind,icon:o[e.kind],placeholder:e.placeholder,maxLength:e.maxLength,minLength:e.minLength,required:e.minLength!=null&&e.minLength>0,disabled:e.disabled,className:be({"border-destructive":!i,"w-full":e.fullWidth}),endAdornment:s,value:e.value,onInput:a=>e.setValue(a.currentTarget.value),onBlur:a=>n(a.currentTarget.value)})})};function QNt(e,t){if(!t)return!0;switch(e){case"email":return Y.string().email().safeParse(t).success;case"url":return Y.string().url().safeParse(t).success;default:return!0}}const Dz=x.forwardRef(({className:e,bottomAdornment:t,...n},r)=>b.jsxs("div",{className:"relative",children:[b.jsx("textarea",{className:be("shadow-xsSolid hover:shadow-smSolid disabled:shadow-xsSolid focus-visible:shadow-mdSolid","flex w-full mb-1 rounded-sm border border-input bg-background px-3 py-2 text-sm font-code ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:border-accent disabled:cursor-not-allowed disabled:opacity-50 min-h-[1.5rem]",e),onClick:tp.stopPropagation(),ref:r,...n}),t&&b.jsx("div",{className:"absolute right-0 bottom-1 flex items-center pr-[6px] pointer-events-none text-muted-foreground h-6",children:t})]}));Dz.displayName="Textarea";class BNt{constructor(){ve(this,"tagName","marimo-text-area");ve(this,"validator",Y.object({initialValue:Y.string(),placeholder:Y.string(),label:Y.string().nullable(),maxLength:Y.number().optional(),minLength:Y.number().optional(),disabled:Y.boolean().optional(),rows:Y.number().default(4),fullWidth:Y.boolean().default(!1)}))}render(t){return b.jsx(WNt,{...t.data,value:t.value,setValue:t.setValue})}}const WNt=e=>{const t=e.maxLength?b.jsxs("span",{className:"text-muted-foreground text-xs font-medium",children:[e.value.length,"/",e.maxLength]}):null;return b.jsx(fc,{label:e.label,align:"top",fullWidth:e.fullWidth,children:b.jsx(Dz,{className:be("font-code",{"w-full":e.fullWidth}),rows:e.rows,cols:33,maxLength:e.maxLength,minLength:e.minLength,required:e.minLength!=null&&e.minLength>0,disabled:e.disabled,bottomAdornment:t,value:e.value,onInput:n=>e.setValue(n.target.value),placeholder:e.placeholder})})};/**
   * table-core
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */function Sy(e,t){return typeof e=="function"?e(t):e}function tu(e,t){return n=>{t.setState(r=>({...r,[e]:Sy(n,r[e])}))}}function Xj(e){return e instanceof Function}function qNt(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function VNt(e,t){const n=[],r=i=>{i.forEach(o=>{n.push(o);const s=t(o);s!=null&&s.length&&r(s)})};return r(e),n}function Vt(e,t,n){let r=[],i;return o=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(o);if(!(a.length!==r.length||a.some((u,f)=>r[f]!==u)))return i;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...a),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,d=f/16,h=(p,g)=>{for(p=String(p);p.length<g;)p=" "+p;return p};console.info(`%c⏱ ${h(f,5)} /${h(u,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n==null?void 0:n.key)}return i}}function Ut(e,t,n,r){return{debug:()=>{var i;return(i=e==null?void 0:e.debugAll)!=null?i:e[t]},key:!1,onChange:r}}function UNt(e,t,n,r){var i,o;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(i=(o=a.id)!=null?o:l?l.replace(".","_"):void 0)!=null?i:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=d=>{let h=d;for(const g of l.split(".")){var p;h=(p=h)==null?void 0:p[g]}return h}:u=d=>d[a.accessorKey]),!c)throw new Error;let f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Vt(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},Ut(e.options,"debugColumns")),getLeafColumns:Vt(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let p=f.columns.flatMap(g=>g.getLeafColumns());return d(p)}return[f]},Ut(e.options,"debugColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(f,e);return f}const oa="debugHeaders";function U1e(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(o),s},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(o,e)}),o}const HNt={createTable:e=>{e.getHeaderGroups=Vt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{var o,s;const a=(o=r==null?void 0:r.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?o:[],l=(s=i==null?void 0:i.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(i!=null&&i.includes(f.id)));return tN(t,[...a,...c,...l],e)},Ut(e.options,oa)),e.getCenterHeaderGroups=Vt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(i!=null&&i.includes(o.id))),tN(t,n,e,"center")),Ut(e.options,oa)),e.getLeftHeaderGroups=Vt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return tN(t,o,e,"left")},Ut(e.options,oa)),e.getRightHeaderGroups=Vt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var i;const o=(i=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?i:[];return tN(t,o,e,"right")},Ut(e.options,oa)),e.getFooterGroups=Vt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Ut(e.options,oa)),e.getLeftFooterGroups=Vt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Ut(e.options,oa)),e.getCenterFooterGroups=Vt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Ut(e.options,oa)),e.getRightFooterGroups=Vt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Ut(e.options,oa)),e.getFlatHeaders=Vt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ut(e.options,oa)),e.getLeftFlatHeaders=Vt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ut(e.options,oa)),e.getCenterFlatHeaders=Vt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ut(e.options,oa)),e.getRightFlatHeaders=Vt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ut(e.options,oa)),e.getCenterLeafHeaders=Vt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ut(e.options,oa)),e.getLeftLeafHeaders=Vt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ut(e.options,oa)),e.getRightLeafHeaders=Vt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ut(e.options,oa)),e.getLeafHeaders=Vt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var i,o,s,a,l,c;return[...(i=(o=t[0])==null?void 0:o.headers)!=null?i:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},Ut(e.options,oa))}};function tN(e,t,n,r){var i,o;let s=0;const a=function(d,h){h===void 0&&(h=1),s=Math.max(s,h),d.filter(p=>p.getIsVisible()).forEach(p=>{var g;(g=p.columns)!=null&&g.length&&a(p.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const p={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},g=[];d.forEach(v=>{const y=[...g].reverse()[0],O=v.column.depth===p.depth;let m,w=!1;if(O&&v.column.parent?m=v.column.parent:(m=v.column,w=!0),y&&(y==null?void 0:y.column)===m)y.subHeaders.push(v);else{const S=U1e(n,m,{id:[r,h,m.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:w,placeholderId:w?`${g.filter(E=>E.column===m).length}`:void 0,depth:h,index:g.length});S.subHeaders.push(v),g.push(S)}p.headers.push(v),v.headerGroup=p}),l.push(p),h>0&&c(g,h-1)},u=t.map((d,h)=>U1e(n,d,{depth:s,index:h}));c(u,s-1),l.reverse();const f=d=>d.filter(p=>p.column.getIsVisible()).map(p=>{let g=0,v=0,y=[0];p.subHeaders&&p.subHeaders.length?(y=[],f(p.subHeaders).forEach(m=>{let{colSpan:w,rowSpan:S}=m;g+=w,y.push(S)})):g=1;const O=Math.min(...y);return v=v+O,p.colSpan=g,p.rowSpan=v,{colSpan:g,rowSpan:v}});return f((i=(o=l[0])==null?void 0:o.headers)!=null?i:[]),l}const nN={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},mq=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),XNt={getDefaultColumnDef:()=>nN,getInitialState:e=>({columnSizing:{},columnSizingInfo:mq(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:tu("columnSizing",e),onColumnSizingInfoChange:tu("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,i;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:nN.minSize,(r=o??e.columnDef.size)!=null?r:nN.size),(i=e.columnDef.maxSize)!=null?i:nN.maxSize)},e.getStart=Vt(n=>[n,PT(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((i,o)=>i+o.getSize(),0),Ut(t.options,"debugColumns")),e.getAfter=Vt(n=>[n,PT(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((i,o)=>i+o.getSize(),0),Ut(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...i}=n;return i})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var o;n+=(o=i.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),i=r==null?void 0:r.getCanResize();return o=>{if(!r||!i||(o.persist==null||o.persist(),yq(o)&&o.touches&&o.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[r.id,r.getSize()]],l=yq(o)?Math.round(o.touches[0].clientX):o.clientX,c={},u=(y,O)=>{typeof O=="number"&&(t.setColumnSizingInfo(m=>{var w,S;const E=t.options.columnResizeDirection==="rtl"?-1:1,C=(O-((w=m==null?void 0:m.startOffset)!=null?w:0))*E,k=Math.max(C/((S=m==null?void 0:m.startSize)!=null?S:0),-.999999);return m.columnSizingStart.forEach(P=>{let[D,M]=P;c[D]=Math.round(Math.max(M+M*k,0)*100)/100}),{...m,deltaOffset:C,deltaPercentage:k}}),(t.options.columnResizeMode==="onChange"||y==="end")&&t.setColumnSizing(m=>({...m,...c})))},f=y=>u("move",y),d=y=>{u("end",y),t.setColumnSizingInfo(O=>({...O,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,p={moveHandler:y=>f(y.clientX),upHandler:y=>{h==null||h.removeEventListener("mousemove",p.moveHandler),h==null||h.removeEventListener("mouseup",p.upHandler),d(y.clientX)}},g={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),f(y.touches[0].clientX),!1),upHandler:y=>{var O;h==null||h.removeEventListener("touchmove",g.moveHandler),h==null||h.removeEventListener("touchend",g.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),d((O=y.touches[0])==null?void 0:O.clientX)}},v=ZNt()?{passive:!1}:!1;yq(o)?(h==null||h.addEventListener("touchmove",g.moveHandler,v),h==null||h.addEventListener("touchend",g.upHandler,v)):(h==null||h.addEventListener("mousemove",p.moveHandler,v),h==null||h.addEventListener("mouseup",p.upHandler,v)),t.setColumnSizingInfo(y=>({...y,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?mq():(n=e.initialState.columnSizingInfo)!=null?n:mq())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?t:0}}};let rN=null;function ZNt(){if(typeof rN=="boolean")return rN;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return rN=e,rN}function yq(e){return e.type==="touchstart"}const YNt={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:tu("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var i,o;e.setExpanded(r?{}:(i=(o=e.initialState)==null?void 0:o.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const s=o.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var i;const o=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(i=n)!=null?i:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,i;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},gFe=(e,t,n)=>{var r;const i=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};gFe.autoRemove=e=>fd(e);const mFe=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};mFe.autoRemove=e=>fd(e);const yFe=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};yFe.autoRemove=e=>fd(e);const vFe=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};vFe.autoRemove=e=>fd(e)||!(e!=null&&e.length);const bFe=(e,t,n)=>!n.some(r=>{var i;return!((i=e.getValue(t))!=null&&i.includes(r))});bFe.autoRemove=e=>fd(e)||!(e!=null&&e.length);const OFe=(e,t,n)=>n.some(r=>{var i;return(i=e.getValue(t))==null?void 0:i.includes(r)});OFe.autoRemove=e=>fd(e)||!(e!=null&&e.length);const xFe=(e,t,n)=>e.getValue(t)===n;xFe.autoRemove=e=>fd(e);const wFe=(e,t,n)=>e.getValue(t)==n;wFe.autoRemove=e=>fd(e);const lse=(e,t,n)=>{let[r,i]=n;const o=e.getValue(t);return o>=r&&o<=i};lse.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,i=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(i)?1/0:i;if(o>s){const a=o;o=s,s=a}return[o,s]};lse.autoRemove=e=>fd(e)||fd(e[0])&&fd(e[1]);const Qp={includesString:gFe,includesStringSensitive:mFe,equalsString:yFe,arrIncludes:vFe,arrIncludesAll:bFe,arrIncludesSome:OFe,equals:xFe,weakEquals:wFe,inNumberRange:lse};function fd(e){return e==null||e===""}const GNt={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:tu("columnFilters",e),onGlobalFilterChange:tu("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Qp.includesString:typeof r=="number"?Qp.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Qp.equals:Array.isArray(r)?Qp.arrIncludes:Qp.weakEquals},e.getFilterFn=()=>{var n,r;return Xj(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Qp[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,i;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,i,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((i=t.options.enableFilters)!=null?i:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const i=e.getFilterFn(),o=r==null?void 0:r.find(u=>u.id===e.id),s=Sy(n,o?o.value:void 0);if(H1e(i,s,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(o){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Qp.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Xj(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Qp[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=i=>{var o;return(o=Sy(t,i))==null?void 0:o.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(H1e(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function H1e(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const KNt=(e,t,n)=>n.reduce((r,i)=>{const o=i.getValue(e);return r+(typeof o=="number"?o:0)},0),JNt=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},eIt=(e,t,n)=>{let r;return n.forEach(i=>{const o=i.getValue(e);o!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}),r},tIt=(e,t,n)=>{let r,i;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r===void 0?s>=s&&(r=i=s):(r>s&&(r=s),i<s&&(i=s)))}),[r,i]},nIt=(e,t)=>{let n=0,r=0;if(t.forEach(i=>{let o=i.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},rIt=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!qNt(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((o,s)=>o-s);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},iIt=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),oIt=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,sIt=(e,t)=>t.length,vq={sum:KNt,min:JNt,max:eIt,extent:tIt,mean:nIt,median:rIt,unique:iIt,uniqueCount:oIt,count:sIt},aIt={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:tu("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r,i,o;return(n=(r=(i=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?i:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return vq.sum;if(Object.prototype.toString.call(r)==="[object Date]")return vq.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Xj(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:vq[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function lIt(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(s=>s.id===o)).filter(Boolean),...r]}const cIt={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:tu("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Vt(n=>[PT(t,n)],n=>n.findIndex(r=>r.id===e.id),Ut(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=PT(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const i=PT(t,n);return((r=i[i.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Vt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>i=>{let o=[];if(!(t!=null&&t.length))o=i;else{const s=[...t],a=[...i];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&o.push(a.splice(c,1)[0])}o=[...o,...a]}return lIt(o,n,r)},Ut(e.options,"debugTable"))}},EY=0,CY=10,bq=()=>({pageIndex:EY,pageSize:CY}),uIt={getInitialState:e=>({...e,pagination:{...bq(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:tu("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,i;if(!t){e._queue(()=>{t=!0});return}if((r=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const i=o=>Sy(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=r=>{var i;e.setPagination(r?bq():(i=e.initialState.pagination)!=null?i:bq())},e.setPageIndex=r=>{e.setPagination(i=>{let o=Sy(r,i.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,s)),{...i,pageIndex:o}})},e.resetPageIndex=r=>{var i,o;e.setPageIndex(r?EY:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?i:EY)},e.resetPageSize=r=>{var i,o;e.setPageSize(r?CY:(i=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?i:CY)},e.setPageSize=r=>{e.setPagination(i=>{const o=Math.max(1,Sy(r,i.pageSize)),s=i.pageSize*i.pageIndex,a=Math.floor(s/o);return{...i,pageIndex:a,pageSize:o}})},e.setPageCount=r=>e.setPagination(i=>{var o;let s=Sy(r,(o=e.options.pageCount)!=null?o:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...i,pageCount:s}}),e.getPageOptions=Vt(()=>[e.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((o,s)=>s)),i},Ut(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:r<i-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},Oq=()=>({left:[],right:[]}),xq=()=>({top:[],bottom:[]}),fIt={getInitialState:e=>({columnPinning:Oq(),rowPinning:xq(),...e}),getDefaultOptions:e=>({onColumnPinningChange:tu("columnPinning",e),onRowPinningChange:tu("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(i=>i.id).filter(Boolean);t.setColumnPinning(i=>{var o,s;if(n==="right"){var a,l;return{left:((a=i==null?void 0:i.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=i==null?void 0:i.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=i==null?void 0:i.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=i==null?void 0:i.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((o=i==null?void 0:i.left)!=null?o:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=i==null?void 0:i.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var i,o,s;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((o=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:i}=t.getState().columnPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();return i?(n=(r=t.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,i)=>{const o=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=i?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...o]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,d;return{top:((f=l==null?void 0:l.top)!=null?f:[]).filter(g=>!(a!=null&&a.has(g))),bottom:[...((d=l==null?void 0:l.bottom)!=null?d:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)]}}if(n==="top"){var h,p;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)],bottom:((p=l==null?void 0:l.bottom)!=null?p:[]).filter(g=>!(a!=null&&a.has(g)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(g=>!(a!=null&&a.has(g))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(g=>!(a!=null&&a.has(g)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=t.options;return typeof r=="function"?r(e):(n=r??i)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,o=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>i==null?void 0:i.includes(a));return o?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const i=e.getIsPinned();if(!i)return-1;const o=(n=t._getPinnedRows(i))==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=Vt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,i)=>{const o=[...r??[],...i??[]];return n.filter(s=>!o.includes(s.column.id))},Ut(t.options,"debugRows")),e.getLeftVisibleCells=Vt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),Ut(t.options,"debugRows")),e.getRightVisibleCells=Vt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),Ut(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Oq():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Oq())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var i,o;return!!((i=r.left)!=null&&i.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Vt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Ut(e.options,"debugColumns")),e.getRightLeafColumns=Vt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(i=>i.id===r)).filter(Boolean),Ut(e.options,"debugColumns")),e.getCenterLeafColumns=Vt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const i=[...n??[],...r??[]];return t.filter(o=>!i.includes(o.id))},Ut(e.options,"debugColumns")),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?xq():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:xq())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var i,o;return!!((i=r.top)!=null&&i.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=Vt(t=>[e.getRowModel().rows,e.getState().rowPinning[t],t],(t,n,r)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},Ut(e.options,"debugRows")),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=Vt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const i=new Set([...n??[],...r??[]]);return t.filter(o=>!i.has(o.id))},Ut(e.options,"debugRows"))}},dIt={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:tu("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):i.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),i={...n};return e.getRowModel().rows.forEach(o=>{_Y(i,o.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Vt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?wq(e,n):{rows:[],flatRows:[],rowsById:{}},Ut(e.options,"debugTable")),e.getFilteredSelectedRowModel=Vt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?wq(e,n):{rows:[],flatRows:[],rowsById:{}},Ut(e.options,"debugTable")),e.getGroupedSelectedRowModel=Vt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?wq(e,n):{rows:[],flatRows:[],rowsById:{}},Ut(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(i=>!n[i.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const i=e.getIsSelected();t.setRowSelection(o=>{var s;if(n=typeof n<"u"?n:!i,e.getCanSelect()&&i===n)return o;const a={...o};return _Y(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return cse(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return kY(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return kY(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var i;n&&e.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},_Y=(e,t,n,r,i)=>{var o;const s=i.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=s.subRows)!=null&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>_Y(e,a.id,n,r,i))};function wq(e,t){const n=e.getState().rowSelection,r=[],i={},o=function(s,a){return s.map(l=>{var c;const u=cse(l,n);if(u&&(r.push(l),i[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:o(l.subRows)}),u)return l}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:i}}function cse(e,t){var n;return(n=t[e.id])!=null?n:!1}function kY(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,o=!1;return e.subRows.forEach(s=>{if(!(o&&!i)&&(s.getCanSelect()&&(cse(s,t)?o=!0:i=!1),s.subRows&&s.subRows.length)){const a=kY(s,t);a==="all"?o=!0:(a==="some"&&(o=!0),i=!1)}}),i?"all":o?"some":!1}const $Y=/([0-9]+)/gm,hIt=(e,t,n)=>SFe(A0(e.getValue(n)).toLowerCase(),A0(t.getValue(n)).toLowerCase()),pIt=(e,t,n)=>SFe(A0(e.getValue(n)),A0(t.getValue(n))),gIt=(e,t,n)=>use(A0(e.getValue(n)).toLowerCase(),A0(t.getValue(n)).toLowerCase()),mIt=(e,t,n)=>use(A0(e.getValue(n)),A0(t.getValue(n))),yIt=(e,t,n)=>{const r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},vIt=(e,t,n)=>use(e.getValue(n),t.getValue(n));function use(e,t){return e===t?0:e>t?1:-1}function A0(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function SFe(e,t){const n=e.split($Y).filter(Boolean),r=t.split($Y).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),o=r.shift(),s=parseInt(i,10),a=parseInt(o,10),l=[s,a].sort();if(isNaN(l[0])){if(i>o)return 1;if(o>i)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const w1={alphanumeric:hIt,alphanumericCaseSensitive:pIt,text:gIt,textCaseSensitive:mIt,datetime:yIt,basic:vIt},bIt={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:tu("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const o=i==null?void 0:i.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return w1.datetime;if(typeof o=="string"&&(r=!0,o.split($Y).length>1))return w1.alphanumeric}return r?w1.text:w1.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Xj(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:w1[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const i=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(h=>h.id===e.id),l=s==null?void 0:s.findIndex(h=>h.id===e.id);let c=[],u,f=o?n:i==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(o||i||(u="remove")),u==="add"){var d;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,i;const o=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(i=t.options.enableMultiRemove)!=null)||i)?!1:s==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(i=>i.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(i=>i.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},OIt={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:tu("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;return(n=(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Vt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ut(t.options,"debugRows")),e.getVisibleCells=Vt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],Ut(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Vt(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),Ut(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,o)=>({...i,[o.id]:n||!(o.getCanHide!=null&&o.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function PT(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const X1e=[HNt,OIt,cIt,fIt,GNt,bIt,aIt,YNt,uIt,dIt,XNt];function xIt(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:X1e};const r=n._features.reduce((u,f)=>Object.assign(u,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),i=u=>n.options.mergeOptions?n.options.mergeOptions(r,u):{...r,...u};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(u=>{var f;s=(f=u.getInitialState==null?void 0:u.getInitialState(s))!=null?f:s});const a=[];let l=!1;const c={_features:X1e,options:{...r,...e},initialState:s,_queue:u=>{a.push(u),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const f=Sy(u,n.options);n.options=i(f)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,f,d)=>{var h;return(h=n.options.getRowId==null?void 0:n.options.getRowId(u,f,d))!=null?h:`${d?[d.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(u,f)=>{let d=(f?n.getPrePaginationRowModel():n.getRowModel()).rowsById[u];if(!d&&(d=n.getCoreRowModel().rowsById[u],!d))throw new Error;return d},_getDefaultColumnDef:Vt(()=>[n.options.defaultColumn],u=>{var f;return u=(f=u)!=null?f:{},{header:d=>{const h=d.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:d=>{var h,p;return(h=(p=d.renderValue())==null||p.toString==null?void 0:p.toString())!=null?h:null},...n._features.reduce((d,h)=>Object.assign(d,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...u}},Ut(e,"debugColumns")),_getColumnDefs:()=>n.options.columns,getAllColumns:Vt(()=>[n._getColumnDefs()],u=>{const f=function(d,h,p){return p===void 0&&(p=0),d.map(g=>{const v=UNt(n,g,p,h),y=g;return v.columns=y.columns?f(y.columns,v,p+1):[],v})};return f(u)},Ut(e,"debugColumns")),getAllFlatColumns:Vt(()=>[n.getAllColumns()],u=>u.flatMap(f=>f.getFlatColumns()),Ut(e,"debugColumns")),_getAllFlatColumnsById:Vt(()=>[n.getAllFlatColumns()],u=>u.reduce((f,d)=>(f[d.id]=d,f),{}),Ut(e,"debugColumns")),getAllLeafColumns:Vt(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,f)=>{let d=u.flatMap(h=>h.getLeafColumns());return f(d)},Ut(e,"debugColumns")),getColumn:u=>n._getAllFlatColumnsById()[u]};Object.assign(n,c);for(let u=0;u<n._features.length;u++){const f=n._features[u];f==null||f.createTable==null||f.createTable(n)}return n}function wIt(e,t,n,r){const i=()=>{var s;return(s=o.getValue())!=null?s:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:i,getContext:Vt(()=>[e,n,t,o],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Ut(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(o,n,t,e)},{}),o}const SIt=(e,t,n,r,i,o,s)=>{let a={id:t,index:r,original:n,depth:i,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>VNt(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:Vt(()=>[e.getAllLeafColumns()],l=>l.map(c=>wIt(e,a,c,c.id)),Ut(e.options,"debugRows")),_getAllCellsByColumnId:Vt(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),Ut(e.options,"debugRows"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a};function EFe(){return e=>Vt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,o,s){o===void 0&&(o=0);const a=[];for(let c=0;c<i.length;c++){const u=SIt(e,e._getRowId(i[c],c,s),i[c],c,o,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(i[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,o+1,u))}}return a};return n.rows=r(t),n},Ut(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function CFe(){return e=>Vt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,i=[],o=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};o.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,f)=>{for(let h=0;h<o.length;h+=1){var d;const p=o[h],g=s[p.id],v=(d=p==null?void 0:p.desc)!=null?d:!1;let y=0;if(g.sortUndefined){const O=u.getValue(p.id),m=f.getValue(p.id),w=O===void 0,S=m===void 0;(w||S)&&(y=w&&S?0:w?g.sortUndefined:-g.sortUndefined)}if(y===0&&(y=g.sortingFn(u,f,p.id)),y!==0)return v&&(y*=-1),g.invertSorting&&(y*=-1),y}return u.index-f.index}),c.forEach(u=>{var f;i.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:i,rowsById:n.rowsById}},Ut(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function EIt(e){const t=[],n=r=>{var i;t.push(r),(i=r.subRows)!=null&&i.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function CIt(e){return t=>Vt(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:i,pageIndex:o}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=i*o,u=c+i;s=s.slice(c,u);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=EIt({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const d=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(d)};return f.rows.forEach(d),f},Ut(t.options,"debugTable"))}/**
   * react-table
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */function Zj(e,t){return e?_It(e)?x.createElement(e,t):e:null}function _It(e){return kIt(e)||typeof e=="function"||$It(e)}function kIt(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function $It(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function _Fe(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=x.useState(()=>({current:xIt(t)})),[r,i]=x.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:s=>{i(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const fse=x.forwardRef(({className:e,...t},n)=>b.jsx("div",{className:"w-full overflow-auto flex-1",children:b.jsx("table",{ref:n,className:be("w-full caption-bottom text-sm",e),...t})}));fse.displayName="Table";const dse=x.forwardRef(({className:e,...t},n)=>b.jsx("thead",{ref:n,className:be("[&_tr]:border-b",e),...t}));dse.displayName="TableHeader";const hse=x.forwardRef(({className:e,...t},n)=>b.jsx("tbody",{ref:n,className:be("[&_tr:last-child]:border-0",e),...t}));hse.displayName="TableBody";const TIt=x.forwardRef(({className:e,...t},n)=>b.jsx("tfoot",{ref:n,className:be("bg-primary font-medium text-primary-foreground",e),...t}));TIt.displayName="TableFooter";const OS=x.forwardRef(({className:e,...t},n)=>b.jsx("tr",{ref:n,className:be("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));OS.displayName="TableRow";const pse=x.forwardRef(({className:e,...t},n)=>b.jsx("th",{ref:n,className:be("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));pse.displayName="TableHead";const Yj=x.forwardRef(({className:e,...t},n)=>b.jsx("td",{ref:n,className:be("p-2 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Yj.displayName="TableCell";const PIt=x.forwardRef(({className:e,...t},n)=>b.jsx("caption",{ref:n,className:be("mt-4 text-sm text-muted-foreground",e),...t}));PIt.displayName="TableCaption";const AIt=({table:e})=>{const t=()=>{const i=e.getSelectedRowModel().rows.length,o=e.getIsAllRowsSelected(),s=e.getIsAllPageRowsSelected(),a=e.getFilteredRowModel().rows.length;return s&&!o?b.jsxs("span",{children:[i," selected",b.jsxs(St,{size:"xs","data-testid":"select-all-button",variant:"link",onClick:()=>e.toggleAllRowsSelected(!0),children:["Select all ",a]})]}):i?b.jsxs("span",{children:[i," selected",b.jsx(St,{size:"xs","data-testid":"clear-selection-button",variant:"link",onClick:()=>e.toggleAllRowsSelected(!1),children:"Clear selection"})]}):`${a} items`},n=Math.min(e.getState().pagination.pageIndex+1,e.getPageCount()),r=e.getPageCount();return b.jsxs("div",{className:"flex flex-1 items-center justify-between px-2",children:[b.jsx("div",{className:"text-sm text-muted-foreground",children:t()}),b.jsxs("div",{className:"flex items-center space-x-2",children:[b.jsxs(St,{size:"xs",variant:"outline","data-testid":"first-page-button",className:"hidden h-6 w-6 p-0 lg:flex",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:[b.jsx("span",{className:"sr-only",children:"Go to first page"}),b.jsx(TEt,{className:"h-4 w-4"})]}),b.jsxs(St,{size:"xs",variant:"outline","data-testid":"previous-page-button",className:"h-6 w-6 p-0",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:[b.jsx("span",{className:"sr-only",children:"Go to previous page"}),b.jsx(_Et,{className:"h-4 w-4"})]}),b.jsxs("div",{className:"flex items-center justify-center text-xs font-medium gap-1",children:[b.jsx("span",{children:"Page"}),b.jsx("select",{className:"cursor-pointer border rounded",value:n,"data-testid":"page-select",onChange:i=>e.setPageIndex(Number(i.target.value)-1),children:Array.from({length:r},(i,o)=>b.jsx("option",{value:o+1,children:o+1},o))}),b.jsxs("span",{className:"flex-shrink-0",children:["of ",RIt(r)]})]}),b.jsxs(St,{size:"xs",variant:"outline","data-testid":"next-page-button",className:"h-6 w-6 p-0",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:[b.jsx("span",{className:"sr-only",children:"Go to next page"}),b.jsx(uoe,{className:"h-4 w-4"})]}),b.jsxs(St,{size:"xs",variant:"outline","data-testid":"last-page-button",className:"hidden h-6 w-6 p-0 lg:flex",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:[b.jsx("span",{className:"sr-only",children:"Go to last page"}),b.jsx(PEt,{className:"h-4 w-4"})]})]})]})};function RIt(e){return new Intl.NumberFormat().format(e)}const TY=["Enter"," "],DIt=["ArrowDown","PageUp","Home"],kFe=["ArrowUp","PageDown","End"],MIt=[...DIt,...kFe],NIt={ltr:[...TY,"ArrowRight"],rtl:[...TY,"ArrowLeft"]},IIt={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Mz="Menu",[gP,LIt,jIt]=jC(Mz),[XO,Nz]=uo(Mz,[jIt,vv,JC]),Iz=vv(),$Fe=JC(),[TFe,xv]=XO(Mz),[FIt,BR]=XO(Mz),zIt=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=Iz(t),[l,c]=x.useState(null),u=x.useRef(!1),f=Xs(o),d=BO(i);return x.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),x.createElement($R,a,x.createElement(TFe,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},x.createElement(FIt,{scope:t,onClose:x.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:d,modal:s},r)))},PFe=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Iz(n);return x.createElement(ez,oe({},i,r,{ref:t}))}),AFe="MenuPortal",[QIt,RFe]=XO(AFe,{forceMount:void 0}),BIt=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=xv(AFe,t);return x.createElement(QIt,{scope:t,forceMount:n},x.createElement(Gs,{present:n||o.open},x.createElement(VC,{asChild:!0,container:i},r)))},dd="MenuContent",[WIt,gse]=XO(dd),qIt=x.forwardRef((e,t)=>{const n=RFe(dd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=xv(dd,e.__scopeMenu),s=BR(dd,e.__scopeMenu);return x.createElement(gP.Provider,{scope:e.__scopeMenu},x.createElement(Gs,{present:r||o.open},x.createElement(gP.Slot,{scope:e.__scopeMenu},s.modal?x.createElement(VIt,oe({},i,{ref:t})):x.createElement(UIt,oe({},i,{ref:t})))))}),VIt=x.forwardRef((e,t)=>{const n=xv(dd,e.__scopeMenu),r=x.useRef(null),i=Yt(t,r);return x.useEffect(()=>{const o=r.current;if(o)return NR(o)},[]),x.createElement(mse,oe({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Xe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),UIt=x.forwardRef((e,t)=>{const n=xv(dd,e.__scopeMenu);return x.createElement(mse,oe({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),mse=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:h,disableOutsideScroll:p,...g}=e,v=xv(dd,n),y=BR(dd,n),O=Iz(n),m=$Fe(n),w=LIt(n),[S,E]=x.useState(null),C=x.useRef(null),k=Yt(t,C,v.onContentChange),P=x.useRef(0),D=x.useRef(""),M=x.useRef(0),L=x.useRef(null),A=x.useRef("right"),T=x.useRef(0),N=p?vz:x.Fragment,j=p?{as:vd,allowPinchZoom:!0}:void 0,z=F=>{var q,U;const V=D.current+F,H=w().filter(ae=>!ae.disabled),Z=document.activeElement,ee=(q=H.find(ae=>ae.ref.current===Z))===null||q===void 0?void 0:q.textValue,se=H.map(ae=>ae.textValue),fe=u5t(se,V,ee),ce=(U=H.find(ae=>ae.textValue===fe))===null||U===void 0?void 0:U.ref.current;(function ae(de){D.current=de,window.clearTimeout(P.current),de!==""&&(P.current=window.setTimeout(()=>ae(""),1e3))})(V),ce&&setTimeout(()=>ce.focus())};x.useEffect(()=>()=>window.clearTimeout(P.current),[]),mz();const W=x.useCallback(F=>{var q,U;return A.current===((q=L.current)===null||q===void 0?void 0:q.side)&&d5t(F,(U=L.current)===null||U===void 0?void 0:U.area)},[]);return x.createElement(WIt,{scope:n,searchRef:D,onItemEnter:x.useCallback(F=>{W(F)&&F.preventDefault()},[W]),onItemLeave:x.useCallback(F=>{var q;W(F)||((q=C.current)===null||q===void 0||q.focus(),E(null))},[W]),onTriggerLeave:x.useCallback(F=>{W(F)&&F.preventDefault()},[W]),pointerGraceTimerRef:M,onPointerGraceIntentChange:x.useCallback(F=>{L.current=F},[])},x.createElement(N,j,x.createElement(gz,{asChild:!0,trapped:i,onMountAutoFocus:Xe(o,F=>{var q;F.preventDefault(),(q=C.current)===null||q===void 0||q.focus()}),onUnmountAutoFocus:s},x.createElement(qC,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:h},x.createElement(rse,oe({asChild:!0},m,{dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:Xe(l,F=>{y.isUsingKeyboardRef.current||F.preventDefault()})}),x.createElement(tz,oe({role:"menu","aria-orientation":"vertical","data-state":jFe(v.open),"data-radix-menu-content":"",dir:y.dir},O,g,{ref:k,style:{outline:"none",...g.style},onKeyDown:Xe(g.onKeyDown,F=>{const U=F.target.closest("[data-radix-menu-content]")===F.currentTarget,V=F.ctrlKey||F.altKey||F.metaKey,H=F.key.length===1;U&&(F.key==="Tab"&&F.preventDefault(),!V&&H&&z(F.key));const Z=C.current;if(F.target!==Z||!MIt.includes(F.key))return;F.preventDefault();const se=w().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);kFe.includes(F.key)&&se.reverse(),l5t(se)}),onBlur:Xe(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(P.current),D.current="")}),onPointerMove:Xe(e.onPointerMove,mP(F=>{const q=F.target,U=T.current!==F.clientX;if(F.currentTarget.contains(q)&&U){const V=F.clientX>T.current?"right":"left";A.current=V,T.current=F.clientX}}))})))))))}),HIt=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.createElement(Ot.div,oe({role:"group"},r,{ref:t}))}),XIt=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.createElement(Ot.div,oe({},r,{ref:t}))}),PY="MenuItem",Z1e="menu.itemSelect",yse=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=x.useRef(null),s=BR(PY,e.__scopeMenu),a=gse(PY,e.__scopeMenu),l=Yt(t,o),c=x.useRef(!1),u=()=>{const f=o.current;if(!n&&f){const d=new CustomEvent(Z1e,{bubbles:!0,cancelable:!0});f.addEventListener(Z1e,h=>r==null?void 0:r(h),{once:!0}),Kre(f,d),d.defaultPrevented?c.current=!1:s.onClose()}};return x.createElement(DFe,oe({},i,{ref:l,disabled:n,onClick:Xe(e.onClick,u),onPointerDown:f=>{var d;(d=e.onPointerDown)===null||d===void 0||d.call(e,f),c.current=!0},onPointerUp:Xe(e.onPointerUp,f=>{var d;c.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:Xe(e.onKeyDown,f=>{const d=a.searchRef.current!=="";n||d&&f.key===" "||TY.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),DFe=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=gse(PY,n),a=$Fe(n),l=x.useRef(null),c=Yt(t,l),[u,f]=x.useState(!1),[d,h]=x.useState("");return x.useEffect(()=>{const p=l.current;if(p){var g;h(((g=p.textContent)!==null&&g!==void 0?g:"").trim())}},[o.children]),x.createElement(gP.ItemSlot,{scope:n,disabled:r,textValue:i??d},x.createElement(ise,oe({asChild:!0},a,{focusable:!r}),x.createElement(Ot.div,oe({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:c,onPointerMove:Xe(e.onPointerMove,mP(p=>{r?s.onItemLeave(p):(s.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus())})),onPointerLeave:Xe(e.onPointerLeave,mP(p=>s.onItemLeave(p))),onFocus:Xe(e.onFocus,()=>f(!0)),onBlur:Xe(e.onBlur,()=>f(!1))}))))}),ZIt=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return x.createElement(NFe,{scope:e.__scopeMenu,checked:n},x.createElement(yse,oe({role:"menuitemcheckbox","aria-checked":Gj(n)?"mixed":n},i,{ref:t,"data-state":vse(n),onSelect:Xe(i.onSelect,()=>r==null?void 0:r(Gj(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),YIt="MenuRadioGroup",[SGn,GIt]=XO(YIt,{value:void 0,onValueChange:()=>{}}),KIt="MenuRadioItem",JIt=x.forwardRef((e,t)=>{const{value:n,...r}=e,i=GIt(KIt,e.__scopeMenu),o=n===i.value;return x.createElement(NFe,{scope:e.__scopeMenu,checked:o},x.createElement(yse,oe({role:"menuitemradio","aria-checked":o},r,{ref:t,"data-state":vse(o),onSelect:Xe(r.onSelect,()=>{var s;return(s=i.onValueChange)===null||s===void 0?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})))}),MFe="MenuItemIndicator",[NFe,e5t]=XO(MFe,{checked:!1}),t5t=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=e5t(MFe,n);return x.createElement(Gs,{present:r||Gj(o.checked)||o.checked===!0},x.createElement(Ot.span,oe({},i,{ref:t,"data-state":vse(o.checked)})))}),n5t=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return x.createElement(Ot.div,oe({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),IFe="MenuSub",[r5t,LFe]=XO(IFe),i5t=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,o=xv(IFe,t),s=Iz(t),[a,l]=x.useState(null),[c,u]=x.useState(null),f=Xs(i);return x.useEffect(()=>(o.open===!1&&f(!1),()=>f(!1)),[o.open,f]),x.createElement($R,s,x.createElement(TFe,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:u},x.createElement(r5t,{scope:t,contentId:Ra(),triggerId:Ra(),trigger:a,onTriggerChange:l},n)))},iN="MenuSubTrigger",o5t=x.forwardRef((e,t)=>{const n=xv(iN,e.__scopeMenu),r=BR(iN,e.__scopeMenu),i=LFe(iN,e.__scopeMenu),o=gse(iN,e.__scopeMenu),s=x.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},u=x.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return x.useEffect(()=>u,[u]),x.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),x.createElement(PFe,oe({asChild:!0},c),x.createElement(DFe,oe({id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":jFe(n.open)},e,{ref:t6(t,i.onTriggerChange),onClick:f=>{var d;(d=e.onClick)===null||d===void 0||d.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Xe(e.onPointerMove,mP(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Xe(e.onPointerLeave,mP(f=>{var d;u();const h=(d=n.content)===null||d===void 0?void 0:d.getBoundingClientRect();if(h){var p;const g=(p=n.content)===null||p===void 0?void 0:p.dataset.side,v=g==="right",y=v?-5:5,O=h[v?"left":"right"],m=h[v?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x:O,y:h.top},{x:m,y:h.top},{x:m,y:h.bottom},{x:O,y:h.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Xe(e.onKeyDown,f=>{const d=o.searchRef.current!=="";if(!(e.disabled||d&&f.key===" ")&&NIt[r.dir].includes(f.key)){var h;n.onOpenChange(!0),(h=n.content)===null||h===void 0||h.focus(),f.preventDefault()}})})))}),s5t="MenuSubContent",a5t=x.forwardRef((e,t)=>{const n=RFe(dd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=xv(dd,e.__scopeMenu),s=BR(dd,e.__scopeMenu),a=LFe(s5t,e.__scopeMenu),l=x.useRef(null),c=Yt(t,l);return x.createElement(gP.Provider,{scope:e.__scopeMenu},x.createElement(Gs,{present:r||o.open},x.createElement(gP.Slot,{scope:e.__scopeMenu},x.createElement(mse,oe({id:a.contentId,"aria-labelledby":a.triggerId},i,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Xe(e.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Xe(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Xe(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),d=IIt[s.dir].includes(u.key);if(f&&d){var h;o.onOpenChange(!1),(h=a.trigger)===null||h===void 0||h.focus(),u.preventDefault()}})})))))});function jFe(e){return e?"open":"closed"}function Gj(e){return e==="indeterminate"}function vse(e){return Gj(e)?"indeterminate":e?"checked":"unchecked"}function l5t(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function c5t(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function u5t(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=c5t(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function f5t(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(i=!i)}return i}function d5t(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return f5t(n,t)}function mP(e){return t=>t.pointerType==="mouse"?e(t):void 0}const FFe=zIt,zFe=PFe,QFe=BIt,BFe=qIt,h5t=HIt,WFe=XIt,qFe=yse,VFe=ZIt,UFe=JIt,HFe=t5t,XFe=n5t,p5t=i5t,ZFe=o5t,YFe=a5t,GFe="DropdownMenu",[g5t,EGn]=uo(GFe,[Nz]),hc=Nz(),[m5t,KFe]=g5t(GFe),y5t=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=hc(t),c=x.useRef(null),[u=!1,f]=ko({prop:i,defaultProp:o,onChange:s});return x.createElement(m5t,{scope:t,triggerId:Ra(),triggerRef:c,contentId:Ra(),open:u,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(d=>!d),[f]),modal:a},x.createElement(FFe,oe({},l,{open:u,onOpenChange:f,dir:r,modal:a}),n))},v5t="DropdownMenuTrigger",b5t=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=KFe(v5t,n),s=hc(n);return x.createElement(zFe,oe({asChild:!0},s),x.createElement(Ot.button,oe({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},i,{ref:t6(t,o.triggerRef),onPointerDown:Xe(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Xe(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),O5t=e=>{const{__scopeDropdownMenu:t,...n}=e,r=hc(t);return x.createElement(QFe,oe({},r,n))},x5t="DropdownMenuContent",w5t=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=KFe(x5t,n),o=hc(n),s=x.useRef(!1);return x.createElement(BFe,oe({id:i.contentId,"aria-labelledby":i.triggerId},o,r,{ref:t,onCloseAutoFocus:Xe(e.onCloseAutoFocus,a=>{var l;s.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Xe(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),S5t=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=hc(n);return x.createElement(h5t,oe({},i,r,{ref:t}))}),E5t=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=hc(n);return x.createElement(WFe,oe({},i,r,{ref:t}))}),C5t=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=hc(n);return x.createElement(qFe,oe({},i,r,{ref:t}))}),_5t=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=hc(n);return x.createElement(VFe,oe({},i,r,{ref:t}))}),k5t=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=hc(n);return x.createElement(UFe,oe({},i,r,{ref:t}))}),$5t=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=hc(n);return x.createElement(HFe,oe({},i,r,{ref:t}))}),T5t=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=hc(n);return x.createElement(XFe,oe({},i,r,{ref:t}))}),P5t=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:o}=e,s=hc(t),[a=!1,l]=ko({prop:r,defaultProp:o,onChange:i});return x.createElement(p5t,oe({},s,{open:a,onOpenChange:l}),n)},A5t=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=hc(n);return x.createElement(ZFe,oe({},i,r,{ref:t}))}),R5t=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=hc(n);return x.createElement(YFe,oe({},i,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),D5t=y5t,M5t=b5t,JFe=O5t,e4e=w5t,N5t=S5t,t4e=E5t,n4e=C5t,r4e=_5t,i4e=k5t,o4e=$5t,s4e=T5t,I5t=P5t,a4e=A5t,l4e=R5t,Bb=D5t,Wb=M5t,L5t=N5t,j5t=JFe,F5t=I5t,c4e=ie.forwardRef(({className:e,inset:t,children:n,...r},i)=>b.jsxs(a4e,{ref:i,className:N3e({className:e,inset:t}),...r,children:[n,b.jsx(uoe,{className:"ml-auto h-4 w-4"})]}));c4e.displayName=a4e.displayName;const u4e=ie.forwardRef(({className:e,...t},n)=>b.jsx(l4e,{ref:n,className:be(kz({subcontent:!0}),"animate-in data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",e),...t}));u4e.displayName=l4e.displayName;const R0=ie.forwardRef(({className:e,sideOffset:t=4,...n},r)=>b.jsx(JFe,{children:b.jsx(e4e,{ref:r,sideOffset:t,className:be(kz(),"animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));R0.displayName=e4e.displayName;const ll=ie.forwardRef(({className:e,inset:t,variant:n,...r},i)=>b.jsx(n4e,{ref:i,className:Hoe({className:e,inset:t,variant:n}),...r}));ll.displayName=n4e.displayName;const z5t=ie.forwardRef(({className:e,children:t,checked:n,...r},i)=>b.jsxs(r4e,{ref:i,className:I3e({className:e}),checked:n,...r,children:[b.jsx("span",{className:yE(),children:b.jsx(o4e,{children:b.jsx(dm,{className:"h-4 w-4"})})}),t]}));z5t.displayName=r4e.displayName;const Q5t=ie.forwardRef(({className:e,children:t,...n},r)=>b.jsxs(i4e,{ref:r,className:I3e({className:e}),...n,children:[b.jsx("span",{className:yE(),children:b.jsx(o4e,{children:b.jsx(Fj,{className:"h-2 w-2 fill-current"})})}),t]}));Q5t.displayName=i4e.displayName;const f4e=ie.forwardRef(({className:e,inset:t,...n},r)=>b.jsx(t4e,{ref:r,className:L3e({className:e,inset:t}),...n}));f4e.displayName=t4e.displayName;const qb=ie.forwardRef(({className:e,...t},n)=>b.jsx(s4e,{ref:n,className:Xoe({className:e}),...t}));qb.displayName=s4e.displayName;const B5t=Zoe;function W5t(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const q5t=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function $g(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function Kj(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function V5t(e){const t=Kj(e,"border-left-width"),n=Kj(e,"border-right-width");return e.clientWidth+t+n}function U5t(e){const t=Kj(e,"border-top-width"),n=Kj(e,"border-bottom-width");return e.clientHeight+t+n}function d4e(e,t={}){const n=t.width||V5t(e),r=t.height||U5t(e);return{width:n,height:r}}function H5t(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const bc=16384;function X5t(e){(e.width>bc||e.height>bc)&&(e.width>bc&&e.height>bc?e.width>e.height?(e.height*=bc/e.width,e.width=bc):(e.width*=bc/e.height,e.height=bc):e.width>bc?(e.height*=bc/e.width,e.width=bc):(e.width*=bc/e.height,e.height=bc))}function Jj(e){return new Promise((t,n)=>{const r=new Image;r.decode=()=>t(r),r.onload=()=>t(r),r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Z5t(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Y5t(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),i.appendChild(o),o.appendChild(e),Z5t(i)}const Yl=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Yl(n,t)};function G5t(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function K5t(e){return $g(e).map(t=>{const n=e.getPropertyValue(t),r=e.getPropertyPriority(t);return`${t}: ${n}${r?" !important":""};`}).join(" ")}function J5t(e,t,n){const r=`.${e}:${t}`,i=n.cssText?G5t(n):K5t(n);return document.createTextNode(`${r}{${i}}`)}function Y1e(e,t,n){const r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(i===""||i==="none")return;const o=q5t();try{t.className=`${t.className} ${o}`}catch{return}const s=document.createElement("style");s.appendChild(J5t(o,n,r)),t.appendChild(s)}function eLt(e,t){Y1e(e,t,":before"),Y1e(e,t,":after")}const G1e="application/font-woff",K1e="image/jpeg",tLt={woff:G1e,woff2:G1e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:K1e,jpeg:K1e,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function nLt(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function bse(e){const t=nLt(e).toLowerCase();return tLt[t]||""}function rLt(e){return e.split(/,/)[1]}function AY(e){return e.search(/^(data:)/)!==-1}function h4e(e,t){return`data:${t};base64,${e}`}async function p4e(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((o,s)=>{const a=new FileReader;a.onerror=s,a.onloadend=()=>{try{o(n({res:r,result:a.result}))}catch(l){s(l)}},a.readAsDataURL(i)})}const Sq={};function iLt(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function Ose(e,t,n){const r=iLt(e,t,n.includeQueryParams);if(Sq[r]!=null)return Sq[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const o=await p4e(e,n.fetchRequestInit,({res:s,result:a})=>(t||(t=s.headers.get("Content-Type")||""),rLt(a)));i=h4e(o,t)}catch(o){i=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${e}`;o&&(s=typeof o=="string"?o:o.message),s&&console.warn(s)}return Sq[r]=i,i}async function oLt(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Jj(t)}async function sLt(e,t){if(e.currentSrc){const o=document.createElement("canvas"),s=o.getContext("2d");o.width=e.clientWidth,o.height=e.clientHeight,s==null||s.drawImage(e,0,0,o.width,o.height);const a=o.toDataURL();return Jj(a)}const n=e.poster,r=bse(n),i=await Ose(n,r,t);return Jj(i)}async function aLt(e){var t;try{if(!((t=e==null?void 0:e.contentDocument)===null||t===void 0)&&t.body)return await Lz(e.contentDocument.body,{},!0)}catch{}return e.cloneNode(!1)}async function lLt(e,t){return Yl(e,HTMLCanvasElement)?oLt(e):Yl(e,HTMLVideoElement)?sLt(e,t):Yl(e,HTMLIFrameElement)?aLt(e):e.cloneNode(!1)}const cLt=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT";async function uLt(e,t,n){var r,i;let o=[];return cLt(e)&&e.assignedNodes?o=$g(e.assignedNodes()):Yl(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?o=$g(e.contentDocument.body.childNodes):o=$g(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),o.length===0||Yl(e,HTMLVideoElement)||await o.reduce((s,a)=>s.then(()=>Lz(a,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}function fLt(e,t){const n=t.style;if(!n)return;const r=window.getComputedStyle(e);r.cssText?(n.cssText=r.cssText,n.transformOrigin=r.transformOrigin):$g(r).forEach(i=>{let o=r.getPropertyValue(i);i==="font-size"&&o.endsWith("px")&&(o=`${Math.floor(parseFloat(o.substring(0,o.length-2)))-.1}px`),Yl(e,HTMLIFrameElement)&&i==="display"&&o==="inline"&&(o="block"),i==="d"&&t.getAttribute("d")&&(o=`path(${t.getAttribute("d")})`),n.setProperty(i,o,r.getPropertyPriority(i))})}function dLt(e,t){Yl(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Yl(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function hLt(e,t){if(Yl(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function pLt(e,t){return Yl(t,Element)&&(fLt(e,t),eLt(e,t),dLt(e,t),hLt(e,t)),t}async function gLt(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let o=0;o<n.length;o++){const a=n[o].getAttribute("xlink:href");if(a){const l=e.querySelector(a),c=document.querySelector(a);!l&&c&&!r[a]&&(r[a]=await Lz(c,t,!0))}}const i=Object.values(r);if(i.length){const o="http://www.w3.org/1999/xhtml",s=document.createElementNS(o,"svg");s.setAttribute("xmlns",o),s.style.position="absolute",s.style.width="0",s.style.height="0",s.style.overflow="hidden",s.style.display="none";const a=document.createElementNS(o,"defs");s.appendChild(a);for(let l=0;l<i.length;l++)a.appendChild(i[l]);e.appendChild(s)}return e}async function Lz(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>lLt(r,t)).then(r=>uLt(e,r,t)).then(r=>pLt(e,r)).then(r=>gLt(r,t))}const g4e=/url\((['"]?)([^'"]+?)\1\)/g,mLt=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,yLt=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function vLt(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function bLt(e){const t=[];return e.replace(g4e,(n,r,i)=>(t.push(i),n)),t.filter(n=>!AY(n))}async function OLt(e,t,n,r,i){try{const o=n?W5t(t,n):t,s=bse(t);let a;if(i){const l=await i(o);a=h4e(l,s)}else a=await Ose(o,s,r);return e.replace(vLt(t),`$1${a}$3`)}catch{}return e}function xLt(e,{preferredFontFormat:t}){return t?e.replace(yLt,n=>{for(;;){const[r,,i]=mLt.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function m4e(e){return e.search(g4e)!==-1}async function y4e(e,t,n){if(!m4e(e))return e;const r=xLt(e,n);return bLt(r).reduce((o,s)=>o.then(a=>OLt(a,s,t,n)),Promise.resolve(r))}async function oN(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const o=await y4e(i,null,n);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function wLt(e,t){await oN("background",e,t)||await oN("background-image",e,t),await oN("mask",e,t)||await oN("mask-image",e,t)}async function SLt(e,t){const n=Yl(e,HTMLImageElement);if(!(n&&!AY(e.src))&&!(Yl(e,SVGImageElement)&&!AY(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await Ose(r,bse(r),t);await new Promise((o,s)=>{e.onload=o,e.onerror=s;const a=e;a.decode&&(a.decode=o),a.loading==="lazy"&&(a.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function ELt(e,t){const r=$g(e.childNodes).map(i=>v4e(i,t));await Promise.all(r).then(()=>e)}async function v4e(e,t){Yl(e,Element)&&(await wLt(e,t),await SLt(e,t),await ELt(e,t))}function CLt(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const J1e={};async function ebe(e){let t=J1e[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},J1e[e]=t,t}async function tbe(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let a=s.replace(r,"$1");return a.startsWith("https://")||(a=new URL(a,e.url).href),p4e(a,t.fetchRequestInit,({result:l})=>(n=n.replace(s,`url(${l})`),[s,l]))});return Promise.all(o).then(()=>n)}function nbe(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",a=new RegExp(s,"gi");for(;;){let l=o.exec(r);if(l===null){if(l=a.exec(r),l===null)break;o.lastIndex=a.lastIndex}else a.lastIndex=o.lastIndex;t.push(l[0])}return t}async function _Lt(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{$g(i.cssRules||[]).forEach((o,s)=>{if(o.type===CSSRule.IMPORT_RULE){let a=s+1;const l=o.href,c=ebe(l).then(u=>tbe(u,t)).then(u=>nbe(u).forEach(f=>{try{i.insertRule(f,f.startsWith("@import")?a+=1:i.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:f,error:d})}})).catch(u=>{console.error("Error loading remote css",u.toString())});r.push(c)}})}catch(o){const s=e.find(a=>a.href==null)||document.styleSheets[0];i.href!=null&&r.push(ebe(i.href).then(a=>tbe(a,t)).then(a=>nbe(a).forEach(l=>{s.insertRule(l,i.cssRules.length)})).catch(a=>{console.error("Error loading remote stylesheet",a)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{$g(i.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${i.href}`,o)}}),n))}function kLt(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>m4e(t.style.getPropertyValue("src")))}async function $Lt(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=$g(e.ownerDocument.styleSheets),r=await _Lt(n,t);return kLt(r)}async function TLt(e,t){const n=await $Lt(e,t);return(await Promise.all(n.map(i=>{const o=i.parentStyleSheet?i.parentStyleSheet.href:null;return y4e(i.cssText,o,t)}))).join(`
`)}async function PLt(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await TLt(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function ALt(e,t={}){const{width:n,height:r}=d4e(e,t),i=await Lz(e,t,!0);return await PLt(i,t),await v4e(i,t),CLt(i,t),await Y5t(i,n,r)}async function RLt(e,t={}){const{width:n,height:r}=d4e(e,t),i=await ALt(e,t),o=await Jj(i),s=document.createElement("canvas"),a=s.getContext("2d"),l=t.pixelRatio||H5t(),c=t.canvasWidth||n,u=t.canvasHeight||r;return s.width=c*l,s.height=u*l,t.skipAutoScale||X5t(s),s.style.width=`${c}`,s.style.height=`${u}`,t.backgroundColor&&(a.fillStyle=t.backgroundColor,a.fillRect(0,0,s.width,s.height)),a.drawImage(o,0,0,s.width,s.height),s}async function DLt(e,t={}){return(await RLt(e,t)).toDataURL()}async function b4e(e,t){const n=document.getElementById("App"),r=(n==null?void 0:n.scrollTop)??0;document.body.classList.add("printing");try{const i=await DLt(e);jz(i,t.endsWith(".png")?t:`${t}.png`)}catch{yr({title:"Error",description:"Failed to download as PNG.",variant:"danger"})}finally{document.body.classList.remove("printing"),requestAnimationFrame(()=>{n==null||n.scrollTo(0,r)})}}function jz(e,t){const n=document.createElement("a");n.href=e,n.download=t,n.click(),n.remove()}function WR(e,t){const n=URL.createObjectURL(e);jz(n,t)}const MLt=[{label:"CSV",format:"csv"},{label:"JSON",format:"json"}],NLt=e=>{const t=b.jsxs(St,{"data-testid":"download-as-button",size:"xs",variant:"link",children:["Download ",b.jsx(P0,{className:"w-3 h-3 ml-1"})]});return b.jsxs(Bb,{modal:!1,children:[b.jsx(Wb,{asChild:!0,children:t}),b.jsx(R0,{side:"bottom",className:"no-print",children:MLt.map(n=>b.jsx(ll,{onSelect:async()=>{const r=await e.downloadAs({format:n.format}).catch(i=>{yr({title:"Failed to download",description:"message"in i?i.message:String(i)})});r&&jz(r,"download")},children:n.label},n.label))})]})},O4e=({wrapperClassName:e,className:t,columns:n,data:r,rowSelection:i,pageSize:o=10,downloadAs:s,pagination:a=!1,onRowSelectionChange:l})=>{var p;const[c,u]=ie.useState([]),[f,d]=ie.useState({pageSize:o,pageIndex:0}),h=_Fe({data:r,columns:n,getCoreRowModel:EFe(),onPaginationChange:d,getPaginationRowModel:a?CIt():void 0,onSortingChange:u,getSortedRowModel:CFe(),onRowSelectionChange:l,state:{sorting:c,pagination:a?{...f,pageSize:o}:{pageIndex:0,pageSize:r.length},rowSelection:i}});return b.jsxs("div",{className:be(e,"flex flex-col space-y-2"),children:[b.jsx("div",{className:be(t||"rounded-md border"),children:b.jsxs(fse,{children:[b.jsx(dse,{children:h.getHeaderGroups().map(g=>b.jsx(OS,{children:g.headers.map(v=>b.jsx(pse,{children:v.isPlaceholder?null:Zj(v.column.columnDef.header,v.getContext())},v.id))},g.id))}),b.jsx(hse,{children:(p=h.getRowModel().rows)!=null&&p.length?h.getRowModel().rows.map(g=>b.jsx(OS,{"data-state":g.getIsSelected()&&"selected",children:g.getVisibleCells().map(v=>b.jsx(Yj,{children:Zj(v.column.columnDef.cell,v.getContext())},v.id))},g.id)):b.jsx(OS,{children:b.jsx(Yj,{colSpan:n.length,className:"h-24 text-center",children:"No results."})})})]})}),b.jsxs("div",{className:"flex align-items justify-between flex-shrink-0",children:[a?b.jsx(AIt,{table:h}):b.jsx("div",{}),s&&b.jsx(NLt,{downloadAs:s})]})]})},AT=({column:e,header:t,className:n})=>{if(!e.getCanSort())return b.jsx("div",{className:be(n),children:t});const r=e.getSortingFn(),i=r===w1.basic?mEt:vEt,o=r===w1.basic?yEt:bEt;return b.jsxs("div",{className:be("group flex items-center space-x-2",n),children:[b.jsx("span",{className:"flex-1",children:t}),b.jsxs(Bb,{modal:!1,children:[b.jsx(Wb,{asChild:!0,children:b.jsx(St,{variant:"ghost","data-testid":"data-table-sort-button",size:"xs",className:be("ml-3 h-5 data-[state=open]:bg-accent m-0 p-1",!e.getIsSorted()&&"invisible group-hover:visible data-[state=open]:visible"),children:e.getIsSorted()==="desc"?b.jsx(o,{className:"h-3 w-3"}):e.getIsSorted()==="asc"?b.jsx(i,{className:"h-3 w-3"}):b.jsx(KZ,{className:"h-3 w-3"})})}),b.jsxs(R0,{align:"start",children:[b.jsxs(ll,{onClick:()=>e.toggleSorting(!1),children:[b.jsx(i,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Asc"]}),b.jsxs(ll,{onClick:()=>e.toggleSorting(!0),children:[b.jsx(o,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Desc"]}),e.getIsSorted()&&b.jsxs(b.Fragment,{children:[b.jsx(qb,{}),b.jsxs(ll,{onClick:()=>e.clearSorting(),children:[b.jsx(KZ,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70"}),"Clear"]})]})]})]})]})},x4e=Hgt,xse=x.forwardRef(({className:e,...t},n)=>b.jsx(Xgt,{ref:n,className:be("border-b",e),...t}));xse.displayName="AccordionItem";const wse=x.forwardRef(({className:e,children:t,...n},r)=>b.jsx(Zgt,{className:"flex",children:b.jsxs(JNe,{ref:r,className:be("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,b.jsx(P0,{className:"h-4 w-4 transition-transform duration-200"})]})}));wse.displayName=JNe.displayName;const Sse=x.forwardRef(({className:e,children:t,...n},r)=>b.jsx(eIe,{ref:r,className:be("overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",e),...n,children:b.jsx("div",{className:"pb-4 pt-0",children:t})}));Sse.displayName=eIe.displayName;const Vb="__",ILt=new Set(["__*","marimo","app","False","None","True","__peg_parser__","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield","None"]);function Eq(e){return e=e.trim(),e?(/^\d/.test(e)&&(e=`_${e}`),e.replaceAll(/\W/g,"_").toLowerCase()):Vb}function LLt(e,t){const n=new Set(t);let r=e;const i=s=>!n.has(s)&&!ILt.has(s);if(i(e))return e;let o=1;for(;!i(r);)r=`${e}_${o}`,o++;return r}function w4e(e,t){return e!==Vb?e:`cell-${t}`}function O$({id:e,name:t=Vb,code:n="",lastCodeRun:r=null,edited:i=!1,config:o={},serializedEditorState:s=null}){return{id:e,config:o,name:t,code:n,edited:i,lastCodeRun:r,serializedEditorState:s}}function fk(){return{outline:null,output:null,consoleOutputs:[],status:"idle",interrupted:!1,errored:!1,stopped:!1,runElapsedTimeMs:null,runStartTimestamp:null,debuggerActive:!1}}function Cq({cellId:e,cell:t,config:n,codeFocus:r}){var o;if(!t)return;const i=document.getElementById(Od.create(e));if(!i){At.warn("scrollCellIntoView: element not found");return}if(n.hide_code)i.focus();else{const s=(o=t.current)==null?void 0:o.editorView;if(!s)return;if(s.focus(),r==="top")s.dispatch({selection:{anchor:0,head:0}});else if(r==="bottom"){const a=s.state.doc.line(s.state.doc.lines);s.dispatch({selection:{anchor:a.from,head:a.from}})}}i.scrollIntoView({behavior:"smooth",block:"center"})}function rbe(){window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})}function jLt(){window.scrollTo({top:0,behavior:"smooth"})}function FLt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const Fz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function e_(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Ese(e){return"nodeType"in e}function pc(e){var t,n;return e?e_(e)?e:Ese(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Cse(e){const{Document:t}=pc(e);return e instanceof t}function qR(e){return e_(e)?!1:e instanceof pc(e).HTMLElement}function S4e(e){return e instanceof pc(e).SVGElement}function t_(e){return e?e_(e)?e.document:Ese(e)?Cse(e)?e:qR(e)||S4e(e)?e.ownerDocument:document:document:document}const wd=Fz?x.useLayoutEffect:x.useEffect;function _se(e){const t=x.useRef(e);return wd(()=>{t.current=e}),x.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function zLt(){const e=x.useRef(null),t=x.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=x.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function yP(e,t){t===void 0&&(t=[e]);const n=x.useRef(e);return wd(()=>{n.current!==e&&(n.current=e)},t),n}function VR(e,t){const n=x.useRef();return x.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function e3(e){const t=_se(e),n=x.useRef(null),r=x.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function RY(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}let _q={};function UR(e,t){return x.useMemo(()=>{if(t)return t;const n=_q[e]==null?0:_q[e]+1;return _q[e]=n,e+"-"+n},[e,t])}function E4e(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,s)=>{const a=Object.entries(s);for(const[l,c]of a){const u=o[l];u!=null&&(o[l]=u+e*c)}return o},{...t})}}const xS=E4e(1),vP=E4e(-1);function QLt(e){return"clientX"in e&&"clientY"in e}function kse(e){if(!e)return!1;const{KeyboardEvent:t}=pc(e.target);return t&&e instanceof t}function BLt(e){if(!e)return!1;const{TouchEvent:t}=pc(e.target);return t&&e instanceof t}function DY(e){if(BLt(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return QLt(e)?{x:e.clientX,y:e.clientY}:null}const bP=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[bP.Translate.toString(e),bP.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),ibe="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function WLt(e){return e.matches(ibe)?e:e.querySelector(ibe)}const qLt={display:"none"};function VLt(e){let{id:t,value:n}=e;return ie.createElement("div",{id:t,style:qLt},n)}function ULt(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ie.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function HLt(){const[e,t]=x.useState("");return{announce:x.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const C4e=x.createContext(null);function XLt(e){const t=x.useContext(C4e);x.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function ZLt(){const[e]=x.useState(()=>new Set),t=x.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[x.useCallback(r=>{let{type:i,event:o}=r;e.forEach(s=>{var a;return(a=s[i])==null?void 0:a.call(s,o)})},[e]),t]}const YLt={draggable:`
    To pick up a draggable item, press the space bar.
    While dragging, use the arrow keys to move the item.
    Press space again to drop the item in its new position, or press escape to cancel.
  `},GLt={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function KLt(e){let{announcements:t=GLt,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=YLt}=e;const{announce:o,announcement:s}=HLt(),a=UR("DndLiveRegion"),[l,c]=x.useState(!1);if(x.useEffect(()=>{c(!0)},[]),XLt(x.useMemo(()=>({onDragStart(f){let{active:d}=f;o(t.onDragStart({active:d}))},onDragMove(f){let{active:d,over:h}=f;t.onDragMove&&o(t.onDragMove({active:d,over:h}))},onDragOver(f){let{active:d,over:h}=f;o(t.onDragOver({active:d,over:h}))},onDragEnd(f){let{active:d,over:h}=f;o(t.onDragEnd({active:d,over:h}))},onDragCancel(f){let{active:d,over:h}=f;o(t.onDragCancel({active:d,over:h}))}}),[o,t])),!l)return null;const u=ie.createElement(ie.Fragment,null,ie.createElement(VLt,{id:r,value:i.draggable}),ie.createElement(ULt,{id:a,announcement:s}));return n?as.createPortal(u,n):u}var zo;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(zo||(zo={}));function t3(){}function obe(e,t){return x.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function JLt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Sd=Object.freeze({x:0,y:0});function _4e(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function k4e(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function ejt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function sbe(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function $4e(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function abe(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const tjt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=abe(t,t.left,t.top),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=_4e(abe(l),i);o.push({id:a,data:{droppableContainer:s,value:c}})}}return o.sort(k4e)},njt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=sbe(t),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=sbe(l),u=i.reduce((d,h,p)=>d+_4e(c[p],h),0),f=Number((u/4).toFixed(4));o.push({id:a,data:{droppableContainer:s,value:f}})}}return o.sort(k4e)};function rjt(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-r,a=o-n;if(r<i&&n<o){const l=t.width*t.height,c=e.width*e.height,u=s*a,f=u/(l+c-u);return Number(f.toFixed(4))}return 0}const ijt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:s}=o,a=n.get(s);if(a){const l=rjt(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(ejt)};function ojt(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function T4e(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Sd}function sjt(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const ajt=sjt(1);function ljt(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function cjt(e,t,n){const r=ljt(t);if(!r)return e;const{scaleX:i,scaleY:o,x:s,y:a}=r,l=e.left-s-(1-i)*parseFloat(n),c=e.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,f=o?e.height/o:e.height;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l}}const ujt={ignoreTransform:!1};function n_(e,t){t===void 0&&(t=ujt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=pc(e).getComputedStyle(e);c&&(n=cjt(n,c,u))}const{top:r,left:i,width:o,height:s,bottom:a,right:l}=n;return{top:r,left:i,width:o,height:s,bottom:a,right:l}}function lbe(e){return n_(e,{ignoreTransform:!0})}function fjt(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function djt(e,t){return t===void 0&&(t=pc(e).getComputedStyle(e)),t.position==="fixed"}function hjt(e,t){t===void 0&&(t=pc(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function zz(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Cse(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!qR(i)||S4e(i)||n.includes(i))return n;const o=pc(e).getComputedStyle(i);return i!==e&&hjt(i,o)&&n.push(i),djt(i,o)?n:r(i.parentNode)}return e?r(e):n}function P4e(e){const[t]=zz(e,1);return t??null}function kq(e){return!Fz||!e?null:e_(e)?e:Ese(e)?Cse(e)||e===t_(e).scrollingElement?window:qR(e)?e:null:null}function A4e(e){return e_(e)?e.scrollX:e.scrollLeft}function R4e(e){return e_(e)?e.scrollY:e.scrollTop}function MY(e){return{x:A4e(e),y:R4e(e)}}var os;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(os||(os={}));function D4e(e){return!Fz||!e?!1:e===document.scrollingElement}function M4e(e){const t={x:0,y:0},n=D4e(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const pjt={x:.2,y:.2};function gjt(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=pjt);const{isTop:c,isBottom:u,isLeft:f,isRight:d}=M4e(e),h={x:0,y:0},p={x:0,y:0},g={height:t.height*i.y,width:t.width*i.x};return!c&&o<=t.top+g.height?(h.y=os.Backward,p.y=r*Math.abs((t.top+g.height-o)/g.height)):!u&&l>=t.bottom-g.height&&(h.y=os.Forward,p.y=r*Math.abs((t.bottom-g.height-l)/g.height)),!d&&a>=t.right-g.width?(h.x=os.Forward,p.x=r*Math.abs((t.right-g.width-a)/g.width)):!f&&s<=t.left+g.width&&(h.x=os.Backward,p.x=r*Math.abs((t.left+g.width-s)/g.width)),{direction:h,speed:p}}function mjt(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:s}=window;return{top:0,left:0,right:o,bottom:s,width:o,height:s}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function N4e(e){return e.reduce((t,n)=>xS(t,MY(n)),Sd)}function yjt(e){return e.reduce((t,n)=>t+A4e(n),0)}function vjt(e){return e.reduce((t,n)=>t+R4e(n),0)}function bjt(e,t){if(t===void 0&&(t=n_),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);P4e(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ojt=[["x",["left","right"],yjt],["y",["top","bottom"],vjt]];class $se{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=zz(n),i=N4e(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of Ojt)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=i[o]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class RT{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function xjt(e){const{EventTarget:t}=pc(e);return e instanceof t?e:t_(e)}function $q(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Su;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Su||(Su={}));function cbe(e){e.preventDefault()}function wjt(e){e.stopPropagation()}var zn;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(zn||(zn={}));const I4e={start:[zn.Space,zn.Enter],cancel:[zn.Esc],end:[zn.Space,zn.Enter]},Sjt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case zn.Right:return{...n,x:n.x+25};case zn.Left:return{...n,x:n.x-25};case zn.Down:return{...n,y:n.y+25};case zn.Up:return{...n,y:n.y-25}}};class Tse{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new RT(t_(n)),this.windowListeners=new RT(pc(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Su.Resize,this.handleCancel),this.windowListeners.add(Su.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Su.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&bjt(r),n(Sd)}handleKeyDown(t){if(kse(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=I4e,coordinateGetter:s=Sjt,scrollBehavior:a="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:Sd;this.referenceCoordinates||(this.referenceCoordinates=u);const f=s(t,{active:n,context:r.current,currentCoordinates:u});if(f){const d=vP(f,u),h={x:0,y:0},{scrollableAncestors:p}=r.current;for(const g of p){const v=t.code,{isTop:y,isRight:O,isLeft:m,isBottom:w,maxScroll:S,minScroll:E}=M4e(g),C=mjt(g),k={x:Math.min(v===zn.Right?C.right-C.width/2:C.right,Math.max(v===zn.Right?C.left:C.left+C.width/2,f.x)),y:Math.min(v===zn.Down?C.bottom-C.height/2:C.bottom,Math.max(v===zn.Down?C.top:C.top+C.height/2,f.y))},P=v===zn.Right&&!O||v===zn.Left&&!m,D=v===zn.Down&&!w||v===zn.Up&&!y;if(P&&k.x!==f.x){const M=g.scrollLeft+d.x,L=v===zn.Right&&M<=S.x||v===zn.Left&&M>=E.x;if(L&&!d.y){g.scrollTo({left:M,behavior:a});return}L?h.x=g.scrollLeft-M:h.x=v===zn.Right?g.scrollLeft-S.x:g.scrollLeft-E.x,h.x&&g.scrollBy({left:-h.x,behavior:a});break}else if(D&&k.y!==f.y){const M=g.scrollTop+d.y,L=v===zn.Down&&M<=S.y||v===zn.Up&&M>=E.y;if(L&&!d.x){g.scrollTo({top:M,behavior:a});return}L?h.y=g.scrollTop-M:h.y=v===zn.Down?g.scrollTop-S.y:g.scrollTop-E.y,h.y&&g.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,xS(vP(f,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Tse.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=I4e,onActivation:i}=t,{active:o}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function ube(e){return!!(e&&"distance"in e)}function fbe(e){return!!(e&&"delay"in e)}class Pse{constructor(t,n,r){var i;r===void 0&&(r=xjt(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:s}=o;this.props=t,this.events=n,this.document=t_(s),this.documentListeners=new RT(this.document),this.listeners=new RT(r),this.windowListeners=new RT(pc(s)),this.initialCoordinates=(i=DY(o))!=null?i:Sd,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(Su.Resize,this.handleCancel),this.windowListeners.add(Su.DragStart,cbe),this.windowListeners.add(Su.VisibilityChange,this.handleCancel),this.windowListeners.add(Su.ContextMenu,cbe),this.documentListeners.add(Su.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(fbe(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}if(ube(n))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Su.Click,wjt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Su.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:s,options:{activationConstraint:a}}=o;if(!i)return;const l=(n=DY(t))!=null?n:Sd,c=vP(i,l);if(!r&&a){if(ube(a)){if(a.tolerance!=null&&$q(c,a.tolerance))return this.handleCancel();if($q(c,a.distance))return this.handleStart()}return fbe(a)&&$q(c,a.tolerance)?this.handleCancel():void 0}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===zn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ejt={move:{name:"pointermove"},end:{name:"pointerup"}};class Ase extends Pse{constructor(t){const{event:n}=t,r=t_(n.target);super(t,Ejt,r)}}Ase.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Cjt={move:{name:"mousemove"},end:{name:"mouseup"}};var NY;(function(e){e[e.RightClick=2]="RightClick"})(NY||(NY={}));class _jt extends Pse{constructor(t){super(t,Cjt,t_(t.event.target))}}_jt.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===NY.RightClick?!1:(r==null||r({event:n}),!0)}}];const Tq={move:{name:"touchmove"},end:{name:"touchend"}};class kjt extends Pse{constructor(t){super(t,Tq)}static setup(){return window.addEventListener(Tq.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Tq.move.name,t)};function t(){}}}kjt.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var DT;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(DT||(DT={}));var n3;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(n3||(n3={}));function $jt(e){let{acceleration:t,activator:n=DT.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:a=n3.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:f,threshold:d}=e;const h=Pjt({delta:f,disabled:!o}),[p,g]=zLt(),v=x.useRef({x:0,y:0}),y=x.useRef({x:0,y:0}),O=x.useMemo(()=>{switch(n){case DT.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case DT.DraggableRect:return i}},[n,i,l]),m=x.useRef(null),w=x.useCallback(()=>{const E=m.current;if(!E)return;const C=v.current.x*y.current.x,k=v.current.y*y.current.y;E.scrollBy(C,k)},[]),S=x.useMemo(()=>a===n3.TreeOrder?[...c].reverse():c,[a,c]);x.useEffect(()=>{if(!o||!c.length||!O){g();return}for(const E of S){if((r==null?void 0:r(E))===!1)continue;const C=c.indexOf(E),k=u[C];if(!k)continue;const{direction:P,speed:D}=gjt(E,k,O,t,d);for(const M of["x","y"])h[M][P[M]]||(D[M]=0,P[M]=0);if(D.x>0||D.y>0){g(),m.current=E,p(w,s),v.current=D,y.current=P;return}}v.current={x:0,y:0},y.current={x:0,y:0},g()},[t,w,r,g,o,s,JSON.stringify(O),JSON.stringify(h),p,c,S,u,JSON.stringify(d)])}const Tjt={x:{[os.Backward]:!1,[os.Forward]:!1},y:{[os.Backward]:!1,[os.Forward]:!1}};function Pjt(e){let{delta:t,disabled:n}=e;const r=RY(t);return VR(i=>{if(n||!r||!i)return Tjt;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[os.Backward]:i.x[os.Backward]||o.x===-1,[os.Forward]:i.x[os.Forward]||o.x===1},y:{[os.Backward]:i.y[os.Backward]||o.y===-1,[os.Forward]:i.y[os.Forward]||o.y===1}}},[n,t,r])}function Ajt(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return VR(i=>{var o;return t===null?null:(o=r??i)!=null?o:null},[r,t])}function Rjt(e,t){return x.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...o]},[]),[e,t])}var OP;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(OP||(OP={}));var IY;(function(e){e.Optimized="optimized"})(IY||(IY={}));const dbe=new Map;function Djt(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,s]=x.useState(null),{frequency:a,measure:l,strategy:c}=i,u=x.useRef(e),f=v(),d=yP(f),h=x.useCallback(function(y){y===void 0&&(y=[]),!d.current&&s(O=>O===null?y:O.concat(y.filter(m=>!O.includes(m))))},[d]),p=x.useRef(null),g=VR(y=>{if(f&&!n)return dbe;if(!y||y===dbe||u.current!==e||o!=null){const O=new Map;for(let m of e){if(!m)continue;if(o&&o.length>0&&!o.includes(m.id)&&m.rect.current){O.set(m.id,m.rect.current);continue}const w=m.node.current,S=w?new $se(l(w),w):null;m.rect.current=S,S&&O.set(m.id,S)}return O}return y},[e,o,n,f,l]);return x.useEffect(()=>{u.current=e},[e]),x.useEffect(()=>{f||h()},[n,f]),x.useEffect(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),x.useEffect(()=>{f||typeof a!="number"||p.current!==null||(p.current=setTimeout(()=>{h(),p.current=null},a))},[a,f,h,...r]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:o!=null};function v(){switch(c){case OP.Always:return!1;case OP.BeforeDragging:return n;default:return!n}}}function L4e(e,t){return VR(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Mjt(e,t){return L4e(e,t)}function Njt(e){let{callback:t,disabled:n}=e;const r=_se(t),i=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return x.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Qz(e){let{callback:t,disabled:n}=e;const r=_se(t),i=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return x.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ijt(e){return new $se(n_(e),e)}function hbe(e,t,n){t===void 0&&(t=Ijt);const[r,i]=x.useReducer(a,null),o=Njt({callback(l){if(e)for(const c of l){const{type:u,target:f}=c;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),s=Qz({callback:i});return wd(()=>{i(),e?(s==null||s.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[e]),r;function a(l){if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u}}function Ljt(e){const t=L4e(e);return T4e(e,t)}const pbe=[];function jjt(e){const t=x.useRef(e),n=VR(r=>e?r&&r!==pbe&&e&&t.current&&e.parentNode===t.current.parentNode?r:zz(e):pbe,[e]);return x.useEffect(()=>{t.current=e},[e]),n}function Fjt(e){const[t,n]=x.useState(null),r=x.useRef(e),i=x.useCallback(o=>{const s=kq(o.target);s&&n(a=>a?(a.set(s,MY(s)),new Map(a)):null)},[]);return x.useEffect(()=>{const o=r.current;if(e!==o){s(o);const a=e.map(l=>{const c=kq(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,MY(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(o)};function s(a){a.forEach(l=>{const c=kq(l);c==null||c.removeEventListener("scroll",i)})}},[i,e]),x.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>xS(o,s),Sd):N4e(e):Sd,[e,t])}function gbe(e,t){t===void 0&&(t=[]);const n=x.useRef(null);return x.useEffect(()=>{n.current=null},t),x.useEffect(()=>{const r=e!==Sd;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?vP(e,n.current):Sd}function zjt(e){x.useEffect(()=>{if(!Fz)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Qjt(e,t){return x.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=s=>{o(s,t)},n},{}),[e,t])}function j4e(e){return x.useMemo(()=>e?fjt(e):null,[e])}const Pq=[];function Bjt(e,t){t===void 0&&(t=n_);const[n]=e,r=j4e(n?pc(n):null),[i,o]=x.useReducer(a,Pq),s=Qz({callback:o});return e.length>0&&i===Pq&&o(),wd(()=>{e.length?e.forEach(l=>s==null?void 0:s.observe(l)):(s==null||s.disconnect(),o())},[e]),i;function a(){return e.length?e.map(l=>D4e(l)?r:new $se(t(l),l)):Pq}}function Wjt(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return qR(t)?t:e}function qjt(e){let{measure:t}=e;const[n,r]=x.useState(null),i=x.useCallback(c=>{for(const{target:u}of c)if(qR(u)){r(f=>{const d=t(u);return f?{...f,width:d.width,height:d.height}:d});break}},[t]),o=Qz({callback:i}),s=x.useCallback(c=>{const u=Wjt(c);o==null||o.disconnect(),u&&(o==null||o.observe(u)),r(u?t(u):null)},[t,o]),[a,l]=e3(s);return x.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Vjt=[{sensor:Ase,options:{}},{sensor:Tse,options:{}}],Ujt={current:{}},R5={draggable:{measure:lbe},droppable:{measure:lbe,strategy:OP.WhileDragging,frequency:IY.Optimized},dragOverlay:{measure:n_}};class MT extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Hjt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new MT,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:t3},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:R5,measureDroppableContainers:t3,windowRect:null,measuringScheduled:!1},Xjt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:t3,draggableNodes:new Map,over:null,measureDroppableContainers:t3},Bz=x.createContext(Xjt),F4e=x.createContext(Hjt);function Zjt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new MT}}}function Yjt(e,t){switch(t.type){case zo.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case zo.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case zo.DragEnd:case zo.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case zo.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new MT(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case zo.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new MT(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case zo.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new MT(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Gjt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=x.useContext(Bz),o=RY(r),s=RY(n==null?void 0:n.id);return x.useEffect(()=>{if(!t&&!r&&o&&s!=null){if(!kse(o)||document.activeElement===o.target)return;const a=i.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const f=WLt(u);if(f){f.focus();break}}})}},[r,t,i,s,o]),null}function Kjt(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function Jjt(e){return x.useMemo(()=>({draggable:{...R5.draggable,...e==null?void 0:e.draggable},droppable:{...R5.droppable,...e==null?void 0:e.droppable},dragOverlay:{...R5.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function e3t(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=x.useRef(!1),{x:s,y:a}=typeof i=="boolean"?{x:i,y:i}:i;wd(()=>{if(!s&&!a||!t){o.current=!1;return}if(o.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const u=n(c),f=T4e(u,r);if(s||(f.x=0),a||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const d=P4e(c);d&&d.scrollBy({top:f.y,left:f.x})}},[t,s,a,r,n])}const z4e=x.createContext({...Sd,scaleX:1,scaleY:1});var ny;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ny||(ny={}));const t3t=x.memo(function(t){var n,r,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:u=Vjt,collisionDetection:f=ijt,measuring:d,modifiers:h,...p}=t;const g=x.useReducer(Yjt,void 0,Zjt),[v,y]=g,[O,m]=ZLt(),[w,S]=x.useState(ny.Uninitialized),E=w===ny.Initialized,{draggable:{active:C,nodes:k,translate:P},droppable:{containers:D}}=v,M=C?k.get(C):null,L=x.useRef({initial:null,translated:null}),A=x.useMemo(()=>{var Rn;return C!=null?{id:C,data:(Rn=M==null?void 0:M.data)!=null?Rn:Ujt,rect:L}:null},[C,M]),T=x.useRef(null),[N,j]=x.useState(null),[z,W]=x.useState(null),F=yP(p,Object.values(p)),q=UR("DndDescribedBy",s),U=x.useMemo(()=>D.getEnabled(),[D]),V=Jjt(d),{droppableRects:H,measureDroppableContainers:Z,measuringScheduled:ee}=Djt(U,{dragging:E,dependencies:[P.x,P.y],config:V.droppable}),se=Ajt(k,C),fe=x.useMemo(()=>z?DY(z):null,[z]),ce=Ar(),ae=Mjt(se,V.draggable.measure);e3t({activeNode:C?k.get(C):null,config:ce.layoutShiftCompensation,initialRect:ae,measure:V.draggable.measure});const de=hbe(se,V.draggable.measure,ae),me=hbe(se?se.parentElement:null),te=x.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:D,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ee=D.getNodeFor((n=te.current.over)==null?void 0:n.id),we=qjt({measure:V.dragOverlay.measure}),ke=(r=we.nodeRef.current)!=null?r:se,je=E?(i=we.rect)!=null?i:de:null,nt=!!(we.nodeRef.current&&we.rect),Re=Ljt(nt?null:de),G=j4e(ke?pc(ke):null),le=jjt(E?Ee??se:null),Oe=Bjt(le),Ue=Kjt(h,{transform:{x:P.x-Re.x,y:P.y-Re.y,scaleX:1,scaleY:1},activatorEvent:z,active:A,activeNodeRect:de,containerNodeRect:me,draggingNodeRect:je,over:te.current.over,overlayNodeRect:we.rect,scrollableAncestors:le,scrollableAncestorRects:Oe,windowRect:G}),Fe=fe?xS(fe,P):null,ye=Fjt(le),Me=gbe(ye),pt=gbe(ye,[de]),at=xS(Ue,Me),ht=je?ajt(je,Ue):null,_t=A&&ht?f({active:A,collisionRect:ht,droppableRects:H,droppableContainers:U,pointerCoordinates:Fe}):null,yn=$4e(_t,"id"),[_n,ri]=x.useState(null),hi=nt?Ue:xS(Ue,pt),Qt=ojt(hi,(o=_n==null?void 0:_n.rect)!=null?o:null,de),An=x.useCallback((Rn,Rr)=>{let{sensor:Ii,options:Ji}=Rr;if(T.current==null)return;const Li=k.get(T.current);if(!Li)return;const ji=Rn.nativeEvent,Ro=new Ii({active:T.current,activeNode:Li,event:ji,options:Ji,context:te,onStart(pi){const Do=T.current;if(Do==null)return;const ta=k.get(Do);if(!ta)return;const{onDragStart:ws}=F.current,_i={active:{id:Do,data:ta.data,rect:L}};as.unstable_batchedUpdates(()=>{ws==null||ws(_i),S(ny.Initializing),y({type:zo.DragStart,initialCoordinates:pi,active:Do}),O({type:"onDragStart",event:_i})})},onMove(pi){y({type:zo.DragMove,coordinates:pi})},onEnd:eo(zo.DragEnd),onCancel:eo(zo.DragCancel)});as.unstable_batchedUpdates(()=>{j(Ro),W(Rn.nativeEvent)});function eo(pi){return async function(){const{active:ta,collisions:ws,over:_i,scrollAdjustedTranslate:ne}=te.current;let ir=null;if(ta&&ne){const{cancelDrop:cn}=F.current;ir={activatorEvent:ji,active:ta,collisions:ws,delta:ne,over:_i},pi===zo.DragEnd&&typeof cn=="function"&&await Promise.resolve(cn(ir))&&(pi=zo.DragCancel)}T.current=null,as.unstable_batchedUpdates(()=>{y({type:pi}),S(ny.Uninitialized),ri(null),j(null),W(null);const cn=pi===zo.DragEnd?"onDragEnd":"onDragCancel";if(ir){const Tt=F.current[cn];Tt==null||Tt(ir),O({type:cn,event:ir})}})}}},[k]),Ht=x.useCallback((Rn,Rr)=>(Ii,Ji)=>{const Li=Ii.nativeEvent,ji=k.get(Ji);if(T.current!==null||!ji||Li.dndKit||Li.defaultPrevented)return;const Ro={active:ji};Rn(Ii,Rr.options,Ro)===!0&&(Li.dndKit={capturedBy:Rr.sensor},T.current=Ji,An(Ii,Rr))},[k,An]),rr=Rjt(u,Ht);zjt(u),wd(()=>{de&&w===ny.Initializing&&S(ny.Initialized)},[de,w]),x.useEffect(()=>{const{onDragMove:Rn}=F.current,{active:Rr,activatorEvent:Ii,collisions:Ji,over:Li}=te.current;if(!Rr||!Ii)return;const ji={active:Rr,activatorEvent:Ii,collisions:Ji,delta:{x:at.x,y:at.y},over:Li};as.unstable_batchedUpdates(()=>{Rn==null||Rn(ji),O({type:"onDragMove",event:ji})})},[at.x,at.y]),x.useEffect(()=>{const{active:Rn,activatorEvent:Rr,collisions:Ii,droppableContainers:Ji,scrollAdjustedTranslate:Li}=te.current;if(!Rn||T.current==null||!Rr||!Li)return;const{onDragOver:ji}=F.current,Ro=Ji.get(yn),eo=Ro&&Ro.rect.current?{id:Ro.id,rect:Ro.rect.current,data:Ro.data,disabled:Ro.disabled}:null,pi={active:Rn,activatorEvent:Rr,collisions:Ii,delta:{x:Li.x,y:Li.y},over:eo};as.unstable_batchedUpdates(()=>{ri(eo),ji==null||ji(pi),O({type:"onDragOver",event:pi})})},[yn]),wd(()=>{te.current={activatorEvent:z,active:A,activeNode:se,collisionRect:ht,collisions:_t,droppableRects:H,draggableNodes:k,draggingNode:ke,draggingNodeRect:je,droppableContainers:D,over:_n,scrollableAncestors:le,scrollAdjustedTranslate:at},L.current={initial:je,translated:ht}},[A,se,_t,ht,k,ke,je,H,D,_n,le,at]),$jt({...ce,delta:P,draggingRect:ht,pointerCoordinates:Fe,scrollableAncestors:le,scrollableAncestorRects:Oe});const Ci=x.useMemo(()=>({active:A,activeNode:se,activeNodeRect:de,activatorEvent:z,collisions:_t,containerNodeRect:me,dragOverlay:we,draggableNodes:k,droppableContainers:D,droppableRects:H,over:_n,measureDroppableContainers:Z,scrollableAncestors:le,scrollableAncestorRects:Oe,measuringConfiguration:V,measuringScheduled:ee,windowRect:G}),[A,se,de,z,_t,me,we,k,D,H,_n,Z,le,Oe,V,ee,G]),xs=x.useMemo(()=>({activatorEvent:z,activators:rr,active:A,activeNodeRect:de,ariaDescribedById:{draggable:q},dispatch:y,draggableNodes:k,over:_n,measureDroppableContainers:Z}),[z,rr,A,de,y,q,k,_n,Z]);return ie.createElement(C4e.Provider,{value:m},ie.createElement(Bz.Provider,{value:xs},ie.createElement(F4e.Provider,{value:Ci},ie.createElement(z4e.Provider,{value:Qt},c)),ie.createElement(Gjt,{disabled:(a==null?void 0:a.restoreFocus)===!1})),ie.createElement(KLt,{...a,hiddenTextDescribedById:q}));function Ar(){const Rn=(N==null?void 0:N.autoScrollEnabled)===!1,Rr=typeof l=="object"?l.enabled===!1:l===!1,Ii=E&&!Rn&&!Rr;return typeof l=="object"?{...l,enabled:Ii}:{enabled:Ii}}}),n3t=x.createContext(null),mbe="button",r3t="Droppable";function i3t(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=UR(r3t),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:d}=x.useContext(Bz),{role:h=mbe,roleDescription:p="draggable",tabIndex:g=0}=i??{},v=(l==null?void 0:l.id)===t,y=x.useContext(v?z4e:n3t),[O,m]=e3(),[w,S]=e3(),E=Qjt(s,t),C=yP(n);wd(()=>(f.set(t,{id:t,key:o,node:O,activatorNode:w,data:C}),()=>{const P=f.get(t);P&&P.key===o&&f.delete(t)}),[f,t]);const k=x.useMemo(()=>({role:h,tabIndex:g,"aria-disabled":r,"aria-pressed":v&&h===mbe?!0:void 0,"aria-roledescription":p,"aria-describedby":u.draggable}),[r,h,g,v,p,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:k,isDragging:v,listeners:r?void 0:E,node:O,over:d,setNodeRef:m,setActivatorNodeRef:S,transform:y}}function o3t(){return x.useContext(F4e)}const s3t="Droppable",a3t={timeout:25};function l3t(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=UR(s3t),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=x.useContext(Bz),u=x.useRef({disabled:n}),f=x.useRef(!1),d=x.useRef(null),h=x.useRef(null),{disabled:p,updateMeasurementsFor:g,timeout:v}={...a3t,...i},y=yP(g??r),O=x.useCallback(()=>{if(!f.current){f.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(y.current)?y.current:[y.current]),h.current=null},v)},[v]),m=Qz({callback:O,disabled:p||!s}),w=x.useCallback((k,P)=>{m&&(P&&(m.unobserve(P),f.current=!1),k&&m.observe(k))},[m]),[S,E]=e3(w),C=yP(t);return x.useEffect(()=>{!m||!S.current||(m.disconnect(),f.current=!1,m.observe(S.current))},[S,m]),wd(()=>(a({type:zo.RegisterDroppable,element:{id:r,key:o,disabled:n,node:S,rect:d,data:C}}),()=>a({type:zo.UnregisterDroppable,key:o,id:r})),[r]),x.useEffect(()=>{n!==u.current.disabled&&(a({type:zo.SetDroppableDisabled,id:r,key:o,disabled:n}),u.current.disabled=n)},[r,o,n,a]),{active:s,rect:d,isOver:(l==null?void 0:l.id)===r,node:S,over:l,setNodeRef:E}}function S1(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function c3t(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function sN(e){return e!==null&&e>=0}function u3t(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function f3t(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Q4e=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=S1(t,r,n),s=t[i],a=o[i];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},aN={scaleX:1,scaleY:1},d3t=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:o,overIndex:s}=e;const a=(t=o[n])!=null?t:r;if(!a)return null;if(i===n){const c=o[s];return c?{x:0,y:n<s?c.top+c.height-(a.top+a.height):c.top-a.top,...aN}:null}const l=h3t(o,i,n);return i>n&&i<=s?{x:0,y:-a.height-l,...aN}:i<n&&i>=s?{x:0,y:a.height+l,...aN}:{x:0,y:0,...aN}};function h3t(e,t,n){const r=e[t],i=e[t-1],o=e[t+1];return r?n<t?i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const B4e="Sortable",W4e=ie.createContext({activeIndex:-1,containerId:B4e,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Q4e,disabled:{draggable:!1,droppable:!1}});function p3t(e){let{children:t,id:n,items:r,strategy:i=Q4e,disabled:o=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=o3t(),f=UR(B4e,n),d=a.rect!==null,h=x.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),p=s!=null,g=s?h.indexOf(s.id):-1,v=c?h.indexOf(c.id):-1,y=x.useRef(h),O=!u3t(h,y.current),m=v!==-1&&g===-1||O,w=f3t(o);wd(()=>{O&&p&&u(h)},[O,h,p,u]),x.useEffect(()=>{y.current=h},[h]);const S=x.useMemo(()=>({activeIndex:g,containerId:f,disabled:w,disableTransforms:m,items:h,overIndex:v,useDragOverlay:d,sortedRects:c3t(h,l),strategy:i}),[g,f,w.draggable,w.droppable,m,h,v,l,d,i]);return ie.createElement(W4e.Provider,{value:S},t)}const g3t=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return S1(n,r,i).indexOf(t)},m3t=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!r||a!==o&&i===s?!1:n?!0:s!==i&&t===l},y3t={duration:200,easing:"ease"},q4e="transform",v3t=bP.Transition.toString({property:q4e,duration:0,easing:"linear"}),b3t={roleDescription:"sortable"};function O3t(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,s]=x.useState(null),a=x.useRef(n);return wd(()=>{if(!t&&n!==a.current&&r.current){const l=i.current;if(l){const c=n_(r.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&s(u)}}n!==a.current&&(a.current=n)},[t,n,r,i]),x.useEffect(()=>{o&&s(null)},[o]),o}function x3t(e){let{animateLayoutChanges:t=m3t,attributes:n,disabled:r,data:i,getNewIndex:o=g3t,id:s,strategy:a,resizeObserverConfig:l,transition:c=y3t}=e;const{items:u,containerId:f,activeIndex:d,disabled:h,disableTransforms:p,sortedRects:g,overIndex:v,useDragOverlay:y,strategy:O}=x.useContext(W4e),m=w3t(r,h),w=u.indexOf(s),S=x.useMemo(()=>({sortable:{containerId:f,index:w,items:u},...i}),[f,i,w,u]),E=x.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:C,node:k,isOver:P,setNodeRef:D}=l3t({id:s,data:S,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...l}}),{active:M,activatorEvent:L,activeNodeRect:A,attributes:T,setNodeRef:N,listeners:j,isDragging:z,over:W,setActivatorNodeRef:F,transform:q}=i3t({id:s,data:S,attributes:{...b3t,...n},disabled:m.draggable}),U=FLt(D,N),V=!!M,H=V&&!p&&sN(d)&&sN(v),Z=!y&&z,ee=Z&&H?q:null,fe=H?ee??(a??O)({rects:g,activeNodeRect:A,activeIndex:d,overIndex:v,index:w}):null,ce=sN(d)&&sN(v)?o({id:s,items:u,activeIndex:d,overIndex:v}):w,ae=M==null?void 0:M.id,de=x.useRef({activeId:ae,items:u,newIndex:ce,containerId:f}),me=u!==de.current.items,te=t({active:M,containerId:f,isDragging:z,isSorting:V,id:s,index:w,items:u,newIndex:de.current.newIndex,previousItems:de.current.items,previousContainerId:de.current.containerId,transition:c,wasDragging:de.current.activeId!=null}),Ee=O3t({disabled:!te,index:w,node:k,rect:C});return x.useEffect(()=>{V&&de.current.newIndex!==ce&&(de.current.newIndex=ce),f!==de.current.containerId&&(de.current.containerId=f),u!==de.current.items&&(de.current.items=u)},[V,ce,f,u]),x.useEffect(()=>{if(ae===de.current.activeId)return;if(ae&&!de.current.activeId){de.current.activeId=ae;return}const ke=setTimeout(()=>{de.current.activeId=ae},50);return()=>clearTimeout(ke)},[ae]),{active:M,activeIndex:d,attributes:T,data:S,rect:C,index:w,newIndex:ce,items:u,isOver:P,isSorting:V,isDragging:z,listeners:j,node:k,overIndex:v,over:W,setNodeRef:U,setActivatorNodeRef:F,setDroppableNodeRef:D,setDraggableNodeRef:N,transform:Ee??fe,transition:we()};function we(){if(Ee||me&&de.current.newIndex===w)return v3t;if(!(Z&&!kse(L)||!c)&&(V||te))return bP.Transition.toString({...c,property:q4e})}}function w3t(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function r3(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const S3t=[zn.Down,zn.Right,zn.Up,zn.Left],E3t=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:s,scrollableAncestors:a}}=t;if(S3t.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const d=i.get(f.id);if(d)switch(e.code){case zn.Down:r.top<d.top&&l.push(f);break;case zn.Up:r.top>d.top&&l.push(f);break;case zn.Left:r.left>d.left&&l.push(f);break;case zn.Right:r.left<d.left&&l.push(f);break}});const c=njt({active:n,collisionRect:r,droppableRects:i,droppableContainers:l,pointerCoordinates:null});let u=$4e(c,"id");if(u===(s==null?void 0:s.id)&&c.length>1&&(u=c[1].id),u!=null){const f=o.get(n.id),d=o.get(u),h=d?i.get(d.id):null,p=d==null?void 0:d.node.current;if(p&&h&&f&&d){const v=zz(p).some((E,C)=>a[C]!==E),y=V4e(f,d),O=C3t(f,d),m=v||!y?{x:0,y:0}:{x:O?r.width-h.width:0,y:O?r.height-h.height:0},w={x:h.left,y:h.top};return m.x&&m.y?w:vP(w,m)}}}};function V4e(e,t){return!r3(e)||!r3(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function C3t(e,t){return!r3(e)||!r3(t)||!V4e(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function _3t(e){if(e.length<2)return ybe(e);const t=e[e.length-1],n=e[e.length-2];return k3t(t,n)&&(bi(typeof t.data=="string","expected string"),bi(typeof n.data=="string","expected string"),n.data+=t.data,e.pop()),ybe(e)}function k3t(e,t){const n=e.mimetype==="text/plain"&&t.mimetype==="text/plain";if(!n)return!1;const r=e.channel===t.channel,i=e.channel!=="stdin";return n&&r&&i}function ybe(e){if(e.length===0)return e;const t=e[e.length-1];if(t.mimetype!=="text/plain")return e;const n=new RegExp(`\r[^
]`,"g");let r=t.data,i=r.search(n);for(;i>-1;){let o=-1;for(let c=i-1;c>=0;c--)if(r.at(c)===`
`){o=c;break}const s=r.slice(i+1),a=r.slice(0,o+1),l=r.slice(o+1,i);r=l.length<=s.length?a+s:a+s+l.slice(s.length),i=r.search(n)}return t.data=r,e}function $3t(e){const t=[],i=new DOMParser().parseFromString(e,"text/html").querySelectorAll("h1, h2, h3");for(const o of Array.from(i)){const s=o.textContent;if(!s)continue;const a=o.id;if(!a)continue;const l=Number.parseInt(o.tagName[1],10);t.push({name:s,id:a,level:l})}return{items:t}}function T3t(e){return{items:e.filter(Boolean).flatMap(t=>t.items)}}function P3t(e){if(e==null||e.mimetype!=="text/html")return null;try{return $3t(e.data)}catch{return At.error("Failed to parse outline"),null}}let i3=class D5{constructor(t){this.ms=t}static fromMilliseconds(t){return t==null?null:new D5(t)}static fromSeconds(t){return t==null?null:new D5(t*1e3)}static now(){return new D5(Date.now())}toMilliseconds(){return this.ms}toSeconds(){return this.ms/1e3}};function A3t(e,t){const n={...e};switch(t.status){case"queued":n.interrupted=!1,n.errored=!1,n.runElapsedTimeMs=null,n.debuggerActive=!1;break;case"running":n.interrupted=!1,e.stopped&&(n.output=null),n.status==="queued"&&(n.consoleOutputs=[]),n.stopped=!1,n.runStartTimestamp=t.timestamp;break;case"idle":e.runStartTimestamp&&(n.runElapsedTimeMs=i3.fromSeconds(t.timestamp-e.runStartTimestamp).toMilliseconds(),n.runStartTimestamp=null),n.debuggerActive=!1;break;case null:break;case"stale":break;case"disabled-transitively":break;default:Ld(t.status)}n.output=t.output??n.output,n.status=t.status??n.status;let r=!1;t.output!==null&&t.output.mimetype==="application/vnd.marimo+error"&&(t.output.data.some(l=>l.type==="interruption")?(n.interrupted=!0,r=!0):t.output.data.some(l=>l.type==="ancestor-stopped")?n.stopped=!0:n.errored=!0);let i=e.consoleOutputs;r&&(n.debuggerActive=!1,i=i.map(l=>l.channel==="stdin"?{...l,response:l.response??""}:l)),t.console!==null&&(i=Array.isArray(t.console)?t.console:_3t([...i,t.console])),n.consoleOutputs=i,n.outline=P3t(n.output);const s=[t.console].flat().filter(Boolean).filter(l=>l.channel==="pdb");return s.length>0&&s.some(l=>l.data==="start")&&(n.debuggerActive=!0),n}function R3t(e){const t={...e};return t.interrupted=!1,t.errored=!1,t.runElapsedTimeMs=null,t.debuggerActive=!1,t}function U4e(e,t){const{status:n,output:r,runStartTimestamp:i,interrupted:o}=e;if(o)return!1;if(t)return!0;const s=n==="running"||n==="queued",a=n==="running"&&r!==null&&i!==null&&r.timestamp>i;return s&&!a?!0:n==="stale"}function ZO(e,t){return{reducer:(n,r)=>(n=n||e(),r.type in t?t[r.type](n,r.payload):(At.error(`Action type ${r.type} is not defined in reducers.`),n)),createActions:n=>{const r={};for(const i in t)r[i]=o=>{n({type:i,payload:o})};return r}}}function D3t(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function vbe(e,t,n){return e.length===0?[n]:[...e.slice(0,t),n,...e.slice(t)]}function Aq(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}const bbe={EMPTY:[]},H4e=1024;let M3t=0,Wu=class{constructor(t,n){this.from=t,this.to=n}};class Zt{constructor(t={}){this.id=M3t++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=To.match(t)),n=>{let r=t(n);return r===void 0?null:[this,r]}}}Zt.closedBy=new Zt({deserialize:e=>e.split(" ")});Zt.openedBy=new Zt({deserialize:e=>e.split(" ")});Zt.group=new Zt({deserialize:e=>e.split(" ")});Zt.isolate=new Zt({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});Zt.contextHash=new Zt({perNode:!0});Zt.lookAhead=new Zt({perNode:!0});Zt.mounted=new Zt({perNode:!0});class xP{constructor(t,n,r){this.tree=t,this.overlay=n,this.parser=r}static get(t){return t&&t.props&&t.props[Zt.mounted.id]}}const N3t=Object.create(null);class To{constructor(t,n,r,i=0){this.name=t,this.props=n,this.id=r,this.flags=i}static define(t){let n=t.props&&t.props.length?Object.create(null):N3t,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new To(t.name||"",n,t.id,r);if(t.props){for(let o of t.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(t){return this.props[t.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(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(Zt.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let r in t)for(let i of r.split(" "))n[i]=t[r];return r=>{for(let i=r.prop(Zt.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}To.none=new To("",Object.create(null),0,8);class r_{constructor(t){this.types=t;for(let n=0;n<t.length;n++)if(t[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let n=[];for(let r of this.types){let i=null;for(let o of t){let s=o(r);s&&(i||(i=Object.assign({},r.props)),i[s[0].id]=s[1])}n.push(i?new To(r.name,i,r.id,r.flags):r)}return new r_(n)}}const lN=new WeakMap,Obe=new WeakMap;var Wr;(function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays"})(Wr||(Wr={}));let Bn=class LY{constructor(t,n,r,i,o){if(this.type=t,this.children=n,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,a]of o)this.props[typeof s=="number"?s:s.id]=a}}toString(){let t=xP.get(this);if(t&&!t.overlay)return t.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}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(t=0){return new o3(this.topNode,t)}cursorAt(t,n=0,r=0){let i=lN.get(this)||this.topNode,o=new o3(i);return o.moveTo(t,n),lN.set(this,o._tree),o}get topNode(){return new ff(this,0,0,null)}resolve(t,n=0){let r=wP(lN.get(this)||this.topNode,t,n,!1);return lN.set(this,r),r}resolveInner(t,n=0){let r=wP(Obe.get(this)||this.topNode,t,n,!0);return Obe.set(this,r),r}resolveStack(t,n=0){return j3t(this,t,n)}iterate(t){let{enter:n,leave:r,from:i=0,to:o=this.length}=t,s=t.mode||0,a=(s&Wr.IncludeAnonymous)>0;for(let l=this.cursor(s|Wr.IncludeAnonymous);;){let c=!1;if(l.from<=o&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:Mse(To.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new LY(this.type,n,r,i,this.propValues),t.makeTree||((n,r,i)=>new LY(To.none,n,r,i)))}static build(t){return F3t(t)}};Bn.empty=new Bn(To.none,[],[],0);class Rse{constructor(t,n){this.buffer=t,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 Rse(this.buffer,this.index)}}class D0{constructor(t,n,r){this.buffer=t,this.length=n,this.set=r}get type(){return To.none}toString(){let t=[];for(let n=0;n<this.buffer.length;)t.push(this.childString(n)),n=this.buffer[n+3];return t.join(",")}childString(t){let n=this.buffer[t],r=this.buffer[t+3],i=this.set.types[n],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),t+=4,r==t)return o;let s=[];for(;t<r;)s.push(this.childString(t)),t=this.buffer[t+3];return o+"("+s.join(",")+")"}findChild(t,n,r,i,o){let{buffer:s}=this,a=-1;for(let l=t;l!=n&&!(X4e(o,i,s[l+1],s[l+2])&&(a=l,r>0));l=s[l+3]);return a}slice(t,n,r){let i=this.buffer,o=new Uint16Array(n-t),s=0;for(let a=t,l=0;a<n;){o[l++]=i[a++],o[l++]=i[a++]-r;let c=o[l++]=i[a++]-r;o[l++]=i[a++]-t,s=Math.max(s,c)}return new D0(o,s,this.set)}}function X4e(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function wP(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let s=!r&&e instanceof ff&&e.index<0?null:e.parent;if(!s)return e;e=s}let o=r?0:Wr.IgnoreOverlays;if(r)for(let s=e,a=s.parent;a;s=a,a=s.parent)s instanceof ff&&s.index<0&&((i=a.enter(t,n,o))===null||i===void 0?void 0:i.from)!=s.from&&(e=a);for(;;){let s=e.enter(t,n,o);if(!s)return e;e=s}}class Z4e{cursor(t=0){return new o3(this,t)}getChild(t,n=null,r=null){let i=xbe(this,t,n,r);return i.length?i[0]:null}getChildren(t,n=null,r=null){return xbe(this,t,n,r)}resolve(t,n=0){return wP(this,t,n,!1)}resolveInner(t,n=0){return wP(this,t,n,!0)}matchContext(t){return jY(this,t)}enterUnfinishedNodesBefore(t){let n=this.childBefore(t),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}let ff=class M5 extends Z4e{constructor(t,n,r,i){super(),this._tree=t,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,o=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=n>0?a.length:-1;t!=c;t+=n){let u=a[t],f=l[t]+s.from;if(X4e(i,r,f,f+u.length)){if(u instanceof D0){if(o&Wr.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,r-f,i);if(d>-1)return new Th(new I3t(s,u,t,f),null,d)}else if(o&Wr.IncludeAnonymous||!u.type.isAnonymous||Dse(u)){let d;if(!(o&Wr.IgnoreMounts)&&(d=xP.get(u))&&!d.overlay)return new M5(d.tree,f,t,s);let h=new M5(u,f,t,s);return o&Wr.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&Wr.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?t=s.index+n:t=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))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(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,n,r=0){let i;if(!(r&Wr.IgnoreOverlays)&&(i=xP.get(this._tree))&&i.overlay){let o=t-this.from;for(let{from:s,to:a}of i.overlay)if((n>0?s<=o:s<o)&&(n<0?a>=o:a>o))return new M5(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}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 xbe(e,t,n,r){let i=e.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(t)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function jY(e,t,n=t.length-1){for(let r=e.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class I3t{constructor(t,n,r,i){this.parent=t,this.buffer=n,this.index=r,this.start=i}}class Th extends Z4e{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(t,n,r){super(),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}child(t,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return o<0?null:new Th(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,n,r=0){if(r&Wr.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return o<0?null:new Th(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Th(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Th(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];t.push(r.slice(i,o,s)),n.push(0)}return new Bn(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Y4e(e){if(!e.length)return null;let t=0,n=e[0];for(let o=1;o<e.length;o++){let s=e[o];(s.from>n.from||s.to<n.to)&&(n=s,t=o)}let r=n instanceof ff&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new L3t(i,n)}class L3t{constructor(t,n){this.heads=t,this.node=n}get next(){return Y4e(this.heads)}}function j3t(e,t,n){let r=e.resolveInner(t,n),i=null;for(let o=r instanceof ff?r:r.context.parent;o;o=o.parent)if(o.index<0){let s=o.parent;(i||(i=[r])).push(s.resolve(t,n)),o=s}else{let s=xP.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=t&&s.overlay[s.overlay.length-1].to>=t){let a=new ff(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(wP(a,t,n,!1))}}return i?Y4e(i):r}class o3{get name(){return this.type.name}constructor(t,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof ff)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}yield(t){return t?t instanceof ff?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,r=this.mode){return this.buffer?r&Wr.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Wr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Wr.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(t<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,r,{buffer:i}=this;if(i){if(t>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let o=n+t,s=t<0?-1:r._tree.children.length;o!=s;o+=t){let a=r._tree.children[o];if(this.mode&Wr.IncludeAnonymous||a instanceof D0||!a.type.isAnonymous||Dse(a))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,n););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,n=null,r=0;if(t&&t.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=t;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i<this.stack.length;i++)n=new Th(this.buffer,n,this.stack[i]);return this.bufferNode=new Th(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;i&&n&&n(this),i=this.type.isAnonymous,!this.nextSibling();){if(!r)return;this.parent(),r--,i=!0}}}matchContext(t){if(!this.buffer)return jY(this.node,t);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=t.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return jY(this.node,t,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(t[i]&&t[i]!=s.name)return!1;i--}}return!0}}function Dse(e){return e.children.some(t=>t instanceof D0||!t.type.isAnonymous||Dse(t))}function F3t(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=H4e,reused:o=[],minRepeatType:s=r.types.length}=e,a=Array.isArray(n)?new Rse(n,n.length):n,l=r.types,c=0,u=0;function f(S,E,C,k,P,D){let{id:M,start:L,end:A,size:T}=a,N=u;for(;T<0;)if(a.next(),T==-1){let q=o[M];C.push(q),k.push(L-S);return}else if(T==-3){c=M;return}else if(T==-4){u=M;return}else throw new RangeError(`Unrecognized record size: ${T}`);let j=l[M],z,W,F=L-S;if(A-L<=i&&(W=v(a.pos-E,P))){let q=new Uint16Array(W.size-W.skip),U=a.pos-W.size,V=q.length;for(;a.pos>U;)V=y(W.start,q,V);z=new D0(q,A-W.start,r),F=W.start-S}else{let q=a.pos-T;a.next();let U=[],V=[],H=M>=s?M:-1,Z=0,ee=A;for(;a.pos>q;)H>=0&&a.id==H&&a.size>=0?(a.end<=ee-i&&(p(U,V,L,Z,a.end,ee,H,N),Z=U.length,ee=a.end),a.next()):D>2500?d(L,q,U,V):f(L,q,U,V,H,D+1);if(H>=0&&Z>0&&Z<U.length&&p(U,V,L,Z,L,ee,H,N),U.reverse(),V.reverse(),H>-1&&Z>0){let se=h(j);z=Mse(j,U,V,0,U.length,0,A-L,se,se)}else z=g(j,U,V,A-L,N-A)}C.push(z),k.push(F)}function d(S,E,C,k){let P=[],D=0,M=-1;for(;a.pos>E;){let{id:L,start:A,end:T,size:N}=a;if(N>4)a.next();else{if(M>-1&&A<M)break;M<0&&(M=T-i),P.push(L,A,T),D++,a.next()}}if(D){let L=new Uint16Array(D*4),A=P[P.length-2];for(let T=P.length-3,N=0;T>=0;T-=3)L[N++]=P[T],L[N++]=P[T+1]-A,L[N++]=P[T+2]-A,L[N++]=N;C.push(new D0(L,P[2]-A,r)),k.push(A-S)}}function h(S){return(E,C,k)=>{let P=0,D=E.length-1,M,L;if(D>=0&&(M=E[D])instanceof Bn){if(!D&&M.type==S&&M.length==k)return M;(L=M.prop(Zt.lookAhead))&&(P=C[D]+M.length+L)}return g(S,E,C,k,P)}}function p(S,E,C,k,P,D,M,L){let A=[],T=[];for(;S.length>k;)A.push(S.pop()),T.push(E.pop()+C-P);S.push(g(r.types[M],A,T,D-P,L-D)),E.push(P-C)}function g(S,E,C,k,P=0,D){if(c){let M=[Zt.contextHash,c];D=D?[M].concat(D):[M]}if(P>25){let M=[Zt.lookAhead,P];D=D?[M].concat(D):[M]}return new Bn(S,E,C,k,D)}function v(S,E){let C=a.fork(),k=0,P=0,D=0,M=C.end-i,L={size:0,start:0,skip:0};e:for(let A=C.pos-S;C.pos>A;){let T=C.size;if(C.id==E&&T>=0){L.size=k,L.start=P,L.skip=D,D+=4,k+=4,C.next();continue}let N=C.pos-T;if(T<0||N<A||C.start<M)break;let j=C.id>=s?4:0,z=C.start;for(C.next();C.pos>N;){if(C.size<0)if(C.size==-3)j+=4;else break e;else C.id>=s&&(j+=4);C.next()}P=z,k+=T,D+=j}return(E<0||k==S)&&(L.size=k,L.start=P,L.skip=D),L.size>4?L:void 0}function y(S,E,C){let{id:k,start:P,end:D,size:M}=a;if(a.next(),M>=0&&k<s){let L=C;if(M>4){let A=a.pos-(M-4);for(;a.pos>A;)C=y(S,E,C)}E[--C]=L,E[--C]=D-S,E[--C]=P-S,E[--C]=k}else M==-3?c=k:M==-4&&(u=k);return C}let O=[],m=[];for(;a.pos>0;)f(e.start||0,e.bufferStart||0,O,m,-1,0);let w=(t=e.length)!==null&&t!==void 0?t:O.length?m[0]+O[0].length:0;return new Bn(l[e.topID],O.reverse(),m.reverse(),w)}const wbe=new WeakMap;function N5(e,t){if(!e.isAnonymous||t instanceof D0||t.type!=e)return 1;let n=wbe.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Bn)){n=1;break}n+=N5(e,r)}wbe.set(t,n)}return n}function Mse(e,t,n,r,i,o,s,a,l){let c=0;for(let p=r;p<i;p++)c+=N5(e,t[p]);let u=Math.ceil(c*1.5/8),f=[],d=[];function h(p,g,v,y,O){for(let m=v;m<y;){let w=m,S=g[m],E=N5(e,p[m]);for(m++;m<y;m++){let C=N5(e,p[m]);if(E+C>=u)break;E+=C}if(m==w+1){if(E>u){let C=p[w];h(C.children,C.positions,0,C.children.length,g[w]+O);continue}f.push(p[w])}else{let C=g[m-1]+p[m-1].length-S;f.push(Mse(e,p,g,w,m,S,C,null,l))}d.push(S+O-o)}}return h(t,n,r,i,0),(a||l)(f,d,s)}class Nse{constructor(){this.map=new WeakMap}setBuffer(t,n,r){let i=this.map.get(t);i||this.map.set(t,i=new Map),i.set(n,r)}getBuffer(t,n){let r=this.map.get(t);return r&&r.get(n)}set(t,n){t instanceof Th?this.setBuffer(t.context.buffer,t.index,n):t instanceof ff&&this.map.set(t.tree,n)}get(t){return t instanceof Th?this.getBuffer(t.context.buffer,t.index):t instanceof ff?this.map.get(t.tree):void 0}cursorSet(t,n){t.buffer?this.setBuffer(t.buffer.buffer,t.index,n):this.map.set(t.tree,n)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class Tg{constructor(t,n,r,i,o=!1,s=!1){this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new Tg(0,t.length,t,0,!1,r)];for(let o of n)o.to>t.length&&i.push(o);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],o=1,s=t.length?t[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<n.length?n[a]:null,f=u?u.fromA:1e9;if(f-l>=r)for(;s&&s.from<f;){let d=s;if(l>=d.from||f<=d.to||c){let h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new Tg(h,p,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),s.to>f)break;s=o<t.length?t[o++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class Wz{startParse(t,n,r){return typeof t=="string"&&(t=new z3t(t)),r=r?r.length?r.map(i=>new Wu(i.from,i.to)):[new Wu(0,0)]:[new Wu(0,t.length)],this.createParse(t,n||[],r)}parse(t,n,r){let i=this.startParse(t,n,r);for(;;){let o=i.advance();if(o)return o}}}class z3t{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}function Ise(e){return(t,n,r,i)=>new B3t(t,e,n,r,i)}class Sbe{constructor(t,n,r,i,o){this.parser=t,this.parse=n,this.overlay=r,this.target=i,this.from=o}}function Ebe(e){if(!e.length||e.some(t=>t.from>=t.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class Q3t{constructor(t,n,r,i,o,s,a){this.parser=t,this.predicate=n,this.mounts=r,this.index=i,this.start=o,this.target=s,this.prev=a,this.depth=0,this.ranges=[]}}const FY=new Zt({perNode:!0});class B3t{constructor(t,n,r,i,o){this.nest=n,this.input=r,this.fragments=i,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Bn(r.type,r.children,r.positions,r.length,r.propValues.concat([[FY,this.stoppedAt]]))),r}let t=this.inner[this.innerDone],n=t.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),t.target.props);r[Zt.mounted.id]=new xP(n,t.overlay,t.parser),t.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<t&&(t=Math.min(t,this.inner[n].parse.parsedPos));return t}stopAt(t){if(this.stoppedAt=t,this.baseParse)this.baseParse.stopAt(t);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(t)}startInner(){let t=new V3t(this.fragments),n=null,r=null,i=new o3(new ff(this.baseTree,this.ranges[0].from,0,null),Wr.IncludeAnonymous|Wr.IgnoreMounts);e:for(let o,s;;){let a=!0,l;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(t.hasNode(i)){if(n){let c=n.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let f=u.from+c.pos,d=u.to+c.pos;f>=i.from&&d<=i.to&&!n.ranges.some(h=>h.from<d&&h.to>f)&&n.ranges.push({from:f,to:d})}}a=!1}else if(r&&(s=W3t(r.ranges,i.from,i.to)))a=s!=2;else if(!i.type.isAnonymous&&(o=this.nest(i,this.input))&&(i.from<i.to||!o.overlay)){i.tree||q3t(i);let c=t.findMounts(i.from,o.parser);if(typeof o.overlay=="function")n=new Q3t(o.parser,o.overlay,c,this.inner.length,i.from,i.tree,n);else{let u=kbe(this.ranges,o.overlay||(i.from<i.to?[new Wu(i.from,i.to)]:[]));u.length&&Ebe(u),(u.length||!o.overlay)&&this.inner.push(new Sbe(o.parser,u.length?o.parser.startParse(this.input,$be(c,u),u):o.parser.startParse(""),o.overlay?o.overlay.map(f=>new Wu(f.from-i.from,f.to-i.from)):null,i.tree,u.length?u[0].from:i.from)),o.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):a=!1}}else n&&(l=n.predicate(i))&&(l===!0&&(l=new Wu(i.from,i.to)),l.from<l.to&&n.ranges.push(l));if(a&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let c=kbe(this.ranges,n.ranges);c.length&&(Ebe(c),this.inner.splice(n.index,0,new Sbe(n.parser,n.parser.startParse(this.input,$be(n.mounts,c),c),n.ranges.map(u=>new Wu(u.from-n.start,u.to-n.start)),n.target,c[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function W3t(e,t,n){for(let r of e){if(r.from>=n)break;if(r.to>t)return r.from<=t&&r.to>=n?2:1}return 0}function Cbe(e,t,n,r,i,o){if(t<n){let s=e.buffer[t+1];r.push(e.slice(t,n,s)),i.push(s-o)}}function q3t(e){let{node:t}=e,n=[],r=t.context.buffer;do n.push(e.index),e.parent();while(!e.tree);let i=e.tree,o=i.children.indexOf(r),s=i.children[o],a=s.buffer,l=[o];function c(u,f,d,h,p,g){let v=n[g],y=[],O=[];Cbe(s,u,v,y,O,h);let m=a[v+1],w=a[v+2];l.push(y.length);let S=g?c(v+4,a[v+3],s.set.types[a[v]],m,w-m,g-1):t.toTree();return y.push(S),O.push(m-h),Cbe(s,a[v+3],f,y,O,h),new Bn(d,y,O,p)}i.children[o]=c(0,a.length,To.none,0,s.length,n.length-1);for(let u of l){let f=e.tree.children[u],d=e.tree.positions[u];e.yield(new ff(f,d+e.from,u,e._tree))}}class _be{constructor(t,n){this.offset=n,this.done=!1,this.cursor=t.cursor(Wr.IncludeAnonymous|Wr.IgnoreMounts)}moveTo(t){let{cursor:n}=this,r=t-this.offset;for(;!this.done&&n.from<r;)n.to>=t&&n.enter(r,1,Wr.IgnoreOverlays|Wr.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==t.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof Bn)n=n.children[0];else break}return!1}}let V3t=class{constructor(t){var n;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let r=this.curFrag=t[0];this.curTo=(n=r.tree.prop(FY))!==null&&n!==void 0?n:r.to,this.inner=new _be(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(t=n.tree.prop(FY))!==null&&t!==void 0?t:n.to,this.inner=new _be(n.tree,-n.offset)}}findMounts(t,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let o=this.inner.cursor.node;o;o=o.parent){let s=(r=o.tree)===null||r===void 0?void 0:r.prop(Zt.mounted);if(s&&s.parser==n)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=o.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:o.from-l.offset,mount:s})}}}return i}};function kbe(e,t){let n=null,r=t;for(let i=1,o=0;i<e.length;i++){let s=e[i-1].to,a=e[i].from;for(;o<r.length;o++){let l=r[o];if(l.from>=a)break;l.to<=s||(n||(r=n=t.slice()),l.from<s?(n[o]=new Wu(l.from,s),l.to>a&&n.splice(o+1,0,new Wu(a,l.to))):l.to>a?n[o--]=new Wu(a,l.to):n.splice(o--,1))}}return r}function U3t(e,t,n,r){let i=0,o=0,s=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==e.length?1e9:s?e[i].to:e[i].from,f=o==t.length?1e9:a?t[o].to:t[o].from;if(s!=a){let d=Math.max(l,n),h=Math.min(u,f,r);d<h&&c.push(new Wu(d,h))}if(l=Math.min(u,f),l==1e9)break;u==l&&(s?(s=!1,i++):s=!0),f==l&&(a?(a=!1,o++):a=!0)}return c}function $be(e,t){let n=[];for(let{pos:r,mount:i,frag:o}of e){let s=r+(i.overlay?i.overlay[0].from:0),a=s+i.tree.length,l=Math.max(o.from,s),c=Math.min(o.to,a);if(i.overlay){let u=i.overlay.map(d=>new Wu(d.from+r,d.to+r)),f=U3t(t,u,l,c);for(let d=0,h=l;;d++){let p=d==f.length,g=p?c:f[d].from;if(g>h&&n.push(new Tg(h,g,i.tree,-s,o.from>=h||o.openStart,o.to<=g||o.openEnd)),p)break;h=f[d].to}}else n.push(new Tg(l,c,i.tree,-s,o.from>=s||o.openStart,o.to<=a||o.openEnd))}return n}class Gn{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,r){[t,n]=vE(this,t,n);let i=[];return this.decompose(0,t,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),Oh.from(i,this.length-(n-t)+r.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=vE(this,t,n);let r=[];return this.decompose(t,n,r,0),Oh.from(r,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),r=this.length-this.scanIdentical(t,-1),i=new NT(this),o=new NT(t);for(let s=n,a=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(t=1){return new NT(this,t)}iterRange(t,n=this.length){return new G4e(this,t,n)}iterLines(t,n){let r;if(t==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(t).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new K4e(r)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?Gn.empty:t.length<=32?new no(t):Oh.from(no.split(t,[]))}}class no extends Gn{constructor(t,n=H3t(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.text[o],a=i+s.length;if((n?r:a)>=t)return new X3t(i,a,r,s);i=a+1,r++}}decompose(t,n,r,i){let o=t<=0&&n>=this.length?this:new no(Tbe(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let s=r.pop(),a=I5(o.text,s.text.slice(),0,o.length);if(a.length<=32)r.push(new no(a,s.length+o.length));else{let l=a.length>>1;r.push(new no(a.slice(0,l)),new no(a.slice(l)))}}else r.push(o)}replace(t,n,r){if(!(r instanceof no))return super.replace(t,n,r);[t,n]=vE(this,t,n);let i=I5(this.text,I5(r.text,Tbe(this.text,0,t)),n),o=this.length+r.length-(n-t);return i.length<=32?new no(i,o):Oh.from(no.split(i,[]),o)}sliceString(t,n=this.length,r=`
`){[t,n]=vE(this,t,n);let i="";for(let o=0,s=0;o<=n&&s<this.text.length;s++){let a=this.text[s],l=o+a.length;o>t&&s&&(i+=r),t<l&&n>o&&(i+=a.slice(Math.max(0,t-o),n-o)),o=l+1}return i}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let o of t)r.push(o),i+=o.length+1,r.length==32&&(n.push(new no(r,i)),r=[],i=-1);return i>-1&&n.push(new no(r,i)),n}}class Oh extends Gn{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let r of t)this.lines+=r.lines}lineInner(t,n,r,i){for(let o=0;;o++){let s=this.children[o],a=i+s.length,l=r+s.lines-1;if((n?l:a)>=t)return s.lineInner(t,n,r,i);i=a+1,r=l+1}}decompose(t,n,r,i){for(let o=0,s=0;s<=n&&o<this.children.length;o++){let a=this.children[o],l=s+a.length;if(t<=l&&n>=s){let c=i&((s<=t?1:0)|(l>=n?2:0));s>=t&&l<=n&&!c?r.push(a):a.decompose(t-s,n-s,r,c)}s=l+1}}replace(t,n,r){if([t,n]=vE(this,t,n),r.lines<this.lines)for(let i=0,o=0;i<this.children.length;i++){let s=this.children[i],a=o+s.length;if(t>=o&&n<=a){let l=s.replace(t-o,n-o,r),c=this.lines-s.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new Oh(u,this.length-(n-t)+r.length)}return super.replace(o,a,l)}o=a+1}return super.replace(t,n,r)}sliceString(t,n=this.length,r=`
`){[t,n]=vE(this,t,n);let i="";for(let o=0,s=0;o<this.children.length&&s<=n;o++){let a=this.children[o],l=s+a.length;s>t&&o&&(i+=r),t<l&&n>s&&(i+=a.sliceString(t-s,n-s,r)),s=l+1}return i}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof Oh))return 0;let r=0,[i,o,s,a]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==a)return r;let l=this.children[i],c=t.children[o];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(t,n=t.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of t)r+=h.lines;if(r<32){let h=[];for(let p of t)p.flatten(h);return new no(h,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,a=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>o&&h instanceof Oh)for(let g of h.children)f(g);else h.lines>s&&(l>s||!l)?(d(),a.push(h)):h instanceof no&&l&&(p=u[u.length-1])instanceof no&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new no(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,c+=h.length+1,u.push(h))}function d(){l!=0&&(a.push(u.length==1?u[0]:Oh.from(u,c)),c=-1,l=u.length=0)}for(let h of t)f(h);return d(),a.length==1?a[0]:new Oh(a,n)}}Gn.empty=new no([""],0);function H3t(e){let t=-1;for(let n of e)t+=n.length+1;return t}function I5(e,t,n=0,r=1e9){for(let i=0,o=0,s=!0;o<e.length&&i<=r;o++){let a=e[o],l=i+a.length;l>=n&&(l>r&&(a=a.slice(0,r-i)),i<n&&(a=a.slice(n-i)),s?(t[t.length-1]+=a,s=!1):t.push(a)),i=l+1}return t}function Tbe(e,t,n){return I5(e,[""],t,n)}class NT{constructor(t,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof no?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,a=i instanceof no?i.text.length:i.children.length;if(s==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,t==0)return this.lineBreak=!0,this.value=`
`,this;t--}else if(i instanceof no){let l=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,t))return this.value=t==0?l:n>0?l.slice(t):l.slice(0,l.length-t),this;t-=l.length}else{let l=i.children[s+(n<0?-1:0)];t>l.length?(t-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof no?l.text.length:l.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class G4e{constructor(t,n,r){this.value="",this.done=!1,this.cursor=new NT(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;t>r&&(t=r),r-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class K4e{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:r,value:i}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Gn.prototype[Symbol.iterator]=function(){return this.iter()},NT.prototype[Symbol.iterator]=G4e.prototype[Symbol.iterator]=K4e.prototype[Symbol.iterator]=function(){return this});let X3t=class{constructor(t,n,r,i){this.from=t,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function vE(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}let wS="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=1;e<wS.length;e++)wS[e]+=wS[e-1];function Z3t(e){for(let t=1;t<wS.length;t+=2)if(wS[t]>e)return wS[t-1]<=e;return!1}function Pbe(e){return e>=127462&&e<=127487}const Abe=8205;function zs(e,t,n=!0,r=!0){return(n?J4e:Y3t)(e,t,r)}function J4e(e,t,n){if(t==e.length)return t;t&&e7e(e.charCodeAt(t))&&t7e(e.charCodeAt(t-1))&&t--;let r=Rs(e,t);for(t+=Lu(r);t<e.length;){let i=Rs(e,t);if(r==Abe||i==Abe||n&&Z3t(i))t+=Lu(i),r=i;else if(Pbe(i)){let o=0,s=t-2;for(;s>=0&&Pbe(Rs(e,s));)o++,s-=2;if(o%2==0)break;t+=2}else break}return t}function Y3t(e,t,n){for(;t>0;){let r=J4e(e,t-2,n);if(r<t)return r;t--}return 0}function e7e(e){return e>=56320&&e<57344}function t7e(e){return e>=55296&&e<56320}function Rs(e,t){let n=e.charCodeAt(t);if(!t7e(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return e7e(r)?(n-55296<<10)+(r-56320)+65536:n}function Lse(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Lu(e){return e<65536?1:2}const zY=/\r\n?|\n/;var qo=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(qo||(qo={}));class Fh{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;n<this.sections.length;n+=2)t+=this.sections[n];return t}get newLength(){let t=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];t+=r<0?this.sections[n]:r}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let n=0,r=0,i=0;n<this.sections.length;){let o=this.sections[n++],s=this.sections[n++];s<0?(t(r,i,o),i+=o):i+=s,r+=o}}iterChangedRanges(t,n=!1){QY(this,t,n)}get invertedDesc(){let t=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?t.push(r,i):t.push(i,r)}return new Fh(t)}composeDesc(t){return this.empty?t:t.empty?this:n7e(this,t)}mapDesc(t,n=!1){return t.empty?this:BY(this,t,n)}mapPos(t,n=-1,r=qo.Simple){let i=0,o=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],l=this.sections[s++],c=i+a;if(l<0){if(c>t)return o+(t-i);o+=a}else{if(r!=qo.Simple&&c>=t&&(r==qo.TrackDel&&i<t&&c>t||r==qo.TrackBefore&&i<t||r==qo.TrackAfter&&c>t))return null;if(c>t||c==t&&n<0&&!a)return t==i||n<0?o:o+l;o+=l}i=c}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return o}touchesRange(t,n=t){for(let r=0,i=0;r<this.sections.length&&i<=n;){let o=this.sections[r++],s=this.sections[r++],a=i+o;if(s>=0&&i<=n&&a>=t)return i<t&&a>n?"cover":!0;i=a}return!1}toString(){let t="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];t+=(t?" ":"")+r+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Fh(t)}static create(t){return new Fh(t)}}class Oo extends Fh{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return QY(this,(n,r,i,o,s)=>t=t.replace(i,i+(r-n),s),!1),t}mapDesc(t,n=!1){return BY(this,t,n,!0)}invert(t){let n=this.sections.slice(),r=[];for(let i=0,o=0;i<n.length;i+=2){let s=n[i],a=n[i+1];if(a>=0){n[i]=a,n[i+1]=s;let l=i>>1;for(;r.length<l;)r.push(Gn.empty);r.push(s?t.slice(o,o+s):Gn.empty)}o+=s}return new Oo(n,r)}compose(t){return this.empty?t:t.empty?this:n7e(this,t,!0)}map(t,n=!1){return t.empty?this:BY(this,t,n,!0)}iterChanges(t,n=!1){QY(this,t,n)}get desc(){return Fh.create(this.sections)}filter(t){let n=[],r=[],i=[],o=new SP(this);e:for(let s=0,a=0;;){let l=s==t.length?1e9:t[s++];for(;a<l||a==l&&o.len==0;){if(o.done)break e;let u=Math.min(o.len,l-a);ba(i,u,-1);let f=o.ins==-1?-1:o.off==0?o.ins:0;ba(n,u,f),f>0&&Ey(r,n,o.text),o.forward(u),a+=u}let c=t[s++];for(;a<c;){if(o.done)break e;let u=Math.min(o.len,c-a);ba(n,u,-1),ba(i,u,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(u),a+=u}}return{changes:new Oo(n,r),filtered:Fh.create(i)}}toJSON(){let t=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?t.push(r):i==0?t.push([r]):t.push([r].concat(this.inserted[n>>1].toJSON()))}return t}static of(t,n,r){let i=[],o=[],s=0,a=null;function l(u=!1){if(!u&&!i.length)return;s<n&&ba(i,n-s,-1);let f=new Oo(i,o);a=a?a.compose(f.map(a)):f,i=[],o=[],s=0}function c(u){if(Array.isArray(u))for(let f of u)c(f);else if(u instanceof Oo){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);l(),a=a?a.compose(u.map(a)):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"?Gn.of(h.split(r||zY)):h:Gn.empty,g=p.length;if(f==d&&g==0)return;f<s&&l(),f>s&&ba(i,f-s,-1),ba(i,d-f,g),Ey(o,i,p),s=d}}return c(t),l(!a),a}static empty(t){return new Oo(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<t.length;i++){let o=t[i];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((s,a)=>a&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length<i;)r.push(Gn.empty);r[i]=Gn.of(o.slice(1)),n.push(o[0],r[i].length)}}}return new Oo(n,r)}static createSet(t,n){return new Oo(t,n)}}function ba(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function Ey(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(Gn.empty);e.push(n)}}function QY(e,t,n){let r=e.inserted;for(let i=0,o=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)i+=a,o+=a;else{let c=i,u=o,f=Gn.empty;for(;c+=a,u+=l,l&&r&&(f=f.append(r[s-2>>1])),!(n||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(i,c,o,u,f),i=c,o=u}}}function BY(e,t,n,r=!1){let i=[],o=r?[]:null,s=new SP(e),a=new SP(t);for(let l=-1;;)if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);ba(i,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len<s.len||a.len==s.len&&!n))){let c=a.len;for(ba(i,a.ins,-1);c;){let u=Math.min(s.len,c);s.ins>=0&&l<s.i&&s.len<=u&&(ba(i,0,s.ins),o&&Ey(o,i,s.text),l=s.i),s.forward(u),c-=u}a.next()}else if(s.ins>=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);c+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.len<u)u-=a.len,a.next();else break;ba(i,c,l<s.i?s.ins:0),o&&l<s.i&&Ey(o,i,s.text),l=s.i,s.forward(s.len-u)}else{if(s.done&&a.done)return o?Oo.createSet(i,o):Fh.create(i);throw new Error("Mismatched change set lengths")}}function n7e(e,t,n=!1){let r=[],i=n?[]:null,o=new SP(e),s=new SP(t);for(let a=!1;;){if(o.done&&s.done)return i?Oo.createSet(r,i):Fh.create(r);if(o.ins==0)ba(r,o.len,0,a),o.next();else if(s.len==0&&!s.done)ba(r,0,s.ins,a),i&&Ey(i,r,s.text),s.next();else{if(o.done||s.done)throw new Error("Mismatched change set lengths");{let l=Math.min(o.len2,s.len),c=r.length;if(o.ins==-1){let u=s.ins==-1?-1:s.off?0:s.ins;ba(r,l,u,a),i&&u&&Ey(i,r,s.text)}else s.ins==-1?(ba(r,o.off?0:o.len,l,a),i&&Ey(i,r,o.textBit(l))):(ba(r,o.off?0:o.len,s.off?0:s.ins,a),i&&!s.off&&Ey(i,r,s.text));a=(o.ins>l||s.ins>=0&&s.len>l)&&(a||r.length>c),o.forward2(l),s.forward(l)}}}}class SP{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[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:t}=this.set,n=this.i-2>>1;return n>=t.length?Gn.empty:t[n]}textBit(t){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!t?Gn.empty:n[r].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}let cN=class WY{constructor(t,n,r){this.from=t,this.to=n,this.flags=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 bidiLevel(){let t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new WY(r,i,this.flags)}extend(t,n=t){if(t<=this.anchor&&n>=this.anchor)return Ae.range(t,n);let r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return Ae.range(this.anchor,r)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Ae.range(t.anchor,t.head)}static create(t,n,r){return new WY(t,n,r)}};class Ae{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:Ae.create(this.ranges.map(r=>r.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(t.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Ae([this.main],0)}addRange(t,n=!0){return Ae.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,Ae.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Ae(t.ranges.map(n=>cN.fromJSON(n)),t.main)}static single(t,n=t){return new Ae([Ae.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<t.length;i++){let o=t[i];if(o.empty?o.from<=r:o.from<r)return Ae.normalized(t.slice(),n);r=o.to}return new Ae(t,n)}static cursor(t,n=0,r,i){return cN.create(t,t,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(t,n,r,i){let o=(r??16777215)<<6|(i==null?7:Math.min(6,i));return n<t?cN.create(n,t,48|o):cN.create(t,n,(n>t?8:0)|o)}static normalized(t,n=0){let r=t[n];t.sort((i,o)=>i.from-o.from),n=t.indexOf(r);for(let i=1;i<t.length;i++){let o=t[i],s=t[i-1];if(o.empty?o.from<=s.to:o.from<s.to){let a=s.from,l=Math.max(o.to,s.to);i<=n&&n--,t.splice(--i,2,o.anchor>o.head?Ae.range(l,a):Ae.range(a,l))}}return new Ae(t,n)}}function r7e(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let jse=0,mt=class i7e{constructor(t,n,r,i,o){this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=jse++,this.default=t([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(t={}){return new i7e(t.combine||(n=>n),t.compareInput||((n,r)=>n===r),t.compare||(t.combine?(n,r)=>n===r:Fse),!!t.static,t.enables)}of(t){return new L5([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new L5(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new L5(t,this,2,n)}from(t,n){return n||(n=r=>r),this.compute([t],r=>n(r.field(t)))}};function Fse(e,t){return e==t||e.length==t.length&&e.every((n,r)=>n===t[r])}class L5{constructor(t,n,r,i){this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=jse++}dynamicSlot(t){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=t[o]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:((n=t[f.id])!==null&&n!==void 0?n:1)&1||u.push(t[f.id]);return{create(f){return f.values[s]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||qY(f,u)){let h=r(f);if(a?!Rbe(h,f.values[s],i):!i(h,f.values[s]))return f.values[s]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[o];if(p!=null){let g=a3(d,p);if(this.dependencies.every(v=>v instanceof mt?d.facet(v)===f.facet(v):v instanceof di?d.field(v,!1)==f.field(v,!1):!0)||(a?Rbe(h=r(f),g,i):i(h=r(f),g)))return f.values[s]=g,0}else h=r(f);return f.values[s]=h,1}}}}function Rbe(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function qY(e,t){let n=!1;for(let r of t)IT(e,r)&1&&(n=!0);return n}function G3t(e,t,n){let r=n.map(l=>e[l.id]),i=n.map(l=>l.type),o=r.filter(l=>!(l&1)),s=e[t.id]>>1;function a(l){let c=[];for(let u=0;u<r.length;u++){let f=a3(l,r[u]);if(i[u]==2)for(let d of f)c.push(d);else c.push(f)}return t.combine(c)}return{create(l){for(let c of r)IT(l,c);return l.values[s]=a(l),1},update(l,c){if(!qY(l,o))return 0;let u=a(l);return t.compare(u,l.values[s])?0:(l.values[s]=u,1)},reconfigure(l,c){let u=qY(l,r),f=c.config.facets[t.id],d=c.facet(t);if(f&&!u&&Fse(n,f))return l.values[s]=d,0;let h=a(l);return t.compare(h,d)?(l.values[s]=d,0):(l.values[s]=h,1)}}}const Dbe=mt.define({static:!0});class di{constructor(t,n,r,i,o){this.id=t,this.createF=n,this.updateF=r,this.compareF=i,this.spec=o,this.provides=void 0}static define(t){let n=new di(jse++,t.create,t.update,t.compare||((r,i)=>r===i),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet(Dbe).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}init(t){return[this,Dbe.of({field:this,create:t})]}get extension(){return this}}const E1={lowest:4,low:3,default:2,high:1,highest:0};function dk(e){return t=>new o7e(t,e)}const Ks={highest:dk(E1.highest),high:dk(E1.high),default:dk(E1.default),low:dk(E1.low),lowest:dk(E1.lowest)};class o7e{constructor(t,n){this.inner=t,this.prec=n}}class wv{of(t){return new VY(this,t)}reconfigure(t){return wv.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class VY{constructor(t,n){this.compartment=t,this.inner=n}}class s3{constructor(t,n,r,i,o,s){for(this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(t){let n=this.address[t.id];return n==null?t.default:this.staticValues[n>>1]}static resolve(t,n,r){let i=[],o=Object.create(null),s=new Map;for(let d of K3t(t,n,s))d instanceof di?i.push(d):(o[d.facet.id]||(o[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=r==null?void 0:r.config.facets;for(let d in o){let h=o[d],p=h[0].facet,g=u&&u[d]||[];if(h.every(v=>v.type==0))if(a[p.id]=l.length<<1|1,Fse(g,h))l.push(r.facet(p));else{let v=p.combine(h.map(y=>y.value));l.push(r&&p.compare(v,r.facet(p))?r.facet(p):v)}else{for(let v of h)v.type==0?(a[v.id]=l.length<<1|1,l.push(v.value)):(a[v.id]=c.length<<1,c.push(y=>v.dynamicSlot(y)));a[p.id]=c.length<<1,c.push(v=>G3t(v,p,h))}}let f=c.map(d=>d(a));return new s3(t,s,f,a,l,o)}}function K3t(e,t,n){let r=[[],[],[],[],[]],i=new Map;function o(s,a){let l=i.get(s);if(l!=null){if(l<=a)return;let c=r[l].indexOf(s);c>-1&&r[l].splice(c,1),s instanceof VY&&n.delete(s.compartment)}if(i.set(s,a),Array.isArray(s))for(let c of s)o(c,a);else if(s instanceof VY){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=t.get(s.compartment)||s.inner;n.set(s.compartment,c),o(c,a)}else if(s instanceof o7e)o(s.inner,s.prec);else if(s instanceof di)r[a].push(s),s.provides&&o(s.provides,a);else if(s instanceof L5)r[a].push(s),s.facet.extensions&&o(s.facet.extensions,E1.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(c,a)}}return o(e,E1.default),r.reduce((s,a)=>s.concat(a))}function IT(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function a3(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const s7e=mt.define(),UY=mt.define({combine:e=>e.some(t=>t),static:!0}),a7e=mt.define({combine:e=>e.length?e[0]:void 0,static:!0}),l7e=mt.define(),c7e=mt.define(),u7e=mt.define(),f7e=mt.define({combine:e=>e.length?e[0]:!1});class bp{constructor(t,n){this.type=t,this.value=n}static define(){return new J3t}}class J3t{of(t){return new bp(this,t)}}class eFt{constructor(t){this.map=t}of(t){return new jt(this,t)}}class jt{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new jt(this.type,n)}is(t){return this.type==t}static define(t={}){return new eFt(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let r=[];for(let i of t){let o=i.map(n);o&&r.push(o)}return r}}jt.reconfigure=jt.define();jt.appendConfig=jt.define();class Co{constructor(t,n,r,i,o,s){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&r7e(r,n.newLength),o.some(a=>a.type==Co.time)||(this.annotations=o.concat(Co.time.of(Date.now())))}static create(t,n,r,i,o,s){return new Co(t,n,r,i,o,s)}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(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Co.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Co.time=bp.define();Co.userEvent=bp.define();Co.addToHistory=bp.define();Co.remote=bp.define();function tFt(e,t){let n=[];for(let r=0,i=0;;){let o,s;if(r<e.length&&(i==t.length||t[i]>=e[r]))o=e[r++],s=e[r++];else if(i<t.length)o=t[i++],s=t[i++];else return n;!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function d7e(e,t,n){var r;let i,o,s;return n?(i=t.changes,o=Oo.empty(t.changes.length),s=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(i)),{changes:s,selection:t.selection?t.selection.map(o):(r=e.selection)===null||r===void 0?void 0:r.map(i),effects:jt.mapEffects(e.effects,i).concat(jt.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function HY(e,t,n){let r=t.selection,i=SS(t.annotations);return t.userEvent&&(i=i.concat(Co.userEvent.of(t.userEvent))),{changes:t.changes instanceof Oo?t.changes:Oo.of(t.changes||[],n,e.facet(a7e)),selection:r&&(r instanceof Ae?r:Ae.single(r.anchor,r.head)),effects:SS(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function h7e(e,t,n){let r=HY(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let o=1;o<t.length;o++){t[o].filter===!1&&(n=!1);let s=!!t[o].sequential;r=d7e(r,HY(e,t[o],s?r.changes.newLength:e.doc.length),s)}let i=Co.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return rFt(n?nFt(i):i)}function nFt(e){let t=e.startState,n=!0;for(let i of t.facet(l7e)){let o=i(e);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:tFt(n,o))}if(n!==!0){let i,o;if(n===!1)o=e.changes.invertedDesc,i=Oo.empty(t.doc.length);else{let s=e.changes.filter(n);i=s.changes,o=s.filtered.mapDesc(s.changes).invertedDesc}e=Co.create(t,i,e.selection&&e.selection.map(o),jt.mapEffects(e.effects,o),e.annotations,e.scrollIntoView)}let r=t.facet(c7e);for(let i=r.length-1;i>=0;i--){let o=r[i](e);o instanceof Co?e=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Co?e=o[0]:e=h7e(t,SS(o),!1)}return e}function rFt(e){let t=e.startState,n=t.facet(u7e),r=e;for(let i=n.length-1;i>=0;i--){let o=n[i](e);o&&Object.keys(o).length&&(r=d7e(r,HY(t,o,e.changes.newLength),!0))}return r==e?e:Co.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}const iFt=[];function SS(e){return e==null?iFt:Array.isArray(e)?e:[e]}var xi=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(xi||(xi={}));const oFt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let XY;try{XY=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function sFt(e){if(XY)return XY.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||oFt.test(n)))return!0}return!1}function aFt(e){return t=>{if(!/\S/.test(t))return xi.Space;if(sFt(t))return xi.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return xi.Word;return xi.Other}}class dn{constructor(t,n,r,i,o,s){this.config=t,this.doc=n,this.selection=r,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)IT(this,a<<1);this.computeSlot=null}field(t,n=!0){let r=this.config.address[t.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return IT(this,r),a3(this,r)}update(...t){return h7e(this,t,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let a of t.effects)a.is(wv.reconfigure)?(n&&(i=new Map,n.compartments.forEach((l,c)=>i.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(jt.reconfigure)?(n=null,r=a.value):a.is(jt.appendConfig)&&(n=null,r=SS(r).concat(a.value));let o;n?o=t.startState.values.slice():(n=s3.resolve(r,i,this),o=new dn(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=t.startState.facet(UY)?t.newSelection:t.newSelection.asSingle();new dn(n,t.newDoc,s,o,(a,l)=>l.update(a,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:Ae.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,r=t(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=SS(r.effects);for(let a=1;a<n.ranges.length;a++){let l=t(n.ranges[a]),c=this.changes(l.changes),u=c.map(i);for(let d=0;d<a;d++)o[d]=o[d].map(u);let f=i.mapDesc(c,!0);o.push(l.range.map(f)),i=i.compose(u),s=jt.mapEffects(s,u).concat(jt.mapEffects(SS(l.effects),f))}return{changes:i,selection:Ae.create(o,n.mainIndex),effects:s}}changes(t=[]){return t instanceof Oo?t:Oo.of(t,this.doc.length,this.facet(dn.lineSeparator))}toText(t){return Gn.of(t.split(this.facet(dn.lineSeparator)||zY))}sliceDoc(t=0,n=this.doc.length){return this.doc.sliceString(t,n,this.lineBreak)}facet(t){let n=this.config.address[t.id];return n==null?t.default:(IT(this,n),a3(this,n))}toJSON(t){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let r in t){let i=t[r];i instanceof di&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(t[r]),this))}return n}static fromJSON(t,n={},r){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let o in r)if(Object.prototype.hasOwnProperty.call(t,o)){let s=r[o],a=t[o];i.push(s.init(l=>s.spec.fromJSON(a,l)))}}return dn.create({doc:t.doc,selection:Ae.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=s3.resolve(t.extensions||[],new Map),r=t.doc instanceof Gn?t.doc:Gn.of((t.doc||"").split(n.staticFacet(dn.lineSeparator)||zY)),i=t.selection?t.selection instanceof Ae?t.selection:Ae.single(t.selection.anchor,t.selection.head):Ae.single(0);return r7e(i,r.length),n.staticFacet(UY)||(i=i.asSingle()),new dn(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(dn.tabSize)}get lineBreak(){return this.facet(dn.lineSeparator)||`
`}get readOnly(){return this.facet(f7e)}phrase(t,...n){for(let r of this.facet(dn.phrases))if(Object.prototype.hasOwnProperty.call(r,t)){t=r[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),t}languageDataAt(t,n,r=-1){let i=[];for(let o of this.facet(s7e))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,t)&&i.push(s[t]);return i}charCategorizer(t){return aFt(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:n,from:r,length:i}=this.doc.lineAt(t),o=this.charCategorizer(t),s=t-r,a=t-r;for(;s>0;){let l=zs(n,s,!1);if(o(n.slice(l,s))!=xi.Word)break;s=l}for(;a<i;){let l=zs(n,a);if(o(n.slice(a,l))!=xi.Word)break;a=l}return s==a?null:Ae.range(s+r,a+r)}}dn.allowMultipleSelections=UY;dn.tabSize=mt.define({combine:e=>e.length?e[0]:4});dn.lineSeparator=a7e;dn.readOnly=f7e;dn.phrases=mt.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(i=>e[i]==t[i])}});dn.languageData=s7e;dn.changeFilter=l7e;dn.transactionFilter=c7e;dn.transactionExtender=u7e;wv.reconfigure=jt.define();function Op(e,t,n={}){let r={};for(let i of e)for(let o of Object.keys(i)){let s=i[o],a=r[o];if(a===void 0)r[o]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](a,s);else throw new Error("Config merge conflict for field "+o)}for(let i in t)r[i]===void 0&&(r[i]=t[i]);return r}class Ub{eq(t){return this==t}range(t,n=t){return ZY.create(t,n,this)}}Ub.prototype.startSide=Ub.prototype.endSide=0;Ub.prototype.point=!1;Ub.prototype.mapMode=qo.TrackDel;let ZY=class p7e{constructor(t,n,r){this.from=t,this.to=n,this.value=r}static create(t,n,r){return new p7e(t,n,r)}};function YY(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}let lFt=class g7e{constructor(t,n,r,i){this.from=t,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,n,r,i=0){let o=r?this.to:this.from;for(let s=i,a=o.length;;){if(s==a)return s;let l=s+a>>1,c=o[l]-t||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(t,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);o<s;o++)if(i(this.from[o]+t,this.to[o]+t,this.value[o])===!1)return!1}map(t,n){let r=[],i=[],o=[],s=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],u=this.from[l]+t,f=this.to[l]+t,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||(s<0&&(s=d),c.point&&(a=Math.max(a,h-d)),r.push(c),i.push(d-s),o.push(h-s))}return{mapped:r.length?new g7e(i,o,r,a):null,pos:s}}};class Dn{constructor(t,n,r,i){this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(t,n,r,i){return new Dn(t,n,r,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=t,s=t.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(YY)),this.isEmpty)return n.length?Dn.of(n):this;let a=new m7e(this,null,-1).goto(0),l=0,c=[],u=new Ol;for(;a.value||l<n.length;)if(l<n.length&&(a.from-n[l].from||a.startSide-n[l].value.startSide)>=0){let f=n[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(a.chunkIndex)<n[l].from)&&(!s||i>this.chunkEnd(a.chunkIndex)||o<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!s||i>a.to||o<a.from||s(a.from,a.to,a.value))&&(u.addInner(a.from,a.to,a.value)||c.push(ZY.create(a.from,a.to,a.value))),a.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?Dn.empty:this.nextLayer.update({add:c,filter:s,filterFrom:i,filterTo:o}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],l=this.chunk[s],c=t.touchesRange(a,a+l.length);if(c===!1)i=Math.max(i,l.maxPoint),n.push(l),r.push(t.mapPos(a));else if(c===!0){let{mapped:u,pos:f}=l.map(a,t);u&&(i=Math.max(i,u.maxPoint),n.push(u),r.push(f))}}let o=this.nextLayer.map(t);return n.length==0?o:new Dn(r,n,o||Dn.empty,i)}between(t,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],s=this.chunk[i];if(n>=o&&t<=o+s.length&&s.between(o,t-o,n-o,r)===!1)return}this.nextLayer.between(t,n,r)}}iter(t=0){return EP.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return EP.from(t).goto(n)}static compare(t,n,r,i,o=-1){let s=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=Mbe(s,a,r),c=new hk(s,l,o),u=new hk(a,l,o);r.iterGaps((f,d,h)=>Nbe(c,f,u,d,h,i)),r.empty&&r.length==0&&Nbe(c,0,u,0,0,i)}static eq(t,n,r=0,i){i==null&&(i=999999999);let o=t.filter(u=>!u.isEmpty&&n.indexOf(u)<0),s=n.filter(u=>!u.isEmpty&&t.indexOf(u)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let a=Mbe(o,s),l=new hk(o,a,0).goto(r),c=new hk(s,a,0).goto(r);for(;;){if(l.to!=c.to||!GY(l.active,c.active)||l.point&&(!c.point||!l.point.eq(c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(t,n,r,i,o=-1){let s=new hk(t,null,o).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,r);if(s.point){let u=s.activeForPoint(s.to),f=s.pointFrom<n?u.length+1:s.point.startSide<0?u.length:Math.min(u.length,l);i.point(a,c,s.point,u,f,s.pointRank),l=Math.min(s.openEnd(c),u.length)}else c>a&&(i.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>r)return l+(s.point&&s.to>r?1:0);a=s.to,s.next()}}static of(t,n=!1){let r=new Ol;for(let i of t instanceof ZY?[t]:n?cFt(t):t)r.add(i.from,i.to,i.value);return r.finish()}static join(t){if(!t.length)return Dn.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=Dn.empty;i=i.nextLayer)n=new Dn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Dn.empty=new Dn([],[],null,-1);function cFt(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(YY(t,r)>0)return e.slice().sort(YY);t=r}return e}Dn.empty.nextLayer=Dn.empty;class Ol{finishChunk(t){this.chunks.push(new lFt(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,t&&(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(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new Ol)).add(t,n,r)}addInner(t,n,r){let i=t-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=t,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-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(t);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+t,this.lastTo=n.to[r]+t,!0}finish(){return this.finishInner(Dn.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=Dn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function Mbe(e,t,n){let r=new Map;for(let o of e)for(let s=0;s<o.chunk.length;s++)o.chunk[s].maxPoint<=0&&r.set(o.chunk[s],o.chunkPos[s]);let i=new Set;for(let o of t)for(let s=0;s<o.chunk.length;s++){let a=r.get(o.chunk[s]);a!=null&&(n?n.mapPos(a):a)==o.chunkPos[s]&&!(n!=null&&n.touchesRange(a,a+o.chunk[s].length))&&i.add(o.chunk[s])}return i}class m7e{constructor(t,n,r,i=0){this.layer=t,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,n,!1),this}gotoInner(t,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<t||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,n){(this.to-t||this.endSide-n)<0&&this.gotoInner(t,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let t=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=t+n.from[this.rangeIndex];if(this.from=r,this.to=t+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(t){if(t==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=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class EP{constructor(t){this.heap=t}static from(t,n=null,r=-1){let i=[];for(let o=0;o<t.length;o++)for(let s=t[o];!s.isEmpty;s=s.nextLayer)s.maxPoint>=r&&i.push(new m7e(s,n,r,o));return i.length==1?i[0]:new EP(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let r of this.heap)r.goto(t,n);for(let r=this.heap.length>>1;r>=0;r--)Rq(this.heap,r);return this.next(),this}forward(t,n){for(let r of this.heap)r.forward(t,n);for(let r=this.heap.length>>1;r>=0;r--)Rq(this.heap,r);(this.to-t||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 t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Rq(this.heap,0)}}}function Rq(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}class hk{constructor(t,n,r){this.minPoint=r,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=EP.from(t,n,r)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){uN(this.active,t),uN(this.activeTo,t),uN(this.activeRank,t),this.minActive=Ibe(this.active,this.activeTo)}addActive(t){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n<this.activeRank.length&&(o-this.activeRank[n]||i-this.activeTo[n])>0;)n++;fN(this.active,n,r),fN(this.activeTo,n,i),fN(this.activeRank,n,o),t&&fN(t,n,this.cursor.from),this.minActive=Ibe(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&uN(r,i)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<t;i--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>t||this.activeTo[r]==t&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(t){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>t;r--)n++;return n}}function Nbe(e,t,n,r,i,o){e.goto(t),n.goto(r);let s=r+i,a=r,l=r-t;for(;;){let c=e.to+l-n.to||e.endSide-n.endSide,u=c<0?e.to+l:n.to,f=Math.min(u,s);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&GY(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(a,f,e.point,n.point):f>a&&!GY(e.active,n.active)&&o.compareRange(a,f,e.active,n.active),u>s)break;a=u,c<=0&&e.next(),c>=0&&n.next()}}function GY(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].eq(t[n]))return!1;return!0}function uN(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function fN(e,t,n){for(let r=e.length-1;r>=t;r--)e[r+1]=e[r];e[t]=n}function Ibe(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function Ed(e,t,n=e.length){let r=0;for(let i=0;i<n;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=zs(e,i));return r}function KY(e,t,n,r){for(let i=0,o=0;;){if(o>=t)return i;if(i==e.length)break;o+=e.charCodeAt(i)==9?n-o%n:1,i=zs(e,i)}return r===!0?-1:e.length}const JY="ͼ",Lbe=typeof Symbol>"u"?"__"+JY:Symbol.for(JY),eG=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),jbe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Xg{constructor(t,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,a,l,c){let u=[],f=/^@(\w+)\b/.exec(s[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(s[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))o(h.split(/,\s*/).map(g=>s.map(v=>g.replace(/&/,v))).reduce((g,v)=>g.concat(v)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");o(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?s.map(r):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in t)o(i(s),t[s],this.rules)}getRules(){return this.rules.join(`
`)}static newName(){let t=jbe[Lbe]||1;return jbe[Lbe]=t+1,JY+t.toString(36)}static mount(t,n,r){let i=t[eG],o=r&&r.nonce;i?o&&i.setNonce(o):i=new uFt(t,o),i.mount(Array.isArray(n)?n:[n],t)}}let Fbe=new Map;class uFt{constructor(t,n){let r=t.ownerDocument||t,i=r.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let o=Fbe.get(r);if(o)return t[eG]=o;this.sheet=new i.CSSStyleSheet,Fbe.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[eG]=this}mount(t,n){let r=this.sheet,i=0,o=0;for(let s=0;s<t.length;s++){let a=t[s],l=this.modules.indexOf(a);if(l<o&&l>-1&&(this.modules.splice(l,1),o--,l=-1),l==-1){if(this.modules.splice(o++,0,a),r)for(let c=0;c<a.rules.length;c++)r.insertRule(a.rules[c],i++)}else{for(;o<l;)i+=this.modules[o++].rules.length;i+=a.rules.length,o++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let s="";for(let l=0;l<this.modules.length;l++)s+=this.modules[l].getRules()+`
`;this.styleTag.textContent=s;let a=n.head||n;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}var M0={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:"'"},CP={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},fFt=typeof navigator<"u"&&/Mac/.test(navigator.platform),dFt=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ds=0;Ds<10;Ds++)M0[48+Ds]=M0[96+Ds]=String(Ds);for(var Ds=1;Ds<=24;Ds++)M0[Ds+111]="F"+Ds;for(var Ds=65;Ds<=90;Ds++)M0[Ds]=String.fromCharCode(Ds+32),CP[Ds]=String.fromCharCode(Ds);for(var Dq in M0)CP.hasOwnProperty(Dq)||(CP[Dq]=M0[Dq]);function hFt(e){var t=fFt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||dFt&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?CP:M0)[e.keyCode]||e.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 l3(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function tG(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function pFt(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function j5(e,t){if(!t.anchorNode)return!1;try{return tG(e,t.anchorNode)}catch{return!1}}function bE(e){return e.nodeType==3?Xb(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function LT(e,t,n,r){return n?zbe(e,t,n,r,-1)||zbe(e,t,n,r,1):!1}function Hb(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function c3(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function zbe(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Zg(e))){if(e.nodeName=="DIV")return!1;let o=e.parentNode;if(!o||o.nodeType!=1)return!1;t=Hb(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=i<0?Zg(e):0}else return!1}}function Zg(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function qz(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function gFt(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function y7e(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function mFt(e,t,n,r,i,o,s,a){let l=e.ownerDocument,c=l.defaultView||window;for(let u=e,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==l.body,p=1,g=1;if(h)d=gFt(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 O=u.getBoundingClientRect();({scaleX:p,scaleY:g}=y7e(u,O)),d={left:O.left,right:O.left+u.clientWidth*p,top:O.top,bottom:O.top+u.clientHeight*g}}let v=0,y=0;if(i=="nearest")t.top<d.top?(y=-(d.top-t.top+s),n>0&&t.bottom>d.bottom+y&&(y=t.bottom-d.bottom+y+s)):t.bottom>d.bottom&&(y=t.bottom-d.bottom+s,n<0&&t.top-y<d.top&&(y=-(d.top+y-t.top+s)));else{let O=t.bottom-t.top,m=d.bottom-d.top;y=(i=="center"&&O<=m?t.top+O/2-m/2:i=="start"||i=="center"&&n<0?t.top-s:t.bottom-m+s)-d.top}if(r=="nearest"?t.left<d.left?(v=-(d.left-t.left+o),n>0&&t.right>d.right+v&&(v=t.right-d.right+v+o)):t.right>d.right&&(v=t.right-d.right+o,n<0&&t.left<d.left+v&&(v=-(d.left+v-t.left+o))):v=(r=="center"?t.left+(t.right-t.left)/2-(d.right-d.left)/2:r=="start"==a?t.left-o:t.right-(d.right-d.left)+o)-d.left,v||y)if(h)c.scrollBy(v,y);else{let O=0,m=0;if(y){let w=u.scrollTop;u.scrollTop+=y/g,m=(u.scrollTop-w)*g}if(v){let w=u.scrollLeft;u.scrollLeft+=v/p,O=(u.scrollLeft-w)*p}t={left:t.left-O,top:t.top-m,right:t.right-O,bottom:t.bottom-m},O&&Math.abs(O-v)<1&&(r="nearest"),m&&Math.abs(m-y)<1&&(i="nearest")}if(h)break;u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function yFt(e){let t=e.ownerDocument;for(let n=e.parentNode;n&&n!=t.body;)if(n.nodeType==1){if(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else if(n.nodeType==11)n=n.host;else break;return null}class vFt{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:r}=t;this.set(n,Math.min(t.anchorOffset,n?Zg(n):0),r,Math.min(t.focusOffset,r?Zg(r):0))}set(t,n,r,i){this.anchorNode=t,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Lx=null;function v7e(e){if(e.setActive)return e.setActive();if(Lx)return e.focus(Lx);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(Lx==null?{get preventScroll(){return Lx={preventScroll:!0},!0}}:void 0),!Lx){Lx=!1;for(let n=0;n<t.length;){let r=t[n++],i=t[n++],o=t[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=o&&(r.scrollLeft=o)}}}let Qbe;function Xb(e,t,n=t){let r=Qbe||(Qbe=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function ES(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let o=new KeyboardEvent("keydown",i);o.synthetic=!0,e.dispatchEvent(o);let s=new KeyboardEvent("keyup",i);return s.synthetic=!0,e.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function bFt(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function b7e(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}function OFt(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,Zg(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Zg(n))}else{if(n==e)return!0;r=Hb(n),n=n.parentNode}}function O7e(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function x7e(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Zg(n)}else if(n.parentNode&&!c3(n))r=Hb(n),n=n.parentNode;else return null}}function w7e(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!c3(n))r=Hb(n)+1,n=n.parentNode;else return null}}class Ca{constructor(t,n,r=!0){this.node=t,this.offset=n,this.precise=r}static before(t,n){return new Ca(t.parentNode,Hb(t),n)}static after(t,n){return new Ca(t.parentNode,Hb(t)+1,n)}}const zse=[];class qr{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t){let n=this.posAtStart;for(let r of this.children){if(r==t)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}sync(t,n){if(this.flags&2){let r=this.dom,i=null,o;for(let s of this.children){if(s.flags&7){if(!s.dom&&(o=i?i.nextSibling:r.firstChild)){let a=qr.get(o);(!a||!a.parent&&a.canReuseDOM(s))&&s.reuseDOM(o)}s.sync(t,n),s.flags&=-8}if(o=i?i.nextSibling:r.firstChild,n&&!n.written&&n.node==r&&o!=s.dom&&(n.written=!0),s.dom.parentNode==r)for(;o&&o!=s.dom;)o=Bbe(o);else r.insertBefore(s.dom,o);i=s.dom}for(o=i?i.nextSibling:r.firstChild,o&&n&&n.node==r&&(n.written=!0);o;)o=Bbe(o)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(t,n),r.flags&=-8)}reuseDOM(t){}localPosFromDOM(t,n){let r;if(t==this.dom)r=this.dom.childNodes[n];else{let i=Zg(t)==0?0:n==0?-1:1;for(;;){let o=t.parentNode;if(o==this.dom)break;i==0&&o.firstChild!=o.lastChild&&(t==o.firstChild?i=-1:i=1),t=o}i<0?r=t:r=t.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!qr.get(r);)r=r.nextSibling;if(!r)return this.length;for(let i=0,o=0;;i++){let s=this.children[i];if(s.dom==r)return o;o+=s.length+s.breakAfter}}domBoundsAround(t,n,r=0){let i=-1,o=-1,s=-1,a=-1;for(let l=0,c=r,u=r;l<this.children.length;l++){let f=this.children[l],d=c+f.length;if(c<t&&d>n)return f.domBoundsAround(t,n,c);if(d>=t&&i==-1&&(i=l,o=c),c>n&&f.dom.parentNode==this.dom){s=l,a=u;break}u=d,c=d+f.breakAfter}return{from:o,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s<this.children.length&&s>=0?this.children[s].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let n=this.parent;n;n=n.parent){if(t&&(n.flags|=2),n.flags&1)return;n.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,this.flags&7&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let n=t.parent;if(!n)return t;t=n}}replaceChildren(t,n,r=zse){this.markDirty();for(let i=t;i<n;i++){let o=this.children[i];o.parent==this&&r.indexOf(o)<0&&o.destroy()}this.children.splice(t,n-t,...r);for(let i=0;i<r.length;i++)r[i].setParent(this)}ignoreMutation(t){return!1}ignoreEvent(t){return!1}childCursor(t=this.length){return new S7e(this.children,t,this.children.length)}childPos(t,n=1){return this.childCursor().findPos(t,n)}toString(){let t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+(t=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(t){return t.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(t,n,r,i,o,s){return!1}become(t){return!1}canReuseDOM(t){return t.constructor==this.constructor&&!((this.flags|t.flags)&8)}getSide(){return 0}destroy(){for(let t of this.children)t.parent==this&&t.destroy();this.parent=null}}qr.prototype.breakAfter=0;function Bbe(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class S7e{constructor(t,n,r){this.children=t,this.pos=n,this.i=r,this.off=0}findPos(t,n=1){for(;;){if(t>this.pos||t==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function E7e(e,t,n,r,i,o,s,a,l){let{children:c}=e,u=c.length?c[t]:null,f=o.length?o[o.length-1]:null,d=f?f.breakAfter:s;if(!(t==r&&u&&!s&&!d&&o.length<2&&u.merge(n,i,o.length?f:null,n==0,a,l))){if(r<c.length){let h=c[r];h&&(i<h.length||h.breakAfter&&(f!=null&&f.breakAfter))?(t==r&&(h=h.split(i),i=0),!d&&f&&h.merge(0,i,f,!0,0,l)?o[o.length-1]=h:((i||h.children.length&&!h.children[0].length)&&h.merge(0,i,null,!1,0,l),o.push(h))):h!=null&&h.breakAfter&&(f?f.breakAfter=1:s=1),r++}for(u&&(u.breakAfter=s,n>0&&(!s&&o.length&&u.merge(n,u.length,o[0],!1,a,0)?u.breakAfter=o.shift().breakAfter:(n<u.length||u.children.length&&u.children[u.children.length-1].length==0)&&u.merge(n,u.length,null,!1,a,0),t++));t<r&&o.length;)if(c[r-1].become(o[o.length-1]))r--,o.pop(),l=o.length?0:a;else if(c[t].become(o[0]))t++,o.shift(),a=o.length?0:l;else break;!o.length&&t&&r<c.length&&!c[t-1].breakAfter&&c[r].merge(0,0,c[t-1],!1,a,l)&&t--,(t<r||o.length)&&e.replaceChildren(t,r,o)}}function C7e(e,t,n,r,i,o){let s=e.childCursor(),{i:a,off:l}=s.findPos(n,1),{i:c,off:u}=s.findPos(t,-1),f=t-n;for(let d of r)f+=d.length;e.length+=f,E7e(e,c,u,a,l,r,0,i,o)}let jc=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},nG=typeof document<"u"?document:{documentElement:{style:{}}};const rG=/Edge\/(\d+)/.exec(jc.userAgent),_7e=/MSIE \d/.test(jc.userAgent),iG=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(jc.userAgent),Vz=!!(_7e||iG||rG),Wbe=!Vz&&/gecko\/(\d+)/i.test(jc.userAgent),Mq=!Vz&&/Chrome\/(\d+)/.exec(jc.userAgent),qbe="webkitFontSmoothing"in nG.documentElement.style,k7e=!Vz&&/Apple Computer/.test(jc.vendor),Vbe=k7e&&(/Mobile\/\w+/.test(jc.userAgent)||jc.maxTouchPoints>2);var bt={mac:Vbe||/Mac/.test(jc.platform),windows:/Win/.test(jc.platform),linux:/Linux|X11/.test(jc.platform),ie:Vz,ie_version:_7e?nG.documentMode||6:iG?+iG[1]:rG?+rG[1]:0,gecko:Wbe,gecko_version:Wbe?+(/Firefox\/(\d+)/.exec(jc.userAgent)||[0,0])[1]:0,chrome:!!Mq,chrome_version:Mq?+Mq[1]:0,ios:Vbe,android:/Android\b/.test(jc.userAgent),webkit:qbe,safari:k7e,webkit_version:qbe?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:nG.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const xFt=256;class Cd extends qr{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){t.nodeType==3&&this.createDOM(t)}merge(t,n,r){return this.flags&8||r&&(!(r instanceof Cd)||this.length-(n-t)+r.length>xFt||r.flags&8)?!1:(this.text=this.text.slice(0,t)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(t){let n=new Cd(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(t,n){return t==this.dom?n:n?this.text.length:0}domAtPos(t){return new Ca(this.dom,t)}domBoundsAround(t,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,n){return wFt(this.dom,t,n)}}class Yg extends qr{constructor(t,n=[],r=0){super(),this.mark=t,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(t){if(b7e(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)t.setAttribute(n,this.mark.attrs[n]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!((this.flags|t.flags)&8)}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,n)}merge(t,n,r,i,o,s){return r&&(!(r instanceof Yg&&r.mark.eq(this.mark))||t&&o<=0||n<this.length&&s<=0)?!1:(C7e(this,t,n,r?r.children.slice():[],o-1,s-1),this.markDirty(),!0)}split(t){let n=[],r=0,i=-1,o=0;for(let a of this.children){let l=r+a.length;l>t&&n.push(r<t?a.split(t-r):a),i<0&&r>=t&&(i=o),r=l,o++}let s=this.length-t;return this.length=t,i>-1&&(this.children.length=i,this.markDirty()),new Yg(this.mark,n,s)}domAtPos(t){return $7e(this,t)}coordsAt(t,n){return P7e(this,t,n)}}function wFt(e,t,n){let r=e.nodeValue.length;t>r&&(t=r);let i=t,o=t,s=0;t==0&&n<0||t==r&&n>=0?bt.chrome||bt.gecko||(t?(i--,s=1):o<r&&(o++,s=-1)):n<0?i--:o<r&&o++;let a=Xb(e,i,o).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return bt.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?qz(l,s<0):l||null}class Cy extends qr{static create(t,n,r){return new Cy(t,n,r)}constructor(t,n,r){super(),this.widget=t,this.length=n,this.side=r,this.prevWidget=null}split(t){let n=Cy.create(this.widget,this.length-t,this.side);return this.length-=t,n}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,n,r,i,o,s){return r&&(!(r instanceof Cy)||!this.widget.compare(r.widget)||t>0&&o<=0||n<this.length&&s<=0)?!1:(this.length=t+(r?r.length:0)+(this.length-n),!0)}become(t){return t instanceof Cy&&t.side==this.side&&this.widget.constructor==t.widget.constructor?(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get overrideDOMText(){if(this.length==0)return Gn.empty;let t=this;for(;t.parent;)t=t.parent;let{view:n}=t,r=n&&n.state.doc,i=this.posAtStart;return r?r.slice(i,i+this.length):Gn.empty}domAtPos(t){return(this.length?t==0:this.side>0)?Ca.before(this.dom):Ca.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,n){let r=this.widget.coordsAt(this.dom,t,n);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let s=this.side?this.side<0:t>0;for(let a=s?i.length-1:0;o=i[a],!(t>0?a==0:a==i.length-1||o.top<o.bottom);a+=s?-1:1);return qz(o,!s)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class OE extends qr{constructor(t){super(),this.side=t}get length(){return 0}merge(){return!1}become(t){return t instanceof OE&&t.side==this.side}split(){return new OE(this.side)}sync(){if(!this.dom){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),this.setDOM(t)}}getSide(){return this.side}domAtPos(t){return this.side>0?Ca.before(this.dom):Ca.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Gn.empty}get isHidden(){return!0}}Cd.prototype.children=Cy.prototype.children=OE.prototype.children=zse;function $7e(e,t){let n=e.dom,{children:r}=e,i=0;for(let o=0;i<r.length;i++){let s=r[i],a=o+s.length;if(!(a==o&&s.getSide()<=0)){if(t>o&&t<a&&s.dom.parentNode==n)return s.domAtPos(t-o);if(t<=o)break;o=a}}for(let o=i;o>0;o--){let s=r[o-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let o=i;o<r.length;o++){let s=r[o];if(s.dom.parentNode==n)return s.domAtPos(0)}return new Ca(n,0)}function T7e(e,t,n){let r,{children:i}=e;n>0&&t instanceof Yg&&i.length&&(r=i[i.length-1])instanceof Yg&&r.mark.eq(t.mark)?T7e(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function P7e(e,t,n){let r=null,i=-1,o=null,s=-1;function a(c,u){for(let f=0,d=0;f<c.children.length&&d<=u;f++){let h=c.children[f],p=d+h.length;p>=u&&(h.children.length?a(h,u-d):(!o||o.isHidden&&n>0)&&(p>u||d==p&&h.getSide()>0)?(o=h,s=u-d):(d<u||d==p&&h.getSide()<0&&!h.isHidden)&&(r=h,i=u-d)),d=p}}a(e,t);let l=(n<0?r:o)||r||o;return l?l.coordsAt(Math.max(0,l==r?i:s),n):SFt(e)}function SFt(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=bE(t);return n[n.length-1]||null}function oG(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const Ube=Object.create(null);function Qse(e,t,n){if(e==t)return!0;e||(e=Ube),t||(t=Ube);let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||e[o]!==t[o]))return!1;return!0}function sG(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i=="style"?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i=="style"?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function EFt(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}class jo extends qr{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,n,r,i,o,s){if(r){if(!(r instanceof jo))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),C7e(this,t,n,r?r.children.slice():[],o,s),!0}split(t){let n=new jo;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(t);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o<this.children.length;o++)n.append(this.children[o],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=t,n}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){Qse(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,n){T7e(this,t,n)}addLineDeco(t){let n=t.spec.attributes,r=t.spec.class;n&&(this.attrs=oG(n,this.attrs||{})),r&&(this.attrs=oG({class:r},this.attrs||{}))}domAtPos(t){return $7e(this,t)}reuseDOM(t){t.nodeName=="DIV"&&(this.setDOM(t),this.flags|=6)}sync(t,n){var r;this.dom?this.flags&4&&(b7e(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(sG(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,n);let i=this.dom.lastChild;for(;i&&qr.get(i)instanceof Yg;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=qr.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!bt.ios||!this.children.some(o=>o instanceof Cd))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let t=0,n;for(let r of this.children){if(!(r instanceof Cd)||/[^ -~]/.test(r.text))return null;let i=bE(r.dom);if(i.length!=1)return null;t+=i[0].width,n=i[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:n}:null}coordsAt(t,n){let r=P7e(this,t,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight<o){let s=(o-i.textHeight)/2;return{top:r.top+s,bottom:r.bottom-s,left:r.left,right:r.left}}}return r}become(t){return!1}covers(){return!0}static find(t,n){for(let r=0,i=0;r<t.children.length;r++){let o=t.children[r],s=i+o.length;if(s>=n){if(o instanceof jo)return o;if(s>n)break}i=s+o.breakAfter}return null}}class e0 extends qr{constructor(t,n,r){super(),this.widget=t,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(t,n,r,i,o,s){return r&&(!(r instanceof e0)||!this.widget.compare(r.widget)||t>0&&o<=0||n<this.length&&s<=0)?!1:(this.length=t+(r?r.length:0)+(this.length-n),!0)}domAtPos(t){return t==0?Ca.before(this.dom):Ca.after(this.dom,t==this.length)}split(t){let n=this.length-t;this.length=t;let r=new e0(this.widget,n,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return zse}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Gn.empty}domBoundsAround(){return null}become(t){return t instanceof e0&&t.widget.constructor==this.widget.constructor?(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(t,n){return this.widget.coordsAt(this.dom,t,n)}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(t){let{startSide:n,endSide:r}=this.deco;return n==r?!1:t<0?n<0:r>0}}class hu{eq(t){return!1}updateDOM(t,n){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var dl=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(dl||(dl={}));class st extends Ub{constructor(t,n,r,i){super(),this.startSide=t,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(t){return new HR(t)}static widget(t){let n=Math.max(-1e4,Math.min(1e4,t.side||0)),r=!!t.block;return n+=r&&!t.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new N0(t,n,n,r,t.widget||null,!1)}static replace(t){let n=!!t.block,r,i;if(t.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=A7e(t,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new N0(t,r,i,n,t.widget||null,!0)}static line(t){return new XR(t)}static set(t,n=!1){return Dn.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}st.none=Dn.empty;class HR extends st{constructor(t){let{start:n,end:r}=A7e(t);super(n?-1:5e8,r?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var n,r;return this==t||t instanceof HR&&this.tagName==t.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(t.class||((r=t.attrs)===null||r===void 0?void 0:r.class))&&Qse(this.attrs,t.attrs,"class")}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}HR.prototype.point=!1;class XR extends st{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof XR&&this.spec.class==t.spec.class&&Qse(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}XR.prototype.mapMode=qo.TrackBefore;XR.prototype.point=!0;class N0 extends st{constructor(t,n,r,i,o,s){super(n,r,o,t),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?qo.TrackBefore:qo.TrackAfter:qo.TrackDel}get type(){return this.startSide!=this.endSide?dl.WidgetRange:this.startSide<=0?dl.WidgetBefore:dl.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof N0&&CFt(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}N0.prototype.point=!0;function A7e(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n==null&&(n=e.inclusive),r==null&&(r=e.inclusive),{start:n??t,end:r??t}}function CFt(e,t){return e==t||!!(e&&t&&e.compare(t))}function aG(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}class jT{constructor(t,n,r,i){this.doc=t,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof e0&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new jo),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(dN(new OE(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(t&&this.content.length&&this.content[this.content.length-1]instanceof e0)&&this.getLine()}buildText(t,n,r){for(;t>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(dN(new Cd(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,t-=i,r=0}}span(t,n,r,i){this.buildText(n-t,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(t,n,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof N0){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=n-t;if(r instanceof N0)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new e0(r.widget||Zb.block,a,r));else{let l=Cy.create(r.widget||Zb.inline,a,a?0:r.startSide),c=this.atCursorPos&&!l.isEditable&&o<=i.length&&(t<n||r.startSide>0),u=!l.isEditable&&(t<n||o>i.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!c&&!l.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),c&&(f.append(dN(new OE(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(dN(l,i),o),this.atCursorPos=u,this.pendingBuffer=u?t<n||o>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=o)}static build(t,n,r,i,o){let s=new jT(t,n,r,o);return s.openEnd=Dn.spans(i,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function dN(e,t){for(let n of t)e=new Yg(n,[e],e.length);return e}class Zb extends hu{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Zb.inline=new Zb("span");Zb.block=new Zb("div");var ti=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(ti||(ti={}));const Yb=ti.LTR,Bse=ti.RTL;function R7e(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const _Ft=R7e("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),kFt=R7e("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),lG=Object.create(null),eh=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);lG[t]=n,lG[n]=-t}function D7e(e){return e<=247?_Ft[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?kFt[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const $Ft=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class _y{get dir(){return this.level%2?Bse:Yb}constructor(t,n,r){this.from=t,this.to=n,this.level=r}side(t,n){return this.dir==n==t?this.to:this.from}forward(t,n){return t==(this.dir==n)}static find(t,n,r,i){let o=-1;for(let s=0;s<t.length;s++){let a=t[s];if(a.from<=n&&a.to>=n){if(a.level==r)return s;(o<0||(i!=0?i<0?a.from<n:a.to>n:t[o].level>a.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function M7e(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!M7e(r.inner,i.inner))return!1}return!0}const Br=[];function TFt(e,t,n,r,i){for(let o=0;o<=r.length;o++){let s=o?r[o-1].to:t,a=o<r.length?r[o].from:n,l=o?256:i;for(let c=s,u=l,f=l;c<a;c++){let d=D7e(e.charCodeAt(c));d==512?d=u:d==8&&f==4&&(d=16),Br[c]=d==4?2:d,d&7&&(f=d),u=d}for(let c=s,u=l,f=l;c<a;c++){let d=Br[c];if(d==128)c<a-1&&u==Br[c+1]&&u&24?d=Br[c]=u:Br[c]=256;else if(d==64){let h=c+1;for(;h<a&&Br[h]==64;)h++;let p=c&&u==8||h<n&&Br[h]==8?f==1?1:8:256;for(let g=c;g<h;g++)Br[g]=p;c=h-1}else d==8&&f==1&&(Br[c]=1);u=d,d&7&&(f=d)}}}function PFt(e,t,n,r,i){let o=i==1?2:1;for(let s=0,a=0,l=0;s<=r.length;s++){let c=s?r[s-1].to:t,u=s<r.length?r[s].from:n;for(let f=c,d,h,p;f<u;f++)if(h=lG[d=e.charCodeAt(f)])if(h<0){for(let g=a-3;g>=0;g-=3)if(eh[g+1]==-h){let v=eh[g+2],y=v&2?i:v&4?v&1?o:i:0;y&&(Br[f]=Br[eh[g]]=y),a=g;break}}else{if(eh.length==189)break;eh[a++]=f,eh[a++]=d,eh[a++]=l}else if((p=Br[f])==2||p==1){let g=p==i;l=g?0:1;for(let v=a-3;v>=0;v-=3){let y=eh[v+2];if(y&2)break;if(g)eh[v+2]|=2;else{if(y&4)break;eh[v+2]|=4}}}}}function AFt(e,t,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:e,a=i<n.length?n[i].from:t;for(let l=s;l<a;){let c=Br[l];if(c==256){let u=l+1;for(;;)if(u==a){if(i==n.length)break;u=n[i++].to,a=i<n.length?n[i].from:t}else if(Br[u]==256)u++;else break;let f=o==1,d=(u<t?Br[u]:r)==1,h=f==d?f?1:2:r;for(let p=u,g=i,v=g?n[g-1].to:e;p>l;)p==v&&(p=n[--g].from,v=g?n[g-1].to:e),Br[--p]=h;l=u}else o=c,l++}}}function cG(e,t,n,r,i,o,s){let a=r%2?2:1;if(r%2==i%2)for(let l=t,c=0;l<n;){let u=!0,f=!1;if(c==o.length||l<o[c].from){let g=Br[l];g!=a&&(u=!1,f=g==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c<o.length&&p==o[c].from){if(f)break e;let g=o[c];if(!u)for(let v=g.to,y=c+1;;){if(v==n)break e;if(y<o.length&&o[y].from==v)v=o[y++].to;else{if(Br[v]==a)break e;break}}if(c++,d)d.push(g);else{g.from>l&&s.push(new _y(l,g.from,h));let v=g.direction==Yb!=!(h%2);uG(e,v?r+1:r,i,g.inner,g.from,g.to,s),l=g.to}p=g.to}else{if(p==n||(u?Br[p]!=a:Br[p]==a))break;p++}d?cG(e,l,p,r+1,i,d,s):l<p&&s.push(new _y(l,p,h)),l=p}else for(let l=n,c=o.length;l>t;){let u=!0,f=!1;if(!c||l>o[c-1].to){let g=Br[l-1];g!=a&&(u=!1,f=g==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(f)break e;let g=o[--c];if(!u)for(let v=g.from,y=c;;){if(v==t)break e;if(y&&o[y-1].to==v)v=o[--y].from;else{if(Br[v-1]==a)break e;break}}if(d)d.push(g);else{g.to<l&&s.push(new _y(g.to,l,h));let v=g.direction==Yb!=!(h%2);uG(e,v?r+1:r,i,g.inner,g.from,g.to,s),l=g.from}p=g.from}else{if(p==t||(u?Br[p-1]!=a:Br[p-1]==a))break;p--}d?cG(e,p,l,r+1,i,d,s):p<l&&s.push(new _y(p,l,h)),l=p}}function uG(e,t,n,r,i,o,s){let a=t%2?2:1;TFt(e,i,o,r,a),PFt(e,i,o,r,a),AFt(i,o,r,a),cG(e,i,o,t,n,r,s)}function RFt(e,t,n){if(!e)return[new _y(0,0,t==Bse?1:0)];if(t==Yb&&!n.length&&!$Ft.test(e))return N7e(e.length);if(n.length)for(;e.length>Br.length;)Br[Br.length]=256;let r=[],i=t==Yb?0:1;return uG(e,i,i,n,0,e.length,r),r}function N7e(e){return[new _y(0,e,0)]}let I7e="";function DFt(e,t,n,r,i){var o;let s=r.head-e.from,a=_y.find(t,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),l=t[a],c=l.side(i,n);if(s==c){let d=a+=i?1:-1;if(d<0||d>=t.length)return null;l=t[a=d],s=l.side(!i,n),c=l.side(i,n)}let u=zs(e.text,s,l.forward(i,n));(u<l.from||u>l.to)&&(u=c),I7e=e.text.slice(Math.min(s,u),Math.max(s,u));let f=a==(i?t.length-1:0)?null:t[a+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)<l.level?Ae.cursor(f.side(!i,n)+e.from,f.forward(i,n)?1:-1,f.level):Ae.cursor(u+e.from,l.forward(i,n)?-1:1,l.level)}function MFt(e,t,n){for(let r=t;r<n;r++){let i=D7e(e.charCodeAt(r));if(i==1)return Yb;if(i==2||i==4)return Bse}return Yb}const L7e=mt.define(),j7e=mt.define(),F7e=mt.define(),z7e=mt.define(),fG=mt.define(),Q7e=mt.define(),B7e=mt.define(),W7e=mt.define({combine:e=>e.some(t=>t)}),q7e=mt.define({combine:e=>e.some(t=>t)}),V7e=mt.define();class CS{constructor(t,n="nearest",r="nearest",i=5,o=5,s=!1){this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(t){return t.empty?this:new CS(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new CS(Ae.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const hN=jt.define({map:(e,t)=>e.map(t)});function Bl(e,t,n){let r=e.facet(z7e);r.length?r[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}const Uz=mt.define({combine:e=>e.length?e[0]:!0});let NFt=0;const x$=mt.define();class jr{constructor(t,n,r,i,o){this.id=t,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(t,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=n||{};return new jr(NFt++,t,r,i,a=>{let l=[x$.of(a)];return s&&l.push(_P.of(c=>{let u=c.plugin(a);return u?s(u):st.none})),o&&l.push(o(a)),l})}static fromClass(t,n){return jr.define(r=>new t(r),n)}}class Nq{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Bl(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(n){Bl(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Bl(t.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const U7e=mt.define(),Wse=mt.define(),_P=mt.define(),H7e=mt.define(),qse=mt.define(),X7e=mt.define();function Hbe(e,t){let n=e.state.facet(X7e);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(e):o),i=[];return Dn.spans(r,t.from,t.to,{point(){},span(o,s,a,l){let c=o-t.from,u=s-t.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,p;if(h==null&&(h=MFt(t.text,c,u)),l>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}}}}),i}const Z7e=mt.define();function Y7e(e){let t=0,n=0,r=0,i=0;for(let o of e.state.facet(Z7e)){let s=o(e);s&&(s.left!=null&&(t=Math.max(t,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:t,right:n,top:r,bottom:i}}const w$=mt.define();class tf{constructor(t,n,r,i){this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}join(t){return new tf(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,r=this;for(;n>0;n--){let i=t[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),t.splice(n-1,1)}}return t.splice(n,0,r),t}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,o=0,s=0,a=0;;i++){let l=i==t.length?null:t[i],c=s-a,u=l?l.fromB:1e9;for(;o<n.length&&n[o]<u;){let f=n[o],d=n[o+1],h=Math.max(a,f),p=Math.min(u,d);if(h<=p&&new tf(h+c,p+c,h,p).addToSet(r),d>u)break;o+=2}if(!l)return r;new tf(l.fromA,l.toA,l.fromB,l.toB).addToSet(r),s=l.toA,a=l.toB}}}class u3{constructor(t,n,r){this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=Oo.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,a,l)=>i.push(new tf(o,s,a,l))),this.changedRanges=i}static create(t,n,r){return new u3(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class Xbe extends qr{get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.compositionBarrier=st.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.setDOM(t.contentDOM),this.children=[new jo],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new tf(0,0,0,t.state.doc.length)],0,null)}update(t){var n;let r=t.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:c,toA:u})=>u<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let i=-1;this.view.inputState.composing>=0&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!WFt(t.changes,this.hasComposition)&&!t.selectionSet&&(i=t.state.selection.main.head));let o=i>-1?jFt(this.view,t.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;r=new tf(c,u,t.changes.mapPos(c,-1),t.changes.mapPos(u,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(bt.ie||bt.chrome)&&!o&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.updateDeco(),l=QFt(s,a,t.changes);return r=tf.extendWithRanges(r,l),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,t.startState.doc.length,o),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=bt.chrome||bt.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.children)s instanceof e0&&s.widget instanceof Zbe&&o.push(s.dom);i.updateGaps(o)}updateChildren(t,n,r){let i=r?r.range.addToSet(t.slice()):t,o=this.childCursor(n);for(let s=i.length-1;;s--){let a=s>=0?i[s]:null;if(!a)break;let{fromA:l,toA:c,fromB:u,toB:f}=a,d,h,p,g;if(r&&r.range.fromB<f&&r.range.toB>u){let w=jT.build(this.view.state.doc,u,r.range.fromB,this.decorations,this.dynamicDecorationMap),S=jT.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);h=w.breakAtStart,p=w.openStart,g=S.openEnd;let E=this.compositionView(r);S.breakAtStart?E.breakAfter=1:S.content.length&&E.merge(E.length,E.length,S.content[0],!1,S.openStart,0)&&(E.breakAfter=S.content[0].breakAfter,S.content.shift()),w.content.length&&E.merge(0,0,w.content[w.content.length-1],!0,0,w.openEnd)&&w.content.pop(),d=w.content.concat(E).concat(S.content)}else({content:d,breakAtStart:h,openStart:p,openEnd:g}=jT.build(this.view.state.doc,u,f,this.decorations,this.dynamicDecorationMap));let{i:v,off:y}=o.findPos(c,1),{i:O,off:m}=o.findPos(l,-1);E7e(this,O,m,v,y,d,h,p,g)}r&&this.fixCompositionDOM(r)}compositionView(t){let n=new Cd(t.text.nodeValue);n.flags|=8;for(let{deco:i}of t.marks)n=new Yg(i,[n],n.length);let r=new jo;return r.append(n,0),r}fixCompositionDOM(t){let n=(o,s)=>{s.flags|=8|(s.children.some(l=>l.flags&7)?1:0),this.markedForComposition.add(s);let a=qr.get(o);a&&a!=s&&(a.dom=null),s.setDOM(o)},r=this.childPos(t.range.fromB,1),i=this.children[r.i];n(t.line,i);for(let o=t.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],n(o>=0?t.marks[o].node:t.text,i)}updateSelection(t=!1,n=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&j5(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let s=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(a.anchor)),c=a.empty?l:this.moveToLine(this.domAtPos(a.head));if(bt.gecko&&a.empty&&!this.hasComposition&&LFt(l)){let f=document.createTextNode("");this.view.observer.ignore(()=>l.node.insertBefore(f,l.node.childNodes[l.offset]||null)),l=c=new Ca(f,0),s=!0}let u=this.view.observer.selectionRange;(s||!u.focusNode||(!LT(l.node,l.offset,u.anchorNode,u.anchorOffset)||!LT(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,a))&&(this.view.observer.ignore(()=>{bt.android&&bt.chrome&&this.dom.contains(u.focusNode)&&BFt(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=l3(this.view.root);if(f)if(a.empty){if(bt.gecko){let d=FFt(l.node,l.offset);if(d&&d!=3){let h=(d==1?x7e:w7e)(l.node,l.offset);h&&(l=new Ca(h.node,h.offset))}}f.collapse(l.node,l.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(l.node,l.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([l,c]=[c,l]),d.setEnd(c.node,c.offset),d.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(d)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(l,c)),this.impreciseAnchor=l.precise?null:new Ca(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new Ca(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&!this.compositionBarrier.size&&LT(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,r=l3(t.root),{anchorNode:i,anchorOffset:o}=t.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=jo.find(this,n.head);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,o)}moveToLine(t){let n=this.dom,r;if(t.node!=n)return t;for(let i=t.offset;!r&&i<n.childNodes.length;i++){let o=qr.get(n.childNodes[i]);o instanceof jo&&(r=o.domAtPos(0))}for(let i=t.offset-1;!r&&i>=0;i--){let o=qr.get(n.childNodes[i]);o instanceof jo&&(r=o.domAtPos(o.length))}return r?new Ca(r.node,r.offset,!0):t}nearest(t){for(let n=t;n;){let r=qr.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(t,n){let r=this.nearest(t);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(t,n)+r.posAtStart}domAtPos(t){let{i:n,off:r}=this.childCursor().findPos(t,-1);for(;n<this.children.length-1;){let i=this.children[n];if(r<i.length||i instanceof jo)break;n++,r=0}return this.children[n].domAtPos(r)}coordsAt(t,n){let r=null,i=0;for(let o=this.length,s=this.children.length-1;s>=0;s--){let a=this.children[s],l=o-a.breakAfter,c=l-a.length;if(l<t)break;c<=t&&(c<t||a.covers(-1))&&(l>t||a.covers(1))&&(!r||a instanceof jo&&!(r instanceof jo&&n>=0))&&(r=a,i=c),o=c}return r?r.coordsAt(t-i,n):null}coordsForChar(t){let{i:n,off:r}=this.childPos(t,1),i=this.children[n];if(!(i instanceof jo))return null;for(;i.children.length;){let{i:a,off:l}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=l}if(!(i instanceof Cd))return null;let o=zs(i.text,r);if(o==r)return null;let s=Xb(i.dom,r,o).getClientRects();for(let a=0;a<s.length;a++){let l=s[a];if(a==s.length-1||l.top<l.bottom&&l.left<l.right)return l}return null}measureVisibleLineHeights(t){let n=[],{from:r,to:i}=t,o=this.view.contentDOM.clientWidth,s=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==ti.LTR;for(let c=0,u=0;u<this.children.length;u++){let f=this.children[u],d=c+f.length;if(d>i)break;if(c>=r){let h=f.dom.getBoundingClientRect();if(n.push(h.height),s){let p=f.dom.lastChild,g=p?bE(p):[];if(g.length){let v=g[g.length-1],y=l?v.right-h.left:h.right-v.left;y>a&&(a=y,this.minWidth=o,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+f.breakAfter}return n}textDirectionAt(t){let{i:n}=this.childPos(t,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?ti.RTL:ti.LTR}measureTextSize(){for(let o of this.children)if(o instanceof jo){let s=o.measureTextSize();if(s)return s}let t=document.createElement("div"),n,r,i;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(t);let o=bE(t.firstChild)[0];n=t.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(t=this.length){let n=this.children.length;return n&&(t-=this.children[--n].length),new S7e(this.children,t,n)}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],s=o?o.from-1:this.length;if(s>r){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;t.push(st.replace({widget:new Zbe(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return st.set(t)}updateDeco(){let t=1,n=this.view.state.facet(_P).map(o=>(this.dynamicDecorationMap[t++]=typeof o=="function")?o(this.view):o),r=!1,i=this.view.state.facet(H7e).map((o,s)=>{let a=typeof o=="function";return a&&(r=!0),a?o(this.view):o});for(i.length&&(this.dynamicDecorationMap[t++]=r,n.push(Dn.join(i))),this.decorations=[this.compositionBarrier,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;return this.decorations}maybeCreateCompositionBarrier(){let{main:{head:t,empty:n}}=this.view.state.selection;if(!n)return!1;let r=null;for(let i of this.decorations)if(i.between(t,t,(o,s,a)=>{a.point?r=!1:a.endSide<0&&o<t&&s==t&&(r=!0)}),r===!1)break;return this.compositionBarrier=r?st.set(IFt.range(t)):st.none,!!r}clearCompositionBarrier(){this.compositionBarrier=st.none}scrollIntoView(t){if(t.isSnapshot){let c=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=c.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let c of this.view.state.facet(V7e))try{if(c(this.view,t.range,t))return!0}catch(u){Bl(this.view.state,u,"scroll handler")}let{range:n}=t,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=Y7e(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;mFt(this.view.scrollDOM,s,n.head<n.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,a),-a),Math.max(Math.min(t.yMargin,l),-l),this.view.textDirection==ti.LTR)}}const IFt=st.widget({side:-1,widget:Zb.inline});function LFt(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}class Zbe extends hu{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function G7e(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=x7e(n.focusNode,n.focusOffset),i=w7e(n.focusNode,n.focusOffset),o=r||i;if(i&&r&&i.node!=r.node){let a=qr.get(i.node);if(!a||a instanceof Cd&&a.text!=i.node.nodeValue)o=i;else if(e.docView.lastCompositionAfterCursor){let l=qr.get(r.node);!l||l instanceof Cd&&l.text!=r.node.nodeValue||(o=i)}}if(e.docView.lastCompositionAfterCursor=o!=r,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}function jFt(e,t,n){let r=G7e(e,n);if(!r)return null;let{node:i,from:o,to:s}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||e.state.doc.sliceString(r.from,r.to)!=a)return null;let l=t.invertedDesc,c=new tf(l.mapPos(o),l.mapPos(s),o,s),u=[];for(let f=i.parentNode;;f=f.parentNode){let d=qr.get(f);if(d instanceof Yg)u.push({node:f,deco:d.mark});else{if(d instanceof jo||f.nodeName=="DIV"&&f.parentNode==e.contentDOM)return{range:c,text:i,marks:u,line:f};if(f!=e.contentDOM)u.push({node:f,deco:new HR({inclusive:!0,attributes:EFt(f),tagName:f.tagName.toLowerCase()})});else return null}}}function FFt(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable=="false"?2:0)}let zFt=class{constructor(){this.changes=[]}compareRange(t,n){aG(t,n,this.changes)}comparePoint(t,n){aG(t,n,this.changes)}};function QFt(e,t,n){let r=new zFt;return Dn.compare(e,t,n,r),r.changes}function BFt(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function WFt(e,t){let n=!1;return t&&e.iterChangedRanges((r,i)=>{r<t.to&&i>t.from&&(n=!0)}),n}function qFt(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),o=t-i.from;if(i.length==0)return Ae.cursor(t);o==0?n=1:o==i.length&&(n=-1);let s=o,a=o;n<0?s=zs(i.text,o,!1):a=zs(i.text,o);let l=r(i.text.slice(s,a));for(;s>0;){let c=zs(i.text,s,!1);if(r(i.text.slice(c,s))!=l)break;s=c}for(;a<i.length;){let c=zs(i.text,a);if(r(i.text.slice(a,c))!=l)break;a=c}return Ae.range(s+i.from,a+i.from)}function VFt(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function UFt(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function Iq(e,t){return e.top<t.bottom-1&&e.bottom>t.top+1}function Ybe(e,t){return t<e.top?{top:t,left:e.left,right:e.right,bottom:e.bottom}:e}function Gbe(e,t){return t>e.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function dG(e,t,n){let r,i,o,s,a=!1,l,c,u,f;for(let p=e.firstChild;p;p=p.nextSibling){let g=bE(p);for(let v=0;v<g.length;v++){let y=g[v];i&&Iq(i,y)&&(y=Ybe(Gbe(y,i.bottom),i.top));let O=VFt(t,y),m=UFt(n,y);if(O==0&&m==0)return p.nodeType==3?Kbe(p,t,n):dG(p,t,n);if(!r||s>m||s==m&&o>O){r=p,i=y,o=O,s=m;let w=m?n<y.top?-1:1:O?t<y.left?-1:1:0;a=!w||(w>0?v<g.length-1:v>0)}O==0?n>y.bottom&&(!u||u.bottom<y.bottom)?(l=p,u=y):n<y.top&&(!f||f.top>y.top)&&(c=p,f=y):u&&Iq(u,y)?u=Gbe(u,y.bottom):f&&Iq(f,y)&&(f=Ybe(f,y.top))}}if(u&&u.bottom>=n?(r=l,i=u):f&&f.top<=n&&(r=c,i=f),!r)return{node:e,offset:0};let d=Math.max(i.left,Math.min(i.right,t));if(r.nodeType==3)return Kbe(r,d,n);if(a&&r.contentEditable!="false")return dG(r,d,n);let h=Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0);return{node:e,offset:h}}function Kbe(e,t,n){let r=e.nodeValue.length,i=-1,o=1e9,s=0;for(let a=0;a<r;a++){let l=Xb(e,a,a+1).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(u.top==u.bottom)continue;s||(s=t-u.left);let f=(u.top>n?u.top-n:n-u.bottom)-1;if(u.left-1<=t&&u.right+1>=t&&f<o){let d=t>=(u.left+u.right)/2,h=d;if((bt.chrome||bt.gecko)&&Xb(e,a).getBoundingClientRect().left==u.right&&(h=!d),f<=0)return{node:e,offset:a+(h?1:0)};i=a+(h?1:0),o=f}}}return{node:e,offset:i>-1?i:s>0?e.nodeValue.length:0}}function K7e(e,t,n,r=-1){var i,o;let s=e.contentDOM.getBoundingClientRect(),a=s.top+e.viewState.paddingTop,l,{docHeight:c}=e.viewState,{x:u,y:f}=t,d=f-a;if(d<0)return 0;if(d>c)return e.state.doc.length;for(let w=e.viewState.heightOracle.textHeight/2,S=!1;l=e.elementAtHeight(d),l.type!=dl.Text;)for(;d=r>0?l.bottom+w:l.top-w,!(d>=0&&d<=c);){if(S)return n?null:0;S=!0,r=-r}f=a+d;let h=l.from;if(h<e.viewport.from)return e.viewport.from==0?0:n?null:Jbe(e,s,l,u,f);if(h>e.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:Jbe(e,s,l,u,f);let p=e.dom.ownerDocument,g=e.root.elementFromPoint?e.root:p,v=g.elementFromPoint(u,f);v&&!e.contentDOM.contains(v)&&(v=null),v||(u=Math.max(s.left+1,Math.min(s.right-1,u)),v=g.elementFromPoint(u,f),v&&!e.contentDOM.contains(v)&&(v=null));let y,O=-1;if(v&&((i=e.docView.nearest(v))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let w=p.caretPositionFromPoint(u,f);w&&({offsetNode:y,offset:O}=w)}else if(p.caretRangeFromPoint){let w=p.caretRangeFromPoint(u,f);w&&({startContainer:y,startOffset:O}=w,(!e.contentDOM.contains(y)||bt.safari&&HFt(y,O,u)||bt.chrome&&XFt(y,O,u))&&(y=void 0))}}if(!y||!e.docView.dom.contains(y)){let w=jo.find(e.docView,h);if(!w)return d>l.top+l.height/2?l.to:l.from;({node:y,offset:O}=dG(w.dom,u,f))}let m=e.docView.nearest(y);if(!m)return null;if(m.isWidget&&((o=m.dom)===null||o===void 0?void 0:o.nodeType)==1){let w=m.dom.getBoundingClientRect();return t.y<w.top||t.y<=w.bottom&&t.x<=(w.left+w.right)/2?m.posAtStart:m.posAtEnd}else return m.localPosFromDOM(y,O)+m.posAtStart}function Jbe(e,t,n,r,i){let o=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let a=e.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(e.defaultLineHeight-a)*.5)/a);o+=l*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+KY(s,o,e.state.tabSize)}function HFt(e,t,n){let r;if(e.nodeType!=3||t!=(r=e.nodeValue.length))return!1;for(let i=e.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return Xb(e,r-1,r).getBoundingClientRect().left>n}function XFt(e,t,n){if(t!=0)return!1;for(let i=e;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=e.nodeType==1?e.getBoundingClientRect():Xb(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function hG(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type)){for(let r of n.type)if(r.to>t||r.to==t&&(r.to==n.to||r.type==dl.Text))return r}return n}function ZFt(e,t,n,r){let i=hG(e,t.head),o=!r||i.type!=dl.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(o){let s=e.dom.getBoundingClientRect(),a=e.textDirectionAt(i.from),l=e.posAtCoords({x:n==(a==ti.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(l!=null)return Ae.cursor(l,n?-1:1)}return Ae.cursor(n?i.to:i.from,n?-1:1)}function eOe(e,t,n,r){let i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),s=e.textDirectionAt(i.from);for(let a=t,l=null;;){let c=DFt(i,o,s,a,n),u=I7e;if(!c){if(i.number==(n?e.state.doc.lines:1))return a;u=`
`,i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),c=e.visualLineSide(i,!n)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function YFt(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return o=>{let s=r(o);return i==xi.Space&&(i=s),i==s}}function GFt(e,t,n,r){let i=t.head,o=n?1:-1;if(i==(n?e.state.doc.length:0))return Ae.cursor(i,t.assoc);let s=t.goalColumn,a,l=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(i,t.assoc||-1),u=e.documentTop;if(c)s==null&&(s=c.left-l.left),a=o<0?c.top:c.bottom;else{let h=e.viewState.lineBlockAt(i);s==null&&(s=Math.min(l.right-l.left,e.defaultCharacterWidth*(i-h.from))),a=(o<0?h.top:h.bottom)+u}let f=l.left+s,d=r??e.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=a+(d+h)*o,g=K7e(e,{x:f,y:p},!1,o);if(p<l.top||p>l.bottom||(o<0?g<i:g>i)){let v=e.docView.coordsForChar(g),y=!v||p<v.top?-1:1;return Ae.cursor(g,y,void 0,s)}}}function F5(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(o,s,a)=>{if(t>o&&t<s){let l=r||n||(t-o<s-t?-1:1);t=l<0?o:s,r=l}});if(!r)return t}}function Lq(e,t,n){let r=F5(e.state.facet(qse).map(i=>i(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:Ae.cursor(r,r<n.from?1:-1)}class KFt{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=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.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,bt.safari&&t.contentDOM.addEventListener("input",()=>null),bt.gecko&&p4t(t.contentDOM.ownerDocument)}handleEvent(t){!s4t(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||this.runHandlers(t.type,t)}runHandlers(t,n){let r=this.handlers[t];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=JFt(t),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,a=r[o];a&&s!=!a.handlers.length&&(i.removeEventListener(o,this.handleEvent),a=null),a||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(t.keyCode!=27&&e6e.indexOf(t.keyCode)<0&&(this.view.inputState.lastEscPress=0),bt.android&&bt.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let n;return bt.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((n=J7e.find(r=>r.keyCode==t.keyCode))&&!t.ctrlKey||e4t.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=n||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString())?!1:(this.pendingIOSKey=void 0,ES(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(t){return/^key/.test(t.type)?this.composing>0?!0:bt.safari&&!bt.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function tOe(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(i){Bl(n.state,i)}}}function JFt(e){let t=Object.create(null);function n(r){return t[r]||(t[r]={observers:[],handlers:[]})}for(let r of e){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let s=i.domEventHandlers[o];s&&n(o).handlers.push(tOe(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&n(o).observers.push(tOe(r.value,s))}}for(let r in _d)n(r).handlers.push(_d[r]);for(let r in df)n(r).observers.push(df[r]);return t}const J7e=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],e4t="dthko",e6e=[16,17,18,20,91,92,224,225],pN=6;function gN(e){return Math.max(0,e)*.7+8}function t4t(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class n4t{constructor(t,n,r,i){this.view=t,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParent=yFt(t.contentDOM),this.atoms=t.state.facet(qse).map(s=>s(t));let o=t.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(dn.allowMultipleSelections)&&r4t(t,n),this.dragging=o4t(t,n)&&i6e(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){var n;if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&t4t(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let r=0,i=0,o=((n=this.scrollParent)===null||n===void 0?void 0:n.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},s=Y7e(this.view);t.clientX-s.left<=o.left+pN?r=-gN(o.left-t.clientX):t.clientX+s.right>=o.right-pN&&(r=gN(t.clientX-o.right)),t.clientY-s.top<=o.top+pN?i=-gN(o.top-t.clientY):t.clientY+s.bottom>=o.bottom-pN&&(i=gN(t.clientY-o.bottom)),this.setScrollSpeed(r,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],o=null;if(i.empty){let s=F5(this.atoms,i.from,0);s!=i.from&&(o=Ae.cursor(s,-1))}else{let s=F5(this.atoms,i.from,-1),a=F5(this.atoms,i.to,1);(s!=i.from||a!=i.to)&&(o=Ae.range(i.from==i.anchor?s:a,i.from==i.head?s:a))}o&&(n||(n=t.ranges.slice()),n[r]=o)}return n?Ae.create(n,t.mainIndex):t}select(t){let{view:n}=this,r=this.skipAtoms(this.style.get(t,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function r4t(e,t){let n=e.state.facet(L7e);return n.length?n[0](t):bt.mac?t.metaKey:t.ctrlKey}function i4t(e,t){let n=e.state.facet(j7e);return n.length?n[0](t):bt.mac?!t.altKey:!t.ctrlKey}function o4t(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=l3(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o<i.length;o++){let s=i[o];if(s.left<=t.clientX&&s.right>=t.clientX&&s.top<=t.clientY&&s.bottom>=t.clientY)return!0}return!1}function s4t(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=qr.get(n))&&r.ignoreEvent(t))return!1;return!0}const _d=Object.create(null),df=Object.create(null),t6e=bt.ie&&bt.ie_version<15||bt.ios&&bt.webkit_version<604;function a4t(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),n6e(e,n.value)},50)}function n6e(e,t){let{state:n}=e,r,i=1,o=n.toText(t),s=o.lines==n.selection.ranges.length;if(pG!=null&&n.selection.ranges.every(l=>l.empty)&&pG==o.toString()){let l=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let f=n.toText((s?o.line(i++).text:t)+n.lineBreak);return{changes:{from:u.from,insert:f},range:Ae.cursor(c.from+f.length)}})}else s?r=n.changeByRange(l=>{let c=o.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:Ae.cursor(l.from+c.length)}}):r=n.replaceSelection(o);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}df.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft};_d.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&(e.inputState.lastEscPress=Date.now()),!1);df.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")};df.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};_d.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(F7e))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=u4t(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new n4t(e,t,n,r)),r&&e.observer.ignore(()=>v7e(e.contentDOM));let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}return!1};function nOe(e,t,n,r){if(r==1)return Ae.cursor(t,n);if(r==2)return qFt(e.state,t,n);{let i=jo.find(e.docView,t),o=e.state.doc.lineAt(i?i.posAtEnd:t),s=i?i.posAtStart:o.from,a=i?i.posAtEnd:o.to;return a<e.state.doc.length&&a==o.to&&a++,Ae.range(s,a)}}let r6e=(e,t)=>e>=t.top&&e<=t.bottom,rOe=(e,t,n)=>r6e(t,n)&&e>=n.left&&e<=n.right;function l4t(e,t,n,r){let i=jo.find(e.docView,t);if(!i)return 1;let o=t-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&rOe(n,r,s))return-1;let a=i.coordsAt(o,1);return a&&rOe(n,r,a)?1:s&&r6e(r,s)?-1:1}function iOe(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:l4t(e,n,t.clientX,t.clientY)}}const c4t=bt.ie&&bt.ie_version<=11;let oOe=null,sOe=0,aOe=0;function i6e(e){if(!c4t)return e.detail;let t=oOe,n=aOe;return oOe=e,aOe=Date.now(),sOe=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(sOe+1)%3:1}function u4t(e,t){let n=iOe(e,t),r=i6e(t),i=e.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,a){let l=iOe(e,o),c,u=nOe(e,l.pos,l.bias,r);if(n.pos!=l.pos&&!s){let f=nOe(e,n.pos,n.bias,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d<u.from?Ae.range(d,h):Ae.range(h,d)}return s?i.replaceRange(i.main.extend(u.from,u.to)):a&&r==1&&i.ranges.length>1&&(c=f4t(i,l.pos))?c:a?i.addRange(u):Ae.create([u])}}}function f4t(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return Ae.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}_d.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.nearest(t.target);if(i&&i.isWidget){let o=i.posAtStart,s=o+i.length;(o>=n.to||s<=n.from)&&(n=Ae.range(o,s))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove"),!1};_d.dragend=e=>(e.inputState.draggedContent=null,!1);function lOe(e,t,n,r){if(!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:o}=e.inputState,s=r&&o&&i4t(e,t)?{from:o.from,to:o.to}:null,a={from:i,insert:n},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}_d.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&lOe(e,t,r.filter(s=>s!=null).join(e.state.lineBreak),!1)};for(let s=0;s<n.length;s++){let a=new FileReader;a.onerror=o,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[s]=a.result),o()},a.readAsText(n[s])}return!0}else{let r=t.dataTransfer.getData("Text");if(r)return lOe(e,t,r,!0),!0}return!1};_d.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=t6e?null:t.clipboardData;return n?(n6e(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(a4t(e),!1)};function d4t(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function h4t(e){let t=[],n=[],r=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let i=-1;for(let{from:o}of e.selection.ranges){let s=e.doc.lineAt(o);s.number>i&&(t.push(s.text),n.push({from:s.from,to:Math.min(e.doc.length,s.to+1)})),i=s.number}r=!0}return{text:t.join(e.lineBreak),ranges:n,linewise:r}}let pG=null;_d.copy=_d.cut=(e,t)=>{let{text:n,ranges:r,linewise:i}=h4t(e.state);if(!n&&!i)return!1;pG=i?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=t6e?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(d4t(e,n),!1)};const o6e=bp.define();function s6e(e,t){let n=[];for(let r of e.facet(B7e)){let i=r(e,t);i&&n.push(i)}return n?e.update({effects:n,annotations:o6e.of(!0)}):null}function a6e(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=s6e(e.state,t);n?e.dispatch(n):e.update([])}},10)}df.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),a6e(e)};df.blur=e=>{e.observer.clearSelectionRange(),a6e(e)};df.compositionstart=df.compositionupdate=e=>{e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0,e.docView.maybeCreateCompositionBarrier()&&(e.update([]),e.docView.clearCompositionBarrier()))};df.compositionend=e=>{e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,bt.chrome&&bt.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50)};df.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};_d.beforeinput=(e,t)=>{var n;let r;if(bt.chrome&&bt.android&&(r=J7e.find(i=>i.inputType==t.inputType))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let i=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>i+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return bt.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),bt.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>df.compositionend(e,t),20),!1};const cOe=new Set;function p4t(e){cOe.has(e)||(cOe.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const uOe=["pre-wrap","normal","pre-line","break-spaces"];class g4t{constructor(t){this.lineWrapping=t,this.doc=Gn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(t,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-t-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return uOe.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let r=0;r<t.length;r++){let i=t[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(t,n,r,i,o,s){let a=uOe.indexOf(t)>-1,l=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,l){this.heightSamples={};for(let c=0;c<s.length;c++){let u=s[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return l}}class m4t{constructor(t,n){this.from=t,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class xh{constructor(t,n,r,i,o){this.from=t,this.length=n,this.top=r,this.height=i,this._content=o}get type(){return typeof this._content=="number"?dl.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 N0?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new xh(this.from,this.length+t.length,this.top,this.height+t.height,n)}}var ai=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(ai||(ai={}));const z5=.001;class hl{constructor(t,n,r=2){this.length=t,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t,n){this.height!=n&&(Math.abs(this.height-n)>z5&&(t.heightChanged=!0),this.height=n)}replace(t,n,r){return hl.of(r)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,r,i){let o=this,s=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:f}=i[a],d=o.lineAt(l,ai.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:o.lineAt(c,ai.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,l<d.from&&(d=o.lineAt(l,ai.ByPosNoHeight,r,0,0));u+=d.from-l,l=d.from;let p=Vse.build(r.setDoc(s),t,u,f);o=o.replace(l,c,p)}return o.updateHeight(r,0)}static empty(){return new $c(0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,o=0;for(;;)if(n==r)if(i>o*2){let a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(o>i*2){let a=t[r];a.break?t.splice(r,1,a.left,null,a.right):t.splice(r,1,a.left,a.right),r+=2+a.break,o-=a.size}else break;else if(i<o){let a=t[n++];a&&(i+=a.size)}else{let a=t[--r];a&&(o+=a.size)}let s=0;return t[n-1]==null?(s=1,n--):t[n]==null&&(s=1,r++),new y4t(hl.of(t.slice(0,n)),s,hl.of(t.slice(r)))}}hl.prototype.size=1;class l6e extends hl{constructor(t,n,r){super(t,n),this.deco=r}blockAt(t,n,r,i){return new xh(i,this.length,r,this.height,this.deco||0)}lineAt(t,n,r,i,o){return this.blockAt(0,r,i,o)}forEachLine(t,n,r,i,o,s){t<=o+this.length&&n>=o&&s(this.blockAt(0,r,i,o))}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(t,i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class $c extends l6e{constructor(t,n){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,n,r,i){return new xh(i,this.length,r,this.height,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof $c||i instanceof Ts&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Ts?i=new $c(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):hl.of(r)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(t,i.heights[i.index++]):(r||this.outdated)&&this.setHeight(t,Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ts extends hl{constructor(t){super(t,0)}heightMetrics(t,n){let r=t.doc.lineAt(n).number,i=t.doc.lineAt(n+this.length).number,o=i-r+1,s,a=0;if(t.lineWrapping){let l=Math.min(this.height,t.lineHeight*o);s=l/o,this.length>o+1&&(a=(this.height-l)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:a}}blockAt(t,n,r,i){let{firstLine:o,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(t<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-r)/this.height))*this.length)),u=n.doc.lineAt(c),f=a+u.length*l,d=Math.max(r,t-f/2);return new xh(u.from,u.length,d,f,0)}else{let c=Math.max(0,Math.min(s-o,Math.floor((t-r)/a))),{from:u,length:f}=n.doc.line(o+c);return new xh(u,f,r+a*c,a,0)}}lineAt(t,n,r,i,o){if(n==ai.ByHeight)return this.blockAt(t,r,i,o);if(n==ai.ByPosNoHeight){let{from:h,to:p}=r.doc.lineAt(t);return new xh(h,p-h,0,0,0)}let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(r,o),c=r.doc.lineAt(t),u=a+c.length*l,f=c.number-s,d=i+a*f+l*(c.from-o-f);return new xh(c.from,c.length,Math.max(i,Math.min(d,i+this.height-u)),u,0)}forEachLine(t,n,r,i,o,s){t=Math.max(t,o),n=Math.min(n,o+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(r,o);for(let u=t,f=i;u<=n;){let d=r.doc.lineAt(u);if(u==t){let p=d.number-a;f+=l*p+c*(t-o-p)}let h=l+c*d.length;s(new xh(d.from,d.length,f,h,0)),f+=h,u=d.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let o=r[r.length-1];o instanceof Ts?r[r.length-1]=new Ts(o.length+i):r.push(null,new Ts(i-1))}if(t>0){let o=r[0];o instanceof Ts?r[0]=new Ts(t+o.length):r.unshift(new Ts(t-1),null)}return hl.of(r)}decomposeLeft(t,n){n.push(new Ts(t-1),null)}decomposeRight(t,n){n.push(null,new Ts(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&s.push(new Ts(i.from-n-1).updateHeight(t,n));a<=o&&i.more;){let u=t.doc.lineAt(a).length;s.length&&s.push(null);let f=i.heights[i.index++];l==-1?l=f:Math.abs(f-l)>=z5&&(l=-2);let d=new $c(u,f);d.outdated=!1,s.push(d),a+=u+1}a<=o&&s.push(null,new Ts(o-a).updateHeight(t,a));let c=hl.of(s);return(l<0||Math.abs(c.height-this.height)>=z5||Math.abs(l-this.heightMetrics(t,n).perLine)>=z5)&&(t.heightChanged=!0),c}else(r||this.outdated)&&(this.setHeight(t,t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class y4t extends hl{constructor(t,n,r){super(t.length+n+r.length,t.height+r.height,n|(t.outdated||r.outdated?2:0)),this.left=t,this.right=r,this.size=t.size+r.size}get break(){return this.flags&1}blockAt(t,n,r,i){let o=r+this.left.height;return t<o?this.left.blockAt(t,n,r,i):this.right.blockAt(t,n,o,i+this.left.length+this.break)}lineAt(t,n,r,i,o){let s=i+this.left.height,a=o+this.left.length+this.break,l=n==ai.ByHeight?t<s:t<a,c=l?this.left.lineAt(t,n,r,i,o):this.right.lineAt(t,n,r,s,a);if(this.break||(l?c.to<a:c.from>a))return c;let u=n==ai.ByPosNoHeight?ai.ByPosNoHeight:ai.ByPos;return l?c.join(this.right.lineAt(a,u,r,s,a)):this.left.lineAt(a,u,r,i,o).join(c)}forEachLine(t,n,r,i,o,s){let a=i+this.left.height,l=o+this.left.length+this.break;if(this.break)t<l&&this.left.forEachLine(t,n,r,i,o,s),n>=l&&this.right.forEachLine(t,n,r,a,l,s);else{let c=this.lineAt(l,ai.ByPos,r,i,o);t<c.from&&this.left.forEachLine(t,c.from-1,r,i,o,s),c.to>=t&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,s)}}replace(t,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(t,n,r),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-i,n-i,r));let o=[];t>0&&this.decomposeLeft(t,o);let s=o.length;for(let a of r)o.push(a);if(t>0&&fOe(o,s-1),n<this.length){let a=o.length;this.decomposeRight(n,o),fOe(o,a)}return hl.of(o)}decomposeLeft(t,n){let r=this.left.length;if(t<=r)return this.left.decomposeLeft(t,n);n.push(this.left),this.break&&(r++,t>=r&&n.push(null)),t>r&&this.right.decomposeLeft(t-r,n)}decomposeRight(t,n){let r=this.left.length,i=r+this.break;if(t>=i)return this.right.decomposeRight(t-i,n);t<r&&this.left.decomposeRight(t,n),this.break&&t<i&&n.push(null),n.push(this.right)}balanced(t,n){return t.size>2*n.size||n.size>2*t.size?hl.of(this.break?[t,null,n]:[t,n]):(this.left=t,this.right=n,this.height=t.height+n.height,this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,r=!1,i){let{left:o,right:s}=this,a=n+o.length+this.break,l=null;return i&&i.from<=n+o.length&&i.more?l=o=o.updateHeight(t,n,r,i):o.updateHeight(t,n,r),i&&i.from<=a+s.length&&i.more?l=s=s.updateHeight(t,a,r,i):s.updateHeight(t,a,r),l?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function fOe(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof Ts&&(r=e[t+1])instanceof Ts&&e.splice(t-1,3,new Ts(n.length+1+r.length))}const v4t=5;class Vse{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof $c?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new $c(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,r){if(t<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,o=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let s=n-t;r.block?this.addBlock(new l6e(s,i,r)):(s||o||i>=v4t)&&this.addLineDeco(i,o,s)}else n>t&&this.span(t,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:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTo<t&&((this.writtenTo<t-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new $c(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,n){let r=new Ts(n-t);return this.oracle.doc.lineAt(t).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof $c)return t;let n=new $c(0,-1);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,t),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof $c)&&!this.isCovered?this.nodes.push(new $c(0,-1)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=t;for(let i of this.nodes)i instanceof $c&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(t,n,r,i){let o=new Vse(r,t);return Dn.spans(n,r,i,o,0),o.finish(r)}}function b4t(e,t,n){let r=new O4t;return Dn.compare(e,t,n,r,0),r.changes}class O4t{constructor(){this.changes=[]}compareRange(){}comparePoint(t,n,r,i){(t<n||r&&r.heightRelevant||i&&i.heightRelevant)&&aG(t,n,this.changes,5)}}function x4t(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),s=Math.min(i.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let c=e.parentNode;c&&c!=r.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();o=Math.max(o,d.left),s=Math.min(s,d.right),a=Math.max(a,d.top),l=c==e.parentNode?d.bottom:Math.min(l,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:o-n.left,right:Math.max(o,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}}function w4t(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class jq{constructor(t,n,r){this.from=t,this.to=n,this.size=r}static same(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.size!=o.size)return!1}return!0}draw(t,n){return st.replace({widget:new S4t(this.size*(n?t.scaleY:t.scaleX),n)}).range(this.from,this.to)}}class S4t extends hu{constructor(t,n){super(),this.size=t,this.vertical=n}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class dOe{constructor(t){this.state=t,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.scrollTop=0,this.scrolledToBottom=!0,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=hOe,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ti.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(Wse).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new g4t(n),this.stateDeco=t.facet(_P).filter(r=>typeof r!="function"),this.heightMap=hl.empty().applyChanges(this.stateDeco,Gn.empty,this.heightOracle.setDoc(t.doc),[new tf(0,0,0,t.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=st.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!t.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);t.push(new mN(o,s))}}this.viewports=t.sort((r,i)=>r.from-i.from),this.scaler=this.heightMap.height<=7e6?hOe:new _4t(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(this.scaler.scale==1?t:S$(t,this.scaler))})}update(t,n=null){this.state=t.state;let r=this.stateDeco;this.stateDeco=this.state.facet(_P).filter(u=>typeof u!="function");let i=t.changedRanges,o=tf.extendWithRanges(i,b4t(r,this.stateDeco,t?t.changes:Oo.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=s&&(t.flags|=2),a?(this.scrollAnchorPos=t.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=o.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.head<l.from||n.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=!t.changes.empty||t.flags&2||l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,this.updateForViewport(),c&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(q7e)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let n=t.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?ti.RTL:ti.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:w,scaleY:S}=y7e(n,a);(w>.005&&Math.abs(this.scaleX-w)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=w,this.scaleY=S,c|=8,s=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=t.scrollDOM.clientWidth,c|=8);let h=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=O7e(t.scrollDOM);let p=(this.printing?w4t:x4t)(n,this.paddingTop),g=p.top-this.pixelViewport.top,v=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let O=a.width;if((this.contentDOMWidth!=O||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=t.scrollDOM.clientHeight,c|=8),l){let w=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(w)&&(s=!0),s||i.lineWrapping&&Math.abs(O-this.contentDOMWidth)>i.charWidth){let{lineHeight:S,charWidth:E,textHeight:C}=t.docView.measureTextSize();s=S>0&&i.refresh(o,S,E,C,O/E,w),s&&(t.docView.minWidth=0,c|=8)}g>0&&v>0?u=Math.max(g,v):g<0&&v<0&&(u=Math.min(g,v)),i.heightChanged=!1;for(let S of this.viewports){let E=S.from==this.viewport.from?w:t.docView.measureVisibleLineHeights(S);this.heightMap=(s?hl.empty().applyChanges(this.stateDeco,Gn.empty,this.heightOracle,[new tf(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new m4t(S.from,E))}i.heightChanged&&(c|=2)}let m=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return m&&(this.viewport=this.getViewport(u,this.scrollTarget)),this.updateForViewport(),(c&2||m)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,t)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let r=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new mN(i.lineAt(s-r*1e3,ai.ByHeight,o,0,0).from,i.lineAt(a+(1-r)*1e3,ai.ByHeight,o,0,0).to);if(n){let{head:c}=n.range;if(c<l.from||c>l.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,ai.ByPos,o,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<l.from?d=f.top:d=f.bottom-u,l=new mN(i.lineAt(d-1e3/2,ai.ByHeight,o,0,0).from,i.lineAt(d+u+1e3/2,ai.ByHeight,o,0,0).to)}}return l}mapViewport(t,n){let r=n.mapPos(t.from,-1),i=n.mapPos(t.to,1);return new mN(this.heightMap.lineAt(r,ai.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,ai.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(t,ai.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(n,ai.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:a}=this;return(t==0||i<=s-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||o>=a+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o<a+2*1e3}mapLineGaps(t,n){if(!t.length||n.empty)return t;let r=[];for(let i of t)n.touchesRange(i.from,i.to)||r.push(new jq(n.mapPos(i.from),n.mapPos(i.to),i.size));return r}ensureLineGaps(t,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,o=i>>1,s=i<<1;if(this.defaultTextDirection!=ti.LTR&&!r)return[];let a=[],l=(c,u,f,d)=>{if(u-c<o)return;let h=this.state.selection.main,p=[h.from];h.empty||p.push(h.to);for(let v of p)if(v>c&&v<u){l(c,v-10,f,d),l(v+10,u,f,d);return}let g=C4t(t,v=>v.from>=f.from&&v.to<=f.to&&Math.abs(v.from-c)<o&&Math.abs(v.to-u)<o&&!p.some(y=>v.from<y&&v.to>y));if(!g){if(u<f.to&&n&&r&&n.visibleRanges.some(v=>v.from<=u&&v.to>=u)){let v=n.moveToLineBoundary(Ae.cursor(u),!1,!0).head;v>c&&(u=v)}g=new jq(c,u,this.gapSize(f,c,u,d))}a.push(g)};for(let c of this.viewportLines){if(c.length<s)continue;let u=E4t(c.from,c.to,this.stateDeco);if(u.total<s)continue;let f=this.scrollTarget?this.scrollTarget.range.head:null,d,h;if(r){let p=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,g,v;if(f!=null){let y=vN(u,f),O=((this.visibleBottom-this.visibleTop)/2+p)/c.height;g=y-O,v=y+O}else g=(this.visibleTop-c.top-p)/c.height,v=(this.visibleBottom-c.top+p)/c.height;d=yN(u,g),h=yN(u,v)}else{let p=u.total*this.heightOracle.charWidth,g=i*this.heightOracle.charWidth,v,y;if(f!=null){let O=vN(u,f),m=((this.pixelViewport.right-this.pixelViewport.left)/2+g)/p;v=O-m,y=O+m}else v=(this.pixelViewport.left-g)/p,y=(this.pixelViewport.right+g)/p;d=yN(u,v),h=yN(u,y)}d>c.from&&l(c.from,d,c,u),h<c.to&&l(h,c.to,c,u)}return a}gapSize(t,n,r,i){let o=vN(i,r)-vN(i,n);return this.heightOracle.lineWrapping?t.height*o:i.total*this.heightOracle.charWidth*o}updateLineGaps(t){jq.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=st.set(t.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];Dn.spans(t,this.viewport.from,this.viewport.to,{span(i,o){n.push({from:i,to:o})},point(){}},20);let r=n.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=n[o].from||i.to!=n[o].to);return this.visibleRanges=n,r?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||S$(this.heightMap.lineAt(t,ai.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return S$(this.heightMap.lineAt(this.scaler.fromDOM(t),ai.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return S$(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}let mN=class{constructor(t,n){this.from=t,this.to=n}};function E4t(e,t,n){let r=[],i=e,o=0;return Dn.spans(n,e,t,{span(){},point(s,a){s>i&&(r.push({from:i,to:s}),o+=s-i),i=a}},20),i<t&&(r.push({from:i,to:t}),o+=t-i),{total:o,ranges:r}}function yN({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let i=0;;i++){let{from:o,to:s}=t[i],a=s-o;if(r<=a)return o+r;r-=a}}function vN(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function C4t(e,t){for(let n of e)if(t(n))return n}const hOe={toDOM(e){return e},fromDOM(e){return e},scale:1};class _4t{constructor(t,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,ai.ByPos,t,0,0).top,u=n.lineAt(l,ai.ByPos,t,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=s+(a.top-o)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),o=a.bottom}toDOM(t){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||t<o.top)return i+(t-r)*this.scale;if(t<=o.bottom)return o.domTop+(t-o.top);r=o.bottom,i=o.domBottom}}fromDOM(t){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||t<o.domTop)return r+(t-i)/this.scale;if(t<=o.domBottom)return o.top+(t-o.domTop);r=o.bottom,i=o.domBottom}}}function S$(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new xh(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(i=>S$(i,t)):e._content)}const bN=mt.define({combine:e=>e.join(" ")}),gG=mt.define({combine:e=>e.indexOf(!0)>-1}),mG=Xg.newName(),c6e=Xg.newName(),u6e=Xg.newName(),f6e={"&light":"."+c6e,"&dark":"."+u6e};function yG(e,t,n){return new Xg(t,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return e;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):e+" "+r}})}const k4t=yG("."+mG,{"&":{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},".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":{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:"#444"},".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",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&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},"&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-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"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".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"}},f6e),E$="";class $4t{constructor(t,n){this.points=t,this.text="",this.lineSeparator=n.facet(dn.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=E$}readRange(t,n){if(!t)return this;let r=t.parentNode;for(let i=t;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let s=i.nextSibling;if(s==n)break;let a=qr.get(i),l=qr.get(s);(a&&l?a.breakAfter:(a?a.breakAfter:c3(i))||c3(s)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>o)&&this.lineBreak(),i=s}return this.findPointBefore(r,n),this}readTextNode(t){let n=t.nodeValue;for(let r of this.points)r.node==t&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,a;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(a=i.exec(n))&&(o=a.index,s=a[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==t&&l.pos>this.text.length&&(l.pos-=s-1);r=o+s}}readNode(t){if(t.cmIgnore)return;let n=qr.get(t),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(t,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let r of this.points)r.node==t&&t.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(t,n){for(let r of this.points)(t.nodeType==3?r.node==t:t.contains(r.node))&&(r.pos=this.text.length+(T4t(t,r.node,r.offset)?n:0))}}function T4t(e,t,n){for(;;){if(!t||n<Zg(t))return!1;if(t==e)return!0;n=Hb(t)+1,t=t.parentNode}}class pOe{constructor(t,n){this.node=t,this.offset=n,this.pos=-1}}class P4t{constructor(t,n,r,i){this.typeOver=i,this.bounds=null,this.text="";let{impreciseHead:o,impreciseAnchor:s}=t.docView;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=t.docView.domBoundsAround(n,r,0))){let a=o||s?[]:D4t(t),l=new $4t(a,t.state);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=M4t(a,this.bounds.from)}else{let a=t.observer.selectionRange,l=o&&o.node==a.focusNode&&o.offset==a.focusOffset||!tG(t.contentDOM,a.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!tG(t.contentDOM,a.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=t.viewport;if((bt.ios||bt.chrome)&&t.state.selection.main.empty&&l!=c&&(u.from>0||u.to<t.state.doc.length)){let f=Math.min(l,c),d=Math.max(l,c),h=u.from-f,p=u.to-d;(h==0||h==1||f==0)&&(p==0||p==-1||d==t.state.doc.length)&&(l=0,c=t.state.doc.length)}this.newSel=Ae.single(c,l)}}}function d6e(e,t){let n,{newSel:r}=t,i=e.state.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:s,to:a}=t.bounds,l=i.from,c=null;(o===8||bt.android&&t.text.length<a-s)&&(l=i.to,c="end");let u=R4t(e.state.doc.sliceString(s,a,E$),t.text,l-s,c);u&&(bt.chrome&&o==13&&u.toB==u.from+2&&t.text.slice(u.from,u.toB)==E$+E$&&u.toB--,n={from:s+u.from,to:s+u.toA,insert:Gn.of(t.text.slice(u.from,u.toB).split(E$))})}else r&&(!e.hasFocus&&e.state.facet(Uz)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:(bt.mac||bt.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Ae.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Gn.of([" "])}):bt.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
 `&&e.lineWrapping&&(r&&(r=Ae.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Gn.of([" "])}),n){if(bt.ios&&e.inputState.flushIOSKey(n)||bt.android&&(n.to==i.to&&(n.from==i.from||n.from==i.from-1&&e.state.sliceDoc(n.from,i.from)==" ")&&n.insert.length==1&&n.insert.lines==2&&ES(e.contentDOM,"Enter",13)||(n.from==i.from-1&&n.to==i.to&&n.insert.length==0||o==8&&n.insert.length<n.to-n.from&&n.to>i.head)&&ES(e.contentDOM,"Backspace",8)||n.from==i.from&&n.to==i.to+1&&n.insert.length==0&&ES(e.contentDOM,"Delete",46)))return!0;let s=n.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a,l=()=>a||(a=A4t(e,n,r));return e.state.facet(Q7e).some(c=>c(e,n.from,n.to,s,l))||e.dispatch(l()),!0}else if(r&&!r.main.eq(i)){let s=!1,a="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(s=!0),a=e.inputState.lastSelectionOrigin),e.dispatch({selection:r,scrollIntoView:s,userEvent:a}),!0}else return!1}function A4t(e,t,n){let r,i=e.state,o=i.selection.main;if(t.from>=o.from&&t.to<=o.to&&t.to-t.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let a=o.from<t.from?i.sliceDoc(o.from,t.from):"",l=o.to>t.to?i.sliceDoc(t.to,o.to):"";r=i.replaceSelection(e.state.toText(a+t.insert.sliceString(0,void 0,e.state.lineBreak)+l))}else{let a=i.changes(t),l=n&&n.main.to<=a.newLength?n.main:void 0;if(i.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=o.to&&t.to>=o.to-10){let c=e.state.sliceDoc(t.from,t.to),u,f=n&&G7e(e,n.main.head);if(f){let p=t.insert.length-(t.to-t.from);u={from:f.from,to:f.to-p}}else u=e.state.doc.lineAt(o.head);let d=o.to-t.to,h=o.to-o.from;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:a,range:l||p.map(a)};let g=p.to-d,v=g-c.length;if(p.to-p.from!=h||e.state.sliceDoc(v,g)!=c||p.to>=u.from&&p.from<=u.to)return{range:p};let y=i.changes({from:v,to:g,insert:t.insert}),O=p.to-o.to;return{changes:y,range:l?Ae.range(Math.max(0,l.anchor+O),Math.max(0,l.head+O)):p.map(y)}})}else r={changes:a,selection:l&&i.selection.replaceRange(l)}}let s="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=".compose",e.inputState.compositionFirstChange&&(s+=".start",e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function R4t(e,t,n,r){let i=Math.min(e.length,t.length),o=0;for(;o<i&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==i&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;if(r=="end"){let l=Math.max(0,o-Math.min(s,a));n-=s+l-o}if(s<o&&e.length<t.length){let l=n<=o&&n>=s?o-n:0;o-=l,a=o+(a-s),s=o}else if(a<o){let l=n<=o&&n>=a?o-n:0;o-=l,s=o+(s-a),a=o}return{from:o,toA:s,toB:a}}function D4t(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=e.observer.selectionRange;return n&&(t.push(new pOe(n,r)),(i!=n||o!=r)&&t.push(new pOe(i,o))),t}function M4t(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?Ae.single(n+t,r+t):null}const N4t={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Fq=bt.ie&&bt.ie_version<=11;class I4t{constructor(t){this.view=t,this.active=!1,this.selectionRange=new vFt,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=t.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(bt.ie&&bt.ie_version<=11||bt.ios&&t.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),Fq&&(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(t.scrollDOM)),this.addWindowListeners(this.win=t.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(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){t.type=="change"&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,r)=>n!=t[r]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Uz)?r.root.activeElement!=this.dom:!j5(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(bt.ie&&bt.ie_version<=11||bt.android&&bt.chrome)&&!r.state.selection.main.empty&&i.focusNode&&LT(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=bt.safari&&t.root.nodeType==11&&pFt(this.dom.ownerDocument)==this.dom&&L4t(this.view)||l3(t.root);if(!n||this.selectionRange.eq(n))return!1;let r=j5(this.dom,n);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&OFt(this.dom,n)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(t,n){this.selectionRange.set(t.node,t.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&t<this.scrollTargets.length&&this.scrollTargets[t]==r?t++:n||(n=this.scrollTargets.slice(0,t)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(t<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,t)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,N4t),Fq&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Fq&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,n){var r;if(!this.delayedAndroidKey){let i=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&ES(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.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 t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of t){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:t,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&j5(this.dom,this.selectionRange);if(t<0&&!i)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new P4t(this.view,t,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=d6e(this.view,n);return this.view.state==r&&this.view.update([]),i}readMutation(t){let n=this.view.docView.nearest(t.target);if(!n||n.ignoreMutation(t))return null;if(n.markDirty(t.type=="attributes"),t.type=="attributes"&&(n.flags|=4),t.type=="childList"){let r=gOe(n,t.previousSibling||t.target.previousSibling,-1),i=gOe(n,t.nextSibling||t.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener("change",this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener("change",this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var t,n,r;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function gOe(e,t,n){for(;t;){let r=qr.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function L4t(e){let t=null;function n(l){l.preventDefault(),l.stopImmediatePropagation(),t=l.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",n,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),!t)return null;let r=t.startContainer,i=t.startOffset,o=t.endContainer,s=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor);return LT(a.node,a.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}class Ve{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.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){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),t.parent&&t.parent.appendChild(this.dom);let{dispatch:n}=t;this.dispatchTransactions=t.dispatchTransactions||n&&(r=>r.forEach(i=>n(i,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=t.root||bFt(t.parent)||document,this.viewState=new dOe(t.state||dn.create(t)),t.scrollTo&&t.scrollTo.is(hN)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(x$).map(r=>new Nq(r));for(let r of this.plugins)r.update(this);this.observer=new I4t(this),this.inputState=new KFt(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Xbe(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...t){let n=t.length==1&&t[0]instanceof Co?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let d of t){if(d.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=d.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,a=0,l=null;t.some(d=>d.annotation(o6e))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=s6e(o,s),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(u=null)):this.observer.clear(),o.facet(dn.phrases)!=this.state.facet(dn.phrases))return this.setState(o);i=u3.create(this,o,t),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of t){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new CS(h.empty?h:Ae.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(hN)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=f3.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(w$)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(bN)!=i.state.facet(bN)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(fG))try{d(i)}catch(h){Bl(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!d6e(this,u)&&c.force&&ES(this.contentDOM,c.key,c.keyCode)})}setState(t){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=t;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new dOe(t),this.plugins=t.facet(x$).map(r=>new Nq(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new Xbe(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(x$),r=t.state.facet(x$);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new Nq(o));else{let a=this.plugins[s];a.mustUpdate=t,i.push(a)}}for(let o of this.plugins)o.mustUpdate!=t&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=t;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let n=t.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Bl(this.state,r,"doc view update listener")}}}measure(t=!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,t&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(O7e(r))o=-1,s=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);o=h.from,s=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return Bl(this.state,p),mOe}}),f=u3.create(this,this.state,[]),d=!1;f.flags|=l,n?n.flags|=l: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]!=mOe)try{let p=c[h];p.write&&p.write(u[h],this)}catch(p){Bl(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,s=-1;continue}else{let p=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-s;if(p>1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(fG))a(n)}get themeClasses(){return mG+" "+(this.state.facet(gG)?u6e:c6e)+" "+this.state.facet(bN)}updateAttrs(){let t=yOe(this,U7e,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Uz)?"true":"false",class:"cm-content",style:`${bt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),yOe(this,Wse,n);let r=this.observer.ignore(()=>{let i=sG(this.contentDOM,this.contentAttrs,n),o=sG(this.dom,this.editorAttrs,t);return i||o});return this.editorAttrs=t,this.contentAttrs=n,r}showAnnouncements(t){let n=!0;for(let r of t)for(let i of r.effects)if(i.is(Ve.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(w$);let t=this.state.facet(Ve.cspNonce);Xg.mount(this.root,this.styleModules.concat(k4t).reverse(),t?{nonce:t}: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(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===t.key){this.measureRequests[n]=t;return}}this.measureRequests.push(t)}}plugin(t){let n=this.pluginMap.get(t);return(n===void 0||n&&n.spec!=t)&&this.pluginMap.set(t,n=this.plugins.find(r=>r.spec==t)||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(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,r){return Lq(this,t,eOe(this,t,n,r))}moveByGroup(t,n){return Lq(this,t,eOe(this,t,n,r=>YFt(this,t.head,r)))}visualLineSide(t,n){let r=this.bidiSpans(t),i=this.textDirectionAt(t.from),o=r[n?r.length-1:0];return Ae.cursor(o.side(n,i)+t.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(t,n,r=!0){return ZFt(this,t,n,r)}moveVertically(t,n,r){return Lq(this,t,GFt(this,t,n,r))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){return this.readMeasured(),K7e(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let r=this.docView.coordsAt(t,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(t),o=this.bidiSpans(i),s=o[_y.find(o,t-i.from,-1,n)];return qz(r,s.dir==ti.LTR==n>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(W7e)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>j4t)return N7e(t.length);let n=this.textDirectionAt(t.from),r;for(let o of this.bidiCache)if(o.from==t.from&&o.dir==n&&(o.fresh||M7e(o.isolates,r=Hbe(this,t))))return o.order;r||(r=Hbe(this,t));let i=RFt(t.text,n,r);return this.bidiCache.push(new f3(t.from,t.to,n,r,!0,i)),i}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||bt.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{v7e(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let t of this.plugins)t.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(t,n={}){return hN.of(new CS(typeof t=="number"?Ae.cursor(t):t,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(t);return hN.of(new CS(Ae.cursor(r.from),"start","start",r.top-t,n,!0))}static domEventHandlers(t){return jr.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return jr.define(()=>({}),{eventObservers:t})}static theme(t,n){let r=Xg.newName(),i=[bN.of(r),w$.of(yG(`.${r}`,t))];return n&&n.dark&&i.push(gG.of(!0)),i}static baseTheme(t){return Ks.lowest(w$.of(yG("."+mG,t,f6e)))}static findFromDOM(t){var n;let r=t.querySelector(".cm-content"),i=r&&qr.get(r)||qr.get(t);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}Ve.styleModule=w$;Ve.inputHandler=Q7e;Ve.scrollHandler=V7e;Ve.focusChangeEffect=B7e;Ve.perLineTextDirection=W7e;Ve.exceptionSink=z7e;Ve.updateListener=fG;Ve.editable=Uz;Ve.mouseSelectionStyle=F7e;Ve.dragMovesSelection=j7e;Ve.clickAddsSelectionRange=L7e;Ve.decorations=_P;Ve.outerDecorations=H7e;Ve.atomicRanges=qse;Ve.bidiIsolatedRanges=X7e;Ve.scrollMargins=Z7e;Ve.darkTheme=gG;Ve.cspNonce=mt.define({combine:e=>e.length?e[0]:""});Ve.contentAttributes=Wse;Ve.editorAttributes=U7e;Ve.lineWrapping=Ve.contentAttributes.of({class:"cm-lineWrapping"});Ve.announce=jt.define();const j4t=4096,mOe={};class f3{constructor(t,n,r,i,o,s){this.from=t,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(t,n){if(n.empty&&!t.some(o=>o.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:ti.LTR;for(let o=Math.max(0,t.length-10);o<t.length;o++){let s=t[o];s.dir==i&&!n.touchesRange(s.from,s.to)&&r.push(new f3(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return r}}function yOe(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let o=r[i],s=typeof o=="function"?o(e):o;s&&oG(s,n)}return n}const F4t=bt.mac?"mac":bt.windows?"win":bt.linux?"linux":"key";function z4t(e,t){const n=e.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,a;for(let l=0;l<n.length-1;++l){const c=n[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))o=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))t=="mac"?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),a&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function ON(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n!==!1&&t.shiftKey&&(e="Shift-"+e),e}const Q4t=Ks.default(Ve.domEventHandlers({keydown(e,t){return p6e(h6e(t.state),e,t,"editor")}})),wi=mt.define({enables:Q4t}),vOe=new WeakMap;function h6e(e){let t=e.facet(wi),n=vOe.get(t);return n||vOe.set(t,n=q4t(t.reduce((r,i)=>r.concat(i),[]))),n}function B4t(e,t,n){return p6e(h6e(e.state),t,e,n)}let gy=null;const W4t=4e3;function q4t(e,t=F4t){let n=Object.create(null),r=Object.create(null),i=(s,a)=>{let l=r[s];if(l==null)r[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,a,l,c,u)=>{var f,d;let h=n[s]||(n[s]=Object.create(null)),p=a.split(/ (?!$)/).map(y=>z4t(y,t));for(let y=1;y<p.length;y++){let O=p.slice(0,y).join(" ");i(O,!0),h[O]||(h[O]={preventDefault:!0,stopPropagation:!1,run:[m=>{let w=gy={view:m,prefix:O,scope:s};return setTimeout(()=>{gy==w&&(gy=null)},W4t),!0}]})}let g=p.join(" ");i(g,!1);let v=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())||[]});l&&v.run.push(l),c&&(v.preventDefault=!0),u&&(v.stopPropagation=!0)};for(let s of e){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in u)u[f].run.push(s.any)}let l=s[t]||s.key;if(l)for(let c of a)o(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}function p6e(e,t,n,r){let i=hFt(t),o=Rs(i,0),s=Lu(o)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;gy&&gy.view==n&&gy.scope==r&&(a=gy.prefix+" ",e6e.indexOf(t.keyCode)<0&&(c=!0,gy=null));let f=new Set,d=v=>{if(v){for(let y of v.run)if(!f.has(y)&&(f.add(y),y(n,t)))return v.stopPropagation&&(u=!0),!0;v.preventDefault&&(v.stopPropagation&&(u=!0),c=!0)}return!1},h=e[r],p,g;return h&&(d(h[a+ON(i,t,!s)])?l=!0:s&&(t.altKey||t.metaKey||t.ctrlKey)&&!(bt.windows&&t.ctrlKey&&t.altKey)&&(p=M0[t.keyCode])&&p!=i?(d(h[a+ON(p,t,!0)])||t.shiftKey&&(g=CP[t.keyCode])!=i&&g!=p&&d(h[a+ON(g,t,!1)]))&&(l=!0):s&&t.shiftKey&&d(h[a+ON(i,t,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&t.stopPropagation(),l}class ZR{constructor(t,n,r,i,o){this.className=t,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=g6e(t);return[new ZR(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return V4t(t,n,r)}}function g6e(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==ti.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function bOe(e,t,n){let r=Ae.cursor(t);return{from:Math.max(n.from,e.moveToLineBoundary(r,!1,!0).from),to:Math.min(n.to,e.moveToLineBoundary(r,!0,!0).from),type:dl.Text}}function V4t(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==ti.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=g6e(e),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),h=hG(e,r),p=hG(e,i),g=h.type==dl.Text?h:null,v=p.type==dl.Text?p:null;if(g&&(e.lineWrapping||h.widgetLineBreaks)&&(g=bOe(e,r,g)),v&&(e.lineWrapping||p.widgetLineBreaks)&&(v=bOe(e,i,v)),g&&v&&g.from==v.from)return O(m(n.from,n.to,g));{let S=g?m(n.from,null,g):w(h,!1),E=v?m(null,n.to,v):w(p,!0),C=[];return(g||h).to<(v||p).from-(g&&v?1:0)||h.widgetLineBreaks>1&&S.bottom+e.defaultLineHeight/2<E.top?C.push(y(f,S.bottom,d,E.top)):S.bottom<E.top&&e.elementAtHeight((S.bottom+E.top)/2).type==dl.Text&&(S.bottom=E.top=(S.bottom+E.top)/2),O(S).concat(C).concat(O(E))}function y(S,E,C,k){return new ZR(t,S-l.left,E-l.top-.01,C-S,k-E+.01)}function O({top:S,bottom:E,horizontal:C}){let k=[];for(let P=0;P<C.length;P+=2)k.push(y(C[P],S,C[P+1],E));return k}function m(S,E,C){let k=1e9,P=-1e9,D=[];function M(T,N,j,z,W){let F=e.coordsAtPos(T,T==C.to?-2:2),q=e.coordsAtPos(j,j==C.from?2:-2);!F||!q||(k=Math.min(F.top,q.top,k),P=Math.max(F.bottom,q.bottom,P),W==ti.LTR?D.push(o&&N?f:F.left,o&&z?d:q.right):D.push(!o&&z?f:q.left,!o&&N?d:F.right))}let L=S??C.from,A=E??C.to;for(let T of e.visibleRanges)if(T.to>L&&T.from<A)for(let N=Math.max(T.from,L),j=Math.min(T.to,A);;){let z=e.state.doc.lineAt(N);for(let W of e.bidiSpans(z)){let F=W.from+z.from,q=W.to+z.from;if(F>=j)break;q>N&&M(Math.max(F,N),S==null&&F<=L,Math.min(q,j),E==null&&q>=A,W.dir)}if(N=z.to+1,N>=j)break}return D.length==0&&M(L,S==null,A,E==null,e.textDirection),{top:k,bottom:P,horizontal:D}}function w(S,E){let C=a.top+(E?S.top:S.bottom);return{top:C,bottom:C,horizontal:[]}}}function U4t(e,t){return e.constructor==t.constructor&&e.eq(t)}class H4t{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(Q5)!=t.state.facet(Q5)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,r=t.facet(Q5);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:n}=this.view;(t!=this.scaleX||n!=this.scaleY)&&(this.scaleX=t,this.scaleY=n,this.dom.style.transform=`scale(${1/t}, ${1/n})`)}draw(t){if(t.length!=this.drawn.length||t.some((n,r)=>!U4t(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of t)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Q5=mt.define();function m6e(e){return[jr.define(t=>new H4t(t,e)),Q5.of(e)]}const y6e=!bt.ios,xE=mt.define({combine(e){return Op(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function Use(e={}){return[xE.of(e),Z4t,Y4t,G4t,q7e.of(!0)]}function X4t(e){return e.facet(xE)}function v6e(e){return e.startState.facet(xE)!=e.state.facet(xE)}const Z4t=m6e({above:!0,markers(e){let{state:t}=e,n=t.facet(xE),r=[];for(let i of t.selection.ranges){let o=i==t.selection.main;if(i.empty?!o||y6e:n.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:Ae.cursor(i.head,i.head>i.anchor?-1:1);for(let l of ZR.forRange(e,s,a))r.push(l)}}return r},update(e,t){e.transactions.some(r=>r.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=v6e(e);return n&&OOe(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){OOe(t.state,e)},class:"cm-cursorLayer"});function OOe(e,t){t.style.animationDuration=e.facet(xE).cursorBlinkRate+"ms"}const Y4t=m6e({above:!1,markers(e){return e.state.selection.ranges.map(t=>t.empty?[]:ZR.forRange(e,"cm-selectionBackground",t)).reduce((t,n)=>t.concat(n))},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||v6e(e)},class:"cm-selectionLayer"}),vG={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};y6e&&(vG[".cm-line"].caretColor="transparent !important",vG[".cm-content"]={caretColor:"transparent !important"});const G4t=Ks.highest(Ve.theme(vG)),b6e=jt.define({map(e,t){return e==null?null:t.mapPos(e)}}),C$=di.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,r)=>r.is(b6e)?r.value:n,e)}}),K4t=jr.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(C$);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(C$)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(C$),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(C$)!=e&&this.view.dispatch({effects:b6e.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function O6e(){return[C$,K4t]}function xOe(e,t,n,r,i){t.lastIndex=0;for(let o=e.iterRange(n,r),s=n,a;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;a=t.exec(o.value);)i(s+a.index,a)}function J4t(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class e7t{constructor(t){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let f=r(a,l,c);f&&u(c,c+a[0].length,f)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(t){let n=new Ol,r=n.add.bind(n);for(let{from:i,to:o}of J4t(t,this.maxLength))xOe(t.state.doc,this.regexp,i,o,(s,a)=>this.addMatch(a,t,s,r));return n.finish()}updateDeco(t,n){let r=1e9,i=-1;return t.docChanged&&t.changes.iterChanges((o,s,a,l)=>{l>t.view.viewport.from&&a<t.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),t.viewportChanged||i-r>1e3?this.createDeco(t.view):i>-1?this.updateRange(t.view,n.map(t.changes),r,i):n}updateRange(t,n,r,i){for(let o of t.visibleRanges){let s=Math.max(o.from,r),a=Math.min(o.to,i);if(a>s){let l=t.state.doc.lineAt(s),c=l.to<a?t.state.doc.lineAt(a):l,u=Math.max(o.from,l.from),f=Math.min(o.to,c.to);if(this.boundary){for(;s>l.from;s--)if(this.boundary.test(l.text[s-1-l.from])){u=s;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){f=a;break}}let d=[],h,p=(g,v,y)=>d.push(y.range(g,v));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.index<f-l.from;)this.addMatch(h,t,h.index+l.from,p);else xOe(t.state.doc,this.regexp,u,f,(g,v)=>this.addMatch(v,t,g,p));n=n.update({filterFrom:u,filterTo:f,filter:(g,v)=>g<u||v>f,add:d})}}return n}}const bG=/x/.unicode!=null?"gu":"g",t7t=new RegExp(`[\0-\b
--­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF￹-￼]`,bG),n7t={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let zq=null;function r7t(){var e;if(zq==null&&typeof document<"u"&&document.body){let t=document.body.style;zq=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return zq||!1}const B5=mt.define({combine(e){let t=Op(e,{render:null,specialChars:t7t,addSpecialChars:null});return(t.replaceTabs=!r7t())&&(t.specialChars=new RegExp("	|"+t.specialChars.source,bG)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,bG)),t}});function Hse(e={}){return[B5.of(e),i7t()]}let wOe=null;function i7t(){return wOe||(wOe=jr.fromClass(class{constructor(e){this.view=e,this.decorations=st.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(B5)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new e7t({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,o=Rs(t[0],0);if(o==9){let s=i.lineAt(r),a=n.state.tabSize,l=Ed(s.text,a,r-s.from);return st.replace({widget:new l7t((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=st.replace({widget:new a7t(e,o)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(B5);e.startState.facet(B5)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const o7t="•";function s7t(e){return e>=32?o7t:e==10?"␤":String.fromCharCode(9216+e)}class a7t extends hu{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=s7t(this.code),r=t.state.phrase("Control character")+" "+(n7t[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class l7t extends hu{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="	",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function x6e(){return u7t}const c7t=st.line({class:"cm-activeLine"}),u7t=jr.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(c7t.range(i.from)),t=i.from)}return st.set(n)}},{decorations:e=>e.decorations});class f7t extends hu{constructor(t){super(),this.content=t}toDOM(){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}coordsAt(t){let n=t.firstChild?bE(t.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(t.parentNode),i=qz(n[0],r.direction!="rtl"),o=parseInt(r.lineHeight);return i.bottom-i.top>o*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+o}:i}ignoreEvent(){return!1}}function Xse(e){return jr.fromClass(class{constructor(t){this.view=t,this.placeholder=e?st.set([st.widget({widget:new f7t(e),side:1}).range(0)]):st.none}get decorations(){return this.view.state.doc.length?st.none:this.placeholder}},{decorations:t=>t.decorations})}const OG=2e3;function d7t(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),o=[];if(t.off>OG||n.off>OG||t.col<0||n.col<0){let s=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let l=r;l<=i;l++){let c=e.doc.line(l);c.length<=a&&o.push(Ae.range(c.from+s,c.to+a))}}else{let s=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let l=r;l<=i;l++){let c=e.doc.line(l),u=KY(c.text,s,e.tabSize,!0);if(u<0)o.push(Ae.cursor(c.to));else{let f=KY(c.text,a,e.tabSize);o.push(Ae.range(c.from+u,c.from+f))}}}return o}function h7t(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function SOe(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,o=i>OG?-1:i==r.length?h7t(e,t.clientX):Ed(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function p7t(e,t){let n=SOe(e,t),r=e.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let a=SOe(e,i);if(!a)return r;let l=d7t(e.state,n,a);return l.length?s?Ae.create(l.concat(r.ranges)):Ae.create(l):r}}:null}function w6e(e){let t=(e==null?void 0:e.eventFilter)||(n=>n.altKey&&n.button==0);return Ve.mouseSelectionStyle.of((n,r)=>t(r)?p7t(n,r):null)}const g7t={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},m7t={style:"cursor: crosshair"};function y7t(e={}){let[t,n]=g7t[e.key||"Alt"],r=jr.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==t||n(i))},keyup(i){(i.keyCode==t||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,Ve.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?m7t:null})]}const pk="-10000px";class S6e{constructor(t,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=t.state.facet(n),this.tooltips=this.input.filter(s=>s);let o=null;this.tooltipViews=this.tooltips.map(s=>o=r(s,o))}update(t,n){var r;let i=t.state.facet(this.facet),o=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(t);return!1}let s=[],a=n?[]:null;for(let l=0;l<o.length;l++){let c=o[l],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)s[l]=this.createTooltipView(c,l?s[l-1]:null),a&&(a[l]=!!c.above);else{let f=s[l]=this.tooltipViews[u];a&&(a[l]=n[u]),f.update&&f.update(t)}}}for(let l of this.tooltipViews)s.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return n&&(a.forEach((l,c)=>n[c]=l),n.length=a.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function v7t(e={}){return W5.of(e)}function b7t(e){let{win:t}=e;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const W5=mt.define({combine:e=>{var t,n,r;return{position:bt.ios?"absolute":((t=e.find(i=>i.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=e.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||b7t}}}),EOe=new WeakMap,Zse=jr.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(W5);this.position=t.position,this.parent=t.parent,this.classes=e.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 S6e(e,Yse,(n,r)=>this.createTooltip(n,r),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(),e.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 e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(W5);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.insertBefore(i,r)}return n.dom.style.position=this.position,n.dom.style.top=pk,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(e=r.destroy)===null||e===void 0||e.call(r);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect(),t=1,n=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(bt.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==pk&&i.style.left=="0px"){let o=i.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,n=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:n}=this.view.viewState);return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map((i,o)=>{let s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(W5).tooltipSpace(this.view),scaleX:t,scaleY:n,makeAbsolute:r}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{editor:n,space:r,scaleX:i,scaleY:o}=e,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:u}=c,f=e.pos[a],d=e.size[a];if(!f||f.bottom<=Math.max(n.top,r.top)||f.top>=Math.min(n.bottom,r.bottom)||f.right<Math.max(n.left,r.left)-.1||f.left>Math.min(n.right,r.right)+.1){u.style.top=pk;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,g=d.right-d.left,v=(t=EOe.get(c))!==null&&t!==void 0?t:d.bottom-d.top,y=c.offset||x7t,O=this.view.textDirection==ti.LTR,m=d.width>r.right-r.left?O?r.left:r.right-d.width:O?Math.min(f.left-(h?14:0)+y.x,r.right-g):Math.max(r.left,f.left-g+(h?14:0)-y.x),w=this.above[a];!l.strictSide&&(w?f.top-(d.bottom-d.top)-y.y<r.top:f.bottom+(d.bottom-d.top)+y.y>r.bottom)&&w==r.bottom-f.bottom>f.top-r.top&&(w=this.above[a]=!w);let S=(w?f.top-r.top:r.bottom-f.bottom)-p;if(S<v&&c.resize!==!1){if(S<this.view.defaultLineHeight){u.style.top=pk;continue}EOe.set(c,v),u.style.height=(v=S)/o+"px"}else u.style.height&&(u.style.height="");let E=w?f.top-v-p-y.y:f.bottom+p+y.y,C=m+g;if(c.overlap!==!0)for(let k of s)k.left<C&&k.right>m&&k.top<E+v&&k.bottom>E&&(E=w?k.top-v-2-p:k.bottom+p+2);if(this.position=="absolute"?(u.style.top=(E-e.parent.top)/o+"px",u.style.left=(m-e.parent.left)/i+"px"):(u.style.top=E/o+"px",u.style.left=m/i+"px"),h){let k=f.left+(O?y.x:-y.x)-(m+14-7);h.style.left=k/i+"px"}c.overlap!==!0&&s.push({left:m,top:E,right:C,bottom:E+v}),u.classList.toggle("cm-tooltip-above",w),u.classList.toggle("cm-tooltip-below",!w),c.positioned&&c.positioned(e.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 e of this.manager.tooltipViews)e.dom.style.top=pk}},{eventObservers:{scroll(){this.maybeMeasure()}}}),O7t=Ve.baseTheme({".cm-tooltip":{zIndex:100,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:`${7*2}px`,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"}}}),x7t={x:0,y:0},Yse=mt.define({enables:[Zse,O7t]}),d3=mt.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class Hz{static create(t){return new Hz(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new S6e(t,d3,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(t,n){let r=t.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let r of this.manager.tooltipViews){let i=r[t];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)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")}}const w7t=Yse.compute([d3],e=>{let t=e.facet(d3);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:Hz.create,above:t[0].above,arrow:t.some(n=>n.arrow)}});class S7t{constructor(t,n,r,i,o){this.view=t,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){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 t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:t,lastMove:n}=this,r=t.docView.nearest(n.target);if(!r)return;let i,o=1;if(r instanceof Cy)i=r.posAtStart;else{if(i=t.posAtCoords(n),i==null)return;let a=t.coordsAtPos(i);if(!a||n.y<a.top||n.y>a.bottom||n.x<a.left-t.defaultCharacterWidth||n.x>a.right+t.defaultCharacterWidth)return;let l=t.bidiSpans(t.state.doc.lineAt(i)).find(u=>u.from<=i&&u.to>=i),c=l&&l.dir==ti.RTL?-1:1;o=n.x<a.left?-c:c}let s=this.source(t,i,o);if(s!=null&&s.then){let a=this.pending={pos:i};s.then(l=>{this.pending==a&&(this.pending=null,l&&!(Array.isArray(l)&&!l.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(l)?l:[l])}))},l=>Bl(t.state,l,"hover tooltip"))}else s&&!(Array.isArray(s)&&!s.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])})}get tooltip(){let t=this.view.plugin(Zse),n=t?t.manager.tooltips.findIndex(r=>r.create==Hz.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,r;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:o}=this;if(i.length&&o&&!E7t(o.dom,t)||this.pending){let{pos:s}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:s;(s==a?this.view.posAtCoords(this.lastMove)!=s:!C7t(this.view,s,a,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length){let{tooltip:r}=this;r&&r.dom.contains(t.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=r=>{t.removeEventListener("mouseleave",n),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const xN=4;function E7t(e,t){let n=e.getBoundingClientRect();return t.clientX>=n.left-xN&&t.clientX<=n.right+xN&&t.clientY>=n.top-xN&&t.clientY<=n.bottom+xN}function C7t(e,t,n,r,i,o){let s=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>r||s.right<r||s.top>i||Math.min(s.bottom,a)<i)return!1;let l=e.posAtCoords({x:r,y:i},!1);return l>=t&&l<=n}function Gse(e,t={}){let n=jt.define(),r=di.define({create(){return[]},update(i,o){if(i.length&&(t.hideOnChange&&(o.docChanged||o.selection)?i=[]:t.hideOn&&(i=i.filter(s=>!t.hideOn(o,s))),o.docChanged)){let s=[];for(let a of i){let l=o.changes.mapPos(a.pos,-1,qo.TrackDel);if(l!=null){let c=Object.assign(Object.create(null),a);c.pos=l,c.end!=null&&(c.end=o.changes.mapPos(c.end)),s.push(c)}}i=s}for(let s of o.effects)s.is(n)&&(i=s.value),s.is(_7t)&&(i=[]);return i},provide:i=>d3.from(i)});return[r,jr.define(i=>new S7t(i,e,r,n,t.hoverTime||300)),w7t]}function E6e(e,t){let n=e.plugin(Zse);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const _7t=jt.define(),COe=mt.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function kP(e,t){let n=e.plugin(C6e),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const C6e=jr.fromClass(class{constructor(e){this.input=e.state.facet(I0),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(COe);this.top=new wN(e,!0,t.topContainer),this.bottom=new wN(e,!1,t.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(e){let t=e.state.facet(COe);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new wN(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new wN(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(I0);if(n!=this.input){let r=n.filter(l=>l),i=[],o=[],s=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(e.view),a.push(u)):(u=this.panels[c],u.update&&u.update(e)),i.push(u),(u.top?o:s).push(u)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Ve.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});let wN=class{constructor(t,n,r){this.view=t,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,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 t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=_Oe(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=_Oe(t)}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 t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}};function _Oe(e){let t=e.nextSibling;return e.remove(),t}const I0=mt.define({enables:C6e});class np extends Ub{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}np.prototype.elementClass="";np.prototype.toDOM=void 0;np.prototype.mapMode=qo.TrackBefore;np.prototype.startSide=np.prototype.endSide=-1;np.prototype.point=!0;const q5=mt.define(),k7t={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Dn.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},FT=mt.define();function _6e(e){return[k6e(),FT.of(Object.assign(Object.assign({},k7t),e))]}const xG=mt.define({combine:e=>e.some(t=>t)});function k6e(e){let t=[$7t];return e&&e.fixed===!1&&t.push(xG.of(!0)),t}const $7t=jr.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(FT).map(t=>new $Oe(e,t));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!e.state.facet(xG),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(xG)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let n=Dn.iter(this.view.state.facet(q5),this.view.viewport.from),r=[],i=this.gutters.map(o=>new T7t(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let a of o.type)if(a.type==dl.Text&&s){wG(n,r,a.from);for(let l of i)l.line(this.view,a,r);s=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(o.type==dl.Text){wG(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(FT),n=e.state.facet(FT),r=e.docChanged||e.heightChanged||e.viewportChanged||!Dn.eq(e.startState.facet(q5),e.state.facet(q5),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let i of this.gutters)i.update(e)&&(r=!0);else{r=!0;let i=[];for(let o of n){let s=t.indexOf(o);s<0?i.push(new $Oe(this.view,o)):(this.gutters[s].update(e),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>Ve.scrollMargins.of(t=>{let n=t.plugin(e);return!n||n.gutters.length==0||!n.fixed?null:t.textDirection==ti.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}})});function kOe(e){return Array.isArray(e)?e:[e]}function wG(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class T7t{constructor(t,n,r){this.gutter=t,this.height=r,this.i=0,this.cursor=Dn.iter(t.markers,n.from)}addElement(t,n,r){let{gutter:i}=this,o=(n.top-this.height)/t.scaleY,s=n.height/t.scaleY;if(this.i==i.elements.length){let a=new $6e(t,s,o,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(t,s,o,r);this.height=n.bottom,this.i++}line(t,n,r){let i=[];wG(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(t,n,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(t,n,i)}widget(t,n){let r=this.gutter.config.widgetMarker(t,n.widget,n);r&&this.addElement(t,n,[r])}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class $Oe{constructor(t,n){this.view=t,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 r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let l=o.getBoundingClientRect();s=(l.top+l.bottom)/2}else s=i.clientY;let a=t.lineBlockAtHeight(s-t.documentTop);n.domEventHandlers[r](t,a,i)&&i.preventDefault()});this.markers=kOe(n.markers(t)),n.initialSpacer&&(this.spacer=new $6e(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=kOe(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],t);i!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[i])}let r=t.view.viewport;return!Dn.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class $6e{constructor(t,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,r,i)}update(t,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),P7t(this.markers,i)||this.setMarkers(t,i)}setMarkers(t,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let a=s,l=o<n.length?n[o++]:null,c=!1;if(l){let u=l.elementClass;u&&(r+=" "+u);for(let f=s;f<this.markers.length;f++)if(this.markers[f].compare(l)){a=f,c=!0;break}}else a=this.markers.length;for(;s<a;){let u=this.markers[s++];if(u.toDOM){u.destroy(i);let f=i.nextSibling;i.remove(),i=f}}if(!l)break;l.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(l.toDOM(t),i)),c&&s++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function P7t(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}const A7t=mt.define(),Bw=mt.define({combine(e){return Op(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,n){let r=Object.assign({},t);for(let i in n){let o=r[i],s=n[i];r[i]=o?(a,l,c)=>o(a,l,c)||s(a,l,c):s}return r}})}});class Qq extends np{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function Bq(e,t){return e.state.facet(Bw).formatNumber(t,e.state)}const R7t=FT.compute([Bw],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(A7t)},lineMarker(t,n,r){return r.some(i=>i.toDOM)?null:new Qq(Bq(t,t.state.doc.lineAt(n.from).number))},widgetMarker:()=>null,lineMarkerChange:t=>t.startState.facet(Bw)!=t.state.facet(Bw),initialSpacer(t){return new Qq(Bq(t,TOe(t.state.doc.lines)))},updateSpacer(t,n){let r=Bq(n.view,TOe(n.view.state.doc.lines));return r==t.number?t:new Qq(r)},domEventHandlers:e.facet(Bw).domEventHandlers}));function T6e(e={}){return[Bw.of(e),k6e(),R7t]}function TOe(e){let t=9;for(;t<e;)t=t*10+9;return t}const D7t=new class extends np{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},M7t=q5.compute(["selection"],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(D7t.range(i)))}return Dn.of(t)});function P6e(){return M7t}let N7t=0;class Xf{constructor(t,n,r){this.set=t,this.base=n,this.modified=r,this.id=N7t++}static define(t){if(t!=null&&t.base)throw new Error("Can not derive from a modified tag");let n=new Xf([],null,[]);if(n.set.push(n),t)for(let r of t.set)n.set.push(r);return n}static defineModifier(){let t=new h3;return n=>n.modified.indexOf(t)>-1?n:h3.get(n.base||n,n.modified.concat(t).sort((r,i)=>r.id-i.id))}}let I7t=0;class h3{constructor(){this.instances=[],this.id=I7t++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(a=>a.base==t&&L7t(n,a.modified));if(r)return r;let i=[],o=new Xf(i,t,n);for(let a of n)a.instances.push(o);let s=j7t(n);for(let a of t.set)if(!a.modified.length)for(let l of s)i.push(h3.get(a,l));return o}}function L7t(e,t){return e.length==t.length&&e.every((n,r)=>n==t[r])}function j7t(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((n,r)=>r.length-n.length)}function YO(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(o.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new p3(r,s,l>0?o.slice(0,l):null);t[c]=u.sort(t[c])}}return A6e.add(t)}const A6e=new Zt;class p3{constructor(t,n,r,i){this.tags=t,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}p3.empty=new p3([],2,null);function R6e(e,t){let n=Object.create(null);for(let o of e)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let s of o.tag)n[s.id]=o.class;let{scope:r,all:i=null}=t||{};return{style:o=>{let s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function F7t(e,t){let n=null;for(let r of e){let i=r.style(t);i&&(n=n?n+" "+i:i)}return n}function z7t(e,t,n,r=0,i=e.length){let o=new Q7t(r,Array.isArray(t)?t:[t],n);o.highlightRange(e.cursor(),r,i,"",o.highlighters),o.flush(i)}class Q7t{constructor(t,n,r){this.at=t,this.highlighters=n,this.span=r,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,r,i,o){let{type:s,from:a,to:l}=t;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=i,u=B7t(t)||p3.empty,f=F7t(o,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),c),u.opaque)return;let d=t.tree&&t.tree.prop(Zt.mounted);if(d&&d.overlay){let h=t.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(v=>!v.scope||v.scope(d.tree.type)),g=t.firstChild();for(let v=0,y=a;;v++){let O=v<d.overlay.length?d.overlay[v]:null,m=O?O.from+a:l,w=Math.max(n,y),S=Math.min(r,m);if(w<S&&g)for(;t.from<S&&(this.highlightRange(t,w,S,i,o),this.startSpan(Math.min(S,t.to),c),!(t.to>=m||!t.nextSibling())););if(!O||m>r)break;y=O.to+a,y>n&&(this.highlightRange(h.cursor(),Math.max(n,O.from+a),Math.min(r,y),"",p),this.startSpan(Math.min(r,y),c))}g&&t.parent()}else if(t.firstChild()){d&&(i="");do if(!(t.to<=n)){if(t.from>=r)break;this.highlightRange(t,n,r,i,o),this.startSpan(Math.min(r,t.to),c)}while(t.nextSibling());t.parent()}}}function B7t(e){let t=e.type.prop(A6e);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const lt=Xf.define,SN=lt(),ry=lt(),POe=lt(ry),AOe=lt(ry),iy=lt(),EN=lt(iy),Wq=lt(iy),sh=lt(),Vv=lt(sh),th=lt(),nh=lt(),SG=lt(),gk=lt(SG),CN=lt(),K={comment:SN,lineComment:lt(SN),blockComment:lt(SN),docComment:lt(SN),name:ry,variableName:lt(ry),typeName:POe,tagName:lt(POe),propertyName:AOe,attributeName:lt(AOe),className:lt(ry),labelName:lt(ry),namespace:lt(ry),macroName:lt(ry),literal:iy,string:EN,docString:lt(EN),character:lt(EN),attributeValue:lt(EN),number:Wq,integer:lt(Wq),float:lt(Wq),bool:lt(iy),regexp:lt(iy),escape:lt(iy),color:lt(iy),url:lt(iy),keyword:th,self:lt(th),null:lt(th),atom:lt(th),unit:lt(th),modifier:lt(th),operatorKeyword:lt(th),controlKeyword:lt(th),definitionKeyword:lt(th),moduleKeyword:lt(th),operator:nh,derefOperator:lt(nh),arithmeticOperator:lt(nh),logicOperator:lt(nh),bitwiseOperator:lt(nh),compareOperator:lt(nh),updateOperator:lt(nh),definitionOperator:lt(nh),typeOperator:lt(nh),controlOperator:lt(nh),punctuation:SG,separator:lt(SG),bracket:gk,angleBracket:lt(gk),squareBracket:lt(gk),paren:lt(gk),brace:lt(gk),content:sh,heading:Vv,heading1:lt(Vv),heading2:lt(Vv),heading3:lt(Vv),heading4:lt(Vv),heading5:lt(Vv),heading6:lt(Vv),contentSeparator:lt(sh),list:lt(sh),quote:lt(sh),emphasis:lt(sh),strong:lt(sh),link:lt(sh),monospace:lt(sh),strikethrough:lt(sh),inserted:lt(),deleted:lt(),changed:lt(),invalid:lt(),meta:CN,documentMeta:lt(CN),annotation:lt(CN),processingInstruction:lt(CN),definition:Xf.defineModifier(),constant:Xf.defineModifier(),function:Xf.defineModifier(),standard:Xf.defineModifier(),local:Xf.defineModifier(),special:Xf.defineModifier()};R6e([{tag:K.link,class:"tok-link"},{tag:K.heading,class:"tok-heading"},{tag:K.emphasis,class:"tok-emphasis"},{tag:K.strong,class:"tok-strong"},{tag:K.keyword,class:"tok-keyword"},{tag:K.atom,class:"tok-atom"},{tag:K.bool,class:"tok-bool"},{tag:K.url,class:"tok-url"},{tag:K.labelName,class:"tok-labelName"},{tag:K.inserted,class:"tok-inserted"},{tag:K.deleted,class:"tok-deleted"},{tag:K.literal,class:"tok-literal"},{tag:K.string,class:"tok-string"},{tag:K.number,class:"tok-number"},{tag:[K.regexp,K.escape,K.special(K.string)],class:"tok-string2"},{tag:K.variableName,class:"tok-variableName"},{tag:K.local(K.variableName),class:"tok-variableName tok-local"},{tag:K.definition(K.variableName),class:"tok-variableName tok-definition"},{tag:K.special(K.variableName),class:"tok-variableName2"},{tag:K.definition(K.propertyName),class:"tok-propertyName tok-definition"},{tag:K.typeName,class:"tok-typeName"},{tag:K.namespace,class:"tok-namespace"},{tag:K.className,class:"tok-className"},{tag:K.macroName,class:"tok-macroName"},{tag:K.propertyName,class:"tok-propertyName"},{tag:K.operator,class:"tok-operator"},{tag:K.comment,class:"tok-comment"},{tag:K.meta,class:"tok-meta"},{tag:K.invalid,class:"tok-invalid"},{tag:K.punctuation,class:"tok-punctuation"}]);var qq;const ky=new Zt;function Xz(e){return mt.define({combine:e?t=>t.concat(e):void 0})}const Kse=new Zt;class Wl{constructor(t,n,r=[],i=""){this.data=t,this.name=i,dn.prototype.hasOwnProperty("tree")||Object.defineProperty(dn.prototype,"tree",{get(){return kr(this)}}),this.parser=n,this.extension=[L0.of(this),dn.languageData.of((o,s,a)=>{let l=ROe(o,s,a),c=l.type.prop(ky);if(!c)return[];let u=o.facet(c),f=l.type.prop(Kse);if(f){let d=l.resolve(s-l.from,a);for(let h of f)if(h.test(d,o)){let p=o.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(t,n,r=-1){return ROe(t,n,r).type.prop(ky)==this.data}findRegions(t){let n=t.facet(L0);if((n==null?void 0:n.data)==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(ky)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(Zt.mounted);if(a){if(a.tree.prop(ky)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;l<o.children.length;l++){let c=o.children[l];c instanceof Bn&&i(c,o.positions[l]+s)}};return i(kr(t),0),r}get allowsNesting(){return!0}}Wl.setState=jt.define();function ROe(e,t,n){let r=e.facet(L0),i=kr(e).topNode;if(!r||r.allowsNesting)for(let o=i;o;o=o.enter(t,n,Wr.ExcludeBuffers))o.type.isTop&&(i=o);return i}class Gb extends Wl{constructor(t,n,r){super(t,n,[],r),this.parser=n}static define(t){let n=Xz(t.languageData);return new Gb(n,t.parser.configure({props:[ky.add(r=>r.isTop?n:void 0)]}),t.name)}configure(t,n){return new Gb(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function kr(e){let t=e.field(Wl.state,!1);return t?t.tree:Bn.empty}function D6e(e,t,n=50){var r;let i=(r=e.field(Wl.state,!1))===null||r===void 0?void 0:r.context;if(!i)return null;let o=i.viewport;i.updateViewport({from:0,to:t});let s=i.isDone(t)||i.work(n,t)?i.tree:null;return i.updateViewport(o),s}class W7t{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let r=this.cursorPos-this.string.length;return t<r||n>=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-r,n-r)}}let mk=null;class Kb{constructor(t,n,r=[],i,o,s,a,l){this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new Kb(t,n,[],Bn.empty,0,r,[],null)}startParse(){return this.parser.startParse(new W7t(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Bn.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof t=="number"){let i=Date.now()+t;t=()=>Date.now()>i}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 i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Tg.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,n;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Tg.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=mk;mk=this;try{return t()}finally{mk=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=DOe(t,n.from,n.to);return t}changes(t,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!t.empty){let l=[];if(t.iterChangedRanges((c,u,f,d)=>l.push({fromA:c,toA:u,fromB:f,toB:d})),r=Tg.applyChanges(r,l),i=Bn.empty,o=0,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=t.mapPos(c.from,1),f=t.mapPos(c.to,-1);u<f&&a.push({from:u,to:f})}}}return new Kb(this.parser,n,r,i,o,s,a,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:o}=this.skipped[r];i<t.to&&o>t.from&&(this.fragments=DOe(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends Wz{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=mk;if(l){for(let c of i)l.tempSkipped.push(c);t&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,t]):t)}return this.parsedPos=s,new Bn(To.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return mk}}function DOe(e,t,n){return Tg.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class wE{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new wE(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=Kb.create(t.facet(L0).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new wE(r)}}Wl.state=di.define({create:wE.init,update(e,t){for(let n of t.effects)if(n.is(Wl.setState))return n.value;return t.startState.facet(L0)!=t.state.facet(L0)?wE.init(t.state):e.apply(t)}});let M6e=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(M6e=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const Vq=typeof navigator<"u"&&(!((qq=navigator.scheduling)===null||qq===void 0)&&qq.isInputPending)?()=>navigator.scheduling.isInputPending():null,q7t=jr.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(Wl.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(Wl.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=M6e(this.work))}work(t){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:r,viewport:{to:i}}=this.view,o=r.field(Wl.state);if(o.tree==o.context.tree&&o.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,t&&!Vq?Math.max(25,t.timeRemaining()-5):1e9),a=o.context.treeLen<i&&r.doc.length>i+1e3,l=o.context.work(()=>Vq&&Vq()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Wl.setState.of(new wE(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Bl(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),L0=mt.define({combine(e){return e.length?e[0]:null},enables:e=>[Wl.state,q7t,Ve.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class j0{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}class _e{constructor(t,n,r,i,o,s=void 0){this.name=t,this.alias=n,this.extensions=r,this.filename=i,this.loadFunc=o,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:n,support:r}=t;if(!n){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(r)}return new _e(t.name,(t.alias||[]).concat(t.name).map(i=>i.toLowerCase()),t.extensions||[],t.filename,n,r)}static matchFilename(t,n){for(let i of t)if(i.filename&&i.filename.test(n))return i;let r=/\.([^.]+)$/.exec(n);if(r){for(let i of t)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(t,n,r=!0){n=n.toLowerCase();for(let i of t)if(i.alias.some(o=>o==n))return i;if(r)for(let i of t)for(let o of i.alias){let s=n.indexOf(o);if(s>-1&&(o.length>2||!/\w/.test(n[s-1])&&!/\w/.test(n[s+o.length])))return i}return null}}const N6e=mt.define(),Gg=mt.define({combine:e=>{if(!e.length)return"  ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function Jb(e){let t=e.facet(Gg);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function $P(e,t){let n="",r=e.tabSize,i=e.facet(Gg)[0];if(i=="	"){for(;t>=r;)n+="	",t-=r;i=" "}for(let o=0;o<t;o++)n+=i;return n}function Jse(e,t){e instanceof dn&&(e=new Zz(e));for(let r of e.state.facet(N6e)){let i=r(e,t);if(i!==void 0)return i}let n=kr(e.state);return n.length>=t?V7t(e,n,t):null}class Zz{constructor(t,n={}){this.state=t,this.options=n,this.unit=Jb(t)}lineAt(t,n=1){let r=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==t?{text:"",from:t}:(n<0?i<t:i<=t)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(t,n=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(t,n);return r.slice(t-i,Math.min(r.length,t+100-i))}column(t,n=1){let{text:r,from:i}=this.lineAt(t,n),o=this.countColumn(r,t-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(t,n=t.length){return Ed(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:r,from:i}=this.lineAt(t,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const i_=new Zt;function V7t(e,t,n){let r=t.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s!=r.node;s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return I6e(r,e,n)}function I6e(e,t,n){for(let r=e;r;r=r.next){let i=H7t(r.node);if(i)return i(eae.create(t,n,r))}return 0}function U7t(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function H7t(e){let t=e.type.prop(i_);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(Zt.closedBy))){let i=e.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>L6e(s,!0,1,void 0,o&&!U7t(s)?i.from:void 0)}return e.parent==null?X7t:null}function X7t(){return 0}class eae extends Zz{constructor(t,n,r){super(t.state,t.options),this.base=t,this.pos=n,this.context=r}get node(){return this.context.node}static create(t,n,r){return new eae(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let r=t.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Z7t(r,t))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return I6e(this.context.next,this.base,this.pos)}}function Z7t(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function Y7t(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,o=e.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=t.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped)return l.from<s?n:null;a=l.to}}function V5({closing:e,align:t=!0,units:n=1}){return r=>L6e(r,t,n,e)}function L6e(e,t,n,r,i){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==e.pos+s,l=t?Y7t(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}const G7t=e=>e.baseIndent;function U5({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}const K7t=200;function j6e(){return dn.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+K7t)return e;let o=n.sliceString(i.from,r);if(!t.some(c=>c.test(o)))return e;let{state:s}=e,a=-1,l=[];for(let{head:c}of s.selection.ranges){let u=s.doc.lineAt(c);if(u.from==a)continue;a=u.from;let f=Jse(s,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=$P(s,f);d!=h&&l.push({from:u.from,to:u.from+d.length,insert:h})}return l.length?[e,{changes:l,sequential:!0}]:e})}const F6e=mt.define(),Sv=new Zt;function TP(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function J7t(e,t,n){let r=kr(e);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let s=i;s;s=s.next){let a=s.node;if(a.to<=n||a.from>n)continue;if(o&&a.from<t)break;let l=a.type.prop(Sv);if(l&&(a.to<r.length-50||r.length==e.doc.length||!e6t(a))){let c=l(a,e);c&&c.from<=n&&c.from>=t&&c.to>n&&(o=c)}}return o}function e6t(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function g3(e,t,n){for(let r of e.facet(F6e)){let i=r(e,t,n);if(i)return i}return J7t(e,t,n)}function z6e(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const Yz=jt.define({map:z6e}),YR=jt.define({map:z6e});function Q6e(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(r=>r.from<=n&&r.to>=n)||t.push(e.lineBlockAt(n));return t}const eO=di.define({create(){return st.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(Yz)&&!t6t(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(tae),i=r?st.replace({widget:new i6t(r(t.state,n.value))}):MOe;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(YR)&&(e=e.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:r}=t.selection.main;e.between(r,r,(i,o)=>{i<r&&o>r&&(n=!0)}),n&&(e=e.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return e},provide:e=>Ve.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");t.push(MOe.range(r,i))}return st.set(t,!0)}});function m3(e,t,n){var r;let i=null;return(r=e.field(eO,!1))===null||r===void 0||r.between(t,n,(o,s)=>{(!i||i.from>o)&&(i={from:o,to:s})}),i}function t6t(e,t,n){let r=!1;return e.between(t,t,(i,o)=>{i==t&&o==n&&(r=!0)}),r}function B6e(e,t){return e.field(eO,!1)?t:t.concat(jt.appendConfig.of(X6e()))}const W6e=e=>{for(let t of Q6e(e)){let n=g3(e.state,t.from,t.to);if(n)return e.dispatch({effects:B6e(e.state,[Yz.of(n),q6e(e,n)])}),!0}return!1},n6t=e=>{if(!e.state.field(eO,!1))return!1;let t=[];for(let n of Q6e(e)){let r=m3(e.state,n.from,n.to);r&&t.push(YR.of(r),q6e(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function q6e(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return Ve.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}const V6e=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),o=g3(t,i.from,i.to);o&&n.push(Yz.of(o)),r=(o?e.lineBlockAt(o.to):i).to+1}return n.length&&e.dispatch({effects:B6e(e.state,n)}),!!n.length},U6e=e=>{let t=e.state.field(eO,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(r,i)=>{n.push(YR.of({from:r,to:i}))}),e.dispatch({effects:n}),!0},H6e=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:W6e},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:n6t},{key:"Ctrl-Alt-[",run:V6e},{key:"Ctrl-Alt-]",run:U6e}],r6t={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},tae=mt.define({combine(e){return Op(e,r6t)}});function X6e(e){let t=[eO,s6t];return e&&t.push(tae.of(e)),t}function Z6e(e,t){let{state:n}=e,r=n.facet(tae),i=s=>{let a=e.lineBlockAt(e.posAtDOM(s.target)),l=m3(e.state,a.from,a.to);l&&e.dispatch({effects:YR.of(l)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const MOe=st.replace({widget:new class extends hu{toDOM(e){return Z6e(e,null)}}});class i6t extends hu{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return Z6e(t,this.value)}}const o6t={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Uq extends np{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function Y6e(e={}){let t=Object.assign(Object.assign({},o6t),e),n=new Uq(t,!0),r=new Uq(t,!1),i=jr.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(L0)!=s.state.facet(L0)||s.startState.field(eO,!1)!=s.state.field(eO,!1)||kr(s.startState)!=kr(s.state)||t.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new Ol;for(let l of s.viewportLineBlocks){let c=m3(s.state,l.from,l.to)?r:g3(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=t;return[i,_6e({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||Dn.empty},initialSpacer(){return new Uq(t,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=m3(s.state,a.from,a.to);if(c)return s.dispatch({effects:YR.of(c)}),!0;let u=g3(s.state,a.from,a.to);return u?(s.dispatch({effects:Yz.of(u)}),!0):!1}})}),X6e()]}const s6t=Ve.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class GR{constructor(t,n){this.specs=t;let r;function i(a){let l=Xg.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof Wl?a=>a.prop(ky)==s.data:s?a=>a==s:void 0,this.style=R6e(t.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new Xg(r):null,this.themeType=n.themeType}static define(t,n){return new GR(t,n||{})}}const EG=mt.define(),G6e=mt.define({combine(e){return e.length?[e[0]]:null}});function Hq(e){let t=e.facet(EG);return t.length?t:e.facet(G6e)}function Gz(e,t){let n=[l6t],r;return e instanceof GR&&(e.module&&n.push(Ve.styleModule.of(e.module)),r=e.themeType),t!=null&&t.fallback?n.push(G6e.of(e)):r?n.push(EG.computeN([Ve.darkTheme],i=>i.facet(Ve.darkTheme)==(r=="dark")?[e]:[])):n.push(EG.of(e)),n}class a6t{constructor(t){this.markCache=Object.create(null),this.tree=kr(t.state),this.decorations=this.buildDeco(t,Hq(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=kr(t.state),r=Hq(t.state),i=r!=Hq(t.startState),{viewport:o}=t.view,s=t.changes.mapPos(this.decoratedTo,1);n.length<o.to&&!i&&n.type==this.tree.type&&s>=o.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=s):(n!=this.tree||t.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(t.view,r),this.decoratedTo=o.to)}buildDeco(t,n){if(!n||!this.tree.length)return st.none;let r=new Ol;for(let{from:i,to:o}of t.visibleRanges)z7t(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=st.mark({class:l})))},i,o);return r.finish()}}const l6t=Ks.high(jr.fromClass(a6t,{decorations:e=>e.decorations})),nae=GR.define([{tag:K.meta,color:"#404740"},{tag:K.link,textDecoration:"underline"},{tag:K.heading,textDecoration:"underline",fontWeight:"bold"},{tag:K.emphasis,fontStyle:"italic"},{tag:K.strong,fontWeight:"bold"},{tag:K.strikethrough,textDecoration:"line-through"},{tag:K.keyword,color:"#708"},{tag:[K.atom,K.bool,K.url,K.contentSeparator,K.labelName],color:"#219"},{tag:[K.literal,K.inserted],color:"#164"},{tag:[K.string,K.deleted],color:"#a11"},{tag:[K.regexp,K.escape,K.special(K.string)],color:"#e40"},{tag:K.definition(K.variableName),color:"#00f"},{tag:K.local(K.variableName),color:"#30a"},{tag:[K.typeName,K.namespace],color:"#085"},{tag:K.className,color:"#167"},{tag:[K.special(K.variableName),K.macroName],color:"#256"},{tag:K.definition(K.propertyName),color:"#00c"},{tag:K.comment,color:"#940"},{tag:K.invalid,color:"#f00"}]),c6t=Ve.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),K6e=1e4,J6e="()[]{}",eze=mt.define({combine(e){return Op(e,{afterCursor:!0,brackets:J6e,maxScanDistance:K6e,renderMatch:d6t})}}),u6t=st.mark({class:"cm-matchingBracket"}),f6t=st.mark({class:"cm-nonmatchingBracket"});function d6t(e){let t=[],n=e.matched?u6t:f6t;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const h6t=di.define({create(){return st.none},update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(eze);for(let i of t.state.selection.ranges){if(!i.empty)continue;let o=qu(t.state,i.head,-1,r)||i.head>0&&qu(t.state,i.head-1,1,r)||r.afterCursor&&(qu(t.state,i.head,1,r)||i.head<t.state.doc.length&&qu(t.state,i.head+1,-1,r));o&&(n=n.concat(r.renderMatch(o,t.state)))}return st.set(n,!0)},provide:e=>Ve.decorations.from(e)}),p6t=[h6t,c6t];function tze(e={}){return[eze.of(e),p6t]}const nze=new Zt;function CG(e,t,n){let r=e.prop(t<0?Zt.openedBy:Zt.closedBy);if(r)return r;if(e.name.length==1){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function _G(e){let t=e.type.prop(nze);return t?t(e.node):e}function qu(e,t,n,r={}){let i=r.maxScanDistance||K6e,o=r.brackets||J6e,s=kr(e),a=s.resolveInner(t,n);for(let l=a;l;l=l.parent){let c=CG(l.type,n,o);if(c&&l.from<l.to){let u=_G(l);if(u&&(n>0?t>=u.from&&t<u.to:t>u.from&&t<=u.to))return g6t(e,t,n,l,u,c,o)}}return m6t(e,t,n,s,a.type,i,o)}function g6t(e,t,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a==null?void 0:a.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from<u.to){let f=_G(u);return{start:l,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(CG(u.type,n,s))c++;else if(CG(u.type,-n,s)){if(c==0){let f=_G(u);return{start:l,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:l,matched:!1}}function m6t(e,t,n,r,i,o,s){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=o;){let h=u.value;n<0&&(d+=h.length);let p=t+d*n;for(let g=n>0?0:h.length-1,v=n>0?h.length:-1;g!=v;g+=n){let y=s.indexOf(h[g]);if(!(y<0||r.resolveInner(p+g,1).type!=i))if(y%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+g,to:p+g+1},matched:y>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}function NOe(e,t,n,r=0,i=0){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let o=i;for(let s=r;s<t;s++)e.charCodeAt(s)==9?o+=n-o%n:o++;return o}class rae{constructor(t,n,r,i){this.string=t,this.tabSize=n,this.indentUnit=r,this.overrideIndent=i,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(t){let n=this.string.charAt(this.pos),r;if(typeof t=="string"?r=n==t:r=n&&(t instanceof RegExp?t.test(n):t(n)),r)return++this.pos,n}eatWhile(t){let n=this.pos;for(;this.eat(t););return this.pos>n}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let n=this.string.indexOf(t,this.pos);if(n>-1)return this.pos=n,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=NOe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var t;return(t=this.overrideIndent)!==null&&t!==void 0?t:NOe(this.string,null,this.tabSize)}match(t,n,r){if(typeof t=="string"){let i=s=>r?s.toLowerCase():s,o=this.string.substr(this.pos,t.length);return i(o)==i(t)?(n!==!1&&(this.pos+=t.length),!0):null}else{let i=this.string.slice(this.pos).match(t);return i&&i.index>0?null:(i&&n!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function y6t(e){return{name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||v6t,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||sae}}function v6t(e){if(typeof e!="object")return e;let t={};for(let n in e){let r=e[n];t[n]=r instanceof Array?r.slice():r}return t}const IOe=new WeakMap;class iae extends Wl{constructor(t){let n=Xz(t.languageData),r=y6t(t),i,o=new class extends Wz{createParse(s,a,l){return new O6t(i,s,a,l)}};super(n,o,[N6e.of((s,a)=>this.getIndent(s,a))],t.name),this.topNode=S6t(n),i=this,this.streamParser=r,this.stateAfter=new Zt({perNode:!0}),this.tokenTable=t.tokenTable?new sze(r.tokenTable):w6t}static define(t){return new iae(t)}getIndent(t,n){let r=kr(t.state),i=r.resolve(n);for(;i&&i.type!=this.topNode;)i=i.parent;if(!i)return null;let o,{overrideIndentation:s}=t.options;s&&(o=IOe.get(t.state),o!=null&&o<n-1e4&&(o=void 0));let a=oae(this,r,0,i.from,o??n),l,c;if(a?(c=a.state,l=a.pos+1):(c=this.streamParser.startState(t.unit),l=0),n-l>1e4)return null;for(;l<n;){let f=t.state.doc.lineAt(l),d=Math.min(n,f.to);if(f.length){let h=s?s(f.from):-1,p=new rae(f.text,t.state.tabSize,t.unit,h<0?void 0:h);for(;p.pos<d-f.from;)ize(this.streamParser.token,p,c)}else this.streamParser.blankLine(c,t.unit);if(d==n)break;l=f.to+1}let u=t.lineAt(n);return s&&o==null&&IOe.set(t.state,u.from),this.streamParser.indent(c,/^\s*(.*)/.exec(u.text)[1],t)}get allowsNesting(){return!1}}function oae(e,t,n,r,i){let o=n>=r&&n+t.length<=i&&t.prop(e.stateAfter);if(o)return{state:e.streamParser.copyState(o),pos:n+t.length};for(let s=t.children.length-1;s>=0;s--){let a=t.children[s],l=n+t.positions[s],c=a instanceof Bn&&l<i&&oae(e,a,l,r,i);if(c)return c}return null}function rze(e,t,n,r,i){if(i&&n<=0&&r>=t.length)return t;!i&&t.type==e.topNode&&(i=!0);for(let o=t.children.length-1;o>=0;o--){let s=t.positions[o],a=t.children[o],l;if(s<r&&a instanceof Bn){if(!(l=rze(e,a,n-s,r-s,i)))break;return i?new Bn(t.type,t.children.slice(0,o).concat(l),t.positions.slice(0,o+1),s+l.length):l}}return null}function b6t(e,t,n,r){for(let i of t){let o=i.from+(i.openStart?25:0),s=i.to-(i.openEnd?25:0),a=o<=n&&s>n&&oae(e,i.tree,0-i.offset,n,s),l;if(a&&(l=rze(e,i.tree,n+i.offset,a.pos+i.offset,!1)))return{state:a.state,tree:l}}return{state:e.streamParser.startState(r?Jb(r):4),tree:Bn.empty}}let O6t=class{constructor(t,n,r,i){this.lang=t,this.input=n,this.fragments=r,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let o=Kb.get(),s=i[0].from,{state:a,tree:l}=b6t(t,r,s,o==null?void 0:o.state);this.state=a,this.parsedPos=this.chunkStart=s+l.length;for(let c=0;c<l.children.length;c++)this.chunks.push(l.children[c]),this.chunkPos.push(l.positions[c]);o&&this.parsedPos<o.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(Jb(o.state)),o.skipUntilInView(this.parsedPos,o.viewport.from),this.parsedPos=o.viewport.from),this.moveRangeIndex()}advance(){let t=Kb.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(n,this.chunkStart+2048);for(t&&(r=Math.min(r,t.viewport.to));this.parsedPos<r;)this.parseLine(t);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=n?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let n=this.input.chunk(t);if(this.input.lineChunks)n==`
`&&(n="");else{let r=n.indexOf(`
`);r>-1&&(n=n.slice(0,r))}return t+n.length<=this.to?n:n.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,n=this.lineAfter(t),r=t+n.length;for(let i=this.rangeIndex;;){let o=this.ranges[i].to;if(o>=r||(n=n.slice(0,o-(r-n.length)),i++,i==this.ranges.length))break;let s=this.ranges[i].from,a=this.lineAfter(s);n+=a,r=s+a.length}return{line:n,end:r}}skipGapsTo(t,n,r){for(;;){let i=this.ranges[this.rangeIndex].to,o=t+n;if(r>0?i>o:i>=o)break;let s=this.ranges[++this.rangeIndex].from;n+=s-i}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,n,r,i,o){if(this.ranges.length>1){o=this.skipGapsTo(n,o,1),n+=o;let s=this.chunk.length;o=this.skipGapsTo(r,o,-1),r+=o,i+=this.chunk.length-s}return this.chunk.push(t,n,r,i),o}parseLine(t){let{line:n,end:r}=this.nextLine(),i=0,{streamParser:o}=this.lang,s=new rae(n,t?t.state.tabSize:4,t?Jb(t.state):2);if(s.eol())o.blankLine(this.state,s.indentUnit);else for(;!s.eol();){let a=ize(o.token,s,this.state);if(a&&(i=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+s.start,this.parsedPos+s.pos,4,i)),s.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=Bn.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:x6t,topID:0,maxBufferLength:2048,reused:this.chunkReused});t=new Bn(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new Bn(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function ize(e,t,n){t.start=t.pos;for(let r=0;r<10;r++){let i=e(t,n);if(t.pos>t.start)return i}throw new Error("Stream parser failed to advance stream.")}const sae=Object.create(null),PP=[To.none],x6t=new r_(PP),LOe=[],jOe=Object.create(null),oze=Object.create(null);for(let[e,t]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"]])oze[e]=aze(sae,t);class sze{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),oze)}resolve(t){return t?this.table[t]||(this.table[t]=aze(this.extra,t)):0}}const w6t=new sze(sae);function Xq(e,t){LOe.indexOf(e)>-1||(LOe.push(e),console.warn(t))}function aze(e,t){let n=[];for(let a of t.split(" ")){let l=[];for(let c of a.split(".")){let u=e[c]||K[c];u?typeof u=="function"?l.length?l=l.map(u):Xq(c,`Modifier ${c} used at start of tag`):l.length?Xq(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:Xq(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),o=jOe[i];if(o)return o.id;let s=jOe[i]=To.define({id:PP.length,name:r,props:[YO({[r]:n})]});return PP.push(s),s.id}function S6t(e){let t=To.define({id:PP.length,name:"Document",props:[ky.add(()=>e)],top:!0});return PP.push(t),t}ti.RTL,ti.LTR;function lze(e){return t=>{let n=!1;for(const r of t)r&&(n=e(r)||n);return n}}const E6t=lze(V6e),C6t=lze(U6e);var Kz={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const _6t=Symbol((Kz?"production":void 0)!=="production"?"RESET":"");function k6t(e,t){return hn(e,function(n,r,i){r(this,t(n(this),i))})}const Zq=(e,t,n)=>(t.has(n)?t:t.set(n,e())).get(n),$6t=new WeakMap,T6t=(e,t,n,r)=>{const i=Zq(()=>new WeakMap,$6t,t),o=Zq(()=>new WeakMap,i,n);return Zq(e,o,r)};function P6t(e,t,n=Object.is){return T6t(()=>{const r=Symbol(),i=([s,a])=>{if(a===r)return t(s);const l=t(s,a);return n(a,l)?a:l},o=hn(s=>{const a=s(o),l=s(e);return l instanceof Promise||a instanceof Promise?Promise.all([l,a]).then(i):i([l,a])});return o.init=r,o},e,t,n)}const FOe=(e,t,n)=>(t.has(n)?t:t.set(n,e())).get(n),A6t=new WeakMap,R6t=(e,t,n)=>{const r=FOe(()=>new WeakMap,A6t,t);return FOe(e,r,n)},D6t={},zOe=e=>!!e.write,M6t=e=>typeof e=="function";function N6t(e,t){return R6t(()=>{const n=new WeakMap,r=(s,a)=>{let l=n.get(s);if(l)return l;const c=a&&n.get(a),u=[],f=[];return s.forEach((d,h)=>{const p=t?t(d):h;f[h]=p;const g=c&&c.atomList[c.keyList.indexOf(p)];if(g){u[h]=g;return}const v=O=>{const m=O(i),w=O(e),E=r(w,m==null?void 0:m.arr).keyList.indexOf(p);if(E<0||E>=w.length){const C=s[r(s).keyList.indexOf(p)];if(C)return C;throw new Error("splitAtom: index out of bounds for read")}return w[E]},y=(O,m,w)=>{const S=O(i),E=O(e),k=r(E,S==null?void 0:S.arr).keyList.indexOf(p);if(k<0||k>=E.length)throw new Error("splitAtom: index out of bounds for write");const P=M6t(w)?w(E[k]):w;Object.is(E[k],P)||m(e,[...E.slice(0,k),P,...E.slice(k+1)])};u[h]=zOe(e)?hn(v,y):hn(v)}),c&&c.keyList.length===f.length&&c.keyList.every((d,h)=>d===f[h])?l=c:l={arr:s,atomList:u,keyList:f},n.set(s,l),l},i=hn(s=>{const a=s(i),l=s(e);return r(l,a==null?void 0:a.arr)});(Kz?"production":void 0)!=="production"&&(i.debugPrivate=!0),i.init=void 0;const o=zOe(e)?hn(s=>s(i).atomList,(s,a,l)=>{switch(l.type){case"remove":{const c=s(o).indexOf(l.atom);if(c>=0){const u=s(e);a(e,[...u.slice(0,c),...u.slice(c+1)])}break}case"insert":{const c=l.before?s(o).indexOf(l.before):s(o).length;if(c>=0){const u=s(e);a(e,[...u.slice(0,c),l.value,...u.slice(c)])}break}case"move":{const c=s(o).indexOf(l.atom),u=l.before?s(o).indexOf(l.before):s(o).length;if(c>=0&&u>=0){const f=s(e);c<u?a(e,[...f.slice(0,c),...f.slice(c+1,u),f[c],...f.slice(u)]):a(e,[...f.slice(0,u),f[c],...f.slice(u,c),...f.slice(c+1)])}break}}}):hn(s=>s(i).atomList);return o},e,t||D6t)}const I6t=e=>typeof(e==null?void 0:e.then)=="function";function L6t(e=()=>{try{return window.localStorage}catch(n){(Kz?"production":void 0)!=="production"&&typeof window<"u"&&console.warn(n);return}},t){let n,r;const i={getItem:(o,s)=>{var a,l;const c=f=>{if(f=f||"",n!==f){try{r=JSON.parse(f,t==null?void 0:t.reviver)}catch{return s}n=f}return r},u=(l=(a=e())==null?void 0:a.getItem(o))!=null?l:null;return I6t(u)?u.then(c):c(u)},setItem:(o,s)=>{var a;return(a=e())==null?void 0:a.setItem(o,JSON.stringify(s,t==null?void 0:t.replacer))},removeItem:o=>{var s;return(s=e())==null?void 0:s.removeItem(o)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(i.subscribe=(o,s,a)=>{if(!(e()instanceof window.Storage))return()=>{};const l=c=>{if(c.storageArea===e()&&c.key===o){let u;try{u=JSON.parse(c.newValue||"")}catch{u=a}s(u)}};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}}),i}const j6t=L6t();function F6t(e,t,n=j6t,r){const i=r==null?void 0:r.getOnInit,o=hn(i?n.getItem(e,t):t);return(Kz?"production":void 0)!=="production"&&(o.debugPrivate=!0),o.onMount=a=>{i||a(n.getItem(e,t));let l;return n.subscribe&&(l=n.subscribe(e,a,t)),l},hn(a=>a(o),(a,l,c)=>{const u=typeof c=="function"?c(a(o)):c;return u===_6t?(l(o,t),n.removeItem(e)):u instanceof Promise?u.then(f=>(l(o,f),n.setItem(e,f))):(l(o,u),n.setItem(e,u))})}function gc(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function tO(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const cze=6048e5,z6t=864e5;let Q6t={};function Jz(){return Q6t}function AP(e,t){var a,l,c,u;const n=Jz(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,i=gc(e),o=i.getDay(),s=(o<r?7:0)+o-r;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function y3(e){return AP(e,{weekStartsOn:1})}function uze(e){const t=gc(e),n=t.getFullYear(),r=tO(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=y3(r),o=tO(e,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const s=y3(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function v3(e){const t=gc(e);return t.setHours(0,0,0,0),t}function QOe(e){const t=gc(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function B6t(e,t){const n=v3(e),r=v3(t),i=+n-QOe(n),o=+r-QOe(r);return Math.round((i-o)/z6t)}function W6t(e){const t=uze(e),n=tO(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),y3(n)}function q6t(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function V6t(e){if(!q6t(e)&&typeof e!="number")return!1;const t=gc(e);return!isNaN(Number(t))}function U6t(e){const t=gc(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function H6t(e){const t=gc(e);return t.setDate(1),t.setHours(0,0,0,0),t}function X6t(e){const t=gc(e),n=tO(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Z6t={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Y6t=(e,t,n)=>{let r;const i=Z6t[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Yq(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const G6t={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},K6t={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},J6t={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ezt={date:Yq({formats:G6t,defaultWidth:"full"}),time:Yq({formats:K6t,defaultWidth:"full"}),dateTime:Yq({formats:J6t,defaultWidth:"full"})},tzt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nzt=(e,t,n,r)=>tzt[e];function yk(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;i=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[s]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const rzt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},izt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ozt={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},szt={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},azt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},lzt={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},czt=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},uzt={ordinalNumber:czt,era:yk({values:rzt,defaultWidth:"wide"}),quarter:yk({values:izt,defaultWidth:"wide",argumentCallback:e=>e-1}),month:yk({values:ozt,defaultWidth:"wide"}),day:yk({values:szt,defaultWidth:"wide"}),dayPeriod:yk({values:azt,defaultWidth:"wide",formattingValues:lzt,defaultFormattingWidth:"wide"})};function vk(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?dzt(a,f=>f.test(s)):fzt(a,f=>f.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(s.length);return{value:c,rest:u}}}function fzt(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function dzt(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function hzt(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let s=e.valueCallback?e.valueCallback(o[0]):o[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(i.length);return{value:s,rest:a}}}const pzt=/^(\d+)(th|st|nd|rd)?/i,gzt=/\d+/i,mzt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},yzt={any:[/^b/i,/^(a|c)/i]},vzt={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},bzt={any:[/1/i,/2/i,/3/i,/4/i]},Ozt={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},xzt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},wzt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Szt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ezt={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Czt={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_zt={ordinalNumber:hzt({matchPattern:pzt,parsePattern:gzt,valueCallback:e=>parseInt(e,10)}),era:vk({matchPatterns:mzt,defaultMatchWidth:"wide",parsePatterns:yzt,defaultParseWidth:"any"}),quarter:vk({matchPatterns:vzt,defaultMatchWidth:"wide",parsePatterns:bzt,defaultParseWidth:"any",valueCallback:e=>e+1}),month:vk({matchPatterns:Ozt,defaultMatchWidth:"wide",parsePatterns:xzt,defaultParseWidth:"any"}),day:vk({matchPatterns:wzt,defaultMatchWidth:"wide",parsePatterns:Szt,defaultParseWidth:"any"}),dayPeriod:vk({matchPatterns:Ezt,defaultMatchWidth:"any",parsePatterns:Czt,defaultParseWidth:"any"})},fze={code:"en-US",formatDistance:Y6t,formatLong:ezt,formatRelative:nzt,localize:uzt,match:_zt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kzt(e){const t=gc(e);return B6t(t,X6t(t))+1}function $zt(e){const t=gc(e),n=+y3(t)-+W6t(t);return Math.round(n/cze)+1}function dze(e,t){var u,f,d,h;const n=gc(e),r=n.getFullYear(),i=Jz(),o=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??i.firstWeekContainsDate??((h=(d=i.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,s=tO(e,0);s.setFullYear(r+1,0,o),s.setHours(0,0,0,0);const a=AP(s,t),l=tO(e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=AP(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Tzt(e,t){var a,l,c,u;const n=Jz(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,i=dze(e,t),o=tO(e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),AP(o,t)}function Pzt(e,t){const n=gc(e),r=+AP(n,t)-+Tzt(n,t);return Math.round(r/cze)+1}function xr(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Im={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return xr(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):xr(n+1,2)},d(e,t){return xr(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return xr(e.getHours()%12||12,t.length)},H(e,t){return xr(e.getHours(),t.length)},m(e,t){return xr(e.getMinutes(),t.length)},s(e,t){return xr(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return xr(i,t.length)}},jx={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},BOe={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Im.y(e,t)},Y:function(e,t,n,r){const i=dze(e,r),o=i>0?i:1-i;if(t==="YY"){const s=o%100;return xr(s,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):xr(o,t.length)},R:function(e,t){const n=uze(e);return xr(n,t.length)},u:function(e,t){const n=e.getFullYear();return xr(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return xr(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return xr(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Im.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return xr(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=Pzt(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):xr(i,t.length)},I:function(e,t,n){const r=$zt(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):xr(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Im.d(e,t)},D:function(e,t,n){const r=kzt(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):xr(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return xr(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return xr(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return xr(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=jx.noon:r===0?i=jx.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=jx.evening:r>=12?i=jx.afternoon:r>=4?i=jx.morning:i=jx.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Im.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Im.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):xr(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):xr(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Im.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Im.s(e,t)},S:function(e,t){return Im.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return qOe(r);case"XXXX":case"XX":return h1(r);case"XXXXX":case"XXX":default:return h1(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return qOe(r);case"xxxx":case"xx":return h1(r);case"xxxxx":case"xxx":default:return h1(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+WOe(r,":");case"OOOO":default:return"GMT"+h1(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+WOe(r,":");case"zzzz":default:return"GMT"+h1(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return xr(r,t.length)},T:function(e,t,n){const r=e.getTime();return xr(r,t.length)}};function WOe(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+xr(o,2)}function qOe(e,t){return e%60===0?(e>0?"-":"+")+xr(Math.abs(e)/60,2):h1(e,t)}function h1(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=xr(Math.trunc(r/60),2),o=xr(r%60,2);return n+i+t+o}const VOe=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},hze=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Azt=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return VOe(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",VOe(r,t)).replace("{{time}}",hze(i,t))},Rzt={p:hze,P:Azt},Dzt=/^D+$/,Mzt=/^Y+$/,Nzt=["D","DD","YY","YYYY"];function Izt(e){return Dzt.test(e)}function Lzt(e){return Mzt.test(e)}function jzt(e,t,n){const r=Fzt(e,t,n);if(console.warn(r),Nzt.includes(e))throw new RangeError(r)}function Fzt(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const zzt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qzt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bzt=/^'([^]*?)'?$/,Wzt=/''/g,qzt=/[a-zA-Z]/;function GO(e,t,n){var u,f,d,h,p,g,v,y;const r=Jz(),i=(n==null?void 0:n.locale)??r.locale??fze,o=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(d=r.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((g=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((y=(v=r.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??0,a=gc(e);if(!V6t(a))throw new RangeError("Invalid time value");let l=t.match(Qzt).map(O=>{const m=O[0];if(m==="p"||m==="P"){const w=Rzt[m];return w(O,i.formatLong)}return O}).join("").match(zzt).map(O=>{if(O==="''")return{isToken:!1,value:"'"};const m=O[0];if(m==="'")return{isToken:!1,value:Vzt(O)};if(BOe[m])return{isToken:!0,value:O};if(m.match(qzt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:O}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:s,locale:i};return l.map(O=>{if(!O.isToken)return O.value;const m=O.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Lzt(m)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Izt(m))&&jzt(m,t,String(e));const w=BOe[m[0]];return w(a,m,i.localize,c)}).join("")}function Vzt(e){const t=e.match(Bzt);return t?t[1].replace(Wzt,"'"):e}function Uzt(e){return gc(e*1e3)}function Hzt(e){const t=[],n=[e.console].filter(Boolean).flat();for(const r of n)if(r.mimetype==="text/plain")switch(r.channel){case"stdout":t.push({timestamp:r.timestamp,level:"stdout",message:r.data,cellId:e.cell_id});break;case"stderr":case"marimo-error":t.push({timestamp:r.timestamp,level:"stderr",message:r.data,cellId:e.cell_id});break}return t.forEach(Xzt.log),t}const Xzt={log:e=>{const t=e.level==="stdout"?"gray":e.level==="stderr"?"red":"orange",n=e.level.toUpperCase();console.log(`%c[${n}]`,`color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`,`[${pze(e.timestamp)}]`,`(${e.cellId}) ${e.message}`)}};function pze(e){try{return Uzt(e).toLocaleTimeString("en-US",{hour12:!0,hour:"numeric",minute:"numeric",second:"numeric"})}catch{return""}}function UOe(e){const t=JSON.stringify(e);return btoa(encodeURIComponent(t))}function HOe(e){const t=decodeURIComponent(atob(e));return JSON.parse(t)}function e8(e,t){return`data:${t};base64,${e}`}const Zzt=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=lae(e.state,n.from);return r.line?Yzt(e):r.block?Kzt(e):!1};function aae(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}const Yzt=aae(t8t,0),Gzt=aae(gze,0),Kzt=aae((e,t)=>gze(e,t,e8t(t)),0);function lae(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}const bk=50;function Jzt(e,{open:t,close:n},r,i){let o=e.sliceDoc(r-bk,r),s=e.sliceDoc(i,i+bk),a=/\s*$/.exec(o)[0].length,l=/^\s*/.exec(s)[0].length,c=o.length-a;if(o.slice(c-t.length,c)==t&&s.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*bk?u=f=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+bk),f=e.sliceDoc(i-bk,i));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-n.length;return u.slice(d,d+t.length)==t&&f.slice(p,p+n.length)==n?{open:{pos:r+d+t.length,margin:/\s/.test(u.charAt(d+t.length))?1:0},close:{pos:i-h-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function e8t(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to),o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function gze(e,t,n=t.selection.ranges){let r=n.map(o=>lae(t,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>Jzt(t,r[s],o.from,o.to));if(e!=2&&!i.every(o=>o))return{changes:t.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(e!=1&&i.some(o=>o)){let o=[];for(let s=0,a;s<i.length;s++)if(a=i[s]){let l=r[s],{open:c,close:u}=a;o.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:o}}return null}function t8t(e,t,n=t.selection.ranges){let r=[],i=-1;for(let{from:o,to:s}of n){let a=r.length,l=1e9,c=lae(t,o).line;if(c){for(let u=o;u<=s;){let f=t.doc.lineAt(u);if(f.from>i&&(o==s||s>f.from)){i=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<l&&(l=d),r.push({line:f,comment:p,token:c,indent:d,empty:h,single:!1})}u=f.to+1}if(l<1e9)for(let u=a;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=l);r.length==a+1&&(r[a].single=!0)}}if(e!=2&&r.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:a,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&o.push({from:a.from+c,insert:l+" "});let s=t.changes(o);return{changes:s,selection:t.selection.map(s,1)}}else if(e!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:a,token:l}of r)if(a>=0){let c=s.from+a,u=c+l.length;s.text[u-s.from]==" "&&u++,o.push({from:c,to:u})}return{changes:o}}return null}const kG=bp.define(),n8t=bp.define(),r8t=mt.define(),mze=mt.define({combine(e){return Op(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,i)=>t(r,i)||n(r,i)})}}),cae=di.define({create(){return Ph.empty},update(e,t){let n=t.state.facet(mze),r=t.annotation(kG);if(r){let l=ql.fromTransaction(t,r.selection),c=r.side,u=c==0?e.undone:e.done;return l?u=O3(u,u.length,n.minDepth,l):u=bze(u,t.startState.selection),new Ph(c==0?r.rest:u,c==0?u:r.rest)}let i=t.annotation(n8t);if((i=="full"||i=="before")&&(e=e.isolate()),t.annotation(Co.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let o=ql.fromTransaction(t),s=t.annotation(Co.time),a=t.annotation(Co.userEvent);return o?e=e.addChanges(o,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),(i=="full"||i=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new Ph(e.done.map(ql.fromJSON),e.undone.map(ql.fromJSON))}});function t8(e={}){return[cae,mze.of(e),Ve.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?uae:t.inputType=="historyRedo"?b3:null;return r?(t.preventDefault(),r(n)):!1}})]}const yze=cae;function n8(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(cae,!1);if(!i)return!1;let o=i.pop(e,n,t);return o?(r(o),!0):!1}}const uae=n8(0,!1),b3=n8(1,!1),i8t=n8(0,!0),o8t=n8(1,!0);class ql{constructor(t,n,r,i,o){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(t){return new ql(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(t){return new ql(t.changes&&Oo.fromJSON(t.changes),[],t.mapped&&Fh.fromJSON(t.mapped),t.startSelection&&Ae.fromJSON(t.startSelection),t.selectionsAfter.map(Ae.fromJSON))}static fromTransaction(t,n){let r=Vu;for(let i of t.startState.facet(r8t)){let o=i(t);o.length&&(r=r.concat(o))}return!r.length&&t.changes.empty?null:new ql(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Vu)}static selection(t){return new ql(void 0,Vu,void 0,void 0,t)}}function O3(e,t,n,r){let i=t+1>n+20?t-n-1:0,o=e.slice(i,t);return o.push(r),o}function s8t(e,t){let n=[],r=!1;return e.iterChangedRanges((i,o)=>n.push(i,o)),t.iterChangedRanges((i,o,s,a)=>{for(let l=0;l<n.length;){let c=n[l++],u=n[l++];a>=c&&s<=u&&(r=!0)}}),r}function a8t(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function vze(e,t){return e.length?t.length?e.concat(t):e:t}const Vu=[],l8t=200;function bze(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-l8t));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),O3(e,e.length-1,1e9,n.setSelAfter(r)))}else return[ql.selection([t])]}function c8t(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Gq(e,t){if(!e.length)return e;let n=e.length,r=Vu;for(;n;){let i=u8t(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=e.slice(0,n);return o[n-1]=i,o}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[ql.selection(r)]:Vu}function u8t(e,t,n){let r=vze(e.selectionsAfter.length?e.selectionsAfter.map(a=>a.map(t)):Vu,n);if(!e.changes)return ql.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(o):o;return new ql(i,jt.mapEffects(e.effects,t),s,e.startSelection.map(o),r)}const f8t=/^(input\.type|delete)($|\.)/;class Ph{constructor(t,n,r=0,i=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Ph(this.done,this.undone):this}addChanges(t,n,r,i,o){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&t.changes&&(!r||f8t.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(o,s8t(a.changes,t.changes))||r=="input.type.compose")?s=O3(s,s.length-1,i.minDepth,new ql(t.changes.compose(a.changes),vze(t.effects,a.effects),a.mapped,a.startSelection,Vu)):s=O3(s,s.length,i.minDepth,t),new Ph(s,Vu,n,r)}addSelection(t,n,r,i){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:Vu;return o.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&a8t(o[o.length-1],t)?this:new Ph(bze(this.done,t),this.undone,n,r)}addMapping(t){return new Ph(Gq(this.done,t),Gq(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let i=t==0?this.done:this.undone;if(i.length==0)return null;let o=i[i.length-1],s=o.selectionsAfter[0]||n.selection;if(r&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:kG.of({side:t,rest:c8t(i),selection:s}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let a=i.length==1?Vu:i.slice(0,i.length-1);return o.mapped&&(a=Gq(a,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:kG.of({side:t,rest:a,selection:s}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Ph.empty=new Ph(Vu,Vu);const fae=[{key:"Mod-z",run:uae,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:b3,preventDefault:!0},{linux:"Ctrl-Shift-z",run:b3,preventDefault:!0},{key:"Mod-u",run:i8t,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:o8t,preventDefault:!0}];function o_(e,t){return Ae.create(e.ranges.map(t),e.mainIndex)}function xp(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Fd({state:e,dispatch:t},n){let r=o_(e.selection,n);return r.eq(e.selection,!0)?!1:(t(xp(e,r)),!0)}function r8(e,t){return Ae.cursor(t?e.to:e.from)}function dae(e,t){return Fd(e,n=>n.empty?e.moveByChar(n,t):r8(n,t))}function qa(e){return e.textDirectionAt(e.state.selection.main.head)==ti.LTR}const hae=e=>dae(e,!qa(e)),Oze=e=>dae(e,qa(e)),d8t=e=>dae(e,!1);function xze(e,t){return Fd(e,n=>n.empty?e.moveByGroup(n,t):r8(n,t))}const h8t=e=>xze(e,!qa(e)),p8t=e=>xze(e,qa(e));function g8t(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function i8(e,t,n){let r=kr(e).resolveInner(t.head),i=n?Zt.closedBy:Zt.openedBy;for(let l=t.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;g8t(e,c,i)?r=c:l=n?c.to:c.from}let o=r.type.prop(i),s,a;return o&&(s=n?qu(e,r.from,1):qu(e,r.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?r.to:r.from,Ae.cursor(a,n?-1:1)}const m8t=e=>Fd(e,t=>i8(e.state,t,!qa(e))),y8t=e=>Fd(e,t=>i8(e.state,t,qa(e)));function wze(e,t){return Fd(e,n=>{if(!n.empty)return r8(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const Sze=e=>wze(e,!1),Eze=e=>wze(e,!0);function Cze(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let o of e.state.facet(Ve.scrollMargins)){let s=o(e);s!=null&&s.top&&(n=Math.max(s==null?void 0:s.top,n)),s!=null&&s.bottom&&(r=Math.max(s==null?void 0:s.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function _ze(e,t){let n=Cze(e),{state:r}=e,i=o_(r.selection,s=>s.empty?e.moveVertically(s,t,n.height):r8(s,t));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=e.coordsAtPos(r.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottom<c&&(o=Ve.scrollIntoView(i.main.head,{y:"start",yMargin:s.top-l}))}return e.dispatch(xp(r,i),{effects:o}),!0}const XOe=e=>_ze(e,!1),$G=e=>_ze(e,!0);function Ev(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&t.head!=r.from+o&&(i=Ae.cursor(r.from+o))}return i}const kze=e=>Fd(e,t=>Ev(e,t,!0)),$ze=e=>Fd(e,t=>Ev(e,t,!1)),v8t=e=>Fd(e,t=>Ev(e,t,!qa(e))),b8t=e=>Fd(e,t=>Ev(e,t,qa(e))),O8t=e=>Fd(e,t=>Ae.cursor(e.lineBlockAt(t.head).from,1)),x8t=e=>Fd(e,t=>Ae.cursor(e.lineBlockAt(t.head).to,-1));function w8t(e,t,n){let r=!1,i=o_(e.selection,o=>{let s=qu(e,o.head,-1)||qu(e,o.head,1)||o.head>0&&qu(e,o.head-1,1)||o.head<e.doc.length&&qu(e,o.head+1,-1);if(!s||!s.end)return o;r=!0;let a=s.start.from==o.head?s.end.to:s.end.from;return n?Ae.range(o.anchor,a):Ae.cursor(a)});return r?(t(xp(e,i)),!0):!1}const S8t=({state:e,dispatch:t})=>w8t(e,t,!1);function Cf(e,t){let n=o_(e.state.selection,r=>{let i=t(r);return Ae.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(xp(e.state,n)),!0)}function Tze(e,t){return Cf(e,n=>e.moveByChar(n,t))}const Pze=e=>Tze(e,!qa(e)),Aze=e=>Tze(e,qa(e));function Rze(e,t){return Cf(e,n=>e.moveByGroup(n,t))}const E8t=e=>Rze(e,!qa(e)),C8t=e=>Rze(e,qa(e)),_8t=e=>Cf(e,t=>i8(e.state,t,!qa(e))),k8t=e=>Cf(e,t=>i8(e.state,t,qa(e)));function Dze(e,t){return Cf(e,n=>e.moveVertically(n,t))}const Mze=e=>Dze(e,!1),Nze=e=>Dze(e,!0);function Ize(e,t){return Cf(e,n=>e.moveVertically(n,t,Cze(e).height))}const ZOe=e=>Ize(e,!1),YOe=e=>Ize(e,!0),$8t=e=>Cf(e,t=>Ev(e,t,!0)),T8t=e=>Cf(e,t=>Ev(e,t,!1)),P8t=e=>Cf(e,t=>Ev(e,t,!qa(e))),A8t=e=>Cf(e,t=>Ev(e,t,qa(e))),R8t=e=>Cf(e,t=>Ae.cursor(e.lineBlockAt(t.head).from)),D8t=e=>Cf(e,t=>Ae.cursor(e.lineBlockAt(t.head).to)),GOe=({state:e,dispatch:t})=>(t(xp(e,{anchor:0})),!0),KOe=({state:e,dispatch:t})=>(t(xp(e,{anchor:e.doc.length})),!0),JOe=({state:e,dispatch:t})=>(t(xp(e,{anchor:e.selection.main.anchor,head:0})),!0),exe=({state:e,dispatch:t})=>(t(xp(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),M8t=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),N8t=({state:e,dispatch:t})=>{let n=o8(e).map(({from:r,to:i})=>Ae.range(r,Math.min(i+1,e.doc.length)));return t(e.update({selection:Ae.create(n),userEvent:"select"})),!0},I8t=({state:e,dispatch:t})=>{let n=o_(e.selection,r=>{var i;let o=kr(e).resolveStack(r.from,1);for(let s=o;s;s=s.next){let{node:a}=s;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&(!((i=a.parent)===null||i===void 0)&&i.parent))return Ae.range(a.to,a.from)}return r});return t(xp(e,n)),!0},L8t=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Ae.create([n.main]):n.main.empty||(r=Ae.create([Ae.cursor(n.main.head)])),r?(t(xp(e,r)),!0):!1};function KR(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(o=>{let{from:s,to:a}=o;if(s==a){let l=t(o);l<s?(n="delete.backward",l=_N(e,l,!1)):l>s&&(n="delete.forward",l=_N(e,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=_N(e,s,!1),a=_N(e,a,!0);return s==a?{range:o}:{changes:{from:s,to:a},range:Ae.cursor(s,s<o.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?Ve.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function _N(e,t,n){if(e instanceof Ve)for(let r of e.state.facet(Ve.atomicRanges).map(i=>i(e)))r.between(t,t,(i,o)=>{i<t&&o>t&&(t=n?o:i)});return t}const Lze=(e,t)=>KR(e,n=>{let r=n.from,{state:i}=e,o=i.doc.lineAt(r),s,a;if(!t&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,r-o.from))){if(s[s.length-1]=="	")return r-1;let l=Ed(s,i.tabSize),c=l%Jb(i)||Jb(i);for(let u=0;u<c&&s[s.length-1-u]==" ";u++)r--;a=r}else a=zs(o.text,r-o.from,t,t)+o.from,a==r&&o.number!=(t?i.doc.lines:1)?a+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,r-o.from))&&(a=zs(o.text,a-o.from,!1,!1)+o.from);return a}),TG=e=>Lze(e,!1),jze=e=>Lze(e,!0),Fze=(e,t)=>KR(e,n=>{let r=n.head,{state:i}=e,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let a=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let l=zs(o.text,r-o.from,t)+o.from,c=o.text.slice(Math.min(r,l)-o.from,Math.max(r,l)-o.from),u=s(c);if(a!=null&&u!=a)break;(c!=" "||r!=n.head)&&(a=u),r=l}return r}),zze=e=>Fze(e,!1),j8t=e=>Fze(e,!0),F8t=e=>KR(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),z8t=e=>KR(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),Q8t=e=>KR(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),B8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Gn.of(["",""])},range:Ae.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},W8t=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let i=r.from,o=e.doc.lineAt(i),s=i==o.from?i-1:zs(o.text,i-o.from,!1)+o.from,a=i==o.to?i+1:zs(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:a,insert:e.doc.slice(i,a).append(e.doc.slice(s,i))},range:Ae.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function o8(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=e.doc.lineAt(r.to-1)),n>=i.number){let s=t[t.length-1];s.to=o.to,s.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function Qze(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let o of o8(e)){if(n?o.to==e.doc.length:o.from==0)continue;let s=e.doc.lineAt(n?o.to+1:o.from-1),a=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+e.lineBreak});for(let l of o.ranges)i.push(Ae.range(Math.min(e.doc.length,l.anchor+a),Math.min(e.doc.length,l.head+a)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:e.lineBreak+s.text});for(let l of o.ranges)i.push(Ae.range(l.anchor-a,l.head-a))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Ae.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const q8t=({state:e,dispatch:t})=>Qze(e,t,!1),V8t=({state:e,dispatch:t})=>Qze(e,t,!0);function Bze(e,t,n){if(e.readOnly)return!1;let r=[];for(let i of o8(e))n?r.push({from:i.from,insert:e.doc.slice(i.from,i.to)+e.lineBreak}):r.push({from:i.to,insert:e.lineBreak+e.doc.slice(i.from,i.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const U8t=({state:e,dispatch:t})=>Bze(e,t,!1),H8t=({state:e,dispatch:t})=>Bze(e,t,!0),X8t=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(o8(t).map(({from:i,to:o})=>(i>0?i--:o<t.doc.length&&o++,{from:i,to:o}))),r=o_(t.selection,i=>e.moveVertically(i,!0)).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Z8t(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=kr(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(Zt.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const Wze=qze(!1),Y8t=qze(!0);function qze(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(i=>{let{from:o,to:s}=i,a=t.doc.lineAt(o),l=!e&&o==s&&Z8t(t,o);e&&(o=s=(s<=a.to?a:t.doc.lineAt(s)).to);let c=new Zz(t,{simulateBreak:o,simulateDoubleBreak:!!l}),u=Jse(c,o);for(u==null&&(u=Ed(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));s<a.to&&/\s/.test(a.text[s-a.from]);)s++;l?{from:o,to:s}=l:o>a.from&&o<a.from+100&&!/\S/.test(a.text.slice(0,o))&&(o=a.from);let f=["",$P(t,u)];return l&&f.push($P(t,c.lineIndent(a.from,-1))),{changes:{from:o,to:s,insert:Gn.of(f)},range:Ae.cursor(o+1+f[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function pae(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let s=r.from;s<=r.to;){let a=e.doc.lineAt(s);a.number>n&&(r.empty||r.to>a.from)&&(t(a,i,r),n=a.number),s=a.to+1}let o=e.changes(i);return{changes:i,range:Ae.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const Vze=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Zz(e,{overrideIndentation:o=>{let s=n[o];return s??-1}}),i=pae(e,(o,s,a)=>{let l=Jse(r,o.from);if(l==null)return;/\S/.test(o.text)||(l=0);let c=/^\s*/.exec(o.text)[0],u=$P(e,l);(c!=u||a.from<o.from+c.length)&&(n[o.from]=l,s.push({from:o.from,to:o.from+c.length,insert:u}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0},s8=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(pae(e,(n,r)=>{r.push({from:n.from,insert:e.facet(Gg)})}),{userEvent:"input.indent"})),!0),gae=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(pae(e,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=Ed(i,e.tabSize),s=0,a=$P(e,Math.max(0,o-Jb(e)));for(;s<i.length&&s<a.length&&i.charCodeAt(s)==a.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+i.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),G8t=[{key:"Ctrl-b",run:hae,shift:Pze,preventDefault:!0},{key:"Ctrl-f",run:Oze,shift:Aze},{key:"Ctrl-p",run:Sze,shift:Mze},{key:"Ctrl-n",run:Eze,shift:Nze},{key:"Ctrl-a",run:O8t,shift:R8t},{key:"Ctrl-e",run:x8t,shift:D8t},{key:"Ctrl-d",run:jze},{key:"Ctrl-h",run:TG},{key:"Ctrl-k",run:F8t},{key:"Ctrl-Alt-h",run:zze},{key:"Ctrl-o",run:B8t},{key:"Ctrl-t",run:W8t},{key:"Ctrl-v",run:$G}],K8t=[{key:"ArrowLeft",run:hae,shift:Pze,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:h8t,shift:E8t,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:v8t,shift:P8t,preventDefault:!0},{key:"ArrowRight",run:Oze,shift:Aze,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:p8t,shift:C8t,preventDefault:!0},{mac:"Cmd-ArrowRight",run:b8t,shift:A8t,preventDefault:!0},{key:"ArrowUp",run:Sze,shift:Mze,preventDefault:!0},{mac:"Cmd-ArrowUp",run:GOe,shift:JOe},{mac:"Ctrl-ArrowUp",run:XOe,shift:ZOe},{key:"ArrowDown",run:Eze,shift:Nze,preventDefault:!0},{mac:"Cmd-ArrowDown",run:KOe,shift:exe},{mac:"Ctrl-ArrowDown",run:$G,shift:YOe},{key:"PageUp",run:XOe,shift:ZOe},{key:"PageDown",run:$G,shift:YOe},{key:"Home",run:$ze,shift:T8t,preventDefault:!0},{key:"Mod-Home",run:GOe,shift:JOe},{key:"End",run:kze,shift:$8t,preventDefault:!0},{key:"Mod-End",run:KOe,shift:exe},{key:"Enter",run:Wze},{key:"Mod-a",run:M8t},{key:"Backspace",run:TG,shift:TG},{key:"Delete",run:jze},{key:"Mod-Backspace",mac:"Alt-Backspace",run:zze},{key:"Mod-Delete",mac:"Alt-Delete",run:j8t},{mac:"Mod-Backspace",run:z8t},{mac:"Mod-Delete",run:Q8t}].concat(G8t.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),x3=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:m8t,shift:_8t},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:y8t,shift:k8t},{key:"Alt-ArrowUp",run:q8t},{key:"Shift-Alt-ArrowUp",run:U8t},{key:"Alt-ArrowDown",run:V8t},{key:"Shift-Alt-ArrowDown",run:H8t},{key:"Escape",run:L8t},{key:"Mod-Enter",run:Y8t},{key:"Alt-l",mac:"Ctrl-l",run:N8t},{key:"Mod-i",run:I8t,preventDefault:!0},{key:"Mod-[",run:gae},{key:"Mod-]",run:s8},{key:"Mod-Alt-\\",run:Vze},{key:"Shift-Mod-k",run:X8t},{key:"Shift-Mod-\\",run:S8t},{key:"Mod-/",run:Zzt},{key:"Alt-A",run:Gzt}].concat(K8t),Uze={key:"Tab",run:s8,shift:gae};function mae(e,t,n){return Math.min(Math.max(e,t),n)}function Hze(){if(Jh()){const e=Fwt();return{cellIds:e.cellIds,cellData:pn.mapValues(e.cellData,HOe),cellRuntime:pn.mapValues(e.cellRuntime,HOe),cellHandles:{},history:[],scrollKey:null,cellLogs:[]}}return{cellIds:[],cellData:{},cellRuntime:{},cellHandles:{},history:[],scrollKey:null,cellLogs:[]}}const{reducer:J8t,createActions:e9t}=ZO(Hze,{createNewCell:(e,t)=>{const{cellId:n,before:r}=t,i=e.cellIds.indexOf(n),o=r?i:i+1,s=DM.create();return{...e,cellIds:vbe(e.cellIds,o,s),cellData:{...e.cellData,[s]:O$({id:s})},cellRuntime:{...e.cellRuntime,[s]:fk()},cellHandles:{...e.cellHandles,[s]:x.createRef()},scrollKey:s}},moveCell:(e,t)=>{const{cellId:n,before:r}=t,i=e.cellIds.indexOf(n),o=e.cellIds[i];return r&&i===0?{...e,cellIds:[o,...e.cellIds.slice(1)],scrollKey:n}:!r&&i===e.cellIds.length-1?{...e,cellIds:[...e.cellIds.slice(0,-1),o],scrollKey:n}:r?{...e,cellIds:S1(e.cellIds,i,i-1),scrollKey:n}:{...e,cellIds:S1(e.cellIds,i,i+1),scrollKey:n}},dropCellOver:(e,t)=>{const{cellId:n,overCellId:r}=t,i=e.cellIds.indexOf(n),o=e.cellIds.indexOf(r);return{...e,cellIds:S1(e.cellIds,i,o),scrollKey:null}},focusCell:(e,t)=>{if(e.cellIds.length===0)return e;const{cellId:n,before:r}=t,i=e.cellIds.indexOf(n);let o=r?i-1:i+1;o=mae(o,0,e.cellIds.length-1);const s=e.cellIds[o];return Cq({cellId:s,cell:e.cellHandles[s],config:e.cellData[s].config,codeFocus:r?"bottom":"top"}),e},focusTopCell:e=>{var n;if(e.cellIds.length===0)return e;const t=e.cellIds[0];return(n=e.cellHandles[t].current)==null||n.editorView.focus(),jLt(),e},focusBottomCell:e=>{var n;if(e.cellIds.length===0)return e;const t=e.cellIds[e.cellIds.length-1];return(n=e.cellHandles[t].current)==null||n.editorView.focus(),rbe(),e},sendToTop:(e,t)=>{if(e.cellIds.length===0)return e;const{cellId:n}=t,r=e.cellIds.indexOf(n);return{...e,cellIds:S1(e.cellIds,r,0),scrollKey:n}},sendToBottom:(e,t)=>{if(e.cellIds.length===0)return e;const{cellId:n}=t,r=e.cellIds.indexOf(n);return{...e,cellIds:S1(e.cellIds,r,e.cellIds.length-1),scrollKey:n}},deleteCell:(e,t)=>{var l;const n=t.cellId;if(e.cellIds.length===1)return e;const r=e.cellIds.indexOf(n),i=e.cellIds[r],o=r===0?1:r-1,s=e.cellIds[o],a=(l=e.cellHandles[i].current)==null?void 0:l.editorView.state.toJSON({history:yze});return{...e,cellIds:D3t(e.cellIds,r),history:[...e.history,{name:e.cellData[i].name,serializedEditorState:a,index:r}],scrollKey:s}},undoDeleteCell:e=>{if(e.history.length===0)return e;{const t=e.history[e.history.length-1],{name:n,serializedEditorState:r={doc:""},index:i}=t,o=DM.create(),s=O$({id:o,name:n,code:r.doc,edited:r.doc.trim().length>0,serializedEditorState:r});return{...e,cellIds:vbe(e.cellIds,i,o),cellData:{...e.cellData,[o]:s},cellRuntime:{...e.cellRuntime,[o]:fk()},cellHandles:{...e.cellHandles,[o]:x.createRef()},history:e.history.slice(0,-1)}}},clearSerializedEditorState:(e,t)=>{const{cellId:n}=t;return Ok(e,n,r=>({...r,serializedEditorState:null}))},updateCellCode:(e,t)=>{const{cellId:n,code:r,formattingChange:i}=t;return e.cellIds.indexOf(n)===-1?e:Ok(e,n,s=>i?{...s,code:r,lastCodeRun:s.edited?s.lastCodeRun:r}:{...s,code:r,edited:r.trim()!==s.lastCodeRun})},updateCellName:(e,t)=>{const{cellId:n,name:r}=t;return Ok(e,n,i=>({...i,name:r}))},updateCellConfig:(e,t)=>{const{cellId:n,config:r}=t;return Ok(e,n,i=>({...i,config:{...i.config,...r}}))},prepareForRun:(e,t)=>{const n=Kq(e,t.cellId,r=>R3t(r));return Ok(n,t.cellId,r=>({...r,edited:!1,lastCodeRun:r.code.trim()}))},handleCellMessage:(e,t)=>{const{cellId:n,message:r}=t,i=Kq(e,n,o=>A3t(o,r));return{...i,cellLogs:[...i.cellLogs,...Hzt(r)]}},setStdinResponse:(e,t)=>{const{cellId:n,response:r,outputIndex:i}=t;return Kq(e,n,o=>{const s=[...o.consoleOutputs],a=s[i];return a.channel!=="stdin"?(At.warn("Expected stdin output"),o):(s[i]={channel:"stdin",mimetype:a.mimetype,data:a.data,timestamp:a.timestamp,response:r},{...o,interrupted:!1,consoleOutputs:s})})},setCells:(e,t)=>({...e,cellIds:t.map(n=>n.id),cellData:Object.fromEntries(t.map(n=>[n.id,n])),cellHandles:Object.fromEntries(t.map(n=>[n.id,x.createRef()])),cellRuntime:Object.fromEntries(t.map(n=>[n.id,fk()]))}),moveToNextCell:(e,t)=>{const{cellId:n,before:r,noCreate:i=!1}=t,o=e.cellIds.indexOf(n),s=r?o-1:o+1;if(s===e.cellIds.length&&!i){const a=DM.create();return{...e,cellIds:[...e.cellIds,a],cellData:{...e.cellData,[a]:O$({id:a})},cellRuntime:{...e.cellRuntime,[a]:fk()},cellHandles:{...e.cellHandles,[a]:x.createRef()}}}else if(s===-1&&!i){const a=DM.create();return{...e,cellIds:[a,...e.cellIds],cellData:{...e.cellData,[a]:O$({id:a})},cellRuntime:{...e.cellRuntime,[a]:fk()},cellHandles:{...e.cellHandles,[a]:x.createRef()}}}else{const a=e.cellIds[s];return Cq({cellId:a,cell:e.cellHandles[a],config:e.cellData[a].config,codeFocus:r?"bottom":"top"}),e}},scrollToTarget:e=>{var n;const t=e.scrollKey;if(t===null)return e;{const r=e.cellIds.indexOf(t);if(r===e.cellIds.length-1){const i=e.cellIds[e.cellIds.length-1];(n=e.cellHandles[i].current)==null||n.editorView.focus(),rbe()}else{const i=e.cellIds[r];Cq({cellId:i,cell:e.cellHandles[i],config:e.cellData[i].config,codeFocus:void 0})}return{...e,scrollKey:null}}},foldAll:e=>{const t=Object.values(e.cellHandles).map(n=>{var r;return(r=n.current)==null?void 0:r.editorView});return E6t(t),e},unfoldAll:e=>{const t=Object.values(e.cellHandles).map(n=>{var r;return(r=n.current)==null?void 0:r.editorView});return C6t(t),e},clearLogs:e=>({...e,cellLogs:[]})});function Kq(e,t,n){return t in e.cellRuntime?{...e,cellRuntime:{...e.cellRuntime,[t]:n(e.cellRuntime[t])}}:(At.warn(`Cell ${t} not found in state`),e)}function Ok(e,t,n){return t in e.cellData?{...e,cellData:{...e.cellData,[t]:n(e.cellData[t])}}:(At.warn(`Cell ${t} not found in state`),e)}const mc=hn(Hze()),t9t=hn(e=>e(mc).cellIds),Xze=hn(e=>{const{cellIds:t,cellRuntime:n,cellData:r}=e(mc);return t.map(o=>{var l;const s=n[o],{name:a}=r[o];if(((l=s.output)==null?void 0:l.mimetype)==="application/vnd.marimo+error"){const c=s.output.data.filter(u=>u.type!=="ancestor-stopped");if(c.length>0)return{output:{...s.output,data:c},cellId:o,cellName:a}}return null}).filter(Boolean)}),n9t=hn(e=>{const{cellIds:t,cellRuntime:n}=e(mc),r=t.map(i=>n[i].outline);return T3t(r)}),r9t=hn(e=>e(Xze).length),i9t=hn(e=>{const{cellIds:t,cellData:n}=e(mc);return pn.fromEntries(t.map(i=>{var o;return[i,(o=n[i])==null?void 0:o.name]}))}),s_=()=>Gi(mc),a8=()=>Gi(t9t),o9t=()=>Gi(i9t),s9t=()=>Gi(Xze),a9t=()=>Gi(mc).cellLogs,yae=()=>Tn.get(mc),l9t=()=>{const{cellIds:e,cellData:t}=Tn.get(mc);return e.map(n=>{var r;return(r=t[n])==null?void 0:r.name}).filter(Boolean)},c9t=N6t(P6t(mc,e=>e.cellIds.map(t=>e.cellData[t]))),u9t=()=>tc(c9t),Cv=()=>{const{cellIds:e,cellHandles:t}=Tn.get(mc);return e.map(n=>{var r;return(r=t[n].current)==null?void 0:r.editorView}).filter(Boolean)},Zze=e=>{var n;const{cellHandles:t}=Tn.get(mc);return(n=t[e].current)==null?void 0:n.editorView};function f9t(e){return Object.values(e.cellRuntime).some(t=>t.status==="running")}function d9t(){const{cellRuntime:e}=Tn.get(mc),t=pn.entries(e).find(([r,i])=>i.status==="running");if(!t)return;const n=Zze(t[0]);n==null||n.dispatch({selection:{anchor:0},effects:[Ve.scrollIntoView(0,{y:"center"})]})}function h9t(e,t,n){if(!n)return!1;const{cellIds:r,cellData:i}=e,o=r.map(c=>i[c]),s=o.map(c=>c.code),a=o.map(c=>c.config),l=o.map(c=>c.name);return!Aq(s,n.codes)||!Aq(a,n.configs)||!Aq(l,n.names)||!c1e(t.selectedLayout,n.layout.selectedLayout)||!c1e(t.layoutData,n.layout.layoutData)}function p9t(e){return Gze(e).length>0}function Yze(e){return e.cellIds.map(t=>e.cellData[t])}function g9t({cellHandles:e}){const t={};for(const[n,r]of pn.entries(e))r.current&&(t[n]=r.current.editorView);return t}function m9t(e){const{cellIds:t,cellData:n}=e;return t.map(r=>n[r]).filter(r=>r.config.disabled)}function y9t(e){const{cellIds:t,cellData:n}=e;return t.map(r=>n[r]).filter(r=>!r.config.disabled)}function Gze(e){const{cellIds:t,cellData:n,cellRuntime:r}=e;return t.filter(i=>n[i].edited||r[i].interrupted)}function Kze(e){const{cellIds:t,cellData:n,cellRuntime:r}=e;return t.map(i=>({...n[i],...r[i]}))}function wp(){const e=vl(mc);return x.useMemo(()=>e9t(n=>{e(r=>J8t(r,n))}),[e])}const zT=e=>{const{className:t,cellId:n,variant:r,onClick:i}=e,o=o9t()[n]??"",s=a8().indexOf(n),a=Od.create(n);return b.jsx("div",{className:be("inline-block cursor-pointer text-[var(--blue-10)] hover:underline",t),onClick:l=>{l.stopPropagation(),l.preventDefault();const c=document.getElementById(a);c===null?At.error(`Cell ${a} not found on page.`):(c.scrollIntoView({behavior:"smooth",block:"center"}),r==="destructive"&&(c.classList.add("error-outline"),setTimeout(()=>{c.classList.remove("error-outline")},1500)),r==="focus"&&(c.classList.add("focus-outline"),setTimeout(()=>{c.classList.remove("focus-outline")},1500)),i==null||i())},children:w4e(o,s)})},Xm=e=>b.jsx(zT,{...e,variant:"destructive"}),xk=e=>b.jsx(x4e,{type:"single",collapsible:!0,className:e.className,children:b.jsxs(xse,{value:"item-1",className:"text-muted-foreground border-muted-foreground-20",children:[b.jsx(wse,{className:"py-2 text-[0.84375rem]",children:"Tip:"}),b.jsx(Sse,{className:"text-[0.84375rem]",children:e.children})]})}),Jze=({errors:e,className:t})=>{let n="This cell wasn't run because it has errors",r="destructive",i="text-error";const o="my-0.5 ml-8 text-muted-foreground/40",s=e.map((l,c)=>{switch(l.type){case"syntax":case"unknown":return b.jsx("p",{children:l.msg},c);case"cycle":return b.jsxs(x.Fragment,{children:[b.jsx("p",{className:"mt-4",children:"This cell is in a cycle:"}),b.jsx("ul",{className:"list-disc",children:l.edges.map(u=>b.jsxs("li",{className:o,children:[b.jsx(Xm,{cellId:u[0]})," -> ",b.jsx(Xm,{cellId:u[1]})]},`${u[0]}-${u[1]}`))}),b.jsx(xk,{children:"Merge these cells into a single cell."})]},c);case"multiple-defs":return b.jsxs(x.Fragment,{children:[b.jsx("p",{className:"mt-4",children:`The variable '${l.name}' was defined by another cell:`}),b.jsx("ul",{className:"list-disc",children:l.cells.map(u=>b.jsx("li",{className:o,children:b.jsx(Xm,{cellId:u})},u))}),b.jsxs(xk,{children:["Try merging this cell with the above cells. Alternatively, rename '",l.name,"' to '_",l.name,"' to make the variable private to this cell."]})]},c);case"delete-nonlocal":return b.jsxs(x.Fragment,{children:[b.jsxs("div",{className:"mt-4",children:[`The variable '${l.name}' can't be deleted because it was defined by another cell (`,b.jsx(Xm,{cellId:l.cells[0]}),")"]}),b.jsxs(xk,{children:["Try refactoring so that you can delete '",l.name,"' in the cell that creates it."]})]},c);case"interruption":return n="Interrupted",b.jsx("p",{children:"This cell was interrupted and needs to be re-run."},c);case"exception":return n=l.exception_type,l.raising_cell==null?b.jsxs(x.Fragment,{children:[b.jsx("p",{children:l.msg}),b.jsx(xk,{children:"See the console area for a traceback."})]},c):b.jsxs("div",{children:[l.msg,b.jsx(Xm,{cellId:l.raising_cell}),b.jsxs(xk,{children:["Fix the error in ",b.jsx(Xm,{cellId:l.raising_cell}),", or handle the exception in with a try/except block."]})]},c);case"ancestor-stopped":return n="Ancestor stopped",r="default",i="text-secondary-foreground",b.jsxs("div",{children:[l.msg,b.jsx(Xm,{cellId:l.raising_cell})]},c);default:return Ld(l),null}}),a=b.jsx(gR,{className:"font-code font-bold mb-4",children:n});return b.jsxs(pR,{variant:r,className:be(`border-none font-code text-sm text-[0.84375rem] px-0 ${i} normal [&:has(svg)]:pl-0`,t),children:[a,b.jsx("div",{children:b.jsx("ul",{children:s})})]})},txe={};function v9t(e){const[t,n]=x.useState(txe[e]??!1);return[t,r=>{n(r),txe[e]=r}]}function b9t(e){return e==null||e.data==null||e.data===""}function vae({message:e,parsedJsonData:t={}}){const n=e.channel;switch(e.mimetype){case"text/html":return b.jsx(Y6,{className:n,html:e.data});case"text/plain":return b.jsx(Jie,{channel:n,text:e.data});case"application/json":return b.jsx(G6,{className:n,data:t,format:"auto"});case"image/png":case"image/svg+xml":case"image/tiff":case"image/avif":case"image/bmp":case"image/gif":case"image/jpeg":return b.jsx(Q5e,{className:n,src:e.data,alt:""});case"video/mp4":case"video/mpeg":return b.jsx(W5e,{className:n,src:e.data});case"application/vnd.marimo+error":return b.jsx(Jze,{errors:e.data});default:return Ld(e),null}}const RP=ie.memo(({output:e,cellId:t,stale:n,allowExpand:r,className:i})=>{const o=x.useMemo(()=>{if(!e)return;const{mimetype:s,data:a}=e;switch(s){case"application/json":return typeof a=="string"?JSON.parse(a):a;default:return}},[e]);if(e===null)return null;if(e.channel==="output"&&e.data==="")return null;{const s=n?"This output is stale":void 0,a=r?t8e:e8e;return b.jsx(Vre,{children:b.jsx(a,{title:s,cellId:t,id:`output-${t}`,className:be(n&&"marimo-output-stale",i),children:vae({message:e,parsedJsonData:o})})})}});RP.displayName="OutputArea";const e8e=ie.forwardRef((e,t)=>b.jsx("div",{ref:t,...e}));e8e.displayName="Div";const t8e=ie.memo(({cellId:e,children:t,...n})=>{const r=x.useRef(null),[i,o]=v9t(e),[s,a]=x.useState(!1);return x.useEffect(()=>{if(!r.current)return;const l=r.current,c=()=>{a(l.scrollHeight>l.clientHeight)},u=new ResizeObserver(c);return u.observe(l),()=>{u.disconnect()}},[n.id]),b.jsxs(b.Fragment,{children:[b.jsxs("div",{children:[(s||i)&&b.jsx("div",{className:"relative",children:b.jsx(St,{"data-testid":"expand-output-button",className:be("absolute top-6 -right-12 z-10",!i&&"hover-action"),onClick:()=>o(!i),size:"xs",variant:"text",children:i?b.jsx(Wt,{content:"Collapse output",side:"left",children:b.jsx(kEt,{className:"h-4 w-4"})}):b.jsx(Wt,{content:"Expand output",side:"left",children:b.jsx(KZ,{className:"h-4 w-4"})})})}),b.jsx("div",{...n,className:be("relative",n.className),ref:r,style:i?{maxHeight:"none"}:void 0,children:t})]}),b.jsx("div",{className:"increase-pointer-area-x contents"})]})});t8e.displayName="ExpandableOutput";const O9t=({value:e})=>typeof e!="object"||e===null||!("mimetype"in e&&"data"in e)?null:b.jsx("div",{className:be("flex items-center space-x-2"),children:vae({message:{channel:"output",data:e.data,mimetype:e.mimetype,timestamp:0}})});function x9t(e){if(e.length===0)return[];if(typeof e[0]!="object")return[];const t=new Map;return e.forEach(n=>{typeof n=="object"&&Object.entries(n).forEach(([r,i])=>{const o=t.get(r);o||t.set(r,{key:r,type:PG(i)?"primitive":"mime"}),o&&o.type==="primitive"&&!PG(i)&&t.set(r,{key:r,type:"mime"})})}),[...t.values()]}function n8e(e,t,n){const i=x9t(e).map(o=>({id:o.key,accessorFn:s=>s[o.key],header:({column:s})=>b.jsx(AT,{header:o.key,column:s}),cell:({renderValue:s,getValue:a})=>{const l=a();if(PG(l)){const c=s();return c==null?"":String(c)}return b.jsx(O9t,{value:l})},enableSorting:o.type==="primitive"}));return t.length>0&&i.unshift(...t),(n==="single"||n==="multi")&&i.unshift({id:"select",header:({table:o})=>n==="multi"?b.jsx(kh,{"data-testid":"select-all-checkbox",checked:o.getIsAllPageRowsSelected(),onCheckedChange:s=>o.toggleAllPageRowsSelected(!!s),"aria-label":"Select all",className:"mx-2"}):null,cell:({row:o})=>b.jsx(kh,{"data-testid":"select-row-checkbox",checked:o.getIsSelected(),onCheckedChange:s=>o.toggleSelected(!!s),"aria-label":"Select row",className:"mx-2"}),enableSorting:!1,enableHiding:!1}),i}function w9t(e){return e.map(([t,n],r)=>({id:`_row_header_${r}`,accessorFn:(i,o)=>n[o],header:({column:i})=>b.jsx(AT,{header:t,column:i}),cell:({renderValue:i})=>b.jsx("b",{children:String(i())}),enableSorting:!1}))}function PG(e){return e==null?!0:!(typeof e=="object")}function zd(e,t){const[n,r]=x.useState(void 0),[i,o]=x.useState(!0),[s,a]=x.useState(void 0);return x.useEffect(()=>{let l=!1,c=!1;const u={previous:()=>{c=!0}};return o(!0),e(u).then(f=>{l||c||(r(f),a(void 0))}).catch(f=>{l||a(f)}).finally(()=>{l||o(!1)}),()=>{l=!0}},t),{data:n,loading:i,error:s,setData:r}}function yc(e,t,n){return e.fields=t||[],e.fname=n,e}function Zi(e){return e==null?null:e.fname}function Ma(e){return e==null?null:e.fields}function r8e(e){return e.length===1?S9t(e[0]):E9t(e)}const S9t=e=>function(t){return t[e]},E9t=e=>{const t=e.length;return function(n){for(let r=0;r<t;++r)n=n[e[r]];return n}};function Le(e){throw Error(e)}function Sp(e){const t=[],n=e.length;let r=null,i=0,o="",s,a,l;e=e+"";function c(){t.push(o+e.substring(s,a)),o="",s=a+1}for(s=a=0;a<n;++a)if(l=e[a],l==="\\")o+=e.substring(s,a++),s=a;else if(l===r)c(),r=null,i=-1;else{if(r)continue;s===i&&l==='"'||s===i&&l==="'"?(s=a+1,r=l):l==="."&&!i?a>s?c():s=a+1:l==="["?(a>s&&c(),i=s=a+1):l==="]"&&(i||Le("Access path missing open bracket: "+e),i>0&&c(),i=0,s=a+1)}return i&&Le("Access path missing closing bracket: "+e),r&&Le("Access path missing closing quote: "+e),a>s&&(a++,c()),t}function hf(e,t,n){const r=Sp(e);return e=r.length===1?r[0]:e,yc((n&&n.get||r8e)(r),[e],t||e)}const JR=hf("id"),Ba=yc(e=>e,[],"identity"),my=yc(()=>0,[],"zero"),a_=yc(()=>1,[],"one"),pf=yc(()=>!0,[],"true"),Zm=yc(()=>!1,[],"false");function C9t(e,t,n){const r=[t].concat([].slice.call(n));console[e].apply(console,r)}const i8e=0,bae=1,Oae=2,o8e=3,s8e=4;function xae(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:C9t,r=e||i8e;return{level(i){return arguments.length?(r=+i,this):r},error(){return r>=bae&&n(t||"error","ERROR",arguments),this},warn(){return r>=Oae&&n(t||"warn","WARN",arguments),this},info(){return r>=o8e&&n(t||"log","INFO",arguments),this},debug(){return r>=s8e&&n(t||"log","DEBUG",arguments),this}}}var ze=Array.isArray;function dt(e){return e===Object(e)}const nxe=e=>e!=="__proto__";function l_(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((r,i)=>{for(const o in i)if(o==="signals")r.signals=_9t(r.signals,i.signals);else{const s=o==="legend"?{layout:1}:o==="style"?!0:null;c_(r,o,i[o],s)}return r},{})}function c_(e,t,n,r){if(!nxe(t))return;let i,o;if(dt(n)&&!ze(n)){o=dt(e[t])?e[t]:e[t]={};for(i in n)r&&(r===!0||r[i])?c_(o,i,n[i]):nxe(i)&&(o[i]=n[i])}else e[t]=n}function _9t(e,t){if(e==null)return t;const n={},r=[];function i(o){n[o.name]||(n[o.name]=1,r.push(o))}return t.forEach(i),e.forEach(i),r}function jn(e){return e[e.length-1]}function $a(e){return e==null||e===""?null:+e}const a8e=e=>t=>e*Math.exp(t),l8e=e=>t=>Math.log(e*t),c8e=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),u8e=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,w3=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function l8(e,t,n,r){const i=n(e[0]),o=n(jn(e)),s=(o-i)*t;return[r(i-s),r(o-s)]}function f8e(e,t){return l8(e,t,$a,Ba)}function d8e(e,t){var n=Math.sign(e[0]);return l8(e,t,l8e(n),a8e(n))}function h8e(e,t,n){return l8(e,t,w3(n),w3(1/n))}function p8e(e,t,n){return l8(e,t,c8e(n),u8e(n))}function c8(e,t,n,r,i){const o=r(e[0]),s=r(jn(e)),a=t!=null?r(t):(o+s)/2;return[i(a+(o-a)*n),i(a+(s-a)*n)]}function wae(e,t,n){return c8(e,t,n,$a,Ba)}function Sae(e,t,n){const r=Math.sign(e[0]);return c8(e,t,n,l8e(r),a8e(r))}function S3(e,t,n,r){return c8(e,t,n,w3(r),w3(1/r))}function Eae(e,t,n,r){return c8(e,t,n,c8e(r),u8e(r))}function g8e(e){return 1+~~(new Date(e).getMonth()/3)}function m8e(e){return 1+~~(new Date(e).getUTCMonth()/3)}function ct(e){return e!=null?ze(e)?e:[e]:[]}function y8e(e,t,n){let r=e[0],i=e[1],o;return i<r&&(o=i,i=r,r=o),o=i-r,o>=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-o),r+o]}function ln(e){return typeof e=="function"}const k9t="descending";function Cae(e,t,n){n=n||{},t=ct(t)||[];const r=[],i=[],o={},s=n.comparator||$9t;return ct(e).forEach((a,l)=>{a!=null&&(r.push(t[l]===k9t?-1:1),i.push(a=ln(a)?a:hf(a,null,n)),(Ma(a)||[]).forEach(c=>o[c]=1))}),i.length===0?null:yc(s(i,r),Object.keys(o))}const u8=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),$9t=(e,t)=>e.length===1?T9t(e[0],t[0]):P9t(e,t,e.length),T9t=(e,t)=>function(n,r){return u8(e(n),e(r))*t},P9t=(e,t,n)=>(t.push(0),function(r,i){let o,s=0,a=-1;for(;s===0&&++a<n;)o=e[a],s=u8(o(r),o(i));return s*t[a]});function Wa(e){return ln(e)?e:()=>e}function _ae(e,t){let n;return r=>{n&&clearTimeout(n),n=setTimeout(()=>(t(r),n=null),e)}}function an(e){for(let t,n,r=1,i=arguments.length;r<i;++r){t=arguments[r];for(n in t)e[n]=t[n]}return e}function rp(e,t){let n=0,r,i,o,s;if(e&&(r=e.length))if(t==null){for(i=e[n];n<r&&(i==null||i!==i);i=e[++n]);for(o=s=i;n<r;++n)i=e[n],i!=null&&(i<o&&(o=i),i>s&&(s=i))}else{for(i=t(e[n]);n<r&&(i==null||i!==i);i=t(e[++n]));for(o=s=i;n<r;++n)i=t(e[n]),i!=null&&(i<o&&(o=i),i>s&&(s=i))}return[o,s]}function v8e(e,t){const n=e.length;let r=-1,i,o,s,a,l;if(t==null){for(;++r<n;)if(o=e[r],o!=null&&o>=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++r<n;)o=e[r],o!=null&&(i>o&&(i=o,a=r),s<o&&(s=o,l=r))}else{for(;++r<n;)if(o=t(e[r],r,e),o!=null&&o>=o){i=s=o;break}if(r===n)return[-1,-1];for(a=l=r;++r<n;)o=t(e[r],r,e),o!=null&&(i>o&&(i=o,a=r),s<o&&(s=o,l=r))}return[a,l]}const A9t=Object.prototype.hasOwnProperty;function Nt(e,t){return A9t.call(e,t)}const kN={};function u_(e){let t={},n;function r(o){return Nt(t,o)&&t[o]!==kN}const i={size:0,empty:0,object:t,has:r,get(o){return r(o)?t[o]:void 0},set(o,s){return r(o)||(++i.size,t[o]===kN&&--i.empty),t[o]=s,this},delete(o){return r(o)&&(--i.size,++i.empty,t[o]=kN),this},clear(){i.size=i.empty=0,i.object=t={}},test(o){return arguments.length?(n=o,i):n},clean(){const o={};let s=0;for(const a in t){const l=t[a];l!==kN&&(!n||!n(l))&&(o[a]=l,++s)}i.size=s,i.empty=0,i.object=t=o}};return e&&Object.keys(e).forEach(o=>{i.set(o,e[o])}),i}function b8e(e,t,n,r,i,o){if(!n&&n!==0)return o;const s=+n;let a=e[0],l=jn(e),c;l<a&&(c=a,a=l,l=c),c=Math.abs(t-a);const u=Math.abs(l-t);return c<u&&c<=s?r:u<=s?i:o}function Ke(e,t,n){const r=e.prototype=Object.create(t.prototype);return Object.defineProperty(r,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),an(r,n)}function Ww(e,t,n,r){let i=t[0],o=t[t.length-1],s;return i>o&&(s=i,i=o,o=s),n=n===void 0||n,r=r===void 0||r,(n?i<=e:i<e)&&(r?e<=o:e<o)}function _v(e){return typeof e=="boolean"}function t0(e){return Object.prototype.toString.call(e)==="[object Date]"}function O8e(e){return e&&ln(e[Symbol.iterator])}function Hn(e){return typeof e=="number"}function x8e(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function ut(e){return typeof e=="string"}function kae(e,t,n){e&&(e=t?ct(e).map(a=>a.replace(/\\(.)/g,"$1")):ct(e));const r=e&&e.length,i=n&&n.get||r8e,o=a=>i(t?[a]:Sp(a));let s;if(!r)s=function(){return""};else if(r===1){const a=o(e[0]);s=function(l){return""+a(l)}}else{const a=e.map(o);s=function(l){let c=""+a[0](l),u=0;for(;++u<r;)c+="|"+a[u](l);return c}}return yc(s,e,"key")}function w8e(e,t){const n=e[0],r=jn(e),i=+t;return i?i===1?r:n+i*(r-n):n}const R9t=1e4;function S8e(e){e=+e||R9t;let t,n,r;const i=()=>{t={},n={},r=0},o=(s,a)=>(++r>e&&(n=t,t={},r=1),t[s]=a);return i(),{clear:i,has:s=>Nt(t,s)||Nt(n,s),get:s=>Nt(t,s)?t[s]:Nt(n,s)?o(s,n[s]):void 0,set:(s,a)=>Nt(t,s)?t[s]=a:o(s,a)}}function E8e(e,t,n,r){const i=t.length,o=n.length;if(!o)return t;if(!i)return n;const s=r||new t.constructor(i+o);let a=0,l=0,c=0;for(;a<i&&l<o;++c)s[c]=e(t[a],n[l])>0?n[l++]:t[a++];for(;a<i;++a,++c)s[c]=t[a];for(;l<o;++l,++c)s[c]=n[l];return s}function _$(e,t){let n="";for(;--t>=0;)n+=e;return n}function C8e(e,t,n,r){const i=n||" ",o=e+"",s=t-o.length;return s<=0?o:r==="left"?_$(i,s)+o:r==="center"?_$(i,~~(s/2))+o+_$(i,Math.ceil(s/2)):o+_$(i,s)}function eD(e){return e&&jn(e)-e[0]||0}function Je(e){return ze(e)?"["+e.map(Je)+"]":dt(e)||ut(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function $ae(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const D9t=e=>Hn(e)||t0(e)?e:Date.parse(e);function Tae(e,t){return t=t||D9t,e==null||e===""?null:t(e)}function Pae(e){return e==null||e===""?null:e+""}function kd(e){const t={},n=e.length;for(let r=0;r<n;++r)t[e[r]]=!0;return t}function _8e(e,t,n,r){const i=r??"…",o=e+"",s=o.length,a=Math.max(0,t-i.length);return s<=t?o:n==="left"?i+o.slice(s-a):n==="center"?o.slice(0,Math.ceil(a/2))+i+o.slice(s-~~(a/2)):o.slice(0,a)+i}function oy(e,t,n){if(e)if(t){const r=e.length;for(let i=0;i<r;++i){const o=t(e[i]);o&&n(o,i,e)}}else e.forEach(n)}var rxe={},Jq={},eV=34,wk=10,tV=13;function k8e(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function M9t(e,t){var n=k8e(e);return function(r,i){return t(n(r),i,e)}}function ixe(e){var t=Object.create(null),n=[];return e.forEach(function(r){for(var i in r)i in t||n.push(t[i]=i)}),n}function Rl(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function N9t(e){return e<0?"-"+Rl(-e,6):e>9999?"+"+Rl(e,6):Rl(e,4)}function I9t(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":N9t(e.getUTCFullYear())+"-"+Rl(e.getUTCMonth()+1,2)+"-"+Rl(e.getUTCDate(),2)+(i?"T"+Rl(t,2)+":"+Rl(n,2)+":"+Rl(r,2)+"."+Rl(i,3)+"Z":r?"T"+Rl(t,2)+":"+Rl(n,2)+":"+Rl(r,2)+"Z":n||t?"T"+Rl(t,2)+":"+Rl(n,2)+"Z":"")}function L9t(e){var t=new RegExp('["'+e+`
\r]`),n=e.charCodeAt(0);function r(f,d){var h,p,g=i(f,function(v,y){if(h)return h(v,y-1);p=v,h=d?M9t(v,d):k8e(v)});return g.columns=p||[],g}function i(f,d){var h=[],p=f.length,g=0,v=0,y,O=p<=0,m=!1;f.charCodeAt(p-1)===wk&&--p,f.charCodeAt(p-1)===tV&&--p;function w(){if(O)return Jq;if(m)return m=!1,rxe;var E,C=g,k;if(f.charCodeAt(C)===eV){for(;g++<p&&f.charCodeAt(g)!==eV||f.charCodeAt(++g)===eV;);return(E=g)>=p?O=!0:(k=f.charCodeAt(g++))===wk?m=!0:k===tV&&(m=!0,f.charCodeAt(g)===wk&&++g),f.slice(C+1,E-1).replace(/""/g,'"')}for(;g<p;){if((k=f.charCodeAt(E=g++))===wk)m=!0;else if(k===tV)m=!0,f.charCodeAt(g)===wk&&++g;else if(k!==n)continue;return f.slice(C,E)}return O=!0,f.slice(C,p)}for(;(y=w())!==Jq;){for(var S=[];y!==rxe&&y!==Jq;)S.push(y),y=w();d&&(S=d(S,v++))==null||h.push(S)}return h}function o(f,d){return f.map(function(h){return d.map(function(p){return u(h[p])}).join(e)})}function s(f,d){return d==null&&(d=ixe(f)),[d.map(u).join(e)].concat(o(f,d)).join(`
`)}function a(f,d){return d==null&&(d=ixe(f)),o(f,d).join(`
`)}function l(f){return f.map(c).join(`
`)}function c(f){return f.map(u).join(e)}function u(f){return f==null?"":f instanceof Date?I9t(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:s,formatBody:a,formatRows:l,formatRow:c,formatValue:u}}function j9t(e){return e}function F9t(e){if(e==null)return j9t;var t,n,r=e.scale[0],i=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var c=2,u=a.length,f=new Array(u);for(f[0]=(t+=a[0])*r+o,f[1]=(n+=a[1])*i+s;c<u;)f[c]=a[c],++c;return f}}function z9t(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function Q9t(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return oxe(e,n)})}:oxe(e,t)}function oxe(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,o=$8e(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:o}:r==null?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function $8e(e,t){var n=F9t(e.transform),r=e.arcs;function i(u,f){f.length&&f.pop();for(var d=r[u<0?~u:u],h=0,p=d.length;h<p;++h)f.push(n(d[h],h));u<0&&z9t(f,p)}function o(u){return n(u)}function s(u){for(var f=[],d=0,h=u.length;d<h;++d)i(u[d],f);return f.length<2&&f.push(f[0]),f}function a(u){for(var f=s(u);f.length<4;)f.push(f[0]);return f}function l(u){return u.map(a)}function c(u){var f=u.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:u.geometries.map(c)};case"Point":d=o(u.coordinates);break;case"MultiPoint":d=u.coordinates.map(o);break;case"LineString":d=s(u.arcs);break;case"MultiLineString":d=u.arcs.map(s);break;case"Polygon":d=l(u.arcs);break;case"MultiPolygon":d=u.arcs.map(l);break;default:return null}return{type:f,coordinates:d}}return c(t)}function B9t(e,t){var n={},r={},i={},o=[],s=-1;t.forEach(function(c,u){var f=e.arcs[c<0?~c:c],d;f.length<3&&!f[1][0]&&!f[1][1]&&(d=t[++s],t[s]=c,t[u]=d)}),t.forEach(function(c){var u=a(c),f=u[0],d=u[1],h,p;if(h=i[f])if(delete i[h.end],h.push(c),h.end=d,p=r[d]){delete r[p.start];var g=p===h?h:h.concat(p);r[g.start=h.start]=i[g.end=p.end]=g}else r[h.start]=i[h.end]=h;else if(h=r[d])if(delete r[h.start],h.unshift(c),h.start=f,p=i[f]){delete i[p.end];var v=p===h?h:p.concat(h);r[v.start=p.start]=i[v.end=h.end]=v}else r[h.start]=i[h.end]=h;else h=[c],r[h.start=f]=i[h.end=d]=h});function a(c){var u=e.arcs[c<0?~c:c],f=u[0],d;return e.transform?(d=[0,0],u.forEach(function(h){d[0]+=h[0],d[1]+=h[1]})):d=u[u.length-1],c<0?[d,f]:[f,d]}function l(c,u){for(var f in c){var d=c[f];delete u[d.start],delete d.start,delete d.end,d.forEach(function(h){n[h<0?~h:h]=1}),o.push(d)}}return l(i,r),l(r,i),t.forEach(function(c){n[c<0?~c:c]||o.push([c])}),o}function W9t(e){return $8e(e,q9t.apply(this,arguments))}function q9t(e,t,n){var r,i,o;if(arguments.length>1)r=V9t(e,t,n);else for(i=0,r=new Array(o=e.arcs.length);i<o;++i)r[i]=i;return{type:"MultiLineString",arcs:B9t(e,r)}}function V9t(e,t,n){var r=[],i=[],o;function s(f){var d=f<0?~f:f;(i[d]||(i[d]=[])).push({i:f,g:o})}function a(f){f.forEach(s)}function l(f){f.forEach(a)}function c(f){f.forEach(l)}function u(f){switch(o=f,f.type){case"GeometryCollection":f.geometries.forEach(u);break;case"LineString":a(f.arcs);break;case"MultiLineString":case"Polygon":l(f.arcs);break;case"MultiPolygon":c(f.arcs);break}}return u(t),i.forEach(n==null?function(f){r.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&r.push(f[0].i)}),r}function Pg(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function U9t(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function f_(e){let t,n,r;e.length!==2?(t=Pg,n=(a,l)=>Pg(e(a),l),r=(a,l)=>e(a)-l):(t=e===Pg||e===U9t?e:H9t,n=e,r=e);function i(a,l,c=0,u=a.length){if(c<u){if(t(l,l)!==0)return u;do{const f=c+u>>>1;n(a[f],l)<0?c=f+1:u=f}while(c<u)}return c}function o(a,l,c=0,u=a.length){if(c<u){if(t(l,l)!==0)return u;do{const f=c+u>>>1;n(a[f],l)<=0?c=f+1:u=f}while(c<u)}return c}function s(a,l,c=0,u=a.length){const f=i(a,l,c,u-1);return f>c&&r(a[f-1],l)>-r(a[f],l)?f-1:f}return{left:i,center:s,right:o}}function H9t(){return 0}function T8e(e){return e===null?NaN:+e}function*X9t(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const P8e=f_(Pg),F0=P8e.right,Z9t=P8e.left;f_(T8e).center;function Y9t(e,t){let n=0,r,i=0,o=0;if(t===void 0)for(let s of e)s!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i));else{let s=-1;for(let a of e)(a=t(a,++s,e))!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i))}if(n>1)return o/(n-1)}function G9t(e,t){const n=Y9t(e,t);return n&&Math.sqrt(n)}class pl{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],s=t+o,a=Math.abs(t)<Math.abs(o)?t-(s-o):o-(s-t);a&&(n[r++]=a),t=s}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,o,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,i=t[--n],s=r+i,o=i-(s-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=s+i,i==r-s&&(s=r))}return s}}class sxe extends Map{constructor(t,n=D8e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(AG(this,t))}has(t){return super.has(AG(this,t))}set(t,n){return super.set(A8e(this,t),n)}delete(t){return super.delete(R8e(this,t))}}class E3 extends Set{constructor(t,n=D8e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const r of t)this.add(r)}has(t){return super.has(AG(this,t))}add(t){return super.add(A8e(this,t))}delete(t){return super.delete(R8e(this,t))}}function AG({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function A8e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function R8e({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function D8e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function K9t(e,t){return Array.from(t,n=>e[n])}function J9t(e=Pg){if(e===Pg)return M8e;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function M8e(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const eQt=Math.sqrt(50),tQt=Math.sqrt(10),nQt=Math.sqrt(2);function C3(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=eQt?10:o>=tQt?5:o>=nQt?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?C3(e,t,n*2):[a,l,c]}function RG(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,s]=r?C3(t,e,n):C3(e,t,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let c=0;c<a;++c)l[c]=(o-c)/-s;else for(let c=0;c<a;++c)l[c]=(o-c)*s;else if(s<0)for(let c=0;c<a;++c)l[c]=(i+c)/-s;else for(let c=0;c<a;++c)l[c]=(i+c)*s;return l}function DG(e,t,n){return t=+t,e=+e,n=+n,C3(e,t,n)[2]}function z0(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?DG(t,e,n):DG(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function ob(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function MG(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function N8e(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?M8e:J9t(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(t-c*f/l+d)),p=Math.min(r,Math.floor(t+(l-c)*f/l+d));N8e(e,t,h,p,i)}const o=e[t];let s=n,a=r;for(Sk(e,n,t),i(e[r],o)>0&&Sk(e,n,r);s<a;){for(Sk(e,s,a),++s,--a;i(e[s],o)<0;)++s;for(;i(e[a],o)>0;)--a}i(e[n],o)===0?Sk(e,n,a):(++a,Sk(e,a,r)),a<=t&&(n=a+1),t<=a&&(r=a-1)}return e}function Sk(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function NG(e,t,n){if(e=Float64Array.from(X9t(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return MG(e);if(t>=1)return ob(e);var r,i=(r-1)*t,o=Math.floor(i),s=ob(N8e(e,o).subarray(0,o+1)),a=MG(e.subarray(o+1));return s+(a-s)*(i-o)}}function I8e(e,t,n=T8e){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),s=+n(e[o],o,e),a=+n(e[o+1],o+1,e);return s+(a-s)*(i-o)}}function rQt(e,t){let n=0,r=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function L8e(e,t){return NG(e,.5,t)}function*iQt(e){for(const t of e)yield*t}function j8e(e){return Array.from(iQt(e))}function Qc(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function F8e(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function oQt(e,...t){e=new E3(e),t=t.map(sQt);e:for(const n of e)for(const r of t)if(!r.has(n)){e.delete(n);continue e}return e}function sQt(e){return e instanceof E3?e:new E3(e)}function aQt(...e){const t=new E3;for(const n of e)for(const r of n)t.add(r);return t}function lQt(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function _3(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function SE(e){return e=_3(Math.abs(e)),e?e[1]:NaN}function cQt(e,t){return function(n,r){for(var i=n.length,o=[],s=0,a=e[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=e[s=(s+1)%e.length];return o.reverse().join(t)}}function uQt(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var fQt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function nO(e){if(!(t=fQt.exec(e)))throw new Error("invalid format: "+e);var t;return new Aae({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}nO.prototype=Aae.prototype;function Aae(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Aae.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function dQt(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var z8e;function hQt(e,t){var n=_3(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(z8e=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+_3(e,Math.max(0,t+o-1))[0]}function axe(e,t){var n=_3(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const lxe={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:lQt,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>axe(e*100,t),r:axe,s:hQt,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function cxe(e){return e}var uxe=Array.prototype.map,fxe=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Q8e(e){var t=e.grouping===void 0||e.thousands===void 0?cxe:cQt(uxe.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?cxe:uQt(uxe.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(f){f=nO(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,v=f.zero,y=f.width,O=f.comma,m=f.precision,w=f.trim,S=f.type;S==="n"?(O=!0,S="g"):lxe[S]||(m===void 0&&(m=12),w=!0,S="g"),(v||d==="0"&&h==="=")&&(v=!0,d="0",h="=");var E=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",C=g==="$"?r:/[%p]/.test(S)?s:"",k=lxe[S],P=/[defgprs%]/.test(S);m=m===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m));function D(M){var L=E,A=C,T,N,j;if(S==="c")A=k(M)+A,M="";else{M=+M;var z=M<0||1/M<0;if(M=isNaN(M)?l:k(Math.abs(M),m),w&&(M=dQt(M)),z&&+M==0&&p!=="+"&&(z=!1),L=(z?p==="("?p:a:p==="-"||p==="("?"":p)+L,A=(S==="s"?fxe[8+z8e/3]:"")+A+(z&&p==="("?")":""),P){for(T=-1,N=M.length;++T<N;)if(j=M.charCodeAt(T),48>j||j>57){A=(j===46?i+M.slice(T+1):M.slice(T))+A,M=M.slice(0,T);break}}}O&&!v&&(M=t(M,1/0));var W=L.length+M.length+A.length,F=W<y?new Array(y-W+1).join(d):"";switch(O&&v&&(M=t(F+M,F.length?y-A.length:1/0),F=""),h){case"<":M=L+M+A+F;break;case"=":M=L+F+M+A;break;case"^":M=F.slice(0,W=F.length>>1)+L+M+A+F.slice(W);break;default:M=F+L+M+A;break}return o(M)}return D.toString=function(){return f+""},D}function u(f,d){var h=c((f=nO(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(SE(d)/3)))*3,g=Math.pow(10,-p),v=fxe[8+p/3];return function(y){return h(g*y)+v}}return{format:c,formatPrefix:u}}var $N,f8,Rae;pQt({thousands:",",grouping:[3],currency:["$",""]});function pQt(e){return $N=Q8e(e),f8=$N.format,Rae=$N.formatPrefix,$N}function B8e(e){return Math.max(0,-SE(Math.abs(e)))}function W8e(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(SE(t)/3)))*3-SE(Math.abs(e)))}function q8e(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,SE(t)-SE(e))+1}const nV=new Date,rV=new Date;function Ko(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s<a-o?s:a},i.offset=(o,s)=>(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return l;let c;do l.push(c=new Date(+o)),t(o,a),e(o);while(c<o&&o<s);return l},i.filter=o=>Ko(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;t(s,-1),!o(s););else for(;--a>=0;)for(;t(s,1),!o(s););}),n&&(i.count=(o,s)=>(nV.setTime(+o),rV.setTime(+s),e(nV),e(rV),Math.floor(n(nV,rV))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const EE=Ko(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);EE.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ko(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):EE);EE.range;const gg=1e3,Uu=gg*60,mg=Uu*60,Kg=mg*24,Dae=Kg*7,dxe=Kg*30,iV=Kg*365,yg=Ko(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*gg)},(e,t)=>(t-e)/gg,e=>e.getUTCSeconds());yg.range;const d8=Ko(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*gg)},(e,t)=>{e.setTime(+e+t*Uu)},(e,t)=>(t-e)/Uu,e=>e.getMinutes());d8.range;const h8=Ko(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Uu)},(e,t)=>(t-e)/Uu,e=>e.getUTCMinutes());h8.range;const p8=Ko(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*gg-e.getMinutes()*Uu)},(e,t)=>{e.setTime(+e+t*mg)},(e,t)=>(t-e)/mg,e=>e.getHours());p8.range;const g8=Ko(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*mg)},(e,t)=>(t-e)/mg,e=>e.getUTCHours());g8.range;const Ag=Ko(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Uu)/Kg,e=>e.getDate()-1);Ag.range;const n0=Ko(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Kg,e=>e.getUTCDate()-1);n0.range;const V8e=Ko(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Kg,e=>Math.floor(e/Kg));V8e.range;function KO(e){return Ko(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Uu)/Dae)}const d_=KO(0),k3=KO(1),gQt=KO(2),mQt=KO(3),CE=KO(4),yQt=KO(5),vQt=KO(6);d_.range;k3.range;gQt.range;mQt.range;CE.range;yQt.range;vQt.range;function JO(e){return Ko(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Dae)}const h_=JO(0),$3=JO(1),bQt=JO(2),OQt=JO(3),_E=JO(4),xQt=JO(5),wQt=JO(6);h_.range;$3.range;bQt.range;OQt.range;_E.range;xQt.range;wQt.range;const DP=Ko(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());DP.range;const MP=Ko(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());MP.range;const ip=Ko(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());ip.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ko(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});ip.range;const op=Ko(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());op.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ko(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});op.range;function U8e(e,t,n,r,i,o){const s=[[yg,1,gg],[yg,5,5*gg],[yg,15,15*gg],[yg,30,30*gg],[o,1,Uu],[o,5,5*Uu],[o,15,15*Uu],[o,30,30*Uu],[i,1,mg],[i,3,3*mg],[i,6,6*mg],[i,12,12*mg],[r,1,Kg],[r,2,2*Kg],[n,1,Dae],[t,1,dxe],[t,3,3*dxe],[e,1,iV]];function a(c,u,f){const d=u<c;d&&([c,u]=[u,c]);const h=f&&typeof f.range=="function"?f:l(c,u,f),p=h?h.range(c,+u+1):[];return d?p.reverse():p}function l(c,u,f){const d=Math.abs(u-c)/f,h=f_(([,,v])=>v).right(s,d);if(h===s.length)return e.every(z0(c/iV,u/iV,f));if(h===0)return EE.every(Math.max(z0(c,u,f),1));const[p,g]=s[d/s[h-1][2]<s[h][2]/d?h-1:h];return p.every(g)}return[a,l]}const[SQt,EQt]=U8e(op,MP,h_,V8e,g8,h8),[CQt,_Qt]=U8e(ip,DP,d_,Ag,p8,d8),qs="year",ic="quarter",Na="month",Ho="week",oc="date",_a="day",sp="dayofyear",nu="hours",ru="minutes",gf="seconds",$d="milliseconds",Mae=[qs,ic,Na,Ho,oc,_a,sp,nu,ru,gf,$d],oV=Mae.reduce((e,t,n)=>(e[t]=1+n,e),{});function Nae(e){const t=ct(e).slice(),n={};return t.length||Le("Missing time unit."),t.forEach(i=>{Nt(oV,i)?n[i]=1:Le(`Invalid time unit: ${i}.`)}),(n[Ho]||n[_a]?1:0)+(n[ic]||n[Na]||n[oc]?1:0)+(n[sp]?1:0)>1&&Le(`Incompatible time units: ${e}`),t.sort((i,o)=>oV[i]-oV[o]),t}const kQt={[qs]:"%Y ",[ic]:"Q%q ",[Na]:"%b ",[oc]:"%d ",[Ho]:"W%U ",[_a]:"%a ",[sp]:"%j ",[nu]:"%H:00",[ru]:"00:%M",[gf]:":%S",[$d]:".%L",[`${qs}-${Na}`]:"%Y-%m ",[`${qs}-${Na}-${oc}`]:"%Y-%m-%d ",[`${nu}-${ru}`]:"%H:%M"};function H8e(e,t){const n=an({},kQt,t),r=Nae(e),i=r.length;let o="",s=0,a,l;for(s=0;s<i;)for(a=r.length;a>s;--a)if(l=r.slice(s,a).join("-"),n[l]!=null){o+=n[l],s=a;break}return o.trim()}const C1=new Date;function Iae(e){return C1.setFullYear(e),C1.setMonth(0),C1.setDate(1),C1.setHours(0,0,0,0),C1}function X8e(e){return Y8e(new Date(e))}function Z8e(e){return IG(new Date(e))}function Y8e(e){return Ag.count(Iae(e.getFullYear())-1,e)}function IG(e){return d_.count(Iae(e.getFullYear())-1,e)}function LG(e){return Iae(e).getDay()}function $Qt(e,t,n,r,i,o,s){if(0<=e&&e<100){const a=new Date(-1,t,n,r,i,o,s);return a.setFullYear(e),a}return new Date(e,t,n,r,i,o,s)}function G8e(e){return J8e(new Date(e))}function K8e(e){return jG(new Date(e))}function J8e(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return n0.count(t-1,e)}function jG(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return h_.count(t-1,e)}function FG(e){return C1.setTime(Date.UTC(e,0,1)),C1.getUTCDay()}function TQt(e,t,n,r,i,o,s){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,r,i,o,s));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,r,i,o,s))}function e9e(e,t,n,r,i){const o=t||1,s=jn(e),a=(y,O,m)=>(m=m||y,PQt(n[m],r[m],y===s&&o,O)),l=new Date,c=kd(e),u=c[qs]?a(qs):Wa(2012),f=c[Na]?a(Na):c[ic]?a(ic):my,d=c[Ho]&&c[_a]?a(_a,1,Ho+_a):c[Ho]?a(Ho,1):c[_a]?a(_a,1):c[oc]?a(oc,1):c[sp]?a(sp,1):a_,h=c[nu]?a(nu):my,p=c[ru]?a(ru):my,g=c[gf]?a(gf):my,v=c[$d]?a($d):my;return function(y){l.setTime(+y);const O=u(l);return i(O,f(l),d(l,O),h(l),p(l),g(l),v(l))}}function PQt(e,t,n,r){const i=n<=1?e:r?(o,s)=>r+n*Math.floor((e(o,s)-r)/n):(o,s)=>n*Math.floor(e(o,s)/n);return t?(o,s)=>t(i(o,s),s):i}function kE(e,t,n){return t+e*7-(n+6)%7}const AQt={[qs]:e=>e.getFullYear(),[ic]:e=>Math.floor(e.getMonth()/3),[Na]:e=>e.getMonth(),[oc]:e=>e.getDate(),[nu]:e=>e.getHours(),[ru]:e=>e.getMinutes(),[gf]:e=>e.getSeconds(),[$d]:e=>e.getMilliseconds(),[sp]:e=>Y8e(e),[Ho]:e=>IG(e),[Ho+_a]:(e,t)=>kE(IG(e),e.getDay(),LG(t)),[_a]:(e,t)=>kE(1,e.getDay(),LG(t))},RQt={[ic]:e=>3*e,[Ho]:(e,t)=>kE(e,0,LG(t))};function t9e(e,t){return e9e(e,t||1,AQt,RQt,$Qt)}const DQt={[qs]:e=>e.getUTCFullYear(),[ic]:e=>Math.floor(e.getUTCMonth()/3),[Na]:e=>e.getUTCMonth(),[oc]:e=>e.getUTCDate(),[nu]:e=>e.getUTCHours(),[ru]:e=>e.getUTCMinutes(),[gf]:e=>e.getUTCSeconds(),[$d]:e=>e.getUTCMilliseconds(),[sp]:e=>J8e(e),[Ho]:e=>jG(e),[_a]:(e,t)=>kE(1,e.getUTCDay(),FG(t)),[Ho+_a]:(e,t)=>kE(jG(e),e.getUTCDay(),FG(t))},MQt={[ic]:e=>3*e,[Ho]:(e,t)=>kE(e,0,FG(t))};function n9e(e,t){return e9e(e,t||1,DQt,MQt,TQt)}const NQt={[qs]:ip,[ic]:DP.every(3),[Na]:DP,[Ho]:d_,[oc]:Ag,[_a]:Ag,[sp]:Ag,[nu]:p8,[ru]:d8,[gf]:yg,[$d]:EE},IQt={[qs]:op,[ic]:MP.every(3),[Na]:MP,[Ho]:h_,[oc]:n0,[_a]:n0,[sp]:n0,[nu]:g8,[ru]:h8,[gf]:yg,[$d]:EE};function p_(e){return NQt[e]}function g_(e){return IQt[e]}function r9e(e,t,n){return e?e.offset(t,n):void 0}function i9e(e,t,n){return r9e(p_(e),t,n)}function o9e(e,t,n){return r9e(g_(e),t,n)}function s9e(e,t,n,r){return e?e.range(t,n,r):void 0}function a9e(e,t,n,r){return s9e(p_(e),t,n,r)}function l9e(e,t,n,r){return s9e(g_(e),t,n,r)}const k$=1e3,$$=k$*60,T$=$$*60,m8=T$*24,LQt=m8*7,hxe=m8*30,zG=m8*365,c9e=[qs,Na,oc,nu,ru,gf,$d],P$=c9e.slice(0,-1),A$=P$.slice(0,-1),R$=A$.slice(0,-1),jQt=R$.slice(0,-1),FQt=[qs,Ho],pxe=[qs,Na],u9e=[qs],Ek=[[P$,1,k$],[P$,5,5*k$],[P$,15,15*k$],[P$,30,30*k$],[A$,1,$$],[A$,5,5*$$],[A$,15,15*$$],[A$,30,30*$$],[R$,1,T$],[R$,3,3*T$],[R$,6,6*T$],[R$,12,12*T$],[jQt,1,m8],[FQt,1,LQt],[pxe,1,hxe],[pxe,3,3*hxe],[u9e,1,zG]];function f9e(e){const t=e.extent,n=e.maxbins||40,r=Math.abs(eD(t))/n;let i=f_(a=>a[2]).right(Ek,r),o,s;return i===Ek.length?(o=u9e,s=z0(t[0]/zG,t[1]/zG,n)):i?(i=Ek[r/Ek[i-1][2]<Ek[i][2]/r?i-1:i],o=i[0],s=i[1]):(o=c9e,s=Math.max(z0(t[0],t[1],n),1)),{units:o,step:s}}function sV(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function aV(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ck(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function d9e(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,c=_k(i),u=kk(i),f=_k(o),d=kk(o),h=_k(s),p=kk(s),g=_k(a),v=kk(a),y=_k(l),O=kk(l),m={a:z,A:W,b:F,B:q,c:null,d:Oxe,e:Oxe,f:lBt,g:vBt,G:OBt,H:oBt,I:sBt,j:aBt,L:h9e,m:cBt,M:uBt,p:U,q:V,Q:Sxe,s:Exe,S:fBt,u:dBt,U:hBt,V:pBt,w:gBt,W:mBt,x:null,X:null,y:yBt,Y:bBt,Z:xBt,"%":wxe},w={a:H,A:Z,b:ee,B:se,c:null,d:xxe,e:xxe,f:CBt,g:NBt,G:LBt,H:wBt,I:SBt,j:EBt,L:g9e,m:_Bt,M:kBt,p:fe,q:ce,Q:Sxe,s:Exe,S:$Bt,u:TBt,U:PBt,V:ABt,w:RBt,W:DBt,x:null,X:null,y:MBt,Y:IBt,Z:jBt,"%":wxe},S={a:D,A:M,b:L,B:A,c:T,d:vxe,e:vxe,f:tBt,g:yxe,G:mxe,H:bxe,I:bxe,j:GQt,L:eBt,m:YQt,M:KQt,p:P,q:ZQt,Q:rBt,s:iBt,S:JQt,u:qQt,U:VQt,V:UQt,w:WQt,W:HQt,x:N,X:j,y:yxe,Y:mxe,Z:XQt,"%":nBt};m.x=E(n,m),m.X=E(r,m),m.c=E(t,m),w.x=E(n,w),w.X=E(r,w),w.c=E(t,w);function E(ae,de){return function(me){var te=[],Ee=-1,we=0,ke=ae.length,je,nt,Re;for(me instanceof Date||(me=new Date(+me));++Ee<ke;)ae.charCodeAt(Ee)===37&&(te.push(ae.slice(we,Ee)),(nt=gxe[je=ae.charAt(++Ee)])!=null?je=ae.charAt(++Ee):nt=je==="e"?" ":"0",(Re=de[je])&&(je=Re(me,nt)),te.push(je),we=Ee+1);return te.push(ae.slice(we,Ee)),te.join("")}}function C(ae,de){return function(me){var te=Ck(1900,void 0,1),Ee=k(te,ae,me+="",0),we,ke;if(Ee!=me.length)return null;if("Q"in te)return new Date(te.Q);if("s"in te)return new Date(te.s*1e3+("L"in te?te.L:0));if(de&&!("Z"in te)&&(te.Z=0),"p"in te&&(te.H=te.H%12+te.p*12),te.m===void 0&&(te.m="q"in te?te.q:0),"V"in te){if(te.V<1||te.V>53)return null;"w"in te||(te.w=1),"Z"in te?(we=aV(Ck(te.y,0,1)),ke=we.getUTCDay(),we=ke>4||ke===0?$3.ceil(we):$3(we),we=n0.offset(we,(te.V-1)*7),te.y=we.getUTCFullYear(),te.m=we.getUTCMonth(),te.d=we.getUTCDate()+(te.w+6)%7):(we=sV(Ck(te.y,0,1)),ke=we.getDay(),we=ke>4||ke===0?k3.ceil(we):k3(we),we=Ag.offset(we,(te.V-1)*7),te.y=we.getFullYear(),te.m=we.getMonth(),te.d=we.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),ke="Z"in te?aV(Ck(te.y,0,1)).getUTCDay():sV(Ck(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(ke+5)%7:te.w+te.U*7-(ke+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,aV(te)):sV(te)}}function k(ae,de,me,te){for(var Ee=0,we=de.length,ke=me.length,je,nt;Ee<we;){if(te>=ke)return-1;if(je=de.charCodeAt(Ee++),je===37){if(je=de.charAt(Ee++),nt=S[je in gxe?de.charAt(Ee++):je],!nt||(te=nt(ae,me,te))<0)return-1}else if(je!=me.charCodeAt(te++))return-1}return te}function P(ae,de,me){var te=c.exec(de.slice(me));return te?(ae.p=u.get(te[0].toLowerCase()),me+te[0].length):-1}function D(ae,de,me){var te=h.exec(de.slice(me));return te?(ae.w=p.get(te[0].toLowerCase()),me+te[0].length):-1}function M(ae,de,me){var te=f.exec(de.slice(me));return te?(ae.w=d.get(te[0].toLowerCase()),me+te[0].length):-1}function L(ae,de,me){var te=y.exec(de.slice(me));return te?(ae.m=O.get(te[0].toLowerCase()),me+te[0].length):-1}function A(ae,de,me){var te=g.exec(de.slice(me));return te?(ae.m=v.get(te[0].toLowerCase()),me+te[0].length):-1}function T(ae,de,me){return k(ae,t,de,me)}function N(ae,de,me){return k(ae,n,de,me)}function j(ae,de,me){return k(ae,r,de,me)}function z(ae){return s[ae.getDay()]}function W(ae){return o[ae.getDay()]}function F(ae){return l[ae.getMonth()]}function q(ae){return a[ae.getMonth()]}function U(ae){return i[+(ae.getHours()>=12)]}function V(ae){return 1+~~(ae.getMonth()/3)}function H(ae){return s[ae.getUTCDay()]}function Z(ae){return o[ae.getUTCDay()]}function ee(ae){return l[ae.getUTCMonth()]}function se(ae){return a[ae.getUTCMonth()]}function fe(ae){return i[+(ae.getUTCHours()>=12)]}function ce(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var de=E(ae+="",m);return de.toString=function(){return ae},de},parse:function(ae){var de=C(ae+="",!1);return de.toString=function(){return ae},de},utcFormat:function(ae){var de=E(ae+="",w);return de.toString=function(){return ae},de},utcParse:function(ae){var de=C(ae+="",!0);return de.toString=function(){return ae},de}}}var gxe={"-":"",_:" ",0:"0"},vs=/^\s*\d+/,zQt=/^%/,QQt=/[\\^$*+?|[\]().{}]/g;function er(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function BQt(e){return e.replace(QQt,"\\$&")}function _k(e){return new RegExp("^(?:"+e.map(BQt).join("|")+")","i")}function kk(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function WQt(e,t,n){var r=vs.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function qQt(e,t,n){var r=vs.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function VQt(e,t,n){var r=vs.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function UQt(e,t,n){var r=vs.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function HQt(e,t,n){var r=vs.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function mxe(e,t,n){var r=vs.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function yxe(e,t,n){var r=vs.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function XQt(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ZQt(e,t,n){var r=vs.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function YQt(e,t,n){var r=vs.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function vxe(e,t,n){var r=vs.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function GQt(e,t,n){var r=vs.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function bxe(e,t,n){var r=vs.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function KQt(e,t,n){var r=vs.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function JQt(e,t,n){var r=vs.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function eBt(e,t,n){var r=vs.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function tBt(e,t,n){var r=vs.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function nBt(e,t,n){var r=zQt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function rBt(e,t,n){var r=vs.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function iBt(e,t,n){var r=vs.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Oxe(e,t){return er(e.getDate(),t,2)}function oBt(e,t){return er(e.getHours(),t,2)}function sBt(e,t){return er(e.getHours()%12||12,t,2)}function aBt(e,t){return er(1+Ag.count(ip(e),e),t,3)}function h9e(e,t){return er(e.getMilliseconds(),t,3)}function lBt(e,t){return h9e(e,t)+"000"}function cBt(e,t){return er(e.getMonth()+1,t,2)}function uBt(e,t){return er(e.getMinutes(),t,2)}function fBt(e,t){return er(e.getSeconds(),t,2)}function dBt(e){var t=e.getDay();return t===0?7:t}function hBt(e,t){return er(d_.count(ip(e)-1,e),t,2)}function p9e(e){var t=e.getDay();return t>=4||t===0?CE(e):CE.ceil(e)}function pBt(e,t){return e=p9e(e),er(CE.count(ip(e),e)+(ip(e).getDay()===4),t,2)}function gBt(e){return e.getDay()}function mBt(e,t){return er(k3.count(ip(e)-1,e),t,2)}function yBt(e,t){return er(e.getFullYear()%100,t,2)}function vBt(e,t){return e=p9e(e),er(e.getFullYear()%100,t,2)}function bBt(e,t){return er(e.getFullYear()%1e4,t,4)}function OBt(e,t){var n=e.getDay();return e=n>=4||n===0?CE(e):CE.ceil(e),er(e.getFullYear()%1e4,t,4)}function xBt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+er(t/60|0,"0",2)+er(t%60,"0",2)}function xxe(e,t){return er(e.getUTCDate(),t,2)}function wBt(e,t){return er(e.getUTCHours(),t,2)}function SBt(e,t){return er(e.getUTCHours()%12||12,t,2)}function EBt(e,t){return er(1+n0.count(op(e),e),t,3)}function g9e(e,t){return er(e.getUTCMilliseconds(),t,3)}function CBt(e,t){return g9e(e,t)+"000"}function _Bt(e,t){return er(e.getUTCMonth()+1,t,2)}function kBt(e,t){return er(e.getUTCMinutes(),t,2)}function $Bt(e,t){return er(e.getUTCSeconds(),t,2)}function TBt(e){var t=e.getUTCDay();return t===0?7:t}function PBt(e,t){return er(h_.count(op(e)-1,e),t,2)}function m9e(e){var t=e.getUTCDay();return t>=4||t===0?_E(e):_E.ceil(e)}function ABt(e,t){return e=m9e(e),er(_E.count(op(e),e)+(op(e).getUTCDay()===4),t,2)}function RBt(e){return e.getUTCDay()}function DBt(e,t){return er($3.count(op(e)-1,e),t,2)}function MBt(e,t){return er(e.getUTCFullYear()%100,t,2)}function NBt(e,t){return e=m9e(e),er(e.getUTCFullYear()%100,t,2)}function IBt(e,t){return er(e.getUTCFullYear()%1e4,t,4)}function LBt(e,t){var n=e.getUTCDay();return e=n>=4||n===0?_E(e):_E.ceil(e),er(e.getUTCFullYear()%1e4,t,4)}function jBt(){return"+0000"}function wxe(){return"%"}function Sxe(e){return+e}function Exe(e){return Math.floor(+e/1e3)}var Fx,Lae,y9e,jae,v9e;FBt({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function FBt(e){return Fx=d9e(e),Lae=Fx.format,y9e=Fx.parse,jae=Fx.utcFormat,v9e=Fx.utcParse,Fx}function D$(e){const t={};return n=>t[n]||(t[n]=e(n))}function zBt(e,t){return n=>{const r=e(n),i=r.indexOf(t);if(i<0)return r;let o=QBt(r,i);const s=o<r.length?r.slice(o):"";for(;--o>i;)if(r[o]!=="0"){++o;break}return r.slice(0,o)+s}}function QBt(e,t){let n=e.lastIndexOf("e"),r;if(n>0)return n;for(n=e.length;--n>t;)if(r=e.charCodeAt(n),r>=48&&r<=57)return n+1}function b9e(e){const t=D$(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(r){const i=nO(r||",");if(i.precision==null){switch(i.precision=12,i.type){case"%":i.precision-=2;break;case"e":i.precision-=1;break}return zBt(t(i),t(".1f")(1)[1])}else return t(i)},formatSpan(r,i,o,s){s=nO(s??",f");const a=z0(r,i,o),l=Math.max(Math.abs(r),Math.abs(i));let c;if(s.precision==null)switch(s.type){case"s":return isNaN(c=W8e(a,l))||(s.precision=c),n(s,l);case"":case"e":case"g":case"p":case"r":{isNaN(c=q8e(a,l))||(s.precision=c-(s.type==="e"));break}case"f":case"%":{isNaN(c=B8e(a))||(s.precision=c-(s.type==="%")*2);break}}return t(s)}}}let QG;O9e();function O9e(){return QG=b9e({format:f8,formatPrefix:Rae})}function x9e(e){return b9e(Q8e(e))}function T3(e){return arguments.length?QG=x9e(e):QG}function Cxe(e,t,n){n=n||{},dt(n)||Le(`Invalid time multi-format specifier: ${n}`);const r=t(gf),i=t(ru),o=t(nu),s=t(oc),a=t(Ho),l=t(Na),c=t(ic),u=t(qs),f=e(n[$d]||".%L"),d=e(n[gf]||":%S"),h=e(n[ru]||"%I:%M"),p=e(n[nu]||"%I %p"),g=e(n[oc]||n[_a]||"%a %d"),v=e(n[Ho]||"%b %d"),y=e(n[Na]||"%B"),O=e(n[ic]||"%B"),m=e(n[qs]||"%Y");return w=>(r(w)<w?f:i(w)<w?d:o(w)<w?h:s(w)<w?p:l(w)<w?a(w)<w?g:v:u(w)<w?c(w)<w?y:O:m)(w)}function w9e(e){const t=D$(e.format),n=D$(e.utcFormat);return{timeFormat:r=>ut(r)?t(r):Cxe(t,p_,r),utcFormat:r=>ut(r)?n(r):Cxe(n,g_,r),timeParse:D$(e.parse),utcParse:D$(e.utcParse)}}let BG;S9e();function S9e(){return BG=w9e({format:Lae,parse:y9e,utcFormat:jae,utcParse:v9e})}function E9e(e){return w9e(d9e(e))}function NP(e){return arguments.length?BG=E9e(e):BG}const WG=(e,t)=>an({},e,t);function C9e(e,t){const n=e?x9e(e):T3(),r=t?E9e(t):NP();return WG(n,r)}function Fae(e,t){const n=arguments.length;return n&&n!==2&&Le("defaultLocale expects either zero or two arguments."),n?WG(T3(e),NP(t)):WG(T3(),NP())}function BBt(){return O9e(),S9e(),Fae()}const WBt=/^(data:|([A-Za-z]+:)?\/\/)/,qBt=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,VBt=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,_xe="file://";function UBt(e,t){return n=>({options:n||{},sanitize:XBt,load:HBt,fileAccess:!!t,file:ZBt(t),http:GBt(e)})}async function HBt(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function XBt(e,t){t=an({},this.options,t);const n=this.fileAccess,r={href:null};let i,o,s;const a=qBt.test(e.replace(VBt,""));(e==null||typeof e!="string"||!a)&&Le("Sanitize failure, invalid URI: "+Je(e));const l=WBt.test(e);return(s=t.baseURL)&&!l&&(!e.startsWith("/")&&!s.endsWith("/")&&(e="/"+e),e=s+e),o=(i=e.startsWith(_xe))||t.mode==="file"||t.mode!=="http"&&!l&&n,i?e=e.slice(_xe.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(r,"localFile",{value:!!o}),r.href=e,t.target&&(r.target=t.target+""),t.rel&&(r.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+""),r}function ZBt(e){return e?t=>new Promise((n,r)=>{e.readFile(t,(i,o)=>{i?r(i):n(o)})}):YBt}async function YBt(){Le("No file system access.")}function GBt(e){return e?async function(t,n){const r=an({},this.options.http,n),i=n&&n.response,o=await e(t,r);return o.ok?ln(o[i])?o[i]():o.text():Le(o.status+""+o.statusText)}:KBt}async function KBt(){Le("No HTTP fetch method available.")}const JBt=e=>e!=null&&e===e,eWt=e=>e==="true"||e==="false"||e===!0||e===!1,tWt=e=>!Number.isNaN(Date.parse(e)),_9e=e=>!Number.isNaN(+e)&&!(e instanceof Date),nWt=e=>_9e(e)&&Number.isInteger(+e),rO={boolean:$ae,integer:$a,number:$a,date:Tae,string:Pae,unknown:Ba},TN=[eWt,nWt,_9e,tWt],rWt=["boolean","integer","number","date"];function k9e(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=TN.length,i=TN.map((o,s)=>s+1);for(let o=0,s=0,a,l;o<n;++o)for(l=t?e[o][t]:e[o],a=0;a<r;++a)if(i[a]&&JBt(l)&&!TN[a](l)&&(i[a]=0,++s,s===TN.length))return"string";return rWt[i.reduce((o,s)=>o===0?s:o,0)-1]}function $9e(e,t){return t.reduce((n,r)=>(n[r]=k9e(e,r),n),{})}function kxe(e){const t=function(n,r){const i={delimiter:e};return zae(n,r?an(r,i):i)};return t.responseType="text",t}function zae(e,t){return t.header&&(e=t.header.map(Je).join(t.delimiter)+`
`+e),L9t(t.delimiter).parse(e+"")}zae.responseType="text";function iWt(e){return typeof Buffer=="function"&&ln(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Qae(e,t){const n=t&&t.property?hf(t.property):Ba;return dt(e)&&!iWt(e)?oWt(n(e),t):n(JSON.parse(e))}Qae.responseType="json";function oWt(e,t){return!ze(e)&&O8e(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const sWt={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function T9e(e,t){let n,r,i,o;return e=Qae(e,t),t&&t.feature?(n=Q9t,i=t.feature):t&&t.mesh?(n=W9t,i=t.mesh,o=sWt[t.filter]):Le("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,o):Le("Invalid TopoJSON object: "+i),r&&r.features||[r]}T9e.responseType="json";const H5={dsv:zae,csv:kxe(","),tsv:kxe("	"),json:Qae,topojson:T9e};function Bae(e,t){return arguments.length>1?(H5[e]=t,this):Nt(H5,e)?H5[e]:null}function P9e(e){const t=Bae(e);return t&&t.responseType||"text"}function IP(e,t,n,r){t=t||{};const i=Bae(t.type||"json");return i||Le("Unknown data format type: "+t.type),e=i(e,t),t.parse&&aWt(e,t.parse,n,r),Nt(e,"columns")&&delete e.columns,e}function aWt(e,t,n,r){if(!e.length)return;const i=NP();n=n||i.timeParse,r=r||i.utcParse;let o=e.columns||Object.keys(e[0]),s,a,l,c,u,f;t==="auto"&&(t=$9e(e,o)),o=Object.keys(t);const d=o.map(h=>{const p=t[h];let g,v;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),v=g[1],(v[0]==="'"&&v[v.length-1]==="'"||v[0]==='"'&&v[v.length-1]==='"')&&(v=v.slice(1,-1)),(g[0]==="utc"?r:n)(v);if(!rO[p])throw Error("Illegal format pattern: "+h+":"+p);return rO[p]});for(l=0,u=e.length,f=o.length;l<u;++l)for(s=e[l],c=0;c<f;++c)a=o[c],s[a]=d[c](s[a])}const tD=UBt(typeof fetch<"u"&&fetch,null);rO.date=e=>new Date(e).toISOString();const A9e=rO.integer,lWt=e=>{if(e==="")return"";if(Z2t(Number.parseInt(e)))try{return BigInt(e)}catch{return A9e(e)}else return""};function R9e(){rO.integer=lWt}function D9e(){rO.integer=A9e}const M9e=tD();function Wae(e,t,n=!1){return M9e.load(e).then(r=>{typeof r=="string"&&(r=uWt(r)),n&&R9e();const i=t&&t.type==="csv"?IP(r,{...t,parse:"auto"}):IP(r,t);return n&&D9e(),i})}function cWt(e,t=!0){t&&R9e();const n=IP(e,{type:"csv",parse:"auto"});return t&&D9e(),n}function uWt(e){if(!e||!e.includes(","))return e;const t=e.split(`
`),r=t[0].split(","),i=new Set,o=[];for(const a of r){const l=dWt(a,i);o.push(l),i.add(l)}const s=o.join(",");return t[0]=s,t.join(`
`)}const fWt="​";function dWt(e,t){let n=e,r=1;for(;t.has(n);)n=`${e}${fWt.repeat(r)}`,r++;return n}const hWt=MR("marimo-table").withData(Y.object({initialValue:Y.array(Y.number()),label:Y.string().nullable(),data:Y.union([Y.string(),Y.array(Y.object({}).passthrough())]),pagination:Y.boolean().default(!1),pageSize:Y.number().default(10),selection:Y.enum(["single","multi"]).nullable().default(null),showDownload:Y.boolean().default(!1),rowHeaders:Y.array(Y.tuple([Y.string(),Y.array(Y.any())]))})).withFunctions({download_as:fP.input(Y.object({format:Y.enum(["csv","json"])})).output(Y.string())}).renderer(e=>typeof e.data.data=="string"?b.jsx(N9e,{...e.data,...e.functions,data:e.data.data,value:e.value,setValue:e.setValue}):b.jsx(I9e,{...e.data,...e.functions,data:e.data.data,value:e.value,setValue:e.setValue})),N9e=e=>{const{data:t,loading:n,error:r}=zd(()=>e.data?Wae(e.data,{type:"csv",parse:"auto"},!0):Promise.resolve([]),[e.data]);return n&&!t?null:r?b.jsxs(pR,{variant:"destructive",children:[b.jsx(gR,{children:"Error"}),b.jsx("div",{className:"text-md",children:r.message||"An unknown error occurred"})]}):b.jsx(I9e,{...e,data:t||[]})},I9e=({label:e,data:t,pagination:n,pageSize:r,selection:i,value:o,showDownload:s,rowHeaders:a,download_as:l,className:c,setValue:u})=>{const f=x.useMemo(()=>n8e(t,w9t(a),i),[t,i,a]),d=Object.fromEntries((o||[]).map(h=>[h,!0]));return b.jsx(fc,{label:e,align:"top",fullWidth:!0,children:b.jsx(O4e,{data:t,columns:f,className:c,pagination:n,pageSize:r,rowSelection:d,downloadAs:s?l:void 0,onRowSelectionChange:h=>{if(i==="single"){const p=typeof h=="function"?h({}):h;u(Object.keys(p).slice(0,1))}if(i==="multi"){const p=typeof h=="function"?h(d):h;u(Object.keys(p))}}})})};class pWt{constructor(){ve(this,"tagName","marimo-accordion");ve(this,"validator",Y.object({labels:Y.array(Y.string()),multiple:Y.boolean()}))}render(t){return b.jsx(gWt,{...t.data,children:t.children})}}const gWt=({labels:e,multiple:t,children:n})=>{const r=t?"multiple":"single";return b.jsx(x4e,{type:r,className:"text-muted-foreground",collapsible:!0,children:ie.Children.map(n,(i,o)=>b.jsxs(xse,{value:o.toString(),className:"border-muted-foreground-20",children:[b.jsx(wse,{className:"py-2 text-md",children:Da({html:e[o]})}),b.jsx(Sse,{className:"text-md",children:i})]},o))})},mWt=Ao("border rounded-lg p-12 mt-12 mb-12 text-foreground shadow-[4px_4px_0px_0px]",{variants:{kind:{neutral:"border-[var(--slate-9)] shadow-[var(--slate-8)]",alert:"bg-[var(--red-2)] border-[var(--red-9)] shadow-[var(--red-8)]",info:"bg-[var(--sky-1)] border-[var(--sky-8)] shadow-[var(--sky-7)]",danger:"bg-[var(--red-2)] border-[var(--red-9)] shadow-[var(--red-8)]",warn:"bg-[var(--amber-2)] border-[var(--amber-9)] shadow-[var(--amber-8)]",success:"bg-[var(--grass-2)] border-[var(--grass-9)] shadow-[var(--grass-8)]"}},defaultVariants:{kind:"neutral"}}),L9e=x.memo(({html:e,kind:t})=>b.jsx("div",{className:mWt({kind:t}),children:b.jsx(Y6,{html:e})}));L9e.displayName="CalloutOutput";class yWt{constructor(){ve(this,"tagName","marimo-callout-output");ve(this,"validator",Y.object({html:Y.string(),kind:sLe}))}render({data:t}){return b.jsx(L9e,{html:t.html,kind:t.kind})}}class vWt{constructor(){ve(this,"tagName","marimo-json-output");ve(this,"validator",Y.object({name:Y.string().nullish(),jsonData:Y.unknown()}))}render({data:t,host:n}){const r=t.name===void 0?!1:t.name||"";return b.jsx(q5e,{container:n.shadowRoot,children:b.jsx(G6,{data:t.jsonData,format:"auto",name:r})})}}const j9e="Tabs",[bWt,DGn]=uo(j9e,[JC]),F9e=JC(),[OWt,qae]=bWt(j9e),xWt=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=BO(a),[f,d]=ko({prop:r,onChange:i,defaultProp:o});return x.createElement(OWt,{scope:n,baseId:Ra(),value:f,onValueChange:d,orientation:s,dir:u,activationMode:l},x.createElement(Ot.div,oe({dir:u,"data-orientation":s},c,{ref:t})))}),wWt="TabsList",SWt=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=qae(wWt,n),s=F9e(n);return x.createElement(rse,oe({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),x.createElement(Ot.div,oe({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),EWt="TabsTrigger",CWt=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=qae(EWt,n),a=F9e(n),l=z9e(s.baseId,r),c=Q9e(s.baseId,r),u=r===s.value;return x.createElement(ise,oe({asChild:!0},a,{focusable:!i,active:u}),x.createElement(Ot.button,oe({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:t,onMouseDown:Xe(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Xe(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Xe(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!i&&f&&s.onValueChange(r)})})))}),_Wt="TabsContent",kWt=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=qae(_Wt,n),l=z9e(a.baseId,r),c=Q9e(a.baseId,r),u=r===a.value,f=x.useRef(u);return x.useEffect(()=>{const d=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(d)},[]),x.createElement(Gs,{present:i||u},({present:d})=>x.createElement(Ot.div,oe({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!d,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),d&&o))});function z9e(e,t){return`${e}-trigger-${t}`}function Q9e(e,t){return`${e}-content-${t}`}const $Wt=xWt,B9e=SWt,W9e=CWt,q9e=kWt,V9e=$Wt,Vae=x.forwardRef(({className:e,...t},n)=>b.jsx(B9e,{ref:n,className:be("inline-flex max-h-14 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Vae.displayName=B9e.displayName;const P3=x.forwardRef(({className:e,...t},n)=>b.jsx(W9e,{ref:n,className:be("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));P3.displayName=W9e.displayName;const A3=x.forwardRef(({className:e,...t},n)=>b.jsx(q9e,{ref:n,className:be("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));A3.displayName=q9e.displayName;class TWt{constructor(){ve(this,"tagName","marimo-tabs");ve(this,"validator",Y.object({tabs:Y.array(Y.string())}))}render(t){return b.jsx(PWt,{...t.data,value:t.value,setValue:t.setValue,children:t.children})}}const PWt=({tabs:e,value:t,setValue:n,children:r})=>{const[i,o]=ie.useState(t||"0"),s=a=>{o(a),n(a)};return t!==i&&t&&o(t),b.jsxs(V9e,{value:i,onValueChange:s,children:[b.jsx(Vae,{children:e.map((a,l)=>b.jsx(P3,{value:l.toString(),children:Da({html:a})},l))}),ie.Children.map(r,(a,l)=>b.jsx(A3,{value:l.toString(),children:a}))]})};function $xe(e){return e!==null&&typeof e=="object"&&"constructor"in e&&e.constructor===Object}function Uae(e,t){e===void 0&&(e={}),t===void 0&&(t={}),Object.keys(t).forEach(n=>{typeof e[n]>"u"?e[n]=t[n]:$xe(t[n])&&$xe(e[n])&&Object.keys(t[n]).length>0&&Uae(e[n],t[n])})}const U9e={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function mm(){const e=typeof document<"u"?document:{};return Uae(e,U9e),e}const AWt={document:U9e,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)}};function Va(){const e=typeof window<"u"?window:{};return Uae(e,AWt),e}function RWt(e){return e===void 0&&(e=""),e.trim().split(" ").filter(t=>!!t.trim())}function DWt(e){const t=e;Object.keys(t).forEach(n=>{try{t[n]=null}catch{}try{delete t[n]}catch{}})}function qG(e,t){return t===void 0&&(t=0),setTimeout(e,t)}function R3(){return Date.now()}function MWt(e){const t=Va();let n;return t.getComputedStyle&&(n=t.getComputedStyle(e,null)),!n&&e.currentStyle&&(n=e.currentStyle),n||(n=e.style),n}function VG(e,t){t===void 0&&(t="x");const n=Va();let r,i,o;const s=MWt(e);return n.WebKitCSSMatrix?(i=s.transform||s.webkitTransform,i.split(",").length>6&&(i=i.split(", ").map(a=>a.replace(",",".")).join(", ")),o=new n.WebKitCSSMatrix(i==="none"?"":i)):(o=s.MozTransform||s.OTransform||s.MsTransform||s.msTransform||s.transform||s.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),r=o.toString().split(",")),t==="x"&&(n.WebKitCSSMatrix?i=o.m41:r.length===16?i=parseFloat(r[12]):i=parseFloat(r[4])),t==="y"&&(n.WebKitCSSMatrix?i=o.m42:r.length===16?i=parseFloat(r[13]):i=parseFloat(r[5])),i||0}function PN(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"}function NWt(e){return typeof window<"u"&&typeof window.HTMLElement<"u"?e instanceof HTMLElement:e&&(e.nodeType===1||e.nodeType===11)}function Rc(){const e=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let n=1;n<arguments.length;n+=1){const r=n<0||arguments.length<=n?void 0:arguments[n];if(r!=null&&!NWt(r)){const i=Object.keys(Object(r)).filter(o=>t.indexOf(o)<0);for(let o=0,s=i.length;o<s;o+=1){const a=i[o],l=Object.getOwnPropertyDescriptor(r,a);l!==void 0&&l.enumerable&&(PN(e[a])&&PN(r[a])?r[a].__swiper__?e[a]=r[a]:Rc(e[a],r[a]):!PN(e[a])&&PN(r[a])?(e[a]={},r[a].__swiper__?e[a]=r[a]:Rc(e[a],r[a])):e[a]=r[a])}}}return e}function M$(e,t,n){e.style.setProperty(t,n)}function H9e(e){let{swiper:t,targetPosition:n,side:r}=e;const i=Va(),o=-t.translate;let s=null,a;const l=t.params.speed;t.wrapperEl.style.scrollSnapType="none",i.cancelAnimationFrame(t.cssModeFrameID);const c=n>o?"next":"prev",u=(d,h)=>c==="next"&&d>=h||c==="prev"&&d<=h,f=()=>{a=new Date().getTime(),s===null&&(s=a);const d=Math.max(Math.min((a-s)/l,1),0),h=.5-Math.cos(d*Math.PI)/2;let p=o+h*(n-o);if(u(p,n)&&(p=n),t.wrapperEl.scrollTo({[r]:p}),u(p,n)){t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout(()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[r]:p})}),i.cancelAnimationFrame(t.cssModeFrameID);return}t.cssModeFrameID=i.requestAnimationFrame(f)};f()}function Bc(e,t){return t===void 0&&(t=""),[...e.children].filter(n=>n.matches(t))}function D3(e){try{console.warn(e);return}catch{}}function $E(e,t){t===void 0&&(t=[]);const n=document.createElement(e);return n.classList.add(...Array.isArray(t)?t:RWt(t)),n}function UG(e){const t=Va(),n=mm(),r=e.getBoundingClientRect(),i=n.body,o=e.clientTop||i.clientTop||0,s=e.clientLeft||i.clientLeft||0,a=e===t?t.scrollY:e.scrollTop,l=e===t?t.scrollX:e.scrollLeft;return{top:r.top+a-o,left:r.left+l-s}}function IWt(e,t){const n=[];for(;e.previousElementSibling;){const r=e.previousElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}function LWt(e,t){const n=[];for(;e.nextElementSibling;){const r=e.nextElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}function $y(e,t){return Va().getComputedStyle(e,null).getPropertyValue(t)}function M3(e){let t=e,n;if(t){for(n=0;(t=t.previousSibling)!==null;)t.nodeType===1&&(n+=1);return n}}function sb(e,t){const n=[];let r=e.parentElement;for(;r;)t?r.matches(t)&&n.push(r):n.push(r),r=r.parentElement;return n}function HG(e,t,n){const r=Va();return n?e[t==="width"?"offsetWidth":"offsetHeight"]+parseFloat(r.getComputedStyle(e,null).getPropertyValue(t==="width"?"margin-right":"margin-top"))+parseFloat(r.getComputedStyle(e,null).getPropertyValue(t==="width"?"margin-left":"margin-bottom")):e.offsetWidth}function rs(e){return(Array.isArray(e)?e:[e]).filter(t=>!!t)}let lV;function jWt(){const e=Va(),t=mm();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}function X9e(){return lV||(lV=jWt()),lV}let cV;function FWt(e){let{userAgent:t}=e===void 0?{}:e;const n=X9e(),r=Va(),i=r.navigator.platform,o=t||r.navigator.userAgent,s={ios:!1,android:!1},a=r.screen.width,l=r.screen.height,c=o.match(/(Android);?[\s\/]+([\d.]+)?/);let u=o.match(/(iPad).*OS\s([\d_]+)/);const f=o.match(/(iPod)(.*OS\s([\d_]+))?/),d=!u&&o.match(/(iPhone\sOS|iOS)\s([\d_]+)/),h=i==="Win32";let p=i==="MacIntel";const g=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!u&&p&&n.touch&&g.indexOf(`${a}x${l}`)>=0&&(u=o.match(/(Version)\/([\d.]+)/),u||(u=[0,1,"13_0_0"]),p=!1),c&&!h&&(s.os="android",s.android=!0),(u||d||f)&&(s.os="ios",s.ios=!0),s}function Z9e(e){return e===void 0&&(e={}),cV||(cV=FWt(e)),cV}let uV;function zWt(){const e=Va(),t=Z9e();let n=!1;function r(){const a=e.navigator.userAgent.toLowerCase();return a.indexOf("safari")>=0&&a.indexOf("chrome")<0&&a.indexOf("android")<0}if(r()){const a=String(e.navigator.userAgent);if(a.includes("Version/")){const[l,c]=a.split("Version/")[1].split(" ")[0].split(".").map(u=>Number(u));n=l<16||l===16&&c<2}}const i=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent),o=r(),s=o||i&&t.ios;return{isSafari:n||o,needPerspectiveFix:n,need3dFix:s,isWebView:i}}function QWt(){return uV||(uV=zWt()),uV}function BWt(e){let{swiper:t,on:n,emit:r}=e;const i=Va();let o=null,s=null;const a=()=>{!t||t.destroyed||!t.initialized||(r("beforeResize"),r("resize"))},l=()=>{!t||t.destroyed||!t.initialized||(o=new ResizeObserver(f=>{s=i.requestAnimationFrame(()=>{const{width:d,height:h}=t;let p=d,g=h;f.forEach(v=>{let{contentBoxSize:y,contentRect:O,target:m}=v;m&&m!==t.el||(p=O?O.width:(y[0]||y).inlineSize,g=O?O.height:(y[0]||y).blockSize)}),(p!==d||g!==h)&&a()})}),o.observe(t.el))},c=()=>{s&&i.cancelAnimationFrame(s),o&&o.unobserve&&t.el&&(o.unobserve(t.el),o=null)},u=()=>{!t||t.destroyed||!t.initialized||r("orientationchange")};n("init",()=>{if(t.params.resizeObserver&&typeof i.ResizeObserver<"u"){l();return}i.addEventListener("resize",a),i.addEventListener("orientationchange",u)}),n("destroy",()=>{c(),i.removeEventListener("resize",a),i.removeEventListener("orientationchange",u)})}function WWt(e){let{swiper:t,extendParams:n,on:r,emit:i}=e;const o=[],s=Va(),a=function(u,f){f===void 0&&(f={});const d=s.MutationObserver||s.WebkitMutationObserver,h=new d(p=>{if(t.__preventObserver__)return;if(p.length===1){i("observerUpdate",p[0]);return}const g=function(){i("observerUpdate",p[0])};s.requestAnimationFrame?s.requestAnimationFrame(g):s.setTimeout(g,0)});h.observe(u,{attributes:typeof f.attributes>"u"?!0:f.attributes,childList:typeof f.childList>"u"?!0:f.childList,characterData:typeof f.characterData>"u"?!0:f.characterData}),o.push(h)},l=()=>{if(t.params.observer){if(t.params.observeParents){const u=sb(t.hostEl);for(let f=0;f<u.length;f+=1)a(u[f])}a(t.hostEl,{childList:t.params.observeSlideChildren}),a(t.wrapperEl,{attributes:!1})}},c=()=>{o.forEach(u=>{u.disconnect()}),o.splice(0,o.length)};n({observer:!1,observeParents:!1,observeSlideChildren:!1}),r("init",l),r("destroy",c)}var qWt={on(e,t,n){const r=this;if(!r.eventsListeners||r.destroyed||typeof t!="function")return r;const i=n?"unshift":"push";return e.split(" ").forEach(o=>{r.eventsListeners[o]||(r.eventsListeners[o]=[]),r.eventsListeners[o][i](t)}),r},once(e,t,n){const r=this;if(!r.eventsListeners||r.destroyed||typeof t!="function")return r;function i(){r.off(e,i),i.__emitterProxy&&delete i.__emitterProxy;for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];t.apply(r,s)}return i.__emitterProxy=t,r.on(e,i,n)},onAny(e,t){const n=this;if(!n.eventsListeners||n.destroyed||typeof e!="function")return n;const r=t?"unshift":"push";return n.eventsAnyListeners.indexOf(e)<0&&n.eventsAnyListeners[r](e),n},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsAnyListeners)return t;const n=t.eventsAnyListeners.indexOf(e);return n>=0&&t.eventsAnyListeners.splice(n,1),t},off(e,t){const n=this;return!n.eventsListeners||n.destroyed||!n.eventsListeners||e.split(" ").forEach(r=>{typeof t>"u"?n.eventsListeners[r]=[]:n.eventsListeners[r]&&n.eventsListeners[r].forEach((i,o)=>{(i===t||i.__emitterProxy&&i.__emitterProxy===t)&&n.eventsListeners[r].splice(o,1)})}),n},emit(){const e=this;if(!e.eventsListeners||e.destroyed||!e.eventsListeners)return e;let t,n,r;for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return typeof o[0]=="string"||Array.isArray(o[0])?(t=o[0],n=o.slice(1,o.length),r=e):(t=o[0].events,n=o[0].data,r=o[0].context||e),n.unshift(r),(Array.isArray(t)?t:t.split(" ")).forEach(l=>{e.eventsAnyListeners&&e.eventsAnyListeners.length&&e.eventsAnyListeners.forEach(c=>{c.apply(r,[l,...n])}),e.eventsListeners&&e.eventsListeners[l]&&e.eventsListeners[l].forEach(c=>{c.apply(r,n)})}),e}};function VWt(){const e=this;let t,n;const r=e.el;typeof e.params.width<"u"&&e.params.width!==null?t=e.params.width:t=r.clientWidth,typeof e.params.height<"u"&&e.params.height!==null?n=e.params.height:n=r.clientHeight,!(t===0&&e.isHorizontal()||n===0&&e.isVertical())&&(t=t-parseInt($y(r,"padding-left")||0,10)-parseInt($y(r,"padding-right")||0,10),n=n-parseInt($y(r,"padding-top")||0,10)-parseInt($y(r,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(n)&&(n=0),Object.assign(e,{width:t,height:n,size:e.isHorizontal()?t:n}))}function UWt(){const e=this;function t(D,M){return parseFloat(D.getPropertyValue(e.getDirectionLabel(M))||0)}const n=e.params,{wrapperEl:r,slidesEl:i,size:o,rtlTranslate:s,wrongRTL:a}=e,l=e.virtual&&n.virtual.enabled,c=l?e.virtual.slides.length:e.slides.length,u=Bc(i,`.${e.params.slideClass}, swiper-slide`),f=l?e.virtual.slides.length:u.length;let d=[];const h=[],p=[];let g=n.slidesOffsetBefore;typeof g=="function"&&(g=n.slidesOffsetBefore.call(e));let v=n.slidesOffsetAfter;typeof v=="function"&&(v=n.slidesOffsetAfter.call(e));const y=e.snapGrid.length,O=e.slidesGrid.length;let m=n.spaceBetween,w=-g,S=0,E=0;if(typeof o>"u")return;typeof m=="string"&&m.indexOf("%")>=0?m=parseFloat(m.replace("%",""))/100*o:typeof m=="string"&&(m=parseFloat(m)),e.virtualSize=-m,u.forEach(D=>{s?D.style.marginLeft="":D.style.marginRight="",D.style.marginBottom="",D.style.marginTop=""}),n.centeredSlides&&n.cssMode&&(M$(r,"--swiper-centered-offset-before",""),M$(r,"--swiper-centered-offset-after",""));const C=n.grid&&n.grid.rows>1&&e.grid;C?e.grid.initSlides(u):e.grid&&e.grid.unsetSlides();let k;const P=n.slidesPerView==="auto"&&n.breakpoints&&Object.keys(n.breakpoints).filter(D=>typeof n.breakpoints[D].slidesPerView<"u").length>0;for(let D=0;D<f;D+=1){k=0;let M;if(u[D]&&(M=u[D]),C&&e.grid.updateSlide(D,M,u),!(u[D]&&$y(M,"display")==="none")){if(n.slidesPerView==="auto"){P&&(u[D].style[e.getDirectionLabel("width")]="");const L=getComputedStyle(M),A=M.style.transform,T=M.style.webkitTransform;if(A&&(M.style.transform="none"),T&&(M.style.webkitTransform="none"),n.roundLengths)k=e.isHorizontal()?HG(M,"width",!0):HG(M,"height",!0);else{const N=t(L,"width"),j=t(L,"padding-left"),z=t(L,"padding-right"),W=t(L,"margin-left"),F=t(L,"margin-right"),q=L.getPropertyValue("box-sizing");if(q&&q==="border-box")k=N+W+F;else{const{clientWidth:U,offsetWidth:V}=M;k=N+j+z+W+F+(V-U)}}A&&(M.style.transform=A),T&&(M.style.webkitTransform=T),n.roundLengths&&(k=Math.floor(k))}else k=(o-(n.slidesPerView-1)*m)/n.slidesPerView,n.roundLengths&&(k=Math.floor(k)),u[D]&&(u[D].style[e.getDirectionLabel("width")]=`${k}px`);u[D]&&(u[D].swiperSlideSize=k),p.push(k),n.centeredSlides?(w=w+k/2+S/2+m,S===0&&D!==0&&(w=w-o/2-m),D===0&&(w=w-o/2-m),Math.abs(w)<1/1e3&&(w=0),n.roundLengths&&(w=Math.floor(w)),E%n.slidesPerGroup===0&&d.push(w),h.push(w)):(n.roundLengths&&(w=Math.floor(w)),(E-Math.min(e.params.slidesPerGroupSkip,E))%e.params.slidesPerGroup===0&&d.push(w),h.push(w),w=w+k+m),e.virtualSize+=k+m,S=k,E+=1}}if(e.virtualSize=Math.max(e.virtualSize,o)+v,s&&a&&(n.effect==="slide"||n.effect==="coverflow")&&(r.style.width=`${e.virtualSize+m}px`),n.setWrapperSize&&(r.style[e.getDirectionLabel("width")]=`${e.virtualSize+m}px`),C&&e.grid.updateWrapperSize(k,d),!n.centeredSlides){const D=[];for(let M=0;M<d.length;M+=1){let L=d[M];n.roundLengths&&(L=Math.floor(L)),d[M]<=e.virtualSize-o&&D.push(L)}d=D,Math.floor(e.virtualSize-o)-Math.floor(d[d.length-1])>1&&d.push(e.virtualSize-o)}if(l&&n.loop){const D=p[0]+m;if(n.slidesPerGroup>1){const M=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/n.slidesPerGroup),L=D*n.slidesPerGroup;for(let A=0;A<M;A+=1)d.push(d[d.length-1]+L)}for(let M=0;M<e.virtual.slidesBefore+e.virtual.slidesAfter;M+=1)n.slidesPerGroup===1&&d.push(d[d.length-1]+D),h.push(h[h.length-1]+D),e.virtualSize+=D}if(d.length===0&&(d=[0]),m!==0){const D=e.isHorizontal()&&s?"marginLeft":e.getDirectionLabel("marginRight");u.filter((M,L)=>!n.cssMode||n.loop?!0:L!==u.length-1).forEach(M=>{M.style[D]=`${m}px`})}if(n.centeredSlides&&n.centeredSlidesBounds){let D=0;p.forEach(L=>{D+=L+(m||0)}),D-=m;const M=D-o;d=d.map(L=>L<=0?-g:L>M?M+v:L)}if(n.centerInsufficientSlides){let D=0;if(p.forEach(M=>{D+=M+(m||0)}),D-=m,D<o){const M=(o-D)/2;d.forEach((L,A)=>{d[A]=L-M}),h.forEach((L,A)=>{h[A]=L+M})}}if(Object.assign(e,{slides:u,snapGrid:d,slidesGrid:h,slidesSizesGrid:p}),n.centeredSlides&&n.cssMode&&!n.centeredSlidesBounds){M$(r,"--swiper-centered-offset-before",`${-d[0]}px`),M$(r,"--swiper-centered-offset-after",`${e.size/2-p[p.length-1]/2}px`);const D=-e.snapGrid[0],M=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map(L=>L+D),e.slidesGrid=e.slidesGrid.map(L=>L+M)}if(f!==c&&e.emit("slidesLengthChange"),d.length!==y&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),h.length!==O&&e.emit("slidesGridLengthChange"),n.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!l&&!n.cssMode&&(n.effect==="slide"||n.effect==="fade")){const D=`${n.containerModifierClass}backface-hidden`,M=e.el.classList.contains(D);f<=n.maxBackfaceHiddenSlides?M||e.el.classList.add(D):M&&e.el.classList.remove(D)}}function HWt(e){const t=this,n=[],r=t.virtual&&t.params.virtual.enabled;let i=0,o;typeof e=="number"?t.setTransition(e):e===!0&&t.setTransition(t.params.speed);const s=a=>r?t.slides[t.getSlideIndexByData(a)]:t.slides[a];if(t.params.slidesPerView!=="auto"&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(a=>{n.push(a)});else for(o=0;o<Math.ceil(t.params.slidesPerView);o+=1){const a=t.activeIndex+o;if(a>t.slides.length&&!r)break;n.push(s(a))}else n.push(s(t.activeIndex));for(o=0;o<n.length;o+=1)if(typeof n[o]<"u"){const a=n[o].offsetHeight;i=a>i?a:i}(i||i===0)&&(t.wrapperEl.style.height=`${i}px`)}function XWt(){const e=this,t=e.slides,n=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let r=0;r<t.length;r+=1)t[r].swiperSlideOffset=(e.isHorizontal()?t[r].offsetLeft:t[r].offsetTop)-n-e.cssOverflowAdjustment()}function ZWt(e){e===void 0&&(e=this&&this.translate||0);const t=this,n=t.params,{slides:r,rtlTranslate:i,snapGrid:o}=t;if(r.length===0)return;typeof r[0].swiperSlideOffset>"u"&&t.updateSlidesOffset();let s=-e;i&&(s=e),r.forEach(l=>{l.classList.remove(n.slideVisibleClass,n.slideFullyVisibleClass)}),t.visibleSlidesIndexes=[],t.visibleSlides=[];let a=n.spaceBetween;typeof a=="string"&&a.indexOf("%")>=0?a=parseFloat(a.replace("%",""))/100*t.size:typeof a=="string"&&(a=parseFloat(a));for(let l=0;l<r.length;l+=1){const c=r[l];let u=c.swiperSlideOffset;n.cssMode&&n.centeredSlides&&(u-=r[0].swiperSlideOffset);const f=(s+(n.centeredSlides?t.minTranslate():0)-u)/(c.swiperSlideSize+a),d=(s-o[0]+(n.centeredSlides?t.minTranslate():0)-u)/(c.swiperSlideSize+a),h=-(s-u),p=h+t.slidesSizesGrid[l],g=h>=0&&h<=t.size-t.slidesSizesGrid[l];(h>=0&&h<t.size-1||p>1&&p<=t.size||h<=0&&p>=t.size)&&(t.visibleSlides.push(c),t.visibleSlidesIndexes.push(l),r[l].classList.add(n.slideVisibleClass)),g&&r[l].classList.add(n.slideFullyVisibleClass),c.progress=i?-f:f,c.originalProgress=i?-d:d}}function YWt(e){const t=this;if(typeof e>"u"){const u=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*u||0}const n=t.params,r=t.maxTranslate()-t.minTranslate();let{progress:i,isBeginning:o,isEnd:s,progressLoop:a}=t;const l=o,c=s;if(r===0)i=0,o=!0,s=!0;else{i=(e-t.minTranslate())/r;const u=Math.abs(e-t.minTranslate())<1,f=Math.abs(e-t.maxTranslate())<1;o=u||i<=0,s=f||i>=1,u&&(i=0),f&&(i=1)}if(n.loop){const u=t.getSlideIndexByData(0),f=t.getSlideIndexByData(t.slides.length-1),d=t.slidesGrid[u],h=t.slidesGrid[f],p=t.slidesGrid[t.slidesGrid.length-1],g=Math.abs(e);g>=d?a=(g-d)/p:a=(g+p-h)/p,a>1&&(a-=1)}Object.assign(t,{progress:i,progressLoop:a,isBeginning:o,isEnd:s}),(n.watchSlidesProgress||n.centeredSlides&&n.autoHeight)&&t.updateSlidesProgress(e),o&&!l&&t.emit("reachBeginning toEdge"),s&&!c&&t.emit("reachEnd toEdge"),(l&&!o||c&&!s)&&t.emit("fromEdge"),t.emit("progress",i)}function GWt(){const e=this,{slides:t,params:n,slidesEl:r,activeIndex:i}=e,o=e.virtual&&n.virtual.enabled,s=e.grid&&n.grid&&n.grid.rows>1,a=f=>Bc(r,`.${n.slideClass}${f}, swiper-slide${f}`)[0];t.forEach(f=>{f.classList.remove(n.slideActiveClass,n.slideNextClass,n.slidePrevClass)});let l,c,u;if(o)if(n.loop){let f=i-e.virtual.slidesBefore;f<0&&(f=e.virtual.slides.length+f),f>=e.virtual.slides.length&&(f-=e.virtual.slides.length),l=a(`[data-swiper-slide-index="${f}"]`)}else l=a(`[data-swiper-slide-index="${i}"]`);else s?(l=t.filter(f=>f.column===i)[0],u=t.filter(f=>f.column===i+1)[0],c=t.filter(f=>f.column===i-1)[0]):l=t[i];l&&(l.classList.add(n.slideActiveClass),s?(u&&u.classList.add(n.slideNextClass),c&&c.classList.add(n.slidePrevClass)):(u=LWt(l,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!u&&(u=t[0]),u&&u.classList.add(n.slideNextClass),c=IWt(l,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!c===0&&(c=t[t.length-1]),c&&c.classList.add(n.slidePrevClass))),e.emitSlidesClasses()}const X5=(e,t)=>{if(!e||e.destroyed||!e.params)return;const n=()=>e.isElement?"swiper-slide":`.${e.params.slideClass}`,r=t.closest(n());if(r){let i=r.querySelector(`.${e.params.lazyPreloaderClass}`);!i&&e.isElement&&(r.shadowRoot?i=r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{r.shadowRoot&&(i=r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`),i&&i.remove())})),i&&i.remove()}},fV=(e,t)=>{if(!e.slides[t])return;const n=e.slides[t].querySelector('[loading="lazy"]');n&&n.removeAttribute("loading")},XG=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const n=e.slides.length;if(!n||!t||t<0)return;t=Math.min(t,n);const r=e.params.slidesPerView==="auto"?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),i=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const s=i,a=[s-t];a.push(...Array.from({length:t}).map((l,c)=>s+r+c)),e.slides.forEach((l,c)=>{a.includes(l.column)&&fV(e,c)});return}const o=i+r-1;if(e.params.rewind||e.params.loop)for(let s=i-t;s<=o+t;s+=1){const a=(s%n+n)%n;(a<i||a>o)&&fV(e,a)}else for(let s=Math.max(i-t,0);s<=Math.min(o+t,n-1);s+=1)s!==i&&(s>o||s<i)&&fV(e,s)};function KWt(e){const{slidesGrid:t,params:n}=e,r=e.rtlTranslate?e.translate:-e.translate;let i;for(let o=0;o<t.length;o+=1)typeof t[o+1]<"u"?r>=t[o]&&r<t[o+1]-(t[o+1]-t[o])/2?i=o:r>=t[o]&&r<t[o+1]&&(i=o+1):r>=t[o]&&(i=o);return n.normalizeSlideIndex&&(i<0||typeof i>"u")&&(i=0),i}function JWt(e){const t=this,n=t.rtlTranslate?t.translate:-t.translate,{snapGrid:r,params:i,activeIndex:o,realIndex:s,snapIndex:a}=t;let l=e,c;const u=h=>{let p=h-t.virtual.slidesBefore;return p<0&&(p=t.virtual.slides.length+p),p>=t.virtual.slides.length&&(p-=t.virtual.slides.length),p};if(typeof l>"u"&&(l=KWt(t)),r.indexOf(n)>=0)c=r.indexOf(n);else{const h=Math.min(i.slidesPerGroupSkip,l);c=h+Math.floor((l-h)/i.slidesPerGroup)}if(c>=r.length&&(c=r.length-1),l===o&&!t.params.loop){c!==a&&(t.snapIndex=c,t.emit("snapIndexChange"));return}if(l===o&&t.params.loop&&t.virtual&&t.params.virtual.enabled){t.realIndex=u(l);return}const f=t.grid&&i.grid&&i.grid.rows>1;let d;if(t.virtual&&i.virtual.enabled&&i.loop)d=u(l);else if(f){const h=t.slides.filter(g=>g.column===l)[0];let p=parseInt(h.getAttribute("data-swiper-slide-index"),10);Number.isNaN(p)&&(p=Math.max(t.slides.indexOf(h),0)),d=Math.floor(p/i.grid.rows)}else if(t.slides[l]){const h=t.slides[l].getAttribute("data-swiper-slide-index");h?d=parseInt(h,10):d=l}else d=l;Object.assign(t,{previousSnapIndex:a,snapIndex:c,previousRealIndex:s,realIndex:d,previousIndex:o,activeIndex:l}),t.initialized&&XG(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(s!==d&&t.emit("realIndexChange"),t.emit("slideChange"))}function eqt(e,t){const n=this,r=n.params;let i=e.closest(`.${r.slideClass}, swiper-slide`);!i&&n.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach(a=>{!i&&a.matches&&a.matches(`.${r.slideClass}, swiper-slide`)&&(i=a)});let o=!1,s;if(i){for(let a=0;a<n.slides.length;a+=1)if(n.slides[a]===i){o=!0,s=a;break}}if(i&&o)n.clickedSlide=i,n.virtual&&n.params.virtual.enabled?n.clickedIndex=parseInt(i.getAttribute("data-swiper-slide-index"),10):n.clickedIndex=s;else{n.clickedSlide=void 0,n.clickedIndex=void 0;return}r.slideToClickedSlide&&n.clickedIndex!==void 0&&n.clickedIndex!==n.activeIndex&&n.slideToClickedSlide()}var tqt={updateSize:VWt,updateSlides:UWt,updateAutoHeight:HWt,updateSlidesOffset:XWt,updateSlidesProgress:ZWt,updateProgress:YWt,updateSlidesClasses:GWt,updateActiveIndex:JWt,updateClickedSlide:eqt};function nqt(e){e===void 0&&(e=this.isHorizontal()?"x":"y");const t=this,{params:n,rtlTranslate:r,translate:i,wrapperEl:o}=t;if(n.virtualTranslate)return r?-i:i;if(n.cssMode)return i;let s=VG(o,e);return s+=t.cssOverflowAdjustment(),r&&(s=-s),s||0}function rqt(e,t){const n=this,{rtlTranslate:r,params:i,wrapperEl:o,progress:s}=n;let a=0,l=0;const c=0;n.isHorizontal()?a=r?-e:e:l=e,i.roundLengths&&(a=Math.floor(a),l=Math.floor(l)),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?a:l,i.cssMode?o[n.isHorizontal()?"scrollLeft":"scrollTop"]=n.isHorizontal()?-a:-l:i.virtualTranslate||(n.isHorizontal()?a-=n.cssOverflowAdjustment():l-=n.cssOverflowAdjustment(),o.style.transform=`translate3d(${a}px, ${l}px, ${c}px)`);let u;const f=n.maxTranslate()-n.minTranslate();f===0?u=0:u=(e-n.minTranslate())/f,u!==s&&n.updateProgress(e),n.emit("setTranslate",n.translate,t)}function iqt(){return-this.snapGrid[0]}function oqt(){return-this.snapGrid[this.snapGrid.length-1]}function sqt(e,t,n,r,i){e===void 0&&(e=0),t===void 0&&(t=this.params.speed),n===void 0&&(n=!0),r===void 0&&(r=!0);const o=this,{params:s,wrapperEl:a}=o;if(o.animating&&s.preventInteractionOnTransition)return!1;const l=o.minTranslate(),c=o.maxTranslate();let u;if(r&&e>l?u=l:r&&e<c?u=c:u=e,o.updateProgress(u),s.cssMode){const f=o.isHorizontal();if(t===0)a[f?"scrollLeft":"scrollTop"]=-u;else{if(!o.support.smoothScroll)return H9e({swiper:o,targetPosition:-u,side:f?"left":"top"}),!0;a.scrollTo({[f?"left":"top"]:-u,behavior:"smooth"})}return!0}return t===0?(o.setTransition(0),o.setTranslate(u),n&&(o.emit("beforeTransitionStart",t,i),o.emit("transitionEnd"))):(o.setTransition(t),o.setTranslate(u),n&&(o.emit("beforeTransitionStart",t,i),o.emit("transitionStart")),o.animating||(o.animating=!0,o.onTranslateToWrapperTransitionEnd||(o.onTranslateToWrapperTransitionEnd=function(d){!o||o.destroyed||d.target===this&&(o.wrapperEl.removeEventListener("transitionend",o.onTranslateToWrapperTransitionEnd),o.onTranslateToWrapperTransitionEnd=null,delete o.onTranslateToWrapperTransitionEnd,n&&o.emit("transitionEnd"))}),o.wrapperEl.addEventListener("transitionend",o.onTranslateToWrapperTransitionEnd))),!0}var aqt={getTranslate:nqt,setTranslate:rqt,minTranslate:iqt,maxTranslate:oqt,translateTo:sqt};function lqt(e,t){const n=this;n.params.cssMode||(n.wrapperEl.style.transitionDuration=`${e}ms`,n.wrapperEl.style.transitionDelay=e===0?"0ms":""),n.emit("setTransition",e,t)}function Y9e(e){let{swiper:t,runCallbacks:n,direction:r,step:i}=e;const{activeIndex:o,previousIndex:s}=t;let a=r;if(a||(o>s?a="next":o<s?a="prev":a="reset"),t.emit(`transition${i}`),n&&o!==s){if(a==="reset"){t.emit(`slideResetTransition${i}`);return}t.emit(`slideChangeTransition${i}`),a==="next"?t.emit(`slideNextTransition${i}`):t.emit(`slidePrevTransition${i}`)}}function cqt(e,t){e===void 0&&(e=!0);const n=this,{params:r}=n;r.cssMode||(r.autoHeight&&n.updateAutoHeight(),Y9e({swiper:n,runCallbacks:e,direction:t,step:"Start"}))}function uqt(e,t){e===void 0&&(e=!0);const n=this,{params:r}=n;n.animating=!1,!r.cssMode&&(n.setTransition(0),Y9e({swiper:n,runCallbacks:e,direction:t,step:"End"}))}var fqt={setTransition:lqt,transitionStart:cqt,transitionEnd:uqt};function dqt(e,t,n,r,i){e===void 0&&(e=0),t===void 0&&(t=this.params.speed),n===void 0&&(n=!0),typeof e=="string"&&(e=parseInt(e,10));const o=this;let s=e;s<0&&(s=0);const{params:a,snapGrid:l,slidesGrid:c,previousIndex:u,activeIndex:f,rtlTranslate:d,wrapperEl:h,enabled:p}=o;if(o.animating&&a.preventInteractionOnTransition||!p&&!r&&!i||o.destroyed)return!1;const g=Math.min(o.params.slidesPerGroupSkip,s);let v=g+Math.floor((s-g)/o.params.slidesPerGroup);v>=l.length&&(v=l.length-1);const y=-l[v];if(a.normalizeSlideIndex)for(let m=0;m<c.length;m+=1){const w=-Math.floor(y*100),S=Math.floor(c[m]*100),E=Math.floor(c[m+1]*100);typeof c[m+1]<"u"?w>=S&&w<E-(E-S)/2?s=m:w>=S&&w<E&&(s=m+1):w>=S&&(s=m)}if(o.initialized&&s!==f&&(!o.allowSlideNext&&(d?y>o.translate&&y>o.minTranslate():y<o.translate&&y<o.minTranslate())||!o.allowSlidePrev&&y>o.translate&&y>o.maxTranslate()&&(f||0)!==s))return!1;s!==(u||0)&&n&&o.emit("beforeSlideChangeStart"),o.updateProgress(y);let O;if(s>f?O="next":s<f?O="prev":O="reset",d&&-y===o.translate||!d&&y===o.translate)return o.updateActiveIndex(s),a.autoHeight&&o.updateAutoHeight(),o.updateSlidesClasses(),a.effect!=="slide"&&o.setTranslate(y),O!=="reset"&&(o.transitionStart(n,O),o.transitionEnd(n,O)),!1;if(a.cssMode){const m=o.isHorizontal(),w=d?y:-y;if(t===0){const S=o.virtual&&o.params.virtual.enabled;S&&(o.wrapperEl.style.scrollSnapType="none",o._immediateVirtual=!0),S&&!o._cssModeVirtualInitialSet&&o.params.initialSlide>0?(o._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{h[m?"scrollLeft":"scrollTop"]=w})):h[m?"scrollLeft":"scrollTop"]=w,S&&requestAnimationFrame(()=>{o.wrapperEl.style.scrollSnapType="",o._immediateVirtual=!1})}else{if(!o.support.smoothScroll)return H9e({swiper:o,targetPosition:w,side:m?"left":"top"}),!0;h.scrollTo({[m?"left":"top"]:w,behavior:"smooth"})}return!0}return o.setTransition(t),o.setTranslate(y),o.updateActiveIndex(s),o.updateSlidesClasses(),o.emit("beforeTransitionStart",t,r),o.transitionStart(n,O),t===0?o.transitionEnd(n,O):o.animating||(o.animating=!0,o.onSlideToWrapperTransitionEnd||(o.onSlideToWrapperTransitionEnd=function(w){!o||o.destroyed||w.target===this&&(o.wrapperEl.removeEventListener("transitionend",o.onSlideToWrapperTransitionEnd),o.onSlideToWrapperTransitionEnd=null,delete o.onSlideToWrapperTransitionEnd,o.transitionEnd(n,O))}),o.wrapperEl.addEventListener("transitionend",o.onSlideToWrapperTransitionEnd)),!0}function hqt(e,t,n,r){e===void 0&&(e=0),t===void 0&&(t=this.params.speed),n===void 0&&(n=!0),typeof e=="string"&&(e=parseInt(e,10));const i=this;if(i.destroyed)return;const o=i.grid&&i.params.grid&&i.params.grid.rows>1;let s=e;if(i.params.loop)if(i.virtual&&i.params.virtual.enabled)s=s+i.virtual.slidesBefore;else{let a;if(o){const d=s*i.params.grid.rows;a=i.slides.filter(h=>h.getAttribute("data-swiper-slide-index")*1===d)[0].column}else a=i.getSlideIndexByData(s);const l=o?Math.ceil(i.slides.length/i.params.grid.rows):i.slides.length,{centeredSlides:c}=i.params;let u=i.params.slidesPerView;u==="auto"?u=i.slidesPerViewDynamic():(u=Math.ceil(parseFloat(i.params.slidesPerView,10)),c&&u%2===0&&(u=u+1));let f=l-a<u;if(c&&(f=f||a<Math.ceil(u/2)),f){const d=c?a<i.activeIndex?"prev":"next":a-i.activeIndex-1<i.params.slidesPerView?"next":"prev";i.loopFix({direction:d,slideTo:!0,activeSlideIndex:d==="next"?a+1:a-l+1,slideRealIndex:d==="next"?i.realIndex:void 0})}if(o){const d=s*i.params.grid.rows;s=i.slides.filter(h=>h.getAttribute("data-swiper-slide-index")*1===d)[0].column}else s=i.getSlideIndexByData(s)}return requestAnimationFrame(()=>{i.slideTo(s,t,n,r)}),i}function pqt(e,t,n){e===void 0&&(e=this.params.speed),t===void 0&&(t=!0);const r=this,{enabled:i,params:o,animating:s}=r;if(!i||r.destroyed)return r;let a=o.slidesPerGroup;o.slidesPerView==="auto"&&o.slidesPerGroup===1&&o.slidesPerGroupAuto&&(a=Math.max(r.slidesPerViewDynamic("current",!0),1));const l=r.activeIndex<o.slidesPerGroupSkip?1:a,c=r.virtual&&o.virtual.enabled;if(o.loop){if(s&&!c&&o.loopPreventsSliding)return!1;if(r.loopFix({direction:"next"}),r._clientLeft=r.wrapperEl.clientLeft,r.activeIndex===r.slides.length-1&&o.cssMode)return requestAnimationFrame(()=>{r.slideTo(r.activeIndex+l,e,t,n)}),!0}return o.rewind&&r.isEnd?r.slideTo(0,e,t,n):r.slideTo(r.activeIndex+l,e,t,n)}function gqt(e,t,n){e===void 0&&(e=this.params.speed),t===void 0&&(t=!0);const r=this,{params:i,snapGrid:o,slidesGrid:s,rtlTranslate:a,enabled:l,animating:c}=r;if(!l||r.destroyed)return r;const u=r.virtual&&i.virtual.enabled;if(i.loop){if(c&&!u&&i.loopPreventsSliding)return!1;r.loopFix({direction:"prev"}),r._clientLeft=r.wrapperEl.clientLeft}const f=a?r.translate:-r.translate;function d(y){return y<0?-Math.floor(Math.abs(y)):Math.floor(y)}const h=d(f),p=o.map(y=>d(y));let g=o[p.indexOf(h)-1];if(typeof g>"u"&&i.cssMode){let y;o.forEach((O,m)=>{h>=O&&(y=m)}),typeof y<"u"&&(g=o[y>0?y-1:y])}let v=0;if(typeof g<"u"&&(v=s.indexOf(g),v<0&&(v=r.activeIndex-1),i.slidesPerView==="auto"&&i.slidesPerGroup===1&&i.slidesPerGroupAuto&&(v=v-r.slidesPerViewDynamic("previous",!0)+1,v=Math.max(v,0))),i.rewind&&r.isBeginning){const y=r.params.virtual&&r.params.virtual.enabled&&r.virtual?r.virtual.slides.length-1:r.slides.length-1;return r.slideTo(y,e,t,n)}else if(i.loop&&r.activeIndex===0&&i.cssMode)return requestAnimationFrame(()=>{r.slideTo(v,e,t,n)}),!0;return r.slideTo(v,e,t,n)}function mqt(e,t,n){e===void 0&&(e=this.params.speed),t===void 0&&(t=!0);const r=this;if(!r.destroyed)return r.slideTo(r.activeIndex,e,t,n)}function yqt(e,t,n,r){e===void 0&&(e=this.params.speed),t===void 0&&(t=!0),r===void 0&&(r=.5);const i=this;if(i.destroyed)return;let o=i.activeIndex;const s=Math.min(i.params.slidesPerGroupSkip,o),a=s+Math.floor((o-s)/i.params.slidesPerGroup),l=i.rtlTranslate?i.translate:-i.translate;if(l>=i.snapGrid[a]){const c=i.snapGrid[a],u=i.snapGrid[a+1];l-c>(u-c)*r&&(o+=i.params.slidesPerGroup)}else{const c=i.snapGrid[a-1],u=i.snapGrid[a];l-c<=(u-c)*r&&(o-=i.params.slidesPerGroup)}return o=Math.max(o,0),o=Math.min(o,i.slidesGrid.length-1),i.slideTo(o,e,t,n)}function vqt(){const e=this;if(e.destroyed)return;const{params:t,slidesEl:n}=e,r=t.slidesPerView==="auto"?e.slidesPerViewDynamic():t.slidesPerView;let i=e.clickedIndex,o;const s=e.isElement?"swiper-slide":`.${t.slideClass}`;if(t.loop){if(e.animating)return;o=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?i<e.loopedSlides-r/2||i>e.slides.length-e.loopedSlides+r/2?(e.loopFix(),i=e.getSlideIndex(Bc(n,`${s}[data-swiper-slide-index="${o}"]`)[0]),qG(()=>{e.slideTo(i)})):e.slideTo(i):i>e.slides.length-r?(e.loopFix(),i=e.getSlideIndex(Bc(n,`${s}[data-swiper-slide-index="${o}"]`)[0]),qG(()=>{e.slideTo(i)})):e.slideTo(i)}else e.slideTo(i)}var bqt={slideTo:dqt,slideToLoop:hqt,slideNext:pqt,slidePrev:gqt,slideReset:mqt,slideToClosest:yqt,slideToClickedSlide:vqt};function Oqt(e){const t=this,{params:n,slidesEl:r}=t;if(!n.loop||t.virtual&&t.params.virtual.enabled)return;const i=()=>{Bc(r,`.${n.slideClass}, swiper-slide`).forEach((f,d)=>{f.setAttribute("data-swiper-slide-index",d)})},o=t.grid&&n.grid&&n.grid.rows>1,s=n.slidesPerGroup*(o?n.grid.rows:1),a=t.slides.length%s!==0,l=o&&t.slides.length%n.grid.rows!==0,c=u=>{for(let f=0;f<u;f+=1){const d=t.isElement?$E("swiper-slide",[n.slideBlankClass]):$E("div",[n.slideClass,n.slideBlankClass]);t.slidesEl.append(d)}};if(a){if(n.loopAddBlankSlides){const u=s-t.slides.length%s;c(u),t.recalcSlides(),t.updateSlides()}else D3("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else if(l){if(n.loopAddBlankSlides){const u=n.grid.rows-t.slides.length%n.grid.rows;c(u),t.recalcSlides(),t.updateSlides()}else D3("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else i();t.loopFix({slideRealIndex:e,direction:n.centeredSlides?void 0:"next"})}function xqt(e){let{slideRealIndex:t,slideTo:n=!0,direction:r,setTranslate:i,activeSlideIndex:o,byController:s,byMousewheel:a}=e===void 0?{}:e;const l=this;if(!l.params.loop)return;l.emit("beforeLoopFix");const{slides:c,allowSlidePrev:u,allowSlideNext:f,slidesEl:d,params:h}=l,{centeredSlides:p}=h;if(l.allowSlidePrev=!0,l.allowSlideNext=!0,l.virtual&&h.virtual.enabled){n&&(!h.centeredSlides&&l.snapIndex===0?l.slideTo(l.virtual.slides.length,0,!1,!0):h.centeredSlides&&l.snapIndex<h.slidesPerView?l.slideTo(l.virtual.slides.length+l.snapIndex,0,!1,!0):l.snapIndex===l.snapGrid.length-1&&l.slideTo(l.virtual.slidesBefore,0,!1,!0)),l.allowSlidePrev=u,l.allowSlideNext=f,l.emit("loopFix");return}let g=h.slidesPerView;g==="auto"?g=l.slidesPerViewDynamic():(g=Math.ceil(parseFloat(h.slidesPerView,10)),p&&g%2===0&&(g=g+1));const v=h.slidesPerGroupAuto?g:h.slidesPerGroup;let y=v;y%v!==0&&(y+=v-y%v),y+=h.loopAdditionalSlides,l.loopedSlides=y;const O=l.grid&&h.grid&&h.grid.rows>1;c.length<g+y?D3("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):O&&h.grid.fill==="row"&&D3("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const m=[],w=[];let S=l.activeIndex;typeof o>"u"?o=l.getSlideIndex(c.filter(A=>A.classList.contains(h.slideActiveClass))[0]):S=o;const E=r==="next"||!r,C=r==="prev"||!r;let k=0,P=0;const D=O?Math.ceil(c.length/h.grid.rows):c.length,L=(O?c[o].column:o)+(p&&typeof i>"u"?-g/2+.5:0);if(L<y){k=Math.max(y-L,v);for(let A=0;A<y-L;A+=1){const T=A-Math.floor(A/D)*D;if(O){const N=D-T-1;for(let j=c.length-1;j>=0;j-=1)c[j].column===N&&m.push(j)}else m.push(D-T-1)}}else if(L+g>D-y){P=Math.max(L-(D-y*2),v);for(let A=0;A<P;A+=1){const T=A-Math.floor(A/D)*D;O?c.forEach((N,j)=>{N.column===T&&w.push(j)}):w.push(T)}}if(l.__preventObserver__=!0,requestAnimationFrame(()=>{l.__preventObserver__=!1}),C&&m.forEach(A=>{c[A].swiperLoopMoveDOM=!0,d.prepend(c[A]),c[A].swiperLoopMoveDOM=!1}),E&&w.forEach(A=>{c[A].swiperLoopMoveDOM=!0,d.append(c[A]),c[A].swiperLoopMoveDOM=!1}),l.recalcSlides(),h.slidesPerView==="auto"?l.updateSlides():O&&(m.length>0&&C||w.length>0&&E)&&l.slides.forEach((A,T)=>{l.grid.updateSlide(T,A,l.slides)}),h.watchSlidesProgress&&l.updateSlidesOffset(),n){if(m.length>0&&C){if(typeof t>"u"){const A=l.slidesGrid[S],N=l.slidesGrid[S+k]-A;a?l.setTranslate(l.translate-N):(l.slideTo(S+Math.ceil(k),0,!1,!0),i&&(l.touchEventsData.startTranslate=l.touchEventsData.startTranslate-N,l.touchEventsData.currentTranslate=l.touchEventsData.currentTranslate-N))}else if(i){const A=O?m.length/h.grid.rows:m.length;l.slideTo(l.activeIndex+A,0,!1,!0),l.touchEventsData.currentTranslate=l.translate}}else if(w.length>0&&E)if(typeof t>"u"){const A=l.slidesGrid[S],N=l.slidesGrid[S-P]-A;a?l.setTranslate(l.translate-N):(l.slideTo(S-P,0,!1,!0),i&&(l.touchEventsData.startTranslate=l.touchEventsData.startTranslate-N,l.touchEventsData.currentTranslate=l.touchEventsData.currentTranslate-N))}else{const A=O?w.length/h.grid.rows:w.length;l.slideTo(l.activeIndex-A,0,!1,!0)}}if(l.allowSlidePrev=u,l.allowSlideNext=f,l.controller&&l.controller.control&&!s){const A={slideRealIndex:t,direction:r,setTranslate:i,activeSlideIndex:o,byController:!0};Array.isArray(l.controller.control)?l.controller.control.forEach(T=>{!T.destroyed&&T.params.loop&&T.loopFix({...A,slideTo:T.params.slidesPerView===h.slidesPerView?n:!1})}):l.controller.control instanceof l.constructor&&l.controller.control.params.loop&&l.controller.control.loopFix({...A,slideTo:l.controller.control.params.slidesPerView===h.slidesPerView?n:!1})}l.emit("loopFix")}function wqt(){const e=this,{params:t,slidesEl:n}=e;if(!t.loop||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const r=[];e.slides.forEach(i=>{const o=typeof i.swiperSlideIndex>"u"?i.getAttribute("data-swiper-slide-index")*1:i.swiperSlideIndex;r[o]=i}),e.slides.forEach(i=>{i.removeAttribute("data-swiper-slide-index")}),r.forEach(i=>{n.append(i)}),e.recalcSlides(),e.slideTo(e.realIndex,0)}var Sqt={loopCreate:Oqt,loopFix:xqt,loopDestroy:wqt};function Eqt(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const n=t.params.touchEventsTarget==="container"?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),n.style.cursor="move",n.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1})}function Cqt(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e[e.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1}))}var _qt={setGrabCursor:Eqt,unsetGrabCursor:Cqt};function kqt(e,t){t===void 0&&(t=this);function n(r){if(!r||r===mm()||r===Va())return null;r.assignedSlot&&(r=r.assignedSlot);const i=r.closest(e);return!i&&!r.getRootNode?null:i||n(r.getRootNode().host)}return n(t)}function Txe(e,t,n){const r=Va(),{params:i}=e,o=i.edgeSwipeDetection,s=i.edgeSwipeThreshold;return o&&(n<=s||n>=r.innerWidth-s)?o==="prevent"?(t.preventDefault(),!0):!1:!0}function $qt(e){const t=this,n=mm();let r=e;r.originalEvent&&(r=r.originalEvent);const i=t.touchEventsData;if(r.type==="pointerdown"){if(i.pointerId!==null&&i.pointerId!==r.pointerId)return;i.pointerId=r.pointerId}else r.type==="touchstart"&&r.targetTouches.length===1&&(i.touchId=r.targetTouches[0].identifier);if(r.type==="touchstart"){Txe(t,r,r.targetTouches[0].pageX);return}const{params:o,touches:s,enabled:a}=t;if(!a||!o.simulateTouch&&r.pointerType==="mouse"||t.animating&&o.preventInteractionOnTransition)return;!t.animating&&o.cssMode&&o.loop&&t.loopFix();let l=r.target;if(o.touchEventsTarget==="wrapper"&&!t.wrapperEl.contains(l)||"which"in r&&r.which===3||"button"in r&&r.button>0||i.isTouched&&i.isMoved)return;const c=!!o.noSwipingClass&&o.noSwipingClass!=="",u=r.composedPath?r.composedPath():r.path;c&&r.target&&r.target.shadowRoot&&u&&(l=u[0]);const f=o.noSwipingSelector?o.noSwipingSelector:`.${o.noSwipingClass}`,d=!!(r.target&&r.target.shadowRoot);if(o.noSwiping&&(d?kqt(f,l):l.closest(f))){t.allowClick=!0;return}if(o.swipeHandler&&!l.closest(o.swipeHandler))return;s.currentX=r.pageX,s.currentY=r.pageY;const h=s.currentX,p=s.currentY;if(!Txe(t,r,h))return;Object.assign(i,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),s.startX=h,s.startY=p,i.touchStartTime=R3(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,o.threshold>0&&(i.allowThresholdMove=!1);let g=!0;l.matches(i.focusableElements)&&(g=!1,l.nodeName==="SELECT"&&(i.isTouched=!1)),n.activeElement&&n.activeElement.matches(i.focusableElements)&&n.activeElement!==l&&n.activeElement.blur();const v=g&&t.allowTouchMove&&o.touchStartPreventDefault;(o.touchStartForcePreventDefault||v)&&!l.isContentEditable&&r.preventDefault(),o.freeMode&&o.freeMode.enabled&&t.freeMode&&t.animating&&!o.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",r)}function Tqt(e){const t=mm(),n=this,r=n.touchEventsData,{params:i,touches:o,rtlTranslate:s,enabled:a}=n;if(!a||!i.simulateTouch&&e.pointerType==="mouse")return;let l=e;if(l.originalEvent&&(l=l.originalEvent),l.type==="pointermove"&&(r.touchId!==null||l.pointerId!==r.pointerId))return;let c;if(l.type==="touchmove"){if(c=[...l.changedTouches].filter(E=>E.identifier===r.touchId)[0],!c||c.identifier!==r.touchId)return}else c=l;if(!r.isTouched){r.startMoving&&r.isScrolling&&n.emit("touchMoveOpposite",l);return}const u=c.pageX,f=c.pageY;if(l.preventedByNestedSwiper){o.startX=u,o.startY=f;return}if(!n.allowTouchMove){l.target.matches(r.focusableElements)||(n.allowClick=!1),r.isTouched&&(Object.assign(o,{startX:u,startY:f,currentX:u,currentY:f}),r.touchStartTime=R3());return}if(i.touchReleaseOnEdges&&!i.loop){if(n.isVertical()){if(f<o.startY&&n.translate<=n.maxTranslate()||f>o.startY&&n.translate>=n.minTranslate()){r.isTouched=!1,r.isMoved=!1;return}}else if(u<o.startX&&n.translate<=n.maxTranslate()||u>o.startX&&n.translate>=n.minTranslate())return}if(t.activeElement&&l.target===t.activeElement&&l.target.matches(r.focusableElements)){r.isMoved=!0,n.allowClick=!1;return}r.allowTouchCallbacks&&n.emit("touchMove",l),o.previousX=o.currentX,o.previousY=o.currentY,o.currentX=u,o.currentY=f;const d=o.currentX-o.startX,h=o.currentY-o.startY;if(n.params.threshold&&Math.sqrt(d**2+h**2)<n.params.threshold)return;if(typeof r.isScrolling>"u"){let E;n.isHorizontal()&&o.currentY===o.startY||n.isVertical()&&o.currentX===o.startX?r.isScrolling=!1:d*d+h*h>=25&&(E=Math.atan2(Math.abs(h),Math.abs(d))*180/Math.PI,r.isScrolling=n.isHorizontal()?E>i.touchAngle:90-E>i.touchAngle)}if(r.isScrolling&&n.emit("touchMoveOpposite",l),typeof r.startMoving>"u"&&(o.currentX!==o.startX||o.currentY!==o.startY)&&(r.startMoving=!0),r.isScrolling){r.isTouched=!1;return}if(!r.startMoving)return;n.allowClick=!1,!i.cssMode&&l.cancelable&&l.preventDefault(),i.touchMoveStopPropagation&&!i.nested&&l.stopPropagation();let p=n.isHorizontal()?d:h,g=n.isHorizontal()?o.currentX-o.previousX:o.currentY-o.previousY;i.oneWayMovement&&(p=Math.abs(p)*(s?1:-1),g=Math.abs(g)*(s?1:-1)),o.diff=p,p*=i.touchRatio,s&&(p=-p,g=-g);const v=n.touchesDirection;n.swipeDirection=p>0?"prev":"next",n.touchesDirection=g>0?"prev":"next";const y=n.params.loop&&!i.cssMode,O=n.touchesDirection==="next"&&n.allowSlideNext||n.touchesDirection==="prev"&&n.allowSlidePrev;if(!r.isMoved){if(y&&O&&n.loopFix({direction:n.swipeDirection}),r.startTranslate=n.getTranslate(),n.setTransition(0),n.animating){const E=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});n.wrapperEl.dispatchEvent(E)}r.allowMomentumBounce=!1,i.grabCursor&&(n.allowSlideNext===!0||n.allowSlidePrev===!0)&&n.setGrabCursor(!0),n.emit("sliderFirstMove",l)}let m;if(new Date().getTime(),r.isMoved&&r.allowThresholdMove&&v!==n.touchesDirection&&y&&O&&Math.abs(p)>=1){Object.assign(o,{startX:u,startY:f,currentX:u,currentY:f,startTranslate:r.currentTranslate}),r.loopSwapReset=!0,r.startTranslate=r.currentTranslate;return}n.emit("sliderMove",l),r.isMoved=!0,r.currentTranslate=p+r.startTranslate;let w=!0,S=i.resistanceRatio;if(i.touchReleaseOnEdges&&(S=0),p>0?(y&&O&&!m&&r.allowThresholdMove&&r.currentTranslate>(i.centeredSlides?n.minTranslate()-n.slidesSizesGrid[n.activeIndex+1]:n.minTranslate())&&n.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),r.currentTranslate>n.minTranslate()&&(w=!1,i.resistance&&(r.currentTranslate=n.minTranslate()-1+(-n.minTranslate()+r.startTranslate+p)**S))):p<0&&(y&&O&&!m&&r.allowThresholdMove&&r.currentTranslate<(i.centeredSlides?n.maxTranslate()+n.slidesSizesGrid[n.slidesSizesGrid.length-1]:n.maxTranslate())&&n.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:n.slides.length-(i.slidesPerView==="auto"?n.slidesPerViewDynamic():Math.ceil(parseFloat(i.slidesPerView,10)))}),r.currentTranslate<n.maxTranslate()&&(w=!1,i.resistance&&(r.currentTranslate=n.maxTranslate()+1-(n.maxTranslate()-r.startTranslate-p)**S))),w&&(l.preventedByNestedSwiper=!0),!n.allowSlideNext&&n.swipeDirection==="next"&&r.currentTranslate<r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&n.swipeDirection==="prev"&&r.currentTranslate>r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&!n.allowSlideNext&&(r.currentTranslate=r.startTranslate),i.threshold>0)if(Math.abs(p)>i.threshold||r.allowThresholdMove){if(!r.allowThresholdMove){r.allowThresholdMove=!0,o.startX=o.currentX,o.startY=o.currentY,r.currentTranslate=r.startTranslate,o.diff=n.isHorizontal()?o.currentX-o.startX:o.currentY-o.startY;return}}else{r.currentTranslate=r.startTranslate;return}!i.followFinger||i.cssMode||((i.freeMode&&i.freeMode.enabled&&n.freeMode||i.watchSlidesProgress)&&(n.updateActiveIndex(),n.updateSlidesClasses()),i.freeMode&&i.freeMode.enabled&&n.freeMode&&n.freeMode.onTouchMove(),n.updateProgress(r.currentTranslate),n.setTranslate(r.currentTranslate))}function Pqt(e){const t=this,n=t.touchEventsData;let r=e;r.originalEvent&&(r=r.originalEvent);let i;if(r.type==="touchend"||r.type==="touchcancel"){if(i=[...r.changedTouches].filter(S=>S.identifier===n.touchId)[0],!i||i.identifier!==n.touchId)return}else{if(n.touchId!==null||r.pointerId!==n.pointerId)return;i=r}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(r.type)&&!(["pointercancel","contextmenu"].includes(r.type)&&(t.browser.isSafari||t.browser.isWebView)))return;n.pointerId=null,n.touchId=null;const{params:s,touches:a,rtlTranslate:l,slidesGrid:c,enabled:u}=t;if(!u||!s.simulateTouch&&r.pointerType==="mouse")return;if(n.allowTouchCallbacks&&t.emit("touchEnd",r),n.allowTouchCallbacks=!1,!n.isTouched){n.isMoved&&s.grabCursor&&t.setGrabCursor(!1),n.isMoved=!1,n.startMoving=!1;return}s.grabCursor&&n.isMoved&&n.isTouched&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!1);const f=R3(),d=f-n.touchStartTime;if(t.allowClick){const S=r.path||r.composedPath&&r.composedPath();t.updateClickedSlide(S&&S[0]||r.target,S),t.emit("tap click",r),d<300&&f-n.lastClickTime<300&&t.emit("doubleTap doubleClick",r)}if(n.lastClickTime=R3(),qG(()=>{t.destroyed||(t.allowClick=!0)}),!n.isTouched||!n.isMoved||!t.swipeDirection||a.diff===0&&!n.loopSwapReset||n.currentTranslate===n.startTranslate&&!n.loopSwapReset){n.isTouched=!1,n.isMoved=!1,n.startMoving=!1;return}n.isTouched=!1,n.isMoved=!1,n.startMoving=!1;let h;if(s.followFinger?h=l?t.translate:-t.translate:h=-n.currentTranslate,s.cssMode)return;if(s.freeMode&&s.freeMode.enabled){t.freeMode.onTouchEnd({currentPos:h});return}const p=h>=-t.maxTranslate()&&!t.params.loop;let g=0,v=t.slidesSizesGrid[0];for(let S=0;S<c.length;S+=S<s.slidesPerGroupSkip?1:s.slidesPerGroup){const E=S<s.slidesPerGroupSkip-1?1:s.slidesPerGroup;typeof c[S+E]<"u"?(p||h>=c[S]&&h<c[S+E])&&(g=S,v=c[S+E]-c[S]):(p||h>=c[S])&&(g=S,v=c[c.length-1]-c[c.length-2])}let y=null,O=null;s.rewind&&(t.isBeginning?O=s.virtual&&s.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(y=0));const m=(h-c[g])/v,w=g<s.slidesPerGroupSkip-1?1:s.slidesPerGroup;if(d>s.longSwipesMs){if(!s.longSwipes){t.slideTo(t.activeIndex);return}t.swipeDirection==="next"&&(m>=s.longSwipesRatio?t.slideTo(s.rewind&&t.isEnd?y:g+w):t.slideTo(g)),t.swipeDirection==="prev"&&(m>1-s.longSwipesRatio?t.slideTo(g+w):O!==null&&m<0&&Math.abs(m)>s.longSwipesRatio?t.slideTo(O):t.slideTo(g))}else{if(!s.shortSwipes){t.slideTo(t.activeIndex);return}t.navigation&&(r.target===t.navigation.nextEl||r.target===t.navigation.prevEl)?r.target===t.navigation.nextEl?t.slideTo(g+w):t.slideTo(g):(t.swipeDirection==="next"&&t.slideTo(y!==null?y:g+w),t.swipeDirection==="prev"&&t.slideTo(O!==null?O:g))}}function Pxe(){const e=this,{params:t,el:n}=e;if(n&&n.offsetWidth===0)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:r,allowSlidePrev:i,snapGrid:o}=e,s=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const a=s&&t.loop;(t.slidesPerView==="auto"||t.slidesPerView>1)&&e.isEnd&&!e.isBeginning&&!e.params.centeredSlides&&!a?e.slideTo(e.slides.length-1,0,!1,!0):e.params.loop&&!s?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout(()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()},500)),e.allowSlidePrev=i,e.allowSlideNext=r,e.params.watchOverflow&&o!==e.snapGrid&&e.checkOverflow()}function Aqt(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function Rqt(){const e=this,{wrapperEl:t,rtlTranslate:n,enabled:r}=e;if(!r)return;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,e.translate===0&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();let i;const o=e.maxTranslate()-e.minTranslate();o===0?i=0:i=(e.translate-e.minTranslate())/o,i!==e.progress&&e.updateProgress(n?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function Dqt(e){const t=this;X5(t,e.target),!(t.params.cssMode||t.params.slidesPerView!=="auto"&&!t.params.autoHeight)&&t.update()}function Mqt(){const e=this;e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const G9e=(e,t)=>{const n=mm(),{params:r,el:i,wrapperEl:o,device:s}=e,a=!!r.nested,l=t==="on"?"addEventListener":"removeEventListener",c=t;n[l]("touchstart",e.onDocumentTouchStart,{passive:!1,capture:a}),i[l]("touchstart",e.onTouchStart,{passive:!1}),i[l]("pointerdown",e.onTouchStart,{passive:!1}),n[l]("touchmove",e.onTouchMove,{passive:!1,capture:a}),n[l]("pointermove",e.onTouchMove,{passive:!1,capture:a}),n[l]("touchend",e.onTouchEnd,{passive:!0}),n[l]("pointerup",e.onTouchEnd,{passive:!0}),n[l]("pointercancel",e.onTouchEnd,{passive:!0}),n[l]("touchcancel",e.onTouchEnd,{passive:!0}),n[l]("pointerout",e.onTouchEnd,{passive:!0}),n[l]("pointerleave",e.onTouchEnd,{passive:!0}),n[l]("contextmenu",e.onTouchEnd,{passive:!0}),(r.preventClicks||r.preventClicksPropagation)&&i[l]("click",e.onClick,!0),r.cssMode&&o[l]("scroll",e.onScroll),r.updateOnWindowResize?e[c](s.ios||s.android?"resize orientationchange observerUpdate":"resize observerUpdate",Pxe,!0):e[c]("observerUpdate",Pxe,!0),i[l]("load",e.onLoad,{capture:!0})};function Nqt(){const e=this,{params:t}=e;e.onTouchStart=$qt.bind(e),e.onTouchMove=Tqt.bind(e),e.onTouchEnd=Pqt.bind(e),e.onDocumentTouchStart=Mqt.bind(e),t.cssMode&&(e.onScroll=Rqt.bind(e)),e.onClick=Aqt.bind(e),e.onLoad=Dqt.bind(e),G9e(e,"on")}function Iqt(){G9e(this,"off")}var Lqt={attachEvents:Nqt,detachEvents:Iqt};const Axe=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;function jqt(){const e=this,{realIndex:t,initialized:n,params:r,el:i}=e,o=r.breakpoints;if(!o||o&&Object.keys(o).length===0)return;const s=e.getBreakpoint(o,e.params.breakpointsBase,e.el);if(!s||e.currentBreakpoint===s)return;const l=(s in o?o[s]:void 0)||e.originalParams,c=Axe(e,r),u=Axe(e,l),f=r.enabled;c&&!u?(i.classList.remove(`${r.containerModifierClass}grid`,`${r.containerModifierClass}grid-column`),e.emitContainerClasses()):!c&&u&&(i.classList.add(`${r.containerModifierClass}grid`),(l.grid.fill&&l.grid.fill==="column"||!l.grid.fill&&r.grid.fill==="column")&&i.classList.add(`${r.containerModifierClass}grid-column`),e.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach(y=>{if(typeof l[y]>"u")return;const O=r[y]&&r[y].enabled,m=l[y]&&l[y].enabled;O&&!m&&e[y].disable(),!O&&m&&e[y].enable()});const d=l.direction&&l.direction!==r.direction,h=r.loop&&(l.slidesPerView!==r.slidesPerView||d),p=r.loop;d&&n&&e.changeDirection(),Rc(e.params,l);const g=e.params.enabled,v=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),f&&!g?e.disable():!f&&g&&e.enable(),e.currentBreakpoint=s,e.emit("_beforeBreakpoint",l),n&&(h?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!p&&v?(e.loopCreate(t),e.updateSlides()):p&&!v&&e.loopDestroy()),e.emit("breakpoint",l)}function Fqt(e,t,n){if(t===void 0&&(t="window"),!e||t==="container"&&!n)return;let r=!1;const i=Va(),o=t==="window"?i.innerHeight:n.clientHeight,s=Object.keys(e).map(a=>{if(typeof a=="string"&&a.indexOf("@")===0){const l=parseFloat(a.substr(1));return{value:o*l,point:a}}return{value:a,point:a}});s.sort((a,l)=>parseInt(a.value,10)-parseInt(l.value,10));for(let a=0;a<s.length;a+=1){const{point:l,value:c}=s[a];t==="window"?i.matchMedia(`(min-width: ${c}px)`).matches&&(r=l):c<=n.clientWidth&&(r=l)}return r||"max"}var zqt={setBreakpoint:jqt,getBreakpoint:Fqt};function Qqt(e,t){const n=[];return e.forEach(r=>{typeof r=="object"?Object.keys(r).forEach(i=>{r[i]&&n.push(t+i)}):typeof r=="string"&&n.push(t+r)}),n}function Bqt(){const e=this,{classNames:t,params:n,rtl:r,el:i,device:o}=e,s=Qqt(["initialized",n.direction,{"free-mode":e.params.freeMode&&n.freeMode.enabled},{autoheight:n.autoHeight},{rtl:r},{grid:n.grid&&n.grid.rows>1},{"grid-column":n.grid&&n.grid.rows>1&&n.grid.fill==="column"},{android:o.android},{ios:o.ios},{"css-mode":n.cssMode},{centered:n.cssMode&&n.centeredSlides},{"watch-progress":n.watchSlidesProgress}],n.containerModifierClass);t.push(...s),i.classList.add(...t),e.emitContainerClasses()}function Wqt(){const e=this,{el:t,classNames:n}=e;t.classList.remove(...n),e.emitContainerClasses()}var qqt={addClasses:Bqt,removeClasses:Wqt};function Vqt(){const e=this,{isLocked:t,params:n}=e,{slidesOffsetBefore:r}=n;if(r){const i=e.slides.length-1,o=e.slidesGrid[i]+e.slidesSizesGrid[i]+r*2;e.isLocked=e.size>o}else e.isLocked=e.snapGrid.length===1;n.allowSlideNext===!0&&(e.allowSlideNext=!e.isLocked),n.allowSlidePrev===!0&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}var Uqt={checkOverflow:Vqt},ZG={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function Hqt(e,t){return function(r){r===void 0&&(r={});const i=Object.keys(r)[0],o=r[i];if(typeof o!="object"||o===null){Rc(t,r);return}if(e[i]===!0&&(e[i]={enabled:!0}),i==="navigation"&&e[i]&&e[i].enabled&&!e[i].prevEl&&!e[i].nextEl&&(e[i].auto=!0),["pagination","scrollbar"].indexOf(i)>=0&&e[i]&&e[i].enabled&&!e[i].el&&(e[i].auto=!0),!(i in e&&"enabled"in o)){Rc(t,r);return}typeof e[i]=="object"&&!("enabled"in e[i])&&(e[i].enabled=!0),e[i]||(e[i]={enabled:!1}),Rc(t,r)}}const dV={eventsEmitter:qWt,update:tqt,translate:aqt,transition:fqt,slide:bqt,loop:Sqt,grabCursor:_qt,events:Lqt,breakpoints:zqt,checkOverflow:Uqt,classes:qqt},hV={};let Hae=class Zp{constructor(){let t,n;for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];i.length===1&&i[0].constructor&&Object.prototype.toString.call(i[0]).slice(8,-1)==="Object"?n=i[0]:[t,n]=i,n||(n={}),n=Rc({},n),t&&!n.el&&(n.el=t);const s=mm();if(n.el&&typeof n.el=="string"&&s.querySelectorAll(n.el).length>1){const u=[];return s.querySelectorAll(n.el).forEach(f=>{const d=Rc({},n,{el:f});u.push(new Zp(d))}),u}const a=this;a.__swiper__=!0,a.support=X9e(),a.device=Z9e({userAgent:n.userAgent}),a.browser=QWt(),a.eventsListeners={},a.eventsAnyListeners=[],a.modules=[...a.__modules__],n.modules&&Array.isArray(n.modules)&&a.modules.push(...n.modules);const l={};a.modules.forEach(u=>{u({params:n,swiper:a,extendParams:Hqt(n,l),on:a.on.bind(a),once:a.once.bind(a),off:a.off.bind(a),emit:a.emit.bind(a)})});const c=Rc({},ZG,l);return a.params=Rc({},c,hV,n),a.originalParams=Rc({},a.params),a.passedParams=Rc({},n),a.params&&a.params.on&&Object.keys(a.params.on).forEach(u=>{a.on(u,a.params.on[u])}),a.params&&a.params.onAny&&a.onAny(a.params.onAny),Object.assign(a,{enabled:a.params.enabled,el:t,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return a.params.direction==="horizontal"},isVertical(){return a.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:a.params.allowSlideNext,allowSlidePrev:a.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:a.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:a.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),a.emit("_swiper"),a.params.init&&a.init(),a}getDirectionLabel(t){return this.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}getSlideIndex(t){const{slidesEl:n,params:r}=this,i=Bc(n,`.${r.slideClass}, swiper-slide`),o=M3(i[0]);return M3(t)-o}getSlideIndexByData(t){return this.getSlideIndex(this.slides.filter(n=>n.getAttribute("data-swiper-slide-index")*1===t)[0])}recalcSlides(){const t=this,{slidesEl:n,params:r}=t;t.slides=Bc(n,`.${r.slideClass}, swiper-slide`)}enable(){const t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))}disable(){const t=this;t.enabled&&(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))}setProgress(t,n){const r=this;t=Math.min(Math.max(t,0),1);const i=r.minTranslate(),s=(r.maxTranslate()-i)*t+i;r.translateTo(s,typeof n>"u"?0:n),r.updateActiveIndex(),r.updateSlidesClasses()}emitContainerClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const n=t.el.className.split(" ").filter(r=>r.indexOf("swiper")===0||r.indexOf(t.params.containerModifierClass)===0);t.emit("_containerClasses",n.join(" "))}getSlideClasses(t){const n=this;return n.destroyed?"":t.className.split(" ").filter(r=>r.indexOf("swiper-slide")===0||r.indexOf(n.params.slideClass)===0).join(" ")}emitSlidesClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const n=[];t.slides.forEach(r=>{const i=t.getSlideClasses(r);n.push({slideEl:r,classNames:i}),t.emit("_slideClass",r,i)}),t.emit("_slideClasses",n)}slidesPerViewDynamic(t,n){t===void 0&&(t="current"),n===void 0&&(n=!1);const r=this,{params:i,slides:o,slidesGrid:s,slidesSizesGrid:a,size:l,activeIndex:c}=r;let u=1;if(typeof i.slidesPerView=="number")return i.slidesPerView;if(i.centeredSlides){let f=o[c]?Math.ceil(o[c].swiperSlideSize):0,d;for(let h=c+1;h<o.length;h+=1)o[h]&&!d&&(f+=Math.ceil(o[h].swiperSlideSize),u+=1,f>l&&(d=!0));for(let h=c-1;h>=0;h-=1)o[h]&&!d&&(f+=o[h].swiperSlideSize,u+=1,f>l&&(d=!0))}else if(t==="current")for(let f=c+1;f<o.length;f+=1)(n?s[f]+a[f]-s[c]<l:s[f]-s[c]<l)&&(u+=1);else for(let f=c-1;f>=0;f-=1)s[c]-s[f]<l&&(u+=1);return u}update(){const t=this;if(!t||t.destroyed)return;const{snapGrid:n,params:r}=t;r.breakpoints&&t.setBreakpoint(),[...t.el.querySelectorAll('[loading="lazy"]')].forEach(s=>{s.complete&&X5(t,s)}),t.updateSize(),t.updateSlides(),t.updateProgress(),t.updateSlidesClasses();function i(){const s=t.rtlTranslate?t.translate*-1:t.translate,a=Math.min(Math.max(s,t.maxTranslate()),t.minTranslate());t.setTranslate(a),t.updateActiveIndex(),t.updateSlidesClasses()}let o;if(r.freeMode&&r.freeMode.enabled&&!r.cssMode)i(),r.autoHeight&&t.updateAutoHeight();else{if((r.slidesPerView==="auto"||r.slidesPerView>1)&&t.isEnd&&!r.centeredSlides){const s=t.virtual&&r.virtual.enabled?t.virtual.slides:t.slides;o=t.slideTo(s.length-1,0,!1,!0)}else o=t.slideTo(t.activeIndex,0,!1,!0);o||i()}r.watchOverflow&&n!==t.snapGrid&&t.checkOverflow(),t.emit("update")}changeDirection(t,n){n===void 0&&(n=!0);const r=this,i=r.params.direction;return t||(t=i==="horizontal"?"vertical":"horizontal"),t===i||t!=="horizontal"&&t!=="vertical"||(r.el.classList.remove(`${r.params.containerModifierClass}${i}`),r.el.classList.add(`${r.params.containerModifierClass}${t}`),r.emitContainerClasses(),r.params.direction=t,r.slides.forEach(o=>{t==="vertical"?o.style.width="":o.style.height=""}),r.emit("changeDirection"),n&&r.update()),r}changeLanguageDirection(t){const n=this;n.rtl&&t==="rtl"||!n.rtl&&t==="ltr"||(n.rtl=t==="rtl",n.rtlTranslate=n.params.direction==="horizontal"&&n.rtl,n.rtl?(n.el.classList.add(`${n.params.containerModifierClass}rtl`),n.el.dir="rtl"):(n.el.classList.remove(`${n.params.containerModifierClass}rtl`),n.el.dir="ltr"),n.update())}mount(t){const n=this;if(n.mounted)return!0;let r=t||n.params.el;if(typeof r=="string"&&(r=document.querySelector(r)),!r)return!1;r.swiper=n,r.parentNode&&r.parentNode.host&&r.parentNode.host.nodeName===n.params.swiperElementNodeName.toUpperCase()&&(n.isElement=!0);const i=()=>`.${(n.params.wrapperClass||"").trim().split(" ").join(".")}`;let s=r&&r.shadowRoot&&r.shadowRoot.querySelector?r.shadowRoot.querySelector(i()):Bc(r,i())[0];return!s&&n.params.createElements&&(s=$E("div",n.params.wrapperClass),r.append(s),Bc(r,`.${n.params.slideClass}`).forEach(a=>{s.append(a)})),Object.assign(n,{el:r,wrapperEl:s,slidesEl:n.isElement&&!r.parentNode.host.slideSlots?r.parentNode.host:s,hostEl:n.isElement?r.parentNode.host:r,mounted:!0,rtl:r.dir.toLowerCase()==="rtl"||$y(r,"direction")==="rtl",rtlTranslate:n.params.direction==="horizontal"&&(r.dir.toLowerCase()==="rtl"||$y(r,"direction")==="rtl"),wrongRTL:$y(s,"display")==="-webkit-box"}),!0}init(t){const n=this;if(n.initialized||n.mount(t)===!1)return n;n.emit("beforeInit"),n.params.breakpoints&&n.setBreakpoint(),n.addClasses(),n.updateSize(),n.updateSlides(),n.params.watchOverflow&&n.checkOverflow(),n.params.grabCursor&&n.enabled&&n.setGrabCursor(),n.params.loop&&n.virtual&&n.params.virtual.enabled?n.slideTo(n.params.initialSlide+n.virtual.slidesBefore,0,n.params.runCallbacksOnInit,!1,!0):n.slideTo(n.params.initialSlide,0,n.params.runCallbacksOnInit,!1,!0),n.params.loop&&n.loopCreate(),n.attachEvents();const i=[...n.el.querySelectorAll('[loading="lazy"]')];return n.isElement&&i.push(...n.hostEl.querySelectorAll('[loading="lazy"]')),i.forEach(o=>{o.complete?X5(n,o):o.addEventListener("load",s=>{X5(n,s.target)})}),XG(n),n.initialized=!0,XG(n),n.emit("init"),n.emit("afterInit"),n}destroy(t,n){t===void 0&&(t=!0),n===void 0&&(n=!0);const r=this,{params:i,el:o,wrapperEl:s,slides:a}=r;return typeof r.params>"u"||r.destroyed||(r.emit("beforeDestroy"),r.initialized=!1,r.detachEvents(),i.loop&&r.loopDestroy(),n&&(r.removeClasses(),o.removeAttribute("style"),s.removeAttribute("style"),a&&a.length&&a.forEach(l=>{l.classList.remove(i.slideVisibleClass,i.slideFullyVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass),l.removeAttribute("style"),l.removeAttribute("data-swiper-slide-index")})),r.emit("destroy"),Object.keys(r.eventsListeners).forEach(l=>{r.off(l)}),t!==!1&&(r.el.swiper=null,DWt(r)),r.destroyed=!0),null}static extendDefaults(t){Rc(hV,t)}static get extendedDefaults(){return hV}static get defaults(){return ZG}static installModule(t){Zp.prototype.__modules__||(Zp.prototype.__modules__=[]);const n=Zp.prototype.__modules__;typeof t=="function"&&n.indexOf(t)<0&&n.push(t)}static use(t){return Array.isArray(t)?(t.forEach(n=>Zp.installModule(n)),Zp):(Zp.installModule(t),Zp)}};Object.keys(dV).forEach(e=>{Object.keys(dV[e]).forEach(t=>{Hae.prototype[t]=dV[e][t]})});Hae.use([BWt,WWt]);const K9e=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function iO(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"&&!e.__swiper__}function _S(e,t){const n=["__proto__","constructor","prototype"];Object.keys(t).filter(r=>n.indexOf(r)<0).forEach(r=>{typeof e[r]>"u"?e[r]=t[r]:iO(t[r])&&iO(e[r])&&Object.keys(t[r]).length>0?t[r].__swiper__?e[r]=t[r]:_S(e[r],t[r]):e[r]=t[r]})}function J9e(e){return e===void 0&&(e={}),e.navigation&&typeof e.navigation.nextEl>"u"&&typeof e.navigation.prevEl>"u"}function eQe(e){return e===void 0&&(e={}),e.pagination&&typeof e.pagination.el>"u"}function tQe(e){return e===void 0&&(e={}),e.scrollbar&&typeof e.scrollbar.el>"u"}function nQe(e){e===void 0&&(e="");const t=e.split(" ").map(r=>r.trim()).filter(r=>!!r),n=[];return t.forEach(r=>{n.indexOf(r)<0&&n.push(r)}),n.join(" ")}function Xqt(e){return e===void 0&&(e=""),e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function Zqt(e){let{swiper:t,slides:n,passedParams:r,changedParams:i,nextEl:o,prevEl:s,scrollbarEl:a,paginationEl:l}=e;const c=i.filter(P=>P!=="children"&&P!=="direction"&&P!=="wrapperClass"),{params:u,pagination:f,navigation:d,scrollbar:h,virtual:p,thumbs:g}=t;let v,y,O,m,w,S,E,C;i.includes("thumbs")&&r.thumbs&&r.thumbs.swiper&&u.thumbs&&!u.thumbs.swiper&&(v=!0),i.includes("controller")&&r.controller&&r.controller.control&&u.controller&&!u.controller.control&&(y=!0),i.includes("pagination")&&r.pagination&&(r.pagination.el||l)&&(u.pagination||u.pagination===!1)&&f&&!f.el&&(O=!0),i.includes("scrollbar")&&r.scrollbar&&(r.scrollbar.el||a)&&(u.scrollbar||u.scrollbar===!1)&&h&&!h.el&&(m=!0),i.includes("navigation")&&r.navigation&&(r.navigation.prevEl||s)&&(r.navigation.nextEl||o)&&(u.navigation||u.navigation===!1)&&d&&!d.prevEl&&!d.nextEl&&(w=!0);const k=P=>{t[P]&&(t[P].destroy(),P==="navigation"?(t.isElement&&(t[P].prevEl.remove(),t[P].nextEl.remove()),u[P].prevEl=void 0,u[P].nextEl=void 0,t[P].prevEl=void 0,t[P].nextEl=void 0):(t.isElement&&t[P].el.remove(),u[P].el=void 0,t[P].el=void 0))};i.includes("loop")&&t.isElement&&(u.loop&&!r.loop?S=!0:!u.loop&&r.loop?E=!0:C=!0),c.forEach(P=>{if(iO(u[P])&&iO(r[P]))Object.assign(u[P],r[P]),(P==="navigation"||P==="pagination"||P==="scrollbar")&&"enabled"in r[P]&&!r[P].enabled&&k(P);else{const D=r[P];(D===!0||D===!1)&&(P==="navigation"||P==="pagination"||P==="scrollbar")?D===!1&&k(P):u[P]=r[P]}}),c.includes("controller")&&!y&&t.controller&&t.controller.control&&u.controller&&u.controller.control&&(t.controller.control=u.controller.control),i.includes("children")&&n&&p&&u.virtual.enabled?(p.slides=n,p.update(!0)):i.includes("virtual")&&p&&u.virtual.enabled&&(n&&(p.slides=n),p.update(!0)),i.includes("children")&&n&&u.loop&&(C=!0),v&&g.init()&&g.update(!0),y&&(t.controller.control=u.controller.control),O&&(t.isElement&&(!l||typeof l=="string")&&(l=document.createElement("div"),l.classList.add("swiper-pagination"),l.part.add("pagination"),t.el.appendChild(l)),l&&(u.pagination.el=l),f.init(),f.render(),f.update()),m&&(t.isElement&&(!a||typeof a=="string")&&(a=document.createElement("div"),a.classList.add("swiper-scrollbar"),a.part.add("scrollbar"),t.el.appendChild(a)),a&&(u.scrollbar.el=a),h.init(),h.updateSize(),h.setTranslate()),w&&(t.isElement&&((!o||typeof o=="string")&&(o=document.createElement("div"),o.classList.add("swiper-button-next"),o.innerHTML=t.hostEl.constructor.nextButtonSvg,o.part.add("button-next"),t.el.appendChild(o)),(!s||typeof s=="string")&&(s=document.createElement("div"),s.classList.add("swiper-button-prev"),s.innerHTML=t.hostEl.constructor.prevButtonSvg,s.part.add("button-prev"),t.el.appendChild(s))),o&&(u.navigation.nextEl=o),s&&(u.navigation.prevEl=s),d.init(),d.update()),i.includes("allowSlideNext")&&(t.allowSlideNext=r.allowSlideNext),i.includes("allowSlidePrev")&&(t.allowSlidePrev=r.allowSlidePrev),i.includes("direction")&&t.changeDirection(r.direction,!1),(S||C)&&t.loopDestroy(),(E||C)&&t.loopCreate(),t.update()}function Yqt(e,t){e===void 0&&(e={}),t===void 0&&(t=!0);const n={on:{}},r={},i={};_S(n,ZG),n._emitClasses=!0,n.init=!1;const o={},s=K9e.map(l=>l.replace(/_/,"")),a=Object.assign({},e);return Object.keys(a).forEach(l=>{typeof e[l]>"u"||(s.indexOf(l)>=0?iO(e[l])?(n[l]={},i[l]={},_S(n[l],e[l]),_S(i[l],e[l])):(n[l]=e[l],i[l]=e[l]):l.search(/on[A-Z]/)===0&&typeof e[l]=="function"?t?r[`${l[2].toLowerCase()}${l.substr(3)}`]=e[l]:n.on[`${l[2].toLowerCase()}${l.substr(3)}`]=e[l]:o[l]=e[l])}),["navigation","pagination","scrollbar"].forEach(l=>{n[l]===!0&&(n[l]={}),n[l]===!1&&delete n[l]}),{params:n,passedParams:i,rest:o,events:r}}function Gqt(e,t){let{el:n,nextEl:r,prevEl:i,paginationEl:o,scrollbarEl:s,swiper:a}=e;J9e(t)&&r&&i&&(a.params.navigation.nextEl=r,a.originalParams.navigation.nextEl=r,a.params.navigation.prevEl=i,a.originalParams.navigation.prevEl=i),eQe(t)&&o&&(a.params.pagination.el=o,a.originalParams.pagination.el=o),tQe(t)&&s&&(a.params.scrollbar.el=s,a.originalParams.scrollbar.el=s),a.init(n)}function Kqt(e,t,n,r,i){const o=[];if(!t)return o;const s=l=>{o.indexOf(l)<0&&o.push(l)};if(n&&r){const l=r.map(i),c=n.map(i);l.join("")!==c.join("")&&s("children"),r.length!==n.length&&s("children")}return K9e.filter(l=>l[0]==="_").map(l=>l.replace(/_/,"")).forEach(l=>{if(l in e&&l in t)if(iO(e[l])&&iO(t[l])){const c=Object.keys(e[l]),u=Object.keys(t[l]);c.length!==u.length?s(l):(c.forEach(f=>{e[l][f]!==t[l][f]&&s(l)}),u.forEach(f=>{e[l][f]!==t[l][f]&&s(l)}))}else e[l]!==t[l]&&s(l)}),o}const Jqt=e=>{!e||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())};function N3(){return N3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},N3.apply(this,arguments)}function rQe(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function iQe(e){const t=[];return ie.Children.toArray(e).forEach(n=>{rQe(n)?t.push(n):n.props&&n.props.children&&iQe(n.props.children).forEach(r=>t.push(r))}),t}function eVt(e){const t=[],n={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return ie.Children.toArray(e).forEach(r=>{if(rQe(r))t.push(r);else if(r.props&&r.props.slot&&n[r.props.slot])n[r.props.slot].push(r);else if(r.props&&r.props.children){const i=iQe(r.props.children);i.length>0?i.forEach(o=>t.push(o)):n["container-end"].push(r)}else n["container-end"].push(r)}),{slides:t,slots:n}}function tVt(e,t,n){if(!n)return null;const r=u=>{let f=u;return u<0?f=t.length+u:f>=t.length&&(f=f-t.length),f},i=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${n.offset}px`}:{top:`${n.offset}px`},{from:o,to:s}=n,a=e.params.loop?-t.length:0,l=e.params.loop?t.length*2:t.length,c=[];for(let u=a;u<l;u+=1)u>=o&&u<=s&&c.push(t[r(u)]);return c.map((u,f)=>ie.cloneElement(u,{swiper:e,style:i,key:u.props.virtualIndex||u.key||`slide-${f}`}))}function QT(e,t){return typeof window>"u"?x.useEffect(e,t):x.useLayoutEffect(e,t)}const Rxe=x.createContext(null),nVt=x.createContext(null),oQe=x.forwardRef(function(e,t){let{className:n,tag:r="div",wrapperTag:i="div",children:o,onSwiper:s,...a}=e===void 0?{}:e,l=!1;const[c,u]=x.useState("swiper"),[f,d]=x.useState(null),[h,p]=x.useState(!1),g=x.useRef(!1),v=x.useRef(null),y=x.useRef(null),O=x.useRef(null),m=x.useRef(null),w=x.useRef(null),S=x.useRef(null),E=x.useRef(null),C=x.useRef(null),{params:k,passedParams:P,rest:D,events:M}=Yqt(a),{slides:L,slots:A}=eVt(o),T=()=>{p(!h)};Object.assign(k.on,{_containerClasses(F,q){u(q)}});const N=()=>{Object.assign(k.on,M),l=!0;const F={...k};if(delete F.wrapperClass,y.current=new Hae(F),y.current.virtual&&y.current.params.virtual.enabled){y.current.virtual.slides=L;const q={cache:!1,slides:L,renderExternal:d,renderExternalUpdate:!1};_S(y.current.params.virtual,q),_S(y.current.originalParams.virtual,q)}};v.current||N(),y.current&&y.current.on("_beforeBreakpoint",T);const j=()=>{l||!M||!y.current||Object.keys(M).forEach(F=>{y.current.on(F,M[F])})},z=()=>{!M||!y.current||Object.keys(M).forEach(F=>{y.current.off(F,M[F])})};x.useEffect(()=>()=>{y.current&&y.current.off("_beforeBreakpoint",T)}),x.useEffect(()=>{!g.current&&y.current&&(y.current.emitSlidesClasses(),g.current=!0)}),QT(()=>{if(t&&(t.current=v.current),!!v.current)return y.current.destroyed&&N(),Gqt({el:v.current,nextEl:w.current,prevEl:S.current,paginationEl:E.current,scrollbarEl:C.current,swiper:y.current},k),s&&!y.current.destroyed&&s(y.current),()=>{y.current&&!y.current.destroyed&&y.current.destroy(!0,!1)}},[]),QT(()=>{j();const F=Kqt(P,O.current,L,m.current,q=>q.key);return O.current=P,m.current=L,F.length&&y.current&&!y.current.destroyed&&Zqt({swiper:y.current,slides:L,passedParams:P,changedParams:F,nextEl:w.current,prevEl:S.current,scrollbarEl:C.current,paginationEl:E.current}),()=>{z()}}),QT(()=>{Jqt(y.current)},[f]);function W(){return k.virtual?tVt(y.current,L,f):L.map((F,q)=>ie.cloneElement(F,{swiper:y.current,swiperSlideIndex:q}))}return ie.createElement(r,N3({ref:v,className:nQe(`${c}${n?` ${n}`:""}`)},D),ie.createElement(nVt.Provider,{value:y.current},A["container-start"],ie.createElement(i,{className:Xqt(k.wrapperClass)},A["wrapper-start"],W(),A["wrapper-end"]),J9e(k)&&ie.createElement(ie.Fragment,null,ie.createElement("div",{ref:S,className:"swiper-button-prev"}),ie.createElement("div",{ref:w,className:"swiper-button-next"})),tQe(k)&&ie.createElement("div",{ref:C,className:"swiper-scrollbar"}),eQe(k)&&ie.createElement("div",{ref:E,className:"swiper-pagination"}),A["container-end"]))});oQe.displayName="Swiper";const sQe=x.forwardRef(function(e,t){let{tag:n="div",children:r,className:i="",swiper:o,zoom:s,lazy:a,virtualIndex:l,swiperSlideIndex:c,...u}=e===void 0?{}:e;const f=x.useRef(null),[d,h]=x.useState("swiper-slide"),[p,g]=x.useState(!1);function v(w,S,E){S===f.current&&h(E)}QT(()=>{if(typeof c<"u"&&(f.current.swiperSlideIndex=c),t&&(t.current=f.current),!(!f.current||!o)){if(o.destroyed){d!=="swiper-slide"&&h("swiper-slide");return}return o.on("_slideClass",v),()=>{o&&o.off("_slideClass",v)}}}),QT(()=>{o&&f.current&&!o.destroyed&&h(o.getSlideClasses(f.current))},[o]);const y={isActive:d.indexOf("swiper-slide-active")>=0,isVisible:d.indexOf("swiper-slide-visible")>=0,isPrev:d.indexOf("swiper-slide-prev")>=0,isNext:d.indexOf("swiper-slide-next")>=0},O=()=>typeof r=="function"?r(y):r,m=()=>{g(!0)};return ie.createElement(n,N3({ref:f,className:nQe(`${d}${i?` ${i}`:""}`),"data-swiper-slide-index":l,onLoad:m},u),s&&ie.createElement(Rxe.Provider,{value:y},ie.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof s=="number"?s:void 0},O(),a&&!p&&ie.createElement("div",{className:"swiper-lazy-preloader"}))),!s&&ie.createElement(Rxe.Provider,{value:y},O(),a&&!p&&ie.createElement("div",{className:"swiper-lazy-preloader"})))});sQe.displayName="SwiperSlide";function rVt(e){let{swiper:t,extendParams:n,on:r,emit:i}=e;n({virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null,renderExternalUpdate:!0,addSlidesBefore:0,addSlidesAfter:0}});let o;const s=mm();t.virtual={cache:{},from:void 0,to:void 0,slides:[],offset:0,slidesGrid:[]};const a=s.createElement("div");function l(p,g){const v=t.params.virtual;if(v.cache&&t.virtual.cache[g])return t.virtual.cache[g];let y;return v.renderSlide?(y=v.renderSlide.call(t,p,g),typeof y=="string"&&(a.innerHTML=y,y=a.children[0])):t.isElement?y=$E("swiper-slide"):y=$E("div",t.params.slideClass),y.setAttribute("data-swiper-slide-index",g),v.renderSlide||(y.innerHTML=p),v.cache&&(t.virtual.cache[g]=y),y}function c(p){const{slidesPerView:g,slidesPerGroup:v,centeredSlides:y,loop:O}=t.params,{addSlidesBefore:m,addSlidesAfter:w}=t.params.virtual,{from:S,to:E,slides:C,slidesGrid:k,offset:P}=t.virtual;t.params.cssMode||t.updateActiveIndex();const D=t.activeIndex||0;let M;t.rtlTranslate?M="right":M=t.isHorizontal()?"left":"top";let L,A;y?(L=Math.floor(g/2)+v+w,A=Math.floor(g/2)+v+m):(L=g+(v-1)+w,A=(O?g:v)+m);let T=D-A,N=D+L;O||(T=Math.max(T,0),N=Math.min(N,C.length-1));let j=(t.slidesGrid[T]||0)-(t.slidesGrid[0]||0);O&&D>=A?(T-=A,y||(j+=t.slidesGrid[0])):O&&D<A&&(T=-A,y&&(j+=t.slidesGrid[0])),Object.assign(t.virtual,{from:T,to:N,offset:j,slidesGrid:t.slidesGrid,slidesBefore:A,slidesAfter:L});function z(){t.updateSlides(),t.updateProgress(),t.updateSlidesClasses(),i("virtualUpdate")}if(S===T&&E===N&&!p){t.slidesGrid!==k&&j!==P&&t.slides.forEach(H=>{H.style[M]=`${j-Math.abs(t.cssOverflowAdjustment())}px`}),t.updateProgress(),i("virtualUpdate");return}if(t.params.virtual.renderExternal){t.params.virtual.renderExternal.call(t,{offset:j,from:T,to:N,slides:function(){const Z=[];for(let ee=T;ee<=N;ee+=1)Z.push(C[ee]);return Z}()}),t.params.virtual.renderExternalUpdate?z():i("virtualUpdate");return}const W=[],F=[],q=H=>{let Z=H;return H<0?Z=C.length+H:Z>=C.length&&(Z=Z-C.length),Z};if(p)t.slides.filter(H=>H.matches(`.${t.params.slideClass}, swiper-slide`)).forEach(H=>{H.remove()});else for(let H=S;H<=E;H+=1)if(H<T||H>N){const Z=q(H);t.slides.filter(ee=>ee.matches(`.${t.params.slideClass}[data-swiper-slide-index="${Z}"], swiper-slide[data-swiper-slide-index="${Z}"]`)).forEach(ee=>{ee.remove()})}const U=O?-C.length:0,V=O?C.length*2:C.length;for(let H=U;H<V;H+=1)if(H>=T&&H<=N){const Z=q(H);typeof E>"u"||p?F.push(Z):(H>E&&F.push(Z),H<S&&W.push(Z))}if(F.forEach(H=>{t.slidesEl.append(l(C[H],H))}),O)for(let H=W.length-1;H>=0;H-=1){const Z=W[H];t.slidesEl.prepend(l(C[Z],Z))}else W.sort((H,Z)=>Z-H),W.forEach(H=>{t.slidesEl.prepend(l(C[H],H))});Bc(t.slidesEl,".swiper-slide, swiper-slide").forEach(H=>{H.style[M]=`${j-Math.abs(t.cssOverflowAdjustment())}px`}),z()}function u(p){if(typeof p=="object"&&"length"in p)for(let g=0;g<p.length;g+=1)p[g]&&t.virtual.slides.push(p[g]);else t.virtual.slides.push(p);c(!0)}function f(p){const g=t.activeIndex;let v=g+1,y=1;if(Array.isArray(p)){for(let O=0;O<p.length;O+=1)p[O]&&t.virtual.slides.unshift(p[O]);v=g+p.length,y=p.length}else t.virtual.slides.unshift(p);if(t.params.virtual.cache){const O=t.virtual.cache,m={};Object.keys(O).forEach(w=>{const S=O[w],E=S.getAttribute("data-swiper-slide-index");E&&S.setAttribute("data-swiper-slide-index",parseInt(E,10)+y),m[parseInt(w,10)+y]=S}),t.virtual.cache=m}c(!0),t.slideTo(v,0)}function d(p){if(typeof p>"u"||p===null)return;let g=t.activeIndex;if(Array.isArray(p))for(let v=p.length-1;v>=0;v-=1)t.params.virtual.cache&&(delete t.virtual.cache[p[v]],Object.keys(t.virtual.cache).forEach(y=>{y>p&&(t.virtual.cache[y-1]=t.virtual.cache[y],t.virtual.cache[y-1].setAttribute("data-swiper-slide-index",y-1),delete t.virtual.cache[y])})),t.virtual.slides.splice(p[v],1),p[v]<g&&(g-=1),g=Math.max(g,0);else t.params.virtual.cache&&(delete t.virtual.cache[p],Object.keys(t.virtual.cache).forEach(v=>{v>p&&(t.virtual.cache[v-1]=t.virtual.cache[v],t.virtual.cache[v-1].setAttribute("data-swiper-slide-index",v-1),delete t.virtual.cache[v])})),t.virtual.slides.splice(p,1),p<g&&(g-=1),g=Math.max(g,0);c(!0),t.slideTo(g,0)}function h(){t.virtual.slides=[],t.params.virtual.cache&&(t.virtual.cache={}),c(!0),t.slideTo(0,0)}r("beforeInit",()=>{if(!t.params.virtual.enabled)return;let p;if(typeof t.passedParams.virtual.slides>"u"){const g=[...t.slidesEl.children].filter(v=>v.matches(`.${t.params.slideClass}, swiper-slide`));g&&g.length&&(t.virtual.slides=[...g],p=!0,g.forEach((v,y)=>{v.setAttribute("data-swiper-slide-index",y),t.virtual.cache[y]=v,v.remove()}))}p||(t.virtual.slides=t.params.virtual.slides),t.classNames.push(`${t.params.containerModifierClass}virtual`),t.params.watchSlidesProgress=!0,t.originalParams.watchSlidesProgress=!0,c()}),r("setTranslate",()=>{t.params.virtual.enabled&&(t.params.cssMode&&!t._immediateVirtual?(clearTimeout(o),o=setTimeout(()=>{c()},100)):c())}),r("init update resize",()=>{t.params.virtual.enabled&&t.params.cssMode&&M$(t.wrapperEl,"--swiper-virtual-size",`${t.virtualSize}px`)}),Object.assign(t.virtual,{appendSlide:u,prependSlide:f,removeSlide:d,removeAllSlides:h,update:c})}function iVt(e){let{swiper:t,extendParams:n,on:r,emit:i}=e;const o=mm(),s=Va();t.keyboard={enabled:!1},n({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}});function a(u){if(!t.enabled)return;const{rtlTranslate:f}=t;let d=u;d.originalEvent&&(d=d.originalEvent);const h=d.keyCode||d.charCode,p=t.params.keyboard.pageUpDown,g=p&&h===33,v=p&&h===34,y=h===37,O=h===39,m=h===38,w=h===40;if(!t.allowSlideNext&&(t.isHorizontal()&&O||t.isVertical()&&w||v)||!t.allowSlidePrev&&(t.isHorizontal()&&y||t.isVertical()&&m||g))return!1;if(!(d.shiftKey||d.altKey||d.ctrlKey||d.metaKey)&&!(o.activeElement&&o.activeElement.nodeName&&(o.activeElement.nodeName.toLowerCase()==="input"||o.activeElement.nodeName.toLowerCase()==="textarea"))){if(t.params.keyboard.onlyInViewport&&(g||v||y||O||m||w)){let S=!1;if(sb(t.el,`.${t.params.slideClass}, swiper-slide`).length>0&&sb(t.el,`.${t.params.slideActiveClass}`).length===0)return;const E=t.el,C=E.clientWidth,k=E.clientHeight,P=s.innerWidth,D=s.innerHeight,M=UG(E);f&&(M.left-=E.scrollLeft);const L=[[M.left,M.top],[M.left+C,M.top],[M.left,M.top+k],[M.left+C,M.top+k]];for(let A=0;A<L.length;A+=1){const T=L[A];if(T[0]>=0&&T[0]<=P&&T[1]>=0&&T[1]<=D){if(T[0]===0&&T[1]===0)continue;S=!0}}if(!S)return}t.isHorizontal()?((g||v||y||O)&&(d.preventDefault?d.preventDefault():d.returnValue=!1),((v||O)&&!f||(g||y)&&f)&&t.slideNext(),((g||y)&&!f||(v||O)&&f)&&t.slidePrev()):((g||v||m||w)&&(d.preventDefault?d.preventDefault():d.returnValue=!1),(v||w)&&t.slideNext(),(g||m)&&t.slidePrev()),i("keyPress",h)}}function l(){t.keyboard.enabled||(o.addEventListener("keydown",a),t.keyboard.enabled=!0)}function c(){t.keyboard.enabled&&(o.removeEventListener("keydown",a),t.keyboard.enabled=!1)}r("init",()=>{t.params.keyboard.enabled&&l()}),r("destroy",()=>{t.keyboard.enabled&&c()}),Object.assign(t.keyboard,{enable:l,disable:c})}function aQe(e,t,n,r){return e.params.createElements&&Object.keys(r).forEach(i=>{if(!n[i]&&n.auto===!0){let o=Bc(e.el,`.${r[i]}`)[0];o||(o=$E("div",r[i]),o.className=r[i],e.el.append(o)),n[i]=o,t[i]=o}}),n}function oVt(e){let{swiper:t,extendParams:n,on:r,emit:i}=e;n({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),t.navigation={nextEl:null,prevEl:null};function o(p){let g;return p&&typeof p=="string"&&t.isElement&&(g=t.el.querySelector(p),g)?g:(p&&(typeof p=="string"&&(g=[...document.querySelectorAll(p)]),t.params.uniqueNavElements&&typeof p=="string"&&g.length>1&&t.el.querySelectorAll(p).length===1&&(g=t.el.querySelector(p))),p&&!g?p:g)}function s(p,g){const v=t.params.navigation;p=rs(p),p.forEach(y=>{y&&(y.classList[g?"add":"remove"](...v.disabledClass.split(" ")),y.tagName==="BUTTON"&&(y.disabled=g),t.params.watchOverflow&&t.enabled&&y.classList[t.isLocked?"add":"remove"](v.lockClass))})}function a(){const{nextEl:p,prevEl:g}=t.navigation;if(t.params.loop){s(g,!1),s(p,!1);return}s(g,t.isBeginning&&!t.params.rewind),s(p,t.isEnd&&!t.params.rewind)}function l(p){p.preventDefault(),!(t.isBeginning&&!t.params.loop&&!t.params.rewind)&&(t.slidePrev(),i("navigationPrev"))}function c(p){p.preventDefault(),!(t.isEnd&&!t.params.loop&&!t.params.rewind)&&(t.slideNext(),i("navigationNext"))}function u(){const p=t.params.navigation;if(t.params.navigation=aQe(t,t.originalParams.navigation,t.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!(p.nextEl||p.prevEl))return;let g=o(p.nextEl),v=o(p.prevEl);Object.assign(t.navigation,{nextEl:g,prevEl:v}),g=rs(g),v=rs(v);const y=(O,m)=>{O&&O.addEventListener("click",m==="next"?c:l),!t.enabled&&O&&O.classList.add(...p.lockClass.split(" "))};g.forEach(O=>y(O,"next")),v.forEach(O=>y(O,"prev"))}function f(){let{nextEl:p,prevEl:g}=t.navigation;p=rs(p),g=rs(g);const v=(y,O)=>{y.removeEventListener("click",O==="next"?c:l),y.classList.remove(...t.params.navigation.disabledClass.split(" "))};p.forEach(y=>v(y,"next")),g.forEach(y=>v(y,"prev"))}r("init",()=>{t.params.navigation.enabled===!1?h():(u(),a())}),r("toEdge fromEdge lock unlock",()=>{a()}),r("destroy",()=>{f()}),r("enable disable",()=>{let{nextEl:p,prevEl:g}=t.navigation;if(p=rs(p),g=rs(g),t.enabled){a();return}[...p,...g].filter(v=>!!v).forEach(v=>v.classList.add(t.params.navigation.lockClass))}),r("click",(p,g)=>{let{nextEl:v,prevEl:y}=t.navigation;v=rs(v),y=rs(y);const O=g.target;if(t.params.navigation.hideOnClick&&!y.includes(O)&&!v.includes(O)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===O||t.pagination.el.contains(O)))return;let m;v.length?m=v[0].classList.contains(t.params.navigation.hiddenClass):y.length&&(m=y[0].classList.contains(t.params.navigation.hiddenClass)),i(m===!0?"navigationShow":"navigationHide"),[...v,...y].filter(w=>!!w).forEach(w=>w.classList.toggle(t.params.navigation.hiddenClass))}});const d=()=>{t.el.classList.remove(...t.params.navigation.navigationDisabledClass.split(" ")),u(),a()},h=()=>{t.el.classList.add(...t.params.navigation.navigationDisabledClass.split(" ")),f()};Object.assign(t.navigation,{enable:d,disable:h,update:a,init:u,destroy:f})}function $k(e){return e===void 0&&(e=""),`.${e.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function sVt(e){let{swiper:t,extendParams:n,on:r,emit:i}=e;const o="swiper-pagination";n({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:y=>y,formatFractionTotal:y=>y,bulletClass:`${o}-bullet`,bulletActiveClass:`${o}-bullet-active`,modifierClass:`${o}-`,currentClass:`${o}-current`,totalClass:`${o}-total`,hiddenClass:`${o}-hidden`,progressbarFillClass:`${o}-progressbar-fill`,progressbarOppositeClass:`${o}-progressbar-opposite`,clickableClass:`${o}-clickable`,lockClass:`${o}-lock`,horizontalClass:`${o}-horizontal`,verticalClass:`${o}-vertical`,paginationDisabledClass:`${o}-disabled`}}),t.pagination={el:null,bullets:[]};let s,a=0;function l(){return!t.params.pagination.el||!t.pagination.el||Array.isArray(t.pagination.el)&&t.pagination.el.length===0}function c(y,O){const{bulletActiveClass:m}=t.params.pagination;y&&(y=y[`${O==="prev"?"previous":"next"}ElementSibling`],y&&(y.classList.add(`${m}-${O}`),y=y[`${O==="prev"?"previous":"next"}ElementSibling`],y&&y.classList.add(`${m}-${O}-${O}`)))}function u(y){const O=y.target.closest($k(t.params.pagination.bulletClass));if(!O)return;y.preventDefault();const m=M3(O)*t.params.slidesPerGroup;if(t.params.loop){if(t.realIndex===m)return;t.slideToLoop(m)}else t.slideTo(m)}function f(){const y=t.rtl,O=t.params.pagination;if(l())return;let m=t.pagination.el;m=rs(m);let w,S;const E=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length,C=t.params.loop?Math.ceil(E/t.params.slidesPerGroup):t.snapGrid.length;if(t.params.loop?(S=t.previousRealIndex||0,w=t.params.slidesPerGroup>1?Math.floor(t.realIndex/t.params.slidesPerGroup):t.realIndex):typeof t.snapIndex<"u"?(w=t.snapIndex,S=t.previousSnapIndex):(S=t.previousIndex||0,w=t.activeIndex||0),O.type==="bullets"&&t.pagination.bullets&&t.pagination.bullets.length>0){const k=t.pagination.bullets;let P,D,M;if(O.dynamicBullets&&(s=HG(k[0],t.isHorizontal()?"width":"height",!0),m.forEach(L=>{L.style[t.isHorizontal()?"width":"height"]=`${s*(O.dynamicMainBullets+4)}px`}),O.dynamicMainBullets>1&&S!==void 0&&(a+=w-(S||0),a>O.dynamicMainBullets-1?a=O.dynamicMainBullets-1:a<0&&(a=0)),P=Math.max(w-a,0),D=P+(Math.min(k.length,O.dynamicMainBullets)-1),M=(D+P)/2),k.forEach(L=>{const A=[...["","-next","-next-next","-prev","-prev-prev","-main"].map(T=>`${O.bulletActiveClass}${T}`)].map(T=>typeof T=="string"&&T.includes(" ")?T.split(" "):T).flat();L.classList.remove(...A)}),m.length>1)k.forEach(L=>{const A=M3(L);A===w?L.classList.add(...O.bulletActiveClass.split(" ")):t.isElement&&L.setAttribute("part","bullet"),O.dynamicBullets&&(A>=P&&A<=D&&L.classList.add(...`${O.bulletActiveClass}-main`.split(" ")),A===P&&c(L,"prev"),A===D&&c(L,"next"))});else{const L=k[w];if(L&&L.classList.add(...O.bulletActiveClass.split(" ")),t.isElement&&k.forEach((A,T)=>{A.setAttribute("part",T===w?"bullet-active":"bullet")}),O.dynamicBullets){const A=k[P],T=k[D];for(let N=P;N<=D;N+=1)k[N]&&k[N].classList.add(...`${O.bulletActiveClass}-main`.split(" "));c(A,"prev"),c(T,"next")}}if(O.dynamicBullets){const L=Math.min(k.length,O.dynamicMainBullets+4),A=(s*L-s)/2-M*s,T=y?"right":"left";k.forEach(N=>{N.style[t.isHorizontal()?T:"top"]=`${A}px`})}}m.forEach((k,P)=>{if(O.type==="fraction"&&(k.querySelectorAll($k(O.currentClass)).forEach(D=>{D.textContent=O.formatFractionCurrent(w+1)}),k.querySelectorAll($k(O.totalClass)).forEach(D=>{D.textContent=O.formatFractionTotal(C)})),O.type==="progressbar"){let D;O.progressbarOpposite?D=t.isHorizontal()?"vertical":"horizontal":D=t.isHorizontal()?"horizontal":"vertical";const M=(w+1)/C;let L=1,A=1;D==="horizontal"?L=M:A=M,k.querySelectorAll($k(O.progressbarFillClass)).forEach(T=>{T.style.transform=`translate3d(0,0,0) scaleX(${L}) scaleY(${A})`,T.style.transitionDuration=`${t.params.speed}ms`})}O.type==="custom"&&O.renderCustom?(k.innerHTML=O.renderCustom(t,w+1,C),P===0&&i("paginationRender",k)):(P===0&&i("paginationRender",k),i("paginationUpdate",k)),t.params.watchOverflow&&t.enabled&&k.classList[t.isLocked?"add":"remove"](O.lockClass)})}function d(){const y=t.params.pagination;if(l())return;const O=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.grid&&t.params.grid.rows>1?t.slides.length/Math.ceil(t.params.grid.rows):t.slides.length;let m=t.pagination.el;m=rs(m);let w="";if(y.type==="bullets"){let S=t.params.loop?Math.ceil(O/t.params.slidesPerGroup):t.snapGrid.length;t.params.freeMode&&t.params.freeMode.enabled&&S>O&&(S=O);for(let E=0;E<S;E+=1)y.renderBullet?w+=y.renderBullet.call(t,E,y.bulletClass):w+=`<${y.bulletElement} ${t.isElement?'part="bullet"':""} class="${y.bulletClass}"></${y.bulletElement}>`}y.type==="fraction"&&(y.renderFraction?w=y.renderFraction.call(t,y.currentClass,y.totalClass):w=`<span class="${y.currentClass}"></span> / <span class="${y.totalClass}"></span>`),y.type==="progressbar"&&(y.renderProgressbar?w=y.renderProgressbar.call(t,y.progressbarFillClass):w=`<span class="${y.progressbarFillClass}"></span>`),t.pagination.bullets=[],m.forEach(S=>{y.type!=="custom"&&(S.innerHTML=w||""),y.type==="bullets"&&t.pagination.bullets.push(...S.querySelectorAll($k(y.bulletClass)))}),y.type!=="custom"&&i("paginationRender",m[0])}function h(){t.params.pagination=aQe(t,t.originalParams.pagination,t.params.pagination,{el:"swiper-pagination"});const y=t.params.pagination;if(!y.el)return;let O;typeof y.el=="string"&&t.isElement&&(O=t.el.querySelector(y.el)),!O&&typeof y.el=="string"&&(O=[...document.querySelectorAll(y.el)]),O||(O=y.el),!(!O||O.length===0)&&(t.params.uniqueNavElements&&typeof y.el=="string"&&Array.isArray(O)&&O.length>1&&(O=[...t.el.querySelectorAll(y.el)],O.length>1&&(O=O.filter(m=>sb(m,".swiper")[0]===t.el)[0])),Array.isArray(O)&&O.length===1&&(O=O[0]),Object.assign(t.pagination,{el:O}),O=rs(O),O.forEach(m=>{y.type==="bullets"&&y.clickable&&m.classList.add(...(y.clickableClass||"").split(" ")),m.classList.add(y.modifierClass+y.type),m.classList.add(t.isHorizontal()?y.horizontalClass:y.verticalClass),y.type==="bullets"&&y.dynamicBullets&&(m.classList.add(`${y.modifierClass}${y.type}-dynamic`),a=0,y.dynamicMainBullets<1&&(y.dynamicMainBullets=1)),y.type==="progressbar"&&y.progressbarOpposite&&m.classList.add(y.progressbarOppositeClass),y.clickable&&m.addEventListener("click",u),t.enabled||m.classList.add(y.lockClass)}))}function p(){const y=t.params.pagination;if(l())return;let O=t.pagination.el;O&&(O=rs(O),O.forEach(m=>{m.classList.remove(y.hiddenClass),m.classList.remove(y.modifierClass+y.type),m.classList.remove(t.isHorizontal()?y.horizontalClass:y.verticalClass),y.clickable&&(m.classList.remove(...(y.clickableClass||"").split(" ")),m.removeEventListener("click",u))})),t.pagination.bullets&&t.pagination.bullets.forEach(m=>m.classList.remove(...y.bulletActiveClass.split(" ")))}r("changeDirection",()=>{if(!t.pagination||!t.pagination.el)return;const y=t.params.pagination;let{el:O}=t.pagination;O=rs(O),O.forEach(m=>{m.classList.remove(y.horizontalClass,y.verticalClass),m.classList.add(t.isHorizontal()?y.horizontalClass:y.verticalClass)})}),r("init",()=>{t.params.pagination.enabled===!1?v():(h(),d(),f())}),r("activeIndexChange",()=>{typeof t.snapIndex>"u"&&f()}),r("snapIndexChange",()=>{f()}),r("snapGridLengthChange",()=>{d(),f()}),r("destroy",()=>{p()}),r("enable disable",()=>{let{el:y}=t.pagination;y&&(y=rs(y),y.forEach(O=>O.classList[t.enabled?"remove":"add"](t.params.pagination.lockClass)))}),r("lock unlock",()=>{f()}),r("click",(y,O)=>{const m=O.target,w=rs(t.pagination.el);if(t.params.pagination.el&&t.params.pagination.hideOnClick&&w&&w.length>0&&!m.classList.contains(t.params.pagination.bulletClass)){if(t.navigation&&(t.navigation.nextEl&&m===t.navigation.nextEl||t.navigation.prevEl&&m===t.navigation.prevEl))return;const S=w[0].classList.contains(t.params.pagination.hiddenClass);i(S===!0?"paginationShow":"paginationHide"),w.forEach(E=>E.classList.toggle(t.params.pagination.hiddenClass))}});const g=()=>{t.el.classList.remove(t.params.pagination.paginationDisabledClass);let{el:y}=t.pagination;y&&(y=rs(y),y.forEach(O=>O.classList.remove(t.params.pagination.paginationDisabledClass))),h(),d(),f()},v=()=>{t.el.classList.add(t.params.pagination.paginationDisabledClass);let{el:y}=t.pagination;y&&(y=rs(y),y.forEach(O=>O.classList.add(t.params.pagination.paginationDisabledClass))),p()};Object.assign(t.pagination,{enable:g,disable:v,render:d,update:f,init:h,destroy:p})}function aVt(e){let{swiper:t,extendParams:n,on:r,emit:i}=e;const o=Va();n({zoom:{enabled:!1,limitToOriginalSize:!1,maxRatio:3,minRatio:1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}}),t.zoom={enabled:!1};let s=1,a=!1,l,c;const u=[],f={originX:0,originY:0,slideEl:void 0,slideWidth:void 0,slideHeight:void 0,imageEl:void 0,imageWrapEl:void 0,maxRatio:3},d={isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},h={x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0};let p=1;Object.defineProperty(t.zoom,"scale",{get(){return p},set(W){if(p!==W){const F=f.imageEl,q=f.slideEl;i("zoomChange",W,F,q)}p=W}});function g(){if(u.length<2)return 1;const W=u[0].pageX,F=u[0].pageY,q=u[1].pageX,U=u[1].pageY;return Math.sqrt((q-W)**2+(U-F)**2)}function v(){const W=t.params.zoom,F=f.imageWrapEl.getAttribute("data-swiper-zoom")||W.maxRatio;if(W.limitToOriginalSize&&f.imageEl&&f.imageEl.naturalWidth){const q=f.imageEl.naturalWidth/f.imageEl.offsetWidth;return Math.min(q,F)}return F}function y(){if(u.length<2)return{x:null,y:null};const W=f.imageEl.getBoundingClientRect();return[(u[0].pageX+(u[1].pageX-u[0].pageX)/2-W.x-o.scrollX)/s,(u[0].pageY+(u[1].pageY-u[0].pageY)/2-W.y-o.scrollY)/s]}function O(){return t.isElement?"swiper-slide":`.${t.params.slideClass}`}function m(W){const F=O();return!!(W.target.matches(F)||t.slides.filter(q=>q.contains(W.target)).length>0)}function w(W){const F=`.${t.params.zoom.containerClass}`;return!!(W.target.matches(F)||[...t.hostEl.querySelectorAll(F)].filter(q=>q.contains(W.target)).length>0)}function S(W){if(W.pointerType==="mouse"&&u.splice(0,u.length),!m(W))return;const F=t.params.zoom;if(l=!1,c=!1,u.push(W),!(u.length<2)){if(l=!0,f.scaleStart=g(),!f.slideEl){f.slideEl=W.target.closest(`.${t.params.slideClass}, swiper-slide`),f.slideEl||(f.slideEl=t.slides[t.activeIndex]);let q=f.slideEl.querySelector(`.${F.containerClass}`);if(q&&(q=q.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),f.imageEl=q,q?f.imageWrapEl=sb(f.imageEl,`.${F.containerClass}`)[0]:f.imageWrapEl=void 0,!f.imageWrapEl){f.imageEl=void 0;return}f.maxRatio=v()}if(f.imageEl){const[q,U]=y();f.originX=q,f.originY=U,f.imageEl.style.transitionDuration="0ms"}a=!0}}function E(W){if(!m(W))return;const F=t.params.zoom,q=t.zoom,U=u.findIndex(V=>V.pointerId===W.pointerId);U>=0&&(u[U]=W),!(u.length<2)&&(c=!0,f.scaleMove=g(),f.imageEl&&(q.scale=f.scaleMove/f.scaleStart*s,q.scale>f.maxRatio&&(q.scale=f.maxRatio-1+(q.scale-f.maxRatio+1)**.5),q.scale<F.minRatio&&(q.scale=F.minRatio+1-(F.minRatio-q.scale+1)**.5),f.imageEl.style.transform=`translate3d(0,0,0) scale(${q.scale})`))}function C(W){if(!m(W)||W.pointerType==="mouse"&&W.type==="pointerout")return;const F=t.params.zoom,q=t.zoom,U=u.findIndex(V=>V.pointerId===W.pointerId);U>=0&&u.splice(U,1),!(!l||!c)&&(l=!1,c=!1,f.imageEl&&(q.scale=Math.max(Math.min(q.scale,f.maxRatio),F.minRatio),f.imageEl.style.transitionDuration=`${t.params.speed}ms`,f.imageEl.style.transform=`translate3d(0,0,0) scale(${q.scale})`,s=q.scale,a=!1,q.scale>1&&f.slideEl?f.slideEl.classList.add(`${F.zoomedSlideClass}`):q.scale<=1&&f.slideEl&&f.slideEl.classList.remove(`${F.zoomedSlideClass}`),q.scale===1&&(f.originX=0,f.originY=0,f.slideEl=void 0)))}function k(W){const F=t.device;if(!f.imageEl||d.isTouched)return;F.android&&W.cancelable&&W.preventDefault(),d.isTouched=!0;const q=u.length>0?u[0]:W;d.touchesStart.x=q.pageX,d.touchesStart.y=q.pageY}function P(W){if(!m(W)||!w(W))return;const F=t.zoom;if(!f.imageEl||!d.isTouched||!f.slideEl)return;d.isMoved||(d.width=f.imageEl.offsetWidth,d.height=f.imageEl.offsetHeight,d.startX=VG(f.imageWrapEl,"x")||0,d.startY=VG(f.imageWrapEl,"y")||0,f.slideWidth=f.slideEl.offsetWidth,f.slideHeight=f.slideEl.offsetHeight,f.imageWrapEl.style.transitionDuration="0ms");const q=d.width*F.scale,U=d.height*F.scale;if(q<f.slideWidth&&U<f.slideHeight)return;if(d.minX=Math.min(f.slideWidth/2-q/2,0),d.maxX=-d.minX,d.minY=Math.min(f.slideHeight/2-U/2,0),d.maxY=-d.minY,d.touchesCurrent.x=u.length>0?u[0].pageX:W.pageX,d.touchesCurrent.y=u.length>0?u[0].pageY:W.pageY,Math.max(Math.abs(d.touchesCurrent.x-d.touchesStart.x),Math.abs(d.touchesCurrent.y-d.touchesStart.y))>5&&(t.allowClick=!1),!d.isMoved&&!a){if(t.isHorizontal()&&(Math.floor(d.minX)===Math.floor(d.startX)&&d.touchesCurrent.x<d.touchesStart.x||Math.floor(d.maxX)===Math.floor(d.startX)&&d.touchesCurrent.x>d.touchesStart.x)){d.isTouched=!1;return}if(!t.isHorizontal()&&(Math.floor(d.minY)===Math.floor(d.startY)&&d.touchesCurrent.y<d.touchesStart.y||Math.floor(d.maxY)===Math.floor(d.startY)&&d.touchesCurrent.y>d.touchesStart.y)){d.isTouched=!1;return}}W.cancelable&&W.preventDefault(),W.stopPropagation(),d.isMoved=!0;const H=(F.scale-s)/(f.maxRatio-t.params.zoom.minRatio),{originX:Z,originY:ee}=f;d.currentX=d.touchesCurrent.x-d.touchesStart.x+d.startX+H*(d.width-Z*2),d.currentY=d.touchesCurrent.y-d.touchesStart.y+d.startY+H*(d.height-ee*2),d.currentX<d.minX&&(d.currentX=d.minX+1-(d.minX-d.currentX+1)**.8),d.currentX>d.maxX&&(d.currentX=d.maxX-1+(d.currentX-d.maxX+1)**.8),d.currentY<d.minY&&(d.currentY=d.minY+1-(d.minY-d.currentY+1)**.8),d.currentY>d.maxY&&(d.currentY=d.maxY-1+(d.currentY-d.maxY+1)**.8),h.prevPositionX||(h.prevPositionX=d.touchesCurrent.x),h.prevPositionY||(h.prevPositionY=d.touchesCurrent.y),h.prevTime||(h.prevTime=Date.now()),h.x=(d.touchesCurrent.x-h.prevPositionX)/(Date.now()-h.prevTime)/2,h.y=(d.touchesCurrent.y-h.prevPositionY)/(Date.now()-h.prevTime)/2,Math.abs(d.touchesCurrent.x-h.prevPositionX)<2&&(h.x=0),Math.abs(d.touchesCurrent.y-h.prevPositionY)<2&&(h.y=0),h.prevPositionX=d.touchesCurrent.x,h.prevPositionY=d.touchesCurrent.y,h.prevTime=Date.now(),f.imageWrapEl.style.transform=`translate3d(${d.currentX}px, ${d.currentY}px,0)`}function D(){const W=t.zoom;if(!f.imageEl)return;if(!d.isTouched||!d.isMoved){d.isTouched=!1,d.isMoved=!1;return}d.isTouched=!1,d.isMoved=!1;let F=300,q=300;const U=h.x*F,V=d.currentX+U,H=h.y*q,Z=d.currentY+H;h.x!==0&&(F=Math.abs((V-d.currentX)/h.x)),h.y!==0&&(q=Math.abs((Z-d.currentY)/h.y));const ee=Math.max(F,q);d.currentX=V,d.currentY=Z;const se=d.width*W.scale,fe=d.height*W.scale;d.minX=Math.min(f.slideWidth/2-se/2,0),d.maxX=-d.minX,d.minY=Math.min(f.slideHeight/2-fe/2,0),d.maxY=-d.minY,d.currentX=Math.max(Math.min(d.currentX,d.maxX),d.minX),d.currentY=Math.max(Math.min(d.currentY,d.maxY),d.minY),f.imageWrapEl.style.transitionDuration=`${ee}ms`,f.imageWrapEl.style.transform=`translate3d(${d.currentX}px, ${d.currentY}px,0)`}function M(){const W=t.zoom;f.slideEl&&t.activeIndex!==t.slides.indexOf(f.slideEl)&&(f.imageEl&&(f.imageEl.style.transform="translate3d(0,0,0) scale(1)"),f.imageWrapEl&&(f.imageWrapEl.style.transform="translate3d(0,0,0)"),f.slideEl.classList.remove(`${t.params.zoom.zoomedSlideClass}`),W.scale=1,s=1,f.slideEl=void 0,f.imageEl=void 0,f.imageWrapEl=void 0,f.originX=0,f.originY=0)}function L(W){const F=t.zoom,q=t.params.zoom;if(!f.slideEl){W&&W.target&&(f.slideEl=W.target.closest(`.${t.params.slideClass}, swiper-slide`)),f.slideEl||(t.params.virtual&&t.params.virtual.enabled&&t.virtual?f.slideEl=Bc(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:f.slideEl=t.slides[t.activeIndex]);let Oe=f.slideEl.querySelector(`.${q.containerClass}`);Oe&&(Oe=Oe.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),f.imageEl=Oe,Oe?f.imageWrapEl=sb(f.imageEl,`.${q.containerClass}`)[0]:f.imageWrapEl=void 0}if(!f.imageEl||!f.imageWrapEl)return;t.params.cssMode&&(t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.touchAction="none"),f.slideEl.classList.add(`${q.zoomedSlideClass}`);let U,V,H,Z,ee,se,fe,ce,ae,de,me,te,Ee,we,ke,je,nt,Re;typeof d.touchesStart.x>"u"&&W?(U=W.pageX,V=W.pageY):(U=d.touchesStart.x,V=d.touchesStart.y);const G=typeof W=="number"?W:null;s===1&&G&&(U=void 0,V=void 0);const le=v();F.scale=G||le,s=G||le,W&&!(s===1&&G)?(nt=f.slideEl.offsetWidth,Re=f.slideEl.offsetHeight,H=UG(f.slideEl).left+o.scrollX,Z=UG(f.slideEl).top+o.scrollY,ee=H+nt/2-U,se=Z+Re/2-V,ae=f.imageEl.offsetWidth,de=f.imageEl.offsetHeight,me=ae*F.scale,te=de*F.scale,Ee=Math.min(nt/2-me/2,0),we=Math.min(Re/2-te/2,0),ke=-Ee,je=-we,fe=ee*F.scale,ce=se*F.scale,fe<Ee&&(fe=Ee),fe>ke&&(fe=ke),ce<we&&(ce=we),ce>je&&(ce=je)):(fe=0,ce=0),G&&F.scale===1&&(f.originX=0,f.originY=0),f.imageWrapEl.style.transitionDuration="300ms",f.imageWrapEl.style.transform=`translate3d(${fe}px, ${ce}px,0)`,f.imageEl.style.transitionDuration="300ms",f.imageEl.style.transform=`translate3d(0,0,0) scale(${F.scale})`}function A(){const W=t.zoom,F=t.params.zoom;if(!f.slideEl){t.params.virtual&&t.params.virtual.enabled&&t.virtual?f.slideEl=Bc(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:f.slideEl=t.slides[t.activeIndex];let q=f.slideEl.querySelector(`.${F.containerClass}`);q&&(q=q.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),f.imageEl=q,q?f.imageWrapEl=sb(f.imageEl,`.${F.containerClass}`)[0]:f.imageWrapEl=void 0}!f.imageEl||!f.imageWrapEl||(t.params.cssMode&&(t.wrapperEl.style.overflow="",t.wrapperEl.style.touchAction=""),W.scale=1,s=1,f.imageWrapEl.style.transitionDuration="300ms",f.imageWrapEl.style.transform="translate3d(0,0,0)",f.imageEl.style.transitionDuration="300ms",f.imageEl.style.transform="translate3d(0,0,0) scale(1)",f.slideEl.classList.remove(`${F.zoomedSlideClass}`),f.slideEl=void 0,f.originX=0,f.originY=0)}function T(W){const F=t.zoom;F.scale&&F.scale!==1?A():L(W)}function N(){const W=t.params.passiveListeners?{passive:!0,capture:!1}:!1,F=t.params.passiveListeners?{passive:!1,capture:!0}:!0;return{passiveListener:W,activeListenerWithCapture:F}}function j(){const W=t.zoom;if(W.enabled)return;W.enabled=!0;const{passiveListener:F,activeListenerWithCapture:q}=N();t.wrapperEl.addEventListener("pointerdown",S,F),t.wrapperEl.addEventListener("pointermove",E,q),["pointerup","pointercancel","pointerout"].forEach(U=>{t.wrapperEl.addEventListener(U,C,F)}),t.wrapperEl.addEventListener("pointermove",P,q)}function z(){const W=t.zoom;if(!W.enabled)return;W.enabled=!1;const{passiveListener:F,activeListenerWithCapture:q}=N();t.wrapperEl.removeEventListener("pointerdown",S,F),t.wrapperEl.removeEventListener("pointermove",E,q),["pointerup","pointercancel","pointerout"].forEach(U=>{t.wrapperEl.removeEventListener(U,C,F)}),t.wrapperEl.removeEventListener("pointermove",P,q)}r("init",()=>{t.params.zoom.enabled&&j()}),r("destroy",()=>{z()}),r("touchStart",(W,F)=>{t.zoom.enabled&&k(F)}),r("touchEnd",(W,F)=>{t.zoom.enabled&&D()}),r("doubleTap",(W,F)=>{!t.animating&&t.params.zoom.enabled&&t.zoom.enabled&&t.params.zoom.toggle&&T(F)}),r("transitionEnd",()=>{t.zoom.enabled&&t.params.zoom.enabled&&M()}),r("slideChange",()=>{t.zoom.enabled&&t.params.zoom.enabled&&t.params.cssMode&&M()}),Object.assign(t.zoom,{enable:j,disable:z,in:L,out:A,toggle:T})}function nD(e,t,n,r){const i=x.useRef(n);x.useEffect(()=>{i.current=n},[n]),x.useEffect(()=>{if(!e)return;const o=s=>i.current(s);return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}},[t,e,r])}const lVt='@font-face{font-family:swiper-icons;font-style:normal;font-weight:400;src:url(data:application/font-woff;charset=utf-8;base64,\\ d09GRgABAAAAAAZgABAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAGRAAAABoAAAAci6qHkUdERUYAAAWgAAAAIwAAACQAYABXR1BPUwAABhQAAAAuAAAANuAY7+xHU1VCAAAFxAAAAFAAAABm2fPczU9TLzIAAAHcAAAASgAAAGBP9V5RY21hcAAAAkQAAACIAAABYt6F0cBjdnQgAAACzAAAAAQAAAAEABEBRGdhc3AAAAWYAAAACAAAAAj//wADZ2x5ZgAAAywAAADMAAAD2MHtryVoZWFkAAABbAAAADAAAAA2E2+eoWhoZWEAAAGcAAAAHwAAACQC9gDzaG10eAAAAigAAAAZAAAArgJkABFsb2NhAAAC0AAAAFoAAABaFQAUGG1heHAAAAG8AAAAHwAAACAAcABAbmFtZQAAA/gAAAE5AAACXvFdBwlwb3N0AAAFNAAAAGIAAACE5s74hXjaY2BkYGAAYpf5Hu/j+W2+MnAzMYDAzaX6QjD6/4//Bxj5GA8AuRwMYGkAPywL13jaY2BkYGA88P8Agx4j+/8fQDYfA1AEBWgDAIB2BOoAeNpjYGRgYNBh4GdgYgABEMnIABJzYNADCQAACWgAsQB42mNgYfzCOIGBlYGB0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAFGBiQQkOaawtDAoMBQxXjg/wEGPcYDDA4wNUA2CCgwsAAAO4EL6gAAeNpj2M0gyAACqxgGNWBkZ2D4/wMA+xkDdgAAAHjaY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMOgyWDLEM1T9/w8UBfEMgLzE////P/5//f/V/xv+r4eaAAeMbAxwIUYmIMHEgKYAYjUcsDAwsLKxc3BycfPw8jEQA/gZBASFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTQZBgMAAMR+E+gAEQFEAAAAKgAqACoANAA+AEgAUgBcAGYAcAB6AIQAjgCYAKIArAC2AMAAygDUAN4A6ADyAPwBBgEQARoBJAEuATgBQgFMAVYBYAFqAXQBfgGIAZIBnAGmAbIBzgHsAAB42u2NMQ6CUAyGW568x9AneYYgm4MJbhKFaExIOAVX8ApewSt4Bic4AfeAid3VOBixDxfPYEza5O+Xfi04YADggiUIULCuEJK8VhO4bSvpdnktHI5QCYtdi2sl8ZnXaHlqUrNKzdKcT8cjlq+rwZSvIVczNiezsfnP/uznmfPFBNODM2K7MTQ45YEAZqGP81AmGGcF3iPqOop0r1SPTaTbVkfUe4HXj97wYE+yNwWYxwWu4v1ugWHgo3S1XdZEVqWM7ET0cfnLGxWfkgR42o2PvWrDMBSFj/IHLaF0zKjRgdiVMwScNRAoWUoH78Y2icB/yIY09An6AH2Bdu/UB+yxopYshQiEvnvu0dURgDt8QeC8PDw7Fpji3fEA4z/PEJ6YOB5hKh4dj3EvXhxPqH/SKUY3rJ7srZ4FZnh1PMAtPhwP6fl2PMJMPDgeQ4rY8YT6Gzao0eAEA409DuggmTnFnOcSCiEiLMgxCiTI6Cq5DZUd3Qmp10vO0LaLTd2cjN4fOumlc7lUYbSQcZFkutRG7g6JKZKy0RmdLY680CDnEJ+UMkpFFe1RN7nxdVpXrC4aTtnaurOnYercZg2YVmLN/d/gczfEimrE/fs/bOuq29Zmn8tloORaXgZgGa78yO9/cnXm2BpaGvq25Dv9S4E9+5SIc9PqupJKhYFSSl47+Qcr1mYNAAAAeNptw0cKwkAAAMDZJA8Q7OUJvkLsPfZ6zFVERPy8qHh2YER+3i/BP83vIBLLySsoKimrqKqpa2hp6+jq6RsYGhmbmJqZSy0sraxtbO3sHRydnEMU4uR6yx7JJXveP7WrDycAAAAAAAH//wACeNpjYGRgYOABYhkgZgJCZgZNBkYGLQZtIJsFLMYAAAw3ALgAeNolizEKgDAQBCchRbC2sFER0YD6qVQiBCv/H9ezGI6Z5XBAw8CBK/m5iQQVauVbXLnOrMZv2oLdKFa8Pjuru2hJzGabmOSLzNMzvutpB3N42mNgZGBg4GKQYzBhYMxJLMlj4GBgAYow/P/PAJJhLM6sSoWKfWCAAwDAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA)}:root{--swiper-theme-color:#007aff}:host{display:block;margin-left:auto;margin-right:auto;position:relative;z-index:1}.swiper{display:block;list-style:none;margin-left:auto;margin-right:auto;overflow:hidden;padding:0;position:relative;z-index:1}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{box-sizing:content-box;display:flex;height:100%;position:relative;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function,initial);width:100%;z-index:1}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{display:block;flex-shrink:0;height:100%;position:relative;transition-property:transform;width:100%}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{backface-visibility:hidden;transform:translateZ(0)}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-cube-shadow,.swiper-3d .swiper-slide{transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:"";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{height:var(--swiper-centered-offset-after);min-width:1px;width:100%}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-bottom,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top{height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:10}.swiper-3d .swiper-slide-shadow{background:#00000026}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(270deg,rgba(0,0,0,.5),transparent)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(90deg,rgba(0,0,0,.5),transparent)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(0deg,rgba(0,0,0,.5),transparent)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(180deg,rgba(0,0,0,.5),transparent)}.swiper-lazy-preloader{border:4px solid var(--swiper-preloader-color,var(--swiper-theme-color));border-radius:50%;border-top:4px solid transparent;box-sizing:border-box;height:42px;left:50%;margin-left:-21px;margin-top:-21px;position:absolute;top:50%;transform-origin:50%;width:42px;z-index:10}.swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader,.swiper:not(.swiper-watch-progress) .swiper-lazy-preloader{animation:swiper-preloader-spin 1s linear infinite}.swiper-lazy-preloader-white{--swiper-preloader-color:#fff}.swiper-lazy-preloader-black{--swiper-preloader-color:#000}@keyframes swiper-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}',cVt='.swiper-virtual .swiper-slide{-webkit-backface-visibility:hidden;transform:translateZ(0)}.swiper-virtual.swiper-css-mode .swiper-wrapper:after{content:"";left:0;pointer-events:none;position:absolute;top:0}.swiper-virtual.swiper-css-mode.swiper-horizontal .swiper-wrapper:after{height:1px;width:var(--swiper-virtual-size)}.swiper-virtual.swiper-css-mode.swiper-vertical .swiper-wrapper:after{height:var(--swiper-virtual-size);width:1px}',uVt="",fVt=':root{--swiper-navigation-size:44px}.swiper-button-next,.swiper-button-prev{align-items:center;color:var(--swiper-navigation-color,var(--swiper-theme-color));cursor:pointer;display:flex;height:var(--swiper-navigation-size);justify-content:center;margin-top:calc(0px - var(--swiper-navigation-size)/2);position:absolute;top:var(--swiper-navigation-top-offset,50%);width:calc(var(--swiper-navigation-size)/44*27);z-index:10}.swiper-button-next.swiper-button-disabled,.swiper-button-prev.swiper-button-disabled{cursor:auto;opacity:.35;pointer-events:none}.swiper-button-next.swiper-button-hidden,.swiper-button-prev.swiper-button-hidden{cursor:auto;opacity:0;pointer-events:none}.swiper-navigation-disabled .swiper-button-next,.swiper-navigation-disabled .swiper-button-prev{display:none!important}.swiper-button-next svg,.swiper-button-prev svg{height:100%;-o-object-fit:contain;object-fit:contain;transform-origin:center;width:100%}.swiper-rtl .swiper-button-next svg,.swiper-rtl .swiper-button-prev svg{transform:rotate(180deg)}.swiper-button-prev,.swiper-rtl .swiper-button-next{left:var(--swiper-navigation-sides-offset,10px);right:auto}.swiper-button-lock{display:none}.swiper-button-next:after,.swiper-button-prev:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);font-variant:normal;letter-spacing:0;line-height:1;text-transform:none!important}.swiper-button-prev:after,.swiper-rtl .swiper-button-next:after{content:"prev"}.swiper-button-next,.swiper-rtl .swiper-button-prev{left:auto;right:var(--swiper-navigation-sides-offset,10px)}.swiper-button-next:after,.swiper-rtl .swiper-button-prev:after{content:"next"}',dVt=".swiper-pagination{position:absolute;text-align:center;transform:translateZ(0);transition:opacity .3s;z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-disabled>.swiper-pagination,.swiper-pagination.swiper-pagination-disabled{display:none!important}.swiper-horizontal>.swiper-pagination-bullets,.swiper-pagination-bullets.swiper-pagination-horizontal,.swiper-pagination-custom,.swiper-pagination-fraction{bottom:var(--swiper-pagination-bottom,8px);left:0;top:var(--swiper-pagination-top,auto);width:100%}.swiper-pagination-bullets-dynamic{font-size:0;overflow:hidden}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{position:relative;transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active,.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{transform:scale(.33)}.swiper-pagination-bullet{background:var(--swiper-pagination-bullet-inactive-color,#000);border-radius:var(--swiper-pagination-bullet-border-radius,50%);display:inline-block;height:var(--swiper-pagination-bullet-height,var(--swiper-pagination-bullet-size,8px));opacity:var(--swiper-pagination-bullet-inactive-opacity,.2);width:var(--swiper-pagination-bullet-width,var(--swiper-pagination-bullet-size,8px))}button.swiper-pagination-bullet{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;box-shadow:none;margin:0;padding:0}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet:only-child{display:none!important}.swiper-pagination-bullet-active{background:var(--swiper-pagination-color,var(--swiper-theme-color));opacity:var(--swiper-pagination-bullet-opacity,1)}.swiper-pagination-vertical.swiper-pagination-bullets,.swiper-vertical>.swiper-pagination-bullets{left:var(--swiper-pagination-left,auto);right:var(--swiper-pagination-right,8px);top:50%;transform:translate3d(0,-50%,0)}.swiper-pagination-vertical.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-vertical>.swiper-pagination-bullets .swiper-pagination-bullet{display:block;margin:var(--swiper-pagination-bullet-vertical-gap,6px) 0}.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;transform:translateY(-50%);width:8px}.swiper-pagination-vertical.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;transition:transform .2s,top .2s}.swiper-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 var(--swiper-pagination-bullet-horizontal-gap,4px)}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;transform:translate(-50%);white-space:nowrap}.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet,.swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:transform .2s,left .2s}.swiper-horizontal.swiper-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{transition:transform .2s,right .2s}.swiper-pagination-fraction{color:var(--swiper-pagination-fraction-color,inherit)}.swiper-pagination-progressbar{background:var(--swiper-pagination-progressbar-bg-color,rgba(0,0,0,.25));position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color,var(--swiper-theme-color));height:100%;left:0;position:absolute;top:0;transform:scale(0);transform-origin:left top;width:100%}.swiper-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{transform-origin:right top}.swiper-horizontal>.swiper-pagination-progressbar,.swiper-pagination-progressbar.swiper-pagination-horizontal,.swiper-pagination-progressbar.swiper-pagination-vertical.swiper-pagination-progressbar-opposite,.swiper-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite{height:var(--swiper-pagination-progressbar-size,4px);left:0;top:0;width:100%}.swiper-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite,.swiper-pagination-progressbar.swiper-pagination-vertical,.swiper-vertical>.swiper-pagination-progressbar{height:100%;left:0;top:0;width:var(--swiper-pagination-progressbar-size,4px)}.swiper-pagination-lock{display:none}",hVt=".swiper-scrollbar{background:var(--swiper-scrollbar-bg-color,rgba(0,0,0,.1));border-radius:var(--swiper-scrollbar-border-radius,10px);position:relative;touch-action:none}.swiper-scrollbar-disabled>.swiper-scrollbar,.swiper-scrollbar.swiper-scrollbar-disabled{display:none!important}.swiper-horizontal>.swiper-scrollbar,.swiper-scrollbar.swiper-scrollbar-horizontal{bottom:var(--swiper-scrollbar-bottom,4px);height:var(--swiper-scrollbar-size,4px);left:var(--swiper-scrollbar-sides-offset,1%);position:absolute;top:var(--swiper-scrollbar-top,auto);width:calc(100% - var(--swiper-scrollbar-sides-offset, 1%)*2);z-index:50}.swiper-scrollbar.swiper-scrollbar-vertical,.swiper-vertical>.swiper-scrollbar{height:calc(100% - var(--swiper-scrollbar-sides-offset, 1%)*2);left:var(--swiper-scrollbar-left,auto);position:absolute;right:var(--swiper-scrollbar-right,4px);top:var(--swiper-scrollbar-sides-offset,1%);width:var(--swiper-scrollbar-size,4px);z-index:50}.swiper-scrollbar-drag{background:var(--swiper-scrollbar-drag-bg-color,rgba(0,0,0,.5));border-radius:var(--swiper-scrollbar-border-radius,10px);height:100%;left:0;position:relative;top:0;width:100%}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-scrollbar-lock{display:none}";class pVt{constructor(){ve(this,"tagName","marimo-carousel");ve(this,"validator",Y.object({index:Y.string().nullish(),height:Y.union([Y.string(),Y.number()]).nullish()}));ve(this,"cssStyles",[lVt,cVt,uVt,fVt,dVt,hVt])}render(t){return b.jsx(gVt,{...t.data,children:t.children})}}const gVt=({children:e,height:t})=>{const n=ie.useRef(null),[r,i]=ie.useState(!1);return nD(document,"fullscreenchange",()=>{var o,s;document.fullscreenElement?(o=n.current)==null||o.swiper.keyboard.enable():(s=n.current)==null||s.swiper.keyboard.disable(),i(!!document.fullscreenElement)}),x.useEffect(()=>{requestAnimationFrame(()=>{window.dispatchEvent(new Event("resize"))})},[r]),b.jsxs(oQe,{ref:n,className:"relative w-full border rounded bg-background mo-carousel",spaceBetween:50,style:{height:r?"100%":t||"550px"},slidesPerView:1,modules:[rVt,iVt,sVt,aVt,oVt],zoom:{maxRatio:5},simulateTouch:!1,keyboard:{enabled:r},navigation:!0,pagination:{clickable:!0},virtual:!0,children:[ie.Children.map(e,(o,s)=>b.jsx(sQe,{children:b.jsx("div",{onKeyDown:a=>{a.target instanceof HTMLElement&&a.target.tagName.toLocaleLowerCase().startsWith("marimo-")&&a.stopPropagation()},className:be("h-full w-full flex items-center justify-center box-border overflow-hidden",r?"p-20":"p-6"),children:o})},s)),b.jsx(St,{variant:"link",size:"sm","data-testid":"marimo-plugin-carousel-fullscreen",onClick:async()=>{if(!n.current)return;const o=n.current;document.fullscreenElement?(await document.exitFullscreen(),i(!1)):(await o.requestFullscreen(),i(!0))},className:"absolute bottom-0 right-0 z-10 mx-1 mb-0",children:r?"Exit Fullscreen":"Fullscreen"})]})},mVt="modulepreload",yVt=function(e,t){return new URL(e,t).href},Dxe={},Pe=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link");i=Promise.all(n.map(s=>{if(s=yVt(s,r),s in Dxe)return;Dxe[s]=!0;const a=s.endsWith(".css"),l=a?'[rel="stylesheet"]':"";if(!!r)for(let f=o.length-1;f>=0;f--){const d=o[f];if(d.href===s&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${l}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":mVt,a||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),a)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${s}`)))})}))}return i.then(()=>t()).catch(o=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o})};class vVt{constructor(){ve(this,"tagName","marimo-tex");ve(this,"validator",Y.object({}))}render(t){return b.jsx(xVt,{tex:t.host.textContent||t.host.innerHTML})}}const bVt=K6(async()=>(await Pe(()=>import("./katex-rPiVaalG.js"),__vite__mapDeps([]),import.meta.url)).default);async function OVt(e,t){const n=await bVt();t.startsWith("||(||(")&&t.endsWith("||)||)")?n.render(t.slice(6,-6),e,{displayMode:!0,throwOnError:!1}):t.startsWith("||(")&&t.endsWith("||)")?n.render(t.slice(3,-3),e,{displayMode:!1,throwOnError:!1}):t.startsWith("||[")&&t.endsWith("||]")&&n.render(t.slice(3,-3),e,{displayMode:!0,throwOnError:!1})}const xVt=({tex:e})=>{const t=x.useRef(null);return x.useLayoutEffect(()=>{t.current&&OVt(t.current,e)},[e]),b.jsx("span",{ref:t})};var wVt=EVt;const SVt={hoursPerDay:24,daysPerWeek:7,weeksPerMonth:4,monthsPerYear:12,daysPerYear:365.25},Mxe={ms:["ms","milli","millisecond","milliseconds"],s:["s","sec","secs","second","seconds"],m:["m","min","mins","minute","minutes"],h:["h","hr","hrs","hour","hours"],d:["d","day","days"],w:["w","week","weeks"],mth:["mon","mth","mths","month","months"],y:["y","yr","yrs","year","years"]};function EVt(e,t,n){n=Object.assign({},SVt,n||{}),(typeof e=="number"||e.match(/^[-+]?[0-9.]+$/g))&&(e=parseInt(e)+"ms");let r=0;const i=CVt(n),o=e.toLowerCase().replace(/[^.\w+-]+/g,"").match(/[-+]?[0-9.]+[a-z]+/g);if(o===null)throw new Error(`The value [${e}] could not be parsed by timestring`);return o.forEach(s=>{const a=s.match(/[0-9.]+/g)[0],l=s.match(/[a-z]+/g)[0];r+=_Vt(a,l,i)}),t?kVt(r,t,i):r}function CVt(e){const t={ms:.001,s:1,m:60,h:3600};return t.d=e.hoursPerDay*t.h,t.w=e.daysPerWeek*t.d,t.mth=e.daysPerYear/e.monthsPerYear*t.d,t.y=e.daysPerYear*t.d,t}function lQe(e){for(const t of Object.keys(Mxe))if(Mxe[t].indexOf(e)>-1)return t;throw new Error(`The unit [${e}] is not supported by timestring`)}function _Vt(e,t,n){return e*n[lQe(t)]}function kVt(e,t,n){return e/n[lQe(t)]}const YG=wf(wVt),I3=.1,Nxe=Y.string().superRefine((e,t)=>{try{YG(e)<I3&&t.addIssue({code:Y.ZodIssueCode.custom,message:`Must be greater than ${I3} seconds.`});return}catch{t.addIssue({code:Y.ZodIssueCode.custom,message:"Must be a valid timestring. e.g. 1m, 30m, 1h."});return}});class $Vt{constructor(){ve(this,"tagName","marimo-refresh");ve(this,"validator",Y.object({options:Y.array(Y.union([Nxe,Y.number().min(I3)])).default([]),defaultInterval:Y.union([Nxe,Y.number().min(I3)]).optional(),label:Y.string().nullable()}))}render(t){return b.jsx(PVt,{...t})}}const AN="off";let TVt=0;const PVt=({setValue:e,data:t})=>{const[n,r]=x.useState(t.defaultInterval??AN);x.useEffect(()=>{r(t.defaultInterval??AN)},[t.defaultInterval]);const[i,o]=x.useState(!1),s=Jn(()=>{o(!0),e(()=>`${n} (${TVt++})`),setTimeout(()=>o(!1),500)});x.useEffect(()=>{if(n===AN)return;let c=typeof n=="number"?n:/[a-z]/.test(n)?YG(n):YG(`${n}s`);c=Math.max(c,1);const u=setInterval(s,c*1e3);return()=>clearInterval(u)},[n,s]);const a="shadow-none! hover:shadow-none! focus:shadow-none! active:shadow-none!",l=t.options.length>0;return b.jsx(fc,{label:t.label,children:b.jsxs("span",{className:"inline-flex items-center text-secondary-foreground rounded shadow-smSolid",children:[b.jsx(St,{"data-testid":"marimo-plugin-refresh-button",variant:"secondary",size:"icon",className:be(a,"border mb-0 rounded",l&&"border-r-0 rounded-tr-none rounded-br-none"),onClick:s,children:b.jsx(P5,{className:be("w-3.5 h-3.5",i&&"animate-spin")})}),b.jsxs($h,{"data-testid":"marimo-plugin-refresh-select",onChange:c=>{r(c.target.value)},value:n,className:be(a,"border mb-0 bg-secondary rounded rounded-tl-none rounded-bl-none hover:bg-secondary/60",!l&&"hidden"),children:[b.jsx("option",{value:AN,children:"off"}),t.options.map(c=>b.jsx("option",{value:c,children:typeof c=="number"?`${c}s`:c},c))]})]})})};function AVt(){const[e,t]=x.useState(0),n=x.useRef(),r=Jn(()=>{n.current=window.setInterval(()=>{t(s=>s+.1)},100)}),i=Jn(()=>{n.current!=null&&(window.clearInterval(n.current),n.current=void 0)}),o=Jn(()=>{t(0)});return x.useEffect(()=>()=>{window.clearInterval(n.current)},[]),{time:new Intl.NumberFormat("en-US",{minimumFractionDigits:1,maximumFractionDigits:1}).format(e),start:r,stop:i,clear:o}}function RVt(e){const{onDone:t,options:n}=e,[r,i]=x.useState("stopped"),o=x.useRef(),[s,a]=x.useState(!0),[l,c]=x.useState(),u=AVt(),f=Jn(()=>{u.clear(),navigator.mediaDevices.getUserMedia({audio:!0}).then(p=>{const g=new MediaRecorder(p,n);i("recording"),o.current=g,g.start(),u.start(),g.addEventListener("dataavailable",v=>{c(v.data),t==null||t(v.data),g.stream.getTracks().forEach(y=>y.stop()),o.current=void 0})}).catch(p=>{At.log(p),a(!1)})}),d=Jn(()=>{var p;(p=o.current)==null||p.stop(),u.stop(),i("stopped")}),h=Jn(()=>{i(p=>{var g,v;return p==="recording"?((g=o.current)==null||g.pause(),u.stop(),"paused"):p==="paused"?((v=o.current)==null||v.resume(),u.start(),"recording"):p})});return x.useEffect(()=>()=>{var p,g;(p=o.current)==null||p.stream.getTracks().forEach(v=>v.stop()),(g=o.current)==null||g.stop(),u.stop()},[]),{start:f,stop:d,pauseResume:h,allowed:s,recordingBlob:l,recordingStatus:r,recordingTime:u.time,mediaRecorder:o}}const DVt=({onStart:e,onStop:t,onPause:n,status:r,time:i})=>b.jsxs("div",{className:"flex items-center gap-3",children:[r==="stopped"&&b.jsx(St,{"data-testid":"audio-recorder-start",variant:"secondary",onClick:e,className:"w-[50px]",children:b.jsx(Fj,{className:be("w-6 h-6 border border-input rounded-full"),strokeWidth:1.5,fill:"var(--red-9)"})}),r==="recording"&&b.jsxs(St,{"data-testid":"audio-recorder-pause",variant:"secondary",onClick:t,className:"w-[50px]",children:[b.jsx(az,{className:"w-5 h-5 rounded-sm",fill:"var(--red-9)",strokeWidth:1.5}),b.jsx(Fj,{className:be("w-6 h-6 absolute opacity-20 animate-ping"),fill:"var(--red-9)",style:{animationDuration:"1.5s"},strokeWidth:0})]}),i&&b.jsxs("span",{className:"text-sm font-bold",children:[i,"s"]})]});class MVt{constructor(){ve(this,"tagName","marimo-microphone");ve(this,"validator",Y.object({label:Y.string().nullish()}))}render(t){return b.jsx(NVt,{...t})}}const NVt=({setValue:e,data:t})=>{const{start:n,stop:r,pauseResume:i,recordingStatus:o,recordingTime:s,allowed:a}=RVt({onDone:async l=>{const c=await Fje(l);e(c)}});return b.jsxs(fc,{label:t.label,align:"top",children:[!a&&b.jsx("div",{className:"text-destructive text-sm",children:"Microphone access is disabled. Please allow microphone access in your browser."}),b.jsx(DVt,{onStart:n,onStop:r,onPause:i,status:o,time:s})]})};class IVt{constructor(){ve(this,"tagName","marimo-download");ve(this,"validator",Y.object({data:Y.string(),disabled:Y.boolean().default(!1),filename:Y.string().nullish(),label:Y.string().nullish()}))}render({data:t}){return b.jsxs("a",{href:t.data,download:t.filename||!0,target:"_blank",rel:"noopener noreferrer",className:pv({variant:"secondary",disabled:t.disabled}),children:[b.jsx(iz,{className:be("w-3 h-3",t.label&&"mr-2")}),t.label??"Download"]})}}const cQe="Progress",y8=100,[LVt,MGn]=uo(cQe),[jVt,FVt]=LVt(cQe),uQe=x.forwardRef((e,t)=>{const{__scopeProgress:n,value:r,max:i,getValueLabel:o=BVt,...s}=e,a=GG(i)?i:y8,l=dQe(r,a)?r:null,c=L3(l)?o(l,a):void 0;return x.createElement(jVt,{scope:n,value:l,max:a},x.createElement(Ot.div,oe({"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":L3(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":fQe(l,a),"data-value":l??void 0,"data-max":a},s,{ref:t})))});uQe.propTypes={max(e,t,n){const r=e[t],i=String(r);return r&&!GG(r)?new Error(WVt(i,n)):null},value(e,t,n){const r=e[t],i=String(r),o=GG(e.max)?e.max:y8;return r!=null&&!dQe(r,o)?new Error(qVt(i,n)):null}};const zVt="ProgressIndicator",QVt=x.forwardRef((e,t)=>{var n;const{__scopeProgress:r,...i}=e,o=FVt(zVt,r);return x.createElement(Ot.div,oe({"data-state":fQe(o.value,o.max),"data-value":(n=o.value)!==null&&n!==void 0?n:void 0,"data-max":o.max},i,{ref:t}))});function BVt(e,t){return`${Math.round(e/t*100)}%`}function fQe(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function L3(e){return typeof e=="number"}function GG(e){return L3(e)&&!isNaN(e)&&e>0}function dQe(e,t){return L3(e)&&!isNaN(e)&&e<=t&&e>=0}function WVt(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${y8}\`.`}function qVt(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
  - a positive number
  - less than the value passed to \`max\` (or ${y8} if no \`max\` prop is set)
  - \`null\` if the progress is indeterminate.

Defaulting to \`null\`.`}const hQe=uQe,VVt=QVt,pQe=x.forwardRef(({className:e,value:t,...n},r)=>b.jsx(hQe,{ref:r,className:be("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:b.jsx(VVt,{className:"h-full w-full flex-1 bg-primary transition-all pulse",style:{transform:`translateX(-${100-(t||0)}%)`}})}));pQe.displayName=hQe.displayName;var gQe={exports:{}};(function(e){(function(){var t=r(function(m){return m===1?"χρόνος":"χρόνια"},function(m){return m===1?"μήνας":"μήνες"},function(m){return m===1?"εβδομάδα":"εβδομάδες"},function(m){return m===1?"μέρα":"μέρες"},function(m){return m===1?"ώρα":"ώρες"},function(m){return m===1?"λεπτό":"λεπτά"},function(m){return m===1?"δευτερόλεπτο":"δευτερόλεπτα"},function(m){return(m===1?"χιλιοστό":"χιλιοστά")+" του δευτερολέπτου"},","),n={af:r("jaar",function(m){return"maand"+(m===1?"":"e")},function(m){return m===1?"week":"weke"},function(m){return m===1?"dag":"dae"},function(m){return m===1?"uur":"ure"},function(m){return m===1?"minuut":"minute"},function(m){return"sekonde"+(m===1?"":"s")},function(m){return"millisekonde"+(m===1?"":"s")},","),ar:u(r(function(m){return["سنة","سنتان","سنوات"][i(m)]},function(m){return["شهر","شهران","أشهر"][i(m)]},function(m){return["أسبوع","أسبوعين","أسابيع"][i(m)]},function(m){return["يوم","يومين","أيام"][i(m)]},function(m){return["ساعة","ساعتين","ساعات"][i(m)]},function(m){return["دقيقة","دقيقتان","دقائق"][i(m)]},function(m){return["ثانية","ثانيتان","ثواني"][i(m)]},function(m){return["جزء من الثانية","جزآن من الثانية","أجزاء من الثانية"][i(m)]},","),{delimiter:" ﻭ ",_digitReplacements:["۰","١","٢","٣","٤","٥","٦","٧","٨","٩"]}),bg:r(function(m){return["години","година","години"][s(m)]},function(m){return["месеца","месец","месеца"][s(m)]},function(m){return["седмици","седмица","седмици"][s(m)]},function(m){return["дни","ден","дни"][s(m)]},function(m){return["часа","час","часа"][s(m)]},function(m){return["минути","минута","минути"][s(m)]},function(m){return["секунди","секунда","секунди"][s(m)]},function(m){return["милисекунди","милисекунда","милисекунди"][s(m)]},","),bn:r("বছর","মাস","সপ্তাহ","দিন","ঘন্টা","মিনিট","সেকেন্ড","মিলিসেকেন্ড"),ca:r(function(m){return"any"+(m===1?"":"s")},function(m){return"mes"+(m===1?"":"os")},function(m){return"setman"+(m===1?"a":"es")},function(m){return"di"+(m===1?"a":"es")},function(m){return"hor"+(m===1?"a":"es")},function(m){return"minut"+(m===1?"":"s")},function(m){return"segon"+(m===1?"":"s")},function(m){return"milisegon"+(m===1?"":"s")},","),ckb:r("ساڵ","مانگ","هەفتە","ڕۆژ","کاژێر","خولەک","چرکە","میلی چرکە","."),cs:r(function(m){return["rok","roku","roky","let"][a(m)]},function(m){return["měsíc","měsíce","měsíce","měsíců"][a(m)]},function(m){return["týden","týdne","týdny","týdnů"][a(m)]},function(m){return["den","dne","dny","dní"][a(m)]},function(m){return["hodina","hodiny","hodiny","hodin"][a(m)]},function(m){return["minuta","minuty","minuty","minut"][a(m)]},function(m){return["sekunda","sekundy","sekundy","sekund"][a(m)]},function(m){return["milisekunda","milisekundy","milisekundy","milisekund"][a(m)]},","),cy:r("flwyddyn","mis","wythnos","diwrnod","awr","munud","eiliad","milieiliad"),da:r("år",function(m){return"måned"+(m===1?"":"er")},function(m){return"uge"+(m===1?"":"r")},function(m){return"dag"+(m===1?"":"e")},function(m){return"time"+(m===1?"":"r")},function(m){return"minut"+(m===1?"":"ter")},function(m){return"sekund"+(m===1?"":"er")},function(m){return"millisekund"+(m===1?"":"er")},","),de:r(function(m){return"Jahr"+(m===1?"":"e")},function(m){return"Monat"+(m===1?"":"e")},function(m){return"Woche"+(m===1?"":"n")},function(m){return"Tag"+(m===1?"":"e")},function(m){return"Stunde"+(m===1?"":"n")},function(m){return"Minute"+(m===1?"":"n")},function(m){return"Sekunde"+(m===1?"":"n")},function(m){return"Millisekunde"+(m===1?"":"n")},","),el:t,en:r(function(m){return"year"+(m===1?"":"s")},function(m){return"month"+(m===1?"":"s")},function(m){return"week"+(m===1?"":"s")},function(m){return"day"+(m===1?"":"s")},function(m){return"hour"+(m===1?"":"s")},function(m){return"minute"+(m===1?"":"s")},function(m){return"second"+(m===1?"":"s")},function(m){return"millisecond"+(m===1?"":"s")}),eo:r(function(m){return"jaro"+(m===1?"":"j")},function(m){return"monato"+(m===1?"":"j")},function(m){return"semajno"+(m===1?"":"j")},function(m){return"tago"+(m===1?"":"j")},function(m){return"horo"+(m===1?"":"j")},function(m){return"minuto"+(m===1?"":"j")},function(m){return"sekundo"+(m===1?"":"j")},function(m){return"milisekundo"+(m===1?"":"j")},","),es:r(function(m){return"año"+(m===1?"":"s")},function(m){return"mes"+(m===1?"":"es")},function(m){return"semana"+(m===1?"":"s")},function(m){return"día"+(m===1?"":"s")},function(m){return"hora"+(m===1?"":"s")},function(m){return"minuto"+(m===1?"":"s")},function(m){return"segundo"+(m===1?"":"s")},function(m){return"milisegundo"+(m===1?"":"s")},","),et:r(function(m){return"aasta"+(m===1?"":"t")},function(m){return"kuu"+(m===1?"":"d")},function(m){return"nädal"+(m===1?"":"at")},function(m){return"päev"+(m===1?"":"a")},function(m){return"tund"+(m===1?"":"i")},function(m){return"minut"+(m===1?"":"it")},function(m){return"sekund"+(m===1?"":"it")},function(m){return"millisekund"+(m===1?"":"it")},","),eu:r("urte","hilabete","aste","egun","ordu","minutu","segundo","milisegundo",","),fa:r("سال","ماه","هفته","روز","ساعت","دقیقه","ثانیه","میلی ثانیه"),fi:r(function(m){return m===1?"vuosi":"vuotta"},function(m){return m===1?"kuukausi":"kuukautta"},function(m){return"viikko"+(m===1?"":"a")},function(m){return"päivä"+(m===1?"":"ä")},function(m){return"tunti"+(m===1?"":"a")},function(m){return"minuutti"+(m===1?"":"a")},function(m){return"sekunti"+(m===1?"":"a")},function(m){return"millisekunti"+(m===1?"":"a")},","),fo:r("ár",function(m){return m===1?"mánaður":"mánaðir"},function(m){return m===1?"vika":"vikur"},function(m){return m===1?"dagur":"dagar"},function(m){return m===1?"tími":"tímar"},function(m){return m===1?"minuttur":"minuttir"},"sekund","millisekund",","),fr:r(function(m){return"an"+(m>=2?"s":"")},"mois",function(m){return"semaine"+(m>=2?"s":"")},function(m){return"jour"+(m>=2?"s":"")},function(m){return"heure"+(m>=2?"s":"")},function(m){return"minute"+(m>=2?"s":"")},function(m){return"seconde"+(m>=2?"s":"")},function(m){return"milliseconde"+(m>=2?"s":"")},","),gr:t,he:r(function(m){return m===1?"שנה":"שנים"},function(m){return m===1?"חודש":"חודשים"},function(m){return m===1?"שבוע":"שבועות"},function(m){return m===1?"יום":"ימים"},function(m){return m===1?"שעה":"שעות"},function(m){return m===1?"דקה":"דקות"},function(m){return m===1?"שניה":"שניות"},function(m){return m===1?"מילישנייה":"מילישניות"}),hr:r(function(m){return m%10===2||m%10===3||m%10===4?"godine":"godina"},function(m){return m===1?"mjesec":m===2||m===3||m===4?"mjeseca":"mjeseci"},function(m){return m%10===1&&m!==11?"tjedan":"tjedna"},function(m){return m===1?"dan":"dana"},function(m){return m===1?"sat":m===2||m===3||m===4?"sata":"sati"},function(m){var w=m%10;return(w===2||w===3||w===4)&&(m<10||m>14)?"minute":"minuta"},function(m){var w=m%10;return w===5||Math.floor(m)===m&&m>=10&&m<=19?"sekundi":w===1?"sekunda":w===2||w===3||w===4?"sekunde":"sekundi"},function(m){return m===1?"milisekunda":m%10===2||m%10===3||m%10===4?"milisekunde":"milisekundi"},","),hi:r("साल",function(m){return m===1?"महीना":"महीने"},function(m){return m===1?"हफ़्ता":"हफ्ते"},"दिन",function(m){return m===1?"घंटा":"घंटे"},"मिनट","सेकंड","मिलीसेकंड"),hu:r("év","hónap","hét","nap","óra","perc","másodperc","ezredmásodperc",","),id:r("tahun","bulan","minggu","hari","jam","menit","detik","milidetik"),is:r("ár",function(m){return"mánuð"+(m===1?"ur":"ir")},function(m){return"vik"+(m===1?"a":"ur")},function(m){return"dag"+(m===1?"ur":"ar")},function(m){return"klukkutím"+(m===1?"i":"ar")},function(m){return"mínút"+(m===1?"a":"ur")},function(m){return"sekúnd"+(m===1?"a":"ur")},function(m){return"millisekúnd"+(m===1?"a":"ur")}),it:r(function(m){return"ann"+(m===1?"o":"i")},function(m){return"mes"+(m===1?"e":"i")},function(m){return"settiman"+(m===1?"a":"e")},function(m){return"giorn"+(m===1?"o":"i")},function(m){return"or"+(m===1?"a":"e")},function(m){return"minut"+(m===1?"o":"i")},function(m){return"second"+(m===1?"o":"i")},function(m){return"millisecond"+(m===1?"o":"i")},","),ja:r("年","ヶ月","週","日","時間","分","秒","ミリ秒"),km:r("ឆ្នាំ","ខែ","សប្តាហ៍","ថ្ងៃ","ម៉ោង","នាទី","វិនាទី","មិល្លីវិនាទី"),kn:r(function(m){return m===1?"ವರ್ಷ":"ವರ್ಷಗಳು"},function(m){return m===1?"ತಿಂಗಳು":"ತಿಂಗಳುಗಳು"},function(m){return m===1?"ವಾರ":"ವಾರಗಳು"},function(m){return m===1?"ದಿನ":"ದಿನಗಳು"},function(m){return m===1?"ಗಂಟೆ":"ಗಂಟೆಗಳು"},function(m){return m===1?"ನಿಮಿಷ":"ನಿಮಿಷಗಳು"},function(m){return m===1?"ಸೆಕೆಂಡ್":"ಸೆಕೆಂಡುಗಳು"},function(m){return m===1?"ಮಿಲಿಸೆಕೆಂಡ್":"ಮಿಲಿಸೆಕೆಂಡುಗಳು"}),ko:r("년","개월","주일","일","시간","분","초","밀리 초"),ku:r("sal","meh","hefte","roj","seet","deqe","saniye","mîlîçirk",","),lo:r("ປີ","ເດືອນ","ອາທິດ","ມື້","ຊົ່ວໂມງ","ນາທີ","ວິນາທີ","ມິນລິວິນາທີ",","),lt:r(function(m){return m%10===0||m%100>=10&&m%100<=20?"metų":"metai"},function(m){return["mėnuo","mėnesiai","mėnesių"][l(m)]},function(m){return["savaitė","savaitės","savaičių"][l(m)]},function(m){return["diena","dienos","dienų"][l(m)]},function(m){return["valanda","valandos","valandų"][l(m)]},function(m){return["minutė","minutės","minučių"][l(m)]},function(m){return["sekundė","sekundės","sekundžių"][l(m)]},function(m){return["milisekundė","milisekundės","milisekundžių"][l(m)]},","),lv:r(function(m){return c(m)?"gads":"gadi"},function(m){return c(m)?"mēnesis":"mēneši"},function(m){return c(m)?"nedēļa":"nedēļas"},function(m){return c(m)?"diena":"dienas"},function(m){return c(m)?"stunda":"stundas"},function(m){return c(m)?"minūte":"minūtes"},function(m){return c(m)?"sekunde":"sekundes"},function(m){return c(m)?"milisekunde":"milisekundes"},","),mk:r(function(m){return m===1?"година":"години"},function(m){return m===1?"месец":"месеци"},function(m){return m===1?"недела":"недели"},function(m){return m===1?"ден":"дена"},function(m){return m===1?"час":"часа"},function(m){return m===1?"минута":"минути"},function(m){return m===1?"секунда":"секунди"},function(m){return m===1?"милисекунда":"милисекунди"},","),mn:r("жил","сар","долоо хоног","өдөр","цаг","минут","секунд","миллисекунд"),mr:r(function(m){return m===1?"वर्ष":"वर्षे"},function(m){return m===1?"महिना":"महिने"},function(m){return m===1?"आठवडा":"आठवडे"},"दिवस","तास",function(m){return m===1?"मिनिट":"मिनिटे"},"सेकंद","मिलिसेकंद"),ms:r("tahun","bulan","minggu","hari","jam","minit","saat","milisaat"),nl:r("jaar",function(m){return m===1?"maand":"maanden"},function(m){return m===1?"week":"weken"},function(m){return m===1?"dag":"dagen"},"uur",function(m){return m===1?"minuut":"minuten"},function(m){return m===1?"seconde":"seconden"},function(m){return m===1?"milliseconde":"milliseconden"},","),no:r("år",function(m){return"måned"+(m===1?"":"er")},function(m){return"uke"+(m===1?"":"r")},function(m){return"dag"+(m===1?"":"er")},function(m){return"time"+(m===1?"":"r")},function(m){return"minutt"+(m===1?"":"er")},function(m){return"sekund"+(m===1?"":"er")},function(m){return"millisekund"+(m===1?"":"er")},","),pl:r(function(m){return["rok","roku","lata","lat"][o(m)]},function(m){return["miesiąc","miesiąca","miesiące","miesięcy"][o(m)]},function(m){return["tydzień","tygodnia","tygodnie","tygodni"][o(m)]},function(m){return["dzień","dnia","dni","dni"][o(m)]},function(m){return["godzina","godziny","godziny","godzin"][o(m)]},function(m){return["minuta","minuty","minuty","minut"][o(m)]},function(m){return["sekunda","sekundy","sekundy","sekund"][o(m)]},function(m){return["milisekunda","milisekundy","milisekundy","milisekund"][o(m)]},","),pt:r(function(m){return"ano"+(m===1?"":"s")},function(m){return m===1?"mês":"meses"},function(m){return"semana"+(m===1?"":"s")},function(m){return"dia"+(m===1?"":"s")},function(m){return"hora"+(m===1?"":"s")},function(m){return"minuto"+(m===1?"":"s")},function(m){return"segundo"+(m===1?"":"s")},function(m){return"milissegundo"+(m===1?"":"s")},","),ro:r(function(m){return m===1?"an":"ani"},function(m){return m===1?"lună":"luni"},function(m){return m===1?"săptămână":"săptămâni"},function(m){return m===1?"zi":"zile"},function(m){return m===1?"oră":"ore"},function(m){return m===1?"minut":"minute"},function(m){return m===1?"secundă":"secunde"},function(m){return m===1?"milisecundă":"milisecunde"},","),ru:r(function(m){return["лет","год","года"][s(m)]},function(m){return["месяцев","месяц","месяца"][s(m)]},function(m){return["недель","неделя","недели"][s(m)]},function(m){return["дней","день","дня"][s(m)]},function(m){return["часов","час","часа"][s(m)]},function(m){return["минут","минута","минуты"][s(m)]},function(m){return["секунд","секунда","секунды"][s(m)]},function(m){return["миллисекунд","миллисекунда","миллисекунды"][s(m)]},","),sq:r(function(m){return m===1?"vit":"vjet"},"muaj","javë","ditë","orë",function(m){return"minut"+(m===1?"ë":"a")},function(m){return"sekond"+(m===1?"ë":"a")},function(m){return"milisekond"+(m===1?"ë":"a")},","),sr:r(function(m){return["години","година","године"][s(m)]},function(m){return["месеци","месец","месеца"][s(m)]},function(m){return["недељи","недеља","недеље"][s(m)]},function(m){return["дани","дан","дана"][s(m)]},function(m){return["сати","сат","сата"][s(m)]},function(m){return["минута","минут","минута"][s(m)]},function(m){return["секунди","секунда","секунде"][s(m)]},function(m){return["милисекунди","милисекунда","милисекунде"][s(m)]},","),ta:r(function(m){return m===1?"வருடம்":"ஆண்டுகள்"},function(m){return m===1?"மாதம்":"மாதங்கள்"},function(m){return m===1?"வாரம்":"வாரங்கள்"},function(m){return m===1?"நாள்":"நாட்கள்"},function(m){return m===1?"மணி":"மணிநேரம்"},function(m){return"நிமிட"+(m===1?"ம்":"ங்கள்")},function(m){return"வினாடி"+(m===1?"":"கள்")},function(m){return"மில்லி விநாடி"+(m===1?"":"கள்")}),te:r(function(m){return"సంవత్స"+(m===1?"రం":"రాల")},function(m){return"నెల"+(m===1?"":"ల")},function(m){return m===1?"వారం":"వారాలు"},function(m){return"రోజు"+(m===1?"":"లు")},function(m){return"గంట"+(m===1?"":"లు")},function(m){return m===1?"నిమిషం":"నిమిషాలు"},function(m){return m===1?"సెకను":"సెకన్లు"},function(m){return m===1?"మిల్లీసెకన్":"మిల్లీసెకన్లు"}),uk:r(function(m){return["років","рік","роки"][s(m)]},function(m){return["місяців","місяць","місяці"][s(m)]},function(m){return["тижнів","тиждень","тижні"][s(m)]},function(m){return["днів","день","дні"][s(m)]},function(m){return["годин","година","години"][s(m)]},function(m){return["хвилин","хвилина","хвилини"][s(m)]},function(m){return["секунд","секунда","секунди"][s(m)]},function(m){return["мілісекунд","мілісекунда","мілісекунди"][s(m)]},","),ur:r("سال",function(m){return m===1?"مہینہ":"مہینے"},function(m){return m===1?"ہفتہ":"ہفتے"},"دن",function(m){return m===1?"گھنٹہ":"گھنٹے"},"منٹ","سیکنڈ","ملی سیکنڈ"),sk:r(function(m){return["rok","roky","roky","rokov"][a(m)]},function(m){return["mesiac","mesiace","mesiace","mesiacov"][a(m)]},function(m){return["týždeň","týždne","týždne","týždňov"][a(m)]},function(m){return["deň","dni","dni","dní"][a(m)]},function(m){return["hodina","hodiny","hodiny","hodín"][a(m)]},function(m){return["minúta","minúty","minúty","minút"][a(m)]},function(m){return["sekunda","sekundy","sekundy","sekúnd"][a(m)]},function(m){return["milisekunda","milisekundy","milisekundy","milisekúnd"][a(m)]},","),sl:r(function(m){return m%10===1?"leto":m%100===2?"leti":m%100===3||m%100===4||Math.floor(m)!==m&&m%100<=5?"leta":"let"},function(m){return m%10===1?"mesec":m%100===2||Math.floor(m)!==m&&m%100<=5?"meseca":m%10===3||m%10===4?"mesece":"mesecev"},function(m){return m%10===1?"teden":m%10===2||Math.floor(m)!==m&&m%100<=4?"tedna":m%10===3||m%10===4?"tedne":"tednov"},function(m){return m%100===1?"dan":"dni"},function(m){return m%10===1?"ura":m%100===2?"uri":m%10===3||m%10===4||Math.floor(m)!==m?"ure":"ur"},function(m){return m%10===1?"minuta":m%10===2?"minuti":m%10===3||m%10===4||Math.floor(m)!==m&&m%100<=4?"minute":"minut"},function(m){return m%10===1?"sekunda":m%100===2?"sekundi":m%100===3||m%100===4||Math.floor(m)!==m?"sekunde":"sekund"},function(m){return m%10===1?"milisekunda":m%100===2?"milisekundi":m%100===3||m%100===4||Math.floor(m)!==m?"milisekunde":"milisekund"},","),sv:r("år",function(m){return"månad"+(m===1?"":"er")},function(m){return"veck"+(m===1?"a":"or")},function(m){return"dag"+(m===1?"":"ar")},function(m){return"timm"+(m===1?"e":"ar")},function(m){return"minut"+(m===1?"":"er")},function(m){return"sekund"+(m===1?"":"er")},function(m){return"millisekund"+(m===1?"":"er")},","),sw:u(r(function(m){return m===1?"mwaka":"miaka"},function(m){return m===1?"mwezi":"miezi"},"wiki",function(m){return m===1?"siku":"masiku"},function(m){return m===1?"saa":"masaa"},"dakika","sekunde","milisekunde"),{_numberFirst:!0}),tr:r("yıl","ay","hafta","gün","saat","dakika","saniye","milisaniye",","),th:r("ปี","เดือน","สัปดาห์","วัน","ชั่วโมง","นาที","วินาที","มิลลิวินาที"),uz:r("yil","oy","hafta","kun","soat","minut","sekund","millisekund"),uz_CYR:r("йил","ой","ҳафта","кун","соат","минут","секунд","миллисекунд"),vi:r("năm","tháng","tuần","ngày","giờ","phút","giây","mili giây",","),zh_CN:r("年","个月","周","天","小时","分钟","秒","毫秒"),zh_TW:r("年","個月","周","天","小時","分鐘","秒","毫秒")};function r(m,w,S,E,C,k,P,D,M){var L={y:m,mo:w,w:S,d:E,h:C,m:k,s:P,ms:D};return typeof M<"u"&&(L.decimal=M),L}function i(m){return m===2?1:m>2&&m<11?2:0}function o(m){return m===1?0:Math.floor(m)!==m?1:m%10>=2&&m%10<=4&&!(m%100>10&&m%100<20)?2:3}function s(m){return Math.floor(m)!==m?2:m%100>=5&&m%100<=20||m%10>=5&&m%10<=9||m%10===0?0:m%10===1?1:m>1?2:0}function a(m){return m===1?0:Math.floor(m)!==m?1:m%10>=2&&m%10<=4&&m%100<10?2:3}function l(m){return m===1||m%10===1&&m%100>20?0:Math.floor(m)!==m||m%10>=2&&m%100>20||m%10>=2&&m%100<10?1:2}function c(m){return m%10===1&&m%100!==11}function u(m){for(var w,S=1;S<arguments.length;S++){w=arguments[S];for(var E in w)d(w,E)&&(m[E]=w[E])}return m}var f=Array.isArray||function(m){return Object.prototype.toString.call(m)==="[object Array]"};function d(m,w){return Object.prototype.hasOwnProperty.call(m,w)}function h(m){var w=[m.language];if(d(m,"fallbacks"))if(f(m.fallbacks)&&m.fallbacks.length)w=w.concat(m.fallbacks);else throw new Error("fallbacks must be an array with at least one element");for(var S=0;S<w.length;S++){var E=w[S];if(d(m.languages,E))return m.languages[E];if(d(n,E))return n[E]}throw new Error("No language found.")}function p(m,w,S){var E=m.unitName,C=m.unitCount,k=S.spacer,P=S.maxDecimalPoints,D;d(S,"decimal")?D=S.decimal:d(w,"decimal")?D=w.decimal:D=".";var M;"digitReplacements"in S?M=S.digitReplacements:"_digitReplacements"in w&&(M=w._digitReplacements);var L,A=P===void 0?C:Math.floor(C*Math.pow(10,P))/Math.pow(10,P),T=A.toString();if(M){L="";for(var N=0;N<T.length;N++){var j=T[N];j==="."?L+=D:L+=M[j]}}else L=T.replace(".",D);var z=w[E],W;return typeof z=="function"?W=z(C):W=z,w._numberFirst?W+k+L:L+k+W}function g(m,w){var S,E,C,k,P=w.units,D=w.unitMeasures,M="largest"in w?w.largest:1/0;if(!P.length)return[];var L={};for(k=m,E=0;E<P.length;E++){S=P[E];var A=D[S],T=E===P.length-1;C=T?k/A:Math.floor(k/A),L[S]=C,k-=C*A}if(w.round){var N=M;for(E=0;E<P.length;E++)if(S=P[E],C=L[S],C!==0&&(N--,N===0)){for(var j=E+1;j<P.length;j++){var z=P[j],W=L[z];L[S]+=W*D[z]/D[S],L[z]=0}break}for(E=P.length-1;E>=0;E--)if(S=P[E],C=L[S],C!==0){var F=Math.round(C);if(L[S]=F,E===0)break;var q=P[E-1],U=D[q],V=Math.floor(F*D[S]/U);if(V)L[q]+=V,L[S]=0;else break}}var H=[];for(E=0;E<P.length&&H.length<M;E++)S=P[E],C=L[S],C&&H.push({unitName:S,unitCount:C});return H}function v(m,w){var S=h(w);if(!m.length){var E=w.units,C=E[E.length-1];return p({unitName:C,unitCount:0},S,w)}var k=w.conjunction,P=w.serialComma,D;d(w,"delimiter")?D=w.delimiter:d(S,"delimiter")?D=S.delimiter:D=", ";for(var M=[],L=0;L<m.length;L++)M.push(p(m[L],S,w));return!k||m.length===1?M.join(D):m.length===2?M.join(k):M.slice(0,-1).join(D)+(P?",":"")+k+M.slice(-1)}function y(m){var w=function(E,C){E=Math.abs(E);var k=u({},w,C||{}),P=g(E,k);return v(P,k)};return u(w,{language:"en",spacer:" ",conjunction:"",serialComma:!0,units:["y","mo","w","d","h","m","s"],languages:{},round:!1,unitMeasures:{y:315576e5,mo:26298e5,w:6048e5,d:864e5,h:36e5,m:6e4,s:1e3,ms:1}},m)}var O=y({});O.getSupportedLanguages=function(){var w=[];for(var S in n)d(n,S)&&S!=="gr"&&w.push(S);return w},O.humanizer=y,e.exports?e.exports=O:this.humanizeDuration=O})()})(gQe);var UVt=gQe.exports;const HVt=wf(UVt);class XVt{constructor(){ve(this,"tagName","marimo-progress");ve(this,"validator",Y.object({title:Y.string().optional(),subtitle:Y.string().optional(),progress:Y.union([Y.number(),Y.boolean()]),total:Y.number().optional(),eta:Y.number().optional(),rate:Y.number().optional()}))}render(t){return b.jsx(ZVt,{...t.data})}}const ZVt=({title:e,subtitle:t,progress:n,total:r,eta:i,rate:o})=>{const s=typeof n=="number"?"items-start":"items-center",a=()=>typeof n=="number"&&r!=null&&r>0?b.jsxs("div",{className:"flex gap-3 text-sm text-muted-foreground items-baseline",children:[b.jsx(pQe,{value:YVt(n/r*100)}),b.jsxs("span",{className:"flex-shrink-0",children:[n," / ",r]})]}):b.jsx(Nb,{className:"w-12 h-12 animate-spin text-primary mx-auto"}),l=()=>{const c=typeof n=="number"&&r!=null&&n>=r,u=[];if(o&&u.push(b.jsxs("span",{children:[o," iter/s"]},"rate"),b.jsx("span",{children:"·"},"spacer-rate")),!c&&i&&u.push(b.jsxs("span",{children:["ETA ",Ixe(i)]},"eta"),b.jsx("span",{children:"·"},"spacer-eta")),c&&o){const f=n/o;u.push(b.jsxs("span",{children:["Total time ",Ixe(f)]},"completed"),b.jsx("span",{children:"·"},"spacer-completed"))}if(u.pop(),u.length>0)return b.jsx("div",{className:"flex gap-2 text-muted-foreground text-sm",children:u})};return b.jsxs("div",{className:`flex flex-col ${s} max-w-sm p-6 mx-auto`,children:[e&&b.jsx("div",{className:"text-lg font-bold text-foreground/60",children:Da({html:e})}),t&&b.jsx("div",{className:"text-sm text-muted-foreground",children:Da({html:t})}),b.jsxs("div",{className:"mt-2 w-full flex flex-col gap-1",children:[a(),l()]})]})};function YVt(e){return mae(e,0,100)}const GVt=HVt.humanizer({language:"shortEn",languages:{shortEn:{y:()=>"y",mo:()=>"mo",w:()=>"w",d:()=>"d",h:()=>"h",m:()=>"m",s:()=>"s",ms:()=>"ms"}}});function Ixe(e){return GVt(e*1e3,{language:"shortEn",largest:2,spacer:"",maxDecimalPoints:2})}function Xae(e){return!!e.or}function Zae(e){return!!e.and}function Yae(e){return!!e.not}function Z5(e,t){if(Yae(e))Z5(e.not,t);else if(Zae(e))for(const n of e.and)Z5(n,t);else if(Xae(e))for(const n of e.or)Z5(n,t);else t(e)}function kS(e,t){return Yae(e)?{not:kS(e.not,t)}:Zae(e)?{and:e.and.map(n=>kS(n,t))}:Xae(e)?{or:e.or.map(n=>kS(n,t))}:t(e)}const Xt=structuredClone;function mQe(e){throw new Error(e)}function TE(e,t){const n={};for(const r of t)Nt(e,r)&&(n[r]=e[r]);return n}function Gl(e,t){const n={...e};for(const r of t)delete n[r];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>Lr(e)).join(",")})`};function Nn(e){if(Hn(e))return e;const t=ut(e)?e:Lr(e);if(t.length<250)return t;let n=0;for(let r=0;r<t.length;r++){const i=t.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return n}function KG(e){return e===!1||e===null}function Pn(e,t){return e.includes(t)}function oO(e,t){let n=0;for(const[r,i]of e.entries())if(t(i,r,n++))return!0;return!1}function Gae(e,t){let n=0;for(const[r,i]of e.entries())if(!t(i,r,n++))return!1;return!0}function yQe(e,...t){for(const n of t)KVt(e,n??{});return e}function KVt(e,t){for(const n of He(t))c_(e,n,t[n],!0)}function Ah(e,t){const n=[],r={};let i;for(const o of e)i=t(o),!(i in r)&&(r[i]=1,n.push(o));return n}function JVt(e,t){const n=He(e),r=He(t);if(n.length!==r.length)return!1;for(const i of n)if(e[i]!==t[i])return!1;return!0}function vQe(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Kae(e,t){for(const n of e)if(t.has(n))return!0;return!1}function JG(e){const t=new Set;for(const n of e){const i=Sp(n).map((s,a)=>a===0?s:`[${s}]`),o=i.map((s,a)=>i.slice(0,a+1).join(""));for(const s of o)t.add(s)}return t}function Jae(e,t){return e===void 0||t===void 0?!0:Kae(JG(e),JG(t))}function Ir(e){return He(e).length===0}const He=Object.keys,Vs=Object.values,Q0=Object.entries;function LP(e){return e===!0||e===!1}function Si(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function BT(e,t){return Yae(e)?`!(${BT(e.not,t)})`:Zae(e)?`(${e.and.map(n=>BT(n,t)).join(") && (")})`:Xae(e)?`(${e.or.map(n=>BT(n,t)).join(") || (")})`:t(e)}function j3(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&j3(e[n],t)&&delete e[n],Ir(e)}function rD(e){return e.charAt(0).toUpperCase()+e.substr(1)}function ele(e,t="datum"){const n=Sp(e),r=[];for(let i=1;i<=n.length;i++){const o=`[${n.slice(0,i).map(Je).join("][")}]`;r.push(`${t}${o}`)}return r.join(" && ")}function bQe(e,t="datum"){return`${t}[${Je(Sp(e).join("."))}]`}function eUt(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function mf(e){return`${Sp(e).map(eUt).join("\\.")}`}function sO(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function tle(e){return`${Sp(e).join(".")}`}function PE(e){return e?Sp(e).length:0}function lo(...e){for(const t of e)if(t!==void 0)return t}let OQe=42;function xQe(e){const t=++OQe;return e?String(e)+t:t}function tUt(){OQe=42}function wQe(e){return SQe(e)?e:`__${e}`}function SQe(e){return e.startsWith("__")}function jP(e){if(e!==void 0)return(e%360+360)%360}function v8(e){return Hn(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const Lxe=Object.getPrototypeOf(structuredClone({}));function Wc(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Wc(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!Wc(r[1],t.get(r[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==Lxe.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==Lxe.toString)return e.toString()===t.toString();const i=Object.keys(e);if(n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!Wc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Lr(e){const t=[];return function n(r){if(r&&r.toJSON&&typeof r.toJSON=="function"&&(r=r.toJSON()),r===void 0)return;if(typeof r=="number")return isFinite(r)?""+r:"null";if(typeof r!="object")return JSON.stringify(r);let i,o;if(Array.isArray(r)){for(o="[",i=0;i<r.length;i++)i&&(o+=","),o+=n(r[i])||"null";return o+"]"}if(r===null)return"null";if(t.includes(r))throw new TypeError("Converting circular structure to JSON");const s=t.push(r)-1,a=Object.keys(r).sort();for(o="",i=0;i<a.length;i++){const l=a[i],c=n(r[l]);c&&(o&&(o+=","),o+=JSON.stringify(l)+":"+c)}return t.splice(s,1),`{${o}}`}(e)}const gr={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},EQe=gr.arc,b8=gr.area,O8=gr.bar,nUt=gr.image,x8=gr.line,w8=gr.point,rUt=gr.rect,F3=gr.rule,CQe=gr.text,nle=gr.tick,iUt=gr.trail,rle=gr.circle,ile=gr.square,_Qe=gr.geoshape;function kv(e){return["line","area","trail"].includes(e)}function FP(e){return["rect","bar","image","arc"].includes(e)}const oUt=new Set(He(gr));function ap(e){return e.type}const sUt=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],aUt=["fill","fillOpacity"],lUt=[...sUt,...aUt],cUt={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},jxe=He(cUt),uUt={area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],line:["point"],tick:["bandSize","thickness"]},fUt={color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},dUt={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},kQe=He(dUt);function aO(e){return e&&e.band!=null}const hUt={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},$Qe=5,pUt={binSpacing:1,continuousBandSize:$Qe,minBandSize:.25,timeUnitBandPosition:.5},gUt={binSpacing:0,continuousBandSize:$Qe,minBandSize:.25,timeUnitBandPosition:.5},mUt={thickness:1};function yUt(e){return ap(e)?e.type:e}const zP={getMarkType(e){const t=typeof e=="string"?e:e.type;if(t==="boxplot"||t==="errorband"||t==="errorbar")throw new Error("Not supported");return t},makeClickable(e){const t=typeof e=="string"?e:e.type;return t in gr?typeof e=="string"?{type:e,cursor:"pointer",tooltip:!0}:{...e,type:t,cursor:"pointer",tooltip:!0}:e},getOpacity(e){return typeof e=="string"?null:"opacity"in e&&typeof e.opacity=="number"?e.opacity:null}};function vUt(e){if(!e||!("encoding"in e))return[];const{encoding:t}=e;return t?Object.entries(t).flatMap(r=>{const[i,o]=r;return o?bUt.has(i)?"field"in o&&typeof o.field=="string"?[o.field]:"condition"in o&&o.condition&&typeof o.condition=="object"&&"field"in o.condition&&o.condition.field&&typeof o.condition.field=="string"?[o.condition.field]:[]:[]:[]}):[]}const bUt=new Set(["color","fill","fillOpacity","opacity","shape","size"]);function OUt(e,t,n,r){const i={and:n.map(o=>({param:o}))};switch(e){case"opacity":{const o=zP.getOpacity(r)||1;return{...t,opacity:{condition:{test:i,value:o},value:o/5}}}default:return t}}const RN={point(e){return e==null?"select_point":`select_point_${e}`},interval(e){return e==null?"select_interval":`select_interval_${e}`},legendSelection(e){return`legend_selection_${e}`},HIGHLIGHT:"highlight"},eK={highlight(){return{name:RN.HIGHLIGHT,select:{type:"point",on:"mouseover"}}},interval(e,t){return{name:RN.interval(t),select:{type:"interval",encodings:Fxe(e),mark:{fill:"#669EFF",fillOpacity:.07,stroke:"#669EFF",strokeOpacity:.4}}}},point(e,t){return{name:RN.point(t),select:{type:"point",encodings:Fxe(e)}}},legend(e){return{name:RN.legendSelection(e),select:{type:"point",fields:[e]},bind:"legend"}}};function Fxe(e){switch(zP.getMarkType(e.mark)){case gr.image:case gr.trail:return;case gr.area:case gr.arc:return["color"];case gr.bar:{const n=xUt(e);return n==="horizontal"?["y"]:n==="vertical"?["x"]:void 0}case gr.circle:case gr.geoshape:case gr.line:case gr.point:case gr.rect:case gr.rule:case gr.square:case gr.text:case gr.tick:return["x","y"]}}function TQe(e){return"params"in e&&e.params&&e.params.length>0?e.params.filter(n=>n==null?!1:"select"in n&&n.select!==void 0).map(n=>n.name):"layer"in e?oPt(e.layer.flatMap(TQe)):[]}function xUt(e){var r,i;if(!e||!("mark"in e))return;const t=(r=e.encoding)==null?void 0:r.x,n=(i=e.encoding)==null?void 0:i.y;if(t&&"type"in t&&t.type==="nominal")return"vertical";if(n&&"type"in n&&n.type==="nominal"||t&&"aggregate"in t)return"horizontal";if(n&&"aggregate"in n)return"vertical"}function wUt(e,t){const{chartSelection:n=!0,fieldSelection:r=!0}=t;if(!n&&!r)return e;if("vconcat"in e){const o=e.vconcat.map(s=>"mark"in s?DN(s):s);return{...e,vconcat:o}}if("hconcat"in e){const o=e.hconcat.map(s=>"mark"in s?DN(s):s);return{...e,hconcat:o}}if("layer"in e){const o=e.layer.map((s,a)=>{if(!("mark"in s))return s;let l=s;return l=zxe(l,n,a),l=DN(l),l});return{...e,layer:o}}if(!("mark"in e))return e;let i=e;return i=SUt(i,r),i=zxe(i,n,void 0),i=DN(i),i}function SUt(e,t){if(t===!1)return e;let n=vUt(e);Array.isArray(t)&&(n=n.filter(o=>t.includes(o)));const r=n.map(o=>eK.legend(o)),i=[...e.params||[],...r];return{...e,params:i}}function zxe(e,t,n){if(t===!1)return e;let r;try{r=zP.getMarkType(e.mark)}catch{return e}if(r==="text")return e;const i=t===!0?EUt(r):[t];if(!i)return e;const o=i.map(a=>a==="interval"?eK.interval(e,n):eK.point(e,n)),s=[...e.params||[],...o];return{...e,params:s}}function DN(e){const t="encoding"in e?e.encoding:void 0,n=e.params||[],r=n.map(o=>o.name);return n.length===0||zP.getMarkType(e.mark)==="text"?e:{...e,mark:zP.makeClickable(e.mark),encoding:OUt("opacity",t||{},r,e.mark)}}function EUt(e){switch(e){case"text":case"arc":case"area":return["point"];case"bar":return["point","interval"];case"line":return;default:return["point","interval"]}}var Qxe=Object.prototype.hasOwnProperty;function Bxe(e,t,n){for(n of e.keys())if($S(n,t))return n}function $S(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&$S(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i=="object"&&(i=Bxe(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i=="object"&&(i=Bxe(t,i),!i)||!$S(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Qxe.call(e,n)&&++r&&!Qxe.call(t,n)||!(n in t)||!$S(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function tK(e){const t=ie.useRef(e);return $S(e,t.current)||(t.current=e),t.current}function PQe(e){return e.startsWith("./")?new URL(e.slice(1),document.baseURI):e.startsWith("/")?new URL(e,document.baseURI):new URL(e,document.baseURI)}function CUt(e){return e.data&&"url"in e.data&&(e.data.url=PQe(e.data.url).href),e}async function _Ut(e){if(!e)return e;const t="datasets"in e?{...e.datasets}:{},n=async i=>{if(!i)return i;if("layer"in i){const a=await Promise.all(i.layer.map(n));i={...i,layer:a}}if("hconcat"in i){const a=await Promise.all(i.hconcat.map(n));i={...i,hconcat:a}}if("vconcat"in i){const a=await Promise.all(i.vconcat.map(n));i={...i,vconcat:a}}if(!i.data||!("url"in i.data))return i;let o;try{o=PQe(i.data.url)}catch{return i}const s=await Wae(o.href,i.data.format);return t[o.pathname]=s,{...i,data:{name:o.pathname}}},r=await n(e);return Object.keys(t).length===0?r:{...r,datasets:t}}class kUt{constructor(){ve(this,"tagName","marimo-vega");ve(this,"validator",Y.object({spec:Y.object({}).passthrough().transform(t=>t),chartSelection:Y.union([Y.boolean(),Y.literal("point"),Y.literal("interval")]).default(!0),fieldSelection:Y.union([Y.boolean(),Y.array(Y.string())]).default(!0)}))}render(t){return b.jsx($Ut,{value:t.value,setValue:t.setValue,...t.data})}}const $Ut=({value:e,setValue:t,chartSelection:n,fieldSelection:r,spec:i})=>{const{data:o}=zd(async()=>_Ut(i),[i]);return o?b.jsx(PUt,{value:e,setValue:t,chartSelection:n,fieldSelection:r,spec:o}):null},TUt=x.lazy(()=>Pe(()=>import("./index-cptemwP2.js"),__vite__mapDeps([]),import.meta.url).then(e=>({default:e.VegaLite}))),PUt=({value:e,setValue:t,chartSelection:n,fieldSelection:r,spec:i})=>{const{theme:o}=mp(),s=x.useRef(),[a,l]=x.useState(),c=x.useMemo(()=>wUt(CUt(i),{chartSelection:n,fieldSelection:r}),[tK(i),n,r]),u=x.useMemo(()=>TQe(c),[c]),f=Jn(g=>{t({...e,...g})}),d=x.useMemo(()=>u.reduce((g,v)=>(g[v]=Coe((y,O)=>{At.debug("[Vega signal]",y,O),f({[y]:pn.mapValues(O,RUt)})},100),g),{}),[tK(u),t]),h=Jn(g=>{At.error(g),At.debug(c),l(g)}),p=Jn(g=>{At.debug("[Vega view] created",g),s.current=g,l(void 0)});return b.jsxs(b.Fragment,{children:[a&&b.jsxs(pR,{variant:"destructive",children:[b.jsx(gR,{children:a.message}),b.jsx("div",{className:"text-md",children:a.stack})]}),b.jsx("div",{className:"contents",onPointerDown:tp.stopPropagation(),children:b.jsx(TUt,{spec:c,theme:o==="dark"?"dark":void 0,actions:AUt,signalListeners:d,onError:h,onNewView:p})})]})},AUt={source:!1,compiled:!1};function RUt(e){return e instanceof Set?[...e]:e}class DUt{constructor(){ve(this,"tagName","marimo-stat");ve(this,"validator",Y.object({value:Y.string(),label:Y.string().optional(),caption:Y.string().optional(),bordered:Y.boolean().default(!1),direction:Y.enum(["increase","decrease"]).optional()}))}render({data:t}){return b.jsx(MUt,{...t})}}const MUt=({value:e,label:t,caption:n,bordered:r,direction:i})=>b.jsxs("div",{className:be("text-card-foreground",r&&"rounded-xl border shadow bg-card"),children:[t&&b.jsx("div",{className:"p-6 flex flex-row items-center justify-between space-y-0 pb-2",children:b.jsx("h3",{className:"tracking-tight text-sm font-medium",children:t})}),b.jsxs("div",{className:"p-6 pt-0",children:[b.jsx("div",{className:"text-2xl font-bold",children:e}),n&&b.jsxs("p",{className:"pt-1 text-xs text-muted-foreground flex align-center",children:[i==="increase"&&b.jsx(Pve,{className:"w-4 h-4 mr-1 p-0.5",fill:"var(--grass-8)",stroke:"var(--grass-9)"}),i==="decrease"&&b.jsx(Pve,{className:"w-4 h-4 mr-1 p-0.5 transform rotate-180",fill:"var(--red-8)",stroke:"var(--red-9)"}),n]})]})]}),NUt=["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float128","complex64","complex128","complex256","bool","object","string_","unicode_","datetime64","timedelta64"],AQe=["count","sum","mean","median","min","max"],On={of(e){return JSON.stringify(e)},parse(e){if(!e)return{};try{return JSON.parse(e)}catch{return{label:e}}}};function ole(){return Math.floor(Math.random()*1e5)}const Qo={number:Y.coerce.number().describe(On.of({label:"Value"})),string:Y.string().min(1).describe(On.of({label:"Value"})),stringColumnValues:Y.string().min(1).describe(On.of({label:"Value",special:"column_values"})),stringMultiColumnValues:Y.array(Y.string()).min(1).describe(On.of({label:"Value",special:"column_values"})),date:Y.coerce.date().describe(On.of({label:"Value"}))},S8={is_true:[],is_false:[]},E8={"==":[Qo.number],"!=":[Qo.number],">":[Qo.number],">=":[Qo.number],"<":[Qo.number],"<=":[Qo.number],is_nan:[],is_not_nan:[]},C8={"==":[Qo.date],"!=":[Qo.date],">":[Qo.date],">=":[Qo.date],"<":[Qo.date],"<=":[Qo.date],is_nan:[],is_not_nan:[]},_8={equals:[Qo.stringColumnValues],does_not_equal:[Qo.stringColumnValues],contains:[Qo.string],regex:[Qo.string],starts_with:[Qo.string],ends_with:[Qo.string],in:[Qo.stringMultiColumnValues]},IUt={...S8,...E8,...C8,..._8};function Wxe(e){return e?e==="bool"?Object.keys(S8):e.startsWith("int")||e.startsWith("float")?Object.keys(E8):e==="datetime64[ns]"?Object.keys(C8):e==="object"||e==="string"?Object.keys(_8):[]:[]}function LUt(e,t){return!e||!t?[]:e==="bool"?Ty(S8,t):e.startsWith("int")||e.startsWith("float")?Ty(E8,t):e==="datetime64[ns]"?Ty(C8,t):e==="object"||e==="string"?Ty(_8,t):[]}function jUt(e,t){const n=[Ty(S8,e),Ty(C8,e),Ty(E8,e),Ty(_8,e)].flat();return n.length===0?!0:n.some(r=>r.safeParse(t).success)}const Ty=(e,t)=>e[t]?e[t]:[],iD=Y.string().min(1,"Required").describe(On.of({label:"Column",special:"column_id"})),sle=Y.array(iD.describe(On.of({special:"column_id"}))).min(1,"At least one column is required").default([]).describe(On.of({label:"Columns"})),FUt=Y.object({type:Y.literal("column_conversion"),column_id:iD,data_type:Y.enum(NUt).describe(On.of({label:"Data type (numpy)"})).default("bool"),errors:Y.enum(["ignore","raise"]).default("ignore").describe(On.of({label:"Handle errors",special:"radio_group"}))}).describe(On.of({})),zUt=Y.object({type:Y.literal("rename_column"),column_id:iD,new_column_id:Y.string().min(1,"Required").describe(On.of({label:"New column name"}))}),QUt=Y.object({type:Y.literal("sort_column"),column_id:iD,ascending:Y.boolean().describe(On.of({label:"Ascending"})).default(!0),na_position:Y.enum(["first","last"]).describe(On.of({label:"N/A position",special:"radio_group"})).default("last")}),BUt=Y.object({column_id:iD,operator:Y.enum(Object.keys(IUt)).describe(On.of({label:" "})),value:Y.any().describe(On.of({label:"Value"}))}).describe(On.of({direction:"row",special:"column_filter"})),WUt=Y.object({type:Y.literal("filter_rows"),operation:Y.enum(["keep_rows","remove_rows"]).default("keep_rows").describe(On.of({special:"radio_group"})),where:Y.array(BUt).min(1).transform(e=>e.filter(t=>jUt(t.operator,t.value))).describe(On.of({label:"Value"})).default([{column_id:"",operator:"==",value:""}])}),qUt=Y.object({type:Y.literal("group_by"),column_ids:sle,aggregation:Y.enum(AQe).default("count").describe(On.of({label:"Aggregation"})),drop_na:Y.boolean().default(!1).describe(On.of({label:"Drop N/A"}))}).describe(On.of({})),VUt=Y.object({type:Y.literal("aggregate"),column_ids:sle,aggregations:Y.array(Y.enum(AQe)).min(1,"At least one aggregation is required").default(["count"]).describe(On.of({label:"Aggregations"}))}).describe(On.of({direction:"row"})),UUt=Y.object({type:Y.literal("select_columns"),column_ids:sle}),HUt=Y.object({type:Y.literal("sample_rows"),n:Y.number().positive().describe(On.of({label:"Number of rows"})),seed:Y.number().default(()=>ole()).describe(On.of({label:"Re-sample",special:"random_number_button"})),replace:Y.boolean().default(!1).describe(On.of({label:"Sample with replacement"}))}),XUt=Y.object({type:Y.literal("shuffle_rows"),seed:Y.number().default(()=>ole()).describe(On.of({label:"Re-shuffle",special:"random_number_button"}))}),ale=Y.union([WUt,UUt,zUt,FUt,QUt,qUt,VUt,HUt,XUt]),ZUt=Y.object({transforms:Y.array(ale)});var oD=e=>e.type==="checkbox",qw=e=>e instanceof Date,el=e=>e==null;const RQe=e=>typeof e=="object";var Yo=e=>!el(e)&&!Array.isArray(e)&&RQe(e)&&!qw(e),DQe=e=>Yo(e)&&e.target?oD(e.target)?e.target.checked:e.target.value:e,YUt=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,MQe=(e,t)=>e.has(YUt(t)),GUt=e=>{const t=e.constructor&&e.constructor.prototype;return Yo(t)&&t.hasOwnProperty("isPrototypeOf")},lle=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Lo(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(lle&&(e instanceof Blob||e instanceof FileList))&&(n||Yo(e)))if(t=n?[]:{},!n&&!GUt(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Lo(e[r]));else return e;return t}var m_=e=>Array.isArray(e)?e.filter(Boolean):[],Gr=e=>e===void 0,ot=(e,t,n)=>{if(!t||!Yo(e))return n;const r=m_(t.split(/[,[\].]+?/)).reduce((i,o)=>el(i)?i:i[o],e);return Gr(r)||r===e?Gr(e[t])?n:e[t]:r},Zf=e=>typeof e=="boolean";const z3={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ju={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Bp={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},NQe=ie.createContext(null),sD=()=>ie.useContext(NQe),IQe=e=>{const{children:t,...n}=e;return ie.createElement(NQe.Provider,{value:n},t)};var LQe=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const s=o;return t._proxyFormState[s]!==ju.all&&(t._proxyFormState[s]=!r||ju.all),n&&(n[s]=!0),e[s]}});return i},Tc=e=>Yo(e)&&!Object.keys(e).length,jQe=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return Tc(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(s=>t[s]===(!r||ju.all))},qc=e=>Array.isArray(e)?e:[e],FQe=(e,t,n)=>!e||!t||e===t||qc(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function k8(e){const t=ie.useRef(e);t.current=e,ie.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function KUt(e){const t=sD(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[s,a]=ie.useState(n._formState),l=ie.useRef(!0),c=ie.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=ie.useRef(i);return u.current=i,k8({disabled:r,next:f=>l.current&&FQe(u.current,f.name,o)&&jQe(f,c.current,n._updateFormState)&&a({...n._formState,...f}),subject:n._subjects.state}),ie.useEffect(()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),LQe(s,n,c.current,!1)}var Rh=e=>typeof e=="string",zQe=(e,t,n,r,i)=>Rh(e)?(r&&t.watch.add(e),ot(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),ot(n,o))):(r&&(t.watchAll=!0),n);function JUt(e){const t=sD(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:s}=e||{},a=ie.useRef(r);a.current=r,k8({disabled:o,subject:n._subjects.values,next:u=>{FQe(a.current,u.name,s)&&c(Lo(zQe(a.current,n._names,u.values||n._formValues,!1,i)))}});const[l,c]=ie.useState(n._getWatch(r,i));return ie.useEffect(()=>n._removeUnmounted()),l}var cle=e=>/^\w*$/.test(e),QQe=e=>m_(e.replace(/["|']|\]/g,"").split(/\.|\[/)),pr=(e,t,n)=>{let r=-1;const i=cle(t)?[t]:QQe(t),o=i.length,s=o-1;for(;++r<o;){const a=i[r];let l=n;if(r!==s){const c=e[a];l=Yo(c)||Array.isArray(c)?c:isNaN(+i[r+1])?{}:[]}e[a]=l,e=e[a]}return e};function BQe(e){const t=sD(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o}=e,s=MQe(i._names.array,n),a=JUt({control:i,name:n,defaultValue:ot(i._formValues,n,ot(i._defaultValues,n,e.defaultValue)),exact:!0}),l=KUt({control:i,name:n}),c=ie.useRef(i.register(n,{...e.rules,value:a,...Zf(e.disabled)?{disabled:e.disabled}:{}}));return ie.useEffect(()=>{const u=i._options.shouldUnregister||o,f=(d,h)=>{const p=ot(i._fields,d);p&&(p._f.mount=h)};if(f(n,!0),u){const d=Lo(ot(i._options.defaultValues,n));pr(i._defaultValues,n,d),Gr(ot(i._formValues,n))&&pr(i._formValues,n,d)}return()=>{(s?u&&!i._state.action:u)?i.unregister(n):f(n,!1)}},[n,i,s,o]),ie.useEffect(()=>{ot(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:ot(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:a,...Zf(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:ie.useCallback(u=>c.current.onChange({target:{value:DQe(u),name:n},type:z3.CHANGE}),[n]),onBlur:ie.useCallback(()=>c.current.onBlur({target:{value:ot(i._formValues,n),name:n},type:z3.BLUR}),[n,i]),ref:u=>{const f=ot(i._fields,n);f&&u&&(f._f.ref={focus:()=>u.focus(),select:()=>u.select(),setCustomValidity:d=>u.setCustomValidity(d),reportValidity:()=>u.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ot(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!ot(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ot(l.touchedFields,n)},error:{enumerable:!0,get:()=>ot(l.errors,n)}})}}const eHt=e=>e.render(BQe(e));var WQe=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Lm=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},pV=(e,t,n={})=>n.shouldFocus||Gr(n.shouldFocus)?n.focusName||`${e}.${Gr(n.focusIndex)?t:n.focusIndex}.`:"",WT=e=>({isOnSubmit:!e||e===ju.onSubmit,isOnBlur:e===ju.onBlur,isOnChange:e===ju.onChange,isOnAll:e===ju.all,isOnTouch:e===ju.onTouched}),nK=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const TS=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=ot(e,i);if(o){const{_f:s,...a}=o;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],i)&&!r)break;if(s.ref&&t(s.ref,s.name)&&!r)break;TS(a,t)}else Yo(a)&&TS(a,t)}}};var qQe=(e,t,n)=>{const r=m_(ot(e,n));return pr(r,"root",t[n]),pr(e,n,r),e},ule=e=>e.type==="file",Py=e=>typeof e=="function",Q3=e=>{if(!lle)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Y5=e=>Rh(e),fle=e=>e.type==="radio",B3=e=>e instanceof RegExp;const qxe={value:!1,isValid:!1},Vxe={value:!0,isValid:!0};var VQe=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Gr(e[0].attributes.value)?Gr(e[0].value)||e[0].value===""?Vxe:{value:e[0].value,isValid:!0}:Vxe:qxe}return qxe};const Uxe={isValid:!1,value:null};var UQe=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Uxe):Uxe;function Hxe(e,t,n="validate"){if(Y5(e)||Array.isArray(e)&&e.every(Y5)||Zf(e)&&!e)return{type:n,message:Y5(e)?e:"",ref:t}}var zx=e=>Yo(e)&&!B3(e)?e:{value:e,message:""},rK=async(e,t,n,r,i)=>{const{ref:o,refs:s,required:a,maxLength:l,minLength:c,min:u,max:f,pattern:d,validate:h,name:p,valueAsNumber:g,mount:v,disabled:y}=e._f,O=ot(t,p);if(!v||y)return{};const m=s?s[0]:o,w=L=>{r&&m.reportValidity&&(m.setCustomValidity(Zf(L)?"":L||""),m.reportValidity())},S={},E=fle(o),C=oD(o),k=E||C,P=(g||ule(o))&&Gr(o.value)&&Gr(O)||Q3(o)&&o.value===""||O===""||Array.isArray(O)&&!O.length,D=WQe.bind(null,p,n,S),M=(L,A,T,N=Bp.maxLength,j=Bp.minLength)=>{const z=L?A:T;S[p]={type:L?N:j,message:z,ref:o,...D(L?N:j,z)}};if(i?!Array.isArray(O)||!O.length:a&&(!k&&(P||el(O))||Zf(O)&&!O||C&&!VQe(s).isValid||E&&!UQe(s).isValid)){const{value:L,message:A}=Y5(a)?{value:!!a,message:a}:zx(a);if(L&&(S[p]={type:Bp.required,message:A,ref:m,...D(Bp.required,A)},!n))return w(A),S}if(!P&&(!el(u)||!el(f))){let L,A;const T=zx(f),N=zx(u);if(!el(O)&&!isNaN(O)){const j=o.valueAsNumber||O&&+O;el(T.value)||(L=j>T.value),el(N.value)||(A=j<N.value)}else{const j=o.valueAsDate||new Date(O),z=q=>new Date(new Date().toDateString()+" "+q),W=o.type=="time",F=o.type=="week";Rh(T.value)&&O&&(L=W?z(O)>z(T.value):F?O>T.value:j>new Date(T.value)),Rh(N.value)&&O&&(A=W?z(O)<z(N.value):F?O<N.value:j<new Date(N.value))}if((L||A)&&(M(!!L,T.message,N.message,Bp.max,Bp.min),!n))return w(S[p].message),S}if((l||c)&&!P&&(Rh(O)||i&&Array.isArray(O))){const L=zx(l),A=zx(c),T=!el(L.value)&&O.length>+L.value,N=!el(A.value)&&O.length<+A.value;if((T||N)&&(M(T,L.message,A.message),!n))return w(S[p].message),S}if(d&&!P&&Rh(O)){const{value:L,message:A}=zx(d);if(B3(L)&&!O.match(L)&&(S[p]={type:Bp.pattern,message:A,ref:o,...D(Bp.pattern,A)},!n))return w(A),S}if(h){if(Py(h)){const L=await h(O,t),A=Hxe(L,m);if(A&&(S[p]={...A,...D(Bp.validate,A.message)},!n))return w(A.message),S}else if(Yo(h)){let L={};for(const A in h){if(!Tc(L)&&!n)break;const T=Hxe(await h[A](O,t),m,A);T&&(L={...T,...D(A,T.message)},w(T.message),n&&(S[p]=L))}if(!Tc(L)&&(S[p]={ref:m,...L},!n))return S}}return w(!0),S},gV=(e,t)=>[...e,...qc(t)],mV=e=>Array.isArray(e)?e.map(()=>{}):void 0;function yV(e,t,n){return[...e.slice(0,t),...qc(n),...e.slice(t)]}var vV=(e,t,n)=>Array.isArray(e)?(Gr(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],bV=(e,t)=>[...qc(t),...qc(e)];function tHt(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return m_(r).length?r:[]}var OV=(e,t)=>Gr(t)?[]:tHt(e,qc(t).sort((n,r)=>n-r)),xV=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function nHt(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Gr(e)?r++:e[t[r++]];return e}function rHt(e){for(const t in e)if(e.hasOwnProperty(t)&&!Gr(e[t]))return!1;return!0}function ts(e,t){const n=Array.isArray(t)?t:cle(t)?[t]:QQe(t),r=n.length===1?e:nHt(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(Yo(r)&&Tc(r)||Array.isArray(r)&&rHt(r))&&ts(e,n.slice(0,-1)),e}var Xxe=(e,t,n)=>(e[t]=n,e);function HQe(e){const t=sD(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o}=e,[s,a]=ie.useState(n._getFieldArray(r)),l=ie.useRef(n._getFieldArray(r).map(Lm)),c=ie.useRef(s),u=ie.useRef(r),f=ie.useRef(!1);u.current=r,c.current=s,n._names.array.add(r),e.rules&&n.register(r,e.rules),k8({next:({values:S,name:E})=>{if(E===u.current||!E){const C=ot(S,u.current);Array.isArray(C)&&(a(C),l.current=C.map(Lm))}},subject:n._subjects.array});const d=ie.useCallback(S=>{f.current=!0,n._updateFieldArray(r,S)},[n,r]),h=(S,E)=>{const C=qc(Lo(S)),k=gV(n._getFieldArray(r),C);n._names.focus=pV(r,k.length-1,E),l.current=gV(l.current,C.map(Lm)),d(k),a(k),n._updateFieldArray(r,k,gV,{argA:mV(S)})},p=(S,E)=>{const C=qc(Lo(S)),k=bV(n._getFieldArray(r),C);n._names.focus=pV(r,0,E),l.current=bV(l.current,C.map(Lm)),d(k),a(k),n._updateFieldArray(r,k,bV,{argA:mV(S)})},g=S=>{const E=OV(n._getFieldArray(r),S);l.current=OV(l.current,S),d(E),a(E),n._updateFieldArray(r,E,OV,{argA:S})},v=(S,E,C)=>{const k=qc(Lo(E)),P=yV(n._getFieldArray(r),S,k);n._names.focus=pV(r,S,C),l.current=yV(l.current,S,k.map(Lm)),d(P),a(P),n._updateFieldArray(r,P,yV,{argA:S,argB:mV(E)})},y=(S,E)=>{const C=n._getFieldArray(r);xV(C,S,E),xV(l.current,S,E),d(C),a(C),n._updateFieldArray(r,C,xV,{argA:S,argB:E},!1)},O=(S,E)=>{const C=n._getFieldArray(r);vV(C,S,E),vV(l.current,S,E),d(C),a(C),n._updateFieldArray(r,C,vV,{argA:S,argB:E},!1)},m=(S,E)=>{const C=Lo(E),k=Xxe(n._getFieldArray(r),S,C);l.current=[...k].map((P,D)=>!P||D===S?Lm():l.current[D]),d(k),a([...k]),n._updateFieldArray(r,k,Xxe,{argA:S,argB:C},!0,!1)},w=S=>{const E=qc(Lo(S));l.current=E.map(Lm),d([...E]),a([...E]),n._updateFieldArray(r,[...E],C=>C,{},!0,!1)};return ie.useEffect(()=>{if(n._state.action=!1,nK(r,n._names)&&n._subjects.state.next({...n._formState}),f.current&&(!WT(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(S=>{const E=ot(S.errors,r),C=ot(n._formState.errors,r);(C?!E&&C.type||E&&(C.type!==E.type||C.message!==E.message):E&&E.type)&&(E?pr(n._formState.errors,r,E):ts(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const S=ot(n._fields,r);S&&S._f&&!(WT(n._options.reValidateMode).isOnSubmit&&WT(n._options.mode).isOnSubmit)&&rK(S,n._formValues,n._options.criteriaMode===ju.all,n._options.shouldUseNativeValidation,!0).then(E=>!Tc(E)&&n._subjects.state.next({errors:qQe(n._formState.errors,E,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&TS(n._fields,(S,E)=>{if(n._names.focus&&E.startsWith(n._names.focus)&&S.focus)return S.focus(),1}),n._names.focus="",n._updateValid(),f.current=!1},[s,r,n]),ie.useEffect(()=>(!ot(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||o)&&n.unregister(r)}),[r,n,i,o]),{swap:ie.useCallback(y,[d,r,n]),move:ie.useCallback(O,[d,r,n]),prepend:ie.useCallback(p,[d,r,n]),append:ie.useCallback(h,[d,r,n]),remove:ie.useCallback(g,[d,r,n]),insert:ie.useCallback(v,[d,r,n]),update:ie.useCallback(m,[d,r,n]),replace:ie.useCallback(w,[d,r,n]),fields:ie.useMemo(()=>s.map((S,E)=>({...S,[i]:l.current[E]||Lm()})),[s,i])}}var wV=()=>{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}},W3=e=>el(e)||!RQe(e);function j1(e,t){if(W3(e)||W3(t))return e===t;if(qw(e)&&qw(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const o=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const s=t[i];if(qw(o)&&qw(s)||Yo(o)&&Yo(s)||Array.isArray(o)&&Array.isArray(s)?!j1(o,s):o!==s)return!1}}return!0}var XQe=e=>e.type==="select-multiple",iHt=e=>fle(e)||oD(e),SV=e=>Q3(e)&&e.isConnected,ZQe=e=>{for(const t in e)if(Py(e[t]))return!0;return!1};function q3(e,t={}){const n=Array.isArray(e);if(Yo(e)||n)for(const r in e)Array.isArray(e[r])||Yo(e[r])&&!ZQe(e[r])?(t[r]=Array.isArray(e[r])?[]:{},q3(e[r],t[r])):el(e[r])||(t[r]=!0);return t}function YQe(e,t,n){const r=Array.isArray(e);if(Yo(e)||r)for(const i in e)Array.isArray(e[i])||Yo(e[i])&&!ZQe(e[i])?Gr(t)||W3(n[i])?n[i]=Array.isArray(e[i])?q3(e[i],[]):{...q3(e[i])}:YQe(e[i],el(t)?{}:t[i],n[i]):n[i]=!j1(e[i],t[i]);return n}var MN=(e,t)=>YQe(e,t,q3(t)),GQe=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Gr(e)?e:t?e===""?NaN:e&&+e:n&&Rh(e)?new Date(e):r?r(e):e;function EV(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return ule(t)?t.files:fle(t)?UQe(e.refs).value:XQe(t)?[...t.selectedOptions].map(({value:n})=>n):oD(t)?VQe(e.refs).value:GQe(Gr(t.value)?e.ref.value:t.value,e)}var oHt=(e,t,n,r)=>{const i={};for(const o of e){const s=ot(t,o);s&&pr(i,o,s._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Tk=e=>Gr(e)?e:B3(e)?e.source:Yo(e)?B3(e.value)?e.value.source:e.value:e,sHt=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Zxe(e,t,n){const r=ot(e,n);if(r||cle(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),s=ot(t,o),a=ot(e,o);if(s&&!Array.isArray(s)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};i.pop()}return{name:n}}var aHt=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,lHt=(e,t)=>!m_(ot(e,t)).length&&ts(e,t);const cHt={mode:ju.onSubmit,reValidateMode:ju.onChange,shouldFocusError:!0};function uHt(e={},t){let n={...cHt,...e},r={submitCount:0,isDirty:!1,isLoading:Py(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:n.errors||{},disabled:n.disabled||!1},i={},o=Yo(n.values)||Yo(n.defaultValues)?Lo(n.values||n.defaultValues)||{}:{},s=n.shouldUnregister?{}:Lo(o),a={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const f={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:wV(),array:wV(),state:wV()},h=WT(n.mode),p=WT(n.reValidateMode),g=n.criteriaMode===ju.all,v=G=>le=>{clearTimeout(u),u=setTimeout(G,le)},y=async G=>{if(f.isValid||G){const le=n.resolver?Tc((await P()).errors):await M(i,!0);le!==r.isValid&&d.state.next({isValid:le})}},O=G=>f.isValidating&&d.state.next({isValidating:G}),m=(G,le=[],Oe,Ue,Fe=!0,ye=!0)=>{if(Ue&&Oe){if(a.action=!0,ye&&Array.isArray(ot(i,G))){const Me=Oe(ot(i,G),Ue.argA,Ue.argB);Fe&&pr(i,G,Me)}if(ye&&Array.isArray(ot(r.errors,G))){const Me=Oe(ot(r.errors,G),Ue.argA,Ue.argB);Fe&&pr(r.errors,G,Me),lHt(r.errors,G)}if(f.touchedFields&&ye&&Array.isArray(ot(r.touchedFields,G))){const Me=Oe(ot(r.touchedFields,G),Ue.argA,Ue.argB);Fe&&pr(r.touchedFields,G,Me)}f.dirtyFields&&(r.dirtyFields=MN(o,s)),d.state.next({name:G,isDirty:A(G,le),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else pr(s,G,le)},w=(G,le)=>{pr(r.errors,G,le),d.state.next({errors:r.errors})},S=G=>{r.errors=G,d.state.next({errors:r.errors,isValid:!1})},E=(G,le,Oe,Ue)=>{const Fe=ot(i,G);if(Fe){const ye=ot(s,G,Gr(Oe)?ot(o,G):Oe);Gr(ye)||Ue&&Ue.defaultChecked||le?pr(s,G,le?ye:EV(Fe._f)):j(G,ye),a.mount&&y()}},C=(G,le,Oe,Ue,Fe)=>{let ye=!1,Me=!1;const pt={name:G},at=!!(ot(i,G)&&ot(i,G)._f.disabled);if(!Oe||Ue){f.isDirty&&(Me=r.isDirty,r.isDirty=pt.isDirty=A(),ye=Me!==pt.isDirty);const ht=at||j1(ot(o,G),le);Me=!!(!at&&ot(r.dirtyFields,G)),ht||at?ts(r.dirtyFields,G):pr(r.dirtyFields,G,!0),pt.dirtyFields=r.dirtyFields,ye=ye||f.dirtyFields&&Me!==!ht}if(Oe){const ht=ot(r.touchedFields,G);ht||(pr(r.touchedFields,G,Oe),pt.touchedFields=r.touchedFields,ye=ye||f.touchedFields&&ht!==Oe)}return ye&&Fe&&d.state.next(pt),ye?pt:{}},k=(G,le,Oe,Ue)=>{const Fe=ot(r.errors,G),ye=f.isValid&&Zf(le)&&r.isValid!==le;if(e.delayError&&Oe?(c=v(()=>w(G,Oe)),c(e.delayError)):(clearTimeout(u),c=null,Oe?pr(r.errors,G,Oe):ts(r.errors,G)),(Oe?!j1(Fe,Oe):Fe)||!Tc(Ue)||ye){const Me={...Ue,...ye&&Zf(le)?{isValid:le}:{},errors:r.errors,name:G};r={...r,...Me},d.state.next(Me)}O(!1)},P=async G=>n.resolver(s,n.context,oHt(G||l.mount,i,n.criteriaMode,n.shouldUseNativeValidation)),D=async G=>{const{errors:le}=await P(G);if(G)for(const Oe of G){const Ue=ot(le,Oe);Ue?pr(r.errors,Oe,Ue):ts(r.errors,Oe)}else r.errors=le;return le},M=async(G,le,Oe={valid:!0})=>{for(const Ue in G){const Fe=G[Ue];if(Fe){const{_f:ye,...Me}=Fe;if(ye){const pt=l.array.has(ye.name),at=await rK(Fe,s,g,n.shouldUseNativeValidation&&!le,pt);if(at[ye.name]&&(Oe.valid=!1,le))break;!le&&(ot(at,ye.name)?pt?qQe(r.errors,at,ye.name):pr(r.errors,ye.name,at[ye.name]):ts(r.errors,ye.name))}Me&&await M(Me,le,Oe)}}return Oe.valid},L=()=>{for(const G of l.unMount){const le=ot(i,G);le&&(le._f.refs?le._f.refs.every(Oe=>!SV(Oe)):!SV(le._f.ref))&&fe(G)}l.unMount=new Set},A=(G,le)=>(G&&le&&pr(s,G,le),!j1(V(),o)),T=(G,le,Oe)=>zQe(G,l,{...a.mount?s:Gr(le)?o:Rh(G)?{[G]:le}:le},Oe,le),N=G=>m_(ot(a.mount?s:o,G,e.shouldUnregister?ot(o,G,[]):[])),j=(G,le,Oe={})=>{const Ue=ot(i,G);let Fe=le;if(Ue){const ye=Ue._f;ye&&(!ye.disabled&&pr(s,G,GQe(le,ye)),Fe=Q3(ye.ref)&&el(le)?"":le,XQe(ye.ref)?[...ye.ref.options].forEach(Me=>Me.selected=Fe.includes(Me.value)):ye.refs?oD(ye.ref)?ye.refs.length>1?ye.refs.forEach(Me=>(!Me.defaultChecked||!Me.disabled)&&(Me.checked=Array.isArray(Fe)?!!Fe.find(pt=>pt===Me.value):Fe===Me.value)):ye.refs[0]&&(ye.refs[0].checked=!!Fe):ye.refs.forEach(Me=>Me.checked=Me.value===Fe):ule(ye.ref)?ye.ref.value="":(ye.ref.value=Fe,ye.ref.type||d.values.next({name:G,values:{...s}})))}(Oe.shouldDirty||Oe.shouldTouch)&&C(G,Fe,Oe.shouldTouch,Oe.shouldDirty,!0),Oe.shouldValidate&&U(G)},z=(G,le,Oe)=>{for(const Ue in le){const Fe=le[Ue],ye=`${G}.${Ue}`,Me=ot(i,ye);(l.array.has(G)||!W3(Fe)||Me&&!Me._f)&&!qw(Fe)?z(ye,Fe,Oe):j(ye,Fe,Oe)}},W=(G,le,Oe={})=>{const Ue=ot(i,G),Fe=l.array.has(G),ye=Lo(le);pr(s,G,ye),Fe?(d.array.next({name:G,values:{...s}}),(f.isDirty||f.dirtyFields)&&Oe.shouldDirty&&d.state.next({name:G,dirtyFields:MN(o,s),isDirty:A(G,ye)})):Ue&&!Ue._f&&!el(ye)?z(G,ye,Oe):j(G,ye,Oe),nK(G,l)&&d.state.next({...r}),d.values.next({name:G,values:{...s}}),!a.mount&&t()},F=async G=>{const le=G.target;let Oe=le.name,Ue=!0;const Fe=ot(i,Oe),ye=()=>le.type?EV(Fe._f):DQe(G),Me=pt=>{Ue=Number.isNaN(pt)||pt===ot(s,Oe,pt)};if(Fe){let pt,at;const ht=ye(),_t=G.type===z3.BLUR||G.type===z3.FOCUS_OUT,yn=!sHt(Fe._f)&&!n.resolver&&!ot(r.errors,Oe)&&!Fe._f.deps||aHt(_t,ot(r.touchedFields,Oe),r.isSubmitted,p,h),_n=nK(Oe,l,_t);pr(s,Oe,ht),_t?(Fe._f.onBlur&&Fe._f.onBlur(G),c&&c(0)):Fe._f.onChange&&Fe._f.onChange(G);const ri=C(Oe,ht,_t,!1),hi=!Tc(ri)||_n;if(!_t&&d.values.next({name:Oe,type:G.type,values:{...s}}),yn)return f.isValid&&y(),hi&&d.state.next({name:Oe,..._n?{}:ri});if(!_t&&_n&&d.state.next({...r}),O(!0),n.resolver){const{errors:Qt}=await P([Oe]);if(Me(ht),Ue){const An=Zxe(r.errors,i,Oe),Ht=Zxe(Qt,i,An.name||Oe);pt=Ht.error,Oe=Ht.name,at=Tc(Qt)}}else pt=(await rK(Fe,s,g,n.shouldUseNativeValidation))[Oe],Me(ht),Ue&&(pt?at=!1:f.isValid&&(at=await M(i,!0)));Ue&&(Fe._f.deps&&U(Fe._f.deps),k(Oe,at,pt,ri))}},q=(G,le)=>{if(ot(r.errors,le)&&G.focus)return G.focus(),1},U=async(G,le={})=>{let Oe,Ue;const Fe=qc(G);if(O(!0),n.resolver){const ye=await D(Gr(G)?G:Fe);Oe=Tc(ye),Ue=G?!Fe.some(Me=>ot(ye,Me)):Oe}else G?(Ue=(await Promise.all(Fe.map(async ye=>{const Me=ot(i,ye);return await M(Me&&Me._f?{[ye]:Me}:Me)}))).every(Boolean),!(!Ue&&!r.isValid)&&y()):Ue=Oe=await M(i);return d.state.next({...!Rh(G)||f.isValid&&Oe!==r.isValid?{}:{name:G},...n.resolver||!G?{isValid:Oe}:{},errors:r.errors,isValidating:!1}),le.shouldFocus&&!Ue&&TS(i,q,G?Fe:l.mount),Ue},V=G=>{const le={...o,...a.mount?s:{}};return Gr(G)?le:Rh(G)?ot(le,G):G.map(Oe=>ot(le,Oe))},H=(G,le)=>({invalid:!!ot((le||r).errors,G),isDirty:!!ot((le||r).dirtyFields,G),isTouched:!!ot((le||r).touchedFields,G),error:ot((le||r).errors,G)}),Z=G=>{G&&qc(G).forEach(le=>ts(r.errors,le)),d.state.next({errors:G?r.errors:{}})},ee=(G,le,Oe)=>{const Ue=(ot(i,G,{_f:{}})._f||{}).ref;pr(r.errors,G,{...le,ref:Ue}),d.state.next({name:G,errors:r.errors,isValid:!1}),Oe&&Oe.shouldFocus&&Ue&&Ue.focus&&Ue.focus()},se=(G,le)=>Py(G)?d.values.subscribe({next:Oe=>G(T(void 0,le),Oe)}):T(G,le,!0),fe=(G,le={})=>{for(const Oe of G?qc(G):l.mount)l.mount.delete(Oe),l.array.delete(Oe),le.keepValue||(ts(i,Oe),ts(s,Oe)),!le.keepError&&ts(r.errors,Oe),!le.keepDirty&&ts(r.dirtyFields,Oe),!le.keepTouched&&ts(r.touchedFields,Oe),!n.shouldUnregister&&!le.keepDefaultValue&&ts(o,Oe);d.values.next({values:{...s}}),d.state.next({...r,...le.keepDirty?{isDirty:A()}:{}}),!le.keepIsValid&&y()},ce=({disabled:G,name:le,field:Oe,fields:Ue,value:Fe})=>{if(Zf(G)){const ye=G?void 0:Gr(Fe)?EV(Oe?Oe._f:ot(Ue,le)._f):Fe;pr(s,le,ye),C(le,ye,!1,!1,!0)}},ae=(G,le={})=>{let Oe=ot(i,G);const Ue=Zf(le.disabled);return pr(i,G,{...Oe||{},_f:{...Oe&&Oe._f?Oe._f:{ref:{name:G}},name:G,mount:!0,...le}}),l.mount.add(G),Oe?ce({field:Oe,disabled:le.disabled,name:G,value:le.value}):E(G,!0,le.value),{...Ue?{disabled:le.disabled}:{},...n.progressive?{required:!!le.required,min:Tk(le.min),max:Tk(le.max),minLength:Tk(le.minLength),maxLength:Tk(le.maxLength),pattern:Tk(le.pattern)}:{},name:G,onChange:F,onBlur:F,ref:Fe=>{if(Fe){ae(G,le),Oe=ot(i,G);const ye=Gr(Fe.value)&&Fe.querySelectorAll&&Fe.querySelectorAll("input,select,textarea")[0]||Fe,Me=iHt(ye),pt=Oe._f.refs||[];if(Me?pt.find(at=>at===ye):ye===Oe._f.ref)return;pr(i,G,{_f:{...Oe._f,...Me?{refs:[...pt.filter(SV),ye,...Array.isArray(ot(o,G))?[{}]:[]],ref:{type:ye.type,name:G}}:{ref:ye}}}),E(G,!1,void 0,ye)}else Oe=ot(i,G,{}),Oe._f&&(Oe._f.mount=!1),(n.shouldUnregister||le.shouldUnregister)&&!(MQe(l.array,G)&&a.action)&&l.unMount.add(G)}}},de=()=>n.shouldFocusError&&TS(i,q,l.mount),me=G=>{Zf(G)&&(d.state.next({disabled:G}),TS(i,(le,Oe)=>{let Ue=G;const Fe=ot(i,Oe);Fe&&Zf(Fe._f.disabled)&&(Ue||(Ue=Fe._f.disabled)),le.disabled=Ue},0,!1))},te=(G,le)=>async Oe=>{let Ue;Oe&&(Oe.preventDefault&&Oe.preventDefault(),Oe.persist&&Oe.persist());let Fe=Lo(s);if(d.state.next({isSubmitting:!0}),n.resolver){const{errors:ye,values:Me}=await P();r.errors=ye,Fe=Me}else await M(i);if(ts(r.errors,"root"),Tc(r.errors)){d.state.next({errors:{}});try{await G(Fe,Oe)}catch(ye){Ue=ye}}else le&&await le({...r.errors},Oe),de(),setTimeout(de);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Tc(r.errors)&&!Ue,submitCount:r.submitCount+1,errors:r.errors}),Ue)throw Ue},Ee=(G,le={})=>{ot(i,G)&&(Gr(le.defaultValue)?W(G,Lo(ot(o,G))):(W(G,le.defaultValue),pr(o,G,Lo(le.defaultValue))),le.keepTouched||ts(r.touchedFields,G),le.keepDirty||(ts(r.dirtyFields,G),r.isDirty=le.defaultValue?A(G,Lo(ot(o,G))):A()),le.keepError||(ts(r.errors,G),f.isValid&&y()),d.state.next({...r}))},we=(G,le={})=>{const Oe=G?Lo(G):o,Ue=Lo(Oe),Fe=G&&!Tc(G)?Ue:o;if(le.keepDefaultValues||(o=Oe),!le.keepValues){if(le.keepDirtyValues)for(const ye of l.mount)ot(r.dirtyFields,ye)?pr(Fe,ye,ot(s,ye)):W(ye,ot(Fe,ye));else{if(lle&&Gr(G))for(const ye of l.mount){const Me=ot(i,ye);if(Me&&Me._f){const pt=Array.isArray(Me._f.refs)?Me._f.refs[0]:Me._f.ref;if(Q3(pt)){const at=pt.closest("form");if(at){at.reset();break}}}}i={}}s=e.shouldUnregister?le.keepDefaultValues?Lo(o):{}:Lo(Fe),d.array.next({values:{...Fe}}),d.values.next({values:{...Fe}})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!a.mount&&t(),a.mount=!f.isValid||!!le.keepIsValid||!!le.keepDirtyValues,a.watch=!!e.shouldUnregister,d.state.next({submitCount:le.keepSubmitCount?r.submitCount:0,isDirty:le.keepDirty?r.isDirty:!!(le.keepDefaultValues&&!j1(G,o)),isSubmitted:le.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:le.keepDirtyValues?le.keepDefaultValues&&s?MN(o,s):r.dirtyFields:le.keepDefaultValues&&G?MN(o,G):{},touchedFields:le.keepTouched?r.touchedFields:{},errors:le.keepErrors?r.errors:{},isSubmitSuccessful:le.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},ke=(G,le)=>we(Py(G)?G(s):G,le);return{control:{register:ae,unregister:fe,getFieldState:H,handleSubmit:te,setError:ee,_executeSchema:P,_getWatch:T,_getDirty:A,_updateValid:y,_removeUnmounted:L,_updateFieldArray:m,_updateDisabledField:ce,_getFieldArray:N,_reset:we,_resetDefaultValues:()=>Py(n.defaultValues)&&n.defaultValues().then(G=>{ke(G,n.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:G=>{r={...r,...G}},_disableForm:me,_subjects:d,_proxyFormState:f,_setErrors:S,get _fields(){return i},get _formValues(){return s},get _state(){return a},set _state(G){a=G},get _defaultValues(){return o},get _names(){return l},set _names(G){l=G},get _formState(){return r},set _formState(G){r=G},get _options(){return n},set _options(G){n={...n,...G}}},trigger:U,register:ae,handleSubmit:te,watch:se,setValue:W,getValues:V,reset:ke,resetField:Ee,clearErrors:Z,unregister:fe,setError:ee,setFocus:(G,le={})=>{const Oe=ot(i,G),Ue=Oe&&Oe._f;if(Ue){const Fe=Ue.refs?Ue.refs[0]:Ue.ref;Fe.focus&&(Fe.focus(),le.shouldSelect&&Fe.select())}},getFieldState:H}}function $8(e={}){const t=ie.useRef(),n=ie.useRef(),[r,i]=ie.useState({isDirty:!1,isValidating:!1,isLoading:Py(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Py(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...uHt(e,()=>i(s=>({...s}))),formState:r});const o=t.current.control;return o._options=e,k8({subject:o._subjects.state,next:s=>{jQe(s,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),ie.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),ie.useEffect(()=>{if(o._proxyFormState.isDirty){const s=o._getDirty();s!==r.isDirty&&o._subjects.state.next({isDirty:s})}},[o,r.isDirty]),ie.useEffect(()=>{e.values&&!j1(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,i(s=>({...s}))):o._resetDefaultValues()},[e.values,o]),ie.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),ie.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),ie.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),t.current.formState=LQe(r,o),t.current}var Yxe=function(e,t,n){if(e&&"reportValidity"in e){var r=ot(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},KQe=function(e,t){var n=function(i){var o=t.fields[i];o&&o.ref&&"reportValidity"in o.ref?Yxe(o.ref,i,e):o.refs&&o.refs.forEach(function(s){return Yxe(s,i,e)})};for(var r in t.fields)n(r)},fHt=function(e,t){t.shouldUseNativeValidation&&KQe(e,t);var n={};for(var r in e){var i=ot(t.fields,r),o=Object.assign(e[r]||{},{ref:i&&i.ref});if(dHt(t.names||Object.keys(e),r)){var s=Object.assign({},ot(n,r));pr(s,"root",o),pr(n,r,s)}else pr(n,r,o)}return n},dHt=function(e,t){return e.some(function(n){return n.startsWith(t+".")})},hHt=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,s=r.path.join(".");if(!n[s])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[s]={message:a.message,type:a.code}}else n[s]={message:o,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(f){return e.push(f)})}),t){var l=n[s].types,c=l&&l[r.code];n[s]=WQe(s,t,n,i,c?[].concat(c,r.message):r.message)}e.shift()}return n},T8=function(e,t,n){return n===void 0&&(n={}),function(r,i,o){try{return Promise.resolve(function(s,a){try{var l=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return o.shouldUseNativeValidation&&KQe({},o),{errors:{},values:n.raw?r:c}})}catch(c){return a(c)}return l&&l.then?l.then(void 0,a):l}(0,function(s){if(function(a){return a.errors!=null}(s))return{values:{},errors:fHt(hHt(s.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw s}))}catch(s){return Promise.reject(s)}}};const dle=IQe,JQe=x.createContext({}),Zn=({...e})=>b.jsx(JQe.Provider,{value:{name:e.name},children:b.jsx(eHt,{...e})}),aD=()=>{const e=x.useContext(JQe),t=x.useContext(eBe),{getFieldState:n,formState:r}=sD(),i=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},eBe=x.createContext({}),wr=x.forwardRef(({className:e,...t},n)=>{const r=x.useId();return b.jsx(eBe.Provider,{value:{id:r},children:b.jsx("div",{ref:n,className:be("flex flex-col gap-1",e),...t})})});wr.displayName="FormItem";const Vn=x.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:i}=aD();if(t.children)return b.jsx(Ls,{ref:n,className:be(r&&"text-destructive",e),htmlFor:i,...t})});Vn.displayName="FormLabel";const Sr=x.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:i,formMessageId:o}=aD();return b.jsx(vd,{ref:t,id:r,"aria-describedby":n?`${i} ${o}`:i,"aria-invalid":!!n,...e})});Sr.displayName="FormControl";const Us=x.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=aD();return t.children?b.jsx("p",{ref:n,id:r,className:be("text-xs text-muted-foreground",e),...t}):null});Us.displayName="FormDescription";const yi=x.forwardRef(({className:e,children:t,...n},r)=>{const{error:i,formMessageId:o}=aD(),s=i!=null&&i.message?String(i==null?void 0:i.message):t;return s?b.jsx("p",{ref:r,id:o,className:be("text-xs font-medium text-destructive",e),...n,children:s}):null});yi.displayName="FormMessage";const tBe=({className:e})=>{const{error:t}=aD(),n=t!=null&&t.message?String(t==null?void 0:t.message):null;return n?b.jsx(Wt,{content:n,children:b.jsx(xLe,{className:be("stroke-[1.8px]",e)})}):null};tBe.displayName="FormMessageTooltip";function V3(e){const t=n=>{if(n instanceof Y.ZodLiteral)return n._def.value;if(n instanceof Y.ZodDefault)return n._def.defaultValue();if(n instanceof Y.ZodEffects)return V3(n._def.schema);if("innerType"in n._def)return t(n._def.innerType)};return e instanceof Y.ZodUnion?t(e._def.options[0]):e instanceof Y.ZodArray?e._def.minLength&&e._def.minLength.value>0?[V3(e._def.type)]:[]:e instanceof Y.ZodString?"":e instanceof Y.ZodEnum?e._def.values[0]:e instanceof Y.ZodObject?Object.fromEntries(Object.entries(e.shape).map(([n,r])=>[n,t(r)])):t(e)}function QP(e){if(e instanceof Y.ZodLiteral)return e;if(e instanceof Y.ZodObject){const t=e._def.shape().type;if(t instanceof Y.ZodLiteral)return t;throw new Error("Invalid schema")}if(e instanceof Y.ZodUnion)return QP(e._def.options[0]);throw new Error("Invalid schema")}const P8=x.createContext({}),hle=x.createContext(""),ple=x.createContext(()=>Promise.resolve({values:[],too_many_values:!1})),lD={startCase:e=>{if(!e)return"";if(typeof e!="string")throw At.error(e),new TypeError(`Expected string, got ${typeof e}`);return/[A-Za-z]/.test(e)?RR(e):e}},pHt=[" ","Enter","ArrowUp","ArrowDown"],gHt=[" ","Enter"],A8="Select",[R8,D8,mHt]=jC(A8),[y_,NGn]=uo(A8,[mHt,vv]),gle=vv(),[yHt,ex]=y_(A8),[vHt,bHt]=y_(A8),OHt=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:d,required:h}=e,p=gle(t),[g,v]=x.useState(null),[y,O]=x.useState(null),[m,w]=x.useState(!1),S=BO(c),[E=!1,C]=ko({prop:r,defaultProp:i,onChange:o}),[k,P]=ko({prop:s,defaultProp:a,onChange:l}),D=x.useRef(null),M=g?!!g.closest("form"):!0,[L,A]=x.useState(new Set),T=Array.from(L).map(N=>N.props.value).join(";");return x.createElement($R,p,x.createElement(yHt,{required:h,scope:t,trigger:g,onTriggerChange:v,valueNode:y,onValueNodeChange:O,valueNodeHasChildren:m,onValueNodeHasChildrenChange:w,contentId:Ra(),value:k,onValueChange:P,open:E,onOpenChange:C,dir:S,triggerPointerDownPosRef:D,disabled:d},x.createElement(R8.Provider,{scope:t},x.createElement(vHt,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(N=>{A(j=>new Set(j).add(N))},[]),onNativeOptionRemove:x.useCallback(N=>{A(j=>{const z=new Set(j);return z.delete(N),z})},[])},n)),M?x.createElement(sBe,{key:T,"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:k,onChange:N=>P(N.target.value),disabled:d},k===void 0?x.createElement("option",{value:""}):null,Array.from(L)):null))},xHt="SelectTrigger",wHt=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=gle(n),s=ex(xHt,n),a=s.disabled||r,l=Yt(t,s.onTriggerChange),c=D8(n),[u,f,d]=aBe(p=>{const g=c().filter(O=>!O.disabled),v=g.find(O=>O.value===s.value),y=lBe(g,p,v);y!==void 0&&s.onValueChange(y.value)}),h=()=>{a||(s.onOpenChange(!0),d())};return x.createElement(ez,oe({asChild:!0},o),x.createElement(Ot.button,oe({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":oBe(s.value)?"":void 0},i,{ref:l,onClick:Xe(i.onClick,p=>{p.currentTarget.focus()}),onPointerDown:Xe(i.onPointerDown,p=>{const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&(h(),s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)},p.preventDefault())}),onKeyDown:Xe(i.onKeyDown,p=>{const g=u.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&f(p.key),!(g&&p.key===" ")&&pHt.includes(p.key)&&(h(),p.preventDefault())})})))}),SHt="SelectValue",EHt=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=ex(SHt,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,f=Yt(t,l.onValueNodeChange);return Qa(()=>{c(u)},[c,u]),x.createElement(Ot.span,oe({},a,{ref:f,style:{pointerEvents:"none"}}),oBe(l.value)?x.createElement(x.Fragment,null,s):o)}),CHt=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return x.createElement(Ot.span,oe({"aria-hidden":!0},i,{ref:t}),r||"▼")}),_Ht=e=>x.createElement(VC,oe({asChild:!0},e)),AE="SelectContent",kHt=x.forwardRef((e,t)=>{const n=ex(AE,e.__scopeSelect),[r,i]=x.useState();if(Qa(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?as.createPortal(x.createElement(nBe,{scope:e.__scopeSelect},x.createElement(R8.Slot,{scope:e.__scopeSelect},x.createElement("div",null,e.children))),o):null}return x.createElement($Ht,oe({},e,{ref:t}))}),Kp=10,[nBe,tx]=y_(AE),$Ht=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:g,avoidCollisions:v,...y}=e,O=ex(AE,n),[m,w]=x.useState(null),[S,E]=x.useState(null),C=Yt(t,fe=>w(fe)),[k,P]=x.useState(null),[D,M]=x.useState(null),L=D8(n),[A,T]=x.useState(!1),N=x.useRef(!1);x.useEffect(()=>{if(m)return NR(m)},[m]),mz();const j=x.useCallback(fe=>{const[ce,...ae]=L().map(te=>te.ref.current),[de]=ae.slice(-1),me=document.activeElement;for(const te of fe)if(te===me||(te==null||te.scrollIntoView({block:"nearest"}),te===ce&&S&&(S.scrollTop=0),te===de&&S&&(S.scrollTop=S.scrollHeight),te==null||te.focus(),document.activeElement!==me))return},[L,S]),z=x.useCallback(()=>j([k,m]),[j,k,m]);x.useEffect(()=>{A&&z()},[A,z]);const{onOpenChange:W,triggerPointerDownPosRef:F}=O;x.useEffect(()=>{if(m){let fe={x:0,y:0};const ce=de=>{var me,te,Ee,we;fe={x:Math.abs(Math.round(de.pageX)-((me=(te=F.current)===null||te===void 0?void 0:te.x)!==null&&me!==void 0?me:0)),y:Math.abs(Math.round(de.pageY)-((Ee=(we=F.current)===null||we===void 0?void 0:we.y)!==null&&Ee!==void 0?Ee:0))}},ae=de=>{fe.x<=10&&fe.y<=10?de.preventDefault():m.contains(de.target)||W(!1),document.removeEventListener("pointermove",ce),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",ae,{capture:!0})}}},[m,W,F]),x.useEffect(()=>{const fe=()=>W(!1);return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[W]);const[q,U]=aBe(fe=>{const ce=L().filter(me=>!me.disabled),ae=ce.find(me=>me.ref.current===document.activeElement),de=lBe(ce,fe,ae);de&&setTimeout(()=>de.ref.current.focus())}),V=x.useCallback((fe,ce,ae)=>{const de=!N.current&&!ae;(O.value!==void 0&&O.value===ce||de)&&(P(fe),de&&(N.current=!0))},[O.value]),H=x.useCallback(()=>m==null?void 0:m.focus(),[m]),Z=x.useCallback((fe,ce,ae)=>{const de=!N.current&&!ae;(O.value!==void 0&&O.value===ce||de)&&M(fe)},[O.value]),ee=r==="popper"?Gxe:THt,se=ee===Gxe?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:g,avoidCollisions:v}:{};return x.createElement(nBe,{scope:n,content:m,viewport:S,onViewportChange:E,itemRefCallback:V,selectedItem:k,onItemLeave:H,itemTextRefCallback:Z,focusSelectedItem:z,selectedItemText:D,position:r,isPositioned:A,searchRef:q},x.createElement(vz,{as:vd,allowPinchZoom:!0},x.createElement(gz,{asChild:!0,trapped:O.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:Xe(i,fe=>{var ce;(ce=O.trigger)===null||ce===void 0||ce.focus({preventScroll:!0}),fe.preventDefault()})},x.createElement(qC,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>O.onOpenChange(!1)},x.createElement(ee,oe({role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:fe=>fe.preventDefault()},y,se,{onPlaced:()=>T(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Xe(y.onKeyDown,fe=>{const ce=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!ce&&fe.key.length===1&&U(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let de=L().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const me=fe.target,te=de.indexOf(me);de=de.slice(te+1)}setTimeout(()=>j(de)),fe.preventDefault()}})}))))))}),THt=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=ex(AE,n),s=tx(AE,n),[a,l]=x.useState(null),[c,u]=x.useState(null),f=Yt(t,C=>u(C)),d=D8(n),h=x.useRef(!1),p=x.useRef(!0),{viewport:g,selectedItem:v,selectedItemText:y,focusSelectedItem:O}=s,m=x.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&g&&v&&y){const C=o.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),D=y.getBoundingClientRect();if(o.dir!=="rtl"){const me=D.left-k.left,te=P.left-me,Ee=C.left-te,we=C.width+Ee,ke=Math.max(we,k.width),je=window.innerWidth-Kp,nt=Hj(te,[Kp,je-ke]);a.style.minWidth=we+"px",a.style.left=nt+"px"}else{const me=k.right-D.right,te=window.innerWidth-P.right-me,Ee=window.innerWidth-C.right-te,we=C.width+Ee,ke=Math.max(we,k.width),je=window.innerWidth-Kp,nt=Hj(te,[Kp,je-ke]);a.style.minWidth=we+"px",a.style.right=nt+"px"}const M=d(),L=window.innerHeight-Kp*2,A=g.scrollHeight,T=window.getComputedStyle(c),N=parseInt(T.borderTopWidth,10),j=parseInt(T.paddingTop,10),z=parseInt(T.borderBottomWidth,10),W=parseInt(T.paddingBottom,10),F=N+j+A+W+z,q=Math.min(v.offsetHeight*5,F),U=window.getComputedStyle(g),V=parseInt(U.paddingTop,10),H=parseInt(U.paddingBottom,10),Z=C.top+C.height/2-Kp,ee=L-Z,se=v.offsetHeight/2,fe=v.offsetTop+se,ce=N+j+fe,ae=F-ce;if(ce<=Z){const me=v===M[M.length-1].ref.current;a.style.bottom="0px";const te=c.clientHeight-g.offsetTop-g.offsetHeight,Ee=Math.max(ee,se+(me?H:0)+te+z),we=ce+Ee;a.style.height=we+"px"}else{const me=v===M[0].ref.current;a.style.top="0px";const Ee=Math.max(Z,N+g.offsetTop+(me?V:0)+se)+ae;a.style.height=Ee+"px",g.scrollTop=ce-Z+g.offsetTop}a.style.margin=`${Kp}px 0`,a.style.minHeight=q+"px",a.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[d,o.trigger,o.valueNode,a,c,g,v,y,o.dir,r]);Qa(()=>m(),[m]);const[w,S]=x.useState();Qa(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const E=x.useCallback(C=>{C&&p.current===!0&&(m(),O==null||O(),p.current=!1)},[m,O]);return x.createElement(PHt,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:E},x.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w}},x.createElement(Ot.div,oe({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),Gxe=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Kp,...o}=e,s=gle(n);return x.createElement(tz,oe({},s,o,{ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[PHt,mle]=y_(AE,{}),Kxe="SelectViewport",AHt=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=tx(Kxe,n),o=mle(Kxe,n),s=Yt(t,i.onViewportChange),a=x.useRef(0);return x.createElement(x.Fragment,null,x.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),x.createElement(R8.Slot,{scope:n},x.createElement(Ot.div,oe({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Xe(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&u){const d=Math.abs(a.current-c.scrollTop);if(d>0){const h=window.innerHeight-Kp*2,p=parseFloat(u.style.minHeight),g=parseFloat(u.style.height),v=Math.max(p,g);if(v<h){const y=v+d,O=Math.min(h,y),m=y-O;u.style.height=O+"px",u.style.bottom==="0px"&&(c.scrollTop=m>0?m:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),RHt="SelectGroup",[DHt,MHt]=y_(RHt),NHt=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Ra();return x.createElement(DHt,{scope:n,id:i},x.createElement(Ot.div,oe({role:"group","aria-labelledby":i},r,{ref:t})))}),IHt="SelectLabel",LHt=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=MHt(IHt,n);return x.createElement(Ot.div,oe({id:i.id},r,{ref:t}))}),iK="SelectItem",[jHt,rBe]=y_(iK),FHt=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=ex(iK,n),l=tx(iK,n),c=a.value===r,[u,f]=x.useState(o??""),[d,h]=x.useState(!1),p=Yt(t,y=>{var O;return(O=l.itemRefCallback)===null||O===void 0?void 0:O.call(l,y,r,i)}),g=Ra(),v=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.createElement(jHt,{scope:n,value:r,disabled:i,textId:g,isSelected:c,onItemTextChange:x.useCallback(y=>{f(O=>{var m;return O||((m=y==null?void 0:y.textContent)!==null&&m!==void 0?m:"").trim()})},[])},x.createElement(R8.ItemSlot,{scope:n,value:r,disabled:i,textValue:u},x.createElement(Ot.div,oe({role:"option","aria-labelledby":g,"data-highlighted":d?"":void 0,"aria-selected":c&&d,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},s,{ref:p,onFocus:Xe(s.onFocus,()=>h(!0)),onBlur:Xe(s.onBlur,()=>h(!1)),onPointerUp:Xe(s.onPointerUp,v),onPointerMove:Xe(s.onPointerMove,y=>{if(i){var O;(O=l.onItemLeave)===null||O===void 0||O.call(l)}else y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Xe(s.onPointerLeave,y=>{if(y.currentTarget===document.activeElement){var O;(O=l.onItemLeave)===null||O===void 0||O.call(l)}}),onKeyDown:Xe(s.onKeyDown,y=>{var O;((O=l.searchRef)===null||O===void 0?void 0:O.current)!==""&&y.key===" "||(gHt.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})}))))}),NN="SelectItemText",zHt=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=ex(NN,n),a=tx(NN,n),l=rBe(NN,n),c=bHt(NN,n),[u,f]=x.useState(null),d=Yt(t,y=>f(y),l.onItemTextChange,y=>{var O;return(O=a.itemTextRefCallback)===null||O===void 0?void 0:O.call(a,y,l.value,l.disabled)}),h=u==null?void 0:u.textContent,p=x.useMemo(()=>x.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},h),[l.disabled,l.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=c;return Qa(()=>(g(p),()=>v(p)),[g,v,p]),x.createElement(x.Fragment,null,x.createElement(Ot.span,oe({id:l.textId},o,{ref:d})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?as.createPortal(o.children,s.valueNode):null)}),QHt="SelectItemIndicator",BHt=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return rBe(QHt,n).isSelected?x.createElement(Ot.span,oe({"aria-hidden":!0},r,{ref:t})):null}),Jxe="SelectScrollUpButton",WHt=x.forwardRef((e,t)=>{const n=tx(Jxe,e.__scopeSelect),r=mle(Jxe,e.__scopeSelect),[i,o]=x.useState(!1),s=Yt(t,r.onScrollButtonChange);return Qa(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;o(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?x.createElement(iBe,oe({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),ewe="SelectScrollDownButton",qHt=x.forwardRef((e,t)=>{const n=tx(ewe,e.__scopeSelect),r=mle(ewe,e.__scopeSelect),[i,o]=x.useState(!1),s=Yt(t,r.onScrollButtonChange);return Qa(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)<c;o(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?x.createElement(iBe,oe({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),iBe=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=tx("SelectScrollButton",n),s=x.useRef(null),a=D8(n),l=x.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return x.useEffect(()=>()=>l(),[l]),Qa(()=>{var c;const u=a().find(f=>f.ref.current===document.activeElement);u==null||(c=u.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),x.createElement(Ot.div,oe({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Xe(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Xe(i.onPointerMove,()=>{var c;(c=o.onItemLeave)===null||c===void 0||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Xe(i.onPointerLeave,()=>{l()})}))}),VHt=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x.createElement(Ot.div,oe({"aria-hidden":!0},r,{ref:t}))});function oBe(e){return e===""||e===void 0}const sBe=x.forwardRef((e,t)=>{const{value:n,...r}=e,i=x.useRef(null),o=Yt(t,i),s=PR(n);return x.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const f=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(f)}},[s,n]),x.createElement(nz,{asChild:!0},x.createElement("select",oe({},r,{ref:o,defaultValue:n})))});sBe.displayName="BubbleSelect";function aBe(e){const t=Xs(e),n=x.useRef(""),r=x.useRef(0),i=x.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function lBe(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=UHt(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function UHt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const HHt=OHt,cBe=wHt,XHt=EHt,ZHt=CHt,YHt=_Ht,uBe=kHt,GHt=AHt,KHt=NHt,fBe=LHt,dBe=FHt,JHt=zHt,eXt=BHt,tXt=WHt,nXt=qHt,hBe=VHt,$v=HHt,Jg=KHt,v_=XHt,ym=x.forwardRef(({className:e,children:t,onClear:n,variant:r,hideChevron:i=!1,...o},s)=>b.jsxs(cBe,{ref:s,className:be($je({variant:r}),"mb-0",e),...o,children:[t,b.jsx(ZHt,{asChild:!0,children:n?b.jsx("span",{onPointerDown:a=>{a.preventDefault(),a.stopPropagation(),n()},children:b.jsx(rc,{className:"h-4 w-4 opacity-50 hover:opacity-90"})}):!i&&b.jsx(P0,{className:"h-4 w-4 opacity-50"})})]}));ym.displayName=cBe.displayName;const vm=x.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>b.jsx(YHt,{children:b.jsxs(uBe,{ref:i,className:be("max-h-[300px] relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[b.jsx(tXt,{className:"flex items-center justify-center h-[20px] bg-background text-muted-foreground cursor-default",children:b.jsx(GZ,{className:"h-4 w-4"})}),b.jsx(GHt,{className:be("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),b.jsx(nXt,{className:"flex items-center justify-center h-[20px] bg-background text-muted-foreground cursor-default",children:b.jsx(P0,{className:"h-4 w-4 opacity-50"})})]})}));vm.displayName=uBe.displayName;const M8=x.forwardRef(({className:e,...t},n)=>b.jsx(fBe,{ref:n,className:be("px-2 py-1.5 text-sm font-semibold",e),...t}));M8.displayName=fBe.displayName;const Kl=x.forwardRef(({className:e,children:t,...n},r)=>b.jsxs(dBe,{ref:r,className:be("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[b.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(eXt,{children:b.jsx(dm,{className:"h-3 w-3"})})}),b.jsx(JHt,{asChild:typeof t=="string"?void 0:!0,className:"flex w-full flex-1",children:t})]}));Kl.displayName=dBe.displayName;const yle=x.forwardRef(({className:e,...t},n)=>b.jsx(hBe,{ref:n,className:be("-mx-1 my-1 h-px bg-muted",e),...t}));yle.displayName=hBe.displayName;const pBe=({type:e})=>{const t=()=>e.startsWith("int")||e.startsWith("float")||e.startsWith("uint")||e.startsWith("complex")?b.jsx(EEt,{size:14}):e.startsWith("object")?b.jsx(kLe,{size:14}):e.startsWith("date")||e.startsWith("time")?b.jsx(_Le,{size:14}):e.startsWith("bool")?b.jsx(LLe,{size:14}):b.jsx(CEt,{size:14});return b.jsx("div",{className:"border p-[1px] border-border bg-[var(--slate-2)] flex items-center justify-center rounded",children:t()})},rXt=x.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:i,...o}=e,[s=!1,a]=ko({prop:n,onChange:i,defaultProp:r});return x.createElement(Ot.button,oe({type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0},o,{ref:t,onClick:Xe(e.onClick,()=>{e.disabled||a(!s)})}))}),gBe=rXt,iXt=Ao(be("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50","data-[state=on]:bg-muted data-[state=on]:text-muted-foreground"),{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-muted hover:text-muted-foreground"},size:{default:"h-9 px-3",xs:"h-4 w-4",sm:"h-6 px-2",lg:"h-10 px-5"}},defaultVariants:{variant:"default",size:"default"}}),qT=x.forwardRef(({className:e,variant:t,size:n,...r},i)=>b.jsx(gBe,{ref:i,className:be(iXt({variant:t,size:n,className:e})),...r}));qT.displayName=gBe.displayName;const twe=`
`,oXt=({value:e,options:t,onChange:n,className:r,placeholder:i,textAreaClassName:o,comboBoxClassName:s})=>{const[a,l]=x.useState(!1),c=N8(e),u=()=>a?b.jsx(mBe,{value:c,className:o,onChange:n,placeholder:i?`${i}: one per line`:"One value per line"}):b.jsx(zR,{placeholder:i,displayValue:f=>f,className:be("w-full max-w-[400px]",s),multiple:!0,value:c,onValueChange:n,keepPopoverOpenOnSelect:!0,chips:!0,chipsClassName:"flex-row flex-wrap min-w-[210px]",children:t.map(f=>b.jsx(KC,{value:f,children:f},f))});return b.jsxs("div",{className:be("flex gap-1",r),children:[u(),b.jsx(Wt,{content:a?"Switch to multi-select":"Switch to textarea",children:b.jsx(qT,{size:"xs",onPressedChange:l,pressed:a,children:b.jsx(ILe,{className:"w-3 h-3"})})})]})},mBe=e=>{const{className:t,value:n,onChange:r,placeholder:i}=e,o=N8(n);return b.jsx(Dz,{value:o.join(twe),className:t,rows:4,onChange:s=>{if(s.target.value===""){r([]);return}r(s.target.value.split(twe))},placeholder:i?`${i}: one per line`:"One value per line"})};function N8(e){return e==null?[]:Array.isArray(e)?e:[e].filter(t=>t!=null||t!=="")}const sXt=({schema:e,form:t,path:n=""})=>b.jsx(IQe,{...t,children:F1(e,t,n)});function F1(e,t,n){var a;const{label:r,description:i,special:o,direction:s="column"}=On.parse(e._def.description||"");if(e instanceof Y.ZodDefault){let l=e._def.innerType;return l=!l.description&&e.description?l.describe(e.description):l,F1(l,t,n)}if(e instanceof Y.ZodObject)return o==="column_filter"?b.jsx(uXt,{schema:e,form:t,path:n}):b.jsxs("div",{className:be("flex",s==="row"?"flex-row gap-6 items-start":"flex-col gap-6"),children:[b.jsx(Vn,{children:r}),pn.entries(e._def.shape()).map(([l,c])=>{const u=c instanceof Y.ZodLiteral,f=F1(c,t,`${n}.${l}`);return u?b.jsx(ie.Fragment,{children:f},l):b.jsx("div",{className:"flex flex-row align-start",children:f},l)})]});if(e instanceof Y.ZodString)return o==="column_id"?b.jsx(yBe,{schema:e,form:t,path:n}):o==="column_values"?b.jsx(dXt,{schema:e,form:t,path:n}):b.jsx(oK,{schema:e,form:t,path:n});if(e instanceof Y.ZodBoolean)return b.jsx(Zn,{control:t.control,name:n,render:({field:l})=>b.jsxs(wr,{children:[b.jsxs("div",{className:"flex flex-row items-start space-x-2",children:[b.jsx(Vn,{children:r}),b.jsx(Us,{children:i}),b.jsx(Sr,{children:b.jsx(kh,{"data-testid":"marimo-plugin-data-frames-boolean-checkbox",checked:l.value,onCheckedChange:l.onChange})})]}),b.jsx(yi,{})]})});if(e instanceof Y.ZodNumber)return o==="random_number_button"?b.jsx(Zn,{control:t.control,name:n,render:({field:l})=>b.jsxs(St,{size:"xs","data-testid":"marimo-plugin-data-frames-random-number-button",variant:"secondary",onClick:()=>{l.onChange(ole())},children:[b.jsx(DLe,{className:"w-3.5 h-3.5 mr-1"}),r]})}):b.jsx(Zn,{control:t.control,name:n,render:({field:l})=>b.jsxs(wr,{children:[b.jsx(Vn,{children:r}),b.jsx(Us,{children:i}),b.jsx(Sr,{children:b.jsx(kje,{...l,type:"number",className:"my-0",onValueChange:l.onChange})}),b.jsx(yi,{})]})});if(e instanceof Y.ZodDate)return b.jsx(Zn,{control:t.control,name:n,render:({field:l})=>b.jsxs(wr,{children:[b.jsx(Vn,{children:r}),b.jsx(Us,{children:i}),b.jsx(Sr,{children:b.jsx(koe,{...l,onValueChange:l.onChange,type:"date",className:"my-0"})}),b.jsx(yi,{})]})});if(e instanceof Y.ZodAny)return b.jsx(oK,{schema:e,form:t,path:n});if(e instanceof Y.ZodEnum)return b.jsx(fXt,{schema:e,form:t,path:n,options:e._def.values});if(e instanceof Y.ZodArray){if(o==="text_area_multiline")return b.jsx(vBe,{schema:e,form:t,path:n});if(o==="column_values")return b.jsx(hXt,{schema:e,form:t,path:n});const l=e._def.type,c=On.parse(l._def.description).special;if(l instanceof Y.ZodString&&c==="column_id")return b.jsx(cXt,{schema:l,form:t,path:n,itemLabel:r});if(l instanceof Y.ZodEnum){const u=l._def.values;return b.jsx(bBe,{schema:e,form:t,path:n,itemLabel:r,options:u})}return b.jsxs("div",{className:"flex flex-col gap-1",children:[b.jsx(Ls,{children:r}),b.jsx(lXt,{schema:e._def.type,form:t,path:n,minLength:(a=e._def.minLength)==null?void 0:a.value},n)]})}else return e instanceof Y.ZodUnion?b.jsx(Zn,{control:t.control,name:n,render:({field:l})=>{const c=e._def.options;let u=l.value;const f=c.map(h=>QP(h)._def.value);u||(u=f[0]);const d=c.find(h=>QP(h)._def.value===u);return b.jsxs("div",{className:"flex flex-col",children:[b.jsx(Vn,{children:r}),b.jsx($h,{"data-testid":"marimo-plugin-data-frames-union-select",...l,children:f.map(h=>b.jsx("option",{value:h,children:h},h))}),d&&F1(d,t,n)]})}}):e instanceof Y.ZodLiteral?b.jsx(Zn,{control:t.control,name:n,render:({field:l})=>b.jsx("input",{...l,type:"hidden"})}):e instanceof Y.ZodEffects&&["refinement","transform"].includes(e._def.effect.type)?F1(e._def.schema,t,n):b.jsxs("div",{children:["Unknown schema type"," ",e?JSON.stringify(e._type||e):n]})}const aXt=({className:e})=>b.jsx(tBe,{className:be("absolute -left-6 bottom-0 text-destructive text-xs w-[16px]",e)}),lXt=({schema:e,form:t,path:n,minLength:r})=>{const{label:i,description:o}=On.parse(e._def.description||""),s=t.control,{fields:a,append:l,remove:c}=HQe({control:s,name:n}),u=r!=null&&a.length<r,f=r==null||a.length>r;return b.jsxs("div",{className:"flex flex-col gap-2 min-w-[220px]",children:[b.jsx(Vn,{children:i}),b.jsx(Us,{children:o}),a.map((d,h)=>b.jsxs("div",{className:"flex flex-row pl-2 ml-4 border-l-2 border-disabled hover-actions-parent relative pr-5 pt-1 items-center w-fit",onKeyDown:tp.onEnter(p=>p.preventDefault()),children:[F1(e,t,`${n}[${h}]`),f&&b.jsx(AR,{className:"w-4 h-4 ml-2 my-1 text-muted-foreground hover:text-destructive cursor-pointer absolute right-0 top-5",onClick:()=>{c(h)}})]},d.id)),u&&b.jsx("div",{className:"text-destructive text-xs font-semibold",children:b.jsxs("div",{children:["At least ",r," required."]})}),b.jsx("div",{children:b.jsxs(St,{size:"xs","data-testid":"marimo-plugin-data-frames-add-array-item",variant:"text",className:"hover:text-accent-foreground",onClick:()=>{l(V3(e))},children:[b.jsx(poe,{className:"w-3.5 h-3.5 mr-1"}),"Add"]})})]})},yBe=({schema:e,form:t,path:n,onChange:r})=>{const i=x.useContext(P8),{label:o,description:s}=On.parse(e._def.description);return b.jsx(Zn,{control:t.control,name:n,render:({field:a})=>b.jsxs(wr,{children:[b.jsx(Vn,{children:o}),b.jsx(Us,{children:s}),b.jsx(aXt,{}),b.jsx(Sr,{children:b.jsxs($v,{"data-testid":"marimo-plugin-data-frames-column-select",value:a.value,onValueChange:l=>{r==null||r(l),a.onChange(l)},children:[b.jsx(ym,{className:"min-w-[210px]",children:b.jsx(v_,{placeholder:"--"})}),b.jsx(vm,{children:b.jsxs(Jg,{children:[pn.entries(i).map(([l,c])=>b.jsx(Kl,{value:l.toString(),children:b.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[b.jsx(pBe,{type:c}),b.jsx("span",{className:"flex-1",children:l}),b.jsxs("span",{className:"text-muted-foreground text-xs font-semibold",children:["(",c,")"]})]})},l)),pn.keys(i).length===0&&b.jsx(Kl,{disabled:!0,value:"--",children:"No columns"})]})})]})})]})})},cXt=({schema:e,form:t,path:n,itemLabel:r})=>{const i=x.useContext(P8),{description:o}=On.parse(e._def.description),s=r?`Select ${r.toLowerCase()}`:void 0;return b.jsx(Zn,{control:t.control,name:n,render:({field:a})=>{const l=N8(a.value);return b.jsxs(wr,{children:[b.jsx(Vn,{children:r}),b.jsx(Us,{children:o}),b.jsx(Sr,{children:b.jsx(zR,{className:"min-w-[210px]",placeholder:s,displayValue:c=>c,multiple:!0,chips:!0,keepPopoverOpenOnSelect:!0,value:l,onValueChange:c=>{a.onChange(c)},children:pn.entries(i).map(([c,u])=>b.jsx(KC,{value:c.toString(),children:b.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[b.jsx(pBe,{type:u}),b.jsx("span",{className:"flex-1",children:c}),b.jsxs("span",{className:"text-muted-foreground text-xs font-semibold",children:["(",u,")"]})]})},c))})}),b.jsx(yi,{})]})}})},uXt=({path:e,form:t,schema:n})=>{var u;const{description:r}=On.parse(n._def.description),i=x.useContext(P8),{field:o}=BQe({name:e}),s=(u=pn.entries(n._def.shape()).find(([f,d])=>f==="column_id"))==null?void 0:u[1],{column_id:a,operator:l}=o.value||{},c=[b.jsx(yBe,{schema:s,form:t,path:`${e}.column_id`,onChange:f=>{const d=i[a];i[f]!==d&&t.setValue(`${e}.value`,void 0)}},"column_id")];if(x.useEffect(()=>{const f=i[a],d=Wxe(f),h=t.getValues(`${e}.operator`);d.includes(h)||(t.setValue(`${e}.operator`,d[0]),t.setValue(`${e}.value`,void 0))},[a]),a){const f=i[a],d=Wxe(f);d.length===0?c.push(b.jsxs("div",{className:"text-muted-foreground text-xs font-semibold",children:[b.jsx(Vn,{className:"whitespace-pre",children:" "}),b.jsx("div",{children:"This column type does not support filtering."})]},"no_operator")):c.push(b.jsx(Zn,{control:t.control,name:`${e}.operator`,render:({field:h})=>b.jsxs(wr,{children:[b.jsx(Vn,{className:"whitespace-pre",children:" "}),b.jsx(Us,{children:r}),b.jsx(Sr,{children:b.jsxs($v,{"data-testid":"marimo-plugin-data-frames-filter-operator-select",value:h.value,onValueChange:h.onChange,children:[b.jsx(ym,{className:"min-w-[210px]",children:b.jsx(v_,{placeholder:"--"})}),b.jsx(vm,{children:b.jsx(Jg,{children:d.map(p=>b.jsx(Kl,{value:p,children:lD.startCase(p)},p))})})]})}),b.jsx(yi,{})]})},"operator"))}if(l){const f=i[a],d=LUt(f,l);d.length===1&&c.push(b.jsx(ie.Fragment,{children:b.jsx(hle.Provider,{value:a,children:F1(d[0],t,`${e}.value`)})},"value"))}return b.jsx(Zn,{control:t.control,name:e,render:()=>b.jsxs("div",{className:"flex flex-col gap-2 bg-red",children:[b.jsx("div",{className:be("flex flex-row gap-3"),children:c}),b.jsx(yi,{})]})})},oK=({schema:e,form:t,path:n})=>{const{label:r,description:i,placeholder:o,disabled:s}=On.parse(e._def.description);return b.jsx(Zn,{control:t.control,name:n,render:({field:a})=>b.jsxs(wr,{children:[b.jsx(Vn,{children:r}),b.jsx(Us,{children:i}),b.jsx(Sr,{children:b.jsx(koe,{...a,value:a.value,onValueChange:a.onChange,className:"my-0",placeholder:o,disabled:s})}),b.jsx(yi,{})]})})},vBe=({schema:e,form:t,path:n})=>{const{label:r,description:i,placeholder:o}=On.parse(e._def.description);return b.jsx(Zn,{control:t.control,name:n,render:({field:s})=>b.jsxs(wr,{children:[b.jsx(Vn,{children:r}),b.jsx(Us,{children:i}),b.jsx(Sr,{children:b.jsx(mBe,{...s,placeholder:o})}),b.jsx(yi,{})]})})},fXt=({schema:e,form:t,path:n,options:r,textTransform:i})=>{const{label:o,description:s,disabled:a,special:l}=On.parse(e._def.description);return l==="radio_group"?b.jsx(Zn,{control:t.control,name:n,disabled:a,render:({field:c})=>b.jsxs(wr,{children:[b.jsx(Vn,{children:o}),b.jsx(Us,{children:s}),b.jsx(Sr,{children:b.jsx(ose,{className:"flex flex-row gap-2 pt-1 items-center",value:c.value,onValueChange:c.onChange,children:r.map(u=>b.jsxs("div",{className:"flex items-center gap-1",children:[b.jsx(sse,{value:u,id:`${n}-${u}`},u),b.jsx(Vn,{className:"whitespace-pre",htmlFor:`${n}-${u}`,children:lD.startCase(u)})]},u))})}),b.jsx(yi,{})]})}):b.jsx(Zn,{control:t.control,name:n,disabled:a,render:({field:c})=>b.jsxs(wr,{children:[b.jsx(Vn,{className:"whitespace-pre",children:o}),b.jsx(Us,{children:s}),b.jsx(Sr,{children:b.jsxs($v,{"data-testid":"marimo-plugin-data-frames-select",value:c.value,onValueChange:c.onChange,children:[b.jsx(ym,{className:"min-w-[210px]",children:b.jsx(v_,{placeholder:"--"})}),b.jsx(vm,{children:b.jsxs(Jg,{children:[r.map(u=>b.jsx(Kl,{value:u,children:(i==null?void 0:i(u))??u},u)),r.length===0&&b.jsx(Kl,{disabled:!0,value:"--",children:"No options"})]})})]})}),b.jsx(yi,{})]})})},bBe=({schema:e,form:t,path:n,options:r,itemLabel:i,showSwitchable:o})=>{const{label:s,description:a,placeholder:l}=On.parse(e._def.description),c=l??(i?`Select ${i==null?void 0:i.toLowerCase()}`:void 0);return b.jsx(Zn,{control:t.control,name:n,render:({field:u})=>{const f=N8(u.value);return b.jsxs(wr,{children:[b.jsx(Vn,{className:"whitespace-pre",children:s}),b.jsx(Us,{children:a}),b.jsx(Sr,{children:o?b.jsx(oXt,{...u,value:f,options:r,placeholder:c}):b.jsx(zR,{className:"min-w-[210px]",placeholder:c,displayValue:d=>lD.startCase(d),multiple:!0,chips:!0,keepPopoverOpenOnSelect:!0,value:f,onValueChange:u.onChange,children:r.map(d=>b.jsx(KC,{value:d,children:d},d))})}),b.jsx(yi,{})]})}})},dXt=({schema:e,form:t,path:n})=>{const{label:r,description:i,placeholder:o}=On.parse(e._def.description),s=x.useContext(hle),a=x.useContext(ple),{data:l,loading:c}=zd(()=>a({column:s}),[s]),u=(l==null?void 0:l.values)||[];if(u.length===0&&!c)return b.jsx(oK,{schema:e,form:t,path:n});const f=u.map(String);return b.jsx(Zn,{control:t.control,name:n,render:({field:d})=>b.jsxs(wr,{children:[b.jsx(Vn,{className:"whitespace-pre",children:r}),b.jsx(Us,{children:i}),b.jsx(Sr,{children:b.jsx(zR,{className:"min-w-[210px]",placeholder:o,multiple:!1,displayValue:h=>h,value:Array.isArray(d.value)?d.value[0]:d.value,onValueChange:d.onChange,children:f.map(h=>b.jsx(KC,{value:h,children:h},h))})}),b.jsx(yi,{})]})})},hXt=({schema:e,form:t,path:n})=>{const r=x.useContext(hle),i=x.useContext(ple),{data:o,loading:s}=zd(()=>i({column:r}),[r]),a=(o==null?void 0:o.values)||[];if(a.length===0&&!s)return b.jsx(vBe,{schema:e,form:t,path:n});const l=a.map(String);return b.jsx(bBe,{schema:e,form:t,path:n,showSwitchable:!0,options:l})};function pXt(e,t){if(!e||e.length===0)return t;let n={...t};for(const r of e)n=gXt(r,n);return n}function gXt(e,t){switch(e.type){case"column_conversion":return e.column_id&&(t[e.column_id]=e.data_type),t;case"rename_column":return e.new_column_id?pn.fromEntries(pn.entries(t).map(([n,r])=>n===e.column_id?[e.new_column_id,r]:[n,r])):t;case"group_by":return pn.filter(t,(n,r)=>!e.column_ids.includes(r));case"aggregate":return pn.filter(t,(n,r)=>e.column_ids.includes(r));case"select_columns":return pn.filter(t,(n,r)=>e.column_ids.includes(r));case"filter_rows":case"shuffle_rows":case"sample_rows":case"sort_column":return t;default:return Ld(e),t}}const mXt=({initialValue:e,columns:t,onChange:n,onInvalidChange:r,getColumnValues:i})=>{var m;const o=$8({resolver:T8(ZUt),defaultValues:e,mode:"onChange",reValidateMode:"onChange"}),{handleSubmit:s,watch:a,control:l}=o,c=Jn(w=>{n(w)}),u=Jn(w=>{r(w)});x.useEffect(()=>{const w=a(()=>{s(c,()=>{u(o.getValues())})()});return()=>w.unsubscribe()},[s,a,u,c,o]);const[f,d]=ie.useState(e.transforms.length>0?0:void 0),h=HQe({control:l,name:"transforms"}),p=o.watch("transforms"),g=f===void 0||(m=p[f])==null?void 0:m.type,v=ale._def.options.find(w=>QP(w)._def.value===g),y=x.useMemo(()=>{const w=p.slice(0,f);return pXt(w,t)},[t,p,f]),O=w=>{const S=V3(w),E=h.fields.length;h.append(S),d(E)};return b.jsx(P8.Provider,{value:y,children:b.jsx(ple.Provider,{value:i,children:b.jsxs("form",{onSubmit:w=>w.preventDefault(),className:"flex flex-row max-h-[400px] overflow-hidden bg-background",children:[b.jsx(yXt,{items:o.watch("transforms"),selected:f,onSelect:w=>{d(w)},onDelete:w=>{h.remove(w);const S=w-1;d(Math.max(S,0))},onAdd:O}),b.jsxs("div",{className:"flex flex-col flex-1 p-4 overflow-auto min-h-[200px] border-l",children:[f!==void 0&&v&&b.jsx(sXt,{form:o,schema:v,path:`transforms.${f}`},`transforms.${f}`),(f===void 0||!v)&&b.jsxs("div",{className:"flex flex-col items-center justify-center flex-grow gap-3",children:[b.jsx(cCt,{className:"w-8 h-8  text-muted-foreground"}),b.jsx(OBe,{onAdd:O,children:b.jsx(St,{"data-testid":"marimo-plugin-data-frames-add-transform",variant:"text",size:"xs",children:b.jsx("div",{className:"text-sm",children:"Select a transform to begin"})})})]})]})]})})})},yXt=({items:e,selected:t,onAdd:n,onSelect:r,onDelete:i})=>b.jsxs("div",{className:"flex flex-col overflow-y-hidden w-[150px] shadow-xs h-full",children:[b.jsx("div",{className:"flex flex-col overflow-y-auto flex-grow",children:e.map((o,s)=>b.jsxs("div",{onClick:()=>{r(s)},className:be("flex flex-row min-h-[40px] items-center px-2 cursor-pointer hover:bg-accent/50 text-sm overflow-hidden hover-actions-parent border border-muted border-l-2 border-l-transparent",{"border-l-primary bg-accent text-accent-foreground":t===s}),children:[b.jsx("div",{className:"flex-grow text-ellipsis",children:lD.startCase(o.type)}),b.jsx(AR,{className:"w-3 h-3 hover-action text-muted-foreground hover:text-destructive",onClick:a=>{i(s),a.stopPropagation()}})]},`${JSON.stringify(o)}-${s}`))}),b.jsx("div",{className:"flex flex-row flex-shrink-0",children:b.jsx(OBe,{onAdd:n,children:b.jsxs(St,{"data-testid":"marimo-plugin-data-frames-add-transform",variant:"text",className:"w-full rounded-none m-0 hover:text-accent-foreground",size:"xs",children:[b.jsx(poe,{className:"w-3 h-3 mr-1"}),"Add"]})})})]}),OBe=({onAdd:e,children:t})=>b.jsxs(Bb,{modal:!1,children:[b.jsx(Wb,{asChild:!0,children:t}),b.jsxs(R0,{className:"w-56",children:[b.jsx(f4e,{children:"Add Transform"}),b.jsx(qb,{}),b.jsxs(L5t,{children:[Object.values(ale._def.options).map(n=>{const r=QP(n),i=vXt[r._def.value];return b.jsxs(ll,{onSelect:o=>{o.stopPropagation(),e(n)},children:[b.jsx(i,{className:"w-3.5 h-3.5 mr-2"}),b.jsx("span",{children:lD.startCase(r._def.value)})]},r._def.value)}),b.jsx(ll,{onSelect:n=>{n.stopPropagation(),window.open("https://github.com/marimo-team/marimo/issues/new?title=New%20dataframe%20transform:&labels=enhancement&template=feature_request.yaml","_blank")},children:b.jsx("span",{className:"underline text-primary text-xs cursor-pointer",children:"Request a transform"})},"_request_")]})]})]}),vXt={aggregate:oz,column_conversion:NEt,filter_rows:BEt,group_by:ZEt,rename_column:mCt,select_columns:uCt,sort_column:xEt,shuffle_rows:_Ct,sample_rows:IEt};function bXt(e,t){const n=`${e}_next`,r=t.map(i=>`${n} = ${OXt(n,i)}`);return[`${n} = ${e}`,...r].join(`
`)}function OXt(e,t){switch(t.type){case"column_conversion":{const{column_id:n,data_type:r,errors:i}=t;return`${e}["${n}"].astype("${r}", errors="${i}")`}case"rename_column":{const{column_id:n,new_column_id:r}=t;return`${e}.rename(columns={"${n}": "${r}"})`}case"sort_column":{const{column_id:n,ascending:r,na_position:i}=t,o=nwe(`by="${n}"`,r?"":"ascending=False",i==="last"?"":`na_position="${i}"`);return`${e}.sort_values(${o})`}case"filter_rows":{const{operation:n,where:r}=t;if(r.length===0)return e;const i=r.map(s=>xXt(e,s));if(n==="keep_rows"&&i.length===1)return`${e}[${i[0]}]`;const o=i.map(s=>`(${s})`).join(" & ");return n==="keep_rows"?`${e}[${o}]`:`${e}[~(${o})]`}case"aggregate":{const{column_ids:n,aggregations:r}=t;return n.length===0?`${e}.agg(${N$(r)})`:`${e}.agg({${n.map(i=>`"${i}": ${N$(r)}`).join(", ")}})`}case"group_by":{const{column_ids:n,aggregation:r,drop_na:i}=t,o=nwe(N$(n),i?"dropna=True":"");return`${e}.groupby(${o}).${r}()`}case"select_columns":{const{column_ids:n}=t;return n.length===0?e:n.length===1?`${e}["${n[0]}"]`:`${e}[${N$(n)}]`}case"sample_rows":{const{n}=t;return`${e}.sample(n=${n})`}case"shuffle_rows":return`${e}.sample(frac=1)`;default:return Ld(t),""}}function xXt(e,t){const{column_id:n,operator:r,value:i}=t;switch(r){case"==":return`${e}["${n}"] == ${Al(i)}`;case"equals":return`${e}["${n}"].eq(${Al(i)})`;case"does_not_equal":return`${e}["${n}"].ne(${Al(i)})`;case"contains":return`${e}["${n}"].str.contains(${Al(i)})`;case"regex":return`${e}["${n}"].str.contains(${Al(i)}, regex=True)`;case"starts_with":return`${e}["${n}"].str.startswith(${Al(i)})`;case"ends_with":return`${e}["${n}"].str.endswith(${Al(i)})`;case"in":return`${e}["${n}"].isin(${N$(i)})`;case"!=":return`${e}["${n}"].ne(${Al(i)})`;case">":return`${e}["${n}"] > ${Al(i)}`;case">=":return`${e}["${n}"] >= ${Al(i)}`;case"<":return`${e}["${n}"] < ${Al(i)}`;case"<=":return`${e}["${n}"] <= ${Al(i)}`;case"is_nan":return`${e}["${n}"].isna()`;case"is_not_nan":return`${e}["${n}"].notna()`;case"is_true":return`${e}["${n}"].eq(True)`;case"is_false":return`${e}["${n}"].eq(False)`;default:return Ld(r),"df"}}function Al(e){return typeof e=="string"?`"${e}"`:`${e}`}function N$(e){return Array.isArray(e)?`[${e.map(Al).join(", ")}]`:Al(e)}function nwe(...e){return e.filter(Boolean).join(", ")}function Hr(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)xBe(e,arguments[t]);return e}function xBe(e,t){if(typeof t=="string")e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)xBe(e,t[n]);else throw new RangeError("Unsupported child node: "+t)}const rwe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class RE{constructor(t,n,r=0,i=t.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=o?a=>o(rwe(a)):rwe,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Rs(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=Lse(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Lu(t);let i=this.normalize(n);for(let o=0,s=r;;o++){let a=i.charCodeAt(o),l=this.match(a,s,this.bufferPos+this.bufferStart);if(o==i.length-1){if(l)return this.value=l,this;break}s==r&&o<n.length&&n.charCodeAt(o)==a&&s++}}}match(t,n,r){let i=null;for(let o=0;o<this.matches.length;o+=2){let s=this.matches[o],a=!1;this.query.charCodeAt(s)==t&&(s==this.query.length-1?i={from:this.matches[o+1],to:r}:(this.matches[o]++,a=!0)),a||(this.matches.splice(o,2),o-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?i={from:n,to:r}:this.matches.push(1,n)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(RE.prototype[Symbol.iterator]=function(){return this});const wBe={from:-1,to:-1,match:/.*/.exec("")},vle="gm"+(/x/.unicode==null?"":"u");class ble{constructor(t,n,r,i=0,o=t.length){if(this.text=t,this.to=o,this.curLine="",this.done=!1,this.value=wBe,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new SBe(t,n,r,i,o);this.re=new RegExp(n,vle+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.iter=t.iter();let s=t.lineAt(i);this.curLineStart=s.from,this.matchPos=U3(t,i),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=U3(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const CV=new WeakMap;class PS{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let i=CV.get(t);if(!i||i.from>=r||i.to<=n){let a=new PS(n,t.sliceString(n,r));return CV.set(t,a),a}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=t.sliceString(n,s)+o,s=n),i.to<r&&(o+=t.sliceString(i.to,r)),CV.set(t,new PS(s,o)),new PS(n,o.slice(n-s,r-s))}}class SBe{constructor(t,n,r,i,o){this.text=t,this.to=o,this.done=!1,this.value=wBe,this.matchPos=U3(t,i),this.re=new RegExp(n,vle+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=PS.get(t,i,this.chunkEnd(i+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=U3(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=PS.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(ble.prototype[Symbol.iterator]=SBe.prototype[Symbol.iterator]=function(){return this});function wXt(e){try{return new RegExp(e,vle),!0}catch{return!1}}function U3(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function sK(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),n=Hr("input",{class:"cm-textfield",name:"line",value:t}),r=Hr("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),e.dispatch({effects:H3.of(!1)}),e.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},Hr("label",e.state.phrase("Go to line"),": ",n)," ",Hr("button",{class:"cm-button",type:"submit"},e.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!o)return;let{state:s}=e,a=s.doc.lineAt(s.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:a.number;if(c&&f){let v=h/100;l&&(v=v*(l=="-"?-1:1)+a.number/s.doc.lines),h=Math.round(s.doc.lines*v)}else c&&l&&(h=h*(l=="-"?-1:1)+a.number);let p=s.doc.line(Math.max(1,Math.min(s.doc.lines,h))),g=Ae.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[H3.of(!1),Ve.scrollIntoView(g.from,{y:"center"})],selection:g}),e.focus()}return{dom:r}}const H3=jt.define(),iwe=di.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(H3)&&(e=n.value);return e},provide:e=>I0.from(e,t=>t?sK:null)}),SXt=e=>{let t=kP(e,sK);if(!t){let n=[H3.of(!0)];e.state.field(iwe,!1)==null&&n.push(jt.appendConfig.of([iwe,EXt])),e.dispatch({effects:n}),t=kP(e,sK)}return t&&t.dom.querySelector("input").select(),!0},EXt=Ve.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),CXt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},EBe=mt.define({combine(e){return Op(e,CXt,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function CBe(e){let t=[PXt,TXt];return e&&t.push(EBe.of(e)),t}const _Xt=st.mark({class:"cm-selectionMatch"}),kXt=st.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function owe(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=xi.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=xi.Word)}function $Xt(e,t,n,r){return e(t.sliceDoc(n,n+1))==xi.Word&&e(t.sliceDoc(r-1,r))==xi.Word}const TXt=jr.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(EBe),{state:n}=e,r=n.selection;if(r.ranges.length>1)return st.none;let i=r.main,o,s=null;if(i.empty){if(!t.highlightWordAroundCursor)return st.none;let l=n.wordAt(i.head);if(!l)return st.none;s=n.charCategorizer(i.head),o=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<t.minSelectionLength||l>200)return st.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!(owe(s,n,i.from,i.to)&&$Xt(s,n,i.from,i.to)))return st.none}else if(o=n.sliceDoc(i.from,i.to),!o)return st.none}let a=[];for(let l of e.visibleRanges){let c=new RE(n.doc,o,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!s||owe(s,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?a.push(kXt.range(u,f)):(u>=i.to||f<=i.from)&&a.push(_Xt.range(u,f)),a.length>t.maxMatches))return st.none}}return st.set(a)}},{decorations:e=>e.decorations}),PXt=Ve.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),AXt=({state:e,dispatch:t})=>{let{selection:n}=e,r=Ae.create(n.ranges.map(i=>e.wordAt(i.head)||Ae.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function RXt(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let s=!1,a=new RE(e.doc,t,r[r.length-1].to);;)if(a.next(),a.done){if(s)return null;a=new RE(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(l=>l.from==a.value.from))continue;if(o){let l=e.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const _Be=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(o=>o.from===o.to))return AXt({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(o=>e.sliceDoc(o.from,o.to)!=r))return!1;let i=RXt(e,r);return i?(t(e.update({selection:e.selection.addRange(Ae.range(i.from,i.to),!1),effects:Ve.scrollIntoView(i.to)})),!0):!1},b_=mt.define({combine(e){return Op(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new qXt(t),scrollToMatch:t=>Ve.scrollIntoView(t)})}});class Tv{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||wXt(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
`:r=="r"?"\r":r=="t"?"	":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new IXt(this):new MXt(this)}getCursor(t,n=0,r){let i=t.doc?t:dn.create({doc:t});return r==null&&(r=i.doc.length),this.regexp?Sw(this,i,n,r):ww(this,i,n,r)}}class kBe{constructor(t){this.spec=t}}function ww(e,t,n,r){return new RE(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:i=>i.toLowerCase(),e.wholeWord?DXt(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function DXt(e,t){return(n,r,i,o)=>((o>n||o+i.length<r)&&(o=Math.max(0,n-2),i=e.sliceString(o,Math.min(e.length,r+2))),(t(X3(i,n-o))!=xi.Word||t(Z3(i,n-o))!=xi.Word)&&(t(Z3(i,r-o))!=xi.Word||t(X3(i,r-o))!=xi.Word))}class MXt extends kBe{constructor(t){super(t)}nextMatch(t,n,r){let i=ww(this.spec,t,r,t.doc.length).nextOverlapping();return i.done&&(i=ww(this.spec,t,0,n).nextOverlapping()),i.done?null:i.value}prevMatchInRange(t,n,r){for(let i=r;;){let o=Math.max(n,i-1e4-this.spec.unquoted.length),s=ww(this.spec,t,o,i),a=null;for(;!s.nextOverlapping().done;)a=s.value;if(a)return a;if(o==n)return null;i-=1e4}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,n){let r=ww(this.spec,t,0,t.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let o=ww(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function Sw(e,t,n,r){return new ble(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?NXt(t.charCategorizer(t.selection.main.head)):void 0},n,r)}function X3(e,t){return e.slice(zs(e,t,!1),t)}function Z3(e,t){return e.slice(t,zs(e,t))}function NXt(e){return(t,n,r)=>!r[0].length||(e(X3(r.input,r.index))!=xi.Word||e(Z3(r.input,r.index))!=xi.Word)&&(e(Z3(r.input,r.index+r[0].length))!=xi.Word||e(X3(r.input,r.index+r[0].length))!=xi.Word)}class IXt extends kBe{nextMatch(t,n,r){let i=Sw(this.spec,t,r,t.doc.length).next();return i.done&&(i=Sw(this.spec,t,0,n).next()),i.done?null:i.value}prevMatchInRange(t,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),s=Sw(this.spec,t,o,r),a=null;for(;!s.next().done;)a=s.value;if(a&&(o==n||a.from>o+10))return a;if(o==n)return null}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(n,r)=>r=="$"?"$":r=="&"?t.match[0]:r!="0"&&+r<t.match.length?t.match[r]:n)}matchAll(t,n){let r=Sw(this.spec,t,0,t.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let o=Sw(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const B0=jt.define(),Ole=jt.define(),r0=di.define({create(e){return new _V(aK(e).create(),null)},update(e,t){for(let n of t.effects)n.is(B0)?e=new _V(n.value.create(),e.panel):n.is(Ole)&&(e=new _V(e.query,n.value?xle:null));return e},provide:e=>I0.from(e,t=>t.panel)});class _V{constructor(t,n){this.query=t,this.panel=n}}const LXt=st.mark({class:"cm-searchMatch"}),jXt=st.mark({class:"cm-searchMatch cm-searchMatch-selected"}),FXt=jr.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(r0))}update(e){let t=e.state.field(r0);(t!=e.startState.field(r0)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return st.none;let{view:n}=this,r=new Ol;for(let i=0,o=n.visibleRanges,s=o.length;i<s;i++){let{from:a,to:l}=o[i];for(;i<s-1&&l>o[i+1].from-2*250;)l=o[++i].to;e.highlight(n.state,a,l,(c,u)=>{let f=n.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?jXt:LXt)})}return r.finish()}},{decorations:e=>e.decorations});function cD(e){return t=>{let n=t.state.field(r0,!1);return n&&n.query.spec.valid?e(t,n):PBe(t)}}const Y3=cD((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=Ae.single(r.from,r.to),o=e.state.facet(b_);return e.dispatch({selection:i,effects:[wle(e,r),o.scrollToMatch(i.main,e)],userEvent:"select.search"}),TBe(e),!0}),G3=cD((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let o=Ae.single(i.from,i.to),s=e.state.facet(b_);return e.dispatch({selection:o,effects:[wle(e,i),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),TBe(e),!0}),zXt=cD((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:Ae.create(n.map(r=>Ae.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),QXt=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let a=new RE(e.doc,e.sliceDoc(r,i));!a.next().done;){if(o.length>1e3)return!1;a.value.from==r&&(s=o.length),o.push(Ae.range(a.value.from,a.value.to))}return t(e.update({selection:Ae.create(o,s),userEvent:"select.search.matches"})),!0},swe=cD((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,r,r);if(!o)return!1;let s=[],a,l,c=[];if(o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),c.push(Ve.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),o){let u=s.length==0||s[0].from>=o.to?0:o.to-o.from-l.length;a=Ae.single(o.from-u,o.to-u),c.push(wle(e,o)),c.push(n.facet(b_).scrollToMatch(a.main,e))}return e.dispatch({changes:s,selection:a,effects:c,userEvent:"input.replace"}),!0}),BXt=cD((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:t.getReplacement(i)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Ve.announce.of(r),userEvent:"input.replace.all"}),!0});function xle(e){return e.state.facet(b_).createPanel(e)}function aK(e,t){var n,r,i,o,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let c=e.facet(b_);return new Tv({search:((n=t==null?void 0:t.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=t==null?void 0:t.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=t==null?void 0:t.literal)!==null&&i!==void 0?i:c.literal,regexp:(o=t==null?void 0:t.regexp)!==null&&o!==void 0?o:c.regexp,wholeWord:(s=t==null?void 0:t.wholeWord)!==null&&s!==void 0?s:c.wholeWord})}function $Be(e){let t=kP(e,xle);return t&&t.dom.querySelector("[main-field]")}function TBe(e){let t=$Be(e);t&&t==e.root.activeElement&&t.select()}const PBe=e=>{let t=e.state.field(r0,!1);if(t&&t.panel){let n=$Be(e);if(n&&n!=e.root.activeElement){let r=aK(e.state,t.query.spec);r.valid&&e.dispatch({effects:B0.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Ole.of(!0),t?B0.of(aK(e.state,t.query.spec)):jt.appendConfig.of(UXt)]});return!0},ABe=e=>{let t=e.state.field(r0,!1);if(!t||!t.panel)return!1;let n=kP(e,xle);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Ole.of(!1)}),!0},WXt=[{key:"Mod-f",run:PBe,scope:"editor search-panel"},{key:"F3",run:Y3,shift:G3,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Y3,shift:G3,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ABe,scope:"editor search-panel"},{key:"Mod-Shift-l",run:QXt},{key:"Mod-Alt-g",run:SXt},{key:"Mod-d",run:_Be,preventDefault:!0}];class qXt{constructor(t){this.view=t;let n=this.query=t.state.field(r0).query.spec;this.commit=this.commit.bind(this),this.searchField=Hr("input",{value:n.search,placeholder:Oc(t,"Find"),"aria-label":Oc(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Hr("input",{value:n.replace,placeholder:Oc(t,"Replace"),"aria-label":Oc(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Hr("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Hr("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Hr("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return Hr("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=Hr("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Y3(t),[Oc(t,"next")]),r("prev",()=>G3(t),[Oc(t,"previous")]),r("select",()=>zXt(t),[Oc(t,"all")]),Hr("label",null,[this.caseField,Oc(t,"match case")]),Hr("label",null,[this.reField,Oc(t,"regexp")]),Hr("label",null,[this.wordField,Oc(t,"by word")]),...t.state.readOnly?[]:[Hr("br"),this.replaceField,r("replace",()=>swe(t),[Oc(t,"replace")]),r("replaceAll",()=>BXt(t),[Oc(t,"replace all")])],Hr("button",{name:"close",onclick:()=>ABe(t),"aria-label":Oc(t,"close"),type:"button"},["×"])])}commit(){let t=new Tv({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:B0.of(t)}))}keydown(t){B4t(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?G3:Y3)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),swe(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(B0)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(b_).top}}function Oc(e,t){return e.state.phrase(t)}const IN=30,LN=/[\s\.,:;?!]/;function wle(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,o=Math.max(r.from,t-IN),s=Math.min(i,n+IN),a=e.state.sliceDoc(o,s);if(o!=r.from){for(let l=0;l<IN;l++)if(!LN.test(a[l+1])&&LN.test(a[l])){a=a.slice(l);break}}if(s!=i){for(let l=a.length-1;l>a.length-IN;l--)if(!LN.test(a[l-1])&&LN.test(a[l])){a=a.slice(0,l);break}}return Ve.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}const VXt=Ve.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),UXt=[r0,Ks.low(FXt),VXt];class Sle{constructor(t,n,r){this.state=t,this.pos=n,this.explicit=r,this.abortListeners=[]}tokenBefore(t){let n=kr(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(DBe(t,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(t,n){t=="abort"&&this.abortListeners&&this.abortListeners.push(n)}}function awe(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function HXt(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let o=1;o<i.length;o++)n[i[o]]=!0}let r=awe(t)+awe(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function Ele(e){let t=e.map(i=>typeof i=="string"?{label:i}:i),[n,r]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:HXt(t);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:t,validFor:n}:null}}function RBe(e,t){return n=>{for(let r=kr(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(e.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return t(n)}}class lwe{constructor(t,n,r,i){this.completion=t,this.source=n,this.match=r,this.score=i}}function i0(e){return e.selection.main.from}function DBe(e,t){var n;let{source:r}=e,i=t&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?e:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const MBe=bp.define();function XXt(e,t,n,r){let{main:i}=e.selection,o=n-i.from,s=r-i.from;return Object.assign(Object.assign({},e.changeByRange(a=>a!=i&&n!=r&&e.sliceDoc(a.from+o,a.from+s)!=e.sliceDoc(n,r)?{range:a}:{changes:{from:a.from+o,to:r==i.from?a.to:a.from+s,insert:t},range:Ae.cursor(a.from+o+t.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const cwe=new WeakMap;function ZXt(e){if(!Array.isArray(e))return e;let t=cwe.get(e);return t||cwe.set(e,t=Ele(e)),t}const K3=jt.define(),BP=jt.define();class YXt{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<t.length;){let r=Rs(t,n),i=Lu(r);this.chars.push(r);let o=t.slice(n,n+i),s=o.toUpperCase();this.folded.push(Rs(s==o?o.toLowerCase():s,0)),n+=i}this.astral=t.length!=this.chars.length}ret(t,n){return this.score=t,this.matched=n,this}match(t){if(this.pattern.length==0)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:n,folded:r,any:i,precise:o,byWord:s}=this;if(n.length==1){let O=Rs(t,0),m=Lu(O),w=m==t.length?0:-100;if(O!=n[0])if(O==r[0])w+=-200;else return null;return this.ret(w,[0,m])}let a=t.indexOf(this.pattern);if(a==0)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=n.length,c=0;if(a<0){for(let O=0,m=Math.min(t.length,200);O<m&&c<l;){let w=Rs(t,O);(w==n[c]||w==r[c])&&(i[c++]=O),O+=Lu(w)}if(c<l)return null}let u=0,f=0,d=!1,h=0,p=-1,g=-1,v=/[a-z]/.test(t),y=!0;for(let O=0,m=Math.min(t.length,200),w=0;O<m&&f<l;){let S=Rs(t,O);a<0&&(u<l&&S==n[u]&&(o[u++]=O),h<l&&(S==n[h]||S==r[h]?(h==0&&(p=O),g=O+1,h++):h=0));let E,C=S<255?S>=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(E=Lse(S))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!O||C==1&&v||w==0&&C!=0)&&(n[f]==S||r[f]==S&&(d=!0)?s[f++]=O:s.length&&(y=!1)),w=C,O+=Lu(S)}return f==l&&s[0]==0&&y?this.result(-100+(d?-200:0),s,t):h==l&&p==0?this.ret(-200-t.length+(g==t.length?0:-100),[0,g]):a>-1?this.ret(-700-t.length,[a,a+this.pattern.length]):h==l?this.ret(-900-t.length,[p,g]):f==l?this.result(-100+(d?-200:0)+-700+(y?0:-1100),s,t):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,t)}result(t,n,r){let i=[],o=0;for(let s of n){let a=s+(this.astral?Lu(Rs(r,s)):1);o&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return this.ret(t-r.length,i)}}class GXt{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let n=t.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(t.length==this.pattern.length?0:-100),this)}}const js=mt.define({combine(e){return Op(e,{activateOnTyping:!0,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:KXt,filterStrict:!1,compareCompletions:(t,n)=>t.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>r=>uwe(t(r),n(r)),optionClass:(t,n)=>r=>uwe(t(r),n(r)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function uwe(e,t){return e?t?e+" "+t:e:t}function KXt(e,t,n,r,i,o){let s=e.textDirection==ti.RTL,a=s,l=!1,c="top",u,f,d=t.left-i.left,h=i.right-t.right,p=r.right-r.left,g=r.bottom-r.top;if(a&&d<Math.min(p,h)?a=!1:!a&&h<Math.min(p,d)&&(a=!0),p<=(a?d:h))u=Math.max(i.top,Math.min(n.top,i.bottom-g))-t.top,f=Math.min(400,a?d:h);else{l=!0,f=Math.min(400,(s?t.right:i.right-t.left)-30);let O=i.bottom-t.bottom;O>=g||O>t.top?u=n.bottom-t.top:(c="bottom",u=t.bottom-n.top)}let v=(t.bottom-t.top)/o.offsetHeight,y=(t.right-t.left)/o.offsetWidth;return{style:`${c}: ${u/v}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(l?s?"left-narrow":"right-narrow":a?"left":"right")}}function JXt(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),t.push({render(n,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let c=0;c<o.length;){let u=o[c++],f=o[c++];u>l&&s.appendChild(document.createTextNode(a.slice(l,u)));let d=s.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(u,f))),d.className="cm-completionMatchedText",l=f}return l<a.length&&s.appendChild(document.createTextNode(a.slice(l))),s},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),t.sort((n,r)=>n.position-r.position).map(n=>n.render)}function kV(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let i=Math.floor(t/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class eZt{constructor(t,n,r){this.view=t,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=t.state.field(n),{options:o,selected:s}=i.open,a=t.state.facet(js);this.optionContent=JXt(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=kV(o.length,s,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=t.state.field(n).open;for(let u=l.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]<c.length){this.applyCompletion(t,c[+f[1]]),l.preventDefault();return}}),this.dom.addEventListener("focusout",l=>{let c=t.state.field(this.stateField,!1);c&&c.tooltip&&t.state.facet(js).closeOnBlur&&l.relatedTarget!=t.contentDOM&&t.dispatch({effects:BP.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let r=t.state.field(this.stateField),i=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),r!=i){let{options:o,selected:s,disabled:a}=r.open;(!i.open||i.open.options!=o)&&(this.range=kV(o.length,s,t.state.facet(js).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;if((n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=kV(n.options.length,n.selected,this.view.state.facet(js).maxRenderedOptions),this.showOptions(n.options,t.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(s,r)}).catch(s=>Bl(this.view.state,s,"completion info")):this.addInfoPane(o,r)}}addInfoPane(t,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",t.nodeType!=null)r.appendChild(t),this.infoDestroy=null;else{let{dom:i,destroy:o}=t;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==t?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&nZt(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=t.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:s.innerWidth,bottom:s.innerHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottom<Math.max(o.top,n.top)+10?null:this.view.state.facet(js).positionInfo(this.view,n,i,r,o,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));let o=null;for(let s=r.from;s<r.to;s++){let{completion:a,match:l}=t[s],{section:c}=a;if(c){let d=typeof c=="string"?c:c.name;if(d!=o&&(s>r.from||r.from==0))if(o=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=n+"-"+s,u.setAttribute("role","option");let f=this.optionClass(a);f&&(u.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<t.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function tZt(e,t){return n=>new eZt(n,e,t)}function nZt(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function fwe(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function rZt(e,t){let n=[],r=null,i=c=>{n.push(c);let{section:u}=c.completion;if(u){r||(r=[]);let f=typeof u=="string"?u:u.name;r.some(d=>d.name==f)||r.push(typeof u=="string"?{name:f}:u)}},o=t.facet(js);for(let c of e)if(c.hasResult()){let u=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)i(new lwe(f,c.source,u?u(f):[],1e9-n.length));else{let f=t.sliceDoc(c.from,c.to),d,h=o.filterStrict?new GXt(f):new YXt(f);for(let p of c.result.options)if(d=h.match(p.label)){let g=p.displayLabel?u?u(p,d.matched):[]:d.matched;i(new lwe(p,c.source,g,d.score+(p.boost||0)))}}}if(r){let c=Object.create(null),u=0,f=(d,h)=>{var p,g;return((p=d.rank)!==null&&p!==void 0?p:1e9)-((g=h.rank)!==null&&g!==void 0?g:1e9)||(d.name<h.name?-1:1)};for(let d of r.sort(f))u-=1e5,c[d.name]=u;for(let d of n){let{section:h}=d.completion;h&&(d.score+=c[typeof h=="string"?h:h.name])}}let s=[],a=null,l=o.compareCompletions;for(let c of n.sort((u,f)=>f.score-u.score||l(u.completion,f.completion))){let u=c.completion;!a||a.label!=u.label||a.detail!=u.detail||a.type!=null&&u.type!=null&&a.type!=u.type||a.apply!=u.apply||a.boost!=u.boost?s.push(c):fwe(c.completion)>fwe(a)&&(s[s.length-1]=c),a=c.completion}return s}class Vw{constructor(t,n,r,i,o,s){this.options=t,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new Vw(this.options,dwe(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,o){let s=rZt(t,n);if(!s.length)return i&&t.some(l=>l.state==1)?new Vw(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let a=n.facet(js).selectOnOpen?0:-1;if(i&&i.selected!=a&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;c<s.length;c++)if(s[c].completion==l){a=c;break}}return new Vw(s,dwe(r,a),{pos:t.reduce((l,c)=>c.hasResult()?Math.min(l,c.from):l,1e8),create:lZt,above:o.aboveCursor},i?i.timestamp:Date.now(),a,!1)}map(t){return new Vw(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class J3{constructor(t,n,r){this.active=t,this.id=n,this.open=r}static start(){return new J3(sZt,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(js),o=(r.override||n.languageDataAt("autocomplete",i0(n)).map(ZXt)).map(a=>(this.active.find(c=>c.source==a)||new rl(a,this.active.some(c=>c.state!=0)?1:0)).update(t,r));o.length==this.active.length&&o.every((a,l)=>a==this.active[l])&&(o=this.active);let s=this.open;s&&t.docChanged&&(s=s.map(t.changes)),t.selection||o.some(a=>a.hasResult()&&t.changes.touchesRange(a.from,a.to))||!iZt(o,this.active)?s=Vw.build(o,n,this.id,s,r):s&&s.disabled&&!o.some(a=>a.state==1)&&(s=null),!s&&o.every(a=>a.state!=1)&&o.some(a=>a.hasResult())&&(o=o.map(a=>a.hasResult()?new rl(a.source,0):a));for(let a of t.effects)a.is(IBe)&&(s=s&&s.setSelected(a.value,this.id));return o==this.active&&s==this.open?this:new J3(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:oZt}}function iZt(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult;)n++;for(;r<t.length&&!t[r].hasResult;)r++;let i=n==e.length,o=r==t.length;if(i||o)return i==o;if(e[n++].result!=t[r++].result)return!1}}const oZt={"aria-autocomplete":"list"};function dwe(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const sZt=[];function lK(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class rl{constructor(t,n,r=-1){this.source=t,this.state=n,this.explicitPos=r}hasResult(){return!1}update(t,n){let r=lK(t),i=this;r?i=i.handleUserEvent(t,r,n):t.docChanged?i=i.handleChange(t):t.selection&&i.state!=0&&(i=new rl(i.source,0));for(let o of t.effects)if(o.is(K3))i=new rl(i.source,1,o.value?i0(t.state):-1);else if(o.is(BP))i=new rl(i.source,0);else if(o.is(NBe))for(let s of o.value)s.source==i.source&&(i=s);return i}handleUserEvent(t,n,r){return n=="delete"||!r.activateOnTyping?this.map(t.changes):new rl(this.source,1)}handleChange(t){return t.changes.touchesRange(i0(t.startState))?new rl(this.source,0):this.map(t.changes)}map(t){return t.empty||this.explicitPos<0?this:new rl(this.source,this.state,t.mapPos(this.explicitPos))}}class AS extends rl{constructor(t,n,r,i,o){super(t,2,n),this.result=r,this.from=i,this.to=o}hasResult(){return!0}handleUserEvent(t,n,r){var i;let o=this.result;o.map&&!t.changes.empty&&(o=o.map(o,t.changes));let s=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),l=i0(t.state);if((this.explicitPos<0?l<=s:l<this.from)||l>a||!o||n=="delete"&&i0(t.startState)==this.from)return new rl(this.source,n=="input"&&r.activateOnTyping?1:0);let c=this.explicitPos<0?-1:t.changes.mapPos(this.explicitPos);return aZt(o.validFor,t.state,s,a)?new AS(this.source,c,o,s,a):o.update&&(o=o.update(o,s,a,new Sle(t.state,l,c>=0)))?new AS(this.source,c,o,o.from,(i=o.to)!==null&&i!==void 0?i:i0(t.state)):new rl(this.source,1,c)}handleChange(t){return t.changes.touchesRange(this.from,this.to)?new rl(this.source,0):this.map(t.changes)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new AS(this.source,this.explicitPos<0?-1:t.mapPos(this.explicitPos),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new rl(this.source,0)}}function aZt(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e=="function"?e(i,n,r,t):DBe(e,!0).test(i)}const NBe=jt.define({map(e,t){return e.map(n=>n.map(t))}}),IBe=jt.define(),il=di.define({create(){return J3.start()},update(e,t){return e.update(t)},provide:e=>[Yse.from(e,t=>t.tooltip),Ve.contentAttributes.from(e,t=>t.attrs)]});function Cle(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(il).active.find(i=>i.source==t.source);return r instanceof AS?(typeof n=="string"?e.dispatch(Object.assign(Object.assign({},XXt(e.state,n,r.from,r.to)),{annotations:MBe.of(t.completion)})):n(e,t.completion,r.from,r.to),!0):!1}const lZt=tZt(il,Cle);function jN(e,t="option"){return n=>{let r=n.state.field(il,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(js).interactionDelay)return!1;let i=1,o;t=="page"&&(o=E6e(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:s-1;return a<0?a=t=="page"?0:s-1:a>=s&&(a=t=="page"?s-1:0),n.dispatch({effects:IBe.of(a)}),!0}}const LBe=e=>{let t=e.state.field(il,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(js).interactionDelay?!1:Cle(e,t.open.options[t.open.selected])},cZt=e=>e.state.field(il,!1)?(e.dispatch({effects:K3.of(!0)}),!0):!1,eF=e=>{let t=e.state.field(il,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:BP.of(null)}),!0)};class uZt{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const fZt=50,dZt=1e3,hZt=jr.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(il).active)t.state==1&&this.startQuery(t)}update(e){let t=e.state.field(il);if(!e.selectionSet&&!e.docChanged&&e.startState.field(il)==t)return;let n=e.transactions.some(i=>(i.selection||i.docChanged)&&!lK(i));for(let i=0;i<this.running.length;i++){let o=this.running[i];if(n||o.updates.length+e.transactions.length>fZt&&Date.now()-o.time>dZt){for(let s of o.context.abortListeners)try{s()}catch(a){Bl(this.view.state,a)}o.context.abortListeners=null,this.running.splice(i--,1)}else o.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(i=>i.effects.some(o=>o.is(K3)))&&(this.pendingStart=!0);let r=this.pendingStart?50:e.state.facet(js).activateOnTypingDelay;if(this.debounceUpdate=t.active.some(i=>i.state==1&&!this.running.some(o=>o.active.source==i.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let i of e.transactions)lK(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(il);for(let n of t.active)n.state==1&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n)}startQuery(e){let{state:t}=this.view,n=i0(t),r=new Sle(t,n,e.explicitPos==n),i=new uZt(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:BP.of(null)}),Bl(this.view.state,o)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(js).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(js);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let s=new AS(i.active.source,i.active.explicitPos,i.done,i.done.from,(e=i.done.to)!==null&&e!==void 0?e:i0(i.updates.length?i.updates[0].startState:this.view.state));for(let a of i.updates)s=s.update(a,n);if(s.hasResult()){t.push(s);continue}}let o=this.view.state.field(il).active.find(s=>s.source==i.active.source);if(o&&o.state==1)if(i.done==null){let s=new rl(i.active.source,0);for(let a of i.updates)s=s.update(a,n);s.state!=1&&t.push(s)}else this.startQuery(o)}t.length&&this.view.dispatch({effects:NBe.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(il,!1);if(t&&t.tooltip&&this.view.state.facet(js).closeOnBlur){let n=t.open&&E6e(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:BP.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:K3.of(!1)}),20),this.composing=0}}}),pZt=typeof navigator=="object"&&/Win/.test(navigator.platform),gZt=Ks.highest(Ve.domEventHandlers({keydown(e,t){let n=t.state.field(il,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(pZt&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(s=>s.source==r.source),o=r.completion.commitCharacters||i.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&Cle(t,r),!1}})),jBe=Ve.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class mZt{constructor(t,n,r,i){this.field=t,this.line=n,this.from=r,this.to=i}}class _le{constructor(t,n,r){this.field=t,this.from=n,this.to=r}map(t){let n=t.mapPos(this.from,-1,qo.TrackDel),r=t.mapPos(this.to,1,qo.TrackDel);return n==null||r==null?null:new _le(this.field,n,r)}}class kle{constructor(t,n){this.lines=t,this.fieldPositions=n}instantiate(t,n){let r=[],i=[n],o=t.doc.lineAt(n),s=/^\s*/.exec(o.text)[0];for(let l of this.lines){if(r.length){let c=s,u=/^\t*/.exec(l)[0].length;for(let f=0;f<u;f++)c+=t.facet(Gg);i.push(n+c.length-u),l=c+l.slice(u)}r.push(l),n+=l.length+1}let a=this.fieldPositions.map(l=>new _le(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(t){let n=[],r=[],i=[],o;for(let s of t.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(s);){let a=o[1]?+o[1]:null,l=o[2]||o[3]||"",c=-1;for(let u=0;u<n.length;u++)(a!=null?n[u].seq==a:l&&n[u].name==l)&&(c=u);if(c<0){let u=0;for(;u<n.length&&(a==null||n[u].seq!=null&&n[u].seq<a);)u++;n.splice(u,0,{seq:a,name:l}),c=u;for(let f of i)f.field>=c&&f.field++}i.push(new mZt(c,r.length,o.index,o.index+l.length)),s=s.slice(0,o.index)+l+s.slice(o.index+o[0].length)}for(let a;a=/\\([{}])/.exec(s);){s=s.slice(0,a.index)+a[1]+s.slice(a.index+a[0].length);for(let l of i)l.line==r.length&&l.from>a.index&&(l.from--,l.to--)}r.push(s)}return new kle(r,i)}}let yZt=st.widget({widget:new class extends hu{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),vZt=st.mark({class:"cm-snippetField"});class O_{constructor(t,n){this.ranges=t,this.active=n,this.deco=st.set(t.map(r=>(r.from==r.to?yZt:vZt).range(r.from,r.to)))}map(t){let n=[];for(let r of this.ranges){let i=r.map(t);if(!i)return null;n.push(i)}return new O_(n,this.active)}selectionInsideField(t){return t.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const uD=jt.define({map(e,t){return e&&e.map(t)}}),bZt=jt.define(),WP=di.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(uD))return n.value;if(n.is(bZt)&&e)return new O_(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Ve.decorations.from(e,t=>t?t.deco:st.none)});function $le(e,t){return Ae.create(e.filter(n=>n.field==t).map(n=>Ae.range(n.from,n.to)))}function OZt(e){let t=kle.parse(e);return(n,r,i,o)=>{let{text:s,ranges:a}=t.instantiate(n.state,i),l={changes:{from:i,to:o,insert:Gn.of(s)},scrollIntoView:!0,annotations:r?[MBe.of(r),Co.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=$le(a,0)),a.some(c=>c.field>0)){let c=new O_(a,0),u=l.effects=[uD.of(c)];n.state.field(WP,!1)===void 0&&u.push(jt.appendConfig.of([WP,CZt,_Zt,jBe]))}n.dispatch(n.state.update(l))}}function FBe(e){return({state:t,dispatch:n})=>{let r=t.field(WP,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,o=e>0&&!r.ranges.some(s=>s.field==i+e);return n(t.update({selection:$le(r.ranges,i),effects:uD.of(o?null:new O_(r.ranges,i)),scrollIntoView:!0})),!0}}const xZt=({state:e,dispatch:t})=>e.field(WP,!1)?(t(e.update({effects:uD.of(null)})),!0):!1,wZt=FBe(1),SZt=FBe(-1),EZt=[{key:"Tab",run:wZt,shift:SZt},{key:"Escape",run:xZt}],hwe=mt.define({combine(e){return e.length?e[0]:EZt}}),CZt=Ks.highest(wi.compute([hwe],e=>e.facet(hwe)));function Ti(e,t){return Object.assign(Object.assign({},t),{apply:OZt(e)})}const _Zt=Ve.domEventHandlers({mousedown(e,t){let n=t.state.field(WP,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(o=>o.from<=r&&o.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:$le(n.ranges,i.field),effects:uD.of(n.ranges.some(o=>o.field>i.field)?new O_(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),qP={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},z1=jt.define({map(e,t){let n=t.mapPos(e,-1,qo.TrackAfter);return n??void 0}}),Tle=new class extends Ub{};Tle.startSide=1;Tle.endSide=-1;const zBe=di.define({create(){return Dn.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of t.effects)n.is(z1)&&(e=e.update({add:[Tle.range(n.value,n.value+1)]}));return e}});function QBe(){return[$Zt,zBe]}const $V="()[]{}<>";function BBe(e){for(let t=0;t<$V.length;t+=2)if($V.charCodeAt(t)==e)return $V.charAt(t+1);return Lse(e<128?e:e+1)}function WBe(e,t){return e.languageDataAt("closeBrackets",t)[0]||qP}const kZt=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),$Zt=Ve.inputHandler.of((e,t,n,r)=>{if((kZt?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&Lu(Rs(r,0))==1||t!=i.from||n!=i.to)return!1;let o=PZt(e.state,r);return o?(e.dispatch(o),!0):!1}),TZt=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=WBe(e,e.selection.main.head).brackets||qP.brackets,i=null,o=e.changeByRange(s=>{if(s.empty){let a=AZt(e.doc,s.head);for(let l of r)if(l==a&&I8(e.doc,s.head)==BBe(Rs(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:Ae.cursor(s.head-l.length)}}return{range:i=s}});return i||t(e.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},qBe=[{key:"Backspace",run:TZt}];function PZt(e,t){let n=WBe(e,e.selection.main.head),r=n.brackets||qP.brackets;for(let i of r){let o=BBe(Rs(i,0));if(t==i)return o==i?MZt(e,i,r.indexOf(i+i+i)>-1,n):RZt(e,i,o,n.before||qP.before);if(t==o&&VBe(e,e.selection.main.from))return DZt(e,i,o)}return null}function VBe(e,t){let n=!1;return e.field(zBe).between(0,e.doc.length,r=>{r==t&&(n=!0)}),n}function I8(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Lu(Rs(n,0)))}function AZt(e,t){let n=e.sliceString(t-2,t);return Lu(Rs(n,0))==n.length?n:n.slice(1)}function RZt(e,t,n,r){let i=null,o=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:n,from:s.to}],effects:z1.of(s.to+t.length),range:Ae.range(s.anchor+t.length,s.head+t.length)};let a=I8(e.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:s.head},effects:z1.of(s.head+t.length),range:Ae.cursor(s.head+t.length)}:{range:i=s}});return i?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function DZt(e,t,n){let r=null,i=e.changeByRange(o=>o.empty&&I8(e.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:Ae.cursor(o.head+n.length)}:r={range:o});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function MZt(e,t,n,r){let i=r.stringPrefixes||qP.stringPrefixes,o=null,s=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:t,from:a.to}],effects:z1.of(a.to+t.length),range:Ae.range(a.anchor+t.length,a.head+t.length)};let l=a.head,c=I8(e.doc,l),u;if(c==t){if(pwe(e,l))return{changes:{insert:t+t,from:l},effects:z1.of(l+t.length),range:Ae.cursor(l+t.length)};if(VBe(e,l)){let d=n&&e.sliceDoc(l,l+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:l,to:l+d.length,insert:d},range:Ae.cursor(l+d.length)}}}else{if(n&&e.sliceDoc(l-2*t.length,l)==t+t&&(u=gwe(e,l-2*t.length,i))>-1&&pwe(e,u))return{changes:{insert:t+t+t+t,from:l},effects:z1.of(l+t.length),range:Ae.cursor(l+t.length)};if(e.charCategorizer(l)(c)!=xi.Word&&gwe(e,l,i)>-1&&!NZt(e,l,t,i))return{changes:{insert:t+t,from:l},effects:z1.of(l+t.length),range:Ae.cursor(l+t.length)}}return{range:o=a}});return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function pwe(e,t){let n=kr(e).resolveInner(t+1);return n.parent&&n.from==t}function NZt(e,t,n,r){let i=kr(e).resolveInner(t,-1),o=r.reduce((s,a)=>Math.max(s,a.length),0);for(let s=0;s<5;s++){let a=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+l;){if(e.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function gwe(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=xi.Word)return t;for(let i of n){let o=t-i.length;if(e.sliceDoc(o,t)==i&&r(e.sliceDoc(o-1,o))!=xi.Word)return o}return-1}function L8(e={}){return[gZt,il,js.of(e),hZt,IZt,jBe]}const Ple=[{key:"Ctrl-Space",run:cZt},{key:"Escape",run:eF},{key:"ArrowDown",run:jN(!0)},{key:"ArrowUp",run:jN(!1)},{key:"PageDown",run:jN(!0,"page")},{key:"PageUp",run:jN(!1,"page")},{key:"Enter",run:LBe}],IZt=Ks.highest(wi.computeN([js],e=>e.facet(js).defaultKeymap?[Ple]:[]));function cK(e){let t=e.field(il,!1);return t&&t.active.some(n=>n.state==1)?"pending":t&&t.active.some(n=>n.state!=0)?"active":null}class LZt{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class _1{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let i=t,o=r.facet(ZBe).markerFilter;o&&(i=o(i,r));let s=st.set(i.map(a=>a.from==a.to||a.from==a.to-1&&r.doc.lineAt(a.from).to==a.from?st.widget({widget:new VZt(a),diagnostic:a}).range(a.from):st.mark({attributes:{class:"cm-lintRange cm-lintRange-"+a.severity+(a.markClass?" "+a.markClass:"")},diagnostic:a,inclusive:!0}).range(a.from,a.to)),!0);return new _1(s,n,DE(s))}}function DE(e,t=null,n=0){let r=null;return e.between(n,1e9,(i,o,{spec:s})=>{if(!(t&&s.diagnostic!=t))return r=new LZt(i,o,s.diagnostic),!1}),r}function jZt(e,t){let n=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(r=>r.is(Ale))||e.changes.touchesRange(n.from,n.to))}function UBe(e,t){return e.field(Vc,!1)?t:t.concat(jt.appendConfig.of(XZt))}function FZt(e,t){return{effects:UBe(e,[Ale.of(t)])}}const Ale=jt.define(),Rle=jt.define(),HBe=jt.define(),Vc=di.define({create(){return new _1(st.none,null,null)},update(e,t){if(t.docChanged){let n=e.diagnostics.map(t.changes),r=null;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=DE(n,e.selected.diagnostic,i)||DE(n,null,i)}e=new _1(n,e.panel,r)}for(let n of t.effects)n.is(Ale)?e=_1.init(n.value,e.panel,t.state):n.is(Rle)?e=new _1(e.diagnostics,n.value?j8.open:null,e.selected):n.is(HBe)&&(e=new _1(e.diagnostics,e.panel,n.value));return e},provide:e=>[I0.from(e,t=>t.panel),Ve.decorations.from(e,t=>t.diagnostics)]}),zZt=st.mark({class:"cm-lintRange cm-lintRange-active",inclusive:!0});function QZt(e,t,n){let{diagnostics:r}=e.state.field(Vc),i=[],o=2e8,s=0;r.between(t-(n<0?1:0),t+(n>0?1:0),(l,c,{spec:u})=>{t>=l&&t<=c&&(l==c||(t>l||n>0)&&(t<c||n<0))&&(i.push(u.diagnostic),o=Math.min(l,o),s=Math.max(c,s))});let a=e.state.facet(ZBe).tooltipFilter;return a&&(i=a(i,e.state)),i.length?{pos:o,end:s,above:e.state.doc.lineAt(o).to<s,create(){return{dom:BZt(e,i)}}}:null}function BZt(e,t){return Hr("ul",{class:"cm-tooltip-lint"},t.map(n=>GBe(e,n,!1)))}const WZt=e=>{let t=e.state.field(Vc,!1);(!t||!t.panel)&&e.dispatch({effects:UBe(e.state,[Rle.of(!0)])});let n=kP(e,j8.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},mwe=e=>{let t=e.state.field(Vc,!1);return!t||!t.panel?!1:(e.dispatch({effects:Rle.of(!1)}),!0)},qZt=e=>{let t=e.state.field(Vc,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},XBe=[{key:"Mod-Shift-m",run:WZt,preventDefault:!0},{key:"F8",run:qZt}],ZBe=mt.define({combine(e){return Object.assign({sources:e.map(t=>t.source).filter(t=>t!=null)},Op(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(t,n)=>t?n?r=>t(r)||n(r):t:n}))}});function YBe(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!t.some(o=>o.toLowerCase()==i.toLowerCase())){t.push(i);continue e}}t.push("")}return t}function GBe(e,t,n){var r;let i=n?YBe(t.actions):[];return Hr("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Hr("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),(r=t.actions)===null||r===void 0?void 0:r.map((o,s)=>{let a=!1,l=d=>{if(d.preventDefault(),a)return;a=!0;let h=DE(e.state.field(Vc).diagnostics,t);h&&o.apply(e,h.from,h.to)},{name:c}=o,u=i[s]?c.indexOf(i[s]):-1,f=u<0?c:[c.slice(0,u),Hr("u",c.slice(u,u+1)),c.slice(u+1)];return Hr("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[s]})"`}.`},f)}),t.source&&Hr("div",{class:"cm-diagnosticSource"},t.source))}class VZt extends hu{constructor(t){super(),this.diagnostic=t}eq(t){return t.diagnostic==this.diagnostic}toDOM(){return Hr("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class ywe{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=GBe(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class j8{constructor(t){this.view=t,this.items=[];let n=i=>{if(i.keyCode==27)mwe(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=YBe(o.actions);for(let a=0;a<s.length;a++)if(s[a].toUpperCase().charCodeAt(0)==i.keyCode){let l=DE(this.view.state.field(Vc).diagnostics,o);l&&o.actions[a].apply(t,l.from,l.to)}}else return;i.preventDefault()},r=i=>{for(let o=0;o<this.items.length;o++)this.items[o].dom.contains(i.target)&&this.moveSelection(o)};this.list=Hr("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=Hr("div",{class:"cm-panel-lint"},this.list,Hr("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>mwe(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Vc).selected;if(!t)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==t.diagnostic)return n;return-1}update(){let{diagnostics:t,selected:n}=this.view.state.field(Vc),r=0,i=!1,o=null;for(t.between(0,this.view.state.doc.length,(s,a,{spec:l})=>{let c=-1,u;for(let f=r;f<this.items.length;f++)if(this.items[f].diagnostic==l.diagnostic){c=f;break}c<0?(u=new ywe(this.view,l.diagnostic),this.items.splice(r,0,u),i=!0):(u=this.items[c],c>r&&(this.items.splice(r,c-r),i=!0)),n&&u.diagnostic==n.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),o=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),r++});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new ywe(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:s,panel:a})=>{let l=a.height/this.list.offsetHeight;s.top<a.top?this.list.scrollTop-=(a.top-s.top)/l:s.bottom>a.bottom&&(this.list.scrollTop+=(s.bottom-a.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let t=this.list.firstChild;function n(){let r=t;t=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;t!=r.dom;)n();t=r.dom.nextSibling}else this.list.insertBefore(r.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(Vc),r=DE(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:HBe.of(r)})}static open(t){return new j8(t)}}function UZt(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function FN(e){return UZt(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const HZt=Ve.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:FN("#d11")},".cm-lintRange-warning":{backgroundImage:FN("orange")},".cm-lintRange-info":{backgroundImage:FN("#999")},".cm-lintRange-hint":{backgroundImage:FN("#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}}}),XZt=[Vc,Ve.decorations.compute([Vc],e=>{let{selected:t,panel:n}=e.field(Vc);return!t||!n||t.from==t.to?st.none:st.set([zZt.range(t.from,t.to)])}),Gse(QZt,{hideOn:jZt}),HZt];var vwe=function(t){t===void 0&&(t={});var{crosshairCursor:n=!1}=t,r=[];t.closeBracketsKeymap!==!1&&(r=r.concat(qBe)),t.defaultKeymap!==!1&&(r=r.concat(x3)),t.searchKeymap!==!1&&(r=r.concat(WXt)),t.historyKeymap!==!1&&(r=r.concat(fae)),t.foldKeymap!==!1&&(r=r.concat(H6e)),t.completionKeymap!==!1&&(r=r.concat(Ple)),t.lintKeymap!==!1&&(r=r.concat(XBe));var i=[];return t.lineNumbers!==!1&&i.push(T6e()),t.highlightActiveLineGutter!==!1&&i.push(P6e()),t.highlightSpecialChars!==!1&&i.push(Hse()),t.history!==!1&&i.push(t8()),t.foldGutter!==!1&&i.push(Y6e()),t.drawSelection!==!1&&i.push(Use()),t.dropCursor!==!1&&i.push(O6e()),t.allowMultipleSelections!==!1&&i.push(dn.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&i.push(j6e()),t.syntaxHighlighting!==!1&&i.push(Gz(nae,{fallback:!0})),t.bracketMatching!==!1&&i.push(tze()),t.closeBrackets!==!1&&i.push(QBe()),t.autocompletion!==!1&&i.push(L8()),t.rectangularSelection!==!1&&i.push(w6e()),n!==!1&&i.push(y7t()),t.highlightActiveLine!==!1&&i.push(x6e()),t.highlightSelectionMatches!==!1&&i.push(CBe()),t.tabSize&&typeof t.tabSize=="number"&&i.push(Gg.of(" ".repeat(t.tabSize))),i.concat([wi.of(r.flat())]).filter(Boolean)},ZZt=function(t){t===void 0&&(t={});var n=[];t.defaultKeymap!==!1&&(n=n.concat(x3)),t.historyKeymap!==!1&&(n=n.concat(fae));var r=[];return t.highlightSpecialChars!==!1&&r.push(Hse()),t.history!==!1&&r.push(t8()),t.drawSelection!==!1&&r.push(Use()),t.syntaxHighlighting!==!1&&r.push(Gz(nae,{fallback:!0})),r.concat([wi.of(n.flat())]).filter(Boolean)};const YZt="#e5c07b",bwe="#e06c75",GZt="#56b6c2",KZt="#ffffff",G5="#abb2bf",uK="#7d8799",JZt="#61afef",eYt="#98c379",Owe="#d19a66",tYt="#c678dd",nYt="#21252b",xwe="#2c313a",wwe="#282c34",TV="#353a42",rYt="#3E4451",Swe="#528bff",iYt=Ve.theme({"&":{color:G5,backgroundColor:wwe},".cm-content":{caretColor:Swe},".cm-cursor, .cm-dropCursor":{borderLeftColor:Swe},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:rYt},".cm-panels":{backgroundColor:nYt,color:G5},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:wwe,color:uK,border:"none"},".cm-activeLineGutter":{backgroundColor:xwe},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:TV},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:TV,borderBottomColor:TV},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:xwe,color:G5}}},{dark:!0}),oYt=GR.define([{tag:K.keyword,color:tYt},{tag:[K.name,K.deleted,K.character,K.propertyName,K.macroName],color:bwe},{tag:[K.function(K.variableName),K.labelName],color:JZt},{tag:[K.color,K.constant(K.name),K.standard(K.name)],color:Owe},{tag:[K.definition(K.name),K.separator],color:G5},{tag:[K.typeName,K.className,K.number,K.changed,K.annotation,K.modifier,K.self,K.namespace],color:YZt},{tag:[K.operator,K.operatorKeyword,K.url,K.escape,K.regexp,K.link,K.special(K.string)],color:GZt},{tag:[K.meta,K.comment],color:uK},{tag:K.strong,fontWeight:"bold"},{tag:K.emphasis,fontStyle:"italic"},{tag:K.strikethrough,textDecoration:"line-through"},{tag:K.link,color:uK,textDecoration:"underline"},{tag:K.heading,fontWeight:"bold",color:bwe},{tag:[K.atom,K.bool,K.special(K.variableName)],color:Owe},{tag:[K.processingInstruction,K.string,K.inserted],color:eYt},{tag:K.invalid,color:KZt}]),KBe=[iYt,Gz(oYt)];var sYt=Ve.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Q1=function(t){t===void 0&&(t={});var{indentWithTab:n=!0,editable:r=!0,readOnly:i=!1,theme:o="light",placeholder:s="",basicSetup:a=!0}=t,l=[];switch(n&&l.unshift(wi.of([Uze])),a&&(typeof a=="boolean"?l.unshift(vwe()):l.unshift(vwe(a))),s&&l.unshift(Xse(s)),o){case"light":l.push(sYt);break;case"dark":l.push(KBe);break;case"none":break;default:l.push(o);break}return r===!1&&l.push(Ve.editable.of(!1)),i&&l.push(dn.readOnly.of(!0)),[...l]},aYt=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)}),Ewe=bp.define(),lYt=[];function cYt(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:o,onUpdate:s,extensions:a=lYt,autoFocus:l,theme:c="light",height:u=null,minHeight:f=null,maxHeight:d=null,width:h=null,minWidth:p=null,maxWidth:g=null,placeholder:v="",editable:y=!0,readOnly:O=!1,indentWithTab:m=!0,basicSetup:w=!0,root:S,initialState:E}=e,[C,k]=x.useState(),[P,D]=x.useState(),[M,L]=x.useState(),A=Ve.theme({"&":{height:u,minHeight:f,maxHeight:d,width:h,minWidth:p,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),T=Ve.updateListener.of(z=>{if(z.docChanged&&typeof r=="function"&&!z.transactions.some(q=>q.annotation(Ewe))){var W=z.state.doc,F=W.toString();r(F,z)}i&&i(aYt(z))}),N=Q1({theme:c,editable:y,readOnly:O,placeholder:v,indentWithTab:m,basicSetup:w}),j=[T,A,...N];return s&&typeof s=="function"&&j.push(Ve.updateListener.of(s)),j=j.concat(a),x.useEffect(()=>{if(C&&!M){var z={doc:t,selection:n,extensions:j},W=E?dn.fromJSON(E.json,z,E.fields):dn.create(z);if(L(W),!P){var F=new Ve({state:W,parent:C,root:S});D(F),o&&o(F,W)}}return()=>{P&&(L(void 0),D(void 0))}},[C,M]),x.useEffect(()=>k(e.container),[e.container]),x.useEffect(()=>()=>{P&&(P.destroy(),D(void 0))},[P]),x.useEffect(()=>{l&&P&&P.focus()},[l,P]),x.useEffect(()=>{P&&P.dispatch({effects:jt.reconfigure.of(j)})},[c,a,u,f,d,h,p,g,v,y,O,m,w,r,s]),x.useEffect(()=>{if(t!==void 0){var z=P?P.state.doc.toString():"";P&&t!==z&&P.dispatch({changes:{from:0,to:z.length,insert:t||""},annotations:[Ewe.of(!0)]})}},[t,P]),{state:M,setState:L,view:P,setView:D,container:C,setContainer:k}}var uYt=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Dle=x.forwardRef((e,t)=>{var{className:n,value:r="",selection:i,extensions:o=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:f="light",height:d,minHeight:h,maxHeight:p,width:g,minWidth:v,maxWidth:y,basicSetup:O,placeholder:m,indentWithTab:w,editable:S,readOnly:E,root:C,initialState:k}=e,P=$o(e,uYt),D=x.useRef(null),{state:M,view:L,container:A}=cYt({container:D.current,root:C,value:r,autoFocus:u,theme:f,height:d,minHeight:h,maxHeight:p,width:g,minWidth:v,maxWidth:y,basicSetup:O,placeholder:m,indentWithTab:w,editable:S,readOnly:E,selection:i,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:o,initialState:k});if(x.useImperativeHandle(t,()=>({editor:D.current,state:M,view:L}),[D,A,M,L]),typeof r!="string")throw new Error("value must be typeof string but got "+typeof r);var T=typeof f=="string"?"cm-theme-"+f:"cm-theme";return b.jsx("div",oe({ref:D,className:""+T+(n?" "+n:"")},P))});Dle.displayName="CodeMirror";var Cwe={};let fYt=class fK{constructor(t,n,r,i,o,s,a,l,c,u=0,f){this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,r=0){let i=t.parser.context;return new fK(t,[],n,r,r,0,[],0,i?new _we(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let r=t>>19,i=t&65535,{parser:o}=this.p,s=o.dynamicPrecedence(i);if(s&&(this.score+=s),r==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,4,!0),this.reduceContext(i,this.reducePos);return}let a=this.stack.length-(r-1)*3-(t&262144?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from,c=this.reducePos-l;c>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=c));let u=a?this.stack[a-1]:0,f=this.bufferBase+this.buffer.length-u;if(i<o.minRepeatTerm||t&131072){let d=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,l,d,f+4,!0)}if(t&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=o.getGoto(d,i,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(i,l)}storeNode(t,n,r,i=4,o=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,a=this.buffer.length;if(a==0&&s.parent&&(a=s.bufferBase-s.parent.bufferBase,s=s.parent),a>0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==r)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(t,n,r,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4);this.buffer[s]=t,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(t,n,r,i){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let o=t,{parser:s}=this.p;(i>this.pos||n<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}}apply(t,n,r,i){t&65536?this.reduce(t):this.shift(t,n,r,i)}useNode(t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=t)&&(this.p.reused.push(t),r++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(;n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new fK(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let r=t<=this.p.parser.maxNode;r&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new dYt(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;o<n.length;o+=2)(s=n[o+1])!=this.state&&this.p.parser.hasAction(s,t)&&i.push(n[o],s);if(this.stack.length<120)for(let o=0;i.length<8&&o<n.length;o+=2){let s=n[o+1];i.some((a,l)=>l&1&&a==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let o=n[i+1];if(o==this.state)continue;let s=this.split();s.pushState(o,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[i],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:t}=this.p,n=t.stateSlot(this.state,5);if(!(n&65536))return!1;if(!t.validAction(this.state,n)){let r=n>>19,i=n&65535,o=this.stack.length-r*3;if(o<0||t.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),t.allActions(i,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-o;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&t.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(s,o+1);if(a!=null)return a}})};return r(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:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=t.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(n)))}reduceContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(n)))}emitContext(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let n=new _we(this.curContext.tracker,t);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(t){t>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=t)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};class _we{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class dYt{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,r=t>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class tF{constructor(t,n,r){this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new tF(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.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 tF(this.stack,this.pos,this.index)}}function I$(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let r=0,i=0;r<e.length;){let o=0;for(;;){let s=e.charCodeAt(r++),a=!1;if(s==126){o=65535;break}s>=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),o+=l,a)break;o*=46}n?n[i++]=o:n=new t(o)}return n}class K5{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const kwe=new K5;class hYt{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=kwe,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let r=this.range,i=this.rangeIndex,o=this.pos+t;for(;o<r.from;){if(!i)return null;let s=this.ranges[--i];o-=r.from-s.to,r=s}for(;n<0?o>r.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let n of this.ranges)if(n.to>t)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+t,i=this.chunk.charCodeAt(n);else{let o=this.resolveOffset(t,1);if(o==null)return-1;if(r=o,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(t,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=r}acceptTokenTo(t,n){this.token.value=t,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),n=this.pos+t.length;this.chunk=n>this.range.to?t.slice(0,this.range.to-this.pos):t,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(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,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(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=kwe,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,n){if(t>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>t&&(r+=this.input.read(Math.max(i.from,t),Math.min(i.to,n)))}return r}}class RS{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:r}=n.p;JBe(this.data,t,n,this.id,r.data,r.tokenPrecTable)}}RS.prototype.contextual=RS.prototype.fallback=RS.prototype.extend=!1;class nF{constructor(t,n,r){this.precTable=n,this.elseToken=r,this.data=typeof t=="string"?I$(t):t}token(t,n){let r=t.pos,i=0;for(;;){let o=t.next<0,s=t.resolveOffset(1,1);if(JBe(this.data,t,n,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(o||i++,s==null)break;t.reset(s,t.token)}i&&(t.reset(r,t.token),t.acceptToken(this.elseToken,i))}}nF.prototype.contextual=RS.prototype.fallback=RS.prototype.extend=!1;class $l{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function JBe(e,t,n,r,i,o){let s=0,a=1<<r,{dialect:l}=n.p.parser;e:for(;a&e[s];){let c=e[s+1];for(let h=s+3;h<c;h+=2)if((e[h+1]&a)>0){let p=e[h];if(l.allows(p)&&(t.token.value==-1||t.token.value==p||pYt(p,t.token.value,i,o))){t.acceptToken(p);break}}let u=t.next,f=0,d=e[s+2];if(t.next<0&&d>f&&e[c+d*3-3]==65535){s=e[c+d*3-1];continue e}for(;f<d;){let h=f+d>>1,p=c+h+(h<<1),g=e[p],v=e[p+1]||65536;if(u<g)d=h;else if(u>=v)f=h+1;else{s=e[p+2],t.advance();continue e}}break}}function $we(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function pYt(e,t,n,r){let i=$we(n,r,t);return i<0||$we(n,r,e)<i}const xc=typeof process<"u"&&Cwe&&/\bparse\b/.test(Cwe.LOG);let PV=null;function Twe(e,t,n){let r=e.cursor(Wr.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}let gYt=class{constructor(t,n){this.fragments=t,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 t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?Twe(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?Twe(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[i],s=this.start[n]+r.positions[i];if(s>t)return this.nextStart=s,null;if(o instanceof Bn){if(s==t){if(s<this.safeFrom)return null;let a=s+o.length;if(a<=this.safeTo){let l=o.prop(Zt.lookAhead);if(!l||a+l<this.fragment.to)return o}}this.index[n]++,s+o.length>=Math.max(this.safeFrom,t)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}};class mYt{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(r=>new K5)}getActions(t){let n=0,r=null,{parser:i}=t.p,{tokenizers:o}=i,s=i.stateSlot(t.state,3),a=t.curContext?t.curContext.hash:0,l=0;for(let c=0;c<o.length;c++){if(!(1<<c&s))continue;let u=o[c],f=this.tokens[c];if(!(r&&!u.fallback)&&((u.contextual||f.start!=t.pos||f.mask!=s||f.context!=a)&&(this.updateCachedToken(f,u,t),f.mask=s,f.context=a),f.lookAhead>f.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=n;if(f.extended>-1&&(n=this.addActions(t,f.extended,f.end,n)),n=this.addActions(t,f.value,f.end,n),!u.extend&&(r=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&t.setLookAhead(l),!r&&t.pos==this.stream.end&&(r=new K5,r.value=t.p.parser.eofTerm,r.start=r.end=t.pos,n=this.addActions(t,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new K5,{pos:r,p:i}=t;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(t,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,t),r),t.value>-1){let{parser:o}=r.p;for(let s=0;s<o.specialized.length;s++)if(o.specialized[s]==t.value){let a=o.specializers[s](this.stream.read(t.start,t.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){a&1?t.extended=a>>1:t.value=a>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,n,r,i){for(let o=0;o<i;o+=3)if(this.actions[o]==t)return i;return this.actions[i++]=t,this.actions[i++]=n,this.actions[i++]=r,i}addActions(t,n,r,i){let{state:o}=t,{parser:s}=t.p,{data:a}=s;for(let l=0;l<2;l++)for(let c=s.stateSlot(o,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=ng(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(ng(a,c+2),n,r,i));break}a[c]==n&&(i=this.putAction(ng(a,c+1),n,r,i))}return i}}class yYt{constructor(t,n,r,i){this.parser=t,this.input=n,this.ranges=i,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 hYt(n,i),this.tokens=new mYt(t,this.stream),this.topTerm=t.top[1];let{from:o}=i[0];this.stacks=[fYt.start(this,t.top[0],o)],this.fragments=r.length&&this.stream.end-o>t.bufferLength*4?new gYt(r,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&t.length==1){let[s]=t;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<t.length;s++){let a=t[s];for(;;){if(this.tokens.mainToken=null,a.pos>n)r.push(a);else{if(this.advanceStack(a,r,t))continue;{i||(i=[],o=[]),i.push(a);let l=this.tokens.getMainToken(a);o.push(l.value,l.end)}}break}}if(!r.length){let s=i&&bYt(i);if(s)return xc&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw xc&&i&&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&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return xc&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((a,l)=>l.score-a.score);r.length>s;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let a=r[s];for(let l=s+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)r[s].pos<this.minStackPos&&(this.minStackPos=r[s].pos);return null}stopAt(t){if(this.stoppedAt!=null&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,n,r){let i=t.pos,{parser:o}=this,s=xc?this.stackID(t)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let c=t.curContext&&t.curContext.tracker.strict,u=c?t.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(t.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(Zt.contextHash)||0)==u))return t.useNode(f,d),xc&&console.log(s+this.stackID(t)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof Bn)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof Bn&&f.positions[0]==0)f=h;else break}}let a=o.stateSlot(t.state,4);if(a>0)return t.reduce(a),xc&&console.log(s+this.stackID(t)+` (via always-reduce ${o.getName(a&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let l=this.tokens.getActions(t);for(let c=0;c<l.length;){let u=l[c++],f=l[c++],d=l[c++],h=c==l.length||!r,p=h?t:t.split(),g=this.tokens.mainToken;if(p.apply(u,f,g?g.start:p.pos,d),xc&&console.log(s+this.stackID(p)+` (via ${u&65536?`reduce of ${o.getName(u&65535)}`:"shift"} for ${o.getName(f)} @ ${i}${p==t?"":", split"})`),h)return!0;p.pos>i?n.push(p):r.push(p)}return!1}advanceFully(t,n){let r=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>r)return Pwe(t,n),!0}}runRecovery(t,n,r){let i=null,o=!1;for(let s=0;s<t.length;s++){let a=t[s],l=n[s<<1],c=n[(s<<1)+1],u=xc?this.stackID(a)+" -> ":"";if(a.deadEnd&&(o||(o=!0,a.restart(),xc&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=u;for(let h=0;f.forceReduce()&&h<10&&(xc&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)xc&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))xc&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),xc&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),Pwe(a,r)):(!i||i.score<a.score)&&(i=a)}return i}stackToTree(t){return t.close(),Bn.build({buffer:tF.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let n=(PV||(PV=new WeakMap)).get(t);return n||PV.set(t,n=String.fromCodePoint(this.nextStackID++)),n+t}}function Pwe(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class vYt{constructor(t,n,r){this.source=t,this.flags=n,this.disabled=r}allows(t){return!this.disabled||this.disabled[t]==0}}const AV=e=>e;class Mle{constructor(t){this.start=t.start,this.shift=t.shift||AV,this.reduce=t.reduce||AV,this.reuse=t.reuse||AV,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class lO extends Wz{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;a<t.repeatNodeCount;a++)n.push("");let r=Object.keys(t.topRules).map(a=>t.topRules[a][1]),i=[];for(let a=0;a<n.length;a++)i.push([]);function o(a,l,c){i[a].push([l,l.deserialize(String(c))])}if(t.nodeProps)for(let a of t.nodeProps){let l=a[0];typeof l=="string"&&(l=Zt[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=0)o(u,l,a[c++]);else{let f=a[c+-u];for(let d=-u;d>0;d--)o(a[c++],l,f);c++}}}this.nodeSet=new r_(n.map((a,l)=>To.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(l)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=H4e;let s=I$(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(Awe),this.states=I$(t.states,Uint32Array),this.data=I$(t.stateData),this.goto=I$(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(a=>typeof a=="number"?new RS(s,a):a),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,r){let i=new yYt(this,t,n,r);for(let o of this.wrappers)i=o(i,t,n,r);return i}getGoto(t,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],a=s&1,l=i[o++];if(a&&r)return l;for(let c=o+(s>>1);o<c;o++)if(i[o]==t)return l;if(a)return-1}}hasAction(t,n){let r=this.data;for(let i=0;i<2;i++)for(let o=this.stateSlot(t,i?2:1),s;;o+=3){if((s=r[o])==65535)if(r[o+1]==1)s=r[o=ng(r,o+2)];else{if(r[o+1]==2)return ng(r,o+2);break}if(s==n||s==0)return ng(r,o+1)}return 0}stateSlot(t,n){return this.states[t*6+n]}stateFlag(t,n){return(this.stateSlot(t,0)&n)>0}validAction(t,n){return!!this.allActions(t,r=>r==n?!0:null)}allActions(t,n){let r=this.stateSlot(t,4),i=r?n(r):void 0;for(let o=this.stateSlot(t,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=ng(this.data,o+2);else break;i=n(ng(this.data,o+1))}return i}nextStates(t){let n=[];for(let r=this.stateSlot(t,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=ng(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(t){let n=Object.assign(Object.create(lO.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let r=this.topRules[t.top];if(!r)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=r}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=t.tokenizers.find(o=>o.from==r);return i?i.to:r})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=t.specializers.find(a=>a.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=Awe(s),s})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(t)for(let o of t.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;o<n.length;o++)if(!r[o])for(let s=this.dialects[n[o]],a;(a=this.data[s++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new vYt(t,r,i)}static deserialize(t){return new lO(t)}}function ng(e,t){return e[t]|e[t+1]<<16}function bYt(e){let t=null;for(let n of e){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function Awe(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}const OYt=1,eWe=196,tWe=197,xYt=198,Rwe=199,wYt=200,SYt=201,EYt=202,CYt=2,_Yt=203,kYt=204,$Yt=3,TYt=205,PYt=206,AYt=4,RYt=207,DYt=208,MYt=5,NYt=209,IYt=26,LYt=27,jYt=51,FYt=52,zYt=57,QYt=58,BYt=59,WYt=61,qYt=62,VYt=63,UYt=64,HYt=65,XYt=67,ZYt=246,YYt=74,GYt=265,KYt=129,JYt=150,eGt=151,tGt=154,VP=10,UP=13,Nle=32,F8=9,Ile=35,nGt=40,rGt=46,Dwe=123,nWe=39,rWe=34,iGt=92,oGt=new Set([LYt,jYt,FYt,GYt,XYt,KYt,QYt,BYt,ZYt,UYt,HYt,YYt,qYt,VYt,JYt,eGt,tGt]);function RV(e){return e==VP||e==UP}const sGt=new $l((e,t)=>{let n;if(e.next<0)e.acceptToken(SYt);else if(t.context.depth<0)RV(e.next)&&e.acceptToken(wYt,1);else if(((n=e.peek(-1))<0||RV(n))&&t.canShift(Rwe)){let r=0;for(;e.next==Nle||e.next==F8;)e.advance(),r++;(e.next==VP||e.next==UP||e.next==Ile)&&e.acceptToken(Rwe,-r)}else RV(e.next)&&e.acceptToken(xYt,1)},{contextual:!0}),aGt=new $l((e,t)=>{let n=t.context.depth;if(n<0)return;let r=e.peek(-1);if(r==VP||r==UP){let i=0,o=0;for(;;){if(e.next==Nle)i++;else if(e.next==F8)i+=8-i%8;else break;e.advance(),o++}i!=n&&e.next!=VP&&e.next!=UP&&e.next!=Ile&&(i<n?e.acceptToken(tWe,-o):e.acceptToken(eWe))}});function dK(e,t){this.parent=e,this.depth=t,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)}const lGt=new dK(null,0);function cGt(e){let t=0;for(let n=0;n<e.length;n++)t+=e.charCodeAt(n)==F8?8-t%8:1;return t}const uGt=new Mle({start:lGt,reduce(e,t){return e.depth<0&&oGt.has(t)?e.parent:e},shift(e,t,n,r){return t==eWe?new dK(e,cGt(r.read(r.pos,n.pos))):t==tWe?e.parent:t==IYt||t==zYt||t==WYt?new dK(e,-1):e},hash(e){return e.hash}}),fGt=new $l(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(!(n==Nle||n==F8)){n!=nGt&&n!=rGt&&n!=VP&&n!=UP&&n!=Ile&&e.acceptToken(OYt);return}}});function z8(e,t,n,r,i){return new $l(o=>{let s=o.pos;for(;!(o.next<0);)if(o.next==Dwe)if(o.peek(1)==Dwe)o.advance(2);else{if(o.pos==s){o.acceptToken(r,1);return}break}else if(o.next==iGt)o.advance(),o.next>=0&&o.advance();else if(o.next==e&&(t==1||o.peek(1)==e&&o.peek(2)==e)){if(o.pos==s){o.acceptToken(i,t);return}break}else o.advance();o.pos>s&&o.acceptToken(n)})}const dGt=z8(nWe,1,EYt,CYt,_Yt),hGt=z8(rWe,1,kYt,$Yt,TYt),pGt=z8(nWe,3,PYt,AYt,RYt),gGt=z8(rWe,3,DYt,MYt,NYt),mGt=YO({'async "*" "**" FormatConversion FormatSpec':K.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":K.controlKeyword,"in not and or is del":K.operatorKeyword,"from def class global nonlocal lambda":K.definitionKeyword,import:K.moduleKeyword,"with as print":K.keyword,Boolean:K.bool,None:K.null,VariableName:K.variableName,"CallExpression/VariableName":K.function(K.variableName),"FunctionDefinition/VariableName":K.function(K.definition(K.variableName)),"ClassDefinition/VariableName":K.definition(K.className),PropertyName:K.propertyName,"CallExpression/MemberExpression/PropertyName":K.function(K.propertyName),Comment:K.lineComment,Number:K.number,String:K.string,FormatString:K.special(K.string),UpdateOp:K.updateOperator,"ArithOp!":K.arithmeticOperator,BitOp:K.bitwiseOperator,CompareOp:K.compareOperator,AssignOp:K.definitionOperator,Ellipsis:K.punctuation,At:K.meta,"( )":K.paren,"[ ]":K.squareBracket,"{ }":K.brace,".":K.derefOperator,", ;":K.separator}),yGt={__proto__:null,await:48,or:58,and:60,in:64,not:66,is:68,if:74,else:76,lambda:80,yield:98,from:100,async:106,for:108,None:168,True:170,False:170,del:184,pass:188,break:192,continue:196,return:200,raise:208,import:212,as:214,global:218,nonlocal:220,assert:224,elif:234,while:238,try:244,except:246,finally:248,with:252,def:256,class:266,match:277,case:283},vGt=lO.deserialize({version:14,states:"#!OO`Q#yOOP$_OSOOO%hQ&nO'#H^OOQS'#Cq'#CqOOQS'#Cr'#CrO'WQ#xO'#CpO(yQ&nO'#H]OOQS'#H^'#H^OOQS'#DW'#DWOOQS'#H]'#H]O)gQ#xO'#DaO)zQ#xO'#DhO*[Q#xO'#DlOOQS'#Dw'#DwO*oO,UO'#DwO*wO7[O'#DwO+POWO'#DxO+[O`O'#DxO+gOpO'#DxO+rO!bO'#DxO-tQ&nO'#G}OOQS'#G}'#G}O'WQ#xO'#G|O/WQ&nO'#G|OOQS'#Ee'#EeO/oQ#xO'#EfOOQS'#G{'#G{O/yQ#xO'#GzOOQV'#Gz'#GzO0UQ#xO'#FXOOQS'#G`'#G`O0ZQ#xO'#FWOOQV'#IS'#ISOOQV'#Gy'#GyOOQV'#Fp'#FpQ`Q#yOOO'WQ#xO'#CsO0iQ#xO'#DPO0pQ#xO'#DTO1OQ#xO'#HbO1`Q&nO'#EYO'WQ#xO'#EZOOQS'#E]'#E]OOQS'#E_'#E_OOQS'#Ea'#EaO1tQ#xO'#EcO2[Q#xO'#EgO0UQ#xO'#EiO2oQ&nO'#EiO0UQ#xO'#ElO/oQ#xO'#EoO/oQ#xO'#EsO/oQ#xO'#EvO2zQ#xO'#ExO3RQ#xO'#E}O3^Q#xO'#EyO/oQ#xO'#E}O0UQ#xO'#FPO0UQ#xO'#FUO3cQ#xO'#FZP3jO#xO'#GxPOOO)CBl)CBlOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Ck'#CkOOQS'#Cl'#ClOOQS'#Cn'#CnO'WQ#xO,59QO'WQ#xO,59QO'WQ#xO,59QO'WQ#xO,59QO'WQ#xO,59QO'WQ#xO,59QO3uQ#xO'#DqOOQS,5:[,5:[O4YQ#xO'#HlOOQS,5:_,5:_O4gQMlO,5:_O4lQ&nO,59[O0iQ#xO,59dO0iQ#xO,59dO0iQ#xO,59dO7[Q#xO,59dO7aQ#xO,59dO7hQ#xO,59lO7oQ#xO'#H]O8uQ#xO'#H[OOQS'#H['#H[OOQS'#D^'#D^O9^Q#xO,59cO'WQ#xO,59cO9lQ#xO,59cOOQS,59{,59{O9qQ#xO,5:TO'WQ#xO,5:TOOQS,5:S,5:SO:PQ#xO,5:SO:UQ#xO,5:ZO'WQ#xO,5:ZO'WQ#xO,5:XOOQS,5:W,5:WO:gQ#xO,5:WO:lQ#xO,5:YOOOO'#Fx'#FxO:qO,UO,5:cOOQS,5:c,5:cOOOO'#Fy'#FyO:yO7[O,5:cO;RQ#xO'#DyOOOW'#Fz'#FzO;cOWO,5:dOOQS,5:d,5:dO;RQ#xO'#D}OOO`'#F}'#F}O;nO`O,5:dO;RQ#xO'#EOOOOp'#GO'#GOO;yOpO,5:dO;RQ#xO'#EPOOO!b'#GP'#GPO<UO!bO,5:dOOQS'#GQ'#GQO<aQ&nO,5:lO?RQ&nO,5=hO?lQ!LUO,5=hO@]Q&nO,5=hOOQS,5;Q,5;QO@tQ#yO'#GYOBTQ#xO,5;]OOQV,5=f,5=fOB`Q&nO'#IOOBwQ#xO,5;sOOQS-E:^-E:^OOQV,5;r,5;rO3XQ#xO'#FPOOQV-E9n-E9nOCPQ&nO,59_OEWQ&nO,59kOEqQ#xO'#H_OE|Q#xO'#H_O0UQ#xO'#H_OFXQ#xO'#DVOFaQ#xO,59oOFfQ#xO'#HcO'WQ#xO'#HcO/oQ#xO,5=|OOQS,5=|,5=|O/oQ#xO'#EUOOQS'#EV'#EVOGTQ#xO'#GSOGeQ#xO,59OOGeQ#xO,59OO)mQ#xO,5:rOGsQ&nO'#HeOOQS,5:u,5:uOOQS,5:},5:}OHWQ#xO,5;ROHiQ#xO,5;TOOQS'#GV'#GVOHwQ&nO,5;TOIVQ#xO,5;TOI[Q#xO'#IROOQS,5;W,5;WOIjQ#xO'#H}OOQS,5;Z,5;ZO3^Q#xO,5;_O3^Q#xO,5;bOI{Q&nO'#ITO'WQ#xO'#ITOJVQ#xO,5;dO2zQ#xO,5;dO/oQ#xO,5;iO0UQ#xO,5;kOJ[Q#yO'#EtOKeQ#{O,5;eONvQ#xO'#IUO3^Q#xO,5;iO! RQ#xO,5;kO! WQ#xO,5;pO! `Q&nO,5;uO'WQ#xO,5;uPOOO,5=d,5=dP! gOSO,5=dP! lO#xO,5=dO!$aQ&nO1G.lO!$hQ&nO1G.lO!'XQ&nO1G.lO!'cQ&nO1G.lO!)|Q&nO1G.lO!*aQ&nO1G.lO!*tQ#xO'#HkO!+SQ&nO'#G}O/oQ#xO'#HkO!+^Q#xO'#HjOOQS,5:],5:]O!+fQ#xO,5:]O!+kQ#xO'#HmO!+vQ#xO'#HmO!,ZQ#xO,5>WOOQS'#Du'#DuOOQS1G/y1G/yOOQS1G/O1G/OO!-ZQ&nO1G/OO!-bQ&nO1G/OO0iQ#xO1G/OO!-}Q#xO1G/WOOQS'#D]'#D]O/oQ#xO,59vOOQS1G.}1G.}O!.UQ#xO1G/gO!.fQ#xO1G/gO!.nQ#xO1G/hO'WQ#xO'#HdO!.sQ#xO'#HdO!.xQ&nO1G.}O!/YQ#xO,59kO!0`Q#xO,5>SO!0pQ#xO,5>SO!0xQ#xO1G/oO!0}Q&nO1G/oOOQS1G/n1G/nO!1_Q#xO,5=}O!2UQ#xO,5=}O/oQ#xO1G/sO!2sQ#xO1G/uO!2xQ&nO1G/uO!3YQ&nO1G/sOOQS1G/r1G/rOOQS1G/t1G/tOOOO-E9v-E9vOOQS1G/}1G/}OOOO-E9w-E9wO!3jQ#xO'#HwO/oQ#xO'#HwO!3xQ#xO,5:eOOOW-E9x-E9xOOQS1G0O1G0OO!4TQ#xO,5:iOOO`-E9{-E9{O!4`Q#xO,5:jOOOp-E9|-E9|O!4kQ#xO,5:kOOO!b-E9}-E9}OOQS-E:O-E:OO!4vQ!LUO1G3SO!5gQ&nO1G3SO'WQ#xO,5<mOOQS,5<m,5<mOOQS-E:P-E:POOQS,5<t,5<tOOQS-E:W-E:WOOQV1G0w1G0wO0UQ#xO'#GUO!6OQ&nO,5>jOOQS1G1_1G1_O!6gQ#xO1G1_OOQS'#DX'#DXO/oQ#xO,5=yOOQS,5=y,5=yO!6lQ#xO'#FqO!6wQ#xO,59qO!7PQ#xO1G/ZO!7ZQ&nO,5=}OOQS1G3h1G3hOOQS,5:p,5:pO!7zQ#xO'#G|OOQS,5<n,5<nOOQS-E:Q-E:QO!8]Q#xO1G.jOOQS1G0^1G0^O!8kQ#xO,5>PO!8{Q#xO,5>PO/oQ#xO1G0mO/oQ#xO1G0mO0UQ#xO1G0oOOQS-E:T-E:TO!9^Q#xO1G0oO!9iQ#xO1G0oO!9nQ#xO,5>mO!9|Q#xO,5>mO!:[Q#xO,5>iO!:rQ#xO,5>iO!;TQ#{O1G0yO!>cQ#{O1G0|O!AnQ#xO,5>oO!AxQ#xO,5>oO!BQQ&nO,5>oO/oQ#xO1G1OO!B[Q#xO1G1OO3^Q#xO1G1TO! RQ#xO1G1VOOQV,5;`,5;`O!BaQ#zO,5;`O!BfQ#{O1G1PO!EwQ#xO'#G]O3^Q#xO1G1PO3^Q#xO1G1PO!FUQ#xO,5>pO!FcQ#xO,5>pO0UQ#xO,5>pOOQV1G1T1G1TO!FkQ#xO'#FRO!F|QMlO1G1VOOQV1G1[1G1[O3^Q#xO1G1[O!GUQ#xO'#F]OOQV1G1a1G1aO! `Q&nO1G1aPOOO1G3O1G3OP!GZOSO1G3OOOQS,5>V,5>VOOQS'#Dr'#DrO/oQ#xO,5>VO!G`Q#xO,5>UO!GsQ#xO,5>UOOQS1G/w1G/wO!G{Q#xO,5>XO!H]Q#xO,5>XO!HeQ#xO,5>XO!HxQ#xO,5>XO!IYQ#xO,5>XOOQS1G3r1G3rOOQS7+$j7+$jO!7PQ#xO7+$rO!J{Q#xO1G/OO!KSQ#xO1G/OOOQS1G/b1G/bOOQS,5<_,5<_O'WQ#xO,5<_OOQS7+%R7+%RO!KZQ#xO7+%ROOQS-E9q-E9qOOQS7+%S7+%SO!KkQ#xO,5>OO'WQ#xO,5>OOOQS7+$i7+$iO!KpQ#xO7+%RO!KxQ#xO7+%SO!K}Q#xO1G3nOOQS7+%Z7+%ZO!L_Q#xO1G3nO!LgQ#xO7+%ZOOQS,5<^,5<^O'WQ#xO,5<^O!LlQ#xO1G3iOOQS-E9p-E9pO!McQ#xO7+%_OOQS7+%a7+%aO!MqQ#xO1G3iO!N`Q#xO7+%aO!NeQ#xO1G3oO!NuQ#xO1G3oO!N}Q#xO7+%_O# SQ#xO,5>cO# jQ#xO,5>cO# jQ#xO,5>cO# xO$ISO'#D{O#!TO#tO'#HxOOOW1G0P1G0PO#!YQ#xO1G0POOO`1G0T1G0TO#!bQ#xO1G0TOOOp1G0U1G0UO#!jQ#xO1G0UOOO!b1G0V1G0VO#!rQ#xO1G0VO#!zQ!LUO7+(nO##kQ&nO1G2XP#$UQ#xO'#GROOQS,5<p,5<pOOQS-E:S-E:SOOQS7+&y7+&yOOQS1G3e1G3eOOQS,5<],5<]OOQS-E9o-E9oOOQS7+$u7+$uO#$cQ#xO,5=hO#$|Q#xO,5=hO#%_Q&nO,5<`O#%rQ#xO1G3kOOQS-E9r-E9rOOQS7+&X7+&XO#&SQ#xO7+&XOOQS7+&Z7+&ZO#&bQ#xO'#IQO0UQ#xO'#IPO#&vQ#xO7+&ZOOQS,5<s,5<sO#'RQ#xO1G4XOOQS-E:V-E:VOOQS,5<o,5<oO#'aQ#xO1G4TOOQS-E:R-E:RO#'wQ#{O7+&eO!EwQ#xO'#GZO3^Q#xO7+&eO3^Q#xO7+&hO#+VQ&nO,5<vO'WQ#xO,5<vO#+aQ#xO1G4ZOOQS-E:Y-E:YO#+kQ#xO1G4ZO3^Q#xO7+&jO/oQ#xO7+&jOOQV7+&o7+&oO!F|QMlO7+&qO`Q#yO1G0zOOQV-E:Z-E:ZO3^Q#xO7+&kO3^Q#xO7+&kOOQV,5<w,5<wO#+sQ#xO,5<wOOQV7+&k7+&kO#,OQ#{O7+&kO#/ZQ#xO,5<xO#/fQ#xO1G4[OOQS-E:[-E:[O#/sQ#xO1G4[O#/{Q#xO'#IWO#0ZQ#xO'#IWO0UQ#xO'#IWOOQS'#IW'#IWO#0fQ#xO'#IVOOQS,5;m,5;mO#0nQ#xO,5;mO/oQ#xO'#FTOOQV7+&q7+&qO3^Q#xO7+&qOOQV7+&v7+&vO#0sQ#zO,5;wOOQV7+&{7+&{POOO7+(j7+(jOOQS1G3q1G3qOOQS,5<b,5<bO#0xQ#xO1G3pOOQS-E9t-E9tO#1]Q#xO,5<cO#1hQ#xO,5<cO#1{Q#xO1G3sOOQS-E9u-E9uO#2]Q#xO1G3sO#2eQ#xO1G3sO#2uQ#xO1G3sO#2]Q#xO1G3sOOQS<<H^<<H^O#3QQ&nO1G1yOOQS<<Hm<<HmP#3_Q#xO'#FsO7hQ#xO1G3jO#3lQ#xO1G3jO#3qQ#xO<<HmOOQS<<Hn<<HnO#4RQ#xO7+)YOOQS<<Hu<<HuO#4cQ&nO1G1xP#5SQ#xO'#FrO#5aQ#xO7+)ZO#5qQ#xO7+)ZO#5yQ#xO<<HyO#6OQ#xO7+)TOOQS<<H{<<H{O#6uQ#xO,5<aO'WQ#xO,5<aOOQS-E9s-E9sOOQS<<Hy<<HyOOQS,5<g,5<gO/oQ#xO,5<gO#6zQ#xO1G3}OOQS-E9y-E9yO#7bQ#xO1G3}O;RQ#xO'#D|OOOO'#F|'#F|O#7pO$ISO,5:gOOO#l,5>d,5>dOOOW7+%k7+%kOOO`7+%o7+%oOOOp7+%p7+%pOOO!b7+%q7+%qO#7{Q#xO1G3SO#8fQ#xO1G3SP'WQ#xO'#FtO/oQ#xO<<IsO#8wQ#xO,5>lO#9YQ#xO,5>lO0UQ#xO,5>lO#9kQ#xO,5>kOOQS<<Iu<<IuP0UQ#xO'#GXP/oQ#xO'#GTOOQV-E:X-E:XO3^Q#xO<<JPOOQV,5<u,5<uO3^Q#xO,5<uOOQV<<JP<<JPOOQV<<JS<<JSO#9pQ&nO1G2bP#9zQ#xO'#G[O#:RQ#xO7+)uO#:]Q#{O<<JUO3^Q#xO<<JUOOQV<<J]<<J]O3^Q#xO<<J]O#=hQ#{O7+&fOOQV<<JV<<JVO#=rQ#{O<<JVOOQV1G2c1G2cO0UQ#xO1G2cO3^Q#xO<<JVO0UQ#xO1G2dP/oQ#xO'#G^O#@}Q#xO7+)vO#A[Q#xO7+)vOOQS'#FS'#FSO/oQ#xO,5>rO#AdQ#xO,5>rOOQS,5>r,5>rO#AoQ#xO,5>qO#BQQ#xO,5>qOOQS1G1X1G1XOOQS,5;o,5;oO#BYQ#xO1G1cP#B_Q#xO'#FvO#BoQ#xO1G1}O#CSQ#xO1G1}O#CdQ#xO1G1}P#CoQ#xO'#FwO#C|Q#xO7+)_O#D^Q#xO7+)_O#D^Q#xO7+)_O#DfQ#xO7+)_O#DvQ#xO7+)UO7hQ#xO7+)UOOQSAN>XAN>XO#EaQ#xO<<LuOOQSAN>eAN>eO/oQ#xO1G1{O#EqQ&nO1G1{P#E{Q#xO'#FuOOQS1G2R1G2RP#FYQ#xO'#F{O#FgQ#xO7+)iO#F}Q#xO,5:hOOOO-E9z-E9zO#GYQ#xO7+(nOOQSAN?_AN?_O#GsQ#xO,5<rO#HXQ#xO1G4WOOQS-E:U-E:UO#HjQ#xO1G4WOOQS1G4V1G4VOOQVAN?kAN?kOOQV1G2a1G2aO3^Q#xOAN?pO#H{Q#{OAN?pOOQVAN?wAN?wOOQV<<JQ<<JQO3^Q#xOAN?qO3^Q#xO7+'}OOQVAN?qAN?qOOQS7+(O7+(OO#LWQ#xO<<MbOOQS1G4^1G4^O/oQ#xO1G4^OOQS,5<y,5<yO#LeQ#xO1G4]OOQS-E:]-E:]OOQU'#Ga'#GaO#LvQ#zO7+&}O#MRQ#xO'#F^O#MyQ#xO7+'iO#NZQ#xO7+'iOOQS7+'i7+'iO#NfQ#xO<<LyO#NvQ#xO<<LyO#NvQ#xO<<LyO$ OQ#xO'#HfOOQS<<Lp<<LpO$ YQ#xO<<LpOOQS7+'g7+'gOOOO1G0S1G0SO$ sQ#xO1G0SO0UQ#xO1G2^P0UQ#xO'#GWO$ {Q#xO7+)rO$!^Q#xO7+)rOOQVG25[G25[O3^Q#xOG25[OOQVG25]G25]OOQV<<Ki<<KiOOQS7+)x7+)xP$!oQ#xO'#G_OOQU-E:_-E:_OOQV<<Ji<<JiO$#cQ&nO'#F`OOQS'#Fb'#FbO$#sQ#xO'#FaO$$eQ#xO'#FaOOQS'#Fa'#FaO$$jQ#xO'#IYO#MRQ#xO'#FhO#MRQ#xO'#FhO$%RQ#xO'#FiO#MRQ#xO'#FjO$%YQ#xO'#IZOOQS'#IZ'#IZO$%wQ#xO,5;xOOQS<<KT<<KTO$&PQ#xO<<KTO$&aQ#xOANBeO$&qQ#xOANBeO$&yQ#xO'#HgOOQS'#Hg'#HgO0pQ#xO'#DeO$'dQ#xO,5>QOOQSANB[ANB[OOOO7+%n7+%nOOQS7+'x7+'xO$'{Q#xO<<M^OOQVLD*vLD*vO4gQMlO'#GcO$(^Q&nO,5<RO#MRQ#xO'#FlOOQS,5<V,5<VOOQS'#Fc'#FcO$)OQ#xO,5;{O$)TQ#xO,5;{OOQS'#Ff'#FfO#MRQ#xO'#GbO$)uQ#xO,5<PO$*aQ#xO,5>tO$*qQ#xO,5>tO0UQ#xO,5<OO$+SQ#xO,5<SO$+XQ#xO,5<SO#MRQ#xO'#I[O$+^Q#xO'#I[O$+cQ#xO,5<TOOQS,5<U,5<UO'WQ#xO'#FoOOQU1G1d1G1dO3^Q#xO1G1dOOQSAN@oAN@oO$+hQ#xOG28PO$+xQ#xO,5:POOQS1G3l1G3lOOQS,5<},5<}OOQS-E:a-E:aO$+}Q&nO'#F`O$,UQ#xO'#I]O$,dQ#xO'#I]O$,lQ#xO,5<WOOQS1G1g1G1gO$,qQ#xO1G1gO$,vQ#xO,5<|OOQS-E:`-E:`O$-bQ#xO,5=QO$-yQ#xO1G4`OOQS-E:d-E:dOOQS1G1j1G1jOOQS1G1n1G1nO$.ZQ#xO,5>vO#MRQ#xO,5>vOOQS1G1o1G1oO$.iQ&nO,5<ZOOQU7+'O7+'OO$ OQ#xO1G/kO#MRQ#xO,5<XO$.pQ#xO,5>wO$.wQ#xO,5>wOOQS1G1r1G1rOOQS7+'R7+'RP#MRQ#xO'#GfO$/PQ#xO1G4bO$/ZQ#xO1G4bO$/cQ#xO1G4bOOQS7+%V7+%VO$/qQ#xO1G1sO$0PQ&nO'#F`O$0WQ#xO,5=POOQS,5=P,5=PO$0fQ#xO1G4cOOQS-E:c-E:cO#MRQ#xO,5=OO$0mQ#xO,5=OO$0rQ#xO7+)|OOQS-E:b-E:bO$0|Q#xO7+)|O#MRQ#xO,5<YP#MRQ#xO'#GeO$1UQ#xO1G2jO#MRQ#xO1G2jP$1dQ#xO'#GdO$1kQ#xO<<MhO$1uQ#xO1G1tO$2TQ#xO7+(UO7hQ#xO'#DPO7hQ#xO,59dO7hQ#xO,59dO7hQ#xO,59dO$2cQ&nO,5=hO7hQ#xO1G/OO/oQ#xO1G/ZO/oQ#xO7+$rP$2vQ#xO'#GRO'WQ#xO'#G|O$3TQ#xO,59dO$3YQ#xO,59dO$3aQ#xO,59oO$3fQ#xO1G/WO0pQ#xO'#DTO7hQ#xO,59l",stateData:"$3w~O%kOS%`OSUOS%_PQ~OPiOXfOhtOjYOquOu!TOxvO!RwO!S!QO!V!WO!W!VO!ZZO!_[O!jeO!ueO!veO!weO#OyO#QzO#S{O#U|O#W}O#[!OO#^!PO#a!RO#b!RO#d!SO#k!UO#n!XO#r!YO#t!ZO#y![O#|mO$O!]O%wRO%xRO%|SO%}WO&c]O&d^O&g_O&j`O&naO&obO&pcO~O%_!^O~OX!eOa!eOc!fOj!mO!Z!oO!h!qO%r!`O%s!aO%t!bO%u!cO%v!cO%w!dO%x!dO%y!eO%z!eO%{!eO~Om&QXn&QXo&QXp&QXq&QXr&QXu&QX|&QX}&QX!{&QX#f&QX%^&QX%a&QX&S&QXi&QX!V&QX!W&QX&T&QX!Y&QX!^&QX!S&QX#_&QXv&QX!n&QX~P$dOhtOjYO!ZZO!_[O!jeO!ueO!veO!weO%wRO%xRO%|SO%}WO&c]O&d^O&g_O&j`O&naO&obO&pcO~O|&PX}&PX#f&PX%^&PX%a&PX&S&PX~Om!tOn!uOo!sOp!sOq!vOr!wOu!xO!{&PX~P(eOX#OOi#QOq0VOx0eO!RwO~P'WOX#SOq0VOx0eO!Y#TO~P'WOX#WOc#XOq0VOx0eO!^#YO~P'WO&e#]O&f#_O~O&h#`O&i#_O~OQ#bO%b#cO%c#eO~OR#fO%d#gO%e#eO~OS#iO%f#jO%g#eO~OT#lO%h#mO%i#eO~OX%qXa%qXc%qXj%qXm%qXn%qXo%qXp%qXq%qXr%qXu%qX|%qX!Z%qX!h%qX%r%qX%s%qX%t%qX%u%qX%v%qX%w%qX%x%qX%y%qX%z%qX%{%qXi%qX!V%qX!W%qX~O&c]O&d^O&g_O&j`O&naO&obO&pcO}%qX!{%qX#f%qX%^%qX%a%qX&S%qX&T%qX!Y%qX!^%qX!S%qX#_%qXv%qX!n%qX~P+}O|#rO}%pX!{%pX#f%pX%^%pX%a%pX&S%pX~Oq0VOx0eO~P'WO#f#uO%^#wO%a#wO~O%}WO~O!V#|O#t!ZO#y![O#|mO~OquO~P'WOX$ROc$SO%}WO}yP~OX$WOq0VOx0eO!S$XO~P'WO}$ZO!{$`O&S$[O#f!|X%^!|X%a!|X~OX$WOq0VOx0eO#f#VX%^#VX%a#VX~P'WOq0VOx0eO#f#ZX%^#ZX%a#ZX~P'WO!h$fO!u$fO%}WO~OX$pO~P'WO!W$rO#r$sO#t$tO~O}$uO~OX$|O~P'WOU%OO%^$}O%k%PO~OX%YOc%YOi%[Oq0VOx0eO~P'WOq0VOx0eO}%_O~P'WO&b%aO~Oc!fOj!mO!Z!oO!h!qOXdaadamdandaodapdaqdardauda|da}da!{da#fda%^da%ada%rda%sda%tda%uda%vda%wda%xda%yda%zda%{da&Sdaida!Vda!Wda&Tda!Yda!^da!Sda#_davda!nda~Op%fO~Oq%fO~P'WOq0VO~P'WOm0XOn0YOo0WOp0WOq0aOr0bOu0fOi&PX!V&PX!W&PX&T&PX!Y&PX!^&PX!S&PX#_&PX!n&PX~P(eO&T%hOi&OX|&OX!V&OX!W&OX!Y&OX}&OX~Oi%jO|%kO!V%oO!W%nO~Oi%jO~O|%rO!V%oO!W%nO!Y&[X~O!Y%vO~O|%wO}%yO!V%oO!W%nO!^&VX~O!^%}O~O!^&OO~O&e#]O&f&QO~O&h#`O&i&QO~OX&TOq0VOx0eO!RwO~P'WOQ#bO%b#cO%c&WO~OR#fO%d#gO%e&WO~OS#iO%f#jO%g&WO~OT#lO%h#mO%i&WO~OX!taa!tac!taj!tam!tan!tao!tap!taq!tar!tau!ta|!ta}!ta!Z!ta!h!ta!{!ta#f!ta%^!ta%a!ta%r!ta%s!ta%t!ta%u!ta%v!ta%w!ta%x!ta%y!ta%z!ta%{!ta&S!tai!ta!V!ta!W!ta&T!ta!Y!ta!^!ta!S!ta#_!tav!ta!n!ta~P#vO|&`O}%pa!{%pa#f%pa%^%pa%a%pa&S%pa~P$dOX&bOquOxvO}%pa!{%pa#f%pa%^%pa%a%pa&S%pa~P'WO|&`O}%pa!{%pa#f%pa%^%pa%a%pa&S%pa~OPiOXfOquOxvO!RwO!S!QO#OyO#QzO#S{O#U|O#W}O#[!OO#^!PO#a!RO#b!RO#d!SO#f$|X%^$|X%a$|X~P'WO#f#uO%^&gO%a&gO~O!h&hOj&rX%^&rX#_&rX#f&rX%a&rX#^&rX~Oj!mO%^&jO~Omgangaogapgaqgargauga|ga}ga!{ga#fga%^ga%aga&Sgaiga!Vga!Wga&Tga!Yga!^ga!Sga#_gavga!nga~P$dOusa|sa}sa#fsa%^sa%asa&Ssa~Om!tOn!uOo!sOp!sOq!vOr!wO!{sa~PDoO&S&lO|&RX}&RX~O%}WO|&RX}&RX~O|&oO}yX~O}&qO~O|%wO#f&VX%^&VX%a&VXi&VX}&VX!^&VX!n&VX&S&VX~OX0`Oq0VOx0eO!RwO~P'WO&S$[O#fWa%^Wa%aWa~O|&zO#f&XX%^&XX%a&XXp&XX~P$dO|&}O!S&|O#f#Za%^#Za%a#Za~O#_'OO#f#]a%^#]a%a#]a~O!h$fO!u$fO#^'QO%}WO~O#^'QO~O|'SO#f&uX%^&uX%a&uX~O|'UO#f&qX%^&qX%a&qX}&qX~O|'YOp&wX~P$dOp']O~OPiOXfOquOxvO!RwO!S!QO#OyO#QzO#S{O#U|O#W}O#[!OO#^!PO#a!RO#b!RO#d!SO%^'bO~P'WOv'fO#o'dO#p'eOP#maX#mah#maj#maq#mau#max#ma!R#ma!S#ma!V#ma!W#ma!Z#ma!_#ma!j#ma!u#ma!v#ma!w#ma#O#ma#Q#ma#S#ma#U#ma#W#ma#[#ma#^#ma#a#ma#b#ma#d#ma#k#ma#n#ma#r#ma#t#ma#y#ma#|#ma$O#ma%Z#ma%w#ma%x#ma%|#ma%}#ma&c#ma&d#ma&g#ma&j#ma&n#ma&o#ma&p#ma%]#ma%a#ma~O|'gO#_'iO}&xX~Oj'kO~Oj!mO}$uO~O}'oO~P$dO%^'rO~OU'sO%^'rO~OX!eOa!eOc!fOj!mO!Z!oO!h!qO%t!bO%u!cO%v!cO%w!dO%x!dO%y!eO%z!eO%{!eOmYinYioYipYiqYirYiuYi|Yi}Yi!{Yi#fYi%^Yi%aYi%rYi&SYiiYi!VYi!WYi&TYi!YYi!^Yi!SYi#_YivYi!nYi~O%s!aO~P! tO%sYi~P! tOX!eOa!eOc!fOj!mO!Z!oO!h!qO%w!dO%x!dO%y!eO%z!eO%{!eOmYinYioYipYiqYirYiuYi|Yi}Yi!{Yi#fYi%^Yi%aYi%rYi%sYi%tYi&SYiiYi!VYi!WYi&TYi!YYi!^Yi!SYi#_YivYi!nYi~O%u!cO%v!cO~P!$oO%uYi%vYi~P!$oOc!fOj!mO!Z!oO!h!qOmYinYioYipYiqYirYiuYi|Yi}Yi!{Yi#fYi%^Yi%aYi%rYi%sYi%tYi%uYi%vYi%wYi%xYi&SYiiYi!VYi!WYi&TYi!YYi!^Yi!SYi#_YivYi!nYi~OX!eOa!eO%y!eO%z!eO%{!eO~P!'mOXYiaYi%yYi%zYi%{Yi~P!'mO!V%oO!W%nOi&_X|&_X~O&S'uO&T'uO~P+}O|'wOi&^X~Oi'yO~O|'zO}'|O!Y&aX~Oq0VOx0eO|'zO}'}O!Y&aX~P'WO!Y(PO~Oo!sOp!sOq!vOr!wOmliuli|li}li!{li#fli%^li%ali&Sli~On!uO~P!,`Onli~P!,`Om0XOn0YOo0WOp0WOq0aOr0bO~Ov(RO~P!-iOX(WOi(XOq0VOx0eO~P'WOi(XO|(YO~Oi([O~O!W(^O~Oi(_O|(YO!V%oO!W%nO~P$dOm0XOn0YOo0WOp0WOq0aOr0bOisa!Vsa!Wsa&Tsa!Ysa!^sa!Ssa#_savsa!nsa~PDoOX(WOq0VOx0eO!Y&[a~P'WO|(bO!Y&[a~O!Y(cO~O|(bO!V%oO!W%nO!Y&[a~P$dOX(gOq0VOx0eO!^&Va#f&Va%^&Va%a&Vai&Va}&Va!n&Va&S&Va~P'WO|(hO!^&Va#f&Va%^&Va%a&Vai&Va}&Va!n&Va&S&Va~O!^(kO~O|(hO!V%oO!W%nO!^&Va~P$dO|(nO!V%oO!W%nO!^&]a~P$dO|(qO}&kX!^&kX!n&kX~O}(tO!^(vO!n(wO~O}(tO!^(xO!n(yO~O}(tO!^(zO!n({O~O}(tO!^(|O!n(}O~OX&bOquOxvO}%pi!{%pi#f%pi%^%pi%a%pi&S%pi~P'WO|)OO}%pi!{%pi#f%pi%^%pi%a%pi&S%pi~O!h&hOj&ra%^&ra#_&ra#f&ra%a&ra#^&ra~O%^)TO~OX$ROc$SO%}WO~O|&oO}ya~OquOxvO~P'WO|(hO#f&Va%^&Va%a&Vai&Va}&Va!^&Va!n&Va&S&Va~P$dO|)YO#f%pX%^%pX%a%pX&S%pX~O&S$[O#fWi%^Wi%aWi~O#f&Xa%^&Xa%a&Xap&Xa~P'WO|)]O#f&Xa%^&Xa%a&Xap&Xa~OX)aOj)cO%}WO~O#^)dO~O%}WO#f&ua%^&ua%a&ua~O|)fO#f&ua%^&ua%a&ua~Oq0VOx0eO#f&qa%^&qa%a&qa}&qa~P'WO|)iO#f&qa%^&qa%a&qa}&qa~Ov)mO#i)lOP#giX#gih#gij#giq#giu#gix#gi!R#gi!S#gi!V#gi!W#gi!Z#gi!_#gi!j#gi!u#gi!v#gi!w#gi#O#gi#Q#gi#S#gi#U#gi#W#gi#[#gi#^#gi#a#gi#b#gi#d#gi#k#gi#n#gi#r#gi#t#gi#y#gi#|#gi$O#gi%Z#gi%w#gi%x#gi%|#gi%}#gi&c#gi&d#gi&g#gi&j#gi&n#gi&o#gi&p#gi%]#gi%a#gi~Ov)nOP#jiX#jih#jij#jiq#jiu#jix#ji!R#ji!S#ji!V#ji!W#ji!Z#ji!_#ji!j#ji!u#ji!v#ji!w#ji#O#ji#Q#ji#S#ji#U#ji#W#ji#[#ji#^#ji#a#ji#b#ji#d#ji#k#ji#n#ji#r#ji#t#ji#y#ji#|#ji$O#ji%Z#ji%w#ji%x#ji%|#ji%}#ji&c#ji&d#ji&g#ji&j#ji&n#ji&o#ji&p#ji%]#ji%a#ji~OX)pOp&wa~P'WO|)qOp&wa~O|)qOp&wa~P$dOp)uO~O%[)xO~Ov){O#o'dO#p)zOP#miX#mih#mij#miq#miu#mix#mi!R#mi!S#mi!V#mi!W#mi!Z#mi!_#mi!j#mi!u#mi!v#mi!w#mi#O#mi#Q#mi#S#mi#U#mi#W#mi#[#mi#^#mi#a#mi#b#mi#d#mi#k#mi#n#mi#r#mi#t#mi#y#mi#|#mi$O#mi%Z#mi%w#mi%x#mi%|#mi%}#mi&c#mi&d#mi&g#mi&j#mi&n#mi&o#mi&p#mi%]#mi%a#mi~Oq0VOx0eO}$uO~P'WOq0VOx0eO}&xa~P'WO|*RO}&xa~OX*VOc*WOi*ZO%y*XO%}WO~O}$uO&{*]O~O%^*aO~O%^*cO~OX%YOc%YOq0VOx0eOi&^a~P'WO|*fOi&^a~Oq0VOx0eO}*iO!Y&aa~P'WO|*jO!Y&aa~Oq0VOx0eO|*jO}*mO!Y&aa~P'WOq0VOx0eO|*jO!Y&aa~P'WO|*jO}*mO!Y&aa~Oo0WOp0WOq0aOr0bOilimliuli|li!Vli!Wli&Tli!Yli}li!^li#fli%^li%ali!Sli#_livli!nli&Sli~On0YO~P!IeOnli~P!IeOX(WOi*rOq0VOx0eO~P'WOp*tO~Oi*rO|*vO~Oi*wO~OX(WOq0VOx0eO!Y&[i~P'WO|*xO!Y&[i~O!Y*yO~OX(gOq0VOx0eO!^&Vi#f&Vi%^&Vi%a&Vii&Vi}&Vi!n&Vi&S&Vi~P'WO|*|O!V%oO!W%nO!^&]i~O|+PO!^&Vi#f&Vi%^&Vi%a&Vii&Vi}&Vi!n&Vi&S&Vi~O!^+QO~Oc+SOq0VOx0eO!^&]i~P'WO|*|O!^&]i~O!^+UO~OX+WOq0VOx0eO}&ka!^&ka!n&ka~P'WO|+XO}&ka!^&ka!n&ka~O!_+[O&m+]O!^!oX~O!^+_O~O}(tO!^+`O~O}(tO!^+aO~O}(tO!^+bO~O}(tO!^+cO~OX&bOquOxvO}%pq!{%pq#f%pq%^%pq%a%pq&S%pq~P'WO|$ui}$ui!{$ui#f$ui%^$ui%a$ui&S$ui~P$dOX&bOquOxvO~P'WOX&bOq0VOx0eO#f%pa%^%pa%a%pa&S%pa~P'WO|+dO#f%pa%^%pa%a%pa&S%pa~O|$ha#f$ha%^$ha%a$hap$ha~P$dO#f&Xi%^&Xi%a&Xip&Xi~P'WO|+gO#f#Zq%^#Zq%a#Zq~O|+hO#_+jO#f&tX%^&tX%a&tXi&tX~OX+lOj)cO%}WO~O%}WO#f&ui%^&ui%a&ui~Oq0VOx0eO#f&qi%^&qi%a&qi}&qi~P'WOv+pO#i)lOP#gqX#gqh#gqj#gqq#gqu#gqx#gq!R#gq!S#gq!V#gq!W#gq!Z#gq!_#gq!j#gq!u#gq!v#gq!w#gq#O#gq#Q#gq#S#gq#U#gq#W#gq#[#gq#^#gq#a#gq#b#gq#d#gq#k#gq#n#gq#r#gq#t#gq#y#gq#|#gq$O#gq%Z#gq%w#gq%x#gq%|#gq%}#gq&c#gq&d#gq&g#gq&j#gq&n#gq&o#gq&p#gq%]#gq%a#gq~Op%Oa|%Oa~P$dOX)pOp&wi~P'WO|+wOp&wi~O|,QO}$uO#_,QO~O#p,ROP#mqX#mqh#mqj#mqq#mqu#mqx#mq!R#mq!S#mq!V#mq!W#mq!Z#mq!_#mq!j#mq!u#mq!v#mq!w#mq#O#mq#Q#mq#S#mq#U#mq#W#mq#[#mq#^#mq#a#mq#b#mq#d#mq#k#mq#n#mq#r#mq#t#mq#y#mq#|#mq$O#mq%Z#mq%w#mq%x#mq%|#mq%}#mq&c#mq&d#mq&g#mq&j#mq&n#mq&o#mq&p#mq%]#mq%a#mq~O#_,SO|%Qa}%Qa~Oq0VOx0eO}&xi~P'WO|,UO}&xi~O}$ZO&S,WOi&zX|&zX~O%}WOi&zX|&zX~O|,[Oi&yX~Oi,^O~O%[,`O~OX%YOc%YOq0VOx0eOi&^i~P'WO},bO|$ka!Y$ka~Oq0VOx0eO},cO|$ka!Y$ka~P'WOq0VOx0eO}*iO!Y&ai~P'WO|,fO!Y&ai~Oq0VOx0eO|,fO!Y&ai~P'WO|,fO},iO!Y&ai~Oi$gi|$gi!Y$gi~P$dOX(WOq0VOx0eO~P'WOp,kO~OX(WOi,lOq0VOx0eO~P'WOX(WOq0VOx0eO!Y&[q~P'WO|$fi!^$fi#f$fi%^$fi%a$fii$fi}$fi!n$fi&S$fi~P$dOX(gOq0VOx0eO~P'WOc+SOq0VOx0eO!^&]q~P'WO|,mO!^&]q~O!^,nO~OX(gOq0VOx0eO!^&Vq#f&Vq%^&Vq%a&Vqi&Vq}&Vq!n&Vq&S&Vq~P'WO},oO~OX+WOq0VOx0eO}&ki!^&ki!n&ki~P'WO|,tO}&ki!^&ki!n&ki~O!_+[O&m+]O!^!oa~OX&bOq0VOx0eO#f%pi%^%pi%a%pi&S%pi~P'WO|,wO#f%pi%^%pi%a%pi&S%pi~O%}WO#f&ta%^&ta%a&tai&ta~O|,zO#f&ta%^&ta%a&tai&ta~Oi,}O~Op%Oi|%Oi~P$dOX)pO~P'WOX)pOp&wq~P'WOv-QOP#lyX#lyh#lyj#lyq#lyu#lyx#ly!R#ly!S#ly!V#ly!W#ly!Z#ly!_#ly!j#ly!u#ly!v#ly!w#ly#O#ly#Q#ly#S#ly#U#ly#W#ly#[#ly#^#ly#a#ly#b#ly#d#ly#k#ly#n#ly#r#ly#t#ly#y#ly#|#ly$O#ly%Z#ly%w#ly%x#ly%|#ly%}#ly&c#ly&d#ly&g#ly&j#ly&n#ly&o#ly&p#ly%]#ly%a#ly~O%]-TO%a-TO~P`O#p-UOP#myX#myh#myj#myq#myu#myx#my!R#my!S#my!V#my!W#my!Z#my!_#my!j#my!u#my!v#my!w#my#O#my#Q#my#S#my#U#my#W#my#[#my#^#my#a#my#b#my#d#my#k#my#n#my#r#my#t#my#y#my#|#my$O#my%Z#my%w#my%x#my%|#my%}#my&c#my&d#my&g#my&j#my&n#my&o#my&p#my%]#my%a#my~Oq0VOx0eO}&xq~P'WO|-YO}&xq~O&S,WOi&za|&za~OX*VOc*WO%y*XO%}WOi&ya~O|-^Oi&ya~O$R-bO~OX%YOc%YOq0VOx0eO~P'WOq0VOx0eO}-cO|$ki!Y$ki~P'WOq0VOx0eO|$ki!Y$ki~P'WO}-cO|$ki!Y$ki~Oq0VOx0eO}*iO~P'WOq0VOx0eO}*iO!Y&aq~P'WO|-fO!Y&aq~Oq0VOx0eO|-fO!Y&aq~P'WOu-iO!V%oO!W%nOi&Wq!Y&Wq!^&Wq|&Wq~P!-iOc+SOq0VOx0eO!^&]y~P'WO|$ii!^$ii~P$dOc+SOq0VOx0eO~P'WOX+WOq0VOx0eO~P'WOX+WOq0VOx0eO}&kq!^&kq!n&kq~P'WO}(tO!^-mO!n-nO~OX&bOq0VOx0eO#f%pq%^%pq%a%pq&S%pq~P'WO#_-oO|$za#f$za%^$za%a$zai$za~O%}WO#f&ti%^&ti%a&tii&ti~O|-qO#f&ti%^&ti%a&tii&ti~Ov-tOP#l!RX#l!Rh#l!Rj#l!Rq#l!Ru#l!Rx#l!R!R#l!R!S#l!R!V#l!R!W#l!R!Z#l!R!_#l!R!j#l!R!u#l!R!v#l!R!w#l!R#O#l!R#Q#l!R#S#l!R#U#l!R#W#l!R#[#l!R#^#l!R#a#l!R#b#l!R#d#l!R#k#l!R#n#l!R#r#l!R#t#l!R#y#l!R#|#l!R$O#l!R%Z#l!R%w#l!R%x#l!R%|#l!R%}#l!R&c#l!R&d#l!R&g#l!R&j#l!R&n#l!R&o#l!R&p#l!R%]#l!R%a#l!R~Oq0VOx0eO}&xy~P'WOX*VOc*WO%y*XO%}WOi&yi~O$R-bO%]-zO%a-zO~OX.UOj.SO!Z.RO!_.TO!j-}O!v.PO!w.PO%x-|O%}WO&c]O&d^O&g_O~Oq0VOx0eO|$kq!Y$kq~P'WO}.ZO|$kq!Y$kq~Oq0VOx0eO}*iO!Y&ay~P'WO|.[O!Y&ay~Oq0VOx.`O~P'WOu-iO!V%oO!W%nOi&Wy!Y&Wy!^&Wy|&Wy~P!-iO}(tO!^.cO~O%}WO#f&tq%^&tq%a&tqi&tq~O|.eO#f&tq%^&tq%a&tqi&tq~OX*VOc*WO%y*XO%}WO~Oj.iO!h.gO|$SX#_$SX%r$SXi$SX~Ou$SX}$SX!Y$SX!^$SX~P$!}O%w.kO%x.kOu$TX|$TX}$TX#_$TX%r$TX!Y$TXi$TX!^$TX~O!j.mO~O|.qO#_.sO%r.nOu&|X}&|X!Y&|Xi&|X~Oc.vO~P#M_Oj.iOu&}X|&}X}&}X#_&}X%r&}X!Y&}Xi&}X!^&}X~Ou.zO}$uO~Oq0VOx0eO|$ky!Y$ky~P'WOq0VOx0eO}*iO!Y&a!R~P'WO|/OO!Y&a!R~Oi&ZXu&ZX!V&ZX!W&ZX!Y&ZX!^&ZX|&ZX~P!-iOu-iO!V%oO!W%nOi&Ya!Y&Ya!^&Ya|&Ya~O%}WO#f&ty%^&ty%a&tyi&ty~O!h.gOj$Zau$Za|$Za}$Za#_$Za%r$Za!Y$Zai$Za!^$Za~O!j/XO~O%w.kO%x.kOu$Ta|$Ta}$Ta#_$Ta%r$Ta!Y$Tai$Ta!^$Ta~O%r.nOu$Xa|$Xa}$Xa#_$Xa!Y$Xai$Xa!^$Xa~Ou&|a}&|a!Y&|ai&|a~P#MRO|/^Ou&|a}&|a!Y&|ai&|a~O!Y/aO~Oi/aO~O}/cO~O!^/dO~Oq0VOx0eO}*iO!Y&a!Z~P'WO}/gO~O&S/hO~P$!}O|/iO#_.sO%r.nOi'PX~O|/iOi'PX~Oi/kO~O!j/lO~O#_.sOu%Ua|%Ua}%Ua%r%Ua!Y%Uai%Ua!^%Ua~O#_.sO%r.nOu%Ya|%Ya}%Ya!Y%Yai%Ya~Ou&|i}&|i!Y&|ii&|i~P#MRO|/nO#_.sO%r.nO!^'Oa~O}$ca~P$dOi'Pa~P#MRO|/vOi'Pa~Oc/xO!^'Oi~P#M_O|/zO!^'Oi~O|/zO#_.sO%r.nO!^'Oi~O#_.sO%r.nOi$ai|$ai~O&S/}O~P$!}O#_.sO%r.nOi%Xa|%Xa~Oi'Pi~P#MRO}0QO~Oc/xO!^'Oq~P#M_O|0SO!^'Oq~O#_.sO%r.nO|%Wi!^%Wi~Oc/xO~P#M_Oc/xO!^'Oy~P#M_O#_.sO%r.nOi$bi|$bi~O#_.sO%r.nO|%Wq!^%Wq~O|+dO#f%pa%^%pa%a%pa&S%pa~P$dOX&bOq0VOx0eO~P'WOp0[O~Oq0[O~P'WO}0]O~Ov0^O~P!-iO&d&g&o&p&c&j&n%}&c~",goto:"!<w'QPPPPPPPP'RP'Z*s+]+v,b,}-kP.YP'Z.y.y'ZPPP'Z2cPPPPPP2c5VPP5VP7g7p=pPP=s>e>hPP'Z'ZPP?QPP'Z'ZPP'Z'Z'Z'Z'Z?U?{'ZP@OP@UD]GyPG}HZH_HcHg'ZPPPHkHq'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RPHwPIOIUPIOPIOIOPPPIOPKTPK^KdKjKTPIOKpPIOPKwK}PLRLgMUMoLRLRMuNSLRLRLRLRNhNnNqNvNy! T! Z! g! y!!P!!Z!!a!!}!#T!#Z!#a!#k!#q!#w!#}!$T!$Z!$m!$w!$}!%T!%Z!%e!%k!%q!%w!&R!&X!&c!&i!&r!&x!'X!'a!'k!'rPPPPPPPPPPPPPPPPP!'x!'{!(R!([!(f!(qPPPPPPPPPPPP!-e!.y!2s!6TPP!6]!6o!6x!7n!7e!7w!7}!8Q!8T!8W!8`!9PPPPPPPPPP!9S!9cPPPP!:R!:_!:k!:q!:z!:}!;T!;Z!;a!;dP!;l!;u!<q!<t]jOs#u$u)x+|'}eOTYZ[fistuwy}!O!S!T!U!V!Y!]!g!h!i!j!k!l!m!o!s!t!u!w!x#O#S#W#X#b#f#i#l#r#u$W$X$Z$]$`$p$r$s$u$|%Y%_%f%i%k%n%r%w%y&T&`&b&m&q&z&|&}'U'Y']'d'g'v'w'z'|'}(R(W(Y(^(b(g(h(n(q)O)Q)Y)])i)l)p)q)u)x*R*]*f*i*j*m*s*t*v*x*{*|+P+S+W+X+[+d+f+g+n+v+w+|,T,U,X,a,b,c,e,f,i,k,m,o,q,s,t,w-Y-[-c-f-i.Z.[.z/O/g0V0W0X0Y0[0]0^0_0`0b0f}!gQ#q$O$a$o${%p%u%{%|&r'['q)P)[)o*q*z+u,p/e0Z!P!hQ#q$O$a$o${%Q%p%u%{%|&r'['q)P)[)o*q*z+u,p/e0Z!R!iQ#q$O$a$o${%Q%R%p%u%{%|&r'['q)P)[)o*q*z+u,p/e0Z!T!jQ#q$O$a$o${%Q%R%S%p%u%{%|&r'['q)P)[)o*q*z+u,p/e0Z!V!kQ#q$O$a$o${%Q%R%S%T%p%u%{%|&r'['q)P)[)o*q*z+u,p/e0Z!X!lQ#q$O$a$o${%Q%R%S%T%U%p%u%{%|&r'['q)P)[)o*q*z+u,p/e0Z!]!lQ!r#q$O$a$o${%Q%R%S%T%U%V%p%u%{%|&r'['q)P)[)o*q*z+u,p/e0Z'}TOTYZ[fistuwy}!O!S!T!U!V!Y!]!g!h!i!j!k!l!m!o!s!t!u!w!x#O#S#W#X#b#f#i#l#r#u$W$X$Z$]$`$p$r$s$u$|%Y%_%f%i%k%n%r%w%y&T&`&b&m&q&z&|&}'U'Y']'d'g'v'w'z'|'}(R(W(Y(^(b(g(h(n(q)O)Q)Y)])i)l)p)q)u)x*R*]*f*i*j*m*s*t*v*x*{*|+P+S+W+X+[+d+f+g+n+v+w+|,T,U,X,a,b,c,e,f,i,k,m,o,q,s,t,w-Y-[-c-f-i.Z.[.z/O/g0V0W0X0Y0[0]0^0_0`0b0f&cVOYZ[isuw}!O!S!T!U!Y!m!o!s!t!u!w!x#b#f#i#l#r#u$X$Z$]$`$s$u%Y%_%f%i%k%r%w%y&T&`&m&q&|&}'U']'d'g'v'w'z'|'}(R(Y(b(h(n(q)O)Q)Y)i)l)u)x*R*]*f*i*j*m*s*t*v*x*{*|+P+W+X+[+d+g+n+|,T,U,X,a,b,c,e,f,i,k,m,o,q,s,t,w-Y-[-c-f-i.Z.[/O/g0V0W0X0Y0[0]0^0_0b0f%mXOYZ[isw}!O!S!T!U!Y!m!o#b#f#i#l#r#u$X$Z$]$`$s$u%Y%_%i%k%r%w%y&T&`&m&q&|&}'U']'d'g'v'w'z'|'}(R(Y(b(h(n(q)O)Q)Y)i)l)u)x*R*]*f*i*j*m*s*v*x*{*|+P+W+X+[+d+g+n+|,T,U,X,a,b,c,e,f,i,m,o,q,s,t,w-Y-[-c-f.Z.[/O0]0^0_Q$UvQ/P.`R0c0e'teOTYZ[fistuwy}!O!S!T!U!V!Y!]!g!h!i!j!k!l!o!s!t!u!w!x#O#S#W#X#b#f#i#l#r#u$W$X$Z$]$`$p$r$s$u$|%Y%_%f%i%k%n%r%w%y&T&`&b&m&q&z&|&}'U'Y']'d'g'v'z'|'}(R(W(Y(^(b(g(h(n(q)O)Q)Y)])i)l)p)q)u)x*R*]*i*j*m*s*t*v*x*{*|+P+S+W+X+[+d+f+g+n+v+w+|,T,U,X,b,c,e,f,i,k,m,o,q,s,t,w-Y-[-c-f-i.Z.[.z/O/g0V0W0X0Y0[0]0^0_0`0b0fW#xm!P!Q$gW$Qv&o.`0eQ$i!RQ$y!ZQ$z![W%X!m'w*f,aS&n$R$SQ'`$tQ)R&hQ)a'OU)b'Q)c)dU)e'S)f+mQ*T'iW*U'k,[-^-xS,Z*V*WY,y+h,z-p-q.eQ,|+jQ-V,QQ-X,Sl-{-b.R.S.U.o.q.v/^/c/h/m/x/}0QQ.d-oQ.w.TQ/T.iQ/`.sU/s/i/v0OX/y/n/z0R0SR&m$Q!_!{YZ!T!U!o%_%k%r'z'|'}(Y(b)l*i*j*m*s*v*x,b,c,e,f,i-c-f.Z.[/OR%i!zQ#PYQ&U#bQ&X#fQ&Z#iQ&]#lQ&v$]Q&y$`R,u+[T._-i/g![!nQ!r#q$O$a$o${%Q%R%S%T%U%V%p%u%{%|&r'['q)P)[)o*q*z+u,p/e0ZQ&k#yR'n$zR'v%XQ%b!qR/R.g'|dOTYZ[fistuwy}!O!S!T!U!V!Y!]!g!h!i!j!k!l!m!o!s!t!u!w!x#O#S#W#X#b#f#i#l#r#u$W$X$Z$]$`$p$r$s$u$|%Y%_%f%i%k%n%r%w%y&T&`&b&m&q&z&|&}'U'Y']'d'g'v'w'z'|'}(R(W(Y(^(b(g(h(n(q)O)Q)Y)])i)l)p)q)u)x*R*]*f*i*j*m*s*t*v*x*{*|+P+S+W+X+[+d+f+g+n+v+w+|,T,U,X,a,b,c,e,f,i,k,m,o,q,s,t,w-Y-[-c-f-i.Z.[.z/O/g0V0W0X0Y0[0]0^0_0`0b0fS#od#p!P.P-b.R.S.T.U.i.o.q.v/^/c/h/i/m/n/v/x/z/}0O0Q0R0S'|dOTYZ[fistuwy}!O!S!T!U!V!Y!]!g!h!i!j!k!l!m!o!s!t!u!w!x#O#S#W#X#b#f#i#l#r#u$W$X$Z$]$`$p$r$s$u$|%Y%_%f%i%k%n%r%w%y&T&`&b&m&q&z&|&}'U'Y']'d'g'v'w'z'|'}(R(W(Y(^(b(g(h(n(q)O)Q)Y)])i)l)p)q)u)x*R*]*f*i*j*m*s*t*v*x*{*|+P+S+W+X+[+d+f+g+n+v+w+|,T,U,X,a,b,c,e,f,i,k,m,o,q,s,t,w-Y-[-c-f-i.Z.[.z/O/g0V0W0X0Y0[0]0^0_0`0b0fT#od#pT#c`#de(u&U&X&Z&](w(y({(},u-nT+](t+^T#ga#hT#jb#kT#mc#nQ$_xR,Y*UX$]x$^$_&xZlOs$u)x+|XpOs)x+|Q$v!XQ'W$mQ'X$nQ'j$xQ'm$zQ)v'_Q)|'dQ*O'eQ*P'fQ*^'lQ*`'nQ+q)lQ+s)mQ+t)nQ+x)tS+z)w*_Q+})zQ,O){Q,P)}Q-O+pQ-P+rQ-R+yQ-S+{Q-W,RQ-s-QQ-u-UQ-v-VQ.f-tQ.{.XR/f.|WpOs)x+|R#{oQ'l$yR)w'`Q,X*UR-[,YQ*_'lR+{)wZnOos)x+|Q'p${R*b'qT-`,`-au.W-b.R.S.U.i.o.q.v/^/c/h/i/m/v/x/}0O0Qt.W-b.R.S.U.i.o.q.v/^/c/h/i/m/v/x/}0O0QQ.w.TX/y/n/z0R0S!P.O-b.R.S.T.U.i.o.q.v/^/c/h/i/m/n/v/x/z/}0O0Q0R0SQ.l-}R/Y.mg.o.Q.p/U/]/b/p/r/t0P0T0Uu.V-b.R.S.U.i.o.q.v/^/c/h/i/m/v/x/}0O0QX.j-{.V/T/sR/V.iV/u/i/v0OR.|.XQsOS#}s+|R+|)xQ&p$TR)W&pS%x#V$VS(i%x(lT(l%{&rQ%l!}Q%s#RW(Z%l%s(`(dQ(`%pR(d%uQ&{$aR)^&{Q(o%|Q*}(jT+T(o*}Q'x%ZR*g'xS'{%^%_Y*k'{*l,g-g.]U*l'|'}(OU,g*m*n*oS-g,h,iR.]-hQ#^^R&P#^Q#a_R&R#aQ#d`R&V#dQ(r&SS+Y(r+ZR+Z(sQ+^(tR,v+^Q#haR&Y#hQ#kbR&[#kQ#ncR&^#nQ#pdR&_#pQ#sgQ&a#qW&d#s&a)Z+eQ)Z&uR+e0ZQ$^xS&w$^&xR&x$_Q'V$kR)j'VQ&i#xR)S&iQ$g!QR'P$gQ+i)bS,{+i-rR-r,|Q'T$iR)g'TQ#vkR&f#vQ)k'WR+o)kQ'Z$oS)r'Z)sR)s'[Q'c$vR)y'cQ'h$wS*S'h,VR,V*TQ,]*YR-_,]WoOs)x+|R#zoQ-a,`R-y-ad.p.Q/U/]/b/p/r/t0P0T0UR/[.pU.h-{/T/sR/S.hQ/o/bS/{/o/|R/|/pS/j/U/VR/w/jQ.r.QR/_.rR!_PXrOs)x+|WqOs)x+|R'a$uYkOs$u)x+|R&e#u[xOs#u$u)x+|R&v$]&bQOYZ[isuw}!O!S!T!U!Y!m!o!s!t!u!w!x#b#f#i#l#r#u$X$Z$]$`$s$u%Y%_%f%i%k%r%w%y&T&`&m&q&|&}'U']'d'g'v'w'z'|'}(R(Y(b(h(n(q)O)Q)Y)i)l)u)x*R*]*f*i*j*m*s*t*v*x*{*|+P+W+X+[+d+g+n+|,T,U,X,a,b,c,e,f,i,k,m,o,q,s,t,w-Y-[-c-f-i.Z.[/O/g0V0W0X0Y0[0]0^0_0b0fQ!rTQ#qfQ$OtU$ay%n(^S$o!V$rQ${!]Q%Q!gQ%R!hQ%S!iQ%T!jQ%U!kQ%V!lQ%p#OQ%u#SQ%{#WQ%|#XQ&r$WQ'[$pQ'q$|Q)P&bU)[&z)]+fW)o'Y)q+v+wQ*q(WQ*z(gQ+u)pQ,p+SQ/e.zR0Z0`Q!}YQ#RZQ$m!TQ$n!UQ%^!oQ(O%_^(V%k%r(Y(b*s*v*x^*h'z*j,e,f-f.[/OQ*n'|Q*o'}Q+r)lQ,d*iQ,h*mQ-d,bQ-e,cQ-h,iQ.Y-cR.}.Z[gOs#u$u)x+|!^!zYZ!T!U!o%_%k%r'z'|'}(Y(b)l*i*j*m*s*v*x,b,c,e,f,i-c-f.Z.[/OQ#V[Q#tiS$Vw}Q$d!OW$k!S$`'])uS$w!Y$sW%W!m'w*f,aY&S#b#f#i#l+[`&c#r&`)O)Q)Y+d,w0_Q&s$XQ&t$ZQ&u$]Q't%YQ(U%iW(f%w(h*{+PQ(j%yQ(s&TQ)U&mS)X&q0]Q)_&|Q)`&}U)h'U)i+nQ)}'dY*Q'g*R,T,U-YQ*d'vS*p(R0^W+R(n*|,m,qW+V(q+X,s,tQ,_*]Q,r+WQ,x+gQ-Z,XQ-l,oR-w-[hUOs#r#u$u&`&q(R)O)Q)x+|%S!yYZ[iw}!O!S!T!U!Y!m!o#b#f#i#l$X$Z$]$`$s%Y%_%i%k%r%w%y&T&m&|&}'U']'d'g'v'w'z'|'}(Y(b(h(n(q)Y)i)l)u*R*]*f*i*j*m*s*v*x*{*|+P+W+X+[+d+g+n,T,U,X,a,b,c,e,f,i,m,o,q,s,t,w-Y-[-c-f.Z.[/O0]0^0_Q$PuW%c!s!w0W0bQ%d!tQ%e!uQ%g!xQ%q0VS(Q%f0[Q(S0XQ(T0YQ,j*tQ-k,kS.^-i/gR0d0fU$Tv.`0eR)V&o[hOs#u$u)x+|a!|Y#b#f#i#l$]$`+[Q#[[Q$YwR$c}Q%m!}Q%t#RQ%z#VQ't%WQ(a%pQ(e%uQ(m%{Q(p%|Q+O(jQ-j,jQ.b-kR/Q.aQ$byQ(]%nR*u(^Q.a-iR/q/gR#UZR#Z[R%]!mQ%Z!mV*e'w*f,a!]!pQ!r#q$O$a$o${%Q%R%S%T%U%V%p%u%{%|&r'['q)P)[)o*q*z+u,p/e0ZR%`!oQ&U#bQ&X#fQ&Z#iQ&]#lR,u+[Q(v&UQ(x&XQ(z&ZQ(|&]Q+`(wQ+a(yQ+b({Q+c(}Q-m,uR.c-nQ$l!SQ&y$`Q)t']R+y)uQ#ymQ$e!PQ$h!QR'R$gQ)a'QR+l)dQ)a'QQ+k)cR+l)dR$j!RXqOs)x+|Q$q!VR'^$rQ$x!YR'_$sR*['kQ*Y'kV-],[-^-xQ.X-bQ.t.RR.u.SU.Q-b.R.SQ.y.UQ/U.iQ/Z.oU/].q/^/mQ/b.vQ/p/cQ/r/hU/t/i/v0OQ0P/xQ0T/}R0U0QR.x.TR/W.i",nodeNames:"⚠ print { { { { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatConversion FormatSpec FormatReplacement FormatReplacement FormatReplacement FormatReplacement ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:uGt,nodeProps:[["group",-14,8,88,90,91,93,95,97,99,101,102,103,105,108,111,"Statement Statement",-22,10,20,23,27,42,51,52,58,59,62,63,64,65,66,69,72,73,74,82,83,84,85,"Expression",-10,113,115,118,120,121,125,127,132,134,137,"Statement",-9,142,143,146,147,149,150,151,152,153,"Pattern"],["openedBy",25,"(",56,"[",60,"{"],["closedBy",26,")",57,"]",61,"}"]],propSources:[mGt],skippedNodes:[0,6],repeatNodeCount:37,tokenData:"%-W#sR!`OX%TXY=|Y[%T[]=|]p%Tpq=|qr@_rsDOst!+|tu%Tuv!Nnvw#!|wx#$Wxy#:Uyz#;Yz{#<^{|#>x|}#@S}!O#AW!O!P#Ci!P!Q#N_!Q!R$!y!R![$&w![!]$1e!]!^$3s!^!_$4w!_!`$7c!`!a$8m!a!b%T!b!c$;U!c!d$<b!d!e$>W!e!h$<b!h!i$H[!i!t$<b!t!u%#r!u!w$<b!w!x$Fl!x!}$<b!}#O%%z#O#P?d#P#Q%'O#Q#R%(S#R#S$<b#S#T%T#T#U$<b#U#V$>W#V#Y$<b#Y#Z$H[#Z#f$<b#f#g%#r#g#i$<b#i#j$Fl#j#o$<b#o#p%)^#p#q%*S#q#r%+^#r#s%,S#s$g%T$g;'S$<b;'S;=`$>Q<%lO$<b!n%^]&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!n&^]&m!b&eSOr%Trs'Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!n'^]&m!b&eSOr%Trs(Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!f(^Z&m!b&eSOw(Vwx)Px#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V!f)UZ&m!bOw(Vwx)wx#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V!f)|Z&m!bOw(Vwx*ox#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V!b*tT&m!bO#o*o#p#q*o#r;'S*o;'S;=`+T<%lO*o!b+WP;=`<%l*o!f+`W&m!bO#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`.d;=`<%l+x<%lO(VS+}V&eSOw+xwx,dx#O+x#O#P-c#P;'S+x;'S;=`.^<%lO+xS,gVOw+xwx,|x#O+x#O#P-c#P;'S+x;'S;=`.^<%lO+xS-PUOw+xx#O+x#O#P-c#P;'S+x;'S;=`.^<%lO+xS-fRO;'S+x;'S;=`-o;=`O+xS-tW&eSOw+xwx,dx#O+x#O#P-c#P;'S+x;'S;=`.^;=`<%l+x<%lO+xS.aP;=`<%l+x!f.iW&eSOw+xwx,dx#O+x#O#P-c#P;'S+x;'S;=`.^;=`<%l(V<%lO+x!f/UP;=`<%l(V!n/`]&m!b&hWOr%Trs&Vsw%Twx0Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!n0`]&m!b&hWOr%Trs&Vsw%Twx1Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!j1`Z&m!b&hWOr1Xrs2Rs#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X!j2WZ&m!bOr1Xrs2ys#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X!j3OZ&m!bOr1Xrs*os#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X!j3vW&m!bO#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`6z;=`<%l4`<%lO1XW4eV&hWOr4`rs4zs#O4`#O#P5y#P;'S4`;'S;=`6t<%lO4`W4}VOr4`rs5ds#O4`#O#P5y#P;'S4`;'S;=`6t<%lO4`W5gUOr4`s#O4`#O#P5y#P;'S4`;'S;=`6t<%lO4`W5|RO;'S4`;'S;=`6V;=`O4`W6[W&hWOr4`rs4zs#O4`#O#P5y#P;'S4`;'S;=`6t;=`<%l4`<%lO4`W6wP;=`<%l4`!j7PW&hWOr4`rs4zs#O4`#O#P5y#P;'S4`;'S;=`6t;=`<%l1X<%lO4`!j7lP;=`<%l1X!n7tW&m!bO#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=P;=`<%l8^<%lO%T[8eX&eS&hWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^[9VX&eSOr8^rs9rsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^[9wX&eSOr8^rs+xsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^[:iX&hWOr8^rs9Qsw8^wx;Ux#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^[;ZX&hWOr8^rs9Qsw8^wx4`x#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^[;yRO;'S8^;'S;=`<S;=`O8^[<ZY&eS&hWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y;=`<%l8^<%lO8^[<|P;=`<%l8^!n=WY&eS&hWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y;=`<%l%T<%lO8^!n=yP;=`<%l%T#s>Xc&m!b&eS&hW%k!TOX%TXY=|Y[%T[]=|]p%Tpq=|qr%Trs&Vsw%Twx/Xx#O%T#O#P?d#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#s?i[&m!bOY%TYZ=|Z]%T]^=|^#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=P;=`<%l8^<%lO%T!q@hd&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`Av!`#O%T#O#P7o#P#T%T#T#UBz#U#f%T#f#gBz#g#hBz#h#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!qBR]oR&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!qCV]!nR&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#cDXa&m!b&eS&csOYE^YZ%TZ]E^]^%T^rE^rs!)|swE^wxGpx#OE^#O#P!!u#P#oE^#o#p!#d#p#qE^#q#r!#d#r;'SE^;'S;=`!)v<%lOE^#cEia&m!b&eS&hW&csOYE^YZ%TZ]E^]^%T^rE^rsFnswE^wxGpx#OE^#O#P!!u#P#oE^#o#p!#d#p#qE^#q#r!#d#r;'SE^;'S;=`!)v<%lOE^#cFw]&m!b&eS&csOr%Trs'Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#cGya&m!b&hW&csOYE^YZ%TZ]E^]^%T^rE^rsFnswE^wxIOx#OE^#O#P!!u#P#oE^#o#p!#d#p#qE^#q#r!#d#r;'SE^;'S;=`!)v<%lOE^#cIXa&m!b&hW&csOYE^YZ%TZ]E^]^%T^rE^rsFnswE^wxJ^x#OE^#O#P!!u#P#oE^#o#p!#d#p#qE^#q#r!#d#r;'SE^;'S;=`!)v<%lOE^#_Jg_&m!b&hW&csOYJ^YZ1XZ]J^]^1X^rJ^rsKfs#OJ^#O#PL`#P#oJ^#o#pL}#p#qJ^#q#rL}#r;'SJ^;'S;=`!!o<%lOJ^#_KmZ&m!b&csOr1Xrs2ys#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X#_LeW&m!bO#oJ^#o#pL}#p#qJ^#q#rL}#r;'SJ^;'S;=`! r;=`<%lL}<%lOJ^{MUZ&hW&csOYL}YZ4`Z]L}]^4`^rL}rsMws#OL}#O#PNc#P;'SL};'S;=`! l<%lOL}{M|V&csOr4`rs5ds#O4`#O#P5y#P;'S4`;'S;=`6t<%lO4`{NfRO;'SL};'S;=`No;=`OL}{Nv[&hW&csOYL}YZ4`Z]L}]^4`^rL}rsMws#OL}#O#PNc#P;'SL};'S;=`! l;=`<%lL}<%lOL}{! oP;=`<%lL}#_! y[&hW&csOYL}YZ4`Z]L}]^4`^rL}rsMws#OL}#O#PNc#P;'SL};'S;=`! l;=`<%lJ^<%lOL}#_!!rP;=`<%lJ^#c!!zW&m!bO#oE^#o#p!#d#p#qE^#q#r!#d#r;'SE^;'S;=`!(q;=`<%l!#d<%lOE^!P!#m]&eS&hW&csOY!#dYZ8^Z]!#d]^8^^r!#drs!$fsw!#dwx!%Yx#O!#d#O#P!'Y#P;'S!#d;'S;=`!(k<%lO!#d!P!$mX&eS&csOr8^rs9rsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^!P!%a]&hW&csOY!#dYZ8^Z]!#d]^8^^r!#drs!$fsw!#dwx!&Yx#O!#d#O#P!'Y#P;'S!#d;'S;=`!(k<%lO!#d!P!&a]&hW&csOY!#dYZ8^Z]!#d]^8^^r!#drs!$fsw!#dwxL}x#O!#d#O#P!'Y#P;'S!#d;'S;=`!(k<%lO!#d!P!']RO;'S!#d;'S;=`!'f;=`O!#d!P!'o^&eS&hW&csOY!#dYZ8^Z]!#d]^8^^r!#drs!$fsw!#dwx!%Yx#O!#d#O#P!'Y#P;'S!#d;'S;=`!(k;=`<%l!#d<%lO!#d!P!(nP;=`<%l!#d#c!(z^&eS&hW&csOY!#dYZ8^Z]!#d]^8^^r!#drs!$fsw!#dwx!%Yx#O!#d#O#P!'Y#P;'S!#d;'S;=`!(k;=`<%lE^<%lO!#d#c!)yP;=`<%lE^#c!*V]&m!b&eS&csOr%Trs!+Osw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c!+ZZ&iW&m!b&eS&gsOw(Vwx)Px#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V#s!,XaU!T&m!b&eS&hWOY!+|YZ%TZ]!+|]^%T^r!+|rs!-^sw!+|wx!:hx#O!+|#O#P!FW#P#o!+|#o#p!GT#p#q!+|#q#r!GT#r;'S!+|;'S;=`!Nh<%lO!+|#s!-gaU!T&m!b&eSOY!+|YZ%TZ]!+|]^%T^r!+|rs!.lsw!+|wx!:hx#O!+|#O#P!FW#P#o!+|#o#p!GT#p#q!+|#q#r!GT#r;'S!+|;'S;=`!Nh<%lO!+|#s!.uaU!T&m!b&eSOY!+|YZ%TZ]!+|]^%T^r!+|rs!/zsw!+|wx!:hx#O!+|#O#P!FW#P#o!+|#o#p!GT#p#q!+|#q#r!GT#r;'S!+|;'S;=`!Nh<%lO!+|#k!0T_U!T&m!b&eSOY!/zYZ(VZ]!/z]^(V^w!/zwx!1Sx#O!/z#O#P!4z#P#o!/z#o#p!5w#p#q!/z#q#r!5w#r;'S!/z;'S;=`!:b<%lO!/z#k!1Z_U!T&m!bOY!/zYZ(VZ]!/z]^(V^w!/zwx!2Yx#O!/z#O#P!4z#P#o!/z#o#p!5w#p#q!/z#q#r!5w#r;'S!/z;'S;=`!:b<%lO!/z#k!2a_U!T&m!bOY!/zYZ(VZ]!/z]^(V^w!/zwx!3`x#O!/z#O#P!4z#P#o!/z#o#p!5w#p#q!/z#q#r!5w#r;'S!/z;'S;=`!:b<%lO!/z#g!3gZU!T&m!bOY!3`YZ*oZ]!3`]^*o^#o!3`#o#p!4Y#p#q!3`#q#r!4Y#r;'S!3`;'S;=`!4t<%lO!3`!T!4_TU!TOY!4YZ]!4Y^;'S!4Y;'S;=`!4n<%lO!4Y!T!4qP;=`<%l!4Y#g!4wP;=`<%l!3`#k!5R[U!T&m!bOY!/zYZ(VZ]!/z]^(V^#o!/z#o#p!5w#p#q!/z#q#r!5w#r;'S!/z;'S;=`!9s;=`<%l+x<%lO!/z!X!6OZU!T&eSOY!5wYZ+xZ]!5w]^+x^w!5wwx!6qx#O!5w#O#P!8a#P;'S!5w;'S;=`!9m<%lO!5w!X!6vZU!TOY!5wYZ+xZ]!5w]^+x^w!5wwx!7ix#O!5w#O#P!8a#P;'S!5w;'S;=`!9m<%lO!5w!X!7nZU!TOY!5wYZ+xZ]!5w]^+x^w!5wwx!4Yx#O!5w#O#P!8a#P;'S!5w;'S;=`!9m<%lO!5w!X!8fWU!TOY!5wYZ+xZ]!5w]^+x^;'S!5w;'S;=`!9O;=`<%l+x<%lO!5w!X!9TW&eSOw+xwx,dx#O+x#O#P-c#P;'S+x;'S;=`.^;=`<%l!5w<%lO+x!X!9pP;=`<%l!5w#k!9xW&eSOw+xwx,dx#O+x#O#P-c#P;'S+x;'S;=`.^;=`<%l!/z<%lO+x#k!:eP;=`<%l!/z#s!:qaU!T&m!b&hWOY!+|YZ%TZ]!+|]^%T^r!+|rs!-^sw!+|wx!;vx#O!+|#O#P!FW#P#o!+|#o#p!GT#p#q!+|#q#r!GT#r;'S!+|;'S;=`!Nh<%lO!+|#s!<PaU!T&m!b&hWOY!+|YZ%TZ]!+|]^%T^r!+|rs!-^sw!+|wx!=Ux#O!+|#O#P!FW#P#o!+|#o#p!GT#p#q!+|#q#r!GT#r;'S!+|;'S;=`!Nh<%lO!+|#o!=__U!T&m!b&hWOY!=UYZ1XZ]!=U]^1X^r!=Urs!>^s#O!=U#O#P!@j#P#o!=U#o#p!Ag#p#q!=U#q#r!Ag#r;'S!=U;'S;=`!FQ<%lO!=U#o!>e_U!T&m!bOY!=UYZ1XZ]!=U]^1X^r!=Urs!?ds#O!=U#O#P!@j#P#o!=U#o#p!Ag#p#q!=U#q#r!Ag#r;'S!=U;'S;=`!FQ<%lO!=U#o!?k_U!T&m!bOY!=UYZ1XZ]!=U]^1X^r!=Urs!3`s#O!=U#O#P!@j#P#o!=U#o#p!Ag#p#q!=U#q#r!Ag#r;'S!=U;'S;=`!FQ<%lO!=U#o!@q[U!T&m!bOY!=UYZ1XZ]!=U]^1X^#o!=U#o#p!Ag#p#q!=U#q#r!Ag#r;'S!=U;'S;=`!Ec;=`<%l4`<%lO!=U!]!AnZU!T&hWOY!AgYZ4`Z]!Ag]^4`^r!Agrs!Bas#O!Ag#O#P!DP#P;'S!Ag;'S;=`!E]<%lO!Ag!]!BfZU!TOY!AgYZ4`Z]!Ag]^4`^r!Agrs!CXs#O!Ag#O#P!DP#P;'S!Ag;'S;=`!E]<%lO!Ag!]!C^ZU!TOY!AgYZ4`Z]!Ag]^4`^r!Agrs!4Ys#O!Ag#O#P!DP#P;'S!Ag;'S;=`!E]<%lO!Ag!]!DUWU!TOY!AgYZ4`Z]!Ag]^4`^;'S!Ag;'S;=`!Dn;=`<%l4`<%lO!Ag!]!DsW&hWOr4`rs4zs#O4`#O#P5y#P;'S4`;'S;=`6t;=`<%l!Ag<%lO4`!]!E`P;=`<%l!Ag#o!EhW&hWOr4`rs4zs#O4`#O#P5y#P;'S4`;'S;=`6t;=`<%l!=U<%lO4`#o!FTP;=`<%l!=U#s!F_[U!T&m!bOY!+|YZ%TZ]!+|]^%T^#o!+|#o#p!GT#p#q!+|#q#r!GT#r;'S!+|;'S;=`!Mq;=`<%l8^<%lO!+|!a!G^]U!T&eS&hWOY!GTYZ8^Z]!GT]^8^^r!GTrs!HVsw!GTwx!JVx#O!GT#O#P!LV#P;'S!GT;'S;=`!Mk<%lO!GT!a!H^]U!T&eSOY!GTYZ8^Z]!GT]^8^^r!GTrs!IVsw!GTwx!JVx#O!GT#O#P!LV#P;'S!GT;'S;=`!Mk<%lO!GT!a!I^]U!T&eSOY!GTYZ8^Z]!GT]^8^^r!GTrs!5wsw!GTwx!JVx#O!GT#O#P!LV#P;'S!GT;'S;=`!Mk<%lO!GT!a!J^]U!T&hWOY!GTYZ8^Z]!GT]^8^^r!GTrs!HVsw!GTwx!KVx#O!GT#O#P!LV#P;'S!GT;'S;=`!Mk<%lO!GT!a!K^]U!T&hWOY!GTYZ8^Z]!GT]^8^^r!GTrs!HVsw!GTwx!Agx#O!GT#O#P!LV#P;'S!GT;'S;=`!Mk<%lO!GT!a!L[WU!TOY!GTYZ8^Z]!GT]^8^^;'S!GT;'S;=`!Lt;=`<%l8^<%lO!GT!a!L{Y&eS&hWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y;=`<%l!GT<%lO8^!a!MnP;=`<%l!GT#s!MxY&eS&hWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y;=`<%l!+|<%lO8^#s!NkP;=`<%l!+|#b!Ny_%zQ&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b#!T]!{r&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b##X_%tQ&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#$aa&m!b&hW&csOY#%fYZ%TZ]#%f]^%T^r#%frs#&vsw#%fwx#8Ux#O#%f#O#P#0}#P#o#%f#o#p#1l#p#q#%f#q#r#1l#r;'S#%f;'S;=`#8O<%lO#%f#c#%qa&m!b&eS&hW&csOY#%fYZ%TZ]#%f]^%T^r#%frs#&vsw#%fwx#/{x#O#%f#O#P#0}#P#o#%f#o#p#1l#p#q#%f#q#r#1l#r;'S#%f;'S;=`#8O<%lO#%f#c#'Pa&m!b&eS&csOY#%fYZ%TZ]#%f]^%T^r#%frs#(Usw#%fwx#/{x#O#%f#O#P#0}#P#o#%f#o#p#1l#p#q#%f#q#r#1l#r;'S#%f;'S;=`#8O<%lO#%f#c#(_a&m!b&eS&csOY#%fYZ%TZ]#%f]^%T^r#%frs#)dsw#%fwx#/{x#O#%f#O#P#0}#P#o#%f#o#p#1l#p#q#%f#q#r#1l#r;'S#%f;'S;=`#8O<%lO#%f#Z#)m_&m!b&eS&csOY#)dYZ(VZ]#)d]^(V^w#)dwx#*lx#O#)d#O#P#+f#P#o#)d#o#p#,T#p#q#)d#q#r#,T#r;'S#)d;'S;=`#/u<%lO#)d#Z#*sZ&m!b&csOw(Vwx)wx#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V#Z#+kW&m!bO#o#)d#o#p#,T#p#q#)d#q#r#,T#r;'S#)d;'S;=`#.x;=`<%l#,T<%lO#)dw#,[Z&eS&csOY#,TYZ+xZ]#,T]^+x^w#,Twx#,}x#O#,T#O#P#-i#P;'S#,T;'S;=`#.r<%lO#,Tw#-SV&csOw+xwx,|x#O+x#O#P-c#P;'S+x;'S;=`.^<%lO+xw#-lRO;'S#,T;'S;=`#-u;=`O#,Tw#-|[&eS&csOY#,TYZ+xZ]#,T]^+x^w#,Twx#,}x#O#,T#O#P#-i#P;'S#,T;'S;=`#.r;=`<%l#,T<%lO#,Tw#.uP;=`<%l#,T#Z#/P[&eS&csOY#,TYZ+xZ]#,T]^+x^w#,Twx#,}x#O#,T#O#P#-i#P;'S#,T;'S;=`#.r;=`<%l#)d<%lO#,T#Z#/xP;=`<%l#)d#c#0U]&m!b&hW&csOr%Trs&Vsw%Twx0Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#1SW&m!bO#o#%f#o#p#1l#p#q#%f#q#r#1l#r;'S#%f;'S;=`#6y;=`<%l#1l<%lO#%f!P#1u]&eS&hW&csOY#1lYZ8^Z]#1l]^8^^r#1lrs#2nsw#1lwx#4nx#O#1l#O#P#5b#P;'S#1l;'S;=`#6s<%lO#1l!P#2u]&eS&csOY#1lYZ8^Z]#1l]^8^^r#1lrs#3nsw#1lwx#4nx#O#1l#O#P#5b#P;'S#1l;'S;=`#6s<%lO#1l!P#3u]&eS&csOY#1lYZ8^Z]#1l]^8^^r#1lrs#,Tsw#1lwx#4nx#O#1l#O#P#5b#P;'S#1l;'S;=`#6s<%lO#1l!P#4uX&hW&csOr8^rs9Qsw8^wx;Ux#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^!P#5eRO;'S#1l;'S;=`#5n;=`O#1l!P#5w^&eS&hW&csOY#1lYZ8^Z]#1l]^8^^r#1lrs#2nsw#1lwx#4nx#O#1l#O#P#5b#P;'S#1l;'S;=`#6s;=`<%l#1l<%lO#1l!P#6vP;=`<%l#1l#c#7S^&eS&hW&csOY#1lYZ8^Z]#1l]^8^^r#1lrs#2nsw#1lwx#4nx#O#1l#O#P#5b#P;'S#1l;'S;=`#6s;=`<%l#%f<%lO#1l#c#8RP;=`<%l#%f#c#8_]&m!b&hW&csOr%Trs&Vsw%Twx#9Wx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#9cZ&fS&m!b&hW&dsOr1Xrs2Rs#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X#c#:a]js&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!q#;e]iR&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#<iaXs&m!b&eS&hWOr%Trs&Vsw%Twx/Xxz%Tz{#=n{!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#=y_cR&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#?T_%ws&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!q#@_]|R&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#s#Ac`%xs&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`!a#Be!a#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#O#Bp]&{`&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#Cta!hQ&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!O%T!O!P#Dy!P!Q%T!Q![#GV![#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#ES_&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!O%T!O!P#FR!P#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#F^]!us&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a#Gbi!jq&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!Q%T!Q![#GV![!g%T!g!h#IP!h!l%T!l!m#MZ!m#O%T#O#P7o#P#R%T#R#S#GV#S#X%T#X#Y#IP#Y#^%T#^#_#MZ#_#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a#IYc&m!b&eS&hWOr%Trs&Vsw%Twx/Xx{%T{|#Je|}%T}!O#Je!O!Q%T!Q![#Km![#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a#Jn_&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!Q%T!Q![#Km![#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a#Kxe!jq&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!Q%T!Q![#Km![!l%T!l!m#MZ!m#O%T#O#P7o#P#R%T#R#S#Km#S#^%T#^#_#MZ#_#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a#Mf]!jq&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c#Nja%yR&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!P%T!P!Q$ o!Q!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b$ z_%{Q&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$#Uw!jq&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!O%T!O!P$%o!P!Q%T!Q![$&w![!d%T!d!e$(w!e!g%T!g!h#IP!h!l%T!l!m#MZ!m!q%T!q!r$+m!r!z%T!z!{$.]!{#O%T#O#P7o#P#R%T#R#S$&w#S#U%T#U#V$(w#V#X%T#X#Y#IP#Y#^%T#^#_#MZ#_#c%T#c#d$+m#d#l%T#l#m$.]#m#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$%x_&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!Q%T!Q![#GV![#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$'Sk!jq&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!O%T!O!P$%o!P!Q%T!Q![$&w![!g%T!g!h#IP!h!l%T!l!m#MZ!m#O%T#O#P7o#P#R%T#R#S$&w#S#X%T#X#Y#IP#Y#^%T#^#_#MZ#_#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$)Qb&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!Q%T!Q!R$*Y!R!S$*Y!S#O%T#O#P7o#P#R%T#R#S$*Y#S#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$*eb!jq&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!Q%T!Q!R$*Y!R!S$*Y!S#O%T#O#P7o#P#R%T#R#S$*Y#S#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$+va&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!Q%T!Q!Y$,{!Y#O%T#O#P7o#P#R%T#R#S$,{#S#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$-Wa!jq&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!Q%T!Q!Y$,{!Y#O%T#O#P7o#P#R%T#R#S$,{#S#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$.fe&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!Q%T!Q![$/w![!c%T!c!i$/w!i#O%T#O#P7o#P#R%T#R#S$/w#S#T%T#T#Z$/w#Z#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a$0Se!jq&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!Q%T!Q![$/w![!c%T!c!i$/w!i#O%T#O#P7o#P#R%T#R#S$/w#S#T%T#T#Z$/w#Z#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#s$1p_}!T&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`$2o!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!q$2z]&TR&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$4O]#fs&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$5SaoR&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!^%T!^!_$6X!_!`Av!`!aAv!a#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b$6d_%uQ&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$7n_&Ss&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`Av!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$8x`oR&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`Av!`!a$9z!a#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b$:V_%vQ&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$;c_aQ#|P&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#s$<oe&m!b&eS&hW&b`%}sOr%Trs&Vsw%Twx/Xx!Q%T!Q![$<b![!c%T!c!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#s$>TP;=`<%l$<b#s$>ei&m!b&eS&hW&b`%}sOr%Trs$@Ssw%Twx$C`x!Q%T!Q![$<b![!c%T!c!t$<b!t!u$Fl!u!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#f$<b#f#g$Fl#g#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#c$@]a&m!b&eS&csOYE^YZ%TZ]E^]^%T^rE^rs$AbswE^wxGpx#OE^#O#P!!u#P#oE^#o#p!#d#p#qE^#q#r!#d#r;'SE^;'S;=`!)v<%lOE^#c$Ak]&m!b&eS&csOr%Trs$Bdsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#Z$BmZ&m!b&eS&gsOw(Vwx)Px#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V#c$Cia&m!b&hW&csOY#%fYZ%TZ]#%f]^%T^r#%frs#&vsw#%fwx$Dnx#O#%f#O#P#0}#P#o#%f#o#p#1l#p#q#%f#q#r#1l#r;'S#%f;'S;=`#8O<%lO#%f#c$Dw]&m!b&hW&csOr%Trs&Vsw%Twx$Epx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#_$EyZ&m!b&hW&dsOr1Xrs2Rs#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X#s$Fye&m!b&eS&hW&b`%}sOr%Trs$@Ssw%Twx$C`x!Q%T!Q![$<b![!c%T!c!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#s$Hii&m!b&eS&hW&b`%}sOr%Trs$JWsw%Twx$MUx!Q%T!Q![$<b![!c%T!c!t$<b!t!u%!S!u!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#f$<b#f#g%!S#g#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#c$Ja]&m!b&eS&nsOr%Trs$KYsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$Ka]&m!b&eSOr%Trs$LYsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#Z$LcZ&m!b&eS&psOw(Vwx)Px#O(V#O#P+Z#P#o(V#o#p+x#p#q(V#q#r+x#r;'S(V;'S;=`/R<%lO(V#c$M_]&m!b&hW&jsOr%Trs&Vsw%Twx$NWx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#c$N_]&m!b&hWOr%Trs&Vsw%Twx% Wx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#_% aZ&m!b&hW&osOr1Xrs2Rs#O1X#O#P3q#P#o1X#o#p4`#p#q1X#q#r4`#r;'S1X;'S;=`7i<%lO1X#s%!ae&m!b&eS&hW&b`%}sOr%Trs$JWsw%Twx$MUx!Q%T!Q![$<b![!c%T!c!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#s%$Pm&m!b&eS&hW&b`%}sOr%Trs$@Ssw%Twx$C`x!Q%T!Q![$<b![!c%T!c!h$<b!h!i%!S!i!t$<b!t!u$Fl!u!}$<b!}#O%T#O#P7o#P#R%T#R#S$<b#S#T%T#T#U$<b#U#V$Fl#V#Y$<b#Y#Z%!S#Z#o$<b#o#p8^#p#q%T#q#r8^#r$g%T$g;'S$<b;'S;=`$>Q<%lO$<b#c%&V]!Zs&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!q%'Z]!YR&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#b%(__%sQ&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T#a%)gX!_#T&eS&hWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^#c%*__%rR&m!b&eS&hWOr%Trs&Vsw%Twx/Xx!_%T!_!`# x!`#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T!q%+gX!^!e&eS&hWOr8^rs9Qsw8^wx:dx#O8^#O#P;v#P;'S8^;'S;=`<y<%lO8^#a%,_]%|q&m!b&eS&hWOr%Trs&Vsw%Twx/Xx#O%T#O#P7o#P#o%T#o#p8^#p#q%T#q#r8^#r;'S%T;'S;=`=v<%lO%T",tokenizers:[fGt,aGt,sGt,dGt,hGt,pGt,gGt,0,1,2,3,4,5,6],topRules:{Script:[0,7]},specialized:[{term:229,get:e=>yGt[e]||-1}],tokenPrec:7205}),Mwe=new Nse,iWe=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function zN(e){return(t,n,r)=>{if(r)return!1;let i=t.node.getChild("VariableName");return i&&n(i,e),!0}}const bGt={FunctionDefinition:zN("function"),ClassDefinition:zN("class"),ForStatement(e,t,n){if(n){for(let r=e.node.firstChild;r;r=r.nextSibling)if(r.name=="VariableName")t(r,"variable");else if(r.name=="in")break}},ImportStatement(e,t){var n,r;let{node:i}=e,o=((n=i.firstChild)===null||n===void 0?void 0:n.name)=="from";for(let s=i.getChild("import");s;s=s.nextSibling)s.name=="VariableName"&&((r=s.nextSibling)===null||r===void 0?void 0:r.name)!="as"&&t(s,o?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if(n.name=="VariableName")t(n,"variable");else if(n.name==":"||n.name=="AssignOp")break},ParamList(e,t){for(let n=null,r=e.node.firstChild;r;r=r.nextSibling)r.name=="VariableName"&&(!n||!/\*|AssignOp/.test(n.name))&&t(r,"variable"),n=r},CapturePattern:zN("variable"),AsPattern:zN("variable"),__proto__:null};function oWe(e,t){let n=Mwe.get(t);if(n)return n;let r=[],i=!0;function o(s,a){let l=e.sliceString(s.from,s.to);r.push({label:l,type:a})}return t.cursor(Wr.IncludeAnonymous).iterate(s=>{if(s.name){let a=bGt[s.name];if(a&&a(s,o,i)||!i&&iWe.has(s.name))return!1;i=!1}else if(s.to-s.from>8192){for(let a of oWe(e,s.node))r.push(a);return!1}}),Mwe.set(t,r),r}const Nwe=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,sWe=["String","FormatString","Comment","PropertyName"];function Lle(e){let t=kr(e.state).resolveInner(e.pos,-1);if(sWe.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&Nwe.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let i=t;i;i=i.parent)iWe.has(i.name)&&(r=r.concat(oWe(e.state.doc,i)));return{options:r,from:n?t.from:e.pos,validFor:Nwe}}const OGt=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),xGt=[Ti("def ${name}(${params}):\n	${}",{label:"def",detail:"function",type:"keyword"}),Ti("for ${name} in ${collection}:\n	${}",{label:"for",detail:"loop",type:"keyword"}),Ti("while ${}:\n	${}",{label:"while",detail:"loop",type:"keyword"}),Ti("try:\n	${}\nexcept ${error}:\n	${}",{label:"try",detail:"/ except block",type:"keyword"}),Ti(`if \${}:
	
`,{label:"if",detail:"block",type:"keyword"}),Ti("if ${}:\n	${}\nelse:\n	${}",{label:"if",detail:"/ else block",type:"keyword"}),Ti("class ${name}:\n	def __init__(self, ${params}):\n			${}",{label:"class",detail:"definition",type:"keyword"}),Ti("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Ti("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],jle=RBe(sWe,Ele(OGt.concat(xGt)));function Iwe(e,t){let n=e.baseIndentFor(t),r=e.lineAt(e.pos,-1),i=r.from+r.text.length;return/^\s*($|#)/.test(r.text)&&e.node.to<i+100&&!/\S/.test(e.state.sliceDoc(i,e.node.to))&&e.lineIndent(e.pos,-1)<=n||/^\s*(else:|elif |except |finally:)/.test(e.textAfter)&&e.lineIndent(e.pos,-1)>n?null:n+e.unit}const DS=Gb.define({name:"python",parser:vGt.configure({props:[i_.add({Body:e=>{var t;return(t=Iwe(e,e.node))!==null&&t!==void 0?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except |finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":V5({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":V5({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":V5({closing:"]"}),"String FormatString":()=>null,Script:e=>{if(e.pos+/\s*/.exec(e.textAfter)[0].length>=e.node.to){let t=null;for(let n=e.node,r=n.to;n=n.lastChild,!(!n||n.to!=r);)n.type.name=="Body"&&(t=n);if(t){let n=Iwe(e,t);if(n!=null)return n}}return e.continue()}}),Sv.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":TP,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function Fle(){return new j0(DS,[DS.data.of({autocomplete:Lle}),DS.data.of({autocomplete:jle})])}const wGt=Object.freeze(Object.defineProperty({__proto__:null,globalCompletion:jle,localCompletionSource:Lle,python:Fle,pythonLanguage:DS},Symbol.toStringTag,{value:"Module"}));function Lwe(e){if(!e)return null;const t=document.createElement("span");return t.classList.add("mo-cm-tooltip"),t.classList.add("docs-documentation"),t.style.display="flex",t.style.flexDirection="column",t.style.gap=".8rem",t.innerHTML=e,t}const zle=new rLe("autocomplete-result",async(e,t)=>{await iSt({id:e,...t})},{resolveExistingRequests:()=>null}),hK={asCompletionResult(e,t){return{from:e-t.prefix_length,options:t.options.map(n=>({label:n.name,type:n.type,info:()=>Lwe(n.completion_info)})),validFor:/^\w*$/}},asHoverTooltip({position:e,message:t,limitToType:n,excludeTypes:r,exactName:i}){const o=SGt(t.options,i);if(!o)return;const s=e-t.prefix_length,a=Lwe(o.completion_info);if(a&&!(n&&o.type!==n)&&!(r&&r.includes(o.type)))return{pos:s,html:o.completion_info,end:s+o.name.length,above:!0,create:()=>({dom:a,resize:!1})}}};function SGt(e,t){if(e.length!==0){if(e.length===1)return e[0];if(t)return e.find(n=>n.name===t)}}const Qle=hn({documentation:null});async function EGt(e){const t=e.state.doc.sliceString(0,e.pos),n=document.activeElement;let r=null;if(n!==null){const s=Od.findElement(n);s!==null&&(r=Od.parse(s.id))}if(r===null)return At.error("Failed to find active cell."),null;const i=await zle.request({document:t,cellId:r});if(!i)return null;const o=hK.asHoverTooltip({position:e.pos,message:i,limitToType:"tooltip"});return o&&Tn.set(Qle,{documentation:o.html??null}),o?null:hK.asCompletionResult(e.pos,i)}class CGt{constructor(){ve(this,"type","python")}transformIn(t){return[t,0]}transformOut(t){return[t,0]}isSupported(t){return!0}getExtension(t){return[L8({activateOnTyping:t.activate_on_typing,closeOnBlur:!1,override:[EGt]}),Ble()]}}const DV=DS.configure({props:[Sv.add({ParenthesizedExpression:TP,ArgList:TP})]});function Ble(){return new j0(DV,[DV.data.of({autocomplete:Lle}),DV.data.of({autocomplete:jle})])}const Wle=x.memo(e=>{const{theme:t}=mp(),{code:n,className:r,initiallyHideCode:i,...o}=e,[s,a]=x.useState(i);return b.jsxs("div",{className:be("relative hover-actions-parent w-full overflow-hidden",r),children:[s&&b.jsx(aWe,{onClick:()=>a(!1)}),!s&&b.jsx(_Gt,{text:n}),b.jsx(Dle,{...o,className:be("cm",s&&"opacity-20 h-8 overflow-hidden"),theme:t==="dark"?"dark":"light",height:"100%",editable:!s,extensions:[Ble(),Ve.lineWrapping],value:n,readOnly:!0})]})});Wle.displayName="ReadonlyPythonCode";const _Gt=e=>{const t=tp.stopPropagation(()=>{navigator.clipboard.writeText(e.text),yr({title:"Copied to clipboard"})});return b.jsx(St,{onClick:t,className:"absolute top-0 right-0 m-2 z-10 hover-action",size:"xs",variant:"secondary",children:b.jsx(WO,{size:14,strokeWidth:1.5})})},aWe=e=>b.jsx("div",{className:"absolute inset-0 z-10",onClick:e.onClick,children:b.jsx(TLe,{className:"hover-action w-5 h-5 text-muted-foreground cursor-pointer absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2 opacity-80 hover:opacity-100"})}),kGt=({transforms:e,dataframeName:t})=>e?b.jsx(Wle,{minHeight:"215px",maxHeight:"215px",code:bXt(t,e.transforms)}):null,$Gt=MR("marimo-dataframe").withData(Y.object({label:Y.string().nullish(),dataframeName:Y.string(),columns:Y.object({}).passthrough().transform(e=>e)})).withFunctions({get_dataframe:fP.input(Y.object({})).output(Y.object({url:Y.string(),has_more:Y.boolean(),total_rows:Y.number(),row_headers:Y.array(Y.tuple([Y.string(),Y.array(Y.any())]))})),get_column_values:fP.input(Y.object({column:Y.string()})).output(Y.object({values:Y.array(Y.any()),too_many_values:Y.boolean()}))}).renderer(e=>b.jsx(UC,{children:b.jsx(PGt,{...e.data,...e.functions,value:e.value,setValue:e.setValue})})),TGt={transforms:[]},PGt=({columns:e,dataframeName:t,value:n,setValue:r,get_dataframe:i,get_column_values:o})=>{const{data:s,error:a}=zd(()=>i({}),[n==null?void 0:n.transforms]),{url:l,has_more:c,total_rows:u,row_headers:f}=s||{},[d,h]=x.useState(n||TGt);return b.jsxs("div",{children:[b.jsxs(V9e,{defaultValue:"transform",children:[b.jsxs(Vae,{className:"h-8",children:[b.jsxs(P3,{value:"transform",className:"text-xs py-1",children:[b.jsx(oz,{className:"w-3 h-3 mr-2"}),"Transform"]}),b.jsxs(P3,{value:"code",className:"text-xs py-1",children:[b.jsx(foe,{className:"w-3 h-3 mr-2"}),"Code"]})]}),b.jsx(A3,{value:"transform",className:"mt-1 border rounded-t overflow-hidden",children:b.jsx(mXt,{initialValue:d,columns:e,onChange:p=>{r(p),h(p)},onInvalidChange:h,getColumnValues:o})}),b.jsx(A3,{value:"code",className:"mt-1 border rounded-t overflow-hidden",children:b.jsx(kGt,{dataframeName:t,transforms:n})})]}),a&&b.jsx(pE,{error:a}),c&&u&&b.jsxs(gE,{children:["Result clipped. Total rows ",AGt(u),"."]}),b.jsx(N9e,{label:null,className:"rounded-b border-x border-b",data:l||"",pageSize:5,pagination:!0,rowHeaders:f||bbe.EMPTY,showDownload:!1,download_as:Yc.THROW,value:bbe.EMPTY,setValue:Yc.NOOP,selection:null})]})};function AGt(e){return new Intl.NumberFormat().format(e)}function lWe(e){const t=/(\w+)=%{([^}]+)}/g,n={};let r;for(;(r=t.exec(e))!==null;)n[r[1]]=r[2];return{update(i){return i===e?this:lWe(i)},parse(i){return Object.entries(n).reduce((o,[s,a])=>(o[s]=eje(i,a),o),{})}}}class RGt{constructor(){ve(this,"tagName","marimo-plotly");ve(this,"validator",Y.object({figure:Y.object({}).passthrough().transform(t=>t)}))}render(t){return b.jsx(cWe,{...t.data,host:t.host,value:t.value,setValue:t.setValue})}}const DGt={displaylogo:!1},MGt=x.lazy(()=>Pe(()=>import("./react-plotly-DbTm8reY.js").then(e=>e.r),__vite__mapDeps([]),import.meta.url)),cWe=x.memo(({figure:e,setValue:t})=>{const n=x.useMemo(()=>({autosize:e.layout.width===void 0,dragmode:"select",height:540,...e.layout}),[e.layout]);return b.jsx(MGt,{...e,layout:n,config:DGt,onSelected:Jn(r=>{r&&t({points:NGt(r.points),indices:r.points.map(i=>i.pointIndex),range:r.range})}),className:"w-full",useResizeHandler:!0,frames:e.frames??void 0,onError:Jn(r=>{At.error("PlotlyPlugin: ",r)})})});cWe.displayName="PlotlyComponent";function NGt(e){if(!e)return[];let t;return e.map(n=>{const r=Array.isArray(n.data.hovertemplate)?n.data.hovertemplate[0]:n.data.hovertemplate;return t=t?t.update(r):lWe(r),t.parse(n)})}const uWe=x.lazy(()=>Pe(()=>import("./any-language-editor-D-Oj6-AZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100]),import.meta.url));class IGt{constructor(){ve(this,"tagName","marimo-code-editor");ve(this,"validator",Y.object({initialValue:Y.string(),language:Y.string().default("python"),placeholder:Y.string(),theme:Y.enum(["light","dark"]).optional(),label:Y.string().nullable(),disabled:Y.boolean().optional(),minHeight:Y.number().optional()}))}render(t){return b.jsx(LGt,{...t.data,value:t.value,setValue:t.setValue})}}const LGt=e=>{const{theme:t}=mp(),n=e.theme||t,r=e.minHeight?`${e.minHeight}px`:"70px";return b.jsx(fc,{label:e.label,align:"top",fullWidth:!0,children:b.jsx(uWe,{className:`cm [&>*]:outline-none border rounded overflow-hidden ${n}`,theme:n==="dark"?"dark":"light",minHeight:r,placeholder:e.placeholder,editable:!e.disabled,value:e.value,language:e.language,onChange:i=>e.setValue(i)})})};/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */function x_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var jGt={exports:{}};(function(e){var t=function(){function n(d,h){return h!=null&&d instanceof h}var r;try{r=Map}catch{r=function(){}}var i;try{i=Set}catch{i=function(){}}var o;try{o=Promise}catch{o=function(){}}function s(d,h,p,g,v){typeof h=="object"&&(p=h.depth,g=h.prototype,v=h.includeNonEnumerable,h=h.circular);var y=[],O=[],m=typeof Buffer<"u";typeof h>"u"&&(h=!0),typeof p>"u"&&(p=1/0);function w(S,E){if(S===null)return null;if(E===0)return S;var C,k;if(typeof S!="object")return S;if(n(S,r))C=new r;else if(n(S,i))C=new i;else if(n(S,o))C=new o(function(z,W){S.then(function(F){z(w(F,E-1))},function(F){W(w(F,E-1))})});else if(s.__isArray(S))C=[];else if(s.__isRegExp(S))C=new RegExp(S.source,f(S)),S.lastIndex&&(C.lastIndex=S.lastIndex);else if(s.__isDate(S))C=new Date(S.getTime());else{if(m&&Buffer.isBuffer(S))return Buffer.allocUnsafe?C=Buffer.allocUnsafe(S.length):C=new Buffer(S.length),S.copy(C),C;n(S,Error)?C=Object.create(S):typeof g>"u"?(k=Object.getPrototypeOf(S),C=Object.create(k)):(C=Object.create(g),k=g)}if(h){var P=y.indexOf(S);if(P!=-1)return O[P];y.push(S),O.push(C)}n(S,r)&&S.forEach(function(z,W){var F=w(W,E-1),q=w(z,E-1);C.set(F,q)}),n(S,i)&&S.forEach(function(z){var W=w(z,E-1);C.add(W)});for(var D in S){var M;k&&(M=Object.getOwnPropertyDescriptor(k,D)),!(M&&M.set==null)&&(C[D]=w(S[D],E-1))}if(Object.getOwnPropertySymbols)for(var L=Object.getOwnPropertySymbols(S),D=0;D<L.length;D++){var A=L[D],T=Object.getOwnPropertyDescriptor(S,A);T&&!T.enumerable&&!v||(C[A]=w(S[A],E-1),T.enumerable||Object.defineProperty(C,A,{enumerable:!1}))}if(v)for(var N=Object.getOwnPropertyNames(S),D=0;D<N.length;D++){var j=N[D],T=Object.getOwnPropertyDescriptor(S,j);T&&T.enumerable||(C[j]=w(S[j],E-1),Object.defineProperty(C,j,{enumerable:!1}))}return C}return w(d,p)}s.clonePrototype=function(h){if(h===null)return null;var p=function(){};return p.prototype=h,new p};function a(d){return Object.prototype.toString.call(d)}s.__objToStr=a;function l(d){return typeof d=="object"&&a(d)==="[object Date]"}s.__isDate=l;function c(d){return typeof d=="object"&&a(d)==="[object Array]"}s.__isArray=c;function u(d){return typeof d=="object"&&a(d)==="[object RegExp]"}s.__isRegExp=u;function f(d){var h="";return d.global&&(h+="g"),d.ignoreCase&&(h+="i"),d.multiline&&(h+="m"),h}return s.__getRegExpFlags=f,s}();e.exports&&(e.exports=t)})(jGt);var FGt=function(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});var n=typeof t.cycles=="boolean"?t.cycles:!1,r=t.cmp&&function(o){return function(s){return function(a,l){var c={key:a,value:s[a]},u={key:l,value:s[l]};return o(c,u)}}}(t.cmp),i=[];return function o(s){if(s&&s.toJSON&&typeof s.toJSON=="function"&&(s=s.toJSON()),s!==void 0){if(typeof s=="number")return isFinite(s)?""+s:"null";if(typeof s!="object")return JSON.stringify(s);var a,l;if(Array.isArray(s)){for(l="[",a=0;a<s.length;a++)a&&(l+=","),l+=o(s[a])||"null";return l+"]"}if(s===null)return"null";if(i.indexOf(s)!==-1){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var c=i.push(s)-1,u=Object.keys(s).sort(r&&r(s));for(l="",a=0;a<u.length;a++){var f=u[a],d=o(s[f]);d&&(l&&(l+=","),l+=JSON.stringify(f)+":"+d)}return i.splice(c,1),"{"+l+"}"}}(e)};const fWe=wf(FGt);function w_(e,t,n){return e.fields=t||[],e.fname=n,e}function MV(e){throw Error(e)}function qle(e){var t=[],n=null,r=0,i=e.length,o="",s,a,l;e=e+"";function c(){t.push(o+e.substring(s,a)),o="",s=a+1}for(s=a=0;a<i;++a)if(l=e[a],l==="\\")o+=e.substring(s,a),s=++a;else if(l===n)c(),n=null,r=-1;else{if(n)continue;s===r&&l==='"'||s===r&&l==="'"?(s=a+1,n=l):l==="."&&!r?a>s?c():s=a+1:l==="["?(a>s&&c(),r=s=a+1):l==="]"&&(r||MV("Access path missing open bracket: "+e),r>0&&c(),r=0,s=a+1)}return r&&MV("Access path missing closing bracket: "+e),n&&MV("Access path missing closing quote: "+e),a>s&&(a++,c()),t}const Q8=Array.isArray;function dWe(e){return e===Object(e)}function Vle(e){return typeof e=="string"}function Ule(e){return Q8(e)?"["+e.map(Ule)+"]":dWe(e)||Vle(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function zGt(e,t){var n=qle(e),r="return _["+n.map(Ule).join("][")+"];";return w_(Function("_",r),[e=n.length===1?n[0]:e],t||e)}var fD=[];zGt("id");w_(function(e){return e},fD,"identity");w_(function(){return 0},fD,"zero");w_(function(){return 1},fD,"one");w_(function(){return!0},fD,"true");w_(function(){return!1},fD,"false");function QN(e,t,n){var r=[t].concat([].slice.call(n));console[e](...r)}var QGt=0,BGt=1,hWe=2,WGt=3,qGt=4;function VGt(e,t){var n=e||QGt;return{level:function(r){return arguments.length?(n=+r,this):n},error:function(){return n>=BGt&&QN(t||"error","ERROR",arguments),this},warn:function(){return n>=hWe&&QN(t||"warn","WARN",arguments),this},info:function(){return n>=WGt&&QN(t||"log","INFO",arguments),this},debug:function(){return n>=qGt&&QN(t||"log","DEBUG",arguments),this}}}function Hle(e){return typeof e=="boolean"}function S_(e){for(var t={},n=0,r=e.length;n<r;++n)t[e[n]]=!0;return t}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>fWe(e)).join(",")})`};const gl=fWe;function Fs(e,t){return e.indexOf(t)>-1}function UGt(e,t){let n=0;for(const[r,i]of e.entries())if(t(i,r,n++))return!0;return!1}const Ep=Object.keys;function HGt(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function XGt(e,t="datum"){return`${t}[${Ule(qle(e).join("."))}]`}function ZGt(e){return`${qle(e).map(t=>t.replace(".","\\.")).join("\\.")}`}function YGt(...e){for(const t of e)if(t!==void 0)return t}function GGt(e){return KGt(e)?e:`__${e}`}function KGt(e){return e.indexOf("__")===0}const yf="row",iu="column",pWe="facet",Zr="x",Xr="y",Xle="x2",Zle="y2",gWe="latitude",mWe="longitude",yWe="latitude2",vWe="longitude2",zh="color",B8="fill",W8="stroke",dD="shape",o0="size",q8="opacity",V8="fillOpacity",U8="strokeOpacity",H8="strokeWidth",Yle="text",bWe="order",Gle="detail",OWe="key",xWe="tooltip",wWe="href",JGt={x:1,y:1,x2:1,y2:1},eKt={longitude:1,longitude2:1,latitude:1,latitude2:1},SWe=Object.assign({},JGt,eKt,{color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,size:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1});function J5(e){return e==="color"||e==="fill"||e==="stroke"}const tKt={row:1,column:1,facet:1},Kle=Object.assign({},SWe,tKt),nKt=Ep(Kle);x_(Kle,["order","detail"]);x_(Kle,["order","detail","row","column","facet"]);const EWe=x_(SWe,["x","y","x2","y2","latitude","longitude","latitude2","longitude2"]),CWe=Ep(EWe),rKt={x:1,y:1},iKt=x_(EWe,["text","tooltip","href","detail","key","order"]),oKt=Object.assign({},rKt,iKt);function sKt(e){return!!oKt[e]}function aKt(e,t){return cKt(e)[t]}const _We={area:"always",bar:"always",circle:"always",geoshape:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},lKt=x_(_We,["geoshape"]);function cKt(e){switch(e){case zh:case B8:case W8:case Gle:case OWe:case xWe:case wWe:case bWe:case q8:case V8:case U8:case H8:case pWe:case yf:case iu:return _We;case Zr:case Xr:case gWe:case mWe:return lKt;case Xle:case Zle:case yWe:case vWe:return{rule:"always",bar:"always",rect:"always",area:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case o0:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case dD:return{point:"always",geoshape:"always"};case Yle:return{text:"always"}}}function NV(e){switch(e){case Zr:case Xr:case o0:case H8:case q8:case V8:case U8:case Xle:case Zle:return;case pWe:case yf:case iu:case dD:case Yle:case xWe:case wWe:return"discrete";case zh:case B8:case W8:return"flexible";case gWe:case mWe:case yWe:case vWe:case Gle:case OWe:case bWe:return}throw new Error("rangeType not implemented for "+e)}const kWe={orient:1,bandPosition:1,domain:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,values:1,zindex:1},uKt=Object.assign({},kWe,{encoding:1});Object.assign({gridScale:1,scale:1},kWe,{encode:1});const $We=Ep(uKt),TWe={clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1};Object.assign({},TWe,{opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,encode:1});const PWe=Ep(TWe),fKt="Invalid spec",dKt='Autosize "fit" only works for single views and layered views.',hKt='Cannot use a fixed value of "rangeStep" when "autosize" is "fit".';function pKt(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function gKt(e){return`The "nearest" transform is not supported for ${e} marks.`}function mKt(e){return`Selection not supported for ${e} yet`}function yKt(e){return`Cannot find a selection named "${e}"`}const vKt="Scale bindings are currently only supported for scales with unbinned, continuous domains.",bKt="Selections bound to scales cannot be separately initialized.";function OKt(e){return`Unknown repeated value "${e}".`}function xKt(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const wKt="Axes cannot be shared in concatenated views yet (https://github.com/vega/vega-lite/issues/2415).",SKt="Axes cannot be shared in repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function EKt(e){return`Unrecognized parse "${e}".`}function CKt(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}function _Kt(e){return`Ignoring an invalid transform: ${gl(e)}.`}const kKt='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function $Kt(e){return`Layer's shared ${e.join(",")} channel ${e.length===1?"is":"are"} overriden`}function TKt(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${gl(t)} is overridden by a child projection ${gl(n)}.`}function PKt(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${gl(n)}}.`}function AKt(e){return`Invalid field type "${e}"`}function RKt(e,t,n){return`A ${n.scaleType?`${n.scaleType} scale`:n.zeroFalse?"scale with zero=false":"scale with custom domain that excludes zero"} is used to encode ${e}'s ${t}. This can be misleading as the ${t==="x"?"width":"height"} of the ${e} can be arbitrary based on the scale domain. You may want to use point mark instead.`}function DKt(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function MKt(e){return`Invalid aggregation operator "${e}"`}function NKt(e,t){return`Missing type for channel "${e}", using "${t}" instead.`}function IKt(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has `+(n&&r?"fill and stroke":n?"fill":"stroke")}function LKt(e,t){return`Dropping ${gl(e)} from channel "${t}" since it does not contain data field or value.`}function jKt(e,t,n){return`${e}-encoding with type ${t} is deprecated. Replacing with ${n}-encoding.`}const FKt="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function zKt(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function QKt(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function BKt(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function WKt(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function qKt(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}const VKt="Bar mark should not be used with point scale when rangeStep is null. Please use band scale instead.";function UKt(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function HKt(e,t){return`Specified orient "${e}" overridden with "${t}"`}const XKt="custom domain scale cannot be unioned with default field-based domain";function ZKt(e){return`Cannot use the scale property "${e}" with non-color channel.`}function YKt(e){return`Using unaggregated domain with raw field has no effect (${gl(e)}).`}function GKt(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function KKt(e){return`Unaggregated domain is currently unsupported for log scale (${gl(e)}).`}function JKt(e){return`Cannot apply size to non-oriented mark "${e}".`}function eJt(e){return`rangeStep for "${e}" is dropped as top-level ${e==="x"?"width":"height"} is provided.`}function tJt(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function nJt(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function rJt(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function iJt(e,t){return`Scale type "${t}" does not work with mark "${e}".`}function oJt(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${gl(n)} and ${gl(r)}).  Using ${gl(n)}.`}function sJt(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${gl(n)} and ${gl(r)}).  Using the union of the two domains.`}function aJt(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function lJt(e){return`Dropping sort property ${gl(e)} as unioned domains only support boolean or op 'count'.`}const cJt="Unable to merge domains",uJt="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",fJt="Invalid channel for axis.";function dJt(e){return`Cannot stack "${e}" if there is already "${e}2"`}function hJt(e){return`Cannot stack non-linear scale (${e})`}function pJt(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}")`}function gJt(e,t){return`Invalid ${e}: ${gl(t)}`}function mJt(e){return`Time unit "${e}" is not supported. We are replacing it with ${e.replace("day","date")}.`}function yJt(e){return`Dropping day from datetime ${gl(e)} as day cannot be combined with other units.`}function vJt(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function bJt(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function OJt(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function xJt(e,t){return`Center is not needed to be specified in ${t} when extent is ${e}.`}function wJt(e){return`1D error band does not support ${e}`}function SJt(e){return`Channel ${e} is required for "binned" bin`}function EJt(e){return`Domain for ${e} is required for threshold scale`}const CJt=Object.freeze(Object.defineProperty({__proto__:null,BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL:VKt,CANNOT_FIX_RANGE_STEP_WITH_FIT:hKt,CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN:XKt,CONCAT_CANNOT_SHARE_AXIS:wKt,FIT_NON_SINGLE:dKt,INVALID_CHANNEL_FOR_AXIS:fJt,INVALID_SPEC:fKt,LINE_WITH_VARYING_SIZE:FKt,MORE_THAN_ONE_SORT:uJt,NO_FIELDS_NEEDS_AS:kKt,NO_INIT_SCALE_BINDINGS:bKt,REPEAT_CANNOT_SHARE_AXIS:SKt,SCALE_BINDINGS_CONTINUOUS:vKt,UNABLE_TO_MERGE_DOMAINS:cJt,cannotApplySizeToNonOrientedMark:JKt,cannotProjectOnChannelWithoutField:pKt,cannotStackNonLinearScale:hJt,cannotStackRangedMark:dJt,cannotUseScalePropertyWithNonColor:ZKt,channelRequiredForBinned:SJt,columnsNotSupportByRowCol:xKt,dayReplacedWithDate:mJt,differentParse:CKt,discreteChannelCannotEncode:qKt,domainRequiredForThresholdScale:EJt,domainSortDropped:lJt,droppedDay:yJt,droppingColor:IKt,emptyFieldDef:LKt,encodingOverridden:$Kt,errorBand1DNotSupport:wJt,errorBarCenterAndExtentAreNotNeeded:vJt,errorBarCenterIsNotNeeded:xJt,errorBarCenterIsUsedWithWrongExtent:bJt,errorBarContinuousAxisHasCustomizedAggregate:OJt,facetChannelDropped:WKt,facetChannelShouldBeDiscrete:BKt,incompatibleChannel:zKt,independentScaleMeansIndependentGuide:aJt,invalidAggregate:MKt,invalidEncodingChannel:QKt,invalidFieldType:AKt,invalidFieldTypeForCountAggregate:DKt,invalidTimeUnit:gJt,invalidTransformIgnored:_Kt,latLongDeprecated:jKt,lineWithRange:UKt,mergeConflictingDomainProperty:sJt,mergeConflictingProperty:oJt,missingFieldType:NKt,nearestNotSupportForContinuous:gKt,noSuchRepeatedValue:OKt,nonZeroScaleUsedWithLengthMark:RKt,orientOverridden:HKt,primitiveChannelDef:PKt,projectionOverridden:TKt,rangeStepDropped:eJt,scalePropertyNotWorkWithScaleType:rJt,scaleTypeNotWorkWithChannel:tJt,scaleTypeNotWorkWithFieldDef:nJt,scaleTypeNotWorkWithMark:iJt,selectionNotFound:yKt,selectionNotSupported:mKt,stackNonSummativeAggregate:pJt,unaggregateDomainHasNoEffectForRawField:YKt,unaggregateDomainWithNonSharedDomainOp:GKt,unaggregatedDomainWithLogScale:KKt,unrecognizedParse:EKt},Symbol.toStringTag,{value:"Module"})),Hu=CJt,_Jt=VGt(hWe);let jwe=_Jt;function s0(...e){jwe.warn.apply(jwe,arguments)}const kJt={quantitative:1,ordinal:1,temporal:1,nominal:1,geojson:1},Oi="quantitative",Td="ordinal",Ms="temporal",nf="nominal",$Jt="geojson";function TJt(e){if(e)switch(e=e.toLowerCase(),e){case"q":case Oi:return"quantitative";case"t":case Ms:return"temporal";case"o":case Td:return"ordinal";case"n":case nf:return"nominal";case $Jt:return"geojson"}}var Yr;(function(e){e.LINEAR="linear",e.LOG="log",e.POW="pow",e.SQRT="sqrt",e.SYMLOG="symlog",e.TIME="time",e.UTC="utc",e.QUANTILE="quantile",e.QUANTIZE="quantize",e.THRESHOLD="threshold",e.BIN_ORDINAL="bin-ordinal",e.ORDINAL="ordinal",e.POINT="point",e.BAND="band"})(Yr||(Yr={}));const PJt={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"},AJt=Ep(PJt),AWe=["linear","log","pow","sqrt","symlog","time","utc"],RJt=S_(AWe),DJt=["quantile","quantize","threshold"],MJt=S_(DJt),NJt=AWe.concat(["quantile","quantize","threshold"]),IJt=S_(NJt),LJt=["ordinal","bin-ordinal","point","band"],jJt=S_(LJt);function cO(e){return e in jJt}function FJt(e){return e in IJt}function Uw(e){return e in RJt}function zJt(e){return e in MJt}const RWe={type:1,domain:1,align:1,range:1,rangeStep:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},DWe=Ep(RWe);x_(RWe,["type","domain","range","rangeStep","scheme"]);BJt();function IV(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!Fs(["point","band","identity"],e);case"bins":return!Fs(["point","band","identity","ordinal"],e);case"round":return Uw(e)||e==="band"||e==="point";case"padding":return Uw(e)||Fs(["point","band"],e);case"paddingOuter":case"rangeStep":case"align":return Fs(["point","band"],e);case"paddingInner":return e==="band";case"clamp":return Uw(e);case"nice":return Uw(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return FJt(e)&&!Fs(["log","time","utc","threshold","quantile"],e)}}function QJt(e,t){switch(t){case"interpolate":case"scheme":return J5(e)?void 0:Hu.cannotUseScalePropertyWithNonColor(e);case"align":case"type":case"bins":case"domain":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeStep":case"reverse":case"round":case"clamp":case"zero":return}}function MWe(e,t){return Fs([Td,nf],t)?e===void 0||cO(e):t===Ms?Fs([Yr.TIME,Yr.UTC,void 0],e):t===Oi?Fs([Yr.LOG,Yr.POW,Yr.SQRT,Yr.SYMLOG,Yr.QUANTILE,Yr.QUANTIZE,Yr.THRESHOLD,Yr.LINEAR,void 0],e):!0}function NWe(e,t){switch(e){case Zr:case Xr:return Uw(t)||Fs(["band","point"],t);case o0:case H8:case q8:case V8:case U8:return Uw(t)||zJt(t)||Fs(["band","point"],t);case zh:case B8:case W8:return t!=="band";case dD:return t==="ordinal"}return!1}function BJt(){const e={};for(const t of nKt)for(const n of Ep(kJt))for(const r of AJt){const i=WJt(t,n);NWe(t,r)&&MWe(r,n)&&(e[i]=e[i]||[],e[i].push(r))}return e}function WJt(e,t){return e+"_"+t}var IWe={exports:{}};(function(e){var t=e.exports,n="__name__";t.namedfunc=function(l,c){return c[n]=l,c},t.name=function(l){return l==null?null:l[n]},t.identity=function(l){return l},t.true=t.namedfunc("true",function(){return!0}),t.false=t.namedfunc("false",function(){return!1}),t.duplicate=function(l){return JSON.parse(JSON.stringify(l))},t.equal=function(l,c){return JSON.stringify(l)===JSON.stringify(c)},t.extend=function(l){for(var c,u,f=1,d=arguments.length;f<d;++f){c=arguments[f];for(u in c)l[u]=c[u]}return l},t.length=function(l){return l!=null&&l.length!=null?l.length:null},t.keys=function(l){var c=[],u;for(u in l)c.push(u);return c},t.vals=function(l){var c=[],u;for(u in l)c.push(l[u]);return c},t.toMap=function(l,c){return(c=t.$(c))?l.reduce(function(u,f){return u[c(f)]=1,u},{}):l.reduce(function(u,f){return u[f]=1,u},{})},t.keystr=function(l){var c=l.length;if(!c)return"";for(var u=String(l[0]),f=1;f<c;++f)u+="|"+String(l[f]);return u};var r=Object.prototype.toString;t.isObject=function(l){return l===Object(l)},t.isFunction=function(l){return r.call(l)==="[object Function]"},t.isString=function(l){return typeof value=="string"||r.call(l)==="[object String]"},t.isArray=Array.isArray||function(l){return r.call(l)==="[object Array]"},t.isNumber=function(l){return typeof l=="number"||r.call(l)==="[object Number]"},t.isBoolean=function(l){return l===!0||l===!1||r.call(l)=="[object Boolean]"},t.isDate=function(l){return r.call(l)==="[object Date]"},t.isValid=function(l){return l!=null&&l===l},t.isBuffer=typeof Buffer=="function"&&Buffer.isBuffer||t.false,t.number=function(l){return l==null||l===""?null:+l},t.boolean=function(l){return l==null||l===""?null:l==="false"?!1:!!l},t.date=function(l,c){var u=c||Date;return l==null||l===""?null:u.parse(l)},t.array=function(l){return l!=null?t.isArray(l)?l:[l]:[]},t.str=function(l){return t.isArray(l)?"["+l.map(t.str)+"]":t.isObject(l)||t.isString(l)?JSON.stringify(l).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):l};var i=/\[(.*?)\]|[^.\[]+/g;t.field=function(l){return String(l).match(i).map(function(c){return c[0]!=="["?c:c[1]!=="'"&&c[1]!=='"'?c.slice(1,-1):c.slice(2,-2).replace(/\\(["'])/g,"$1")})},t.accessor=function(l){return l==null||t.isFunction(l)?l:t.namedfunc(l,Function("x","return x["+t.field(l).map(t.str).join("][")+"];"))},t.$=t.accessor,t.mutator=function(l){var c;return t.isString(l)&&(c=t.field(l)).length>1?function(u,f){for(var d=0;d<c.length-1;++d)u=u[c[d]];u[c[d]]=f}:function(u,f){u[l]=f}},t.$func=function(l,c){return function(u){u=t.$(u)||t.identity;var f=l+(t.name(u)?"_"+t.name(u):"");return t.namedfunc(f,function(d){return c(u(d))})}},t.$valid=t.$func("valid",t.isValid),t.$length=t.$func("length",t.length),t.$in=function(l,c){l=t.$(l);var u=t.isArray(c)?t.toMap(c):c;return function(f){return!!u[l(f)]}},t.comparator=function(l){var c=[];return l===void 0&&(l=[]),l=t.array(l).map(function(u){var f=1;return u[0]==="-"?(f=-1,u=u.slice(1)):u[0]==="+"&&(f=1,u=u.slice(1)),c.push(f),t.accessor(u)}),function(u,f){var d,h,p,g;for(d=0,h=l.length;d<h;++d)if(p=l[d],g=t.cmp(p(u),p(f)),g)return g*c[d];return 0}},t.cmp=function(l,c){return(l<c||l==null)&&c!=null?-1:(l>c||c==null)&&l!=null?1:(c=c instanceof Date?+c:c,(l=l instanceof Date?+l:l)!==l&&c===c?-1:c!==c&&l===l?1:0)},t.numcmp=function(l,c){return l-c},t.stablesort=function(l,c,u){var f=l.reduce(function(d,h,p){return d[u(h)]=p,d},{});return l.sort(function(d,h){var p=c(d),g=c(h);return p<g?-1:p>g?1:f[u(d)]-f[u(h)]}),l},t.permute=function(l){for(var c=l.length,u,f;c;)f=Math.floor(Math.random()*c--),u=l[c],l[c]=l[f],l[f]=u},t.pad=function(l,c,u,f){f=f||" ";var d=c-l.length;if(d<=0)return l;switch(u){case"left":return o(d,f)+l;case"middle":case"center":return o(Math.floor(d/2),f)+l+o(Math.ceil(d/2),f);default:return l+o(d,f)}};function o(l,c){var u="",f;for(f=0;f<l;++f)u+=c;return u}t.truncate=function(l,c,u,f,d){var h=l.length;if(h<=c)return l;d=d!==void 0?String(d):"…";var p=Math.max(0,c-d.length);switch(u){case"left":return d+(f?s(l,p,1):l.slice(h-p));case"middle":case"center":var g=Math.ceil(p/2),v=Math.floor(p/2);return(f?s(l,g):l.slice(0,g))+d+(f?s(l,v,1):l.slice(h-v));default:return(f?s(l,p):l.slice(0,p))+d}};function s(l,c,u){var f=0,d=l.split(a);return u?l=(d=d.reverse()).filter(function(h){return f+=h.length,f<=c}).reverse():l=d.filter(function(h){return f+=h.length,f<=c}),l.length?l.join("").trim():d[0].slice(0,c)}var a=/([\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF])/})(IWe);var rn=IWe.exports;function Mc(e,t){return e.indexOf(t)!==-1}function mh(e,t){for(let n=0;n<e.length;n++)if(!t(e[n],n))return!1;return!0}function fa(e,t,n){if(e.forEach)e.forEach.call(n,t);else for(let r in e)t.call(n,e[r],r,e)}function lg(e,t){let n=0,r;for(r in e)if(t(e[r],r,n++))return!0;return!1}function qJt(e,t){return e.filter(function(n){return!Mc(t,n)})}function VJt(e){return Object.keys(e)}function Qh(e){return!!e.parent}const LWe={channel:1,aggregate:1,autoCount:1,bin:1,timeUnit:1,hasFn:1,sort:1,stack:1,field:1,type:1,format:1,scale:1,axis:1,legend:1,value:1},Jle=VJt(LWe);function UJt(e){return e in LWe}const HJt={bin:1,scale:1,sort:1,axis:1,legend:1};function ece(e){return HJt[e]}const XJt=["maxbins","divide","extent","base","step","steps","minstep"],ZJt=["field","op","order"],jWe=XJt.map(e=>({parent:"bin",child:e})),tce=ZJt.map(e=>({parent:"sort",child:e})),rF=DWe.map(e=>({parent:"scale",child:e})),FWe=$We.map(e=>({parent:"axis",child:e})),zWe=PWe.map(e=>({parent:"legend",child:e})),X8=[].concat(jWe,tce,rF,FWe,zWe),QWe=["width","height","background","padding","title"],BWe=".";function eL(e){return Qh(e)?e.parent+BWe+e.child:e}function YJt(e){const t=e.split(BWe);if(t.length===1)return e;if(t.length===2)return{parent:t[0],child:t[1]};throw"Invalid property key with "+t.length+" dots: "+e}const GJt=X8.reduce((e,t)=>(e[t.parent]=e[t.parent]||[],e[t.parent][t.child]=t,e),{});function vg(e,t){return(GJt[e]||{})[t]}function WWe(e){return UJt(e)||Qh(e)}const KJt=[].concat(Jle,X8),qWe=["type","field","bin","timeUnit","aggregate","autoCount","channel","mark","stack","scale","sort","axis","legend"].concat(jWe,rF,FWe,zWe,tce);var ge;(function(e){e.MARK="mark",e.TRANSFORM="transform",e.STACK="stack",e.FORMAT="format",e.CHANNEL="channel",e.AGGREGATE="aggregate",e.AUTOCOUNT="autoCount",e.BIN="bin",e.HAS_FN="hasFn",e.TIMEUNIT="timeUnit",e.FIELD="field",e.TYPE="type",e.SORT="sort",e.SCALE="scale",e.AXIS="axis",e.LEGEND="legend",e.WIDTH="width",e.HEIGHT="height",e.BACKGROUND="background",e.PADDING="padding",e.TITLE="title"})(ge||(ge={}));const B1="area",rg="bar",VT="line",HP="point",pK="rect",gK="rule",iF="text",UT="tick",oF="circle",sF="square",JJt={area:1,bar:1,line:1,point:1,text:1,tick:1,trail:1,rect:1,geoshape:1,rule:1,circle:1,square:1};function een(e){return Fs(["line","area","trail"],e)}const ten=Ep(JJt);function nen(e){return e.type}S_(ten);const ren=["january","february","march","april","may","june","july","august","september","october","november","december"];ren.map(e=>e.substr(0,3));const ien=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];ien.map(e=>e.substr(0,3));var mo;(function(e){e.YEAR="year",e.MONTH="month",e.DAY="day",e.DATE="date",e.HOURS="hours",e.MINUTES="minutes",e.SECONDS="seconds",e.MILLISECONDS="milliseconds",e.YEARMONTH="yearmonth",e.YEARMONTHDATE="yearmonthdate",e.YEARMONTHDATEHOURS="yearmonthdatehours",e.YEARMONTHDATEHOURSMINUTES="yearmonthdatehoursminutes",e.YEARMONTHDATEHOURSMINUTESSECONDS="yearmonthdatehoursminutesseconds",e.MONTHDATE="monthdate",e.MONTHDATEHOURS="monthdatehours",e.HOURSMINUTES="hoursminutes",e.HOURSMINUTESSECONDS="hoursminutesseconds",e.MINUTESSECONDS="minutesseconds",e.SECONDSMILLISECONDS="secondsmilliseconds",e.QUARTER="quarter",e.YEARQUARTER="yearquarter",e.QUARTERMONTH="quartermonth",e.YEARQUARTERMONTH="yearquartermonth",e.UTCYEAR="utcyear",e.UTCMONTH="utcmonth",e.UTCDAY="utcday",e.UTCDATE="utcdate",e.UTCHOURS="utchours",e.UTCMINUTES="utcminutes",e.UTCSECONDS="utcseconds",e.UTCMILLISECONDS="utcmilliseconds",e.UTCYEARMONTH="utcyearmonth",e.UTCYEARMONTHDATE="utcyearmonthdate",e.UTCYEARMONTHDATEHOURS="utcyearmonthdatehours",e.UTCYEARMONTHDATEHOURSMINUTES="utcyearmonthdatehoursminutes",e.UTCYEARMONTHDATEHOURSMINUTESSECONDS="utcyearmonthdatehoursminutesseconds",e.UTCMONTHDATE="utcmonthdate",e.UTCMONTHDATEHOURS="utcmonthdatehours",e.UTCHOURSMINUTES="utchoursminutes",e.UTCHOURSMINUTESSECONDS="utchoursminutesseconds",e.UTCMINUTESSECONDS="utcminutesseconds",e.UTCSECONDSMILLISECONDS="utcsecondsmilliseconds",e.UTCQUARTER="utcquarter",e.UTCYEARQUARTER="utcyearquarter",e.UTCQUARTERMONTH="utcquartermonth",e.UTCYEARQUARTERMONTH="utcyearquartermonth"})(mo||(mo={}));const nce={year:1,quarter:1,month:1,day:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},VWe=Ep(nce);function oen(e){return!!nce[e]}const rce={utcyear:1,utcquarter:1,utcmonth:1,utcday:1,utcdate:1,utchours:1,utcminutes:1,utcseconds:1,utcmilliseconds:1};function sen(e){return!!rce[e]}const aen={yearquarter:1,yearquartermonth:1,yearmonth:1,yearmonthdate:1,yearmonthdatehours:1,yearmonthdatehoursminutes:1,yearmonthdatehoursminutesseconds:1,quartermonth:1,monthdate:1,monthdatehours:1,hoursminutes:1,hoursminutesseconds:1,minutesseconds:1,secondsmilliseconds:1},UWe={utcyearquarter:1,utcyearquartermonth:1,utcyearmonth:1,utcyearmonthdate:1,utcyearmonthdatehours:1,utcyearmonthdatehoursminutes:1,utcyearmonthdatehoursminutesseconds:1,utcquartermonth:1,utcmonthdate:1,utcmonthdatehours:1,utchoursminutes:1,utchoursminutesseconds:1,utcminutesseconds:1,utcsecondsmilliseconds:1},len=Object.assign({},rce,UWe);function cen(e){return!!len[e]}const uen=Object.assign({},nce,rce,aen,UWe);function fen(e){return!!uen[e]}const den={year:"setFullYear",month:"setMonth",date:"setDate",hours:"setHours",minutes:"setMinutes",seconds:"setSeconds",milliseconds:"setMilliseconds",quarter:null,day:null};function hen(e,t){const n=cen(e),r=n?new Date(Date.UTC(1972,0,1,0,0,0,0)):new Date(1972,0,1,0,0,0,0);for(const i of VWe)if(HWe(e,i))switch(i){case mo.DAY:throw new Error("Cannot convert to TimeUnits containing 'day'");case mo.QUARTER:{const{getDateMethod:o,setDateMethod:s}=Fwe("month",n);r[s](Math.floor(t[o]()/3)*3);break}default:{const{getDateMethod:o,setDateMethod:s}=Fwe(i,n);r[s](t[o]())}}return r}function Fwe(e,t){const n=den[e],r=t?"setUTC"+n.substr(3):n,i="get"+(t?"UTC":"")+n.substr(3);return{setDateMethod:r,getDateMethod:i}}function HWe(e,t){const n=e.indexOf(t);return n>-1&&(t!==mo.SECONDS||n===0||e.charAt(n-1)!=="i")}const Jr="?";function It(e){return Z8(e)||pen(e)}function Z8(e){return e===Jr}function pen(e){return e!==void 0&&e!=null&&(!!e.enum||!!e.name)&&!rn.isArray(e)}function LV(e,t,n){return rn.extend({},{name:t,enum:n},e===Jr?{}:e)}function jV(e){let t={},n={};for(const r of e){const i=[0];for(let s=0;s<r.length;s++)r.charAt(s).toUpperCase()===r.charAt(s)&&i.push(s);let o=i.map(s=>r.charAt(s)).join("").toLowerCase();if(!n[o]){t[r]=o,n[o]=!0;continue}if(i[i.length-1]!==r.length-1&&(o=i.concat([r.length-1]).map(s=>r.charAt(s)).join("").toLowerCase(),!n[o])){t[r]=o,n[o]=!0;continue}for(let s=1;!t[r];s++){let a=o+"_"+s;if(!n[a]){t[r]=a,n[a]=!0;break}}}return t}const BN={mark:"m",channel:"c",aggregate:"a",autoCount:"#",hasFn:"h",bin:"b",sort:"so",stack:"st",scale:"s",format:"f",axis:"ax",legend:"l",value:"v",timeUnit:"tu",field:"f",type:"t",binProps:{maxbins:"mb",min:"mi",max:"ma",base:"b",step:"s",steps:"ss",minstep:"ms",divide:"d"},sortProps:{field:"f",op:"o",order:"or"},scaleProps:jV(DWe),axisProps:jV($We),legendProps:jV(PWe)};function Pk(e){if(Qh(e))return BN[e.parent]+"-"+BN[e.parent+"Props"][e.child];if(BN[e])return BN[e];throw new Error("Default name undefined for "+e)}const Fl=[!1,!0],gen={maxbins:[5,10,20],extent:[void 0],base:[10],step:[void 0],steps:[void 0],minstep:[void 0],divide:[[5,2]],binned:[!1],anchor:[void 0],nice:[!0]},men={field:[void 0],op:["min","mean"],order:["ascending","descending"]},yen={type:[void 0,Yr.LOG],domain:[void 0],base:[void 0],exponent:[1,2],constant:[void 0],bins:[void 0],clamp:Fl,nice:Fl,reverse:Fl,round:Fl,zero:Fl,padding:[void 0],paddingInner:[void 0],paddingOuter:[void 0],interpolate:[void 0],range:[void 0],rangeStep:[17,21],scheme:[void 0]},ven={zindex:[1,0],offset:[void 0],orient:[void 0],values:[void 0],bandPosition:[void 0],encoding:[void 0],domain:Fl,domainColor:[void 0],domainDash:[void 0],domainDashOffset:[void 0],domainOpacity:[void 0],domainWidth:[void 0],formatType:[void 0],grid:Fl,gridColor:[void 0],gridDash:[void 0],gridDashOffset:[void 0],gridOpacity:[void 0],gridWidth:[void 0],format:[void 0],labels:Fl,labelAlign:[void 0],labelAngle:[void 0],labelBaseline:[void 0],labelColor:[void 0],labelFlushOffset:[void 0],labelFont:[void 0],labelFontSize:[void 0],labelFontStyle:[void 0],labelFontWeight:[void 0],labelLimit:[void 0],labelOpacity:[void 0],labelSeparation:[void 0],labelOverlap:[void 0],labelPadding:[void 0],labelBound:[void 0],labelFlush:[void 0],maxExtent:[void 0],minExtent:[void 0],position:[void 0],ticks:Fl,tickColor:[void 0],tickCount:[void 0],tickDash:[void 0],tickExtra:[void 0],tickDashOffset:[void 0],tickMinStep:[void 0],tickOffset:[void 0],tickOpacity:[void 0],tickRound:[void 0],tickSize:[void 0],tickWidth:[void 0],title:[void 0],titleAlign:[void 0],titleAnchor:[void 0],titleAngle:[void 0],titleBaseline:[void 0],titleColor:[void 0],titleFont:[void 0],titleFontSize:[void 0],titleFontStyle:[void 0],titleFontWeight:[void 0],titleLimit:[void 0],titleOpacity:[void 0],titlePadding:[void 0],titleX:[void 0],titleY:[void 0]},ben={orient:["left","right"],format:[void 0],type:[void 0],values:[void 0],zindex:[void 0],clipHeight:[void 0],columnPadding:[void 0],columns:[void 0],cornerRadius:[void 0],direction:[void 0],encoding:[void 0],fillColor:[void 0],formatType:[void 0],gridAlign:[void 0],offset:[void 0],padding:[void 0],rowPadding:[void 0],strokeColor:[void 0],labelAlign:[void 0],labelBaseline:[void 0],labelColor:[void 0],labelFont:[void 0],labelFontSize:[void 0],labelFontStyle:[void 0],labelFontWeight:[void 0],labelLimit:[void 0],labelOffset:[void 0],labelOpacity:[void 0],labelOverlap:[void 0],labelPadding:[void 0],labelSeparation:[void 0],legendX:[void 0],legendY:[void 0],gradientLength:[void 0],gradientOpacity:[void 0],gradientStrokeColor:[void 0],gradientStrokeWidth:[void 0],gradientThickness:[void 0],symbolDash:[void 0],symbolDashOffset:[void 0],symbolFillColor:[void 0],symbolOffset:[void 0],symbolOpacity:[void 0],symbolSize:[void 0],symbolStrokeColor:[void 0],symbolStrokeWidth:[void 0],symbolType:[void 0],tickCount:[void 0],tickMinStep:[void 0],title:[void 0],titleAnchor:[void 0],titleAlign:[void 0],titleBaseline:[void 0],titleColor:[void 0],titleFont:[void 0],titleFontSize:[void 0],titleFontStyle:[void 0],titleFontWeight:[void 0],titleLimit:[void 0],titleOpacity:[void 0],titleOrient:[void 0],titlePadding:[void 0]},Oen={mark:[HP,rg,VT,B1,pK,UT,iF],channel:[Zr,Xr,yf,iu,o0,zh],aggregate:[void 0,"mean"],autoCount:Fl,bin:Fl,hasFn:Fl,timeUnit:[void 0,mo.YEAR,mo.MONTH,mo.MINUTES,mo.SECONDS],field:[void 0],type:[nf,Td,Oi,Ms],sort:["ascending","descending"],stack:["zero","normalize","center",null],value:[void 0],format:[void 0],title:[void 0],scale:[!0],axis:Fl,legend:Fl,binProps:gen,sortProps:men,scaleProps:yen,axisProps:ven,legendProps:ben};function FV(e,t,n){if(e==="field"||Qh(e)&&e.parent==="sort"&&e.child==="field")return t.fieldNames();let r;if(Qh(e)?r=n.enum[e.parent+"Props"][e.child]:r=n.enum[e],r!==void 0)return r;throw new Error("No default enumValues for "+JSON.stringify(e))}const hD={verbose:!1,defaultSpecConfig:{line:{point:!0},scale:{useUnaggregatedDomain:!0}},propertyPrecedence:qWe.map(eL),enum:Oen,numberNominalProportion:.05,numberNominalLimit:40,constraintManuallySpecifiedValue:!1,autoAddCount:!1,hasAppropriateGraphicTypeForMark:!0,omitAggregate:!1,omitAggregatePlotWithDimensionOnlyOnFacet:!0,omitAggregatePlotWithoutDimension:!1,omitBarLineAreaWithOcclusion:!0,omitBarTickWithSize:!0,omitMultipleNonPositionalChannels:!0,omitRaw:!1,omitRawContinuousFieldForAggregatePlot:!0,omitRepeatedField:!0,omitNonPositionalOrFacetOverPositionalChannels:!0,omitTableWithOcclusionIfAutoAddCount:!0,omitVerticalDotPlot:!1,omitInvalidStackSpec:!0,omitNonSumStack:!0,preferredBinAxis:Zr,preferredTemporalAxis:Zr,preferredOrdinalAxis:Xr,preferredNominalAxis:Xr,preferredFacet:yf,minCardinalityForBin:15,maxCardinalityForCategoricalColor:20,maxCardinalityForFacet:20,maxCardinalityForShape:6,timeUnitShouldHaveVariation:!0,typeMatchesSchemaType:!0,stylize:!0,smallRangeStepForHighCardinalityOrFacet:{maxCardinality:10,rangeStep:12},nominalColorScaleForHighCardinality:{maxCardinality:10,palette:"category20"},xAxisOnTopForHighYCardinalityWithoutColumn:{maxCardinality:30},maxGoodCardinalityForFacet:5,maxGoodCardinalityForColor:7,minPercentUniqueForKey:.8,minCardinalityForKey:50},xen={argmax:1,argmin:1,average:1,count:1,distinct:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1};function wen(e){return!!e&&!!e.argmin}function Sen(e){return!!e&&!!e.argmax}function Een(e){return Vle(e)&&!!xen[e]}const XWe=["count","sum","distinct","valid","missing"],Cen=["mean","average","median","q1","q3","min","max"];S_(Cen);function _en(e){return Hle(e)&&(e=Ren(e,void 0)),"bin"+Ep(e).map(t=>HGt(`_${t}_${e[t]}`)).join("")}function ZWe(e){return e===!0||ken(e)&&!e.binned}function ken(e){return dWe(e)}function mK(e){switch(e){case yf:case iu:case o0:case zh:case B8:case W8:case H8:case q8:case V8:case U8:case dD:return 6;default:return 10}}function YWe(e){return!!e&&!!e.condition&&!Q8(e.condition)&&Ay(e.condition)}function Ay(e){return!!e&&(!!e.field||e.aggregate==="count")}function zV(e){return Ay(e)&&Vle(e.field)}function $en(e){return!!e.op}function QV(e,t={}){let n=e.field;const r=t.prefix;let i=t.suffix,o="";if(Pen(e))n=GGt("count");else{let s;if(!t.nofn)if($en(e))s=e.op;else{const{bin:a,aggregate:l,timeUnit:c}=e;ZWe(a)?(s=_en(a),i=(t.binSuffix||"")+(t.suffix||"")):l?Sen(l)?(o=`.${n}`,n=`argmax_${l.argmax}`):wen(l)?(o=`.${n}`,n=`argmin_${l.argmin}`):s=String(l):c&&(s=String(c))}s&&(n=n?`${s}_${n}`:s)}return i&&(n=`${n}_${i}`),r&&(n=`${r}_${n}`),t.forAs?n:t.expr?XGt(n,t.expr)+o:ZGt(n)+o}function GWe(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return!!e.bin;case"temporal":return!1}throw new Error(Hu.invalidFieldType(e.type))}function Ten(e){return!GWe(e)}function Pen(e){return e.aggregate==="count"}function Aen(e){if(Ay(e))return e;if(YWe(e))return e.condition}function Ren(e,t){return Hle(e)?{maxbins:mK(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?Object.assign({},e,{maxbins:mK(t)}):e}const Qx={compatible:!0};function Den(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case"row":case"column":case"facet":return Ten(e)?{compatible:!1,warning:Hu.facetChannelShouldBeDiscrete(t)}:Qx;case"x":case"y":case"color":case"fill":case"stroke":case"text":case"detail":case"key":case"tooltip":case"href":return Qx;case"longitude":case"longitude2":case"latitude":case"latitude2":return n!==Oi?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:Qx;case"opacity":case"fillOpacity":case"strokeOpacity":case"strokeWidth":case"size":case"x2":case"y2":return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:Qx;case"shape":return Fs(["ordinal","nominal","geojson"],e.type)?Qx:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case"order":return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:Qx}throw new Error("channelCompatability not implemented for channel "+t)}function Men(e,t,n,r){const i=Nen(t,n,r),{type:o}=e;return sKt(t)?o!==void 0?NWe(t,o)?MWe(o,n.type)?o:(s0(Hu.scaleTypeNotWorkWithFieldDef(o,i)),i):(s0(Hu.scaleTypeNotWorkWithChannel(t,o,i)),i):i:null}function Nen(e,t,n){switch(t.type){case"nominal":case"ordinal":return J5(e)||NV(e)==="discrete"?(e==="shape"&&t.type==="ordinal"&&s0(Hu.discreteChannelCannotEncode(e,"ordinal")),"ordinal"):Fs(["x","y"],e)&&(Fs(["rect","bar","rule"],n)||n==="bar")?"band":"point";case"temporal":return J5(e)?"time":NV(e)==="discrete"?(s0(Hu.discreteChannelCannotEncode(e,"temporal")),"ordinal"):"time";case"quantitative":return J5(e)?ZWe(t.bin)?"bin-ordinal":"linear":NV(e)==="discrete"?(s0(Hu.discreteChannelCannotEncode(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(Hu.invalidFieldType(t.type))}var Pd;(function(e){e.QUANTITATIVE=Oi,e.ORDINAL=Td,e.TEMPORAL=Ms,e.NOMINAL=nf,e.KEY="key"})(Pd||(Pd={}));function zwe(e){return e===Td||e===nf||e===Pd.KEY}class xl{constructor(t=null){this.index=t?Object.assign({},t):{}}has(t){return eL(t)in this.index}get(t){return this.index[eL(t)]}set(t,n){return this.index[eL(t)]=n,this}setByKey(t,n){this.index[t]=n}map(t){const n=new xl;for(const r in this.index)n.index[r]=t(this.index[r]);return n}size(){return rn.keys(this.index).length}duplicate(){return new xl(this.index)}}function Qwe(e,t){const n=e&&e[t];return n?Q8(n)?UGt(n,r=>!!r.field):Ay(n)||YWe(n):!1}const Ien={zero:1,center:1,normalize:1};function Len(e){return!!Ien[e]}const jen=[rg,B1,gK,HP,oF,sF,VT,iF,UT],Fen=[rg,B1];function zen(e){const t=e.x,n=e.y;if(Ay(t)&&Ay(n))if(t.type==="quantitative"&&n.type==="quantitative"){if(t.stack)return"x";if(n.stack)return"y";if(!!t.aggregate!=!!n.aggregate)return t.aggregate?"x":"y"}else{if(t.type==="quantitative")return"x";if(n.type==="quantitative")return"y"}else{if(Ay(t)&&t.type==="quantitative")return"x";if(Ay(n)&&n.type==="quantitative")return"y"}}function Qen(e,t,n,r={}){const i=nen(e)?e.type:e;if(!Fs(jen,i))return null;const o=zen(t);if(!o)return null;const s=t[o],a=zV(s)?QV(s,{}):void 0,l=o==="x"?"y":"x",c=t[l],u=zV(c)?QV(c,{}):void 0,f=CWe.reduce((h,p)=>{if(p!=="tooltip"&&Qwe(t,p)){const g=t[p];(Q8(g)?g:[g]).forEach(v=>{const y=Aen(v);if(y.aggregate)return;const O=zV(y)?QV(y,{}):void 0;(!O||O!==u&&O!==a)&&h.push({channel:p,fieldDef:y})})}return h},[]);let d;if(s.stack!==void 0?Hle(s.stack)?d=s.stack?"zero":null:d=s.stack:f.length>0&&(Fs(Fen,i)?d=YGt(n,"zero"):d=n),!d||!Len(d))return null;if(s.scale&&s.scale.type&&s.scale.type!==Yr.LINEAR){if(r.disallowNonLinearStack)return null;s0(Hu.cannotStackNonLinearScale(s.scale.type))}return Qwe(t,o===Zr?Xle:Zle)?(s.stack!==void 0&&s0(Hu.cannotStackRangedMark(o)),null):(s.aggregate&&!Fs(XWe,s.aggregate)&&s0(Hu.stackNonSummativeAggregate(s.aggregate)),{groupbyChannel:c?l:void 0,fieldChannel:o,impute:een(i),stackBy:f,offset:d})}function Ben(e){return lg(e.encodings,t=>on(t)&&!It(t.aggregate)&&!!t.aggregate||Y8(t))}function KWe(e){if(!Ven(e))return null;const t=tqe(e.encodings,{schema:null,wildcardMode:"null"}),n=e.mark;return Qen(n,t,void 0,{disallowNonLinearStack:!0})}function Wen(e){for(const t of e.encodings)if(t[ge.STACK]!==void 0&&!It(t[ge.STACK]))return t[ge.STACK]}function qen(e){for(const t of e.encodings)if(t[ge.STACK]!==void 0&&!It(t.channel))return t.channel;return null}function Ven(e){if(It(e.mark))return!1;const t=[ge.STACK,ge.CHANNEL,ge.MARK,ge.FIELD,ge.AGGREGATE,ge.AUTOCOUNT,ge.SCALE,vg("scale","type"),ge.TYPE],n=rn.toMap(qJt(KJt,t)),r=e.encodings.filter(i=>!$u(i));for(const i of r)if(JWe(i,{exclude:n}))return!1;return!0}function JWe(e,t={}){if(!rn.isObject(e))return!1;for(const n in e)if(e.hasOwnProperty(n)&&(It(e[n])&&(!t.exclude||!t.exclude[n])||JWe(e[n],t)))return!0;return!1}function Uen(e){return e.map(t=>Hen(t))}function Hen(e){return t=>e[t]!==void 0?e[t]:t}function ab(e,t){return It(e)?!Z8(e)&&e.enum?Jr+JSON.stringify(e.enum):Jr:t?t(e):e}function tL(e,t){return t?t(e):e}const ice=new xl,oce=[].concat(qWe,tce,[ge.TRANSFORM,ge.STACK],QWe).reduce((e,t)=>e.set(t,!0),new xl),yK={axis:{x:!0,y:!0,row:!0,column:!0},legend:{color:!0,opacity:!0,size:!0,shape:!0},scale:{x:!0,y:!0,color:!0,opacity:!0,row:!0,column:!0,size:!0,shape:!0},sort:{x:!0,y:!0,path:!0,order:!0},stack:{x:!0,y:!0}};function ME(e,t=oce,n=ice){const r=[];t.get(ge.MARK)&&r.push(ab(e.mark,n.get(ge.MARK))),e.transform&&e.transform.length>0&&r.push("transform:"+JSON.stringify(e.transform));let i;if(t.get(ge.STACK)&&(i=KWe(e)),e.encodings){const o=e.encodings.reduce((s,a)=>{if(!$u(a)){let l;i&&a.channel===i.fieldChannel?l=Bwe(Object.assign({},a,{stack:i.offset}),t,n):l=Bwe(a,t,n),l&&s.push(l)}return s},[]).sort().join("|");o&&r.push(o)}for(let o of QWe){const s=o.toString();if(t.get(o)&&e[s]){const a=e[s];r.push(`${s}=${JSON.stringify(a)}`)}}return r.join("|")}function Bwe(e,t=oce,n=ice){const r=[];if(t.get(ge.CHANNEL)&&r.push(ab(e.channel,n.get(ge.CHANNEL))),on(e)){const i=eqe(e,t,n);i&&r.push(i)}else Eu(e)?r.push(e.value):Eo(e)&&r.push("autocount()");return r.join(":")}function eqe(e,t=oce,n=ice){if(t.get(ge.AGGREGATE)&&$u(e))return"-";const r=Xen(e,t,n),i=Zen(e,t,n);let o;if(on(e)){if(o=t.get("field")?ab(e.field,n.get("field")):"...",t.get(ge.TYPE))if(It(e.type))o+=","+ab(e.type,n.get(ge.TYPE));else{const s=((e.type||Oi)+"").substr(0,1);o+=","+ab(s,n.get(ge.TYPE))}o+=i.map(s=>{let a=s.value instanceof Array?"["+s.value+"]":s.value;return","+s.key+"="+a}).join("")}else Eo(e)&&(o="*,q");return o?r?(rn.isString(r)?r:Jr+(rn.keys(r).length>0?JSON.stringify(r):""))+"("+o+")":o:null}function Xen(e,t,n){if(t.get(ge.AGGREGATE)&&e.aggregate&&!It(e.aggregate))return tL(e.aggregate,n.get(ge.AGGREGATE));if(t.get(ge.AGGREGATE)&&Y8(e))return tL("count",n.get(ge.AGGREGATE));if(t.get(ge.TIMEUNIT)&&e.timeUnit&&!It(e.timeUnit))return tL(e.timeUnit,n.get(ge.TIMEUNIT));if(t.get(ge.BIN)&&e.bin&&!It(e.bin))return"bin";{let r=null;for(const i of[ge.AGGREGATE,ge.AUTOCOUNT,ge.TIMEUNIT,ge.BIN]){const o=e[i];t.get(i)&&e[i]&&It(o)&&(r=r||{},r[i]=Z8(o)?o:o.enum)}return r&&e.hasFn&&(r.hasFn=!0),r}}function Zen(e,t,n){const r=[];if(!rn.isBoolean(e.bin)&&!Z8(e.bin)){const i=e.bin;for(const o in i){const s=vg("bin",o);s&&t.get(s)&&i[o]!==void 0&&r.push({key:o,value:ab(i[o],n.get(s))})}r.sort((o,s)=>o.key.localeCompare(s.key))}for(const i of[ge.SCALE,ge.SORT,ge.STACK,ge.AXIS,ge.LEGEND])if(!(!It(e.channel)&&!yK[i][e.channel])&&t.get(i)&&e[i]!==void 0){const o=e[i];if(rn.isBoolean(o)||o===null)r.push({key:i+"",value:o||!1});else if(rn.isString(o))r.push({key:i+"",value:tL(JSON.stringify(o),n.get(i))});else{let s=[];for(const a in o){const l=vg(i,a);l&&t.get(l)&&o[a]!==void 0&&s.push({key:a,value:ab(o[a],n.get(l))})}if(s.length>0){const a=s.sort((l,c)=>l.key.localeCompare(c.key)).reduce((l,c)=>(l[c.key]=c.value,l),{});r.push({key:i+"",value:JSON.stringify(a)})}}}return r}function BV(e,t,n){let r=[],i=0;for(let o=0;o<n;o++){let s=e.indexOf(t,i);if(s!==-1)r.push(e.substring(i,s)),i=s+1;else break}if(r.push(e.substr(i)),r.length!==n+1)for(;r.length!==n+1;)r.push("");return r}var Wwe;(function(e){function t(o,s){let a=s.indexOf("(")!==-1?i(s):n(BV(s,",",2));return Object.assign({channel:o},a)}e.encoding=t;function n(o){const s={};s.field=o[0],s.type=TJt(o[1].toUpperCase())||"?";let a=o[2],l=0,c=0;for(;c<a.length;){let u=a.indexOf("=",c),f;if(u!==-1){let d=a.substring(c,u);if(a[c+d.length+1]==="{"){let h=c+d.length+1;l=r(h,a,"}");const p=a.substring(h,l+1);f=JSON.parse(p),c=l+2}else if(a[c+d.length+1]==="["){let h=c+d.length+1,p=r(h,a,"]");const g=a.substring(h,p+1);f=JSON.parse(g),c=p+2}else{let h=c,p=a.indexOf(",",c+d.length);p===-1&&(p=a.length),c=p+1,f=JSON.parse(a.substring(h+d.length+1,p))}ece(d)?s[d]=f:(s.bin=s.bin||{},s.bin[d]=f)}else break}return s}e.rawFieldDef=n;function r(o,s,a){for(let l=o;l<s.length;l++)if(s[l]===a)return l}e.getClosingIndex=r;function i(o){const s={};if(o[0]==="?"){let a=r(1,o,"}"),l=JSON.parse(o.substring(1,a+1));for(let c in l)rn.isArray(l[c])?s[c]={enum:l[c]}:s[c]=l[c];return Object.assign({},s,n(BV(o.substring(a+2,o.length-1),",",2)))}else{let a=o.substring(0,o.indexOf("(")),l=o.substring(a.length+1,o.length-1),c=BV(l,",",2);if(Een(a))return Object.assign({aggregate:a},n(c));if(fen(a))return Object.assign({timeUnit:a},n(c));if(a==="bin")return Object.assign({bin:{}},n(c))}}e.fn=i})(Wwe||(Wwe={}));function Eu(e){return e!=null&&e.value!==void 0}function on(e){return e!=null&&(e.field||e.aggregate==="count")}function Eo(e){return e!=null&&"autoCount"in e}function $u(e){return Eo(e)&&e.autoCount===!1}function Y8(e){return Eo(e)&&e.autoCount===!0}const Yen=[ge.AGGREGATE,ge.BIN,ge.TIMEUNIT,ge.FIELD,ge.TYPE,ge.SCALE,ge.SORT,ge.AXIS,ge.LEGEND,ge.STACK,ge.FORMAT];function tqe(e,t){let n={};for(const r of e){if($u(r))continue;const{channel:i}=r;if(It(i))throw new Error("Cannot convert wildcard channel to a fixed channel");const o=Eu(r)?Gen(r):sce(r,t);if(o===null){if(t.wildcardMode==="null")return null;continue}n[i]=o}return n}function Gen(e){const{value:t}=e;return It(t)?null:{value:t}}function sce(e,t={}){const{props:n=Yen,schema:r,wildcardMode:i="skip"}=t;if(on(e)){const o={};for(const s of n){let a=e[s];if(It(a)){if(i==="skip")continue;return null}if(a!==void 0){if(!(!yK[s]||yK[s][e.channel]))continue;if(ece(s)&&rn.isObject(a)){a=Object.assign({},a);for(const c in a)if(It(a[c])){if(i==="null")return null;delete a[c]}}if(s==="bin"&&a===!1)continue;s==="type"&&a==="key"?o.type="nominal":o[s]=a}if(s===ge.SCALE&&r&&e.type===Td){const l=e.scale,{ordinalDomain:c}=r.fieldSchema(e.field);l!==null&&c&&(o[ge.SCALE]=Object.assign({domain:c},rn.isObject(l)?l:{}))}}return o}else{if(e.autoCount===!1)throw new Error("Cannot convert {autoCount: false} into a field def");return{aggregate:"count",field:"*",type:"quantitative"}}}function Ak(e){return on(e)?!yy(e)&&e.type!=="temporal":Eo(e)}function yy(e){if(on(e)){const t=sce(e,{props:["bin","timeUnit","type"]});return GWe(t)||!!t.timeUnit}return!1}function uO(e){const t=e.scale===!0||e.scale===Jr?{}:e.scale||{},{type:n,channel:r,timeUnit:i,bin:o}=e,s=void 0;if(It(t.type)||It(n)||It(r)||It(o))return;if(t.type)return t.type;if(n==="temporal"&&It(i)||n==="quantitative"&&It(o))return;const l={type:n===Pd.KEY?"nominal":n,timeUnit:i,bin:o};return Men({type:t.type},r,l,s)}var ace={exports:{}},WV=new Date,qV=new Date;function bs(e,t,n,r){function i(o){return e(o=new Date(+o)),o}return i.floor=i,i.round=function(o){var s=new Date(+o),a=new Date(o-1);return e(s),e(a),t(a,1),o-s<a-o?s:a},i.ceil=function(o){return e(o=new Date(o-1)),t(o,1),o},i.offset=function(o,s){return t(o=new Date(+o),s==null?1:Math.floor(s)),o},i.range=function(o,s,a){var l=[];if(o=new Date(o-1),s=new Date(+s),a=a==null?1:Math.floor(a),!(o<s)||!(a>0))return l;for(t(o,1),e(o),o<s&&l.push(new Date(+o));t(o,a),e(o),o<s;)l.push(new Date(+o));return l},i.filter=function(o){return bs(function(s){for(;e(s),!o(s);)s.setTime(s-1)},function(s,a){for(;--a>=0;)for(;t(s,1),!o(s););})},n&&(i.count=function(o,s){return WV.setTime(+o),qV.setTime(+s),e(WV),e(qV),Math.floor(n(WV,qV))},i.every=function(o){return o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?function(s){return r(s)%o===0}:function(s){return i.count(0,s)%o===0}):i}),i}var XP=bs(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});XP.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?bs(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):XP};const nqe=bs(function(e){e.setMilliseconds(0)},function(e,t){e.setTime(+e+t*1e3)},function(e,t){return(t-e)/1e3},function(e){return e.getSeconds()}),rqe=bs(function(e){e.setSeconds(0,0)},function(e,t){e.setTime(+e+t*6e4)},function(e,t){return(t-e)/6e4},function(e){return e.getMinutes()}),iqe=bs(function(e){e.setMinutes(0,0,0)},function(e,t){e.setTime(+e+t*36e5)},function(e,t){return(t-e)/36e5},function(e){return e.getHours()}),oqe=bs(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5},function(e){return e.getDate()-1});function nx(e){return bs(function(t){t.setHours(0,0,0,0),t.setDate(t.getDate()-(t.getDay()+7-e)%7)},function(t,n){t.setDate(t.getDate()+n*7)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5})}var aF=nx(0),sqe=nx(1),aqe=nx(2),lqe=nx(3),cqe=nx(4),uqe=nx(5),fqe=nx(6);const dqe=bs(function(e){e.setHours(0,0,0,0),e.setDate(1)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()}),hqe=bs(function(e){e.setHours(0,0,0,0),e.setMonth(0,1)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()}),pqe=bs(function(e){e.setUTCMilliseconds(0)},function(e,t){e.setTime(+e+t*1e3)},function(e,t){return(t-e)/1e3},function(e){return e.getUTCSeconds()}),gqe=bs(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*6e4)},function(e,t){return(t-e)/6e4},function(e){return e.getUTCMinutes()}),mqe=bs(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*36e5)},function(e,t){return(t-e)/36e5},function(e){return e.getUTCHours()}),yqe=bs(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/864e5},function(e){return e.getUTCDate()-1});function rx(e){return bs(function(t){t.setUTCHours(0,0,0,0),t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7)},function(t,n){t.setUTCDate(t.getUTCDate()+n*7)},function(t,n){return(n-t)/6048e5})}var lF=rx(0),vqe=rx(1),bqe=rx(2),Oqe=rx(3),xqe=rx(4),wqe=rx(5),Sqe=rx(6);const Eqe=bs(function(e){e.setUTCHours(0,0,0,0),e.setUTCDate(1)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()}),Cqe=bs(function(e){e.setUTCHours(0,0,0,0),e.setUTCMonth(0,1)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});var _qe=XP.range,Ken=nqe.range,Jen=rqe.range,etn=iqe.range,ttn=oqe.range,ntn=aF.range,rtn=sqe.range,itn=aqe.range,otn=lqe.range,stn=cqe.range,atn=uqe.range,ltn=fqe.range,ctn=aF.range,utn=dqe.range,ftn=hqe.range,dtn=XP,htn=_qe,ptn=pqe.range,gtn=gqe.range,mtn=mqe.range,ytn=yqe.range,vtn=lF.range,btn=vqe.range,Otn=bqe.range,xtn=Oqe.range,wtn=xqe.range,Stn=wqe.range,Etn=Sqe.range,Ctn=lF.range,_tn=Eqe.range,ktn=Cqe.range;const $tn=Object.freeze(Object.defineProperty({__proto__:null,day:oqe,days:ttn,friday:uqe,fridays:atn,hour:iqe,hours:etn,interval:bs,millisecond:XP,milliseconds:_qe,minute:rqe,minutes:Jen,monday:sqe,mondays:rtn,month:dqe,months:utn,saturday:fqe,saturdays:ltn,second:nqe,seconds:Ken,sunday:aF,sundays:ntn,thursday:cqe,thursdays:stn,tuesday:aqe,tuesdays:itn,utcDay:yqe,utcDays:ytn,utcFriday:wqe,utcFridays:Stn,utcHour:mqe,utcHours:mtn,utcMillisecond:dtn,utcMilliseconds:htn,utcMinute:gqe,utcMinutes:gtn,utcMonday:vqe,utcMondays:btn,utcMonth:Eqe,utcMonths:_tn,utcSaturday:Sqe,utcSaturdays:Etn,utcSecond:pqe,utcSeconds:ptn,utcSunday:lF,utcSundays:vtn,utcThursday:xqe,utcThursdays:wtn,utcTuesday:bqe,utcTuesdays:Otn,utcWednesday:Oqe,utcWednesdays:xtn,utcWeek:lF,utcWeeks:Ctn,utcYear:Cqe,utcYears:ktn,wednesday:lqe,wednesdays:otn,week:aF,weeks:ctn,year:hqe,years:ftn},Symbol.toStringTag,{value:"Module"})),Ttn=cu($tn);var Tu=Ttn,qwe=new Date,Bx=new Date(0,0,1).setFullYear(0),Wx=new Date(Date.UTC(0,0,1)).setUTCFullYear(0);function Pu(e){return qwe.setTime(+e),qwe}function Nc(e,t,n,r,i,o){var s={type:e,date:t,unit:n};return r?s.step=r:s.minstep=1,i!=null&&(s.min=i),o!=null&&(s.max=o),s}function Au(e,t,n,r,i,o){return Nc(e,function(s){return t.offset(n,s)},function(s){return t.count(n,s)},r,i,o)}var Ptn=[Au("second",Tu.second,Bx),Au("minute",Tu.minute,Bx),Au("hour",Tu.hour,Bx),Au("day",Tu.day,Bx,[1,7]),Au("month",Tu.month,Bx,[1,3,6]),Au("year",Tu.year,Bx),Nc("seconds",function(e){return new Date(1970,0,1,0,0,e)},function(e){return Pu(e).getSeconds()},null,0,59),Nc("minutes",function(e){return new Date(1970,0,1,0,e)},function(e){return Pu(e).getMinutes()},null,0,59),Nc("hours",function(e){return new Date(1970,0,1,e)},function(e){return Pu(e).getHours()},null,0,23),Nc("weekdays",function(e){return new Date(1970,0,4+e)},function(e){return Pu(e).getDay()},[1],0,6),Nc("dates",function(e){return new Date(1970,0,e)},function(e){return Pu(e).getDate()},[1],1,31),Nc("months",function(e){return new Date(1970,e%12,1)},function(e){return Pu(e).getMonth()},[1],0,11)],Atn=[Au("second",Tu.utcSecond,Wx),Au("minute",Tu.utcMinute,Wx),Au("hour",Tu.utcHour,Wx),Au("day",Tu.utcDay,Wx,[1,7]),Au("month",Tu.utcMonth,Wx,[1,3,6]),Au("year",Tu.utcYear,Wx),Nc("seconds",function(e){return new Date(Date.UTC(1970,0,1,0,0,e))},function(e){return Pu(e).getUTCSeconds()},null,0,59),Nc("minutes",function(e){return new Date(Date.UTC(1970,0,1,0,e))},function(e){return Pu(e).getUTCMinutes()},null,0,59),Nc("hours",function(e){return new Date(Date.UTC(1970,0,1,e))},function(e){return Pu(e).getUTCHours()},null,0,23),Nc("weekdays",function(e){return new Date(Date.UTC(1970,0,4+e))},function(e){return Pu(e).getUTCDay()},[1],0,6),Nc("dates",function(e){return new Date(Date.UTC(1970,0,e))},function(e){return Pu(e).getUTCDate()},[1],1,31),Nc("months",function(e){return new Date(Date.UTC(1970,e%12,1))},function(e){return Pu(e).getUTCMonth()},[1],0,11)],Rk=[[31536e6,5],[7776e6,4],[2592e6,4],[12096e5,3],[6048e5,3],[1728e5,3],[864e5,3],[432e5,2],[216e5,2],[108e5,2],[36e5,2],[18e5,1],[9e5,1],[3e5,1],[6e4,1],[3e4,0],[15e3,0],[5e3,0],[1e3,0]];function Rtn(e,t,n,r){var i=Rk[0],o,s,a;for(o=1,s=Rk.length;o<s;++o)if(i=Rk[o],t>i[0]){if(a=t/i[0],a>r)return e[Rk[o-1][1]];if(a>=n)return e[i[1]]}return e[Rk[s-1][1]]}function kqe(e){var t={},n,r;for(n=0,r=e.length;n<r;++n)t[e[n].type]=e[n];return t.find=function(i,o,s){return Rtn(e,i,o,s)},t}ace.exports=kqe(Ptn);ace.exports.utc=kqe(Atn);var Dtn=ace.exports,Mtn=rn,Vwe=Dtn,$qe=1e-15;function vK(e){if(!e)throw Error("Missing binning options.");var t=e.maxbins||15,n=e.base||10,r=Math.log(n),i=e.div||[5,2],o=e.min,s=e.max,a=s-o,l,c,u,f,d,h,p;if(e.step)l=e.step;else if(e.steps)l=e.steps[Math.min(e.steps.length-1,Ntn(e.steps,a/t,0,e.steps.length))];else{for(c=Math.ceil(Math.log(t)/r),u=e.minstep||0,l=Math.max(u,Math.pow(n,Math.round(Math.log(a)/r)-c));Math.ceil(a/l)>t;)l*=n;for(h=0;h<i.length;++h)d=l/i[h],d>=u&&a/d<=t&&(l=d)}return d=Math.log(l),f=d>=0?0:~~(-d/r)+1,p=Math.pow(n,-f-1),o=Math.min(o,Math.floor(o/l+p)*l),s=Math.ceil(s/l)*l,{start:o,stop:s,step:l,unit:{precision:f},value:Tqe,index:Pqe}}function Ntn(e,t,n,r){for(;n<r;){var i=n+r>>>1;Mtn.cmp(e[i],t)<0?n=i+1:r=i}return n}function Tqe(e){return this.step*Math.floor(e/this.step+$qe)}function Pqe(e){return Math.floor((e-this.start)/this.step+$qe)}function Itn(e){return this.unit.date(Tqe.call(this,e))}function Ltn(e){return Pqe.call(this,this.unit.unit(e))}vK.date=function(e){if(!e)throw Error("Missing date binning options.");var t=e.utc?Vwe.utc:Vwe,n=e.min,r=e.max,i=e.maxbins||20,o=e.minbins||4,s=+r-+n,a=e.unit?t[e.unit]:t.find(s,o,i),l=vK({min:a.min!=null?a.min:a.unit(n),max:a.max!=null?a.max:a.unit(r),maxbins:i,minstep:a.minstep,steps:a.step});return l.unit=a,l.index=Ltn,e.raw||(l.value=Itn),l};var jtn=vK;const Ftn=wf(jtn);var bo=rn,cF="__types__",ztn={boolean:bo.boolean,integer:bo.number,number:bo.number,date:bo.date,string:function(e){return e==null||e===""?null:e+""}},Aqe={boolean:function(e){return e==="true"||e==="false"||bo.isBoolean(e)},integer:function(e){return Aqe.number(e)&&(e=+e)===~~e},number:function(e){return!isNaN(+e)&&!bo.isDate(e)},date:function(e){return!isNaN(Date.parse(e))}};function Qtn(e,t){if(!t)return e&&e[cF]||null;e[cF]=t}function Rqe(e){return bo.keys(e)}function Dqe(e){return"["+e+"]"}function ix(e,t){e=bo.array(e),t=bo.$(t);var n,r,i;if(e[cF]&&(n=t(e[cF]),bo.isString(n)))return n;for(r=0,i=e.length;!bo.isValid(n)&&r<i;++r)n=t?t(e[r]):e[r];return bo.isDate(n)?"date":bo.isNumber(n)?"number":bo.isBoolean(n)?"boolean":bo.isString(n)?"string":null}function Btn(e,t){if(e.length){var n=t?bo.identity:(t=Rqe(e[0]),Dqe);return t.reduce(function(r,i){return r[i]=ix(e,n(i)),r},{})}}function Mqe(e,t){e=bo.array(e),t=bo.$(t);var n,r,i,o=["boolean","integer","number","date"];for(n=0;n<e.length;++n){for(i=t?t(e[n]):e[n],r=0;r<o.length;++r)bo.isValid(i)&&!Aqe[o[r]](i)&&(o.splice(r,1),r-=1);if(o.length===0)return"string"}return o[0]}function Wtn(e,t){var n=t?bo.identity:(t=Rqe(e[0]),Dqe);return t.reduce(function(r,i){return r[i]=Mqe(e,n(i)),r},{})}ix.annotation=Qtn;ix.all=Btn;ix.infer=Mqe;ix.inferAll=Wtn;ix.parsers=ztn;var Nqe=ix,Iqe={exports:{}},Lqe={exports:{}};(function(e){var t=rn,n=e.exports;n.repeat=function(r,i){var o=Array(i),s;for(s=0;s<i;++s)o[s]=r;return o},n.zeros=function(r){return n.repeat(0,r)},n.range=function(r,i,o){if(arguments.length<3&&(o=1,arguments.length<2&&(i=r,r=0)),(i-r)/o==1/0)throw new Error("Infinite range");var s=[],a=-1,l;if(o<0)for(;(l=r+o*++a)>i;)s.push(l);else for(;(l=r+o*++a)<i;)s.push(l);return s},n.random={},n.random.uniform=function(r,i){i===void 0&&(i=r===void 0?1:r,r=0);var o=i-r,s=function(){return r+o*Math.random()};return s.samples=function(a){return n.zeros(a).map(s)},s.pdf=function(a){return a>=r&&a<=i?1/o:0},s.cdf=function(a){return a<r?0:a>i?1:(a-r)/o},s.icdf=function(a){return a>=0&&a<=1?r+a*o:NaN},s},n.random.integer=function(r,i){i===void 0&&(i=r,r=0);var o=i-r,s=function(){return r+Math.floor(o*Math.random())};return s.samples=function(a){return n.zeros(a).map(s)},s.pdf=function(a){return a===Math.floor(a)&&a>=r&&a<i?1/o:0},s.cdf=function(a){var l=Math.floor(a);return l<r?0:l>=i?1:(l-r+1)/o},s.icdf=function(a){return a>=0&&a<=1?r-1+Math.floor(a*o):NaN},s},n.random.normal=function(r,i){r=r||0,i=i||1;var o,s=function(){var a=0,l=0,c,u;if(o!==void 0)return a=o,o=void 0,a;do a=Math.random()*2-1,l=Math.random()*2-1,c=a*a+l*l;while(c===0||c>1);return u=Math.sqrt(-2*Math.log(c)/c),o=r+l*u*i,r+a*u*i};return s.samples=function(a){return n.zeros(a).map(s)},s.pdf=function(a){var l=Math.exp(Math.pow(a-r,2)/(-2*Math.pow(i,2)));return 1/(i*Math.sqrt(2*Math.PI))*l},s.cdf=function(a){var l,c=(a-r)/i,u=Math.abs(c);if(u>37)l=0;else{var f,d=Math.exp(-u*u/2);u<7.07106781186547?(f=.0352624965998911*u+.700383064443688,f=f*u+6.37396220353165,f=f*u+33.912866078383,f=f*u+112.079291497871,f=f*u+221.213596169931,f=f*u+220.206867912376,l=d*f,f=.0883883476483184*u+1.75566716318264,f=f*u+16.064177579207,f=f*u+86.7807322029461,f=f*u+296.564248779674,f=f*u+637.333633378831,f=f*u+793.826512519948,f=f*u+440.413735824752,l=l/f):(f=u+.65,f=u+4/f,f=u+3/f,f=u+2/f,f=u+1/f,l=d/f/2.506628274631)}return c>0?1-l:l},s.icdf=function(a){if(a<=0||a>=1)return NaN;var l=2*a-1,c=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),u=2/(Math.PI*c)+Math.log(1-Math.pow(l,2))/2,f=Math.log(1-l*l)/c,d=(l>0?1:-1)*Math.sqrt(Math.sqrt(u*u-f)-u);return r+i*Math.SQRT2*d},s},n.random.bootstrap=function(r,i){var o=r.filter(t.isValid),s=o.length,a=i?n.random.normal(0,i):null,l=function(){return o[~~(Math.random()*s)]+(a?a():0)};return l.samples=function(c){return n.zeros(c).map(l)},l}})(Lqe);var qtn=Lqe.exports;(function(e){var t=rn,n=Nqe,r=qtn,i=e.exports;i.unique=function(l,c,u){c=t.$(c),u=u||[];var f={},d,h,p;for(h=0,p=l.length;h<p;++h)d=c?c(l[h]):l[h],!(d in f)&&(f[d]=1,u.push(d));return u},i.count=function(l){return l&&l.length||0},i.count.valid=function(l,c){c=t.$(c);var u,f,d,h=0;for(f=0,d=l.length;f<d;++f)u=c?c(l[f]):l[f],t.isValid(u)&&(h+=1);return h},i.count.missing=function(l,c){c=t.$(c);var u,f,d,h=0;for(f=0,d=l.length;f<d;++f)u=c?c(l[f]):l[f],u==null&&(h+=1);return h},i.count.distinct=function(l,c){c=t.$(c);var u={},f,d,h,p=0;for(d=0,h=l.length;d<h;++d)f=c?c(l[d]):l[d],!(f in u)&&(u[f]=1,p+=1);return p},i.count.map=function(l,c){c=t.$(c);var u={},f,d,h;for(d=0,h=l.length;d<h;++d)f=c?c(l[d]):l[d],u[f]=f in u?u[f]+1:1;return u},i.median=function(l,c){return c&&(l=l.map(t.$(c))),l=l.filter(t.isValid).sort(t.cmp),i.quantile(l,.5)},i.quartile=function(l,c){c&&(l=l.map(t.$(c))),l=l.filter(t.isValid).sort(t.cmp);var u=i.quantile;return[u(l,.25),u(l,.5),u(l,.75)]},i.quantile=function(l,c,u){u===void 0&&(u=c,c=t.identity),c=t.$(c);var f=(l.length-1)*u+1,d=Math.floor(f),h=+c(l[d-1]),p=f-d;return p?h+p*(c(l[d])-h):h},i.sum=function(l,c){c=t.$(c);for(var u=0,f=0,d=l.length,h;f<d;++f)h=c?c(l[f]):l[f],t.isValid(h)&&(u+=h);return u},i.mean=function(l,c){c=t.$(c);var u=0,f,d,h,p,g;for(d=0,p=0,h=l.length;d<h;++d)g=c?c(l[d]):l[d],t.isValid(g)&&(f=g-u,u=u+f/++p);return u},i.mean.geometric=function(l,c){c=t.$(c);var u=1,f,d,h,p;for(p=0,f=0,d=l.length;p<d;++p)if(h=c?c(l[p]):l[p],t.isValid(h)){if(h<=0)throw Error("Geometric mean only defined for positive values.");u*=h,++f}return u=f>0?Math.pow(u,1/f):0,u},i.mean.harmonic=function(l,c){c=t.$(c);var u=0,f,d,h,p;for(p=0,f=0,d=l.length;p<d;++p)h=c?c(l[p]):l[p],t.isValid(h)&&(u+=1/h,++f);return f/u},i.variance=function(l,c){if(c=t.$(c),!t.isArray(l)||l.length<2)return 0;var u=0,f=0,d,h,p,g;for(h=0,p=0;h<l.length;++h)g=c?c(l[h]):l[h],t.isValid(g)&&(d=g-u,u=u+d/++p,f=f+d*(g-u));return f=f/(p-1),f},i.stdev=function(l,c){return Math.sqrt(i.variance(l,c))},i.modeskew=function(l,c){var u=i.mean(l,c),f=i.median(l,c),d=i.stdev(l,c);return d===0?0:(u-f)/d},i.min=function(l,c){return i.extent(l,c)[0]},i.max=function(l,c){return i.extent(l,c)[1]},i.extent=function(l,c){c=t.$(c);var u,f,d,h,p=l.length;for(h=0;h<p;++h)if(d=c?c(l[h]):l[h],t.isValid(d)){u=f=d;break}for(;h<p;++h)d=c?c(l[h]):l[h],t.isValid(d)&&(d<u&&(u=d),d>f&&(f=d));return[u,f]},i.extent.index=function(l,c){c=t.$(c);var u=-1,f=-1,d,h,p,g,v=l.length;for(g=0;g<v;++g)if(p=c?c(l[g]):l[g],t.isValid(p)){d=h=p,u=f=g;break}for(;g<v;++g)p=c?c(l[g]):l[g],t.isValid(p)&&(p<d&&(d=p,u=g),p>h&&(h=p,f=g));return[u,f]},i.dot=function(l,c,u){var f=0,d,h;if(u)for(c=t.$(c),u=t.$(u),d=0;d<l.length;++d)h=c(l[d])*u(l[d]),h===h&&(f+=h);else{if(l.length!==c.length)throw Error("Array lengths must match.");for(d=0;d<l.length;++d)h=l[d]*c[d],h===h&&(f+=h)}return f},i.dist=function(l,c,u,f){var d=t.isFunction(u)||t.isString(u),h=l,p=d?l:c,g=d?f:u,v=g===2||g==null,y=l.length,O=0,m,w;for(d&&(c=t.$(c),u=t.$(u)),w=0;w<y;++w)m=d?c(h[w])-u(p[w]):h[w]-p[w],O+=v?m*m:Math.pow(Math.abs(m),g);return v?Math.sqrt(O):Math.pow(O,1/g)},i.cohensd=function(l,c,u){var f=u?l.map(t.$(c)):l,d=u?l.map(t.$(u)):c,h=i.mean(f),p=i.mean(d),g=i.count.valid(f),v=i.count.valid(d);if(g+v-2<=0)return 0;var y=i.variance(f),O=i.variance(d),m=Math.sqrt(((g-1)*y+(v-1)*O)/(g+v-2));return m===0?0:(h-p)/m},i.covariance=function(l,c,u){var f=u?l.map(t.$(c)):l,d=u?l.map(t.$(u)):c,h=f.length,p=i.mean(f),g=i.mean(d),v=0,y=0,O,m,w,S,E;if(h!==d.length)throw Error("Input lengths must match.");for(O=0;O<h;++O)if(m=f[O],S=t.isValid(m),w=d[O],E=t.isValid(w),S&&E)v+=(m-p)*(w-g),++y;else if(S||E)throw Error("Valid values must align.");return v/(y-1)},i.rank=function(l,c){c=t.$(c)||t.identity;var u=l.map(function(O,m){return{idx:m,val:c(O)}}).sort(t.comparator("val")),f=l.length,d=Array(f),h=-1,p={},g,v,y;for(g=0;g<f;++g){if(v=u[g].val,h<0&&p===v)h=g-1;else if(h>-1&&p!==v){for(y=1+(g-1+h)/2;h<g;++h)d[u[h].idx]=y;h=-1}d[u[g].idx]=g+1,p=v}if(h>-1)for(y=1+(f-1+h)/2;h<f;++h)d[u[h].idx]=y;return d},i.cor=function(l,c,u){var f=u;u=f?l.map(t.$(u)):c,c=f?l.map(t.$(c)):l;var d=i.dot(c,u),h=i.mean(c),p=i.mean(u),g=i.stdev(c),v=i.stdev(u),y=l.length;return(d-y*h*p)/((y-1)*g*v)},i.cor.rank=function(l,c,u){var f=u?i.rank(l,c):i.rank(l),d=u?i.rank(l,u):i.rank(c),h=l.length,p,g,v;for(p=0,g=0;p<h;++p)v=f[p]-d[p],g+=v*v;return 1-6*g/(h*(h*h-1))},i.cor.dist=function(l,c,u){var f=u?l.map(t.$(c)):l,d=u?l.map(t.$(u)):c,h=i.dist.mat(f),p=i.dist.mat(d),g=h.length,v,y,O,m;for(v=0,y=0,O=0,m=0;v<g;++v)y+=h[v]*h[v],O+=p[v]*p[v],m+=h[v]*p[v];return Math.sqrt(m/Math.sqrt(y*O))},i.linearRegression=function(l,c,u){var f=u?l.map(t.$(c)):l,d=u?l.map(t.$(u)):c,h=f.length,p=i.covariance(f,d),g=i.stdev(f),v=i.stdev(d),y=p/(g*g),O=i.mean(d)-y*i.mean(f),m={slope:y,intercept:O,R:p/(g*v),rss:0},w,S;for(S=0;S<h;++S)t.isValid(f[S])&&t.isValid(d[S])&&(w=y*f[S]+O-d[S],m.rss+=w*w);return m},i.bootstrap={},i.bootstrap.ci=function(l,c,u,f,d){var h,p,g,v,y,O,m;for(t.isFunction(c)||t.isString(c)?(h=l.map(t.$(c)),p=u,g=f,v=d):(h=l,p=c,g=u,v=f),p=p?+p:1e3,g=g||.05,y=r.random.bootstrap(h,v),m=0,O=Array(p);m<p;++m)O[m]=i.mean(y.samples(h.length));return O.sort(t.numcmp),[i.quantile(O,g/2),i.quantile(O,1-g/2)]},i.z={},i.z.ci=function(l,c,u){var f=l,d=c;(t.isFunction(c)||t.isString(c))&&(f=l.map(t.$(c)),d=u),d=d||.05;var h=d===.05?1.96:r.random.normal(0,1).icdf(1-d/2),p=i.mean(f),g=i.stdev(f)/Math.sqrt(i.count.valid(f));return[p-h*g,p+h*g]},i.z.test=function(l,c,u,f){return t.isFunction(u)||t.isString(u)?(f&&f.paired?s:a)(f,l,c,u):t.isArray(c)?(u&&u.paired?s:a)(u,l,c):t.isFunction(c)||t.isString(c)?o(u,l,c):o(c,l)};function o(l,c,u){var f=l&&l.nullh||0,d=r.random.normal(0,1),h=i.mean(c,u),p=i.stdev(c,u)/Math.sqrt(i.count.valid(c,u));if(p===0)return h-f===0?1:0;var g=(h-f)/p;return 2*d.cdf(-Math.abs(g))}function s(l,c,u,f){var d=f?c.map(t.$(u)):c,h=f?c.map(t.$(f)):u,p=i.count(d),g=i.count(h),v=Array(),y;if(p!==g)throw Error("Array lengths must match.");for(y=0;y<p;++y)t.isValid(d[y])&&t.isValid(h[y])&&v.push(d[y]-h[y]);return i.z.test(v,l&&l.nullh||0)}function a(l,c,u,f){var d=f?c.map(t.$(u)):c,h=f?c.map(t.$(f)):u,p=i.count.valid(d),g=i.count.valid(h),v=r.random.normal(0,1),y=i.mean(d)-i.mean(h)-(l&&l.nullh||0),O=Math.sqrt(i.variance(d)/p+i.variance(h)/g);if(O===0)return y===0?1:0;var m=y/O;return 2*v.cdf(-Math.abs(m))}i.dist.mat=function(l){var c=l.length,u=c*c,f=Array(u),d=r.zeros(c),h=0,p,g,v;for(g=0;g<c;++g)for(f[g*c+g]=0,v=g+1;v<c;++v)f[g*c+v]=p=Math.abs(l[g]-l[v]),f[v*c+g]=p,d[g]+=p,d[v]+=p;for(g=0;g<c;++g)h+=d[g],d[g]/=c;for(h/=u,g=0;g<c;++g)for(v=g;v<c;++v)f[g*c+v]+=h-d[g]-d[v],f[v*c+g]=f[g*c+v];return f},i.entropy=function(l,c){c=t.$(c);var u,f,d=0,h=0,p=l.length;for(u=0;u<p;++u)d+=c?c(l[u]):l[u];if(d===0)return 0;for(u=0;u<p;++u)f=(c?c(l[u]):l[u])/d,f&&(h+=f*Math.log(f));return-h/Math.LN2},i.mutual=function(l,c,u,f){var d=f?l.map(t.$(c)):l,h=f?l.map(t.$(u)):c,p=f?l.map(t.$(f)):u,g={},v={},y=p.length,O=0,m=0,w=0,S,E,C;for(C=0;C<y;++C)g[d[C]]=0,v[h[C]]=0;for(C=0;C<y;++C)g[d[C]]+=p[C],v[h[C]]+=p[C],O+=p[C];for(E=1/(O*Math.LN2),C=0;C<y;++C)p[C]!==0&&(S=O*p[C]/(g[d[C]]*v[h[C]]),m+=p[C]*E*Math.log(S),w+=p[C]*E*Math.log(p[C]/O));return[m,1+m/w]},i.mutual.info=function(l,c,u,f){return i.mutual(l,c,u,f)[0]},i.mutual.dist=function(l,c,u,f){return i.mutual(l,c,u,f)[1]},i.profile=function(l,c){var u=0,f=0,d=0,h=0,p=null,g=null,v=0,y=[],O={},m,w,S,E,C;for(S=0;S<l.length;++S)E=c?c(l[S]):l[S],O[E]=E in O?O[E]+1:(h+=1,1),E==null?++d:t.isValid(E)&&(C=typeof E=="string"?E.length:E,(p===null||C<p)&&(p=C),(g===null||C>g)&&(g=C),m=C-u,u=u+m/++f,v=v+m*(C-u),y.push(C));return v=v/(f-1),w=Math.sqrt(v),y.sort(t.cmp),{type:n(l,c),unique:O,count:l.length,valid:f,missing:d,distinct:h,min:p,max:g,mean:u,stdev:w,median:E=i.quantile(y,.5),q1:i.quantile(y,.25),q3:i.quantile(y,.75),modeskew:w===0?0:(u-E)/w}},i.summary=function(l,c){c=c||t.keys(l[0]);var u=c.map(function(f){var d=i.profile(l,t.$(f));return d.field=f,d});return u.__summary__=!0,u}})(Iqe);var Vtn=Iqe.exports;const Utn=Ftn;function Htn(e,t={},n={fields:[]}){t=rn.extend({},hD,t);let r=Vtn.summary(e),i=Nqe.inferAll(e),o=n.fields.reduce((l,c)=>(l[c.name]=c,l),{}),s=r.map(function(l,c){const u=l.field,f=i[u]==="date"?so.DATETIME:i[u];let d=l.distinct,h;if(f===so.NUMBER)h=Oi;else if(f===so.INTEGER)d<t.numberNominalLimit&&d/l.count<t.numberNominalProportion?h=nf:h=Oi;else if(f===so.DATETIME){h=Ms,l.min=new Date(e[0][u]),l.max=new Date(e[0][u]);for(const v of e){const y=new Date(v[u]).getTime();y<l.min.getTime()&&(l.min=new Date(y)),y>l.max.getTime()&&(l.max=new Date(y))}}else h=nf;h===nf&&d/l.count>t.minPercentUniqueForKey&&l.count>t.minCardinalityForKey&&(h=Pd.KEY);let p={name:u,originalIndex:c,vlType:h,type:f,stats:l,timeStats:{},binStats:{}};const g=o[p.name];return p=rn.extend(p,g),p});for(let l of s)if(l.vlType===Oi)for(let c of t.enum.binProps.maxbins)l.binStats[c]=jqe(c,l.stats);else if(l.vlType===Ms)for(let c of t.enum.timeUnit)c!==void 0&&(l.timeStats[c]=Fqe(c,l.stats));const a=Object.assign({},n,{fields:s});return new Xtn(a)}const WN={nominal:0,key:1,ordinal:2,temporal:3,quantitative:4};let Xtn=class{constructor(t){this._tableSchema=t,t.fields.sort(function(n,r){return WN[n.vlType]<WN[r.vlType]?-1:WN[n.vlType]>WN[r.vlType]?1:n.name.localeCompare(r.name)}),t.fields.forEach((n,r)=>n.index=r),this._fieldSchemaIndex=t.fields.reduce((n,r)=>(n[r.name]=r,n),{})}fieldNames(){return this._tableSchema.fields.map(t=>t.name)}get fieldSchemas(){return this._tableSchema.fields}fieldSchema(t){return this._fieldSchemaIndex[t]}tableSchema(){const t=rn.duplicate(this._tableSchema);return t.fields.sort((n,r)=>n.originalIndex-r.originalIndex),t}primitiveType(t){return this._fieldSchemaIndex[t]?this._fieldSchemaIndex[t].type:null}vlType(t){return this._fieldSchemaIndex[t]?this._fieldSchemaIndex[t].vlType:null}cardinality(t,n=!0,r=!1){const i=this._fieldSchemaIndex[t.field];if(t.aggregate||Eo(t)&&t.autoCount)return 1;if(t.bin){let o;typeof t.bin=="boolean"?o={maxbins:mK(t.channel)}:t.bin==="?"?o={enum:[!0,!1]}:o=t.bin;const s=o.maxbins;return i.binStats[s]||(i.binStats[s]=jqe(s,i.stats)),i.binStats[s].distinct}else if(t.timeUnit){if(n)switch(t.timeUnit){case mo.SECONDS:return 60;case mo.MINUTES:return 60;case mo.HOURS:return 24;case mo.DAY:return 7;case mo.DATE:return 31;case mo.MONTH:return 12;case mo.QUARTER:return 4;case mo.MILLISECONDS:return 1e3}let o=t.timeUnit,s=i.timeStats;return(!s||!s[o])&&(s=Object.assign({},s,{[o]:Fqe(t.timeUnit,i.stats)})),r?s[o].distinct-Uwe(s[o].unique,["Invalid Date",null]):s[o].distinct}else return i?r?i.stats.distinct-Uwe(i.stats.unique,[NaN,null]):i.stats.distinct:null}timeUnitHasVariation(t){if(!t.timeUnit)return;if(t.timeUnit===mo.DAY){const r=rn.extend({},t,{timeUnit:mo.DATE});if(this.cardinality(r,!1,!0)<=1)return!1}let n=t.timeUnit;for(let r of VWe)if(HWe(n,r)){const i=rn.extend({},t,{timeUnit:r});if(this.cardinality(i,!1,!0)<=1)return!1}return!0}domain(t){const n=this._fieldSchemaIndex[t.field];let r=rn.keys(n.stats.unique);return n.vlType===Oi?[+n.stats.min,+n.stats.max]:n.type===so.DATETIME?[n.stats.min,n.stats.max]:n.type===so.INTEGER||n.type===so.NUMBER?(r=r.map(i=>+i),r.sort(rn.cmp)):n.vlType===Td&&n.ordinalDomain?n.ordinalDomain:r.map(i=>i==="null"?null:i).sort(rn.cmp)}stats(t){const n=this._fieldSchemaIndex[t.field];return n?n.stats:null}};function jqe(e,t){const n=Utn({min:t.min,max:t.max,maxbins:e}),r=rn.extend({},t);return r.unique=Ztn(n,t.unique),r.distinct=(n.stop-n.start)/n.step,r.min=n.start,r.max=n.stop,r}function Fqe(e,t){const n=rn.extend({},t);let r={};return rn.keys(t.unique).forEach(function(i){let o=i==="null"?null:new Date(i),s;o===null?s=null:isNaN(o.getTime())?s="Invalid Date":s=(e===mo.DAY?o.getDay():hen(e,o)).toString(),r[s]=(r[s]||0)+t.unique[i]}),n.unique=r,n.distinct=rn.keys(r).length,n}function Ztn(e,t){const n={};for(let r in t){let i;r===null?i=null:isNaN(Number(r))?i=NaN:i=e.value(Number(r)),n[i]=(n[i]||0)+t[r]}return n}function Uwe(e,t){return t.reduce(function(n,r){return e[r]?n+1:n},0)}var so;(function(e){e[e.STRING="string"]="STRING",e[e.NUMBER="number"]="NUMBER",e[e.INTEGER="integer"]="INTEGER",e[e.BOOLEAN="boolean"]="BOOLEAN",e[e.DATETIME="datetime"]="DATETIME"})(so||(so={}));class zqe{constructor(t){this.constraint=t}name(){return this.constraint.name}description(){return this.constraint.description}properties(){return this.constraint.properties}strict(){return this.constraint.strict}}class Qqe extends zqe{constructor(t){super(t)}hasAllRequiredPropertiesSpecific(t){return mh(this.constraint.properties,n=>{if(Qh(n)){let r=n.parent,i=n.child;return t[r]?!It(t[r][i]):!0}return t[n]?!It(t[n]):!0})}satisfy(t,n,r,i){return!this.constraint.allowWildcardForProperties&&!this.hasAllRequiredPropertiesSpecific(t)?!0:this.constraint.satisfy(t,n,r,i)}}const Bqe=[{name:"aggregateOpSupportedByType",description:"Aggregate function should be supported by data type.",properties:[ge.TYPE,ge.AGGREGATE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>e.aggregate?!zwe(e.type):!0},{name:"asteriskFieldWithCountOnly",description:'Field="*" should be disallowed except aggregate="count"',properties:[ge.FIELD,ge.AGGREGATE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>e.field==="*"==(e.aggregate==="count")},{name:"minCardinalityForBin",description:"binned quantitative field should not have too low cardinality",properties:[ge.BIN,ge.FIELD,ge.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>{if(e.bin&&e.type===Oi){let i={channel:e.channel,field:e.field,type:e.type};return t.cardinality(i)>=r.minCardinalityForBin}return!0}},{name:"binAppliedForQuantitative",description:"bin should be applied to quantitative field only.",properties:[ge.TYPE,ge.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>e.bin?e.type===Oi:!0},{name:"channelFieldCompatible",description:"encoding channel's range type be compatible with channel type.",properties:[ge.CHANNEL,ge.TYPE,ge.BIN,ge.TIMEUNIT],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>{const i=Object.assign({field:"f"},sce(e,{schema:t,props:["bin","timeUnit","type"]})),{compatible:o}=Den(i,e.channel);return o?!0:!!((e.channel==="row"||e.channel==="column")&&(oen(i.timeUnit)||sen(i.timeUnit)))}},{name:"hasFn",description:"A field with as hasFn flag should have one of aggregate, timeUnit, or bin.",properties:[ge.AGGREGATE,ge.BIN,ge.TIMEUNIT],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,r)=>e.hasFn?!!e.aggregate||!!e.bin||!!e.timeUnit:!0},{name:"omitScaleZeroWithBinnedField",description:"Do not use scale zero with binned field",properties:[ge.SCALE,vg("scale","zero"),ge.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>!(e.bin&&e.scale&&e.scale.zero===!0)},{name:"onlyOneTypeOfFunction",description:"Only of of aggregate, autoCount, timeUnit, or bin should be applied at the same time.",properties:[ge.AGGREGATE,ge.AUTOCOUNT,ge.TIMEUNIT,ge.BIN],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,r)=>on(e)?(!It(e.aggregate)&&e.aggregate?1:0)+(!It(e.bin)&&e.bin?1:0)+(!It(e.timeUnit)&&e.timeUnit?1:0)<=1:!0},{name:"timeUnitAppliedForTemporal",description:"Time unit should be applied to temporal field only.",properties:[ge.TYPE,ge.TIMEUNIT],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>!(e.timeUnit&&e.type!==Ms)},{name:"timeUnitShouldHaveVariation",description:"A particular time unit should be applied only if they produce unique values.",properties:[ge.TIMEUNIT,ge.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,r)=>e.timeUnit&&e.type===Ms?!n.has("timeUnit")&&!r.constraintManuallySpecifiedValue?!0:t.timeUnitHasVariation(e):!0},{name:"scalePropertiesSupportedByScaleType",description:"Scale properties must be supported by correct scale type",properties:[].concat(rF,[ge.SCALE,ge.TYPE]),allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,r)=>{if(e.scale){const i=e.scale,o=uO(e);if(o==null)return!0;for(let s in i){if(s==="type"||s==="name"||s==="enum")continue;const a=s;if(o==="point"){if(!IV("point",a)&&!IV("band",a))return!1}else if(!IV(o,a))return!1}}return!0}},{name:"scalePropertiesSupportedByChannel",description:"Not all scale properties are supported by all encoding channels",properties:[].concat(rF,[ge.SCALE,ge.CHANNEL]),allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n,r)=>{if(e){let i=e.channel,o=e.scale;if(i&&!It(i)&&o){if(i==="row"||i==="column")return!1;for(let s in o){if(!o.hasOwnProperty(s)||s==="type"||s==="name"||s==="enum")continue;if(!(QJt(i,s)===void 0))return!1}}}return!0}},{name:"typeMatchesPrimitiveType",description:"Data type should be supported by field's primitive type.",properties:[ge.FIELD,ge.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>{if(e.field==="*")return!0;const i=t.primitiveType(e.field),o=e.type;if(!n.has("field")&&!n.has("type")&&!r.constraintManuallySpecifiedValue)return!0;switch(i){case so.BOOLEAN:case so.STRING:return o!==Oi&&o!==Ms;case so.NUMBER:case so.INTEGER:return o!==Ms;case so.DATETIME:return o===Ms;case null:return!1}throw new Error("Not implemented")}},{name:"typeMatchesSchemaType",description:"Enumerated data type of a field should match the field's type in the schema.",properties:[ge.FIELD,ge.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,r)=>!n.has("field")&&!n.has("type")&&!r.constraintManuallySpecifiedValue?!0:e.field==="*"?e.type===Oi:t.vlType(e.field)===e.type},{name:"maxCardinalityForCategoricalColor",description:"Categorical channel should not have too high cardinality",properties:[ge.CHANNEL,ge.FIELD],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,r)=>e.channel===zh&&(e.type===nf||e.type===Pd.KEY)?t.cardinality(e)<=r.maxCardinalityForCategoricalColor:!0},{name:"maxCardinalityForFacet",description:"Row/column channel should not have too high cardinality",properties:[ge.CHANNEL,ge.FIELD,ge.BIN,ge.TIMEUNIT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,r)=>e.channel===yf||e.channel===iu?t.cardinality(e)<=r.maxCardinalityForFacet:!0},{name:"maxCardinalityForShape",description:"Shape channel should not have too high cardinality",properties:[ge.CHANNEL,ge.FIELD,ge.BIN,ge.TIMEUNIT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n,r)=>e.channel===dD?t.cardinality(e)<=r.maxCardinalityForShape:!0},{name:"dataTypeAndFunctionMatchScaleType",description:"Scale type must match data type",properties:[ge.TYPE,ge.SCALE,vg("scale","type"),ge.TIMEUNIT,ge.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>{if(e.scale){const i=e.type,o=uO(e);if(zwe(i))return o===void 0||cO(o);if(i===Ms)return e.timeUnit?Mc([Yr.TIME,Yr.UTC,void 0],o)||cO(o):Mc([Yr.TIME,Yr.UTC,void 0],o);if(i===Oi)return e.bin?Mc([Yr.LINEAR,void 0],o):Mc([Yr.LOG,Yr.POW,Yr.SQRT,Yr.QUANTILE,Yr.QUANTIZE,Yr.LINEAR,void 0],o)}return!0}},{name:"stackIsOnlyUsedWithXY",description:"stack should only be allowed for x and y channels",properties:[ge.STACK,ge.CHANNEL],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>e.stack?e.channel===Zr||e.channel===Xr:!0}].map(e=>new Qqe(e));Bqe.reduce((e,t)=>(e[t.name()]=t,e),{});const Ytn=Bqe.reduce((e,t)=>{for(const n of t.properties())e.set(n,e.get(n)||[]),e.get(n).push(t);return e},new xl),Wqe=[{name:"doesNotSupportConstantValue",description:"row, column, x, y, order, and detail should not work with constant values.",properties:[ge.TYPE,ge.AGGREGATE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n,r)=>!Mc(["row","column","x","y","detail","order"],e.channel)}].map(e=>new Qqe(e));Wqe.reduce((e,t)=>(e[t.name()]=t,e),{});const Gtn=Wqe.reduce((e,t)=>{for(const n of t.properties())e.set(n,e.get(n)||[]),e.get(n).push(t);return e},new xl);function Ktn(e,t,n,r,i,o){const s=Ytn.get(e)||[],a=r.getEncodingQueryByIndex(n);for(const c of s)if((c.strict()||o[c.name()])&&!c.satisfy(a,i,r.wildcardIndex.encodings[n],o)){let f="(enc) "+c.name();return o.verbose&&console.log(f+" failed with "+r.toShorthand()+" for "+t.name),f}const l=Gtn.get(e)||[];for(const c of l)if((c.strict()||o[c.name()])&&Eu(a)&&!c.satisfy(a,i,r.wildcardIndex.encodings[n],o)){let f="(enc) "+c.name();return o.verbose&&console.log(f+" failed with "+r.toShorthand()+" for "+t.name),f}return null}const Jtn=CWe.reduce((e,t)=>(e[t]=!0,e),{});class enn extends zqe{constructor(t){super(t)}hasAllRequiredPropertiesSpecific(t){return mh(this.constraint.properties,n=>{if(n===ge.MARK)return!It(t.getMark());if(Qh(n)){let r=n.parent,i=n.child;return mh(t.getEncodings(),o=>o[r]?!It(o[r][i]):!0)}if(!WWe(n))throw new Error("UNIMPLEMENTED");return mh(t.getEncodings(),r=>r[n]?!It(r[n]):!0)})}satisfy(t,n,r){return!this.constraint.allowWildcardForProperties&&!this.hasAllRequiredPropertiesSpecific(t)?!0:this.constraint.satisfy(t,n,r)}}const qqe=[{name:"noRepeatedChannel",description:"Each encoding channel should only be used once.",properties:[ge.CHANNEL],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n)=>{let r={};return mh(e.getEncodings(),i=>It(i.channel)?!0:r[i.channel]?!1:(r[i.channel]=!0,!0))}},{name:"alwaysIncludeZeroInScaleWithBarMark",description:"Do not recommend bar mark if scale does not start at zero",properties:[ge.MARK,ge.SCALE,vg("scale","zero"),ge.CHANNEL,ge.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const r=e.getMark(),i=e.getEncodings();if(r===rg){for(let o of i)if(on(o)&&(o.channel===Zr||o.channel===Xr)&&o.type===Oi&&o.scale&&o.scale.zero===!1)return!1}return!0}},{name:"autoAddCount",description:"Automatically adding count only for plots with only ordinal, binned quantitative, or temporal with timeunit fields.",properties:[ge.BIN,ge.TIMEUNIT,ge.TYPE,ge.AUTOCOUNT],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{if(lg(e.getEncodings(),i=>Y8(i)))return mh(e.getEncodings(),i=>{if(Eu(i)||Eo(i))return!0;switch(i.type){case Oi:return!!i.bin;case Ms:return!!i.timeUnit;case Td:case Pd.KEY:case nf:return!0}throw new Error("Unsupported Type")});{const i=e.wildcardIndex.encodingIndicesByProperty.get("autoCount")||[];if(mh(i,s=>{let a=e.getEncodingQueryByIndex(s);return Eo(a)&&!It(a.autoCount)}))return lg(e.getEncodings(),s=>(on(s)||Eo(s))&&s.type===Oi?$u(s)?!1:on(s)&&(!s.bin||It(s.bin)):on(s)&&s.type===Ms?!s.timeUnit||It(s.timeUnit):!1)}return!0}},{name:"channelPermittedByMarkType",description:"Each encoding channel should be supported by the mark type",properties:[ge.CHANNEL,ge.MARK],allowWildcardForProperties:!0,strict:!0,satisfy:(e,t,n)=>{const r=e.getMark();return It(r)?!0:mh(e.getEncodings(),i=>It(i.channel)?!0:!!aKt(i.channel,r))}},{name:"hasAllRequiredChannelsForMark",description:"All required channels for the specified mark should be specified",properties:[ge.CHANNEL,ge.MARK],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const r=e.getMark();switch(r){case B1:case VT:return e.channelUsed(Zr)&&e.channelUsed(Xr);case iF:return e.channelUsed(Yle);case rg:case oF:case sF:case UT:case gK:case pK:return e.channelUsed(Zr)||e.channelUsed(Xr);case HP:return!e.wildcardIndex.hasProperty(ge.CHANNEL)||e.channelUsed(Zr)||e.channelUsed(Xr)}throw new Error("hasAllRequiredChannelsForMark not implemented for mark"+JSON.stringify(r))}},{name:"omitAggregate",description:"Omit aggregate plots.",properties:[ge.AGGREGATE,ge.AUTOCOUNT],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>!e.isAggregate()},{name:"omitAggregatePlotWithDimensionOnlyOnFacet",description:"Omit aggregate plots with dimensions only on facets as that leads to inefficient use of space.",properties:[ge.CHANNEL,ge.AGGREGATE,ge.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{if(e.isAggregate()){let r=!1,i=!1,o=!1;if(e.specQuery.encodings.forEach((s,a)=>{Eu(s)||$u(s)||on(s)&&!s.aggregate&&(i=!0,Mc([yf,iu],s.channel)?e.wildcardIndex.hasEncodingProperty(a,ge.CHANNEL)&&(o=!0):r=!0)}),i&&!r&&(o||n.constraintManuallySpecifiedValue))return!1}return!0}},{name:"omitAggregatePlotWithoutDimension",description:"Aggregate plots without dimension should be omitted",properties:[ge.AGGREGATE,ge.AUTOCOUNT,ge.BIN,ge.TIMEUNIT,ge.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>e.isAggregate()?lg(e.getEncodings(),r=>!!(yy(r)||on(r)&&r.type==="temporal")):!0},{name:"omitBarLineAreaWithOcclusion",description:"Don't use bar, line or area to visualize raw plot as they often lead to occlusion.",properties:[ge.MARK,ge.AGGREGATE,ge.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>Mc([rg,VT,B1],e.getMark())?e.isAggregate():!0},{name:"omitBarTickWithSize",description:"Do not map field to size channel with bar and tick mark",properties:[ge.CHANNEL,ge.MARK],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{const r=e.getMark();if(Mc([UT,rg],r)&&e.channelEncodingField(o0)){if(n.constraintManuallySpecifiedValue)return!1;{const i=e.specQuery.encodings;for(let o=0;o<i.length;o++)if(i[o].channel===o0)return!e.wildcardIndex.hasEncodingProperty(o,ge.CHANNEL)}}return!0}},{name:"omitBarAreaForLogScale",description:"Do not use bar and area mark for x and y's log scale",properties:[ge.MARK,ge.CHANNEL,ge.SCALE,vg("scale","type"),ge.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const r=e.getMark(),i=e.getEncodings();if(r===B1||r===rg){for(let o of i)if(on(o)&&(o.channel===Zr||o.channel===Xr)&&o.scale&&uO(o)===Yr.LOG)return!1}return!0}},{name:"omitMultipleNonPositionalChannels",description:"Unless manually specified, do not use multiple non-positional encoding channel to avoid over-encoding.",properties:[ge.CHANNEL],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{const r=e.specQuery.encodings;let i=0,o=!1;for(let s=0;s<r.length;s++){const a=r[s];if(Eu(a)||$u(a))continue;const l=a.channel;if(!It(l)&&Jtn[l+""]&&(i+=1,e.wildcardIndex.hasEncodingProperty(s,ge.CHANNEL)&&(o=!0),i>1&&(o||n.constraintManuallySpecifiedValue)))return!1}return!0}},{name:"omitNonPositionalOrFacetOverPositionalChannels",description:"Do not use non-positional channels unless all positional channels are used",properties:[ge.CHANNEL],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{const r=e.specQuery.encodings;let i=!1,o=!1,s=!1,a=!1;for(let l=0;l<r.length;l++){const c=r[l];if(Eu(c)||$u(c))continue;const u=c.channel;u===Zr?s=!0:u===Xr?a=!0:It(u)||(i=!0,e.wildcardIndex.hasEncodingProperty(l,ge.CHANNEL)&&(o=!0))}return o||n.constraintManuallySpecifiedValue&&i?s&&a:!0}},{name:"omitRaw",description:"Omit raw plots.",properties:[ge.AGGREGATE,ge.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>!!e.isAggregate()},{name:"omitRawContinuousFieldForAggregatePlot",description:"Aggregate plot should not use raw continuous field as group by values. (Quantitative should be binned. Temporal should have time unit.)",properties:[ge.AGGREGATE,ge.AUTOCOUNT,ge.TIMEUNIT,ge.BIN,ge.TYPE],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{if(e.isAggregate()){const r=e.specQuery.encodings;for(let i=0;i<r.length;i++){const o=r[i];if(!(Eu(o)||$u(o))&&(on(o)&&o.type===Ms&&!o.timeUnit&&(e.wildcardIndex.hasEncodingProperty(i,ge.TIMEUNIT)||n.constraintManuallySpecifiedValue)||o.type===Oi&&on(o)&&!o.bin&&!o.aggregate&&(e.wildcardIndex.hasEncodingProperty(i,ge.BIN)||e.wildcardIndex.hasEncodingProperty(i,ge.AGGREGATE)||e.wildcardIndex.hasEncodingProperty(i,ge.AUTOCOUNT)||n.constraintManuallySpecifiedValue)))return!1}}return!0}},{name:"omitRawDetail",description:"Do not use detail channel with raw plot.",properties:[ge.CHANNEL,ge.AGGREGATE,ge.AUTOCOUNT],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>e.isAggregate()?!0:mh(e.specQuery.encodings,(r,i)=>Eu(r)||$u(r)?!0:!(r.channel===Gle&&(e.wildcardIndex.hasEncodingProperty(i,ge.CHANNEL)||n.constraintManuallySpecifiedValue)))},{name:"omitRepeatedField",description:"Each field should be mapped to only one channel",properties:[ge.FIELD],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{let r={},i={};const o=e.specQuery.encodings;for(let s=0;s<o.length;s++){const a=o[s];if(Eu(a)||Eo(a))continue;let l;if(a.field&&!It(a.field)&&(l=a.field),Eo(a)&&!It(a.autoCount)&&(l="count_*"),l){if(e.wildcardIndex.hasEncodingProperty(s,ge.FIELD)&&(i[l]=!0),r[l]&&(i[l]||n.constraintManuallySpecifiedValue))return!1;r[l]=!0}}return!0}},{name:"omitVerticalDotPlot",description:"Do not output vertical dot plot.",properties:[ge.CHANNEL],allowWildcardForProperties:!0,strict:!1,satisfy:(e,t,n)=>{const r=e.getEncodings();return!(r.length===1&&r[0].channel===Xr)}},{name:"hasAppropriateGraphicTypeForMark",description:"Has appropriate graphic type for mark",properties:[ge.CHANNEL,ge.MARK,ge.TYPE,ge.TIMEUNIT,ge.BIN,ge.AGGREGATE,ge.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{const r=e.getMark();switch(r){case B1:case VT:if(e.isAggregate()){const h=e.getEncodingQueryByChannel(Zr),p=e.getEncodingQueryByChannel(Xr),g=Ak(h),v=Ak(p);return h&&p&&g!==v&&!(on(h)&&!g&&Mc(["nominal","key"],h.type))&&!(on(p)&&!v&&Mc(["nominal","key"],p.type))}return!0;case iF:return!0;case rg:case UT:if(e.channelEncodingField(o0))return!1;{const h=e.getEncodingQueryByChannel(Zr),p=e.getEncodingQueryByChannel(Xr),g=Ak(h),v=Ak(p);return g!==v}case pK:const i=e.getEncodingQueryByChannel(Zr),o=e.getEncodingQueryByChannel(Xr),s=yy(i),a=yy(o),l=e.getEncodingQueryByChannel(zh),c=Ak(l),u=on(l)?l.type===Td:!1;return(s&&a||s&&!e.channelUsed(Xr)||a&&!e.channelUsed(Zr))&&(!l||l&&(c||u));case oF:case HP:case sF:case gK:return!0}throw new Error("hasAllRequiredChannelsForMark not implemented for mark"+r)}},{name:"omitInvalidStackSpec",description:"If stack is specified, must follow Vega-Lite stack rules",properties:[ge.STACK,ge.FIELD,ge.CHANNEL,ge.MARK,ge.AGGREGATE,ge.AUTOCOUNT,ge.SCALE,vg("scale","type"),ge.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{if(!e.wildcardIndex.hasProperty(ge.STACK))return!0;const r=e.getVlStack();return!(r===null&&e.getStackOffset()!==null||r.fieldChannel!==e.getStackChannel())}},{name:"omitNonSumStack",description:"Stack specifications that use non-summative aggregates should be omitted (even implicit ones)",properties:[ge.CHANNEL,ge.MARK,ge.AGGREGATE,ge.AUTOCOUNT,ge.SCALE,vg("scale","type"),ge.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:(e,t,n)=>{const r=e.getVlStack();if(r!=null){const i=e.getEncodingQueryByChannel(r.fieldChannel);if(!Mc(XWe,i.aggregate))return!1}return!0}},{name:"omitTableWithOcclusionIfAutoAddCount",description:"Plots without aggregation or autocount where x and y are both discrete should be omitted if autoAddCount is enabled as they often lead to occlusion",properties:[ge.CHANNEL,ge.TYPE,ge.TIMEUNIT,ge.BIN,ge.AGGREGATE,ge.AUTOCOUNT],allowWildcardForProperties:!1,strict:!1,satisfy:(e,t,n)=>{if(n.autoAddCount){const r=e.getEncodingQueryByChannel("x"),i=e.getEncodingQueryByChannel("y");if((!on(r)||yy(r))&&(!on(i)||yy(i)))return e.isAggregate()?mh(e.getEncodings(),o=>{let s=o.channel;return!(s!==Zr&&s!==Xr&&s!==yf&&s!==iu&&on(o)&&!o.aggregate)}):!1}return!0}}].map(e=>new enn(e));qqe.reduce((e,t)=>(e[t.name()]=t,e),{});const tnn=qqe.reduce((e,t)=>{for(const n of t.properties())e.set(n,e.get(n)||[]),e.get(n).push(t);return e},new xl);function Vqe(e,t,n,r,i){const o=tnn.get(e)||[];for(const s of o)if((s.strict()||i[s.name()])&&!s.satisfy(n,r,i)){let l="(spec) "+s.name();return i.verbose&&console.log(l+" failed with "+n.toShorthand()+" for "+t.name),l}return null}const G8=new xl;function nnn(e){return G8.get(e)}G8.set("mark",(e,t,n)=>(r,i)=>(i.getMark().enum.forEach(s=>{i.setMark(s),Vqe("mark",e.mark,i,t,n)||r.push(i.duplicate())}),i.resetMark(),r));Jle.forEach(e=>{G8.set(e,Uqe(e))});X8.forEach(e=>{G8.set(e,Uqe(e))});function Uqe(e){return(t,n,r)=>(i,o)=>{const s=t.encodingIndicesByProperty.get(e);function a(l){if(l===s.length){i.push(o.duplicate());return}const c=s[l],u=t.encodings[c].get(e),f=o.getEncodingQueryByIndex(c),d=o.getEncodingProperty(c,e);Eu(f)||$u(f)||!d?a(l+1):(u.enum.forEach(h=>{h===null&&(h=void 0),o.setEncodingProperty(c,e,h,u),!(Ktn(e,u,c,o,n,r)||Vqe(e,u,o,n,r))&&a(l+1)}),o.resetEncodingProperty(c,e,u))}return a(0),i}}function rnn(e){return rn.isObject(e)&&!!e.property}function pD(e,t,n){return t=t||new xl,n=n||new xl,e.forEach(r=>{rnn(r)?(t.setByKey(r.property,!0),n.setByKey(r.property,r.replace)):t.setByKey(r,!0)}),{include:t,replaceIndex:n,replacer:Uen(n)}}const Hqe=[ge.FIELD,ge.TYPE,ge.AGGREGATE,ge.BIN,ge.TIMEUNIT,ge.STACK],inn=Hqe.concat([{property:ge.CHANNEL,replace:{x:"xy",y:"xy",color:"style",size:"style",shape:"style",opacity:"style",row:"facet",column:"facet"}}]);let lce={};function K8(e,t){lce[e]=t}const onn="field",snn="fieldTransform",ann="encoding",lnn="spec";function cnn(e,t){if(t){const n={name:"",path:"",items:[]};let r={},i=[],o=[],s=[];for(let a=0;a<t.length;a++){i.push(a>0?i[a-1].duplicate():new xl),o.push(a>0?o[a-1].duplicate():new xl);const l=t[a].groupBy;if(rn.isArray(l)){let c=pD(l,i[a],o[a]);s.push(c.replacer)}}return e.forEach(a=>{let l="",c=n;for(let u=0;u<t.length;u++){const f=c.groupBy=t[u].groupBy;c.orderGroupBy=t[u].orderGroupBy;const d=rn.isArray(f)?ME(a.specQuery,i[u],s[u]):lce[f](a.specQuery);l+="/"+d,r[l]||(r[l]={name:d,path:l,items:[]},c.items.push(r[l])),c=r[l]}c.items.push(a)}),n}else return{name:"",path:"",items:e}}const unn=[ge.FIELD],Hwe=pD(unn);function fnn(e,t){return lce[t](e)}K8(onn,e=>ME(e,Hwe.include,Hwe.replacer));const Xwe=pD(Hqe);K8(snn,e=>ME(e,Xwe.include,Xwe.replacer));const Zwe=pD(inn);K8(ann,e=>ME(e,Zwe.include,Zwe.replacer));K8(lnn,e=>JSON.stringify(e));class dnn{constructor(){this._mark=void 0,this._encodings={},this._encodingIndicesByProperty=new xl}setEncodingProperty(t,n,r){const i=this._encodings;(i[t]=i[t]||new xl).set(n,r);const s=this._encodingIndicesByProperty;return s.set(n,s.get(n)||[]),s.get(n).push(t),this}hasEncodingProperty(t,n){return!!this._encodings[t]&&this._encodings[t].has(n)}hasProperty(t){if(WWe(t))return this.encodingIndicesByProperty.has(t);if(t==="mark")return!!this.mark;throw new Error("Unimplemented for property "+t)}isEmpty(){return!this.mark&&this.encodingIndicesByProperty.size()===0}setMark(t){return this._mark=t,this}get mark(){return this._mark}get encodings(){return this._encodings}get encodingIndicesByProperty(){return this._encodingIndicesByProperty}}class uF{constructor(t,n,r,i,o){this._rankingScore={},this._spec=t,this._channelFieldCount=t.encodings.reduce((s,a)=>(!It(a.channel)&&(!Eo(a)||a.autoCount!==!1)&&(s[a.channel+""]=1),s),{}),this._wildcardIndex=n,this._assignedWildcardIndex=o,this._opt=i,this._schema=r}static build(t,n,r){let i=new dnn;if(It(t.mark)){const o=Pk(ge.MARK);t.mark=LV(t.mark,o,r.enum.mark),i.setMark(t.mark)}if(t.encodings.forEach((o,s)=>{Eo(o)&&(console.warn("A field with autoCount should not be included as autoCount meant to be an internal object."),o.type=Oi),on(o)&&o.type===void 0&&(o.type=Jr),Jle.forEach(a=>{if(It(o[a])){const l=Pk(a)+s,c=FV(a,n,r),u=o[a]=LV(o[a],l,c);i.setEncodingProperty(s,a,u)}}),X8.forEach(a=>{const l=o[a.parent];if(l){const c=a.child;if(It(l[c])){const u=Pk(a)+s,f=FV(a,n,r),d=l[c]=LV(l[c],u,f);i.setEncodingProperty(s,a,d)}}})}),r.autoAddCount){const o={name:Pk(ge.CHANNEL)+t.encodings.length,enum:FV(ge.CHANNEL,n,r)},s={name:Pk(ge.AUTOCOUNT)+t.encodings.length,enum:[!1,!0]},a={channel:o,autoCount:s,type:Oi};t.encodings.push(a);const l=t.encodings.length-1;i.setEncodingProperty(l,ge.CHANNEL,o),i.setEncodingProperty(l,ge.AUTOCOUNT,s)}return new uF(t,i,n,r,{})}get wildcardIndex(){return this._wildcardIndex}get schema(){return this._schema}get specQuery(){return this._spec}duplicate(){return new uF(rn.duplicate(this._spec),this._wildcardIndex,this._schema,this._opt,rn.duplicate(this._assignedWildcardIndex))}setMark(t){const n=this._wildcardIndex.mark.name;this._assignedWildcardIndex[n]=this._spec.mark=t}resetMark(){const t=this._spec.mark=this._wildcardIndex.mark;delete this._assignedWildcardIndex[t.name]}getMark(){return this._spec.mark}getEncodingProperty(t,n){const r=this._spec.encodings[t];return Qh(n)?r[n.parent][n.child]:r[n]}setEncodingProperty(t,n,r,i){const o=this._spec.encodings[t];n===ge.CHANNEL&&o.channel&&!It(o.channel)&&this._channelFieldCount[o.channel]--,Qh(n)?o[n.parent][n.child]=r:ece(n)&&r===!0?o[n]=rn.extend({},o[n],{enum:void 0,name:void 0}):o[n]=r,this._assignedWildcardIndex[i.name]=r,n===ge.CHANNEL&&(this._channelFieldCount[r]=(this._channelFieldCount[r]||0)+1)}resetEncodingProperty(t,n,r){const i=this._spec.encodings[t];n===ge.CHANNEL&&this._channelFieldCount[i.channel]--,Qh(n)?i[n.parent][n.child]=r:i[n]=r,delete this._assignedWildcardIndex[r.name]}channelUsed(t){return this._channelFieldCount[t]>0}channelEncodingField(t){const n=this.getEncodingQueryByChannel(t);return on(n)}getEncodings(){return this._spec.encodings.filter(t=>!$u(t))}getEncodingQueryByChannel(t){for(let n of this._spec.encodings)if(n.channel===t)return n}getEncodingQueryByIndex(t){return this._spec.encodings[t]}isAggregate(){return Ben(this._spec)}getVlStack(){return KWe(this._spec)}getStackOffset(){return Wen(this._spec)}getStackChannel(){return qen(this._spec)}toShorthand(t){if(t){if(rn.isString(t))return fnn(this.specQuery,t);const n=pD(t);return ME(this._spec,n.include,n.replacer)}return ME(this._spec)}toSpec(t){if(It(this._spec.mark))return null;let n={};return t=t||this._spec.data,t&&(n.data=t),this._spec.transform&&(n.transform=this._spec.transform),n.mark=this._spec.mark,n.encoding=tqe(this.specQuery.encodings,{schema:this._schema,wildcardMode:"null"}),this._spec.width&&(n.width=this._spec.width),this._spec.height&&(n.height=this._spec.height),this._spec.background&&(n.background=this._spec.background),this._spec.padding&&(n.padding=this._spec.padding),this._spec.title&&(n.title=this._spec.title),n.encoding===null?null:((this._spec.config||this._opt.defaultSpecConfig)&&(n.config=rn.extend({},this._opt.defaultSpecConfig,this._spec.config)),n)}getRankingScore(t){return this._rankingScore[t]}setRankingScore(t,n){this._rankingScore[t]=n}}function hnn(e){if(e.groupBy){let t={groupBy:e.groupBy};e.orderBy&&(t.orderGroupBy=e.orderBy);let n={spec:rn.duplicate(e.spec),nest:[t]};return e.chooseBy&&(n.chooseBy=e.chooseBy),e.config&&(n.config=e.config),n}return rn.duplicate(e)}function Xqe(e){return e.items!==void 0}function bK(e){let t=e.items[0];for(;t&&Xqe(t);)t=t.items[0];return t}class E_{constructor(t){this.type=t,this.scoreIndex=this.initScore()}getFeatureScore(t){const n=this.type,r=this.scoreIndex[t];if(r!==void 0)return{type:n,feature:t,score:r}}}var Jl;(function(e){e[e.Q=Oi]="Q",e[e.BIN_Q="bin_"+Oi]="BIN_Q",e[e.T=Ms]="T",e[e.TIMEUNIT_T="timeUnit_time"]="TIMEUNIT_T",e[e.TIMEUNIT_O="timeUnit_"+Td]="TIMEUNIT_O",e[e.O=Td]="O",e[e.N=nf]="N",e[e.K=Pd.KEY]="K",e[e.NONE="-"]="NONE"})(Jl||(Jl={}));const Zqe=Jl.Q,fF=Jl.BIN_Q,cce=Jl.T,Hw=Jl.TIMEUNIT_T,dF=Jl.TIMEUNIT_O,hF=Jl.O,pF=Jl.N,OK=Jl.K,gF=Jl.NONE;function mF(e){if(e.bin)return Jl.BIN_Q;if(e.timeUnit){const t=uO(e);return cO(t)?Jl.TIMEUNIT_O:Jl.TIMEUNIT_T}return e.type}class pnn extends E_{constructor(){super("Axis")}initScore(t={}){t=Object.assign({},hD,t);let n={};return[{feature:fF,opt:"preferredBinAxis"},{feature:cce,opt:"preferredTemporalAxis"},{feature:Hw,opt:"preferredTemporalAxis"},{feature:dF,opt:"preferredTemporalAxis"},{feature:hF,opt:"preferredOrdinalAxis"},{feature:pF,opt:"preferredNominalAxis"}].forEach(i=>{t[i.opt]===Zr?n[i.feature+"_"+Xr]=-.01:t[i.opt]===Xr&&(n[i.feature+"_"+Zr]=-.01)}),n}featurize(t,n){return t+"_"+n}getScore(t,n,r){return t.getEncodings().reduce((i,o)=>{if(on(o)||Eo(o)){const s=mF(o),a=this.featurize(s,o.channel),l=this.getFeatureScore(a);l&&i.push(l)}return i},[])}}class gnn extends E_{constructor(){super("Dimension")}initScore(){return{row:-2,column:-2,color:0,opacity:0,size:0,shape:0}}getScore(t,n,r){return t.isAggregate()&&t.getEncodings().reduce((i,o)=>{if(Eo(o)||on(o)&&!o.aggregate){const s=this.getFeatureScore(o.channel+"");if(s&&s.score>i.score)return s}return i},{type:"Dimension",feature:"No Dimension",score:-5}),[]}}class mnn extends E_{constructor(){super("Facet")}initScore(t){t=Object.assign({},hD,t);let n={};return t.preferredFacet===yf?n[iu]=-.01:t.preferredFacet===iu&&(n[yf]=-.01),n}getScore(t,n,r){return t.getEncodings().reduce((i,o)=>{if(on(o)||Eo(o)){const s=this.getFeatureScore(o.channel);s&&i.push(s)}return i},[])}}class ynn extends E_{constructor(){super("SizeChannel")}initScore(){return{bar_size:-2,tick_size:-2}}getScore(t,n,r){const i=t.getMark();return t.getEncodings().reduce((o,s)=>{if(on(s)||Eo(s)){const a=i+"_"+s.channel,l=this.getFeatureScore(a);l&&o.push(l)}return o},[])}}const qN=-10;class vnn extends E_{constructor(){super("TypeChannel")}initScore(){let t={};const n={x:0,y:0,size:-.575,color:-.725,text:-2,opacity:-3,shape:qN,row:qN,column:qN,detail:2*qN};[Zqe,cce,Hw].forEach(o=>{rn.keys(n).forEach(s=>{t[this.featurize(o,s)]=n[s]})});const r=rn.extend({},n,{row:-.75,column:-.75,shape:-3.1,text:-3.2,detail:-4});[fF,dF,hF].forEach(o=>{rn.keys(r).forEach(s=>{t[this.featurize(o,s)]=r[s]})});const i={x:0,y:0,color:-.6,shape:-.65,row:-.7,column:-.7,text:-.8,detail:-2,size:-3,opacity:-3.1};return rn.keys(i).forEach(o=>{t[this.featurize(pF,o)]=i[o],t[this.featurize(OK,o)]=Mc(["x","y","detail"],o)?-1:i[o]-2}),t}featurize(t,n){return t+"_"+n}getScore(t,n,r){const i=t.getEncodings().reduce((s,a)=>{if(on(a)||Eo(a)){const l=eqe(a);(s[l]=s[l]||[]).push(a)}return s},{}),o=[];return fa(i,s=>{const a=s.reduce((l,c)=>{if(on(c)||Eo(c)){const u=mF(c),f=this.featurize(u,c.channel),d=this.getFeatureScore(f);if(l===null||d.score>l.score)return d}return l},null);o.push(a)}),o}}class bnn extends E_{constructor(){super("Mark")}initScore(){return Onn()}getScore(t,n,r){let i=t.getMark();(i===oF||i===sF)&&(i=HP);const o=t.getEncodingQueryByChannel(Zr),s=o?mF(o):gF,a=t.getEncodingQueryByChannel(Xr),l=a?mF(a):gF,c=!t.isAggregate(),u=s+"_"+l+"_"+c+"_"+i,f=this.getFeatureScore(u);return f?[f]:(console.error("feature score missing for",u),[])}}function go(e,t,n,r){return e+"_"+t+"_"+n+"_"+r}function Onn(){const e=[Zqe,cce],n=[fF,dF,hF,pF,OK].concat([gF]);let r={};e.forEach(i=>{e.forEach(o=>{fa({point:0,text:-.2,tick:-.5,rect:-1,bar:-2,line:-2,area:-2,rule:-2.5},(l,c)=>{const u=go(i,o,!0,c);r[u]=l}),fa({point:0,text:-.2,tick:-.5,bar:-2,line:-2,area:-2,rule:-2.5},(l,c)=>{const u=go(i,o,!1,c);r[u]=l})})}),e.forEach(i=>{n.forEach(o=>{fa({tick:0,point:-.2,text:-.5,bar:-2,line:-2,area:-2,rule:-2.5},(a,l)=>{const c=go(i,o,!0,l);r[c]=a;const u=go(o,i,!0,l);r[u]=a})}),[Hw].forEach(o=>{fa({point:0,text:-.5,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5},(a,l)=>{const c=go(i,o,!0,l);r[c]=a;const u=go(o,i,!0,l);r[u]=a})}),[gF,pF,hF,OK].forEach(o=>{fa({bar:0,point:-.2,tick:-.25,text:-.3,line:-2,area:-2,rule:-2.5},(a,l)=>{const c=go(i,o,!1,l);r[c]=a;const u=go(o,i,!1,l);r[u]=a})}),[fF].forEach(o=>{fa({bar:0,point:-.2,tick:-.25,text:-.3,line:-.5,area:-.5,rule:-2.5},(a,l)=>{const c=go(i,o,!1,l);r[c]=a;const u=go(o,i,!1,l);r[u]=a})}),[Hw,dF].forEach(o=>{fa({line:0,area:-.1,bar:-.2,point:-.3,tick:-.35,text:-.4,rule:-2.5},(a,l)=>{const c=go(i,o,!1,l);r[c]=a;const u=go(o,i,!1,l);r[u]=a})})}),[Hw].forEach(i=>{[Hw].forEach(o=>{const s={point:0,rect:-.1,text:-.5,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5};fa(s,(a,l)=>{const c=go(i,o,!0,l);r[c]=a}),fa(s,(a,l)=>{const c=go(i,o,!1,l);r[c]=a})}),n.forEach(o=>{const s={tick:0,point:-.2,text:-.5,rect:-1,bar:-2,line:-2,area:-2,rule:-2.5};fa(s,(a,l)=>{const c=go(i,o,!0,l);r[c]=a}),fa(s,(a,l)=>{const c=go(o,i,!0,l);r[c]=a}),fa(s,(a,l)=>{const c=go(i,o,!1,l);r[c]=a}),fa(s,(a,l)=>{const c=go(o,i,!1,l);r[c]=a})})});for(const i of n)for(const o of n){const s={point:0,rect:0,text:-.1,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5};fa(s,(a,l)=>{const c=go(i,o,!0,l);r[c]=a}),fa(s,(a,l)=>{const c=go(i,o,!1,l);r[c]=a})}return r}const xnn=[new pnn,new gnn,new mnn,new bnn,new ynn,new vnn];function wnn(e,t,n){const r=xnn.reduce((i,o)=>{const s=o.getScore(e,t,n);return i.concat(s)},[]);return{score:r.reduce((i,o)=>i+o.score,0),features:r}}const Ym="aggregationQuality";function Snn(e,t,n){const r=Enn(e);return{score:r.score,features:[r]}}function Enn(e,t,n){const r=e.getEncodings();if(e.isAggregate()){if(lg(r,o=>on(o)&&(o.type===Oi&&!o.bin&&!o.aggregate||o.type===Ms&&!o.timeUnit)))return{type:Ym,score:.1,feature:"Aggregate with raw continuous"};if(lg(r,o=>on(o)&&yy(o))){let o=lg(r,a=>on(a)&&a.aggregate==="count"||Y8(a)),s=lg(r,a=>on(a)&&!!a.bin);return o?{type:Ym,score:.8,feature:"Aggregate with count"}:s?{type:Ym,score:.7,feature:"Aggregate with bin but without count"}:{type:Ym,score:.9,feature:"Aggregate without count and without bin"}}return{type:Ym,score:.3,feature:"Aggregate without dimension"}}else return lg(r,i=>on(i)&&!yy(i))?{type:Ym,score:1,feature:"Raw with measure"}:{type:Ym,score:.2,feature:"Raw without measure"}}const Cnn="fieldOrder";function _nn(e,t,n){const r=e.wildcardIndex.encodingIndicesByProperty.get("field");if(!r)return{score:0,features:[]};const i=e.specQuery.encodings,o=t.fieldSchemas.length,s=[];let a=0,l=1;for(let c=r.length-1;c>=0;c--){const u=r[c],f=i[u];let d;if(on(f))d=f.field;else continue;const h=e.wildcardIndex.encodings[u].get("field"),p=t.fieldSchema(d).index,g=-p*l;a+=g,s.push({score:g,type:"fieldOrder",feature:`field ${h.name} is ${d} (#${p} in the schema)`}),l*=o}return{score:a,features:s}}let Yqe={};function uce(e,t){Yqe[e]=t}function knn(e){return Yqe[e]}function Gqe(e,t,n,r){return!t.nest||r===t.nest.length?(t.orderBy||t.chooseBy)&&(e.items.sort($nn(t.orderBy||t.chooseBy,n,t.config)),t.chooseBy&&e.items.length>0&&e.items.splice(1)):(e.items.forEach(i=>{Gqe(i,t,n,r+1)}),t.nest[r].orderGroupBy&&e.items.sort(Tnn(t.nest[r].orderGroupBy,n,t.config))),e}function $nn(e,t,n){return(r,i)=>e instanceof Array?yF(e,r,i,t,n):yF([e],r,i,t,n)}function Tnn(e,t,n){return(r,i)=>{const o=bK(r),s=bK(i);return e instanceof Array?yF(e,o,s,t,n):yF([e],o,s,t,n)}}function yF(e,t,n,r,i){for(let o of e){let s=Ywe(n,o,r,i).score-Ywe(t,o,r,i).score;if(s!==0)return s}return 0}function Ywe(e,t,n,r){if(e.getRankingScore(t)!==void 0)return e.getRankingScore(t);const o=knn(t)(e,n,r);return e.setRankingScore(t,o),o}const Pnn="effectiveness";uce(Pnn,wnn);uce(Ym,Snn);uce(Cnn,_nn);function Ann(e,t,n){let r={};return e=e.map(function(i){return n.smallRangeStepForHighCardinalityOrFacet&&(i=Rnn(i,t,r,n)),n.nominalColorScaleForHighCardinality&&(i=Dnn(i,t,r,n)),n.xAxisOnTopForHighYCardinalityWithoutColumn&&(i=Mnn(i,t,r,n)),i}),e}function Rnn(e,t,n,r){[yf,Xr,iu,Zr].forEach(s=>{n[s]=e.getEncodingQueryByChannel(s)});const i=n[Xr];if(i!==void 0&&on(i)&&(n[yf]||t.cardinality(i)>r.smallRangeStepForHighCardinalityOrFacet.maxCardinality)){i.scale===void 0&&(i.scale={});const s=uO(i);i.scale&&(s===void 0||cO(s))&&(i.scale.rangeStep||(i.scale.rangeStep=12))}const o=n[Zr];if(on(o)&&(n[iu]||t.cardinality(o)>r.smallRangeStepForHighCardinalityOrFacet.maxCardinality)){o.scale===void 0&&(o.scale={});const s=uO(o);o.scale&&(s===void 0||cO(s))&&(o.scale.rangeStep||(o.scale.rangeStep=12))}return e}function Dnn(e,t,n,r){n[zh]=e.getEncodingQueryByChannel(zh);const i=n[zh];return on(i)&&i!==void 0&&(i.type===nf||i.type===Pd.KEY)&&t.cardinality(i)>r.nominalColorScaleForHighCardinality.maxCardinality&&(i.scale===void 0&&(i.scale={}),i.scale&&(i.scale.range||(i.scale.scheme=r.nominalColorScaleForHighCardinality.palette))),e}function Mnn(e,t,n,r){if([iu,Zr,Xr].forEach(i=>{n[i]=e.getEncodingQueryByChannel(i)}),n[iu]===void 0){const i=n[Zr],o=n[Xr];on(i)&&on(o)&&o!==void 0&&o.field&&cO(uO(o))&&i!==void 0&&t.cardinality(o)>r.xAxisOnTopForHighYCardinalityWithoutColumn.maxCardinality&&(i.axis===void 0&&(i.axis={}),i.axis&&!i.axis.orient&&(i.axis.orient="top"))}return e}function Nnn(e,t,n=hD){const r=uF.build(e,t,n),i=r.wildcardIndex;let o=[r];return n.propertyPrecedence.forEach(s=>{const a=YJt(s);if(i.hasProperty(a)){const c=nnn(a)(i,t,n);o=o.reduce(c,[])}}),n.stylize&&(n.nominalColorScaleForHighCardinality!==null||n.smallRangeStepForHighCardinalityOrFacet!==null||n.xAxisOnTopForHighYCardinalityWithoutColumn!==null)?Ann(o,t,n):o}function Kqe(e,t,n){e=Object.assign({},hnn(e),{config:Object.assign({},hD,n,e.config)});const r=Nnn(e.spec,t,e.config),i=cnn(r,e.nest),o=Gqe(i,e,t,0);return{query:e,result:o}}const Gwe={};function xK(e,t){e===void 0&&(e=Gwe),t===void 0&&(t=Gwe);const n=Object.keys(e),r=Object.keys(t);return e===t||n.length===r.length&&n.every(i=>e[i]===t[i])}/*!
 * https://github.com/Starcounter-Jack/JSON-Patch
 * (c) 2017-2022 Joachim Wester
 * MIT licensed
 */var Inn=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lnn=Object.prototype.hasOwnProperty;function wK(e,t){return Lnn.call(e,t)}function SK(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var r=[];for(var i in e)wK(e,i)&&r.push(i);return r}function Uc(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function EK(e){for(var t=0,n=e.length,r;t<n;){if(r=e.charCodeAt(t),r>=48&&r<=57){t++;continue}return!1}return!0}function p1(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Jqe(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function CK(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(CK(e[t]))return!0}else if(typeof e=="object"){for(var r=SK(e),i=r.length,o=0;o<i;o++)if(CK(e[r[o]]))return!0}}return!1}function Kwe(e,t){var n=[e];for(var r in t){var i=typeof t[r]=="object"?JSON.stringify(t[r],null,2):t[r];typeof i<"u"&&n.push(r+": "+i)}return n.join(`
`)}var eVe=function(e){Inn(t,e);function t(n,r,i,o,s){var a=this.constructor,l=e.call(this,Kwe(n,{name:r,index:i,operation:o,tree:s}))||this;return l.name=r,l.index=i,l.operation=o,l.tree=s,Object.setPrototypeOf(l,a.prototype),l.message=Kwe(n,{name:r,index:i,operation:o,tree:s}),l}return t}(Error),Bi=eVe,jnn=Uc,Xw={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=vF(n,this.path);r&&(r=Uc(r));var i=lb(n,{op:"remove",path:this.from}).removed;return lb(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=vF(n,this.from);return lb(n,{op:"add",path:this.path,value:Uc(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:ZP(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},Fnn={add:function(e,t,n){return EK(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var r=e.splice(t,1);return{newDocument:n,removed:r[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:Xw.move,copy:Xw.copy,test:Xw.test,_get:Xw._get};function vF(e,t){if(t=="")return e;var n={op:"_get",path:t};return lb(e,n),n.value}function lb(e,t,n,r,i,o){if(n===void 0&&(n=!1),r===void 0&&(r=!0),i===void 0&&(i=!0),o===void 0&&(o=0),n&&(typeof n=="function"?n(t,0,e,t.path):bF(t,0)),t.path===""){var s={newDocument:e};if(t.op==="add")return s.newDocument=t.value,s;if(t.op==="replace")return s.newDocument=t.value,s.removed=e,s;if(t.op==="move"||t.op==="copy")return s.newDocument=vF(e,t.from),t.op==="move"&&(s.removed=e),s;if(t.op==="test"){if(s.test=ZP(e,t.value),s.test===!1)throw new Bi("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s.newDocument=e,s}else{if(t.op==="remove")return s.removed=e,s.newDocument=null,s;if(t.op==="_get")return t.value=e,s;if(n)throw new Bi("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return s}}else{r||(e=Uc(e));var a=t.path||"",l=a.split("/"),c=e,u=1,f=l.length,d=void 0,h=void 0,p=void 0;for(typeof n=="function"?p=n:p=bF;;){if(h=l[u],h&&h.indexOf("~")!=-1&&(h=Jqe(h)),i&&(h=="__proto__"||h=="prototype"&&u>0&&l[u-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[h]===void 0?d=l.slice(0,u).join("/"):u==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),u++,Array.isArray(c)){if(h==="-")h=c.length;else{if(n&&!EK(h))throw new Bi("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);EK(h)&&(h=~~h)}if(u>=f){if(n&&t.op==="add"&&h>c.length)throw new Bi("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var s=Fnn[t.op].call(t,c,h,e);if(s.test===!1)throw new Bi("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}}else if(u>=f){var s=Xw[t.op].call(t,c,h,e);if(s.test===!1)throw new Bi("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}if(c=c[h],n&&u<f&&(!c||typeof c!="object"))throw new Bi("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}function J8(e,t,n,r,i){if(r===void 0&&(r=!0),i===void 0&&(i=!0),n&&!Array.isArray(t))throw new Bi("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(e=Uc(e));for(var o=new Array(t.length),s=0,a=t.length;s<a;s++)o[s]=lb(e,t[s],n,!0,i,s),e=o[s].newDocument;return o.newDocument=e,o}function znn(e,t,n){var r=lb(e,t);if(r.test===!1)throw new Bi("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return r.newDocument}function bF(e,t,n,r){if(typeof e!="object"||e===null||Array.isArray(e))throw new Bi("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(Xw[e.op]){if(typeof e.path!="string")throw new Bi("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Bi('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Bi("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Bi("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&CK(e.value))throw new Bi("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var i=e.path.split("/").length,o=r.split("/").length;if(i!==o+1&&i!==o)throw new Bi("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==r)throw new Bi("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var s={op:"_get",path:e.from,value:void 0},a=tVe([s],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Bi("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Bi("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function tVe(e,t,n){try{if(!Array.isArray(e))throw new Bi("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)J8(Uc(t),Uc(e),n||!0);else{n=n||bF;for(var r=0;r<e.length;r++)n(e[r],r,t,void 0)}}catch(i){if(i instanceof Bi)return i;throw i}}function ZP(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),r=Array.isArray(t),i,o,s;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!ZP(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var a=Object.keys(e);if(o=a.length,o!==Object.keys(t).length)return!1;for(i=o;i--!==0;)if(!t.hasOwnProperty(a[i]))return!1;for(i=o;i--!==0;)if(s=a[i],!ZP(e[s],t[s]))return!1;return!0}return e!==e&&t!==t}const Qnn=Object.freeze(Object.defineProperty({__proto__:null,JsonPatchError:Bi,_areEquals:ZP,applyOperation:lb,applyPatch:J8,applyReducer:znn,deepClone:jnn,getValueByPointer:vF,validate:tVe,validator:bF},Symbol.toStringTag,{value:"Module"}));/*!
 * https://github.com/Starcounter-Jack/JSON-Patch
 * (c) 2017-2021 Joachim Wester
 * MIT license
 */var fce=new WeakMap,Bnn=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),Wnn=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function qnn(e){return fce.get(e)}function Vnn(e,t){return e.observers.get(t)}function Unn(e,t){e.observers.delete(t.callback)}function Hnn(e,t){t.unobserve()}function Xnn(e,t){var n=[],r,i=qnn(e);if(!i)i=new Bnn(e),fce.set(e,i);else{var o=Vnn(i,t);r=o&&o.observer}if(r)return r;if(r={},i.value=Uc(e),t){r.callback=t,r.next=null;var s=function(){_K(r)},a=function(){clearTimeout(r.next),r.next=setTimeout(s)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return r.patches=n,r.object=e,r.unobserve=function(){_K(r),clearTimeout(r.next),Unn(i,r),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},i.observers.set(t,new Wnn(t,r)),r}function _K(e,t){t===void 0&&(t=!1);var n=fce.get(e.object);dce(n.value,e.object,e.patches,"",t),e.patches.length&&J8(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function dce(e,t,n,r,i){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=SK(t),s=SK(e),a=!1,l=s.length-1;l>=0;l--){var c=s[l],u=e[c];if(wK(t,c)&&!(t[c]===void 0&&u!==void 0&&Array.isArray(t)===!1)){var f=t[c];typeof u=="object"&&u!=null&&typeof f=="object"&&f!=null&&Array.isArray(u)===Array.isArray(f)?dce(u,f,n,r+"/"+p1(c),i):u!==f&&(i&&n.push({op:"test",path:r+"/"+p1(c),value:Uc(u)}),n.push({op:"replace",path:r+"/"+p1(c),value:Uc(f)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+p1(c),value:Uc(u)}),n.push({op:"remove",path:r+"/"+p1(c)}),a=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}))}if(!(!a&&o.length==s.length))for(var l=0;l<o.length;l++){var c=o[l];!wK(e,c)&&t[c]!==void 0&&n.push({op:"add",path:r+"/"+p1(c),value:Uc(t[c])})}}}function Znn(e,t,n){n===void 0&&(n=!1);var r=[];return dce(e,t,r,"",n),r}const Ynn=Object.freeze(Object.defineProperty({__proto__:null,compare:Znn,generate:_K,observe:Xnn,unobserve:Hnn},Symbol.toStringTag,{value:"Module"}));Object.assign({},Qnn,Ynn,{JsonPatchError:eVe,deepClone:Uc,escapePathComponent:p1,unescapePathComponent:Jqe});var Gnn=/("(?:[^\\"]|\\.)*")|[:,]/g,Knn=function(t,n){var r,i,o;return n=n||{},r=JSON.stringify([1],void 0,n.indent===void 0?2:n.indent).slice(2,-3),i=r===""?1/0:n.maxLength===void 0?80:n.maxLength,o=n.replacer,function s(a,l,c){var u,f,d,h,p,g,v,y,O,m,w,S;if(a&&typeof a.toJSON=="function"&&(a=a.toJSON()),w=JSON.stringify(a,o),w===void 0)return w;if(v=i-l.length-c,w.length<=v&&(O=w.replace(Gnn,function(E,C){return C||E+" "}),O.length<=v))return O;if(o!=null&&(a=JSON.parse(w),o=void 0),typeof a=="object"&&a!==null){if(y=l+r,d=[],f=0,Array.isArray(a))for(m="[",u="]",v=a.length;f<v;f++)d.push(s(a[f],y,f===v-1?0:1)||"null");else for(m="{",u="}",g=Object.keys(a),v=g.length;f<v;f++)h=g[f],p=JSON.stringify(h)+": ",S=s(a[h],y,p.length+(f===v-1?0:1)),S!==void 0&&d.push(p+S);if(d.length>0)return[m,r+d.join(`,
`+y),u].join(`
`+l)}return w}(t,"",0)};const VV=wf(Knn);function e9(e){const t=e||Ba,n=[],r={};return n.add=i=>{const o=t(i);return r[o]||(r[o]=1,n.push(i)),n},n.remove=i=>{const o=t(i);if(r[o]){r[o]=0;const s=n.indexOf(i);s>=0&&n.splice(s,1)}return n},n}async function nL(e,t){try{await t(e)}catch(n){e.error(n)}}const nVe=Symbol("vega_id");let Jnn=1;function t9(e){return!!(e&&Dt(e))}function Dt(e){return e[nVe]}function rVe(e,t){return e[nVe]=t,e}function dr(e){const t=e===Object(e)?e:{data:e};return Dt(t)?t:rVe(t,Jnn++)}function hce(e){return n9(e,dr({}))}function n9(e,t){for(const n in e)t[n]=e[n];return t}function iVe(e,t){return rVe(t,Dt(e))}function ox(e,t){return e?t?(n,r)=>e(n,r)||Dt(t(n))-Dt(t(r)):(n,r)=>e(n,r)||Dt(n)-Dt(r):null}function oVe(e){return e&&e.constructor===sx}function sx(){const e=[],t=[],n=[],r=[],i=[];let o=null,s=!1;return{constructor:sx,insert(a){const l=ct(a),c=l.length;for(let u=0;u<c;++u)e.push(l[u]);return this},remove(a){const l=ln(a)?r:t,c=ct(a),u=c.length;for(let f=0;f<u;++f)l.push(c[f]);return this},modify(a,l,c){const u={field:l,value:Wa(c)};return ln(a)?(u.filter=a,i.push(u)):(u.tuple=a,n.push(u)),this},encode(a,l){return ln(a)?i.push({filter:a,field:l}):n.push({tuple:a,field:l}),this},clean(a){return o=a,this},reflow(){return s=!0,this},pulse(a,l){const c={},u={};let f,d,h,p,g,v;for(f=0,d=l.length;f<d;++f)c[Dt(l[f])]=1;for(f=0,d=t.length;f<d;++f)g=t[f],c[Dt(g)]=-1;for(f=0,d=r.length;f<d;++f)p=r[f],l.forEach(O=>{p(O)&&(c[Dt(O)]=-1)});for(f=0,d=e.length;f<d;++f)g=e[f],v=Dt(g),c[v]?c[v]=1:a.add.push(dr(e[f]));for(f=0,d=l.length;f<d;++f)g=l[f],c[Dt(g)]<0&&a.rem.push(g);function y(O,m,w){w?O[m]=w(O):a.encode=m,s||(u[Dt(O)]=O)}for(f=0,d=n.length;f<d;++f)h=n[f],g=h.tuple,p=h.field,v=c[Dt(g)],v>0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=i.length;f<d;++f)h=i[f],p=h.filter,l.forEach(O=>{p(O)&&c[Dt(O)]>0&&y(O,h.field,h.value)}),a.modifies(h.field);if(s)a.mod=t.length||r.length?l.filter(O=>c[Dt(O)]>0):l.slice();else for(v in u)a.mod.push(u[v]);return(o||o==null&&(t.length||r.length))&&a.clean(!0),a}}}const rL="_:mod:_";function r9(){Object.defineProperty(this,rL,{writable:!0,value:{}})}r9.prototype={set(e,t,n,r){const i=this,o=i[e],s=i[rL];return t!=null&&t>=0?(o[t]!==n||r)&&(o[t]=n,s[t+":"+e]=-1,s[e]=-1):(o!==n||r)&&(i[e]=n,s[e]=ze(n)?1+n.length:-1),i},modified(e,t){const n=this[rL];if(arguments.length){if(ze(e)){for(let r=0;r<e.length;++r)if(n[e[r]])return!0;return!1}}else{for(const r in n)if(n[r])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[rL]={},this}};let ern=0;const trn="pulse",nrn=new r9,rrn=1,irn=2;function Vr(e,t,n,r){this.id=++ern,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,r)}function Jwe(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}Vr.prototype={targets(){return this._targets||(this._targets=e9(JR))},set(e){return this.value!==e?(this.value=e,1):0},skip:Jwe(rrn),modified:Jwe(irn),parameters(e,t,n){t=t!==!1;const r=this._argval=this._argval||new r9,i=this._argops=this._argops||[],o=[];let s,a,l,c;const u=(f,d,h)=>{h instanceof Vr?(h!==this&&(t&&h.targets().add(this),o.push(h)),i.push({op:h,name:f,index:d})):r.set(f,d,h)};for(s in e)if(a=e[s],s===trn)ct(a).forEach(f=>{f instanceof Vr?f!==this&&(f.targets().add(this),o.push(f)):Le("Pulse parameters must be operator instances.")}),this.source=a;else if(ze(a))for(r.set(s,-1,Array(l=a.length)),c=0;c<l;++c)u(s,c,a[c]);else u(s,-1,a);return this.marshall().clear(),n&&(i.initonly=!0),o},marshall(e){const t=this._argval||nrn,n=this._argops;let r,i,o,s;if(n){const a=n.length;for(i=0;i<a;++i)r=n[i],o=r.op,s=o.modified()&&o.stamp===e,t.set(r.name,r.index,o.value,s);if(n.initonly){for(i=0;i<a;++i)r=n[i],r.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,r,i;if(e)for(t=0,n=e.length;t<n;++t)r=e[t],i=r.op,i._targets&&i._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),r=t.call(this,n,e);if(n.clear(),r!==this.value)this.value=r;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function orn(e,t,n,r){let i=1,o;return e instanceof Vr?o=e:e&&e.prototype instanceof Vr?o=new e:ln(e)?o=new Vr(null,e):(i=0,o=new Vr(e,t)),this.rank(o),i&&(r=n,n=t),n&&this.connect(o,o.parameters(n,r)),this.touch(o),o}function srn(e,t){const n=e.rank,r=t.length;for(let i=0;i<r;++i)if(n<t[i].rank){this.rerank(e);return}}let arn=0;function i9(e,t,n){this.id=++arn,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function Gm(e,t,n){return new i9(e,t,n)}i9.prototype={_filter:pf,_apply:Ba,targets(){return this._targets||(this._targets=e9(JR))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,r=n?n.length:0;for(let i=0;i<r;++i)n[i].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=Gm(e);return this.targets().add(t),t},apply(e){const t=Gm(null,e);return this.targets().add(t),t},merge(){const e=Gm();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Gm();return this.targets().add(Gm(null,null,_ae(e,n=>{const r=n.dataflow;t.receive(n),r&&r.run&&r.run()}))),t},between(e,t){let n=!1;return e.targets().add(Gm(null,null,()=>n=!0)),t.targets().add(Gm(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=pf,this._targets=null}};function lrn(e,t,n,r){const i=this,o=Gm(n,r),s=function(c){c.dataflow=i;try{o.receive(c)}catch(u){i.error(u)}finally{i.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=ct(e);const l=a.length;for(let c=0;c<l;++c)a[c].addEventListener(t,s);return o}function crn(e,t){const n=this.locale();return IP(e,t,n.timeParse,n.utcParse)}function urn(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function frn(e,t){const n=this;let r=0,i;try{i=await n.loader().load(e,{context:"dataflow",response:P9e(t&&t.type)});try{i=n.parse(i,t)}catch(o){r=-2,n.warn("Data ingestion failed",e,o)}}catch(o){r=-1,n.warn("Loading failed",e,o)}return{data:i,status:r}}async function drn(e,t,n){const r=this,i=r._pending||hrn(r);i.requests+=1;const o=await r.request(t,n);return r.pulse(e,r.changeset().remove(pf).insert(o.data||[])),i.done(),o}function hrn(e){let t;const n=new Promise(r=>t=r);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const prn={skip:!0};function grn(e,t,n,r,i){return(e instanceof Vr?yrn:mrn)(this,e,t,n,r,i),this}function mrn(e,t,n,r,i,o){const s=an({},o,prn);let a,l;ln(n)||(n=Wa(n)),r===void 0?a=c=>e.touch(n(c)):ln(r)?(l=new Vr(null,r,i,!1),a=c=>{l.evaluate(c);const u=n(c),f=l.value;oVe(f)?e.pulse(u,f,o):e.update(u,f,s)}):a=c=>e.update(n(c),r,s),t.apply(a)}function yrn(e,t,n,r,i,o){if(r===void 0)t.targets().add(n);else{const s=o||{},a=new Vr(null,vrn(n,r),i,!1);a.modified(s.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function vrn(e,t){return t=ln(t)?t:Wa(t),e?function(n,r){const i=t(n,r);return e.skip()||(e.skip(i!==this.value).value=i),i}:t}function brn(e){e.rank=++this._rank}function Orn(e){const t=[e];let n,r,i;for(;t.length;)if(this.rank(n=t.pop()),r=n._targets)for(i=r.length;--i>=0;)t.push(n=r[i]),n===e&&Le("Cycle detected in dataflow graph.")}const OF={},fh=1,sy=2,Jp=4,xrn=fh|sy,eSe=fh|Jp,qx=fh|sy|Jp,tSe=8,Dk=16,nSe=32,rSe=64;function a0(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function UV(e,t){const n=[];return oy(e,t,r=>n.push(r)),n}function iSe(e,t){const n={};return e.visit(t,r=>{n[Dt(r)]=1}),r=>n[Dt(r)]?null:r}function VN(e,t){return e?(n,r)=>e(n,r)&&t(n,r):t}a0.prototype={StopPropagation:OF,ADD:fh,REM:sy,MOD:Jp,ADD_REM:xrn,ADD_MOD:eSe,ALL:qx,REFLOW:tSe,SOURCE:Dk,NO_SOURCE:nSe,NO_FIELDS:rSe,fork(e){return new a0(this.dataflow).init(this,e)},clone(){const e=this.fork(qx);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(qx|Dk)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new a0(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&rSe)&&(n.fields=e.fields),t&fh?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&sy?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Jp?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&nSe?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||qx;return t&fh&&this.add.length||t&sy&&this.rem.length||t&Jp&&this.mod.length},reflow(e){if(e)return this.fork(qx).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Jp,iSe(this,fh))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return ze(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?ze(e)?e.some(r=>n[r]):n[e]:!!n:!1},filter(e,t){const n=this;return e&fh&&(n.addF=VN(n.addF,t)),e&sy&&(n.remF=VN(n.remF,t)),e&Jp&&(n.modF=VN(n.modF,t)),e&Dk&&(n.srcF=VN(n.srcF,t)),n},materialize(e){e=e||qx;const t=this;return e&fh&&t.addF&&(t.add=UV(t.add,t.addF),t.addF=null),e&sy&&t.remF&&(t.rem=UV(t.rem,t.remF),t.remF=null),e&Jp&&t.modF&&(t.mod=UV(t.mod,t.modF),t.modF=null),e&Dk&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,r=t;if(e&Dk)return oy(n.source,n.srcF,r),n;e&fh&&oy(n.add,n.addF,r),e&sy&&oy(n.rem,n.remF,r),e&Jp&&oy(n.mod,n.modF,r);const i=n.source;if(e&tSe&&i){const o=n.add.length+n.mod.length;o===i.length||(o?oy(i,iSe(n,eSe),r):oy(i,n.srcF,r))}return n}};function pce(e,t,n,r){const i=this;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(const s of n)if(s.stamp===t){if(s.fields){const a=i.fields||(i.fields={});for(const l in s.fields)a[l]=1}s.changed(i.ADD)&&(o|=i.ADD),s.changed(i.REM)&&(o|=i.REM),s.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}Ke(pce,a0,{fork(e){const t=new a0(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?ze(e)?e.some(r=>n[r]):n[e]:0},filter(){Le("MultiPulse does not support filtering.")},materialize(){Le("MultiPulse does not support materialization.")},visit(e,t){const n=this,r=n.pulses,i=r.length;let o=0;if(e&n.SOURCE)for(;o<i;++o)r[o].visit(e,t);else for(;o<i;++o)r[o].stamp===n.stamp&&r[o].visit(e,t);return n}});async function wrn(e,t,n){const r=this,i=[];if(r._pulse)return sVe(r);if(r._pending&&await r._pending,t&&await nL(r,t),!r._touched.length)return r.debug("Dataflow invoked, but nothing to do."),r;const o=++r._clock;r._pulse=new a0(r,o,e),r._touched.forEach(u=>r._enqueue(u,!0)),r._touched=e9(JR);let s=0,a,l,c;try{for(;r._heap.size()>0;){if(a=r._heap.pop(),a.rank!==a.qrank){r._enqueue(a,!0);continue}l=a.run(r._getPulse(a,e)),l.then?l=await l:l.async&&(i.push(l.async),l=OF),l!==OF&&a._targets&&a._targets.forEach(u=>r._enqueue(u)),++s}}catch(u){r._heap.clear(),c=u}if(r._input={},r._pulse=null,r.debug(`Pulse ${o}: ${s} operators`),c&&(r._postrun=[],r.error(c)),r._postrun.length){const u=r._postrun.sort((f,d)=>d.priority-f.priority);r._postrun=[];for(let f=0;f<u.length;++f)await nL(r,u[f].callback)}return n&&await nL(r,n),i.length&&Promise.all(i).then(u=>r.runAsync(null,()=>{u.forEach(f=>{try{f(r)}catch(d){r.error(d)}})})),r}async function Srn(e,t,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running}function Ern(e,t,n){return this._pulse?sVe(this):(this.evaluate(e,t,n),this)}function Crn(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(r){this.error(r)}}function sVe(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function _rn(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function krn(e,t){const n=e.source,r=this._clock;return n&&ze(n)?new pce(this,r,n.map(i=>i.pulse),t):this._input[e.id]||$rn(this._pulse,n&&n.pulse)}function $rn(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==OF&&(e.source=t.source),e)}const gce={skip:!1,force:!1};function Trn(e,t){const n=t||gce;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function Prn(e,t,n){const r=n||gce;return(e.set(t)||r.force)&&this.touch(e,r),this}function Arn(e,t,n){this.touch(e,n||gce);const r=new a0(this,this._clock+(this._pulse?0:1)),i=e.pulse&&e.pulse.source||[];return r.target=e,this._input[e.id]=t.pulse(r,i),this}function Rrn(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),aVe(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let r;return t.length?(r=t[0],t[0]=n,Drn(t,0,e)):r=n,r}}}function aVe(e,t,n,r){let i,o;const s=e[n];for(;n>t;){if(o=n-1>>1,i=e[o],r(s,i)<0){e[n]=i,n=o;continue}break}return e[n]=s}function Drn(e,t,n){const r=t,i=e.length,o=e[t];let s=(t<<1)+1,a;for(;s<i;)a=s+1,a<i&&n(e[s],e[a])>=0&&(s=a),e[t]=e[s],t=s,s=(t<<1)+1;return e[t]=o,aVe(e,r,t,n)}function MS(){this.logger(xae()),this.logLevel(bae),this._clock=0,this._rank=0,this._locale=Fae();try{this._loader=tD()}catch{}this._touched=e9(JR),this._input={},this._pulse=null,this._heap=Rrn((e,t)=>e.qrank-t.qrank),this._postrun=[]}function Mk(e){return function(){return this._log[e].apply(this,arguments)}}MS.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:Mk("error"),warn:Mk("warn"),info:Mk("info"),debug:Mk("debug"),logLevel:Mk("level"),cleanThreshold:1e4,add:orn,connect:srn,rank:brn,rerank:Orn,pulse:Arn,touch:Trn,update:Prn,changeset:sx,ingest:urn,parse:crn,preload:drn,request:frn,events:lrn,on:grn,evaluate:wrn,run:Ern,runAsync:Srn,runAfter:Crn,_enqueue:_rn,_getPulse:krn};function De(e,t){Vr.call(this,e,null,t)}Ke(De,Vr,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const NE={};function lVe(e){const t=cVe(e);return t&&t.Definition||null}function cVe(e){return e=e&&e.toLowerCase(),Nt(NE,e)?NE[e]:null}function*uVe(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)r=t(r,++n,e),r!=null&&r!==""&&(r=+r)>=r&&(yield r)}}function mce(e,t,n){const r=Float64Array.from(uVe(e,n));return r.sort(Pg),t.map(i=>I8e(r,i))}function yce(e,t){return mce(e,[.25,.5,.75],t)}function vce(e,t){const n=e.length,r=G9t(e,t),i=yce(e,t),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function fVe(e){const t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o=e.extent[0],s=e.extent[1],a,l,c,u,f,d;const h=e.span||s-o||Math.abs(o)||1;if(e.step)a=e.step;else if(e.steps){for(u=h/t,f=0,d=e.steps.length;f<d&&e.steps[f]<u;++f);a=e.steps[Math.max(0,f-1)]}else{for(l=Math.ceil(Math.log(t)/r),c=e.minstep||0,a=Math.max(c,Math.pow(n,Math.round(Math.log(h)/r)-l));Math.ceil(h/a)>t;)a*=n;for(f=0,d=i.length;f<d;++f)u=a/i[f],u>=c&&h/u<=t&&(a=u)}u=Math.log(a);const p=u>=0?0:~~(-u/r)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(u=Math.floor(o/a+g)*a,o=o<u?u-a:u,s=Math.ceil(s/a)*a),{start:o,stop:s===o?o+a:s,step:a}}var vf=Math.random;function Mrn(e){vf=e}function dVe(e,t,n,r){if(!e.length)return[void 0,void 0];const i=Float64Array.from(uVe(e,r)),o=i.length,s=t;let a,l,c,u;for(c=0,u=Array(s);c<s;++c){for(a=0,l=0;l<o;++l)a+=i[~~(vf()*o)];u[c]=a/o}return u.sort(Pg),[NG(u,n/2),NG(u,1-n/2)]}function hVe(e,t,n,r){r=r||(d=>d);const i=e.length,o=new Float64Array(i);let s=0,a=1,l=r(e[0]),c=l,u=l+t,f;for(;a<i;++a){if(f=r(e[a]),f>=u){for(c=(l+c)/2;s<a;++s)o[s]=c;u=f+t,l=f}c=f}for(c=(l+c)/2;s<a;++s)o[s]=c;return n?Nrn(o,t+t/4):o}function Nrn(e,t){const n=e.length;let r=0,i=1,o,s;for(;e[r]===e[i];)++i;for(;i<n;){for(o=i+1;e[i]===e[o];)++o;if(e[i]-e[i-1]<t){for(s=i+(r+o-i-i>>1);s<i;)e[s++]=e[i];for(;s>i;)e[s--]=e[r]}r=i,i=o}return e}function Irn(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function Lrn(e,t){t==null&&(t=e,e=0);let n,r,i;const o={min(s){return arguments.length?(n=s||0,i=r-n,o):n},max(s){return arguments.length?(r=s||0,i=r-n,o):r},sample(){return n+Math.floor(i*vf())},pdf(s){return s===Math.floor(s)&&s>=n&&s<r?1/i:0},cdf(s){const a=Math.floor(s);return a<n?0:a>=r?1:(a-n+1)/i},icdf(s){return s>=0&&s<=1?n-1+Math.floor(s*i):NaN}};return o.min(e).max(t)}const pVe=Math.sqrt(2*Math.PI),jrn=Math.SQRT2;let Nk=NaN;function o9(e,t){e=e||0,t=t??1;let n=0,r=0,i,o;if(Nk===Nk)n=Nk,Nk=NaN;else{do n=vf()*2-1,r=vf()*2-1,i=n*n+r*r;while(i===0||i>1);o=Math.sqrt(-2*Math.log(i)/i),n*=o,Nk=r*o}return e+n*t}function bce(e,t,n){n=n??1;const r=(e-(t||0))/n;return Math.exp(-.5*r*r)/(n*pVe)}function s9(e,t,n){t=t||0,n=n??1;const r=(e-t)/n,i=Math.abs(r);let o;if(i>37)o=0;else{const s=Math.exp(-i*i/2);let a;i<7.07106781186547?(a=.0352624965998911*i+.700383064443688,a=a*i+6.37396220353165,a=a*i+33.912866078383,a=a*i+112.079291497871,a=a*i+221.213596169931,a=a*i+220.206867912376,o=s*a,a=.0883883476483184*i+1.75566716318264,a=a*i+16.064177579207,a=a*i+86.7807322029461,a=a*i+296.564248779674,a=a*i+637.333633378831,a=a*i+793.826512519948,a=a*i+440.413735824752,o=o/a):(a=i+.65,a=i+4/a,a=i+3/a,a=i+2/a,a=i+1/a,o=s/a/2.506628274631)}return r>0?1-o:o}function a9(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*jrn*Frn(2*e-1)}function Frn(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function Oce(e,t){let n,r;const i={mean(o){return arguments.length?(n=o||0,i):n},stdev(o){return arguments.length?(r=o??1,i):r},sample:()=>o9(n,r),pdf:o=>bce(o,n,r),cdf:o=>s9(o,n,r),icdf:o=>a9(o,n,r)};return i.mean(e).stdev(t)}function xce(e,t){const n=Oce();let r=0;const i={data(o){return arguments.length?(e=o,r=o?o.length:0,i.bandwidth(t)):e},bandwidth(o){return arguments.length?(t=o,!t&&e&&(t=vce(e)),i):t},sample(){return e[~~(vf()*r)]+t*n.sample()},pdf(o){let s=0,a=0;for(;a<r;++a)s+=n.pdf((o-e[a])/t);return s/t/r},cdf(o){let s=0,a=0;for(;a<r;++a)s+=n.cdf((o-e[a])/t);return s/r},icdf(){throw Error("KDE icdf not supported.")}};return i.data(e)}function wce(e,t){return e=e||0,t=t??1,Math.exp(e+o9()*t)}function Sce(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;const r=(Math.log(e)-t)/n;return Math.exp(-.5*r*r)/(n*pVe*e)}function Ece(e,t,n){return s9(Math.log(e),t,n)}function Cce(e,t,n){return Math.exp(a9(e,t,n))}function gVe(e,t){let n,r;const i={mean(o){return arguments.length?(n=o||0,i):n},stdev(o){return arguments.length?(r=o??1,i):r},sample:()=>wce(n,r),pdf:o=>Sce(o,n,r),cdf:o=>Ece(o,n,r),icdf:o=>Cce(o,n,r)};return i.mean(e).stdev(t)}function mVe(e,t){let n=0,r;function i(s){const a=[];let l=0,c;for(c=0;c<n;++c)l+=a[c]=s[c]==null?1:+s[c];for(c=0;c<n;++c)a[c]/=l;return a}const o={weights(s){return arguments.length?(r=i(t=s||[]),o):t},distributions(s){return arguments.length?(s?(n=s.length,e=s):(n=0,e=[]),o.weights(t)):e},sample(){const s=vf();let a=e[n-1],l=r[0],c=0;for(;c<n-1;l+=r[++c])if(s<l){a=e[c];break}return a.sample()},pdf(s){let a=0,l=0;for(;l<n;++l)a+=r[l]*e[l].pdf(s);return a},cdf(s){let a=0,l=0;for(;l<n;++l)a+=r[l]*e[l].cdf(s);return a},icdf(){throw Error("Mixture icdf not supported.")}};return o.distributions(e).weights(t)}function _ce(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*vf()}function kce(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function $ce(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function Tce(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function yVe(e,t){let n,r;const i={min(o){return arguments.length?(n=o||0,i):n},max(o){return arguments.length?(r=o??1,i):r},sample:()=>_ce(n,r),pdf:o=>kce(o,n,r),cdf:o=>$ce(o,n,r),icdf:o=>Tce(o,n,r)};return t==null&&(t=e??1,e=0),i.min(e).max(t)}function Pce(e,t,n){let r=0,i=0;for(const o of e){const s=n(o);t(o)==null||s==null||isNaN(s)||(r+=(s-r)/++i)}return{coef:[r],predict:()=>r,rSquared:0}}function gD(e,t,n,r){const i=r-e*e,o=Math.abs(i)<1e-24?0:(n-e*t)/i;return[t-o*e,o]}function l9(e,t,n,r){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),r&&e.sort((h,p)=>t(h)-t(p));const i=e.length,o=new Float64Array(i),s=new Float64Array(i);let a=0,l=0,c=0,u,f,d;for(d of e)o[a]=u=+t(d),s[a]=f=+n(d),++a,l+=(u-l)/a,c+=(f-c)/a;for(a=0;a<i;++a)o[a]-=l,s[a]-=c;return[o,s,l,c]}function mD(e,t,n,r){let i=-1,o,s;for(const a of e)o=t(a),s=n(a),o!=null&&(o=+o)>=o&&s!=null&&(s=+s)>=s&&r(o,s,++i)}function C_(e,t,n,r,i){let o=0,s=0;return mD(e,t,n,(a,l)=>{const c=l-i(a),u=l-r;o+=c*c,s+=u*u}),1-o/s}function Ace(e,t,n){let r=0,i=0,o=0,s=0,a=0;mD(e,t,n,(u,f)=>{++a,r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=gD(r,i,o,s),c=u=>l[0]+l[1]*u;return{coef:l,predict:c,rSquared:C_(e,t,n,i,c)}}function vVe(e,t,n){let r=0,i=0,o=0,s=0,a=0;mD(e,t,n,(u,f)=>{++a,u=Math.log(u),r+=(u-r)/a,i+=(f-i)/a,o+=(u*f-o)/a,s+=(u*u-s)/a});const l=gD(r,i,o,s),c=u=>l[0]+l[1]*Math.log(u);return{coef:l,predict:c,rSquared:C_(e,t,n,i,c)}}function bVe(e,t,n){const[r,i,o,s]=l9(e,t,n);let a=0,l=0,c=0,u=0,f=0,d,h,p;mD(e,t,n,(O,m)=>{d=r[f++],h=Math.log(m),p=d*m,a+=(m*h-a)/f,l+=(p-l)/f,c+=(p*h-c)/f,u+=(d*p-u)/f});const[g,v]=gD(l/s,a/s,c/s,u/s),y=O=>Math.exp(g+v*(O-o));return{coef:[Math.exp(g-v*o),v],predict:y,rSquared:C_(e,t,n,s,y)}}function OVe(e,t,n){let r=0,i=0,o=0,s=0,a=0,l=0;mD(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++l,r+=(h-r)/l,i+=(p-i)/l,o+=(h*p-o)/l,s+=(h*h-s)/l,a+=(d-a)/l});const c=gD(r,i,o,s),u=f=>c[0]*Math.pow(f,c[1]);return c[0]=Math.exp(c[0]),{coef:c,predict:u,rSquared:C_(e,t,n,a,u)}}function Rce(e,t,n){const[r,i,o,s]=l9(e,t,n),a=r.length;let l=0,c=0,u=0,f=0,d=0,h,p,g,v;for(h=0;h<a;)p=r[h],g=i[h++],v=p*p,l+=(v-l)/h,c+=(v*p-c)/h,u+=(v*v-u)/h,f+=(p*g-f)/h,d+=(v*g-d)/h;const y=u-l*l,O=l*y-c*c,m=(d*l-f*c)/O,w=(f*y-d*c)/O,S=-m*l,E=C=>(C=C-o,m*C*C+w*C+S+s);return{coef:[S-w*o+m*o*o+s,w-2*m*o,m],predict:E,rSquared:C_(e,t,n,s,E)}}function xVe(e,t,n,r){if(r===0)return Pce(e,t,n);if(r===1)return Ace(e,t,n);if(r===2)return Rce(e,t,n);const[i,o,s,a]=l9(e,t,n),l=i.length,c=[],u=[],f=r+1;let d,h,p,g,v;for(d=0;d<f;++d){for(p=0,g=0;p<l;++p)g+=Math.pow(i[p],d)*o[p];for(c.push(g),v=new Float64Array(f),h=0;h<f;++h){for(p=0,g=0;p<l;++p)g+=Math.pow(i[p],d+h);v[h]=g}u.push(v)}u.push(c);const y=Qrn(u),O=m=>{m-=s;let w=a+y[0]+y[1]*m+y[2]*m*m;for(d=3;d<f;++d)w+=y[d]*Math.pow(m,d);return w};return{coef:zrn(f,y,-s,a),predict:O,rSquared:C_(e,t,n,a,O)}}function zrn(e,t,n,r){const i=Array(e);let o,s,a,l;for(o=0;o<e;++o)i[o]=0;for(o=e-1;o>=0;--o)for(a=t[o],l=1,i[o]+=a,s=1;s<=o;++s)l*=(o+1-s)/s,i[o-s]+=a*Math.pow(n,s)*l;return i[0]+=r,i}function Qrn(e){const t=e.length-1,n=[];let r,i,o,s,a;for(r=0;r<t;++r){for(s=r,i=r+1;i<t;++i)Math.abs(e[r][i])>Math.abs(e[r][s])&&(s=i);for(o=r;o<t+1;++o)a=e[o][r],e[o][r]=e[o][s],e[o][s]=a;for(i=r+1;i<t;++i)for(o=t;o>=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;i>=0;--i){for(a=0,o=i+1;o<t;++o)a+=e[o][i]*n[o];n[i]=(e[t][i]-a)/e[i][i]}return n}const oSe=2,sSe=1e-12;function wVe(e,t,n,r){const[i,o,s,a]=l9(e,t,n,!0),l=i.length,c=Math.max(2,~~(r*l)),u=new Float64Array(l),f=new Float64Array(l),d=new Float64Array(l).fill(1);for(let h=-1;++h<=oSe;){const p=[0,c-1];for(let v=0;v<l;++v){const y=i[v],O=p[0],m=p[1],w=y-i[O]>i[m]-y?O:m;let S=0,E=0,C=0,k=0,P=0;const D=1/Math.abs(i[w]-y||1);for(let A=O;A<=m;++A){const T=i[A],N=o[A],j=Brn(Math.abs(y-T)*D)*d[A],z=T*j;S+=j,E+=z,C+=N*j,k+=N*z,P+=T*z}const[M,L]=gD(E/S,C/S,k/S,P/S);u[v]=M+L*y,f[v]=Math.abs(o[v]-u[v]),Wrn(i,v+1,p)}if(h===oSe)break;const g=L8e(f);if(Math.abs(g)<sSe)break;for(let v=0,y,O;v<l;++v)y=f[v]/(6*g),d[v]=y>=1?sSe:(O=1-y*y)*O}return qrn(i,u,s,a)}function Brn(e){return(e=1-e*e*e)*e*e}function Wrn(e,t,n){const r=e[t];let i=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}function qrn(e,t,n,r){const i=e.length,o=[];let s=0,a=0,l=[],c;for(;s<i;++s)c=e[s]+n,l[0]===c?l[1]+=(t[s]-l[1])/++a:(a=0,l[1]+=r,l=[c,t[s]],o.push(l));return l[1]+=r,o}const Vrn=.5*Math.PI/180;function c9(e,t,n,r){n=n||25,r=Math.max(n,r||200);const i=g=>[g,e(g)],o=t[0],s=t[1],a=s-o,l=a/r,c=[i(o)],u=[];if(n===r){for(let g=1;g<r;++g)c.push(i(o+g/n*a));return c.push(i(s)),c}else{u.push(i(s));for(let g=n;--g>0;)u.push(i(o+g/n*a))}let f=c[0],d=u[u.length-1];const h=1/a,p=Urn(f[1],u);for(;d;){const g=i((f[0]+d[0])/2);g[0]-f[0]>=l&&Hrn(f,g,d,h,p)>Vrn?u.push(g):(f=d,c.push(d),u.pop()),d=u[u.length-1]}return c}function Urn(e,t){let n=e,r=e;const i=t.length;for(let o=0;o<i;++o){const s=t[o][1];s<n&&(n=s),s>r&&(r=s)}return 1/(r-n)}function Hrn(e,t,n,r,i){const o=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),s=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(o-s)}function Xrn(e){return t=>{const n=e.length;let r=1,i=String(e[0](t));for(;r<n;++r)i+="|"+e[r](t);return i}}function kK(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:Xrn(e)}function SVe(e,t,n){return n||e+(t?"_"+t:"")}const HV=()=>{},Zrn={init:HV,add:HV,rem:HV,idx:0},YP={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||e.min===void 0)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},yD=Object.keys(YP).filter(e=>e!=="__count__");function Yrn(e,t){return(n,r)=>an({name:e,aggregate_param:r,out:n||e},Zrn,t)}[...yD,"__count__"].forEach(e=>{YP[e]=Yrn(e,YP[e])});function EVe(e,t,n){return YP[e](n,t)}function CVe(e,t){return e.idx-t.idx}function Grn(e){const t={};e.forEach(r=>t[r.name]=r);const n=r=>{r.req&&r.req.forEach(i=>{t[i]||n(t[i]=YP[i]())})};return e.forEach(n),Object.values(t).sort(CVe)}function Krn(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function Jrn(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function ein(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function tin(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function _Ve(e,t){const n=t||Ba,r=Grn(e),i=e.slice().sort(CVe);function o(s){this._ops=r,this._out=i,this.cell=s,this.init()}return o.prototype.init=Krn,o.prototype.add=Jrn,o.prototype.rem=ein,o.prototype.set=tin,o.prototype.get=n,o.fields=e.map(s=>s.out),o}function Dce(e){this._key=e?hf(e):Dt,this.reset()}const Js=Dce.prototype;Js.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Js.add=function(e){this._add.push(e)};Js.rem=function(e){this._rem.push(e)};Js.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),s={};let a,l,c;for(a=0;a<i;++a)s[n(t[a])]=1;for(a=0,l=0;a<r;++a)s[n(c=e[a])]?s[n(c)]=0:o[l++]=c;return this._rem=[],this._add=o};Js.distinct=function(e){const t=this.values(),n={};let r=t.length,i=0,o;for(;--r>=0;)o=e(t[r])+"",Nt(n,o)||(n[o]=1,++i);return i};Js.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=v8e(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Js.argmin=function(e){return this.extent(e)[0]||{}};Js.argmax=function(e){return this.extent(e)[1]||{}};Js.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Js.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Js.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=yce(this.values(),e),this._get=e),this._q};Js.q1=function(e){return this.quartile(e)[0]};Js.q2=function(e){return this.quartile(e)[1]};Js.q3=function(e){return this.quartile(e)[2]};Js.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=dVe(this.values(),1e3,.05,e),this._get=e),this._ci};Js.ci0=function(e){return this.ci(e)[0]};Js.ci1=function(e){return this.ci(e)[1]};function W0(e){De.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}W0.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:yD},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};Ke(W0,De,{transform(e,t){const n=this,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.modified();return n.stamp=r.stamp,n.value&&(i||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(e):Object.create(null),t.visit(t.SOURCE,o=>n.add(o))):(n.value=n.value||n.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),r.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&r.clean(!0).runAfter(()=>this.clean()),n.changes(r)},cross(){const e=this,t=e.value,n=e._dnames,r=n.map(()=>({})),i=n.length;function o(a){let l,c,u,f;for(l in a)for(u=a[l].tuple,c=0;c<i;++c)r[c][f=u[n[c]]]=f}o(e._prev),o(t);function s(a,l,c){const u=n[c],f=r[c++];for(const d in f){const h=a?a+"|"+d:d;l[u]=f[d],c<i?s(h,l,c):t[h]||e.cell(h,l)}}s("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],r={};function i(O){const m=ct(Ma(O)),w=m.length;let S=0,E;for(;S<w;++S)r[E=m[S]]||(r[E]=1,t.push(E))}this._dims=ct(e.groupby),this._dnames=this._dims.map(O=>{const m=Zi(O);return i(O),n.push(m),m}),this.cellkey=e.key?e.key:kK(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const o=e.fields||[null],s=e.ops||["count"],a=e.aggregate_params||[null],l=e.as||[],c=o.length,u={};let f,d,h,p,g,v,y;for(c!==s.length&&Le("Unmatched number of fields and aggregate ops."),y=0;y<c;++y){if(f=o[y],d=s[y],h=a[y]||null,f==null&&d!=="count"&&Le("Null aggregate field specified."),g=Zi(f),v=SVe(d,g,l[y]),n.push(v),d==="count"){this._counts.push(v);continue}p=u[g],p||(i(f),p=u[g]=[],p.field=f,this._measures.push(p)),d!=="count"&&(this._countOnly=!1),p.push(EVe(d,h,v))}return this._measures=this._measures.map(O=>_Ve(O,O.field)),Object.create(null)},cellkey:kK(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const r=this._measures,i=r.length;n.agg=Array(i);for(let o=0;o<i;++o)n.agg[o]=new r[o](n)}return n.store&&(n.data=new Dce),n},newtuple(e,t){const n=this._dnames,r=this._dims,i=r.length,o={};for(let s=0;s<i;++s)o[n[s]]=r[s](e);return t?iVe(t.tuple,o):dr(o)},clean(){const e=this.value;for(const t in e)e[t].num===0&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const r=n.agg;for(let i=0,o=r.length;i<o;++i)r[i].add(r[i].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const r=n.agg;for(let i=0,o=r.length;i<o;++i)r[i].rem(r[i].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let r=0,i=n.length;r<i;++r)t[n[r]]=e.num;if(!this._countOnly){const r=e.agg;for(let i=0,o=r.length;i<o;++i)r[i].set(t)}return t},changes(e){const t=this._adds,n=this._mods,r=this._prev,i=this._drop,o=e.add,s=e.rem,a=e.mod;let l,c,u,f;if(r)for(c in r)l=r[c],(!i||l.num)&&s.push(l.tuple);for(u=0,f=this._alen;u<f;++u)o.push(this.celltuple(t[u])),t[u]=null;for(u=0,f=this._mlen;u<f;++u)l=n[u],(l.num===0&&i?s:a).push(this.celltuple(l)),n[u]=null;return this._alen=this._mlen=0,this._prev=null,e}});const nin=1e-14;function Mce(e){De.call(this,null,e)}Mce.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};Ke(Mce,De,{transform(e,t){const n=e.interval!==!1,r=this._bins(e),i=r.start,o=r.step,s=e.as||["bin0","bin1"],a=s[0],l=s[1];let c;return e.modified()?(t=t.reflow(!0),c=t.SOURCE):c=t.modified(Ma(e.field))?t.ADD_MOD:t.ADD,t.visit(c,n?u=>{const f=r(u);u[a]=f,u[l]=f==null?null:i+o*(1+(f-i)/o)}:u=>u[a]=r(u)),t.modifies(n?s:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=fVe(e),r=n.step;let i=n.start,o=i+Math.ceil((n.stop-i)/r)*r,s,a;(s=e.anchor)!=null&&(a=s-(i+r*Math.floor((s-i)/r)),i+=a,o+=a);const l=function(c){let u=$a(t(c));return u==null?null:u<i?-1/0:u>o?1/0:(u=Math.max(i,Math.min(u,o-r)),i+r*Math.floor(nin+(u-i)/r))};return l.start=i,l.stop=n.stop,l.step=r,this.value=yc(l,Ma(t),e.name||"bin_"+Zi(t))}});function kVe(e,t,n){const r=e;let i=t||[],o=n||[],s={},a=0;return{add:l=>o.push(l),remove:l=>s[r(l)]=++a,size:()=>i.length,data:(l,c)=>(a&&(i=i.filter(u=>!s[r(u)]),s={},a=0),c&&l&&i.sort(l),o.length&&(i=l?E8e(l,i,o.sort(l)):i.concat(o),o=[]),i)}}function Nce(e){De.call(this,[],e)}Nce.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};Ke(Nce,De,{transform(e,t){const n=t.fork(t.ALL),r=kVe(Dt,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(ox(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function $Ve(e){Vr.call(this,null,rin,e)}Ke($Ve,Vr);function rin(e){return this.value&&!e.modified()?this.value:Cae(e.fields,e.orders)}function Ice(e){De.call(this,null,e)}Ice.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function iin(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}Ke(Ice,De,{transform(e,t){const n=f=>d=>{for(var h=iin(a(d),e.case,o)||[],p,g=0,v=h.length;g<v;++g)s.test(p=h[g])||f(p)},r=this._parameterCheck(e,t),i=this._counts,o=this._match,s=this._stop,a=e.field,l=e.as||["text","count"],c=n(f=>i[f]=1+(i[f]||0)),u=n(f=>i[f]-=1);return r?t.visit(t.SOURCE,c):(t.visit(t.ADD,c),t.visit(t.REM,u)),this._finish(t,l)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],s=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,l,c;for(a in n)l=r[a],c=n[a]||0,!l&&c?(r[a]=l=dr({}),l[i]=a,l[o]=c,s.add.push(l)):c===0?(l&&s.rem.push(l),n[a]=null,r[a]=null):l[o]!==c&&(l[o]=c,s.mod.push(l));return s.modifies(t)}});function Lce(e){De.call(this,null,e)}Lce.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};Ke(Lce,De,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],s=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return s?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=oin(a,i,o,e.filter||pf)):n.mod=a,n.source=this.value,n.modifies(r)}});function oin(e,t,n,r){for(var i=[],o={},s=e.length,a=0,l,c;a<s;++a)for(o[t]=c=e[a],l=0;l<s;++l)o[n]=e[l],r(o)&&(i.push(dr(o)),o={},o[t]=c);return i}const aSe={kde:xce,mixture:mVe,normal:Oce,lognormal:gVe,uniform:yVe},sin="distributions",lSe="function",ain="field";function TVe(e,t){const n=e[lSe];Nt(aSe,n)||Le("Unknown distribution function: "+n);const r=aSe[n]();for(const i in e)i===ain?r.data((e.from||t()).map(e[i])):i===sin?r[i](e[i].map(o=>TVe(o,t))):typeof r[i]===lSe&&r[i](e[i]);return r}function jce(e){De.call(this,null,e)}const PVe=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],lin={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:PVe},{name:"weights",type:"number",array:!0}]};jce.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:PVe.concat(lin)},{name:"as",type:"string",array:!0,default:["value","density"]}]};Ke(jce,De,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=TVe(e.distribution,cin(t)),i=e.steps||e.minsteps||25,o=e.steps||e.maxsteps||200;let s=e.method||"pdf";s!=="pdf"&&s!=="cdf"&&Le("Invalid density method: "+s),!e.extent&&!r.data&&Le("Missing density extent parameter."),s=r[s];const a=e.as||["value","density"],l=e.extent||rp(r.data()),c=c9(s,l,i,o).map(u=>{const f={};return f[a[0]]=u[0],f[a[1]]=u[1],dr(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});function cin(e){return()=>e.materialize(e.SOURCE).source}function AVe(e,t){return e?e.map((n,r)=>t[r]||Zi(n)):null}function Fce(e,t,n){const r=[],i=f=>f(l);let o,s,a,l,c,u;if(t==null)r.push(e.map(n));else for(o={},s=0,a=e.length;s<a;++s)l=e[s],c=t.map(i),u=o[c],u||(o[c]=u=[],u.dims=c,r.push(u)),u.push(n(l));return r}const RVe="bin";function zce(e){De.call(this,null,e)}zce.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:RVe}]};const uin=(e,t)=>eD(rp(e,t))/30;Ke(zce,De,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,r=Fce(t.source,e.groupby,Ba),i=e.smooth||!1,o=e.field,s=e.step||uin(n,o),a=ox((p,g)=>o(p)-o(g)),l=e.as||RVe,c=r.length;let u=1/0,f=-1/0,d=0,h;for(;d<c;++d){const p=r[d].sort(a);h=-1;for(const g of hVe(p,s,i,o))g<u&&(u=g),g>f&&(f=g),p[++h][l]=g}return this.value={start:u,stop:f,step:s},t.reflow(!0).modifies(l)}});function DVe(e){Vr.call(this,null,fin,e),this.modified(!0)}Ke(DVe,Vr);function fin(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:yc(n=>t(n,e),Ma(t),Zi(t))}function Qce(e){De.call(this,[void 0,void 0],e)}Qce.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};Ke(Qce,De,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],s=n[1];if((i||o==null)&&(o=1/0,s=-1/0),t.visit(i?t.SOURCE:t.ADD,a=>{const l=$a(r(a));l!=null&&(l<o&&(o=l),l>s&&(s=l))}),!Number.isFinite(o)||!Number.isFinite(s)){let a=Zi(r);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${o}, ${s}]`),o=s=void 0}this.value=[o,s]}});function Bce(e,t){Vr.call(this,e),this.parent=t,this.count=0}Ke(Bce,Vr,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function u9(e){De.call(this,{},e),this._keys=u_();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let r=0,i=t.active;r<i;++r)n(t[r],r,t)}}Ke(u9,De,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){const i=this.value;let o=Nt(i,e)&&i[e],s,a;return o?o.value.stamp<n.stamp&&(o.init(n),this.activate(o)):(a=r||(a=this._group[e])&&a.tuple,s=n.dataflow,o=new Bce(n.fork(n.NO_SOURCE),this),s.add(o).connect(t(s,e,a)),i[e]=o,this.activate(o)),o},clean(){const e=this.value;let t=0;for(const n in e)if(e[n].count===0){const r=e[n].detachSubflow;r&&r(),delete e[n],++t}if(t){const n=this._targets.filter(r=>r&&r.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,r=e?e.length:0;let i=0;for(;i<r;++i)t[i]=e[i];for(;i<n&&t[i]!=null;++i)t[i]=null;t.active=r},transform(e,t){const n=t.dataflow,r=e.key,i=e.subflow,o=this._keys,s=e.modified("key"),a=l=>this.subflow(l,i,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,l=>{const c=Dt(l),u=o.get(c);u!==void 0&&(o.delete(c),a(u).rem(l))}),t.visit(t.ADD,l=>{const c=r(l);o.set(Dt(l),c),a(c).add(l)}),s||t.modified(r.fields)?t.visit(t.MOD,l=>{const c=Dt(l),u=o.get(c),f=r(l);u===f?a(f).mod(l):(o.set(c,f),a(u).rem(l),a(f).add(l))}):t.changed(t.MOD)&&t.visit(t.MOD,l=>{a(o.get(Dt(l))).mod(l)}),s&&t.visit(t.REFLOW,l=>{const c=Dt(l),u=o.get(c),f=r(l);u!==f&&(o.set(c,f),a(u).rem(l),a(f).add(l))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}});function MVe(e){Vr.call(this,null,din,e)}Ke(MVe,Vr);function din(e){return this.value&&!e.modified()?this.value:ze(e.name)?ct(e.name).map(t=>hf(t)):hf(e.name,e.as)}function Wce(e){De.call(this,u_(),e)}Wce.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};Ke(Wce,De,{transform(e,t){const n=t.dataflow,r=this.value,i=t.fork(),o=i.add,s=i.rem,a=i.mod,l=e.expr;let c=!0;t.visit(t.REM,f=>{const d=Dt(f);r.has(d)?r.delete(d):s.push(f)}),t.visit(t.ADD,f=>{l(f,e)?o.push(f):r.set(Dt(f),1)});function u(f){const d=Dt(f),h=l(f,e),p=r.get(d);h&&p?(r.delete(d),o.push(f)):!h&&!p?(r.set(d,1),s.push(f)):c&&h&&!p&&a.push(f)}return t.visit(t.MOD,u),e.modified()&&(c=!1,t.visit(t.REFLOW,u)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}});function qce(e){De.call(this,[],e)}qce.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};Ke(qce,De,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=AVe(r,e.as||[]),o=e.index||null,s=i.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const l=r.map(p=>p(a)),c=l.reduce((p,g)=>Math.max(p,g.length),0);let u=0,f,d,h;for(;u<c;++u){for(d=hce(a),f=0;f<s;++f)d[i[f]]=(h=l[f][u])==null?null:h;o&&(d[o]=u),n.add.push(d)}}),this.value=n.source=n.add,o&&n.modifies(o),n.modifies(i)}});function Vce(e){De.call(this,[],e)}Vce.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]};Ke(Vce,De,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=r.map(Zi),o=e.as||["key","value"],s=o[0],a=o[1],l=r.length;return n.rem=this.value,t.visit(t.SOURCE,c=>{for(let u=0,f;u<l;++u)f=hce(c),f[s]=i[u],f[a]=r[u](c),n.add.push(f)}),this.value=n.source=n.add,n.modifies(o)}});function Uce(e){De.call(this,null,e)}Uce.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};Ke(Uce,De,{transform(e,t){const n=e.expr,r=e.as,i=e.modified(),o=e.initonly?t.ADD:i?t.SOURCE:t.modified(n.fields)||t.modified(r)?t.ADD_MOD:t.ADD;return i&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(r),t.visit(o,s=>s[r]=n(s,e))}});function NVe(e){De.call(this,[],e)}Ke(NVe,De,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i=this.value,o=e.size-i.length,s,a,l;if(o>0){for(s=[];--o>=0;)s.push(l=dr(r(e))),i.push(l);n.add=n.add.length?n.materialize(n.ADD).add.concat(s):s}else a=i.slice(0,-o),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,i=i.slice(-o);return n.source=this.value=i,n}});const UN={value:"value",median:L8e,mean:rQt,min:MG,max:ob},hin=[];function Hce(e){De.call(this,[],e)}Hce.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function pin(e){var t=e.method||UN.value,n;if(UN[t]==null)Le("Unrecognized imputation method: "+t);else return t===UN.value?(n=e.value!==void 0?e.value:0,()=>n):UN[t]}function gin(e){const t=e.field;return n=>n?t(n):NaN}Ke(Hce,De,{transform(e,t){var n=t.fork(t.ALL),r=pin(e),i=gin(e),o=Zi(e.field),s=Zi(e.key),a=(e.groupby||[]).map(Zi),l=min(t.source,e.groupby,e.key,e.keyvals),c=[],u=this.value,f=l.domain.length,d,h,p,g,v,y,O,m,w,S;for(v=0,m=l.length;v<m;++v)for(d=l[v],p=d.values,h=NaN,O=0;O<f;++O)if(d[O]==null){for(g=l.domain[O],S={_impute:!0},y=0,w=p.length;y<w;++y)S[a[y]]=p[y];S[s]=g,S[o]=Number.isNaN(h)?h=r(d,i):h,c.push(dr(S))}return c.length&&(n.add=n.materialize(n.ADD).add.concat(c)),u.length&&(n.rem=n.materialize(n.REM).rem.concat(u)),this.value=c,n}});function min(e,t,n,r){var i=y=>y(v),o=[],s=r?r.slice():[],a={},l={},c,u,f,d,h,p,g,v;for(s.forEach((y,O)=>a[y]=O+1),d=0,g=e.length;d<g;++d)v=e[d],p=n(v),h=a[p]||(a[p]=s.push(p)),u=(c=t?t.map(i):hin)+"",(f=l[u])||(f=l[u]=[],o.push(f),f.values=c),f[h-1]=v;return o.domain=s,o}function Xce(e){W0.call(this,e)}Xce.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:yD},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};Ke(Xce,W0,{transform(e,t){const n=this,r=e.modified();let i;return n.value&&(r||t.modified(n._inputs,!0))?(i=n.value=r?n.init(e):{},t.visit(t.SOURCE,o=>n.add(o))):(i=n.value=n.value||this.init(e),t.visit(t.REM,o=>n.rem(o)),t.visit(t.ADD,o=>n.add(o))),n.changes(),t.visit(t.SOURCE,o=>{an(o,i[n.cellkey(o)].tuple)}),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n<r;++n)this.celltuple(e[n]),e[n]=null;for(n=0,r=this._mlen;n<r;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function Zce(e){De.call(this,null,e)}Zce.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]};Ke(Zce,De,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=t.materialize(t.SOURCE).source,i=Fce(r,e.groupby,e.field),o=(e.groupby||[]).map(Zi),s=e.bandwidth,a=e.cumulative?"cdf":"pdf",l=e.as||["value","density"],c=[];let u=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;a!=="pdf"&&a!=="cdf"&&Le("Invalid density method: "+a),e.resolve==="shared"&&(u||(u=rp(r,e.field)),f=d=e.steps||d),i.forEach(h=>{const p=xce(h,s)[a],g=e.counts?h.length:1,v=u||rp(h);c9(p,v,f,d).forEach(y=>{const O={};for(let m=0;m<o.length;++m)O[o[m]]=h.dims[m];O[l[0]]=y[0],O[l[1]]=y[1]*g,c.push(dr(O))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=c}return n}});function IVe(e){Vr.call(this,null,yin,e)}Ke(IVe,Vr);function yin(e){return this.value&&!e.modified()?this.value:kae(e.fields,e.flat)}function LVe(e){De.call(this,[],e),this._pending=null}Ke(LVe,De,{transform(e,t){const n=t.dataflow;return this._pending?XV(this,t,this._pending):vin(e)?t.StopPropagation:e.values?XV(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(i=>(this._pending=ct(i.data),o=>o.touch(this)))}:n.request(e.url,e.format).then(r=>XV(this,t,ct(r.data)))}});function vin(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function XV(e,t,n){n.forEach(dr);const r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function Yce(e){De.call(this,{},e)}Yce.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};Ke(Yce,De,{transform(e,t){const n=e.fields,r=e.index,i=e.values,o=e.default==null?null:e.default,s=e.modified(),a=n.length;let l=s?t.SOURCE:t.ADD,c=t,u=e.as,f,d,h;return i?(d=i.length,a>1&&!u&&Le('Multi-field lookup requires explicit "as" parameter.'),u&&u.length!==a*d&&Le('The "as" parameter has too few output field names.'),u=u||i.map(Zi),f=function(p){for(var g=0,v=0,y,O;g<a;++g)if(O=r.get(n[g](p)),O==null)for(y=0;y<d;++y,++v)p[u[v]]=o;else for(y=0;y<d;++y,++v)p[u[v]]=i[y](O)}):(u||Le("Missing output field names."),f=function(p){for(var g=0,v;g<a;++g)v=r.get(n[g](p)),p[u[g]]=v??o}),s?c=t.reflow(!0):(h=n.some(p=>t.modified(p.fields)),l|=h?t.MOD:0),t.visit(l,f),c.modifies(u)}});function jVe(e){Vr.call(this,null,bin,e)}Ke(jVe,Vr);function bin(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let r=1/0,i=-1/0,o,s;for(o=0;o<n;++o)s=t[o],s[0]<r&&(r=s[0]),s[1]>i&&(i=s[1]);return[r,i]}function FVe(e){Vr.call(this,null,Oin,e)}Ke(FVe,Vr);function Oin(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function zVe(e){De.call(this,null,e)}Ke(zVe,De,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Gce(e){W0.call(this,e)}Gce.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:yD,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};Ke(Gce,W0,{_transform:W0.prototype.transform,transform(e,t){return this._transform(xin(e,t),t)}});function xin(e,t){const n=e.field,r=e.value,i=(e.op==="count"?"__count__":e.op)||"sum",o=Ma(n).concat(Ma(r)),s=Sin(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:s.map(()=>i),fields:s.map(a=>win(a,n,r,o)),as:s.map(a=>a+""),modified:e.modified.bind(e)}}function win(e,t,n,r){return yc(i=>t(i)===e?n(i):NaN,r,e+"")}function Sin(e,t,n){const r={},i=[];return n.visit(n.SOURCE,o=>{const s=e(o);r[s]||(r[s]=1,i.push(s))}),i.sort(u8),t?i.slice(0,t):i}function QVe(e){u9.call(this,e)}Ke(QVe,u9,{transform(e,t){const n=e.subflow,r=e.field,i=o=>this.subflow(Dt(o),n,t,o);return(e.modified("field")||r&&t.modified(Ma(r)))&&Le("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,o=>{const s=i(o);r(o).forEach(a=>s.mod(a))}),t.visit(t.ADD,o=>{const s=i(o);r(o).forEach(a=>s.add(dr(a)))}),t.visit(t.REM,o=>{const s=i(o);r(o).forEach(a=>s.rem(a))})):(t.visit(t.MOD,o=>i(o).mod(o)),t.visit(t.ADD,o=>i(o).add(o)),t.visit(t.REM,o=>i(o).rem(o))),t.clean()&&t.runAfter(()=>this.clean()),t}});function Kce(e){De.call(this,null,e)}Kce.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};Ke(Kce,De,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=AVe(e.fields,e.as||[]),o=r?(a,l)=>Ein(a,l,r,i):n9;let s;return this.value?s=this.value:(t=t.addAll(),s=this.value={}),t.visit(t.REM,a=>{const l=Dt(a);n.rem.push(s[l]),s[l]=null}),t.visit(t.ADD,a=>{const l=o(a,dr({}));s[Dt(a)]=l,n.add.push(l)}),t.visit(t.MOD,a=>{n.mod.push(o(a,s[Dt(a)]))}),n}});function Ein(e,t,n,r){for(let i=0,o=n.length;i<o;++i)t[r[i]]=n[i](e);return t}function BVe(e){De.call(this,null,e)}Ke(BVe,De,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function Jce(e){De.call(this,null,e)}Jce.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};const Cin=1e-14;Ke(Jce,De,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const i=t.materialize(t.SOURCE).source,o=Fce(i,e.groupby,e.field),s=(e.groupby||[]).map(Zi),a=[],l=e.step||.01,c=e.probs||Qc(l/2,1-Cin,l),u=c.length;return o.forEach(f=>{const d=mce(f,c);for(let h=0;h<u;++h){const p={};for(let g=0;g<s.length;++g)p[s[g]]=f.dims[g];p[r[0]]=c[h],p[r[1]]=d[h],a.push(dr(p))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function WVe(e){De.call(this,null,e)}Ke(WVe,De,{transform(e,t){let n,r;return this.value?r=this.value:(n=t=t.addAll(),r=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,i=>{const o=Dt(i);n.rem.push(r[o]),r[o]=null}),t.visit(t.ADD,i=>{const o=hce(i);r[Dt(i)]=o,n.add.push(o)}),t.visit(t.MOD,i=>{const o=r[Dt(i)];for(const s in i)o[s]=i[s],n.modifies(s);n.mod.push(o)})),n}});function eue(e){De.call(this,[],e),this.count=0}eue.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};Ke(eue,De,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.modified("size"),i=e.size,o=this.value.reduce((u,f)=>(u[Dt(f)]=1,u),{});let s=this.value,a=this.count,l=0;function c(u){let f,d;s.length<i?s.push(u):(d=~~((a+1)*vf()),d<s.length&&d>=l&&(f=s[d],o[Dt(f)]&&n.rem.push(f),s[d]=u)),++a}if(t.rem.length&&(t.visit(t.REM,u=>{const f=Dt(u);o[f]&&(o[f]=-1,n.rem.push(u)),--a}),s=s.filter(u=>o[Dt(u)]!==-1)),(t.rem.length||r)&&s.length<i&&t.source&&(l=a=s.length,t.visit(t.SOURCE,u=>{o[Dt(u)]||c(u)}),l=-1),r&&s.length>i){const u=s.length-i;for(let f=0;f<u;++f)o[Dt(s[f])]=-1,n.rem.push(s[f]);s=s.slice(u)}return t.mod.length&&t.visit(t.MOD,u=>{o[Dt(u)]&&n.mod.push(u)}),t.add.length&&t.visit(t.ADD,c),(t.add.length||l<0)&&(n.add=s.filter(u=>!o[Dt(u)])),this.count=a,this.value=n.source=s,n}});function tue(e){De.call(this,null,e)}tue.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};Ke(tue,De,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Qc(e.start,e.stop,e.step||1).map(i=>{const o={};return o[r]=i,dr(o)}),n.add=t.add.concat(this.value),n}});function qVe(e){De.call(this,null,e),this.modified(!0)}Ke(qVe,De,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function nue(e){De.call(this,null,e)}const VVe=["unit0","unit1"];nue.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Mae,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:VVe}]};Ke(nue,De,{transform(e,t){const n=e.field,r=e.interval!==!1,i=e.timezone==="utc",o=this._floor(e,t),s=(i?g_:p_)(o.unit).offset,a=e.as||VVe,l=a[0],c=a[1],u=o.step;let f=o.start||1/0,d=o.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(Ma(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let v,y;g==null?(p[l]=null,r&&(p[c]=null)):(p[l]=v=y=o(g),r&&(p[c]=y=s(v,u)),v<f&&(f=v),y>d&&(d=y))}),o.start=f,o.stop=d,t.modifies(r?a:l)},_floor(e,t){const n=e.timezone==="utc",{units:r,step:i}=e.units?{units:e.units,step:e.step||1}:f9e({extent:e.extent||rp(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),o=Nae(r),s=this.value||{},a=(n?n9e:t9e)(o,i);return a.unit=jn(o),a.units=o,a.step=i,a.start=s.start,a.stop=s.stop,this.value=a}});function UVe(e){De.call(this,u_(),e)}Ke(UVe,De,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=a=>i.set(r(a),a);let s=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,a=>i.delete(r(a))),t.visit(t.ADD,o)):s=!1,this.modified(s),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}});function HVe(e){De.call(this,null,e)}Ke(HVe,De,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(ox(e.sort)):t.source).map(e.field))}});function _in(e,t,n,r){const i=GP[e](t,n);return{init:i.init||my,update:function(o,s){s[r]=i.next(o)}}}const GP={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,r=t.data;return n&&t.compare(r[n-1],r[n])?++e:e}}},percent_rank:function(){const e=GP.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,r=t.compare;let i=t.index;if(e<i){for(;i+1<n.length&&!r(n[i],n[i+1]);)++i;e=i}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||Le("ntile num must be greater than zero.");const n=GP.cume_dist(),r=n.next;return{init:n.init,next:i=>Math.ceil(t*r(i))}},lag:function(e,t){return t=+t||1,{next:n=>{const r=n.index-t;return r>=0?e(n.data[r]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const r=n.index+t,i=n.data;return r<i.length?e(i[r]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||Le("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(t-1);return r<n.i1?e(n.data[r]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const r=e(n.data[n.index]);return r!=null?t=r:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:r=>{const i=r.data;return r.index<=n?t:(n=kin(e,i,r.index))<0?(n=i.length,t=null):t=e(i[n])}}}};function kin(e,t,n){for(let r=t.length;n<r;++n)if(e(t[n])!=null)return n;return-1}const $in=Object.keys(GP);function XVe(e){const t=ct(e.ops),n=ct(e.fields),r=ct(e.params),i=ct(e.aggregate_params),o=ct(e.as),s=this.outputs=[],a=this.windows=[],l={},c={},u=[],f=[];let d=!0;function h(p){ct(Ma(p)).forEach(g=>l[g]=1)}h(e.sort),t.forEach((p,g)=>{const v=n[g],y=r[g],O=i[g]||null,m=Zi(v),w=SVe(p,m,o[g]);if(h(v),s.push(w),Nt(GP,p))a.push(_in(p,v,y,w));else{if(v==null&&p!=="count"&&Le("Null aggregate field specified."),p==="count"){u.push(w);return}d=!1;let S=c[m];S||(S=c[m]=[],S.field=v,f.push(S)),S.push(EVe(p,O,w))}}),(u.length||f.length)&&(this.cell=Tin(f,u,d)),this.inputs=Object.keys(l)}const ZVe=XVe.prototype;ZVe.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};ZVe.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let s;if(n){for(s=e.p0;s<e.i0;++s)n.rem(i[s]);for(s=e.p1;s<e.i1;++s)n.add(i[s]);n.set(t)}for(s=0;s<o;++s)r[s].update(e,t)};function Tin(e,t,n){e=e.map(l=>_Ve(l,l.field));const r={num:0,agg:null,store:!1,count:t};if(!n)for(var i=e.length,o=r.agg=Array(i),s=0;s<i;++s)o[s]=new e[s](r);if(r.store)var a=r.data=new Dce;return r.add=function(l){if(r.num+=1,!n){a&&a.add(l);for(let c=0;c<i;++c)o[c].add(o[c].get(l),l)}},r.rem=function(l){if(r.num-=1,!n){a&&a.rem(l);for(let c=0;c<i;++c)o[c].rem(o[c].get(l),l)}},r.set=function(l){let c,u;for(a&&a.values(),c=0,u=t.length;c<u;++c)l[t[c]]=r.num;if(!n)for(c=0,u=o.length;c<u;++c)o[c].set(l)},r.init=function(){r.num=0,a&&a.reset();for(let l=0;l<i;++l)o[l].init()},r}function rue(e){De.call(this,{},e),this._mlen=0,this._mods=[]}rue.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:$in.concat(yD)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};Ke(rue,De,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),r=ox(e.sort),i=kK(e.groupby),o=a=>this.group(i(a));let s=this.state;(!s||n)&&(s=this.state=new XVe(e)),n||t.modified(s.inputs)?(this.value={},t.visit(t.SOURCE,a=>o(a).add(a))):(t.visit(t.REM,a=>o(a).remove(a)),t.visit(t.ADD,a=>o(a).add(a)));for(let a=0,l=this._mlen;a<l;++a)Pin(this._mods[a],s,r,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(s.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=kVe(Dt),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function Pin(e,t,n,r){const i=r.sort,o=i&&!r.ignorePeers,s=r.frame||[null,0],a=e.data(n),l=a.length,c=o?f_(i):null,u={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:i||Wa(-1)};t.init();for(let f=0;f<l;++f)Ain(u,s,f,l),o&&Rin(u,c),t.update(u,a[f])}function Ain(e,t,n,r){e.p0=e.i0,e.p1=e.i1,e.i0=t[0]==null?0:Math.max(0,n-Math.abs(t[0])),e.i1=t[1]==null?r:Math.min(r,n+Math.abs(t[1])+1),e.index=n}function Rin(e,t){const n=e.i0,r=e.i1-1,i=e.compare,o=e.data,s=o.length-1;n>0&&!i(o[n],o[n-1])&&(e.i0=t.left(o,o[n])),r<s&&!i(o[r],o[r+1])&&(e.i1=t.right(o,o[r]))}const Din=Object.freeze(Object.defineProperty({__proto__:null,aggregate:W0,bin:Mce,collect:Nce,compare:$Ve,countpattern:Ice,cross:Lce,density:jce,dotbin:zce,expression:DVe,extent:Qce,facet:u9,field:MVe,filter:Wce,flatten:qce,fold:Vce,formula:Uce,generate:NVe,impute:Hce,joinaggregate:Xce,kde:Zce,key:IVe,load:LVe,lookup:Yce,multiextent:jVe,multivalues:FVe,params:zVe,pivot:Gce,prefacet:QVe,project:Kce,proxy:BVe,quantile:Jce,relay:WVe,sample:eue,sequence:tue,sieve:qVe,subflow:Bce,timeunit:nue,tupleindex:UVe,values:HVe,window:rue},Symbol.toStringTag,{value:"Module"}));function mr(e){return function(){return e}}const cSe=Math.abs,sa=Math.atan2,Uv=Math.cos,Min=Math.max,ZV=Math.min,rh=Math.sin,W1=Math.sqrt,ha=1e-12,IE=Math.PI,xF=IE/2,YVe=2*IE;function Nin(e){return e>1?0:e<-1?IE:Math.acos(e)}function uSe(e){return e>=1?xF:e<=-1?-xF:Math.asin(e)}const $K=Math.PI,TK=2*$K,g1=1e-6,Iin=TK-g1;function GVe(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Lin(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return GVe;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let iue=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?GVe:Lin(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+s}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let s=this._x1,a=this._y1,l=r-t,c=i-n,u=s-t,f=a-n,d=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>g1)if(!(Math.abs(f*l-c*u)>g1)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-s,p=i-a,g=l*l+c*c,v=h*h+p*p,y=Math.sqrt(g),O=Math.sqrt(d),m=o*Math.tan(($K-Math.acos((g+d-v)/(2*y*O)))/2),w=m/O,S=m/y;Math.abs(w-1)>g1&&this._append`L${t+w*u},${n+w*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=t+S*l},${this._y1=n+S*c}`}}arc(t,n,r,i,o,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),l=r*Math.sin(i),c=t+a,u=n+l,f=1^s,d=s?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>g1||Math.abs(this._y1-u)>g1)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%TK+TK),d>Iin?this._append`A${r},${r},0,1,${f},${t-a},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>g1&&this._append`A${r},${r},0,${+(d>=$K)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function f9(){return new iue}f9.prototype=iue.prototype;function d9(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new iue(t)}function jin(e){return e.innerRadius}function Fin(e){return e.outerRadius}function zin(e){return e.startAngle}function Qin(e){return e.endAngle}function Bin(e){return e&&e.padAngle}function Win(e,t,n,r,i,o,s,a){var l=n-e,c=r-t,u=s-i,f=a-o,d=f*l-u*c;if(!(d*d<ha))return d=(u*(t-o)-f*(e-i))/d,[e+d*l,t+d*c]}function HN(e,t,n,r,i,o,s){var a=e-n,l=t-r,c=(s?o:-o)/W1(a*a+l*l),u=c*l,f=-c*a,d=e+u,h=t+f,p=n+u,g=r+f,v=(d+p)/2,y=(h+g)/2,O=p-d,m=g-h,w=O*O+m*m,S=i-o,E=d*g-p*h,C=(m<0?-1:1)*W1(Min(0,S*S*w-E*E)),k=(E*m-O*C)/w,P=(-E*O-m*C)/w,D=(E*m+O*C)/w,M=(-E*O+m*C)/w,L=k-v,A=P-y,T=D-v,N=M-y;return L*L+A*A>T*T+N*N&&(k=D,P=M),{cx:k,cy:P,x01:-u,y01:-f,x11:k*(i/S-1),y11:P*(i/S-1)}}function qin(){var e=jin,t=Fin,n=mr(0),r=null,i=zin,o=Qin,s=Bin,a=null,l=d9(c);function c(){var u,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=i.apply(this,arguments)-xF,g=o.apply(this,arguments)-xF,v=cSe(g-p),y=g>p;if(a||(a=u=l()),h<d&&(f=h,h=d,d=f),!(h>ha))a.moveTo(0,0);else if(v>YVe-ha)a.moveTo(h*Uv(p),h*rh(p)),a.arc(0,0,h,p,g,!y),d>ha&&(a.moveTo(d*Uv(g),d*rh(g)),a.arc(0,0,d,g,p,y));else{var O=p,m=g,w=p,S=g,E=v,C=v,k=s.apply(this,arguments)/2,P=k>ha&&(r?+r.apply(this,arguments):W1(d*d+h*h)),D=ZV(cSe(h-d)/2,+n.apply(this,arguments)),M=D,L=D,A,T;if(P>ha){var N=uSe(P/d*rh(k)),j=uSe(P/h*rh(k));(E-=N*2)>ha?(N*=y?1:-1,w+=N,S-=N):(E=0,w=S=(p+g)/2),(C-=j*2)>ha?(j*=y?1:-1,O+=j,m-=j):(C=0,O=m=(p+g)/2)}var z=h*Uv(O),W=h*rh(O),F=d*Uv(S),q=d*rh(S);if(D>ha){var U=h*Uv(m),V=h*rh(m),H=d*Uv(w),Z=d*rh(w),ee;if(v<IE)if(ee=Win(z,W,H,Z,U,V,F,q)){var se=z-ee[0],fe=W-ee[1],ce=U-ee[0],ae=V-ee[1],de=1/rh(Nin((se*ce+fe*ae)/(W1(se*se+fe*fe)*W1(ce*ce+ae*ae)))/2),me=W1(ee[0]*ee[0]+ee[1]*ee[1]);M=ZV(D,(d-me)/(de-1)),L=ZV(D,(h-me)/(de+1))}else M=L=0}C>ha?L>ha?(A=HN(H,Z,z,W,h,L,y),T=HN(U,V,F,q,h,L,y),a.moveTo(A.cx+A.x01,A.cy+A.y01),L<D?a.arc(A.cx,A.cy,L,sa(A.y01,A.x01),sa(T.y01,T.x01),!y):(a.arc(A.cx,A.cy,L,sa(A.y01,A.x01),sa(A.y11,A.x11),!y),a.arc(0,0,h,sa(A.cy+A.y11,A.cx+A.x11),sa(T.cy+T.y11,T.cx+T.x11),!y),a.arc(T.cx,T.cy,L,sa(T.y11,T.x11),sa(T.y01,T.x01),!y))):(a.moveTo(z,W),a.arc(0,0,h,O,m,!y)):a.moveTo(z,W),!(d>ha)||!(E>ha)?a.lineTo(F,q):M>ha?(A=HN(F,q,U,V,d,-M,y),T=HN(z,W,H,Z,d,-M,y),a.lineTo(A.cx+A.x01,A.cy+A.y01),M<D?a.arc(A.cx,A.cy,M,sa(A.y01,A.x01),sa(T.y01,T.x01),!y):(a.arc(A.cx,A.cy,M,sa(A.y01,A.x01),sa(A.y11,A.x11),!y),a.arc(0,0,d,sa(A.cy+A.y11,A.cx+A.x11),sa(T.cy+T.y11,T.cx+T.x11),y),a.arc(T.cx,T.cy,M,sa(T.y11,T.x11),sa(T.y01,T.x01),!y))):a.arc(0,0,d,S,w,y)}if(a.closePath(),u)return a=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-IE/2;return[Uv(f)*u,rh(f)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:mr(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:mr(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:mr(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:mr(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:mr(+u),c):i},c.endAngle=function(u){return arguments.length?(o=typeof u=="function"?u:mr(+u),c):o},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:mr(+u),c):s},c.context=function(u){return arguments.length?(a=u??null,c):a},c}function KVe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function JVe(e){this._context=e}JVe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function oue(e){return new JVe(e)}function eUe(e){return e[0]}function tUe(e){return e[1]}function nUe(e,t){var n=mr(!0),r=null,i=oue,o=null,s=d9(a);e=typeof e=="function"?e:e===void 0?eUe:mr(e),t=typeof t=="function"?t:t===void 0?tUe:mr(t);function a(l){var c,u=(l=KVe(l)).length,f,d=!1,h;for(r==null&&(o=i(h=s())),c=0;c<=u;++c)!(c<u&&n(f=l[c],c,l))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(f,c,l),+t(f,c,l));if(h)return o=null,h+""||null}return a.x=function(l){return arguments.length?(e=typeof l=="function"?l:mr(+l),a):e},a.y=function(l){return arguments.length?(t=typeof l=="function"?l:mr(+l),a):t},a.defined=function(l){return arguments.length?(n=typeof l=="function"?l:mr(!!l),a):n},a.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),a):i},a.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),a):r},a}function rUe(e,t,n){var r=null,i=mr(!0),o=null,s=oue,a=null,l=d9(c);e=typeof e=="function"?e:e===void 0?eUe:mr(+e),t=typeof t=="function"?t:mr(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?tUe:mr(+n);function c(f){var d,h,p,g=(f=KVe(f)).length,v,y=!1,O,m=new Array(g),w=new Array(g);for(o==null&&(a=s(O=l())),d=0;d<=g;++d){if(!(d<g&&i(v=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=d-1;p>=h;--p)a.point(m[p],w[p]);a.lineEnd(),a.areaEnd()}y&&(m[d]=+e(v,d,f),w[d]=+t(v,d,f),a.point(r?+r(v,d,f):m[d],n?+n(v,d,f):w[d]))}if(O)return a=null,O+""||null}function u(){return nUe().defined(i).curve(s).context(o)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:mr(+f),r=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:mr(+f),c):e},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:mr(+f),c):r},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:mr(+f),n=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:mr(+f),c):t},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:mr(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:mr(!!f),c):i},c.curve=function(f){return arguments.length?(s=f,o!=null&&(a=s(o)),c):s},c.context=function(f){return arguments.length?(f==null?o=a=null:a=s(o=f),c):o},c}const Vin={draw(e,t){const n=W1(t/IE);e.moveTo(n,0),e.arc(0,0,n,0,YVe)}};function Uin(e,t){let n=null,r=d9(i);e=typeof e=="function"?e:mr(e||Vin),t=typeof t=="function"?t:mr(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:mr(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:mr(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function q0(){}function wF(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function h9(e){this._context=e}h9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:wF(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:wF(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Hin(e){return new h9(e)}function iUe(e){this._context=e}iUe.prototype={areaStart:q0,areaEnd:q0,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:wF(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Xin(e){return new iUe(e)}function oUe(e){this._context=e}oUe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:wF(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Zin(e){return new oUe(e)}function sUe(e,t){this._basis=new h9(e),this._beta=t}sUe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],o=e[n]-r,s=t[n]-i,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(r+l*o),this._beta*t[a]+(1-this._beta)*(i+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const Yin=function e(t){function n(r){return t===1?new h9(r):new sUe(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function SF(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function sue(e,t){this._context=e,this._k=(1-t)/6}sue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:SF(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:SF(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Gin=function e(t){function n(r){return new sue(r,t)}return n.tension=function(r){return e(+r)},n}(0);function aue(e,t){this._context=e,this._k=(1-t)/6}aue.prototype={areaStart:q0,areaEnd:q0,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:SF(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Kin=function e(t){function n(r){return new aue(r,t)}return n.tension=function(r){return e(+r)},n}(0);function lue(e,t){this._context=e,this._k=(1-t)/6}lue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:SF(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Jin=function e(t){function n(r){return new lue(r,t)}return n.tension=function(r){return e(+r)},n}(0);function cue(e,t,n){var r=e._x1,i=e._y1,o=e._x2,s=e._y2;if(e._l01_a>ha){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>ha){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,s,e._x2,e._y2)}function aUe(e,t){this._context=e,this._alpha=t}aUe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:cue(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const eon=function e(t){function n(r){return t?new aUe(r,t):new sue(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function lUe(e,t){this._context=e,this._alpha=t}lUe.prototype={areaStart:q0,areaEnd:q0,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:cue(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const ton=function e(t){function n(r){return t?new lUe(r,t):new aue(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function cUe(e,t){this._context=e,this._alpha=t}cUe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:cue(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const non=function e(t){function n(r){return t?new cUe(r,t):new lue(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function uUe(e){this._context=e}uUe.prototype={areaStart:q0,areaEnd:q0,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ron(e){return new uUe(e)}function fSe(e){return e<0?-1:1}function dSe(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(fSe(o)+fSe(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function hSe(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function YV(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function EF(e){this._context=e}EF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:YV(this,this._t0,hSe(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,YV(this,hSe(this,n=dSe(this,e,t)),n);break;default:YV(this,this._t0,n=dSe(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function fUe(e){this._context=new dUe(e)}(fUe.prototype=Object.create(EF.prototype)).point=function(e,t){EF.prototype.point.call(this,t,e)};function dUe(e){this._context=e}dUe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function ion(e){return new EF(e)}function oon(e){return new fUe(e)}function hUe(e){this._context=e}hUe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=pSe(e),i=pSe(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function pSe(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),s=new Array(n);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function son(e){return new hUe(e)}function p9(e,t){this._context=e,this._t=t}p9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function aon(e){return new p9(e,.5)}function lon(e){return new p9(e,0)}function con(e){return new p9(e,1)}function l0(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const uon=()=>typeof Image<"u"?Image:null;function Cp(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Pv(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const PK=Symbol("implicit");function uue(){var e=new sxe,t=[],n=[],r=PK;function i(o){let s=e.get(o);if(s===void 0){if(r!==PK)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new sxe;for(const s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return uue(t,n).unknown(r)},Cp.apply(i,arguments),i}function __(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vD(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Av(){}var fO=.7,LE=1/fO,NS="\\s*([+-]?\\d+)\\s*",KP="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Bh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fon=/^#([0-9a-f]{3,8})$/,don=new RegExp(`^rgb\\(${NS},${NS},${NS}\\)$`),hon=new RegExp(`^rgb\\(${Bh},${Bh},${Bh}\\)$`),pon=new RegExp(`^rgba\\(${NS},${NS},${NS},${KP}\\)$`),gon=new RegExp(`^rgba\\(${Bh},${Bh},${Bh},${KP}\\)$`),mon=new RegExp(`^hsl\\(${KP},${Bh},${Bh}\\)$`),yon=new RegExp(`^hsla\\(${KP},${Bh},${Bh},${KP}\\)$`),gSe={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};__(Av,dO,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:mSe,formatHex:mSe,formatHex8:von,formatHsl:bon,formatRgb:ySe,toString:ySe});function mSe(){return this.rgb().formatHex()}function von(){return this.rgb().formatHex8()}function bon(){return pUe(this).formatHsl()}function ySe(){return this.rgb().formatRgb()}function dO(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=fon.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?vSe(t):n===3?new cs(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?XN(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?XN(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=don.exec(e))?new cs(t[1],t[2],t[3],1):(t=hon.exec(e))?new cs(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=pon.exec(e))?XN(t[1],t[2],t[3],t[4]):(t=gon.exec(e))?XN(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mon.exec(e))?xSe(t[1],t[2]/100,t[3]/100,1):(t=yon.exec(e))?xSe(t[1],t[2]/100,t[3]/100,t[4]):gSe.hasOwnProperty(e)?vSe(gSe[e]):e==="transparent"?new cs(NaN,NaN,NaN,0):null}function vSe(e){return new cs(e>>16&255,e>>8&255,e&255,1)}function XN(e,t,n,r){return r<=0&&(e=t=n=NaN),new cs(e,t,n,r)}function fue(e){return e instanceof Av||(e=dO(e)),e?(e=e.rgb(),new cs(e.r,e.g,e.b,e.opacity)):new cs}function V0(e,t,n,r){return arguments.length===1?fue(e):new cs(e,t,n,r??1)}function cs(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}__(cs,V0,vD(Av,{brighter(e){return e=e==null?LE:Math.pow(LE,e),new cs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?fO:Math.pow(fO,e),new cs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new cs(cb(this.r),cb(this.g),cb(this.b),CF(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bSe,formatHex:bSe,formatHex8:Oon,formatRgb:OSe,toString:OSe}));function bSe(){return`#${q1(this.r)}${q1(this.g)}${q1(this.b)}`}function Oon(){return`#${q1(this.r)}${q1(this.g)}${q1(this.b)}${q1((isNaN(this.opacity)?1:this.opacity)*255)}`}function OSe(){const e=CF(this.opacity);return`${e===1?"rgb(":"rgba("}${cb(this.r)}, ${cb(this.g)}, ${cb(this.b)}${e===1?")":`, ${e})`}`}function CF(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cb(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function q1(e){return e=cb(e),(e<16?"0":"")+e.toString(16)}function xSe(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kf(e,t,n,r)}function pUe(e){if(e instanceof Kf)return new Kf(e.h,e.s,e.l,e.opacity);if(e instanceof Av||(e=dO(e)),!e)return new Kf;if(e instanceof Kf)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new Kf(s,a,l,e.opacity)}function _F(e,t,n,r){return arguments.length===1?pUe(e):new Kf(e,t,n,r??1)}function Kf(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}__(Kf,_F,vD(Av,{brighter(e){return e=e==null?LE:Math.pow(LE,e),new Kf(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?fO:Math.pow(fO,e),new Kf(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new cs(GV(e>=240?e-240:e+120,i,r),GV(e,i,r),GV(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Kf(wSe(this.h),ZN(this.s),ZN(this.l),CF(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=CF(this.opacity);return`${e===1?"hsl(":"hsla("}${wSe(this.h)}, ${ZN(this.s)*100}%, ${ZN(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wSe(e){return e=(e||0)%360,e<0?e+360:e}function ZN(e){return Math.max(0,Math.min(1,e||0))}function GV(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const gUe=Math.PI/180,mUe=180/Math.PI,kF=18,yUe=.96422,vUe=1,bUe=.82521,OUe=4/29,IS=6/29,xUe=3*IS*IS,xon=IS*IS*IS;function wUe(e){if(e instanceof Wh)return new Wh(e.l,e.a,e.b,e.opacity);if(e instanceof bg)return SUe(e);e instanceof cs||(e=fue(e));var t=tU(e.r),n=tU(e.g),r=tU(e.b),i=KV((.2225045*t+.7168786*n+.0606169*r)/vUe),o,s;return t===n&&n===r?o=s=i:(o=KV((.4360747*t+.3850649*n+.1430804*r)/yUe),s=KV((.0139322*t+.0971045*n+.7141733*r)/bUe)),new Wh(116*i-16,500*(o-i),200*(i-s),e.opacity)}function $F(e,t,n,r){return arguments.length===1?wUe(e):new Wh(e,t,n,r??1)}function Wh(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}__(Wh,$F,vD(Av,{brighter(e){return new Wh(this.l+kF*(e??1),this.a,this.b,this.opacity)},darker(e){return new Wh(this.l-kF*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=yUe*JV(t),e=vUe*JV(e),n=bUe*JV(n),new cs(eU(3.1338561*t-1.6168667*e-.4906146*n),eU(-.9787684*t+1.9161415*e+.033454*n),eU(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function KV(e){return e>xon?Math.pow(e,1/3):e/xUe+OUe}function JV(e){return e>IS?e*e*e:xUe*(e-OUe)}function eU(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function tU(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function won(e){if(e instanceof bg)return new bg(e.h,e.c,e.l,e.opacity);if(e instanceof Wh||(e=wUe(e)),e.a===0&&e.b===0)return new bg(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*mUe;return new bg(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function TF(e,t,n,r){return arguments.length===1?won(e):new bg(e,t,n,r??1)}function bg(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function SUe(e){if(isNaN(e.h))return new Wh(e.l,0,0,e.opacity);var t=e.h*gUe;return new Wh(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}__(bg,TF,vD(Av,{brighter(e){return new bg(this.h,this.c,this.l+kF*(e??1),this.opacity)},darker(e){return new bg(this.h,this.c,this.l-kF*(e??1),this.opacity)},rgb(){return SUe(this).rgb()}}));var EUe=-.14861,due=1.78277,hue=-.29227,g9=-.90649,JP=1.97294,SSe=JP*g9,ESe=JP*due,CSe=due*hue-g9*EUe;function Son(e){if(e instanceof ub)return new ub(e.h,e.s,e.l,e.opacity);e instanceof cs||(e=fue(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(CSe*r+SSe*t-ESe*n)/(CSe+SSe-ESe),o=r-i,s=(JP*(n-i)-hue*o)/g9,a=Math.sqrt(s*s+o*o)/(JP*i*(1-i)),l=a?Math.atan2(s,o)*mUe-120:NaN;return new ub(l<0?l+360:l,a,i,e.opacity)}function AK(e,t,n,r){return arguments.length===1?Son(e):new ub(e,t,n,r??1)}function ub(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}__(ub,AK,vD(Av,{brighter(e){return e=e==null?LE:Math.pow(LE,e),new ub(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?fO:Math.pow(fO,e),new ub(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*gUe,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new cs(255*(t+n*(EUe*r+due*i)),255*(t+n*(hue*r+g9*i)),255*(t+n*(JP*r)),this.opacity)}}));function CUe(e,t,n,r,i){var o=e*e,s=o*e;return((1-3*e+3*o-s)*t+(4-6*o+3*s)*n+(1+3*e+3*o-3*s)*r+s*i)/6}function _Ue(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],o=e[r+1],s=r>0?e[r-1]:2*i-o,a=r<t-1?e[r+2]:2*o-i;return CUe((n-r/t)*t,s,i,o,a)}}function kUe(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],o=e[r%t],s=e[(r+1)%t],a=e[(r+2)%t];return CUe((n-r/t)*t,i,o,s,a)}}const m9=e=>()=>e;function $Ue(e,t){return function(n){return e+n*t}}function Eon(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function y9(e,t){var n=t-e;return n?$Ue(e,n>180||n<-180?n-360*Math.round(n/360):n):m9(isNaN(e)?t:e)}function Con(e){return(e=+e)==1?us:function(t,n){return n-t?Eon(t,n,e):m9(isNaN(t)?n:t)}}function us(e,t){var n=t-e;return n?$Ue(e,n):m9(isNaN(e)?t:e)}const eA=function e(t){var n=Con(t);function r(i,o){var s=n((i=V0(i)).r,(o=V0(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),c=us(i.opacity,o.opacity);return function(u){return i.r=s(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function TUe(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;s<n;++s)a=V0(t[s]),r[s]=a.r||0,i[s]=a.g||0,o[s]=a.b||0;return r=e(r),i=e(i),o=e(o),a.opacity=1,function(l){return a.r=r(l),a.g=i(l),a.b=o(l),a+""}}}var _on=TUe(_Ue),kon=TUe(kUe);function pue(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function PUe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $on(e,t){return(PUe(t)?pue:AUe)(e,t)}function AUe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),s;for(s=0;s<r;++s)i[s]=Rv(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(a){for(s=0;s<r;++s)o[s]=i[s](a);return o}}function RUe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ru(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function DUe(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Rv(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var RK=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,nU=new RegExp(RK.source,"g");function Ton(e){return function(){return e}}function Pon(e){return function(t){return e(t)+""}}function gue(e,t){var n=RK.lastIndex=nU.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=RK.exec(e))&&(i=nU.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:Ru(r,i)})),n=nU.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?Pon(l[0].x):Ton(t):(t=l.length,function(c){for(var u=0,f;u<t;++u)a[(f=l[u]).i]=f.x(c);return a.join("")})}function Rv(e,t){var n=typeof t,r;return t==null||n==="boolean"?m9(t):(n==="number"?Ru:n==="string"?(r=dO(t))?(t=r,eA):gue:t instanceof dO?eA:t instanceof Date?RUe:PUe(t)?pue:Array.isArray(t)?AUe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?DUe:Ru)(e,t)}function Aon(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function Ron(e,t){var n=y9(+e,+t);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function bD(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var _Se=180/Math.PI,DK={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function MUe(e,t,n,r,i,o){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*_Se,skewX:Math.atan(l)*_Se,scaleX:s,scaleY:a}}var YN;function Don(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?DK:MUe(t.a,t.b,t.c,t.d,t.e,t.f)}function Mon(e){return e==null||(YN||(YN=document.createElementNS("http://www.w3.org/2000/svg","g")),YN.setAttribute("transform",e),!(e=YN.transform.baseVal.consolidate()))?DK:(e=e.matrix,MUe(e.a,e.b,e.c,e.d,e.e,e.f))}function NUe(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function o(c,u,f,d,h,p){if(c!==f||u!==d){var g=h.push("translate(",null,t,null,n);p.push({i:g-4,x:Ru(c,f)},{i:g-2,x:Ru(u,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function s(c,u,f,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Ru(c,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(c,u,f,d){c!==u?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Ru(c,u)}):u&&f.push(i(f)+"skewX("+u+r)}function l(c,u,f,d,h,p){if(c!==f||u!==d){var g=h.push(i(h)+"scale(",null,",",null,")");p.push({i:g-4,x:Ru(c,f)},{i:g-2,x:Ru(u,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=e(c),u=e(u),o(c.translateX,c.translateY,u.translateX,u.translateY,f,d),s(c.rotate,u.rotate,f,d),a(c.skewX,u.skewX,f,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(h){for(var p=-1,g=d.length,v;++p<g;)f[(v=d[p]).i]=v.x(h);return f.join("")}}}var IUe=NUe(Don,"px, ","px)","deg)"),LUe=NUe(Mon,", ",")",")"),Non=1e-12;function kSe(e){return((e=Math.exp(e))+1/e)/2}function Ion(e){return((e=Math.exp(e))-1/e)/2}function Lon(e){return((e=Math.exp(2*e))-1)/(e+1)}const jUe=function e(t,n,r){function i(o,s){var a=o[0],l=o[1],c=o[2],u=s[0],f=s[1],d=s[2],h=u-a,p=f-l,g=h*h+p*p,v,y;if(g<Non)y=Math.log(d/c)/t,v=function(C){return[a+C*h,l+C*p,c*Math.exp(t*C*y)]};else{var O=Math.sqrt(g),m=(d*d-c*c+r*g)/(2*c*n*O),w=(d*d-c*c-r*g)/(2*d*n*O),S=Math.log(Math.sqrt(m*m+1)-m),E=Math.log(Math.sqrt(w*w+1)-w);y=(E-S)/t,v=function(C){var k=C*y,P=kSe(S),D=c/(n*O)*(P*Lon(t*k+S)-Ion(S));return[a+D*h,l+D*p,c*P/kSe(t*k+S)]}}return v.duration=y*1e3*t/Math.SQRT2,v}return i.rho=function(o){var s=Math.max(.001,+o),a=s*s,l=a*a;return e(s,a,l)},i}(Math.SQRT2,2,4);function FUe(e){return function(t,n){var r=e((t=_F(t)).h,(n=_F(n)).h),i=us(t.s,n.s),o=us(t.l,n.l),s=us(t.opacity,n.opacity);return function(a){return t.h=r(a),t.s=i(a),t.l=o(a),t.opacity=s(a),t+""}}}const jon=FUe(y9);var Fon=FUe(us);function zon(e,t){var n=us((e=$F(e)).l,(t=$F(t)).l),r=us(e.a,t.a),i=us(e.b,t.b),o=us(e.opacity,t.opacity);return function(s){return e.l=n(s),e.a=r(s),e.b=i(s),e.opacity=o(s),e+""}}function zUe(e){return function(t,n){var r=e((t=TF(t)).h,(n=TF(n)).h),i=us(t.c,n.c),o=us(t.l,n.l),s=us(t.opacity,n.opacity);return function(a){return t.h=r(a),t.c=i(a),t.l=o(a),t.opacity=s(a),t+""}}}const Qon=zUe(y9);var Bon=zUe(us);function QUe(e){return function t(n){n=+n;function r(i,o){var s=e((i=AK(i)).h,(o=AK(o)).h),a=us(i.s,o.s),l=us(i.l,o.l),c=us(i.opacity,o.opacity);return function(u){return i.h=s(u),i.s=a(u),i.l=l(Math.pow(u,n)),i.opacity=c(u),i+""}}return r.gamma=t,r}(1)}const Won=QUe(y9);var qon=QUe(us);function mue(e,t){t===void 0&&(t=e,e=Rv);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(s){var a=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return o[a](s-a)}}function Von(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const Uon=Object.freeze(Object.defineProperty({__proto__:null,interpolate:Rv,interpolateArray:$on,interpolateBasis:_Ue,interpolateBasisClosed:kUe,interpolateCubehelix:Won,interpolateCubehelixLong:qon,interpolateDate:RUe,interpolateDiscrete:Aon,interpolateHcl:Qon,interpolateHclLong:Bon,interpolateHsl:jon,interpolateHslLong:Fon,interpolateHue:Ron,interpolateLab:zon,interpolateNumber:Ru,interpolateNumberArray:pue,interpolateObject:DUe,interpolateRgb:eA,interpolateRgbBasis:_on,interpolateRgbBasisClosed:kon,interpolateRound:bD,interpolateString:gue,interpolateTransformCss:IUe,interpolateTransformSvg:LUe,interpolateZoom:jUe,piecewise:mue,quantize:Von},Symbol.toStringTag,{value:"Module"}));function Hon(e){return function(){return e}}function MK(e){return+e}var $Se=[0,1];function Vl(e){return e}function NK(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Hon(isNaN(t)?NaN:.5)}function Xon(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Zon(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=NK(i,r),o=n(s,o)):(r=NK(r,i),o=n(o,s)),function(a){return o(r(a))}}function Yon(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=NK(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(a){var l=F0(e,a,1,r)-1;return o[l](i[l](a))}}function OD(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function v9(){var e=$Se,t=$Se,n=Rv,r,i,o,s=Vl,a,l,c;function u(){var d=Math.min(e.length,t.length);return s!==Vl&&(s=Xon(e[0],e[d-1])),a=d>2?Yon:Zon,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?o:(l||(l=a(e.map(r),t,n)))(r(s(d)))}return f.invert=function(d){return s(i((c||(c=a(t,e.map(r),Ru)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,MK),u()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=bD,u()},f.clamp=function(d){return arguments.length?(s=d?!0:Vl,u()):s!==Vl},f.interpolate=function(d){return arguments.length?(n=d,u()):n},f.unknown=function(d){return arguments.length?(o=d,f):o},function(d,h){return r=d,i=h,u()}}function BUe(){return v9()(Vl,Vl)}function WUe(e,t,n,r){var i=z0(e,t,n),o;switch(r=nO(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=W8e(i,s))&&(r.precision=o),Rae(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=q8e(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=B8e(i))&&(r.precision=o-(r.type==="%")*2);break}}return f8(r)}function ax(e){var t=e.domain;return e.ticks=function(n){var r=t();return RG(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return WUe(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,s=r[i],a=r[o],l,c,u=10;for(a<s&&(c=s,s=a,a=c,c=i,i=o,o=c);u-- >0;){if(c=DG(s,a,n),c===l)return r[i]=s,r[o]=a,t(r);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return e},e}function qUe(){var e=BUe();return e.copy=function(){return OD(e,qUe())},Cp.apply(e,arguments),ax(e)}function VUe(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,MK),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return VUe(e).unknown(t)},e=arguments.length?Array.from(e,MK):[0,1],ax(n)}function UUe(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],s;return o<i&&(s=n,n=r,r=s,s=i,i=o,o=s),e[n]=t.floor(i),e[r]=t.ceil(o),e}function TSe(e){return Math.log(e)}function PSe(e){return Math.exp(e)}function Gon(e){return-Math.log(-e)}function Kon(e){return-Math.exp(-e)}function Jon(e){return isFinite(e)?+("1e"+e):e<0?0:e}function esn(e){return e===10?Jon:e===Math.E?Math.exp:t=>Math.pow(e,t)}function tsn(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function ASe(e){return(t,n)=>-e(-t,n)}function yue(e){const t=e(TSe,PSe),n=t.domain;let r=10,i,o;function s(){return i=tsn(r),o=esn(r),n()[0]<0?(i=ASe(i),o=ASe(o),e(Gon,Kon)):e(TSe,PSe),t}return t.base=function(a){return arguments.length?(r=+a,s()):r},t.domain=function(a){return arguments.length?(n(a),s()):n()},t.ticks=a=>{const l=n();let c=l[0],u=l[l.length-1];const f=u<c;f&&([c,u]=[u,c]);let d=i(c),h=i(u),p,g;const v=a==null?10:+a;let y=[];if(!(r%1)&&h-d<v){if(d=Math.floor(d),h=Math.ceil(h),c>0){for(;d<=h;++d)for(p=1;p<r;++p)if(g=d<0?p/o(-d):p*o(d),!(g<c)){if(g>u)break;y.push(g)}}else for(;d<=h;++d)for(p=r-1;p>=1;--p)if(g=d>0?p/o(-d):p*o(d),!(g<c)){if(g>u)break;y.push(g)}y.length*2<v&&(y=RG(c,u,v))}else y=RG(d,h,Math.min(h-d,v)).map(o);return f?y.reverse():y},t.tickFormat=(a,l)=>{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=nO(l)).precision==null&&(l.trim=!0),l=f8(l)),a===1/0)return l;const c=Math.max(1,r*a/t.ticks().length);return u=>{let f=u/o(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=c?l(u):""}},t.nice=()=>n(UUe(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),t}function HUe(){const e=yue(v9()).domain([1,10]);return e.copy=()=>OD(e,HUe()).base(e.base()),Cp.apply(e,arguments),e}function RSe(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function DSe(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function vue(e){var t=1,n=e(RSe(t),DSe(t));return n.constant=function(r){return arguments.length?e(RSe(t=+r),DSe(t)):t},ax(n)}function XUe(){var e=vue(v9());return e.copy=function(){return OD(e,XUe()).constant(e.constant())},Cp.apply(e,arguments)}function MSe(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function nsn(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function rsn(e){return e<0?-e*e:e*e}function bue(e){var t=e(Vl,Vl),n=1;function r(){return n===1?e(Vl,Vl):n===.5?e(nsn,rsn):e(MSe(n),MSe(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ax(t)}function Oue(){var e=bue(v9());return e.copy=function(){return OD(e,Oue()).exponent(e.exponent())},Cp.apply(e,arguments),e}function isn(){return Oue.apply(null,arguments).exponent(.5)}function ZUe(){var e=[],t=[],n=[],r;function i(){var s=0,a=Math.max(1,t.length);for(n=new Array(a-1);++s<a;)n[s-1]=I8e(e,s/a);return o}function o(s){return s==null||isNaN(s=+s)?r:t[F0(n,s)]}return o.invertExtent=function(s){var a=t.indexOf(s);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},o.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let a of s)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Pg),i()},o.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},o.unknown=function(s){return arguments.length?(r=s,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return ZUe().domain(e).range(t).unknown(r)},Cp.apply(o,arguments)}function YUe(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function s(l){return l!=null&&l<=l?i[F0(r,l,0,n)]:o}function a(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return s}return s.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,a()):[e,t]},s.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,a()):i.slice()},s.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},s.unknown=function(l){return arguments.length&&(o=l),s},s.thresholds=function(){return r.slice()},s.copy=function(){return YUe().domain([e,t]).range(i).unknown(o)},Cp.apply(ax(s),arguments)}function GUe(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[F0(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return GUe().domain(e).range(t).unknown(n)},Cp.apply(i,arguments)}function osn(e){return new Date(e)}function ssn(e){return e instanceof Date?+e:+new Date(+e)}function xue(e,t,n,r,i,o,s,a,l,c){var u=BUe(),f=u.invert,d=u.domain,h=c(".%L"),p=c(":%S"),g=c("%I:%M"),v=c("%I %p"),y=c("%a %d"),O=c("%b %d"),m=c("%B"),w=c("%Y");function S(E){return(l(E)<E?h:a(E)<E?p:s(E)<E?g:o(E)<E?v:r(E)<E?i(E)<E?y:O:n(E)<E?m:w)(E)}return u.invert=function(E){return new Date(f(E))},u.domain=function(E){return arguments.length?d(Array.from(E,ssn)):d().map(osn)},u.ticks=function(E){var C=d();return e(C[0],C[C.length-1],E??10)},u.tickFormat=function(E,C){return C==null?S:c(C)},u.nice=function(E){var C=d();return(!E||typeof E.range!="function")&&(E=t(C[0],C[C.length-1],E??10)),E?d(UUe(C,E)):u},u.copy=function(){return OD(u,xue(e,t,n,r,i,o,s,a,l,c))},u}function asn(){return Cp.apply(xue(CQt,_Qt,ip,DP,d_,Ag,p8,d8,yg,Lae).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function lsn(){return Cp.apply(xue(SQt,EQt,op,MP,h_,n0,g8,h8,yg,jae).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function b9(){var e=0,t=1,n,r,i,o,s=Vl,a=!1,l;function c(f){return f==null||isNaN(f=+f)?l:s(i===0?.5:(f=(o(f)-n)*i,a?Math.max(0,Math.min(1,f)):f))}c.domain=function(f){return arguments.length?([e,t]=f,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),c):[e,t]},c.clamp=function(f){return arguments.length?(a=!!f,c):a},c.interpolator=function(f){return arguments.length?(s=f,c):s};function u(f){return function(d){var h,p;return arguments.length?([h,p]=d,s=f(h,p),c):[s(0),s(1)]}}return c.range=u(Rv),c.rangeRound=u(bD),c.unknown=function(f){return arguments.length?(l=f,c):l},function(f){return o=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),c}}function Dv(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function wue(){var e=ax(b9()(Vl));return e.copy=function(){return Dv(e,wue())},Pv.apply(e,arguments)}function KUe(){var e=yue(b9()).domain([1,10]);return e.copy=function(){return Dv(e,KUe()).base(e.base())},Pv.apply(e,arguments)}function JUe(){var e=vue(b9());return e.copy=function(){return Dv(e,JUe()).constant(e.constant())},Pv.apply(e,arguments)}function Sue(){var e=bue(b9());return e.copy=function(){return Dv(e,Sue()).exponent(e.exponent())},Pv.apply(e,arguments)}function csn(){return Sue.apply(null,arguments).exponent(.5)}function O9(){var e=0,t=.5,n=1,r=1,i,o,s,a,l,c=Vl,u,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+u(g))-o)*(r*g<r*o?a:l),c(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t,n]=g,i=u(e=+e),o=u(t=+t),s=u(n=+n),a=i===o?0:.5/(o-i),l=o===s?0:.5/(s-o),r=o<i?-1:1,h):[e,t,n]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(c=g,h):c};function p(g){return function(v){var y,O,m;return arguments.length?([y,O,m]=v,c=mue(g,[y,O,m]),h):[c(0),c(.5),c(1)]}}return h.range=p(Rv),h.rangeRound=p(bD),h.unknown=function(g){return arguments.length?(d=g,h):d},function(g){return u=g,i=g(e),o=g(t),s=g(n),a=i===o?0:.5/(o-i),l=o===s?0:.5/(s-o),r=o<i?-1:1,h}}function eHe(){var e=ax(O9()(Vl));return e.copy=function(){return Dv(e,eHe())},Pv.apply(e,arguments)}function tHe(){var e=yue(O9()).domain([.1,1,10]);return e.copy=function(){return Dv(e,tHe()).base(e.base())},Pv.apply(e,arguments)}function nHe(){var e=vue(O9());return e.copy=function(){return Dv(e,nHe()).constant(e.constant())},Pv.apply(e,arguments)}function Eue(){var e=bue(O9());return e.copy=function(){return Dv(e,Eue()).exponent(e.exponent())},Pv.apply(e,arguments)}function usn(){return Eue.apply(null,arguments).exponent(.5)}function Cue(e,t,n){const r=e-t+n*2;return e?r>0?r:1:0}const fsn="identity",jE="linear",em="log",xD="pow",wD="sqrt",x9="symlog",hO="time",pO="utc",qh="sequential",k_="diverging",FE="quantile",w9="quantize",S9="threshold",_ue="ordinal",IK="point",rHe="band",kue="bin-ordinal",Jo="continuous",SD="discrete",ED="discretizing",_f="interpolating",$ue="temporal";function dsn(e){return function(t){let n=t[0],r=t[1],i;return r<n&&(i=n,n=r,r=i),[e.invert(n),e.invert(r)]}}function hsn(e){return function(t){const n=e.range();let r=t[0],i=t[1],o=-1,s,a,l,c;for(i<r&&(a=r,r=i,i=a),l=0,c=n.length;l<c;++l)n[l]>=r&&n[l]<=i&&(o<0&&(o=l),s=l);if(!(o<0))return r=e.invertExtent(n[o]),i=e.invertExtent(n[s]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function Tue(){const e=uue().unknown(void 0),t=e.domain,n=e.range;let r=[0,1],i,o,s=!1,a=0,l=0,c=.5;delete e.unknown;function u(){const f=t().length,d=r[1]<r[0],h=r[1-d],p=Cue(f,a,l);let g=r[d-0];i=(h-g)/(p||1),s&&(i=Math.floor(i)),g+=(h-g-i*(f-a))*c,o=i*(1-a),s&&(g=Math.round(g),o=Math.round(o));const v=Qc(f).map(y=>g+i*y);return n(d?v.reverse():v)}return e.domain=function(f){return arguments.length?(t(f),u()):t()},e.range=function(f){return arguments.length?(r=[+f[0],+f[1]],u()):r.slice()},e.rangeRound=function(f){return r=[+f[0],+f[1]],s=!0,u()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(f){return arguments.length?(s=!!f,u()):s},e.padding=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),a=l,u()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),u()):a},e.paddingOuter=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),u()):l},e.align=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),u()):c},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=r[1]<r[0],h=d?n().reverse():n(),p=h.length-1;let g=+f[0],v=+f[1],y,O,m;if(!(g!==g||v!==v)&&(v<g&&(m=g,g=v,v=m),!(v<h[0]||g>r[1-d])))return y=Math.max(0,F0(h,g)-1),O=g===v?y:F0(h,v)-1,g-h[y]>o+1e-10&&++y,d&&(m=y,y=p-O,O=p-m),y>O?void 0:t().slice(y,O+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Tue().domain(t()).range(r).round(s).paddingInner(a).paddingOuter(l).align(c)},u()}function iHe(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return iHe(t())},e}function psn(){return iHe(Tue().paddingInner(1))}var gsn=Array.prototype.map;function msn(e){return gsn.call(e,$a)}const ysn=Array.prototype.slice;function oHe(){let e=[],t=[];function n(r){return r==null||r!==r?void 0:t[(F0(e,r)-1)%t.length]}return n.domain=function(r){return arguments.length?(e=msn(r),n):e.slice()},n.range=function(r){return arguments.length?(t=ysn.call(r),n):t.slice()},n.tickFormat=function(r,i){return WUe(e[0],jn(e),r??10,i)},n.copy=function(){return oHe().domain(n.domain()).range(n.range())},n}const PF=new Map,sHe=Symbol("vega_scale");function aHe(e){return e[sHe]=!0,e}function vsn(e){return e&&e[sHe]===!0}function bsn(e,t,n){const r=function(){const o=t();return o.invertRange||(o.invertRange=o.invert?dsn(o):o.invertExtent?hsn(o):void 0),o.type=e,aHe(o)};return r.metadata=kd(ct(n)),r}function tr(e,t,n){return arguments.length>1?(PF.set(e,bsn(e,t,n)),this):lHe(e)?PF.get(e):void 0}tr(fsn,VUe);tr(jE,qUe,Jo);tr(em,HUe,[Jo,em]);tr(xD,Oue,Jo);tr(wD,isn,Jo);tr(x9,XUe,Jo);tr(hO,asn,[Jo,$ue]);tr(pO,lsn,[Jo,$ue]);tr(qh,wue,[Jo,_f]);tr(`${qh}-${jE}`,wue,[Jo,_f]);tr(`${qh}-${em}`,KUe,[Jo,_f,em]);tr(`${qh}-${xD}`,Sue,[Jo,_f]);tr(`${qh}-${wD}`,csn,[Jo,_f]);tr(`${qh}-${x9}`,JUe,[Jo,_f]);tr(`${k_}-${jE}`,eHe,[Jo,_f]);tr(`${k_}-${em}`,tHe,[Jo,_f,em]);tr(`${k_}-${xD}`,Eue,[Jo,_f]);tr(`${k_}-${wD}`,usn,[Jo,_f]);tr(`${k_}-${x9}`,nHe,[Jo,_f]);tr(FE,ZUe,[ED,FE]);tr(w9,YUe,ED);tr(S9,GUe,ED);tr(kue,oHe,[SD,ED]);tr(_ue,uue,SD);tr(rHe,Tue,SD);tr(IK,psn,SD);function lHe(e){return PF.has(e)}function lx(e,t){const n=PF.get(e);return n&&n.metadata[t]}function Pue(e){return lx(e,Jo)}function zE(e){return lx(e,SD)}function LK(e){return lx(e,ED)}function cHe(e){return lx(e,em)}function Osn(e){return lx(e,$ue)}function uHe(e){return lx(e,_f)}function fHe(e){return lx(e,FE)}const xsn=["clamp","base","constant","exponent"];function dHe(e,t){const n=t[0],r=jn(t)-n;return function(i){return e(n+i*r)}}function E9(e,t,n){return mue(Aue(t||"rgb",n),e)}function hHe(e,t){const n=new Array(t),r=t+1;for(let i=0;i<t;)n[i]=e(++i/r);return n}function pHe(e,t,n){const r=n-t;let i,o,s;return!r||!Number.isFinite(r)?Wa(.5):(i=(o=e.type).indexOf("-"),o=i<0?o:o.slice(i+1),s=tr(o)().domain([t,n]).range([0,1]),xsn.forEach(a=>e[a]?s[a](e[a]()):0),s)}function Aue(e,t){const n=Uon[wsn(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function wsn(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const Ssn={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},Esn={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function gHe(e){const t=e.length/6|0,n=new Array(t);for(let r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}function mHe(e,t){for(const n in e)Rue(n,t(e[n]))}const NSe={};mHe(Esn,gHe);mHe(Ssn,e=>E9(gHe(e)));function Rue(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(NSe[e]=t,this):NSe[e]}const iL="symbol",Csn="discrete",_sn="gradient",ksn=e=>ze(e)?e.map(t=>String(t)):String(e),$sn=(e,t)=>e[1]-t[1],Tsn=(e,t)=>t[1]-e[1];function Due(e,t,n){let r;return Hn(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(eD(e.domain())/n||1)+1))),dt(t)&&(r=t.step,t=t.interval),ut(t)&&(t=e.type===hO?p_(t):e.type==pO?g_(t):Le("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function yHe(e,t,n){let r=e.range(),i=r[0],o=jn(r),s=$sn;if(i>o&&(r=o,o=i,i=r,s=Tsn),i=Math.floor(i),o=Math.ceil(o),t=t.map(a=>[a,e(a)]).filter(a=>i<=a[1]&&a[1]<=o).sort(s).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],jn(t)];for(;t.length>n&&t.length>=3;)t=t.filter((l,c)=>!(c%2));t.length<3&&(t=a)}return t}function Mue(e,t){return e.bins?yHe(e,e.bins):e.ticks?e.ticks(t):e.domain()}function vHe(e,t,n,r,i,o){const s=t.type;let a=ksn;if(s===hO||i===hO)a=e.timeFormat(r);else if(s===pO||i===pO)a=e.utcFormat(r);else if(cHe(s)){const l=e.formatFloat(r);if(o||t.bins)a=l;else{const c=bHe(t,n,!1);a=u=>c(u)?l(u):""}}else if(t.tickFormat){const l=t.domain();a=e.formatSpan(l[0],l[l.length-1],n,r)}else r&&(a=e.format(r));return a}function bHe(e,t,n){const r=Mue(e,t),i=e.base(),o=Math.log(i),s=Math.max(1,i*t/r.length),a=l=>{let c=l/Math.pow(i,Math.round(Math.log(l)/o));return c*i<i-.5&&(c*=i),c<=s};return n?r.filter(a):a}const jK={[FE]:"quantiles",[w9]:"thresholds",[S9]:"domain"},OHe={[FE]:"quantiles",[w9]:"domain"};function xHe(e,t){return e.bins?Rsn(e.bins):e.type===em?bHe(e,t,!0):jK[e.type]?Asn(e[jK[e.type]]()):Mue(e,t)}function Psn(e,t,n){const r=t[OHe[t.type]](),i=r.length;let o=i>1?r[1]-r[0]:r[0],s;for(s=1;s<i;++s)o=Math.min(o,r[s]-r[s-1]);return e.formatSpan(0,o,3*10,n)}function Asn(e){const t=[-1/0].concat(e);return t.max=1/0,t}function Rsn(e){const t=e.slice(0,-1);return t.max=jn(e),t}const Dsn=e=>jK[e.type]||e.bins;function wHe(e,t,n,r,i,o,s){const a=OHe[t.type]&&o!==hO&&o!==pO?Psn(e,t,i):vHe(e,t,n,i,o,s);return r===iL&&Dsn(t)?Msn(a):r===Csn?Nsn(a):Isn(a)}const Msn=e=>(t,n,r)=>{const i=ISe(r[n+1],ISe(r.max,1/0)),o=LSe(t,e),s=LSe(i,e);return o&&s?o+" – "+s:s?"< "+s:"≥ "+o},ISe=(e,t)=>e??t,Nsn=e=>(t,n)=>n?e(t):null,Isn=e=>t=>e(t),LSe=(e,t)=>Number.isFinite(e)?t(e):null;function Lsn(e){const t=e.domain(),n=t.length-1;let r=+t[0],i=+jn(t),o=i-r;if(e.type===S9){const s=n?o/n:.1;r-=s,i+=s,o=i-r}return s=>(s-r)/o}function jsn(e,t,n,r){const i=r||t.type;return ut(n)&&Osn(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&i===hO?e.timeFormat("%A, %d %B %Y, %X"):!n&&i===pO?e.utcFormat("%A, %d %B %Y, %X UTC"):wHe(e,t,5,null,n,r,!0)}function SHe(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=jsn(e,t,n.format,n.formatType);if(LK(t.type)){const o=xHe(t).slice(1).map(i),s=o.length;return`${s} boundar${s===1?"y":"ies"}: ${o.join(", ")}`}else if(zE(t.type)){const o=t.domain(),s=o.length,a=s>r?o.slice(0,r-2).map(i).join(", ")+", ending with "+o.slice(-1).map(i):o.map(i).join(", ");return`${s} value${s===1?"":"s"}: ${a}`}else{const o=t.domain();return`values from ${i(o[0])} to ${i(jn(o))}`}}let EHe=0;function Fsn(){EHe=0}const AF="p_";function Nue(e){return e&&e.gradient}function CHe(e,t,n){const r=e.gradient;let i=e.id,o=r==="radial"?AF:"";return i||(i=e.id="gradient_"+EHe++,r==="radial"?(e.x1=ih(e.x1,.5),e.y1=ih(e.y1,.5),e.r1=ih(e.r1,0),e.x2=ih(e.x2,.5),e.y2=ih(e.y2,.5),e.r2=ih(e.r2,.5),o=AF):(e.x1=ih(e.x1,0),e.y1=ih(e.y1,0),e.x2=ih(e.x2,1),e.y2=ih(e.y2,0))),t[i]=e,"url("+(n||"")+"#"+o+i+")"}function ih(e,t){return e??t}function _He(e,t){var n=[],r;return r={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(i,o){return n.push({offset:i,color:o}),r}}}const jSe={basis:{curve:Hin},"basis-closed":{curve:Xin},"basis-open":{curve:Zin},bundle:{curve:Yin,tension:"beta",value:.85},cardinal:{curve:Gin,tension:"tension",value:0},"cardinal-open":{curve:Jin,tension:"tension",value:0},"cardinal-closed":{curve:Kin,tension:"tension",value:0},"catmull-rom":{curve:eon,tension:"alpha",value:.5},"catmull-rom-closed":{curve:ton,tension:"alpha",value:.5},"catmull-rom-open":{curve:non,tension:"alpha",value:.5},linear:{curve:oue},"linear-closed":{curve:ron},monotone:{horizontal:oon,vertical:ion},natural:{curve:son},step:{curve:aon},"step-after":{curve:con},"step-before":{curve:lon}};function Iue(e,t,n){var r=Nt(jSe,e)&&jSe[e],i=null;return r&&(i=r.curve||r[t||"vertical"],r.tension&&n!=null&&(i=i[r.tension](n))),i}const zsn={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},Qsn=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,Bsn=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,Wsn=/^((\s+,?\s*)|(,\s*))/,qsn=/^[01]/;function QE(e){const t=[];return(e.match(Qsn)||[]).forEach(r=>{let i=r[0];const o=i.toLowerCase(),s=zsn[o],a=Vsn(o,s,r.slice(1).trim()),l=a.length;if(l<s||l&&l%s!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([i,...a.slice(0,s)]),l!==s){o==="m"&&(i=i==="M"?"L":"l");for(let c=s;c<l;c+=s)t.push([i,...a.slice(c,c+s)])}}),t}function Vsn(e,t,n){const r=[];for(let i=0;t&&i<n.length;)for(let o=0;o<t;++o){const s=e==="a"&&(o===3||o===4)?qsn:Bsn,a=n.slice(i).match(s);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");i+=a[0].length,r.push(+a[0]);const l=n.slice(i).match(Wsn);l!==null&&(i+=l[0].length)}return r}const U0=Math.PI/180,Usn=1e-14,k1=Math.PI/2,wh=Math.PI*2,Vx=Math.sqrt(3)/2;var rU={},iU={},kHe=[].join;function Hsn(e,t,n,r,i,o,s,a,l){const c=kHe.call(arguments);if(rU[c])return rU[c];const u=s*U0,f=Math.sin(u),d=Math.cos(u);n=Math.abs(n),r=Math.abs(r);const h=d*(a-e)*.5+f*(l-t)*.5,p=d*(l-t)*.5-f*(a-e)*.5;let g=h*h/(n*n)+p*p/(r*r);g>1&&(g=Math.sqrt(g),n*=g,r*=g);const v=d/n,y=f/n,O=-f/r,m=d/r,w=v*a+y*l,S=O*a+m*l,E=v*e+y*t,C=O*e+m*t;let P=1/((E-w)*(E-w)+(C-S)*(C-S))-.25;P<0&&(P=0);let D=Math.sqrt(P);o==i&&(D=-D);const M=.5*(w+E)-D*(C-S),L=.5*(S+C)+D*(E-w),A=Math.atan2(S-L,w-M);let N=Math.atan2(C-L,E-M)-A;N<0&&o===1?N+=wh:N>0&&o===0&&(N-=wh);const j=Math.ceil(Math.abs(N/(k1+.001))),z=[];for(let W=0;W<j;++W){const F=A+W*N/j,q=A+(W+1)*N/j;z[W]=[M,L,F,q,n,r,f,d]}return rU[c]=z}function Xsn(e){const t=kHe.call(e);if(iU[t])return iU[t];var n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7];const u=c*s,f=-l*a,d=l*s,h=c*a,p=Math.cos(i),g=Math.sin(i),v=Math.cos(o),y=Math.sin(o),O=.5*(o-i),m=Math.sin(O*.5),w=8/3*m*m/Math.sin(O),S=n+p-w*g,E=r+g+w*p,C=n+v,k=r+y,P=C+w*y,D=k-w*v;return iU[t]=[u*S+f*E,d*S+h*E,u*P+f*D,d*P+h*D,u*C+f*k,d*C+h*k]}const mu=["l",0,0,0,0,0,0,0];function Zsn(e,t,n){const r=mu[0]=e[0];if(r==="a"||r==="A")mu[1]=t*e[1],mu[2]=n*e[2],mu[3]=e[3],mu[4]=e[4],mu[5]=e[5],mu[6]=t*e[6],mu[7]=n*e[7];else if(r==="h"||r==="H")mu[1]=t*e[1];else if(r==="v"||r==="V")mu[1]=n*e[1];else for(var i=1,o=e.length;i<o;++i)mu[i]=(i%2==1?t:n)*e[i];return mu}function tA(e,t,n,r,i,o){var s,a=null,l=0,c=0,u=0,f=0,d,h,p,g,v=0,y=0;n==null&&(n=0),r==null&&(r=0),i==null&&(i=1),o==null&&(o=i),e.beginPath&&e.beginPath();for(var O=0,m=t.length;O<m;++O){switch(s=t[O],(i!==1||o!==1)&&(s=Zsn(s,i,o)),s[0]){case"l":l+=s[1],c+=s[2],e.lineTo(l+n,c+r);break;case"L":l=s[1],c=s[2],e.lineTo(l+n,c+r);break;case"h":l+=s[1],e.lineTo(l+n,c+r);break;case"H":l=s[1],e.lineTo(l+n,c+r);break;case"v":c+=s[1],e.lineTo(l+n,c+r);break;case"V":c=s[1],e.lineTo(l+n,c+r);break;case"m":l+=s[1],c+=s[2],v=l,y=c,e.moveTo(l+n,c+r);break;case"M":l=s[1],c=s[2],v=l,y=c,e.moveTo(l+n,c+r);break;case"c":d=l+s[5],h=c+s[6],u=l+s[3],f=c+s[4],e.bezierCurveTo(l+s[1]+n,c+s[2]+r,u+n,f+r,d+n,h+r),l=d,c=h;break;case"C":l=s[5],c=s[6],u=s[3],f=s[4],e.bezierCurveTo(s[1]+n,s[2]+r,u+n,f+r,l+n,c+r);break;case"s":d=l+s[3],h=c+s[4],u=2*l-u,f=2*c-f,e.bezierCurveTo(u+n,f+r,l+s[1]+n,c+s[2]+r,d+n,h+r),u=l+s[1],f=c+s[2],l=d,c=h;break;case"S":d=s[3],h=s[4],u=2*l-u,f=2*c-f,e.bezierCurveTo(u+n,f+r,s[1]+n,s[2]+r,d+n,h+r),l=d,c=h,u=s[1],f=s[2];break;case"q":d=l+s[3],h=c+s[4],u=l+s[1],f=c+s[2],e.quadraticCurveTo(u+n,f+r,d+n,h+r),l=d,c=h;break;case"Q":d=s[3],h=s[4],e.quadraticCurveTo(s[1]+n,s[2]+r,d+n,h+r),l=d,c=h,u=s[1],f=s[2];break;case"t":d=l+s[1],h=c+s[2],a[0].match(/[QqTt]/)===null?(u=l,f=c):a[0]==="t"?(u=2*l-p,f=2*c-g):a[0]==="q"&&(u=2*l-u,f=2*c-f),p=u,g=f,e.quadraticCurveTo(u+n,f+r,d+n,h+r),l=d,c=h,u=l+s[1],f=c+s[2];break;case"T":d=s[1],h=s[2],u=2*l-u,f=2*c-f,e.quadraticCurveTo(u+n,f+r,d+n,h+r),l=d,c=h;break;case"a":FSe(e,l+n,c+r,[s[1],s[2],s[3],s[4],s[5],s[6]+l+n,s[7]+c+r]),l+=s[6],c+=s[7];break;case"A":FSe(e,l+n,c+r,[s[1],s[2],s[3],s[4],s[5],s[6]+n,s[7]+r]),l=s[6],c=s[7];break;case"z":case"Z":l=v,c=y,e.closePath();break}a=s}}function FSe(e,t,n,r){const i=Hsn(r[5],r[6],r[0],r[1],r[3],r[4],r[2],t,n);for(let o=0;o<i.length;++o){const s=Xsn(i[o]);e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}}const zSe=.5773502691896257,QSe={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,wh)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,r=n/2.5;e.moveTo(-n,-r),e.lineTo(-n,r),e.lineTo(-r,r),e.lineTo(-r,n),e.lineTo(r,n),e.lineTo(r,r),e.lineTo(n,r),e.lineTo(n,-r),e.lineTo(r,-r),e.lineTo(r,-n),e.lineTo(-r,-n),e.lineTo(-r,-r),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),r=-n/2;e.rect(r,r,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,r=n/7,i=n/2.5,o=n/8;e.moveTo(-r,n),e.lineTo(r,n),e.lineTo(r,-o),e.lineTo(i,-o),e.lineTo(0,-n),e.lineTo(-i,-o),e.lineTo(-r,-o),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,r=Vx*n,i=r-n*zSe,o=n/4;e.moveTo(0,-r-i),e.lineTo(-o,r-i),e.lineTo(o,r-i),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,r=Vx*n,i=r-n*zSe;e.moveTo(0,-r-i),e.lineTo(-n,r-i),e.lineTo(n,r-i),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,r=Vx*n;e.moveTo(0,-r),e.lineTo(-n,r),e.lineTo(n,r),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,r=Vx*n;e.moveTo(0,r),e.lineTo(-n,-r),e.lineTo(n,-r),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,r=Vx*n;e.moveTo(r,0),e.lineTo(-r,-n),e.lineTo(-r,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,r=Vx*n;e.moveTo(-r,0),e.lineTo(r,-n),e.lineTo(r,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function $He(e){return Nt(QSe,e)?QSe[e]:Ysn(e)}var oU={};function Ysn(e){if(!Nt(oU,e)){const t=QE(e);oU[e]={draw:function(n,r){tA(n,t,0,0,Math.sqrt(r)/2)}}}return oU[e]}const jm=.448084975506;function Gsn(e){return e.x}function Ksn(e){return e.y}function Jsn(e){return e.width}function ean(e){return e.height}function Wp(e){return typeof e=="function"?e:()=>+e}function GN(e,t,n){return Math.max(t,Math.min(e,n))}function THe(){var e=Gsn,t=Ksn,n=Jsn,r=ean,i=Wp(0),o=i,s=i,a=i,l=null;function c(u,f,d){var h,p=f??+e.call(this,u),g=d??+t.call(this,u),v=+n.call(this,u),y=+r.call(this,u),O=Math.min(v,y)/2,m=GN(+i.call(this,u),0,O),w=GN(+o.call(this,u),0,O),S=GN(+s.call(this,u),0,O),E=GN(+a.call(this,u),0,O);if(l||(l=h=f9()),m<=0&&w<=0&&S<=0&&E<=0)l.rect(p,g,v,y);else{var C=p+v,k=g+y;l.moveTo(p+m,g),l.lineTo(C-w,g),l.bezierCurveTo(C-jm*w,g,C,g+jm*w,C,g+w),l.lineTo(C,k-E),l.bezierCurveTo(C,k-jm*E,C-jm*E,k,C-E,k),l.lineTo(p+S,k),l.bezierCurveTo(p+jm*S,k,p,k-jm*S,p,k-S),l.lineTo(p,g+m),l.bezierCurveTo(p,g+jm*m,p+jm*m,g,p+m,g),l.closePath()}if(h)return l=null,h+""||null}return c.x=function(u){return arguments.length?(e=Wp(u),c):e},c.y=function(u){return arguments.length?(t=Wp(u),c):t},c.width=function(u){return arguments.length?(n=Wp(u),c):n},c.height=function(u){return arguments.length?(r=Wp(u),c):r},c.cornerRadius=function(u,f,d,h){return arguments.length?(i=Wp(u),o=f!=null?Wp(f):i,a=d!=null?Wp(d):i,s=h!=null?Wp(h):o,c):i},c.context=function(u){return arguments.length?(l=u??null,c):l},c}function PHe(){var e,t,n,r,i=null,o,s,a,l;function c(f,d,h){const p=h/2;if(o){var g=a-d,v=f-s;if(g||v){var y=Math.hypot(g,v),O=(g/=y)*l,m=(v/=y)*l,w=Math.atan2(v,g);i.moveTo(s-O,a-m),i.lineTo(f-g*p,d-v*p),i.arc(f,d,p,w-Math.PI,w),i.lineTo(s+O,a+m),i.arc(s,a,l,w,w+Math.PI)}else i.arc(f,d,p,0,wh);i.closePath()}else o=1;s=f,a=d,l=p}function u(f){var d,h=f.length,p,g=!1,v;for(i==null&&(i=v=f9()),d=0;d<=h;++d)!(d<h&&r(p=f[d],d,f))===g&&(g=!g)&&(o=0),g&&c(+e(p,d,f),+t(p,d,f),+n(p,d,f));if(v)return i=null,v+""||null}return u.x=function(f){return arguments.length?(e=f,u):e},u.y=function(f){return arguments.length?(t=f,u):t},u.size=function(f){return arguments.length?(n=f,u):n},u.defined=function(f){return arguments.length?(r=f,u):r},u.context=function(f){return arguments.length?(f==null?i=null:i=f,u):i},u}function CD(e,t){return e??t}const _D=e=>e.x||0,kD=e=>e.y||0,tan=e=>e.width||0,nan=e=>e.height||0,ran=e=>(e.x||0)+(e.width||0),ian=e=>(e.y||0)+(e.height||0),oan=e=>e.startAngle||0,san=e=>e.endAngle||0,aan=e=>e.padAngle||0,lan=e=>e.innerRadius||0,can=e=>e.outerRadius||0,uan=e=>e.cornerRadius||0,fan=e=>CD(e.cornerRadiusTopLeft,e.cornerRadius)||0,dan=e=>CD(e.cornerRadiusTopRight,e.cornerRadius)||0,han=e=>CD(e.cornerRadiusBottomRight,e.cornerRadius)||0,pan=e=>CD(e.cornerRadiusBottomLeft,e.cornerRadius)||0,gan=e=>CD(e.size,64),man=e=>e.size||1,C9=e=>e.defined!==!1,yan=e=>$He(e.shape||"circle"),van=qin().startAngle(oan).endAngle(san).padAngle(aan).innerRadius(lan).outerRadius(can).cornerRadius(uan),ban=rUe().x(_D).y1(kD).y0(ian).defined(C9),Oan=rUe().y(kD).x1(_D).x0(ran).defined(C9),xan=nUe().x(_D).y(kD).defined(C9),wan=THe().x(_D).y(kD).width(tan).height(nan).cornerRadius(fan,dan,han,pan),San=Uin().type(yan).size(gan),Ean=PHe().x(_D).y(kD).defined(C9).size(man);function Lue(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Can(e,t){return van.context(e)(t)}function _an(e,t){const n=t[0],r=n.interpolate||"linear";return(n.orient==="horizontal"?Oan:ban).curve(Iue(r,n.orient,n.tension)).context(e)(t)}function kan(e,t){const n=t[0],r=n.interpolate||"linear";return xan.curve(Iue(r,n.orient,n.tension)).context(e)(t)}function $_(e,t,n,r){return wan.context(e)(t,n,r)}function $an(e,t){return(t.mark.shape||t.shape).context(e)(t)}function Tan(e,t){return San.context(e)(t)}function Pan(e,t){return Ean.context(e)(t)}var AHe=1;function RHe(){AHe=1}function jue(e,t,n){var r=t.clip,i=e._defs,o=t.clip_id||(t.clip_id="clip"+AHe++),s=i.clipping[o]||(i.clipping[o]={id:o});return ln(r)?s.path=r(null):Lue(n)?s.path=$_(null,n,0,0):(s.width=n.width||0,s.height=n.height||0),"url(#"+o+")"}function Po(e){this.clear(),e&&this.union(e)}Po.prototype={clone(){return new Po(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,r){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),r<t?(this.y2=t,this.y1=r):(this.y1=t,this.y2=r),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const r=this.rotatedPoints(e,t,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:s}=this,a=Math.cos(e),l=Math.sin(e),c=t-t*a+n*l,u=n-t*l-n*a;return[a*r-l*i+c,l*r+a*i+u,a*r-l*s+c,l*r+a*s+u,a*o-l*i+c,l*o+a*i+u,a*o-l*s+c,l*o+a*s+u]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function _9(e){this.mark=e,this.bounds=this.bounds||new Po}function k9(e){_9.call(this,e),this.items=this.items||[]}Ke(k9,_9);function Fue(e){this._pending=0,this._loader=e||tD()}function BSe(e){e._pending+=1}function Ik(e){e._pending-=1}Fue.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return BSe(t),t._loader.sanitize(e,{context:"href"}).then(n=>(Ik(t),n)).catch(()=>(Ik(t),null))},loadImage(e){const t=this,n=uon();return BSe(t),t._loader.sanitize(e,{context:"image"}).then(r=>{const i=r.href;if(!i||!n)throw{url:i};const o=new n,s=Nt(r,"crossOrigin")?r.crossOrigin:"anonymous";return s!=null&&(o.crossOrigin=s),o.onload=()=>Ik(t),o.onerror=()=>Ik(t),o.src=i,o}).catch(r=>(Ik(t),{complete:!1,width:0,height:0,src:r&&r.url||""}))},ready(){const e=this;return new Promise(t=>{function n(r){e.pending()?setTimeout(()=>{n(!0)},10):t(r)}n(!1)})}};function bm(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const r=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(r+(n?Aan(t,r):0))}return e}function Aan(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const Ran=wh-1e-8;let $9,oL,sL,V1,FK,aL,zK,QK;const Ry=(e,t)=>$9.add(e,t),lL=(e,t)=>Ry(oL=e,sL=t),WSe=e=>Ry(e,$9.y1),qSe=e=>Ry($9.x1,e),$1=(e,t)=>FK*e+zK*t,T1=(e,t)=>aL*e+QK*t,sU=(e,t)=>Ry($1(e,t),T1(e,t)),aU=(e,t)=>lL($1(e,t),T1(e,t));function $D(e,t){return $9=e,t?(V1=t*U0,FK=QK=Math.cos(V1),aL=Math.sin(V1),zK=-aL):(FK=QK=1,V1=aL=zK=0),Dan}const Dan={beginPath(){},closePath(){},moveTo:aU,lineTo:aU,rect(e,t,n,r){V1?(sU(e+n,t),sU(e+n,t+r),sU(e,t+r),aU(e,t)):(Ry(e+n,t+r),lL(e,t))},quadraticCurveTo(e,t,n,r){const i=$1(e,t),o=T1(e,t),s=$1(n,r),a=T1(n,r);VSe(oL,i,s,WSe),VSe(sL,o,a,qSe),lL(s,a)},bezierCurveTo(e,t,n,r,i,o){const s=$1(e,t),a=T1(e,t),l=$1(n,r),c=T1(n,r),u=$1(i,o),f=T1(i,o);USe(oL,s,l,u,WSe),USe(sL,a,c,f,qSe),lL(u,f)},arc(e,t,n,r,i,o){if(r+=V1,i+=V1,oL=n*Math.cos(i)+e,sL=n*Math.sin(i)+t,Math.abs(i-r)>Ran)Ry(e-n,t-n),Ry(e+n,t+n);else{const s=c=>Ry(n*Math.cos(c)+e,n*Math.sin(c)+t);let a,l;if(s(r),s(i),i!==r)if(r=r%wh,r<0&&(r+=wh),i=i%wh,i<0&&(i+=wh),i<r&&(o=!o,a=r,r=i,i=a),o)for(i-=wh,a=r-r%k1,l=0;l<4&&a>i;++l,a-=k1)s(a);else for(a=r-r%k1+k1,l=0;l<4&&a<i;++l,a=a+k1)s(a)}}};function VSe(e,t,n,r){const i=(e-t)/(e+n-2*t);0<i&&i<1&&r(e+(t-e)*i)}function USe(e,t,n,r,i){const o=r-e+3*t-3*n,s=e+n-2*t,a=e-t;let l=0,c=0,u;Math.abs(o)>Usn?(u=s*s+a*o,u>=0&&(u=Math.sqrt(u),l=(-s+u)/o,c=(-s-u)/o)):l=.5*a/s,0<l&&l<1&&i(HSe(l,e,t,n,r)),0<c&&c<1&&i(HSe(c,e,t,n,r))}function HSe(e,t,n,r,i){const o=1-e,s=o*o,a=e*e;return s*o*t+3*s*e*n+3*o*a*r+a*e*i}var c0=(c0=l0(1,1))?c0.getContext("2d"):null;const BK=new Po;function zue(e){return function(t,n){if(!c0)return!0;e(c0,t),BK.clear().union(t.bounds).intersect(n).round();const{x1:r,y1:i,x2:o,y2:s}=BK;for(let a=i;a<=s;++a)for(let l=r;l<=o;++l)if(c0.isPointInPath(l,a))return!0;return!1}}function Que(e,t){return t.contains(e.x||0,e.y||0)}function DHe(e,t){const n=e.x||0,r=e.y||0,i=e.width||0,o=e.height||0;return t.intersects(BK.set(n,r,n+i,r+o))}function MHe(e,t){const n=e.x||0,r=e.y||0,i=e.x2!=null?e.x2:n,o=e.y2!=null?e.y2:r;return Zw(t,n,r,i,o)}function Zw(e,t,n,r,i){const{x1:o,y1:s,x2:a,y2:l}=e,c=r-t,u=i-n;let f=0,d=1,h,p,g,v;for(v=0;v<4;++v){if(v===0&&(h=-c,p=-(o-t)),v===1&&(h=c,p=a-t),v===2&&(h=-u,p=-(s-n)),v===3&&(h=u,p=l-n),Math.abs(h)<1e-10&&p<0)return!1;if(g=p/h,h<0){if(g>d)return!1;g>f&&(f=g)}else if(h>0){if(g<f)return!1;g<d&&(d=g)}}return!0}function BE(e,t){e.globalCompositeOperation=t.blend||"source-over"}function jf(e,t){return e??t}function XSe(e,t){const n=t.length;for(let r=0;r<n;++r)e.addColorStop(t[r].offset,t[r].color);return e}function Man(e,t,n){const r=n.width(),i=n.height();let o;if(t.gradient==="radial")o=e.createRadialGradient(n.x1+jf(t.x1,.5)*r,n.y1+jf(t.y1,.5)*i,Math.max(r,i)*jf(t.r1,0),n.x1+jf(t.x2,.5)*r,n.y1+jf(t.y2,.5)*i,Math.max(r,i)*jf(t.r2,.5));else{const s=jf(t.x1,0),a=jf(t.y1,0),l=jf(t.x2,1),c=jf(t.y2,0);if(s===l||a===c||r===i)o=e.createLinearGradient(n.x1+s*r,n.y1+a*i,n.x1+l*r,n.y1+c*i);else{const u=l0(Math.ceil(r),Math.ceil(i)),f=u.getContext("2d");return f.scale(r,i),f.fillStyle=XSe(f.createLinearGradient(s,a,l,c),t.stops),f.fillRect(0,0,r,i),e.createPattern(u,"no-repeat")}}return XSe(o,t.stops)}function NHe(e,t,n){return Nue(n)?Man(e,n,t.bounds):n}function RF(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=NHe(e,t,t.fill),!0):!1}var Nan=[];function WE(e,t,n){var r=(r=t.strokeWidth)!=null?r:1;return r<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=NHe(e,t,t.stroke),e.lineWidth=r,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||Nan),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function Ian(e,t){return e.zindex-t.zindex||e.index-t.index}function Bue(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],r,i,o;for(i=0,o=t.length;i<o;++i)r=t[i],r.index=i,r.zindex&&n.push(r);return e.zdirty=!1,e.zitems=n.sort(Ian)}function Ad(e,t){var n=e.items,r,i;if(!n||!n.length)return;const o=Bue(e);if(o&&o.length){for(r=0,i=n.length;r<i;++r)n[r].zindex||t(n[r]);n=o}for(r=0,i=n.length;r<i;++r)t(n[r])}function DF(e,t){var n=e.items,r,i;if(!n||!n.length)return null;const o=Bue(e);for(o&&o.length&&(n=o),i=n.length;--i>=0;)if(r=t(n[i]))return r;if(n===o){for(n=e.items,i=n.length;--i>=0;)if(!n[i].zindex&&(r=t(n[i])))return r}return null}function Wue(e){return function(t,n,r){Ad(n,i=>{(!r||r.intersects(i.bounds))&&IHe(e,t,i,i)})}}function Lan(e){return function(t,n,r){n.items.length&&(!r||r.intersects(n.bounds))&&IHe(e,t,n.items[0],n.items)}}function IHe(e,t,n,r){var i=n.opacity==null?1:n.opacity;i!==0&&(e(t,r)||(BE(t,n),n.fill&&RF(t,n,i)&&t.fill(),n.stroke&&WE(t,n,i)&&t.stroke()))}function T9(e){return e=e||pf,function(t,n,r,i,o,s){return r*=t.pixelRatio,i*=t.pixelRatio,DF(n,a=>{const l=a.bounds;if(!(l&&!l.contains(o,s)||!l)&&e(t,a,r,i,o,s))return a})}}function TD(e,t){return function(n,r,i,o){var s=Array.isArray(r)?r[0]:r,a=t??s.fill,l=s.stroke&&n.isPointInStroke,c,u;return l&&(c=s.strokeWidth,u=s.strokeCap,n.lineWidth=c??1,n.lineCap=u??"butt"),e(n,r)?!1:a&&n.isPointInPath(i,o)||l&&n.isPointInStroke(i,o)}}function que(e){return T9(TD(e))}function fb(e,t){return"translate("+e+","+t+")"}function Vue(e){return"rotate("+e+")"}function jan(e,t){return"scale("+e+","+t+")"}function LHe(e){return fb(e.x||0,e.y||0)}function Fan(e){return fb(e.x||0,e.y||0)+(e.angle?" "+Vue(e.angle):"")}function zan(e){return fb(e.x||0,e.y||0)+(e.angle?" "+Vue(e.angle):"")+(e.scaleX||e.scaleY?" "+jan(e.scaleX||1,e.scaleY||1):"")}function Uue(e,t,n){function r(s,a){s("transform",Fan(a)),s("d",t(null,a))}function i(s,a){return t($D(s,a.angle),a),bm(s,a).translate(a.x||0,a.y||0)}function o(s,a){var l=a.x||0,c=a.y||0,u=a.angle||0;s.translate(l,c),u&&s.rotate(u*=U0),s.beginPath(),t(s,a),u&&s.rotate(-u),s.translate(-l,-c)}return{type:e,tag:"path",nested:!1,attr:r,bound:i,draw:Wue(o),pick:que(o),isect:n||zue(o)}}var Qan=Uue("arc",Can);function Ban(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],r=e[0].orient==="horizontal"?"y":"x",i=e.length,o=1/0,s,a;--i>=0;)e[i].defined!==!1&&(a=Math.abs(e[i][r]-n),a<o&&(o=a,s=e[i]));return s}function Wan(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),r=e.length,i,o,s;--r>=0;)if(e[r].defined!==!1&&(i=e[r].x-t[0],o=e[r].y-t[1],s=i*i+o*o,s<n))return e[r];return null}function qan(e,t){for(var n=e.length,r,i,o;--n>=0;)if(e[n].defined!==!1&&(r=e[n].x-t[0],i=e[n].y-t[1],o=r*r+i*i,r=e[n].size||1,o<r*r))return e[n];return null}function Hue(e,t,n){function r(l,c){var u=c.mark.items;u.length&&l("d",t(null,u))}function i(l,c){var u=c.items;return u.length===0?l:(t($D(l),u),bm(l,u[0]))}function o(l,c){l.beginPath(),t(l,c)}const s=TD(o);function a(l,c,u,f,d,h){var p=c.items,g=c.bounds;return!p||!p.length||g&&!g.contains(d,h)?null:(u*=l.pixelRatio,f*=l.pixelRatio,s(l,p,u,f)?p[0]:null)}return{type:e,tag:"path",nested:!0,attr:r,bound:i,draw:Lan(o),pick:a,isect:Que,tip:n}}var Van=Hue("area",_an,Ban);function Uan(e,t){var n=t.clip;e.save(),ln(n)?(e.beginPath(),n(e),e.clip()):jHe(e,t.group)}function jHe(e,t){e.beginPath(),Lue(t)?$_(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function FHe(e){const t=jf(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function Han(e,t){e("transform",LHe(t))}function zHe(e,t){const n=FHe(t);e("d",$_(null,t,n,n))}function Xan(e,t){e("class","background"),e("aria-hidden",!0),zHe(e,t)}function Zan(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?zHe(e,t):e("d","")}function Yan(e,t,n){const r=t.clip?jue(n,t,t):null;e("clip-path",r)}function Gan(e,t){if(!t.clip&&t.items){const n=t.items,r=n.length;for(let i=0;i<r;++i)e.union(n[i].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),bm(e,t),e.translate(t.x||0,t.y||0)}function nA(e,t,n,r){const i=FHe(t);e.beginPath(),$_(e,t,(n||0)+i,(r||0)+i)}const Kan=TD(nA),Jan=TD(nA,!1),eln=TD(nA,!0);function tln(e,t,n,r){Ad(t,i=>{const o=i.x||0,s=i.y||0,a=i.strokeForeground,l=i.opacity==null?1:i.opacity;(i.stroke||i.fill)&&l&&(nA(e,i,o,s),BE(e,i),i.fill&&RF(e,i,l)&&e.fill(),i.stroke&&!a&&WE(e,i,l)&&e.stroke()),e.save(),e.translate(o,s),i.clip&&jHe(e,i),n&&n.translate(-o,-s),Ad(i,c=>{(c.marktype==="group"||r==null||r.includes(c.marktype))&&this.draw(e,c,n,r)}),n&&n.translate(o,s),e.restore(),a&&i.stroke&&l&&(nA(e,i,o,s),BE(e,i),WE(e,i,l)&&e.stroke())})}function nln(e,t,n,r,i,o){if(t.bounds&&!t.bounds.contains(i,o)||!t.items)return null;const s=n*e.pixelRatio,a=r*e.pixelRatio;return DF(t,l=>{let c,u,f;const d=l.bounds;if(d&&!d.contains(i,o))return;u=l.x||0,f=l.y||0;const h=u+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(i<u||i>h||o<f||o>p))return;if(e.save(),e.translate(u,f),u=i-u,f=o-f,g&&Lue(l)&&!eln(e,l,s,a))return e.restore(),null;const v=l.strokeForeground,y=t.interactive!==!1;return y&&v&&l.stroke&&Jan(e,l,s,a)?(e.restore(),l):(c=DF(l,O=>rln(O,u,f)?this.pick(O,n,r,u,f):null),!c&&y&&(l.fill||!v&&l.stroke)&&Kan(e,l,s,a)&&(c=l),e.restore(),c||null)})}function rln(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var iln={type:"group",tag:"g",nested:!1,attr:Han,bound:Gan,draw:tln,pick:nln,isect:DHe,content:Yan,background:Xan,foreground:Zan},rA={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Xue(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(r=>{e.image=r,e.image.url=e.url})),n}function Zue(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function Yue(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function P9(e,t){return e==="center"?t/2:e==="right"?t:0}function A9(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function oln(e,t,n){const r=Xue(t,n),i=Zue(t,r),o=Yue(t,r),s=(t.x||0)-P9(t.align,i),a=(t.y||0)-A9(t.baseline,o),l=!r.src&&r.toDataURL?r.toDataURL():r.src||"";e("href",l,rA["xmlns:xlink"],"xlink:href"),e("transform",fb(s,a)),e("width",i),e("height",o),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function sln(e,t){const n=t.image,r=Zue(t,n),i=Yue(t,n),o=(t.x||0)-P9(t.align,r),s=(t.y||0)-A9(t.baseline,i);return e.set(o,s,o+r,s+i)}function aln(e,t,n){Ad(t,r=>{if(n&&!n.intersects(r.bounds))return;const i=Xue(r,this);let o=Zue(r,i),s=Yue(r,i);if(o===0||s===0)return;let a=(r.x||0)-P9(r.align,o),l=(r.y||0)-A9(r.baseline,s),c,u,f,d;r.aspect!==!1&&(u=i.width/i.height,f=r.width/r.height,u===u&&f===f&&u!==f&&(f<u?(d=o/u,l+=(s-d)/2,s=d):(d=s*u,a+=(o-d)/2,o=d))),(i.complete||i.toDataURL)&&(BE(e,r),e.globalAlpha=(c=r.opacity)!=null?c:1,e.imageSmoothingEnabled=r.smooth!==!1,e.drawImage(i,a,l,o,s))})}var lln={type:"image",tag:"image",nested:!1,attr:oln,bound:sln,draw:aln,pick:T9(),isect:pf,get:Xue,xOffset:P9,yOffset:A9},cln=Hue("line",kan,Wan);function uln(e,t){var n=t.scaleX||1,r=t.scaleY||1;(n!==1||r!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",zan(t)),e("d",t.path)}function cL(e,t){var n=t.path;if(n==null)return!0;var r=t.x||0,i=t.y||0,o=t.scaleX||1,s=t.scaleY||1,a=(t.angle||0)*U0,l=t.pathCache;(!l||l.path!==n)&&((t.pathCache=l=QE(n)).path=n),a&&e.rotate&&e.translate?(e.translate(r,i),e.rotate(a),tA(e,l,0,0,o,s),e.rotate(-a),e.translate(-r,-i)):tA(e,l,r,i,o,s)}function fln(e,t){return cL($D(e,t.angle),t)?e.set(0,0,0,0):bm(e,t,!0)}var dln={type:"path",tag:"path",nested:!1,attr:uln,bound:fln,draw:Wue(cL),pick:que(cL),isect:zue(cL)};function hln(e,t){e("d",$_(null,t))}function pln(e,t){var n,r;return bm(e.set(n=t.x||0,r=t.y||0,n+t.width||0,r+t.height||0),t)}function ZSe(e,t){e.beginPath(),$_(e,t)}var gln={type:"rect",tag:"path",nested:!1,attr:hln,bound:pln,draw:Wue(ZSe),pick:que(ZSe),isect:DHe};function mln(e,t){e("transform",LHe(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function yln(e,t){var n,r;return bm(e.set(n=t.x||0,r=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:r),t)}function QHe(e,t,n){var r,i,o,s;return t.stroke&&WE(e,t,n)?(r=t.x||0,i=t.y||0,o=t.x2!=null?t.x2:r,s=t.y2!=null?t.y2:i,e.beginPath(),e.moveTo(r,i),e.lineTo(o,s),!0):!1}function vln(e,t,n){Ad(t,r=>{if(!(n&&!n.intersects(r.bounds))){var i=r.opacity==null?1:r.opacity;i&&QHe(e,r,i)&&(BE(e,r),e.stroke())}})}function bln(e,t,n,r){return e.isPointInStroke?QHe(e,t,1)&&e.isPointInStroke(n,r):!1}var Oln={type:"rule",tag:"line",nested:!1,attr:mln,bound:yln,draw:vln,pick:T9(bln),isect:MHe},xln=Uue("shape",$an),wln=Uue("symbol",Tan,Que);const YSe=S8e();var Gc={height:_p,measureWidth:Gue,estimateWidth:MF,width:MF,canvas:BHe};BHe(!0);function BHe(e){Gc.width=e&&c0?Gue:MF}function MF(e,t){return WHe(X0(e,t),_p(e))}function WHe(e,t){return~~(.8*e.length*t)}function Gue(e,t){return _p(e)<=0||!(t=X0(e,t))?0:qHe(t,R9(e))}function qHe(e,t){const n=`(${t}) ${e}`;let r=YSe.get(n);return r===void 0&&(c0.font=t,r=c0.measureText(e).width,YSe.set(n,r)),r}function _p(e){return e.fontSize!=null?+e.fontSize||0:11}function H0(e){return e.lineHeight!=null?e.lineHeight:_p(e)+2}function Sln(e){return ze(e)?e.length>1?e:e[0]:e}function PD(e){return Sln(e.lineBreak&&e.text&&!ze(e.text)?e.text.split(e.lineBreak):e.text)}function Kue(e){const t=PD(e);return(ze(t)?t.length-1:0)*H0(e)}function X0(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?Cln(e,n):n}function Eln(e){if(Gc.width===Gue){const t=R9(e);return n=>qHe(n,t)}else if(Gc.width===MF){const t=_p(e);return n=>WHe(n,t)}else return t=>Gc.width(e,t)}function Cln(e,t){var n=+e.limit,r=Eln(e);if(r(t)<n)return t;var i=e.ellipsis||"…",o=e.dir==="rtl",s=0,a=t.length,l;if(n-=r(i),o){for(;s<a;)l=s+a>>>1,r(t.slice(l))>n?s=l+1:a=l;return i+t.slice(s)}else{for(;s<a;)l=1+(s+a>>>1),r(t.slice(0,l))<n?s=l:a=l-1;return t.slice(0,s)+i}}function AD(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function R9(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+_p(e)+"px "+AD(e,t)}function Jue(e){var t=e.baseline,n=_p(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*H0(e):t==="line-bottom"?.29*n-.5*H0(e):0)}const _ln={left:"start",center:"middle",right:"end"},HT=new Po;function D9(e){var t=e.x||0,n=e.y||0,r=e.radius||0,i;return r&&(i=(e.theta||0)-k1,t+=r*Math.cos(i),n+=r*Math.sin(i)),HT.x1=t,HT.y1=n,HT}function kln(e,t){var n=t.dx||0,r=(t.dy||0)+Jue(t),i=D9(t),o=i.x1,s=i.y1,a=t.angle||0,l;e("text-anchor",_ln[t.align]||"start"),a?(l=fb(o,s)+" "+Vue(a),(n||r)&&(l+=" "+fb(n,r))):l=fb(o+n,s+r),e("transform",l)}function efe(e,t,n){var r=Gc.height(t),i=t.align,o=D9(t),s=o.x1,a=o.y1,l=t.dx||0,c=(t.dy||0)+Jue(t)-Math.round(.8*r),u=PD(t),f;if(ze(u)?(r+=H0(t)*(u.length-1),f=u.reduce((d,h)=>Math.max(d,Gc.width(t,h)),0)):f=Gc.width(t,u),i==="center"?l-=f/2:i==="right"&&(l-=f),e.set(l+=s,c+=a,l+f,c+r),t.angle&&!n)e.rotate(t.angle*U0,s,a);else if(n===2)return e.rotatedPoints(t.angle*U0,s,a);return e}function $ln(e,t,n){Ad(t,r=>{var i=r.opacity==null?1:r.opacity,o,s,a,l,c,u,f;if(!(n&&!n.intersects(r.bounds)||i===0||r.fontSize<=0||r.text==null||r.text.length===0)){if(e.font=R9(r),e.textAlign=r.align||"left",o=D9(r),s=o.x1,a=o.y1,r.angle&&(e.save(),e.translate(s,a),e.rotate(r.angle*U0),s=a=0),s+=r.dx||0,a+=(r.dy||0)+Jue(r),u=PD(r),BE(e,r),ze(u))for(c=H0(r),l=0;l<u.length;++l)f=X0(r,u[l]),r.fill&&RF(e,r,i)&&e.fillText(f,s,a),r.stroke&&WE(e,r,i)&&e.strokeText(f,s,a),a+=c;else f=X0(r,u),r.fill&&RF(e,r,i)&&e.fillText(f,s,a),r.stroke&&WE(e,r,i)&&e.strokeText(f,s,a);r.angle&&e.restore()}})}function Tln(e,t,n,r,i,o){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var s=D9(t),a=s.x1,l=s.y1,c=efe(HT,t,1),u=-t.angle*U0,f=Math.cos(u),d=Math.sin(u),h=f*i-d*o+(a-f*a+d*l),p=d*i+f*o+(l-d*a-f*l);return c.contains(h,p)}function Pln(e,t){const n=efe(HT,e,2);return Zw(t,n[0],n[1],n[2],n[3])||Zw(t,n[0],n[1],n[4],n[5])||Zw(t,n[4],n[5],n[6],n[7])||Zw(t,n[2],n[3],n[6],n[7])}var Aln={type:"text",tag:"text",nested:!1,attr:kln,bound:efe,draw:$ln,pick:T9(Tln),isect:Pln},Rln=Hue("trail",Pan,qan),ou={arc:Qan,area:Van,group:iln,image:lln,line:cln,path:dln,rect:gln,rule:Oln,shape:xln,symbol:wln,text:Aln,trail:Rln};function WK(e,t,n){var r=ou[e.mark.marktype],i=t||r.bound;return r.nested&&(e=e.mark),i(e.bounds||(e.bounds=new Po),e,n)}var GSe={mark:null};function VHe(e,t,n){var r=ou[e.marktype],i=r.bound,o=e.items,s=o&&o.length,a,l,c,u;if(r.nested)return s?c=o[0]:(GSe.mark=e,c=GSe),u=WK(c,i,n),t=t&&t.union(u)||u,t;if(t=t||e.bounds&&e.bounds.clear()||new Po,s)for(a=0,l=o.length;a<l;++a)t.union(WK(o[a],i,n));return e.bounds=t}const Dln=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function UHe(e,t){return JSON.stringify(e,Dln,t)}function HHe(e){const t=typeof e=="string"?JSON.parse(e):e;return XHe(t)}function XHe(e){var t=e.marktype,n=e.items,r,i,o;if(n)for(i=0,o=n.length;i<o;++i)r=t?"mark":"group",n[i][r]=e,n[i].zindex&&(n[i][r].zdirty=!0),(t||r)==="group"&&XHe(n[i]);return t&&VHe(e),e}function tfe(e){arguments.length?this.root=HHe(e):(this.root=ZHe({marktype:"group",name:"root",role:"frame"}),this.root.items=[new k9(this.root)])}tfe.prototype={toJSON(e){return UHe(this.root,e||0)},mark(e,t,n){t=t||this.root.items[0];const r=ZHe(e,t);return t.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}};function ZHe(e,t){const n={bounds:new Po,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function Dy(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function nfe(e,t){t=t.toLowerCase();for(var n=e.childNodes,r=0,i=n.length;r<i;++r)if(n[r].tagName.toLowerCase()===t)return n[r]}function Vo(e,t,n,r){var i=e.childNodes[t],o;return(!i||i.tagName.toLowerCase()!==n.toLowerCase())&&(o=i||null,i=Dy(e.ownerDocument,n,r),e.insertBefore(i,o)),i}function Du(e,t){for(var n=e.childNodes,r=n.length;r>t;)e.removeChild(n[--r]);return e}function YHe(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function M9(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function Mln(e,t,n,r){var i=e&&e.mark,o,s;if(i&&(o=ou[i.marktype]).tip){for(s=M9(t,n),s[0]-=r[0],s[1]-=r[1];e=e.mark.group;)s[0]-=e.x||0,s[1]-=e.y||0;e=o.tip(i.items,s)}return e}function Z0(e,t){this._active=null,this._handlers={},this._loader=e||tD(),this._tooltip=t||Nln}function Nln(e,t,n,r){e.element().setAttribute("title",r||"")}Z0.prototype={initialize(e,t,n){return this._el=e,this._obj=n||null,this.origin(t)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(e){return arguments.length?(this._origin=e||[0,0],this):this._origin.slice()},scene(e){return arguments.length?(this._scene=e,this):this._scene},on(){},off(){},_handlerIndex(e,t,n){for(let r=e?e.length:0;--r>=0;)if(e[r].type===t&&(!n||e[r].handler===n))return r;return-1},handlers(e){const t=this._handlers,n=[];if(e)n.push(...t[this.eventName(e)]);else for(const r in t)n.push(...t[r]);return n},eventName(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)},handleHref(e,t,n){this._loader.sanitize(n,{context:"href"}).then(r=>{const i=new MouseEvent(e.type,e),o=Dy(null,"a");for(const s in r)o.setAttribute(s,r[s]);o.dispatchEvent(i)}).catch(()=>{})},handleTooltip(e,t,n){if(t&&t.tooltip!=null){t=Mln(t,e,this.canvas(),this._origin);const r=n&&t&&t.tooltip||null;this._tooltip.call(this._obj,this,e,t,r)}},getItemBoundingClientRect(e){const t=this.canvas();if(!t)return;const n=t.getBoundingClientRect(),r=this._origin,i=e.bounds,o=i.width(),s=i.height();let a=i.x1+r[0]+n.left,l=i.y1+r[1]+n.top;for(;e.mark&&(e=e.mark.group);)a+=e.x||0,l+=e.y||0;return{x:a,y:l,width:o,height:s,left:a,top:l,right:a+o,bottom:l+s}}};function pu(e){this._el=null,this._bgcolor=null,this._loader=new Fue(e)}pu.prototype={initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return arguments.length===0?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(e,t){const n=this;return n._call=function(){n._render(e,t)},n._call(),n._call=null,n},_render(){},renderAsync(e,t){const n=this.render(e,t);return this._ready?this._ready.then(()=>n):Promise.resolve(n)},_load(e,t){var n=this,r=n._loader[e](t);if(!n._ready){const i=n._call;n._ready=n._loader.ready().then(o=>{o&&i(),n._ready=null})}return r},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const Iln="keydown",Lln="keypress",jln="keyup",GHe="dragenter",uL="dragleave",KHe="dragover",qK="pointerdown",Fln="pointerup",NF="pointermove",XT="pointerout",JHe="pointerover",VK="mousedown",zln="mouseup",eXe="mousemove",UK="mouseout",tXe="mouseover",IF="click",Qln="dblclick",Bln="wheel",nXe="mousewheel",LF="touchstart",jF="touchmove",FF="touchend",Wln=[Iln,Lln,jln,GHe,uL,KHe,qK,Fln,NF,XT,JHe,VK,zln,eXe,UK,tXe,IF,Qln,Bln,nXe,LF,jF,FF],HK=NF,iA=XT,XK=IF;function Y0(e,t){Z0.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}const qln=e=>e===LF||e===jF||e===FF?[LF,jF,FF]:[e];function KSe(e,t){qln(t).forEach(n=>Vln(e,n))}function Vln(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?r=>e[t](r):r=>e.fire(t,r)))}function L$(e,t,n){t.forEach(r=>e.fire(r,n))}function JSe(e,t,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i?L$(this,e,r):((!i||!i.exit)&&L$(this,n,r),this._active=o,L$(this,t,r),L$(this,e,r))}}function eEe(e){return function(t){L$(this,e,t),this._active=null}}Ke(Y0,Z0,{initialize(e,t,n){return this._canvas=e&&nfe(e,"canvas"),[IF,VK,qK,NF,XT,uL].forEach(r=>KSe(this,r)),Z0.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:Wln,DOMMouseScroll(e){this.fire(nXe,e)},pointermove:JSe([NF,eXe],[JHe,tXe],[XT,UK]),dragover:JSe([KHe],[GHe],[uL]),pointerout:eEe([XT,UK]),dragleave:eEe([uL]),pointerdown(e){this._down=this._active,this.fire(qK,e)},mousedown(e){this._down=this._active,this.fire(VK,e)},click(e){this._down===this._active&&(this.fire(IF,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(LF,e,!0)},touchmove(e){this.fire(jF,e,!0)},touchend(e){this.fire(FF,e,!0),this._touch=null},fire(e,t,n){const r=n?this._touch:this._active,i=this._handlers[e];if(t.vegaType=e,e===XK&&r&&r.href?this.handleHref(t,r,r.href):(e===HK||e===iA)&&this.handleTooltip(t,r,e!==iA),i)for(let o=0,s=i.length;o<s;++o)i[o].handler.call(this._obj,t,r)},on(e,t){const n=this.eventName(e),r=this._handlers;return this._handlerIndex(r[n],e,t)<0&&(KSe(this,e),(r[n]||(r[n]=[])).push({type:e,handler:t})),this},off(e,t){const n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&r.splice(i,1),this},pickEvent(e){const t=M9(e,this._canvas),n=this._origin;return this.pick(this._scene,t[0],t[1],t[0]-n[0],t[1]-n[1])},pick(e,t,n,r,i){const o=this.context();return ou[e.marktype].pick.call(this,o,e,t,n,r,i)}});function Uln(){return typeof window<"u"&&window.devicePixelRatio||1}function Hln(e,t,n,r,i,o){const s=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),l=s?Uln():i;e.width=t*l,e.height=n*l;for(const c in o)a[c]=o[c];return s&&l!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*r[0],l*r[1]),e}function oA(e){pu.call(this,e),this._options={},this._redraw=!1,this._dirty=new Po,this._tempb=new Po}const tEe=pu.prototype,Xln=(e,t,n)=>new Po().set(0,0,t,n).translate(-e[0],-e[1]);function Zln(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}Ke(oA,pu,{initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:l0(1,1,this._options.type),e&&this._canvas&&(Du(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),tEe.initialize.call(this,e,t,n,r,i)},resize(e,t,n,r){if(tEe.resize.call(this,e,t,n,r),this._canvas)Hln(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const i=this._options.externalContext;i||Le("CanvasRenderer is missing a valid canvas or context"),i.scale(this._scale,this._scale),i.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e,t){const n=this.context(),r=this._origin,i=this._width,o=this._height,s=this._dirty,a=Xln(r,i,o);n.save();const l=this._redraw||s.empty()?(this._redraw=!1,a.expand(1)):Zln(n,a.intersect(s),r);return this.clear(-r[0],-r[1],i,o),this.draw(n,e,l,t),n.restore(),s.clear(),this},draw(e,t,n,r){if(t.marktype!=="group"&&r!=null&&!r.includes(t.marktype))return;const i=ou[t.marktype];t.clip&&Uan(e,t),i.draw.call(this,e,t,n,r),t.clip&&e.restore()},clear(e,t,n,r){const i=this._options,o=this.context();i.type!=="pdf"&&!i.externalContext&&o.clearRect(e,t,n,r),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,r))}});function rfe(e,t){Z0.call(this,e,t);const n=this;n._hrefHandler=ZK(n,(r,i)=>{i&&i.href&&n.handleHref(r,i,i.href)}),n._tooltipHandler=ZK(n,(r,i)=>{n.handleTooltip(r,i,r.type!==iA)})}const ZK=(e,t)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,t.call(e._obj,n,r)};Ke(rfe,Z0,{initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener(XK,this._hrefHandler),r.removeEventListener(HK,this._tooltipHandler),r.removeEventListener(iA,this._tooltipHandler)),this._svg=r=e&&nfe(e,"svg"),r&&(r.addEventListener(XK,this._hrefHandler),r.addEventListener(HK,this._tooltipHandler),r.addEventListener(iA,this._tooltipHandler)),Z0.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),r=this._handlers;if(this._handlerIndex(r[n],e,t)<0){const o={type:e,handler:t,listener:ZK(this,t)};(r[n]||(r[n]=[])).push(o),this._svg&&this._svg.addEventListener(n,o.listener)}return this},off(e,t){const n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const rXe="aria-hidden",ife="aria-label",ofe="role",sfe="aria-roledescription",iXe="graphics-object",afe="graphics-symbol",oXe=(e,t,n)=>({[ofe]:e,[sfe]:t,[ife]:n||void 0}),Yln=kd(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),nEe={axis:{desc:"axis",caption:Jln},legend:{desc:"legend",caption:ecn},"title-text":{desc:"title",caption:e=>`Title text '${iEe(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${iEe(e)}'`}},rEe={ariaRole:ofe,ariaRoleDescription:sfe,description:ife};function sXe(e,t){const n=t.aria===!1;if(e(rXe,n||void 0),n||t.description==null)for(const r in rEe)e(rEe[r],void 0);else{const r=t.mark.marktype;e(ife,t.description),e(ofe,t.ariaRole||(r==="group"?iXe:afe)),e(sfe,t.ariaRoleDescription||`${r} mark`)}}function aXe(e){return e.aria===!1?{[rXe]:!0}:Yln[e.role]?null:nEe[e.role]?Kln(e,nEe[e.role]):Gln(e)}function Gln(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(r=>r.description!=null&&r.aria!==!1);return oXe(n?iXe:afe,`${t} mark container`,e.description)}function Kln(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return oXe(t.role||afe,t.desc,n.description||r(n))}catch{return null}}function iEe(e){return ct(e.text).join(" ")}function Jln(e){const t=e.datum,n=e.orient,r=t.title?lXe(e):null,i=e.context,o=i.scales[t.scale].value,s=i.dataflow.locale(),a=o.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(r?` titled '${r}'`:"")+` for a ${zE(a)?"discrete":a} scale with ${SHe(s,o,e)}`}function ecn(e){const t=e.datum,n=t.title?lXe(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),s=e.context,a=s.scales[i[o[0]]].value,l=s.dataflow.locale();return ncn(r)+(n?` titled '${n}'`:"")+` for ${tcn(o)} with ${SHe(l,a,e)}`}function lXe(e){try{return ct(jn(e.items).items[0].text).join(" ")}catch{return null}}function tcn(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+jn(e)}function ncn(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const cXe=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),rcn=e=>cXe(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function lfe(){let e="",t="",n="";const r=[],i=()=>t=n="",o=l=>{t&&(e+=`${t}>${n}`,i()),r.push(l)},s=(l,c)=>(c!=null&&(t+=` ${l}="${rcn(c)}"`),a),a={open(l){o(l),t="<"+l;for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f<c;f++)u[f-1]=arguments[f];for(const d of u)for(const h in d)s(h,d[h]);return a},close(){const l=r.pop();return t?e+=t+(n?`>${n}</${l}>`:"/>"):e+=`</${l}>`,i(),a},attr:s,text:l=>(n+=cXe(l),a),toString:()=>e};return a}const uXe=e=>fXe(lfe(),e)+"";function fXe(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,r=n.length;for(let i=0;i<r;++i)e.attr(n[i].name,n[i].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const r of n)r.nodeType===3?e.text(r.nodeValue):fXe(e,r)}return e.close()}const zF={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},QF={blend:"mix-blend-mode"},dXe={fill:"none","stroke-miterlimit":10},Lk=0,oEe="http://www.w3.org/2000/xmlns/",Bo=rA.xmlns;function N9(e){pu.call(this,e),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}const lU=pu.prototype;Ke(N9,pu,{initialize(e,t,n,r,i){return this._defs={},this._clearDefs(),e&&(this._svg=Vo(e,0,"svg",Bo),this._svg.setAttributeNS(oEe,"xmlns",Bo),this._svg.setAttributeNS(oEe,"xmlns:xlink",rA["xmlns:xlink"]),this._svg.setAttribute("version",rA.version),this._svg.setAttribute("class","marks"),Du(e,1),this._root=Vo(this._svg,Lk,"g",Bo),My(this._root,dXe),Du(this._svg,Lk+1)),this.background(this._bgcolor),lU.initialize.call(this,e,t,n,r,i)},background(e){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",e),lU.background.apply(this,arguments)},resize(e,t,n,r){return lU.resize.call(this,e,t,n,r),this._svg&&(My(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this},canvas(){return this._svg},svg(){const e=this._svg,t=this._bgcolor;if(!e)return null;let n;t&&(e.removeAttribute("style"),n=Vo(e,Lk,"rect",Bo),My(n,{width:this._width,height:this._height,fill:t}));const r=uXe(e);return t&&(e.removeChild(n),this._svg.style.setProperty("background-color",t)),r},_render(e,t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,e,void 0,t),Du(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(e){e.dirty!==this._dirtyID&&(e.dirty=this._dirtyID,this._dirty.push(e))},isDirty(e){return this._dirtyAll||!e._svg||!e._svg.ownerSVGElement||e.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const e=this._dirty;if(!e.length||!this._dirtyID)return!0;const t=++this._dirtyID;let n,r,i,o,s,a,l;for(s=0,a=e.length;s<a;++s)if(n=e[s],r=n.mark,r.marktype!==i&&(i=r.marktype,o=ou[i]),r.zdirty&&r.dirty!==t&&(this._dirtyAll=!1,sEe(n,t),r.items.forEach(c=>{c.dirty=t})),!r.zdirty){if(n.exit){o.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(o,l._svg,l)):n._svg&&(l=n._svg.parentNode,l&&l.removeChild(n._svg)),n._svg=null;continue}n=o.nested?r.items[0]:n,n._update!==t&&(!n._svg||!n._svg.ownerSVGElement?(this._dirtyAll=!1,sEe(n,t)):this._update(o,n._svg,n),n._update=t)}return!this._dirtyAll},mark(e,t,n,r){if(!this.isDirty(t))return t._svg;const i=this._svg,o=t.marktype,s=ou[o],a=t.interactive===!1?"none":null,l=s.tag==="g",c=aEe(t,e,n,"g",i);if(o!=="group"&&r!=null&&!r.includes(o))return Du(c,0),t._svg;c.setAttribute("class",YHe(t));const u=aXe(t);for(const p in u)Ga(c,p,u[p]);l||Ga(c,"pointer-events",a),Ga(c,"clip-path",t.clip?jue(this,t,t.group):null);let f=null,d=0;const h=p=>{const g=this.isDirty(p),v=aEe(p,c,f,s.tag,i);g&&(this._update(s,v,p),l&&scn(this,v,p,r)),f=v,++d};return s.nested?t.items.length&&h(t.items[0]):Ad(t,h),Du(c,d),c},_update(e,t,n){Og=t,va=t.__values__,sXe(ZT,n),e.attr(ZT,n,this);const r=lcn[e.type];r&&r.call(this,e,t,n),Og&&this.style(Og,n)},style(e,t){if(t!=null){for(const n in zF){let r=n==="font"?AD(t):t[n];if(r===va[n])continue;const i=zF[n];r==null?e.removeAttribute(i):(Nue(r)&&(r=CHe(r,this._defs.gradient,hXe())),e.setAttribute(i,r+"")),va[n]=r}for(const n in QF)fL(e,QF[n],t[n])}},defs(){const e=this._svg,t=this._defs;let n=t.el,r=0;for(const i in t.gradient)n||(t.el=n=Vo(e,Lk+1,"defs",Bo)),r=icn(n,t.gradient[i],r);for(const i in t.clipping)n||(t.el=n=Vo(e,Lk+1,"defs",Bo)),r=ocn(n,t.clipping[i],r);n&&(r===0?(e.removeChild(n),t.el=null):Du(n,r))},_clearDefs(){const e=this._defs;e.gradient={},e.clipping={}}});function sEe(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function icn(e,t,n){let r,i,o;if(t.gradient==="radial"){let s=Vo(e,n++,"pattern",Bo);My(s,{id:AF+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),s=Vo(s,0,"rect",Bo),My(s,{width:1,height:1,fill:`url(${hXe()}#${t.id})`}),e=Vo(e,n++,"radialGradient",Bo),My(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=Vo(e,n++,"linearGradient",Bo),My(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(r=0,i=t.stops.length;r<i;++r)o=Vo(e,r,"stop",Bo),o.setAttribute("offset",t.stops[r].offset),o.setAttribute("stop-color",t.stops[r].color);return Du(e,r),n}function ocn(e,t,n){let r;return e=Vo(e,n,"clipPath",Bo),e.setAttribute("id",t.id),t.path?(r=Vo(e,0,"path",Bo),r.setAttribute("d",t.path)):(r=Vo(e,0,"rect",Bo),My(r,{x:0,y:0,width:t.width,height:t.height})),Du(e,1),n+1}function scn(e,t,n,r){t=t.lastChild.previousSibling;let i,o=0;Ad(n,s=>{i=e.mark(t,s,i,r),++o}),Du(t,1+o)}function aEe(e,t,n,r,i){let o=e._svg,s;if(!o&&(s=t.ownerDocument,o=Dy(s,r,Bo),e._svg=o,e.mark&&(o.__data__=e,o.__values__={fill:"default"},r==="g"))){const a=Dy(s,"path",Bo);o.appendChild(a),a.__data__=e;const l=Dy(s,"g",Bo);o.appendChild(l),l.__data__=e;const c=Dy(s,"path",Bo);o.appendChild(c),c.__data__=e,c.__values__={fill:"default"}}return(o.ownerSVGElement!==i||acn(o,n))&&t.insertBefore(o,n?n.nextSibling:t.firstChild),o}function acn(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Og=null,va=null;const lcn={group(e,t,n){const r=Og=t.childNodes[2];va=r.__values__,e.foreground(ZT,n,this),va=t.__values__,Og=t.childNodes[1],e.content(ZT,n,this);const i=Og=t.childNodes[0];e.background(ZT,n,this);const o=n.mark.interactive===!1?"none":null;if(o!==va.events&&(Ga(r,"pointer-events",o),Ga(i,"pointer-events",o),va.events=o),n.strokeForeground&&n.stroke){const s=n.fill;Ga(r,"display",null),this.style(i,n),Ga(i,"stroke",null),s&&(n.fill=null),va=r.__values__,this.style(r,n),s&&(n.fill=s),Og=null}else Ga(r,"display","none")},image(e,t,n){n.smooth===!1?(fL(t,"image-rendering","optimizeSpeed"),fL(t,"image-rendering","pixelated")):fL(t,"image-rendering",null)},text(e,t,n){const r=PD(n);let i,o,s,a;ze(r)?(o=r.map(l=>X0(n,l)),i=o.join(`
`),i!==va.text&&(Du(t,0),s=t.ownerDocument,a=H0(n),o.forEach((l,c)=>{const u=Dy(s,"tspan",Bo);u.__data__=n,u.textContent=l,c&&(u.setAttribute("x",0),u.setAttribute("dy",a)),t.appendChild(u)}),va.text=i)):(o=X0(n,r),o!==va.text&&(t.textContent=o,va.text=o)),Ga(t,"font-family",AD(n)),Ga(t,"font-size",_p(n)+"px"),Ga(t,"font-style",n.fontStyle),Ga(t,"font-variant",n.fontVariant),Ga(t,"font-weight",n.fontWeight)}};function ZT(e,t,n){t!==va[e]&&(n?ccn(Og,e,t,n):Ga(Og,e,t),va[e]=t)}function fL(e,t,n){n!==va[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),va[t]=n)}function My(e,t){for(const n in t)Ga(e,n,t[n])}function Ga(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function ccn(e,t,n,r){n!=null?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}function hXe(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function cfe(e){pu.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}Ke(cfe,pu,{svg(){return this._text},_render(e){const t=lfe();t.open("svg",an({},rA,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;return n&&n!=="transparent"&&n!=="none"&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",dXe,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(e,t){const n=ou[t.marktype],r=n.tag,i=[sXe,n.attr];e.open("g",{class:YHe(t),"clip-path":t.clip?jue(this,t,t.group):null},aXe(t),{"pointer-events":r!=="g"&&t.interactive===!1?"none":null});const o=s=>{const a=this.href(s);if(a&&e.open("a",a),e.open(r,this.attr(t,s,i,r!=="g"?r:null)),r==="text"){const l=PD(s);if(ze(l)){const c={x:0,dy:H0(s)};for(let u=0;u<l.length;++u)e.open("tspan",u?c:null).text(X0(s,l[u])).close()}else e.text(X0(s,l))}else if(r==="g"){const l=s.strokeForeground,c=s.fill,u=s.stroke;l&&u&&(s.stroke=null),e.open("path",this.attr(t,s,n.background,"bgrect")).close(),e.open("g",this.attr(t,s,n.content)),Ad(s,f=>this.mark(e,f)),e.close(),l&&u?(c&&(s.fill=null),s.stroke=u,e.open("path",this.attr(t,s,n.foreground,"bgrect")).close(),c&&(s.fill=c)):e.open("path",this.attr(t,s,n.foreground,"bgfore")).close()}e.close(),a&&e.close()};return n.nested?t.items&&t.items.length&&o(t.items[0]):Ad(t,o),e.close()},href(e){const t=e.href;let n;if(t){if(n=this._hrefs&&this._hrefs[t])return n;this.sanitizeURL(t).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[t]=r})}return null},attr(e,t,n,r){const i={},o=(s,a,l,c)=>{i[c||s]=a};return Array.isArray(n)?n.forEach(s=>s(o,t,this)):n(o,t,this),r&&ucn(i,t,e,r,this._defs),i},defs(e){const t=this._defs.gradient,n=this._defs.clipping;if(Object.keys(t).length+Object.keys(n).length!==0){e.open("defs");for(const i in t){const o=t[i],s=o.stops;o.gradient==="radial"?(e.open("pattern",{id:AF+i,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),e.open("rect",{width:"1",height:"1",fill:"url(#"+i+")"}).close(),e.close(),e.open("radialGradient",{id:i,fx:o.x1,fy:o.y1,fr:o.r1,cx:o.x2,cy:o.y2,r:o.r2})):e.open("linearGradient",{id:i,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2});for(let a=0;a<s.length;++a)e.open("stop",{offset:s[a].offset,"stop-color":s[a].color}).close();e.close()}for(const i in n){const o=n[i];e.open("clipPath",{id:i}),o.path?e.open("path",{d:o.path}).close():e.open("rect",{x:0,y:0,width:o.width,height:o.height}).close(),e.close()}e.close()}}});function ucn(e,t,n,r,i){let o;if(t==null||(r==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),r==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;r==="image"&&t.smooth===!1&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),r==="text"&&(e["font-family"]=AD(t),e["font-size"]=_p(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const s in zF){let a=t[s];const l=zF[s];a==="transparent"&&(l==="fill"||l==="stroke")||a!=null&&(Nue(a)&&(a=CHe(a,i.gradient,"")),e[l]=a)}for(const s in QF){const a=t[s];a!=null&&(o=o||[],o.push(`${QF[s]}: ${a};`))}return o&&(e.style=o.join(" ")),e}const Vf={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function fcn(e){Vf.svgMarkTypes=e.svgMarkTypes??["text"],Vf.svgOnTop=e.svgOnTop??!0,Vf.debug=e.debug??!1}function BF(e){pu.call(this,e),this._svgRenderer=new N9(e),this._canvasRenderer=new oA(e)}const lEe=pu.prototype;Ke(BF,pu,{initialize(e,t,n,r,i){this._root_el=Vo(e,0,"div");const o=Vo(this._root_el,0,"div"),s=Vo(this._root_el,1,"div");return this._root_el.style.position="relative",Vf.debug||(o.style.height="100%",s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.height="100%",s.style.width="100%"),this._svgEl=Vf.svgOnTop?s:o,this._canvasEl=Vf.svgOnTop?o:s,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,t,n,r,i),this._svgRenderer.initialize(this._svgEl,t,n,r,i),lEe.initialize.call(this,e,t,n,r,i)},dirty(e){return Vf.svgMarkTypes.includes(e.mark.marktype)?this._svgRenderer.dirty(e):this._canvasRenderer.dirty(e),this},_render(e,t){const r=(t??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(i=>!Vf.svgMarkTypes.includes(i));this._svgRenderer.render(e,Vf.svgMarkTypes),this._canvasRenderer.render(e,r)},resize(e,t,n,r){return lEe.resize.call(this,e,t,n,r),this._svgRenderer.resize(e,t,n,r),this._canvasRenderer.resize(e,t,n,r),this},background(e){return Vf.svgOnTop?this._canvasRenderer.background(e):this._svgRenderer.background(e),this}});function ufe(e,t){Y0.call(this,e,t)}Ke(ufe,Y0,{initialize(e,t,n){const r=Vo(Vo(e,0,"div"),Vf.svgOnTop?0:1,"div");return Y0.prototype.initialize.call(this,r,t,n)}});const pXe="canvas",gXe="hybrid",mXe="png",yXe="svg",vXe="none",Ny={Canvas:pXe,PNG:mXe,SVG:yXe,Hybrid:gXe,None:vXe},gO={};gO[pXe]=gO[mXe]={renderer:oA,headless:oA,handler:Y0};gO[yXe]={renderer:N9,headless:cfe,handler:rfe};gO[gXe]={renderer:BF,headless:BF,handler:ufe};gO[vXe]={};function I9(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(gO[e]=t,this):gO[e]}function bXe(e,t,n){const r=[],i=new Po().union(t),o=e.marktype;return o?OXe(e,i,n,r):o==="group"?xXe(e,i,n,r):Le("Intersect scene must be mark node or group item.")}function OXe(e,t,n,r){if(dcn(e,t,n)){const i=e.items,o=e.marktype,s=i.length;let a=0;if(o==="group")for(;a<s;++a)xXe(i[a],t,n,r);else for(const l=ou[o].isect;a<s;++a){const c=i[a];wXe(c,t,l)&&r.push(c)}}return r}function dcn(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function xXe(e,t,n,r){n&&n(e.mark)&&wXe(e,t,ou.group.isect)&&r.push(e);const i=e.items,o=i&&i.length;if(o){const s=e.x||0,a=e.y||0;t.translate(-s,-a);for(let l=0;l<o;++l)OXe(i[l],t,n,r);t.translate(s,a)}return r}function wXe(e,t,n){const r=e.bounds;return t.encloses(r)||t.intersects(r)&&n(e,t)}const cU=new Po;function SXe(e){const t=e.clip;if(ln(t))t($D(cU.clear()));else if(t)cU.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(cU)}const hcn=1e-9;function ffe(e,t,n){return e===t?!0:n==="path"?EXe(e,t):e instanceof Date&&t instanceof Date?+e==+t:Hn(e)&&Hn(t)?Math.abs(e-t)<=hcn:!e||!t||!dt(e)&&!dt(t)?e==t:pcn(e,t)}function EXe(e,t){return ffe(QE(e),QE(t))}function pcn(e,t){var n=Object.keys(e),r=Object.keys(t),i,o;if(n.length!==r.length)return!1;for(n.sort(),r.sort(),o=n.length-1;o>=0;o--)if(n[o]!=r[o])return!1;for(o=n.length-1;o>=0;o--)if(i=n[o],!ffe(e[i],t[i],i))return!1;return typeof e==typeof t}function gcn(){RHe(),Fsn()}const qE="top",Jf="left",nd="right",G0="bottom",mcn="top-left",ycn="top-right",vcn="bottom-left",bcn="bottom-right",dfe="start",YK="middle",nl="end",Ocn="x",xcn="y",L9="group",hfe="axis",pfe="title",wcn="frame",Scn="scope",gfe="legend",CXe="row-header",_Xe="row-footer",kXe="row-title",$Xe="column-header",TXe="column-footer",PXe="column-title",Ecn="padding",Ccn="symbol",AXe="fit",RXe="fit-x",DXe="fit-y",_cn="pad",mfe="none",KN="all",GK="each",yfe="flush",Iy="column",Ly="row";function MXe(e){De.call(this,null,e)}Ke(MXe,De,{transform(e,t){const n=t.dataflow,r=e.mark,i=r.marktype,o=ou[i],s=o.bound;let a=r.bounds,l;if(o.nested)r.items.length&&n.dirty(r.items[0]),a=JN(r,s),r.items.forEach(c=>{c.bounds.clear().union(a)});else if(i===L9||e.modified())switch(t.visit(t.MOD,c=>n.dirty(c)),a.clear(),r.items.forEach(c=>a.union(JN(c,s))),r.role){case hfe:case gfe:case pfe:t.reflow()}else l=t.changed(t.REM),t.visit(t.ADD,c=>{a.union(JN(c,s))}),t.visit(t.MOD,c=>{l=l||a.alignsWith(c.bounds),n.dirty(c),a.union(JN(c,s))}),l&&(a.clear(),r.items.forEach(c=>a.union(c.bounds)));return SXe(r),t.modifies("bounds")}});function JN(e,t,n){return t(e.bounds.clear(),e,n)}const cEe=":vega_identifier:";function vfe(e){De.call(this,0,e)}vfe.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};Ke(vfe,De,{transform(e,t){const n=kcn(t.dataflow),r=e.as;let i=n.value;return t.visit(t.ADD,o=>o[r]=o[r]||++i),n.set(this.value=i),t}});function kcn(e){return e._signals[cEe]||(e._signals[cEe]=e.add(0))}function NXe(e){De.call(this,null,e)}Ke(NXe,De,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,$cn(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const r=n.marktype===L9?k9:_9;return t.visit(t.ADD,i=>r.call(i,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function $cn(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function IXe(e){De.call(this,null,e)}const uEe={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((r,i)=>!i||!LXe(n.bounds,r.bounds,t)?(n=r,1):r.opacity=0)}},LXe=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),fEe=(e,t)=>{for(var n=1,r=e.length,i=e[0].bounds,o;n<r;i=o,++n)if(LXe(i,o=e[n].bounds,t))return!0},Tcn=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},Pcn=(e,t,n)=>{var r=e.range(),i=new Po;return t===qE||t===G0?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),o=>i.encloses(o.bounds)},dEe=e=>(e.forEach(t=>t.opacity=1),e),hEe=(e,t)=>e.reflow(t.modified()).modifies("opacity");Ke(IXe,De,{transform(e,t){const n=uEe[e.method]||uEe.parity,r=e.separation||0;let i=t.materialize(t.SOURCE).source,o,s;if(!i||!i.length)return;if(!e.method)return e.modified("method")&&(dEe(i),t=hEe(t,e)),t;if(i=i.filter(Tcn),!i.length)return;if(e.sort&&(i=i.slice().sort(e.sort)),o=dEe(i),t=hEe(t,e),o.length>=3&&fEe(o,r)){do o=n(o,r);while(o.length>=3&&fEe(o,r));o.length<3&&!jn(i).opacity&&(o.length>1&&(jn(o).opacity=0),jn(i).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(s=Pcn(e.boundScale,e.boundOrient,+e.boundTolerance),i.forEach(l=>{s(l)||(l.opacity=0)}));const a=o[0].mark.bounds.clear();return i.forEach(l=>{l.opacity&&a.union(l.bounds)}),t}});function jXe(e){De.call(this,null,e)}Ke(jXe,De,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,r=>n.dirty(r)),t.fields&&t.fields.zindex){const r=t.source&&t.source[0];r&&(r.mark.zdirty=!0)}}});const pa=new Po;function Yw(e,t,n){return e[t]===n?0:(e[t]=n,1)}function Acn(e){var t=e.items[0].orient;return t===Jf||t===nd}function Rcn(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function Dcn(e,t,n,r){var i=t.items[0],o=i.datum,s=i.translate!=null?i.translate:.5,a=i.orient,l=Rcn(o),c=i.range,u=i.offset,f=i.position,d=i.minExtent,h=i.maxExtent,p=o.title&&i.items[l[2]].items[0],g=i.titlePadding,v=i.bounds,y=p&&Kue(p),O=0,m=0,w,S;switch(pa.clear().union(v),v.clear(),(w=l[0])>-1&&v.union(i.items[w].bounds),(w=l[1])>-1&&v.union(i.items[w].bounds),a){case qE:O=f||0,m=-u,S=Math.max(d,Math.min(h,-v.y1)),v.add(0,-S).add(c,0),p&&eI(e,p,S,g,y,0,-1,v);break;case Jf:O=-u,m=f||0,S=Math.max(d,Math.min(h,-v.x1)),v.add(-S,0).add(0,c),p&&eI(e,p,S,g,y,1,-1,v);break;case nd:O=n+u,m=f||0,S=Math.max(d,Math.min(h,v.x2)),v.add(0,0).add(S,c),p&&eI(e,p,S,g,y,1,1,v);break;case G0:O=f||0,m=r+u,S=Math.max(d,Math.min(h,v.y2)),v.add(0,0).add(c,S),p&&eI(e,p,S,g,0,0,1,v);break;default:O=i.x,m=i.y}return bm(v.translate(O,m),i),Yw(i,"x",O+s)|Yw(i,"y",m+s)&&(i.bounds=pa,e.dirty(i),i.bounds=v,e.dirty(i)),i.mark.bounds.clear().union(v)}function eI(e,t,n,r,i,o,s,a){const l=t.bounds;if(t.auto){const c=s*(n+i+r);let u=0,f=0;e.dirty(t),o?u=(t.x||0)-(t.x=c):f=(t.y||0)-(t.y=c),t.mark.bounds.clear().union(l.translate(-u,-f)),e.dirty(t)}a.union(l)}const pEe=(e,t)=>Math.floor(Math.min(e,t)),gEe=(e,t)=>Math.ceil(Math.max(e,t));function Mcn(e){var t=e.items,n=t.length,r=0,i,o;const s={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;r<n;++r)if(i=t[r],o=i.items,i.marktype===L9)switch(i.role){case hfe:case gfe:case pfe:break;case CXe:s.rowheaders.push(...o);break;case _Xe:s.rowfooters.push(...o);break;case $Xe:s.colheaders.push(...o);break;case TXe:s.colfooters.push(...o);break;case kXe:s.rowtitle=o[0];break;case PXe:s.coltitle=o[0];break;default:s.marks.push(...o)}return s}function Ncn(e){return new Po().set(0,0,e.width||0,e.height||0)}function Icn(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function mi(e,t,n){const r=dt(e)?e[t]:e;return r??(n!==void 0?n:0)}function mEe(e){return e<0?Math.ceil(-e):0}function FXe(e,t,n){var r=!n.nodirty,i=n.bounds===yfe?Ncn:Icn,o=pa.set(0,0,0,0),s=mi(n.align,Iy),a=mi(n.align,Ly),l=mi(n.padding,Iy),c=mi(n.padding,Ly),u=n.columns||t.length,f=u<=0?1:Math.ceil(t.length/u),d=t.length,h=Array(d),p=Array(u),g=0,v=Array(d),y=Array(f),O=0,m=Array(d),w=Array(d),S=Array(d),E,C,k,P,D,M,L,A,T,N,j;for(C=0;C<u;++C)p[C]=0;for(C=0;C<f;++C)y[C]=0;for(C=0;C<d;++C)M=t[C],D=S[C]=i(M),M.x=M.x||0,m[C]=0,M.y=M.y||0,w[C]=0,k=C%u,P=~~(C/u),g=Math.max(g,L=Math.ceil(D.x2)),O=Math.max(O,A=Math.ceil(D.y2)),p[k]=Math.max(p[k],L),y[P]=Math.max(y[P],A),h[C]=l+mEe(D.x1),v[C]=c+mEe(D.y1),r&&e.dirty(t[C]);for(C=0;C<d;++C)C%u===0&&(h[C]=0),C<u&&(v[C]=0);if(s===GK)for(k=1;k<u;++k){for(j=0,C=k;C<d;C+=u)j<h[C]&&(j=h[C]);for(C=k;C<d;C+=u)h[C]=j+p[k-1]}else if(s===KN){for(j=0,C=0;C<d;++C)C%u&&j<h[C]&&(j=h[C]);for(C=0;C<d;++C)C%u&&(h[C]=j+g)}else for(s=!1,k=1;k<u;++k)for(C=k;C<d;C+=u)h[C]+=p[k-1];if(a===GK)for(P=1;P<f;++P){for(j=0,C=P*u,E=C+u;C<E;++C)j<v[C]&&(j=v[C]);for(C=P*u;C<E;++C)v[C]=j+y[P-1]}else if(a===KN){for(j=0,C=u;C<d;++C)j<v[C]&&(j=v[C]);for(C=u;C<d;++C)v[C]=j+O}else for(a=!1,P=1;P<f;++P)for(C=P*u,E=C+u;C<E;++C)v[C]+=y[P-1];for(T=0,C=0;C<d;++C)T=h[C]+(C%u?T:0),m[C]+=T-t[C].x;for(k=0;k<u;++k)for(N=0,C=k;C<d;C+=u)N+=v[C],w[C]+=N-t[C].y;if(s&&mi(n.center,Iy)&&f>1)for(C=0;C<d;++C)D=s===KN?g:p[C%u],T=D-S[C].x2-t[C].x-m[C],T>0&&(m[C]+=T/2);if(a&&mi(n.center,Ly)&&u!==1)for(C=0;C<d;++C)D=a===KN?O:y[~~(C/u)],N=D-S[C].y2-t[C].y-w[C],N>0&&(w[C]+=N/2);for(C=0;C<d;++C)o.union(S[C].translate(m[C],w[C]));switch(T=mi(n.anchor,Ocn),N=mi(n.anchor,xcn),mi(n.anchor,Iy)){case nl:T-=o.width();break;case YK:T-=o.width()/2}switch(mi(n.anchor,Ly)){case nl:N-=o.height();break;case YK:N-=o.height()/2}for(T=Math.round(T),N=Math.round(N),o.clear(),C=0;C<d;++C)t[C].mark.bounds.clear();for(C=0;C<d;++C)M=t[C],M.x+=m[C]+=T,M.y+=w[C]+=N,o.union(M.mark.bounds.union(M.bounds.translate(m[C],w[C]))),r&&e.dirty(M);return o}function Lcn(e,t,n){var r=Mcn(t),i=r.marks,o=n.bounds===yfe?jcn:Fcn,s=n.offset,a=n.columns||i.length,l=a<=0?1:Math.ceil(i.length/a),c=l*a,u,f,d,h,p,g,v;const y=FXe(e,i,n);y.empty()&&y.set(0,0,0,0),r.rowheaders&&(g=mi(n.headerBand,Ly,null),u=tI(e,r.rowheaders,i,a,l,-mi(s,"rowHeader"),pEe,0,o,"x1",0,a,1,g)),r.colheaders&&(g=mi(n.headerBand,Iy,null),f=tI(e,r.colheaders,i,a,a,-mi(s,"columnHeader"),pEe,1,o,"y1",0,1,a,g)),r.rowfooters&&(g=mi(n.footerBand,Ly,null),d=tI(e,r.rowfooters,i,a,l,mi(s,"rowFooter"),gEe,0,o,"x2",a-1,a,1,g)),r.colfooters&&(g=mi(n.footerBand,Iy,null),h=tI(e,r.colfooters,i,a,a,mi(s,"columnFooter"),gEe,1,o,"y2",c-a,1,a,g)),r.rowtitle&&(p=mi(n.titleAnchor,Ly),v=mi(s,"rowTitle"),v=p===nl?d+v:u-v,g=mi(n.titleBand,Ly,.5),yEe(e,r.rowtitle,v,0,y,g)),r.coltitle&&(p=mi(n.titleAnchor,Iy),v=mi(s,"columnTitle"),v=p===nl?h+v:f-v,g=mi(n.titleBand,Iy,.5),yEe(e,r.coltitle,v,1,y,g))}function jcn(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function Fcn(e,t){return e.bounds[t]}function tI(e,t,n,r,i,o,s,a,l,c,u,f,d,h){var p=n.length,g=0,v=0,y,O,m,w,S,E,C,k,P;if(!p)return g;for(y=u;y<p;y+=f)n[y]&&(g=s(g,l(n[y],c)));if(!t.length)return g;for(t.length>i&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),g+=o,O=0,w=t.length;O<w;++O)e.dirty(t[O]),t[O].mark.bounds.clear();for(y=u,O=0,w=t.length;O<w;++O,y+=f){for(E=t[O],S=E.mark.bounds,m=y;m>=0&&(C=n[m])==null;m-=d);a?(k=h==null?C.x:Math.round(C.bounds.x1+h*C.bounds.width()),P=g):(k=g,P=h==null?C.y:Math.round(C.bounds.y1+h*C.bounds.height())),S.union(E.bounds.translate(k-(E.x||0),P-(E.y||0))),E.x=k,E.y=P,e.dirty(E),v=s(v,S[c])}return v}function yEe(e,t,n,r,i,o){if(t){e.dirty(t);var s=n,a=n;r?s=Math.round(i.x1+o*i.width()):a=Math.round(i.y1+o*i.height()),t.bounds.translate(s-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=s,t.y=a,e.dirty(t)}}function zcn(e,t){const n=e[t]||{};return(r,i)=>n[r]!=null?n[r]:e[r]!=null?e[r]:i}function Qcn(e,t){let n=-1/0;return e.forEach(r=>{r.offset!=null&&(n=Math.max(n,r.offset))}),n>-1/0?n:t}function Bcn(e,t,n,r,i,o,s){const a=zcn(n,t),l=Qcn(e,a("offset",0)),c=a("anchor",dfe),u=c===nl?1:c===YK?.5:0,f={align:GK,bounds:a("bounds",yfe),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case Jf:f.anchor={x:Math.floor(r.x1)-l,column:nl,y:u*(s||r.height()+2*r.y1),row:c};break;case nd:f.anchor={x:Math.ceil(r.x2)+l,y:u*(s||r.height()+2*r.y1),row:c};break;case qE:f.anchor={y:Math.floor(i.y1)-l,row:nl,x:u*(o||i.width()+2*i.x1),column:c};break;case G0:f.anchor={y:Math.ceil(i.y2)+l,x:u*(o||i.width()+2*i.x1),column:c};break;case mcn:f.anchor={x:l,y:l};break;case ycn:f.anchor={x:o-l,y:l,column:nl};break;case vcn:f.anchor={x:l,y:s-l,row:nl};break;case bcn:f.anchor={x:o-l,y:s-l,column:nl,row:nl};break}return f}function Wcn(e,t){var n=t.items[0],r=n.datum,i=n.orient,o=n.bounds,s=n.x,a=n.y,l,c;return n._bounds?n._bounds.clear().union(o):n._bounds=o.clone(),o.clear(),Vcn(e,n,n.items[0].items[0]),o=qcn(n,o),l=2*n.padding,c=2*n.padding,o.empty()||(l=Math.ceil(o.width()+l),c=Math.ceil(o.height()+c)),r.type===Ccn&&Ucn(n.items[0].items[0].items[0].items),i!==mfe&&(n.x=s=0,n.y=a=0),n.width=l,n.height=c,bm(o.set(s,a,s+l,a+c),n),n.mark.bounds.clear().union(o),n}function qcn(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function Vcn(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(!t.datum.title)(i||o)&&jk(e,n,i,o);else{var s=t.items[1].items[0],a=s.anchor,l=t.titlePadding||0,c=r-s.x,u=r-s.y;switch(s.orient){case Jf:i+=Math.ceil(s.bounds.width())+l;break;case nd:case G0:break;default:o+=s.bounds.height()+l}switch((i||o)&&jk(e,n,i,o),s.orient){case Jf:u+=Ux(t,n,s,a,1,1);break;case nd:c+=Ux(t,n,s,nl,0,0)+l,u+=Ux(t,n,s,a,1,1);break;case G0:c+=Ux(t,n,s,a,0,0),u+=Ux(t,n,s,nl,-1,0,1)+l;break;default:c+=Ux(t,n,s,a,0,0)}(c||u)&&jk(e,s,c,u),(c=Math.round(s.bounds.x1-r))<0&&(jk(e,n,-c,0),jk(e,s,-c,0))}}function Ux(e,t,n,r,i,o,s){const a=e.datum.type!=="symbol",l=n.datum.vgrad,c=a&&(o||!l)&&!s?t.items[0]:t,u=c.bounds[i?"y2":"x2"]-e.padding,f=l&&o?u:0,d=l&&o?0:u,h=i<=0?0:Kue(n);return Math.round(r===dfe?f:r===nl?d-h:.5*(u-h))}function jk(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function Ucn(e){const t=e.reduce((n,r)=>(n[r.column]=Math.max(r.bounds.x2-r.x,n[r.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function Hcn(e,t,n,r,i){var o=t.items[0],s=o.frame,a=o.orient,l=o.anchor,c=o.offset,u=o.padding,f=o.items[0].items[0],d=o.items[1]&&o.items[1].items[0],h=a===Jf||a===nd?r:n,p=0,g=0,v=0,y=0,O=0,m;if(s!==L9?a===Jf?(p=i.y2,h=i.y1):a===nd?(p=i.y1,h=i.y2):(p=i.x1,h=i.x2):a===Jf&&(p=r,h=0),m=l===dfe?p:l===nl?h:(p+h)/2,d&&d.text){switch(a){case qE:case G0:O=f.bounds.height()+u;break;case Jf:y=f.bounds.width()+u;break;case nd:y=-f.bounds.width()-u;break}pa.clear().union(d.bounds),pa.translate(y-(d.x||0),O-(d.y||0)),Yw(d,"x",y)|Yw(d,"y",O)&&(e.dirty(d),d.bounds.clear().union(pa),d.mark.bounds.clear().union(pa),e.dirty(d)),pa.clear().union(d.bounds)}else pa.clear();switch(pa.union(f.bounds),a){case qE:g=m,v=i.y1-pa.height()-c;break;case Jf:g=i.x1-pa.width()-c,v=m;break;case nd:g=i.x2+pa.width()+c,v=m;break;case G0:g=m,v=i.y2+c;break;default:g=o.x,v=o.y}return Yw(o,"x",g)|Yw(o,"y",v)&&(pa.translate(g,v),e.dirty(o),o.bounds.clear().union(pa),t.bounds.clear().union(pa),e.dirty(o)),o.bounds}function zXe(e){De.call(this,null,e)}Ke(zXe,De,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(r=>{e.layout&&Lcn(n,r,e.layout),Zcn(n,r,e)}),Xcn(e.mark.group)?t.reflow():t}});function Xcn(e){return e&&e.mark.role!=="legend-entry"}function Zcn(e,t,n){var r=t.items,i=Math.max(0,t.width||0),o=Math.max(0,t.height||0),s=new Po().set(0,0,i,o),a=s.clone(),l=s.clone(),c=[],u,f,d,h,p,g;for(p=0,g=r.length;p<g;++p)switch(f=r[p],f.role){case hfe:h=Acn(f)?a:l,h.union(Dcn(e,f,i,o));break;case pfe:u=f;break;case gfe:c.push(Wcn(e,f));break;case wcn:case Scn:case CXe:case _Xe:case kXe:case $Xe:case TXe:case PXe:a.union(f.bounds),l.union(f.bounds);break;default:s.union(f.bounds)}if(c.length){const v={};c.forEach(y=>{d=y.orient||nd,d!==mfe&&(v[d]||(v[d]=[])).push(y)});for(const y in v){const O=v[y];FXe(e,O,Bcn(O,y,n.legends,a,l,i,o))}c.forEach(y=>{const O=y.bounds;if(O.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=O,e.dirty(y)),n.autosize&&(n.autosize.type===AXe||n.autosize.type===RXe||n.autosize.type===DXe))switch(y.orient){case Jf:case nd:s.add(O.x1,0).add(O.x2,0);break;case qE:case G0:s.add(0,O.y1).add(0,O.y2)}else s.union(O)})}s.union(a).union(l),u&&s.union(Hcn(e,u,i,o,s)),t.clip&&s.set(0,0,t.width||0,t.height||0),Ycn(e,t,s,n)}function Ycn(e,t,n,r){const i=r.autosize||{},o=i.type;if(e._autosize<1||!o)return;let s=e._width,a=e._height,l=Math.max(0,t.width||0),c=Math.max(0,Math.ceil(-n.x1)),u=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-u));if(i.contains===Ecn){const p=e.padding();s-=p.left+p.right,a-=p.top+p.bottom}o===mfe?(c=0,f=0,l=s,u=a):o===AXe?(l=Math.max(0,s-c-d),u=Math.max(0,a-f-h)):o===RXe?(l=Math.max(0,s-c-d),a=u+f+h):o===DXe?(s=l+c+d,u=Math.max(0,a-f-h)):o===_cn&&(s=l+c+d,a=u+f+h),e._resizeView(s,a,l,u,[c,f],i.resize)}const Gcn=Object.freeze(Object.defineProperty({__proto__:null,bound:MXe,identifier:vfe,mark:NXe,overlap:IXe,render:jXe,viewlayout:zXe},Symbol.toStringTag,{value:"Module"}));function QXe(e){De.call(this,null,e)}Ke(QXe,De,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.scale,s=e.count==null?e.values?e.values.length:10:e.count,a=Due(o,s,e.minstep),l=e.format||vHe(n,o,a,e.formatSpecifier,e.formatType,!!e.values),c=e.values?yHe(o,e.values,a):Mue(o,a);return i&&(r.rem=i),i=c.map((u,f)=>dr({index:f/(c.length-1||1),value:u,label:l(u)})),e.extra&&i.length&&i.push(dr({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}});function BXe(e){De.call(this,null,e)}function Kcn(){return dr({})}function Jcn(e){const t=u_().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}Ke(BXe,De,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||Kcn,o=e.key||Dt,s=this.value;return ze(r.encode)&&(r.encode=null),s&&(e.modified("key")||t.modified(o))&&Le("DataJoin does not support modified key function or fields."),s||(t=t.addAll(),this.value=s=Jcn(o)),t.visit(t.ADD,a=>{const l=o(a);let c=s.get(l);c?c.exit?(s.empty--,r.add.push(c)):r.mod.push(c):(c=i(a),s.set(l,c),r.add.push(c)),c.datum=a,c.exit=!1}),t.visit(t.MOD,a=>{const l=o(a),c=s.get(l);c&&(c.datum=a,r.mod.push(c))}),t.visit(t.REM,a=>{const l=o(a),c=s.get(l);a===c.datum&&!c.exit&&(r.rem.push(c),c.exit=!0,++s.empty)}),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&s.empty>n.cleanThreshold)&&n.runAfter(s.clean),r}});function WXe(e){De.call(this,null,e)}Ke(WXe,De,{transform(e,t){var n=t.fork(t.ADD_REM),r=e.mod||!1,i=e.encoders,o=t.encode;if(ze(o))if(n.changed()||o.every(f=>i[f]))o=o[0],n.encode=null;else return t.StopPropagation;var s=o==="enter",a=i.update||Zm,l=i.enter||Zm,c=i.exit||Zm,u=(o&&!s?i[o]:a)||Zm;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{l(f,e),a(f,e)}),n.modifies(l.output),n.modifies(a.output),u!==Zm&&u!==a&&(t.visit(t.ADD,f=>{u(f,e)}),n.modifies(u.output))),t.changed(t.REM)&&c!==Zm&&(t.visit(t.REM,f=>{c(f,e)}),n.modifies(c.output)),s||u!==Zm){const f=t.MOD|(e.modified()?t.REFLOW:0);s?(t.visit(f,d=>{const h=l(d,e)||r;(u(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(l.output)):t.visit(f,d=>{(u(d,e)||r)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)}return n.changed()?n:t.StopPropagation}});function qXe(e){De.call(this,[],e)}Ke(qXe,De,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=this.value,o=e.type||iL,s=e.scale,a=+e.limit,l=Due(s,e.count==null?5:e.count,e.minstep),c=!!e.values||o===iL,u=e.format||wHe(n,s,l,o,e.formatSpecifier,e.formatType,c),f=e.values||xHe(s,l),d,h,p,g,v;return i&&(r.rem=i),o===iL?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),i=f.slice(0,a-1),v=!0):i=f,ln(p=e.size)?(!e.values&&s(i[0])===0&&(i=i.slice(1)),g=i.reduce((y,O)=>Math.max(y,p(O,e)),0)):p=Wa(g=p||8),i=i.map((y,O)=>dr({index:O,label:u(y,O,i),value:y,offset:g,size:p(y,e)})),v&&(v=f[i.length],i.push(dr({index:i.length,label:`…${f.length-i.length} entries`,value:v,offset:g,size:p(v,e)})))):o===_sn?(d=s.domain(),h=pHe(s,d[0],jn(d)),f.length<3&&!e.values&&d[0]!==jn(d)&&(f=[d[0],jn(d)]),i=f.map((y,O)=>dr({index:O,label:u(y,O,f),value:y,perc:h(y)}))):(p=f.length-1,h=Lsn(s),i=f.map((y,O)=>dr({index:O,label:u(y,O,f),value:y,perc:O?h(y):0,perc2:O===p?1:h(f[O+1])}))),r.source=i,r.add=i,this.value=i,r}});const eun=e=>e.source.x,tun=e=>e.source.y,nun=e=>e.target.x,run=e=>e.target.y;function bfe(e){De.call(this,{},e)}bfe.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};Ke(bfe,De,{transform(e,t){var n=e.sourceX||eun,r=e.sourceY||tun,i=e.targetX||nun,o=e.targetY||run,s=e.as||"path",a=e.orient||"vertical",l=e.shape||"line",c=vEe.get(l+"-"+a)||vEe.get(l);return c||Le("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,u=>{u[s]=c(n(u),r(u),i(u),o(u))}),t.reflow(e.modified()).modifies(s)}});const VXe=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r,iun=(e,t,n,r)=>VXe(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),UXe=(e,t,n,r)=>{var i=n-e,o=r-t,s=Math.hypot(i,o)/2,a=180*Math.atan2(o,i)/Math.PI;return"M"+e+","+t+"A"+s+","+s+" "+a+" 0 1 "+n+","+r},oun=(e,t,n,r)=>UXe(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),HXe=(e,t,n,r)=>{const i=n-e,o=r-t,s=.2*(i+o),a=.2*(o-i);return"M"+e+","+t+"C"+(e+s)+","+(t+a)+" "+(n+a)+","+(r-s)+" "+n+","+r},sun=(e,t,n,r)=>HXe(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),aun=(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,lun=(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,cun=(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),l=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+(l?1:0)+" "+t*s+","+t*a+"L"+r*s+","+r*a},uun=(e,t,n,r)=>{const i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},fun=(e,t,n,r)=>{const i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},dun=(e,t,n,r)=>{const i=Math.cos(e),o=Math.sin(e),s=Math.cos(n),a=Math.sin(n),l=(t+r)/2;return"M"+t*i+","+t*o+"C"+l*i+","+l*o+" "+l*s+","+l*a+" "+r*s+","+r*a},vEe=u_({line:VXe,"line-radial":iun,arc:UXe,"arc-radial":oun,curve:HXe,"curve-radial":sun,"orthogonal-horizontal":aun,"orthogonal-vertical":lun,"orthogonal-radial":cun,"diagonal-horizontal":uun,"diagonal-vertical":fun,"diagonal-radial":dun});function Ofe(e){De.call(this,null,e)}Ofe.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};Ke(Ofe,De,{transform(e,t){var n=e.as||["startAngle","endAngle"],r=n[0],i=n[1],o=e.field||a_,s=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,l=t.source,c=l.map(o),u=c.length,f=s,d=(a-s)/F8e(c),h=Qc(u),p,g,v;for(e.sort&&h.sort((y,O)=>c[y]-c[O]),p=0;p<u;++p)v=c[h[p]],g=l[h[p]],g[r]=f,g[i]=f+=v*d;return this.value=c,t.reflow(e.modified()).modifies(n)}});const hun=5;function pun(e){const t=e.type;return!e.bins&&(t===jE||t===xD||t===wD)}function XXe(e){return Pue(e)&&e!==qh}const gun=kd(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function ZXe(e){De.call(this,null,e),this.modified(!0)}Ke(ZXe,De,{transform(e,t){var n=t.dataflow,r=this.value,i=mun(e);(!r||i!==r.type)&&(this.value=r=tr(i)());for(i in e)if(!gun[i]){if(i==="padding"&&XXe(r.type))continue;ln(r[i])?r[i](e[i]):n.warn("Unsupported scale property: "+i)}return wun(r,e,xun(r,e,vun(r,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function mun(e){var t=e.type,n="",r;return t===qh?qh+"-"+jE:(yun(e)&&(r=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=r===2?qh+"-":r===3?k_+"-":""),(n+t||jE).toLowerCase())}function yun(e){const t=e.type;return Pue(t)&&t!==hO&&t!==pO&&(e.scheme||e.range&&e.range.length&&e.range.every(ut))}function vun(e,t,n){const r=bun(e,t.domainRaw,n);if(r>-1)return r;var i=t.domain,o=e.type,s=t.zero||t.zero===void 0&&pun(e),a,l;if(!i)return 0;if(XXe(o)&&t.padding&&i[0]!==jn(i)&&(i=Oun(o,i,t.range,t.padding,t.exponent,t.constant)),(s||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(i=i.slice()).length-1||1,s&&(i[0]>0&&(i[0]=0),i[a]<0&&(i[a]=0)),t.domainMin!=null&&(i[0]=t.domainMin),t.domainMax!=null&&(i[a]=t.domainMax),t.domainMid!=null)){l=t.domainMid;const c=l>i[a]?a+1:l<i[0]?0:a;c!==a&&n.warn("Scale domainMid exceeds domain min or max.",l),i.splice(c,0,l)}return e.domain(YXe(o,i,n)),o===_ue&&e.unknown(t.domainImplicit?PK:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&Due(e,t.nice)||null),i.length}function bun(e,t,n){return t?(e.domain(YXe(e.type,t,n)),t.length):-1}function Oun(e,t,n,r,i,o){var s=Math.abs(jn(n)-n[0]),a=s/(s-2*r),l=e===em?Sae(t,null,a):e===wD?S3(t,null,a,.5):e===xD?S3(t,null,a,i||1):e===x9?Eae(t,null,a,o||1):wae(t,null,a);return t=t.slice(),t[0]=l[0],t[t.length-1]=l[1],t}function YXe(e,t,n){if(cHe(e)){var r=Math.abs(t.reduce((i,o)=>i+(o<0?-1:o>0?1:0),0));r!==t.length&&n.warn("Log scale domain includes zero: "+Je(t))}return t}function xun(e,t,n){let r=t.bins;if(r&&!ze(r)){const i=e.domain(),o=i[0],s=jn(i),a=r.step;let l=r.start==null?o:r.start,c=r.stop==null?s:r.stop;a||Le("Scale bins parameter missing step property."),l<o&&(l=a*Math.ceil(o/a)),c>s&&(c=a*Math.floor(s/a)),r=Qc(l,c+a/2,a)}return r?e.bins=r:e.bins&&delete e.bins,e.type===kue&&(r?!t.domain&&!t.domainRaw&&(e.domain(r),n=r.length):e.bins=e.domain()),n}function wun(e,t,n){var r=e.type,i=t.round||!1,o=t.range;if(t.rangeStep!=null)o=Sun(r,t,n);else if(t.scheme&&(o=Eun(r,t,n),ln(o))){if(e.interpolator)return e.interpolator(o);Le(`Scale type ${r} does not support interpolating color schemes.`)}if(o&&uHe(r))return e.interpolator(E9(KK(o,t.reverse),t.interpolate,t.interpolateGamma));o&&t.interpolate&&e.interpolate?e.interpolate(Aue(t.interpolate,t.interpolateGamma)):ln(e.round)?e.round(i):ln(e.rangeRound)&&e.interpolate(i?bD:Rv),o&&e.range(KK(o,t.reverse))}function Sun(e,t,n){e!==rHe&&e!==IK&&Le("Only band and point scales support rangeStep.");var r=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,i=e===IK?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Cue(n,i,r)]}function Eun(e,t,n){var r=t.schemeExtent,i,o;return ze(t.scheme)?o=E9(t.scheme,t.interpolate,t.interpolateGamma):(i=t.scheme.toLowerCase(),o=Rue(i),o||Le(`Unrecognized scheme name: ${t.scheme}`)),n=e===S9?n+1:e===kue?n-1:e===FE||e===w9?+t.schemeCount||hun:n,uHe(e)?bEe(o,r,t.reverse):ln(o)?hHe(bEe(o,r),n):e===_ue?o:o.slice(0,n)}function bEe(e,t,n){return ln(e)&&(t||n)?dHe(e,KK(t||[0,1],n)):e}function KK(e,t){return t?e.slice().reverse():e}function GXe(e){De.call(this,null,e)}Ke(GXe,De,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(ox(e.sort)),this.modified(n),t}});const OEe="zero",KXe="center",JXe="normalize",eZe=["y0","y1"];function xfe(e){De.call(this,null,e)}xfe.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:OEe,values:[OEe,KXe,JXe]},{name:"as",type:"string",array:!0,length:2,default:eZe}]};Ke(xfe,De,{transform(e,t){var n=e.as||eZe,r=n[0],i=n[1],o=ox(e.sort),s=e.field||a_,a=e.offset===KXe?Cun:e.offset===JXe?_un:kun,l,c,u,f;for(l=$un(t.source,e.groupby,o,s),c=0,u=l.length,f=l.max;c<u;++c)a(l[c],f,s,r,i);return t.reflow(e.modified()).modifies(n)}});function Cun(e,t,n,r,i){for(var o=(t-e.sum)/2,s=e.length,a=0,l;a<s;++a)l=e[a],l[r]=o,l[i]=o+=Math.abs(n(l))}function _un(e,t,n,r,i){for(var o=1/e.sum,s=0,a=e.length,l=0,c=0,u;l<a;++l)u=e[l],u[r]=s,u[i]=s=o*(c+=Math.abs(n(u)))}function kun(e,t,n,r,i){for(var o=0,s=0,a=e.length,l=0,c,u;l<a;++l)u=e[l],c=+n(u),c<0?(u[r]=s,u[i]=s+=c):(u[r]=o,u[i]=o+=c)}function $un(e,t,n,r){var i=[],o=g=>g(u),s,a,l,c,u,f,d,h,p;if(t==null)i.push(e.slice());else for(s={},a=0,l=e.length;a<l;++a)u=e[a],f=t.map(o),d=s[f],d||(s[f]=d=[],i.push(d)),d.push(u);for(f=0,p=0,c=i.length;f<c;++f){for(d=i[f],a=0,h=0,l=d.length;a<l;++a)h+=Math.abs(r(d[a]));d.sum=h,h>p&&(p=h),n&&d.sort(n)}return i.max=p,i}const Tun=Object.freeze(Object.defineProperty({__proto__:null,axisticks:QXe,datajoin:BXe,encode:WXe,legendentries:qXe,linkpath:bfe,pie:Ofe,scale:ZXe,sortitems:GXe,stack:xfe},Symbol.toStringTag,{value:"Module"}));var Lt=1e-6,WF=1e-12,En=Math.PI,Hi=En/2,qF=En/4,wl=En*2,ro=180/En,bn=En/180,Ln=Math.abs,T_=Math.atan,bf=Math.atan2,zt=Math.cos,nI=Math.ceil,tZe=Math.exp,JK=Math.hypot,VF=Math.log,uU=Math.pow,Mt=Math.sin,Xu=Math.sign||function(e){return e>0?1:e<0?-1:0},Sl=Math.sqrt,wfe=Math.tan;function nZe(e){return e>1?0:e<-1?En:Math.acos(e)}function sc(e){return e>1?Hi:e<-1?-Hi:Math.asin(e)}function Qs(){}function UF(e,t){e&&wEe.hasOwnProperty(e.type)&&wEe[e.type](e,t)}var xEe={Feature:function(e,t){UF(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)UF(n[r].geometry,t)}},wEe={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){eJ(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)eJ(n[r],t,0)},Polygon:function(e,t){SEe(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)SEe(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)UF(n[r],t)}};function eJ(e,t,n){var r=-1,i=e.length-n,o;for(t.lineStart();++r<i;)o=e[r],t.point(o[0],o[1],o[2]);t.lineEnd()}function SEe(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)eJ(e[n],t,1);t.polygonEnd()}function cg(e,t){e&&xEe.hasOwnProperty(e.type)?xEe[e.type](e,t):UF(e,t)}var HF=new pl,XF=new pl,rZe,iZe,tJ,nJ,rJ,lp={point:Qs,lineStart:Qs,lineEnd:Qs,polygonStart:function(){HF=new pl,lp.lineStart=Pun,lp.lineEnd=Aun},polygonEnd:function(){var e=+HF;XF.add(e<0?wl+e:e),this.lineStart=this.lineEnd=this.point=Qs},sphere:function(){XF.add(wl)}};function Pun(){lp.point=Run}function Aun(){oZe(rZe,iZe)}function Run(e,t){lp.point=oZe,rZe=e,iZe=t,e*=bn,t*=bn,tJ=e,nJ=zt(t=t/2+qF),rJ=Mt(t)}function oZe(e,t){e*=bn,t*=bn,t=t/2+qF;var n=e-tJ,r=n>=0?1:-1,i=r*n,o=zt(t),s=Mt(t),a=rJ*s,l=nJ*o+a*zt(i),c=a*r*Mt(i);HF.add(bf(c,l)),tJ=e,nJ=o,rJ=s}function Dun(e){return XF=new pl,cg(e,lp),XF*2}function ZF(e){return[bf(e[1],e[0]),sc(e[2])]}function mO(e){var t=e[0],n=e[1],r=zt(n);return[r*zt(t),r*Mt(t),Mt(n)]}function rI(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function VE(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function fU(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function iI(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function YF(e){var t=Sl(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var $i,Il,Qi,Ic,m1,sZe,aZe,LS,YT,ay,tm,ig={point:iJ,lineStart:EEe,lineEnd:CEe,polygonStart:function(){ig.point=cZe,ig.lineStart=Mun,ig.lineEnd=Nun,YT=new pl,lp.polygonStart()},polygonEnd:function(){lp.polygonEnd(),ig.point=iJ,ig.lineStart=EEe,ig.lineEnd=CEe,HF<0?($i=-(Qi=180),Il=-(Ic=90)):YT>Lt?Ic=90:YT<-Lt&&(Il=-90),tm[0]=$i,tm[1]=Qi},sphere:function(){$i=-(Qi=180),Il=-(Ic=90)}};function iJ(e,t){ay.push(tm=[$i=e,Qi=e]),t<Il&&(Il=t),t>Ic&&(Ic=t)}function lZe(e,t){var n=mO([e*bn,t*bn]);if(LS){var r=VE(LS,n),i=[r[1],-r[0],0],o=VE(i,r);YF(o),o=ZF(o);var s=e-m1,a=s>0?1:-1,l=o[0]*ro*a,c,u=Ln(s)>180;u^(a*m1<l&&l<a*e)?(c=o[1]*ro,c>Ic&&(Ic=c)):(l=(l+360)%360-180,u^(a*m1<l&&l<a*e)?(c=-o[1]*ro,c<Il&&(Il=c)):(t<Il&&(Il=t),t>Ic&&(Ic=t))),u?e<m1?Pc($i,e)>Pc($i,Qi)&&(Qi=e):Pc(e,Qi)>Pc($i,Qi)&&($i=e):Qi>=$i?(e<$i&&($i=e),e>Qi&&(Qi=e)):e>m1?Pc($i,e)>Pc($i,Qi)&&(Qi=e):Pc(e,Qi)>Pc($i,Qi)&&($i=e)}else ay.push(tm=[$i=e,Qi=e]);t<Il&&(Il=t),t>Ic&&(Ic=t),LS=n,m1=e}function EEe(){ig.point=lZe}function CEe(){tm[0]=$i,tm[1]=Qi,ig.point=iJ,LS=null}function cZe(e,t){if(LS){var n=e-m1;YT.add(Ln(n)>180?n+(n>0?360:-360):n)}else sZe=e,aZe=t;lp.point(e,t),lZe(e,t)}function Mun(){lp.lineStart()}function Nun(){cZe(sZe,aZe),lp.lineEnd(),Ln(YT)>Lt&&($i=-(Qi=180)),tm[0]=$i,tm[1]=Qi,LS=null}function Pc(e,t){return(t-=e)<0?t+360:t}function Iun(e,t){return e[0]-t[0]}function _Ee(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function Lun(e){var t,n,r,i,o,s,a;if(Ic=Qi=-($i=Il=1/0),ay=[],cg(e,ig),n=ay.length){for(ay.sort(Iun),t=1,r=ay[0],o=[r];t<n;++t)i=ay[t],_Ee(r,i[0])||_Ee(r,i[1])?(Pc(r[0],i[1])>Pc(r[0],r[1])&&(r[1]=i[1]),Pc(i[0],r[1])>Pc(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(s=-1/0,n=o.length-1,t=0,r=o[n];t<=n;r=i,++t)i=o[t],(a=Pc(r[1],i[0]))>s&&(s=a,$i=i[0],Qi=r[1])}return ay=tm=null,$i===1/0||Il===1/0?[[NaN,NaN],[NaN,NaN]]:[[$i,Il],[Qi,Ic]]}var j$,GF,KF,JF,e4,t4,n4,r4,oJ,sJ,aJ,uZe,fZe,ol,sl,al,rd={sphere:Qs,point:Sfe,lineStart:kEe,lineEnd:$Ee,polygonStart:function(){rd.lineStart=zun,rd.lineEnd=Qun},polygonEnd:function(){rd.lineStart=kEe,rd.lineEnd=$Ee}};function Sfe(e,t){e*=bn,t*=bn;var n=zt(t);RD(n*zt(e),n*Mt(e),Mt(t))}function RD(e,t,n){++j$,KF+=(e-KF)/j$,JF+=(t-JF)/j$,e4+=(n-e4)/j$}function kEe(){rd.point=jun}function jun(e,t){e*=bn,t*=bn;var n=zt(t);ol=n*zt(e),sl=n*Mt(e),al=Mt(t),rd.point=Fun,RD(ol,sl,al)}function Fun(e,t){e*=bn,t*=bn;var n=zt(t),r=n*zt(e),i=n*Mt(e),o=Mt(t),s=bf(Sl((s=sl*o-al*i)*s+(s=al*r-ol*o)*s+(s=ol*i-sl*r)*s),ol*r+sl*i+al*o);GF+=s,t4+=s*(ol+(ol=r)),n4+=s*(sl+(sl=i)),r4+=s*(al+(al=o)),RD(ol,sl,al)}function $Ee(){rd.point=Sfe}function zun(){rd.point=Bun}function Qun(){dZe(uZe,fZe),rd.point=Sfe}function Bun(e,t){uZe=e,fZe=t,e*=bn,t*=bn,rd.point=dZe;var n=zt(t);ol=n*zt(e),sl=n*Mt(e),al=Mt(t),RD(ol,sl,al)}function dZe(e,t){e*=bn,t*=bn;var n=zt(t),r=n*zt(e),i=n*Mt(e),o=Mt(t),s=sl*o-al*i,a=al*r-ol*o,l=ol*i-sl*r,c=JK(s,a,l),u=sc(c),f=c&&-u/c;oJ.add(f*s),sJ.add(f*a),aJ.add(f*l),GF+=u,t4+=u*(ol+(ol=r)),n4+=u*(sl+(sl=i)),r4+=u*(al+(al=o)),RD(ol,sl,al)}function Wun(e){j$=GF=KF=JF=e4=t4=n4=r4=0,oJ=new pl,sJ=new pl,aJ=new pl,cg(e,rd);var t=+oJ,n=+sJ,r=+aJ,i=JK(t,n,r);return i<WF&&(t=t4,n=n4,r=r4,GF<Lt&&(t=KF,n=JF,r=e4),i=JK(t,n,r),i<WF)?[NaN,NaN]:[bf(n,t)*ro,sc(r/i)*ro]}function lJ(e,t){function n(r,i){return r=e(r,i),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,i){return r=t.invert(r,i),r&&e.invert(r[0],r[1])}),n}function cJ(e,t){return Ln(e)>En&&(e-=Math.round(e/wl)*wl),[e,t]}cJ.invert=cJ;function hZe(e,t,n){return(e%=wl)?t||n?lJ(PEe(e),AEe(t,n)):PEe(e):t||n?AEe(t,n):cJ}function TEe(e){return function(t,n){return t+=e,Ln(t)>En&&(t-=Math.round(t/wl)*wl),[t,n]}}function PEe(e){var t=TEe(e);return t.invert=TEe(-e),t}function AEe(e,t){var n=zt(e),r=Mt(e),i=zt(t),o=Mt(t);function s(a,l){var c=zt(l),u=zt(a)*c,f=Mt(a)*c,d=Mt(l),h=d*n+u*r;return[bf(f*i-h*o,u*n-d*r),sc(h*i+f*o)]}return s.invert=function(a,l){var c=zt(l),u=zt(a)*c,f=Mt(a)*c,d=Mt(l),h=d*i-f*o;return[bf(f*i+d*o,u*n+h*r),sc(h*n-u*r)]},s}function qun(e){e=hZe(e[0]*bn,e[1]*bn,e.length>2?e[2]*bn:0);function t(n){return n=e(n[0]*bn,n[1]*bn),n[0]*=ro,n[1]*=ro,n}return t.invert=function(n){return n=e.invert(n[0]*bn,n[1]*bn),n[0]*=ro,n[1]*=ro,n},t}function Vun(e,t,n,r,i,o){if(n){var s=zt(t),a=Mt(t),l=r*n;i==null?(i=t+r*wl,o=t-l/2):(i=REe(s,i),o=REe(s,o),(r>0?i<o:i>o)&&(i+=r*wl));for(var c,u=i;r>0?u>o:u<o;u-=l)c=ZF([s,-a*zt(u),-a*Mt(u)]),e.point(c[0],c[1])}}function REe(e,t){t=mO(t),t[0]-=e,YF(t);var n=nZe(-t[1]);return((-t[2]<0?-n:n)+wl-Lt)%wl}function pZe(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:Qs,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function dL(e,t){return Ln(e[0]-t[0])<Lt&&Ln(e[1]-t[1])<Lt}function oI(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function gZe(e,t,n,r,i){var o=[],s=[],a,l;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,v=p[0],y=p[g],O;if(dL(v,y)){if(!v[2]&&!y[2]){for(i.lineStart(),a=0;a<g;++a)i.point((v=p[a])[0],v[1]);i.lineEnd();return}y[0]+=2*Lt}o.push(O=new oI(v,p,null,!0)),s.push(O.o=new oI(v,null,O,!1)),o.push(O=new oI(y,p,null,!1)),s.push(O.o=new oI(y,null,O,!0))}}),!!o.length){for(s.sort(t),DEe(o),DEe(s),a=0,l=s.length;a<l;++a)s[a].e=n=!n;for(var c=o[0],u,f;;){for(var d=c,h=!0;d.v;)if((d=d.n)===c)return;u=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,l=u.length;a<l;++a)i.point((f=u[a])[0],f[1]);else r(d.x,d.n.x,1,i);d=d.n}else{if(h)for(u=d.p.z,a=u.length-1;a>=0;--a)i.point((f=u[a])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,h=!h}while(!d.v);i.lineEnd()}}}function DEe(e){if(t=e.length){for(var t,n=0,r=e[0],i;++n<t;)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}}function dU(e){return Ln(e[0])<=En?e[0]:Xu(e[0])*((Ln(e[0])+En)%wl-En)}function Uun(e,t){var n=dU(t),r=t[1],i=Mt(r),o=[Mt(n),-zt(n),0],s=0,a=0,l=new pl;i===1?r=Hi+Lt:i===-1&&(r=-Hi-Lt);for(var c=0,u=e.length;c<u;++c)if(d=(f=e[c]).length)for(var f,d,h=f[d-1],p=dU(h),g=h[1]/2+qF,v=Mt(g),y=zt(g),O=0;O<d;++O,p=w,v=E,y=C,h=m){var m=f[O],w=dU(m),S=m[1]/2+qF,E=Mt(S),C=zt(S),k=w-p,P=k>=0?1:-1,D=P*k,M=D>En,L=v*E;if(l.add(bf(L*P*Mt(D),y*C+L*zt(D))),s+=M?k+P*wl:k,M^p>=n^w>=n){var A=VE(mO(h),mO(m));YF(A);var T=VE(o,A);YF(T);var N=(M^k>=0?-1:1)*sc(T[2]);(r>N||r===N&&(A[0]||A[1]))&&(a+=M^k>=0?1:-1)}}return(s<-Lt||s<Lt&&l<-WF)^a&1}function mZe(e,t,n,r){return function(i){var o=t(i),s=pZe(),a=t(s),l=!1,c,u,f,d={point:h,lineStart:g,lineEnd:v,polygonStart:function(){d.point=y,d.lineStart=O,d.lineEnd=m,u=[],c=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=v,u=j8e(u);var w=Uun(c,r);u.length?(l||(i.polygonStart(),l=!0),gZe(u,Xun,w,n,i)):w&&(l||(i.polygonStart(),l=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),u=c=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function h(w,S){e(w,S)&&i.point(w,S)}function p(w,S){o.point(w,S)}function g(){d.point=p,o.lineStart()}function v(){d.point=h,o.lineEnd()}function y(w,S){f.push([w,S]),a.point(w,S)}function O(){a.lineStart(),f=[]}function m(){y(f[0][0],f[0][1]),a.lineEnd();var w=a.clean(),S=s.result(),E,C=S.length,k,P,D;if(f.pop(),c.push(f),f=null,!!C){if(w&1){if(P=S[0],(k=P.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),E=0;E<k;++E)i.point((D=P[E])[0],D[1]);i.lineEnd()}return}C>1&&w&2&&S.push(S.pop().concat(S.shift())),u.push(S.filter(Hun))}}return d}}function Hun(e){return e.length>1}function Xun(e,t){return((e=e.x)[0]<0?e[1]-Hi-Lt:Hi-e[1])-((t=t.x)[0]<0?t[1]-Hi-Lt:Hi-t[1])}const MEe=mZe(function(){return!0},Zun,Gun,[-En,-Hi]);function Zun(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,s){var a=o>0?En:-En,l=Ln(o-t);Ln(l-En)<Lt?(e.point(t,n=(n+s)/2>0?Hi:-Hi),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(o,n),i=0):r!==a&&l>=En&&(Ln(t-r)<Lt&&(t-=r*Lt),Ln(o-a)<Lt&&(o-=a*Lt),n=Yun(t,n,o,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),i=0),e.point(t=o,n=s),r=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function Yun(e,t,n,r){var i,o,s=Mt(e-n);return Ln(s)>Lt?T_((Mt(t)*(o=zt(r))*Mt(n)-Mt(r)*(i=zt(t))*Mt(e))/(i*o*s)):(t+r)/2}function Gun(e,t,n,r){var i;if(e==null)i=n*Hi,r.point(-En,i),r.point(0,i),r.point(En,i),r.point(En,0),r.point(En,-i),r.point(0,-i),r.point(-En,-i),r.point(-En,0),r.point(-En,i);else if(Ln(e[0]-t[0])>Lt){var o=e[0]<t[0]?En:-En;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function Kun(e){var t=zt(e),n=2*bn,r=t>0,i=Ln(t)>Lt;function o(u,f,d,h){Vun(h,e,n,d,u,f)}function s(u,f){return zt(u)*zt(f)>t}function a(u){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(v,y){var O=[v,y],m,w=s(v,y),S=r?w?0:c(v,y):w?c(v+(v<0?En:-En),y):0;if(!f&&(p=h=w)&&u.lineStart(),w!==h&&(m=l(f,O),(!m||dL(f,m)||dL(O,m))&&(O[2]=1)),w!==h)g=0,w?(u.lineStart(),m=l(O,f),u.point(m[0],m[1])):(m=l(f,O),u.point(m[0],m[1],2),u.lineEnd()),f=m;else if(i&&f&&r^w){var E;!(S&d)&&(E=l(O,f,!0))&&(g=0,r?(u.lineStart(),u.point(E[0][0],E[0][1]),u.point(E[1][0],E[1][1]),u.lineEnd()):(u.point(E[1][0],E[1][1]),u.lineEnd(),u.lineStart(),u.point(E[0][0],E[0][1],3)))}w&&(!f||!dL(f,O))&&u.point(O[0],O[1]),f=O,h=w,d=S},lineEnd:function(){h&&u.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(u,f,d){var h=mO(u),p=mO(f),g=[1,0,0],v=VE(h,p),y=rI(v,v),O=v[0],m=y-O*O;if(!m)return!d&&u;var w=t*y/m,S=-t*O/m,E=VE(g,v),C=iI(g,w),k=iI(v,S);fU(C,k);var P=E,D=rI(C,P),M=rI(P,P),L=D*D-M*(rI(C,C)-1);if(!(L<0)){var A=Sl(L),T=iI(P,(-D-A)/M);if(fU(T,C),T=ZF(T),!d)return T;var N=u[0],j=f[0],z=u[1],W=f[1],F;j<N&&(F=N,N=j,j=F);var q=j-N,U=Ln(q-En)<Lt,V=U||q<Lt;if(!U&&W<z&&(F=z,z=W,W=F),V?U?z+W>0^T[1]<(Ln(T[0]-N)<Lt?z:W):z<=T[1]&&T[1]<=W:q>En^(N<=T[0]&&T[0]<=j)){var H=iI(P,(-D+A)/M);return fU(H,C),[T,ZF(H)]}}}function c(u,f){var d=r?e:En-e,h=0;return u<-d?h|=1:u>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return mZe(s,a,o,r?[0,-e]:[-En,e-En])}function Jun(e,t,n,r,i,o){var s=e[0],a=e[1],l=t[0],c=t[1],u=0,f=1,d=l-s,h=c-a,p;if(p=n-s,!(!d&&p>0)){if(p/=d,d<0){if(p<u)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>u&&(u=p)}if(p=i-s,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>u&&(u=p)}else if(d>0){if(p<u)return;p<f&&(f=p)}if(p=r-a,!(!h&&p>0)){if(p/=h,h<0){if(p<u)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>u&&(u=p)}if(p=o-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>u&&(u=p)}else if(h>0){if(p<u)return;p<f&&(f=p)}return u>0&&(e[0]=s+u*d,e[1]=a+u*h),f<1&&(t[0]=s+f*d,t[1]=a+f*h),!0}}}}}var F$=1e9,sI=-F$;function yZe(e,t,n,r){function i(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function o(c,u,f,d){var h=0,p=0;if(c==null||(h=s(c,f))!==(p=s(u,f))||l(c,u)<0^f>0)do d.point(h===0||h===3?e:n,h>1?r:t);while((h=(h+f+4)%4)!==p);else d.point(u[0],u[1])}function s(c,u){return Ln(c[0]-e)<Lt?u>0?0:3:Ln(c[0]-n)<Lt?u>0?2:1:Ln(c[1]-t)<Lt?u>0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var f=s(c,1),d=s(u,1);return f!==d?f-d:f===0?u[1]-c[1]:f===1?c[0]-u[0]:f===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,f=pZe(),d,h,p,g,v,y,O,m,w,S,E,C={point:k,lineStart:L,lineEnd:A,polygonStart:D,polygonEnd:M};function k(N,j){i(N,j)&&u.point(N,j)}function P(){for(var N=0,j=0,z=h.length;j<z;++j)for(var W=h[j],F=1,q=W.length,U=W[0],V,H,Z=U[0],ee=U[1];F<q;++F)V=Z,H=ee,U=W[F],Z=U[0],ee=U[1],H<=r?ee>r&&(Z-V)*(r-H)>(ee-H)*(e-V)&&++N:ee<=r&&(Z-V)*(r-H)<(ee-H)*(e-V)&&--N;return N}function D(){u=f,d=[],h=[],E=!0}function M(){var N=P(),j=E&&N,z=(d=j8e(d)).length;(j||z)&&(c.polygonStart(),j&&(c.lineStart(),o(null,null,1,c),c.lineEnd()),z&&gZe(d,a,N,o,c),c.polygonEnd()),u=c,d=h=p=null}function L(){C.point=T,h&&h.push(p=[]),S=!0,w=!1,O=m=NaN}function A(){d&&(T(g,v),y&&w&&f.rejoin(),d.push(f.result())),C.point=k,w&&u.lineEnd()}function T(N,j){var z=i(N,j);if(h&&p.push([N,j]),S)g=N,v=j,y=z,S=!1,z&&(u.lineStart(),u.point(N,j));else if(z&&w)u.point(N,j);else{var W=[O=Math.max(sI,Math.min(F$,O)),m=Math.max(sI,Math.min(F$,m))],F=[N=Math.max(sI,Math.min(F$,N)),j=Math.max(sI,Math.min(F$,j))];Jun(W,F,e,t,n,r)?(w||(u.lineStart(),u.point(W[0],W[1])),u.point(F[0],F[1]),z||u.lineEnd(),E=!1):z&&(u.lineStart(),u.point(N,j),E=!1)}O=N,m=j,w=z}return C}}function NEe(e,t,n){var r=Qc(e,t-Lt,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function IEe(e,t,n){var r=Qc(e,t-Lt,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function efn(){var e,t,n,r,i,o,s,a,l=10,c=l,u=90,f=360,d,h,p,g,v=2.5;function y(){return{type:"MultiLineString",coordinates:O()}}function O(){return Qc(nI(r/u)*u,n,u).map(p).concat(Qc(nI(a/f)*f,s,f).map(g)).concat(Qc(nI(t/l)*l,e,l).filter(function(m){return Ln(m%u)>Lt}).map(d)).concat(Qc(nI(o/c)*c,i,c).filter(function(m){return Ln(m%f)>Lt}).map(h))}return y.lines=function(){return O().map(function(m){return{type:"LineString",coordinates:m}})},y.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(g(s).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(m){return arguments.length?y.extentMajor(m).extentMinor(m):y.extentMinor()},y.extentMajor=function(m){return arguments.length?(r=+m[0][0],n=+m[1][0],a=+m[0][1],s=+m[1][1],r>n&&(m=r,r=n,n=m),a>s&&(m=a,a=s,s=m),y.precision(v)):[[r,a],[n,s]]},y.extentMinor=function(m){return arguments.length?(t=+m[0][0],e=+m[1][0],o=+m[0][1],i=+m[1][1],t>e&&(m=t,t=e,e=m),o>i&&(m=o,o=i,i=m),y.precision(v)):[[t,o],[e,i]]},y.step=function(m){return arguments.length?y.stepMajor(m).stepMinor(m):y.stepMinor()},y.stepMajor=function(m){return arguments.length?(u=+m[0],f=+m[1],y):[u,f]},y.stepMinor=function(m){return arguments.length?(l=+m[0],c=+m[1],y):[l,c]},y.precision=function(m){return arguments.length?(v=+m,d=NEe(o,i,90),h=IEe(t,e,v),p=NEe(a,s,90),g=IEe(r,n,v),y):v},y.extentMajor([[-180,-90+Lt],[180,90-Lt]]).extentMinor([[-180,-80-Lt],[180,80+Lt]])}const sA=e=>e;var hU=new pl,uJ=new pl,vZe,bZe,fJ,dJ,ug={point:Qs,lineStart:Qs,lineEnd:Qs,polygonStart:function(){ug.lineStart=tfn,ug.lineEnd=rfn},polygonEnd:function(){ug.lineStart=ug.lineEnd=ug.point=Qs,hU.add(Ln(uJ)),uJ=new pl},result:function(){var e=hU/2;return hU=new pl,e}};function tfn(){ug.point=nfn}function nfn(e,t){ug.point=OZe,vZe=fJ=e,bZe=dJ=t}function OZe(e,t){uJ.add(dJ*e-fJ*t),fJ=e,dJ=t}function rfn(){OZe(vZe,bZe)}var UE=1/0,i4=UE,aA=-UE,o4=aA,s4={point:ifn,lineStart:Qs,lineEnd:Qs,polygonStart:Qs,polygonEnd:Qs,result:function(){var e=[[UE,i4],[aA,o4]];return aA=o4=-(i4=UE=1/0),e}};function ifn(e,t){e<UE&&(UE=e),e>aA&&(aA=e),t<i4&&(i4=t),t>o4&&(o4=t)}var hJ=0,pJ=0,z$=0,a4=0,l4=0,Gw=0,gJ=0,mJ=0,Q$=0,xZe,wZe,Sh,Eh,Fu={point:yO,lineStart:LEe,lineEnd:jEe,polygonStart:function(){Fu.lineStart=afn,Fu.lineEnd=lfn},polygonEnd:function(){Fu.point=yO,Fu.lineStart=LEe,Fu.lineEnd=jEe},result:function(){var e=Q$?[gJ/Q$,mJ/Q$]:Gw?[a4/Gw,l4/Gw]:z$?[hJ/z$,pJ/z$]:[NaN,NaN];return hJ=pJ=z$=a4=l4=Gw=gJ=mJ=Q$=0,e}};function yO(e,t){hJ+=e,pJ+=t,++z$}function LEe(){Fu.point=ofn}function ofn(e,t){Fu.point=sfn,yO(Sh=e,Eh=t)}function sfn(e,t){var n=e-Sh,r=t-Eh,i=Sl(n*n+r*r);a4+=i*(Sh+e)/2,l4+=i*(Eh+t)/2,Gw+=i,yO(Sh=e,Eh=t)}function jEe(){Fu.point=yO}function afn(){Fu.point=cfn}function lfn(){SZe(xZe,wZe)}function cfn(e,t){Fu.point=SZe,yO(xZe=Sh=e,wZe=Eh=t)}function SZe(e,t){var n=e-Sh,r=t-Eh,i=Sl(n*n+r*r);a4+=i*(Sh+e)/2,l4+=i*(Eh+t)/2,Gw+=i,i=Eh*e-Sh*t,gJ+=i*(Sh+e),mJ+=i*(Eh+t),Q$+=i*3,yO(Sh=e,Eh=t)}function EZe(e){this._context=e}EZe.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,wl);break}}},result:Qs};var yJ=new pl,pU,CZe,_Ze,B$,W$,lA={point:Qs,lineStart:function(){lA.point=ufn},lineEnd:function(){pU&&kZe(CZe,_Ze),lA.point=Qs},polygonStart:function(){pU=!0},polygonEnd:function(){pU=null},result:function(){var e=+yJ;return yJ=new pl,e}};function ufn(e,t){lA.point=kZe,CZe=B$=e,_Ze=W$=t}function kZe(e,t){B$-=e,W$-=t,yJ.add(Sl(B$*B$+W$*W$)),B$=e,W$=t}let FEe,c4,zEe,QEe;class BEe{constructor(t){this._append=t==null?$Ze:ffn(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==zEe||this._append!==c4){const r=this._radius,i=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,zEe=r,c4=this._append,QEe=this._,this._=i}this._+=QEe;break}}}result(){const t=this._;return this._="",t.length?t:null}}function $Ze(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ffn(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return $Ze;if(t!==FEe){const n=10**t;FEe=t,c4=function(i){let o=1;this._+=i[0];for(const s=i.length;o<s;++o)this._+=Math.round(arguments[o]*n)/n+i[o]}}return c4}function TZe(e,t){let n=3,r=4.5,i,o;function s(a){return a&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),cg(a,i(o))),o.result()}return s.area=function(a){return cg(a,i(ug)),ug.result()},s.measure=function(a){return cg(a,i(lA)),lA.result()},s.bounds=function(a){return cg(a,i(s4)),s4.result()},s.centroid=function(a){return cg(a,i(Fu)),Fu.result()},s.projection=function(a){return arguments.length?(i=a==null?(e=null,sA):(e=a).stream,s):e},s.context=function(a){return arguments.length?(o=a==null?(t=null,new BEe(n)):new EZe(t=a),typeof r!="function"&&o.pointRadius(r),s):t},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(o.pointRadius(+a),+a),s):r},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const l=Math.floor(a);if(!(l>=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(o=new BEe(n)),s},s.projection(e).digits(n).context(t)}function j9(e){return function(t){var n=new vJ;for(var r in e)n[r]=e[r];return n.stream=t,n}}function vJ(){}vJ.prototype={constructor:vJ,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Efe(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),cg(n,e.stream(s4)),t(s4.result()),r!=null&&e.clipExtent(r),e}function F9(e,t,n){return Efe(e,function(r){var i=t[1][0]-t[0][0],o=t[1][1]-t[0][1],s=Math.min(i/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),a=+t[0][0]+(i-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(o-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,l])},n)}function Cfe(e,t,n){return F9(e,[[0,0],t],n)}function _fe(e,t,n){return Efe(e,function(r){var i=+t,o=i/(r[1][0]-r[0][0]),s=(i-o*(r[1][0]+r[0][0]))/2,a=-o*r[0][1];e.scale(150*o).translate([s,a])},n)}function kfe(e,t,n){return Efe(e,function(r){var i=+t,o=i/(r[1][1]-r[0][1]),s=-o*r[0][0],a=(i-o*(r[1][1]+r[0][1]))/2;e.scale(150*o).translate([s,a])},n)}var WEe=16,dfn=zt(30*bn);function qEe(e,t){return+t?pfn(e,t):hfn(e)}function hfn(e){return j9({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function pfn(e,t){function n(r,i,o,s,a,l,c,u,f,d,h,p,g,v){var y=c-r,O=u-i,m=y*y+O*O;if(m>4*t&&g--){var w=s+d,S=a+h,E=l+p,C=Sl(w*w+S*S+E*E),k=sc(E/=C),P=Ln(Ln(E)-1)<Lt||Ln(o-f)<Lt?(o+f)/2:bf(S,w),D=e(P,k),M=D[0],L=D[1],A=M-r,T=L-i,N=O*A-y*T;(N*N/m>t||Ln((y*A+O*T)/m-.5)>.3||s*d+a*h+l*p<dfn)&&(n(r,i,o,s,a,l,M,L,P,w/=C,S/=C,E,g,v),v.point(M,L),n(M,L,P,w,S,E,c,u,f,d,h,p,g,v))}}return function(r){var i,o,s,a,l,c,u,f,d,h,p,g,v={point:y,lineStart:O,lineEnd:w,polygonStart:function(){r.polygonStart(),v.lineStart=S},polygonEnd:function(){r.polygonEnd(),v.lineStart=O}};function y(k,P){k=e(k,P),r.point(k[0],k[1])}function O(){f=NaN,v.point=m,r.lineStart()}function m(k,P){var D=mO([k,P]),M=e(k,P);n(f,d,u,h,p,g,f=M[0],d=M[1],u=k,h=D[0],p=D[1],g=D[2],WEe,r),r.point(f,d)}function w(){v.point=y,r.lineEnd()}function S(){O(),v.point=E,v.lineEnd=C}function E(k,P){m(i=k,P),o=f,s=d,a=h,l=p,c=g,v.point=m}function C(){n(f,d,u,h,p,g,o,s,i,a,l,c,WEe,r),v.lineEnd=w,w()}return v}}var gfn=j9({point:function(e,t){this.stream.point(e*bn,t*bn)}});function mfn(e){return j9({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function yfn(e,t,n,r,i){function o(s,a){return s*=r,a*=i,[t+e*s,n-e*a]}return o.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*i]},o}function VEe(e,t,n,r,i,o){if(!o)return yfn(e,t,n,r,i);var s=zt(o),a=Mt(o),l=s*e,c=a*e,u=s/e,f=a/e,d=(a*n-s*t)/e,h=(a*t+s*n)/e;function p(g,v){return g*=r,v*=i,[l*g-c*v+t,n-c*g-l*v]}return p.invert=function(g,v){return[r*(u*g-f*v+d),i*(h-f*g-u*v)]},p}function kp(e){return PZe(function(){return e})()}function PZe(e){var t,n=150,r=480,i=250,o=0,s=0,a=0,l=0,c=0,u,f=0,d=1,h=1,p=null,g=MEe,v=null,y,O,m,w=sA,S=.5,E,C,k,P,D;function M(N){return k(N[0]*bn,N[1]*bn)}function L(N){return N=k.invert(N[0],N[1]),N&&[N[0]*ro,N[1]*ro]}M.stream=function(N){return P&&D===N?P:P=gfn(mfn(u)(g(E(w(D=N)))))},M.preclip=function(N){return arguments.length?(g=N,p=void 0,T()):g},M.postclip=function(N){return arguments.length?(w=N,v=y=O=m=null,T()):w},M.clipAngle=function(N){return arguments.length?(g=+N?Kun(p=N*bn):(p=null,MEe),T()):p*ro},M.clipExtent=function(N){return arguments.length?(w=N==null?(v=y=O=m=null,sA):yZe(v=+N[0][0],y=+N[0][1],O=+N[1][0],m=+N[1][1]),T()):v==null?null:[[v,y],[O,m]]},M.scale=function(N){return arguments.length?(n=+N,A()):n},M.translate=function(N){return arguments.length?(r=+N[0],i=+N[1],A()):[r,i]},M.center=function(N){return arguments.length?(o=N[0]%360*bn,s=N[1]%360*bn,A()):[o*ro,s*ro]},M.rotate=function(N){return arguments.length?(a=N[0]%360*bn,l=N[1]%360*bn,c=N.length>2?N[2]%360*bn:0,A()):[a*ro,l*ro,c*ro]},M.angle=function(N){return arguments.length?(f=N%360*bn,A()):f*ro},M.reflectX=function(N){return arguments.length?(d=N?-1:1,A()):d<0},M.reflectY=function(N){return arguments.length?(h=N?-1:1,A()):h<0},M.precision=function(N){return arguments.length?(E=qEe(C,S=N*N),T()):Sl(S)},M.fitExtent=function(N,j){return F9(M,N,j)},M.fitSize=function(N,j){return Cfe(M,N,j)},M.fitWidth=function(N,j){return _fe(M,N,j)},M.fitHeight=function(N,j){return kfe(M,N,j)};function A(){var N=VEe(n,0,0,d,h,f).apply(null,t(o,s)),j=VEe(n,r-N[0],i-N[1],d,h,f);return u=hZe(a,l,c),C=lJ(t,j),k=lJ(u,C),E=qEe(C,S),T()}function T(){return P=D=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&L,A()}}function $fe(e){var t=0,n=En/3,r=PZe(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*bn,n=o[1]*bn):[t*ro,n*ro]},i}function vfn(e){var t=zt(e);function n(r,i){return[r*t,Mt(i)/t]}return n.invert=function(r,i){return[r/t,sc(i*t)]},n}function bfn(e,t){var n=Mt(e),r=(n+Mt(t))/2;if(Ln(r)<Lt)return vfn(e);var i=1+n*(2*r-n),o=Sl(i)/r;function s(a,l){var c=Sl(i-2*r*Mt(l))/r;return[c*Mt(a*=r),o-c*zt(a)]}return s.invert=function(a,l){var c=o-l,u=bf(a,Ln(c))*Xu(c);return c*r<0&&(u-=En*Xu(a)*Xu(c)),[u/r,sc((i-(a*a+c*c)*r*r)/(2*r))]},s}function u4(){return $fe(bfn).scale(155.424).center([0,33.6442])}function AZe(){return u4().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Ofn(e){var t=e.length;return{point:function(n,r){for(var i=-1;++i<t;)e[i].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function xfn(){var e,t,n=AZe(),r,i=u4().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,s=u4().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,l,c={point:function(d,h){l=[d,h]}};function u(d){var h=d[0],p=d[1];return l=null,r.point(h,p),l||(o.point(h,p),l)||(a.point(h,p),l)}u.invert=function(d){var h=n.scale(),p=n.translate(),g=(d[0]-p[0])/h,v=(d[1]-p[1])/h;return(v>=.12&&v<.234&&g>=-.425&&g<-.214?i:v>=.166&&v<.234&&g>=-.214&&g<-.115?s:n).invert(d)},u.stream=function(d){return e&&t===d?e:e=Ofn([n.stream(t=d),i.stream(d),s.stream(d)])},u.precision=function(d){return arguments.length?(n.precision(d),i.precision(d),s.precision(d),f()):n.precision()},u.scale=function(d){return arguments.length?(n.scale(d),i.scale(d*.35),s.scale(d),u.translate(n.translate())):n.scale()},u.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return r=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(c),o=i.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+Lt,g+.12*h+Lt],[p-.214*h-Lt,g+.234*h-Lt]]).stream(c),a=s.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+Lt,g+.166*h+Lt],[p-.115*h-Lt,g+.234*h-Lt]]).stream(c),f()},u.fitExtent=function(d,h){return F9(u,d,h)},u.fitSize=function(d,h){return Cfe(u,d,h)},u.fitWidth=function(d,h){return _fe(u,d,h)},u.fitHeight=function(d,h){return kfe(u,d,h)};function f(){return e=t=null,u}return u.scale(1070)}function RZe(e){return function(t,n){var r=zt(t),i=zt(n),o=e(r*i);return o===1/0?[2,0]:[o*i*Mt(t),o*Mt(n)]}}function DD(e){return function(t,n){var r=Sl(t*t+n*n),i=e(r),o=Mt(i),s=zt(i);return[bf(t*o,r*s),sc(r&&n*o/r)]}}var DZe=RZe(function(e){return Sl(2/(1+e))});DZe.invert=DD(function(e){return 2*sc(e/2)});function wfn(){return kp(DZe).scale(124.75).clipAngle(180-.001)}var MZe=RZe(function(e){return(e=nZe(e))&&e/Mt(e)});MZe.invert=DD(function(e){return e});function Sfn(){return kp(MZe).scale(79.4188).clipAngle(180-.001)}function z9(e,t){return[e,VF(wfe((Hi+t)/2))]}z9.invert=function(e,t){return[e,2*T_(tZe(t))-Hi]};function Efn(){return NZe(z9).scale(961/wl)}function NZe(e){var t=kp(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,s=null,a,l,c;t.scale=function(f){return arguments.length?(r(f),u()):r()},t.translate=function(f){return arguments.length?(i(f),u()):i()},t.center=function(f){return arguments.length?(n(f),u()):n()},t.clipExtent=function(f){return arguments.length?(f==null?s=a=l=c=null:(s=+f[0][0],a=+f[0][1],l=+f[1][0],c=+f[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var f=En*r(),d=t(qun(t.rotate()).invert([0,0]));return o(s==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===z9?[[Math.max(d[0]-f,s),a],[Math.min(d[0]+f,l),c]]:[[s,Math.max(d[1]-f,a)],[l,Math.min(d[1]+f,c)]])}return u()}function aI(e){return wfe((Hi+e)/2)}function Cfn(e,t){var n=zt(e),r=e===t?Mt(e):VF(n/zt(t))/VF(aI(t)/aI(e)),i=n*uU(aI(e),r)/r;if(!r)return z9;function o(s,a){i>0?a<-Hi+Lt&&(a=-Hi+Lt):a>Hi-Lt&&(a=Hi-Lt);var l=i/uU(aI(a),r);return[l*Mt(r*s),i-l*zt(r*s)]}return o.invert=function(s,a){var l=i-a,c=Xu(r)*Sl(s*s+l*l),u=bf(s,Ln(l))*Xu(l);return l*r<0&&(u-=En*Xu(s)*Xu(l)),[u/r,2*T_(uU(i/c,1/r))-Hi]},o}function _fn(){return $fe(Cfn).scale(109.5).parallels([30,30])}function f4(e,t){return[e,t]}f4.invert=f4;function kfn(){return kp(f4).scale(152.63)}function $fn(e,t){var n=zt(e),r=e===t?Mt(e):(n-zt(t))/(t-e),i=n/r+e;if(Ln(r)<Lt)return f4;function o(s,a){var l=i-a,c=r*s;return[l*Mt(c),i-l*zt(c)]}return o.invert=function(s,a){var l=i-a,c=bf(s,Ln(l))*Xu(l);return l*r<0&&(c-=En*Xu(s)*Xu(l)),[c/r,i-Xu(r)*Sl(s*s+l*l)]},o}function Tfn(){return $fe($fn).scale(131.154).center([0,13.9389])}var GT=1.340264,KT=-.081106,JT=893e-6,e2=.003796,d4=Sl(3)/2,Pfn=12;function IZe(e,t){var n=sc(d4*Mt(t)),r=n*n,i=r*r*r;return[e*zt(n)/(d4*(GT+3*KT*r+i*(7*JT+9*e2*r))),n*(GT+KT*r+i*(JT+e2*r))]}IZe.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,s,a,l;o<Pfn&&(a=n*(GT+KT*r+i*(JT+e2*r))-t,l=GT+3*KT*r+i*(7*JT+9*e2*r),n-=s=a/l,r=n*n,i=r*r*r,!(Ln(s)<WF));++o);return[d4*e*(GT+3*KT*r+i*(7*JT+9*e2*r))/zt(n),sc(Mt(n)/d4)]};function Afn(){return kp(IZe).scale(177.158)}function LZe(e,t){var n=zt(t),r=zt(e)*n;return[n*Mt(e)/r,Mt(t)/r]}LZe.invert=DD(T_);function Rfn(){return kp(LZe).scale(144.049).clipAngle(60)}function Dfn(){var e=1,t=0,n=0,r=1,i=1,o=0,s,a,l=null,c,u,f,d=1,h=1,p=j9({point:function(w,S){var E=m([w,S]);this.stream.point(E[0],E[1])}}),g=sA,v,y;function O(){return d=e*r,h=e*i,v=y=null,m}function m(w){var S=w[0]*d,E=w[1]*h;if(o){var C=E*s-S*a;S=S*s+E*a,E=C}return[S+t,E+n]}return m.invert=function(w){var S=w[0]-t,E=w[1]-n;if(o){var C=E*s+S*a;S=S*s-E*a,E=C}return[S/d,E/h]},m.stream=function(w){return v&&y===w?v:v=p(g(y=w))},m.postclip=function(w){return arguments.length?(g=w,l=c=u=f=null,O()):g},m.clipExtent=function(w){return arguments.length?(g=w==null?(l=c=u=f=null,sA):yZe(l=+w[0][0],c=+w[0][1],u=+w[1][0],f=+w[1][1]),O()):l==null?null:[[l,c],[u,f]]},m.scale=function(w){return arguments.length?(e=+w,O()):e},m.translate=function(w){return arguments.length?(t=+w[0],n=+w[1],O()):[t,n]},m.angle=function(w){return arguments.length?(o=w%360*bn,a=Mt(o),s=zt(o),O()):o*ro},m.reflectX=function(w){return arguments.length?(r=w?-1:1,O()):r<0},m.reflectY=function(w){return arguments.length?(i=w?-1:1,O()):i<0},m.fitExtent=function(w,S){return F9(m,w,S)},m.fitSize=function(w,S){return Cfe(m,w,S)},m.fitWidth=function(w,S){return _fe(m,w,S)},m.fitHeight=function(w,S){return kfe(m,w,S)},m}function jZe(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}jZe.invert=function(e,t){var n=t,r=25,i;do{var o=n*n,s=o*o;n-=i=(n*(1.007226+o*(.015085+s*(-.044475+.028874*o-.005916*s)))-t)/(1.007226+o*(.015085*3+s*(-.044475*7+.028874*9*o-.005916*11*s)))}while(Ln(i)>Lt&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function Mfn(){return kp(jZe).scale(175.295)}function FZe(e,t){return[zt(t)*Mt(e),Mt(t)]}FZe.invert=DD(sc);function Nfn(){return kp(FZe).scale(249.5).clipAngle(90+Lt)}function zZe(e,t){var n=zt(t),r=1+zt(e)*n;return[n*Mt(e)/r,Mt(t)/r]}zZe.invert=DD(function(e){return 2*T_(e)});function Ifn(){return kp(zZe).scale(250).clipAngle(142)}function QZe(e,t){return[VF(wfe((Hi+t)/2)),-e]}QZe.invert=function(e,t){return[-t,2*T_(tZe(e))-Hi]};function Lfn(){var e=NZe(QZe),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}var jfn=Math.abs,bJ=Math.cos,h4=Math.sin,Ffn=1e-6,BZe=Math.PI,OJ=BZe/2,UEe=zfn(2);function HEe(e){return e>1?OJ:e<-1?-OJ:Math.asin(e)}function zfn(e){return e>0?Math.sqrt(e):0}function Qfn(e,t){var n=e*h4(t),r=30,i;do t-=i=(t+h4(t)-n)/(1+bJ(t));while(jfn(i)>Ffn&&--r>0);return t/2}function Bfn(e,t,n){function r(i,o){return[e*i*bJ(o=Qfn(n,o)),t*h4(o)]}return r.invert=function(i,o){return o=HEe(o/t),[i/(e*bJ(o)),HEe((2*o+h4(2*o))/n)]},r}var Wfn=Bfn(UEe/OJ,UEe,BZe);function qfn(){return kp(Wfn).scale(169.529)}const Vfn=TZe(),xJ=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function Ufn(e,t){return function n(){const r=t();return r.type=e,r.path=TZe().projection(r),r.copy=r.copy||function(){const i=n();return xJ.forEach(o=>{r[o]&&i[o](r[o]())}),i.path.pointRadius(r.path.pointRadius()),i},aHe(r)}}function Tfe(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(p4[e]=Ufn(e,t),this):p4[e]||null}function WZe(e){return e&&e.path||Vfn}const p4={albers:AZe,albersusa:xfn,azimuthalequalarea:wfn,azimuthalequidistant:Sfn,conicconformal:_fn,conicequalarea:u4,conicequidistant:Tfn,equalEarth:Afn,equirectangular:kfn,gnomonic:Rfn,identity:Dfn,mercator:Efn,mollweide:qfn,naturalEarth1:Mfn,orthographic:Nfn,stereographic:Ifn,transversemercator:Lfn};for(const e in p4)Tfe(e,p4[e]);function Hfn(){}const qp=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function qZe(){var e=1,t=1,n=a;function r(l,c){return c.map(u=>i(l,u))}function i(l,c){var u=[],f=[];return o(l,c,d=>{n(d,l,c),Xfn(d)>0?u.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=u.length,g;h<p;++h)if(Zfn((g=u[h])[0],d)!==-1){g.push(d);return}}),{type:"MultiPolygon",value:c,coordinates:u}}function o(l,c,u){var f=new Array,d=new Array,h,p,g,v,y,O;for(h=p=-1,v=l[0]>=c,qp[v<<1].forEach(m);++h<e-1;)g=v,v=l[h+1]>=c,qp[g|v<<1].forEach(m);for(qp[v<<0].forEach(m);++p<t-1;){for(h=-1,v=l[p*e+e]>=c,y=l[p*e]>=c,qp[v<<1|y<<2].forEach(m);++h<e-1;)g=v,v=l[p*e+e+h+1]>=c,O=y,y=l[p*e+h+1]>=c,qp[g|v<<1|y<<2|O<<3].forEach(m);qp[v|y<<3].forEach(m)}for(h=-1,y=l[p*e]>=c,qp[y<<2].forEach(m);++h<e-1;)O=y,y=l[p*e+h+1]>=c,qp[y<<2|O<<3].forEach(m);qp[y<<3].forEach(m);function m(w){var S=[w[0][0]+h,w[0][1]+p],E=[w[1][0]+h,w[1][1]+p],C=s(S),k=s(E),P,D;(P=d[C])?(D=f[k])?(delete d[P.end],delete f[D.start],P===D?(P.ring.push(E),u(P.ring)):f[P.start]=d[D.end]={start:P.start,end:D.end,ring:P.ring.concat(D.ring)}):(delete d[P.end],P.ring.push(E),d[P.end=k]=P):(P=f[k])?(D=d[C])?(delete f[P.start],delete d[D.end],P===D?(P.ring.push(E),u(P.ring)):f[D.start]=d[P.end]={start:D.start,end:P.end,ring:D.ring.concat(P.ring)}):(delete f[P.start],P.ring.unshift(S),f[P.start=C]=P):f[C]=d[k]={start:C,end:k,ring:[S,E]}}}function s(l){return l[0]*2+l[1]*(e+1)*4}function a(l,c,u){l.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,v,y=c[g*e+p];d>0&&d<e&&p===d&&(v=c[g*e+p-1],f[0]=d+(u-v)/(y-v)-.5),h>0&&h<t&&g===h&&(v=c[(g-1)*e+p],f[1]=h+(u-v)/(y-v)-.5)})}return r.contour=i,r.size=function(l){if(!arguments.length)return[e,t];var c=Math.floor(l[0]),u=Math.floor(l[1]);return c>=0&&u>=0||Le("invalid size"),e=c,t=u,r},r.smooth=function(l){return arguments.length?(n=l?a:Hfn,r):n===a},r}function Xfn(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r}function Zfn(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=Yfn(e,t[n]))return i;return 0}function Yfn(e,t){for(var n=t[0],r=t[1],i=-1,o=0,s=e.length,a=s-1;o<s;a=o++){var l=e[o],c=l[0],u=l[1],f=e[a],d=f[0],h=f[1];if(Gfn(l,f,t))return 0;u>r!=h>r&&n<(d-c)*(r-u)/(h-u)+c&&(i=-i)}return i}function Gfn(e,t,n){var r;return Kfn(e,t,n)&&Jfn(e[r=+(e[0]===t[0])],n[r],t[r])}function Kfn(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function Jfn(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function VZe(e,t,n){return function(r){var i=rp(r),o=n?Math.min(i[0],0):i[0],s=i[1],a=s-o,l=t?z0(o,s,e):a/(e+1);return Qc(o+l,s,l)}}function Pfe(e){De.call(this,null,e)}Pfe.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};Ke(Pfe,De,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=e.field||Ba,o=qZe().smooth(e.smooth!==!1),s=e.thresholds||edn(r,i,e),a=e.as===null?null:e.as||"contour",l=[];return r.forEach(c=>{const u=i(c),f=o.size([u.width,u.height])(u.values,ze(s)?s:s(u.values));tdn(f,u,c,e),f.forEach(d=>{l.push(n9(c,dr(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function edn(e,t,n){const r=VZe(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?r:r(e.map(i=>ob(t(i).values)))}function tdn(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;if(ln(i)&&(i=i(n,r)),ln(o)&&(o=o(n,r)),(i===1||i==null)&&!o)return;const s=(Hn(i)?i:i[0])||1,a=(Hn(i)?i:i[1])||1,l=o&&o[0]||0,c=o&&o[1]||0;e.forEach(UZe(t,s,a,l,c))}function UZe(e,t,n,r,i){const o=e.x1||0,s=e.y1||0,a=t*n<0;function l(f){f.forEach(c)}function c(f){a&&f.reverse(),f.forEach(u)}function u(f){f[0]=(f[0]-o)*t+r,f[1]=(f[1]-s)*n+i}return function(f){return f.coordinates.forEach(l),f}}function XEe(e,t,n){const r=e>=0?e:vce(t,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function gU(e){return ln(e)?e:Wa(+e)}function HZe(){var e=l=>l[0],t=l=>l[1],n=a_,r=[-1,-1],i=960,o=500,s=2;function a(l,c){const u=XEe(r[0],l,e)>>s,f=XEe(r[1],l,t)>>s,d=u?u+2:0,h=f?f+2:0,p=2*d+(i>>s),g=2*h+(o>>s),v=new Float32Array(p*g),y=new Float32Array(p*g);let O=v;l.forEach(w=>{const S=d+(+e(w)>>s),E=h+(+t(w)>>s);S>=0&&S<p&&E>=0&&E<g&&(v[S+E*p]+=+n(w))}),u>0&&f>0?(Hx(p,g,v,y,u),Xx(p,g,y,v,f),Hx(p,g,v,y,u),Xx(p,g,y,v,f),Hx(p,g,v,y,u),Xx(p,g,y,v,f)):u>0?(Hx(p,g,v,y,u),Hx(p,g,y,v,u),Hx(p,g,v,y,u),O=y):f>0&&(Xx(p,g,v,y,f),Xx(p,g,y,v,f),Xx(p,g,v,y,f),O=y);const m=c?Math.pow(2,-2*s):1/F8e(O);for(let w=0,S=p*g;w<S;++w)O[w]*=m;return{values:O,scale:1<<s,width:p,height:g,x1:d,y1:h,x2:d+(i>>s),y2:h+(o>>s)}}return a.x=function(l){return arguments.length?(e=gU(l),a):e},a.y=function(l){return arguments.length?(t=gU(l),a):t},a.weight=function(l){return arguments.length?(n=gU(l),a):n},a.size=function(l){if(!arguments.length)return[i,o];var c=+l[0],u=+l[1];return c>=0&&u>=0||Le("invalid size"),i=c,o=u,a},a.cellSize=function(l){return arguments.length?((l=+l)>=1||Le("invalid cell size"),s=Math.floor(Math.log(l)/Math.LN2),a):1<<s},a.bandwidth=function(l){return arguments.length?(l=ct(l),l.length===1&&(l=[+l[0],+l[0]]),l.length!==2&&Le("invalid bandwidth"),r=l,a):r},a}function Hx(e,t,n,r,i){const o=(i<<1)+1;for(let s=0;s<t;++s)for(let a=0,l=0;a<e+i;++a)a<e&&(l+=n[a+s*e]),a>=i&&(a>=o&&(l-=n[a-o+s*e]),r[a-i+s*e]=l/Math.min(a+1,e-1+o-a,o))}function Xx(e,t,n,r,i){const o=(i<<1)+1;for(let s=0;s<e;++s)for(let a=0,l=0;a<t+i;++a)a<t&&(l+=n[s+a*e]),a>=i&&(a>=o&&(l-=n[s+(a-o)*e]),r[s+(a-i)*e]=l/Math.min(a+1,t-1+o-a,o))}function Afe(e){De.call(this,null,e)}Afe.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const ndn=["x","y","weight","size","cellSize","bandwidth"];function XZe(e,t){return ndn.forEach(n=>t[n]!=null?e[n](t[n]):0),e}Ke(Afe,De,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=t.materialize(t.SOURCE).source,i=rdn(r,e.groupby),o=(e.groupby||[]).map(Zi),s=XZe(HZe(),e),a=e.as||"grid",l=[];function c(u,f){for(let d=0;d<o.length;++d)u[o[d]]=f[d];return u}return l=i.map(u=>dr(c({[a]:s(u,e.counts)},u.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function rdn(e,t){var n=[],r=u=>u(a),i,o,s,a,l,c;if(t==null)n.push(e);else for(i={},o=0,s=e.length;o<s;++o)a=e[o],l=t.map(r),c=i[l],c||(i[l]=c=[],c.dims=l,n.push(c)),c.push(a);return n}function Rfe(e){De.call(this,null,e)}Rfe.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]};Ke(Rfe,De,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=qZe().smooth(e.smooth!==!1),i=e.values,o=e.thresholds||VZe(e.count||10,e.nice,!!i),s=e.size,a,l;return i||(i=t.materialize(t.SOURCE).source,a=XZe(HZe(),e)(i,!0),l=UZe(a,a.scale||1,a.scale||1,0,0),s=[a.width,a.height],i=a.values),o=ze(o)?o:o(i),i=r.size(s)(i,o),l&&i.forEach(l),this.value&&(n.rem=this.value),this.value=n.source=n.add=(i||[]).map(dr),n}});const wJ="Feature",Dfe="FeatureCollection",idn="MultiPoint";function Mfe(e){De.call(this,null,e)}Mfe.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};Ke(Mfe,De,{transform(e,t){var n=this._features,r=this._points,i=e.fields,o=i&&i[0],s=i&&i[1],a=e.geojson||!i&&Ba,l=t.ADD,c;c=e.modified()||t.changed(t.REM)||t.modified(Ma(a))||o&&t.modified(Ma(o))||s&&t.modified(Ma(s)),(!this.value||c)&&(l=t.SOURCE,this._features=n=[],this._points=r=[]),a&&t.visit(l,u=>n.push(a(u))),o&&s&&(t.visit(l,u=>{var f=o(u),d=s(u);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&r.push([f,d])}),n=n.concat({type:wJ,geometry:{type:idn,coordinates:r}})),this.value={type:Dfe,features:n}}});function Nfe(e){De.call(this,null,e)}Nfe.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};Ke(Nfe,De,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||Ba,o=e.as||"path",s=n.SOURCE;!r||e.modified()?(this.value=r=WZe(e.projection),n.materialize().reflow()):s=i===Ba||t.modified(i.fields)?n.ADD_MOD:n.ADD;const a=odn(r,e.pointRadius);return n.visit(s,l=>l[o]=r(i(l))),r.pointRadius(a),n.modifies(o)}});function odn(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function Ife(e){De.call(this,null,e)}Ife.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};Ke(Ife,De,{transform(e,t){var n=e.projection,r=e.fields[0],i=e.fields[1],o=e.as||["x","y"],s=o[0],a=o[1],l;function c(u){const f=n([r(u),i(u)]);f?(u[s]=f[0],u[a]=f[1]):(u[s]=void 0,u[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,c):(l=t.modified(r.fields)||t.modified(i.fields),t.visit(l?t.ADD_MOD:t.ADD,c)),t.modifies(o)}});function Lfe(e){De.call(this,null,e)}Lfe.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};Ke(Lfe,De,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.as||"shape",o=n.ADD;return(!r||e.modified())&&(this.value=r=sdn(WZe(e.projection),e.field||hf("datum"),e.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,s=>s[i]=r),n.modifies(i)}});function sdn(e,t,n){const r=n==null?i=>e(t(i)):i=>{var o=e.pointRadius(),s=e.pointRadius(n)(t(i));return e.pointRadius(o),s};return r.context=i=>(e.context(i),r),r}function jfe(e){De.call(this,[],e),this.generator=efn()}jfe.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};Ke(jfe,De,{transform(e,t){var n=this.value,r=this.generator,i;if(!n.length||e.modified())for(const o in e)ln(r[o])&&r[o](e[o]);return i=r(),n.length?t.mod.push(iVe(n[0],i)):t.add.push(dr(i)),n[0]=i,t}});function Ffe(e){De.call(this,null,e)}Ffe.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};Ke(Ffe,De,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r=e.resolve==="shared",i=e.field||Ba,o=ldn(e.opacity,e),s=adn(e.color,e),a=e.as||"image",l={$x:0,$y:0,$value:0,$max:r?ob(n.map(c=>ob(i(c).values))):0};return n.forEach(c=>{const u=i(c),f=an({},c,l);r||(f.$max=ob(u.values||[])),c[a]=cdn(u,f,s.dep?s:Wa(s(f)),o.dep?o:Wa(o(f)))}),t.reflow(!0).modifies(a)}});function adn(e,t){let n;return ln(e)?(n=r=>V0(e(r,t)),n.dep=ZZe(e)):n=Wa(V0(e||"#888")),n}function ldn(e,t){let n;return ln(e)?(n=r=>e(r,t),n.dep=ZZe(e)):e?n=Wa(e):(n=r=>r.$value/r.$max||0,n.dep=!0),n}function ZZe(e){if(!ln(e))return!1;const t=kd(Ma(e));return t.$x||t.$y||t.$value||t.$max}function cdn(e,t,n,r){const i=e.width,o=e.height,s=e.x1||0,a=e.y1||0,l=e.x2||i,c=e.y2||o,u=e.values,f=u?v=>u[v]:my,d=l0(l-s,c-a),h=d.getContext("2d"),p=h.getImageData(0,0,l-s,c-a),g=p.data;for(let v=a,y=0;v<c;++v){t.$y=v-a;for(let O=s,m=v*i;O<l;++O,y+=4){t.$x=O-s,t.$value=f(O+m);const w=n(t);g[y+0]=w.r,g[y+1]=w.g,g[y+2]=w.b,g[y+3]=~~(255*r(t))}}return h.putImageData(p,0,0),d}function YZe(e){De.call(this,null,e),this.modified(!0)}Ke(YZe,De,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=fdn(e.type),xJ.forEach(r=>{e[r]!=null&&ZEe(n,r,e[r])})):xJ.forEach(r=>{e.modified(r)&&ZEe(n,r,e[r])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&udn(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function udn(e,t){const n=ddn(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function fdn(e){const t=Tfe((e||"mercator").toLowerCase());return t||Le("Unrecognized projection type: "+e),t()}function ZEe(e,t,n){ln(e[t])&&e[t](n)}function ddn(e){return e=ct(e),e.length===1?e[0]:{type:Dfe,features:e.reduce((t,n)=>t.concat(hdn(n)),[])}}function hdn(e){return e.type===Dfe?e.features:ct(e).filter(t=>t!=null).map(t=>t.type===wJ?t:{type:wJ,geometry:t})}const pdn=Object.freeze(Object.defineProperty({__proto__:null,contour:Rfe,geojson:Mfe,geopath:Nfe,geopoint:Ife,geoshape:Lfe,graticule:jfe,heatmap:Ffe,isocontour:Pfe,kde2d:Afe,projection:YZe},Symbol.toStringTag,{value:"Module"}));function gdn(e,t){var n,r=1;e==null&&(e=0),t==null&&(t=0);function i(){var o,s=n.length,a,l=0,c=0;for(o=0;o<s;++o)a=n[o],l+=a.x,c+=a.y;for(l=(l/s-e)*r,c=(c/s-t)*r,o=0;o<s;++o)a=n[o],a.x-=l,a.y-=c}return i.initialize=function(o){n=o},i.x=function(o){return arguments.length?(e=+o,i):e},i.y=function(o){return arguments.length?(t=+o,i):t},i.strength=function(o){return arguments.length?(r=+o,i):r},i}function mdn(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return GZe(this.cover(t,n),t,n,e)}function GZe(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o=e._root,s={data:r},a=e._x0,l=e._y0,c=e._x1,u=e._y1,f,d,h,p,g,v,y,O;if(!o)return e._root=s,e;for(;o.length;)if((g=t>=(f=(a+c)/2))?a=f:c=f,(v=n>=(d=(l+u)/2))?l=d:u=d,i=o,!(o=o[y=v<<1|g]))return i[y]=s,e;if(h=+e._x.call(null,o.data),p=+e._y.call(null,o.data),t===h&&n===p)return s.next=o,i?i[y]=s:e._root=s,e;do i=i?i[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+c)/2))?a=f:c=f,(v=n>=(d=(l+u)/2))?l=d:u=d;while((y=v<<1|g)===(O=(p>=d)<<1|h>=f));return i[O]=o,i[y]=s,e}function ydn(e){var t,n,r=e.length,i,o,s=new Array(r),a=new Array(r),l=1/0,c=1/0,u=-1/0,f=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(s[n]=i,a[n]=o,i<l&&(l=i),i>u&&(u=i),o<c&&(c=o),o>f&&(f=o));if(l>u||c>f)return this;for(this.cover(l,c).cover(u,f),n=0;n<r;++n)GZe(this,s[n],a[n],e[n]);return this}function vdn(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,o=(r=Math.floor(t))+1;else{for(var s=i-n||1,a=this._root,l,c;n>e||e>=i||r>t||t>=o;)switch(c=(t<r)<<1|e<n,l=new Array(4),l[c]=a,a=l,s*=2,c){case 0:i=n+s,o=r+s;break;case 1:n=i-s,o=r+s;break;case 2:i=n+s,r=o-s;break;case 3:n=i-s,r=o-s;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this}function bdn(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function Odn(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function cl(e,t,n,r,i){this.node=e,this.x0=t,this.y0=n,this.x1=r,this.y1=i}function xdn(e,t,n){var r,i=this._x0,o=this._y0,s,a,l,c,u=this._x1,f=this._y1,d=[],h=this._root,p,g;for(h&&d.push(new cl(h,i,o,u,f)),n==null?n=1/0:(i=e-n,o=t-n,u=e+n,f=t+n,n*=n);p=d.pop();)if(!(!(h=p.node)||(s=p.x0)>u||(a=p.y0)>f||(l=p.x1)<i||(c=p.y1)<o))if(h.length){var v=(s+l)/2,y=(a+c)/2;d.push(new cl(h[3],v,y,l,c),new cl(h[2],s,y,v,c),new cl(h[1],v,a,l,y),new cl(h[0],s,a,v,y)),(g=(t>=y)<<1|e>=v)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var O=e-+this._x.call(null,h.data),m=t-+this._y.call(null,h.data),w=O*O+m*m;if(w<n){var S=Math.sqrt(n=w);i=e-S,o=t-S,u=e+S,f=t+S,r=h.data}}return r}function wdn(e){if(isNaN(u=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,r,i,o,s=this._x0,a=this._y0,l=this._x1,c=this._y1,u,f,d,h,p,g,v,y;if(!n)return this;if(n.length)for(;;){if((p=u>=(d=(s+l)/2))?s=d:l=d,(g=f>=(h=(a+c)/2))?a=h:c=h,t=n,!(n=n[v=g<<1|p]))return this;if(!n.length)break;(t[v+1&3]||t[v+2&3]||t[v+3&3])&&(r=t,y=v)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(o=n.next)&&delete n.next,i?(o?i.next=o:delete i.next,this):t?(o?t[v]=o:delete t[v],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(r?r[y]=n:this._root=n),this):(this._root=o,this)}function Sdn(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function Edn(){return this._root}function Cdn(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function _dn(e){var t=[],n,r=this._root,i,o,s,a,l;for(r&&t.push(new cl(r,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(r=n.node,o=n.x0,s=n.y0,a=n.x1,l=n.y1)&&r.length){var c=(o+a)/2,u=(s+l)/2;(i=r[3])&&t.push(new cl(i,c,u,a,l)),(i=r[2])&&t.push(new cl(i,o,u,c,l)),(i=r[1])&&t.push(new cl(i,c,s,a,u)),(i=r[0])&&t.push(new cl(i,o,s,c,u))}return this}function kdn(e){var t=[],n=[],r;for(this._root&&t.push(new cl(this._root,this._x0,this._y0,this._x1,this._y1));r=t.pop();){var i=r.node;if(i.length){var o,s=r.x0,a=r.y0,l=r.x1,c=r.y1,u=(s+l)/2,f=(a+c)/2;(o=i[0])&&t.push(new cl(o,s,a,u,f)),(o=i[1])&&t.push(new cl(o,u,a,l,f)),(o=i[2])&&t.push(new cl(o,s,f,u,c)),(o=i[3])&&t.push(new cl(o,u,f,l,c))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function $dn(e){return e[0]}function Tdn(e){return arguments.length?(this._x=e,this):this._x}function Pdn(e){return e[1]}function Adn(e){return arguments.length?(this._y=e,this):this._y}function zfe(e,t,n){var r=new Qfe(t??$dn,n??Pdn,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function Qfe(e,t,n,r,i,o){this._x=e,this._y=t,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function YEe(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var Tl=zfe.prototype=Qfe.prototype;Tl.copy=function(){var e=new Qfe(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,r;if(!t)return e;if(!t.length)return e._root=YEe(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var i=0;i<4;++i)(r=t.source[i])&&(r.length?n.push({source:r,target:t.target[i]=new Array(4)}):t.target[i]=YEe(r));return e};Tl.add=mdn;Tl.addAll=ydn;Tl.cover=vdn;Tl.data=bdn;Tl.extent=Odn;Tl.find=xdn;Tl.remove=wdn;Tl.removeAll=Sdn;Tl.root=Edn;Tl.size=Cdn;Tl.visit=_dn;Tl.visitAfter=kdn;Tl.x=Tdn;Tl.y=Adn;function ul(e){return function(){return e}}function jy(e){return(e()-.5)*1e-6}function Rdn(e){return e.x+e.vx}function Ddn(e){return e.y+e.vy}function Mdn(e){var t,n,r,i=1,o=1;typeof e!="function"&&(e=ul(e==null?1:+e));function s(){for(var c,u=t.length,f,d,h,p,g,v,y=0;y<o;++y)for(f=zfe(t,Rdn,Ddn).visitAfter(a),c=0;c<u;++c)d=t[c],g=n[d.index],v=g*g,h=d.x+d.vx,p=d.y+d.vy,f.visit(O);function O(m,w,S,E,C){var k=m.data,P=m.r,D=g+P;if(k){if(k.index>d.index){var M=h-k.x-k.vx,L=p-k.y-k.vy,A=M*M+L*L;A<D*D&&(M===0&&(M=jy(r),A+=M*M),L===0&&(L=jy(r),A+=L*L),A=(D-(A=Math.sqrt(A)))/A*i,d.vx+=(M*=A)*(D=(P*=P)/(v+P)),d.vy+=(L*=A)*D,k.vx-=M*(D=1-D),k.vy-=L*D)}return}return w>h+D||E<h-D||S>p+D||C<p-D}}function a(c){if(c.data)return c.r=n[c.data.index];for(var u=c.r=0;u<4;++u)c[u]&&c[u].r>c.r&&(c.r=c[u].r)}function l(){if(t){var c,u=t.length,f;for(n=new Array(u),c=0;c<u;++c)f=t[c],n[f.index]=+e(f,c,t)}}return s.initialize=function(c,u){t=c,r=u,l()},s.iterations=function(c){return arguments.length?(o=+c,s):o},s.strength=function(c){return arguments.length?(i=+c,s):i},s.radius=function(c){return arguments.length?(e=typeof c=="function"?c:ul(+c),l(),s):e},s}function Ndn(e){return e.index}function GEe(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function Idn(e){var t=Ndn,n=f,r,i=ul(30),o,s,a,l,c,u=1;e==null&&(e=[]);function f(v){return 1/Math.min(a[v.source.index],a[v.target.index])}function d(v){for(var y=0,O=e.length;y<u;++y)for(var m=0,w,S,E,C,k,P,D;m<O;++m)w=e[m],S=w.source,E=w.target,C=E.x+E.vx-S.x-S.vx||jy(c),k=E.y+E.vy-S.y-S.vy||jy(c),P=Math.sqrt(C*C+k*k),P=(P-o[m])/P*v*r[m],C*=P,k*=P,E.vx-=C*(D=l[m]),E.vy-=k*D,S.vx+=C*(D=1-D),S.vy+=k*D}function h(){if(s){var v,y=s.length,O=e.length,m=new Map(s.map((S,E)=>[t(S,E,s),S])),w;for(v=0,a=new Array(y);v<O;++v)w=e[v],w.index=v,typeof w.source!="object"&&(w.source=GEe(m,w.source)),typeof w.target!="object"&&(w.target=GEe(m,w.target)),a[w.source.index]=(a[w.source.index]||0)+1,a[w.target.index]=(a[w.target.index]||0)+1;for(v=0,l=new Array(O);v<O;++v)w=e[v],l[v]=a[w.source.index]/(a[w.source.index]+a[w.target.index]);r=new Array(O),p(),o=new Array(O),g()}}function p(){if(s)for(var v=0,y=e.length;v<y;++v)r[v]=+n(e[v],v,e)}function g(){if(s)for(var v=0,y=e.length;v<y;++v)o[v]=+i(e[v],v,e)}return d.initialize=function(v,y){s=v,c=y,h()},d.links=function(v){return arguments.length?(e=v,h(),d):e},d.id=function(v){return arguments.length?(t=v,d):t},d.iterations=function(v){return arguments.length?(u=+v,d):u},d.strength=function(v){return arguments.length?(n=typeof v=="function"?v:ul(+v),p(),d):n},d.distance=function(v){return arguments.length?(i=typeof v=="function"?v:ul(+v),g(),d):i},d}var Ldn={value:()=>{}};function MD(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new hL(n)}function hL(e){this._=e}function jdn(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}hL.prototype=MD.prototype={constructor:hL,on:function(e,t){var n=this._,r=jdn(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=Fdn(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=KEe(n[i],e.name,t);else if(t==null)for(i in n)n[i]=KEe(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new hL(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function Fdn(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function KEe(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Ldn,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var HE=0,q$=0,Fk=0,KZe=1e3,g4,V$,m4=0,vO=0,Q9=0,cA=typeof performance=="object"&&performance.now?performance:Date,JZe=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function B9(){return vO||(JZe(zdn),vO=cA.now()+Q9)}function zdn(){vO=0}function uA(){this._call=this._time=this._next=null}uA.prototype=Bfe.prototype={constructor:uA,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?B9():+n)+(t==null?0:+t),!this._next&&V$!==this&&(V$?V$._next=this:g4=this,V$=this),this._call=e,this._time=n,SJ()},stop:function(){this._call&&(this._call=null,this._time=1/0,SJ())}};function Bfe(e,t,n){var r=new uA;return r.restart(e,t,n),r}function Qdn(){B9(),++HE;for(var e=g4,t;e;)(t=vO-e._time)>=0&&e._call.call(void 0,t),e=e._next;--HE}function JEe(){vO=(m4=cA.now())+Q9,HE=q$=0;try{Qdn()}finally{HE=0,Wdn(),vO=0}}function Bdn(){var e=cA.now(),t=e-m4;t>KZe&&(Q9-=t,m4=e)}function Wdn(){for(var e,t=g4,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:g4=n);V$=e,SJ(r)}function SJ(e){if(!HE){q$&&(q$=clearTimeout(q$));var t=e-vO;t>24?(e<1/0&&(q$=setTimeout(JEe,e-cA.now()-Q9)),Fk&&(Fk=clearInterval(Fk))):(Fk||(m4=cA.now(),Fk=setInterval(Bdn,KZe)),HE=1,JZe(JEe))}}function eCe(e,t,n){var r=new uA;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}function qdn(e,t,n){var r=new uA,i=t;return t==null?(r.restart(e,t,n),r):(r._restart=r.restart,r.restart=function(o,s,a){s=+s,a=a==null?B9():+a,r._restart(function l(c){c+=i,r._restart(l,i+=s,a),o(c)},s,a)},r.restart(e,t,n),r)}const Vdn=1664525,Udn=1013904223,tCe=4294967296;function Hdn(){let e=1;return()=>(e=(Vdn*e+Udn)%tCe)/tCe}function Xdn(e){return e.x}function Zdn(e){return e.y}var Ydn=10,Gdn=Math.PI*(3-Math.sqrt(5));function Kdn(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,s=.6,a=new Map,l=Bfe(f),c=MD("tick","end"),u=Hdn();e==null&&(e=[]);function f(){d(),c.call("tick",t),n<r&&(l.stop(),c.call("end",t))}function d(g){var v,y=e.length,O;g===void 0&&(g=1);for(var m=0;m<g;++m)for(n+=(o-n)*i,a.forEach(function(w){w(n)}),v=0;v<y;++v)O=e[v],O.fx==null?O.x+=O.vx*=s:(O.x=O.fx,O.vx=0),O.fy==null?O.y+=O.vy*=s:(O.y=O.fy,O.vy=0);return t}function h(){for(var g=0,v=e.length,y;g<v;++g){if(y=e[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var O=Ydn*Math.sqrt(.5+g),m=g*Gdn;y.x=O*Math.cos(m),y.y=O*Math.sin(m)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function p(g){return g.initialize&&g.initialize(e,u),g}return h(),t={tick:d,restart:function(){return l.restart(f),t},stop:function(){return l.stop(),t},nodes:function(g){return arguments.length?(e=g,h(),a.forEach(p),t):e},alpha:function(g){return arguments.length?(n=+g,t):n},alphaMin:function(g){return arguments.length?(r=+g,t):r},alphaDecay:function(g){return arguments.length?(i=+g,t):+i},alphaTarget:function(g){return arguments.length?(o=+g,t):o},velocityDecay:function(g){return arguments.length?(s=1-g,t):1-s},randomSource:function(g){return arguments.length?(u=g,a.forEach(p),t):u},force:function(g,v){return arguments.length>1?(v==null?a.delete(g):a.set(g,p(v)),t):a.get(g)},find:function(g,v,y){var O=0,m=e.length,w,S,E,C,k;for(y==null?y=1/0:y*=y,O=0;O<m;++O)C=e[O],w=g-C.x,S=v-C.y,E=w*w+S*S,E<y&&(k=C,y=E);return k},on:function(g,v){return arguments.length>1?(c.on(g,v),t):c.on(g)}}}function Jdn(){var e,t,n,r,i=ul(-30),o,s=1,a=1/0,l=.81;function c(h){var p,g=e.length,v=zfe(e,Xdn,Zdn).visitAfter(f);for(r=h,p=0;p<g;++p)t=e[p],v.visit(d)}function u(){if(e){var h,p=e.length,g;for(o=new Array(p),h=0;h<p;++h)g=e[h],o[g.index]=+i(g,h,e)}}function f(h){var p=0,g,v,y=0,O,m,w;if(h.length){for(O=m=w=0;w<4;++w)(g=h[w])&&(v=Math.abs(g.value))&&(p+=g.value,y+=v,O+=v*g.x,m+=v*g.y);h.x=O/y,h.y=m/y}else{g=h,g.x=g.data.x,g.y=g.data.y;do p+=o[g.data.index];while(g=g.next)}h.value=p}function d(h,p,g,v){if(!h.value)return!0;var y=h.x-t.x,O=h.y-t.y,m=v-p,w=y*y+O*O;if(m*m/l<w)return w<a&&(y===0&&(y=jy(n),w+=y*y),O===0&&(O=jy(n),w+=O*O),w<s&&(w=Math.sqrt(s*w)),t.vx+=y*h.value*r/w,t.vy+=O*h.value*r/w),!0;if(h.length||w>=a)return;(h.data!==t||h.next)&&(y===0&&(y=jy(n),w+=y*y),O===0&&(O=jy(n),w+=O*O),w<s&&(w=Math.sqrt(s*w)));do h.data!==t&&(m=o[h.data.index]*r/w,t.vx+=y*m,t.vy+=O*m);while(h=h.next)}return c.initialize=function(h,p){e=h,n=p,u()},c.strength=function(h){return arguments.length?(i=typeof h=="function"?h:ul(+h),u(),c):i},c.distanceMin=function(h){return arguments.length?(s=h*h,c):Math.sqrt(s)},c.distanceMax=function(h){return arguments.length?(a=h*h,c):Math.sqrt(a)},c.theta=function(h){return arguments.length?(l=h*h,c):Math.sqrt(l)},c}function ehn(e){var t=ul(.1),n,r,i;typeof e!="function"&&(e=ul(e==null?0:+e));function o(a){for(var l=0,c=n.length,u;l<c;++l)u=n[l],u.vx+=(i[l]-u.x)*r[l]*a}function s(){if(n){var a,l=n.length;for(r=new Array(l),i=new Array(l),a=0;a<l;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:ul(+a),s(),o):t},o.x=function(a){return arguments.length?(e=typeof a=="function"?a:ul(+a),s(),o):e},o}function thn(e){var t=ul(.1),n,r,i;typeof e!="function"&&(e=ul(e==null?0:+e));function o(a){for(var l=0,c=n.length,u;l<c;++l)u=n[l],u.vy+=(i[l]-u.y)*r[l]*a}function s(){if(n){var a,l=n.length;for(r=new Array(l),i=new Array(l),a=0;a<l;++a)r[a]=isNaN(i[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return o.initialize=function(a){n=a,s()},o.strength=function(a){return arguments.length?(t=typeof a=="function"?a:ul(+a),s(),o):t},o.y=function(a){return arguments.length?(e=typeof a=="function"?a:ul(+a),s(),o):e},o}const nCe={center:gdn,collide:Mdn,nbody:Jdn,link:Idn,x:ehn,y:thn},U$="forces",EJ=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],nhn=["static","iterations"],eYe=["x","y","vx","vy"];function Wfe(e){De.call(this,null,e)}Wfe.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:eYe}]};Ke(Wfe,De,{transform(e,t){var n=this.value,r=t.changed(t.ADD_REM),i=e.modified(EJ),o=e.iterations||300;if(n?(r&&(t.modifies("index"),n.nodes(t.source)),(i||t.changed(t.MOD))&&tYe(n,e,0,t)):(this.value=n=ihn(t.source,e),n.on("tick",rhn(t.dataflow,this)),e.static||(r=!0,n.tick()),t.modifies("index")),i||r||e.modified(nhn)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/o)),e.static)for(n.stop();--o>=0;)n.tick();else if(n.stopped()&&n.restart(),!r)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,l=0,c=a.length,u;l<c;++l)if(u=a[l],!(u.name!==U$||u.op._argval.force!=="link")){for(var r=u.op._argops,i=0,o=r.length,s;i<o;++i)if(r[i].name==="links"&&(s=r[i].op.source)){n.pulse(s,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(eYe)}});function rhn(e,t){return()=>e.touch(t).run()}function ihn(e,t){const n=Kdn(e),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),tYe(n,t,!0).on("end",()=>o=!0)}function tYe(e,t,n,r){var i=ct(t.forces),o,s,a,l;for(o=0,s=EJ.length;o<s;++o)a=EJ[o],a!==U$&&t.modified(a)&&e[a](t[a]);for(o=0,s=i.length;o<s;++o)l=U$+o,a=n||t.modified(U$,o)?shn(i[o]):r&&ohn(i[o],r)?e.force(l):null,a&&e.force(l,a);for(s=e.numForces||0;o<s;++o)e.force(U$+o,null);return e.numForces=i.length,e}function ohn(e,t){var n,r;for(n in e)if(ln(r=e[n])&&t.modified(Ma(r)))return 1;return 0}function shn(e){var t,n;Nt(nCe,e.force)||Le("Unrecognized force: "+e.force),t=nCe[e.force]();for(n in e)ln(t[n])&&ahn(t[n],e[n],e);return t}function ahn(e,t,n){e(ln(t)?r=>t(r,n):t)}const lhn=Object.freeze(Object.defineProperty({__proto__:null,force:Wfe},Symbol.toStringTag,{value:"Module"}));function chn(e,t){return e.parent===t.parent?1:2}function uhn(e){return e.reduce(fhn,0)/e.length}function fhn(e,t){return e+t.x}function dhn(e){return 1+e.reduce(hhn,0)}function hhn(e,t){return Math.max(e,t.y)}function phn(e){for(var t;t=e.children;)e=t[0];return e}function ghn(e){for(var t;t=e.children;)e=t[t.length-1];return e}function mhn(){var e=chn,t=1,n=1,r=!1;function i(o){var s,a=0;o.eachAfter(function(d){var h=d.children;h?(d.x=uhn(h),d.y=dhn(h)):(d.x=s?a+=e(d,s):0,d.y=0,s=d)});var l=phn(o),c=ghn(o),u=l.x-e(l,c)/2,f=c.x+e(c,l)/2;return o.eachAfter(r?function(d){d.x=(d.x-o.x)*t,d.y=(o.y-d.y)*n}:function(d){d.x=(d.x-u)/(f-u)*t,d.y=(1-(o.y?d.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(r=!1,t=+o[0],n=+o[1],i):r?null:[t,n]},i.nodeSize=function(o){return arguments.length?(r=!0,t=+o[0],n=+o[1],i):r?[t,n]:null},i}function yhn(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function vhn(){return this.eachAfter(yhn)}function bhn(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function Ohn(e,t){for(var n=this,r=[n],i,o,s=-1;n=r.pop();)if(e.call(t,n,++s,this),i=n.children)for(o=i.length-1;o>=0;--o)r.push(i[o]);return this}function xhn(e,t){for(var n=this,r=[n],i=[],o,s,a,l=-1;n=r.pop();)if(i.push(n),o=n.children)for(s=0,a=o.length;s<a;++s)r.push(o[s]);for(;n=i.pop();)e.call(t,n,++l,this);return this}function whn(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Shn(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function Ehn(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Chn(e){for(var t=this,n=_hn(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function _hn(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function khn(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function $hn(){return Array.from(this)}function Thn(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Phn(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Ahn(){var e=this,t,n=[e],r,i,o;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,o=r.length;i<o;++i)n.push(r[i]);while(n.length)}function qfe(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Mhn)):t===void 0&&(t=Dhn);for(var n=new XE(e),r,i=[n],o,s,a,l;r=i.pop();)if((s=t(r.data))&&(l=(s=Array.from(s)).length))for(r.children=s,a=l-1;a>=0;--a)i.push(o=s[a]=new XE(s[a])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(nYe)}function Rhn(){return qfe(this).eachBefore(Nhn)}function Dhn(e){return e.children}function Mhn(e){return Array.isArray(e)?e[1]:null}function Nhn(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function nYe(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function XE(e){this.data=e,this.depth=this.height=0,this.parent=null}XE.prototype=qfe.prototype={constructor:XE,count:vhn,each:bhn,eachAfter:xhn,eachBefore:Ohn,find:whn,sum:Shn,sort:Ehn,path:Chn,ancestors:khn,descendants:$hn,leaves:Thn,links:Phn,copy:Rhn,[Symbol.iterator]:Ahn};function pL(e){return e==null?null:rYe(e)}function rYe(e){if(typeof e!="function")throw new Error;return e}function P1(){return 0}function Ew(e){return function(){return e}}const Ihn=1664525,Lhn=1013904223,rCe=4294967296;function jhn(){let e=1;return()=>(e=(Ihn*e+Lhn)%rCe)/rCe}function Fhn(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function zhn(e,t){let n=e.length,r,i;for(;n;)i=t()*n--|0,r=e[n],e[n]=e[i],e[i]=r;return e}function Qhn(e,t){for(var n=0,r=(e=zhn(Array.from(e),t)).length,i=[],o,s;n<r;)o=e[n],s&&iYe(s,o)?++n:(s=Whn(i=Bhn(i,o)),n=0);return s}function Bhn(e,t){var n,r;if(mU(t,e))return[t];for(n=0;n<e.length;++n)if(lI(t,e[n])&&mU(H$(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(lI(H$(e[n],e[r]),t)&&lI(H$(e[n],t),e[r])&&lI(H$(e[r],t),e[n])&&mU(oYe(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function lI(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function iYe(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function mU(e,t){for(var n=0;n<t.length;++n)if(!iYe(e,t[n]))return!1;return!0}function Whn(e){switch(e.length){case 1:return qhn(e[0]);case 2:return H$(e[0],e[1]);case 3:return oYe(e[0],e[1],e[2])}}function qhn(e){return{x:e.x,y:e.y,r:e.r}}function H$(e,t){var n=e.x,r=e.y,i=e.r,o=t.x,s=t.y,a=t.r,l=o-n,c=s-r,u=a-i,f=Math.sqrt(l*l+c*c);return{x:(n+o+l/f*u)/2,y:(r+s+c/f*u)/2,r:(f+i+a)/2}}function oYe(e,t,n){var r=e.x,i=e.y,o=e.r,s=t.x,a=t.y,l=t.r,c=n.x,u=n.y,f=n.r,d=r-s,h=r-c,p=i-a,g=i-u,v=l-o,y=f-o,O=r*r+i*i-o*o,m=O-s*s-a*a+l*l,w=O-c*c-u*u+f*f,S=h*p-d*g,E=(p*w-g*m)/(S*2)-r,C=(g*v-p*y)/S,k=(h*m-d*w)/(S*2)-i,P=(d*y-h*v)/S,D=C*C+P*P-1,M=2*(o+E*C+k*P),L=E*E+k*k-o*o,A=-(Math.abs(D)>1e-6?(M+Math.sqrt(M*M-4*D*L))/(2*D):L/M);return{x:r+E+C*A,y:i+k+P*A,r:A}}function iCe(e,t,n){var r=e.x-t.x,i,o,s=e.y-t.y,a,l,c=r*r+s*s;c?(o=t.r+n.r,o*=o,l=e.r+n.r,l*=l,o>l?(i=(c+l-o)/(2*c),a=Math.sqrt(Math.max(0,l/c-i*i)),n.x=e.x-i*r-a*s,n.y=e.y-i*s+a*r):(i=(c+o-l)/(2*c),a=Math.sqrt(Math.max(0,o/c-i*i)),n.x=t.x+i*r-a*s,n.y=t.y+i*s+a*r)):(n.x=t.x+n.r,n.y=t.y)}function oCe(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function sCe(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,o=(t.y*n.r+n.y*t.r)/r;return i*i+o*o}function cI(e){this._=e,this.next=null,this.previous=null}function Vhn(e,t){if(!(o=(e=Fhn(e)).length))return 0;var n,r,i,o,s,a,l,c,u,f,d;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;iCe(r,n,i=e[2]),n=new cI(n),r=new cI(r),i=new cI(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(l=3;l<o;++l){iCe(n._,r._,i=e[l]),i=new cI(i),c=r.next,u=n.previous,f=r._.r,d=n._.r;do if(f<=d){if(oCe(c._,i._)){r=c,n.next=r,r.previous=n,--l;continue e}f+=c._.r,c=c.next}else{if(oCe(u._,i._)){n=u,n.next=r,r.previous=n,--l;continue e}d+=u._.r,u=u.previous}while(c!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,s=sCe(n);(i=i.next)!==r;)(a=sCe(i))<s&&(n=i,s=a);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=Qhn(n,t),l=0;l<o;++l)n=e[l],n.x-=i.x,n.y-=i.y;return i.r}function Uhn(e){return Math.sqrt(e.value)}function Hhn(){var e=null,t=1,n=1,r=P1;function i(o){const s=jhn();return o.x=t/2,o.y=n/2,e?o.eachBefore(aCe(e)).eachAfter(yU(r,.5,s)).eachBefore(lCe(1)):o.eachBefore(aCe(Uhn)).eachAfter(yU(P1,1,s)).eachAfter(yU(r,o.r/Math.min(t,n),s)).eachBefore(lCe(Math.min(t,n)/(2*o.r))),o}return i.radius=function(o){return arguments.length?(e=pL(o),i):e},i.size=function(o){return arguments.length?(t=+o[0],n=+o[1],i):[t,n]},i.padding=function(o){return arguments.length?(r=typeof o=="function"?o:Ew(+o),i):r},i}function aCe(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function yU(e,t,n){return function(r){if(i=r.children){var i,o,s=i.length,a=e(r)*t||0,l;if(a)for(o=0;o<s;++o)i[o].r+=a;if(l=Vhn(i,n),a)for(o=0;o<s;++o)i[o].r-=a;r.r=l+a}}}function lCe(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function sYe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ND(e,t,n,r,i){for(var o=e.children,s,a=-1,l=o.length,c=e.value&&(r-t)/e.value;++a<l;)s=o[a],s.y0=n,s.y1=i,s.x0=t,s.x1=t+=s.value*c}function Xhn(){var e=1,t=1,n=0,r=!1;function i(s){var a=s.height+1;return s.x0=s.y0=n,s.x1=e,s.y1=t/a,s.eachBefore(o(t,a)),r&&s.eachBefore(sYe),s}function o(s,a){return function(l){l.children&&ND(l,l.x0,s*(l.depth+1)/a,l.x1,s*(l.depth+2)/a);var c=l.x0,u=l.y0,f=l.x1-n,d=l.y1-n;f<c&&(c=f=(c+f)/2),d<u&&(u=d=(u+d)/2),l.x0=c,l.y0=u,l.x1=f,l.y1=d}}return i.round=function(s){return arguments.length?(r=!!s,i):r},i.size=function(s){return arguments.length?(e=+s[0],t=+s[1],i):[e,t]},i.padding=function(s){return arguments.length?(n=+s,i):n},i}var Zhn={depth:-1},cCe={},vU={};function Yhn(e){return e.id}function Ghn(e){return e.parentId}function uCe(){var e=Yhn,t=Ghn,n;function r(i){var o=Array.from(i),s=e,a=t,l,c,u,f,d,h,p,g,v=new Map;if(n!=null){const y=o.map((w,S)=>Khn(n(w,S,i))),O=y.map(fCe),m=new Set(y).add("");for(const w of O)m.has(w)||(m.add(w),y.push(w),O.push(fCe(w)),o.push(vU));s=(w,S)=>y[S],a=(w,S)=>O[S]}for(u=0,l=o.length;u<l;++u)c=o[u],h=o[u]=new XE(c),(p=s(c,u,i))!=null&&(p+="")&&(g=h.id=p,v.set(g,v.has(g)?cCe:h)),(p=a(c,u,i))!=null&&(p+="")&&(h.parent=p);for(u=0;u<l;++u)if(h=o[u],p=h.parent){if(d=v.get(p),!d)throw new Error("missing: "+p);if(d===cCe)throw new Error("ambiguous: "+p);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===vU&&f.children.length===1;)f=f.children[0],--l;for(let y=o.length-1;y>=0&&(h=o[y],h.data===vU);--y)h.data=null}if(f.parent=Zhn,f.eachBefore(function(y){y.depth=y.parent.depth+1,--l}).eachBefore(nYe),f.parent=null,l>0)throw new Error("cycle");return f}return r.id=function(i){return arguments.length?(e=pL(i),r):e},r.parentId=function(i){return arguments.length?(t=pL(i),r):t},r.path=function(i){return arguments.length?(n=pL(i),r):n},r}function Khn(e){e=`${e}`;let t=e.length;return CJ(e,t-1)&&!CJ(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function fCe(e){let t=e.length;if(t<2)return"";for(;--t>1&&!CJ(e,t););return e.slice(0,t)}function CJ(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function Jhn(e,t){return e.parent===t.parent?1:2}function bU(e){var t=e.children;return t?t[0]:e.t}function OU(e){var t=e.children;return t?t[t.length-1]:e.t}function epn(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function tpn(e){for(var t=0,n=0,r=e.children,i=r.length,o;--i>=0;)o=r[i],o.z+=t,o.m+=t,t+=o.s+(n+=o.c)}function npn(e,t,n){return e.a.parent===t.parent?e.a:n}function gL(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}gL.prototype=Object.create(XE.prototype);function rpn(e){for(var t=new gL(e,0),n,r=[t],i,o,s,a;n=r.pop();)if(o=n._.children)for(n.children=new Array(a=o.length),s=a-1;s>=0;--s)r.push(i=n.children[s]=new gL(o[s],s)),i.parent=n;return(t.parent=new gL(null,0)).children=[t],t}function ipn(){var e=Jhn,t=1,n=1,r=null;function i(c){var u=rpn(c);if(u.eachAfter(o),u.parent.m=-u.z,u.eachBefore(s),r)c.eachBefore(l);else{var f=c,d=c,h=c;c.eachBefore(function(O){O.x<f.x&&(f=O),O.x>d.x&&(d=O),O.depth>h.depth&&(h=O)});var p=f===d?1:e(f,d)/2,g=p-f.x,v=t/(d.x+p+g),y=n/(h.depth||1);c.eachBefore(function(O){O.x=(O.x+g)*v,O.y=O.depth*y})}return c}function o(c){var u=c.children,f=c.parent.children,d=c.i?f[c.i-1]:null;if(u){tpn(c);var h=(u[0].z+u[u.length-1].z)/2;d?(c.z=d.z+e(c._,d._),c.m=c.z-h):c.z=h}else d&&(c.z=d.z+e(c._,d._));c.parent.A=a(c,d,c.parent.A||f[0])}function s(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function a(c,u,f){if(u){for(var d=c,h=c,p=u,g=d.parent.children[0],v=d.m,y=h.m,O=p.m,m=g.m,w;p=OU(p),d=bU(d),p&&d;)g=bU(g),h=OU(h),h.a=c,w=p.z+O-d.z-v+e(p._,d._),w>0&&(epn(npn(p,c,f),c,w),v+=w,y+=w),O+=p.m,v+=d.m,m+=g.m,y+=h.m;p&&!OU(h)&&(h.t=p,h.m+=O-y),d&&!bU(g)&&(g.t=d,g.m+=v-m,f=c)}return f}function l(c){c.x*=t,c.y=c.depth*n}return i.separation=function(c){return arguments.length?(e=c,i):e},i.size=function(c){return arguments.length?(r=!1,t=+c[0],n=+c[1],i):r?null:[t,n]},i.nodeSize=function(c){return arguments.length?(r=!0,t=+c[0],n=+c[1],i):r?[t,n]:null},i}function W9(e,t,n,r,i){for(var o=e.children,s,a=-1,l=o.length,c=e.value&&(i-n)/e.value;++a<l;)s=o[a],s.x0=t,s.x1=r,s.y0=n,s.y1=n+=s.value*c}var aYe=(1+Math.sqrt(5))/2;function lYe(e,t,n,r,i,o){for(var s=[],a=t.children,l,c,u=0,f=0,d=a.length,h,p,g=t.value,v,y,O,m,w,S,E;u<d;){h=i-n,p=o-r;do v=a[f++].value;while(!v&&f<d);for(y=O=v,S=Math.max(p/h,h/p)/(g*e),E=v*v*S,w=Math.max(O/E,E/y);f<d;++f){if(v+=c=a[f].value,c<y&&(y=c),c>O&&(O=c),E=v*v*S,m=Math.max(O/E,E/y),m>w){v-=c;break}w=m}s.push(l={value:v,dice:h<p,children:a.slice(u,f)}),l.dice?ND(l,n,r,i,g?r+=p*v/g:o):W9(l,n,r,g?n+=h*v/g:i,o),g-=v,u=f}return s}const cYe=function e(t){function n(r,i,o,s,a){lYe(t,r,i,o,s,a)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(aYe);function opn(){var e=cYe,t=!1,n=1,r=1,i=[0],o=P1,s=P1,a=P1,l=P1,c=P1;function u(d){return d.x0=d.y0=0,d.x1=n,d.y1=r,d.eachBefore(f),i=[0],t&&d.eachBefore(sYe),d}function f(d){var h=i[d.depth],p=d.x0+h,g=d.y0+h,v=d.x1-h,y=d.y1-h;v<p&&(p=v=(p+v)/2),y<g&&(g=y=(g+y)/2),d.x0=p,d.y0=g,d.x1=v,d.y1=y,d.children&&(h=i[d.depth+1]=o(d)/2,p+=c(d)-h,g+=s(d)-h,v-=a(d)-h,y-=l(d)-h,v<p&&(p=v=(p+v)/2),y<g&&(g=y=(g+y)/2),e(d,p,g,v,y))}return u.round=function(d){return arguments.length?(t=!!d,u):t},u.size=function(d){return arguments.length?(n=+d[0],r=+d[1],u):[n,r]},u.tile=function(d){return arguments.length?(e=rYe(d),u):e},u.padding=function(d){return arguments.length?u.paddingInner(d).paddingOuter(d):u.paddingInner()},u.paddingInner=function(d){return arguments.length?(o=typeof d=="function"?d:Ew(+d),u):o},u.paddingOuter=function(d){return arguments.length?u.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):u.paddingTop()},u.paddingTop=function(d){return arguments.length?(s=typeof d=="function"?d:Ew(+d),u):s},u.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Ew(+d),u):a},u.paddingBottom=function(d){return arguments.length?(l=typeof d=="function"?d:Ew(+d),u):l},u.paddingLeft=function(d){return arguments.length?(c=typeof d=="function"?d:Ew(+d),u):c},u}function spn(e,t,n,r,i){var o=e.children,s,a=o.length,l,c=new Array(a+1);for(c[0]=l=s=0;s<a;++s)c[s+1]=l+=o[s].value;u(0,a,e.value,t,n,r,i);function u(f,d,h,p,g,v,y){if(f>=d-1){var O=o[f];O.x0=p,O.y0=g,O.x1=v,O.y1=y;return}for(var m=c[f],w=h/2+m,S=f+1,E=d-1;S<E;){var C=S+E>>>1;c[C]<w?S=C+1:E=C}w-c[S-1]<c[S]-w&&f+1<S&&--S;var k=c[S]-m,P=h-k;if(v-p>y-g){var D=h?(p*P+v*k)/h:v;u(f,S,k,p,g,D,y),u(S,d,P,D,g,v,y)}else{var M=h?(g*P+y*k)/h:y;u(f,S,k,p,g,v,M),u(S,d,P,p,M,v,y)}}}function apn(e,t,n,r,i){(e.depth&1?W9:ND)(e,t,n,r,i)}const lpn=function e(t){function n(r,i,o,s,a){if((l=r._squarify)&&l.ratio===t)for(var l,c,u,f,d=-1,h,p=l.length,g=r.value;++d<p;){for(c=l[d],u=c.children,f=c.value=0,h=u.length;f<h;++f)c.value+=u[f].value;c.dice?ND(c,i,o,s,g?o+=(a-o)*c.value/g:a):W9(c,i,o,g?i+=(s-i)*c.value/g:s,a),g-=c.value}else r._squarify=l=lYe(t,r,i,o,s,a),l.ratio=t}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(aYe);function _J(e,t,n){const r={};return e.each(i=>{const o=i.data;n(o)&&(r[t(o)]=i)}),e.lookup=r,e}function Vfe(e){De.call(this,null,e)}Vfe.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const cpn=e=>e.values;Ke(Vfe,De,{transform(e,t){t.source||Le("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return(!o||r||t.changed())&&(o&&o.each(s=>{s.children&&t9(s.data)&&i.rem.push(s.data)}),this.value=o=qfe({values:ct(e.keys).reduce((s,a)=>(s.key(a),s),upn()).entries(i.source)},cpn),n&&o.each(s=>{s.children&&(s=dr(s.data),i.add.push(s),i.source.push(s))}),_J(o,Dt,Dt)),i.source.root=o,i}});function upn(){const e=[],t={entries:i=>r(n(i,0),0),key:i=>(e.push(i),t)};function n(i,o){if(o>=e.length)return i;const s=i.length,a=e[o++],l={},c={};let u=-1,f,d,h;for(;++u<s;)f=a(d=i[u])+"",(h=l[f])?h.push(d):l[f]=[d];for(f in l)c[f]=n(l[f],o);return c}function r(i,o){if(++o>e.length)return i;const s=[];for(const a in i)s.push({key:a,values:r(i[a],o)});return s}return t}function Om(e){De.call(this,null,e)}const fpn=(e,t)=>e.parent===t.parent?1:2;Ke(Om,De,{transform(e,t){(!t.source||!t.source.root)&&Le(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(ox(e.sort,s=>s.data)),dpn(n,this.params,e),n.separation&&n.separation(e.separation!==!1?fpn:a_);try{this.value=n(i)}catch(s){Le(s)}return i.each(s=>hpn(s,r,o)),t.reflow(e.modified()).modifies(o).modifies("leaf")}});function dpn(e,t,n){for(let r,i=0,o=t.length;i<o;++i)r=t[i],r in n&&e[r](n[r])}function hpn(e,t,n){const r=e.data,i=t.length-1;for(let o=0;o<i;++o)r[n[o]]=e[t[o]];r[n[i]]=e.children?e.children.length:0}const kJ=["x","y","r","depth","children"];function Ufe(e){Om.call(this,e)}Ufe.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:kJ.length,default:kJ}]};Ke(Ufe,Om,{layout:Hhn,params:["radius","size","padding"],fields:kJ});const $J=["x0","y0","x1","y1","depth","children"];function Hfe(e){Om.call(this,e)}Hfe.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:$J.length,default:$J}]};Ke(Hfe,Om,{layout:Xhn,params:["size","round","padding"],fields:$J});function Xfe(e){De.call(this,null,e)}Xfe.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};Ke(Xfe,De,{transform(e,t){t.source||Le("Stratify transform requires an upstream data source.");let n=this.value;const r=e.modified(),i=t.fork(t.ALL).materialize(t.SOURCE),o=!n||r||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return i.source=i.source.slice(),o&&(n=i.source.length?_J(uCe().id(e.key).parentId(e.parentKey)(i.source),e.key,pf):_J(uCe()([{}]),e.key,e.key)),i.source.root=this.value=n,i}});const dCe={tidy:ipn,cluster:mhn},TJ=["x","y","depth","children"];function Zfe(e){Om.call(this,e)}Zfe.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:TJ.length,default:TJ}]};Ke(Zfe,Om,{layout(e){const t=e||"tidy";if(Nt(dCe,t))return dCe[t]();Le("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:TJ});function Yfe(e){De.call(this,[],e)}Yfe.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};Ke(Yfe,De,{transform(e,t){const n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),o={};return r||Le("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,s=>o[Dt(s)]=1),r.each(s=>{const a=s.data,l=s.parent&&s.parent.data;l&&o[Dt(a)]&&o[Dt(l)]&&i.add.push(dr({source:l,target:a}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,s=>o[Dt(s)]=1),n.forEach(s=>{(o[Dt(s.source)]||o[Dt(s.target)])&&i.mod.push(s)})),i}});const hCe={binary:spn,dice:ND,slice:W9,slicedice:apn,squarify:cYe,resquarify:lpn},PJ=["x0","y0","x1","y1","depth","children"];function Gfe(e){Om.call(this,e)}Gfe.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:PJ.length,default:PJ}]};Ke(Gfe,Om,{layout(){const e=opn();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{Nt(hCe,t)?e.tile(hCe[t]):Le("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:PJ});const ppn=Object.freeze(Object.defineProperty({__proto__:null,nest:Vfe,pack:Ufe,partition:Hfe,stratify:Xfe,tree:Zfe,treelinks:Yfe,treemap:Gfe},Symbol.toStringTag,{value:"Module"})),xU=4278190080;function gpn(e,t){const n=e.bitmap();return(t||[]).forEach(r=>n.set(e(r.boundary[0]),e(r.boundary[3]))),[n,void 0]}function mpn(e,t,n,r,i){const o=e.width,s=e.height,a=r||i,l=l0(o,s).getContext("2d"),c=l0(o,s).getContext("2d"),u=a&&l0(o,s).getContext("2d");n.forEach(k=>mL(l,k,!1)),mL(c,t,!1),a&&mL(u,t,!0);const f=wU(l,o,s),d=wU(c,o,s),h=a&&wU(u,o,s),p=e.bitmap(),g=a&&e.bitmap();let v,y,O,m,w,S,E,C;for(y=0;y<s;++y)for(v=0;v<o;++v)w=y*o+v,S=f[w]&xU,C=d[w]&xU,E=a&&h[w]&xU,(S||E||C)&&(O=e(v),m=e(y),!i&&(S||C)&&p.set(O,m),a&&(S||E)&&g.set(O,m));return[p,g]}function wU(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function mL(e,t,n){if(!t.length)return;const r=t[0].mark.marktype;r==="group"?t.forEach(i=>{i.items.forEach(o=>mL(e,o.items,n))}):ou[r].draw(e,{items:n?t.map(ypn):t})}function ypn(e){const t=n9(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Vp=5,Xa=31,fA=32,ly=new Uint32Array(fA+1),Yf=new Uint32Array(fA+1);Yf[0]=0;ly[0]=~Yf[0];for(let e=1;e<=fA;++e)Yf[e]=Yf[e-1]<<1|1,ly[e]=~Yf[e];function vpn(e,t){const n=new Uint32Array(~~((e*t+fA)/fA));function r(o,s){n[o]|=s}function i(o,s){n[o]&=s}return{array:n,get:(o,s)=>{const a=s*e+o;return n[a>>>Vp]&1<<(a&Xa)},set:(o,s)=>{const a=s*e+o;r(a>>>Vp,1<<(a&Xa))},clear:(o,s)=>{const a=s*e+o;i(a>>>Vp,~(1<<(a&Xa)))},getRange:(o,s,a,l)=>{let c=l,u,f,d,h;for(;c>=s;--c)if(u=c*e+o,f=c*e+a,d=u>>>Vp,h=f>>>Vp,d===h){if(n[d]&ly[u&Xa]&Yf[(f&Xa)+1])return!0}else{if(n[d]&ly[u&Xa]||n[h]&Yf[(f&Xa)+1])return!0;for(let p=d+1;p<h;++p)if(n[p])return!0}return!1},setRange:(o,s,a,l)=>{let c,u,f,d,h;for(;s<=l;++s)if(c=s*e+o,u=s*e+a,f=c>>>Vp,d=u>>>Vp,f===d)r(f,ly[c&Xa]&Yf[(u&Xa)+1]);else for(r(f,ly[c&Xa]),r(d,Yf[(u&Xa)+1]),h=f+1;h<d;++h)r(h,4294967295)},clearRange:(o,s,a,l)=>{let c,u,f,d,h;for(;s<=l;++s)if(c=s*e+o,u=s*e+a,f=c>>>Vp,d=u>>>Vp,f===d)i(f,Yf[c&Xa]|ly[(u&Xa)+1]);else for(i(f,Yf[c&Xa]),i(d,ly[(u&Xa)+1]),h=f+1;h<d;++h)i(h,0)},outOfBounds:(o,s,a,l)=>o<0||s<0||l>=t||a>=e}}function bpn(e,t,n){const r=Math.max(1,Math.sqrt(e*t/1e6)),i=~~((e+2*n+r)/r),o=~~((t+2*n+r)/r),s=a=>~~((a+n)/r);return s.invert=a=>a*r-n,s.bitmap=()=>vpn(i,o),s.ratio=r,s.padding=n,s.width=e,s.height=t,s}function Opn(e,t,n,r){const i=e.width,o=e.height;return function(s){const a=s.datum.datum.items[r].items,l=a.length,c=s.datum.fontSize,u=Gc.width(s.datum,s.datum.text);let f=0,d,h,p,g,v,y,O;for(let m=0;m<l;++m)d=a[m].x,p=a[m].y,h=a[m].x2===void 0?d:a[m].x2,g=a[m].y2===void 0?p:a[m].y2,v=(d+h)/2,y=(p+g)/2,O=Math.abs(h-d+g-p),O>=f&&(f=O,s.x=v,s.y=y);return v=u/2,y=c/2,d=s.x-v,h=s.x+v,p=s.y-y,g=s.y+y,s.align="center",d<0&&h<=i?s.align="left":0<=d&&i<h&&(s.align="right"),s.baseline="middle",p<0&&g<=o?s.baseline="top":0<=p&&o<g&&(s.baseline="bottom"),!0}}function y4(e,t,n,r,i,o){let s=n/2;return e-s<0||e+s>i||t-(s=r/2)<0||t+s>o}function Fy(e,t,n,r,i,o,s,a){const l=i*o/(r*2),c=e(t-l),u=e(t+l),f=e(n-(o=o/2)),d=e(n+o);return s.outOfBounds(c,f,u,d)||s.getRange(c,f,u,d)||a&&a.getRange(c,f,u,d)}function xpn(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1];function l(c,u,f,d,h){const p=e.invert(c),g=e.invert(u);let v=f,y=o,O;if(!y4(p,g,d,h,i,o)&&!Fy(e,p,g,h,d,v,s,a)&&!Fy(e,p,g,h,d,h,s,null)){for(;y-v>=1;)O=(v+y)/2,Fy(e,p,g,h,d,O,s,a)?y=O:v=O;if(v>f)return[p,g,v,!0]}}return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=Gc.width(c.datum,c.datum.text);let p=n?d:0,g=!1,v=!1,y=0,O,m,w,S,E,C,k,P,D,M,L,A,T,N,j,z,W;for(let F=0;F<f;++F){for(O=u[F].x,w=u[F].y,m=u[F].x2===void 0?O:u[F].x2,S=u[F].y2===void 0?w:u[F].y2,O>m&&(W=O,O=m,m=W),w>S&&(W=w,w=S,S=W),D=e(O),L=e(m),M=~~((D+L)/2),A=e(w),N=e(S),T=~~((A+N)/2),k=M;k>=D;--k)for(P=T;P>=A;--P)z=l(k,P,p,h,d),z&&([c.x,c.y,p,g]=z);for(k=M;k<=L;++k)for(P=T;P<=N;++P)z=l(k,P,p,h,d),z&&([c.x,c.y,p,g]=z);!g&&!n&&(j=Math.abs(m-O+S-w),E=(O+m)/2,C=(w+S)/2,j>=y&&!y4(E,C,h,d,i,o)&&!Fy(e,E,C,d,h,d,s,null)&&(y=j,c.x=E,c.y=C,v=!0))}return g||v?(E=h/2,C=d/2,s.setRange(e(c.x-E),e(c.y-C),e(c.x+E),e(c.y+C)),c.align="center",c.baseline="middle",!0):!1}}const wpn=[-1,-1,1,1],Spn=[-1,1,-1,1];function Epn(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1],l=e.bitmap();return function(c){const u=c.datum.datum.items[r].items,f=u.length,d=c.datum.fontSize,h=Gc.width(c.datum,c.datum.text),p=[];let g=n?d:0,v=!1,y=!1,O=0,m,w,S,E,C,k,P,D,M,L,A,T;for(let N=0;N<f;++N){for(m=u[N].x,S=u[N].y,w=u[N].x2===void 0?m:u[N].x2,E=u[N].y2===void 0?S:u[N].y2,p.push([e((m+w)/2),e((S+E)/2)]);p.length;)if([P,D]=p.pop(),!(s.get(P,D)||a.get(P,D)||l.get(P,D))){l.set(P,D);for(let j=0;j<4;++j)C=P+wpn[j],k=D+Spn[j],l.outOfBounds(C,k,C,k)||p.push([C,k]);if(C=e.invert(P),k=e.invert(D),M=g,L=o,!y4(C,k,h,d,i,o)&&!Fy(e,C,k,d,h,M,s,a)&&!Fy(e,C,k,d,h,d,s,null)){for(;L-M>=1;)A=(M+L)/2,Fy(e,C,k,d,h,A,s,a)?L=A:M=A;M>g&&(c.x=C,c.y=k,g=M,v=!0)}}!v&&!n&&(T=Math.abs(w-m+E-S),C=(m+w)/2,k=(S+E)/2,T>=O&&!y4(C,k,h,d,i,o)&&!Fy(e,C,k,d,h,d,s,null)&&(O=T,c.x=C,c.y=k,y=!0))}return v||y?(C=h/2,k=d/2,s.setRange(e(c.x-C),e(c.y-k),e(c.x+C),e(c.y+k)),c.align="center",c.baseline="middle",!0):!1}}const Cpn=["right","center","left"],_pn=["bottom","middle","top"];function kpn(e,t,n,r){const i=e.width,o=e.height,s=t[0],a=t[1],l=r.length;return function(c){const u=c.boundary,f=c.datum.fontSize;if(u[2]<0||u[5]<0||u[0]>i||u[3]>o)return!1;let d=c.textWidth??0,h,p,g,v,y,O,m,w,S,E,C,k,P,D,M;for(let L=0;L<l;++L){if(h=(n[L]&3)-1,p=(n[L]>>>2&3)-1,g=h===0&&p===0||r[L]<0,v=h&&p?Math.SQRT1_2:1,y=r[L]<0?-1:1,O=u[1+h]+r[L]*h*v,C=u[4+p]+y*f*p/2+r[L]*p*v,w=C-f/2,S=C+f/2,k=e(O),D=e(w),M=e(S),!d)if(pCe(k,k,D,M,s,a,O,O,w,S,u,g))d=Gc.width(c.datum,c.datum.text);else continue;if(E=O+y*d*h/2,O=E-d/2,m=E+d/2,k=e(O),P=e(m),pCe(k,P,D,M,s,a,O,m,w,S,u,g))return c.x=h?h*y<0?m:O:E,c.y=p?p*y<0?S:w:C,c.align=Cpn[h*y+1],c.baseline=_pn[p*y+1],s.setRange(k,D,P,M),!0}return!1}}function pCe(e,t,n,r,i,o,s,a,l,c,u,f){return!(i.outOfBounds(e,n,t,r)||(f&&o||i).getRange(e,n,t,r))}const SU=0,EU=4,CU=8,_U=0,kU=1,$U=2,$pn={"top-left":SU+_U,top:SU+kU,"top-right":SU+$U,left:EU+_U,middle:EU+kU,right:EU+$U,"bottom-left":CU+_U,bottom:CU+kU,"bottom-right":CU+$U},Tpn={naive:Opn,"reduced-search":xpn,floodfill:Epn};function Ppn(e,t,n,r,i,o,s,a,l,c,u){if(!e.length)return e;const f=Math.max(r.length,i.length),d=Apn(r,f),h=Rpn(i,f),p=Dpn(e[0].datum),g=p==="group"&&e[0].datum.items[l].marktype,v=g==="area",y=Mpn(p,g,a,l),O=c===null||c===1/0,m=v&&u==="naive";let w=-1,S=-1;const E=e.map(D=>{const M=O?Gc.width(D,D.text):void 0;return w=Math.max(w,M),S=Math.max(S,D.fontSize),{datum:D,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(D),textWidth:M}});c=c===null||c===1/0?Math.max(w,S)+Math.max(...r):c;const C=bpn(t[0],t[1],c);let k;if(!m){n&&E.sort((L,A)=>n(L.datum,A.datum));let D=!1;for(let L=0;L<h.length&&!D;++L)D=h[L]===5||d[L]<0;const M=(p&&s||v)&&e.map(L=>L.datum);k=o.length||M?mpn(C,M||[],o,D,v):gpn(C,s&&E)}const P=v?Tpn[u](C,k,s,l):kpn(C,k,h,d);return E.forEach(D=>D.opacity=+P(D)),E}function Apn(e,t){const n=new Float64Array(t),r=e.length;for(let i=0;i<r;++i)n[i]=e[i]||0;for(let i=r;i<t;++i)n[i]=n[r-1];return n}function Rpn(e,t){const n=new Int8Array(t),r=e.length;for(let i=0;i<r;++i)n[i]|=$pn[e[i]];for(let i=r;i<t;++i)n[i]=n[r-1];return n}function Dpn(e){return e&&e.mark&&e.mark.marktype}function Mpn(e,t,n,r){const i=o=>[o.x,o.x,o.x,o.y,o.y,o.y];return e?e==="line"||e==="area"?o=>i(o.datum):t==="line"?o=>{const s=o.datum.items[r].items;return i(s.length?s[n==="start"?0:s.length-1]:{x:NaN,y:NaN})}:o=>{const s=o.datum.bounds;return[s.x1,(s.x1+s.x2)/2,s.x2,s.y1,(s.y1+s.y2)/2,s.y2]}:i}const AJ=["x","y","opacity","align","baseline"],uYe=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function Kfe(e){De.call(this,null,e)}Kfe.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:uYe},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:AJ.length,default:AJ}]};Ke(Kfe,De,{transform(e,t){function n(o){const s=e[o];return ln(s)&&t.modified(s.fields)}const r=e.modified();if(!(r||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&Le("Size parameter should be specified as a [width, height] array.");const i=e.as||AJ;return Ppn(t.materialize(t.SOURCE).source||[],e.size,e.sort,ct(e.offset==null?1:e.offset),ct(e.anchor||uYe),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(o=>{const s=o.datum;s[i[0]]=o.x,s[i[1]]=o.y,s[i[2]]=o.opacity,s[i[3]]=o.align,s[i[4]]=o.baseline}),t.reflow(r).modifies(i)}});const Npn=Object.freeze(Object.defineProperty({__proto__:null,label:Kfe},Symbol.toStringTag,{value:"Module"}));function fYe(e,t){var n=[],r=function(u){return u(a)},i,o,s,a,l,c;if(t==null)n.push(e);else for(i={},o=0,s=e.length;o<s;++o)a=e[o],l=t.map(r),c=i[l],c||(i[l]=c=[],c.dims=l,n.push(c)),c.push(a);return n}function Jfe(e){De.call(this,null,e)}Jfe.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]};Ke(Jfe,De,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=t.materialize(t.SOURCE).source,i=fYe(r,e.groupby),o=(e.groupby||[]).map(Zi),s=o.length,a=e.as||[Zi(e.x),Zi(e.y)],l=[];i.forEach(c=>{wVe(c,e.x,e.y,e.bandwidth||.3).forEach(u=>{const f={};for(let d=0;d<s;++d)f[o[d]]=c.dims[d];f[a[0]]=u[0],f[a[1]]=u[1],l.push(dr(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});const RJ={constant:Pce,linear:Ace,log:vVe,exp:bVe,pow:OVe,quad:Rce,poly:xVe},Ipn=(e,t)=>e==="poly"?t:e==="quad"?2:1;function ede(e){De.call(this,null,e)}ede.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(RJ)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};Ke(ede,De,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=t.materialize(t.SOURCE).source,i=fYe(r,e.groupby),o=(e.groupby||[]).map(Zi),s=e.method||"linear",a=e.order==null?3:e.order,l=Ipn(s,a),c=e.as||[Zi(e.x),Zi(e.y)],u=RJ[s],f=[];let d=e.extent;Nt(RJ,s)||Le("Invalid regression method: "+s),d!=null&&s==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach(h=>{if(h.length<=l){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=u(h,e.x,e.y,a);if(e.params){f.push(dr({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const v=d||rp(h,e.x),y=O=>{const m={};for(let w=0;w<o.length;++w)m[o[w]]=h.dims[w];m[c[0]]=O[0],m[c[1]]=O[1],f.push(dr(m))};s==="linear"||s==="constant"?v.forEach(O=>y([O,g.predict(O)])):c9(g.predict,v,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const Lpn=Object.freeze(Object.defineProperty({__proto__:null,loess:Jfe,regression:ede},Symbol.toStringTag,{value:"Module"})),Rg=11102230246251565e-32,aa=134217729,jpn=(3+8*Rg)*Rg;function TU(e,t,n,r,i){let o,s,a,l,c=t[0],u=r[0],f=0,d=0;u>c==u>-c?(o=c,c=t[++f]):(o=u,u=r[++d]);let h=0;if(f<e&&d<n)for(u>c==u>-c?(s=c+o,a=o-(s-c),c=t[++f]):(s=u+o,a=o-(s-u),u=r[++d]),o=s,a!==0&&(i[h++]=a);f<e&&d<n;)u>c==u>-c?(s=o+c,l=s-o,a=o-(s-l)+(c-l),c=t[++f]):(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=r[++d]),o=s,a!==0&&(i[h++]=a);for(;f<e;)s=o+c,l=s-o,a=o-(s-l)+(c-l),c=t[++f],o=s,a!==0&&(i[h++]=a);for(;d<n;)s=o+u,l=s-o,a=o-(s-l)+(u-l),u=r[++d],o=s,a!==0&&(i[h++]=a);return(o!==0||h===0)&&(i[h++]=o),h}function Fpn(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function ID(e){return new Float64Array(e)}const zpn=(3+16*Rg)*Rg,Qpn=(2+12*Rg)*Rg,Bpn=(9+64*Rg)*Rg*Rg,Zx=ID(4),gCe=ID(8),mCe=ID(12),yCe=ID(16),Za=ID(4);function Wpn(e,t,n,r,i,o,s){let a,l,c,u,f,d,h,p,g,v,y,O,m,w,S,E,C,k;const P=e-i,D=n-i,M=t-o,L=r-o;w=P*L,d=aa*P,h=d-(d-P),p=P-h,d=aa*L,g=d-(d-L),v=L-g,S=p*v-(w-h*g-p*g-h*v),E=M*D,d=aa*M,h=d-(d-M),p=M-h,d=aa*D,g=d-(d-D),v=D-g,C=p*v-(E-h*g-p*g-h*v),y=S-C,f=S-y,Zx[0]=S-(y+f)+(f-C),O=w+y,f=O-w,m=w-(O-f)+(y-f),y=m-E,f=m-y,Zx[1]=m-(y+f)+(f-E),k=O+y,f=k-O,Zx[2]=O-(k-f)+(y-f),Zx[3]=k;let A=Fpn(4,Zx),T=Qpn*s;if(A>=T||-A>=T||(f=e-P,a=e-(P+f)+(f-i),f=n-D,c=n-(D+f)+(f-i),f=t-M,l=t-(M+f)+(f-o),f=r-L,u=r-(L+f)+(f-o),a===0&&l===0&&c===0&&u===0)||(T=Bpn*s+jpn*Math.abs(A),A+=P*u+L*a-(M*c+D*l),A>=T||-A>=T))return A;w=a*L,d=aa*a,h=d-(d-a),p=a-h,d=aa*L,g=d-(d-L),v=L-g,S=p*v-(w-h*g-p*g-h*v),E=l*D,d=aa*l,h=d-(d-l),p=l-h,d=aa*D,g=d-(d-D),v=D-g,C=p*v-(E-h*g-p*g-h*v),y=S-C,f=S-y,Za[0]=S-(y+f)+(f-C),O=w+y,f=O-w,m=w-(O-f)+(y-f),y=m-E,f=m-y,Za[1]=m-(y+f)+(f-E),k=O+y,f=k-O,Za[2]=O-(k-f)+(y-f),Za[3]=k;const N=TU(4,Zx,4,Za,gCe);w=P*u,d=aa*P,h=d-(d-P),p=P-h,d=aa*u,g=d-(d-u),v=u-g,S=p*v-(w-h*g-p*g-h*v),E=M*c,d=aa*M,h=d-(d-M),p=M-h,d=aa*c,g=d-(d-c),v=c-g,C=p*v-(E-h*g-p*g-h*v),y=S-C,f=S-y,Za[0]=S-(y+f)+(f-C),O=w+y,f=O-w,m=w-(O-f)+(y-f),y=m-E,f=m-y,Za[1]=m-(y+f)+(f-E),k=O+y,f=k-O,Za[2]=O-(k-f)+(y-f),Za[3]=k;const j=TU(N,gCe,4,Za,mCe);w=a*u,d=aa*a,h=d-(d-a),p=a-h,d=aa*u,g=d-(d-u),v=u-g,S=p*v-(w-h*g-p*g-h*v),E=l*c,d=aa*l,h=d-(d-l),p=l-h,d=aa*c,g=d-(d-c),v=c-g,C=p*v-(E-h*g-p*g-h*v),y=S-C,f=S-y,Za[0]=S-(y+f)+(f-C),O=w+y,f=O-w,m=w-(O-f)+(y-f),y=m-E,f=m-y,Za[1]=m-(y+f)+(f-E),k=O+y,f=k-O,Za[2]=O-(k-f)+(y-f),Za[3]=k;const z=TU(j,mCe,4,Za,yCe);return yCe[z-1]}function uI(e,t,n,r,i,o){const s=(t-o)*(n-i),a=(e-i)*(r-o),l=s-a,c=Math.abs(s+a);return Math.abs(l)>=zpn*c?l:-Wpn(e,t,n,r,i,o,c)}const vCe=Math.pow(2,-52),fI=new Uint32Array(512);class v4{static from(t,n=Xpn,r=Zpn){const i=t.length,o=new Float64Array(i*2);for(let s=0;s<i;s++){const a=t[s];o[2*s]=n(a),o[2*s+1]=r(a)}return new v4(o)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:o}=this,s=t.length>>1;let a=1/0,l=1/0,c=-1/0,u=-1/0;for(let D=0;D<s;D++){const M=t[2*D],L=t[2*D+1];M<a&&(a=M),L<l&&(l=L),M>c&&(c=M),L>u&&(u=L),this._ids[D]=D}const f=(a+c)/2,d=(l+u)/2;let h=1/0,p,g,v;for(let D=0;D<s;D++){const M=PU(f,d,t[2*D],t[2*D+1]);M<h&&(p=D,h=M)}const y=t[2*p],O=t[2*p+1];h=1/0;for(let D=0;D<s;D++){if(D===p)continue;const M=PU(y,O,t[2*D],t[2*D+1]);M<h&&M>0&&(g=D,h=M)}let m=t[2*g],w=t[2*g+1],S=1/0;for(let D=0;D<s;D++){if(D===p||D===g)continue;const M=Upn(y,O,m,w,t[2*D],t[2*D+1]);M<S&&(v=D,S=M)}let E=t[2*v],C=t[2*v+1];if(S===1/0){for(let L=0;L<s;L++)this._dists[L]=t[2*L]-t[0]||t[2*L+1]-t[1];Kw(this._ids,this._dists,0,s-1);const D=new Uint32Array(s);let M=0;for(let L=0,A=-1/0;L<s;L++){const T=this._ids[L];this._dists[T]>A&&(D[M++]=T,A=this._dists[T])}this.hull=D.subarray(0,M),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(uI(y,O,m,w,E,C)<0){const D=g,M=m,L=w;g=v,m=E,w=C,v=D,E=M,C=L}const k=Hpn(y,O,m,w,E,C);this._cx=k.x,this._cy=k.y;for(let D=0;D<s;D++)this._dists[D]=PU(t[2*D],t[2*D+1],k.x,k.y);Kw(this._ids,this._dists,0,s-1),this._hullStart=p;let P=3;r[p]=n[v]=g,r[g]=n[p]=v,r[v]=n[g]=p,i[p]=0,i[g]=1,i[v]=2,o.fill(-1),o[this._hashKey(y,O)]=p,o[this._hashKey(m,w)]=g,o[this._hashKey(E,C)]=v,this.trianglesLen=0,this._addTriangle(p,g,v,-1,-1,-1);for(let D=0,M,L;D<this._ids.length;D++){const A=this._ids[D],T=t[2*A],N=t[2*A+1];if(D>0&&Math.abs(T-M)<=vCe&&Math.abs(N-L)<=vCe||(M=T,L=N,A===p||A===g||A===v))continue;let j=0;for(let U=0,V=this._hashKey(T,N);U<this._hashSize&&(j=o[(V+U)%this._hashSize],!(j!==-1&&j!==r[j]));U++);j=n[j];let z=j,W;for(;W=r[z],uI(T,N,t[2*z],t[2*z+1],t[2*W],t[2*W+1])>=0;)if(z=W,z===j){z=-1;break}if(z===-1)continue;let F=this._addTriangle(z,A,r[z],-1,-1,i[z]);i[A]=this._legalize(F+2),i[z]=F,P++;let q=r[z];for(;W=r[q],uI(T,N,t[2*q],t[2*q+1],t[2*W],t[2*W+1])<0;)F=this._addTriangle(q,A,W,i[A],-1,i[q]),i[A]=this._legalize(F+2),r[q]=q,P--,q=W;if(z===j)for(;W=n[z],uI(T,N,t[2*W],t[2*W+1],t[2*z],t[2*z+1])<0;)F=this._addTriangle(W,A,z,-1,i[z],i[W]),this._legalize(F+2),i[W]=F,r[z]=z,P--,z=W;this._hullStart=n[A]=z,r[z]=n[q]=A,r[A]=q,o[this._hashKey(T,N)]=A,o[this._hashKey(t[2*z],t[2*z+1])]=z}this.hull=new Uint32Array(P);for(let D=0,M=this._hullStart;D<P;D++)this.hull[D]=M,M=r[M];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(qpn(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:r,coords:i}=this;let o=0,s=0;for(;;){const a=r[t],l=t-t%3;if(s=l+(t+2)%3,a===-1){if(o===0)break;t=fI[--o];continue}const c=a-a%3,u=l+(t+1)%3,f=c+(a+2)%3,d=n[s],h=n[t],p=n[u],g=n[f];if(Vpn(i[2*d],i[2*d+1],i[2*h],i[2*h+1],i[2*p],i[2*p+1],i[2*g],i[2*g+1])){n[t]=g,n[a]=d;const y=r[f];if(y===-1){let m=this._hullStart;do{if(this._hullTri[m]===f){this._hullTri[m]=t;break}m=this._hullPrev[m]}while(m!==this._hullStart)}this._link(t,y),this._link(a,r[s]),this._link(s,f);const O=c+(a+1)%3;o<fI.length&&(fI[o++]=O)}else{if(o===0)break;t=fI[--o]}}return s}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,r,i,o,s){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=r,this._link(a,i),this._link(a+1,o),this._link(a+2,s),this.trianglesLen+=3,a}}function qpn(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function PU(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function Vpn(e,t,n,r,i,o,s,a){const l=e-s,c=t-a,u=n-s,f=r-a,d=i-s,h=o-a,p=l*l+c*c,g=u*u+f*f,v=d*d+h*h;return l*(f*v-g*h)-c*(u*v-g*d)+p*(u*h-f*d)<0}function Upn(e,t,n,r,i,o){const s=n-e,a=r-t,l=i-e,c=o-t,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=(c*u-a*f)*d,p=(s*f-l*u)*d;return h*h+p*p}function Hpn(e,t,n,r,i,o){const s=n-e,a=r-t,l=i-e,c=o-t,u=s*s+a*a,f=l*l+c*c,d=.5/(s*c-a*l),h=e+(c*u-a*f)*d,p=t+(s*f-l*u)*d;return{x:h,y:p}}function Kw(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const o=e[i],s=t[o];let a=i-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=o}else{const i=n+r>>1;let o=n+1,s=r;zk(e,i,o),t[e[n]]>t[e[r]]&&zk(e,n,r),t[e[o]]>t[e[r]]&&zk(e,o,r),t[e[n]]>t[e[o]]&&zk(e,n,o);const a=e[o],l=t[a];for(;;){do o++;while(t[e[o]]<l);do s--;while(t[e[s]]>l);if(s<o)break;zk(e,o,s)}e[n+1]=e[s],e[s]=a,r-o+1>=s-n?(Kw(e,t,o,r),Kw(e,t,n,s-1)):(Kw(e,t,n,s-1),Kw(e,t,o,r))}}function zk(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Xpn(e){return e[0]}function Zpn(e){return e[1]}const bCe=1e-6;class U1{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;const i=t+r,o=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${o}`:(Math.abs(this._x1-i)>bCe||Math.abs(this._y1-o)>bCe)&&(this._+="L"+i+","+o),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=o}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class DJ{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let Ypn=class{constructor(t,[n,r,i,o]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((o=+o)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=o,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this;let o,s;const a=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let g=0,v=0,y=r.length,O,m;g<y;g+=3,v+=2){const w=r[g]*2,S=r[g+1]*2,E=r[g+2]*2,C=t[w],k=t[w+1],P=t[S],D=t[S+1],M=t[E],L=t[E+1],A=P-C,T=D-k,N=M-C,j=L-k,z=(A*j-T*N)*2;if(Math.abs(z)<1e-9){if(o===void 0){o=s=0;for(const F of n)o+=t[F*2],s+=t[F*2+1];o/=n.length,s/=n.length}const W=1e9*Math.sign((o-C)*j-(s-k)*N);O=(C+M)/2-W*j,m=(k+L)/2+W*N}else{const W=1/z,F=A*A+T*T,q=N*N+j*j;O=C+(j*F-T*q)*W,m=k+(A*q-N*F)*W}a[v]=O,a[v+1]=m}let l=n[n.length-1],c,u=l*4,f,d=t[2*l],h,p=t[2*l+1];i.fill(0);for(let g=0;g<n.length;++g)l=n[g],c=u,f=d,h=p,u=l*4,d=t[2*l],p=t[2*l+1],i[c+2]=i[u]=h-p,i[c+3]=i[u+1]=d-f}render(t){const n=t==null?t=new U1:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:s,vectors:a}=this;if(o.length<=1)return null;for(let u=0,f=r.length;u<f;++u){const d=r[u];if(d<u)continue;const h=Math.floor(u/3)*2,p=Math.floor(d/3)*2,g=s[h],v=s[h+1],y=s[p],O=s[p+1];this._renderSegment(g,v,y,O,t)}let l,c=o[o.length-1];for(let u=0;u<o.length;++u){l=c,c=o[u];const f=Math.floor(i[c]/3)*2,d=s[f],h=s[f+1],p=l*4,g=this._project(d,h,a[p+2],a[p+3]);g&&this._renderSegment(d,h,g[0],g[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new U1:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const r=n==null?n=new U1:void 0,i=this._clip(t);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let o=i.length;for(;i[0]===i[o-2]&&i[1]===i[o-1]&&o>1;)o-=2;for(let s=2;s<o;s+=2)(i[s]!==i[s-2]||i[s+1]!==i[s-1])&&n.lineTo(i[s],i[s+1]);return n.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,r=t.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(t){const n=new DJ;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,o){let s;const a=this._regioncode(t,n),l=this._regioncode(r,i);a===0&&l===0?(o.moveTo(t,n),o.lineTo(r,i)):(s=this._clipSegment(t,n,r,i,a,l))&&(o.moveTo(s[0],s[1]),o.lineTo(s[2],s[3]))}contains(t,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(t,n,r)===t}*neighbors(t){const n=this._clip(t);if(n)for(const r of this.delaunay.neighbors(t)){const i=this._clip(r);if(i){e:for(let o=0,s=n.length;o<s;o+=2)for(let a=0,l=i.length;a<l;a+=2)if(n[o]===i[a]&&n[o+1]===i[a+1]&&n[(o+2)%s]===i[(a+l-2)%l]&&n[(o+3)%s]===i[(a+l-1)%l]){yield r;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:o}}=this,s=r[t];if(s===-1)return null;const a=[];let l=s;do{const c=Math.floor(l/3);if(a.push(n[c*2],n[c*2+1]),l=l%3===2?l-2:l+1,o[l]!==t)break;l=i[l]}while(l!==s&&l!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:r}=this,i=t*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(t,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(t,n))}_clipFinite(t,n){const r=n.length;let i=null,o,s,a=n[r-2],l=n[r-1],c,u=this._regioncode(a,l),f,d=0;for(let h=0;h<r;h+=2)if(o=a,s=l,a=n[h],l=n[h+1],c=u,u=this._regioncode(a,l),c===0&&u===0)f=d,d=0,i?i.push(a,l):i=[a,l];else{let p,g,v,y,O;if(c===0){if((p=this._clipSegment(o,s,a,l,c,u))===null)continue;[g,v,y,O]=p}else{if((p=this._clipSegment(a,l,o,s,u,c))===null)continue;[y,O,g,v]=p,f=d,d=this._edgecode(g,v),f&&d&&this._edge(t,f,d,i,i.length),i?i.push(g,v):i=[g,v]}f=d,d=this._edgecode(y,O),f&&d&&this._edge(t,f,d,i,i.length),i?i.push(y,O):i=[y,O]}if(i)f=d,d=this._edgecode(i[0],i[1]),f&&d&&this._edge(t,f,d,i,i.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(t,n,r,i,o,s){const a=o<s;for(a&&([t,n,r,i,o,s]=[r,i,t,n,s,o]);;){if(o===0&&s===0)return a?[r,i,t,n]:[t,n,r,i];if(o&s)return null;let l,c,u=o||s;u&8?(l=t+(r-t)*(this.ymax-n)/(i-n),c=this.ymax):u&4?(l=t+(r-t)*(this.ymin-n)/(i-n),c=this.ymin):u&2?(c=n+(i-n)*(this.xmax-t)/(r-t),l=this.xmax):(c=n+(i-n)*(this.xmin-t)/(r-t),l=this.xmin),o?(t=l,n=c,o=this._regioncode(t,n)):(r=l,i=c,s=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,o,s){let a=Array.from(n),l;if((l=this._project(a[0],a[1],r,i))&&a.unshift(l[0],l[1]),(l=this._project(a[a.length-2],a[a.length-1],o,s))&&a.push(l[0],l[1]),a=this._clipFinite(t,a))for(let c=0,u=a.length,f,d=this._edgecode(a[u-2],a[u-1]);c<u;c+=2)f=d,d=this._edgecode(a[c],a[c+1]),f&&d&&(c=this._edge(t,f,d,a,c),u=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,n,r,i,o){for(;n!==r;){let s,a;switch(n){case 5:n=4;continue;case 4:n=6,s=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,s=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,s=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,s=this.xmin,a=this.ymin;break}(i[o]!==s||i[o+1]!==a)&&this.contains(t,s,a)&&(i.splice(o,0,s,a),o+=2)}return o}_project(t,n,r,i){let o=1/0,s,a,l;if(i<0){if(n<=this.ymin)return null;(s=(this.ymin-n)/i)<o&&(l=this.ymin,a=t+(o=s)*r)}else if(i>0){if(n>=this.ymax)return null;(s=(this.ymax-n)/i)<o&&(l=this.ymax,a=t+(o=s)*r)}if(r>0){if(t>=this.xmax)return null;(s=(this.xmax-t)/r)<o&&(a=this.xmax,l=n+(o=s)*i)}else if(r<0){if(t<=this.xmin)return null;(s=(this.xmin-t)/r)<o&&(a=this.xmin,l=n+(o=s)*i)}return[a,l]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const r=(n+2)%t.length,i=(n+4)%t.length;(t[n]===t[r]&&t[r]===t[i]||t[n+1]===t[r+1]&&t[r+1]===t[i+1])&&(t.splice(r,2),n-=2)}t.length||(t=null)}return t}};const Gpn=2*Math.PI,Yx=Math.pow;function Kpn(e){return e[0]}function Jpn(e){return e[1]}function egn(e){const{triangles:t,coords:n}=e;for(let r=0;r<t.length;r+=3){const i=2*t[r],o=2*t[r+1],s=2*t[r+2];if((n[s]-n[i])*(n[o+1]-n[i+1])-(n[o]-n[i])*(n[s+1]-n[i+1])>1e-10)return!1}return!0}function tgn(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class tde{static from(t,n=Kpn,r=Jpn,i){return new tde("length"in t?ngn(t,n,r,i):Float64Array.from(rgn(t,n,r,i)))}constructor(t){this._delaunator=new v4(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&egn(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const l=this.collinear[0],c=this.collinear[this.collinear.length-1],u=[n[2*l],n[2*l+1],n[2*c],n[2*c+1]],f=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let d=0,h=n.length/2;d<h;++d){const p=tgn(n[2*d],n[2*d+1],f);n[2*d]=p[0],n[2*d+1]=p[1]}this._delaunator=new v4(n)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,o=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let l=0,c=r.length;l<c;++l){const u=o[l%3===2?l-2:l+1];(r[l]===-1||s[u]===-1)&&(s[u]=l)}for(let l=0,c=i.length;l<c;++l)a[i[l]]=l;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],s[i[0]]=1,i.length===2&&(s[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new Ypn(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:s,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}const l=n[t];if(l===-1)return;let c=l,u=-1;do{if(yield u=s[c],c=c%3===2?c-2:c+1,s[c]!==t)return;if(c=o[c],c===-1){const f=r[(i[t]+1)%r.length];f!==u&&(yield f);return}}while(c!==l)}find(t,n,r=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const i=r;let o;for(;(o=this._step(r,t,n))>=0&&o!==r&&o!==i;)r=o;return o}_step(t,n,r){const{inedges:i,hull:o,_hullIndex:s,halfedges:a,triangles:l,points:c}=this;if(i[t]===-1||!c.length)return(t+1)%(c.length>>1);let u=t,f=Yx(n-c[t*2],2)+Yx(r-c[t*2+1],2);const d=i[t];let h=d;do{let p=l[h];const g=Yx(n-c[p*2],2)+Yx(r-c[p*2+1],2);if(g<f&&(f=g,u=p),h=h%3===2?h-2:h+1,l[h]!==t)break;if(h=a[h],h===-1){if(h=o[(s[t]+1)%o.length],h!==p&&Yx(n-c[h*2],2)+Yx(r-c[h*2+1],2)<f)return h;break}}while(h!==d);return u}render(t){const n=t==null?t=new U1:void 0,{points:r,halfedges:i,triangles:o}=this;for(let s=0,a=i.length;s<a;++s){const l=i[s];if(l<s)continue;const c=o[s]*2,u=o[l]*2;t.moveTo(r[c],r[c+1]),t.lineTo(r[u],r[u+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const r=t==null?t=new U1:void 0,{points:i}=this;for(let o=0,s=i.length;o<s;o+=2){const a=i[o],l=i[o+1];t.moveTo(a+n,l),t.arc(a,l,n,0,Gpn)}return r&&r.value()}renderHull(t){const n=t==null?t=new U1:void 0,{hull:r,points:i}=this,o=r[0]*2,s=r.length;t.moveTo(i[o],i[o+1]);for(let a=1;a<s;++a){const l=2*r[a];t.lineTo(i[l],i[l+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new DJ;return this.renderHull(t),t.value()}renderTriangle(t,n){const r=n==null?n=new U1:void 0,{points:i,triangles:o}=this,s=o[t*=3]*2,a=o[t+1]*2,l=o[t+2]*2;return n.moveTo(i[s],i[s+1]),n.lineTo(i[a],i[a+1]),n.lineTo(i[l],i[l+1]),n.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,r=t.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new DJ;return this.renderTriangle(t,n),n.value()}}function ngn(e,t,n,r){const i=e.length,o=new Float64Array(i*2);for(let s=0;s<i;++s){const a=e[s];o[s*2]=t.call(r,a,s,e),o[s*2+1]=n.call(r,a,s,e)}return o}function*rgn(e,t,n,r){let i=0;for(const o of e)yield t.call(r,o,i,e),yield n.call(r,o,i,e),++i}function nde(e){De.call(this,null,e)}nde.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const ign=[-1e5,-1e5,1e5,1e5];Ke(nde,De,{transform(e,t){const n=e.as||"path",r=t.source;if(!r||!r.length)return t;let i=e.size;i=i?[0,0,i[0],i[1]]:(i=e.extent)?[i[0][0],i[0][1],i[1][0],i[1][1]]:ign;const o=this.value=tde.from(r,e.x,e.y).voronoi(i);for(let s=0,a=r.length;s<a;++s){const l=o.cellPolygon(s);r[s][n]=l&&!sgn(l)?ogn(l):null}return t.reflow(e.modified()).modifies(n)}});function ogn(e){const t=e[0][0],n=e[0][1];let r=e.length-1;for(;e[r][0]===t&&e[r][1]===n;--r);return"M"+e.slice(0,r+1).join("L")+"Z"}function sgn(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const agn=Object.freeze(Object.defineProperty({__proto__:null,voronoi:nde},Symbol.toStringTag,{value:"Module"}));var AU=Math.PI/180,X$=64,yL=2048;function lgn(){var e=[256,256],t,n,r,i,o,s,a,l=dYe,c=[],u=Math.random,f={};f.layout=function(){for(var p=d(l0()),g=pgn((e[0]>>5)*e[1]),v=null,y=c.length,O=-1,m=[],w=c.map(E=>({text:t(E),font:n(E),style:i(E),weight:o(E),rotate:s(E),size:~~(r(E)+1e-14),padding:a(E),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:E})).sort((E,C)=>C.size-E.size);++O<y;){var S=w[O];S.x=e[0]*(u()+.5)>>1,S.y=e[1]*(u()+.5)>>1,cgn(p,S,w,O),S.hasText&&h(g,S,v)&&(m.push(S),v?fgn(v,S):v=[{x:S.x+S.x0,y:S.y+S.y0},{x:S.x+S.x1,y:S.y+S.y1}],S.x-=e[0]>>1,S.y-=e[1]>>1)}return m};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(X$<<5)/g,p.height=yL/g;var v=p.getContext("2d");return v.fillStyle=v.strokeStyle="red",v.textAlign="center",{context:v,ratio:g}}function h(p,g,v){for(var y=g.x,O=g.y,m=Math.sqrt(e[0]*e[0]+e[1]*e[1]),w=l(e),S=u()<.5?1:-1,E=-S,C,k,P;(C=w(E+=S))&&(k=~~C[0],P=~~C[1],!(Math.min(Math.abs(k),Math.abs(P))>=m));)if(g.x=y+k,g.y=O+P,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!v||!ugn(g,p,e[0]))&&(!v||dgn(g,v))){for(var D=g.sprite,M=g.width>>5,L=e[0]>>5,A=g.x-(M<<4),T=A&127,N=32-T,j=g.y1-g.y0,z=(g.y+g.y0)*L+(A>>5),W,F=0;F<j;F++){W=0;for(var q=0;q<=M;q++)p[z+q]|=W<<N|(q<M?(W=D[F*M+q])>>>T:0);z+=L}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(c=p,f):c},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=Hv(p),f):n},f.fontStyle=function(p){return arguments.length?(i=Hv(p),f):i},f.fontWeight=function(p){return arguments.length?(o=Hv(p),f):o},f.rotate=function(p){return arguments.length?(s=Hv(p),f):s},f.text=function(p){return arguments.length?(t=Hv(p),f):t},f.spiral=function(p){return arguments.length?(l=ggn[p]||p,f):l},f.fontSize=function(p){return arguments.length?(r=Hv(p),f):r},f.padding=function(p){return arguments.length?(a=Hv(p),f):a},f.random=function(p){return arguments.length?(u=p,f):u},f}function cgn(e,t,n,r){if(!t.sprite){var i=e.context,o=e.ratio;i.clearRect(0,0,(X$<<5)/o,yL/o);var s=0,a=0,l=0,c=n.length,u,f,d,h,p;for(--r;++r<c;){if(t=n[r],i.save(),i.font=t.style+" "+t.weight+" "+~~((t.size+1)/o)+"px "+t.font,u=i.measureText(t.text+"m").width*o,d=t.size<<1,t.rotate){var g=Math.sin(t.rotate*AU),v=Math.cos(t.rotate*AU),y=u*v,O=u*g,m=d*v,w=d*g;u=Math.max(Math.abs(y+w),Math.abs(y-w))+31>>5<<5,d=~~Math.max(Math.abs(O+m),Math.abs(O-m))}else u=u+31>>5<<5;if(d>l&&(l=d),s+u>=X$<<5&&(s=0,a+=l,l=0),a+d>=yL)break;i.translate((s+(u>>1))/o,(a+(d>>1))/o),t.rotate&&i.rotate(t.rotate*AU),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=u,t.height=d,t.xoff=s,t.yoff=a,t.x1=u>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,s+=u}for(var S=i.getImageData(0,0,(X$<<5)/o,yL/o).data,E=[];--r>=0;)if(t=n[r],!!t.hasText){for(u=t.width,f=u>>5,d=t.y1-t.y0,h=0;h<d*f;h++)E[h]=0;if(s=t.xoff,s==null)return;a=t.yoff;var C=0,k=-1;for(p=0;p<d;p++){for(h=0;h<u;h++){var P=f*p+(h>>5),D=S[(a+p)*(X$<<5)+(s+h)<<2]?1<<31-h%32:0;E[P]|=D,C|=D}C?k=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+k,t.sprite=E.slice(0,(t.y1-t.y0)*f)}}}function ugn(e,t,n){n>>=5;for(var r=e.sprite,i=e.width>>5,o=e.x-(i<<4),s=o&127,a=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(o>>5),u,f=0;f<l;f++){u=0;for(var d=0;d<=i;d++)if((u<<a|(d<i?(u=r[f*i+d])>>>s:0))&t[c+d])return!0;c+=n}return!1}function fgn(e,t){var n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function dgn(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function dYe(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function hgn(e){var t=4,n=t*e[0]/e[1],r=0,i=0;return function(o){var s=o<0?-1:1;switch(Math.sqrt(1+4*s*o)-s&3){case 0:r+=n;break;case 1:i+=t;break;case 2:r-=n;break;default:i-=t;break}return[r,i]}}function pgn(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function Hv(e){return typeof e=="function"?e:function(){return e}}var ggn={archimedean:dYe,rectangular:hgn};const hYe=["x","y","font","fontSize","fontStyle","fontWeight","angle"],mgn=["text","font","rotate","fontSize","fontStyle","fontWeight"];function rde(e){De.call(this,lgn(),e)}rde.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:hYe}]};Ke(rde,De,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&Le("Wordcloud size dimensions must be non-zero.");function n(p){const g=e[p];return ln(g)&&t.modified(g.fields)}const r=e.modified();if(!(r||t.changed(t.ADD_REM)||mgn.some(n)))return;const i=t.materialize(t.SOURCE).source,o=this.value,s=e.as||hYe;let a=e.fontSize||14,l;if(ln(a)?l=e.fontSizeRange:a=Wa(a),l){const p=a,g=tr("sqrt")().domain(rp(i,p)).range(l);a=v=>g(p(v))}i.forEach(p=>{p[s[0]]=NaN,p[s[1]]=NaN,p[s[3]]=0});const c=o.words(i).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(vf).layout(),u=o.size(),f=u[0]>>1,d=u[1]>>1,h=c.length;for(let p=0,g,v;p<h;++p)g=c[p],v=g.datum,v[s[0]]=g.x+f,v[s[1]]=g.y+d,v[s[2]]=g.font,v[s[3]]=g.size,v[s[4]]=g.style,v[s[5]]=g.weight,v[s[6]]=g.rotate;return t.reflow(r).modifies(s)}});const ygn=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:rde},Symbol.toStringTag,{value:"Module"})),vgn=e=>new Uint8Array(e),bgn=e=>new Uint16Array(e),t2=e=>new Uint32Array(e);function Ogn(){let e=8,t=[],n=t2(0),r=dI(0,e),i=dI(0,e);return{data:()=>t,seen:()=>n=xgn(n,t.length),add(o){for(let s=0,a=t.length,l=o.length,c;s<l;++s)c=o[s],c._index=a++,t.push(c)},remove(o,s){const a=t.length,l=Array(a-o),c=t;let u,f,d;for(f=0;!s[f]&&f<a;++f)l[f]=t[f],c[f]=f;for(d=f;f<a;++f)u=t[f],s[f]?c[f]=-1:(c[f]=d,r[d]=r[f],i[d]=i[f],l[d]=u,u._index=d++),r[f]=0;return t=l,c},size:()=>t.length,curr:()=>r,prev:()=>i,reset:o=>i[o]=r[o],all:()=>e<257?255:e<65537?65535:4294967295,set(o,s){r[o]|=s},clear(o,s){r[o]&=~s},resize(o,s){const a=r.length;(o>a||s>e)&&(e=Math.max(s,e),r=dI(o,e,r),i=dI(o,e))}}}function xgn(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function dI(e,t,n){const r=(t<257?vgn:t<65537?bgn:t2)(e);return n&&r.set(n),r}function OCe(e,t,n){const r=1<<t;return{one:r,zero:~r,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(i,o){const s=this,a=s.bisect(s.range,i.value),l=i.index,c=a[0],u=a[1],f=l.length;let d;for(d=0;d<c;++d)o[l[d]]|=r;for(d=u;d<f;++d)o[l[d]]|=r;return s}}}function xCe(){let e=t2(0),t=[],n=0;function r(a,l,c){if(!l.length)return[];const u=n,f=l.length,d=t2(f);let h=Array(f),p,g,v;for(v=0;v<f;++v)h[v]=a(l[v]),d[v]=v;if(h=wgn(h,d),u)p=t,g=e,t=Array(u+f),e=t2(u+f),Sgn(c,p,g,u,h,d,f,t,e);else{if(c>0)for(v=0;v<f;++v)d[v]+=c;t=h,e=d}return n=u+f,{index:d,value:h}}function i(a,l){const c=n;let u,f,d;for(f=0;!l[e[f]]&&f<c;++f);for(d=f;f<c;++f)l[u=e[f]]||(e[d]=u,t[d]=t[f],++d);n=c-a}function o(a){for(let l=0,c=n;l<c;++l)e[l]=a[e[l]]}function s(a,l){let c;return l?c=l.length:(l=t,c=n),[Z9t(l,a[0],0,c),F0(l,a[1],0,c)]}return{insert:r,remove:i,bisect:s,reindex:o,index:()=>e,size:()=>n}}function wgn(e,t){return e.sort.call(t,(n,r)=>{const i=e[n],o=e[r];return i<o?-1:i>o?1:0}),K9t(e,t)}function Sgn(e,t,n,r,i,o,s,a,l){let c=0,u=0,f;for(f=0;c<r&&u<s;++f)t[c]<i[u]?(a[f]=t[c],l[f]=n[c++]):(a[f]=i[u],l[f]=o[u++]+e);for(;c<r;++c,++f)a[f]=t[c],l[f]=n[c];for(;u<s;++u,++f)a[f]=i[u],l[f]=o[u]+e}function ide(e){De.call(this,Ogn(),e),this._indices=null,this._dims=null}ide.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};Ke(ide,De,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(r=>t.modified(r.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],s=r.length;let a=0,l,c;for(;a<s;++a)l=n[a].fname,c=i[l]||(i[l]=xCe()),o.push(OCe(c,a,r[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),r=e.fields,i=e.query,o=this._indices,s=this._dims,a=this.value,l=a.curr(),c=a.prev(),u=a.all(),f=n.rem=n.add,d=n.mod,h=i.length,p={};let g,v,y,O,m,w,S,E,C;if(c.set(l),t.rem.length&&(m=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(w={},O=t.mod,S=0,E=O.length;S<E;++S)w[O[S]._index]=1;for(S=0;S<h;++S)C=r[S],(!s[S]||e.modified("fields",S)||t.modified(C.fields))&&(y=C.fname,(g=p[y])||(o[y]=v=xCe(),p[y]=g=v.insert(C,t.source,0)),s[S]=OCe(v,S,i[S]).onAdd(g,l));for(S=0,E=a.data().length;S<E;++S)m[S]||(c[S]!==l[S]?f.push(S):w[S]&&l[S]!==u&&d.push(S));return a.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),r=this._dims.length;let i=0;return t.rem.length&&(this.remove(e,t,n),i|=(1<<r)-1),e.modified("query")&&!e.modified("fields")&&(i|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),i|=(1<<r)-1),t.mod.length&&(this.modify(t,n),i|=(1<<r)-1),this.value.mask=i,n},insert(e,t,n){const r=t.add,i=this.value,o=this._dims,s=this._indices,a=e.fields,l={},c=n.add,u=i.size()+r.length,f=o.length;let d=i.size(),h,p,g;i.resize(u,f),i.add(r);const v=i.curr(),y=i.prev(),O=i.all();for(h=0;h<f;++h)p=a[h].fname,g=l[p]||(l[p]=s[p].insert(a[h],r,d)),o[h].onAdd(g,v);for(;d<u;++d)y[d]=O,v[d]!==O&&c.push(d)},modify(e,t){const n=t.mod,r=this.value,i=r.curr(),o=r.all(),s=e.mod;let a,l,c;for(a=0,l=s.length;a<l;++a)c=s[a]._index,i[c]!==o&&n.push(c)},remove(e,t,n){const r=this._indices,i=this.value,o=i.curr(),s=i.prev(),a=i.all(),l={},c=n.rem,u=t.rem;let f,d,h,p;for(f=0,d=u.length;f<d;++f)h=u[f]._index,l[h]=1,s[h]=p=o[h],o[h]=a,p!==a&&c.push(h);for(h in r)r[h].remove(d,l);return this.reindex(t,d,l),l},reindex(e,t,n){const r=this._indices,i=this.value;e.runAfter(()=>{const o=i.remove(t,n);for(const s in r)r[s].reindex(o)})},update(e,t,n){const r=this._dims,i=e.query,o=t.stamp,s=r.length;let a=0,l,c;for(n.filters=0,c=0;c<s;++c)e.modified("query",c)&&(l=c,++a);if(a===1)a=r[l].one,this.incrementOne(r[l],i[l],n.add,n.rem);else for(c=0,a=0;c<s;++c)e.modified("query",c)&&(a|=r[c].one,this.incrementAll(r[c],i[c],o,n.add),n.rem=n.add);return a},incrementAll(e,t,n,r){const i=this.value,o=i.seen(),s=i.curr(),a=i.prev(),l=e.index(),c=e.bisect(e.range),u=e.bisect(t),f=u[0],d=u[1],h=c[0],p=c[1],g=e.one;let v,y,O;if(f<h)for(v=f,y=Math.min(h,d);v<y;++v)O=l[v],o[O]!==n&&(a[O]=s[O],o[O]=n,r.push(O)),s[O]^=g;else if(f>h)for(v=h,y=Math.min(f,p);v<y;++v)O=l[v],o[O]!==n&&(a[O]=s[O],o[O]=n,r.push(O)),s[O]^=g;if(d>p)for(v=Math.max(f,p),y=d;v<y;++v)O=l[v],o[O]!==n&&(a[O]=s[O],o[O]=n,r.push(O)),s[O]^=g;else if(d<p)for(v=Math.max(h,d),y=p;v<y;++v)O=l[v],o[O]!==n&&(a[O]=s[O],o[O]=n,r.push(O)),s[O]^=g;e.range=t.slice()},incrementOne(e,t,n,r){const i=this.value,o=i.curr(),s=e.index(),a=e.bisect(e.range),l=e.bisect(t),c=l[0],u=l[1],f=a[0],d=a[1],h=e.one;let p,g,v;if(c<f)for(p=c,g=Math.min(f,u);p<g;++p)v=s[p],o[v]^=h,n.push(v);else if(c>f)for(p=f,g=Math.min(c,d);p<g;++p)v=s[p],o[v]^=h,r.push(v);if(u>d)for(p=Math.max(c,d),g=u;p<g;++p)v=s[p],o[v]^=h,n.push(v);else if(u<d)for(p=Math.max(f,u),g=d;p<g;++p)v=s[p],o[v]^=h,r.push(v);e.range=t.slice()}});function ode(e){De.call(this,null,e)}ode.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};Ke(ode,De,{transform(e,t){const n=~(e.ignore||0),r=e.filter,i=r.mask;if(!(i&n))return t.StopPropagation;const o=t.fork(t.ALL),s=r.data(),a=r.curr(),l=r.prev(),c=u=>a[u]&n?null:s[u];return o.filter(o.MOD,c),i&i-1?(o.filter(o.ADD,u=>{const f=a[u]&n;return!f&&f^l[u]&n?s[u]:null}),o.filter(o.REM,u=>{const f=a[u]&n;return f&&!(f^(f^l[u]&n))?s[u]:null})):(o.filter(o.ADD,c),o.filter(o.REM,u=>(a[u]&n)===i?s[u]:null)),o.filter(o.SOURCE,u=>c(u._index))}});const Egn=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:ide,resolvefilter:ode},Symbol.toStringTag,{value:"Module"})),Cgn="RawCode",bO="Literal",_gn="Property",kgn="Identifier",$gn="ArrayExpression",Tgn="BinaryExpression",pYe="CallExpression",Pgn="ConditionalExpression",Agn="LogicalExpression",Rgn="MemberExpression",Dgn="ObjectExpression",Mgn="UnaryExpression";function Qd(e){this.type=e}Qd.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=Ngn(this),n=0,r=t.length;n<r;++n)if(t[n].visit(e))return 1};function Ngn(e){switch(e.type){case $gn:return e.elements;case Tgn:case Agn:return[e.left,e.right];case pYe:return[e.callee].concat(e.arguments);case Pgn:return[e.test,e.consequent,e.alternate];case Rgn:return[e.object,e.property];case Dgn:return e.properties;case _gn:return[e.key,e.value];case Mgn:return[e.argument];case kgn:case bO:case Cgn:default:return[]}}var $p,wt,Ie,Ia,Cr,q9=1,LD=2,OO=3,Mv=4,V9=5,cx=6,Dl=7,jD=8,Ign=9;$p={};$p[q9]="Boolean";$p[LD]="<end>";$p[OO]="Identifier";$p[Mv]="Keyword";$p[V9]="Null";$p[cx]="Numeric";$p[Dl]="Punctuator";$p[jD]="String";$p[Ign]="RegularExpression";var Lgn="ArrayExpression",jgn="BinaryExpression",Fgn="CallExpression",zgn="ConditionalExpression",gYe="Identifier",Qgn="Literal",Bgn="LogicalExpression",Wgn="MemberExpression",qgn="ObjectExpression",Vgn="Property",Ugn="UnaryExpression",fs="Unexpected token %0",Hgn="Unexpected number",Xgn="Unexpected string",Zgn="Unexpected identifier",Ygn="Unexpected reserved word",Ggn="Unexpected end of input",MJ="Invalid regular expression",RU="Invalid regular expression: missing /",mYe="Octal literals are not allowed in strict mode.",Kgn="Duplicate data property in object literal not allowed in strict mode",Bs="ILLEGAL",dA="Disabled.",Jgn=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),emn=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function U9(e,t){if(!e)throw new Error("ASSERT: "+t)}function og(e){return e>=48&&e<=57}function sde(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function n2(e){return"01234567".indexOf(e)>=0}function tmn(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function hA(e){return e===10||e===13||e===8232||e===8233}function FD(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Jgn.test(String.fromCharCode(e))}function b4(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&emn.test(String.fromCharCode(e))}const nmn={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function yYe(){for(;Ie<Ia;){const e=wt.charCodeAt(Ie);if(tmn(e)||hA(e))++Ie;else break}}function NJ(e){var t,n,r,i=0;for(n=e==="u"?4:2,t=0;t<n;++t)Ie<Ia&&sde(wt[Ie])?(r=wt[Ie++],i=i*16+"0123456789abcdef".indexOf(r.toLowerCase())):Kn({},fs,Bs);return String.fromCharCode(i)}function rmn(){var e,t,n,r;for(e=wt[Ie],t=0,e==="}"&&Kn({},fs,Bs);Ie<Ia&&(e=wt[Ie++],!!sde(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&Kn({},fs,Bs),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,r=(t-65536&1023)+56320,String.fromCharCode(n,r))}function vYe(){var e,t;for(e=wt.charCodeAt(Ie++),t=String.fromCharCode(e),e===92&&(wt.charCodeAt(Ie)!==117&&Kn({},fs,Bs),++Ie,e=NJ("u"),(!e||e==="\\"||!FD(e.charCodeAt(0)))&&Kn({},fs,Bs),t=e);Ie<Ia&&(e=wt.charCodeAt(Ie),!!b4(e));)++Ie,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),wt.charCodeAt(Ie)!==117&&Kn({},fs,Bs),++Ie,e=NJ("u"),(!e||e==="\\"||!b4(e.charCodeAt(0)))&&Kn({},fs,Bs),t+=e);return t}function imn(){var e,t;for(e=Ie++;Ie<Ia;){if(t=wt.charCodeAt(Ie),t===92)return Ie=e,vYe();if(b4(t))++Ie;else break}return wt.slice(e,Ie)}function omn(){var e,t,n;return e=Ie,t=wt.charCodeAt(Ie)===92?vYe():imn(),t.length===1?n=OO:nmn.hasOwnProperty(t)?n=Mv:t==="null"?n=V9:t==="true"||t==="false"?n=q9:n=OO,{type:n,value:t,start:e,end:Ie}}function DU(){var e=Ie,t=wt.charCodeAt(Ie),n,r=wt[Ie],i,o,s;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++Ie,{type:Dl,value:String.fromCharCode(t),start:e,end:Ie};default:if(n=wt.charCodeAt(Ie+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return Ie+=2,{type:Dl,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:Ie};case 33:case 61:return Ie+=2,wt.charCodeAt(Ie)===61&&++Ie,{type:Dl,value:wt.slice(e,Ie),start:e,end:Ie}}}if(s=wt.substr(Ie,4),s===">>>=")return Ie+=4,{type:Dl,value:s,start:e,end:Ie};if(o=s.substr(0,3),o===">>>"||o==="<<="||o===">>=")return Ie+=3,{type:Dl,value:o,start:e,end:Ie};if(i=o.substr(0,2),r===i[1]&&"+-<>&|".indexOf(r)>=0||i==="=>")return Ie+=2,{type:Dl,value:i,start:e,end:Ie};if(i==="//"&&Kn({},fs,Bs),"<>=!+-*%&|^/".indexOf(r)>=0)return++Ie,{type:Dl,value:r,start:e,end:Ie};Kn({},fs,Bs)}function smn(e){let t="";for(;Ie<Ia&&sde(wt[Ie]);)t+=wt[Ie++];return t.length===0&&Kn({},fs,Bs),FD(wt.charCodeAt(Ie))&&Kn({},fs,Bs),{type:cx,value:parseInt("0x"+t,16),start:e,end:Ie}}function amn(e){let t="0"+wt[Ie++];for(;Ie<Ia&&n2(wt[Ie]);)t+=wt[Ie++];return(FD(wt.charCodeAt(Ie))||og(wt.charCodeAt(Ie)))&&Kn({},fs,Bs),{type:cx,value:parseInt(t,8),octal:!0,start:e,end:Ie}}function wCe(){var e,t,n;if(n=wt[Ie],U9(og(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=Ie,e="",n!=="."){if(e=wt[Ie++],n=wt[Ie],e==="0"){if(n==="x"||n==="X")return++Ie,smn(t);if(n2(n))return amn(t);n&&og(n.charCodeAt(0))&&Kn({},fs,Bs)}for(;og(wt.charCodeAt(Ie));)e+=wt[Ie++];n=wt[Ie]}if(n==="."){for(e+=wt[Ie++];og(wt.charCodeAt(Ie));)e+=wt[Ie++];n=wt[Ie]}if(n==="e"||n==="E")if(e+=wt[Ie++],n=wt[Ie],(n==="+"||n==="-")&&(e+=wt[Ie++]),og(wt.charCodeAt(Ie)))for(;og(wt.charCodeAt(Ie));)e+=wt[Ie++];else Kn({},fs,Bs);return FD(wt.charCodeAt(Ie))&&Kn({},fs,Bs),{type:cx,value:parseFloat(e),start:t,end:Ie}}function lmn(){var e="",t,n,r,i,o=!1;for(t=wt[Ie],U9(t==="'"||t==='"',"String literal must starts with a quote"),n=Ie,++Ie;Ie<Ia;)if(r=wt[Ie++],r===t){t="";break}else if(r==="\\")if(r=wt[Ie++],!r||!hA(r.charCodeAt(0)))switch(r){case"u":case"x":wt[Ie]==="{"?(++Ie,e+=rmn()):e+=NJ(r);break;case"n":e+=`
`;break;case"r":e+="\r";break;case"t":e+="	";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:n2(r)?(i="01234567".indexOf(r),i!==0&&(o=!0),Ie<Ia&&n2(wt[Ie])&&(o=!0,i=i*8+"01234567".indexOf(wt[Ie++]),"0123".indexOf(r)>=0&&Ie<Ia&&n2(wt[Ie])&&(i=i*8+"01234567".indexOf(wt[Ie++]))),e+=String.fromCharCode(i)):e+=r;break}else r==="\r"&&wt[Ie]===`
`&&++Ie;else{if(hA(r.charCodeAt(0)))break;e+=r}return t!==""&&Kn({},fs,Bs),{type:jD,value:e,octal:o,start:n,end:Ie}}function cmn(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(r,i)=>{if(parseInt(i,16)<=1114111)return"x";Kn({},MJ)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Kn({},MJ)}try{return new RegExp(e,t)}catch{return null}}function umn(){var e,t,n,r,i;for(e=wt[Ie],U9(e==="/","Regular expression literal must start with a slash"),t=wt[Ie++],n=!1,r=!1;Ie<Ia;)if(e=wt[Ie++],t+=e,e==="\\")e=wt[Ie++],hA(e.charCodeAt(0))&&Kn({},RU),t+=e;else if(hA(e.charCodeAt(0)))Kn({},RU);else if(n)e==="]"&&(n=!1);else if(e==="/"){r=!0;break}else e==="["&&(n=!0);return r||Kn({},RU),i=t.substr(1,t.length-2),{value:i,literal:t}}function fmn(){var e,t,n;for(t="",n="";Ie<Ia&&(e=wt[Ie],!!b4(e.charCodeAt(0)));)++Ie,e==="\\"&&Ie<Ia?Kn({},fs,Bs):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Kn({},MJ,n),{value:n,literal:t}}function dmn(){var e,t,n,r;return Cr=null,yYe(),e=Ie,t=umn(),n=fmn(),r=cmn(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:Ie}}function hmn(e){return e.type===OO||e.type===Mv||e.type===q9||e.type===V9}function bYe(){if(yYe(),Ie>=Ia)return{type:LD,start:Ie,end:Ie};const e=wt.charCodeAt(Ie);return FD(e)?omn():e===40||e===41||e===59?DU():e===39||e===34?lmn():e===46?og(wt.charCodeAt(Ie+1))?wCe():DU():og(e)?wCe():DU()}function zl(){const e=Cr;return Ie=e.end,Cr=bYe(),Ie=e.end,e}function OYe(){const e=Ie;Cr=bYe(),Ie=e}function pmn(e){const t=new Qd(Lgn);return t.elements=e,t}function SCe(e,t,n){const r=new Qd(e==="||"||e==="&&"?Bgn:jgn);return r.operator=e,r.left=t,r.right=n,r}function gmn(e,t){const n=new Qd(Fgn);return n.callee=e,n.arguments=t,n}function mmn(e,t,n){const r=new Qd(zgn);return r.test=e,r.consequent=t,r.alternate=n,r}function ade(e){const t=new Qd(gYe);return t.name=e,t}function Z$(e){const t=new Qd(Qgn);return t.value=e.value,t.raw=wt.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function ECe(e,t,n){const r=new Qd(Wgn);return r.computed=e==="[",r.object=t,r.property=n,r.computed||(n.member=!0),r}function ymn(e){const t=new Qd(qgn);return t.properties=e,t}function CCe(e,t,n){const r=new Qd(Vgn);return r.key=t,r.value=n,r.kind=e,r}function vmn(e,t){const n=new Qd(Ugn);return n.operator=e,n.argument=t,n.prefix=!0,n}function Kn(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(o,s)=>(U9(s<r.length,"Message reference must be in range"),r[s]));throw n=new Error(i),n.index=Ie,n.description=i,n}function H9(e){e.type===LD&&Kn(e,Ggn),e.type===cx&&Kn(e,Hgn),e.type===jD&&Kn(e,Xgn),e.type===OO&&Kn(e,Zgn),e.type===Mv&&Kn(e,Ygn),Kn(e,fs,e.value)}function La(e){const t=zl();(t.type!==Dl||t.value!==e)&&H9(t)}function ci(e){return Cr.type===Dl&&Cr.value===e}function MU(e){return Cr.type===Mv&&Cr.value===e}function bmn(){const e=[];for(Ie=Cr.start,La("[");!ci("]");)ci(",")?(zl(),e.push(null)):(e.push(xO()),ci("]")||La(","));return zl(),pmn(e)}function _Ce(){Ie=Cr.start;const e=zl();return e.type===jD||e.type===cx?(e.octal&&Kn(e,mYe),Z$(e)):ade(e.value)}function Omn(){var e,t,n,r;if(Ie=Cr.start,e=Cr,e.type===OO)return n=_Ce(),La(":"),r=xO(),CCe("init",n,r);if(e.type===LD||e.type===Dl)H9(e);else return t=_Ce(),La(":"),r=xO(),CCe("init",t,r)}function xmn(){var e=[],t,n,r,i={},o=String;for(Ie=Cr.start,La("{");!ci("}");)t=Omn(),t.key.type===gYe?n=t.key.name:n=o(t.key.value),r="$"+n,Object.prototype.hasOwnProperty.call(i,r)?Kn({},Kgn):i[r]=!0,e.push(t),ci("}")||La(",");return La("}"),ymn(e)}function wmn(){La("(");const e=lde();return La(")"),e}const Smn={if:1};function Emn(){var e,t,n;if(ci("("))return wmn();if(ci("["))return bmn();if(ci("{"))return xmn();if(e=Cr.type,Ie=Cr.start,e===OO||Smn[Cr.value])n=ade(zl().value);else if(e===jD||e===cx)Cr.octal&&Kn(Cr,mYe),n=Z$(zl());else{if(e===Mv)throw new Error(dA);e===q9?(t=zl(),t.value=t.value==="true",n=Z$(t)):e===V9?(t=zl(),t.value=null,n=Z$(t)):ci("/")||ci("/=")?(n=Z$(dmn()),OYe()):H9(zl())}return n}function Cmn(){const e=[];if(La("("),!ci(")"))for(;Ie<Ia&&(e.push(xO()),!ci(")"));)La(",");return La(")"),e}function _mn(){Ie=Cr.start;const e=zl();return hmn(e)||H9(e),ade(e.value)}function kmn(){return La("."),_mn()}function $mn(){La("[");const e=lde();return La("]"),e}function Tmn(){var e,t,n;for(e=Emn();;)if(ci("."))n=kmn(),e=ECe(".",e,n);else if(ci("("))t=Cmn(),e=gmn(e,t);else if(ci("["))n=$mn(),e=ECe("[",e,n);else break;return e}function kCe(){const e=Tmn();if(Cr.type===Dl&&(ci("++")||ci("--")))throw new Error(dA);return e}function vL(){var e,t;if(Cr.type!==Dl&&Cr.type!==Mv)t=kCe();else{if(ci("++")||ci("--"))throw new Error(dA);if(ci("+")||ci("-")||ci("~")||ci("!"))e=zl(),t=vL(),t=vmn(e.value,t);else{if(MU("delete")||MU("void")||MU("typeof"))throw new Error(dA);t=kCe()}}return t}function $Ce(e){let t=0;if(e.type!==Dl&&e.type!==Mv)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function Pmn(){var e,t,n,r,i,o,s,a,l,c;if(e=Cr,l=vL(),r=Cr,i=$Ce(r),i===0)return l;for(r.prec=i,zl(),t=[e,Cr],s=vL(),o=[l,r,s];(i=$Ce(Cr))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)s=o.pop(),a=o.pop().value,l=o.pop(),t.pop(),n=SCe(a,l,s),o.push(n);r=zl(),r.prec=i,o.push(r),t.push(Cr),n=vL(),o.push(n)}for(c=o.length-1,n=o[c],t.pop();c>1;)t.pop(),n=SCe(o[c-1].value,o[c-2],n),c-=2;return n}function xO(){var e,t,n;return e=Pmn(),ci("?")&&(zl(),t=xO(),La(":"),n=xO(),e=mmn(e,t,n)),e}function lde(){const e=xO();if(ci(","))throw new Error(dA);return e}function cde(e){wt=e,Ie=0,Ia=wt.length,Cr=null,OYe();const t=lde();if(Cr.type!==LD)throw new Error("Unexpect token after expression.");return t}var xYe={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function wYe(e){function t(s,a,l,c){let u=e(a[0]);return l&&(u=l+"("+u+")",l.lastIndexOf("new ",0)===0&&(u="("+u+")")),u+"."+s+(c<0?"":c===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(s,a,l){return c=>t(s,c,a,l)}const r="new Date",i="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(s){s.length<3&&Le("Missing arguments to clamp function."),s.length>3&&Le("Too many arguments to clamp function.");const a=s.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:n("getDate",r,0),day:n("getDay",r,0),year:n("getFullYear",r,0),month:n("getMonth",r,0),hours:n("getHours",r,0),minutes:n("getMinutes",r,0),seconds:n("getSeconds",r,0),milliseconds:n("getMilliseconds",r,0),time:n("getTime",r,0),timezoneoffset:n("getTimezoneOffset",r,0),utcdate:n("getUTCDate",r,0),utcday:n("getUTCDay",r,0),utcyear:n("getUTCFullYear",r,0),utcmonth:n("getUTCMonth",r,0),utchours:n("getUTCHours",r,0),utcminutes:n("getUTCMinutes",r,0),utcseconds:n("getUTCSeconds",r,0),utcmilliseconds:n("getUTCMilliseconds",r,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",i,0),lower:n("toLowerCase",i,0),substring:n("substring",i),split:n("split",i),trim:n("trim",i,0),regexp:o,test:n("test",o),if:function(s){s.length<3&&Le("Missing arguments to if function."),s.length>3&&Le("Too many arguments to if function.");const a=s.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function Amn(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function SYe(e){e=e||{};const t=e.allowed?kd(e.allowed):{},n=e.forbidden?kd(e.forbidden):{},r=e.constants||xYe,i=(e.functions||wYe)(f),o=e.globalvar,s=e.fieldvar,a=ln(o)?o:p=>`${o}["${p}"]`;let l={},c={},u=0;function f(p){if(ut(p))return p;const g=d[p.type];return g==null&&Le("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return u>0?g:Nt(n,g)?Le("Illegal identifier: "+g):Nt(r,g)?r[g]:Nt(t,g)?g:(l[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,v=f(p.object);g&&(u+=1);const y=f(p.property);return v===s&&(c[Amn(y)]=1),g&&(u-=1),v+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&Le("Illegal callee type: "+p.callee.type);const g=p.callee.name,v=p.arguments,y=Nt(i,g)&&i[g];return y||Le("Unrecognized function: "+g),ln(y)?y(v):y+"("+v.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{u+=1;const g=f(p.key);return u-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},g}return h.functions=i,h.constants=r,h}const TCe=Symbol("vega_selection_getter");function EYe(e){return(!e.getter||!e.getter[TCe])&&(e.getter=hf(e.field),e.getter[TCe]=!0),e.getter}const ude="intersect",PCe="union",Rmn="vlMulti",Dmn="vlPoint",ACe="or",Mmn="and",yh="_vgsid_",pA=hf(yh),Nmn="E",Imn="R",Lmn="R-E",jmn="R-LE",Fmn="R-RE",O4="index:unit";function RCe(e,t){for(var n=t.fields,r=t.values,i=n.length,o=0,s,a;o<i;++o)if(a=n[o],s=EYe(a)(e),t0(s)&&(s=$a(s)),t0(r[o])&&(r[o]=$a(r[o])),ze(r[o])&&t0(r[o][0])&&(r[o]=r[o].map($a)),a.type===Nmn){if(ze(r[o])?r[o].indexOf(s)<0:s!==r[o])return!1}else if(a.type===Imn){if(!Ww(s,r[o]))return!1}else if(a.type===Fmn){if(!Ww(s,r[o],!0,!1))return!1}else if(a.type===Lmn){if(!Ww(s,r[o],!1,!1))return!1}else if(a.type===jmn&&!Ww(s,r[o],!1,!0))return!1;return!0}function zmn(e,t,n){for(var r=this.context.data[e],i=r?r.values.value:[],o=r?r[O4]&&r[O4].value:void 0,s=n===ude,a=i.length,l=0,c,u,f,d,h;l<a;++l)if(c=i[l],o&&s){if(u=u||{},f=u[d=c.unit]||0,f===-1)continue;if(h=RCe(t,c),u[d]=h?-1:++f,h&&o.size===1)return!0;if(!h&&f===o.get(d).count)return!1}else if(h=RCe(t,c),s^h)return h;return a&&s}const CYe=f_(pA),Qmn=CYe.left,Bmn=CYe.right;function Wmn(e,t,n){const r=this.context.data[e],i=r?r.values.value:[],o=r?r[O4]&&r[O4].value:void 0,s=n===ude,a=pA(t),l=Qmn(i,a);if(l===i.length||pA(i[l])!==a)return!1;if(o&&s){if(o.size===1)return!0;if(Bmn(i,a)-l<o.size)return!1}return!0}function qmn(e,t){return e.map(n=>an(t.fields?{values:t.fields.map(r=>EYe(r)(n.datum))}:{[yh]:pA(n.datum)},t))}function Vmn(e,t,n,r){for(var i=this.context.data[e],o=i?i.values.value:[],s={},a={},l={},c,u,f,d,h,p,g,v,y,O,m=o.length,w=0,S,E;w<m;++w)if(c=o[w],d=c.unit,u=c.fields,f=c.values,u&&f){for(S=0,E=u.length;S<E;++S)h=u[S],g=s[h.field]||(s[h.field]={}),v=g[d]||(g[d]=[]),l[h.field]=y=h.type.charAt(0),O=NU[`${y}_union`],g[d]=O(v,ct(f[S]));n&&(v=a[d]||(a[d]=[]),v.push(ct(f).reduce((C,k,P)=>(C[u[P].field]=k,C),{})))}else h=yh,p=pA(c),g=s[h]||(s[h]={}),v=g[d]||(g[d]=[]),v.push(p),n&&(v=a[d]||(a[d]=[]),v.push({[yh]:p}));if(t=t||PCe,s[yh]?s[yh]=NU[`${yh}_${t}`](...Object.values(s[yh])):Object.keys(s).forEach(C=>{s[C]=Object.keys(s[C]).map(k=>s[C][k]).reduce((k,P)=>k===void 0?P:NU[`${l[C]}_${t}`](k,P))}),o=Object.keys(a),n&&o.length){const C=r?Dmn:Rmn;s[C]=t===PCe?{[ACe]:o.reduce((k,P)=>(k.push(...a[P]),k),[])}:{[Mmn]:o.map(k=>({[ACe]:a[k]}))}}return s}var NU={[`${yh}_union`]:aQt,[`${yh}_intersect`]:oQt,E_union:function(e,t){if(!e.length)return t;for(var n=0,r=t.length;n<r;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.indexOf(n)>=0):t},R_union:function(e,t){var n=$a(t[0]),r=$a(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<r&&(e[1]=r),e):[n,r]},R_intersect:function(e,t){var n=$a(t[0]),r=$a(t[1]);return n>r&&(n=t[1],r=t[0]),e.length?r<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>r&&(e[1]=r),e):[n,r]}};const Umn=":",Hmn="@";function fde(e,t,n,r){t[0].type!==bO&&Le("First argument to selection functions must be a string literal.");const i=t[0].value,o=t.length>=2&&jn(t).value,s="unit",a=Hmn+s,l=Umn+i;o===ude&&!Nt(r,a)&&(r[a]=n.getData(i).indataRef(n,s)),Nt(r,l)||(r[l]=n.getData(i).tuplesRef())}function _Ye(e){const t=this.context.data[e];return t?t.values.value:[]}function Xmn(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i&&i.count}function Zmn(e,t){const n=this.context.dataflow,r=this.context.data[e],i=r.input;return n.pulse(i,n.changeset().remove(pf).insert(t)),1}function Ymn(e,t,n){if(e){const r=this.context.dataflow,i=e.mark.source;r.pulse(i,r.changeset().encode(e,t))}return n!==void 0?n:e}const zD=e=>function(t,n){return this.context.dataflow.locale()[e](n)(t)},Gmn=zD("format"),kYe=zD("timeFormat"),Kmn=zD("utcFormat"),Jmn=zD("timeParse"),eyn=zD("utcParse"),hI=new Date(2e3,0,1);function X9(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(hI.setYear(2e3),hI.setMonth(e),hI.setDate(t),kYe.call(this,hI,n))}function tyn(e){return X9.call(this,e,1,"%B")}function nyn(e){return X9.call(this,e,1,"%b")}function ryn(e){return X9.call(this,0,2+e,"%A")}function iyn(e){return X9.call(this,0,2+e,"%a")}const oyn=":",syn="@",IJ="%",$Ye="$";function dde(e,t,n,r){t[0].type!==bO&&Le("First argument to data functions must be a string literal.");const i=t[0].value,o=oyn+i;if(!Nt(o,r))try{r[o]=n.getData(i).tuplesRef()}catch{}}function ayn(e,t,n,r){t[0].type!==bO&&Le("First argument to indata must be a string literal."),t[1].type!==bO&&Le("Second argument to indata must be a string literal.");const i=t[0].value,o=t[1].value,s=syn+o;Nt(s,r)||(r[s]=n.getData(i).indataRef(n,o))}function ml(e,t,n,r){if(t[0].type===bO)DCe(n,r,t[0].value);else for(e in n.scales)DCe(n,r,e)}function DCe(e,t,n){const r=IJ+n;if(!Nt(t,r))try{t[r]=e.scaleRef(n)}catch{}}function Tp(e,t){if(ln(e))return e;if(ut(e)){const n=t.scales[e];return n&&vsn(n.value)?n.value:void 0}}function lyn(e,t,n){t.__bandwidth=i=>i&&i.bandwidth?i.bandwidth():0,n._bandwidth=ml,n._range=ml,n._scale=ml;const r=i=>"_["+(i.type===bO?Je(IJ+i.value):Je(IJ)+"+"+e(i))+"]";return{_bandwidth:i=>`this.__bandwidth(${r(i[0])})`,_range:i=>`${r(i[0])}.range()`,_scale:i=>`${r(i[0])}(${e(i[1])})`}}function hde(e,t){return function(n,r,i){if(n){const o=Tp(n,(i||this).context);return o&&o.path[e](r)}else return t(r)}}const cyn=hde("area",Dun),uyn=hde("bounds",Lun),fyn=hde("centroid",Wun);function dyn(e,t){const n=Tp(e,(t||this).context);return n&&n.scale()}function hyn(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function pde(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(r){e.warn(r)}return n[n.length-1]}function pyn(){return pde(this.context.dataflow,"warn",arguments)}function gyn(){return pde(this.context.dataflow,"info",arguments)}function myn(){return pde(this.context.dataflow,"debug",arguments)}function IU(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function LJ(e){const t=V0(e),n=IU(t.r),r=IU(t.g),i=IU(t.b);return .2126*n+.7152*r+.0722*i}function yyn(e,t){const n=LJ(e),r=LJ(t),i=Math.max(n,r),o=Math.min(n,r);return(i+.05)/(o+.05)}function vyn(){const e=[].slice.call(arguments);return e.unshift({}),an(...e)}function TYe(e,t){return e===t||e!==e&&t!==t?!0:ze(e)?ze(t)&&e.length===t.length?byn(e,t):!1:dt(e)&&dt(t)?PYe(e,t):!1}function byn(e,t){for(let n=0,r=e.length;n<r;++n)if(!TYe(e[n],t[n]))return!1;return!0}function PYe(e,t){for(const n in e)if(!TYe(e[n],t[n]))return!1;return!0}function MCe(e){return t=>PYe(e,t)}function Oyn(e,t,n,r,i,o){const s=this.context.dataflow,a=this.context.data[e],l=a.input,c=s.stamp();let u=a.changes,f,d;if(s._trigger===!1||!(l.value.length||t||r))return 0;if((!u||u.stamp<c)&&(a.changes=u=s.changeset(),u.stamp=c,s.runAfter(()=>{a.modified=!0,s.pulse(l,u).run()},!0,1)),n&&(f=n===!0?pf:ze(n)||t9(n)?n:MCe(n),u.remove(f)),t&&u.insert(t),r&&(f=MCe(r),l.value.some(f)?u.remove(f):u.insert(r)),i)for(d in o)u.modify(i,d,o[d]);return 1}function xyn(e){const t=e.touches,n=t[0].clientX-t[1].clientX,r=t[0].clientY-t[1].clientY;return Math.hypot(n,r)}function wyn(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const NCe={};function Syn(e,t){const n=NCe[t]||(NCe[t]=hf(t));return ze(e)?e.map(n):n(e)}function gde(e){return ze(e)||ArrayBuffer.isView(e)?e:null}function mde(e){return gde(e)||(ut(e)?e:null)}function Eyn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return gde(e).join(...n)}function Cyn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return mde(e).indexOf(...n)}function _yn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return mde(e).lastIndexOf(...n)}function kyn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return mde(e).slice(...n)}function $yn(e,t,n){return ln(n)&&Le("Function argument passed to replace."),String(e).replace(t,n)}function Tyn(e){return gde(e).slice().reverse()}function Pyn(e,t,n){return Cue(e||0,t||0,n||0)}function Ayn(e,t){const n=Tp(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function Ryn(e,t){const n=Tp(e,(t||this).context);return n?n.copy():void 0}function Dyn(e,t){const n=Tp(e,(t||this).context);return n?n.domain():[]}function Myn(e,t,n){const r=Tp(e,(n||this).context);return r?ze(t)?(r.invertRange||r.invert)(t):(r.invert||r.invertExtent)(t):void 0}function Nyn(e,t){const n=Tp(e,(t||this).context);return n&&n.range?n.range():[]}function Iyn(e,t,n){const r=Tp(e,(n||this).context);return r?r(t):void 0}function Lyn(e,t,n,r,i){e=Tp(e,(i||this).context);const o=_He(t,n);let s=e.domain(),a=s[0],l=jn(s),c=Ba;return l-a?c=pHe(e,a,l):e=(e.interpolator?tr("sequential")().interpolator(e.interpolator()):tr("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,l=1]),e.ticks&&(s=e.ticks(+r||15),a!==s[0]&&s.unshift(a),l!==jn(s)&&s.push(l)),s.forEach(u=>o.stop(c(u),e(u))),o}function jyn(e,t,n){const r=Tp(e,(n||this).context);return function(i){return r?r.path.context(i)(t):""}}function Fyn(e){let t=null;return function(n){return n?tA(n,t=t||QE(e)):e}}const AYe=e=>e.data;function RYe(e,t){const n=_Ye.call(t,e);return n.root&&n.root.lookup||{}}function zyn(e,t,n){const r=RYe(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(AYe):void 0}function Qyn(e,t){const n=RYe(e,this)[t];return n?n.ancestors().map(AYe):void 0}const DYe=()=>typeof window<"u"&&window||null;function Byn(){const e=DYe();return e?e.screen:{}}function Wyn(){const e=DYe();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function qyn(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function MYe(e,t,n){if(!e)return[];const[r,i]=e,o=new Po().set(r[0],r[1],i[0],i[1]),s=n||this.context.dataflow.scenegraph().root;return bXe(s,o,Vyn(t))}function Vyn(e){let t=null;if(e){const n=ct(e.marktype),r=ct(e.markname);t=i=>(!n.length||n.some(o=>i.marktype===o))&&(!r.length||r.some(o=>i.name===o))}return t}function Uyn(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=ct(e);const i=e[e.length-1];return i===void 0||Math.hypot(i[0]-t,i[1]-n)>r?[...e,[t,n]]:e}function Hyn(e){return ct(e).reduce((t,n,r)=>{let[i,o]=n;return t+=r==0?`M ${i},${o} `:r===e.length-1?" Z":`L ${i},${o} `},"")}function Xyn(e,t,n){const{x:r,y:i,mark:o}=n,s=new Po().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[l,c]of t)l<s.x1&&(s.x1=l),l>s.x2&&(s.x2=l),c<s.y1&&(s.y1=c),c>s.y2&&(s.y2=c);return s.translate(r,i),MYe([[s.x1,s.y1],[s.x2,s.y2]],e,o).filter(l=>Zyn(l.x,l.y,t))}function Zyn(e,t,n){let r=0;for(let i=0,o=n.length-1;i<n.length;o=i++){const[s,a]=n[o],[l,c]=n[i];c>t!=a>t&&e<(s-l)*(t-c)/(a-c)+l&&r++}return r&1}const gA={random(){return vf()},cumulativeNormal:s9,cumulativeLogNormal:Ece,cumulativeUniform:$ce,densityNormal:bce,densityLogNormal:Sce,densityUniform:kce,quantileNormal:a9,quantileLogNormal:Cce,quantileUniform:Tce,sampleNormal:o9,sampleLogNormal:wce,sampleUniform:_ce,isArray:ze,isBoolean:_v,isDate:t0,isDefined(e){return e!==void 0},isNumber:Hn,isObject:dt,isRegExp:x8e,isString:ut,isTuple:t9,isValid(e){return e!=null&&e===e},toBoolean:$ae,toDate(e){return Tae(e)},toNumber:$a,toString:Pae,indexof:Cyn,join:Eyn,lastindexof:_yn,replace:$yn,reverse:Tyn,slice:kyn,flush:b8e,lerp:w8e,merge:vyn,pad:C8e,peek:jn,pluck:Syn,span:eD,inrange:Ww,truncate:_8e,rgb:V0,lab:$F,hcl:TF,hsl:_F,luminance:LJ,contrast:yyn,sequence:Qc,format:Gmn,utcFormat:Kmn,utcParse:eyn,utcOffset:o9e,utcSequence:l9e,timeFormat:kYe,timeParse:Jmn,timeOffset:i9e,timeSequence:a9e,timeUnitSpecifier:H8e,monthFormat:tyn,monthAbbrevFormat:nyn,dayFormat:ryn,dayAbbrevFormat:iyn,quarter:g8e,utcquarter:m8e,week:Z8e,utcweek:K8e,dayofyear:X8e,utcdayofyear:G8e,warn:pyn,info:gyn,debug:myn,extent(e){return rp(e)},inScope:hyn,intersect:MYe,clampRange:y8e,pinchDistance:xyn,pinchAngle:wyn,screen:Byn,containerSize:qyn,windowSize:Wyn,bandspace:Pyn,setdata:Zmn,pathShape:Fyn,panLinear:f8e,panLog:d8e,panPow:h8e,panSymlog:p8e,zoomLinear:wae,zoomLog:Sae,zoomPow:S3,zoomSymlog:Eae,encode:Ymn,modify:Oyn,lassoAppend:Uyn,lassoPath:Hyn,intersectLasso:Xyn},Yyn=["view","item","group","xy","x","y"],Gyn="event.vega.",NYe="this.",yde={},IYe={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${Je($Ye+e)}]`,functions:Kyn,constants:xYe,visitors:yde},jJ=SYe(IYe);function Kyn(e){const t=wYe(e);Yyn.forEach(n=>t[n]=Gyn+n);for(const n in gA)t[n]=NYe+n;return an(t,lyn(e,gA,yde)),t}function po(e,t,n){return arguments.length===1?gA[e]:(gA[e]=t,n&&(yde[e]=n),jJ&&(jJ.functions[e]=NYe+e),this)}po("bandwidth",Ayn,ml);po("copy",Ryn,ml);po("domain",Dyn,ml);po("range",Nyn,ml);po("invert",Myn,ml);po("scale",Iyn,ml);po("gradient",Lyn,ml);po("geoArea",cyn,ml);po("geoBounds",uyn,ml);po("geoCentroid",fyn,ml);po("geoShape",jyn,ml);po("geoScale",dyn,ml);po("indata",Xmn,ayn);po("data",_Ye,dde);po("treePath",zyn,dde);po("treeAncestors",Qyn,dde);po("vlSelectionTest",zmn,fde);po("vlSelectionIdTest",Wmn,fde);po("vlSelectionResolve",Vmn,fde);po("vlSelectionTuples",qmn);function cp(e,t){const n={};let r;try{e=ut(e)?e:Je(e)+"",r=cde(e)}catch{Le("Expression parse error: "+e)}r.visit(o=>{if(o.type!==pYe)return;const s=o.callee.name,a=IYe.visitors[s];a&&a(s,o.arguments,t,n)});const i=jJ(r);return i.globals.forEach(o=>{const s=$Ye+o;!Nt(n,s)&&t.getSignal(o)&&(n[s]=t.signalRef(o))}),{$expr:an({code:i.code},t.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}function Jyn(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(r=>t.parseOperator(r)),n.forEach(r=>t.parseOperatorParameters(r)),(e.streams||[]).forEach(r=>t.parseStream(r)),(e.updates||[]).forEach(r=>t.parseUpdate(r)),t.resolve()}const e0n=kd(["rule"]),ICe=kd(["group","image","rect"]);function t0n(e,t){let n="";return e0n[t]||(e.x2&&(e.x?(ICe[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(ICe[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function vde(e){return(e+"").toLowerCase()}function n0n(e){return vde(e)==="operator"}function r0n(e){return vde(e)==="collect"}function Qk(e,t,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}function i0n(e,t,n,r){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
  : (u > v || v == null) && u != null ? ${r}
  : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}
  : v !== v && u === u ? ${r} : `}var o0n={operator:(e,t)=>Qk(e,["_"],t.code),parameter:(e,t)=>Qk(e,["datum","_"],t.code),event:(e,t)=>Qk(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return Qk(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:r}=t;let i="var o=item,datum=o.datum,m=0,$;";for(const o in r){const s="o["+Je(o)+"]";i+=`$=${r[o].code};if(${s}!==$)${s}=$,m=1;`}return i+=t0n(r,n),i+="return m;",Qk(e,["item","_"],i)},codegen:{get(e){const t=`[${e.map(Je).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const r=(o,s)=>{const a=t[s];let l,c;return o.path?(l=`a${o.path}`,c=`b${o.path}`):((n=n||{})["f"+s]=o,l=`this.f${s}(a)`,c=`this.f${s}(b)`),i0n(l,c,-a,a)},i=Function("a","b","var u, v; return "+e.map(r).join("")+"0;");return n?i.bind(n):i}}};function s0n(e){const t=this;n0n(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function a0n(e){const t=this;if(e.params){const n=t.get(e.id);n||Le("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function l0n(e,t){t=t||{};const n=this;for(const r in e){const i=e[r];t[r]=ze(i)?i.map(o=>LCe(o,n,t)):LCe(i,n,t)}return t}function LCe(e,t,n){if(!e||!dt(e))return e;for(let r=0,i=jCe.length,o;r<i;++r)if(o=jCe[r],Nt(e,o.key))return o.parse(e,t,n);return e}var jCe=[{key:"$ref",parse:c0n},{key:"$key",parse:f0n},{key:"$expr",parse:u0n},{key:"$field",parse:d0n},{key:"$encode",parse:p0n},{key:"$compare",parse:h0n},{key:"$context",parse:g0n},{key:"$subflow",parse:m0n},{key:"$tupleid",parse:y0n}];function c0n(e,t){return t.get(e.$ref)||Le("Operator not defined: "+e.$ref)}function u0n(e,t,n){e.$params&&t.parseParameters(e.$params,n);const r="e:"+e.$expr.code;return t.fn[r]||(t.fn[r]=yc(t.parameterExpression(e.$expr),e.$fields))}function f0n(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=kae(e.$key,e.$flat,t.expr.codegen))}function d0n(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=hf(e.$field,e.$name,t.expr.codegen))}function h0n(e,t){const n="c:"+e.$compare+"_"+e.$order,r=ct(e.$compare).map(i=>i&&i.$tupleid?Dt:i);return t.fn[n]||(t.fn[n]=Cae(r,e.$order,t.expr.codegen))}function p0n(e,t){const n=e.$encode,r={};for(const i in n){const o=n[i];r[i]=yc(t.encodeExpression(o.$expr),o.$fields),r[i].output=o.$output}return r}function g0n(e,t){return t}function m0n(e,t){const n=e.$subflow;return function(r,i,o){const s=t.fork().parse(n),a=s.get(n.operators[0].id),l=s.signals.parent;return l&&l.set(o),a.detachSubflow=()=>t.detach(s),a}}function y0n(){return Dt}function v0n(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,r=e.stream!=null?t.get(e.stream):void 0,i;e.source?r=t.events(e.source,e.type,n):e.merge&&(i=e.merge.map(o=>t.get(o)),r=i[0].merge.apply(i[0],i.slice(1))),e.between&&(i=e.between.map(o=>t.get(o)),r=r.between(i[0],i[1])),e.filter&&(r=r.filter(n)),e.throttle!=null&&(r=r.throttle(+e.throttle)),e.debounce!=null&&(r=r.debounce(+e.debounce)),r==null&&Le("Invalid stream definition: "+JSON.stringify(e)),e.consume&&r.consume(!0),t.stream(e,r)}function b0n(e){var t=this,n=dt(n=e.source)?n.$ref:n,r=t.get(n),i=null,o=e.update,s=void 0;r||Le("Source not defined: "+e.source),i=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),o&&o.$expr&&(o.$params&&(s=t.parseParameters(o.$params)),o=t.handlerExpression(o.$expr)),t.update(e,r,i,o,s)}const O0n={skip:!0};function x0n(e){var t=this,n={};if(e.signals){var r=n.signals={};Object.keys(t.signals).forEach(o=>{const s=t.signals[o];e.signals(o,s)&&(r[o]=s.value)})}if(e.data){var i=n.data={};Object.keys(t.data).forEach(o=>{const s=t.data[o];e.data(o,s)&&(i[o]=s.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(o=>o.getState(e))),n}function w0n(e){var t=this,n=t.dataflow,r=e.data,i=e.signals;Object.keys(i||{}).forEach(o=>{n.update(t.signals[o],i[o],O0n)}),Object.keys(r||{}).forEach(o=>{n.pulse(t.data[o].input,n.changeset().remove(pf).insert(r[o]))}),(e.subcontext||[]).forEach((o,s)=>{const a=t.subcontext[s];a&&a.setState(o)})}function LYe(e,t,n,r){return new jYe(e,t,n,r)}function jYe(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||o0n,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function FCe(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}jYe.prototype=FCe.prototype={fork(){const e=new FCe(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,r=n.dataflow,i=e.value;if(n.set(e.id,t),r0n(e.type)&&i&&(i.$ingest?r.ingest(t,i.$ingest,i.$format):i.$request?r.preload(t,i.$request,i.$format):r.pulse(t,r.changeset().insert(i))),e.root&&(n.root=t),e.parent){let o=n.get(e.parent.$ref);o?(r.connect(o,[t]),t.targets().add(o)):(n.unresolved=n.unresolved||[]).push(()=>{o=n.get(e.parent.$ref),r.connect(o,[t]),t.targets().add(o)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const o in e.data){const s=n.data[o]||(n.data[o]={});e.data[o].forEach(a=>s[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[vde(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:Jyn,parseOperator:s0n,parseOperatorParameters:a0n,parseParameters:l0n,parseStream:v0n,parseUpdate:b0n,getState:x0n,setState:w0n};function S0n(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),FYe(t,e.description()))}function FYe(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function E0n(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const LU="default";function C0n(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:LU,item:null}));e.on(e.events("view","pointermove"),t,(n,r)=>{const i=t.value,o=i?ut(i)?i:i.user:LU,s=r.item&&r.item.cursor||null;return i&&o===i.user&&s==i.item?i:{user:o,item:s}}),e.add(null,function(n){let r=n.cursor,i=this.value;return ut(r)||(i=r.item,r=r.user),FJ(e,r&&r!==LU?r:i||r),i},{cursor:t})}function FJ(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function x4(e,t){var n=e._runtime.data;return Nt(n,t)||Le("Unrecognized data set: "+t),n[t]}function _0n(e,t){return arguments.length<2?x4(this,e).values.value:Z9.call(this,e,sx().remove(pf).insert(t))}function Z9(e,t){oVe(t)||Le("Second argument to changes must be a changeset.");const n=x4(this,e);return n.modified=!0,this.pulse(n.input,t)}function k0n(e,t){return Z9.call(this,e,sx().insert(t))}function $0n(e,t){return Z9.call(this,e,sx().remove(t))}function zYe(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function QYe(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function Y9(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function T0n(e){var t=Y9(e),n=zYe(e),r=QYe(e);e._renderer.background(e.background()),e._renderer.resize(n,r,t),e._handler.origin(t),e._resizeListeners.forEach(i=>{try{i(n,r)}catch(o){e.error(o)}})}function P0n(e,t,n){var r=e._renderer,i=r&&r.canvas(),o,s,a;return i&&(a=Y9(e),s=t.changedTouches?t.changedTouches[0]:t,o=M9(s,i),o[0]-=a[0],o[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=A0n(e,n,o),t}function A0n(e,t,n){const r=t?t.mark.marktype==="group"?t:t.mark.group:null;function i(s){var a=r,l;if(s){for(l=t;l;l=l.mark.group)if(l.mark.name===s){a=l;break}}return a&&a.mark&&a.mark.interactive?a:{}}function o(s){if(!s)return n;ut(s)&&(s=i(s));const a=n.slice();for(;s;)a[0]-=s.x||0,a[1]-=s.y||0,s=s.mark&&s.mark.group;return a}return{view:Wa(e),item:Wa(t||{}),group:i,xy:o,x:s=>o(s)[0],y:s=>o(s)[1]}}const zCe="view",R0n="timer",D0n="window",M0n={trap:!1};function N0n(e){const t=an({defaults:{}},e),n=(r,i)=>{i.forEach(o=>{ze(r[o])&&(r[o]=kd(r[o]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function BYe(e,t,n,r){e._eventListeners.push({type:n,sources:ct(t),handler:r})}function I0n(e,t){var n=e._eventConfig.defaults,r=n.prevent,i=n.allow;return r===!1||i===!0?!1:r===!0||i===!1?!0:r?r[t]:i?!i[t]:e.preventDefault()}function pI(e,t,n){const r=e._eventConfig&&e._eventConfig[t];return r===!1||dt(r)&&!r[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function L0n(e,t,n){var r=this,i=new i9(n),o=function(c,u){r.runAsync(null,()=>{e===zCe&&I0n(r,t)&&c.preventDefault(),i.receive(P0n(r,c,u))})},s;if(e===R0n)pI(r,"timer",t)&&r.timer(o,t);else if(e===zCe)pI(r,"view",t)&&r.addEventListener(t,o,M0n);else if(e===D0n?pI(r,"window",t)&&typeof window<"u"&&(s=[window]):typeof document<"u"&&pI(r,"selector",t)&&(s=Array.from(document.querySelectorAll(e))),!s)r.warn("Can not resolve event source: "+e);else{for(var a=0,l=s.length;a<l;++a)s[a].addEventListener(t,o);BYe(r,s,t,o)}return i}function QCe(e){return e.item}function BCe(e){return e.item.mark.source}function WCe(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function j0n(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",QCe),BCe,WCe(e)),this.on(this.events("view","pointerout",QCe),BCe,WCe(t)),this}function F0n(){var e=this._tooltip,t=this._timers,n=this._eventListeners,r,i,o;for(r=t.length;--r>=0;)t[r].stop();for(r=n.length;--r>=0;)for(o=n[r],i=o.sources.length;--i>=0;)o.sources[i].removeEventListener(o.type,o.handler);return e&&e.call(this,this._handler,null,null,null),this}function Kc(e,t,n){const r=document.createElement(e);for(const i in t)r.setAttribute(i,t[i]);return n!=null&&(r.textContent=n),r}const z0n="vega-bind",Q0n="vega-bind-name",B0n="vega-bind-radio";function W0n(e,t,n){if(!t)return;const r=n.param;let i=n.state;return i||(i=n.state={elements:null,active:!1,set:null,update:s=>{s!=e.signal(r.signal)&&e.runAsync(null,()=>{i.source=!0,e.signal(r.signal,s)})}},r.debounce&&(i.update=_ae(r.debounce,i.update))),(r.input==null&&r.element?q0n:U0n)(i,t,r,e),i.active||(e.on(e._signals[r.signal],null,()=>{i.source?i.source=!1:i.set(e.signal(r.signal))}),i.active=!0),i}function q0n(e,t,n,r){const i=n.event||"input",o=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,o),BYe(r,t,i,o),e.set=s=>{t.value=s,t.dispatchEvent(V0n(i))}}function V0n(e){return typeof Event<"u"?new Event(e):{type:e}}function U0n(e,t,n,r){const i=r.signal(n.signal),o=Kc("div",{class:z0n}),s=n.input==="radio"?o:o.appendChild(Kc("label"));s.appendChild(Kc("span",{class:Q0n},n.name||n.signal)),t.appendChild(o);let a=H0n;switch(n.input){case"checkbox":a=X0n;break;case"select":a=Z0n;break;case"radio":a=Y0n;break;case"range":a=G0n;break}a(e,s,n,i)}function H0n(e,t,n,r){const i=Kc("input");for(const o in n)o!=="signal"&&o!=="element"&&i.setAttribute(o==="input"?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",()=>e.update(i.value)),e.elements=[i],e.set=o=>i.value=o}function X0n(e,t,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=Kc("input",i);t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=s=>o.checked=!!s||null}function Z0n(e,t,n,r){const i=Kc("select",{name:n.signal}),o=n.labels||[];n.options.forEach((s,a)=>{const l={value:s};w4(s,r)&&(l.selected=!0),i.appendChild(Kc("option",l,(o[a]||s)+""))}),t.appendChild(i),i.addEventListener("change",()=>{e.update(n.options[i.selectedIndex])}),e.elements=[i],e.set=s=>{for(let a=0,l=n.options.length;a<l;++a)if(w4(n.options[a],s)){i.selectedIndex=a;return}}}function Y0n(e,t,n,r){const i=Kc("span",{class:B0n}),o=n.labels||[];t.appendChild(i),e.elements=n.options.map((s,a)=>{const l={type:"radio",name:n.signal,value:s};w4(s,r)&&(l.checked=!0);const c=Kc("input",l);c.addEventListener("change",()=>e.update(s));const u=Kc("label",{},(o[a]||s)+"");return u.prepend(c),i.appendChild(u),c}),e.set=s=>{const a=e.elements,l=a.length;for(let c=0;c<l;++c)w4(a[c].value,s)&&(a[c].checked=!0)}}function G0n(e,t,n,r){r=r!==void 0?r:(+n.max+ +n.min)/2;const i=n.max!=null?n.max:Math.max(100,+r)||100,o=n.min||Math.min(0,i,+r)||0,s=n.step||z0(o,i,100),a=Kc("input",{type:"range",name:n.signal,min:o,max:i,step:s});a.value=r;const l=Kc("span",{},+r);t.appendChild(a),t.appendChild(l);const c=()=>{l.textContent=a.value,e.update(+a.value)};a.addEventListener("input",c),a.addEventListener("change",c),e.elements=[a],e.set=u=>{a.value=u,l.textContent=u}}function w4(e,t){return e===t||e+""==t+""}function WYe(e,t,n,r,i,o){return t=t||new r(e.loader()),t.initialize(n,zYe(e),QYe(e),Y9(e),i,o).background(e.background())}function bde(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function K0n(e,t,n,r){const i=new r(e.loader(),bde(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,Y9(e),e);return t&&t.handlers().forEach(o=>{i.on(o.type,o.handler)}),i}function J0n(e,t){const n=this,r=n._renderType,i=n._eventConfig.bind,o=I9(r);e=n._el=e?jU(n,e,!0):null,S0n(n),o||n.error("Unrecognized renderer type: "+r);const s=o.handler||Y0,a=e?o.renderer:o.headless;return n._renderer=a?WYe(n,n._renderer,e,a):null,n._handler=K0n(n,n._handler,e,s),n._redraw=!0,e&&i!=="none"&&(t=t?n._elBind=jU(n,t,!0):e.appendChild(Kc("form",{class:"vega-bindings"})),n._bind.forEach(l=>{l.param.element&&i!=="container"&&(l.element=jU(n,l.param.element,!!l.param.input))}),n._bind.forEach(l=>{W0n(n,l.element||t,l)})),n}function jU(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(r){t=null,e.error(r)}return t}const Bk=e=>+e||0,evn=e=>({top:e,bottom:e,left:e,right:e});function qCe(e){return dt(e)?{top:Bk(e.top),bottom:Bk(e.bottom),left:Bk(e.left),right:Bk(e.right)}:evn(Bk(e))}async function Ode(e,t,n,r){const i=I9(t),o=i&&i.headless;return o||Le("Unrecognized renderer type: "+t),await e.runAsync(),WYe(e,null,null,o,n,r).renderAsync(e._scenegraph.root)}async function tvn(e,t){e!==Ny.Canvas&&e!==Ny.SVG&&e!==Ny.PNG&&Le("Unrecognized image type: "+e);const n=await Ode(this,e,t);return e===Ny.SVG?nvn(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function nvn(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function rvn(e,t){return(await Ode(this,Ny.Canvas,e,t)).canvas()}async function ivn(e){return(await Ode(this,Ny.SVG,e)).svg()}function ovn(e,t,n){return LYe(e,NE,gA,n).parse(t)}function svn(e){var t=this._runtime.scales;return Nt(t,e)||Le("Unrecognized scale or projection: "+e),t[e].value}var qYe="width",VYe="height",xde="padding",VCe={skip:!0};function UYe(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===xde?r.left+r.right:0)}function HYe(e,t){var n=e.autosize(),r=e.padding();return t-(n&&n.contains===xde?r.top+r.bottom:0)}function avn(e){var t=e._signals,n=t[qYe],r=t[VYe],i=t[xde];function o(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=UYe(e,a.size),o()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=HYe(e,a.size),o()},{size:r});const s=e.add(null,o,{pad:i});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=r.rank+1,s.rank=i.rank+1}function lvn(e,t,n,r,i,o){this.runAfter(s=>{let a=0;s._autosize=0,s.width()!==n&&(a=1,s.signal(qYe,n,VCe),s._resizeWidth.skip(!0)),s.height()!==r&&(a=1,s.signal(VYe,r,VCe),s._resizeHeight.skip(!0)),s._viewWidth!==e&&(s._resize=1,s._viewWidth=e),s._viewHeight!==t&&(s._resize=1,s._viewHeight=t),(s._origin[0]!==i[0]||s._origin[1]!==i[1])&&(s._resize=1,s._origin=i),a&&s.run("enter"),o&&s.runAfter(l=>l.resize())},!1,1)}function cvn(e){return this._runtime.getState(e||{data:uvn,signals:fvn,recurse:!0})}function uvn(e,t){return t.modified&&ze(t.input.value)&&!e.startsWith("_:vega:_")}function fvn(e,t){return!(e==="parent"||t instanceof NE.proxy)}function dvn(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function hvn(e,t){function n(r){e({timestamp:Date.now(),elapsed:r})}this._timers.push(qdn(n,t))}function pvn(e,t,n,r){const i=e.element();i&&i.setAttribute("title",gvn(r))}function gvn(e){return e==null?"":ze(e)?XYe(e):dt(e)&&!t0(e)?mvn(e):e+""}function mvn(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(ze(n)?XYe(n):ZYe(n))}).join(`
`)}function XYe(e){return"["+e.map(ZYe).join(", ")+"]"}function ZYe(e){return ze(e)?"[…]":dt(e)&&!t0(e)?"{…}":e}function yvn(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function YYe(e,t){const n=this;if(t=t||{},MS.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const o=an({},e.locale,t.locale);n.locale(C9e(o.number,o.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Ny.Canvas,n._scenegraph=new tfe;const r=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||pvn,n._redraw=!0,n._handler=new Y0().scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=N0n(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=ovn(n,e,t.expr);n._runtime=i,n._signals=i.signals,n._bind=(e.bindings||[]).map(o=>({state:null,param:an({},o)})),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=UYe(n,n._width),n._viewHeight=HYe(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,avn(n),E0n(n),C0n(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function gI(e,t){return Nt(e._signals,t)?e._signals[t]:Le("Unrecognized signal name: "+Je(t))}function GYe(e,t){const n=(e._targets||[]).filter(r=>r._update&&r._update.handler===t);return n.length?n[0]:null}function UCe(e,t,n,r){let i=GYe(n,r);return i||(i=bde(e,()=>r(t,n.value)),i.handler=r,e.on(n,null,i)),e}function HCe(e,t,n){const r=GYe(t,n);return r&&t._targets.remove(r),e}Ke(YYe,MS,{async evaluate(e,t,n){if(await MS.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,T0n(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(r){this.error(r)}return n&&nL(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&FYe(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const r=gI(this,e);return arguments.length===1?r.value:this.update(r,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",qCe(e)):qCe(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(I9(e)||Le("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(MS.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(gI(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:lvn,addEventListener(e,t,n){let r=t;return n&&n.trap===!1||(r=bde(this,t),r.raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),r=n.length,i,o;--r>=0;)if(o=n[r].type,i=n[r].handler,e===o&&(t===i||t===i.raw)){this._handler.off(o,i);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return UCe(this,e,gI(this,e),t)},removeSignalListener(e,t){return HCe(this,gI(this,e),t)},addDataListener(e,t){return UCe(this,e,x4(this,e).values,t)},removeDataListener(e,t){return HCe(this,x4(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=FJ(this,null);this._globalCursor=!!e,t&&FJ(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:hvn,events:L0n,finalize:F0n,hover:j0n,data:_0n,change:Z9,insert:k0n,remove:$0n,scale:svn,initialize:J0n,toImageURL:tvn,toCanvas:rvn,toSVG:ivn,getState:cvn,setState:dvn,_watchPixelRatio:yvn});const vvn="view",S4="[",E4="]",KYe="{",JYe="}",bvn=":",eGe=",",Ovn="@",xvn=">",wvn=/[[\]{}]/,Svn={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let tGe,nGe;function Nv(e,t,n){return tGe=t||vvn,nGe=n||Svn,rGe(e.trim()).map(zJ)}function Evn(e){return nGe[e]}function r2(e,t,n,r,i){const o=e.length;let s=0,a;for(;t<o;++t){if(a=e[t],!s&&a===n)return t;i&&i.indexOf(a)>=0?--s:r&&r.indexOf(a)>=0&&++s}return t}function rGe(e){const t=[],n=e.length;let r=0,i=0;for(;i<n;)i=r2(e,i,eGe,S4+KYe,E4+JYe),t.push(e.substring(r,i).trim()),r=++i;if(t.length===0)throw"Empty event selector: "+e;return t}function zJ(e){return e[0]==="["?Cvn(e):_vn(e)}function Cvn(e){const t=e.length;let n=1,r;if(n=r2(e,n,E4,S4,E4),n===t)throw"Empty between selector: "+e;if(r=rGe(e.substring(1,n)),r.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==xvn)throw"Expected '>' after between selector: "+e;r=r.map(zJ);const i=zJ(e.slice(1).trim());return i.between?{between:r,stream:i}:(i.between=r,i)}function _vn(e){const t={source:tGe},n=[];let r=[0,0],i=0,o=0,s=e.length,a=0,l,c;if(e[s-1]===JYe){if(a=e.lastIndexOf(KYe),a>=0){try{r=kvn(e.substring(a+1,s-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),s=e.length}else throw"Unmatched right brace: "+e;a=0}if(!s)throw e;if(e[0]===Ovn&&(i=++a),l=r2(e,a,bvn),l<s&&(n.push(e.substring(o,l).trim()),o=a=++l),a=r2(e,a,S4),a===s)n.push(e.substring(o,s).trim());else if(n.push(e.substring(o,a).trim()),c=[],o=++a,o===s)throw"Unmatched left bracket: "+e;for(;a<s;){if(a=r2(e,a,E4),a===s)throw"Unmatched left bracket: "+e;if(c.push(e.substring(o,a).trim()),a<s-1&&e[++a]!==S4)throw"Expected left bracket: "+e;o=++a}if(!(s=n.length)||wvn.test(n[s-1]))throw"Invalid event selector: "+e;return s>1?(t.type=n[1],i?t.markname=n[0].slice(1):Evn(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),c!=null&&(t.filter=c),r[0]&&(t.throttle=r[0]),r[1]&&(t.debounce=r[1]),t}function kvn(e){const t=e.split(eGe);if(!e.length||t.length>2)throw e;return t.map(n=>{const r=+n;if(r!==r)throw e;return r})}function $vn(e){return dt(e)?e:{type:e||"pad"}}const Wk=e=>+e||0,Tvn=e=>({top:e,bottom:e,left:e,right:e});function Pvn(e){return dt(e)?e.signal?e:{top:Wk(e.top),bottom:Wk(e.bottom),left:Wk(e.left),right:Wk(e.right)}:Tvn(Wk(e))}const ds=e=>dt(e)&&!ze(e)?an({},e):{value:e};function XCe(e,t,n,r){return n!=null?(dt(n)&&!ze(n)||ze(n)&&n.length&&dt(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n},1):0}function Ys(e,t,n){for(const r in t)XCe(e,r,t[r]);for(const r in n)XCe(e,r,n[r],"update")}function P_(e,t,n){for(const r in t)n&&Nt(n,r)||(e[r]=an(e[r]||{},t[r]));return e}function Cw(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const wde="mark",Sde="frame",Ede="scope",Avn="axis",Rvn="axis-domain",Dvn="axis-grid",Mvn="axis-label",Nvn="axis-tick",Ivn="axis-title",Lvn="legend",jvn="legend-band",Fvn="legend-entry",zvn="legend-gradient",iGe="legend-label",Qvn="legend-symbol",Bvn="legend-title",Wvn="title",qvn="title-text",Vvn="title-subtitle";function Uvn(e,t,n,r,i){const o={},s={};let a,l,c,u;l="lineBreak",t==="text"&&i[l]!=null&&!Cw(l,e)&&FU(o,l,i[l]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),u=n===Sde?i.group:n===wde?an({},i.mark,i[t]):null;for(l in u)c=Cw(l,e)||(l==="fill"||l==="stroke")&&(Cw("fill",e)||Cw("stroke",e)),c||FU(o,l,u[l]);ct(r).forEach(f=>{const d=i.style&&i.style[f];for(const h in d)Cw(h,e)||FU(o,h,d[h])}),e=an({},e);for(l in o)u=o[l],u.signal?(a=a||{})[l]=u:s[l]=u;return e.enter=an(s,e.enter),a&&(e.update=an(a,e.update)),e}function FU(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const oGe=e=>ut(e)?Je(e):e.signal?`(${e.signal})`:sGe(e);function G9(e){if(e.gradient!=null)return Xvn(e);let t=e.signal?`(${e.signal})`:e.color?Hvn(e.color):e.field!=null?sGe(e.field):e.value!==void 0?Je(e.value):void 0;return e.scale!=null&&(t=Zvn(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${bL(e.exponent)})`),e.mult!=null&&(t+=`*${bL(e.mult)}`),e.offset!=null&&(t+=`+${bL(e.offset)}`),e.round&&(t=`round(${t})`),t}const mI=(e,t,n,r)=>`(${e}(${[t,n,r].map(G9).join(",")})+'')`;function Hvn(e){return e.c?mI("hcl",e.h,e.c,e.l):e.h||e.s?mI("hsl",e.h,e.s,e.l):e.l||e.a?mI("lab",e.l,e.a,e.b):e.r||e.g||e.b?mI("rgb",e.r,e.g,e.b):null}function Xvn(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:Je(n));for(;t.length&&jn(t)==null;)t.pop();return t.unshift(oGe(e.gradient)),`gradient(${t.join(",")})`}function bL(e){return dt(e)?"("+G9(e)+")":e}function sGe(e){return aGe(dt(e)?e:{datum:e})}function aGe(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(r=e.parent,t+=".datum"):r=e.group}else e.datum?(t="datum",r=e.datum):Le("Invalid field reference: "+Je(e));return e.signal||(r=ut(r)?Sp(r).map(Je).join("]["):aGe(r)),t+"["+r+"]"}function Zvn(e,t){const n=oGe(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+bL(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function Yvn(e){let t="";return e.forEach(n=>{const r=G9(n);t+=n.test?`(${n.test})?${r}:`:r}),jn(t)===":"&&(t+="null"),t}function lGe(e,t,n,r,i,o){const s={};o=o||{},o.encoders={$encode:s},e=Uvn(e,t,n,r,i.config);for(const a in e)s[a]=Gvn(e[a],t,o,i);return o}function Gvn(e,t,n,r){const i={},o={};for(const s in e)e[s]!=null&&(i[s]=Jvn(Kvn(e[s]),r,n,o));return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}function Kvn(e){return ze(e)?Yvn(e):G9(e)}function Jvn(e,t,n,r){const i=cp(e,t);return i.$fields.forEach(o=>r[o]=1),an(n,i.$params),i.$expr}const e1n="outer",t1n=["value","update","init","react","bind"];function ZCe(e,t){Le(e+' for "outer" push: '+Je(t))}function cGe(e,t){const n=e.name;if(e.push===e1n)t.signals[n]||ZCe("No prior signal definition",n),t1n.forEach(r=>{e[r]!==void 0&&ZCe("Invalid property ",r)});else{const r=t.addSignal(n,e.value);e.react===!1&&(r.react=!1),e.bind&&t.addBinding(n,e.bind)}}function QJ(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function K9(e,t,n,r){return new QJ(e,t,n,r)}function C4(e,t){return K9("operator",e,t)}function Rt(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function mA(e,t){return t?{$field:e,$name:t}:{$field:e}}const BJ=mA("key");function YCe(e,t){return{$compare:e,$order:t}}function n1n(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const r1n="ascending",i1n="descending";function o1n(e){return dt(e)?(e.order===i1n?"-":"+")+J9(e.op,e.field):""}function J9(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const Cde="scope",WJ="view";function Zo(e){return e&&e.signal}function s1n(e){return e&&e.expr}function OL(e){if(Zo(e))return!0;if(dt(e)){for(const t in e)if(OL(e[t]))return!0}return!1}function Uf(e,t){return e??t}function db(e){return e&&e.signal||e}const GCe="timer";function yA(e,t){return(e.merge?l1n:e.stream?c1n:e.type?u1n:Le("Invalid stream specification: "+Je(e)))(e,t)}function a1n(e){return e===Cde?WJ:e||WJ}function l1n(e,t){const n=e.merge.map(i=>yA(i,t)),r=_de({merge:n},e,t);return t.addStream(r).id}function c1n(e,t){const n=yA(e.stream,t),r=_de({stream:n},e,t);return t.addStream(r).id}function u1n(e,t){let n;e.type===GCe?(n=t.event(GCe,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(a1n(e.source),e.type);const r=_de({stream:n},e,t);return Object.keys(r).length===1?n:t.addStream(r).id}function _de(e,t,n){let r=t.between;return r&&(r.length!==2&&Le('Stream "between" parameter must have 2 entries: '+Je(t)),e.between=[yA(r[0],n),yA(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(f1n(t.marktype,t.markname,t.markrole)),t.source===Cde&&r.push("inScope(event.item)"),r.length&&(e.filter=cp("("+r.join(")&&(")+")",n).$expr),(r=t.throttle)!=null&&(e.throttle=+r),(r=t.debounce)!=null&&(e.debounce=+r),t.consume&&(e.consume=!0),e}function f1n(e,t,n){const r="event.item";return r+(e&&e!=="*"?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}const d1n={code:"_.$value",ast:{type:"Identifier",value:"value"}};function h1n(e,t,n){const r=e.encode,i={target:n};let o=e.events,s=e.update,a=[];o||Le("Signal update missing events specification."),ut(o)&&(o=Nv(o,t.isSubscope()?Cde:WJ)),o=ct(o).filter(l=>l.signal||l.scale?(a.push(l),0):1),a.length>1&&(a=[g1n(a)]),o.length&&a.push(o.length>1?{merge:o}:o[0]),r!=null&&(s&&Le("Signal encode and update are mutually exclusive."),s="encode(item(),"+Je(r)+")"),i.update=ut(s)?cp(s,t):s.expr!=null?cp(s.expr,t):s.value!=null?s.value:s.signal!=null?{$expr:d1n,$params:{$value:t.signalRef(s.signal)}}:Le("Invalid signal update specification."),e.force&&(i.options={force:!0}),a.forEach(l=>t.addUpdate(an(p1n(l,t),i)))}function p1n(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):yA(e,t)}}function g1n(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function m1n(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?Le("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=cp(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(i=>h1n(i,t,n.id))}const zr=e=>(t,n,r)=>K9(e,n,t||void 0,r),uGe=zr("aggregate"),y1n=zr("axisticks"),fGe=zr("bound"),Bd=zr("collect"),KCe=zr("compare"),v1n=zr("datajoin"),dGe=zr("encode"),b1n=zr("expression"),O1n=zr("facet"),x1n=zr("field"),w1n=zr("key"),S1n=zr("legendentries"),E1n=zr("load"),C1n=zr("mark"),_1n=zr("multiextent"),k1n=zr("multivalues"),$1n=zr("overlap"),T1n=zr("params"),hGe=zr("prefacet"),P1n=zr("projection"),A1n=zr("proxy"),R1n=zr("relay"),pGe=zr("render"),D1n=zr("scale"),ux=zr("sieve"),M1n=zr("sortitems"),gGe=zr("viewlayout"),N1n=zr("values");let I1n=0;const mGe={min:"min",max:"max",count:"sum"};function L1n(e,t){const n=e.type||"linear";lHe(n)||Le("Unrecognized scale type: "+Je(n)),t.addScale(e.name,{type:n,domain:void 0})}function j1n(e,t){const n=t.getScale(e.name).params;let r;n.domain=yGe(e.domain,e,t),e.range!=null&&(n.range=bGe(e,t,n)),e.interpolate!=null&&X1n(e.interpolate,n),e.nice!=null&&(n.nice=H1n(e.nice,t)),e.bins!=null&&(n.bins=U1n(e.bins,t));for(r in e)Nt(n,r)||r==="name"||(n[r]=Zu(e[r],t))}function Zu(e,t){return dt(e)?e.signal?t.signalRef(e.signal):Le("Unsupported object: "+Je(e)):e}function xL(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Zu(n,t))}function eQ(e){Le("Can not find data set: "+Je(e))}function yGe(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&Le("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(ze(e)?F1n:e.fields?Q1n:z1n)(e,t,n)}function F1n(e,t,n){return e.map(r=>Zu(r,n))}function z1n(e,t,n){const r=n.getData(e.data);return r||eQ(e.data),zE(t.type)?r.valuesRef(n,e.field,vGe(e.sort,!1)):fHe(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function Q1n(e,t,n){const r=e.data,i=e.fields.reduce((o,s)=>(s=ut(s)?{data:r,field:s}:ze(s)||s.signal?B1n(s,n):s,o.push(s),o),[]);return(zE(t.type)?W1n:fHe(t.type)?q1n:V1n)(e,n,i)}function B1n(e,t){const n="_:vega:_"+I1n++,r=Bd({});if(ze(e))r.value={$ingest:e};else if(e.signal){const i="setdata("+Je(n)+","+e.signal+")";r.params.input=t.signalRef(i)}return t.addDataPipeline(n,[r,ux({})]),{data:n,field:"data"}}function W1n(e,t,n){const r=vGe(e.sort,!0);let i,o;const s=n.map(c=>{const u=t.getData(c.data);return u||eQ(c.data),u.countsRef(t,c.field,r)}),a={groupby:BJ,pulse:s};r&&(i=r.op||"count",o=r.field?J9(i,r.field):"count",a.ops=[mGe[i]],a.fields=[t.fieldRef(o)],a.as=[o]),i=t.add(uGe(a));const l=t.add(Bd({pulse:Rt(i)}));return o=t.add(N1n({field:BJ,sort:t.sortRef(r),pulse:Rt(l)})),Rt(o)}function vGe(e,t){return e&&(!e.field&&!e.op?dt(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?Le("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!mGe[e.op]&&Le("Multiple domain scales can not be sorted using "+e.op)),e}function q1n(e,t,n){const r=n.map(i=>{const o=t.getData(i.data);return o||eQ(i.data),o.domainRef(t,i.field)});return Rt(t.add(k1n({values:r})))}function V1n(e,t,n){const r=n.map(i=>{const o=t.getData(i.data);return o||eQ(i.data),o.extentRef(t,i.field)});return Rt(t.add(_1n({extents:r})))}function U1n(e,t){return e.signal||ze(e)?xL(e,t):t.objectProperty(e)}function H1n(e,t){return e.signal?t.signalRef(e.signal):dt(e)?{interval:Zu(e.interval),step:Zu(e.step)}:Zu(e)}function X1n(e,t){t.interpolate=Zu(e.type||e),e.gamma!=null&&(t.interpolateGamma=Zu(e.gamma))}function bGe(e,t,n){const r=t.config.range;let i=e.range;if(i.signal)return t.signalRef(i.signal);if(ut(i)){if(r&&Nt(r,i))return e=an({},e,{range:r[i]}),bGe(e,t,n);i==="width"?i=[0,{signal:"width"}]:i==="height"?i=zE(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Le("Unrecognized scale range value: "+Je(i))}else if(i.scheme){n.scheme=ze(i.scheme)?xL(i.scheme,t):Zu(i.scheme,t),i.extent&&(n.schemeExtent=xL(i.extent,t)),i.count&&(n.schemeCount=Zu(i.count,t));return}else if(i.step){n.rangeStep=Zu(i.step,t);return}else{if(zE(e.type)&&!ze(i))return yGe(i,e,t);ze(i)||Le("Unsupported range type: "+Je(i))}return i.map(o=>(ze(o)?xL:Zu)(o,t))}function Z1n(e,t){const n=t.config.projection||{},r={};for(const i in e)i!=="name"&&(r[i]=qJ(e[i],i,t));for(const i in n)r[i]==null&&(r[i]=qJ(n[i],i,t));t.addProjection(e.name,r)}function qJ(e,t,n){return ze(e)?e.map(r=>qJ(r,t,n)):dt(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:Le("Unsupported parameter object: "+Je(e)):e}const Wd="top",A_="left",R_="right",K0="bottom",OGe="center",Y1n="vertical",G1n="start",K1n="middle",J1n="end",VJ="index",kde="label",ebn="offset",ZE="perc",tbn="perc2",rf="value",QD="guide-label",$de="guide-title",nbn="group-title",rbn="group-subtitle",JCe="symbol",wL="gradient",UJ="discrete",HJ="size",ibn="shape",obn="fill",sbn="stroke",abn="strokeWidth",lbn="strokeDash",cbn="opacity",Tde=[HJ,ibn,obn,sbn,abn,lbn,cbn],BD={name:1,style:1,interactive:1},Qn={value:0},of={value:1},tQ="group",xGe="rect",Pde="rule",ubn="symbol",fx="text";function vA(e){return e.type=tQ,e.interactive=e.interactive||!1,e}function vc(e,t){const n=(r,i)=>Uf(e[r],Uf(t[r],i));return n.isVertical=r=>Y1n===Uf(e.direction,t.direction||(r?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>Uf(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>Uf(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>Uf(e.columns,Uf(t.columns,+n.isVertical(!0))),n}function wGe(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function fbn(e,t,n){const r=t.config.style[n];return r&&r[e]}function nQ(e,t,n){return`item.anchor === '${G1n}' ? ${e} : item.anchor === '${J1n}' ? ${t} : ${n}`}const Ade=nQ(Je(A_),Je(R_),Je(OGe));function dbn(e){const t=e("tickBand");let n=e("tickOffset"),r,i;return t?t.signal?(r={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},dt(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(r=1,i=!0,n=0):(r=.5,i=!1):(r=e("bandPosition"),i=e("tickExtra")),{extra:i,band:r,offset:n}}function SGe(e,t){return t?e?dt(e)?Object.assign({},e,{offset:SGe(e.offset,t)}):{value:e,offset:t}:t:e}function su(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=P_(e.encode,t,BD)):e.interactive=!1,e}function hbn(e,t,n,r){const i=vc(e,n),o=i.isVertical(),s=i.gradientThickness(),a=i.gradientLength();let l,c,u,f,d;o?(c=[0,1],u=[0,0],f=s,d=a):(c=[0,0],u=[1,0],f=a,d=s);const h={enter:l={opacity:Qn,x:Qn,y:Qn,width:ds(f),height:ds(d)},update:an({},l,{opacity:of,fill:{gradient:t,start:c,stop:u}}),exit:{opacity:Qn}};return Ys(h,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),su({type:xGe,role:zvn,encode:h},r)}function pbn(e,t,n,r,i){const o=vc(e,n),s=o.isVertical(),a=o.gradientThickness(),l=o.gradientLength();let c,u,f,d,h="";s?(c="y",f="y2",u="x",d="width",h="1-"):(c="x",f="x2",u="y",d="height");const p={opacity:Qn,fill:{scale:t,field:rf}};p[c]={signal:h+"datum."+ZE,mult:l},p[u]=Qn,p[f]={signal:h+"datum."+tbn,mult:l},p[d]=ds(a);const g={enter:p,update:an({},p,{opacity:of}),exit:{opacity:Qn}};return Ys(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),su({type:xGe,role:jvn,key:rf,from:i,encode:g},r)}const gbn=`datum.${ZE}<=0?"${A_}":datum.${ZE}>=1?"${R_}":"${OGe}"`,mbn=`datum.${ZE}<=0?"${K0}":datum.${ZE}>=1?"${Wd}":"${K1n}"`;function e_e(e,t,n,r){const i=vc(e,t),o=i.isVertical(),s=ds(i.gradientThickness()),a=i.gradientLength();let l=i("labelOverlap"),c,u,f,d,h="";const p={enter:c={opacity:Qn},update:u={opacity:of,text:{field:kde}},exit:{opacity:Qn}};return Ys(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:Uf(e.labelLimit,t.gradientLabelLimit)}),o?(c.align={value:"left"},c.baseline=u.baseline={signal:mbn},f="y",d="x",h="1-"):(c.align=u.align={signal:gbn},c.baseline={value:"top"},f="x",d="y"),c[f]=u[f]={signal:h+"datum."+ZE,mult:a},c[d]=u[d]=s,s.offset=Uf(e.labelOffset,t.gradientLabelOffset)||0,l=l?{separation:i("labelSeparation"),method:l,order:"datum."+VJ}:void 0,su({type:fx,role:iGe,style:QD,key:rf,from:r,encode:p,overlap:l},n)}function ybn(e,t,n,r,i){const o=vc(e,t),s=n.entries,a=!!(s&&s.interactive),l=s?s.name:void 0,c=o("clipHeight"),u=o("symbolOffset"),f={data:"value"},d=`(${i}) ? datum.${ebn} : datum.${HJ}`,h=c?ds(c):{field:HJ},p=`datum.${VJ}`,g=`max(1, ${i})`;let v,y,O,m,w;h.mult=.5,v={enter:y={opacity:Qn,x:{signal:d,mult:.5,offset:u},y:h},update:O={opacity:of,x:y.x,y:y.y},exit:{opacity:Qn}};let S=null,E=null;e.fill||(S=t.symbolBaseFillColor,E=t.symbolBaseStrokeColor),Ys(v,{fill:o("symbolFillColor",S),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",E),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),Tde.forEach(D=>{e[D]&&(O[D]=y[D]={scale:e[D],field:rf})});const C=su({type:ubn,role:Qvn,key:rf,from:f,clip:c?!0:void 0,encode:v},n.symbols),k=ds(u);k.offset=o("labelOffset"),v={enter:y={opacity:Qn,x:{signal:d,offset:k},y:h},update:O={opacity:of,text:{field:kde},x:y.x,y:y.y},exit:{opacity:Qn}},Ys(v,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const P=su({type:fx,role:iGe,style:QD,key:rf,from:f,encode:v},n.labels);return v={enter:{noBound:{value:!c},width:Qn,height:c?ds(c):Qn,opacity:Qn},exit:{opacity:Qn},update:O={opacity:of,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(m=`ceil(item.mark.items.length / ${g})`,O.row.signal=`${p}%${m}`,O.column.signal=`floor(${p} / ${m})`,w={field:["row",p]}):(O.row.signal=`floor(${p} / ${g})`,O.column.signal=`${p} % ${g}`,w={field:p}),O.column.signal=`(${i})?${O.column.signal}:${p}`,r={facet:{data:r,name:"value",groupby:VJ}},vA({role:Ede,from:r,encode:P_(v,s,BD),marks:[C,P],name:l,interactive:a,sort:w})}function vbn(e,t){const n=vc(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const Rde='item.orient === "left"',Dde='item.orient === "right"',rQ=`(${Rde} || ${Dde})`,bbn=`datum.vgrad && ${rQ}`,Obn=nQ('"top"','"bottom"','"middle"'),xbn=nQ('"right"','"left"','"center"'),wbn=`datum.vgrad && ${Dde} ? (${xbn}) : (${rQ} && !(datum.vgrad && ${Rde})) ? "left" : ${Ade}`,Sbn=`item._anchor || (${rQ} ? "middle" : "start")`,Ebn=`${bbn} ? (${Rde} ? -90 : 90) : 0`,Cbn=`${rQ} ? (datum.vgrad ? (${Dde} ? "bottom" : "top") : ${Obn}) : "top"`;function _bn(e,t,n,r){const i=vc(e,t),o={enter:{opacity:Qn},update:{opacity:of,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Qn}};return Ys(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:Sbn},angle:{signal:Ebn},align:{signal:wbn},baseline:{signal:Cbn},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),su({type:fx,role:Bvn,style:$de,from:r,encode:o},n)}function kbn(e,t){let n;return dt(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+t_e(e.path)+")":e.sphere&&(n="geoShape("+t_e(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function t_e(e){return dt(e)&&e.signal?e.signal:Je(e)}function EGe(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===tQ?Ede:t||wde}function $bn(e){return{marktype:e.type,name:e.name||void 0,role:e.role||EGe(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function Tbn(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function Mde(e,t){const n=lVe(e.type);n||Le("Unrecognized transform type: "+Je(e.type));const r=K9(n.type.toLowerCase(),null,CGe(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function CGe(e,t,n){const r={},i=e.params.length;for(let o=0;o<i;++o){const s=e.params[o];r[s.name]=Pbn(s,t,n)}return r}function Pbn(e,t,n){const r=e.type,i=t[e.name];if(r==="index")return Abn(e,t,n);if(i===void 0){e.required&&Le("Missing required "+Je(t.type)+" parameter: "+Je(e.name));return}else{if(r==="param")return Rbn(e,t,n);if(r==="projection")return n.projectionRef(t[e.name])}return e.array&&!Zo(i)?i.map(o=>n_e(e,o,n)):n_e(e,i,n)}function n_e(e,t,n){const r=e.type;if(Zo(t))return i_e(r)?Le("Expression references can not be signals."):zU(r)?n.fieldRef(t):o_e(r)?n.compareRef(t):n.signalRef(t.signal);{const i=e.expr||zU(r);return i&&Dbn(t)?n.exprRef(t.expr,t.as):i&&Mbn(t)?mA(t.field,t.as):i_e(r)?cp(t,n):Nbn(r)?Rt(n.getData(t).values):zU(r)?mA(t):o_e(r)?n.compareRef(t):t}}function Abn(e,t,n){return ut(t.from)||Le('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function Rbn(e,t,n){const r=t[e.name];return e.array?(ze(r)||Le("Expected an array of sub-parameters. Instead: "+Je(r)),r.map(i=>r_e(e,i,n))):r_e(e,r,n)}function r_e(e,t,n){const r=e.params.length;let i;for(let s=0;s<r;++s){i=e.params[s];for(const a in i.key)if(i.key[a]!==t[a]){i=null;break}if(i)break}i||Le("Unsupported parameter: "+Je(t));const o=an(CGe(i,t,n),i.key);return Rt(n.add(T1n(o)))}const Dbn=e=>e&&e.expr,Mbn=e=>e&&e.field,Nbn=e=>e==="data",i_e=e=>e==="expr",zU=e=>e==="field",o_e=e=>e==="compare";function Ibn(e,t,n){let r,i,o,s,a;return e?(r=e.facet)&&(t||Le("Only group marks can be faceted."),r.field!=null?s=a=SL(r,n):(e.data?a=Rt(n.getData(e.data).aggregate):(o=Mde(an({type:"aggregate",groupby:ct(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=SL(r,n),s=a=Rt(n.add(o))),i=n.keyRef(r.groupby,!0))):s=Rt(n.add(Bd(null,[{}]))),s||(s=SL(e,n)),{key:i,pulse:s,parent:a}}function SL(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:Rt(t.getData(e.data).output)}function wO(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}wO.fromEntries=function(e,t){const n=t.length,r=t[n-1],i=t[n-2];let o=t[0],s=null,a=1;for(o&&o.type==="load"&&(o=t[1]),e.add(t[0]);a<n;++a)t[a].params.pulse=Rt(t[a-1]),e.add(t[a]),t[a].type==="aggregate"&&(s=t[a]);return new wO(e,o,i,r,s)};function _Ge(e){return ut(e)?e:null}function s_e(e,t,n){const r=J9(n.op,n.field);let i;if(t.ops){for(let o=0,s=t.as.length;o<s;++o)if(t.as[o]===r)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((i=n.op.signal)?e.signalRef(i):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(r))}function qk(e,t,n,r,i,o,s){const a=t[n]||(t[n]={}),l=o1n(o);let c=_Ge(i),u,f;if(c!=null&&(e=t.scope,c=c+(l?"|"+l:""),u=a[c]),!u){const d=o?{field:BJ,pulse:t.countsRef(e,i,o)}:{field:e.fieldRef(i),pulse:Rt(t.output)};l&&(d.sort=e.sortRef(o)),f=e.add(K9(r,void 0,d)),s&&(t.index[i]=f),u=Rt(f),c!=null&&(a[c]=u)}return u}wO.prototype={countsRef(e,t,n){const r=this,i=r.counts||(r.counts={}),o=_Ge(t);let s,a,l;return o!=null&&(e=r.scope,s=i[o]),s?n&&n.field&&s_e(e,s.agg.params,n):(l={groupby:e.fieldRef(t,"key"),pulse:Rt(r.output)},n&&n.field&&s_e(e,l,n),a=e.add(uGe(l)),s=e.add(Bd({pulse:Rt(a)})),s={agg:a,ref:Rt(s)},o!=null&&(i[o]=s)),s.ref},tuplesRef(){return Rt(this.values)},extentRef(e,t){return qk(e,this,"extent","extent",t,!1)},domainRef(e,t){return qk(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return qk(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return qk(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return qk(e,this,"indata","tupleindex",t,!0,!0)}};function Lbn(e,t,n){const r=e.from.facet,i=r.name,o=SL(r,t);let s;r.name||Le("Facet must have a name: "+Je(r)),r.data||Le("Facet must reference a data set: "+Je(r)),r.field?s=t.add(hGe({field:t.fieldRef(r.field),pulse:o})):r.groupby?s=t.add(O1n({key:t.keyRef(r.groupby),group:Rt(t.proxy(n.parent)),pulse:o})):Le("Facet must specify groupby or field: "+Je(r));const a=t.fork(),l=a.add(Bd()),c=a.add(ux({pulse:Rt(l)}));a.addData(i,new wO(a,l,l,c)),a.addSignal("parent",null),s.params.subflow={$subflow:a.parse(e).toRuntime()}}function jbn(e,t,n){const r=t.add(hGe({pulse:n.pulse})),i=t.fork();i.add(ux()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}function kGe(e,t,n){const r=e.remove,i=e.insert,o=e.toggle,s=e.modify,a=e.values,l=t.add(C4()),c="if("+e.trigger+',modify("'+n+'",'+[i,r,o,s,a].map(f=>f??"null").join(",")+"),0)",u=cp(c,t);l.update=u.$expr,l.params=u.$params}function iQ(e,t){const n=EGe(e),r=e.type===tQ,i=e.from&&e.from.facet,o=e.overlap;let s=e.layout||n===Ede||n===Sde,a,l,c,u,f,d,h;const p=n===wde||s||i,g=Ibn(e.from,r,t);l=t.add(v1n({key:g.key||(e.key?mA(e.key):void 0),pulse:g.pulse,clean:!r}));const v=Rt(l);l=c=t.add(Bd({pulse:v})),l=t.add(C1n({markdef:$bn(e),interactive:Tbn(e.interactive,t),clip:kbn(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:Rt(l)}));const y=Rt(l);l=u=t.add(dGe(lGe(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),l.params.parent=t.encode(),e.transform&&e.transform.forEach(E=>{const C=Mde(E,t),k=C.metadata;(k.generates||k.changes)&&Le("Mark transforms should not generate new data."),k.nomod||(u.params.mod=!0),C.params.pulse=Rt(l),t.add(l=C)}),e.sort&&(l=t.add(M1n({sort:t.compareRef(e.sort),pulse:Rt(l)})));const O=Rt(l);(i||s)&&(s=t.add(gGe({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:O})),d=Rt(s));const m=t.add(fGe({mark:y,pulse:d||O}));h=Rt(m),r&&(p&&(a=t.operators,a.pop(),s&&a.pop()),t.pushState(O,d||h,v),i?Lbn(e,t,g):p?jbn(e,t,g):t.parse(e),t.popState(),p&&(s&&a.push(s),a.push(m))),o&&(h=Fbn(o,h,t));const w=t.add(pGe({pulse:h})),S=t.add(ux({pulse:Rt(w)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new wO(t,c,w,S)),e.on&&e.on.forEach(E=>{(E.insert||E.remove||E.toggle)&&Le("Marks only support modify triggers."),kGe(E,t,f)}))}function Fbn(e,t,n){const r=e.method,i=e.bound,o=e.separation,s={separation:Zo(o)?n.signalRef(o.signal):o,method:Zo(r)?n.signalRef(r.signal):r,pulse:t};if(e.order&&(s.sort=n.compareRef({field:e.order})),i){const a=i.tolerance;s.boundTolerance=Zo(a)?n.signalRef(a.signal):+a,s.boundScale=n.scaleRef(i.scale),s.boundOrient=i.orient}return Rt(n.add($1n(s)))}function zbn(e,t){const n=t.config.legend,r=e.encode||{},i=vc(e,n),o=r.legend||{},s=o.name||void 0,a=o.interactive,l=o.style,c={};let u=0,f,d,h;Tde.forEach(m=>e[m]?(c[m]=e[m],u=u||e[m]):0),u||Le("Missing valid scale for legend.");const p=Qbn(e,t.scaleType(u)),g={title:e.title!=null,scales:c,type:p,vgrad:p!=="symbol"&&i.isVertical()},v=Rt(t.add(Bd(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},O=Rt(t.add(S1n(d={type:p,scale:t.scaleRef(u),count:t.objectProperty(i("tickCount")),limit:t.property(i("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===wL?(h=[hbn(e,u,n,r.gradient),e_e(e,n,r.labels,O)],d.count=d.count||t.signalRef(`max(2,2*floor((${db(i.gradientLength())})/100))`)):p===UJ?h=[pbn(e,u,n,r.gradient,O),e_e(e,n,r.labels,O)]:(f=vbn(e,n),h=[ybn(e,n,r,O,db(f.columns))],d.size=qbn(e,t,h[0].marks)),h=[vA({role:Fvn,from:v,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(_bn(e,n,r.title,v)),iQ(vA({role:Lvn,from:v,encode:P_(Wbn(i,e,n),o,BD),marks:h,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:s,interactive:a,style:l}),t)}function Qbn(e,t){let n=e.type||JCe;return!e.type&&Bbn(e)===1&&(e.fill||e.stroke)&&(n=Pue(t)?wL:LK(t)?UJ:JCe),n!==wL?n:LK(t)?UJ:wL}function Bbn(e){return Tde.reduce((t,n)=>t+(e[n]?1:0),0)}function Wbn(e,t,n){const r={enter:{},update:{}};return Ys(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}function qbn(e,t,n){const r=db(a_e("size",e,n)),i=db(a_e("strokeWidth",e,n)),o=db(Vbn(n[1].encode,t,QD));return cp(`max(ceil(sqrt(${r})+${i}),${o})`,t)}function a_e(e,t,n){return t[e]?`scale("${t[e]}",datum)`:wGe(e,n[0].encode)}function Vbn(e,t,n){return wGe("fontSize",e)||fbn("fontSize",t,n)}const Ubn=`item.orient==="${A_}"?-90:item.orient==="${R_}"?90:0`;function Hbn(e,t){e=ut(e)?{text:e}:e;const n=vc(e,t.config.title),r=e.encode||{},i=r.group||{},o=i.name||void 0,s=i.interactive,a=i.style,l=[],c={},u=Rt(t.add(Bd(null,[c])));return l.push(Ybn(e,n,Xbn(e),u)),e.subtitle&&l.push(Gbn(e,n,r.subtitle,u)),iQ(vA({role:Wvn,from:u,encode:Zbn(n,i),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:s,style:a}),t)}function Xbn(e){const t=e.encode;return t&&t.title||an({name:e.name,interactive:e.interactive,style:e.style},t)}function Zbn(e,t){const n={enter:{},update:{}};return Ys(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:Ade},angle:{signal:Ubn},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),P_(n,t,BD)}function Ybn(e,t,n,r){const i={value:0},o=e.text,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Ys(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),su({type:fx,role:qvn,style:nbn,from:r,encode:s},n)}function Gbn(e,t,n,r){const i={value:0},o=e.subtitle,s={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return Ys(s,{text:o,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),su({type:fx,role:Vvn,style:rbn,from:r,encode:s},n)}function Kbn(e,t){const n=[];e.transform&&e.transform.forEach(r=>{n.push(Mde(r,t))}),e.on&&e.on.forEach(r=>{kGe(r,t,e.name)}),t.addDataPipeline(e.name,Jbn(e,t,n))}function Jbn(e,t,n){const r=[];let i=null,o=!1,s=!1,a,l,c,u,f;for(e.values?Zo(e.values)||OL(e.format)?(r.push(l_e(t,e)),r.push(i=Xv())):r.push(i=Xv({$ingest:e.values,$format:e.format})):e.url?OL(e.url)||OL(e.format)?(r.push(l_e(t,e)),r.push(i=Xv())):r.push(i=Xv({$request:e.url,$format:e.format})):e.source&&(i=a=ct(e.source).map(d=>Rt(t.getData(d).output)),r.push(null)),l=0,c=n.length;l<c;++l)u=n[l],f=u.metadata,!i&&!f.source&&r.push(i=Xv()),r.push(u),f.generates&&(s=!0),f.modifies&&!s&&(o=!0),f.source?i=u:f.changes&&(i=null);return a&&(c=a.length-1,r[0]=R1n({derive:o,pulse:c?a:a[0]}),(o||c)&&r.splice(1,0,Xv())),i||r.push(Xv()),r.push(ux({})),r}function Xv(e){const t=Bd({},e);return t.metadata={source:!0},t}function l_e(e,t){return E1n({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}const $Ge=e=>e===K0||e===Wd,oQ=(e,t,n)=>Zo(e)?rOn(e.signal,t,n):e===A_||e===Wd?t:n,hs=(e,t,n)=>Zo(e)?tOn(e.signal,t,n):$Ge(e)?t:n,hd=(e,t,n)=>Zo(e)?nOn(e.signal,t,n):$Ge(e)?n:t,TGe=(e,t,n)=>Zo(e)?iOn(e.signal,t,n):e===Wd?{value:t}:{value:n},eOn=(e,t,n)=>Zo(e)?oOn(e.signal,t,n):e===R_?{value:t}:{value:n},tOn=(e,t,n)=>PGe(`${e} === '${Wd}' || ${e} === '${K0}'`,t,n),nOn=(e,t,n)=>PGe(`${e} !== '${Wd}' && ${e} !== '${K0}'`,t,n),rOn=(e,t,n)=>Nde(`${e} === '${A_}' || ${e} === '${Wd}'`,t,n),iOn=(e,t,n)=>Nde(`${e} === '${Wd}'`,t,n),oOn=(e,t,n)=>Nde(`${e} === '${R_}'`,t,n),PGe=(e,t,n)=>(t=t!=null?ds(t):t,n=n!=null?ds(n):n,c_e(t)&&c_e(n)?(t=t?t.signal||Je(t.value):null,n=n?n.signal||Je(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[an({test:e},t)].concat(n||[])),c_e=e=>e==null||Object.keys(e).length===1,Nde=(e,t,n)=>({signal:`${e} ? (${Jw(t)}) : (${Jw(n)})`}),sOn=(e,t,n,r,i)=>({signal:(r!=null?`${e} === '${A_}' ? (${Jw(r)}) : `:"")+(n!=null?`${e} === '${K0}' ? (${Jw(n)}) : `:"")+(i!=null?`${e} === '${R_}' ? (${Jw(i)}) : `:"")+(t!=null?`${e} === '${Wd}' ? (${Jw(t)}) : `:"")+"(null)"}),Jw=e=>Zo(e)?e.signal:e==null?null:Je(e),aOn=(e,t)=>t===0?0:Zo(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},jS=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function Gx(e,t,n,r){let i;if(t&&Nt(t,e))return t[e];if(Nt(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[$de][i]}else if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[QD][i]}return null}function u_e(e){const t={};for(const n of e)if(n)for(const r in n)t[r]=1;return Object.keys(t)}function lOn(e,t){var n=t.config,r=n.style,i=n.axis,o=t.scaleType(e.scale)==="band"&&n.axisBand,s=e.orient,a,l,c;if(Zo(s)){const f=u_e([n.axisX,n.axisY]),d=u_e([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(c of f)a[c]=hs(s,Gx(c,n.axisX,i,r),Gx(c,n.axisY,i,r));l={};for(c of d)l[c]=sOn(s.signal,Gx(c,n.axisTop,i,r),Gx(c,n.axisBottom,i,r),Gx(c,n.axisLeft,i,r),Gx(c,n.axisRight,i,r))}else a=s===Wd||s===K0?n.axisX:n.axisY,l=n["axis"+s[0].toUpperCase()+s.slice(1)];return a||l||o?an({},i,a,l,o):i}function cOn(e,t,n,r){const i=vc(e,t),o=e.orient;let s,a;const l={enter:s={opacity:Qn},update:a={opacity:of},exit:{opacity:Qn}};Ys(l,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const c=f_e(e,0),u=f_e(e,1);return s.x=a.x=hs(o,c,Qn),s.x2=a.x2=hs(o,u),s.y=a.y=hd(o,c,Qn),s.y2=a.y2=hd(o,u),su({type:Pde,role:Rvn,from:r,encode:l},n)}function f_e(e,t){return{scale:e.scale,range:t}}function uOn(e,t,n,r,i){const o=vc(e,t),s=e.orient,a=e.gridScale,l=oQ(s,1,-1),c=fOn(e.offset,l);let u,f,d;const h={enter:u={opacity:Qn},update:d={opacity:of},exit:f={opacity:Qn}};Ys(h,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:e.scale,field:rf,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=hs(s,{signal:"height"},{signal:"width"}),v=a?{scale:a,range:0,mult:l,offset:c}:{value:0,offset:c},y=a?{scale:a,range:1,mult:l,offset:c}:an(g,{mult:l,offset:c});return u.x=d.x=hs(s,p,v),u.y=d.y=hd(s,p,v),u.x2=d.x2=hd(s,y),u.y2=d.y2=hs(s,y),f.x=hs(s,p),f.y=hd(s,p),su({type:Pde,role:Dvn,key:rf,from:r,encode:h},n)}function fOn(e,t){if(t!==1)if(!dt(e))e=Zo(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=an({},e);for(;n.mult!=null;)if(dt(n.mult))n=n.mult=an({},n.mult);else return n.mult=Zo(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function dOn(e,t,n,r,i,o){const s=vc(e,t),a=e.orient,l=oQ(a,-1,1);let c,u,f;const d={enter:c={opacity:Qn},update:f={opacity:of},exit:u={opacity:Qn}};Ys(d,{stroke:s("tickColor"),strokeCap:s("tickCap"),strokeDash:s("tickDash"),strokeDashOffset:s("tickDashOffset"),strokeOpacity:s("tickOpacity"),strokeWidth:s("tickWidth")});const h=ds(i);h.mult=l;const p={scale:e.scale,field:rf,band:o.band,extra:o.extra,offset:o.offset,round:s("tickRound")};return f.y=c.y=hs(a,Qn,p),f.y2=c.y2=hs(a,h),u.x=hs(a,p),f.x=c.x=hd(a,Qn,p),f.x2=c.x2=hd(a,h),u.y=hd(a,p),su({type:Pde,role:Nvn,key:rf,from:r,encode:d},n)}function QU(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function hOn(e,t,n,r,i,o){const s=vc(e,t),a=e.orient,l=e.scale,c=oQ(a,-1,1),u=db(s("labelFlush")),f=db(s("labelFlushOffset")),d=s("labelAlign"),h=s("labelBaseline");let p=u===0||!!u,g;const v=ds(i);v.mult=c,v.offset=ds(s("labelPadding")||0),v.offset.mult=c;const y={scale:l,field:rf,band:.5,offset:SGe(o.offset,s("labelOffset"))},O=hs(a,p?QU(l,u,'"left"','"right"','"center"'):{value:"center"},eOn(a,"left","right")),m=hs(a,TGe(a,"bottom","top"),p?QU(l,u,'"top"','"bottom"','"middle"'):{value:"middle"}),w=QU(l,u,`-(${f})`,f,0);p=p&&f;const S={opacity:Qn,x:hs(a,y,v),y:hd(a,y,v)},E={enter:S,update:g={opacity:of,text:{field:kde},x:S.x,y:S.y,align:O,baseline:m},exit:{opacity:Qn,x:S.x,y:S.y}};Ys(E,{dx:!d&&p?hs(a,w):null,dy:!h&&p?hd(a,w):null}),Ys(E,{angle:s("labelAngle"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontWeight:s("labelFontWeight"),fontStyle:s("labelFontStyle"),limit:s("labelLimit"),lineHeight:s("labelLineHeight")},{align:d,baseline:h});const C=s("labelBound");let k=s("labelOverlap");return k=k||C?{separation:s("labelSeparation"),method:k,order:"datum.index",bound:C?{scale:l,orient:a,tolerance:C}:null}:void 0,g.align!==O&&(g.align=jS(g.align,O)),g.baseline!==m&&(g.baseline=jS(g.baseline,m)),su({type:fx,role:Mvn,style:QD,key:rf,from:r,encode:E,overlap:k},n)}function pOn(e,t,n,r){const i=vc(e,t),o=e.orient,s=oQ(o,-1,1);let a,l;const c={enter:a={opacity:Qn,anchor:ds(i("titleAnchor",null)),align:{signal:Ade}},update:l=an({},a,{opacity:of,text:ds(e.title)}),exit:{opacity:Qn}},u={signal:`lerp(range("${e.scale}"), ${nQ(0,1,.5)})`};return l.x=hs(o,u),l.y=hd(o,u),a.angle=hs(o,Qn,aOn(s,90)),a.baseline=hs(o,TGe(o,K0,Wd),{value:K0}),l.angle=a.angle,l.baseline=a.baseline,Ys(c,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),gOn(i,o,c,n),c.update.align=jS(c.update.align,a.align),c.update.angle=jS(c.update.angle,a.angle),c.update.baseline=jS(c.update.baseline,a.baseline),su({type:fx,role:Ivn,style:$de,from:r,encode:c},n)}function gOn(e,t,n,r){const i=(a,l)=>a!=null?(n.update[l]=jS(ds(a),n.update[l]),!1):!Cw(l,r),o=i(e("titleX"),"x"),s=i(e("titleY"),"y");n.enter.auto=s===o?ds(s):hs(t,ds(s),ds(o))}function mOn(e,t){const n=lOn(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,s=i.interactive,a=i.style,l=vc(e,n),c=dbn(l),u={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:e.title!=null},f=Rt(t.add(Bd({},[u]))),d=Rt(t.add(y1n({scale:t.scaleRef(e.scale),extra:t.property(c.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return u.grid&&h.push(uOn(e,n,r.grid,d,c)),u.ticks&&(p=l("tickSize"),h.push(dOn(e,n,r.ticks,d,p,c))),u.labels&&(p=u.ticks?p:0,h.push(hOn(e,n,r.labels,d,p,c))),u.domain&&h.push(cOn(e,n,r.domain,f)),u.title&&h.push(pOn(e,n,r.title,f)),iQ(vA({role:Avn,from:f,encode:P_(yOn(l,e),i,BD),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:o,interactive:s,style:a}),t)}function yOn(e,t){const n={enter:{},update:{}};return Ys(n,{orient:e("orient"),offset:e("offset")||0,position:Uf(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function AGe(e,t,n){const r=ct(e.signals),i=ct(e.scales);return n||r.forEach(o=>cGe(o,t)),ct(e.projections).forEach(o=>Z1n(o,t)),i.forEach(o=>L1n(o,t)),ct(e.data).forEach(o=>Kbn(o,t)),i.forEach(o=>j1n(o,t)),(n||r).forEach(o=>m1n(o,t)),ct(e.axes).forEach(o=>mOn(o,t)),ct(e.marks).forEach(o=>iQ(o,t)),ct(e.legends).forEach(o=>zbn(o,t)),e.title&&Hbn(e.title,t),t.parseLambdas(),t}const vOn=e=>P_({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function bOn(e,t){const n=t.config,r=Rt(t.root=t.add(C4())),i=OOn(e,n);i.forEach(c=>cGe(c,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const o=t.add(Bd()),s=t.add(dGe(lGe(vOn(e.encode),tQ,Sde,e.style,t,{pulse:Rt(o)}))),a=t.add(gGe({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:Rt(s)}));t.operators.pop(),t.pushState(Rt(s),Rt(a),null),AGe(e,t,i),t.operators.push(a);let l=t.add(fGe({mark:r,pulse:Rt(a)}));return l=t.add(pGe({pulse:Rt(l)})),l=t.add(ux({pulse:Rt(l)})),t.addData("root",new wO(t,o,o,l)),t}function Vk(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function OOn(e,t){const n=s=>Uf(e[s],t[s]),r=[Vk("background",n("background")),Vk("autosize",$vn(n("autosize"))),Vk("padding",Pvn(n("padding"))),Vk("width",n("width")||0),Vk("height",n("height")||0)],i=r.reduce((s,a)=>(s[a.name]=a,s),{}),o={};return ct(e.signals).forEach(s=>{Nt(i,s.name)?s=an(i[s.name],s):r.push(s),o[s.name]=s}),ct(t.signals).forEach(s=>{!Nt(o,s.name)&&!Nt(i,s.name)&&r.push(s)}),r}function RGe(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function d_e(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}RGe.prototype=d_e.prototype={parse(e){return AGe(e,this)},fork(){return new d_e(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof QJ?Rt(e):e;return this.add(A1n({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(r,i,o){let s,a;r&&(s=r.data||(r.data={}),a=s[i]||(s[i]=[]),a.push(o))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const r in t.index)n(t.index[r],e,"index:"+r)}return this},pushState(e,t,n){this._encode.push(Rt(this.add(ux({pulse:e})))),this._parent.push(t),this._lookup.push(n?Rt(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return jn(this._parent)},encode(){return jn(this._encode)},lookup(){return jn(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(ut(e))return mA(e,t);e.signal||Le("Unsupported field reference: "+Je(e));const n=e.signal;let r=this.field[n];if(!r){const i={name:this.signalRef(n)};t&&(i.as=t),this.field[n]=r=Rt(this.add(x1n(i)))}return r},compareRef(e){let t=!1;const n=o=>Zo(o)?(t=!0,this.signalRef(o.signal)):s1n(o)?(t=!0,this.exprRef(o.expr)):o,r=ct(e.field).map(n),i=ct(e.order).map(n);return t?Rt(this.add(KCe({fields:r,orders:i}))):YCe(r,i)},keyRef(e,t){let n=!1;const r=o=>Zo(o)?(n=!0,Rt(i[o.signal])):o,i=this.signals;return e=ct(e).map(r),n?Rt(this.add(w1n({fields:e,flat:t}))):n1n(e,t)},sortRef(e){if(!e)return e;const t=J9(e.op,e.field),n=e.order||r1n;return n.signal?Rt(this.add(KCe({fields:t,orders:this.signalRef(n.signal)}))):YCe(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:e,type:t}),this.events[n]=r}return this.events[n]},hasOwnSignal(e){return Nt(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&Le("Duplicate signal name: "+Je(e));const n=t instanceof QJ?t:this.add(C4(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||Le("Unrecognized signal name: "+Je(e)),this.signals[e]},signalRef(e){return this.signals[e]?Rt(this.signals[e]):(Nt(this.lambdas,e)||(this.lambdas[e]=this.add(C4(null))),Rt(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){const r=e[t],i=cp(r,this),o=this.lambdas[r];o.params=i.$params,o.update=i.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return!e||!dt(e)?e:this.signalRef(e.signal||Ide(e))},exprRef(e,t){const n={expr:cp(e,this)};return t&&(n.expr.$name=t),Rt(this.add(b1n(n)))},addBinding(e,t){this.bindings||Le("Nested signals do not support binding: "+Je(e)),this.bindings.push(an({signal:e},t))},addScaleProj(e,t){Nt(this.scales,e)&&Le("Duplicate scale or projection name: "+Je(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,D1n(t))},addProjection(e,t){this.addScaleProj(e,P1n(t))},getScale(e){return this.scales[e]||Le("Unrecognized scale name: "+Je(e)),this.scales[e]},scaleRef(e){return Rt(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return Nt(this.data,e)&&Le("Duplicate data set name: "+Je(e)),this.data[e]=t},getData(e){return this.data[e]||Le("Undefined data set name: "+Je(e)),this.data[e]},addDataPipeline(e,t){return Nt(this.data,e)&&Le("Duplicate data set name: "+Je(e)),this.addData(e,wO.fromEntries(this,t))}};function Ide(e){return(ze(e)?xOn:wOn)(e)}function xOn(e){const t=e.length;let n="[";for(let r=0;r<t;++r){const i=e[r];n+=(r>0?",":"")+(dt(i)?i.signal||Ide(i):Je(i))}return n+"]"}function wOn(e){let t="{",n=0,r,i;for(r in e)i=e[r],t+=(++n>1?",":"")+Je(r)+":"+(dt(i)?i.signal||Ide(i):Je(i));return t+"}"}function SOn(){const e="sans-serif",r="#4c78a8",i="#000",o="#888",s="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:r},area:{fill:r},image:null,line:{stroke:r,strokeWidth:2},path:{stroke:r},rect:{fill:r},rule:{stroke:i},shape:{stroke:r},symbol:{fill:r,size:64},text:{fill:i,font:e,fontSize:11},trail:{fill:r,size:2},style:{"guide-label":{fill:i,font:e,fontSize:10},"guide-title":{fill:i,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:i,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:i,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:s},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:o,grid:!1,gridWidth:1,gridColor:s,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:o,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:s,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:o,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function EOn(e,t,n){return dt(e)||Le("Input Vega specification must be an object."),t=l_(SOn(),t,e.config),bOn(e,new RGe(t,n)).toRuntime()}var COn="5.28.0";an(NE,Din,Gcn,Tun,pdn,lhn,Npn,ppn,Lpn,agn,ygn,Egn);const _On=Object.freeze(Object.defineProperty({__proto__:null,Bounds:Po,CanvasHandler:Y0,CanvasRenderer:oA,DATE:oc,DAY:_a,DAYOFYEAR:sp,Dataflow:MS,Debug:s8e,Error:bae,EventStream:i9,Gradient:_He,GroupItem:k9,HOURS:nu,Handler:Z0,HybridHandler:ufe,HybridRenderer:BF,Info:o8e,Item:_9,MILLISECONDS:$d,MINUTES:ru,MONTH:Na,Marks:ou,MultiPulse:pce,None:i8e,Operator:Vr,Parameters:r9,Pulse:a0,QUARTER:ic,RenderType:Ny,Renderer:pu,ResourceLoader:Fue,SECONDS:gf,SVGHandler:rfe,SVGRenderer:N9,SVGStringRenderer:cfe,Scenegraph:tfe,TIME_UNITS:Mae,Transform:De,View:YYe,WEEK:Ho,Warn:Oae,YEAR:qs,accessor:yc,accessorFields:Ma,accessorName:Zi,array:ct,ascending:u8,bandwidthNRD:vce,bin:fVe,bootstrapCI:dVe,boundClip:SXe,boundContext:$D,boundItem:WK,boundMark:VHe,boundStroke:bm,changeset:sx,clampRange:y8e,codegenExpression:SYe,compare:Cae,constant:Wa,cumulativeLogNormal:Ece,cumulativeNormal:s9,cumulativeUniform:$ce,dayofyear:X8e,debounce:_ae,defaultLocale:Fae,definition:lVe,densityLogNormal:Sce,densityNormal:bce,densityUniform:kce,domChild:Vo,domClear:Du,domCreate:Dy,domFind:nfe,dotbin:hVe,error:Le,expressionFunction:po,extend:an,extent:rp,extentIndex:v8e,falsy:Zm,fastmap:u_,field:hf,flush:b8e,font:R9,fontFamily:AD,fontSize:_p,format:H5,formatLocale:T3,formats:Bae,hasOwnProperty:Nt,id:JR,identity:Ba,inferType:k9e,inferTypes:$9e,ingest:dr,inherits:Ke,inrange:Ww,interpolate:Aue,interpolateColors:E9,interpolateRange:dHe,intersect:bXe,intersectBoxLine:Zw,intersectPath:zue,intersectPoint:Que,intersectRule:MHe,isArray:ze,isBoolean:_v,isDate:t0,isFunction:ln,isIterable:O8e,isNumber:Hn,isObject:dt,isRegExp:x8e,isString:ut,isTuple:t9,key:kae,lerp:w8e,lineHeight:H0,loader:tD,locale:C9e,logger:xae,lruCache:S8e,markup:lfe,merge:E8e,mergeConfig:l_,multiLineOffset:Kue,one:a_,pad:C8e,panLinear:f8e,panLog:d8e,panPow:h8e,panSymlog:p8e,parse:EOn,parseExpression:cde,parseSelector:Nv,path:f9,pathCurves:Iue,pathEqual:EXe,pathParse:QE,pathRectangle:THe,pathRender:tA,pathSymbols:$He,pathTrail:PHe,peek:jn,point:M9,projection:Tfe,quantileLogNormal:Cce,quantileNormal:a9,quantileUniform:Tce,quantiles:mce,quantizeInterpolator:hHe,quarter:g8e,quartiles:yce,get random(){return vf},randomInteger:Lrn,randomKDE:xce,randomLCG:Irn,randomLogNormal:gVe,randomMixture:mVe,randomNormal:Oce,randomUniform:yVe,read:IP,regressionConstant:Pce,regressionExp:bVe,regressionLinear:Ace,regressionLoess:wVe,regressionLog:vVe,regressionPoly:xVe,regressionPow:OVe,regressionQuad:Rce,renderModule:I9,repeat:_$,resetDefaultLocale:BBt,resetSVGClipId:RHe,resetSVGDefIds:gcn,responseType:P9e,runtimeContext:LYe,sampleCurve:c9,sampleLogNormal:wce,sampleNormal:o9,sampleUniform:_ce,scale:tr,sceneEqual:ffe,sceneFromJSON:HHe,scenePickVisit:DF,sceneToJSON:UHe,sceneVisit:Ad,sceneZOrder:Bue,scheme:Rue,serializeXML:uXe,setHybridRendererOptions:fcn,setRandom:Mrn,span:eD,splitAccessPath:Sp,stringValue:Je,textMetrics:Gc,timeBin:f9e,timeFloor:t9e,timeFormatLocale:NP,timeInterval:p_,timeOffset:i9e,timeSequence:a9e,timeUnitSpecifier:H8e,timeUnits:Nae,toBoolean:$ae,toDate:Tae,toNumber:$a,toSet:kd,toString:Pae,transform:cVe,transforms:NE,truncate:_8e,truthy:pf,tupleid:Dt,typeParsers:rO,utcFloor:n9e,utcInterval:g_,utcOffset:o9e,utcSequence:l9e,utcdayofyear:G8e,utcquarter:m8e,utcweek:K8e,version:COn,visitArray:oy,week:Z8e,writeConfig:c_,zero:my,zoomLinear:wae,zoomLog:Sae,zoomPow:S3,zoomSymlog:Eae},Symbol.toStringTag,{value:"Module"}));function kOn(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var $On={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},TOn={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<<t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},POn={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const AOn=Array.prototype.slice,Zv=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,AOn.call(t,1))},ROn=(e,t,n,r,i,o,s)=>new Date(e,t||0,n??1,r||0,i||0,o||0,s||0);var DOn={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:ROn,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return Zv("join",arguments)},indexof:function(){return Zv("indexOf",arguments)},lastindexof:function(){return Zv("lastIndexOf",arguments)},slice:function(){return Zv("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return Zv("substring",arguments,String)},split:function(){return Zv("split",arguments,String)},replace:function(){return Zv("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const MOn=["view","item","group","xy","x","y"],XJ=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&XJ.add(setImmediate);const NOn={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:$On[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,r=e(t.object);n&&(e.memberDepth+=1);const i=e(t.property);if(n&&(e.memberDepth-=1),XJ.has(r[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return r[i]},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return r.startsWith("_")&&(r=r.slice(1)),r==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||DOn[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>TOn[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>POn[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,r)=>{e.memberDepth+=1;const i=e(r.key);return e.memberDepth-=1,XJ.has(e(r.value))?console.error(`Prevented interpretation of property "${i}" which could lead to insecure code execution`):n[i]=e(r.value),n},{})};function Uk(e,t,n,r,i,o){const s=a=>NOn[a.type](s,a);return s.memberDepth=0,s.fn=Object.create(t),s.params=n,s.datum=r,s.event=i,s.item=o,MOn.forEach(a=>s.fn[a]=function(){return i.vega[a](...arguments)}),s(e)}var IOn={operator(e,t){const n=t.ast,r=e.functions;return i=>Uk(n,r,i)},parameter(e,t){const n=t.ast,r=e.functions;return(i,o)=>Uk(n,r,o,i)},event(e,t){const n=t.ast,r=e.functions;return i=>Uk(n,r,void 0,void 0,i)},handler(e,t){const n=t.ast,r=e.functions;return(i,o)=>{const s=o.item&&o.item.datum;return Uk(n,r,i,s,o)}},encode(e,t){const{marktype:n,channels:r}=t,i=e.functions,o=n==="group"||n==="image"||n==="rect";return(s,a)=>{const l=s.datum;let c=0,u;for(const f in r)u=Uk(r[f].ast,i,a,l,void 0,s),s[f]!==u&&(s[f]=u,c=1);return n!=="rule"&&kOn(s,r,o),c}}};const LOn="vega-lite",jOn='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',FOn="5.16.3",zOn=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],QOn="https://vega.github.io/vega-lite/",BOn="Vega-Lite is a concise high-level language for interactive visualization.",WOn=["vega","chart","visualization"],qOn="build/vega-lite.js",VOn="build/vega-lite.min.js",UOn="build/vega-lite.min.js",HOn="build/src/index",XOn="build/src/index.d.ts",ZOn={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},YOn=["bin","build","src","vega-lite*","tsconfig.json"],GOn={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",jest:"NODE_OPTIONS=--experimental-vm-modules npx jest",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk --experimental-vm-modules ./node_modules/.bin/jest --runInBand test","test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},KOn={type:"git",url:"https://github.com/vega/vega-lite.git"},JOn="BSD-3-Clause",exn={url:"https://github.com/vega/vega-lite/issues"},txn={"@babel/core":"^7.22.10","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/preset-env":"^7.22.10","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-alias":"^5.0.0","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-commonjs":"^25.0.4","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.2.1","@rollup/plugin-terser":"^0.4.3","@types/chai":"^4.3.5","@types/d3":"^7.4.0","@types/jest":"^29.5.4","@types/pako":"^2.0.0","@typescript-eslint/eslint-plugin":"^6.4.1","@typescript-eslint/parser":"^6.4.1",ajv:"^8.12.0","ajv-formats":"^2.1.1",chai:"^4.3.7",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^4.0.0",d3:"^7.8.5","del-cli":"^5.0.0",eslint:"^8.47.0","eslint-config-prettier":"^9.0.0","eslint-plugin-jest":"^27.2.3","eslint-plugin-prettier":"^5.0.0","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.8.0",jest:"^29.6.3","jest-dev-server":"^9.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.0.2",puppeteer:"^15.0.0","release-it":"^16.1.5",rollup:"^3.28.1","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-sourcemaps":"^0.6.3",serve:"^14.2.1",terser:"^5.19.2","ts-jest":"^29.1.1","ts-json-schema-generator":"^1.3.0",typescript:"~5.2.2","vega-cli":"^5.25.0","vega-datasets":"^2.7.0","vega-embed":"^6.22.2","vega-tooltip":"^0.33.0","yaml-front-matter":"^4.1.1"},nxn={"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.2","vega-event-selector":"~3.0.1","vega-expression":"~5.1.0","vega-util":"~1.17.2",yargs:"~17.7.2"},rxn={vega:"^5.24.0"},ixn={node:">=18"},oxn={name:LOn,author:jOn,version:FOn,collaborators:zOn,homepage:QOn,description:BOn,keywords:WOn,main:qOn,unpkg:VOn,jsdelivr:UOn,module:HOn,types:XOn,bin:ZOn,files:YOn,scripts:GOn,repository:KOn,license:JOn,bugs:exn,devDependencies:txn,dependencies:nxn,peerDependencies:rxn,engines:ixn},Dg="row",Mg="column",sQ="facet",Ei="x",Os="y",qd="x2",Pp="y2",Iv="xOffset",D_="yOffset",Vd="radius",xm="radius2",kf="theta",wm="theta2",Ud="latitude",Hd="longitude",Xd="latitude2",Of="longitude2",ac="color",Ap="fill",Rp="stroke",lc="shape",Sm="size",dx="angle",Em="opacity",Lv="fillOpacity",jv="strokeOpacity",Fv="strokeWidth",zv="strokeDash",WD="text",YE="order",qD="detail",aQ="key",SO="tooltip",lQ="href",cQ="url",uQ="description",sxn={x:1,y:1,x2:1,y2:1},DGe={theta:1,theta2:1,radius:1,radius2:1};function MGe(e){return e in DGe}const Lde={longitude:1,longitude2:1,latitude:1,latitude2:1};function NGe(e){switch(e){case Ud:return"y";case Xd:return"y2";case Hd:return"x";case Of:return"x2"}}function IGe(e){return e in Lde}const axn=He(Lde),jde={...sxn,...DGe,...Lde,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function FS(e){return e===ac||e===Ap||e===Rp}const LGe={row:1,column:1,facet:1},Yu=He(LGe),Fde={...jde,...LGe},lxn=He(Fde),{order:zGn,detail:QGn,tooltip:BGn,...cxn}=Fde,{row:WGn,column:qGn,facet:VGn,...uxn}=cxn;function fxn(e){return!!uxn[e]}function jGe(e){return!!Fde[e]}const dxn=[qd,Pp,Xd,Of,wm,xm];function FGe(e){return hx(e)!==e}function hx(e){switch(e){case qd:return Ei;case Pp:return Os;case Xd:return Ud;case Of:return Hd;case wm:return kf;case xm:return Vd}return e}function J0(e){if(MGe(e))switch(e){case kf:return"startAngle";case wm:return"endAngle";case Vd:return"outerRadius";case xm:return"innerRadius"}return e}function Dp(e){switch(e){case Ei:return qd;case Os:return Pp;case Ud:return Xd;case Hd:return Of;case kf:return wm;case Vd:return xm}}function cc(e){switch(e){case Ei:case qd:return"width";case Os:case Pp:return"height"}}function zGe(e){switch(e){case Ei:return"xOffset";case Os:return"yOffset";case qd:return"x2Offset";case Pp:return"y2Offset";case kf:return"thetaOffset";case Vd:return"radiusOffset";case wm:return"theta2Offset";case xm:return"radius2Offset"}}function zde(e){switch(e){case Ei:return"xOffset";case Os:return"yOffset"}}function hxn(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const pxn=He(jde),{x:UGn,y:HGn,x2:XGn,y2:ZGn,xOffset:YGn,yOffset:GGn,latitude:KGn,longitude:JGn,latitude2:eKn,longitude2:tKn,theta:nKn,theta2:rKn,radius:iKn,radius2:oKn,...Qde}=jde,gxn=He(Qde),Bde={x:1,y:1},Mp=He(Bde);function co(e){return e in Bde}const Wde={theta:1,radius:1},mxn=He(Wde);function fQ(e){return e==="width"?Ei:Os}const QGe={xOffset:1,yOffset:1};function VD(e){return e in QGe}const{text:sKn,tooltip:aKn,href:lKn,url:cKn,description:uKn,detail:fKn,key:dKn,order:hKn,...BGe}=Qde,WGe=He(BGe);function yxn(e){return!!Qde[e]}function vxn(e){switch(e){case ac:case Ap:case Rp:case Sm:case lc:case Em:case Fv:case zv:return!0;case Lv:case jv:case dx:return!1}}const qGe={...Bde,...Wde,...QGe,...BGe},dQ=He(qGe);function Cm(e){return!!qGe[e]}function bxn(e,t){return xxn(e)[t]}const VGe={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:pKn,...Oxn}=VGe;function xxn(e){switch(e){case ac:case Ap:case Rp:case uQ:case qD:case aQ:case SO:case lQ:case YE:case Em:case Lv:case jv:case Fv:case sQ:case Dg:case Mg:return VGe;case Ei:case Os:case Iv:case D_:case Ud:case Hd:return Oxn;case qd:case Pp:case Xd:case Of:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Sm:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case zv:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case lc:return{point:"always",geoshape:"always"};case WD:return{text:"always"};case dx:return{point:"always",square:"always",text:"always"};case cQ:return{image:"always"};case kf:return{text:"always",arc:"always"};case Vd:return{text:"always",arc:"always"};case wm:case xm:return{arc:"always"}}}function BU(e){switch(e){case Ei:case Os:case kf:case Vd:case Iv:case D_:case Sm:case dx:case Fv:case Em:case Lv:case jv:case qd:case Pp:case wm:case xm:return;case sQ:case Dg:case Mg:case lc:case zv:case WD:case SO:case lQ:case cQ:case uQ:return"discrete";case ac:case Ap:case Rp:return"flexible";case Ud:case Hd:case Xd:case Of:case qD:case aQ:case YE:return}}const wxn={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Sxn={count:1,min:1,max:1};function nm(e){return!!e&&!!e.argmin}function Qv(e){return!!e&&!!e.argmax}function hQ(e){return ut(e)&&!!wxn[e]}const Exn=new Set(["count","valid","missing","distinct"]);function UGe(e){return ut(e)&&Exn.has(e)}function Cxn(e){return ut(e)&&Pn(["min","max"],e)}const _xn=new Set(["count","sum","distinct","valid","missing"]),kxn=new Set(["mean","average","median","q1","q3","min","max"]);function HGe(e){return _v(e)&&(e=xQ(e,void 0)),"bin"+He(e).map(t=>pQ(e[t])?Si(`_${t}_${Q0(e[t])}`):Si(`_${t}_${e[t]}`)).join("")}function ni(e){return e===!0||px(e)&&!e.binned}function Ps(e){return e==="binned"||px(e)&&e.binned===!0}function px(e){return dt(e)}function pQ(e){return e==null?void 0:e.param}function h_e(e){switch(e){case Dg:case Mg:case Sm:case ac:case Ap:case Rp:case Fv:case Em:case Lv:case jv:case lc:return 6;case zv:return 4;default:return 10}}function UD(e){return!!(e!=null&&e.expr)}function Ll(e){const t=He(e||{}),n={};for(const r of t)n[r]=Fc(e[r]);return n}function XGe(e){const{anchor:t,frame:n,offset:r,orient:i,angle:o,limit:s,color:a,subtitleColor:l,subtitleFont:c,subtitleFontSize:u,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,v={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...r?{offset:r}:{},...i?{orient:i}:{},...o!==void 0?{angle:o}:{},...s!==void 0?{limit:s}:{}},O={...l?{subtitleColor:l}:{},...c?{subtitleFont:c}:{},...u?{subtitleFontSize:u}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},m=TE(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:v,subtitleMarkConfig:m,nonMarkTitleProperties:y,subtitle:O}}function cy(e){return ut(e)||ze(e)&&ut(e[0])}function Et(e){return!!(e!=null&&e.signal)}function Bv(e){return!!e.step}function $xn(e){return ze(e)?!1:"fields"in e&&!("data"in e)}function Txn(e){return ze(e)?!1:"fields"in e&&"data"in e}function xg(e){return ze(e)?!1:"field"in e&&"data"in e}const Pxn={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},Axn=He(Pxn),Rxn={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},ZJ=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function ZGe(e){const t=ze(e.condition)?e.condition.map(p_e):p_e(e.condition);return{...Fc(e),condition:t}}function Fc(e){if(UD(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function p_e(e){if(UD(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function ui(e){if(UD(e)){const{expr:t,...n}=e;return{signal:t,...n}}return Et(e)?e:e!==void 0?{value:e}:void 0}function Dxn(e){return Et(e)?e.signal:Je(e)}function g_e(e){return Et(e)?e.signal:Je(e.value)}function id(e){return Et(e)?e.signal:e==null?null:Je(e)}function Mxn(e,t,n){for(const r of n){const i=rm(r,t.markDef,t.config);i!==void 0&&(e[r]=ui(i))}return e}function YGe(e){return[].concat(e.type,e.style??[])}function vr(e,t,n,r={}){const{vgChannel:i,ignoreVgConfig:o}=r;return i&&t[i]!==void 0?t[i]:t[e]!==void 0?t[e]:o&&(!i||i===e)?void 0:rm(e,t,n,r)}function rm(e,t,n,{vgChannel:r}={}){return lo(r?_4(e,t,n.style):void 0,_4(e,t,n.style),r?n[t.type][r]:void 0,n[t.type][e],r?n.mark[r]:n.mark[e])}function _4(e,t,n){return GGe(e,YGe(t),n)}function GGe(e,t,n){t=ct(t);let r;for(const i of t){const o=n[i];o&&o[e]!==void 0&&(r=o[e])}return r}function KGe(e,t){return ct(e).reduce((n,r)=>(n.field.push(tt(r,t)),n.order.push(r.sort??"ascending"),n),{field:[],order:[]})}function JGe(e,t){const n=[...e];return t.forEach(r=>{for(const i of n)if(Wc(i,r))return;n.push(r)}),n}function eKe(e,t){return Wc(e,t)||!t?e:e?[...ct(e),...ct(t)].join(", "):t}function tKe(e,t){const n=e.value,r=t.value;if(n==null||r===null)return{explicit:e.explicit,value:null};if((cy(n)||Et(n))&&(cy(r)||Et(r)))return{explicit:e.explicit,value:eKe(n,r)};if(cy(n)||Et(n))return{explicit:e.explicit,value:n};if(cy(r)||Et(r))return{explicit:e.explicit,value:r};if(!cy(n)&&!Et(n)&&!cy(r)&&!Et(r))return{explicit:e.explicit,value:JGe(n,r)};throw new Error("It should never reach here")}function qde(e){return`Invalid specification ${Lr(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Nxn='Autosize "fit" only works for single views and layered views.';function m_e(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function y_e(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function v_e(e){return e?`Dropping "fit-${e}" because spec has discrete ${cc(e)}.`:'Dropping "fit" because spec has discrete size.'}function Vde(e){return`Unknown field for ${e}. Cannot calculate view size.`}function b_e(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Ixn(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Lxn(e){return`The "nearest" transform is not supported for ${e} marks.`}function nKe(e){return`Selection not supported for ${e} yet.`}function jxn(e){return`Cannot find a selection named "${e}".`}const Fxn="Scale bindings are currently only supported for scales with unbinned, continuous domains.",zxn="Legend bindings are only supported for selections over an individual field or encoding channel.";function Qxn(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function Bxn(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const Wxn="The same selection must be used to override scale domains in a layered view.",qxn='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function Vxn(e){return`Unknown repeated value "${e}".`}function O_e(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Uxn="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Hxn(e){return`Unrecognized parse "${e}".`}function x_e(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Xxn="Attempt to add the same child twice.";function Zxn(e){return`Ignoring an invalid transform: ${Lr(e)}.`}const Yxn='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function w_e(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Gxn(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Lr(t)} is overridden by a child projection ${Lr(n)}.`}const Kxn="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Jxn(e){return`${e}Offset dropped because ${e} is continuous`}function ewn(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Lr(n)}}.`}function rKe(e){return`Invalid field type "${e}".`}function twn(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function nwn(e){return`Invalid aggregation operator "${e}".`}function iKe(e,t){const{fill:n,stroke:r}=t;return`Dropping color ${e} as the plot also has ${n&&r?"fill and stroke":n?"fill":"stroke"}.`}function rwn(e){return`Position range does not support relative band size for ${e}.`}function YJ(e,t){return`Dropping ${Lr(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const iwn="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function gQ(e,t,n){return`${e} dropped as it is incompatible with "${t}"${n?` when ${n}`:""}.`}function own(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function swn(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function awn(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function lwn(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function WU(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function cwn(e){return`The ${e} for range marks cannot be an expression`}function uwn(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function fwn(e,t){return`Specified orient "${e}" overridden with "${t}".`}function dwn(e){return`Cannot use the scale property "${e}" with non-color channel.`}function hwn(e){return`Cannot use the relative band size with ${e} scale.`}function pwn(e){return`Using unaggregated domain with raw field has no effect (${Lr(e)}).`}function gwn(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function mwn(e){return`Unaggregated domain is currently unsupported for log scale (${Lr(e)}).`}function ywn(e){return`Cannot apply size to non-oriented mark "${e}".`}function vwn(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function bwn(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function oKe(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function sKe(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Own(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${Lr(n)} and ${Lr(r)}). Using ${Lr(n)}.`}function xwn(e,t,n,r){return`Conflicting ${t.toString()} property "${e.toString()}" (${Lr(n)} and ${Lr(r)}). Using the union of the two domains.`}function wwn(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function Swn(e){return`Dropping sort property ${Lr(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const S_e="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Ewn="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",Cwn="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",_wn="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function kwn(e){return`Cannot stack "${e}" if there is already "${e}2".`}function $wn(e){return`Cannot stack non-linear scale (${e}).`}function Twn(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function k4(e,t){return`Invalid ${e}: ${Lr(t)}.`}function Pwn(e){return`Dropping day from datetime ${Lr(e)} as day cannot be combined with other units.`}function Awn(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Rwn(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Dwn(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function E_e(e){return`1D error band does not support ${e}.`}function aKe(e){return`Channel ${e} is required for "binned" bin.`}function Mwn(e){return`Channel ${e} should not be used with "binned" bin.`}function Nwn(e){return`Domain for ${e} is required for threshold scale.`}const lKe=xae(Oae);let GE=lKe;function Iwn(e){return GE=e,GE}function Lwn(){return GE=lKe,GE}function Ye(...e){GE.warn(...e)}function jwn(...e){GE.debug(...e)}function gx(e){if(e&&dt(e)){for(const t of Hde)if(t in e)return!0}return!1}const cKe=["january","february","march","april","may","june","july","august","september","october","november","december"],Fwn=cKe.map(e=>e.substr(0,3)),uKe=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],zwn=uKe.map(e=>e.substr(0,3));function Qwn(e){if(v8(e)&&(e=+e),Hn(e))return e>4&&Ye(k4("quarter",e)),e-1;throw new Error(k4("quarter",e))}function Bwn(e){if(v8(e)&&(e=+e),Hn(e))return e-1;{const t=e.toLowerCase(),n=cKe.indexOf(t);if(n!==-1)return n;const r=t.substr(0,3),i=Fwn.indexOf(r);if(i!==-1)return i;throw new Error(k4("month",e))}}function Wwn(e){if(v8(e)&&(e=+e),Hn(e))return e%7;{const t=e.toLowerCase(),n=uKe.indexOf(t);if(n!==-1)return n;const r=t.substr(0,3),i=zwn.indexOf(r);if(i!==-1)return i;throw new Error(k4("day",e))}}function Ude(e,t){const n=[];if(t&&e.day!==void 0&&He(e).length>1&&(Ye(Pwn(e)),e=Xt(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const r=t?Bwn(e.month):e.month;n.push(r)}else if(e.quarter!==void 0){const r=t?Qwn(e.quarter):e.quarter;n.push(Hn(r)?r*3:`${r}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const r=t?Wwn(e.day):e.day;n.push(Hn(r)?r+1:`${r}+1`)}else n.push(1);for(const r of["hours","minutes","seconds","milliseconds"]){const i=e[r];n.push(typeof i>"u"?0:i)}return n}function EO(e){const n=Ude(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function qwn(e){const n=Ude(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function Vwn(e){const t=Ude(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const fKe={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Hde=He(fKe);function Uwn(e){return!!fKe[e]}function mx(e){return dt(e)?e.binned:dKe(e)}function dKe(e){return e&&e.startsWith("binned")}function Xde(e){return e.startsWith("utc")}function Hwn(e){return e.substring(3)}const Xwn={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function mQ(e){return Hde.filter(t=>pKe(e,t))}function hKe(e){const t=mQ(e);return t[t.length-1]}function pKe(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function Zwn(e,t,{end:n}={end:!1}){const r=ele(t),i=Xde(e)?"utc":"";function o(l){return l==="quarter"?`(${i}quarter(${r})-1)`:`${i}${l}(${r})`}let s;const a={};for(const l of Hde)pKe(e,l)&&(a[l]=o(l),s=l);return n&&(a[s]+="+1"),qwn(a)}function gKe(e){if(!e)return;const t=mQ(e);return`timeUnitSpecifier(${Lr(t)}, ${Lr(Xwn)})`}function Ywn(e,t,n){if(!e)return;const r=gKe(e);return`${n||Xde(e)?"utc":"time"}Format(${t}, ${r})`}function gs(e){if(!e)return;let t;return ut(e)?dKe(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:dt(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),Xde(t.unit)&&(t.utc=!0,t.unit=Hwn(t.unit)),t}function Gwn(e){const{utc:t,...n}=gs(e);return n.unit?(t?"utc":"")+He(n).map(r=>Si(`${r==="unit"?"":`_${r}_`}${n[r]}`)).join(""):(t?"utc":"")+"timeunit"+He(n).map(r=>Si(`_${r}_${n[r]}`)).join("")}function mKe(e,t=n=>n){const n=gs(e),r=hKe(n.unit);if(r&&r!=="day"){const i={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:o,part:s}=yKe(r,n.step),a={...i,[s]:+i[s]+o};return`${t(EO(a))} - ${t(EO(i))}`}}const Kwn={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function Jwn(e){return!!Kwn[e]}function yKe(e,t=1){if(Jwn(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function eSn(e){return e==null?void 0:e.param}function Zde(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function Yde(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function Gde(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function Kde(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function Jde(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function ehe(e){if(e!=null&&e.field){if(ze(e.range)&&e.range.length===2)return!0;if(Et(e.range))return!0}return!1}function the(e){return!!(e!=null&&e.field)&&(ze(e.oneOf)||ze(e.in))}function tSn(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function vKe(e){return the(e)||Zde(e)||ehe(e)||Yde(e)||Kde(e)||Gde(e)||Jde(e)}function ah(e,t){return wQ(e,{timeUnit:t,wrapTime:!0})}function nSn(e,t){return e.map(n=>ah(n,t))}function bKe(e,t=!0){const{field:n}=e,r=gs(e.timeUnit),{unit:i,binned:o}=r||{},s=tt(e,{expr:"datum"}),a=i?`time(${o?s:Zwn(i,n)})`:s;if(Zde(e))return`${a}===${ah(e.equal,i)}`;if(Yde(e)){const l=e.lt;return`${a}<${ah(l,i)}`}else if(Kde(e)){const l=e.gt;return`${a}>${ah(l,i)}`}else if(Gde(e)){const l=e.lte;return`${a}<=${ah(l,i)}`}else if(Jde(e)){const l=e.gte;return`${a}>=${ah(l,i)}`}else{if(the(e))return`indexof([${nSn(e.oneOf,i).join(",")}], ${a}) !== -1`;if(tSn(e))return nhe(a,e.valid);if(ehe(e)){const{range:l}=e,c=Et(l)?{signal:`${l.signal}[0]`}:l[0],u=Et(l)?{signal:`${l.signal}[1]`}:l[1];if(c!==null&&u!==null&&t)return"inrange("+a+", ["+ah(c,i)+", "+ah(u,i)+"])";const f=[];return c!==null&&f.push(`${a} >= ${ah(c,i)}`),u!==null&&f.push(`${a} <= ${ah(u,i)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Lr(e)}`)}function nhe(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function rSn(e){return vKe(e)&&e.timeUnit?{...e,timeUnit:gs(e.timeUnit)}:e}const HD={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function iSn(e){return e==="quantitative"||e==="temporal"}function OKe(e){return e==="ordinal"||e==="nominal"}const CO=HD.quantitative,rhe=HD.ordinal,KE=HD.temporal,ihe=HD.nominal,M_=HD.geojson;function oSn(e){if(e)switch(e=e.toLowerCase(),e){case"q":case CO:return"quantitative";case"t":case KE:return"temporal";case"o":case rhe:return"ordinal";case"n":case ihe:return"nominal";case M_:return"geojson"}}const ec={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},GJ={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function sSn(e,t){const n=GJ[e],r=GJ[t];return n===r||n==="ordinal-position"&&r==="time"||r==="ordinal-position"&&n==="time"}const aSn={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function C_e(e){return aSn[e]}const xKe=new Set(["linear","log","pow","sqrt","symlog"]),wKe=new Set([...xKe,"time","utc"]);function SKe(e){return xKe.has(e)}const EKe=new Set(["quantile","quantize","threshold"]),lSn=new Set([...wKe,...EKe,"sequential","identity"]),cSn=new Set(["ordinal","bin-ordinal","point","band"]);function ms(e){return cSn.has(e)}function au(e){return lSn.has(e)}function od(e){return wKe.has(e)}function JE(e){return EKe.has(e)}const uSn={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function fSn(e){return!ut(e)&&!!e.name}function CKe(e){return e==null?void 0:e.param}function dSn(e){return e==null?void 0:e.unionWith}function hSn(e){return dt(e)&&"field"in e}const pSn={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:gKn,domain:mKn,range:yKn,rangeMax:vKn,rangeMin:bKn,scheme:OKn,...gSn}=pSn,mSn=He(gSn);function KJ(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return od(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return od(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return od(e);case"nice":return od(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return au(e)&&!Pn(["log","time","utc","threshold","quantile"],e)}}function _Ke(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return FS(e)?void 0:dwn(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function ySn(e,t){return Pn([rhe,ihe],t)?e===void 0||ms(e):t===KE?Pn([ec.TIME,ec.UTC,void 0],e):t===CO?SKe(e)||JE(e)||e===void 0:!0}function vSn(e,t,n=!1){if(!Cm(e))return!1;switch(e){case Ei:case Os:case Iv:case D_:case kf:case Vd:return od(t)||t==="band"?!0:t==="point"?!n:!1;case Sm:case Fv:case Em:case Lv:case jv:case dx:return od(t)||JE(t)||Pn(["band","point","ordinal"],t);case ac:case Ap:case Rp:return t!=="band";case zv:case lc:return t==="ordinal"||JE(t)}}function ohe(e){const{channel:t,channelDef:n,markDef:r,scale:i,config:o}=e,s=ahe(e);return Ze(n)&&!UGe(n.aggregate)&&i&&od(i.get("type"))?bSn({fieldDef:n,channel:t,markDef:r,ref:s,config:o}):s}function bSn({fieldDef:e,channel:t,markDef:n,ref:r,config:i}){return kv(n.type)?r:vr("invalid",n,i)===null?[OSn(e,t),r]:r}function OSn(e,t){const n=she(e,!0),i=hx(t)==="y"?{field:{group:"height"}}:{value:0};return{test:n,...i}}function she(e,t=!0){return nhe(ut(e)?e:tt(e,{expr:"datum"}),!t)}function xSn(e){const{datum:t}=e;return gx(t)?EO(t):`${Lr(t)}`}function hb(e,t,n,r){const i={};if(t&&(i.scale=t),Np(e)){const{datum:o}=e;gx(o)?i.signal=EO(o):Et(o)?i.signal=o.signal:UD(o)?i.signal=o.expr:i.value=o}else i.field=tt(e,n);if(r){const{offset:o,band:s}=r;o&&(i.offset=o),s&&(i.band=s)}return i}function $4({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:r,startSuffix:i,endSuffix:o="end",bandPosition:s=.5}){const a=!Et(s)&&0<s&&s<1?"datum":void 0,l=tt(t,{expr:a,suffix:i}),c=n!==void 0?tt(n,{expr:a}):tt(t,{suffix:o,expr:a}),u={};if(s===0||s===1){u.scale=e;const f=s===0?l:c;u.field=f}else{const f=Et(s)?`(1-${s.signal}) * ${l} + ${s.signal} * ${c}`:`${1-s} * ${l} + ${s} * ${c}`;u.signal=`scale("${e}", ${f})`}return r&&(u.offset=r),u}function wSn({scaleName:e,fieldDef:t}){const n=tt(t,{expr:"datum"}),r=tt(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${r}) - scale("${e}", ${n}))`}function ahe({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:s,stack:a,offset:l,defaultRef:c,bandPosition:u}){if(t){if(Jt(t)){const f=s==null?void 0:s.get("type");if(El(t)){u??(u=ev({fieldDef:t,fieldDef2:n,markDef:r,config:i}));const{bin:d,timeUnit:h,type:p}=t;if(ni(d)||u&&h&&p===KE)return a!=null&&a.impute?hb(t,o,{binSuffix:"mid"},{offset:l}):u&&!ms(f)?$4({scaleName:o,fieldOrDatumDef:t,bandPosition:u,offset:l}):hb(t,o,GD(t,e)?{binSuffix:"range"}:{},{offset:l});if(Ps(d)){if(Ze(n))return $4({scaleName:o,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:u,offset:l});Ye(aKe(e===Ei?qd:Pp))}}return hb(t,o,ms(f)?{binSuffix:"range"}:{},{offset:l,band:f==="band"?u??t.bandPosition??.5:void 0})}else if(Rd(t)){const f=t.value,d=l?{offset:l}:{};return{...i2(e,f),...d}}}return ln(c)&&(c=c()),c&&{...c,...l?{offset:l}:{}}}function i2(e,t){return Pn(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:Pn(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:ui(t)}function _O(e){return e&&e!=="number"&&e!=="time"}function kKe(e,t,n){return`${e}(${t}${n?`, ${Lr(n)}`:""})`}const SSn=" – ";function lhe({fieldOrDatumDef:e,format:t,formatType:n,expr:r,normalizeStack:i,config:o}){var l,c;if(_O(n))return sd({fieldOrDatumDef:e,format:t,formatType:n,expr:r,config:o});const s=$Ke(e,r,i),a=eC(e);if(t===void 0&&n===void 0&&o.customFormatTypes){if(a==="quantitative"){if(i&&o.normalizedNumberFormatType)return sd({fieldOrDatumDef:e,format:o.normalizedNumberFormat,formatType:o.normalizedNumberFormatType,expr:r,config:o});if(o.numberFormatType)return sd({fieldOrDatumDef:e,format:o.numberFormat,formatType:o.numberFormatType,expr:r,config:o})}if(a==="temporal"&&o.timeFormatType&&Ze(e)&&e.timeUnit===void 0)return sd({fieldOrDatumDef:e,format:o.timeFormat,formatType:o.timeFormatType,expr:r,config:o})}if(nC(e)){const u=CSn({field:s,timeUnit:Ze(e)?(l=gs(e.timeUnit))==null?void 0:l.unit:void 0,format:t,formatType:o.timeFormatType,rawTimeFormat:o.timeFormat,isUTCScale:yx(e)&&((c=e.scale)==null?void 0:c.type)===ec.UTC});return u?{signal:u}:void 0}if(t=JJ({type:a,specifiedFormat:t,config:o,normalizeStack:i}),Ze(e)&&ni(e.bin)){const u=tt(e,{expr:r,binSuffix:"end"});return{signal:XD(s,u,t,n,o)}}else return t||eC(e)==="quantitative"?{signal:`${AKe(s,t)}`}:{signal:`isValid(${s}) ? ${s} : ""+${s}`}}function $Ke(e,t,n){return Ze(e)?n?`${tt(e,{expr:t,suffix:"end"})}-${tt(e,{expr:t,suffix:"start"})}`:tt(e,{expr:t}):xSn(e)}function sd({fieldOrDatumDef:e,format:t,formatType:n,expr:r,normalizeStack:i,config:o,field:s}){if(s??(s=$Ke(e,r,i)),s!=="datum.value"&&Ze(e)&&ni(e.bin)){const a=tt(e,{expr:r,binSuffix:"end"});return{signal:XD(s,a,t,n,o)}}return{signal:kKe(n,s,t)}}function TKe(e,t,n,r,i,o){var s;if(!(ut(r)&&_O(r))&&!(n===void 0&&r===void 0&&i.customFormatTypes&&eC(e)==="quantitative"&&(i.normalizedNumberFormatType&&tC(e)&&e.stack==="normalize"||i.numberFormatType))){if(tC(e)&&e.stack==="normalize"&&i.normalizedNumberFormat)return JJ({type:"quantitative",config:i,normalizeStack:!0});if(nC(e)){const a=Ze(e)?(s=gs(e.timeUnit))==null?void 0:s.unit:void 0;return a===void 0&&i.customFormatTypes&&i.timeFormatType?void 0:ESn({specifiedFormat:n,timeUnit:a,config:i,omitTimeFormatConfig:o})}return JJ({type:t,specifiedFormat:n,config:i})}}function PKe(e,t,n){var r;if(e&&(Et(e)||e==="number"||e==="time"))return e;if(nC(t)&&n!=="time"&&n!=="utc")return Ze(t)&&((r=gs(t==null?void 0:t.timeUnit))!=null&&r.utc)?"utc":"time"}function JJ({type:e,specifiedFormat:t,config:n,normalizeStack:r}){if(ut(t))return t;if(e===CO)return r?n.normalizedNumberFormat:n.numberFormat}function ESn({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:r}){return e||(t?{signal:gKe(t)}:r?void 0:n.timeFormat)}function AKe(e,t){return`format(${e}, "${t||""}")`}function __e(e,t,n,r){return _O(n)?kKe(n,e,t):AKe(e,(ut(t)?t:void 0)??r.numberFormat)}function XD(e,t,n,r,i){if(n===void 0&&r===void 0&&i.customFormatTypes&&i.numberFormatType)return XD(e,t,i.numberFormat,i.numberFormatType,i);const o=__e(e,n,r,i),s=__e(t,n,r,i);return`${nhe(e,!1)} ? "null" : ${o} + "${SSn}" + ${s}`}function CSn({field:e,timeUnit:t,format:n,formatType:r,rawTimeFormat:i,isUTCScale:o}){return!t||n?!t&&r?`${r}(${e}, '${n}')`:(n=ut(n)?n:i,`${o?"utc":"time"}Format(${e}, '${n}')`):Ywn(t,e,o)}const yQ="min",_Sn={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function k_e(e){return e in _Sn}function RKe(e){return!!(e!=null&&e.encoding)}function Vh(e){return e&&(e.op==="count"||!!e.field)}function DKe(e){return e&&ze(e)}function ZD(e){return"row"in e||"column"in e}function che(e){return!!e&&"header"in e}function vQ(e){return"facet"in e}function kSn(e){return e.param}function $Sn(e){return e&&!ut(e)&&"repeat"in e}function $_e(e){const{field:t,timeUnit:n,bin:r,aggregate:i}=e;return{...n?{timeUnit:n}:{},...r?{bin:r}:{},...i?{aggregate:i}:{},field:t}}function uhe(e){return"sort"in e}function ev({fieldDef:e,fieldDef2:t,markDef:n,config:r}){if(Jt(e)&&e.bandPosition!==void 0)return e.bandPosition;if(Ze(e)){const{timeUnit:i,bin:o}=e;if(i&&!t)return rm("timeUnitBandPosition",n,r);if(ni(o))return .5}}function MKe({channel:e,fieldDef:t,fieldDef2:n,markDef:r,config:i,scaleType:o,useVlSizeChannel:s}){var c,u,f;const a=cc(e),l=vr(s?"size":a,r,i,{vgChannel:a});if(l!==void 0)return l;if(Ze(t)){const{timeUnit:d,bin:h}=t;if(d&&!n)return{band:rm("timeUnitBandSize",r,i)};if(ni(h)&&!ms(o))return{band:1}}if(FP(r.type))return o?ms(o)?((c=i[r.type])==null?void 0:c.discreteBandSize)||{band:1}:(u=i[r.type])==null?void 0:u.continuousBandSize:(f=i[r.type])==null?void 0:f.discreteBandSize}function NKe(e,t,n,r){return ni(e.bin)||e.timeUnit&&El(e)&&e.type==="temporal"?ev({fieldDef:e,fieldDef2:t,markDef:n,config:r})!==void 0:!1}function IKe(e){return e&&!!e.sort&&!e.field}function bQ(e){return e&&"condition"in e}function OQ(e){const t=e==null?void 0:e.condition;return!!t&&!ze(t)&&Ze(t)}function YD(e){const t=e==null?void 0:e.condition;return!!t&&!ze(t)&&Jt(t)}function TSn(e){const t=e==null?void 0:e.condition;return!!t&&(ze(t)||Rd(t))}function Ze(e){return e&&(!!e.field||e.aggregate==="count")}function eC(e){return e==null?void 0:e.type}function Np(e){return e&&"datum"in e}function zy(e){return El(e)&&!P4(e)||T4(e)}function T_e(e){return El(e)&&e.type==="quantitative"&&!e.bin||T4(e)}function T4(e){return Np(e)&&Hn(e.datum)}function Jt(e){return Ze(e)||Np(e)}function El(e){return e&&("field"in e||e.aggregate==="count")&&"type"in e}function Rd(e){return e&&"value"in e&&"value"in e}function yx(e){return e&&("scale"in e||"sort"in e)}function tC(e){return e&&("axis"in e||"stack"in e||"impute"in e)}function LKe(e){return e&&"legend"in e}function jKe(e){return e&&("format"in e||"formatType"in e)}function PSn(e){return Gl(e,["legend","axis","header","scale"])}function ASn(e){return"op"in e}function tt(e,t={}){let n=e.field;const r=t.prefix;let i=t.suffix,o="";if(DSn(e))n=wQe("count");else{let s;if(!t.nofn)if(ASn(e))s=e.op;else{const{bin:a,aggregate:l,timeUnit:c}=e;ni(a)?(s=HGe(a),i=(t.binSuffix??"")+(t.suffix??"")):l?Qv(l)?(o=`["${n}"]`,n=`argmax_${l.argmax}`):nm(l)?(o=`["${n}"]`,n=`argmin_${l.argmin}`):s=String(l):c&&!mx(c)&&(s=Gwn(c),i=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}s&&(n=n?`${s}_${n}`:s)}return i&&(n=`${n}_${i}`),r&&(n=`${r}_${n}`),t.forAs?tle(n):t.expr?bQe(n,t.expr)+o:mf(n)+o}function P4(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return Ze(e)&&!!e.bin;case"temporal":return!1}throw new Error(rKe(e.type))}function RSn(e){var t;return yx(e)&&JE((t=e.scale)==null?void 0:t.type)}function DSn(e){return e.aggregate==="count"}function MSn(e,t){var s;const{field:n,bin:r,timeUnit:i,aggregate:o}=e;if(o==="count")return t.countTitle;if(ni(r))return`${n} (binned)`;if(i&&!mx(i)){const a=(s=gs(i))==null?void 0:s.unit;if(a)return`${n} (${mQ(a).join("-")})`}else if(o)return Qv(o)?`${n} for max ${o.argmax}`:nm(o)?`${n} for min ${o.argmin}`:`${rD(o)} of ${n}`;return n}function NSn(e){const{aggregate:t,bin:n,timeUnit:r,field:i}=e;if(Qv(t))return`${i} for argmax(${t.argmax})`;if(nm(t))return`${i} for argmin(${t.argmin})`;const o=r&&!mx(r)?gs(r):void 0,s=t||(o==null?void 0:o.unit)||(o==null?void 0:o.maxbins)&&"timeunit"||ni(n)&&"bin";return s?`${s.toUpperCase()}(${i})`:i}const FKe=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return NSn(e);default:return MSn(e,t)}};let zKe=FKe;function QKe(e){zKe=e}function ISn(){QKe(FKe)}function zS(e,t,{allowDisabling:n,includeDefault:r=!0}){var a;const i=(a=fhe(e))==null?void 0:a.title;if(!Ze(e))return i??e.title;const o=e,s=r?dhe(o,t):void 0;return n?lo(i,o.title,s):i??o.title??s}function fhe(e){if(tC(e)&&e.axis)return e.axis;if(LKe(e)&&e.legend)return e.legend;if(che(e)&&e.header)return e.header}function dhe(e,t){return zKe(e,t)}function A4(e){if(jKe(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=fhe(e)??{},{format:n,formatType:r}=t;return{format:n,formatType:r}}}function LSn(e,t){var o;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(uhe(e)&&ze(e.sort))return"ordinal";const{aggregate:n,bin:r,timeUnit:i}=e;if(i)return"temporal";if(r||n&&!Qv(n)&&!nm(n))return"quantitative";if(yx(e)&&((o=e.scale)!=null&&o.type))switch(GJ[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function up(e){if(Ze(e))return e;if(OQ(e))return e.condition}function Xo(e){if(Jt(e))return e;if(YD(e))return e.condition}function BKe(e,t,n,r={}){if(ut(e)||Hn(e)||_v(e)){const i=ut(e)?"string":Hn(e)?"number":"boolean";return Ye(ewn(t,i,e)),{value:e}}return Jt(e)?R4(e,t,n,r):YD(e)?{...e,condition:R4(e.condition,t,n,r)}:e}function R4(e,t,n,r){if(jKe(e)){const{format:i,formatType:o,...s}=e;if(_O(o)&&!n.customFormatTypes)return Ye(w_e(t)),R4(s,t,n,r)}else{const i=tC(e)?"axis":LKe(e)?"legend":che(e)?"header":null;if(i&&e[i]){const{format:o,formatType:s,...a}=e[i];if(_O(s)&&!n.customFormatTypes)return Ye(w_e(t)),R4({...e,[i]:a},t,n,r)}}return Ze(e)?hhe(e,t,r):jSn(e)}function jSn(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Hn(n)?"quantitative":ut(n)?"nominal":gx(n)?"temporal":void 0,{...e,type:t}}function hhe(e,t,{compositeMark:n=!1}={}){const{aggregate:r,timeUnit:i,bin:o,field:s}=e,a={...e};if(!n&&r&&!hQ(r)&&!Qv(r)&&!nm(r)&&(Ye(nwn(r)),delete a.aggregate),i&&(a.timeUnit=gs(i)),s&&(a.field=`${s}`),ni(o)&&(a.bin=xQ(o,t)),Ps(o)&&!co(t)&&Ye(Mwn(t)),El(a)){const{type:l}=a,c=oSn(l);l!==c&&(a.type=c),l!=="quantitative"&&UGe(r)&&(Ye(twn(l,r)),a.type="quantitative")}else if(!FGe(t)){const l=LSn(a,t);a.type=l}if(El(a)){const{compatible:l,warning:c}=FSn(a,t)||{};l===!1&&Ye(c)}if(uhe(a)&&ut(a.sort)){const{sort:l}=a;if(k_e(l))return{...a,sort:{encoding:l}};const c=l.substr(1);if(l.charAt(0)==="-"&&k_e(c))return{...a,sort:{encoding:c,order:"descending"}}}if(che(a)){const{header:l}=a;if(l){const{orient:c,...u}=l;if(c)return{...a,header:{...u,labelOrient:l.labelOrient||c,titleOrient:l.titleOrient||c}}}}return a}function xQ(e,t){return _v(e)?{maxbins:h_e(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:h_e(t)}:e}const Kx={compatible:!0};function FSn(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Dg:case Mg:case sQ:return P4(e)?Kx:{compatible:!1,warning:swn(t)};case Ei:case Os:case Iv:case D_:case ac:case Ap:case Rp:case WD:case qD:case aQ:case SO:case lQ:case cQ:case dx:case kf:case Vd:case uQ:return Kx;case Hd:case Of:case Ud:case Xd:return n!==CO?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:Kx;case Em:case Lv:case jv:case Fv:case Sm:case wm:case xm:case qd:case Pp:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:Kx;case lc:case zv:return!P4(e)&&!RSn(e)?{compatible:!1,warning:awn(t)}:Kx;case YE:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:Kx}}function nC(e){const{formatType:t}=A4(e);return t==="time"||!t&&zSn(e)}function zSn(e){return e&&(e.type==="temporal"||Ze(e)&&!!e.timeUnit)}function wQ(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){var l;const o=t&&((l=gs(t))==null?void 0:l.unit);let s=o||n==="temporal",a;return UD(e)?a=e.expr:Et(e)?a=e.signal:gx(e)?(s=!0,a=EO(e)):(ut(e)||Hn(e))&&s&&(a=`datetime(${Lr(e)})`,Uwn(o)&&(Hn(e)&&e<1e4||ut(e)&&isNaN(Date.parse(e)))&&(a=EO({[o]:e}))),a?r&&s?`time(${a})`:a:i?void 0:Lr(e)}function WKe(e,t){const{type:n}=e;return t.map(r=>{const i=Ze(e)&&!mx(e.timeUnit)?e.timeUnit:void 0,o=wQ(r,{timeUnit:i,type:n,undefinedIfExprNotRequired:!0});return o!==void 0?{signal:o}:r})}function GD(e,t){return ni(e.bin)?Cm(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const P_e={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function KD(e){return e==null?void 0:e.condition}const qKe=["domain","grid","labels","ticks","title"],QSn={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},VKe={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},BSn={...VKe,style:1,labelExpr:1,encoding:1};function A_e(e){return!!BSn[e]}const WSn={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},UKe=He(WSn);function _m(e){return"mark"in e}class SQ{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return _m(t)?yUt(t.mark)===this.name:!1}}function pb(e,t){const n=e&&e[t];return n?ze(n)?oO(n,r=>!!r.field):Ze(n)||OQ(n):!1}function HKe(e,t){const n=e&&e[t];return n?ze(n)?oO(n,r=>!!r.field):Ze(n)||Np(n)||YD(n):!1}function XKe(e,t){if(co(t)){const n=e[t];if((Ze(n)||Np(n))&&(OKe(n.type)||Ze(n)&&n.timeUnit)){const r=zde(t);return HKe(e,r)}}return!1}function phe(e){return oO(lxn,t=>{if(pb(e,t)){const n=e[t];if(ze(n))return oO(n,r=>!!r.aggregate);{const r=up(n);return r&&!!r.aggregate}}return!1})}function ZKe(e,t){const n=[],r=[],i=[],o=[],s={};return ghe(e,(a,l)=>{if(Ze(a)){const{field:c,aggregate:u,bin:f,timeUnit:d,...h}=a;if(u||d||f){const p=fhe(a),g=p==null?void 0:p.title;let v=tt(a,{forAs:!0});const y={...g?[]:{title:zS(a,t,{allowDisabling:!0})},...h,field:v};if(u){let O;if(Qv(u)?(O="argmax",v=tt({op:"argmax",field:u.argmax},{forAs:!0}),y.field=`${v}.${c}`):nm(u)?(O="argmin",v=tt({op:"argmin",field:u.argmin},{forAs:!0}),y.field=`${v}.${c}`):u!=="boxplot"&&u!=="errorbar"&&u!=="errorband"&&(O=u),O){const m={op:O,as:v};c&&(m.field=c),o.push(m)}}else if(n.push(v),El(a)&&ni(f)){if(r.push({bin:f,field:c,as:v}),n.push(tt(a,{binSuffix:"end"})),GD(a,l)&&n.push(tt(a,{binSuffix:"range"})),co(l)){const O={field:`${v}_end`};s[`${l}2`]=O}y.bin="binned",FGe(l)||(y.type=CO)}else if(d&&!mx(d)){i.push({timeUnit:d,field:c,as:v});const O=El(a)&&a.type!==KE&&"time";O&&(l===WD||l===SO?y.formatType=O:yxn(l)?y.legend={formatType:O,...y.legend}:co(l)&&(y.axis={formatType:O,...y.axis}))}s[l]=y}else n.push(c),s[l]=e[l]}else s[l]=e[l]}),{bins:r,timeUnits:i,aggregate:o,groupby:n,encoding:s}}function qSn(e,t,n){const r=bxn(t,n);if(r){if(r==="binned"){const i=e[t===qd?Ei:Os];return!!(Ze(i)&&Ze(e[t])&&Ps(i.bin))}}else return!1;return!0}function VSn(e,t,n,r){const i={};for(const o of He(e))jGe(o)||Ye(own(o));for(let o of pxn){if(!e[o])continue;const s=e[o];if(VD(o)){const a=hxn(o),l=i[a];if(Ze(l)&&iSn(l.type)&&Ze(s)&&!l.timeUnit){Ye(Jxn(a));continue}}if(o==="angle"&&t==="arc"&&!e.theta&&(Ye(Kxn),o=kf),!qSn(e,o,t)){Ye(gQ(o,t));continue}if(o===Sm&&t==="line"){const a=up(e[o]);if(a!=null&&a.aggregate){Ye(iwn);continue}}if(o===ac&&(n?"fill"in e:"stroke"in e)){Ye(iKe("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(o===qD||o===YE&&!ze(s)&&!Rd(s)||o===SO&&ze(s)){if(s){if(o===YE){const a=e[o];if(IKe(a)){i[o]=a;continue}}i[o]=ct(s).reduce((a,l)=>(Ze(l)?a.push(hhe(l,o)):Ye(YJ(l,o)),a),[])}}else{if(o===SO&&s===null)i[o]=null;else if(!Ze(s)&&!Np(s)&&!Rd(s)&&!bQ(s)&&!Et(s)){Ye(YJ(s,o));continue}i[o]=BKe(s,o,r)}}return i}function EQ(e,t){const n={};for(const r of He(e)){const i=BKe(e[r],r,t,{compositeMark:!0});n[r]=i}return n}function USn(e){const t=[];for(const n of He(e))if(pb(e,n)){const r=e[n],i=ct(r);for(const o of i)Ze(o)?t.push(o):OQ(o)&&t.push(o.condition)}return t}function ghe(e,t,n){if(e)for(const r of He(e)){const i=e[r];if(ze(i))for(const o of i)t.call(n,o,r);else t.call(n,i,r)}}function HSn(e,t,n,r){return e?He(e).reduce((i,o)=>{const s=e[o];return ze(s)?s.reduce((a,l)=>t.call(r,a,l,o),i):t.call(r,i,s,o)},n):n}function YKe(e,t){return He(t).reduce((n,r)=>{switch(r){case Ei:case Os:case lQ:case uQ:case cQ:case qd:case Pp:case Iv:case D_:case kf:case wm:case Vd:case xm:case Ud:case Hd:case Xd:case Of:case WD:case lc:case dx:case SO:return n;case YE:if(e==="line"||e==="trail")return n;case qD:case aQ:{const i=t[r];if(ze(i)||Ze(i))for(const o of ct(i))o.aggregate||n.push(tt(o,{}));return n}case Sm:if(e==="trail")return n;case ac:case Ap:case Rp:case Em:case Lv:case jv:case zv:case Fv:{const i=up(t[r]);return i&&!i.aggregate&&n.push(tt(i,{})),n}}},[])}function XSn(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let r,i;if(ze(t)){for(const o of t)o.aggregate?(r||(r=[]),r.push(o)):(i||(i=[]),i.push(o));r&&(n.tooltip=r)}else t.aggregate?n.tooltip=t:i=t;return ze(i)&&i.length===1&&(i=i[0]),{customTooltipWithoutAggregatedField:i,filteredEncoding:n}}function eee(e,t,n,r=!0){if("tooltip"in n)return{tooltip:n.tooltip};const i=e.map(({fieldPrefix:s,titlePrefix:a})=>{const l=r?` of ${mhe(t)}`:"";return{field:s+t.field,type:t.type,title:Et(a)?{signal:`${a}"${escape(l)}"`}:a+l}}),o=USn(n).map(PSn);return{tooltip:[...i,...Ah(o,Nn)]}}function mhe(e){const{title:t,field:n}=e;return lo(t,n)}function yhe(e,t,n,r,i){const{scale:o,axis:s}=n;return({partName:a,mark:l,positionPrefix:c,endPositionPrefix:u=void 0,extraEncoding:f={}})=>{const d=mhe(n);return GKe(e,a,i,{mark:l,encoding:{[t]:{field:`${c}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...o!==void 0?{scale:o}:{},...s!==void 0?{axis:s}:{}},...ut(u)?{[`${t}2`]:{field:`${u}_${n.field}`}}:{},...r,...f}})}}function GKe(e,t,n,r){const{clip:i,color:o,opacity:s}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...r,mark:{...n[t],...i?{clip:i}:{},...o?{color:o}:{},...s?{opacity:s}:{},...ap(r.mark)?r.mark:{type:r.mark},style:`${a}-${String(t)}`,..._v(e[t])?{}:e[t]}}]:[]}function KKe(e,t,n){const{encoding:r}=e,i=t==="vertical"?"y":"x",o=r[i],s=r[`${i}2`],a=r[`${i}Error`],l=r[`${i}Error2`];return{continuousAxisChannelDef:yI(o,n),continuousAxisChannelDef2:yI(s,n),continuousAxisChannelDefError:yI(a,n),continuousAxisChannelDefError2:yI(l,n),continuousAxis:i}}function yI(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...r}=e;return n!==t&&Ye(Dwn(n,t)),r}else return e}function JKe(e,t){const{mark:n,encoding:r}=e,{x:i,y:o}=r;if(ap(n)&&n.orient)return n.orient;if(zy(i)){if(zy(o)){const s=Ze(i)&&i.aggregate,a=Ze(o)&&o.aggregate;if(!s&&a===t)return"vertical";if(!a&&s===t)return"horizontal";if(s===t&&a===t)throw new Error("Both x and y cannot have aggregate");return nC(o)&&!nC(i)?"horizontal":"vertical"}return"horizontal"}else{if(zy(o))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const D4="boxplot",ZSn=["box","median","outliers","rule","ticks"],YSn=new SQ(D4,tJe);function eJe(e){return Hn(e)?"tukey":e}function tJe(e,{config:t}){e={...e,encoding:EQ(e.encoding,t)};const{mark:n,encoding:r,params:i,projection:o,...s}=e,a=ap(n)?n:{type:n};i&&Ye(nKe("boxplot"));const l=a.extent??t.boxplot.extent,c=vr("size",a,t),u=a.invalid,f=eJe(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:v,groupby:y,aggregate:O,encodingWithoutContinuousAxis:m,ticksOrient:w,boxOrient:S,customTooltipWithoutAggregatedField:E}=GSn(e,l,t),{color:C,size:k,...P}=m,D=je=>yhe(a,v,g,je,t.boxplot),M=D(P),L=D(m),A=D({...P,...k?{size:k}:{}}),T=eee([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,m),N={type:"tick",color:"black",opacity:1,orient:w,invalid:u,aria:!1},j=f==="min-max"?T:eee([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,m),z=[...M({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:j}),...M({partName:"rule",mark:{type:"rule",invalid:u,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:j}),...M({partName:"ticks",mark:N,positionPrefix:"lower_whisker",extraEncoding:j}),...M({partName:"ticks",mark:N,positionPrefix:"upper_whisker",extraEncoding:j})],W=[...f!=="tukey"?z:[],...L({partName:"box",mark:{type:"bar",...c?{size:c}:{},orient:S,invalid:u,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:T}),...A({partName:"median",mark:{type:"tick",invalid:u,...dt(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...c?{size:c}:{},orient:w,aria:!1},positionPrefix:"mid_box",extraEncoding:T})];if(f==="min-max")return{...s,transform:(s.transform??[]).concat(p),layer:W};const F=`datum["lower_box_${g.field}"]`,q=`datum["upper_box_${g.field}"]`,U=`(${q} - ${F})`,V=`${F} - ${l} * ${U}`,H=`${q} + ${l} * ${U}`,Z=`datum["${g.field}"]`,ee={joinaggregate:nJe(g.field),groupby:y},se={transform:[{filter:`(${V} <= ${Z}) && (${Z} <= ${H})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${g.field}`},{op:"max",field:g.field,as:`upper_whisker_${g.field}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${g.field}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${g.field}`},...O],groupby:y}],layer:z},{tooltip:fe,...ce}=P,{scale:ae,axis:de}=g,me=mhe(g),te=Gl(de,["title"]),Ee=GKe(a,"outliers",t.boxplot,{transform:[{filter:`(${Z} < ${V}) || (${Z} > ${H})`}],mark:"point",encoding:{[v]:{field:g.field,type:g.type,...me!==void 0?{title:me}:{},...ae!==void 0?{scale:ae}:{},...Ir(te)?{}:{axis:te}},...ce,...C?{color:C}:{},...E?{tooltip:E}:{}}})[0];let we;const ke=[...d,...h,ee];return Ee?we={transform:ke,layer:[Ee,se]}:(we=se,we.transform.unshift(...ke)),{...s,layer:[we,{transform:p,layer:W}]}}function nJe(e){return[{op:"q1",field:e,as:`lower_box_${e}`},{op:"q3",field:e,as:`upper_box_${e}`}]}function GSn(e,t,n){const r=JKe(e,D4),{continuousAxisChannelDef:i,continuousAxis:o}=KKe(e,r,D4),s=i.field,a=eJe(t),l=[...nJe(s),{op:"median",field:s,as:`mid_box_${s}`},{op:"min",field:s,as:(a==="min-max"?"lower_whisker_":"min_")+s},{op:"max",field:s,as:(a==="min-max"?"upper_whisker_":"max_")+s}],c=a==="min-max"||a==="tukey"?[]:[{calculate:`datum["upper_box_${s}"] - datum["lower_box_${s}"]`,as:`iqr_${s}`},{calculate:`min(datum["upper_box_${s}"] + datum["iqr_${s}"] * ${t}, datum["max_${s}"])`,as:`upper_whisker_${s}`},{calculate:`max(datum["lower_box_${s}"] - datum["iqr_${s}"] * ${t}, datum["min_${s}"])`,as:`lower_whisker_${s}`}],{[o]:u,...f}=e.encoding,{customTooltipWithoutAggregatedField:d,filteredEncoding:h}=XSn(f),{bins:p,timeUnits:g,aggregate:v,groupby:y,encoding:O}=ZKe(h,n),m=r==="vertical"?"horizontal":"vertical",w=r,S=[...p,...g,{aggregate:[...v,...l],groupby:y},...c];return{bins:p,timeUnits:g,transform:S,groupby:y,aggregate:v,continuousAxisChannelDef:i,continuousAxis:o,encodingWithoutContinuousAxis:O,ticksOrient:m,boxOrient:w,customTooltipWithoutAggregatedField:d}}const vhe="errorbar",KSn=["ticks","rule"],JSn=new SQ(vhe,rJe);function rJe(e,{config:t}){e={...e,encoding:EQ(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,ticksOrient:s,markDef:a,outerSpec:l,tooltipEncoding:c}=iJe(e,vhe,t);delete o.size;const u=yhe(a,i,r,o,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:s,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...u({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:c}),...u({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:c}),...u({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:c})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function eEn(e,t){const{encoding:n}=e;if(tEn(n))return{orient:JKe(e,t),inputType:"raw"};const r=nEn(n),i=rEn(n),o=n.x,s=n.y;if(r){if(i)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,l=n.y2;if(Jt(a)&&Jt(l))throw new Error(`${t} cannot have both x2 and y2`);if(Jt(a)){if(zy(o))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(Jt(l)){if(zy(s))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,l=n.xError2,c=n.yError,u=n.yError2;if(Jt(l)&&!Jt(a))throw new Error(`${t} cannot have xError2 without xError`);if(Jt(u)&&!Jt(c))throw new Error(`${t} cannot have yError2 without yError`);if(Jt(a)&&Jt(c))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Jt(a)){if(zy(o))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(Jt(c)){if(zy(s))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function tEn(e){return(Jt(e.x)||Jt(e.y))&&!Jt(e.x2)&&!Jt(e.y2)&&!Jt(e.xError)&&!Jt(e.xError2)&&!Jt(e.yError)&&!Jt(e.yError2)}function nEn(e){return Jt(e.x2)||Jt(e.y2)}function rEn(e){return Jt(e.xError)||Jt(e.xError2)||Jt(e.yError)||Jt(e.yError2)}function iJe(e,t,n){const{mark:r,encoding:i,params:o,projection:s,...a}=e,l=ap(r)?r:{type:r};o&&Ye(nKe(t));const{orient:c,inputType:u}=eEn(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=KKe(e,c,t),{errorBarSpecificAggregate:v,postAggregateCalculates:y,tooltipSummary:O,tooltipTitleWithFieldName:m}=iEn(l,f,d,h,p,u,t,n),{[g]:w,[g==="x"?"x2":"y2"]:S,[g==="x"?"xError":"yError"]:E,[g==="x"?"xError2":"yError2"]:C,...k}=i,{bins:P,timeUnits:D,aggregate:M,groupby:L,encoding:A}=ZKe(k,n),T=[...M,...v],N=u!=="raw"?[]:L,j=eee(O,f,A,m);return{transform:[...a.transform??[],...P,...D,...T.length===0?[]:[{aggregate:T,groupby:N}],...y],groupby:N,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:A,ticksOrient:c==="vertical"?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:j}}function iEn(e,t,n,r,i,o,s,a){let l=[],c=[];const u=t.field;let f,d=!1;if(o==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&Ye(Rwn(h,p,s)),p==="stderr"||p==="stdev")l=[{op:p,field:u,as:`extent_${u}`},{op:h,field:u,as:`center_${u}`}],c=[{calculate:`datum["center_${u}"] + datum["extent_${u}"]`,as:`upper_${u}`},{calculate:`datum["center_${u}"] - datum["extent_${u}"]`,as:`lower_${u}`}],f=[{fieldPrefix:"center_",titlePrefix:rD(h)},{fieldPrefix:"upper_",titlePrefix:R_e(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:R_e(h,p,"-")}],d=!0;else{let g,v,y;p==="ci"?(g="mean",v="ci0",y="ci1"):(g="median",v="q1",y="q3"),l=[{op:v,field:u,as:`lower_${u}`},{op:y,field:u,as:`upper_${u}`},{op:g,field:u,as:`center_${u}`}],f=[{fieldPrefix:"upper_",titlePrefix:zS({field:u,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:zS({field:u,aggregate:v,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:zS({field:u,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&Ye(Awn(e.center,e.extent)),o==="aggregated-upper-lower"?(f=[],c=[{calculate:`datum["${n.field}"]`,as:`upper_${u}`},{calculate:`datum["${u}"]`,as:`lower_${u}`}]):o==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:u}],c=[{calculate:`datum["${u}"] + datum["${r.field}"]`,as:`upper_${u}`}],i?c.push({calculate:`datum["${u}"] + datum["${i.field}"]`,as:`lower_${u}`}):c.push({calculate:`datum["${u}"] - datum["${r.field}"]`,as:`lower_${u}`}));for(const h of c)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:sO(sO(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:c,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}function R_e(e,t,n){return`${rD(e)} ${n} ${t}`}const bhe="errorband",oEn=["band","borders"],sEn=new SQ(bhe,oJe);function oJe(e,{config:t}){e={...e,encoding:EQ(e.encoding,t)};const{transform:n,continuousAxisChannelDef:r,continuousAxis:i,encodingWithoutContinuousAxis:o,markDef:s,outerSpec:a,tooltipEncoding:l}=iJe(e,bhe,t),c=s,u=yhe(c,i,r,o,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...c.interpolate?{interpolate:c.interpolate}:{},...c.tension&&c.interpolate?{tension:c.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):c.interpolate?Ye(E_e("interpolate")):c.tension&&Ye(E_e("tension")),{...a,transform:n,layer:[...u({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...u({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const sJe={};function Ohe(e,t,n){const r=new SQ(e,t);sJe[e]={normalizer:r,parts:n}}function aEn(){return He(sJe)}Ohe(D4,tJe,ZSn);Ohe(vhe,rJe,KSn);Ohe(bhe,oJe,oEn);const lEn=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],aJe={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},lJe={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},cEn=He(aJe),uEn=He(lJe),fEn={header:1,headerRow:1,headerColumn:1,headerFacet:1},cJe=He(fEn),uJe=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],dEn={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},hEn={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Dd="_vgsid_",pEn={point:{on:"click",fields:[Dd],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function xhe(e){return e==="legend"||!!(e!=null&&e.legend)}function qU(e){return xhe(e)&&dt(e)}function whe(e){return!!(e!=null&&e.select)}function fJe(e){const t=[];for(const n of e||[]){if(whe(n))continue;const{expr:r,bind:i,...o}=n;if(i&&r){const s={...o,bind:i,init:r};t.push(s)}else{const s={...o,...r?{update:r}:{},...i?{bind:i}:{}};t.push(s)}}return t}function gEn(e){return CQ(e)||Ehe(e)||She(e)}function She(e){return"concat"in e}function CQ(e){return"vconcat"in e}function Ehe(e){return"hconcat"in e}function dJe({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function fp(e){return dt(e)&&e.step!==void 0}function D_e(e){return e.view||e.width||e.height}const M_e=20,mEn={align:1,bounds:1,center:1,columns:1,spacing:1},yEn=He(mEn);function vEn(e,t,n){const r=n[t],i={},{spacing:o,columns:s}=r;o!==void 0&&(i.spacing=o),s!==void 0&&(vQ(e)&&!ZD(e.facet)||She(e))&&(i.columns=s),CQ(e)&&(i.columns=1);for(const a of yEn)if(e[a]!==void 0)if(a==="spacing"){const l=e[a];i[a]=Hn(l)?l:{row:l.row??o,column:l.column??o}}else i[a]=e[a];return i}function tee(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function M4(e,t){const n=N4(e,t);return fp(n)?n.step:hJe}function N4(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return lo(n,{step:e.step})}const hJe=20,bEn={continuousWidth:200,continuousHeight:200,step:hJe},OEn={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:bEn,mark:fUt,arc:{},area:{},bar:pUt,circle:{},geoshape:{},image:{},line:{},point:{},rect:gUt,rule:{color:"black"},square:{},text:{color:"black"},tick:mUt,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:uSn,projection:{},legend:dEn,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:pEn,style:{},title:{},facet:{spacing:M_e},concat:{spacing:M_e},normalizedNumberFormat:".0%"},Up=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],N_e={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},I_e={blue:Up[0],orange:Up[1],red:Up[2],teal:Up[3],green:Up[4],yellow:Up[5],purple:Up[6],pink:Up[7],brown:Up[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function xEn(e={}){return{signals:[{name:"color",value:dt(e)?{...I_e,...e}:I_e}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function wEn(e){return{signals:[{name:"fontSize",value:dt(e)?{...N_e,...e}:N_e}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function SEn(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function pJe(e){const t=He(e||{}),n={};for(const r of t){const i=e[r];n[r]=KD(i)?ZGe(i):Fc(i)}return n}function EEn(e){const t=He(e),n={};for(const r of t)n[r]=pJe(e[r]);return n}const CEn=[...kQe,...UKe,...cJe,"background","padding","legend","lineBreak","scale","style","title","view"];function gJe(e={}){const{color:t,font:n,fontSize:r,selection:i,...o}=e,s=l_({},Xt(OEn),n?SEn(n):{},t?xEn(t):{},r?wEn(r):{},o||{});i&&c_(s,"selection",i,!0);const a=Gl(s,CEn);for(const l of["background","lineBreak","padding"])s[l]&&(a[l]=Fc(s[l]));for(const l of kQe)s[l]&&(a[l]=Ll(s[l]));for(const l of UKe)s[l]&&(a[l]=pJe(s[l]));for(const l of cJe)s[l]&&(a[l]=Ll(s[l]));return s.legend&&(a.legend=Ll(s.legend)),s.scale&&(a.scale=Ll(s.scale)),s.style&&(a.style=EEn(s.style)),s.title&&(a.title=Ll(s.title)),s.view&&(a.view=Ll(s.view)),a}const _En=new Set(["view",...oUt]),kEn=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],$En={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...uUt};function TEn(e){e=Xt(e);for(const t of kEn)delete e[t];if(e.axis)for(const t in e.axis)KD(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of lEn)delete e.legend[t];if(e.mark){for(const t of jxe)delete e.mark[t];e.mark.tooltip&&dt(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(fJe(e.params)),delete e.params);for(const t of _En){for(const r of jxe)delete e[t][r];const n=$En[t];if(n)for(const r of n)delete e[t][r];AEn(e,t)}for(const t of aEn())delete e[t];PEn(e);for(const t in e)dt(e[t])&&Ir(e[t])&&delete e[t];return Ir(e)?void 0:e}function PEn(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:r}=XGe(e.title);Ir(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Ir(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Ir(r)?delete e.title:e.title=r}function AEn(e,t,n,r){const i=r?e[t][r]:e[t];t==="view"&&(n="cell");const o={...i,...e.style[n??t]};Ir(o)||(e.style[n??t]=o),r||delete e[t]}function _Q(e){return"layer"in e}function REn(e){return"repeat"in e}function DEn(e){return!ze(e.repeat)&&e.repeat.layer}class Che{map(t,n){return vQ(t)?this.mapFacet(t,n):REn(t)?this.mapRepeat(t,n):Ehe(t)?this.mapHConcat(t,n):CQ(t)?this.mapVConcat(t,n):She(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(_Q(t))return this.mapLayer(t,n);if(_m(t))return this.mapUnit(t,n);throw new Error(qde(t))}mapLayer(t,n){return{...t,layer:t.layer.map(r=>this.mapLayerOrUnit(r,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(r=>this.map(r,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(r=>this.map(r,n))}}mapConcat(t,n){const{concat:r,...i}=t;return{...i,concat:r.map(o=>this.map(o,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const MEn={zero:1,center:1,normalize:1};function NEn(e){return e in MEn}const IEn=new Set([EQe,O8,b8,F3,w8,rle,ile,x8,CQe,nle]),LEn=new Set([O8,b8,EQe]);function Jx(e){return Ze(e)&&eC(e)==="quantitative"&&!e.bin}function L_e(e,t,{orient:n,type:r}){const i=t==="x"?"y":"radius",o=t==="x"&&["bar","area"].includes(r),s=e[t],a=e[i];if(Ze(s)&&Ze(a))if(Jx(s)&&Jx(a)){if(s.stack)return t;if(a.stack)return i;const l=Ze(s)&&!!s.aggregate,c=Ze(a)&&!!a.aggregate;if(l!==c)return l?t:i;if(o){if(n==="vertical")return i;if(n==="horizontal")return t}}else{if(Jx(s))return t;if(Jx(a))return i}else{if(Jx(s))return o&&n==="vertical"?void 0:t;if(Jx(a))return o&&n==="horizontal"?void 0:i}}function jEn(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function mJe(e,t){var g,v;const n=ap(e)?e:{type:e},r=n.type;if(!IEn.has(r))return null;const i=L_e(t,"x",n)||L_e(t,"theta",n);if(!i)return null;const o=t[i],s=Ze(o)?tt(o,{}):void 0,a=jEn(i),l=[],c=new Set;if(t[a]){const y=t[a],O=Ze(y)?tt(y,{}):void 0;O&&O!==s&&(l.push(a),c.add(O))}const u=a==="x"?"xOffset":"yOffset",f=t[u],d=Ze(f)?tt(f,{}):void 0;d&&d!==s&&(l.push(u),c.add(d));const h=gxn.reduce((y,O)=>{if(O!=="tooltip"&&pb(t,O)){const m=t[O];for(const w of ct(m)){const S=up(w);if(S.aggregate)continue;const E=tt(S,{});(!E||!c.has(E))&&y.push({channel:O,fieldDef:S})}}return y},[]);let p;return o.stack!==void 0?_v(o.stack)?p=o.stack?"zero":null:p=o.stack:LEn.has(r)&&(p="zero"),!p||!NEn(p)||phe(t)&&h.length===0?null:(g=o==null?void 0:o.scale)!=null&&g.type&&((v=o==null?void 0:o.scale)==null?void 0:v.type)!==ec.LINEAR?(o!=null&&o.stack&&Ye($wn(o.scale.type)),null):Jt(t[Dp(i)])?(o.stack!==void 0&&Ye(kwn(i)),null):(Ze(o)&&o.aggregate&&!_xn.has(o.aggregate)&&Ye(Twn(o.aggregate)),{groupbyChannels:l,groupbyFields:c,fieldChannel:i,impute:o.impute===null?!1:kv(r),stackBy:h,offset:p})}function yJe(e,t,n){const r=Ll(e),i=vr("orient",r,n);if(r.orient=BEn(r.type,t,i),i!==void 0&&i!==r.orient&&Ye(fwn(r.orient,i)),r.type==="bar"&&r.orient){const a=vr("cornerRadiusEnd",r,n);if(a!==void 0){const l=r.orient==="horizontal"&&t.x2||r.orient==="vertical"&&t.y2?["cornerRadius"]:hUt[r.orient];for(const c of l)r[c]=a;r.cornerRadiusEnd!==void 0&&delete r.cornerRadiusEnd}}return vr("opacity",r,n)===void 0&&(r.opacity=zEn(r.type,t)),vr("cursor",r,n)===void 0&&(r.cursor=FEn(r,t,n)),r}function FEn(e,t,n){return t.href||e.href||vr("href",e,n)?"pointer":e.cursor}function zEn(e,t){if(Pn([w8,nle,rle,ile],e)&&!phe(t))return .7}function QEn(e,t,{graticule:n}){if(n)return!1;const r=rm("filled",e,t),i=e.type;return lo(r,i!==w8&&i!==x8&&i!==F3)}function BEn(e,t,n){switch(e){case w8:case rle:case ile:case CQe:case rUt:case nUt:return}const{x:r,y:i,x2:o,y2:s}=t;switch(e){case O8:if(Ze(r)&&(Ps(r.bin)||Ze(i)&&i.aggregate&&!r.aggregate))return"vertical";if(Ze(i)&&(Ps(i.bin)||Ze(r)&&r.aggregate&&!i.aggregate))return"horizontal";if(s||o){if(n)return n;if(!o)return(Ze(r)&&r.type===CO&&!ni(r.bin)||T4(r))&&Ze(i)&&Ps(i.bin)?"horizontal":"vertical";if(!s)return(Ze(i)&&i.type===CO&&!ni(i.bin)||T4(i))&&Ze(r)&&Ps(r.bin)?"vertical":"horizontal"}case F3:if(o&&!(Ze(r)&&Ps(r.bin))&&s&&!(Ze(i)&&Ps(i.bin)))return;case b8:if(s)return Ze(i)&&Ps(i.bin)?"horizontal":"vertical";if(o)return Ze(r)&&Ps(r.bin)?"vertical":"horizontal";if(e===F3){if(r&&!i)return"vertical";if(i&&!r)return"horizontal"}case x8:case nle:{const a=T_e(r),l=T_e(i);if(n)return n;if(a&&!l)return e!=="tick"?"horizontal":"vertical";if(!a&&l)return e!=="tick"?"vertical":"horizontal";if(a&&l)return"vertical";{const c=El(r)&&r.type===KE,u=El(i)&&i.type===KE;if(c&&!u)return"vertical";if(!c&&u)return"horizontal"}return}}return"vertical"}function WEn(e){const{point:t,line:n,...r}=e;return He(r).length>1?r:r.type}function qEn(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:Gl(e[t],["point","line"])});return e}function VU(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?dt(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?dt(t.point)?t.point:{}:void 0}function j_e(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class VEn{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(_m(t)){const{mark:r,encoding:i}=t,o=ap(r)?r:{type:r};switch(o.type){case"line":case"rule":case"trail":return!!VU(o,n[o.type],i);case"area":return!!VU(o,n[o.type],i)||!!j_e(o,n[o.type])}}return!1}run(t,n,r){const{config:i}=n,{params:o,projection:s,mark:a,name:l,encoding:c,...u}=t,f=EQ(c,i),d=ap(a)?a:{type:a},h=VU(d,i[d.type],f),p=d.type==="area"&&j_e(d,i[d.type]),g=[{name:l,...o?{params:o}:{},mark:WEn({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:Gl(f,["shape"])}],v=mJe(yJe(d,f,i),f);let y=f;if(v){const{fieldChannel:O,offset:m}=v;y={...f,[O]:{...f[O],...m?{stack:m}:{}}}}return y=Gl(y,["y2","x2"]),p&&g.push({...s?{projection:s}:{},mark:{type:"line",...TE(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...s?{projection:s}:{},mark:{type:"point",opacity:1,filled:!0,...TE(d,["clip","tooltip"]),...h},encoding:y}),r({...u,layer:g},{...n,config:qEn(i)})}}function UEn(e,t){return t?ZD(e)?bJe(e,t):vJe(e,t):e}function UU(e,t){return t?bJe(e,t):e}function nee(e,t,n){const r=t[e];if($Sn(r)){if(r.repeat in n)return{...t,[e]:n[r.repeat]};Ye(Vxn(r.repeat));return}return t}function vJe(e,t){if(e=nee("field",e,t),e!==void 0){if(e===null)return null;if(uhe(e)&&Vh(e.sort)){const n=nee("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function F_e(e,t){if(Ze(e))return vJe(e,t);{const n=nee("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function z_e(e,t){if(Jt(e)){const n=F_e(e,t);if(n)return n;if(bQ(e))return{condition:e.condition}}else{if(YD(e)){const n=F_e(e.condition,t);if(n)return{...e,condition:n};{const{condition:r,...i}=e;return i}}return e}}function bJe(e,t){const n={};for(const r in e)if(Nt(e,r)){const i=e[r];if(ze(i))n[r]=i.map(o=>z_e(o,t)).filter(o=>o);else{const o=z_e(i,t);o!==void 0&&(n[r]=o)}}return n}class HEn{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(_m(t)){const{encoding:n,mark:r}=t;if(r==="line"||ap(r)&&r.type==="line")for(const i of dxn){const o=hx(i),s=n[o];if(n[i]&&(Ze(s)&&!Ps(s.bin)||Np(s)))return!0}}return!1}run(t,n,r){const{encoding:i,mark:o}=t;return Ye(uwn(!!i.x2,!!i.y2)),r({...t,mark:dt(o)?{...o,type:"rule"}:"rule"},n)}}class XEn extends Che{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[YSn,JSn,sEn,new VEn,new HEn]}map(t,n){if(_m(t)){const r=pb(t.encoding,Dg),i=pb(t.encoding,Mg),o=pb(t.encoding,sQ);if(r||i||o)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:r,parentProjection:i}=n,o=UU(t.encoding,n.repeater),s={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(l=>l).join("_")}:{},...o?{encoding:o}:{}};if(r||i)return this.mapUnitWithParentEncodingOrProjection(s,n);const a=this.mapLayerOrUnit.bind(this);for(const l of this.nonFacetUnitNormalizers)if(l.hasMatchingType(s,n.config))return l.run(s,n,a);return s}mapRepeat(t,n){return DEn(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:r,spec:i,...o}=t,{row:s,column:a,layer:l}=r,{repeater:c={},repeaterPrefix:u=""}=n;return s||a?this.mapRepeat({...t,repeat:{...s?{row:s}:{},...a?{column:a}:{}},spec:{repeat:{layer:l},spec:i}},n):{...o,layer:l.map(f=>{const d={...c,layer:f},h=`${(i.name?`${i.name}_`:"")+u}child__layer_${Si(f)}`,p=this.mapLayerOrUnit(i,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:r,spec:i,data:o,...s}=t;!ze(r)&&t.columns&&(t=Gl(t,["columns"]),Ye(O_e("repeat")));const a=[],{repeater:l={},repeaterPrefix:c=""}=n,u=!ze(r)&&r.row||[l?l.row:null],f=!ze(r)&&r.column||[l?l.column:null],d=ze(r)&&r||[l?l.repeat:null];for(const p of d)for(const g of u)for(const v of f){const y={repeat:p,row:g,column:v,layer:l.layer},O=(i.name?`${i.name}_`:"")+c+"child__"+(ze(r)?`${Si(p)}`:(r.row?`row_${Si(g)}`:"")+(r.column?`column_${Si(v)}`:"")),m=this.map(i,{...n,repeater:y,repeaterPrefix:O});m.name=O,a.push(Gl(m,["data"]))}const h=ze(r)?t.columns:r.column?r.column.length:1;return{data:i.data??o,align:"all",...s,columns:h,concat:a}}mapFacet(t,n){const{facet:r}=t;return ZD(r)&&t.columns&&(t=Gl(t,["columns"]),Ye(O_e("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:r,projection:i}=t,{parentEncoding:o,parentProjection:s,config:a}=n,l=B_e({parentProjection:s,projection:i}),c=Q_e({parentEncoding:o,encoding:UU(r,n.repeater)});return this.mapUnit({...t,...l?{projection:l}:{},...c?{encoding:c}:{}},{config:a})}mapFacetedUnit(t,n){const{row:r,column:i,facet:o,...s}=t.encoding,{mark:a,width:l,projection:c,height:u,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:v}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},n),y=UU(s,n.repeater);return this.mapFacet({...p,...v,facet:g,spec:{...l?{width:l}:{},...u?{height:u}:{},...f?{view:f}:{},...c?{projection:c}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:r,column:i,facet:o}=t;if(r||i){o&&Ye(lwn([...r?[Dg]:[],...i?[Mg]:[]]));const s={},a={};for(const l of[Dg,Mg]){const c=t[l];if(c){const{align:u,center:f,spacing:d,columns:h,...p}=c;s[l]=p;for(const g of["align","center","spacing"])c[g]!==void 0&&(a[g]??(a[g]={}),a[g][l]=c[g])}}return{facetMapping:s,layout:a}}else{const{align:s,center:a,spacing:l,columns:c,...u}=o;return{facetMapping:UEn(u,n.repeater),layout:{...s?{align:s}:{},...a?{center:a}:{},...l?{spacing:l}:{},...c?{columns:c}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:r,...i}){const{encoding:o,projection:s,...a}=t,l={...i,parentEncoding:Q_e({parentEncoding:n,encoding:o,layer:!0}),parentProjection:B_e({parentProjection:r,projection:s})};return super.mapLayer({...a,...t.name?{name:[l.repeaterPrefix,t.name].filter(c=>c).join("_")}:{}},l)}}function Q_e({parentEncoding:e,encoding:t={},layer:n}){let r={};if(e){const i=new Set([...He(e),...He(t)]);for(const o of i){const s=t[o],a=e[o];if(Jt(s)){const l={...a,...s};r[o]=l}else YD(s)?r[o]={...s,condition:{...a,...s.condition}}:s||s===null?r[o]=s:(n||Rd(a)||Et(a)||Jt(a)||ze(a))&&(r[o]=a)}}else r=t;return!r||Ir(r)?void 0:r}function B_e(e){const{parentProjection:t,projection:n}=e;return t&&n&&Ye(Gxn({parentProjection:t,projection:n})),n??t}function _he(e){return"filter"in e}function ZEn(e){return(e==null?void 0:e.stop)!==void 0}function OJe(e){return"lookup"in e}function YEn(e){return"data"in e}function GEn(e){return"param"in e}function KEn(e){return"pivot"in e}function JEn(e){return"density"in e}function eCn(e){return"quantile"in e}function tCn(e){return"regression"in e}function nCn(e){return"loess"in e}function rCn(e){return"sample"in e}function iCn(e){return"window"in e}function oCn(e){return"joinaggregate"in e}function sCn(e){return"flatten"in e}function aCn(e){return"calculate"in e}function xJe(e){return"bin"in e}function lCn(e){return"impute"in e}function cCn(e){return"timeUnit"in e}function uCn(e){return"aggregate"in e}function fCn(e){return"stack"in e}function dCn(e){return"fold"in e}function hCn(e){return"extent"in e&&!("density"in e)}function pCn(e){return e.map(t=>_he(t)?{filter:kS(t.filter,rSn)}:t)}class gCn extends Che{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=W_e(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=W_e(t,n),t.encoding){const r={};for(const[i,o]of Q0(t.encoding))r[i]=wJe(o,n);t={...t,encoding:r}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:r,...i}=t;return r?{...i,params:Q0(r).map(([o,s])=>{const{init:a,bind:l,empty:c,...u}=s;u.type==="single"?(u.type="point",u.toggle=!1):u.type==="multi"&&(u.type="point"),n.emptySelections[o]=c!=="none";for(const f of Vs(n.selectionPredicates[o]??{}))f.empty=c!=="none";return{name:o,value:a,select:u,bind:l}})}:t}}function W_e(e,t){const{transform:n,...r}=e;if(n){const i=n.map(o=>{if(_he(o))return{filter:ree(o,t)};if(xJe(o)&&px(o.bin))return{...o,bin:SJe(o.bin)};if(OJe(o)){const{selection:s,...a}=o.from;return s?{...o,from:{param:s,...a}}:o}return o});return{...r,transform:i}}return e}function wJe(e,t){var r,i;const n=Xt(e);if(Ze(n)&&px(n.bin)&&(n.bin=SJe(n.bin)),yx(n)&&((i=(r=n.scale)==null?void 0:r.domain)!=null&&i.selection)){const{selection:o,...s}=n.scale.domain;n.scale.domain={...s,...o?{param:o}:{}}}if(bQ(n))if(ze(n.condition))n.condition=n.condition.map(o=>{const{selection:s,param:a,test:l,...c}=o;return a?o:{...c,test:ree(o,t)}});else{const{selection:o,param:s,test:a,...l}=wJe(n.condition,t);n.condition=s?n.condition:{...l,test:ree(n.condition,t)}}return n}function SJe(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...r}=t;return{...e,extent:{...r,param:n}}}return e}function ree(e,t){const n=r=>kS(r,i=>{var o;const s=t.emptySelections[i]??!0,a={param:i,empty:s};return(o=t.selectionPredicates)[i]??(o[i]=[]),t.selectionPredicates[i].push(a),a});return e.selection?n(e.selection):kS(e.test||e.filter,r=>r.selection?n(r.selection):r)}class iee extends Che{map(t,n){const r=n.selections??[];if(t.params&&!_m(t)){const i=[];for(const o of t.params)whe(o)?r.push(o):i.push(o);t.params=i}return n.selections=r,super.map(t,n)}mapUnit(t,n){const r=n.selections;if(!r||!r.length)return t;const i=(n.path??[]).concat(t.name),o=[];for(const s of r)if(!s.views||!s.views.length)o.push(s);else for(const a of s.views)(ut(a)&&(a===t.name||i.includes(a))||ze(a)&&a.map(l=>i.indexOf(l)).every((l,c,u)=>l!==-1&&(c===0||l>u[c-1])))&&o.push(s);return o.length&&(t.params=o),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=iee.prototype[e];iee.prototype[e]=function(n,r){return t.call(this,n,mCn(n,r))}}function mCn(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function EJe(e,t){t===void 0&&(t=gJe(e.config));const n=OCn(e,t),{width:r,height:i}=e,o=xCn(n,{width:r,height:i,autosize:e.autosize},t);return{...n,...o?{autosize:o}:{}}}const yCn=new XEn,vCn=new gCn,bCn=new iee;function OCn(e,t={}){const n={config:t};return bCn.map(yCn.map(vCn.map(e,n),n),n)}function q_e(e){return ut(e)?{type:e}:e??{}}function xCn(e,t,n){let{width:r,height:i}=t;const o=_m(e)||_Q(e),s={};o?r=="container"&&i=="container"?(s.type="fit",s.contains="padding"):r=="container"?(s.type="fit-x",s.contains="padding"):i=="container"&&(s.type="fit-y",s.contains="padding"):(r=="container"&&(Ye(m_e("width")),r=void 0),i=="container"&&(Ye(m_e("height")),i=void 0));const a={type:"pad",...s,...n?q_e(n.autosize):{},...q_e(e.autosize)};if(a.type==="fit"&&!o&&(Ye(Nxn),a.type="pad"),r=="container"&&!(a.type=="fit"||a.type=="fit-x")&&Ye(y_e("width")),i=="container"&&!(a.type=="fit"||a.type=="fit-y")&&Ye(y_e("height")),!Wc(a,{type:"pad"}))return a}function wCn(e){return e==="fit"||e==="fit-x"||e==="fit-y"}function SCn(e){return e?`fit-${fQ(e)}`:"fit"}const ECn=["background","padding"];function V_e(e,t){const n={};for(const r of ECn)e&&e[r]!==void 0&&(n[r]=Fc(e[r]));return t&&(n.params=e.params),n}class km{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new km(Xt(this.explicit),Xt(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return lo(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:r}){n!==void 0&&this.set(t,n,r)}set(t,n,r){return delete this[r?"implicit":"explicit"][t],this[r?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:r}){n[t]!==void 0?this.set(t,n[t],!0):r[t]!==void 0&&this.set(t,r[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of He(t.combine())){const r=t.getWithExplicit(n);this.setWithExplicit(n,r)}}}function dh(e){return{explicit:!0,value:e}}function _c(e){return{explicit:!1,value:e}}function CJe(e){return(t,n,r,i)=>{const o=e(t.value,n.value);return o>0?t:o<0?n:kQ(t,n,r,i)}}function kQ(e,t,n,r){return e.explicit&&t.explicit&&Ye(Own(n,r,e.value,t.value)),e}function tv(e,t,n,r,i=kQ){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Wc(e.value,t.value)?e:i(e,t,n,r)}class CCn extends km{constructor(t={},n={},r=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=r}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function rC(e){return"url"in e}function bA(e){return"values"in e}function _Je(e){return"name"in e&&!rC(e)&&!bA(e)&&!u0(e)}function u0(e){return e&&(kJe(e)||$Je(e)||khe(e))}function kJe(e){return"sequence"in e}function $Je(e){return"sphere"in e}function khe(e){return"graticule"in e}var Kr;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"})(Kr||(Kr={}));function TJe(e){const{signals:t,hasLegend:n,index:r,...i}=e;return i.field=mf(i.field),i}function kO(e,t=!0,n=Ba){if(ze(e)){const r=e.map(i=>kO(i,t,n));return t?`[${r.join(", ")}]`:r}else if(gx(e))return n(t?EO(e):Vwn(e));return t?n(Lr(e)):e}function _Cn(e,t){for(const n of Vs(e.component.selection??{})){const r=n.name;let i=`${r}${rv}, ${n.resolve==="global"?"true":`{unit: ${gb(e)}}`}`;for(const o of AQ)o.defined(n)&&(o.signals&&(t=o.signals(e,n,t)),o.modifyExpr&&(i=o.modifyExpr(e,n,i)));t.push({name:r+i_n,on:[{events:{signal:n.name+rv},update:`modify(${Je(n.name+$O)}, ${i})`}]})}return $he(t)}function kCn(e,t){if(e.component.selection&&He(e.component.selection).length){const n=Je(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Nv("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return $he(t)}function $Cn(e,t){let n=!1;for(const r of Vs(e.component.selection??{})){const i=r.name,o=Je(i+$O);if(t.filter(a=>a.name===i).length===0){const a=r.resolve==="global"?"union":r.resolve,l=r.type==="point"?", true, true)":")";t.push({name:r.name,update:`${HJe}(${o}, ${Je(a)}${l}`})}n=!0;for(const a of AQ)a.defined(r)&&a.topLevelSignals&&(t=a.topLevelSignals(e,r,t))}return n&&t.filter(i=>i.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),$he(t)}function TCn(e,t){const n=[...t],r=gb(e,{escape:!1});for(const i of Vs(e.component.selection??{})){const o={name:i.name+$O};if(i.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Dd}}]),i.init){const a=i.project.items.map(TJe);o.values=i.project.hasSelectionId?i.init.map(l=>({unit:r,[Dd]:kO(l,!1)[0]})):i.init.map(l=>({unit:r,fields:a,values:kO(l,!1)}))}n.filter(a=>a.name===i.name+$O).length||n.push(o)}return n}function PJe(e,t){for(const n of Vs(e.component.selection??{}))for(const r of AQ)r.defined(n)&&r.marks&&(t=r.marks(e,n,t));return t}function PCn(e,t){for(const n of e.children)Ui(n)&&(t=PJe(n,t));return t}function ACn(e,t,n,r){const i=KJe(e,t.param,t);return{signal:au(n.get("type"))&&ze(r)&&r[0]>r[1]?`isValid(${i}) && reverse(${i})`:i}}function $he(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class Pr{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){Ye(Xxn);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const i of this._children)i.parent=t;this._children=[],t.removeChild(this);const r=t.parent.removeChild(t);this._parent=n,n.addChild(this,r),t.parent=this}}let yl=class extends Pr{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,r,i){super(t,n),this.type=r,this.refCounts=i,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${xQe()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}};function HU(e){return e.as!==void 0}function U_e(e){return`${e}_end`}class Uh extends Pr{clone(){return new Uh(null,Xt(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const r=n.reduceFieldDef((i,o,s)=>{const{field:a,timeUnit:l}=o;if(l){let c;if(mx(l)){if(Ui(n)){const{mark:u,markDef:f,config:d}=n,h=ev({fieldDef:o,markDef:f,config:d});(FP(u)||h)&&(c={timeUnit:gs(l),field:a})}}else c={as:tt(o,{forAs:!0}),field:a,timeUnit:l};if(Ui(n)){const{mark:u,markDef:f,config:d}=n,h=ev({fieldDef:o,markDef:f,config:d});FP(u)&&co(s)&&h!==.5&&(c.rectBandPosition=h)}c&&(i[Nn(c)]=c)}return i},{});return Ir(r)?null:new Uh(t,r)}static makeFromTransform(t,n){const{timeUnit:r,...i}={...n},o=gs(r),s={...i,timeUnit:o};return new Uh(t,{[Nn(s)]:s})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[r,i]of Q0(this.timeUnits)){const o=HU(i)?i.as:`${i.field}_end`;t.has(o)||(n[r]=i)}this.timeUnits=n}producedFields(){return new Set(Vs(this.timeUnits).map(t=>HU(t)?t.as:U_e(t.field)))}dependentFields(){return new Set(Vs(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${Nn(this.timeUnits)}`}assemble(){const t=[];for(const n of Vs(this.timeUnits)){const{rectBandPosition:r}=n,i=gs(n.timeUnit);if(HU(n)){const{field:o,as:s}=n,{unit:a,utc:l,...c}=i,u=[s,`${s}_end`];t.push({field:mf(o),type:"timeunit",...a?{units:mQ(a)}:{},...l?{timezone:"utc"}:{},...c,as:u}),t.push(...H_e(u,r,i))}else if(n){const{field:o}=n,s=o.replaceAll("\\.","."),a=AJe({timeUnit:i,field:s}),l=U_e(s);t.push({type:"formula",expr:a,as:l}),t.push(...H_e([s,l],r,i))}}return t}}const $Q="offsetted_rect_start",TQ="offsetted_rect_end";function AJe({timeUnit:e,field:t,reverse:n}){const{unit:r,utc:i}=e,o=hKe(r),{part:s,step:a}=yKe(o,e.step);return`${i?"utcOffset":"timeOffset"}('${s}', datum['${t}'], ${n?-a:a})`}function H_e([e,t],n,r){if(n!==void 0&&n!==.5){const i=`datum['${e}']`,o=`datum['${t}']`;return[{type:"formula",expr:X_e([AJe({timeUnit:r,field:e,reverse:!0}),i],n+.5),as:`${e}_${$Q}`},{type:"formula",expr:X_e([i,o],n+.5),as:`${e}_${TQ}`}]}return[]}function X_e([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const JD="_tuple_fields";class RCn{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const DCn={defined:()=>!0,parse:(e,t,n)=>{const r=t.name,i=t.project??(t.project=new RCn),o={},s={},a=new Set,l=(p,g)=>{const v=g==="visual"?p.channel:p.field;let y=Si(`${r}_${v}`);for(let O=1;a.has(y);O++)y=Si(`${r}_${v}_${O}`);return a.add(y),{[g]:y}},c=t.type,u=e.config.selection[c],f=n.value!==void 0?ct(n.value):null;let{fields:d,encodings:h}=dt(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(dt(p))for(const g of He(p))fxn(g)?(h||(h=[])).push(g):c==="interval"?(Ye(qxn),h=u.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=u.encodings,"fields"in u&&(d=u.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let v=g.field;if(g.aggregate){Ye(Ixn(p,g.aggregate));continue}else if(!v){Ye(b_e(p));continue}if(g.timeUnit&&!mx(g.timeUnit)){v=e.vgField(p);const y={timeUnit:g.timeUnit,as:v,field:g.field};s[Nn(y)]=y}if(!o[v]){const y=c==="interval"&&Cm(p)&&au(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",O={field:v,channel:p,type:y,index:i.items.length};O.signals={...l(O,"data"),...l(O,"visual")},i.items.push(o[v]=O),i.hasField[v]=o[v],i.hasSelectionId=i.hasSelectionId||v===Dd,IGe(p)?(O.geoChannel=p,O.channel=NGe(p),i.hasChannel[O.channel]=o[v]):i.hasChannel[p]=o[v]}}else Ye(b_e(p))}for(const p of d??[]){if(i.hasField[p])continue;const g={type:"E",field:p,index:i.items.length};g.signals={...l(g,"data")},i.items.push(g),i.hasField[p]=g,i.hasSelectionId=i.hasSelectionId||p===Dd}f&&(t.init=f.map(p=>i.items.map(g=>dt(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Ir(s)||(i.timeUnit=new Uh(null,s))},signals:(e,t,n)=>{const r=t.name+JD;return n.filter(o=>o.name===r).length>0||t.project.hasSelectionId?n:n.concat({name:r,value:t.project.items.map(TJe)})}},Ng={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const r of t.project.items){const i=r.channel;if(!Cm(i))continue;const o=e.getScaleComponent(i),s=o?o.get("type"):void 0;if(!o||!au(s)){Ye(Fxn);continue}o.set("selectionExtent",{param:t.name,field:r.field},!0),n.push(r)}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter(s=>n.filter(a=>a.name===s.signals.data).length===0);if(!e.parent||Z_e(e)||r.length===0)return n;const i=n.filter(s=>s.name===t.name)[0];let o=i.update;if(o.indexOf(HJe)>=0)i.update=`{${r.map(s=>`${Je(mf(s.field))}: ${s.signals.data}`).join(", ")}}`;else{for(const s of r){const a=`${Je(mf(s.field))}: ${s.signals.data}`;o.includes(a)||(o=`${o.substring(0,o.length-1)}, ${a}}`)}i.update=o}return n.concat(r.map(s=>({name:s.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!Z_e(e))for(const r of t.scales){const i=n.filter(o=>o.name===r.signals.data)[0];i.push="outer",delete i.value,delete i.update}return n}};function oee(e,t){return`domain(${Je(e.scaleName(t))})`}function Z_e(e){return e.parent&&F_(e.parent)&&!e.parent.parent}const QS="_brush",RJe="_scale_trigger",Hk="geo_interval_init_tick",DJe="_init",MCn="_center",NCn={defined:e=>e.type==="interval",parse:(e,t,n)=>{var r;if(e.hasProjection){const i={...dt(n.select)?n.select:{}};i.fields=[Dd],i.encodings||(i.encodings=n.value?He(n.value):[Hd,Ud]),n.select={type:"interval",...i}}if(t.translate&&!Ng.defined(t)){const i=`!event.item || event.item.mark.name !== ${Je(t.name+QS)}`;for(const o of t.events){if(!o.between){Ye(`${o} is not an ordered event stream for interval selections.`);continue}const s=ct((r=o.between[0]).filter??(r.filter=[]));s.indexOf(i)<0&&s.push(i)}}},signals:(e,t,n)=>{const r=t.name,i=r+rv,o=Vs(t.project.hasChannel).filter(a=>a.channel===Ei||a.channel===Os),s=t.init?t.init[0]:null;if(n.push(...o.reduce((a,l)=>a.concat(ICn(e,t,l,s&&s[l.index])),[])),e.hasProjection){const a=Je(e.projectionName()),l=e.projectionName()+MCn,{x:c,y:u}=t.project.hasChannel,f=c&&c.signals.visual,d=u&&u.signals.visual,h=c?s&&s[c.index]:`${l}[0]`,p=u?s&&s[u.index]:`${l}[1]`,g=S=>e.getSizeSignalRef(S).signal,v=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;s&&(n.unshift({name:r+DJe,init:`[scale(${a}, [${c?h[0]:h}, ${u?p[0]:p}]), scale(${a}, [${c?h[1]:h}, ${u?p[1]:p}])]`}),(!c||!u)&&(n.find(E=>E.name===l)||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${v}, {markname: ${Je(e.getName("marks"))}}, unit.mark)`,O=`{unit: ${gb(e)}}`,m=`vlSelectionTuples(${y}, ${O})`,w=o.map(S=>S.signals.visual);return n.concat({name:i,on:[{events:[...w.length?[{signal:w.join(" || ")}]:[],...s?[{signal:Hk}]:[]],update:m}]})}else{if(!Ng.defined(t)){const c=r+RJe,u=o.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=Je(e.scaleName(d)),v=e.getScaleComponent(d).get("type"),y=au(v)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});u.length&&n.push({name:c,value:{},on:[{events:o.map(f=>({scale:e.scaleName(f.channel)})),update:u.join(" && ")+` ? ${c} : {}`}]})}const a=o.map(c=>c.signals.data),l=`unit: ${gb(e)}, fields: ${r+JD}, values`;return n.concat({name:i,...s?{init:`{${l}: ${kO(s)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Ui(e)&&e.hasProjection&&t.init&&(n.filter(i=>i.name===Hk).length||n.unshift({name:Hk,value:null,on:[{events:"timer{1}",update:`${Hk} === null ? {} : ${Hk}`}]})),n),marks:(e,t,n)=>{const r=t.name,{x:i,y:o}=t.project.hasChannel,s=i==null?void 0:i.signals.visual,a=o==null?void 0:o.signals.visual,l=`data(${Je(t.name+$O)})`;if(Ng.defined(t)||!i&&!o)return n;const c={x:i!==void 0?{signal:`${s}[0]`}:{value:0},y:o!==void 0?{signal:`${a}[0]`}:{value:0},x2:i!==void 0?{signal:`${s}[1]`}:{field:{group:"width"}},y2:o!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const g of He(c))c[g]=[{test:`${l}.length && ${l}[0].unit === ${gb(e)}`,...c[g]},{value:0}];const{fill:u,fillOpacity:f,cursor:d,...h}=t.mark,p=He(h).reduce((g,v)=>(g[v]=[{test:[i!==void 0&&`${s}[0] !== ${s}[1]`,o!==void 0&&`${a}[0] !== ${a}[1]`].filter(y=>y).join(" && "),value:h[v]},{value:null}],g),{});return[{name:`${r+QS}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:u},fillOpacity:{value:f}},update:c}},...n,{name:r+QS,type:"rect",clip:!0,encode:{enter:{...d?{cursor:{value:d}}:{},fill:{value:"transparent"}},update:{...c,...p}}}]}};function ICn(e,t,n,r){const i=!e.hasProjection,o=n.channel,s=n.signals.visual,a=Je(i?e.scaleName(o):e.projectionName()),l=d=>`scale(${a}, ${d})`,c=e.getSizeSignalRef(o===Ei?"width":"height").signal,u=`${o}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${u}, ${u}]`},{events:h,update:`[${s}[0], clamp(${u}, 0, ${c})]`}],[]);if(i){const d=n.signals.data,h=Ng.defined(t),p=e.getScaleComponent(o),g=p?p.get("type"):void 0,v=r?{init:kO(r,!0,l)}:{value:[]};return f.push({events:{signal:t.name+RJe},update:au(g)?`[${l(`${d}[0]`)}, ${l(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:s,...v,on:f},{name:d,...r?{init:kO(r)}:{},on:[{events:{signal:s},update:`${s}[0] === ${s}[1] ? null : invert(${a}, ${s})`}]}]}else{const d=o===Ei?0:1,h=t.name+DJe,p=r?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:s,...p,on:f}]}}const LCn={defined:e=>e.type==="point",signals:(e,t,n)=>{const r=t.name,i=r+JD,o=t.project,s="(item().isVoronoi ? datum.datum : datum)",a=Vs(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+QS):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),l=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let c=`unit: ${gb(e)}, `;if(t.project.hasSelectionId)c+=`${Dd}: ${s}[${Je(Dd)}]`;else{const f=o.items.map(d=>{const h=e.fieldDef(d.channel);return h!=null&&h.bin?`[${s}[${Je(e.vgField(d.channel,{}))}], ${s}[${Je(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${s}[${Je(d.field)}]`}).join(", ");c+=`fields: ${i}, values: [${f}]`}const u=t.events;return n.concat([{name:r+rv,on:u?[{events:u,update:`${l} ? {${c}} : null`,force:!0}]:[]}])}};function N_(e,t,n,r){const i=bQ(t)&&t.condition,o=r(t);if(i){const a=ct(i).map(l=>{const c=r(l);if(kSn(l)){const{param:u,empty:f}=l;return{test:GJe(e,{param:u,empty:f}),...c}}else return{test:j4(e,l.test),...c}});return{[n]:[...a,...o!==void 0?[o]:[]]}}else return o!==void 0?{[n]:o}:{}}function The(e,t="text"){const n=e.encoding[t];return N_(e,n,t,r=>PQ(r,e.config))}function PQ(e,t,n="datum"){if(e){if(Rd(e))return ui(e.value);if(Jt(e)){const{format:r,formatType:i}=A4(e);return lhe({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}}function MJe(e,t={}){const{encoding:n,markDef:r,config:i,stack:o}=e,s=n.tooltip;if(ze(s))return{tooltip:Y_e({tooltip:s},o,i,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return N_(e,s,"tooltip",l=>{const c=PQ(l,i,a);if(c)return c;if(l===null)return;let u=vr("tooltip",r,i);if(u===!0&&(u={content:"encoding"}),ut(u))return{value:u};if(dt(u))return Et(u)?u:u.content==="encoding"?Y_e(n,o,i,t):{signal:a}})}}function NJe(e,t,n,{reactiveGeom:r}={}){const i={...n,...n.tooltipFormat},o={},s=r?"datum.datum":"datum",a=[];function l(u,f){const d=hx(f),h=El(u)?u:{...u,type:e[d].type},p=h.title||dhe(h,i),g=ct(p).join(", ").replaceAll(/"/g,'\\"');let v;if(co(f)){const y=f==="x"?"x2":"y2",O=up(e[y]);if(Ps(h.bin)&&O){const m=tt(h,{expr:s}),w=tt(O,{expr:s}),{format:S,formatType:E}=A4(h);v=XD(m,w,S,E,i),o[y]=!0}}if((co(f)||f===kf||f===Vd)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:O}=A4(h);v=lhe({fieldOrDatumDef:h,format:y,formatType:O,expr:s,config:i,normalizeStack:!0}).signal}v??(v=PQ(h,i,s).signal),a.push({channel:f,key:g,value:v})}ghe(e,(u,f)=>{Ze(u)?l(u,f):OQ(u)&&l(u.condition,f)});const c={};for(const{channel:u,key:f,value:d}of a)!o[u]&&!c[f]&&(c[f]=d);return c}function Y_e(e,t,n,{reactiveGeom:r}={}){const i=NJe(e,t,n,{reactiveGeom:r}),o=Q0(i).map(([s,a])=>`"${s}": ${a}`);return o.length>0?{signal:`{${o.join(", ")}}`}:void 0}function jCn(e){const{markDef:t,config:n}=e,r=vr("aria",t,n);return r===!1?{}:{...r?{aria:r}:{},...FCn(e),...zCn(e)}}function FCn(e){const{mark:t,markDef:n,config:r}=e;if(r.aria===!1)return{};const i=vr("ariaRoleDescription",n,r);return i!=null?{ariaRoleDescription:{value:i}}:t in Rxn?{}:{ariaRoleDescription:{value:t}}}function zCn(e){const{encoding:t,markDef:n,config:r,stack:i}=e,o=t.description;if(o)return N_(e,o,"description",l=>PQ(l,e.config));const s=vr("description",n,r);if(s!=null)return{description:ui(s)};if(r.aria===!1)return{};const a=NJe(t,i,r);if(!Ir(a))return{description:{signal:Q0(a).map(([l,c],u)=>`"${u>0?"; ":""}${l}: " + (${c})`).join(" + ")}}}function ls(e,t,n={}){const{markDef:r,encoding:i,config:o}=t,{vgChannel:s}=n;let{defaultRef:a,defaultValue:l}=n;a===void 0&&(l??(l=vr(e,r,o,{vgChannel:s,ignoreVgConfig:!0})),l!==void 0&&(a=ui(l)));const c=i[e];return N_(t,c,s??e,u=>ahe({channel:e,channelDef:u,markDef:r,config:o,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:a}))}function IJe(e,t={filled:void 0}){const{markDef:n,encoding:r,config:i}=e,{type:o}=n,s=t.filled??vr("filled",n,i),a=Pn(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,l=vr(s===!0?"color":void 0,n,i,{vgChannel:"fill"})??i.mark[s===!0&&"color"]??a,c=vr(s===!1?"color":void 0,n,i,{vgChannel:"stroke"})??i.mark[s===!1&&"color"],u=s?"fill":"stroke",f={...l?{fill:ui(l)}:{},...c?{stroke:ui(c)}:{}};return n.color&&(s?n.fill:n.stroke)&&Ye(iKe("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...ls("color",e,{vgChannel:u,defaultValue:s?l:c}),...ls("fill",e,{defaultValue:r.fill?l:void 0}),...ls("stroke",e,{defaultValue:r.stroke?c:void 0})}}function QCn(e){const{encoding:t,mark:n}=e,r=t.order;return!kv(n)&&Rd(r)?N_(e,r,"zindex",i=>ui(i.value)):{}}function iC({channel:e,markDef:t,encoding:n={},model:r,bandPosition:i}){const o=`${e}Offset`,s=t[o],a=n[o];if((o==="xOffset"||o==="yOffset")&&a)return{offsetType:"encoding",offset:ahe({channel:o,channelDef:a,markDef:t,config:r==null?void 0:r.config,scaleName:r.scaleName(o),scale:r.getScaleComponent(o),stack:null,defaultRef:ui(s),bandPosition:i})};const l=t[o];return l?{offsetType:"visual",offset:l}:{}}function Ta(e,t,{defaultPos:n,vgChannel:r}){const{encoding:i,markDef:o,config:s,stack:a}=t,l=i[e],c=i[Dp(e)],u=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=iC({channel:e,markDef:o,encoding:i,model:t,bandPosition:.5}),p=Phe({model:t,defaultPos:n,channel:e,scaleName:u,scale:f}),g=!l&&co(e)&&(i.latitude||i.longitude)?{field:t.getName(e)}:BCn({channel:e,channelDef:l,channel2Def:c,markDef:o,config:s,scaleName:u,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[r||e]:g}:void 0}function BCn(e){const{channel:t,channelDef:n,scaleName:r,stack:i,offset:o,markDef:s}=e;if(Jt(n)&&i&&t===i.fieldChannel){if(Ze(n)){let a=n.bandPosition;if(a===void 0&&s.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return $4({scaleName:r,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:o})}return hb(n,r,{suffix:"end"},{offset:o})}return ohe(e)}function Phe({model:e,defaultPos:t,channel:n,scaleName:r,scale:i}){const{markDef:o,config:s}=e;return()=>{const a=hx(n),l=J0(n),c=vr(n,o,s,{vgChannel:l});if(c!==void 0)return i2(n,c);switch(t){case"zeroOrMin":case"zeroOrMax":if(r){const u=i.get("type");if(!Pn([ec.LOG,ec.TIME,ec.UTC],u)){if(i.domainDefinitelyIncludesZero())return{scale:r,value:0}}}if(t==="zeroOrMin")return a==="y"?{field:{group:"height"}}:{value:0};switch(a){case"radius":return{signal:`min(${e.width.signal},${e.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...e[cc(n)],mult:.5}}}}const WCn={left:"x",center:"xc",right:"x2"},qCn={top:"y",middle:"yc",bottom:"y2"};function LJe(e,t,n,r="middle"){if(e==="radius"||e==="theta")return J0(e);const i=e==="x"?"align":"baseline",o=vr(i,t,n);let s;return Et(o)?(Ye(cwn(i)),s=void 0):s=o,e==="x"?WCn[s||(r==="top"?"left":"center")]:qCn[s||r]}function I4(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?jJe(e,t,{defaultPos:n,defaultPos2:r}):Ta(e,t,{defaultPos:n})}function jJe(e,t,{defaultPos:n,defaultPos2:r}){const{markDef:i,config:o}=t,s=Dp(e),a=cc(e),l=VCn(t,r,s),c=l[a]?LJe(e,i,o):J0(e);return{...Ta(e,t,{defaultPos:n,vgChannel:c}),...l}}function VCn(e,t,n){const{encoding:r,mark:i,markDef:o,stack:s,config:a}=e,l=hx(n),c=cc(n),u=J0(n),f=r[l],d=e.scaleName(l),h=e.getScaleComponent(l),{offset:p}=n in r||n in o?iC({channel:n,markDef:o,encoding:r,model:e}):iC({channel:l,markDef:o,encoding:r,model:e});if(!f&&(n==="x2"||n==="y2")&&(r.latitude||r.longitude)){const v=cc(n),y=e.markDef[v];return y!=null?{[v]:{value:y}}:{[u]:{field:e.getName(n)}}}const g=UCn({channel:n,channelDef:f,channel2Def:r[n],markDef:o,config:a,scaleName:d,scale:h,stack:s,offset:p,defaultRef:void 0});return g!==void 0?{[u]:g}:vI(n,o)||vI(n,{[n]:_4(n,o,a.style),[c]:_4(c,o,a.style)})||vI(n,a[i])||vI(n,a.mark)||{[u]:Phe({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function UCn({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:s,stack:a,offset:l,defaultRef:c}){return Jt(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?hb(t,o,{suffix:"start"},{offset:l}):ohe({channel:e,channelDef:n,scaleName:o,scale:s,stack:a,markDef:r,config:i,offset:l,defaultRef:c})}function vI(e,t){const n=cc(e),r=J0(e);if(t[r]!==void 0)return{[r]:i2(e,t[r])};if(t[e]!==void 0)return{[r]:i2(e,t[e])};if(t[n]){const i=t[n];if(aO(i))Ye(rwn(n));else return{[n]:i2(e,i)}}}function nv(e,t){const{config:n,encoding:r,markDef:i}=e,o=i.type,s=Dp(t),a=cc(t),l=r[t],c=r[s],u=e.getScaleComponent(t),f=u?u.get("type"):void 0,d=i.orient,h=r[a]??r.size??vr("size",i,n,{vgChannel:a}),p=zGe(t),g=o==="bar"&&(t==="x"?d==="vertical":d==="horizontal");return Ze(l)&&(ni(l.bin)||Ps(l.bin)||l.timeUnit&&!c)&&!(h&&!aO(h))&&!r[p]&&!ms(f)?ZCn({fieldDef:l,fieldDef2:c,channel:t,model:e}):(Jt(l)&&ms(f)||g)&&!c?XCn(l,t,e):jJe(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function HCn(e,t,n,r,i,o,s){if(aO(i))if(n){const l=n.get("type");if(l==="band"){let c=`bandwidth('${t}')`;i.band!==1&&(c=`${i.band} * ${c}`);const u=rm("minBandSize",{type:s},r);return{signal:u?`max(${id(u)}, ${c})`:c}}else i.band!==1&&(Ye(hwn(l)),i=void 0)}else return{mult:i.band,field:{group:e}};else{if(Et(i))return i;if(i)return{value:i}}if(n){const l=n.get("range");if(Bv(l)&&Hn(l.step))return{value:l.step-2}}if(!o){const{bandPaddingInner:l,barBandPaddingInner:c,rectBandPaddingInner:u}=r.scale,f=lo(l,s==="bar"?c:u);if(Et(f))return{signal:`(1 - (${f.signal})) * ${e}`};if(Hn(f))return{signal:`${1-f} * ${e}`}}return{value:M4(r.view,e)-2}}function XCn(e,t,n){var P,D;const{markDef:r,encoding:i,config:o,stack:s}=n,a=r.orient,l=n.scaleName(t),c=n.getScaleComponent(t),u=cc(t),f=Dp(t),d=zGe(t),h=n.scaleName(d),p=n.getScaleComponent(zde(t)),g=a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let v;(i.size||r.size)&&(g?v=ls("size",n,{vgChannel:u,defaultRef:ui(r.size)}):Ye(ywn(r.type)));const y=!!v,O=MKe({channel:t,fieldDef:e,markDef:r,config:o,scaleType:(P=c||p)==null?void 0:P.get("type"),useVlSizeChannel:g});v=v||{[u]:HCn(u,h||l,p||c,o,O,!!e,r.type)};const m=((D=c||p)==null?void 0:D.get("type"))==="band"&&aO(O)&&!y?"top":"middle",w=LJe(t,r,o,m),S=w==="xc"||w==="yc",{offset:E,offsetType:C}=iC({channel:t,markDef:r,encoding:i,model:n,bandPosition:S?.5:0}),k=ohe({channel:t,channelDef:e,markDef:r,config:o,scaleName:l,scale:c,stack:s,offset:E,defaultRef:Phe({model:n,defaultPos:"mid",channel:t,scaleName:l,scale:c}),bandPosition:S?C==="encoding"?0:.5:Et(O)?{signal:`(1-${O})/2`}:aO(O)?(1-O.band)/2:0});if(u)return{[w]:k,...v};{const M=J0(f),L=v[u],A=E?{...L,offset:E}:L;return{[w]:k,[M]:ze(k)?[k[0],{...k[1],offset:A}]:{...k,offset:A}}}}function G_e(e,t,n,r,i,o,s){if(MGe(e))return 0;const a=e==="x"||e==="y2",l=a?-t/2:t/2;if(Et(n)||Et(i)||Et(r)||o){const c=id(n),u=id(i),f=id(r),d=id(o),p=o?`(${s} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${s})) : ${l})`:l,g=f?`${f} + `:"",v=c?`(${c} ? -1 : 1) * `:"",y=u?`(${u} + ${p})`:p;return{signal:g+v+y}}else return i=i||0,r+(n?-i-l:+i+l)}function ZCn({fieldDef:e,fieldDef2:t,channel:n,model:r}){var D;const{config:i,markDef:o,encoding:s}=r,a=r.getScaleComponent(n),l=r.scaleName(n),c=a?a.get("type"):void 0,u=a.get("reverse"),f=MKe({channel:n,fieldDef:e,markDef:o,config:i,scaleType:c}),d=(D=r.component.axes[n])==null?void 0:D[0],h=(d==null?void 0:d.get("translate"))??.5,p=co(n)?vr("binSpacing",o,i)??0:0,g=Dp(n),v=J0(n),y=J0(g),O=rm("minBandSize",o,i),{offset:m}=iC({channel:n,markDef:o,encoding:s,model:r,bandPosition:0}),{offset:w}=iC({channel:g,markDef:o,encoding:s,model:r,bandPosition:0}),S=wSn({fieldDef:e,scaleName:l}),E=G_e(n,p,u,h,m,O,S),C=G_e(g,p,u,h,w??m,O,S),k=Et(f)?{signal:`(1-${f.signal})/2`}:aO(f)?(1-f.band)/2:.5,P=ev({fieldDef:e,fieldDef2:t,markDef:o,config:i});if(ni(e.bin)||e.timeUnit){const M=e.timeUnit&&P!==.5;return{[y]:K_e({fieldDef:e,scaleName:l,bandPosition:k,offset:C,useRectOffsetField:M}),[v]:K_e({fieldDef:e,scaleName:l,bandPosition:Et(k)?{signal:`1-${k.signal}`}:1-k,offset:E,useRectOffsetField:M})}}else if(Ps(e.bin)){const M=hb(e,l,{},{offset:C});if(Ze(t))return{[y]:M,[v]:hb(t,l,{},{offset:E})};if(px(e.bin)&&e.bin.step)return{[y]:M,[v]:{signal:`scale("${l}", ${tt(e,{expr:"datum"})} + ${e.bin.step})`,offset:E}}}Ye(aKe(g))}function K_e({fieldDef:e,scaleName:t,bandPosition:n,offset:r,useRectOffsetField:i}){return $4({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:r,...i?{startSuffix:$Q,endSuffix:TQ}:{}})}const YCn=new Set(["aria","width","height"]);function $f(e,t){const{fill:n=void 0,stroke:r=void 0}=t.color==="include"?IJe(e):{};return{...GCn(e.markDef,t),...J_e(e,"fill",n),...J_e(e,"stroke",r),...ls("opacity",e),...ls("fillOpacity",e),...ls("strokeOpacity",e),...ls("strokeWidth",e),...ls("strokeDash",e),...QCn(e),...MJe(e),...The(e,"href"),...jCn(e)}}function J_e(e,t,n){const{config:r,mark:i,markDef:o}=e;if(vr("invalid",o,r)==="hide"&&n&&!kv(i)){const a=KCn(e,{invalid:!0,channels:dQ});if(a)return{[t]:[{test:a,value:null},...ct(n)]}}return n?{[t]:n}:{}}function GCn(e,t){return Axn.reduce((n,r)=>(!YCn.has(r)&&e[r]!==void 0&&t[r]!=="ignore"&&(n[r]=ui(e[r])),n),{})}function KCn(e,{invalid:t=!1,channels:n}){const r=n.reduce((o,s)=>{const a=e.getScaleComponent(s);if(a){const l=a.get("type"),c=e.vgField(s,{expr:"datum"});c&&au(l)&&(o[c]=!0)}return o},{}),i=He(r);if(i.length>0){const o=t?"||":"&&";return i.map(s=>she(s,t)).join(` ${o} `)}}function Ahe(e){const{config:t,markDef:n}=e;if(vr("invalid",n,t)){const i=JCn(e,{channels:Mp});if(i)return{defined:{signal:i}}}return{}}function JCn(e,{invalid:t=!1,channels:n}){const r=n.reduce((o,s)=>{var l;const a=e.getScaleComponent(s);if(a){const c=a.get("type"),u=e.vgField(s,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});u&&au(c)&&(o[u]=!0)}return o},{}),i=He(r);if(i.length>0){const o=t?"||":"&&";return i.map(s=>she(s,t)).join(` ${o} `)}}function eke(e,t){if(t!==void 0)return{[e]:ui(t)}}const XU="voronoi",FJe={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(XU)},marks:(e,t,n)=>{const{x:r,y:i}=t.project.hasChannel,o=e.mark;if(kv(o))return Ye(Lxn(o)),n;const s={name:e.getName(XU),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...MJe(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:r||!i?"datum.datum.x || 0":"0"},y:{expr:i||!r?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((c,u)=>{const f=c.name??"";f===e.component.mark[0].name?a=u:f.indexOf(XU)>=0&&(l=!0)}),l||n.splice(a+1,0,s),n}},zJe={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!xhe(e.bind),parse:(e,t,n)=>XJe(t,n),topLevelSignals:(e,t,n)=>{const r=t.name,i=t.project,o=t.bind,s=t.init&&t.init[0],a=FJe.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return i.items.forEach((l,c)=>{const u=Si(`${r}_${l.field}`);n.filter(d=>d.name===u).length||n.unshift({name:u,...s?{init:kO(s[c])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${Je(l.field)}] : null`}]:[],bind:o[l.field]??o[l.channel]??o})}),n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.filter(c=>c.name===r+rv)[0],s=r+JD,a=i.items.map(c=>Si(`${r}_${c.field}`)),l=a.map(c=>`${c} !== null`).join(" && ");return a.length&&(o.update=`${l} ? {fields: ${s}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}},L4="_toggle",QJe={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+L4,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+rv,r=t.name+L4;return`${r} ? null : ${n}, `+(t.resolve==="global"?`${r} ? null : true, `:`${r} ? null : {unit: ${gb(e)}}, `)+`${r} ? ${n} : null`}},e_n={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=ut(t.clear)?Nv(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(zJe.defined(t))for(const r of t.project.items){const i=n.findIndex(o=>o.name===Si(`${t.name}_${r.field}`));i!==-1&&n[i].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function r(i,o){i!==-1&&n[i].on&&n[i].on.push({events:t.clear,update:o})}if(t.type==="interval")for(const i of t.project.items){const o=n.findIndex(s=>s.name===i.signals.visual);if(r(o,"[0, 0]"),o===-1){const s=n.findIndex(a=>a.name===i.signals.data);r(s,"null")}}else{let i=n.findIndex(o=>o.name===t.name+rv);r(i,"null"),QJe.defined(t)&&(i=n.findIndex(o=>o.name===t.name+L4),r(i,"false"))}return n}},BJe={defined:e=>{const t=e.resolve==="global"&&e.bind&&xhe(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Dd;return t&&!n&&Ye(zxn),t&&n},parse:(e,t,n)=>{const r=Xt(n);if(r.select=ut(r.select)?{type:r.select,toggle:t.toggle}:{...r.select,toggle:t.toggle},XJe(t,r),dt(n.select)&&(n.select.on||n.select.clear)){const s='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=ct(a.filter??[]),a.filter.includes(s)||a.filter.push(s)}const i=qU(t.bind)?t.bind.legend:"click",o=ut(i)?Nv(i,"view"):ct(i);t.bind={legend:{merge:o}}},topLevelSignals:(e,t,n)=>{const r=t.name,i=qU(t.bind)&&t.bind.legend,o=s=>a=>{const l=Xt(a);return l.markname=s,l};for(const s of t.project.items){if(!s.hasLegend)continue;const a=`${Si(s.field)}_legend`,l=`${r}_${a}`;if(n.filter(u=>u.name===l).length===0){const u=i.merge.map(o(`${a}_symbols`)).concat(i.merge.map(o(`${a}_labels`))).concat(i.merge.map(o(`${a}_entries`)));n.unshift({name:l,...t.init?{}:{value:null},on:[{events:u,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:`!event.item || !datum ? null : ${l}`,force:!0}]})}}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find(d=>d.name===r+rv),s=r+JD,a=i.items.filter(d=>d.hasLegend).map(d=>Si(`${r}_${Si(d.field)}_legend`)),c=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${s}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?o.on.push({events:a.map(d=>({signal:d})),update:c}):a.length>0&&(o.update=c,delete o.value,delete o.on);const u=n.find(d=>d.name===r+L4),f=qU(t.bind)&&t.bind.legend;return u&&(t.events?u.on.push({...u.on[0],events:f}):u.on[0].events=f),n}};function t_n(e,t,n){var i;const r=(i=e.fieldDef(t))==null?void 0:i.field;for(const o of Vs(e.component.selection??{})){const s=o.project.hasField[r]??o.project.hasChannel[t];if(s&&BJe.defined(o)){const a=n.get("selections")??[];a.push(o.name),n.set("selections",a,!1),s.hasLegend=!0}}}const WJe="_translate_anchor",qJe="_translate_delta",n_n={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const r=t.name,i=Ng.defined(t),o=r+WJe,{x:s,y:a}=t.project.hasChannel;let l=Nv(t.translate,"scope");return i||(l=l.map(c=>(c.between[0].markname=r+QS,c))),n.push({name:o,value:{},on:[{events:l.map(c=>c.between[0]),update:"{x: x(unit), y: y(unit)"+(s!==void 0?`, extent_x: ${i?oee(e,Ei):`slice(${s.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${i?oee(e,Os):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:r+qJe,value:{},on:[{events:l,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),s!==void 0&&tke(e,t,s,"width",n),a!==void 0&&tke(e,t,a,"height",n),n}};function tke(e,t,n,r,i){const o=t.name,s=o+WJe,a=o+qJe,l=n.channel,c=Ng.defined(t),u=i.filter(S=>S.name===n.signals[c?"data":"visual"])[0],f=e.getSizeSignalRef(r).signal,d=e.getScaleComponent(l),h=d&&d.get("type"),p=d&&d.get("reverse"),g=c?l===Ei?p?"":"-":p?"-":"":"",v=`${s}.extent_${l}`,y=`${g}${a}.${l} / ${c?`${f}`:`span(${v})`}`,O=!c||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",m=c?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",w=`${O}(${v}, ${y}${m})`;u.on.push({events:{signal:a},update:c?w:`clampRange(${w}, 0, ${f})`})}const VJe="_zoom_anchor",UJe="_zoom_delta",r_n={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const r=t.name,i=Ng.defined(t),o=r+UJe,{x:s,y:a}=t.project.hasChannel,l=Je(e.scaleName(Ei)),c=Je(e.scaleName(Os));let u=Nv(t.zoom,"scope");return i||(u=u.map(f=>(f.markname=r+QS,f))),n.push({name:r+VJe,on:[{events:u,update:i?"{"+[l?`x: invert(${l}, x(unit))`:"",c?`y: invert(${c}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:u,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),s!==void 0&&nke(e,t,s,"width",n),a!==void 0&&nke(e,t,a,"height",n),n}};function nke(e,t,n,r,i){const o=t.name,s=n.channel,a=Ng.defined(t),l=i.filter(O=>O.name===n.signals[a?"data":"visual"])[0],c=e.getSizeSignalRef(r).signal,u=e.getScaleComponent(s),f=u&&u.get("type"),d=a?oee(e,s):l.name,h=o+UJe,p=`${o}${VJe}.${s}`,g=!a||!u?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",v=a?f==="pow"?`, ${u.get("exponent")??1}`:f==="symlog"?`, ${u.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${v})`;l.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${c})`})}const $O="_store",rv="_tuple",i_n="_modify",HJe="vlSelectionResolve",AQ=[LCn,NCn,DCn,QJe,zJe,Ng,BJe,e_n,n_n,r_n,FJe];function o_n(e){let t=e.parent;for(;t&&!gd(t);)t=t.parent;return t}function gb(e,{escape:t}={escape:!0}){let n=t?Je(e.name):e.name;const r=o_n(e);if(r){const{facet:i}=r;for(const o of Yu)i[o]&&(n+=` + '__facet_${o}_' + (facet[${Je(r.vgField(o))}])`)}return n}function Rhe(e){return Vs(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function XJe(e,t){(ut(t.select)||!t.select.on)&&delete e.events,(ut(t.select)||!t.select.clear)&&delete e.clear,(ut(t.select)||!t.select.toggle)&&delete e.toggle}function see(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...see(e.object)),t.push(...see(e.property))),t)}function ZJe(e){return e.object.type==="MemberExpression"?ZJe(e.object):e.object.name==="datum"}function YJe(e){const t=cde(e),n=new Set;return t.visit(r=>{r.type==="MemberExpression"&&ZJe(r)&&n.add(see(r).slice(1).join("."))}),n}class I_ extends Pr{clone(){return new I_(null,this.model,Xt(this.filter))}constructor(t,n,r){super(t),this.model=n,this.filter=r,this.expr=j4(this.model,this.filter,this),this._dependentFields=YJe(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function s_n(e,t){const n={},r=e.config.selection;if(!t||!t.length)return n;for(const i of t){const o=Si(i.name),s=i.select,a=ut(s)?s:s.type,l=dt(s)?Xt(s):{type:a},c=r[a];for(const d in c)d==="fields"||d==="encodings"||(d==="mark"&&(l[d]={...c[d],...l[d]}),(l[d]===void 0||l[d]===!0)&&(l[d]=Xt(c[d]??l[d])));const u=n[o]={...l,name:o,type:a,init:i.value,bind:i.bind,events:ut(l.on)?Nv(l.on,"scope"):ct(Xt(l.on))},f=Xt(i);for(const d of AQ)d.defined(u)&&d.parse&&d.parse(e,u,f)}return n}function GJe(e,t,n,r="datum"){const i=ut(t)?t:t.param,o=Si(i),s=Je(o+$O);let a;try{a=e.getSelectionComponent(o,i)}catch{return`!!${o}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const l=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",c=a.resolve==="global"?")":`, ${Je(a.resolve)})`,u=`${l}${s}, ${r}${c}`,f=`length(data(${s}))`;return t.empty===!1?`${f} && ${u}`:`!${f} || ${u}`}function KJe(e,t,n){const r=Si(t),i=n.encoding;let o=n.field,s;try{s=e.getSelectionComponent(r,t)}catch{return r}if(!i&&!o)o=s.project.items[0].field,s.project.items.length>1&&Ye(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${Je(o)}.`);else if(i&&!o){const a=s.project.items.filter(l=>l.channel===i);!a.length||a.length>1?(o=s.project.items[0].field,Ye((a.length?"Multiple ":"No ")+`matching ${Je(i)} encoding found for selection ${Je(n.param)}. Using "field": ${Je(o)}.`)):o=a[0].field}return`${s.name}[${Je(mf(o))}]`}function a_n(e,t){for(const[n,r]of Q0(e.component.selection??{})){const i=e.getName(`lookup_${n}`);e.component.data.outputNodes[i]=r.materialized=new yl(new I_(t,e,{param:n}),i,Kr.Lookup,e.component.data.outputNodeRefCounts)}}function j4(e,t,n){return BT(t,r=>ut(r)?r:eSn(r)?GJe(e,r,n):bKe(r))}function l_n(e,t){if(e)return ze(e)&&!cy(e)?e.map(n=>dhe(n,t)).join(", "):e}function ZU(e,t,n,r){var i,o;e.encode??(e.encode={}),(i=e.encode)[t]??(i[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=r}function Y$(e,t,n,r={header:!1}){var f,d;const{disable:i,orient:o,scale:s,labelExpr:a,title:l,zindex:c,...u}=e.combine();if(!i){for(const h in u){const p=QSn[h],g=u[h];if(p&&p!==t&&p!=="both")delete u[h];else if(KD(g)){const{condition:v,...y}=g,O=ct(v),m=P_e[h];if(m){const{vgProp:w,part:S}=m,E=[...O.map(C=>{const{test:k,...P}=C;return{test:j4(null,k),...P}}),y];ZU(u,S,w,E),delete u[h]}else if(m===null){const w={signal:O.map(S=>{const{test:E,...C}=S;return`${j4(null,E)} ? ${g_e(C)} : `}).join("")+g_e(y)};u[h]=w}}else if(Et(g)){const v=P_e[h];if(v){const{vgProp:y,part:O}=v;ZU(u,O,y,g),delete u[h]}}Pn(["labelAlign","labelBaseline"],h)&&u[h]===null&&delete u[h]}if(t==="grid"){if(!u.grid)return;if(u.encode){const{grid:h}=u.encode;u.encode={...h?{grid:h}:{}},Ir(u.encode)&&delete u.encode}return{scale:s,orient:o,...u,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:lo(c,0)}}else{if(!r.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=u.encode)==null?void 0:f.labels)!=null&&d.update&&Et(u.encode.labels.update.text)&&(p=sO(a,"datum.label",u.encode.labels.update.text.signal)),ZU(u,"labels","text",{signal:p})}if(u.labelAlign===null&&delete u.labelAlign,u.encode){for(const p of qKe)e.hasAxisPart(p)||delete u.encode[p];Ir(u.encode)&&delete u.encode}const h=l_n(l,n);return{scale:s,orient:o,grid:!1,...h?{title:h}:{},...u,...n.aria===!1?{aria:!1}:{},zindex:lo(c,0)}}}}function JJe(e){const{axes:t}=e.component,n=[];for(const r of Mp)if(t[r]){for(const i of t[r])if(!i.get("disable")&&!i.get("gridScale")){const o=r==="x"?"height":"width",s=e.getSizeSignalRef(o).signal;o!==s&&n.push({name:o,update:s})}}return n}function c_n(e,t){const{x:n=[],y:r=[]}=e;return[...n.map(i=>Y$(i,"grid",t)),...r.map(i=>Y$(i,"grid",t)),...n.map(i=>Y$(i,"main",t)),...r.map(i=>Y$(i,"main",t))].filter(i=>i)}function rke(e,t,n,r){return Object.assign.apply(null,[{},...e.map(i=>{if(i==="axisOrient"){const o=n==="x"?"bottom":"left",s=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},l=new Set([...He(s),...He(a)]),c={};for(const u of l.values())c[u]={signal:`${r.signal} === "${o}" ? ${id(s[u])} : ${id(a[u])}`};return c}return t[i]})])}function u_n(e,t,n,r){const i=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:SKe(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],o=e==="x"?"axisX":"axisY",s=Et(n)?"axisOrient":`axis${rD(n)}`,a=[...i,...i.map(c=>o+c.substr(4))],l=["axis",s,o];return{vlOnlyAxisConfig:rke(a,r,e,n),vgAxisConfig:rke(l,r,e,n),axisConfigStyle:f_n([...l,...a],r)}}function f_n(e,t){var r;const n=[{}];for(const i of e){let o=(r=t[i])==null?void 0:r.style;if(o){o=ct(o);for(const s of o)n.push(t.style[s])}}return Object.assign.apply(null,n)}function aee(e,t,n,r={}){var o;const i=GGe(e,n,t);if(i!==void 0)return{configFrom:"style",configValue:i};for(const s of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((o=r[s])==null?void 0:o[e])!==void 0)return{configFrom:s,configValue:r[s][e]};return{}}const ike={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??d_n(n,e),gridScale:({model:e,channel:t})=>h_n(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||tet(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||eet(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??g_n(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??m_n(t.type,n,Ze(t)&&!!t.timeUnit,Ze(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{const o=e==="x"?"width":e==="y"?"height":void 0,s=o?t.getSizeSignalRef(o):void 0;return n.tickCount??v_n({fieldOrDatumDef:r,scaleType:i,size:s,values:n.values})},tickMinStep:b_n,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const r=net(t,n);if(r!==void 0)return r;const i=t.typedFieldDef(n),o=n==="x"?"x2":"y2",s=t.fieldDef(o);return JGe(i?[$_e(i)]:[],Ze(s)?[$_e(s)]:[])},values:({axis:e,fieldOrDatumDef:t})=>O_n(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??x_n(n,t)};function d_n(e,t){return!ms(e)&&Ze(t)&&!ni(t==null?void 0:t.bin)&&!Ps(t==null?void 0:t.bin)}function h_n(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function p_n(e,t,n,r,i){const o=t==null?void 0:t.labelAngle;if(o!==void 0)return Et(o)?o:jP(o);{const{configValue:s}=aee("labelAngle",r,t==null?void 0:t.style,i);return s!==void 0?jP(s):n===Ei&&Pn([ihe,rhe],e.type)&&!(Ze(e)&&e.timeUnit)?270:void 0}}function lee(e){return`(((${e.signal} % 360) + 360) % 360)`}function eet(e,t,n,r){if(e!==void 0)if(n==="x"){if(Et(e)){const i=lee(e),o=Et(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${i} && ${i} < 135) || (225 < ${i} && ${i} < 315) ? "middle" :(${i} <= 45 || 315 <= ${i}) === ${o} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(Et(t)){const i=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${i} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)==(t==="top")?"bottom":"top"}else{if(Et(e)){const i=lee(e),o=Et(t)?`(${t.signal} === "left")`:t==="left";return{signal:`${i} <= 45 || 315 <= ${i} || (135 <= ${i} && ${i} <= 225) ? ${r?'"middle"':"null"} : (45 <= ${i} && ${i} <= 135) === ${o} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return r?"middle":null;if(Et(t)){const i=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${i} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)==(t==="left")?"top":"bottom"}}function tet(e,t,n){if(e===void 0)return;const r=n==="x",i=r?0:90,o=r?"bottom":"left";if(Et(e)){const s=lee(e),a=Et(t)?`(${t.signal} === "${o}")`:t===o;return{signal:`(${i?`(${s} + 90)`:s} % 180 === 0) ? ${r?null:'"center"'} :(${i} < ${s} && ${s} < ${180+i}) === ${a} ? "left" : "right"`}}if((e+i)%180===0)return r?null:"center";if(Et(t)){const s=i<e&&e<180+i?"===":"!==";return{signal:`${`${t.signal} ${s} "${o}"`} ? "left" : "right"`}}return(i<e&&e<180+i)==(t===o)?"left":"right"}function g_n(e,t){if(t==="x"&&Pn(["quantitative","temporal"],e))return!0}function m_n(e,t,n,r){if(n&&!dt(r)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function y_n(e){return e==="x"?"bottom":"left"}function v_n({fieldOrDatumDef:e,scaleType:t,size:n,values:r}){var i;if(!r&&!ms(t)&&t!=="log"){if(Ze(e)){if(ni(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&Pn(["month","hours","day","quarter"],(i=gs(e.timeUnit))==null?void 0:i.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function b_n({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(Ze(t)){const{timeUnit:n}=t;if(n){const r=mKe(n);if(r)return{signal:r}}}}function net(e,t){const n=t==="x"?"x2":"y2",r=e.fieldDef(t),i=e.fieldDef(n),o=r?r.title:void 0,s=i?i.title:void 0;if(o&&s)return eKe(o,s);if(o)return o;if(s)return s;if(o!==void 0)return o;if(s!==void 0)return s}function O_n(e,t){const n=e.values;if(ze(n))return WKe(t,n);if(Et(n))return n}function x_n(e,t){return e==="rect"&&P4(t)?1:0}class oC extends Pr{clone(){return new oC(null,Xt(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=YJe(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((r,i)=>{if(yx(r)&&DKe(r.sort)){const{field:o,timeUnit:s}=r,a=r.sort,l=a.map((c,u)=>`${bKe({field:o,timeUnit:s,equal:c})} ? ${u} : `).join("")+a.length;t=new oC(t,{calculate:l,as:sC(r,i,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Nn(this.transform)}`}}function sC(e,t,n){return tt(e,{prefix:t,suffix:"sort_index",...n??{}})}function RQ(e,t){return Pn(["top","bottom"],t)?"column":Pn(["left","right"],t)||e==="row"?"row":"column"}function aC(e,t,n,r){const i=r==="row"?n.headerRow:r==="column"?n.headerColumn:n.headerFacet;return lo((t||{})[e],i[e],n.header[e])}function DQ(e,t,n,r){const i={};for(const o of e){const s=aC(o,t||{},n,r);s!==void 0&&(i[o]=s)}return i}const Dhe=["row","column"],Mhe=["header","footer"];function w_n(e,t){const n=e.component.layoutHeaders[t].title,r=e.config?e.config:void 0,i=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:o,titleAngle:s,titleOrient:a}=DQ(["titleAnchor","titleAngle","titleOrient"],i.header,r,t),l=RQ(t,a),c=jP(s);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...iet(c,l),...ret(l,c,o),...oet(r,i,t,cEn,aJe)}}}function ret(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const r=tet(t,e==="row"?"left":"top",e==="row"?"y":"x");return r?{align:r}:{}}function iet(e,t){const n=eet(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function S_n(e,t){const n=e.component.layoutHeaders[t],r=[];for(const i of Mhe)if(n[i])for(const o of n[i]){const s=C_n(e,t,i,n,o);s!=null&&r.push(s)}return r}function E_n(e,t){const{sort:n}=e;return Vh(n)?{field:tt(n,{expr:"datum"}),order:n.order??"ascending"}:ze(n)?{field:sC(e,t,{expr:"datum"}),order:"ascending"}:{field:tt(e,{expr:"datum"}),order:n??"ascending"}}function cee(e,t,n){const{format:r,formatType:i,labelAngle:o,labelAnchor:s,labelOrient:a,labelExpr:l}=DQ(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),c=lhe({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,u=RQ(t,a);return{text:{signal:l?sO(sO(l,"datum.label",c),"datum.value",tt(e,{expr:"parent"})):c},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...iet(o,u),...ret(u,o,s),...oet(n,e,t,uEn,lJe)}}function C_n(e,t,n,r,i){if(i){let o=null;const{facetFieldDef:s}=r,a=e.config?e.config:void 0;if(s&&i.labels){const{labelOrient:f}=DQ(["labelOrient"],s.header,a,t);(t==="row"&&!Pn(["top","bottom"],f)||t==="column"&&!Pn(["left","right"],f))&&(o=cee(s,t,a))}const l=gd(e)&&!ZD(e.facet),c=i.axes,u=(c==null?void 0:c.length)>0;if(o||u){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...r.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:E_n(s,t)}:{},...u&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...o?{title:o}:{},...i.sizeSignal?{encode:{update:{[f]:i.sizeSignal}}}:{},...u?{axes:c}:{}}}}return null}const __n={column:{start:0,end:1},row:{start:1,end:0}};function k_n(e,t){return __n[t][e]}function $_n(e,t){const n={};for(const r of Yu){const i=e[r];if(i!=null&&i.facetFieldDef){const{titleAnchor:o,titleOrient:s}=DQ(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,r),a=RQ(r,s),l=k_n(o,a);l!==void 0&&(n[a]=l)}}return Ir(n)?void 0:n}function oet(e,t,n,r,i){const o={};for(const s of r){if(!i[s])continue;const a=aC(s,t==null?void 0:t.header,e,n);a!==void 0&&(o[i[s]]=a)}return o}function Nhe(e){return[...bI(e,"width"),...bI(e,"height"),...bI(e,"childWidth"),...bI(e,"childHeight")]}function bI(e,t){const n=t==="width"?"x":"y",r=e.component.layoutSize.get(t);if(!r||r==="merged")return[];const i=e.getSizeSignalRef(t).signal;if(r==="step"){const o=e.getScaleComponent(n);if(o){const s=o.get("type"),a=o.get("range");if(ms(s)&&Bv(a)){const l=e.scaleName(n);return gd(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[oke(l,a)]:[oke(l,a),{name:i,update:set(l,o,`domain('${l}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(r=="container"){const o=i.endsWith("width"),s=o?"containerSize()[0]":"containerSize()[1]",a=tee(e.config.view,o?"width":"height"),l=`isFinite(${s}) ? ${s} : ${a}`;return[{name:i,init:l,on:[{update:l,events:"window:resize"}]}]}else return[{name:i,value:r}]}function oke(e,t){const n=`${e}_step`;return Et(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function set(e,t,n){const r=t.get("type"),i=t.get("padding"),o=lo(t.get("paddingOuter"),i);let s=t.get("paddingInner");return s=r==="band"?s!==void 0?s:i:1,`bandspace(${n}, ${id(s)}, ${id(o)}) * ${e}_step`}function aet(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function cet(e,t){return He(e).reduce((n,r)=>{const i=e[r];return{...n,...N_(t,i,r,o=>ui(o.value))}},{})}function uet(e,t){if(gd(t))return e==="theta"?"independent":"shared";if(F_(t))return"shared";if(Bhe(t))return co(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function Ihe(e,t){const n=e.scale[t],r=co(t)?"axis":"legend";return n==="independent"?(e[r][t]==="shared"&&Ye(wwn(t)),"independent"):e[r][t]||"shared"}const T_n={...hEn,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},fet=He(T_n);class P_n extends km{}const ske={symbols:A_n,gradient:R_n,labels:D_n,entries:M_n};function A_n(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){if(o!=="symbol")return;const{markDef:s,encoding:a,config:l,mark:c}=n,u=s.filled&&c!=="trail";let f={...Mxn({},n,lUt),...IJe(n,{filled:u})};const d=i.get("symbolOpacity")??l.legend.symbolOpacity,h=i.get("symbolFillColor")??l.legend.symbolFillColor,p=i.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=d===void 0?det(a.opacity)??s.opacity:void 0;if(f.fill){if(r==="fill"||u&&r===ac)delete f.fill;else if(f.fill.field)h?delete f.fill:(f.fill=ui(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=ui(g??1));else if(ze(f.fill)){const v=uee(a.fill??a.color)??s.fill??(u&&s.color);v&&(f.fill=ui(v))}}if(f.stroke){if(r==="stroke"||!u&&r===ac)delete f.stroke;else if(f.stroke.field||p)delete f.stroke;else if(ze(f.stroke)){const v=lo(uee(a.stroke||a.color),s.stroke,u?s.color:void 0);v&&(f.stroke={value:v})}}if(r!==Em){const v=Ze(t)&&pet(n,i,t);v?f.opacity=[{test:v,...ui(g??1)},ui(l.legend.unselectedOpacity)]:g&&(f.opacity=ui(g))}return f={...f,...e},Ir(f)?void 0:f}function R_n(e,{model:t,legendType:n,legendCmpt:r}){if(n!=="gradient")return;const{config:i,markDef:o,encoding:s}=t;let a={};const c=(r.get("gradientOpacity")??i.legend.gradientOpacity)===void 0?det(s.opacity)||o.opacity:void 0;return c&&(a.opacity=ui(c)),a={...a,...e},Ir(a)?void 0:a}function D_n(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){const o=n.legend(r)||{},s=n.config,a=Ze(t)?pet(n,i,t):void 0,l=a?[{test:a,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:c,formatType:u}=o;let f;_O(u)?f=sd({fieldOrDatumDef:t,field:"datum.value",format:c,formatType:u,config:s}):c===void 0&&u===void 0&&s.customFormatTypes&&(t.type==="quantitative"&&s.numberFormatType?f=sd({fieldOrDatumDef:t,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):t.type==="temporal"&&s.timeFormatType&&Ze(t)&&t.timeUnit===void 0&&(f=sd({fieldOrDatumDef:t,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...e};return Ir(d)?void 0:d}function M_n(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function det(e){return het(e,(t,n)=>Math.max(t,n.value))}function uee(e){return het(e,(t,n)=>lo(t,n.value))}function het(e,t){if(TSn(e))return ct(e.condition).reduce(t,e.value);if(Rd(e))return e.value}function pet(e,t,n){const r=t.get("selections");if(!(r!=null&&r.length))return;const i=Je(n.field);return r.map(o=>`(!length(data(${Je(Si(o)+$O)})) || (${o}[${i}] && indexof(${o}[${i}], datum.value) >= 0))`).join(" || ")}const ake={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:r,formatType:i}=t;return TKe(e,e.type,r,i,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:r}=e;return PKe(r,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??Q_n(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??B_n(n),symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>e.symbolType??I_n(t.type,n,r.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>zS(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(FS(n)&&od(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>N_n(t,e)};function N_n(e,t){const n=e.values;if(ze(n))return WKe(t,n);if(Et(n))return n}function I_n(e,t,n,r){if(t!=="shape"){const i=uee(n)??r;if(i)return i}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function L_n(e){const{legend:t}=e;return lo(t.type,j_n(e))}function j_n({channel:e,timeUnit:t,scaleType:n}){if(FS(e)){if(Pn(["quarter","month","day"],t))return"symbol";if(od(n))return"gradient"}return"symbol"}function F_n({legendConfig:e,legendType:t,orient:n,legend:r}){return r.direction??e[t?"gradientDirection":"symbolDirection"]??z_n(n,t)}function z_n(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function Q_n({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){const{gradientHorizontalMaxLength:o,gradientHorizontalMinLength:s,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=e;if(od(i))return n==="horizontal"?r==="top"||r==="bottom"?lke(t,"width",s,o):s:lke(t,"height",l,a)}function lke(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function B_n(e){if(Pn(["quantile","threshold","log","symlog"],e))return"greedy"}function get(e){const t=Ui(e)?W_n(e):H_n(e);return e.component.legends=t,t}function W_n(e){const{encoding:t}=e,n={};for(const r of[ac,...uJe]){const i=Xo(t[r]);!i||!e.getScaleComponent(r)||r===lc&&Ze(i)&&i.type===M_||(n[r]=U_n(e,r))}return n}function q_n(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function V_n(e,t,n,r){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(r==null?void 0:r.title))return!0}return e===(n||{})[t]}function U_n(e,t){var w;let n=e.legend(t);const{markDef:r,encoding:i,config:o}=e,s=o.legend,a=new P_n({},q_n(e,t));t_n(e,t,a);const l=n!==void 0?!n:s.disable;if(a.set("disable",l,n!==void 0),l)return a;n=n||{};const c=e.getScaleComponent(t).get("type"),u=Xo(i[t]),f=Ze(u)?(w=gs(u.timeUnit))==null?void 0:w.unit:void 0,d=n.orient||o.legend.orient||"right",h=L_n({legend:n,channel:t,timeUnit:f,scaleType:c}),p=F_n({legend:n,legendType:h,orient:d,legendConfig:s}),g={legend:n,channel:t,model:e,markDef:r,encoding:i,fieldOrDatumDef:u,legendConfig:s,config:o,scaleType:c,orient:d,legendType:h,direction:p};for(const S of fet){if(h==="gradient"&&S.startsWith("symbol")||h==="symbol"&&S.startsWith("gradient"))continue;const E=S in ake?ake[S](g):n[S];if(E!==void 0){const C=V_n(E,S,n,e.fieldDef(t));(C||o.legend[S]===void 0)&&a.set(S,E,C)}}const v=(n==null?void 0:n.encoding)??{},y=a.get("selections"),O={},m={fieldOrDatumDef:u,model:e,channel:t,legendCmpt:a,legendType:h};for(const S of["labels","legend","title","symbols","gradient","entries"]){const E=cet(v[S]??{},e),C=S in ske?ske[S](E,m):E;C!==void 0&&!Ir(C)&&(O[S]={...y!=null&&y.length&&Ze(u)?{name:`${Si(u.field)}_legend_${S}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:C})}return Ir(O)||a.set("encode",O,!!(n!=null&&n.encoding)),a}function H_n(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){get(r);for(const i of He(r.component.legends))n.legend[i]=Ihe(e.component.resolve,i),n.legend[i]==="shared"&&(t[i]=met(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const r of He(t))for(const i of e.children)i.component.legends[r]&&n.legend[r]==="shared"&&delete i.component.legends[r];return t}function met(e,t){var o,s,a,l;if(!e)return t.clone();const n=e.getWithExplicit("orient"),r=t.getWithExplicit("orient");if(n.explicit&&r.explicit&&n.value!==r.value)return;let i=!1;for(const c of fet){const u=tv(e.getWithExplicit(c),t.getWithExplicit(c),c,"legend",(f,d)=>{switch(c){case"symbolType":return X_n(f,d);case"title":return tKe(f,d);case"type":return i=!0,_c("symbol")}return kQ(f,d,c,"legend")});e.setWithExplicit(c,u)}return i&&((s=(o=e.implicit)==null?void 0:o.encode)!=null&&s.gradient&&j3(e.implicit,["encode","gradient"]),(l=(a=e.explicit)==null?void 0:a.encode)!=null&&l.gradient&&j3(e.explicit,["encode","gradient"])),e}function X_n(e,t){return t.value==="circle"?t:e}function Z_n(e,t,n,r){var i,o;e.encode??(e.encode={}),(i=e.encode)[t]??(i[t]={}),(o=e.encode[t]).update??(o.update={}),e.encode[t].update[n]=r}function yet(e){const t=e.component.legends,n={};for(const i of He(t)){const o=e.getScaleComponent(i),s=Lr(o.get("domains"));if(n[s])for(const a of n[s])met(a,t[i])||n[s].push(t[i]);else n[s]=[t[i].clone()]}return Vs(n).flat().map(i=>Y_n(i,e.config)).filter(i=>i!==void 0)}function Y_n(e,t){var s,a,l;const{disable:n,labelExpr:r,selections:i,...o}=e.combine();if(!n){if(t.aria===!1&&o.aria==null&&(o.aria=!1),(s=o.encode)!=null&&s.symbols){const c=o.encode.symbols.update;c.fill&&c.fill.value!=="transparent"&&!c.stroke&&!o.stroke&&(c.stroke={value:"transparent"});for(const u of uJe)o[u]&&delete c[u]}if(o.title||delete o.title,r!==void 0){let c=r;(l=(a=o.encode)==null?void 0:a.labels)!=null&&l.update&&Et(o.encode.labels.update.text)&&(c=sO(r,"datum.label",o.encode.labels.update.text.signal)),Z_n(o,"labels","text",{signal:c})}return o}}function G_n(e){return F_(e)||Bhe(e)?K_n(e):vet(e)}function K_n(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),vet(e))}function vet(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:r}=n;if(t.data){const i={signal:`[${t.size.map(s=>s.signal).join(", ")}]`},o=t.data.reduce((s,a)=>{const l=Et(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return Pn(s,l)||s.push(l),s},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:r,size:i,fit:{signal:o.length>1?`[${o.join(", ")}]`:o[0]},...n}]}else return[{name:r,translate:{signal:"[width / 2, height / 2]"},...n}]}const J_n=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class bet extends km{constructor(t,n,r,i){super({...n},{name:t}),this.specifiedProjection=n,this.size=r,this.data=i,this.merged=!1}get isFit(){return!!this.data}}function Oet(e){e.component.projection=Ui(e)?ekn(e):rkn(e)}function ekn(e){if(e.hasProjection){const t=Ll(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),r=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,i=n?tkn(e):void 0,o=new bet(e.projectionName(!0),{...Ll(e.config.projection)??{},...t??{}},r,i);return o.get("type")||o.set("type","equalEarth",!1),o}}function tkn(e){const t=[],{encoding:n}=e;for(const r of[[Hd,Ud],[Of,Xd]])(Xo(n[r[0]])||Xo(n[r[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(lc)&&e.typedFieldDef(lc).type===M_&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Kr.Main)),t}function nkn(e,t){const n=Gae(J_n,i=>!!(!Nt(e.explicit,i)&&!Nt(t.explicit,i)||Nt(e.explicit,i)&&Nt(t.explicit,i)&&Wc(e.get(i),t.get(i))));if(Wc(e.size,t.size)){if(n)return e;if(Wc(e.explicit,{}))return t;if(Wc(t.explicit,{}))return e}return null}function rkn(e){if(e.children.length===0)return;let t;for(const r of e.children)Oet(r);const n=Gae(e.children,r=>{const i=r.component.projection;if(i)if(t){const o=nkn(t,i);return o&&(t=o),!!o}else return t=i,!0;else return!0});if(t&&n){const r=e.projectionName(!0),i=new bet(r,t.specifiedProjection,t.size,Xt(t.data));for(const o of e.children){const s=o.component.projection;s&&(s.isFit&&i.data.push(...o.component.projection.data),o.renameProjection(s.get("name"),r),s.merged=!0)}return i}}function ikn(e,t,n,r){if(GD(t,n)){const i=Ui(e)?e.axis(n)??e.legend(n)??{}:{},o=tt(t,{expr:"datum"}),s=tt(t,{expr:"datum",binSuffix:"end"});return{formulaAs:tt(t,{binSuffix:"range",forAs:!0}),formula:XD(o,s,i.format,i.formatType,r)}}return{}}function xet(e,t){return`${HGe(e)}_${t}`}function okn(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function Lhe(e,t,n){const r=xQ(n,void 0)??{},i=xet(r,t);return e.getName(`${i}_bins`)}function skn(e){return"as"in e}function cke(e,t,n){let r,i;skn(e)?r=ut(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:r=[tt(e,{forAs:!0}),tt(e,{binSuffix:"end",forAs:!0})];const o={...xQ(t,void 0)},s=xet(o,e.field),{signal:a,extentSignal:l}=okn(n,s);if(pQ(o.extent)){const u=o.extent;i=KJe(n,u.param,u),delete o.extent}const c={bin:o,field:e.field,as:[r],...a?{signal:a}:{},...l?{extentSignal:l}:{},...i?{span:i}:{}};return{key:s,binComponent:c}}class Hh extends Pr{clone(){return new Hh(null,Xt(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const r=n.reduceFieldDef((i,o,s)=>{if(El(o)&&ni(o.bin)){const{key:a,binComponent:l}=cke(o,o.bin,n);i[a]={...l,...i[a],...ikn(n,o,s,n.config)}}return i},{});return Ir(r)?null:new Hh(t,r)}static makeFromTransform(t,n,r){const{key:i,binComponent:o}=cke(n,n.bin,r);return new Hh(t,{[i]:o})}merge(t,n){for(const r of He(t.bins))r in this.bins?(n(t.bins[r].signal,this.bins[r].signal),this.bins[r].as=Ah([...this.bins[r].as,...t.bins[r].as],Nn)):this.bins[r]=t.bins[r];for(const r of t.children)t.removeChild(r),r.parent=this;t.remove()}producedFields(){return new Set(Vs(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(Vs(this.bins).map(t=>t.field))}hash(){return`Bin ${Nn(this.bins)}`}assemble(){return Vs(this.bins).flatMap(t=>{const n=[],[r,...i]=t.as,{extent:o,...s}=t.bin,a={type:"bin",field:mf(t.field),as:r,signal:t.signal,...pQ(o)?{extent:null}:{extent:o},...t.span?{span:{signal:`span(${t.span})`}}:{},...s};!o&&t.extentSignal&&(n.push({type:"extent",field:mf(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const l of i)for(let c=0;c<2;c++)n.push({type:"formula",expr:tt({field:r[c]},{expr:"datum"}),as:l[c]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function akn(e,t,n,r){var o;const i=Ui(r)?r.encoding[Dp(t)]:void 0;if(El(n)&&Ui(r)&&NKe(n,i,r.markDef,r.config)){e.add(tt(n,{})),e.add(tt(n,{suffix:"end"}));const{mark:s,markDef:a,config:l}=r,c=ev({fieldDef:n,markDef:a,config:l});FP(s)&&c!==.5&&co(t)&&(e.add(tt(n,{suffix:$Q})),e.add(tt(n,{suffix:TQ}))),n.bin&&GD(n,t)&&e.add(tt(n,{binSuffix:"range"}))}else if(IGe(t)){const s=NGe(t);e.add(r.getName(s))}else e.add(tt(n));return yx(n)&&hSn((o=n.scale)==null?void 0:o.range)&&e.add(n.scale.range.field),e}function lkn(e,t){for(const n of He(t)){const r=t[n];for(const i of He(r))n in e?e[n][i]=new Set([...e[n][i]??[],...r[i]]):e[n]={[i]:r[i]}}}class pd extends Pr{clone(){return new pd(null,new Set(this.dimensions),Xt(this.measures))}constructor(t,n,r){super(t),this.dimensions=n,this.measures=r}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let r=!1;n.forEachFieldDef(s=>{s.aggregate&&(r=!0)});const i={},o=new Set;return!r||(n.forEachFieldDef((s,a)=>{const{aggregate:l,field:c}=s;if(l)if(l==="count")i["*"]??(i["*"]={}),i["*"].count=new Set([tt(s,{forAs:!0})]);else{if(nm(l)||Qv(l)){const u=nm(l)?"argmin":"argmax",f=l[u];i[f]??(i[f]={}),i[f][u]=new Set([tt({op:u,field:f},{forAs:!0})])}else i[c]??(i[c]={}),i[c][l]=new Set([tt(s,{forAs:!0})]);Cm(a)&&n.scaleDomain(a)==="unaggregated"&&(i[c]??(i[c]={}),i[c].min=new Set([tt({field:c,aggregate:"min"},{forAs:!0})]),i[c].max=new Set([tt({field:c,aggregate:"max"},{forAs:!0})]))}else akn(o,a,s,n)}),o.size+He(i).length===0)?null:new pd(t,o,i)}static makeFromTransform(t,n){const r=new Set,i={};for(const o of n.aggregate){const{op:s,field:a,as:l}=o;s&&(s==="count"?(i["*"]??(i["*"]={}),i["*"].count=new Set([l||tt(o,{forAs:!0})])):(i[a]??(i[a]={}),i[a][s]=new Set([l||tt(o,{forAs:!0})])))}for(const o of n.groupby??[])r.add(o);return r.size+He(i).length===0?null:new pd(t,r,i)}merge(t){return vQe(this.dimensions,t.dimensions)?(lkn(this.measures,t.measures),!0):(jwn("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...He(this.measures)])}producedFields(){const t=new Set;for(const n of He(this.measures))for(const r of He(this.measures[n])){const i=this.measures[n][r];i.size===0?t.add(`${r}_${n}`):i.forEach(t.add,t)}return t}hash(){return`Aggregate ${Nn({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],r=[];for(const o of He(this.measures))for(const s of He(this.measures[o]))for(const a of this.measures[o][s])r.push(a),t.push(s),n.push(o==="*"?null:mf(o));return{type:"aggregate",groupby:[...this.dimensions].map(mf),ops:t,fields:n,as:r}}}class L_ extends Pr{constructor(t,n,r,i){super(t),this.model=n,this.name=r,this.data=i;for(const o of Yu){const s=n.facet[o];if(s){const{bin:a,sort:l}=s;this[o]={name:n.getName(`${o}_domain`),fields:[tt(s),...ni(a)?[tt(s,{binSuffix:"end"})]:[]],...Vh(l)?{sortField:l}:ze(l)?{sortIndexField:sC(s,o)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of Yu)this[n]&&(t+=` ${n.charAt(0)}:${Nn(this[n])}`);return t}get fields(){var n;const t=[];for(const r of Yu)(n=this[r])!=null&&n.fields&&t.push(...this[r].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of Yu)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of Mp){const r=this.childModel.component.scales[n];if(r&&!r.merged){const i=r.get("type"),o=r.get("range");if(ms(i)&&Bv(o)){const s=MQ(this.childModel,n),a=Qhe(s);a?t[n]=a:Ye(Vde(n))}}}return t}assembleRowColumnHeaderData(t,n,r){const i={row:"y",column:"x",facet:void 0}[t],o=[],s=[],a=[];i&&r&&r[i]&&(n?(o.push(`distinct_${r[i]}`),s.push("max")):(o.push(r[i]),s.push("distinct")),a.push(`distinct_${r[i]}`));const{sortField:l,sortIndexField:c}=this[t];if(l){const{op:u=yQ,field:f}=l;o.push(f),s.push(u),a.push(tt(l,{forAs:!0}))}else c&&(o.push(c),s.push("max"),a.push(c));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...o.length?{fields:o,ops:s,as:a}:{}}]}}assembleFacetHeaderData(t){var l;const{columns:n}=this.model.layout,{layoutHeaders:r}=this.model.component,i=[],o={};for(const c of Dhe){for(const u of Mhe){const f=(r[c]&&r[c][u])??[];for(const d of f)if(((l=d.axes)==null?void 0:l.length)>0){o[c]=!0;break}}if(o[c]){const u=`length(data("${this.facet.name}"))`,f=c==="row"?n?{signal:`ceil(${u} / ${n})`}:1:n?{signal:`min(${u}, ${n})`}:{signal:u};i.push({name:`${this.facet.name}_${c}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:s,column:a}=o;return(s||a)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,t)),i}assemble(){const t=[];let n=null;const r=this.getChildIndependentFieldsWithStep(),{column:i,row:o,facet:s}=this;if(i&&o&&(r.x||r.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(r.x??[],r.y??[]),l=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:l}]})}for(const a of[Mg,Dg])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,r));if(s){const a=this.assembleFacetHeaderData(r);a&&t.push(...a)}return t}}function uke(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function ckn(e,t){const n=ele(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const r=uke(t.slice(5,t.length));return`timeParse(${n},'${r}')`}else if(t.startsWith("utc:")){const r=uke(t.slice(4,t.length));return`utcParse(${n},'${r}')`}else return Ye(Hxn(t)),null}function ukn(e){const t={};return Z5(e.filter,n=>{if(vKe(n)){let r=null;Zde(n)?r=Fc(n.equal):Gde(n)?r=Fc(n.lte):Yde(n)?r=Fc(n.lt):Kde(n)?r=Fc(n.gt):Jde(n)?r=Fc(n.gte):ehe(n)?r=n.range[0]:the(n)&&(r=(n.oneOf??n.in)[0]),r&&(gx(r)?t[n.field]="date":Hn(r)?t[n.field]="number":ut(r)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function fkn(e){const t={};function n(r){nC(r)?t[r.field]="date":r.type==="quantitative"&&Cxn(r.aggregate)?t[r.field]="number":PE(r.field)>1?r.field in t||(t[r.field]="flatten"):yx(r)&&Vh(r.sort)&&PE(r.sort.field)>1&&(r.sort.field in t||(t[r.sort.field]="flatten"))}if((Ui(e)||gd(e))&&e.forEachFieldDef((r,i)=>{if(El(r))n(r);else{const o=hx(i),s=e.fieldDef(o);n({...r,type:s.type})}}),Ui(e)){const{mark:r,markDef:i,encoding:o}=e;if(kv(r)&&!e.encoding.order){const s=i.orient==="horizontal"?"y":"x",a=o[s];Ze(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function dkn(e){const t={};if(Ui(e)&&e.component.selection)for(const n of He(e.component.selection)){const r=e.component.selection[n];for(const i of r.project.items)!i.channel&&PE(i.field)>1&&(t[i.field]="flatten")}return t}class Pa extends Pr{clone(){return new Pa(null,Xt(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${Nn(this._parse)}`}static makeExplicit(t,n,r){var s;let i={};const o=n.data;return!u0(o)&&((s=o==null?void 0:o.format)!=null&&s.parse)&&(i=o.format.parse),this.makeWithAncestors(t,i,{},r)}static makeWithAncestors(t,n,r,i){for(const a of He(r)){const l=i.getWithExplicit(a);l.value!==void 0&&(l.explicit||l.value===r[a]||l.value==="derived"||r[a]==="flatten"?delete r[a]:Ye(x_e(a,r[a],l.value)))}for(const a of He(n)){const l=i.get(a);l!==void 0&&(l===n[a]?delete n[a]:Ye(x_e(a,n[a],l)))}const o=new km(n,r);i.copyAll(o);const s={};for(const a of He(o.combine())){const l=o.get(a);l!==null&&(s[a]=l)}return He(s).length===0||i.parseNothing?null:new Pa(t,s)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of He(this._parse)){const r=this._parse[n];PE(n)===1&&(t[n]=r)}return t}producedFields(){return new Set(He(this._parse))}dependentFields(){return new Set(He(this._parse))}assembleTransforms(t=!1){return He(this._parse).filter(n=>t?PE(n)>1:!0).map(n=>{const r=ckn(n,this._parse[n]);return r?{type:"formula",expr:r,as:tle(n)}:null}).filter(n=>n!==null)}}class iv extends Pr{clone(){return new iv(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Dd])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Dd}}}class eM extends Pr{clone(){return new eM(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Nn(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class tM extends Pr{clone(){return new tM(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Nn(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class TO extends Pr{constructor(t){super(null),t??(t={name:"source"});let n;if(u0(t)||(n=t.format?{...Gl(t.format,["parse"])}:{}),bA(t))this._data={values:t.values};else if(rC(t)){if(this._data={url:t.url},!n.type){let r=/(?:\.([^.]+))?$/.exec(t.url)[1];Pn(["json","csv","tsv","dsv","topojson"],r)||(r="json"),n.type=r}}else $Je(t)?this._data={values:[{type:"Sphere"}]}:(_Je(t)||u0(t))&&(this._data={});this._generator=u0(t),t.name&&(this._name=t.name),n&&!Ir(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var fke=function(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},hkn=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},G$;function jhe(e){return e instanceof TO||e instanceof eM||e instanceof tM}class Fhe{constructor(){G$.set(this,void 0),fke(this,G$,!1,"f")}setModified(){fke(this,G$,!0,"f")}get modifiedFlag(){return hkn(this,G$,"f")}}G$=new WeakMap;class vx extends Fhe{getNodeDepths(t,n,r){r.set(t,n);for(const i of t.children)this.getNodeDepths(i,n+1,r);return r}optimize(t){const r=[...this.getNodeDepths(t,0,new Map).entries()].sort((i,o)=>o[1]-i[1]);for(const i of r)this.run(i[0]);return this.modifiedFlag}}class zhe extends Fhe{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class pkn extends zhe{mergeNodes(t,n){const r=n.shift();for(const i of n)t.removeChild(i),i.parent=r,i.remove()}run(t){const n=t.children.map(i=>i.hash()),r={};for(let i=0;i<n.length;i++)r[n[i]]===void 0?r[n[i]]=[t.children[i]]:r[n[i]].push(t.children[i]);for(const i of He(r))r[i].length>1&&(this.setModified(),this.mergeNodes(t,r[i]))}}class gkn extends zhe{constructor(t){super(),this.requiresSelectionId=t&&Rhe(t)}run(t){t instanceof iv&&(this.requiresSelectionId&&(jhe(t.parent)||t.parent instanceof pd||t.parent instanceof Pa)||(this.setModified(),t.remove()))}}class mkn extends Fhe{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let r=new Set;t instanceof Uh&&(r=t.producedFields(),Kae(r,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const i of t.children)this.run(i,new Set([...n,...r]))}}class ykn extends zhe{constructor(){super()}run(t){t instanceof yl&&!t.isRequired()&&(this.setModified(),t.remove())}}class vkn extends vx{run(t){if(!jhe(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof Pa)if(t instanceof Pa)this.setModified(),t.merge(n);else{if(Jae(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class bkn extends vx{run(t){const n=[...t.children],r=t.children.filter(i=>i instanceof Pa);if(t.numChildren()>1&&r.length>=1){const i={},o=new Set;for(const s of r){const a=s.parse;for(const l of He(a))l in i?i[l]!==a[l]&&o.add(l):i[l]=a[l]}for(const s of o)delete i[s];if(!Ir(i)){this.setModified();const s=new Pa(t,i);for(const a of n){if(a instanceof Pa)for(const l of He(i))delete a.parse[l];t.removeChild(a),a.parent=s,a instanceof Pa&&He(a.parse).length===0&&a.remove()}}}}}class Okn extends vx{run(t){t instanceof yl||t.numChildren()>0||t instanceof L_||t instanceof TO||(this.setModified(),t.remove())}}class xkn extends vx{run(t){const n=t.children.filter(i=>i instanceof Uh),r=n.pop();for(const i of n)this.setModified(),r.merge(i)}}class wkn extends vx{run(t){const n=t.children.filter(i=>i instanceof pd),r={};for(const i of n){const o=Nn(i.groupBy);o in r||(r[o]=[]),r[o].push(i)}for(const i of He(r)){const o=r[i];if(o.length>1){const s=o.pop();for(const a of o)s.merge(a)&&(t.removeChild(a),a.parent=s,a.remove(),this.setModified())}}}}class Skn extends vx{constructor(t){super(),this.model=t}run(t){const n=!(jhe(t)||t instanceof I_||t instanceof Pa||t instanceof iv),r=[],i=[];for(const o of t.children)o instanceof Hh&&(n&&!Jae(t.producedFields(),o.dependentFields())?r.push(o):i.push(o));if(r.length>0){const o=r.pop();for(const s of r)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Hh?t.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(i.length>1){const o=i.pop();for(const s of i)o.merge(s,this.model.renameSignal.bind(this.model));this.setModified()}}}class Ekn extends vx{run(t){const n=[...t.children];if(!oO(n,s=>s instanceof yl)||t.numChildren()<=1)return;const i=[];let o;for(const s of n)if(s instanceof yl){let a=s;for(;a.numChildren()===1;){const[l]=a.children;if(l instanceof yl)a=l;else break}i.push(...a.children),o?(t.removeChild(s),s.parent=o.parent,o.parent.removeChild(o),o.parent=a,this.setModified()):o=a}else i.push(s);if(i.length){this.setModified();for(const s of i)s.parent.removeChild(s),s.parent=o}}}class bx extends Pr{clone(){return new bx(null,Xt(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Ah(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??tt(t)}hash(){return`JoinAggregateTransform ${Nn(this.transform)}`}assemble(){const t=[],n=[],r=[];for(const o of this.transform.joinaggregate)n.push(o.op),r.push(this.getDefaultName(o)),t.push(o.field===void 0?null:o.field);const i=this.transform.groupby;return{type:"joinaggregate",as:r,ops:n,fields:t,...i!==void 0?{groupby:i}:{}}}}function Ckn(e){return e.stack.stackBy.reduce((t,n)=>{const r=n.fieldDef,i=tt(r);return i&&t.push(i),t},[])}function _kn(e){return ze(e)&&e.every(t=>ut(t))&&e.length>1}class Ig extends Pr{clone(){return new Ig(null,Xt(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:r,groupby:i,as:o,offset:s="zero"}=n,a=[],l=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),l.push(lo(f.order,"ascending"));const c={field:a,order:l};let u;return _kn(o)?u=o:ut(o)?u=[o,`${o}_end`]:u=[`${n.stack}_start`,`${n.stack}_end`],new Ig(t,{dimensionFieldDefs:[],stackField:r,groupby:i,offset:s,sort:c,facetby:[],as:u})}static makeFromEncoding(t,n){const r=n.stack,{encoding:i}=n;if(!r)return null;const{groupbyChannels:o,fieldChannel:s,offset:a,impute:l}=r,c=o.map(h=>{const p=i[h];return up(p)}).filter(h=>!!h),u=Ckn(n),f=n.encoding.order;let d;if(ze(f)||Ze(f))d=KGe(f);else{const h=IKe(f)?f.sort:s==="y"?"descending":"ascending";d=u.reduce((p,g)=>(p.field.push(g),p.order.push(h),p),{field:[],order:[]})}return new Ig(t,{dimensionFieldDefs:c,stackField:n.vgField(s),facetby:[],stackby:u,sort:d,offset:a,impute:l,as:[n.vgField(s,{suffix:"start",forAs:!0}),n.vgField(s,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Nn(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:r}=this._stack;return t.length>0?t.map(i=>i.bin?n?[tt(i,{binSuffix:"mid"})]:[tt(i,{}),tt(i,{binSuffix:"end"})]:[tt(i)]).flat():r??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:r,stackField:i,stackby:o,sort:s,offset:a,impute:l,as:c}=this._stack;if(l)for(const u of r){const{bandPosition:f=.5,bin:d}=u;if(d){const h=tt(u,{expr:"datum"}),p=tt(u,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${f}*${h}+${1-f}*${p}`,as:tt(u,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:i,groupby:[...o,...n],key:tt(u,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:i,sort:s,as:c,offset:a}),t}}class j_ extends Pr{clone(){return new j_(null,Xt(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Ah(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??tt(t)}hash(){return`WindowTransform ${Nn(this.transform)}`}assemble(){const t=[],n=[],r=[],i=[];for(const f of this.transform.window)n.push(f.op),r.push(this.getDefaultName(f)),i.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const o=this.transform.frame,s=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&n.every(f=>hQ(f)))return{type:"joinaggregate",as:r,ops:n,fields:t,...s!==void 0?{groupby:s}:{}};const a=[],l=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),l.push(f.order??"ascending");const c={field:a,order:l},u=this.transform.ignorePeers;return{type:"window",params:i,as:r,ops:n,fields:t,sort:c,...u!==void 0?{ignorePeers:u}:{},...s!==void 0?{groupby:s}:{},...o!==void 0?{frame:o}:{}}}}function kkn(e){function t(n){if(!(n instanceof L_)){const r=n.clone();if(r instanceof yl){const i=dee+r.getSource();r.setSource(i),e.model.component.data.outputNodes[i]=r}else(r instanceof pd||r instanceof Ig||r instanceof j_||r instanceof bx)&&r.addDimensions(e.fields);for(const i of n.children.flatMap(t))i.parent=r;return[r]}return n.children.flatMap(t)}return t}function fee(e){if(e instanceof L_)if(e.numChildren()===1&&!(e.children[0]instanceof yl)){const t=e.children[0];(t instanceof pd||t instanceof Ig||t instanceof j_||t instanceof bx)&&t.addDimensions(e.fields),t.swapWithParent(),fee(e)}else{const t=e.model.component.data.main;wet(t);const n=kkn(e),r=e.children.map(n).flat();for(const i of r)i.parent=t}else e.children.map(fee)}function wet(e){if(e instanceof yl&&e.type===Kr.Main&&e.numChildren()===1){const t=e.children[0];t instanceof L_||(t.swapWithParent(),wet(e))}}const dee="scale_",OI=5;function hee(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!hee(t.children))return!1}return!0}function Nf(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function dke(e,t,n){let r=e.sources,i=!1;return i=Nf(new ykn,r)||i,i=Nf(new gkn(t),r)||i,r=r.filter(o=>o.numChildren()>0),i=Nf(new Okn,r)||i,r=r.filter(o=>o.numChildren()>0),n||(i=Nf(new vkn,r)||i,i=Nf(new Skn(t),r)||i,i=Nf(new mkn,r)||i,i=Nf(new bkn,r)||i,i=Nf(new wkn,r)||i,i=Nf(new xkn,r)||i,i=Nf(new pkn,r)||i,i=Nf(new Ekn,r)||i),e.sources=r,i}function $kn(e,t){hee(e.sources);let n=0,r=0;for(let i=0;i<OI&&dke(e,t,!0);i++)n++;e.sources.map(fee);for(let i=0;i<OI&&dke(e,t,!1);i++)r++;hee(e.sources),Math.max(n,r)===OI&&Ye(`Maximum optimization runs(${OI}) reached.`)}class ss{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new ss(()=>t(n))}}function Eet(e){Ui(e)?Tkn(e):Pkn(e)}function Tkn(e){const t=e.component.scales;for(const n of He(t)){const r=Rkn(e,n);if(t[n].setWithExplicit("domains",r),Mkn(e,n),e.component.data.isFaceted){let o=e;for(;!gd(o)&&o.parent;)o=o.parent;if(o.component.resolve.scale[n]==="shared")for(const a of r.value)xg(a)&&(a.data=dee+a.data.replace(dee,""))}}}function Pkn(e){for(const n of e.children)Eet(n);const t=e.component.scales;for(const n of He(t)){let r,i=null;for(const o of e.children){const s=o.component.scales[n];if(s){r===void 0?r=s.getWithExplicit("domains"):r=tv(r,s.getWithExplicit("domains"),"domains","scale",pee);const a=s.get("selectionExtent");i&&a&&i.param!==a.param&&Ye(Wxn),i=a}}t[n].setWithExplicit("domains",r),i&&t[n].set("selectionExtent",i,!0)}}function Akn(e,t,n,r){if(e==="unaggregated"){const{valid:i,reason:o}=hke(t,n);if(!i){Ye(o);return}}else if(e===void 0&&r.useUnaggregatedDomain){const{valid:i}=hke(t,n);if(i)return"unaggregated"}return e}function Rkn(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:r}=e,i=Akn(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return i!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:i}),t==="x"&&Xo(r.x2)?Xo(r.x)?tv(Km(n,i,e,"x"),Km(n,i,e,"x2"),"domain","scale",pee):Km(n,i,e,"x2"):t==="y"&&Xo(r.y2)?Xo(r.y)?tv(Km(n,i,e,"y"),Km(n,i,e,"y2"),"domain","scale",pee):Km(n,i,e,"y2"):Km(n,i,e,t)}function Dkn(e,t,n){return e.map(r=>({signal:`{data: ${wQ(r,{timeUnit:n,type:t})}}`}))}function YU(e,t,n){var i;const r=(i=gs(n))==null?void 0:i.unit;return t==="temporal"||r?Dkn(e,t,r):[e]}function Km(e,t,n,r){const{encoding:i,markDef:o,mark:s,config:a,stack:l}=n,c=Xo(i[r]),{type:u}=c,f=c.timeUnit;if(dSn(t)){const p=Km(e,void 0,n,r),g=YU(t.unionWith,u,f);return dh([...g,...p.value])}else{if(Et(t))return dh([t]);if(t&&t!=="unaggregated"&&!CKe(t))return dh(YU(t,u,f))}if(l&&r===l.fieldChannel){if(l.offset==="normalize")return _c([[0,1]]);const p=n.requestDataName(Kr.Main);return _c([{data:p,field:n.vgField(r,{suffix:"start"})},{data:p,field:n.vgField(r,{suffix:"end"})}])}const d=Cm(r)&&Ze(c)?Nkn(n,r,e):void 0;if(Np(c)){const p=YU([c.datum],u,f);return _c(p)}const h=c;if(t==="unaggregated"){const p=n.requestDataName(Kr.Main),{field:g}=c;return _c([{data:p,field:tt({field:g,aggregate:"min"})},{data:p,field:tt({field:g,aggregate:"max"})}])}else if(ni(h.bin)){if(ms(e))return _c(e==="bin-ordinal"?[]:[{data:LP(d)?n.requestDataName(Kr.Main):n.requestDataName(Kr.Raw),field:n.vgField(r,GD(h,r)?{binSuffix:"range"}:{}),sort:d===!0||!dt(d)?{field:n.vgField(r,{}),op:"min"}:d}]);{const{bin:p}=h;if(ni(p)){const g=Lhe(n,h.field,p);return _c([new ss(()=>{const v=n.getSignalName(g);return`[${v}.start, ${v}.stop]`})])}else return _c([{data:n.requestDataName(Kr.Main),field:n.vgField(r,{})}])}}else if(h.timeUnit&&Pn(["time","utc"],e)){const p=i[Dp(r)];if(NKe(h,p,o,a)){const g=n.requestDataName(Kr.Main),v=ev({fieldDef:h,fieldDef2:p,markDef:o,config:a}),y=FP(s)&&v!==.5&&co(r);return _c([{data:g,field:n.vgField(r,y?{suffix:$Q}:{})},{data:g,field:n.vgField(r,{suffix:y?TQ:"end"})}])}}return _c(d?[{data:LP(d)?n.requestDataName(Kr.Main):n.requestDataName(Kr.Raw),field:n.vgField(r),sort:d}]:[{data:n.requestDataName(Kr.Main),field:n.vgField(r)}])}function GU(e,t){const{op:n,field:r,order:i}=e;return{op:n??(t?"sum":yQ),...r?{field:mf(r)}:{},...i?{order:i}:{}}}function Mkn(e,t){var a;const n=e.component.scales[t],r=e.specifiedScales[t].domain,i=(a=e.fieldDef(t))==null?void 0:a.bin,o=CKe(r)&&r,s=px(i)&&pQ(i.extent)&&i.extent;(o||s)&&n.set("selectionExtent",o??s,!0)}function Nkn(e,t,n){if(!ms(n))return;const r=e.fieldDef(t),i=r.sort;if(DKe(i))return{op:"min",field:sC(r,t),order:"ascending"};const{stack:o}=e,s=o?new Set([...o.groupbyFields,...o.stackBy.map(a=>a.fieldDef.field)]):void 0;if(Vh(i)){const a=o&&!s.has(i.field);return GU(i,a)}else if(RKe(i)){const{encoding:a,order:l}=i,c=e.fieldDef(a),{aggregate:u,field:f}=c,d=o&&!s.has(f);if(nm(u)||Qv(u))return GU({field:tt(c),order:l},d);if(hQ(u)||!u)return GU({op:u,field:f,order:l},d)}else{if(i==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(Pn(["ascending",void 0],i))return!0}}function hke(e,t){const{aggregate:n,type:r}=e;return n?ut(n)&&!kxn.has(n)?{valid:!1,reason:gwn(n)}:r==="quantitative"&&t==="log"?{valid:!1,reason:mwn(e)}:{valid:!0}:{valid:!1,reason:pwn(e)}}function pee(e,t,n,r){return e.explicit&&t.explicit&&Ye(xwn(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Ikn(e){const t=Ah(e.map(s=>{if(xg(s)){const{sort:a,...l}=s;return l}return s}),Nn),n=Ah(e.map(s=>{if(xg(s)){const a=s.sort;return a!==void 0&&!LP(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(s=>s!==void 0),Nn);if(t.length===0)return;if(t.length===1){const s=e[0];if(xg(s)&&n.length>0){let a=n[0];if(n.length>1){Ye(S_e);const l=n.filter(c=>dt(c)&&"op"in c&&c.op!=="min");n.every(c=>dt(c)&&"op"in c)&&l.length===1?a=l[0]:a=!0}else if(dt(a)&&"field"in a){const l=a.field;s.field===l&&(a=a.order?{order:a.order}:!0)}return{...s,sort:a}}return s}const r=Ah(n.map(s=>LP(s)||!("op"in s)||ut(s.op)&&s.op in Sxn?s:(Ye(Swn(s)),!0)),Nn);let i;r.length===1?i=r[0]:r.length>1&&(Ye(S_e),i=!0);const o=Ah(e.map(s=>xg(s)?s.data:null),s=>s);return o.length===1&&o[0]!==null?{data:o[0],fields:t.map(a=>a.field),...i?{sort:i}:{}}:{fields:t,...i?{sort:i}:{}}}function Qhe(e){if(xg(e)&&ut(e.field))return e.field;if($xn(e)){let t;for(const n of e.fields)if(xg(n)&&ut(n.field)){if(!t)t=n.field;else if(t!==n.field)return Ye(Ewn),t}return Ye(Cwn),t}else if(Txn(e)){Ye(_wn);const t=e.fields[0];return ut(t)?t:void 0}}function MQ(e,t){const r=e.component.scales[t].get("domains").map(i=>(xg(i)&&(i.data=e.lookupDataSource(i.data)),i));return Ikn(r)}function Cet(e){return F_(e)||Bhe(e)?e.children.reduce((t,n)=>t.concat(Cet(n)),pke(e)):pke(e)}function pke(e){return He(e.component.scales).reduce((t,n)=>{const r=e.component.scales[n];if(r.merged)return t;const i=r.combine(),{name:o,type:s,selectionExtent:a,domains:l,range:c,reverse:u,...f}=i,d=Lkn(i.range,o,n,e),h=MQ(e,n),p=a?ACn(e,a,r,h):null;return t.push({name:o,type:s,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...u!==void 0?{reverse:u}:{},...f}),t},[])}function Lkn(e,t,n,r){if(co(n)){if(Bv(e))return{step:{signal:`${t}_step`}}}else if(dt(e)&&xg(e))return{...e,data:r.lookupDataSource(e.data)};return e}class _et extends km{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainDefinitelyIncludesZero(){return this.get("zero")!==!1?!0:oO(this.get("domains"),t=>ze(t)&&t.length===2&&Hn(t[0])&&t[0]<=0&&Hn(t[1])&&t[1]>=0)}}const jkn=["range","scheme"];function Fkn(e){const t=e.component.scales;for(const n of dQ){const r=t[n];if(!r)continue;const i=zkn(n,e);r.setWithExplicit("range",i)}}function gke(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:r,field:i}=n,o=cc(t),s=e.getName(o);if(dt(r)&&r.binned&&r.step!==void 0)return new ss(()=>{const a=e.scaleName(t),l=`(domain("${a}")[1] - domain("${a}")[0]) / ${r.step}`;return`${e.getSignalName(s)} / (${l})`});if(ni(r)){const a=Lhe(e,i,r);return new ss(()=>{const l=e.getSignalName(a),c=`(${l}.stop - ${l}.start) / ${l}.step`;return`${e.getSignalName(s)} / (${c})`})}}}function zkn(e,t){const n=t.specifiedScales[e],{size:r}=t,o=t.getScaleComponent(e).get("type");for(const f of jkn)if(n[f]!==void 0){const d=KJ(o,f),h=_Ke(e,f);if(!d)Ye(oKe(o,f,e));else if(h)Ye(h);else switch(f){case"range":{const p=n.range;if(ze(p)){if(co(e))return dh(p.map(g=>{if(g==="width"||g==="height"){const v=t.getName(g),y=t.getSignalName.bind(t);return ss.fromName(y,v)}return g}))}else if(dt(p))return dh({data:t.requestDataName(Kr.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return dh(p)}case"scheme":return dh(Qkn(n[f]))}}const s=e===Ei||e==="xOffset"?"width":"height",a=r[s];if(fp(a)){if(co(e))if(ms(o)){const f=$et(a,t,e);if(f)return dh({step:f})}else Ye(sKe(s));else if(VD(e)){const f=e===Iv?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=Tet(a,o);if(p)return dh(p)}}}const{rangeMin:l,rangeMax:c}=n,u=Bkn(e,t);return(l!==void 0||c!==void 0)&&KJ(o,"rangeMin")&&ze(u)&&u.length===2?dh([l??u[0],c??u[1]]):_c(u)}function Qkn(e){return fSn(e)?{scheme:e.name,...Gl(e,["name"])}:{scheme:e}}function ket(e,t,n,{center:r}={}){const i=cc(e),o=t.getName(i),s=t.getSignalName.bind(t);return e===Os&&au(n)?r?[ss.fromName(a=>`${s(a)}/2`,o),ss.fromName(a=>`-${s(a)}/2`,o)]:[ss.fromName(s,o),0]:r?[ss.fromName(a=>`-${s(a)}/2`,o),ss.fromName(a=>`${s(a)}/2`,o)]:[0,ss.fromName(s,o)]}function Bkn(e,t){const{size:n,config:r,mark:i,encoding:o}=t,{type:s}=Xo(o[e]),l=t.getScaleComponent(e).get("type"),{domain:c,domainMid:u}=t.specifiedScales[e];switch(e){case Ei:case Os:{if(Pn(["point","band"],l)){const f=Pet(e,n,r.view);if(fp(f))return{step:$et(f,t,e)}}return ket(e,t,l)}case Iv:case D_:return Wkn(e,t,l);case Sm:{const f=t.component.scales[e].get("zero"),d=Aet(i,f,r),h=Ukn(i,n,t,r);return JE(l)?Vkn(d,h,qkn(l,r,c,e)):[d,h]}case kf:return[0,Math.PI*2];case dx:return[0,360];case Vd:return[0,new ss(()=>{const f=t.getSignalName("width"),d=t.getSignalName("height");return`min(${f},${d})/2`})];case Fv:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case zv:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case lc:return"symbol";case ac:case Ap:case Rp:return l==="ordinal"?s==="nominal"?"category":"ordinal":u!==void 0?"diverging":i==="rect"||i==="geoshape"?"heatmap":"ramp";case Em:case Lv:case jv:return[r.scale.minOpacity,r.scale.maxOpacity]}}function $et(e,t,n){const{encoding:r}=t,i=t.getScaleComponent(n),o=zde(n),s=r[o];if(dJe({step:e,offsetIsDiscrete:Jt(s)&&OKe(s.type)})==="offset"&&HKe(r,o)){const l=t.getScaleComponent(o);let u=`domain('${t.scaleName(o)}').length`;if(l.get("type")==="band"){const d=l.get("paddingInner")??l.get("padding")??0,h=l.get("paddingOuter")??l.get("padding")??0;u=`bandspace(${u}, ${d}, ${h})`}const f=i.get("paddingInner")??i.get("padding");return{signal:`${e.step} * ${u} / (1-${Dxn(f)})`}}else return e.step}function Tet(e,t){if(dJe({step:e,offsetIsDiscrete:ms(t)})==="offset")return{step:e.step}}function Wkn(e,t,n){const r=e===Iv?"x":"y",i=t.getScaleComponent(r);if(!i)return ket(r,t,n,{center:!0});const o=i.get("type"),s=t.scaleName(r),{markDef:a,config:l}=t;if(o==="band"){const c=Pet(r,t.size,t.config.view);if(fp(c)){const u=Tet(c,n);if(u)return u}return[0,{signal:`bandwidth('${s}')`}]}else{const c=t.encoding[r];if(Ze(c)&&c.timeUnit){const u=mKe(c.timeUnit,p=>`scale('${s}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=ev({fieldDef:c,markDef:a,config:l})-.5,h=d!==0?` + ${d}`:"";if(f){const p=Et(f)?`${f.signal}/2`+h:`${f/2+d}`,g=Et(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${u})`},{signal:`${g} * (${u})`}]}return[0,{signal:u}]}return mQe(`Cannot use ${e} scale if ${r} scale is not discrete.`)}}function Pet(e,t,n){const r=e===Ei?"width":"height",i=t[r];return i||N4(n,r)}function qkn(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&ze(n)?n.length+1:(Ye(Nwn(r)),3)}}function Vkn(e,t,n){const r=()=>{const i=id(t),o=id(e),s=`(${i} - ${o}) / (${n} - 1)`;return`sequence(${o}, ${i} + ${s}, ${s})`};return Et(t)?new ss(r):{signal:r()}}function Aet(e,t,n){if(t)return Et(t)?{signal:`${t.signal} ? 0 : ${Aet(e,!1,n)}`}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(gQ("size",e))}const mke=.95;function Ukn(e,t,n,r){const i={x:gke(n,"x"),y:gke(n,"y")};switch(e){case"bar":case"tick":{if(r.scale.maxBandSize!==void 0)return r.scale.maxBandSize;const o=yke(t,i,r.view);return Hn(o)?o-1:new ss(()=>`${o.signal} - 1`)}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const o=yke(t,i,r.view);return Hn(o)?Math.pow(mke*o,2):new ss(()=>`pow(${mke} * ${o.signal}, 2)`)}}throw new Error(gQ("size",e))}function yke(e,t,n){const r=fp(e.width)?e.width.step:M4(n,"width"),i=fp(e.height)?e.height.step:M4(n,"height");return t.x||t.y?new ss(()=>`min(${[t.x?t.x.signal:r,t.y?t.y.signal:i].join(", ")})`):Math.min(r,i)}function Ret(e,t){Ui(e)?Hkn(e,t):Met(e,t)}function Hkn(e,t){const n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:s}=e;for(const a of He(n)){const l=s[a],c=n[a],u=e.getScaleComponent(a),f=Xo(i[a]),d=l[t],h=u.get("type"),p=u.get("padding"),g=u.get("paddingInner"),v=KJ(h,t),y=_Ke(a,t);if(d!==void 0&&(v?y&&Ye(y):Ye(oKe(h,t,a))),v&&y===void 0)if(d!==void 0){const O=f.timeUnit,m=f.type;switch(t){case"domainMax":case"domainMin":gx(l[t])||m==="temporal"||O?c.set(t,{signal:wQ(l[t],{type:m,timeUnit:O})},!0):c.set(t,l[t],!0);break;default:c.copyKeyFromObject(t,l)}}else{const O=t in vke?vke[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:o,config:r,hasNestedOffsetScale:XKe(i,a),hasSecondaryRangeChannel:!!i[Dp(a)]}):r.scale[t];O!==void 0&&c.set(t,O,!1)}}}const vke={bins:({model:e,fieldOrDatumDef:t})=>Ze(t)?Xkn(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>Zkn(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:r,domainMax:i,fieldOrDatumDef:o})=>Ykn(e,t,n,r,i,o),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>Gkn(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:r,config:i,hasNestedOffsetScale:o})=>Kkn(e,t,n.type,r,i.scale,o),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:r,config:i,hasNestedOffsetScale:o})=>Jkn(e,t,n,r,i.scale,o),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>{const i=Ze(e)?e.sort:void 0;return e$n(t,i,n,r.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i,config:o,hasSecondaryRangeChannel:s})=>t$n(e,t,n,r,i,o.scale,s)};function Det(e){Ui(e)?Fkn(e):Met(e,"range")}function Met(e,t){const n=e.component.scales;for(const r of e.children)t==="range"?Det(r):Ret(r,t);for(const r of He(n)){let i;for(const o of e.children){const s=o.component.scales[r];if(s){const a=s.getWithExplicit(t);i=tv(i,a,t,"scale",CJe((l,c)=>{switch(t){case"range":return l.step&&c.step?l.step-c.step:0}return 0}))}}n[r].setWithExplicit(t,i)}}function Xkn(e,t){const n=t.bin;if(ni(n)){const r=Lhe(e,t.field,n);return new ss(()=>e.getSignalName(r))}else if(Ps(n)&&px(n)&&n.step!==void 0)return{step:n.step}}function Zkn(e,t){if(Pn([ac,Ap,Rp],e)&&t!=="nominal")return"hcl"}function Ykn(e,t,n,r,i,o){var s;if(!((s=up(o))!=null&&s.bin||ze(n)||i!=null||r!=null||Pn([ec.TIME,ec.UTC],e)))return co(t)?!0:void 0}function Gkn(e,t,n,r,i,o){if(co(e)){if(od(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:s,orient:a}=i;if(s==="bar"&&!(Ze(r)&&(r.bin||r.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return o.continuousBandSize}if(t===ec.POINT)return n.pointPadding}}function Kkn(e,t,n,r,i,o=!1){if(e===void 0){if(co(t)){const{bandPaddingInner:s,barBandPaddingInner:a,rectBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=i;return o?c:lo(s,n==="bar"?a:l)}else if(VD(t)&&r===ec.BAND)return i.offsetBandPaddingInner}}function Jkn(e,t,n,r,i,o=!1){if(e===void 0){if(co(t)){const{bandPaddingOuter:s,bandWithNestedOffsetPaddingOuter:a}=i;if(o)return a;if(n===ec.BAND)return lo(s,Et(r)?{signal:`${r.signal}/2`}:r/2)}else if(VD(t)){if(n===ec.POINT)return .5;if(n===ec.BAND)return i.offsetBandPaddingOuter}}}function e$n(e,t,n,r){if(n==="x"&&r.xReverse!==void 0)return au(e)&&t==="descending"?Et(r.xReverse)?{signal:`!${r.xReverse.signal}`}:!r.xReverse:r.xReverse;if(au(e)&&t==="descending")return!0}function t$n(e,t,n,r,i,o,s){if(!!n&&n!=="unaggregated"&&au(i)){if(ze(n)){const l=n[0],c=n[n.length-1];if(Hn(l)&&l<=0&&Hn(c)&&c>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!JE(i))return!0;if(!(Ze(t)&&t.bin)&&Pn([...Mp,...mxn],e)){const{orient:l,type:c}=r;return Pn(["bar","area","line","trail"],c)&&(l==="horizontal"&&e==="y"||l==="vertical"&&e==="x")?!1:Pn(["bar","area"],c)&&!s?!0:o==null?void 0:o.zero}return!1}function n$n(e,t,n,r,i=!1){const o=r$n(t,n,r,i),{type:s}=e;return Cm(t)?s!==void 0?vSn(t,s)?Ze(n)&&!ySn(s,n.type)?(Ye(bwn(s,o)),o):s:(Ye(vwn(t,s,o)),o):o:null}function r$n(e,t,n,r){var i;switch(t.type){case"nominal":case"ordinal":{if(FS(e)||BU(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&Ye(WU(e,"ordinal")),"ordinal";if(co(e)||VD(e)){if(Pn(["rect","bar","image","rule"],n.type)||r)return"band"}else if(n.type==="arc"&&e in Wde)return"band";const o=n[cc(e)];return aO(o)||tC(t)&&((i=t.axis)!=null&&i.tickBand)?"band":"point"}case"temporal":return FS(e)?"time":BU(e)==="discrete"?(Ye(WU(e,"temporal")),"ordinal"):Ze(t)&&t.timeUnit&&gs(t.timeUnit).utc?"utc":"time";case"quantitative":return FS(e)?Ze(t)&&ni(t.bin)?"bin-ordinal":"linear":BU(e)==="discrete"?(Ye(WU(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(rKe(t.type))}function i$n(e,{ignoreRange:t}={}){Net(e),Eet(e);for(const n of mSn)Ret(e,n);t||Det(e)}function Net(e){Ui(e)?e.component.scales=o$n(e):e.component.scales=a$n(e)}function o$n(e){const{encoding:t,mark:n,markDef:r}=e,i={};for(const o of dQ){const s=Xo(t[o]);if(s&&n===_Qe&&o===lc&&s.type===M_)continue;let a=s&&s.scale;if(s&&a!==null&&a!==!1){a??(a={});const l=XKe(t,o),c=n$n(a,o,s,r,l);i[o]=new _et(e.scaleName(`${o}`,!0),{value:c,explicit:a.type===c})}}return i}const s$n=CJe((e,t)=>C_e(e)-C_e(t));function a$n(e){var t;const n=e.component.scales={},r={},i=e.component.resolve;for(const o of e.children){Net(o);for(const s of He(o.component.scales))if((t=i.scale)[s]??(t[s]=uet(s,e)),i.scale[s]==="shared"){const a=r[s],l=o.component.scales[s].getWithExplicit("type");a?sSn(a.value,l.value)?r[s]=tv(a,l,"type","scale",s$n):(i.scale[s]="independent",delete r[s]):r[s]=l}}for(const o of He(r)){const s=e.scaleName(o,!0),a=r[o];n[o]=new _et(s,a);for(const l of e.children){const c=l.component.scales[o];c&&(l.renameScale(c.get("name"),s),c.merged=!0)}}return n}class KU{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function Ui(e){return(e==null?void 0:e.type)==="unit"}function gd(e){return(e==null?void 0:e.type)==="facet"}function Bhe(e){return(e==null?void 0:e.type)==="concat"}function F_(e){return(e==null?void 0:e.type)==="layer"}let Whe=class{constructor(t,n,r,i,o,s,a){this.type=n,this.parent=r,this.config=o,this.correctDataNames=l=>{var c,u,f;return(c=l.from)!=null&&c.data&&(l.from.data=this.lookupDataSource(l.from.data)),(f=(u=l.from)==null?void 0:u.facet)!=null&&f.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l},this.parent=r,this.config=o,this.view=Ll(a),this.name=t.name??i,this.title=cy(t.title)?{text:t.title}:t.title?Ll(t.title):void 0,this.scaleNameMap=r?r.scaleNameMap:new KU,this.projectionNameMap=r?r.projectionNameMap:new KU,this.signalNameMap=r?r.signalNameMap:new KU,this.data=t.data,this.description=t.description,this.transforms=pCn(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:vEn(t,n,o),this.component={data:{sources:r?r.component.data.sources:[],outputNodes:r?r.component.data.outputNodes:{},outputNodeRefCounts:r?r.component.data.outputNodeRefCounts:{},isFaceted:vQ(t)||(r==null?void 0:r.component.data.isFaceted)&&t.data===void 0},layoutSize:new km,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...s?Xt(s):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){i$n(this)}parseProjection(){Oet(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){get(this)}assembleEncodeFromView(t){const{style:n,...r}=t,i={};for(const o of He(r)){const s=r[o];s!==void 0&&(i[o]=ui(s))}return i}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=ui(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n??{}}:Ir(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:r,config:i}=this,o=$_n(r.layoutHeaders,i);return{padding:t,...this.assembleDefaultLayout(),...n,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const r of Yu)t[r].title&&n.push(w_n(this,r));for(const r of Dhe)n=n.concat(S_n(this,r));return n}assembleAxes(){return c_n(this.component.axes,this.config)}assembleLegends(){return yet(this)}assembleProjections(){return G_n(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},r={...XGe(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(r.text)return Pn(["unit","layer"],this.type)?Pn(["middle",void 0],r.anchor)&&(r.frame??(r.frame="group")):r.anchor??(r.anchor="start"),Ir(r)?void 0:r}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const r=this.assembleLayout();r&&(n.layout=r),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||gd(this.parent)?Cet(this):[];i.length>0&&(n.scales=i);const o=this.assembleAxes();o.length>0&&(n.axes=o);const s=this.assembleLegends();return s.length>0&&(n.legends=s),n}getName(t){return Si((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Kr[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),r=this.component.data.outputNodeRefCounts;return r[n]=(r[n]||0)+1,n}getSizeSignalRef(t){if(gd(this.parent)){const n=aet(t),r=fQ(n),i=this.component.scales[r];if(i&&!i.merged){const o=i.get("type"),s=i.get("range");if(ms(o)&&Bv(s)){const a=i.get("name"),l=MQ(this,r),c=Qhe(l);if(c){const u=tt({aggregate:"distinct",field:c},{expr:"datum"});return{signal:set(a,i,u)}}else return Ye(Vde(r)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(jGe(t)&&Cm(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getSelectionComponent(t,n){let r=this.component.selection[t];if(!r&&this.parent&&(r=this.parent.getSelectionComponent(t,n)),!r)throw new Error(jxn(n));return r}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(r=>r.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(r=>r.hasOrientSignalRef()))}};class Iet extends Whe{vgField(t,n={}){const r=this.fieldDef(t);if(r)return tt(r,n)}reduceFieldDef(t,n){return HSn(this.getMapping(),(r,i,o)=>{const s=up(i);return s?t(r,s,o):r},n)}forEachFieldDef(t,n){ghe(this.getMapping(),(r,i)=>{const o=up(r);o&&t(o,i)},n)}}class NQ extends Pr{clone(){return new NQ(null,Xt(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Xt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"]}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Nn(this.transform)}`}assemble(){const{density:t,...n}=this.transform,r={type:"kde",field:t,...n};return this.transform.groupby&&(r.resolve="shared"),r}}class IQ extends Pr{clone(){return new IQ(null,Xt(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Xt(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Nn(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class OA extends Pr{clone(){return new OA(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n){const{config:r,mark:i,markDef:o}=n;if(vr("invalid",o,r)!=="filter")return null;const a=n.reduceFieldDef((l,c,u)=>{const f=Cm(u)&&n.getScaleComponent(u);if(f){const d=f.get("type");au(d)&&c.aggregate!=="count"&&!kv(i)&&(l[c.field]=c)}return l},{});return He(a).length?new OA(t,a):null}dependentFields(){return new Set(He(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Nn(this.filter)}`}assemble(){const t=He(this.filter).reduce((n,r)=>{const i=this.filter[r],o=tt(i,{expr:"datum"});return i!==null&&(i.type==="temporal"?n.push(`(isDate(${o}) || (isValid(${o}) && isFinite(+${o})))`):i.type==="quantitative"&&(n.push(`isValid(${o})`),n.push(`isFinite(+${o})`))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}class LQ extends Pr{clone(){return new LQ(this.parent,Xt(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Xt(n);const{flatten:r,as:i=[]}=this.transform;this.transform.as=r.map((o,s)=>i[s]??o)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Nn(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class jQ extends Pr{clone(){return new jQ(null,Xt(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Xt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Nn(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class BS extends Pr{clone(){return new BS(null,Xt(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let r=0;for(const i of[[Hd,Ud],[Of,Xd]]){const o=i.map(s=>{const a=Xo(n.encoding[s]);return Ze(a)?a.field:Np(a)?{expr:`${a.datum}`}:Rd(a)?{expr:`${a.value}`}:void 0});(o[0]||o[1])&&(t=new BS(t,o,null,n.getName(`geojson_${r++}`)))}if(n.channelHasField(lc)){const i=n.typedFieldDef(lc);i.type===M_&&(t=new BS(t,null,i.field,n.getName(`geojson_${r++}`)))}return t}constructor(t,n,r,i){super(t),this.fields=n,this.geojson=r,this.signal=i}dependentFields(){const t=(this.fields??[]).filter(ut);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Nn(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class xA extends Pr{clone(){return new xA(null,this.projection,Xt(this.fields),Xt(this.as))}constructor(t,n,r,i){super(t),this.projection=n,this.fields=r,this.as=i}static parseAll(t,n){if(!n.projectionName())return t;for(const r of[[Hd,Ud],[Of,Xd]]){const i=r.map(s=>{const a=Xo(n.encoding[s]);return Ze(a)?a.field:Np(a)?{expr:`${a.datum}`}:Rd(a)?{expr:`${a.value}`}:void 0}),o=r[0]===Of?"2":"";(i[0]||i[1])&&(t=new xA(t,n.projectionName(),i,[n.getName(`x${o}`),n.getName(`y${o}`)]))}return t}dependentFields(){return new Set(this.fields.filter(ut))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Nn(this.fields)} ${Nn(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class mb extends Pr{clone(){return new mb(null,Xt(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:r,step:i}=t;return{signal:`sequence(${[n,r,...i?[i]:[]].join(",")})`}}static makeFromTransform(t,n){return new mb(t,n)}static makeFromEncoding(t,n){const r=n.encoding,i=r.x,o=r.y;if(Ze(i)&&Ze(o)){const s=i.impute?i:o.impute?o:void 0;if(s===void 0)return;const a=i.impute?o:o.impute?i:void 0,{method:l,value:c,frame:u,keyvals:f}=s.impute,d=YKe(n.mark,r);return new mb(t,{impute:s.field,key:a.field,...l?{method:l}:{},...c!==void 0?{value:c}:{},...u?{frame:u}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${Nn(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:r,method:i,groupby:o,value:s,frame:a=[null,null]}=this.transform,l={type:"impute",field:t,key:n,...r?{keyvals:ZEn(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!i||i==="value"?s:null};if(i&&i!=="value"){const c={type:"window",as:[`imputed_${t}_value`],ops:[i],fields:[t],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},u={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[l,c,u]}else return[l]}}class FQ extends Pr{clone(){return new FQ(null,Xt(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Xt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Nn(this.transform)}`}assemble(){const{loess:t,on:n,...r}=this.transform;return{type:"loess",x:n,y:t,...r}}}class wA extends Pr{clone(){return new wA(null,Xt(this.transform),this.secondary)}constructor(t,n,r){super(t),this.transform=n,this.secondary=r}static make(t,n,r,i){const o=n.component.data.sources,{from:s}=r;let a=null;if(YEn(s)){let l=Fet(s.data,o);l||(l=new TO(s.data),o.push(l));const c=n.getName(`lookup_${i}`);a=new yl(l,c,Kr.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[c]=a}else if(GEn(s)){const l=s.param;r={as:l,...r};let c;try{c=n.getSelectionComponent(Si(l),l)}catch{throw new Error(Qxn(l))}if(a=c.materialized,!a)throw new Error(Bxn(l))}return new wA(t,r,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?ct(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Nn({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:ct(this.transform.as)}:{}};else{let n=this.transform.as;ut(n)||(Ye(Yxn),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class zQ extends Pr{clone(){return new zQ(null,Xt(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Xt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Nn(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class QQ extends Pr{clone(){return new QQ(null,Xt(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Xt(n);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??n.on,r[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Nn(this.transform)}`}assemble(){const{regression:t,on:n,...r}=this.transform;return{type:"regression",x:n,y:t,...r}}}class BQ extends Pr{clone(){return new BQ(null,Xt(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Ah((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Nn(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:r,limit:i,op:o}=this.transform;return{type:"pivot",field:t,value:n,...i!==void 0?{limit:i}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}}class WQ extends Pr{clone(){return new WQ(null,Xt(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Nn(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function Let(e){let t=0;function n(r,i){if(r instanceof TO&&!r.isGenerator&&!rC(r.data)&&(e.push(i),i={name:null,source:i.name,transform:[]}),r instanceof Pa&&(r.parent instanceof TO&&!i.source?(i.format={...i.format??{},parse:r.assembleFormatParse()},i.transform.push(...r.assembleTransforms(!0))):i.transform.push(...r.assembleTransforms())),r instanceof L_){i.name||(i.name=`data_${t++}`),!i.source||i.transform.length>0?(e.push(i),r.data=i.name):r.data=i.source,e.push(...r.assemble());return}switch((r instanceof eM||r instanceof tM||r instanceof OA||r instanceof I_||r instanceof oC||r instanceof xA||r instanceof pd||r instanceof wA||r instanceof j_||r instanceof bx||r instanceof jQ||r instanceof LQ||r instanceof NQ||r instanceof FQ||r instanceof zQ||r instanceof QQ||r instanceof iv||r instanceof WQ||r instanceof BQ||r instanceof IQ)&&i.transform.push(r.assemble()),(r instanceof Hh||r instanceof Uh||r instanceof mb||r instanceof Ig||r instanceof BS)&&i.transform.push(...r.assemble()),r instanceof yl&&(i.source&&i.transform.length===0?r.setSource(i.source):r.parent instanceof yl?r.setSource(i.name):(i.name||(i.name=`data_${t++}`),r.setSource(i.name),r.numChildren()===1&&(e.push(i),i={name:null,source:i.name,transform:[]}))),r.numChildren()){case 0:r instanceof yl&&(!i.source||i.transform.length>0)&&e.push(i);break;case 1:n(r.children[0],i);break;default:{i.name||(i.name=`data_${t++}`);let o=i.name;!i.source||i.transform.length>0?e.push(i):o=i.source;for(const s of r.children)n(s,{name:null,source:o,transform:[]});break}}}return n}function l$n(e){const t=[],n=Let(t);for(const r of e.children)n(r,{source:e.name,name:null,transform:[]});return t}function c$n(e,t){const n=[],r=Let(n);let i=0;for(const s of e.sources){s.hasName()||(s.dataName=`source_${i++}`);const a=s.assemble();r(s,a)}for(const s of n)s.transform.length===0&&delete s.transform;let o=0;for(const[s,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(o++,0,n.splice(s,1)[0]);for(const s of n)for(const a of s.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const s of n)s.name in t&&(s.values=t[s.name]);return n}function u$n(e){return e==="top"||e==="left"||Et(e)?"header":"footer"}function f$n(e){for(const t of Yu)d$n(e,t);bke(e,"x"),bke(e,"y")}function d$n(e,t){var s;const{facet:n,config:r,child:i,component:o}=e;if(e.channelHasField(t)){const a=n[t],l=aC("title",null,r,t);let c=zS(a,r,{allowDisabling:!0,includeDefault:l===void 0||!!l});i.component.layoutHeaders[t].title&&(c=ze(c)?c.join(", "):c,c+=` / ${i.component.layoutHeaders[t].title}`,i.component.layoutHeaders[t].title=null);const u=aC("labelOrient",a.header,r,t),f=a.header!==null?lo((s=a.header)==null?void 0:s.labels,r.header.labels,!0):!1,d=Pn(["bottom","right"],u)?"footer":"header";o.layoutHeaders[t]={title:a.header!==null?c:null,facetFieldDef:a,[d]:t==="facet"?[]:[jet(e,t,f)]}}}function jet(e,t,n){const r=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(r)?e.child.getSizeSignalRef(r):void 0,axes:[]}}function bke(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:r,resolve:i}=e.component;if(i.axis[t]=Ihe(i,t),i.axis[t]==="shared"){const o=t==="x"?"column":"row",s=r[o];for(const a of n.component.axes[t]){const l=u$n(a.get("orient"));s[l]??(s[l]=[jet(e,o,!1)]);const c=Y$(a,"main",e.config,{header:!0});c&&s[l][0].axes.push(c),a.mainExtracted=!0}}}}function h$n(e){qhe(e),F4(e,"width"),F4(e,"height")}function p$n(e){qhe(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";F4(e,t),F4(e,n)}function qhe(e){for(const t of e.children)t.parseLayoutSize()}function F4(e,t){const n=aet(t),r=fQ(n),i=e.component.resolve,o=e.component.layoutSize;let s;for(const a of e.children){const l=a.component.layoutSize.getWithExplicit(n),c=i.scale[r]??uet(r,e);if(c==="independent"&&l.value==="step"){s=void 0;break}if(s){if(c==="independent"&&s.value!==l.value){s=void 0;break}s=tv(s,l,n,"")}else s=l}if(s){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);o.setWithExplicit(t,s)}else o.setWithExplicit(t,{explicit:!1,value:void 0})}function g$n(e){const{size:t,component:n}=e;for(const r of Mp){const i=cc(r);if(t[i]){const o=t[i];n.layoutSize.set(i,fp(o)?"step":o,!0)}else{const o=m$n(e,i);n.layoutSize.set(i,o,!1)}}}function m$n(e,t){const n=t==="width"?"x":"y",r=e.config,i=e.getScaleComponent(n);if(i){const o=i.get("type"),s=i.get("range");if(ms(o)){const a=N4(r.view,t);return Bv(s)||fp(a)?"step":a}else return tee(r.view,t)}else{if(e.hasProjection||e.mark==="arc")return tee(r.view,t);{const o=N4(r.view,t);return fp(o)?o.step:o}}}function gee(e,t,n){return tt(t,{suffix:`by_${tt(e)}`,...n??{}})}class o2 extends Iet{constructor(t,n,r,i){super(t,"facet",n,r,i,t.resolve),this.child=Zhe(t.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!ZD(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=He(t),r={};for(const i of n){if(![Dg,Mg].includes(i)){Ye(gQ(i,"facet"));break}const o=t[i];if(o.field===void 0){Ye(YJ(o,i));break}r[i]=this.initFacetFieldDef(o,i)}return r}initFacetFieldDef(t,n){const r=hhe(t,n);return r.header?r.header=Ll(r.header):r.header===null&&(r.header=null),r}channelHasField(t){return!!this.facet[t]}fieldDef(t){return this.facet[t]}parseData(){this.component.data=qQ(this),this.child.parseData()}parseLayoutSize(){qhe(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),f$n(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of Yu)for(const r of Mhe){const i=this.component.layoutHeaders[n],o=i[r],{facetFieldDef:s}=i;if(s){const a=aC("titleOrient",s.header,this.config,n);if(["right","bottom"].includes(a)){const l=RQ(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[l]="end"}}if(o!=null&&o[0]){const a=n==="row"?"height":"width",l=r==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[l]??(t[l]={}),t[l][n]=.5),i.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,r=t?this.columnDistinctSignal():n?1:void 0;let i="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(i="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof o2))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof o2?{...this.channelHasField("column")?{encode:{update:{columns:{field:tt(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],r=[];if(this.child instanceof o2){if(this.child.channelHasField("column")){const i=tt(this.child.facet.column);t.push(i),n.push("distinct"),r.push(`distinct_${i}`)}}else for(const i of Mp){const o=this.child.component.scales[i];if(o&&!o.merged){const s=o.get("type"),a=o.get("range");if(ms(s)&&Bv(a)){const l=MQ(this.child,i),c=Qhe(l);c?(t.push(c),n.push("distinct"),r.push(`distinct_${c}`)):Ye(Vde(i))}}}return{fields:t,ops:n,as:r}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:r,column:i}=this.facet,{fields:o,ops:s,as:a}=this.getCardinalityAggregateForChild(),l=[];for(const u of Yu){const f=this.facet[u];if(f){l.push(tt(f));const{bin:d,sort:h}=f;if(ni(d)&&l.push(tt(f,{binSuffix:"end"})),Vh(h)){const{field:p,op:g=yQ}=h,v=gee(f,h);r&&i?(o.push(v),s.push("max"),a.push(v)):(o.push(p),s.push(g),a.push(v))}else if(ze(h)){const p=sC(f,u);o.push(p),s.push("max"),a.push(p)}}}const c=!!r&&!!i;return{name:t,data:n,groupby:l,...c||o.length>0?{aggregate:{...c?{cross:c}:{},...o.length?{fields:o,ops:s,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,r=n[t];return r?Vh(r.sort)?[gee(r,r.sort,{expr:"datum"})]:ze(r.sort)?[sC(r,t,{expr:"datum"})]:[tt(r,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,r=n[t];if(r){const{sort:i}=r;return[(Vh(i)?i.order:!ze(i)&&i)||"ascending"]}return[]}assembleLabelTitle(){var i;const{facet:t,config:n}=this;if(t.facet)return cee(t.facet,"facet",n);const r={row:["top","bottom"],column:["left","right"]};for(const o of Dhe)if(t[o]){const s=aC("labelOrient",(i=t[o])==null?void 0:i.header,n,o);if(r[o].includes(s))return cee(t[o],o,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,r=l$n(n),i=t.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||t.assembleTitle(),s=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...s?{style:s}:{},from:{facet:this.assembleFacet()},sort:{field:Yu.map(l=>this.facetSortFields(l)).flat(),order:Yu.map(l=>this.facetSortOrder(l)).flat()},...r.length>0?{data:r}:{},...i?{encode:{update:i}}:{},...t.assembleGroup(kCn(this,[]))}]}getMapping(){return this.facet}}function y$n(e,t){const{row:n,column:r}=t;if(n&&r){let i=null;for(const o of[n,r])if(Vh(o.sort)){const{field:s,op:a=yQ}=o.sort;e=i=new bx(e,{joinaggregate:[{op:a,field:s,as:gee(o,o.sort,{forAs:!0})}],groupby:[tt(o)]})}return i}return null}function Fet(e,t){var n,r,i,o;for(const s of t){const a=s.data;if(e.name&&s.hasName()&&e.name!==s.dataName)continue;const l=(n=e.format)==null?void 0:n.mesh,c=(r=a.format)==null?void 0:r.feature;if(l&&c)continue;const u=(i=e.format)==null?void 0:i.feature;if((u||c)&&u!==c)continue;const f=(o=a.format)==null?void 0:o.mesh;if(!((l||f)&&l!==f)){if(bA(e)&&bA(a)){if(Wc(e.values,a.values))return s}else if(rC(e)&&rC(a)){if(e.url===a.url)return s}else if(_Je(e)&&e.name===s.dataName)return s}}return null}function v$n(e,t){if(e.data||!e.parent){if(e.data===null){const r=new TO({values:[]});return t.push(r),r}const n=Fet(e.data,t);if(n)return u0(e.data)||(n.data.format=yQe({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const r=new TO(e.data);return t.push(r),r}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function b$n(e,t,n){let r=0;for(const i of t.transforms){let o,s;if(aCn(i))s=e=new oC(e,i),o="derived";else if(_he(i)){const a=ukn(i);s=e=Pa.makeWithAncestors(e,{},a,n)??e,e=new I_(e,t,i.filter)}else if(xJe(i))s=e=Hh.makeFromTransform(e,i,t),o="number";else if(cCn(i))o="date",n.getWithExplicit(i.field).value===void 0&&(e=new Pa(e,{[i.field]:o}),n.set(i.field,o,!1)),s=e=Uh.makeFromTransform(e,i);else if(uCn(i))s=e=pd.makeFromTransform(e,i),o="number",Rhe(t)&&(e=new iv(e));else if(OJe(i))s=e=wA.make(e,t,i,r++),o="derived";else if(iCn(i))s=e=new j_(e,i),o="number";else if(oCn(i))s=e=new bx(e,i),o="number";else if(fCn(i))s=e=Ig.makeFromTransform(e,i),o="derived";else if(dCn(i))s=e=new jQ(e,i),o="derived";else if(hCn(i))s=e=new IQ(e,i),o="derived";else if(sCn(i))s=e=new LQ(e,i),o="derived";else if(KEn(i))s=e=new BQ(e,i),o="derived";else if(rCn(i))e=new WQ(e,i);else if(lCn(i))s=e=mb.makeFromTransform(e,i),o="derived";else if(JEn(i))s=e=new NQ(e,i),o="derived";else if(eCn(i))s=e=new zQ(e,i),o="derived";else if(tCn(i))s=e=new QQ(e,i),o="derived";else if(nCn(i))s=e=new FQ(e,i),o="derived";else{Ye(Zxn(i));continue}if(s&&o!==void 0)for(const a of s.producedFields()??[])n.set(a,o,!1)}return e}function qQ(e){var g;let t=v$n(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:r}=e.component.data,i=e.data,s=!(i&&(u0(i)||rC(i)||bA(i)))&&e.parent?e.parent.component.data.ancestorParse.clone():new CCn;u0(i)?(kJe(i)?t=new tM(t,i.sequence):khe(i)&&(t=new eM(t,i.graticule)),s.parseNothing=!0):((g=i==null?void 0:i.format)==null?void 0:g.parse)===null&&(s.parseNothing=!0),t=Pa.makeExplicit(t,e,s)??t,t=new iv(t);const a=e.parent&&F_(e.parent);(Ui(e)||gd(e))&&a&&(t=Hh.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=b$n(t,e,s));const l=dkn(e),c=fkn(e);t=Pa.makeWithAncestors(t,{},{...l,...c},s)??t,Ui(e)&&(t=BS.parseAll(t,e),t=xA.parseAll(t,e)),(Ui(e)||gd(e))&&(a||(t=Hh.makeFromEncoding(t,e)??t),t=Uh.makeFromEncoding(t,e)??t,t=oC.parseAllForSortIndex(t,e));const u=e.getDataName(Kr.Raw),f=new yl(t,u,Kr.Raw,r);if(n[u]=f,t=f,Ui(e)){const v=pd.makeFromEncoding(t,e);v&&(t=v,Rhe(e)&&(t=new iv(t))),t=mb.makeFromEncoding(t,e)??t,t=Ig.makeFromEncoding(t,e)??t}Ui(e)&&(t=OA.make(t,e)??t);const d=e.getDataName(Kr.Main),h=new yl(t,d,Kr.Main,r);n[d]=h,t=h,Ui(e)&&a_n(e,h);let p=null;if(gd(e)){const v=e.getName("facet");t=y$n(t,e.facet)??t,p=new L_(t,e,v,h.getSource()),n[v]=p}return{...e.component.data,outputNodes:n,outputNodeRefCounts:r,raw:f,main:h,facetRoot:p,ancestorParse:s}}class O$n extends Whe{constructor(t,n,r,i){var o,s,a,l;super(t,"concat",n,r,i,t.resolve),(((s=(o=t.resolve)==null?void 0:o.axis)==null?void 0:s.x)==="shared"||((l=(a=t.resolve)==null?void 0:a.axis)==null?void 0:l.y)==="shared")&&Ye(Uxn),this.children=this.getChildren(t).map((c,u)=>Zhe(c,this,this.getName(`concat_${u}`),void 0,i))}parseData(){this.component.data=qQ(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of He(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return CQ(t)?t.vconcat:Ehe(t)?t.hconcat:t.concat}parseLayoutSize(){p$n(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=Nhe(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,r)=>r.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),r=t.assembleGroupStyle(),i=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...r?{style:r}:{},...i?{encode:{update:i}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function x$n(e){return e===!1||e===null}const w$n={disable:1,gridScale:1,scale:1,...VKe,labelExpr:1,encode:1},zet=He(w$n);class Vhe extends km{constructor(t={},n={},r=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=r}clone(){return new Vhe(Xt(this.explicit),Xt(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!x$n(this.get(t))}hasOrientSignalRef(){return Et(this.explicit.orient)}}function S$n(e,t,n){const{encoding:r,config:i}=e,o=Xo(r[t])??Xo(r[Dp(t)]),s=e.axis(t)||{},{format:a,formatType:l}=s;if(_O(l))return{text:sd({fieldOrDatumDef:o,field:"datum.value",format:a,formatType:l,config:i}),...n};if(a===void 0&&l===void 0&&i.customFormatTypes){if(eC(o)==="quantitative"){if(tC(o)&&o.stack==="normalize"&&i.normalizedNumberFormatType)return{text:sd({fieldOrDatumDef:o,field:"datum.value",format:i.normalizedNumberFormat,formatType:i.normalizedNumberFormatType,config:i}),...n};if(i.numberFormatType)return{text:sd({fieldOrDatumDef:o,field:"datum.value",format:i.numberFormat,formatType:i.numberFormatType,config:i}),...n}}if(eC(o)==="temporal"&&i.timeFormatType&&Ze(o)&&!o.timeUnit)return{text:sd({fieldOrDatumDef:o,field:"datum.value",format:i.timeFormat,formatType:i.timeFormatType,config:i}),...n}}return n}function E$n(e){return Mp.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[A$n(n,e)]),t),{})}const C$n={bottom:"top",top:"bottom",left:"right",right:"left"};function _$n(e){const{axes:t,resolve:n}=e.component,r={top:0,bottom:0,right:0,left:0};for(const i of e.children){i.parseAxesAndHeaders();for(const o of He(i.component.axes))n.axis[o]=Ihe(e.component.resolve,o),n.axis[o]==="shared"&&(t[o]=k$n(t[o],i.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const i of Mp){for(const o of e.children)if(o.component.axes[i]){if(n.axis[i]==="independent"){t[i]=(t[i]??[]).concat(o.component.axes[i]);for(const s of o.component.axes[i]){const{value:a,explicit:l}=s.getWithExplicit("orient");if(!Et(a)){if(r[a]>0&&!l){const c=C$n[a];r[a]>r[c]&&s.set("orient",c,!1)}r[a]++}}}delete o.component.axes[i]}if(n.axis[i]==="independent"&&t[i]&&t[i].length>1)for(const[o,s]of(t[i]||[]).entries())o>0&&s.get("grid")&&!s.explicit.grid&&(s.implicit.grid=!1)}}function k$n(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let r=0;r<n;r++){const i=e[r],o=t[r];if(!!i!=!!o)return;if(i&&o){const s=i.getWithExplicit("orient"),a=o.getWithExplicit("orient");if(s.explicit&&a.explicit&&s.value!==a.value)return;e[r]=$$n(i,o)}}}else return t.map(n=>n.clone());return e}function $$n(e,t){for(const n of zet){const r=tv(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(i,o)=>{switch(n){case"title":return tKe(i,o);case"gridScale":return{explicit:i.explicit,value:lo(i.value,o.value)}}return kQ(i,o,n,"axis")});e.setWithExplicit(n,r)}return e}function T$n(e,t,n,r,i){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(Et(n.labelAngle)?n.labelAngle:jP(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===net(r,i))return!0}return e===n[t]}const P$n=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function A$n(e,t){var y,O;let n=t.axis(e);const r=new Vhe,i=Xo(t.encoding[e]),{mark:o,config:s}=t,a=(n==null?void 0:n.orient)||((y=s[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((O=s.axis)==null?void 0:O.orient)||y_n(e),l=t.getScaleComponent(e).get("type"),c=u_n(e,l,a,t.config),u=n!==void 0?!n:aee("disable",s.style,n==null?void 0:n.style,c).configValue;if(r.set("disable",u,n!==void 0),u)return r;n=n||{};const f=p_n(i,n,e,s.style,c),d=PKe(n.formatType,i,l),h=TKe(i,i.type,n.format,n.formatType,s,!0),p={fieldOrDatumDef:i,axis:n,channel:e,model:t,scaleType:l,orient:a,labelAngle:f,format:h,formatType:d,mark:o,config:s};for(const m of zet){const w=m in ike?ike[m](p):A_e(m)?n[m]:void 0,S=w!==void 0,E=T$n(w,m,n,t,e);if(S&&E)r.set(m,w,E);else{const{configValue:C=void 0,configFrom:k=void 0}=A_e(m)&&m!=="values"?aee(m,s.style,n.style,c):{},P=C!==void 0;S&&!P?r.set(m,w,E):(k!=="vgAxisConfig"||P$n.has(m)&&P||KD(C)||Et(C))&&r.set(m,C,!1)}}const g=n.encoding??{},v=qKe.reduce((m,w)=>{if(!r.hasAxisPart(w))return m;const S=cet(g[w]??{},t),E=w==="labels"?S$n(t,e,S):S;return E!==void 0&&!Ir(E)&&(m[w]={update:E}),m},{});return Ir(v)||r.set("encode",v,!!n.encoding||n.labelAngle!==void 0),r}function R$n({encoding:e,size:t}){for(const n of Mp){const r=cc(n);fp(t[r])&&zy(e[n])&&(delete t[r],Ye(sKe(r)))}return t}const D$n={vgMark:"arc",encodeEntry:e=>({...$f(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ta("x",e,{defaultPos:"mid"}),...Ta("y",e,{defaultPos:"mid"}),...nv(e,"radius"),...nv(e,"theta")})},M$n={vgMark:"area",encodeEntry:e=>({...$f(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...I4("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...I4("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...Ahe(e)})},N$n={vgMark:"rect",encodeEntry:e=>({...$f(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...nv(e,"x"),...nv(e,"y")})},I$n={vgMark:"shape",encodeEntry:e=>({...$f(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&Ze(n)&&n.type===M_?{field:tt(n,{expr:"datum"})}:{}}]}},L$n={vgMark:"image",encodeEntry:e=>({...$f(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...nv(e,"x"),...nv(e,"y"),...The(e,"url")})},j$n={vgMark:"line",encodeEntry:e=>({...$f(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Ta("x",e,{defaultPos:"mid"}),...Ta("y",e,{defaultPos:"mid"}),...ls("size",e,{vgChannel:"strokeWidth"}),...Ahe(e)})},F$n={vgMark:"trail",encodeEntry:e=>({...$f(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ta("x",e,{defaultPos:"mid"}),...Ta("y",e,{defaultPos:"mid"}),...ls("size",e),...Ahe(e)})};function Uhe(e,t){const{config:n}=e;return{...$f(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Ta("x",e,{defaultPos:"mid"}),...Ta("y",e,{defaultPos:"mid"}),...ls("size",e),...ls("angle",e),...z$n(e,n,t)}}function z$n(e,t,n){return n?{shape:{value:n}}:ls("shape",e)}const Q$n={vgMark:"symbol",encodeEntry:e=>Uhe(e)},B$n={vgMark:"symbol",encodeEntry:e=>Uhe(e,"circle")},W$n={vgMark:"symbol",encodeEntry:e=>Uhe(e,"square")},q$n={vgMark:"rect",encodeEntry:e=>({...$f(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...nv(e,"x"),...nv(e,"y")})},V$n={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...$f(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...I4("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...I4("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...ls("size",e,{vgChannel:"strokeWidth"})}}},U$n={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...$f(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Ta("x",e,{defaultPos:"mid"}),...Ta("y",e,{defaultPos:"mid"}),...The(e),...ls("size",e,{vgChannel:"fontSize"}),...ls("angle",e),...eke("align",H$n(e.markDef,n,t)),...eke("baseline",X$n(e.markDef,n,t)),...Ta("radius",e,{defaultPos:null}),...Ta("theta",e,{defaultPos:null})}}};function H$n(e,t,n){if(vr("align",e,n)===void 0)return"center"}function X$n(e,t,n){if(vr("baseline",e,n)===void 0)return"middle"}const Z$n={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,r=n.orient,i=r==="horizontal"?"width":"height",o=r==="horizontal"?"height":"width";return{...$f(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Ta("x",e,{defaultPos:"mid",vgChannel:"xc"}),...Ta("y",e,{defaultPos:"mid",vgChannel:"yc"}),...ls("size",e,{defaultValue:Y$n(e),vgChannel:i}),[o]:ui(vr("thickness",n,t))}}};function Y$n(e){const{config:t,markDef:n}=e,{orient:r}=n,i=r==="horizontal"?"width":"height",o=e.getScaleComponent(r==="horizontal"?"x":"y"),s=vr("size",n,t,{vgChannel:i})??t.tick.bandSize;if(s!==void 0)return s;{const a=o?o.get("range"):void 0;return a&&Bv(a)&&Hn(a.step)?a.step*3/4:M4(t.view,i)*3/4}}const xI={arc:D$n,area:M$n,bar:N$n,circle:B$n,geoshape:I$n,image:L$n,line:j$n,point:Q$n,rect:q$n,rule:V$n,square:W$n,text:U$n,tick:Z$n,trail:F$n};function G$n(e){if(Pn([x8,b8,iUt],e.mark)){const t=YKe(e.mark,e.encoding);if(t.length>0)return K$n(e,t)}else if(e.mark===O8){const t=ZJ.some(n=>vr(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return J$n(e)}return Hhe(e)}const Oke="faceted_path_";function K$n(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:Oke+e.requestDataName(Kr.Main),data:e.requestDataName(Kr.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Hhe(e,{fromPrefix:Oke})}]}const xke="stack_group_";function J$n(e){var c;const[t]=Hhe(e,{fromPrefix:xke}),n=e.scaleName(e.stack.fieldChannel),r=(u={})=>e.vgField(e.stack.fieldChannel,u),i=(u,f)=>{const d=[r({prefix:"min",suffix:"start",expr:f}),r({prefix:"max",suffix:"start",expr:f}),r({prefix:"min",suffix:"end",expr:f}),r({prefix:"max",suffix:"end",expr:f})];return`${u}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let o,s;e.stack.fieldChannel==="x"?(o={...TE(t.encode.update,["y","yc","y2","height",...ZJ]),x:{signal:i("min","datum")},x2:{signal:i("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...Gl(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(o={...TE(t.encode.update,["x","xc","x2","width"]),y:{signal:i("min","datum")},y2:{signal:i("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...Gl(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const u of ZJ){const f=rm(u,e.markDef,e.config);t.encode.update[u]?(o[u]=t.encode.update[u],delete t.encode.update[u]):f&&(o[u]=ui(f)),f&&(t.encode.update[u]={value:0})}const a=[];if(((c=e.stack.groupbyChannels)==null?void 0:c.length)>0)for(const u of e.stack.groupbyChannels){const f=e.fieldDef(u),d=tt(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(tt(f,{binSuffix:"end"}))}return o=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((u,f)=>{if(t.encode.update[f])return{...u,[f]:t.encode.update[f]};{const d=rm(f,e.markDef,e.config);return d!==void 0?{...u,[f]:ui(d)}:u}},o),o.stroke&&(o.strokeForeground={value:!0},o.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Kr.Main),name:xke+e.requestDataName(Kr.Main),groupby:a,aggregate:{fields:[r({suffix:"start"}),r({suffix:"start"}),r({suffix:"end"}),r({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:o},marks:[{type:"group",encode:{update:s},marks:[t]}]}]}function eTn(e){var a;const{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,s=t.order;if(!(!ze(s)&&Rd(s)&&KG(s.value)||!s&&KG(vr("order",i,o)))){if((ze(s)||Ze(s))&&!n)return KGe(s,{expr:"datum"});if(kv(r)){const l=i.orient==="horizontal"?"y":"x",c=t[l];if(Ze(c)){const u=c.sort;if(ze(u))return{field:tt(c,{prefix:l,suffix:"sort_index",expr:"datum"})};if(Vh(u))return{field:tt({aggregate:phe(e.encoding)?u.op:void 0,field:u.field},{expr:"datum"})};if(RKe(u)){const f=e.fieldDef(u.encoding);return{field:tt(f,{expr:"datum"}),order:u.order}}else return u===null?void 0:{field:tt(c,{binSuffix:(a=e.stack)!=null&&a.impute?"mid":void 0,expr:"datum"})}}return}}}function Hhe(e,t={fromPrefix:""}){const{mark:n,markDef:r,encoding:i,config:o}=e,s=lo(r.clip,tTn(e),nTn(e)),a=YGe(r),l=i.key,c=eTn(e),u=rTn(e),f=vr("aria",r,o),d=xI[n].postEncodingTransform?xI[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:xI[n].vgMark,...s?{clip:!0}:{},...a?{style:a}:{},...l?{key:l.field}:{},...c?{sort:c}:{},...u||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Kr.Main)},encode:{update:xI[n].encodeEntry(e)},...d?{transform:d}:{}}]}function tTn(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function nTn(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function rTn(e){if(!e.component.selection)return null;const t=He(e.component.selection).length;let n=t,r=e.parent;for(;r&&n===0;)n=He(r.component.selection).length,r=r.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip}:null}class Qet extends Iet{constructor(t,n,r,i={},o){super(t,"unit",n,r,o,void 0,D_e(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const s=ap(t.mark)?{...t.mark}:{type:t.mark},a=s.type;s.filled===void 0&&(s.filled=QEn(s,o,{graticule:t.data&&khe(t.data)}));const l=this.encoding=VSn(t.encoding||{},a,s.filled,o);this.markDef=yJe(s,l,o),this.size=R$n({encoding:l,size:D_e(t)?{...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:i}),this.stack=mJe(this.markDef,l),this.specifiedScales=this.initScales(a,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(c=>whe(c))}get hasProjection(){const{encoding:t}=this,n=this.mark===_Qe,r=t&&axn.some(i=>Jt(t[i]));return n||r}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return dQ.reduce((r,i)=>{const o=Xo(n[i]);return o&&(r[i]=this.initScale(o.scale??{})),r},{})}initScale(t){const{domain:n,range:r}=t,i=Ll(t);return ze(n)&&(i.domain=n.map(Fc)),ze(r)&&(i.range=r.map(Fc)),i}initAxes(t){return Mp.reduce((n,r)=>{const i=t[r];if(Jt(i)||r===Ei&&Jt(t.x2)||r===Os&&Jt(t.y2)){const o=Jt(i)?i.axis:void 0;n[r]=o&&this.initAxis({...o})}return n},{})}initAxis(t){const n=He(t),r={};for(const i of n){const o=t[i];r[i]=KD(o)?ZGe(o):Fc(o)}return r}initLegends(t){return WGe.reduce((n,r)=>{const i=Xo(t[r]);if(i&&vxn(r)){const o=i.legend;n[r]=o&&Ll(o)}return n},{})}parseData(){this.component.data=qQ(this)}parseLayoutSize(){g$n(this)}parseSelections(){this.component.selection=s_n(this,this.selection)}parseMarkGroup(){this.component.mark=G$n(this)}parseAxesAndHeaders(){this.component.axes=E$n(this)}assembleSelectionTopLevelSignals(t){return $Cn(this,t)}assembleSignals(){return[...JJe(this),..._Cn(this,[])]}assembleSelectionData(t){return TCn(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return Nhe(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!F_(this.parent))&&(t=PJe(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return pb(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return up(n)}typedFieldDef(t){const n=this.fieldDef(t);return El(n)?n:null}}class Xhe extends Whe{constructor(t,n,r,i,o){super(t,"layer",n,r,o,t.resolve,t.view);const s={...i,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,l)=>{if(_Q(a))return new Xhe(a,this,this.getName(`layer_${l}`),s,o);if(_m(a))return new Qet(a,this,this.getName(`layer_${l}`),s,o);throw new Error(qde(a))})}parseData(){this.component.data=qQ(this);for(const t of this.children)t.parseData()}parseLayoutSize(){h$n(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of He(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){_$n(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,r)=>r.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),JJe(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),Nhe(this))}assembleSelectionData(t){return this.children.reduce((n,r)=>r.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const r of this.children)for(const i of ct(r.assembleGroupStyle()))t.add(i);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return PCn(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),yet(this))}}function Zhe(e,t,n,r,i){if(vQ(e))return new o2(e,t,n,i);if(_Q(e))return new Xhe(e,t,n,r,i);if(_m(e))return new Qet(e,t,n,r,i);if(gEn(e))return new O$n(e,t,n,i);throw new Error(qde(e))}function iTn(e,t={}){t.logger&&Iwn(t.logger),t.fieldTitle&&QKe(t.fieldTitle);try{const n=gJe(l_(t.config,e.config)),r=EJe(e,n),i=Zhe(r,null,"",void 0,n);return i.parse(),$kn(i.component.data,i),{spec:sTn(i,oTn(e,r.autosize,n,i),e.datasets,e.usermeta),normalized:r}}finally{t.logger&&Lwn(),t.fieldTitle&&ISn()}}function oTn(e,t,n,r){const i=r.component.layoutSize.get("width"),o=r.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},r.hasAxisOrientSignalRef()&&(t.resize=!0)):ut(t)&&(t={type:t}),i&&o&&wCn(t.type)){if(i==="step"&&o==="step")Ye(v_e()),t.type="pad";else if(i==="step"||o==="step"){const s=i==="step"?"width":"height";Ye(v_e(fQ(s)));const a=s==="width"?"height":"width";t.type=SCn(a)}}return{...He(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...V_e(n,!1),...V_e(e,!0)}}function sTn(e,t,n={},r){const i=e.config?TEn(e.config):void 0,o=[].concat(e.assembleSelectionData([]),c$n(e.component.data,n)),s=e.assembleProjections(),a=e.assembleTitle(),l=e.assembleGroupStyle(),c=e.assembleGroupEncodeEntry(!0);let u=e.assembleLayoutSignals();u=u.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:o,...s.length>0?{projections:s}:{},...e.assembleGroup([...u,...e.assembleSelectionTopLevelSignals([]),...fJe(f)]),...i?{config:i}:{},...r?{usermeta:r}:{}}}const aTn=oxn.version,lTn=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:PE,accessPathWithDatum:ele,compile:iTn,contains:Pn,deepEqual:Wc,deleteNestedProperty:j3,duplicate:Xt,entries:Q0,every:Gae,fieldIntersection:Jae,flatAccessWithDatum:bQe,getFirstDefined:lo,hasIntersection:Kae,hash:Nn,internalField:wQe,isBoolean:LP,isEmpty:Ir,isEqual:JVt,isInternalField:SQe,isNullOrFalse:KG,isNumeric:v8,keys:He,logicalExpr:BT,mergeDeep:yQe,never:mQe,normalize:EJe,normalizeAngle:jP,omit:Gl,pick:TE,prefixGenerator:JG,removePathFromField:tle,replaceAll:sO,replacePathInField:mf,resetIdCounter:tUt,setEqual:vQe,some:oO,stringify:Lr,titleCase:rD,unique:Ah,uniqueId:xQe,vals:Vs,varName:Si,version:aTn},Symbol.toStringTag,{value:"Module"}));function Bet(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var cTn="vega-themes",uTn="2.14.0",fTn="Themes for stylized Vega and Vega-Lite visualizations.",dTn=["vega","vega-lite","themes","style"],hTn="BSD-3-Clause",pTn={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},gTn=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],mTn="build/vega-themes.js",yTn="build/vega-themes.module.js",vTn="build/vega-themes.min.js",bTn="build/vega-themes.min.js",OTn="build/vega-themes.module.d.ts",xTn={type:"git",url:"https://github.com/vega/vega-themes.git"},wTn=["src","build"],STn={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},ETn={"@babel/core":"^7.22.9","@babel/plugin-proposal-async-generator-functions":"^7.20.7","@babel/plugin-proposal-json-strings":"^7.18.6","@babel/plugin-proposal-object-rest-spread":"^7.20.7","@babel/plugin-proposal-optional-catch-binding":"^7.18.6","@babel/plugin-transform-runtime":"^7.22.9","@babel/preset-env":"^7.22.9","@babel/preset-typescript":"^7.22.5","@release-it/conventional-changelog":"^7.0.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-terser":"^0.4.3","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","browser-sync":"^2.29.3",concurrently:"^8.2.0",eslint:"^8.45.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^5.0.0","gh-pages":"^5.0.0",prettier:"^3.0.0","release-it":"^16.1.0",rollup:"^3.26.2","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.2.0",typescript:"^5.1.6",vega:"^5.25.0","vega-lite":"^5.9.3"},CTn={vega:"*","vega-lite":"*"},_Tn={},kTn={name:cTn,version:uTn,description:fTn,keywords:dTn,license:hTn,author:pTn,contributors:gTn,main:mTn,module:yTn,unpkg:vTn,jsdelivr:bTn,types:OTn,repository:xTn,files:wTn,scripts:STn,devDependencies:ETn,peerDependencies:CTn,dependencies:_Tn};const ew="#fff",wke="#888",$Tn={background:"#333",view:{stroke:wke},title:{color:ew,subtitleColor:ew},style:{"guide-label":{fill:ew},"guide-title":{fill:ew}},axis:{domainColor:ew,gridColor:wke,tickColor:ew}},Yv="#4572a7",TTn={background:"#fff",arc:{fill:Yv},area:{fill:Yv},line:{stroke:Yv,strokeWidth:2},path:{stroke:Yv},rect:{fill:Yv},shape:{stroke:Yv},symbol:{fill:Yv,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},Gv="#30a2da",JU="#cbcbcb",PTn="#999",ATn="#333",Ske="#f0f0f0",Eke="#333",RTn={arc:{fill:Gv},area:{fill:Gv},axis:{domainColor:JU,grid:!0,gridColor:JU,gridWidth:1,labelColor:PTn,labelFontSize:10,titleColor:ATn,tickColor:JU,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:Ske,group:{fill:Ske},legend:{labelColor:Eke,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:Eke,titleFontSize:14,titlePadding:10},line:{stroke:Gv,strokeWidth:2},path:{stroke:Gv,strokeWidth:.5},rect:{fill:Gv},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:Gv},bar:{binSpacing:2,fill:Gv,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Kv="#000",DTn={group:{fill:"#e5e5e5"},arc:{fill:Kv},area:{fill:Kv},line:{stroke:Kv},path:{stroke:Kv},rect:{fill:Kv},shape:{stroke:Kv},symbol:{fill:Kv,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},MTn=22,NTn="normal",Cke="Benton Gothic, sans-serif",_ke=11.5,ITn="normal",Jv="#82c6df",eH="Benton Gothic Bold, sans-serif",kke="normal",$ke=13,Xk={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},LTn={background:"#ffffff",title:{anchor:"start",color:"#000000",font:eH,fontSize:MTn,fontWeight:NTn},arc:{fill:Jv},area:{fill:Jv},line:{stroke:Jv,strokeWidth:2},path:{stroke:Jv},rect:{fill:Jv},shape:{stroke:Jv},symbol:{fill:Jv,size:30},axis:{labelFont:Cke,labelFontSize:_ke,labelFontWeight:ITn,titleFont:eH,titleFontSize:$ke,titleFontWeight:kke},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:Cke,labelFontSize:_ke,symbolType:"square",titleFont:eH,titleFontSize:$ke,titleFontWeight:kke},range:{category:Xk["category-6"],diverging:Xk["fireandice-6"],heatmap:Xk["fire-7"],ordinal:Xk["fire-7"],ramp:Xk["fire-7"]}},e1="#ab5787",wI="#979797",jTn={background:"#f9f9f9",arc:{fill:e1},area:{fill:e1},line:{stroke:e1},path:{stroke:e1},rect:{fill:e1},shape:{stroke:e1},symbol:{fill:e1,size:30},axis:{domainColor:wI,domainWidth:.5,gridWidth:.2,labelColor:wI,tickColor:wI,tickWidth:.2,titleColor:wI},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},t1="#3e5c69",FTn={background:"#fff",arc:{fill:t1},area:{fill:t1},line:{stroke:t1},path:{stroke:t1},rect:{fill:t1},shape:{stroke:t1},symbol:{fill:t1},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},yu="#1696d2",Tke="#000000",zTn="#FFFFFF",SI="Lato",tH="Lato",QTn="Lato",BTn="#DEDDDD",WTn=18,Zk={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},qTn={background:zTn,title:{anchor:"start",fontSize:WTn,font:SI},axisX:{domain:!0,domainColor:Tke,domainWidth:1,grid:!1,labelFontSize:12,labelFont:tH,labelAngle:0,tickColor:Tke,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:SI},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:BTn,gridWidth:1,labelFontSize:12,labelFont:tH,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:SI,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:tH,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:SI,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:Zk["six-groups-cat-1"],diverging:Zk["diverging-colors"],heatmap:Zk["diverging-colors"],ordinal:Zk["six-groups-seq"],ramp:Zk["shades-blue"]},area:{fill:yu},rect:{fill:yu},line:{color:yu,stroke:yu,strokeWidth:5},trail:{color:yu,stroke:yu,strokeWidth:0,size:1},path:{stroke:yu,strokeWidth:.5},point:{filled:!0},text:{font:QTn,color:yu,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:yu,stroke:null}},arc:{fill:yu},shape:{stroke:yu},symbol:{fill:yu,size:30}},n1="#3366CC",Pke="#ccc",EI="Arial, sans-serif",VTn={arc:{fill:n1},area:{fill:n1},path:{stroke:n1},rect:{fill:n1},shape:{stroke:n1},symbol:{stroke:n1},circle:{fill:n1},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:EI,fontSize:12},"guide-title":{font:EI,fontSize:12},"group-title":{font:EI,fontSize:12}},title:{font:EI,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:Pke,tickColor:Pke,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},Yhe=e=>e*(1/3+1),Ake=Yhe(9),Rke=Yhe(10),Dke=Yhe(12),Yk="Segoe UI",Mke="wf_standard-font, helvetica, arial, sans-serif",Nke="#252423",Gk="#605E5C",Ike="transparent",UTn="#C8C6C4",Ff="#118DFF",HTn="#12239E",XTn="#E66C37",ZTn="#6B007B",YTn="#E044A7",GTn="#744EC2",KTn="#D9B300",JTn="#D64550",Wet=Ff,qet="#DEEFFF",Lke=[qet,Wet],e2n=[qet,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",Wet],t2n={view:{stroke:Ike},background:Ike,font:Yk,header:{titleFont:Mke,titleFontSize:Dke,titleColor:Nke,labelFont:Yk,labelFontSize:Rke,labelColor:Gk},axis:{ticks:!1,grid:!1,domain:!1,labelColor:Gk,labelFontSize:Ake,titleFont:Mke,titleColor:Nke,titleFontSize:Dke,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:UTn,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Ff},line:{stroke:Ff,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Yk,fontSize:Ake,fill:Gk},arc:{fill:Ff},area:{fill:Ff,line:!0,opacity:.6},path:{stroke:Ff},rect:{fill:Ff},point:{fill:Ff,filled:!0,size:75},shape:{stroke:Ff},symbol:{fill:Ff,strokeWidth:1.5,size:50},legend:{titleFont:Yk,titleFontWeight:"bold",titleColor:Gk,labelFont:Yk,labelFontSize:Rke,labelColor:Gk,symbolType:"circle",symbolSize:75},range:{category:[Ff,HTn,XTn,ZTn,YTn,GTn,KTn,JTn],diverging:Lke,heatmap:Lke,ordinal:e2n}},nH='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',jke=400,n2n=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],r2n=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function VQ({type:e,background:t}){const n=e==="dark"?"#161616":"#ffffff",r=e==="dark"?"#f4f4f4":"#161616",i=e==="dark"?n2n:r2n,o=e==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:o},area:{fill:o},path:{stroke:o},rect:{fill:o},shape:{stroke:o},symbol:{stroke:o},circle:{fill:o},view:{fill:n,stroke:n},group:{fill:n},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:nH,fontWeight:600},axis:{labelColor:r,labelFontSize:12,grid:!0,gridColor:"#525252",titleColor:r,labelAngle:0},style:{"guide-label":{font:nH,fill:r,fontWeight:jke},"guide-title":{font:nH,fill:r,fontWeight:jke}},range:{category:i,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const i2n=VQ({type:"light",background:"#ffffff"}),o2n=VQ({type:"light",background:"#f4f4f4"}),s2n=VQ({type:"dark",background:"#262626"}),a2n=VQ({type:"dark",background:"#161616"}),l2n=kTn.version,c2n=Object.freeze(Object.defineProperty({__proto__:null,carbong10:o2n,carbong100:a2n,carbong90:s2n,carbonwhite:i2n,dark:$Tn,excel:TTn,fivethirtyeight:RTn,ggplot2:DTn,googlecharts:VTn,latimes:LTn,powerbi:t2n,quartz:jTn,urbaninstitute:qTn,version:l2n,vox:FTn},Symbol.toStringTag,{value:"Module"}));function u2n(e,t,n){if(ze(e))return`[${e.map(r=>t(ut(r)?r:Fke(r,n))).join(", ")}]`;if(dt(e)){let r="";const{title:i,image:o,...s}=e;i&&(r+=`<h2>${t(i)}</h2>`),o&&(r+=`<img src="${t(o)}">`);const a=Object.keys(s);if(a.length>0){r+="<table>";for(const l of a){let c=s[l];c!==void 0&&(dt(c)&&(c=Fke(c,n)),r+=`<tr><td class="key">${t(l)}</td><td class="value">${t(c)}</td></tr>`)}r+="</table>"}return r||"{}"}return t(e)}function f2n(e){const t=[];return function(n,r){if(typeof r!="object"||r===null)return r;const i=t.indexOf(this)+1;return t.length=i,t.length>e?"[Object]":t.indexOf(r)>=0?"[Circular]":(t.push(r),r)}}function Fke(e,t){return JSON.stringify(e,f2n(t))}var d2n=`#vg-tooltip-element {
  visibility: hidden;
  padding: 8px;
  position: fixed;
  z-index: 1000;
  font-family: sans-serif;
  font-size: 11px;
  border-radius: 3px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  /* The default theme is the light theme. */
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid #d9d9d9;
  color: black;
}
#vg-tooltip-element.visible {
  visibility: visible;
}
#vg-tooltip-element h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 13px;
}
#vg-tooltip-element table {
  border-spacing: 0;
}
#vg-tooltip-element table tr {
  border: none;
}
#vg-tooltip-element table tr td {
  overflow: hidden;
  text-overflow: ellipsis;
  padding-top: 2px;
  padding-bottom: 2px;
}
#vg-tooltip-element table tr td.key {
  color: #808080;
  max-width: 150px;
  text-align: right;
  padding-right: 4px;
}
#vg-tooltip-element table tr td.value {
  display: block;
  max-width: 300px;
  max-height: 7em;
  text-align: left;
}
#vg-tooltip-element.dark-theme {
  background-color: rgba(32, 32, 32, 0.9);
  border: 1px solid #f5f5f5;
  color: white;
}
#vg-tooltip-element.dark-theme td.key {
  color: #bfbfbf;
}
`;const Vet="vg-tooltip-element",h2n={offsetX:10,offsetY:10,id:Vet,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:p2n,maxDepth:2,formatTooltip:u2n};function p2n(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function g2n(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return d2n.toString().replace(Vet,e)}function m2n(e,t,n,r){let i=e.clientX+n;i+t.width>window.innerWidth&&(i=+e.clientX-n-t.width);let o=e.clientY+r;return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}class y2n{constructor(t){this.options={...h2n,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const r=document.createElement("style");r.setAttribute("id",this.options.styleId),r.innerHTML=g2n(n);const i=document.head;i.childNodes.length>0?i.insertBefore(r,i.childNodes[0]):i.appendChild(r)}}tooltipHandler(t,n,r,i){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),i==null||i===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(i,this.options.sanitize,this.options.maxDepth),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:o,y:s}=m2n(n,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${s}px`,this.el.style.left=`${o}px`}}var rH={};function SA(e){"@babel/helpers - typeof";return SA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},SA(e)}function v2n(e,t){if(SA(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(SA(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function b2n(e){var t=v2n(e,"string");return SA(t)==="symbol"?t:String(t)}function O2n(e,t,n){return t=b2n(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x2n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var iH,zke;function w2n(){return zke||(zke=1,iH=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),iH}var S2n=nr;nr.Node=PO;nr.create=nr;function nr(e){var t=this;if(t instanceof nr||(t=new nr),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}nr.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t};nr.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};nr.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};nr.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)C2n(this,arguments[e]);return this.length};nr.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)_2n(this,arguments[e]);return this.length};nr.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};nr.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};nr.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next};nr.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev};nr.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value};nr.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value};nr.prototype.map=function(e,t){t=t||this;for(var n=new nr,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};nr.prototype.mapReverse=function(e,t){t=t||this;for(var n=new nr,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};nr.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n};nr.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n};nr.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};nr.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};nr.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new nr;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(;i!==null&&r<t;r++,i=i.next)n.push(i.value);return n};nr.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new nr;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,i=this.tail;i!==null&&r>t;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)n.push(i.value);return n};nr.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(var o=[],r=0;i&&r<t;r++)o.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=E2n(this,i,n[r]);return o};nr.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function E2n(e,t,n){var r=t===e.head?new PO(n,null,t,e):new PO(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function C2n(e,t){e.tail=new PO(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function _2n(e,t){e.head=new PO(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function PO(e,t,n,r){if(!(this instanceof PO))return new PO(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{w2n()(nr)}catch{}const k2n=S2n,A1=Symbol("max"),sg=Symbol("length"),tw=Symbol("lengthCalculator"),s2=Symbol("allowStale"),H1=Symbol("maxAge"),eg=Symbol("dispose"),Qke=Symbol("noDisposeOnSet"),ns=Symbol("lruList"),Qf=Symbol("cache"),Uet=Symbol("updateAgeOnGet"),oH=()=>1;let $2n=class{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[A1]=t.max||1/0;const n=t.length||oH;if(this[tw]=typeof n!="function"?oH:n,this[s2]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[H1]=t.maxAge||0,this[eg]=t.dispose,this[Qke]=t.noDisposeOnSet||!1,this[Uet]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[A1]=t||1/0,Kk(this)}get max(){return this[A1]}set allowStale(t){this[s2]=!!t}get allowStale(){return this[s2]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[H1]=t,Kk(this)}get maxAge(){return this[H1]}set lengthCalculator(t){typeof t!="function"&&(t=oH),t!==this[tw]&&(this[tw]=t,this[sg]=0,this[ns].forEach(n=>{n.length=this[tw](n.value,n.key),this[sg]+=n.length})),Kk(this)}get lengthCalculator(){return this[tw]}get length(){return this[sg]}get itemCount(){return this[ns].length}rforEach(t,n){n=n||this;for(let r=this[ns].tail;r!==null;){const i=r.prev;Bke(this,t,r,n),r=i}}forEach(t,n){n=n||this;for(let r=this[ns].head;r!==null;){const i=r.next;Bke(this,t,r,n),r=i}}keys(){return this[ns].toArray().map(t=>t.key)}values(){return this[ns].toArray().map(t=>t.value)}reset(){this[eg]&&this[ns]&&this[ns].length&&this[ns].forEach(t=>this[eg](t.key,t.value)),this[Qf]=new Map,this[ns]=new k2n,this[sg]=0}dump(){return this[ns].map(t=>z4(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[ns]}set(t,n,r){if(r=r||this[H1],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,o=this[tw](n,t);if(this[Qf].has(t)){if(o>this[A1])return WS(this,this[Qf].get(t)),!1;const l=this[Qf].get(t).value;return this[eg]&&(this[Qke]||this[eg](t,l.value)),l.now=i,l.maxAge=r,l.value=n,this[sg]+=o-l.length,l.length=o,this.get(t),Kk(this),!0}const s=new T2n(t,n,o,i,r);return s.length>this[A1]?(this[eg]&&this[eg](t,n),!1):(this[sg]+=s.length,this[ns].unshift(s),this[Qf].set(t,this[ns].head),Kk(this),!0)}has(t){if(!this[Qf].has(t))return!1;const n=this[Qf].get(t).value;return!z4(this,n)}get(t){return sH(this,t,!0)}peek(t){return sH(this,t,!1)}pop(){const t=this[ns].tail;return t?(WS(this,t),t.value):null}del(t){WS(this,this[Qf].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const i=t[r],o=i.e||0;if(o===0)this.set(i.k,i.v);else{const s=o-n;s>0&&this.set(i.k,i.v,s)}}}prune(){this[Qf].forEach((t,n)=>sH(this,n,!1))}};const sH=(e,t,n)=>{const r=e[Qf].get(t);if(r){const i=r.value;if(z4(e,i)){if(WS(e,r),!e[s2])return}else n&&(e[Uet]&&(r.value.now=Date.now()),e[ns].unshiftNode(r));return i.value}},z4=(e,t)=>{if(!t||!t.maxAge&&!e[H1])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[H1]&&n>e[H1]},Kk=e=>{if(e[sg]>e[A1])for(let t=e[ns].tail;e[sg]>e[A1]&&t!==null;){const n=t.prev;WS(e,t),t=n}},WS=(e,t)=>{if(t){const n=t.value;e[eg]&&e[eg](n.key,n.value),e[sg]-=n.length,e[Qf].delete(n.key),e[ns].removeNode(t)}};class T2n{constructor(t,n,r,i,o){this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=o||0}}const Bke=(e,t,n,r)=>{let i=n.value;z4(e,i)&&(WS(e,n),e[s2]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var P2n=$2n;const A2n=Object.freeze({loose:!0}),R2n=Object.freeze({}),D2n=e=>e?typeof e!="object"?A2n:e:R2n;var Ghe=D2n,mee={exports:{}};const M2n="2.0.0",Het=256,N2n=Number.MAX_SAFE_INTEGER||9007199254740991,I2n=16,L2n=Het-6,j2n=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Khe={MAX_LENGTH:Het,MAX_SAFE_COMPONENT_LENGTH:I2n,MAX_SAFE_BUILD_LENGTH:L2n,MAX_SAFE_INTEGER:N2n,RELEASE_TYPES:j2n,SEMVER_SPEC_VERSION:M2n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const F2n=typeof process=="object"&&rH&&rH.NODE_DEBUG&&/\bsemver\b/i.test(rH.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var UQ=F2n;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Khe,o=UQ;t=e.exports={};const s=t.re=[],a=t.safeRe=[],l=t.src=[],c=t.t={};let u=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[f,r]],h=g=>{for(const[v,y]of d)g=g.split(`${v}*`).join(`${v}{0,${y}}`).split(`${v}+`).join(`${v}{1,${y}}`);return g},p=(g,v,y)=>{const O=h(v),m=u++;o(g,m,v),c[g]=m,l[m]=v,s[m]=new RegExp(v,y?"g":void 0),a[m]=new RegExp(O,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),p("FULL",`^${l[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),p("LOOSE",`^${l[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),p("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",l[c.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(mee,mee.exports);var Jhe=mee.exports;const Wke=/^[0-9]+$/,Xet=(e,t)=>{const n=Wke.test(e),r=Wke.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1},z2n=(e,t)=>Xet(t,e);var Q2n={compareIdentifiers:Xet,rcompareIdentifiers:z2n};const CI=UQ,{MAX_LENGTH:qke,MAX_SAFE_INTEGER:_I}=Khe,{safeRe:Vke,t:Uke}=Jhe,B2n=Ghe,{compareIdentifiers:nw}=Q2n;let W2n=class lh{constructor(t,n){if(n=B2n(n),t instanceof lh){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>qke)throw new TypeError(`version is longer than ${qke} characters`);CI("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?Vke[Uke.LOOSE]:Vke[Uke.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>_I||this.major<0)throw new TypeError("Invalid major version");if(this.minor>_I||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>_I||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const o=+i;if(o>=0&&o<_I)return o}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(CI("SemVer.compare",this.version,this.options,t),!(t instanceof lh)){if(typeof t=="string"&&t===this.version)return 0;t=new lh(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof lh||(t=new lh(t,this.options)),nw(this.major,t.major)||nw(this.minor,t.minor)||nw(this.patch,t.patch)}comparePre(t){if(t instanceof lh||(t=new lh(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=t.prerelease[n];if(CI("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return nw(r,i)}while(++n)}compareBuild(t){t instanceof lh||(t=new lh(t,this.options));let n=0;do{const r=this.build[n],i=t.build[n];if(CI("prerelease compare",n,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return nw(r,i)}while(++n)}inc(t,n,r){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(r)?1:0;if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(n){let o=[n,i];r===!1&&(o=[n]),nw(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var epe=W2n;const Hke=epe,q2n=(e,t,n)=>new Hke(e,n).compare(new Hke(t,n));var z_=q2n;const V2n=z_,U2n=(e,t,n)=>V2n(e,t,n)===0;var H2n=U2n;const X2n=z_,Z2n=(e,t,n)=>X2n(e,t,n)!==0;var Y2n=Z2n;const G2n=z_,K2n=(e,t,n)=>G2n(e,t,n)>0;var J2n=K2n;const ePn=z_,tPn=(e,t,n)=>ePn(e,t,n)>=0;var nPn=tPn;const rPn=z_,iPn=(e,t,n)=>rPn(e,t,n)<0;var oPn=iPn;const sPn=z_,aPn=(e,t,n)=>sPn(e,t,n)<=0;var lPn=aPn;const cPn=H2n,uPn=Y2n,fPn=J2n,dPn=nPn,hPn=oPn,pPn=lPn,gPn=(e,t,n,r)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return cPn(e,n,r);case"!=":return uPn(e,n,r);case">":return fPn(e,n,r);case">=":return dPn(e,n,r);case"<":return hPn(e,n,r);case"<=":return pPn(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};var mPn=gPn,aH,Xke;function yPn(){if(Xke)return aH;Xke=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,f){if(f=n(f),u instanceof t){if(u.loose===!!f.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,f),this.options=f,this.loose=!!f.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const f=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],d=u.match(f);if(!d)throw new TypeError(`Invalid comparator: ${u}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return o(u,this.operator,this.semver,this.options)}intersects(u,f){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,f).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,f).test(u.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||o(this.semver,"<",u.semver,f)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||o(this.semver,">",u.semver,f)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}aH=t;const n=Ghe,{safeRe:r,t:i}=Jhe,o=mPn,s=UQ,a=epe,l=Zet();return aH}var lH,Zke;function Zet(){if(Zke)return lH;Zke=1;class e{constructor(T,N){if(N=r(N),T instanceof e)return T.loose===!!N.loose&&T.includePrerelease===!!N.includePrerelease?T:new e(T.raw,N);if(T instanceof i)return this.raw=T.value,this.set=[[T]],this.format(),this;if(this.options=N,this.loose=!!N.loose,this.includePrerelease=!!N.includePrerelease,this.raw=T.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(j=>this.parseRange(j.trim())).filter(j=>j.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const j=this.set[0];if(this.set=this.set.filter(z=>!p(z[0])),this.set.length===0)this.set=[j];else if(this.set.length>1){for(const z of this.set)if(z.length===1&&g(z[0])){this.set=[z];break}}}this.format()}format(){return this.range=this.set.map(T=>T.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(T){const j=((this.options.includePrerelease&&d)|(this.options.loose&&h))+":"+T,z=n.get(j);if(z)return z;const W=this.options.loose,F=W?a[l.HYPHENRANGELOOSE]:a[l.HYPHENRANGE];T=T.replace(F,M(this.options.includePrerelease)),o("hyphen replace",T),T=T.replace(a[l.COMPARATORTRIM],c),o("comparator trim",T),T=T.replace(a[l.TILDETRIM],u),o("tilde trim",T),T=T.replace(a[l.CARETTRIM],f),o("caret trim",T);let q=T.split(" ").map(Z=>y(Z,this.options)).join(" ").split(/\s+/).map(Z=>D(Z,this.options));W&&(q=q.filter(Z=>(o("loose invalid filter",Z,this.options),!!Z.match(a[l.COMPARATORLOOSE])))),o("range list",q);const U=new Map,V=q.map(Z=>new i(Z,this.options));for(const Z of V){if(p(Z))return[Z];U.set(Z.value,Z)}U.size>1&&U.has("")&&U.delete("");const H=[...U.values()];return n.set(j,H),H}intersects(T,N){if(!(T instanceof e))throw new TypeError("a Range is required");return this.set.some(j=>v(j,N)&&T.set.some(z=>v(z,N)&&j.every(W=>z.every(F=>W.intersects(F,N)))))}test(T){if(!T)return!1;if(typeof T=="string")try{T=new s(T,this.options)}catch{return!1}for(let N=0;N<this.set.length;N++)if(L(this.set[N],T,this.options))return!0;return!1}}lH=e;const t=P2n,n=new t({max:1e3}),r=Ghe,i=yPn(),o=UQ,s=epe,{safeRe:a,t:l,comparatorTrimReplace:c,tildeTrimReplace:u,caretTrimReplace:f}=Jhe,{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:h}=Khe,p=A=>A.value==="<0.0.0-0",g=A=>A.value==="",v=(A,T)=>{let N=!0;const j=A.slice();let z=j.pop();for(;N&&j.length;)N=j.every(W=>z.intersects(W,T)),z=j.pop();return N},y=(A,T)=>(o("comp",A,T),A=S(A,T),o("caret",A),A=m(A,T),o("tildes",A),A=C(A,T),o("xrange",A),A=P(A,T),o("stars",A),A),O=A=>!A||A.toLowerCase()==="x"||A==="*",m=(A,T)=>A.trim().split(/\s+/).map(N=>w(N,T)).join(" "),w=(A,T)=>{const N=T.loose?a[l.TILDELOOSE]:a[l.TILDE];return A.replace(N,(j,z,W,F,q)=>{o("tilde",A,j,z,W,F,q);let U;return O(z)?U="":O(W)?U=`>=${z}.0.0 <${+z+1}.0.0-0`:O(F)?U=`>=${z}.${W}.0 <${z}.${+W+1}.0-0`:q?(o("replaceTilde pr",q),U=`>=${z}.${W}.${F}-${q} <${z}.${+W+1}.0-0`):U=`>=${z}.${W}.${F} <${z}.${+W+1}.0-0`,o("tilde return",U),U})},S=(A,T)=>A.trim().split(/\s+/).map(N=>E(N,T)).join(" "),E=(A,T)=>{o("caret",A,T);const N=T.loose?a[l.CARETLOOSE]:a[l.CARET],j=T.includePrerelease?"-0":"";return A.replace(N,(z,W,F,q,U)=>{o("caret",A,z,W,F,q,U);let V;return O(W)?V="":O(F)?V=`>=${W}.0.0${j} <${+W+1}.0.0-0`:O(q)?W==="0"?V=`>=${W}.${F}.0${j} <${W}.${+F+1}.0-0`:V=`>=${W}.${F}.0${j} <${+W+1}.0.0-0`:U?(o("replaceCaret pr",U),W==="0"?F==="0"?V=`>=${W}.${F}.${q}-${U} <${W}.${F}.${+q+1}-0`:V=`>=${W}.${F}.${q}-${U} <${W}.${+F+1}.0-0`:V=`>=${W}.${F}.${q}-${U} <${+W+1}.0.0-0`):(o("no pr"),W==="0"?F==="0"?V=`>=${W}.${F}.${q}${j} <${W}.${F}.${+q+1}-0`:V=`>=${W}.${F}.${q}${j} <${W}.${+F+1}.0-0`:V=`>=${W}.${F}.${q} <${+W+1}.0.0-0`),o("caret return",V),V})},C=(A,T)=>(o("replaceXRanges",A,T),A.split(/\s+/).map(N=>k(N,T)).join(" ")),k=(A,T)=>{A=A.trim();const N=T.loose?a[l.XRANGELOOSE]:a[l.XRANGE];return A.replace(N,(j,z,W,F,q,U)=>{o("xRange",A,j,z,W,F,q,U);const V=O(W),H=V||O(F),Z=H||O(q),ee=Z;return z==="="&&ee&&(z=""),U=T.includePrerelease?"-0":"",V?z===">"||z==="<"?j="<0.0.0-0":j="*":z&&ee?(H&&(F=0),q=0,z===">"?(z=">=",H?(W=+W+1,F=0,q=0):(F=+F+1,q=0)):z==="<="&&(z="<",H?W=+W+1:F=+F+1),z==="<"&&(U="-0"),j=`${z+W}.${F}.${q}${U}`):H?j=`>=${W}.0.0${U} <${+W+1}.0.0-0`:Z&&(j=`>=${W}.${F}.0${U} <${W}.${+F+1}.0-0`),o("xRange return",j),j})},P=(A,T)=>(o("replaceStars",A,T),A.trim().replace(a[l.STAR],"")),D=(A,T)=>(o("replaceGTE0",A,T),A.trim().replace(a[T.includePrerelease?l.GTE0PRE:l.GTE0],"")),M=A=>(T,N,j,z,W,F,q,U,V,H,Z,ee,se)=>(O(j)?N="":O(z)?N=`>=${j}.0.0${A?"-0":""}`:O(W)?N=`>=${j}.${z}.0${A?"-0":""}`:F?N=`>=${N}`:N=`>=${N}${A?"-0":""}`,O(V)?U="":O(H)?U=`<${+V+1}.0.0-0`:O(Z)?U=`<${V}.${+H+1}.0-0`:ee?U=`<=${V}.${H}.${Z}-${ee}`:A?U=`<${V}.${H}.${+Z+1}-0`:U=`<=${U}`,`${N} ${U}`.trim()),L=(A,T,N)=>{for(let j=0;j<A.length;j++)if(!A[j].test(T))return!1;if(T.prerelease.length&&!N.includePrerelease){for(let j=0;j<A.length;j++)if(o(A[j].semver),A[j].semver!==i.ANY&&A[j].semver.prerelease.length>0){const z=A[j].semver;if(z.major===T.major&&z.minor===T.minor&&z.patch===T.patch)return!0}return!1}return!0};return lH}const vPn=Zet(),bPn=(e,t,n)=>{try{t=new vPn(t,n)}catch{return!1}return t.test(e)};var OPn=bPn,Yet=x2n(OPn);function xPn(e,t,n){const r=e.open(t),i=1e4,o=250,{origin:s}=new URL(t);let a=~~(i/o);function l(u){u.source===r&&(a=0,e.removeEventListener("message",l,!1))}e.addEventListener("message",l,!1);function c(){a<=0||(r.postMessage(n,s),setTimeout(c,o),a-=1)}setTimeout(c,o)}var wPn=`.vega-embed {
  position: relative;
  display: inline-block;
  box-sizing: border-box;
}
.vega-embed.has-actions {
  padding-right: 38px;
}
.vega-embed details:not([open]) > :not(summary) {
  display: none !important;
}
.vega-embed summary {
  list-style: none;
  position: absolute;
  top: 0;
  right: 0;
  padding: 6px;
  z-index: 1000;
  background: white;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  color: #1b1e23;
  border: 1px solid #aaa;
  border-radius: 999px;
  opacity: 0.2;
  transition: opacity 0.4s ease-in;
  cursor: pointer;
  line-height: 0px;
}
.vega-embed summary::-webkit-details-marker {
  display: none;
}
.vega-embed summary:active {
  box-shadow: #aaa 0px 0px 0px 1px inset;
}
.vega-embed summary svg {
  width: 14px;
  height: 14px;
}
.vega-embed details[open] summary {
  opacity: 0.7;
}
.vega-embed:hover summary, .vega-embed:focus-within summary {
  opacity: 1 !important;
  transition: opacity 0.2s ease;
}
.vega-embed .vega-actions {
  position: absolute;
  z-index: 1001;
  top: 35px;
  right: -9px;
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
  padding-top: 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid #d9d9d9;
  background: white;
  animation-duration: 0.15s;
  animation-name: scale-in;
  animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
  text-align: left;
}
.vega-embed .vega-actions a {
  padding: 8px 16px;
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: #434a56;
  text-decoration: none;
}
.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {
  background-color: #f7f7f9;
  color: black;
}
.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {
  content: "";
  display: inline-block;
  position: absolute;
}
.vega-embed .vega-actions::before {
  left: auto;
  right: 14px;
  top: -16px;
  border: 8px solid rgba(0, 0, 0, 0);
  border-bottom-color: #d9d9d9;
}
.vega-embed .vega-actions::after {
  left: auto;
  right: 15px;
  top: -14px;
  border: 7px solid rgba(0, 0, 0, 0);
  border-bottom-color: #fff;
}
.vega-embed .chart-wrapper.fit-x {
  width: 100%;
}
.vega-embed .chart-wrapper.fit-y {
  height: 100%;
}

.vega-embed-wrapper {
  max-width: 100%;
  overflow: auto;
  padding-right: 14px;
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
`;function Get(e,...t){for(const n of t)SPn(e,n);return e}function SPn(e,t){for(const n of Object.keys(t))c_(e,n,t[n],!0)}function Yke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function f0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yke(Object(n),!0).forEach(function(r){O2n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yke(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const Wf=_On;let EA=lTn;const kI=typeof window<"u"?window:void 0;var RRe;EA===void 0&&((RRe=kI==null?void 0:kI.vl)!=null&&RRe.compile)&&(EA=kI.vl);const EPn={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},CPn={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},K$={vega:"Vega","vega-lite":"Vega-Lite"},Q4={vega:Wf.version,"vega-lite":EA?EA.version:"not available"},_Pn={vega:e=>e,"vega-lite":(e,t)=>EA.compile(e,{config:t}).spec},kPn=`
<svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
  <circle r="2" cy="8" cx="2"></circle>
  <circle r="2" cy="8" cx="8"></circle>
  <circle r="2" cy="8" cx="14"></circle>
</svg>`,$Pn="chart-wrapper";function TPn(e){return typeof e=="function"}function Gke(e,t,n,r){const i=`<html><head>${t}</head><body><pre><code class="json">`,o=`</code></pre>${n}</body></html>`,s=window.open("");s.document.write(i+e+o),s.document.title=`${K$[r]} JSON Source`}function PPn(e,t){if(e.$schema){const n=Bet(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${K$[n.library]}, but mode argument sets ${K$[t]??t}.`);const r=n.library;return Yet(Q4[r],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${K$[r]} ${n.version}, but the current version of ${K$[r]} is v${Q4[r]}.`),r}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}function APn(e){return!!(e&&"load"in e)}function Kke(e){return APn(e)?e:Wf.loader(e)}function RPn(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return ut(t.defaultStyle)&&(t.defaultStyle=!1),t}async function DPn(e,t,n={}){let r,i;ut(t)?(i=Kke(n.loader),r=JSON.parse(await i.load(t))):r=t;const o=RPn(r),s=o.loader;(!i||s)&&(i=Kke(n.loader??s));const a=await Jke(o,i),l=await Jke(n,i),c=f0(f0({},Get(l,a)),{},{config:l_(l.config??{},a.config??{})});return await NPn(e,r,c,i)}async function Jke(e,t){const n=ut(e.config)?JSON.parse(await t.load(e.config)):e.config??{},r=ut(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return f0(f0(f0({},e),r?{patch:r}:{}),n?{config:n}:{})}function MPn(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function NPn(e,t,n={},r){const i=n.theme?l_(c2n[n.theme],n.config??{}):n.config,o=_v(n.actions)?n.actions:Get({},EPn,n.actions??{}),s=f0(f0({},CPn),n.i18n),a=n.renderer??"canvas",l=n.logLevel??Wf.Warn,c=n.downloadFileName??"visualization",u=typeof e=="string"?document.querySelector(e):e;if(!u)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const S="vega-embed-style",{root:E,rootContainer:C}=MPn(u);if(!E.getElementById(S)){const k=document.createElement("style");k.id=S,k.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?wPn.toString():n.defaultStyle,C.appendChild(k)}}const f=PPn(t,n.mode);let d=_Pn[f](t,i);if(f==="vega-lite"&&d.$schema){const S=Bet(d.$schema);Yet(Q4.vega,`^${S.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${S.version}, but current version is v${Q4.vega}.`)}u.classList.add("vega-embed"),o&&u.classList.add("has-actions"),u.innerHTML="";let h=u;if(o){const S=document.createElement("div");S.classList.add($Pn),u.appendChild(S),h=S}const p=n.patch;if(p&&(d=p instanceof Function?p(d):J8(d,p,!0,!1).newDocument),n.formatLocale&&Wf.formatLocale(n.formatLocale),n.timeFormatLocale&&Wf.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const S in n.expressionFunctions){const E=n.expressionFunctions[S];"fn"in E?Wf.expressionFunction(S,E.fn,E.visitor):E instanceof Function&&Wf.expressionFunction(S,E)}const{ast:g}=n,v=Wf.parse(d,f==="vega-lite"?{}:i,{ast:g}),y=new(n.viewClass||Wf.View)(v,f0({loader:r,logLevel:l,renderer:a},g?{expr:Wf.expressionInterpreter??n.expr??IOn}:{}));if(y.addSignalListener("autosize",(S,E)=>{const{type:C}=E;C=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):C=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):C=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const S=TPn(n.tooltip)?n.tooltip:new y2n(n.tooltip===!0?{}:n.tooltip).call;y.tooltip(S)}let{hover:O}=n;if(O===void 0&&(O=f==="vega"),O){const{hoverSet:S,updateSet:E}=typeof O=="boolean"?{}:O;y.hover(S,E)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let m;if(o!==!1){let S=u;if(n.defaultStyle!==!1||n.forceActionsMenu){const C=document.createElement("details");C.title=s.CLICK_TO_VIEW_ACTIONS,u.append(C),S=C;const k=document.createElement("summary");k.innerHTML=kPn,C.append(k),m=P=>{C.contains(P.target)||C.removeAttribute("open")},document.addEventListener("click",m)}const E=document.createElement("div");if(S.append(E),E.classList.add("vega-actions"),o===!0||o.export!==!1){for(const C of["svg","png"])if(o===!0||o.export===!0||o.export[C]){const k=s[`${C.toUpperCase()}_ACTION`],P=document.createElement("a"),D=dt(n.scaleFactor)?n.scaleFactor[C]:n.scaleFactor;P.text=k,P.href="#",P.target="_blank",P.download=`${c}.${C}`,P.addEventListener("mousedown",async function(M){M.preventDefault();const L=await y.toImageURL(C,D);this.href=L}),E.append(P)}}if(o===!0||o.source!==!1){const C=document.createElement("a");C.text=s.SOURCE_ACTION,C.href="#",C.addEventListener("click",function(k){Gke(VV(t),n.sourceHeader??"",n.sourceFooter??"",f),k.preventDefault()}),E.append(C)}if(f==="vega-lite"&&(o===!0||o.compiled!==!1)){const C=document.createElement("a");C.text=s.COMPILED_ACTION,C.href="#",C.addEventListener("click",function(k){Gke(VV(d),n.sourceHeader??"",n.sourceFooter??"","vega"),k.preventDefault()}),E.append(C)}if(o===!0||o.editor!==!1){const C=n.editorUrl??"https://vega.github.io/editor/",k=document.createElement("a");k.text=s.EDITOR_ACTION,k.href="#",k.addEventListener("click",function(P){xPn(window,C,{config:i,mode:f,renderer:a,spec:VV(t)}),P.preventDefault()}),E.append(k)}}function w(){m&&document.removeEventListener("click",m),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:w,embedOptions:n}}function IPn(e){return!!e&&{}.toString.call(e)==="[object Function]"}function LPn(e,t,n){n&&(IPn(n)?n(e.data(t)):e.change(t,Wf.changeset().remove(()=>!0).insert(n)))}function jPn(e,t){Object.keys(t).forEach(n=>{LPn(e,n,t[n])})}function Ket(e){const t=new Set;return e.forEach(n=>{Object.keys(n).forEach(r=>{t.add(r)})}),t}const Jet=()=>{};function cH(e,t){const n=Object.keys(t);return n.forEach(r=>{try{e.addSignalListener(r,t[r])}catch(i){console.warn("Cannot add invalid signal listener.",i)}}),n.length>0}var FPn=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n};const ett=wf(FPn);function zPn(e,t){if(e===t)return!1;const n={width:!1,height:!1,isExpensive:!1},r=Ket([e,t]);return r.has("width")&&(!("width"in e)||!("width"in t)||e.width!==t.width)&&("width"in e&&typeof e.width=="number"?n.width=e.width:n.isExpensive=!0),r.has("height")&&(!("height"in e)||!("height"in t)||e.height!==t.height)&&("height"in e&&typeof e.height=="number"?n.height=e.height:n.isExpensive=!0),r.delete("width"),r.delete("height"),[...r].some(i=>!(i in e)||!(i in t)||!ett(e[i],t[i]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function e$e(e,t){const n=Object.keys(t);return n.forEach(r=>{try{e.removeSignalListener(r,t[r])}catch(i){console.warn("Cannot remove invalid signal listener.",i)}}),n.length>0}function uH(e){const{spec:t,width:n,height:r}=e;return typeof n<"u"&&typeof r<"u"?{...t,width:n,height:r}:typeof n<"u"?{...t,width:n}:typeof r<"u"?{...t,height:r}:t}function J$(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ttt extends ie.PureComponent{constructor(){super(...arguments),J$(this,"containerRef",ie.createRef()),J$(this,"resultPromise",void 0),J$(this,"handleError",t=>{const{onError:n=Jet}=this.props;n(t,this.containerRef.current),console.warn(t)}),J$(this,"modifyView",t=>{this.resultPromise&&this.resultPromise.then(n=>(n&&t(n.view),!0)).catch(this.handleError)})}componentDidMount(){this.createView()}componentDidUpdate(t){const n=Ket([this.props,t]);if(n.delete("className"),n.delete("signalListeners"),n.delete("spec"),n.delete("style"),n.delete("width"),n.delete("height"),Array.from(n).some(r=>this.props[r]!==t[r]))this.clearView(),this.createView();else{const r=zPn(uH(this.props),uH(t)),{signalListeners:i}=this.props,{signalListeners:o}=t;if(r)if(r.isExpensive)this.clearView(),this.createView();else{const s=!xK(i,o);this.modifyView(a=>{r.width!==!1&&a.width(r.width),r.height!==!1&&a.height(r.height),s&&(o&&e$e(a,o),i&&cH(a,i)),a.run()})}else xK(i,o)||this.modifyView(s=>{o&&e$e(s,o),i&&cH(s,i),s.run()})}}componentWillUnmount(){this.clearView()}createView(){const{spec:t,onNewView:n,signalListeners:r={},width:i,height:o,...s}=this.props;if(this.containerRef.current){const a=uH(this.props);this.resultPromise=DPn(this.containerRef.current,a,s).then(l=>{if(l){const{view:c}=l;cH(c,r)&&c.run()}return l}).catch(this.handleError),n&&this.modifyView(n)}}clearView(){return this.resultPromise&&this.resultPromise.then(t=>{t&&t.finalize()}).catch(this.handleError),this.resultPromise=void 0,this}render(){const{className:t,style:n}=this.props;return ie.createElement("div",{ref:this.containerRef,className:t,style:n})}}J$(ttt,"propTypes",{className:Or.string,onError:Or.func});function yee(){return yee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yee.apply(this,arguments)}function vee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const QPn={};class ntt extends ie.PureComponent{constructor(){super(...arguments),vee(this,"vegaEmbed",ie.createRef()),vee(this,"handleNewView",t=>{this.update();const{onNewView:n=Jet}=this.props;n(t)})}componentDidMount(){this.update()}componentDidUpdate(t){xK(this.props.data,t.data)||this.update()}update(){const{data:t}=this.props;this.vegaEmbed.current&&t&&Object.keys(t).length>0&&this.vegaEmbed.current.modifyView(n=>{jPn(n,t),n.resize().run()})}render(){const{data:t,...n}=this.props;return ie.createElement(ttt,yee({ref:this.vegaEmbed},n,{onNewView:this.handleNewView}))}}vee(ntt,"defaultProps",{data:QPn});function bee(){return bee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bee.apply(this,arguments)}function t$e(e){return ie.createElement(ntt,bee({},e,{mode:"vega-lite"}))}const eS={[so.BOOLEAN]:b.jsx(LLe,{className:"h-5 w-5 inline-flex opacity-60"}),[so.DATETIME]:b.jsx(_Le,{className:"h-5 w-5 inline-flex opacity-60"}),[so.NUMBER]:b.jsx(GEt,{className:"h-5 w-5 inline-flex opacity-60"}),[so.STRING]:b.jsx($Ct,{className:"h-5 w-5 inline-flex opacity-60"}),[so.INTEGER]:b.jsx(rCt,{className:"h-5 w-5 inline-flex opacity-60"})};function tpe(e){const{type:t,limit:n,additionalFieldQuery:r}=e;return{type:t,limit:n,createQuery(i){return{spec:{...i.spec,encodings:[...i.spec.encodings,r]},groupBy:"field",orderBy:["fieldOrder","aggregationQuality","effectiveness"],chooseBy:["aggregationQuality","effectiveness"],config:{autoAddCount:!0}}}}}const BPn=tpe({type:"addCategoricalField",limit:4,additionalFieldQuery:{channel:Jr,field:Jr,type:"nominal"}}),WPn=tpe({type:"addQuantitativeField",limit:4,additionalFieldQuery:{channel:Jr,bin:Jr,aggregate:Jr,field:Jr,type:"quantitative"}}),qPn=tpe({type:"addTemporalField",limit:2,additionalFieldQuery:{channel:Jr,hasFn:!0,timeUnit:Jr,field:Jr,type:"temporal"}});function VPn(e){if(e){if(e==="bin")return{bin:!0};if(hQ(e))return{aggregate:e};if(UPn(e))return{timeUnit:e}}else return{};return{}}function UPn(e){return e?rtt.includes(e)||itt.includes(e):!1}const HPn=["bin","min","max","mean","median","sum"],rtt=["year","month","date","day","hours","minutes","seconds","milliseconds"],itt=["yearmonth","yearmonthdate","monthdate"];function XPn(e){const{aggregate:t,bin:n,timeUnit:r}=e;if(n)return"bin";if(t)return t.toString();if(r)return r.toString()}function ZPn(e){return!stt(e).hasAnyWildcard}function YPn(e){const t=["x","y","color"],n=["row","column"],r=new Set(e.encodings.map(s=>s.channel)),i=t.every(s=>r.has(s)),o=n.some(s=>r.has(s));return i&&o}function ott(e){return e.encodings.length===0}function stt(e){let t=!1,n=!1,r=!1;for(const i of e.encodings)Eu(i)||(Eo(i)?It(i.autoCount)&&(n=!0):(It(i.field)&&(t=!0),(It(i.aggregate)||It(i.bin)||It(i.timeUnit))&&(n=!0),It(i.channel)&&(r=!0)));return{hasAnyWildcard:r||t||n,hasWildcardField:t,hasWildcardFn:n,hasWildcardChannel:r}}function att(e){const t={};for(const n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function GPn(e,t){const{fn:n,...r}=e;return{channel:t,...VPn(n),...r}}function KPn(e){const{aggregate:t,bin:n,timeUnit:r,field:i,scale:o,legend:s,axis:a,sort:l,description:c}=e;let{type:u}=e;if(It(u))throw new Error("Wildcard not support");u==="ordinal"&&(console.warn("Ordinal type is not supported. Using nominal type instead."),u="nominal");const f=XPn({aggregate:t,bin:n,timeUnit:r});return bi(i!==void 0,"Field is required for fieldQ"),att({field:i,fn:f,type:u,sort:l,scale:o,axis:a,legend:s,description:c})}function JPn(e){return{mark:e.mark,encodings:eAn(e.encoding),config:e.config}}function eAn(e){return Object.entries(e).map(([t,n])=>GPn(n,t))}const ltt={name:"source"};function tAn(e){let t=!1,n=!1,r=!1;return e.encodings.forEach(i=>{i.channel==="x"||i.channel==="y"?t=!0:i.channel==="row"||i.channel==="column"?r=!0:typeof i.channel=="string"&&Pn(WGe,i.channel)&&(n=!0)}),{hasOpenPosition:t,hasStyleChannel:n,hasOpenFacet:r}}function nAn(e,t){const n={},{hasOpenPosition:r,hasStyleChannel:i,hasOpenFacet:o}=tAn(e.spec);return(r||i)&&(n.addQuantitativeField=EL(WPn,e,t)),(r||i||o)&&(n.addCategoricalField=EL(BPn,e,t)),r&&(n.addTemporalField=EL(qPn,e,t)),n}function fH(e,t){if(ott(e.spec))return{plots:[],query:e,limit:1};const n=Kqe(e,t).result;return{plots:[ctt(n,ltt)[0]],query:e,limit:1}}function EL(e,t,n){const r=e.createQuery(t),i=Kqe(r,n).result;return{plots:ctt(i,ltt),query:r,limit:e.limit}}function ctt(e,t){return e.items.map(n=>Xqe(n)?n$e(t,bK(n)):n$e(t,n))}function n$e(e,t){return{fieldInfos:t.getEncodings().filter(on).map(r=>({fieldDef:KPn(r),channel:r.channel})),spec:t.toSpec(e)}}function rAn(e){const{spec:t,autoAddCount:n}=e,r=JPn(t),{hasAnyWildcard:i,hasWildcardFn:o,hasWildcardField:s}=stt(r),a=iAn({hasWildcardFn:o,hasWildcardField:s});return{spec:r,groupBy:a,orderBy:["fieldOrder","aggregationQuality","effectiveness"],chooseBy:["aggregationQuality","effectiveness"],config:i?{autoAddCount:n}:void 0}}function iAn(e){const{hasWildcardFn:t,hasWildcardField:n}=e;return t?"fieldTransform":n?"field":"encoding"}const oAn={type:"histograms",limit:12,createQuery(e){return{spec:{data:e.spec.data,mark:Jr,transform:e.spec.transform,encodings:[{channel:Jr,bin:Jr,timeUnit:Jr,field:Jr,type:Jr},{channel:Jr,aggregate:"count",field:"*",type:"quantitative"}]},groupBy:"fieldTransform",orderBy:["fieldOrder","aggregationQuality","effectiveness"],chooseBy:["aggregationQuality","effectiveness"],config:{autoAddCount:!1}}}};function utt(){return{mark:Jr,encoding:{},config:{},schema:null}}const{reducer:sAn,createActions:aAn}=ZO(utt,{setSchema:(e,t)=>({...e,schema:t}),setMark:(e,t)=>({...e,mark:t}),setEncoding:(e,t)=>{const n=att({...e.encoding,...t});return{...e,encoding:n}},set:(e,t)=>{const{schema:n,...r}=t;return{...e,...r}}}),yb=hn(utt());function ftt(e){const t=vl(yb);return x.useMemo(()=>aAn(r=>{t(i=>{const o=sAn(i,r);return e==null||e(o),o})}),[t,e])}const lAn=hn(e=>{const t=e(yb);if(!t.schema)return{};const n=rAn({spec:t,autoAddCount:!0});return ott(n.spec)?{main:fH(n,t.schema),histograms:EL(oAn,n,t.schema)}:ZPn(n.spec)&&!YPn(n.spec)?{main:fH(n,t.schema),...nAn(n,t.schema)}:{main:fH(n,t.schema)}}),cAn=[Jr,"area","bar","circle","geoshape","line","point","rect","rule","square","text","tick","trail"],uAn=["x","y","row","column"],fAn=["color","size","shape"],dAn=({schema:e,mark:t})=>{const n=Gi(yb),r=ftt(),i=n.encoding.x&&n.encoding.y,o=a=>{const c=(a==="row"||a==="column")&&!i;return b.jsx(hAn,{schema:e,label:a,disabled:c,fieldDefinition:n.encoding[a],onChange:u=>r.setEncoding({[a]:u})},a)},s=b.jsxs($v,{"data-testid":"marimo-plugin-data-explorer-mark-select",value:t.toString(),onValueChange:a=>r.setMark(a),children:[b.jsx(ym,{children:b.jsx(v_,{placeholder:"Mark"})}),b.jsx(vm,{children:b.jsxs(Jg,{children:[b.jsx(M8,{children:"Mark"}),cAn.map(a=>b.jsx(Kl,{value:a,children:a===Jr?"auto":a},a))]})})]});return b.jsxs("div",{className:"grid gap-x-2 gap-y-4 justify-items-start py-3 pl-4 pr-2 bg-[var(--slate-1)] border rounded items-center grid-template-columns-[repeat(2,_minmax(0,_min-content))] self-start",children:[b.jsx("span",{className:"col-span-2 flex items-center justify-between w-full",children:b.jsx("div",{className:"text-sm font-semibold",children:"Encodings"})}),uAn.map(o),b.jsxs("span",{className:"col-span-2 text-sm font-semibold w-full border-t border-divider flex items-center justify-between pt-2 pr-[30px]",children:[b.jsx("div",{children:"Mark"}),s]}),fAn.map(o)]})},hAn=({label:e,schema:t,fieldDefinition:n,disabled:r,onChange:i})=>{const o=()=>{if(!n)return"--";if(n.field==="*")return b.jsxs("span",{className:"flex gap-2 flex-1",children:[eS[so.NUMBER],b.jsx("span",{className:"text-left flex-1",children:"Count"})]});const l=n.field.toString(),c=()=>n.fn?`${n.fn}(${n.field})`:l;return b.jsxs("span",{className:"flex gap-2 flex-1",children:[eS[t.primitiveType(l)],b.jsx("span",{className:"text-left flex-1",children:c()})]})},s=()=>{i(void 0)},a=(n==null?void 0:n.field.toString())??"";return b.jsxs(b.Fragment,{children:[b.jsx(Ls,{className:"text-[var(--slate-11)] font-semibold",children:e}),b.jsxs("div",{className:"flex flex-row gap-1 h-[26px]",children:[b.jsxs($v,{value:a,disabled:r,onValueChange:l=>{i(l==="*"?{field:"*",fn:"count",type:"quantitative"}:{field:l,type:t.vlType(l)})},children:[b.jsx(ym,{className:"min-w-[140px] lg:min-w-[210px] h-full",onClear:a?s:void 0,children:o()}),b.jsx(vm,{children:b.jsxs(Jg,{children:[t.fieldNames().map(l=>b.jsx(Kl,{value:l.toString(),children:b.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[eS[t.primitiveType(l)],b.jsx("span",{className:"flex-1",children:l}),b.jsxs("span",{className:"text-muted-foreground text-xs font-semibold",children:["(",t.vlType(l),")"]})]})},l)),t.fieldNames().length===0&&b.jsx(Kl,{disabled:!0,value:"--",children:"No columns"}),b.jsx(yle,{}),b.jsx(Kl,{value:"*",children:b.jsxs("span",{className:"flex items-center gap-1 flex-1",children:[eS[so.NUMBER],b.jsx("span",{className:"flex-1",children:"Count"})]})},"*")]})})]}),b.jsx("div",{className:"w-[26px]",children:n&&b.jsx(pAn,{field:n,onChange:i})})]})]})},dH="__",pAn=({field:e,onChange:t})=>{if(e.field==="*")return null;let n=[];return e.type===Pd.QUANTITATIVE&&(n=[["",HPn]]),e.type===Pd.TEMPORAL&&(n=[["Single",rtt],["Multi",itt]]),n.length>0?b.jsxs($v,{"data-testid":"marimo-plugin-data-explorer-field-options",value:e.fn,onValueChange:r=>{t({...e,fn:r===dH?void 0:r})},children:[b.jsx(ym,{className:"h-full px-1",hideChevron:!0,variant:"ghost",children:b.jsx(oz,{size:14,strokeWidth:1.5})}),b.jsxs(vm,{children:[b.jsx(Jg,{children:b.jsx(Kl,{value:dH,children:"None"})}),b.jsx(yle,{}),n.map(([r,i])=>b.jsxs(Jg,{children:[r&&b.jsx(M8,{children:r}),i.map(o=>b.jsx(Kl,{value:o??dH,children:RR(o)},o))]},r))]})]}):null},r$e=12,gAn=({schema:e})=>{const[t,n]=x.useState(),[r,i]=x.useState(),o=e.fieldNames(),s=t?e.stats({field:t,channel:"x"}):void 0,a=b.jsx(SEt,{className:"text-muted-foreground",width:40,height:40,strokeWidth:1.5}),l=r?o:o.slice(0,r$e),c=o.length>r$e;return b.jsxs("div",{className:"flex flex-col justify-center items-center h-full flex-1 gap-2",children:[a,b.jsxs("span",{className:"text-muted-foreground font-semibold",children:[o.length>0?o.length:"No"," fields"]}),b.jsxs("div",{className:"hidden lg:grid grid-cols-2 xl:grid-cols-3 gap-2 p-2 bg-[var(--slate-1)] border rounded lg:items-center items-start w-fit grid-flow-dense max-h-[300px] overflow-auto",children:[l.map(u=>{const f=e.cardinality({channel:"x",field:u});return b.jsxs("span",{className:be("hover:bg-muted self-start px-2 py-2 rounded flex flex-row gap-1 items-center cursor-pointer lg:justify-center text-sm truncate flex-shrink-0 overflow-hidden",t===u&&"bg-muted"),onClick:()=>{if(t===u){n(void 0);return}n(u)},children:[eS[e.primitiveType(u)],u,f>1&&b.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",f,")"]})]},u)}),c&&b.jsx(St,{"data-testid":"marimo-plugin-data-explorer-show-more-columns",variant:"link",size:"sm",className:"self-center col-span-3 -mt-1",onClick:()=>i(u=>!u),children:r?"Show less":"Show more"})]}),b.jsx("div",{className:"lg:hidden",children:b.jsxs($v,{"data-testid":"marimo-plugin-data-explorer-column-select",value:t||"",disabled:o.length===0,onValueChange:u=>{n(u)},children:[b.jsx(ym,{className:"min-w-[210px] h-full",children:b.jsx(v_,{placeholder:"Select a column"})}),b.jsx(vm,{children:b.jsx(Jg,{children:e.fieldNames().map(u=>b.jsx(Kl,{value:u.toString(),children:b.jsxs("span",{className:"flex items-center gap-2 flex-1",children:[eS[e.primitiveType(u)],b.jsx("span",{className:"flex-1",children:u}),b.jsxs("span",{className:"text-muted-foreground text-xs font-semibold",children:["(",e.vlType(u),")"]})]})},u))})})]})}),t&&b.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-2 p-2 text-sm",children:mAn.map(u=>b.jsxs("div",{className:"flex flex-row gap-2 min-w-[100px]",children:[b.jsx("span",{className:"font-semibold",children:u}),b.jsx("span",{children:yAn(s==null?void 0:s[u])})]},u))})]})},mAn=["distinct","min","max","mean","median","q1","q3","stdev"];function yAn(e){return typeof e=="number"?new Intl.NumberFormat("en-US",{maximumFractionDigits:2}).format(e):typeof e=="string"?e:typeof e=="object"&&e instanceof Date?new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(e):String(e)}function HQ(e){x.useEffect(e,[])}const vAn=MR("marimo-data-explorer").withData(Y.object({label:Y.string().nullish(),data:Y.string()})).renderer(e=>b.jsx(UC,{children:b.jsx(bAn,{...e.data,value:e.value,setValue:e.setValue})})),bAn=e=>{const t=x.useMemo(()=>K7(),[]);return HQ(()=>{const n=t.sub(yb,()=>{const i=t.get(yb),{schema:o,...s}=i;e.setValue(s)}),r=e.value;return r&&Object.keys(r).length>0&&t.set(yb,r),n}),b.jsx(YMe,{store:t,children:b.jsx(wAn,{...e})})},OAn={export:{svg:!0,png:!0},source:!1,compiled:!1,editor:!1},xAn={left:20,right:20,top:20,bottom:20},wAn=({data:e})=>{var d,h,p,g,v,y;const t=ftt(),{data:n,loading:r,error:i}=zd(async()=>{if(!e)return{};const O=await Wae(e,{type:"csv",parse:"auto"}),m=Htn(O);return t.setSchema(m),{chartData:O,schema:m}},[e]),{mark:o}=Gi(yb),s=Gi(lAn);if(i)return b.jsx(pE,{error:i});if(!n)return b.jsx("div",{});const{chartData:a,schema:l}=n;if(r||!l)return b.jsx("div",{});const c=(h=(d=s.main)==null?void 0:d.plots)==null?void 0:h[0],u=new Set(c==null?void 0:c.fieldInfos.map(O=>O.fieldDef.field)),f=()=>c?b.jsx("div",{className:"flex overflow-y-auto justify-center items-center flex-1 w-[90%]",children:b.jsx(t$e,{data:{source:a},padding:xAn,actions:OAn,spec:CAn(c.spec)})}):b.jsx(gAn,{schema:l});return b.jsxs("div",{className:"flex flex-col gap-2",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(dAn,{mark:o,schema:l}),f()]}),b.jsx(SAn,{children:[(p=s.histograms)==null?void 0:p.plots,(g=s.addCategoricalField)==null?void 0:g.plots,(v=s.addQuantitativeField)==null?void 0:v.plots,(y=s.addTemporalField)==null?void 0:y.plots].filter(Boolean).flat().map((O,m)=>b.jsx(EAn,{title:b.jsx("div",{className:"flex flex-row gap-1",children:O.fieldInfos.map(w=>{const S=w.fieldDef.field==="*"?"Count":w.fieldDef.fn?`${w.fieldDef.fn}(${w.fieldDef.field})`:w.fieldDef.field.toString();return b.jsx(tse,{variant:u.has(w.fieldDef.field)?"secondary":"defaultOutline",children:S},S)})}),actions:b.jsx(Wt,{content:"Make main plot",children:b.jsx(St,{"data-testid":"marimo-plugin-data-explorer-make-main-plot",variant:"text",size:"icon",onClick:()=>{const w=pn.fromEntries(O.fieldInfos.map(S=>[S.channel,S.fieldDef]));t.setEncoding(w)},children:b.jsx(nCt,{className:"w-4 h-4"})})}),children:b.jsx(t$e,{data:{source:a},actions:!1,spec:O.spec},m)},m))})]})},SAn=({children:e})=>ie.Children.count(e)===0?null:b.jsx("div",{className:"flex flex-row overflow-x-auto overflow-y-hidden gap-4 snap-x pb-4",children:e}),EAn=({title:e,children:t,actions:n})=>b.jsxs("div",{className:"flex-shrink-0 bg-card shadow-md border overflow-hidden rounded snap-start",children:[b.jsxs("div",{className:"flex flex-row justify-between items-center bg-[var(--slate-3)] py-0.5 px-2",children:[b.jsx("div",{className:"text-sm font-medium",children:e}),n]}),b.jsx("div",{className:"px-6 pt-2 max-h-[280px] overflow-y-auto",children:t})]});function CAn(e){var n,r;return!!((n=e.encoding)!=null&&n.row||(r=e.encoding)!=null&&r.column)||(e.width="container"),e}class _An{constructor(){ve(this,"tagName","marimo-mermaid");ve(this,"validator",Y.object({diagram:Y.string()}))}render(t){return b.jsx(kAn,{diagram:t.data.diagram})}}const kAn=x.lazy(()=>Pe(()=>import("./mermaid-DRQTlRip.js").then(e=>e.a6),__vite__mapDeps([]),import.meta.url));class $An{constructor(){ve(this,"tagName","marimo-anywidget");ve(this,"validator",Y.object({jsUrl:Y.string(),css:Y.string().nullish()}))}render(t){return b.jsx(TAn,{...t})}}const TAn=e=>{const{css:t,jsUrl:n}=e.data,{data:r,loading:i,error:o}=zd(async()=>{const s=document.baseURI,a=new URL(n,s).toString();return await Pe(()=>import(a),__vite__mapDeps([]),import.meta.url)},[]);if(x.useEffect(()=>{if(!t||!e.host.shadowRoot)return;const s=document.createElement("style");return s.innerHTML=t,e.host.shadowRoot.append(s),()=>{s.remove()}},[t,e.host]),o)return b.jsx(pE,{error:o});if(!r||i)return null;if(!r.default.render){const s=new Error(`Module at ${n} does not have a default export with a render function`);return b.jsx(pE,{error:s})}return b.jsx(PAn,{...e,render:r.default.render})},PAn=({value:e,setValue:t,render:n})=>{const r=x.useRef(null),i=x.useRef(new AAn(e,t));return HQ(()=>{r.current&&n({model:i.current,el:r.current})}),x.useEffect(()=>{i.current.updateAndEmitDiffs(e)},[tK([e])]),b.jsx("div",{ref:r})};class AAn{constructor(t,n){ve(this,"listeners",{});this.data=t,this.onChange=n}get(t){return this.data[t]}set(t,n){this.data={...this.data,[t]:n},this.emit(`change:${t}`,n)}save_changes(){this.onChange(this.data)}updateAndEmitDiffs(t){Object.keys(t).forEach(n=>{const r=n;$S(this.data[r],t[r])||this.set(r,t[r])})}on(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}emit(t,n){this.listeners[t]&&this.listeners[t].forEach(r=>r(n))}}function RAn(e={}){const{threshold:t=1,root:n=null,rootMargin:r="0px"}=e,[i,o]=x.useState(null),s=x.useRef(null);return[x.useCallback(l=>{if(s.current&&(s.current.disconnect(),s.current=null),(l==null?void 0:l.nodeType)===Node.ELEMENT_NODE){const c=new IntersectionObserver(([u])=>{o(u)},{threshold:t,root:n,rootMargin:r});c.observe(l),s.current=c}},[t,n,r]),i]}const DAn=MR("marimo-lazy").withData(Y.object({showLoadingIndicator:Y.boolean().default(!1)})).withFunctions({load:fP.input(Y.object({})).output(Y.object({html:Y.string()}))}).renderer(e=>b.jsx(MAn,{...e.data,...e.functions})),MAn=({load:e,showLoadingIndicator:t})=>{const[n,r]=RAn({threshold:0,root:null,rootMargin:"0px"}),i=x.useRef(!1);r!=null&&r.isIntersecting&&(i.current=!0);const{data:o,loading:s,error:a}=zd(()=>i.current?e({}):Promise.resolve({html:""}),[i.current]);return a?b.jsx(pE,{error:a}):b.jsx("div",{ref:n,className:"min-h-4",children:s&&t?b.jsx(Nb,{className:"w-12 h-12 animate-spin text-primary my-4 mx-4"}):o&&Da({html:o.html})})},NAn=[new rEt,new NCt,hWt,new lPt,new uPt,new IGt,new dPt,new lAt,TRt,new MVt,new bMt,new wMt,new JMt,new $Vt,new CNt,new LNt,new TWt,new BNt,new FNt,new kUt,new RGt,vAn,$Gt,DAn,new $An],IAn=[new pWt,new yWt,new pVt,new IVt,new vWt,new XVt,new DUt,new vVt,new _An];function LAn(){ySt(),NAn.forEach(wve),IAn.forEach(wve)}const jAn=Ao("flex items-center justify-center m-0 leading-none font-medium border border-foreground/10 shadow-xsSolid shadow-foreground/10 hover:cursor-pointer focus:shadow-md dark:border-border text-sm",{variants:{color:{gray:"mo-button gray",white:"mo-button white",green:"mo-button green",red:"mo-button red",yellow:"mo-button yellow","hint-green":"mo-button hint-green",disabled:"mo-button disabled"},shape:{rectangle:"rounded",circle:"rounded-full"},size:{small:"",medium:""}},compoundVariants:[{size:"small",shape:"circle",class:"h-[24px] w-[24px] px-[5.5px] py-[5.5px]"},{size:"medium",shape:"circle",class:"px-2 py-2"},{size:"small",shape:"rectangle",class:"px-1 py-1 h-[24px] w-[24px]"},{size:"medium",shape:"rectangle",class:"px-3 py-2"}],defaultVariants:{color:"gray",size:"medium",shape:"rectangle"}}),FAn=Ao("font-mono w-full flex-1 inline-flex items-center justify-center rounded px-2.5 text-foreground/60 h-[36px] hover:shadow-md hover:cursor-pointer focus:shadow-md focus:outline-none text-[hsl(0, 0%, 43.5%)] bg-transparent hover:bg-background focus:bg-background"),Xi=ie.forwardRef(({color:e,shape:t,size:n,className:r,...i},o)=>b.jsx("button",{ref:o,className:bd(jAn({color:e,shape:t,size:n}),r),...i,children:i.children}));Xi.displayName="Button";const dtt=ie.forwardRef(({className:e,...t},n)=>b.jsx("input",{ref:n,className:bd(FAn(),e),...t}));dtt.displayName="Input";function B4(){if(typeof window>"u")return At.warn("isPlatformMac() called without window"),!1;const e=window.navigator.userAgentData?window.navigator.userAgentData.platform:window.navigator.platform;return/mac/i.test(e)}function XQ(e){const t=e.split("-");return n=>{let r=!0;for(const i of t){switch(i){case"Ctrl":r&&(r=n.ctrlKey);break;case"Cmd":r&&(r=n.metaKey);break;case"Shift":r&&(r=n.shiftKey);break;case"Alt":r&&(r=n.altKey);break;case"Space":r&&(r=n.code==="Space");break;default:r&&(r=n.key.toLowerCase()===i.toLowerCase());break}if(!r)return!1}return t.includes("Shift")||r&&(r=!n.shiftKey),t.includes("Ctrl")||r&&(r=!n.ctrlKey),t.includes("Cmd")||r&&(r=!n.metaKey),t.includes("Alt")||r&&(r=!n.altKey),r}}const htt=hn({});function zAn(){return Gi(htt)}function QAn(){const e=vl(htt);return{registerAction:(t,n)=>{e(r=>({...r,[t]:n}))},unregisterAction:t=>{e(n=>{const{[t]:r,...i}=n;return i})}}}const npe={"cell.focusUp":{name:"Focus up",group:"Navigation",key:"Mod-Shift-k"},"cell.focusDown":{name:"Focus down",group:"Navigation",key:"Mod-Shift-j"},"cell.moveUp":{name:"Move up",group:"Creation and Ordering",key:"Mod-Shift-9"},"cell.moveDown":{name:"Move down",group:"Creation and Ordering",key:"Mod-Shift-0"},"cell.createAbove":{name:"Create cell above",group:"Creation and Ordering",key:"Mod-Shift-o"},"cell.createBelow":{name:"Create cell below",group:"Creation and Ordering",key:"Mod-Shift-p"},"cell.sendToTop":{name:"Send to top",group:"Creation and Ordering",key:"Mod-Shift-1"},"cell.sendToBottom":{name:"Send to bottom",group:"Creation and Ordering",key:"Mod-Shift-2"},"cell.run":{name:"Run",group:"Running Cells",key:"Mod-Enter"},"cell.runAndNewBelow":{name:"Run and new below",group:"Running Cells",key:"Shift-Enter"},"cell.runAndNewAbove":{name:"Run and new above",group:"Running Cells",key:"Mod-Shift-Enter"},"cell.format":{name:"Format",group:"Editing",key:"Mod-b"},"cell.viewAsMarkdown":{name:"View as Markdown",group:"Editing",key:"Mod-Shift-m"},"cell.complete":{name:"Code completion",group:"Editing",key:"Ctrl-Space"},"cell.undo":{name:"Undo",group:"Editing",key:"Mod-z"},"cell.redo":{name:"Redo",group:"Editing",key:{main:"Mod-Shift-z",windows:"Mod-y"}},"cell.findAndReplace":{name:"Find and replace",group:"Editing",key:"Mod-f"},"cell.selectNextOccurrence":{name:"Select next occurrence",group:"Editing",key:"Mod-d"},"cell.fold":{name:"Fold",group:"Editing",key:{main:"Mod-Alt-[",windows:"Mod-Shift-["}},"cell.unfold":{name:"Unfold",group:"Editing",key:{main:"Mod-Alt-]",windows:"Mod-Shift-]"}},"cell.foldAll":{name:"Fold all in cell",group:"Editing",key:"Ctrl-Alt-["},"cell.unfoldAll":{name:"Unfold all in cell",group:"Editing",key:"Ctrl-Alt-]"},"cell.delete":{name:"Delete empty cell",group:"Editing",key:"Shift-Backspace"},"cell.hideCode":{name:"Hide cell code",group:"Editing",key:"Mod-h"},"cell.aiCompletion":{name:"AI completion",group:"Editing",key:"Mod-Shift-e"},"cell.cellActions":{name:"Open cell actions",group:"Editing",key:"Mod-p"},"global.hideCode":{name:"Toggle app view",group:"Other",key:"Mod-."},"global.foldCode":{name:"Fold all cells",group:"Editing",key:{main:"Ctrl-Cmd-l",windows:"Mod-Shift-l"}},"global.unfoldCode":{name:"Unfold all cells",group:"Editing",key:{main:"Ctrl-Cmd-;",windows:"Mod-Shift-:"}},"global.showHelp":{name:"Keyboard shortcuts",group:"Other",key:"Mod-Shift-h"},"global.save":{name:"Save",group:"Other",key:"Mod-s"},"global.commandPalette":{name:"Command palette",group:"Other",key:"Mod-k"},"global.runStale":{name:"Run all modified cells",group:"Running Cells",key:"Mod-Shift-r"},"global.interrupt":{name:"Stop (interrupt) execution",group:"Running Cells",key:"Mod-i"},"global.formatAll":{name:"Format all",group:"Editing",key:"Mod-Shift-b"},"global.toggleLanguage":{name:"Toggle language to markdown (if supported)",group:"Editing",key:"F4"},"global.focusTop":{name:"Focus top",group:"Navigation",key:"Mod-Shift-f"},"global.focusBottom":{name:"Focus bottom",group:"Navigation",key:"Mod-Shift-g"},"global.toggleSidebar":{name:"Toggle helper panel",group:"Navigation",key:"Mod-Shift-s"}};function BAn(e){return e in npe}class rpe{constructor(t,n){ve(this,"mod");ve(this,"platform");this.hotkeys=t,n=n??B4(),this.mod=n?"Cmd":"Ctrl",this.platform=n?"mac":"windows"}static create(t){return new rpe(npe,t)}iterate(){return pn.keys(this.hotkeys)}getHotkey(t){const{name:n,key:r}=this.hotkeys[t];if(typeof r=="string")return{name:n,key:r.replace("Mod",this.mod)};const i=r[this.platform]||r.main;return{name:n,key:i.replace("Mod",this.mod)}}getHotkeyDisplay(t){return this.hotkeys[t].name}getHotkeyGroups(){return pn.groupBy(pn.entries(this.hotkeys),([,t])=>t.group,([t])=>t)}}class WAn extends rpe{constructor(t){super(npe),this.overrides=t}getHotkey(t){const n=super.getHotkey(t),r=this.overrides[t]||n.key;return{name:n.name,key:r}}}const Er=new WAn({});function tl(e,t){const{registerAction:n,unregisterAction:r}=QAn(),i=t===Yc.NOOP,o=Jn(()=>t()),s=Jn(a=>{const l=Er.getHotkey(e).key;XQ(l)(a)&&t()!==!1&&(a.preventDefault(),a.stopPropagation())});nD(document,"keydown",s),x.useEffect(()=>{if(!i)return n(e,o),()=>r(e)},[o,e,i])}function qAn(e,t){nD(e,"keydown",n=>{for(const[r,i]of pn.entries(t)){const o=Er.getHotkey(r).key;XQ(o)(n)&&(At.debug("Satisfied",o,n),i()!==!1&&(n.preventDefault(),n.stopPropagation()))}})}function VAn(e,t){nD(e,"keydown",n=>{for(const[r,i]of pn.entries(t))XQ(r)(n)&&(At.debug("Satisfied",r,n),i()!==!1&&(n.preventDefault(),n.stopPropagation()))})}const Oee=e=>b.jsx("kbd",{className:bd(e.className,"rounded-md bg-muted/40 px-2 text-[0.75rem] font-prose center border border-foreground/20 text-muted-foreground block"),children:e.children});function Md(e){const t=Er.getHotkey(e);return b.jsxs("span",{className:"flex",children:[b.jsx("span",{className:"mr-2",children:t.name}),b.jsx(W4,{shortcut:t.key})]})}const W4=({shortcut:e})=>{const t=e.split("-");return b.jsx("div",{className:"flex gap-1",children:t.map(ptt).map(([n,r])=>r?b.jsx(Wt,{asChild:!1,tabIndex:-1,content:n,delayDuration:300,children:b.jsx(Oee,{children:r},n)},n):b.jsx(Oee,{children:gtt(n)},n))})};function ipe(e){const n=Er.getHotkey(e).key.split("-");return b.jsx(B5t,{className:"flex gap-1 items-center",children:n.map(ptt).map(([r,i])=>i?b.jsx(Wt,{content:r,delayDuration:300,tabIndex:-1,children:b.jsx("span",{children:i},r)},r):b.jsx("span",{children:gtt(r)},r))})}function ptt(e){const t=B4()?"mac":"default",n=e.toLowerCase(),r=UAn[e.toLowerCase()];if(r){const i=r.symbols[t]||r.symbols.default;return[r.label,i]}return[n]}const UAn={ctrl:{symbols:{mac:"⌃",default:"Ctrl"},label:"Control"},control:{symbols:{mac:"⌃",default:"Ctrl"},label:"Control"},shift:{symbols:{mac:"⇧",default:"Shift"},label:"Shift"},alt:{symbols:{mac:"⌥",default:"Alt"},label:"Alt/Option"},escape:{symbols:{mac:"⎋",default:"Esc"},label:"Escape"},arrowup:{symbols:{default:"↑"},label:"Arrow Up"},arrowdown:{symbols:{default:"↓"},label:"Arrow Down"},arrowleft:{symbols:{default:"←"},label:"Arrow Left"},arrowright:{symbols:{default:"→"},label:"Arrow Right"},backspace:{symbols:{mac:"⌫",default:"⟵"},label:"Backspace"},tab:{symbols:{mac:"⇥",default:"⭾"},label:"Tab"},capslock:{symbols:{default:"⇪"},label:"Caps Lock"},fn:{symbols:{default:"Fn"},label:"Fn"},cmd:{symbols:{mac:"⌘",windows:"⊞ Win",default:"Command"},label:"Command"},insert:{symbols:{default:"Ins"},label:"Insert"},delete:{symbols:{mac:"⌦",default:"Del"},label:"Delete"},home:{symbols:{mac:"↖",default:"Home"},label:"Home"},end:{symbols:{mac:"↘",default:"End"},label:"End"}};function gtt(e){return e.charAt(0).toUpperCase()+e.slice(1)}const mtt=hn(!1),HAn=()=>{const[e,t]=tc(mtt);if(tl("global.showHelp",()=>t(o=>!o)),!e)return null;const n=o=>{const s=Er.getHotkey(o);return b.jsxs("div",{className:"keyboard-shortcut flex flex-col",children:[b.jsx(W4,{shortcut:s.key}),b.jsx("span",{children:s.name.toLowerCase()})]},o)},r=Er.getHotkeyGroups(),i=o=>{const s=r[o];return b.jsxs("div",{className:"keyboard-shortcut-group gap-2 flex flex-col",children:[b.jsx("h3",{className:"text-lg font-medium",children:o}),s.map(a=>n(a))]})};return b.jsx(_z,{open:e,onOpenChange:o=>t(o),children:b.jsxs(Voe,{className:"sm:items-center sm:top-0",children:[b.jsx(Uoe,{}),b.jsxs(gm,{usePortal:!1,className:"max-h-screen sm:max-h-[90vh] overflow-y-auto sm:max-w-[850px]",children:[b.jsx(YC,{children:b.jsx(Ov,{children:"Shortcuts"})}),b.jsxs("div",{className:"flex flex-row gap-3",children:[b.jsxs("div",{className:"w-1/2",children:[i("Editing"),i("Navigation")]}),b.jsxs("div",{className:"w-1/2",children:[i("Running Cells"),i("Creation and Ordering"),i("Other")]})]})]})]})})},ytt=ie.createContext({modal:null,setModal:()=>{}}),XAn=e=>{const[t,n]=ie.useState(null);return b.jsxs(ytt.Provider,{value:{modal:t,setModal:n},children:[t,e.children]})};function $m(){const e=ie.useContext(ytt);if(e===void 0)throw new Error("useModal must be used within a ModalProvider");const t=()=>{e.setModal(null)};return{openModal:n=>{e.setModal(b.jsx(_z,{open:!0,onOpenChange:r=>{r||t()},children:n}))},openAlert:n=>{e.setModal(b.jsx(hY,{open:!0,onOpenChange:r=>{r||t()},children:b.jsxs(qj,{children:[n,b.jsx(Vj,{children:b.jsx(xz,{autoFocus:!0,onClick:t,children:"Ok"})})]})}))},openConfirm:n=>{e.setModal(b.jsx(hY,{open:!0,onOpenChange:r=>{r||t()},children:b.jsxs(qj,{children:[b.jsxs(bz,{children:[b.jsx(Oz,{className:n.variant==="destructive"?"text-destructive":"",children:n.title}),b.jsx(Qoe,{children:n.description})]}),b.jsxs(Vj,{children:[b.jsx(p3e,{onClick:t,children:"Cancel"}),n.confirmAction]})]})}))},closeModal:t}}const ZAn=({onShutdown:e})=>{const{openConfirm:t,closeModal:n}=$m();return b.jsx(Wt,{content:"Shutdown",children:b.jsx(Xi,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:"red",className:"h-[27px] w-[27px]",onClick:r=>{r.stopPropagation(),t({title:"Shutdown",description:"This will terminate the Python kernel. You'll lose all data that's in memory.",variant:"destructive",confirmAction:b.jsx(wz,{onClick:i=>{e(i),n()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},children:b.jsx(rc,{strokeWidth:1})})})},YAn=e=>{const t=()=>{WR(new Blob([e.getCellsAsJSON()],{type:"text/plain"}),`${e.proposedName}.json`)};return b.jsx(gm,{className:"w-fit",children:b.jsxs("form",{onSubmit:n=>{n.preventDefault(),t(),e.closeModal()},onKeyDown:n=>{n.key==="Escape"&&e.closeModal()},children:[b.jsx(Ov,{className:"text-accent mb-6",children:"Download unsaved changes?"}),b.jsxs(mE,{className:"markdown",children:[b.jsx("p",{children:"This app has unsaved changes. To recover:"}),b.jsxs("ol",{children:[b.jsxs("li",{style:{paddingBottom:"10px"},children:['Click the "Download" button. This will download a file called ',b.jsxs("code",{children:[e.proposedName,".json"]}),". This file contains your code."]}),b.jsxs("li",{style:{paddingBottom:"10px"},children:["In your terminal, type",b.jsxs("code",{style:{display:"block",padding:"10px"},children:["marimo recover ",e.proposedName,".json ",">"," ",e.proposedName,".py"]}),"to overwrite ",b.jsxs("code",{children:[e.proposedName,".py"]})," with the recovered changes."]})]})]}),b.jsxs(FR,{children:[b.jsx(St,{"aria-label":"Cancel",variant:"secondary","data-testid":"cancel-recovery-button",onClick:e.closeModal,children:"Cancel"}),b.jsx(St,{"data-testid":"download-recovery-button","aria-label":"Download",variant:"default",type:"submit",children:"Download"})]})]})})},GAn=e=>{const{filename:t,needsSave:n,getCellsAsJSON:r}=e,{openModal:i,closeModal:o}=$m(),s=t===null?"app":t.slice(0,-3),a=()=>{n&&i(b.jsx(YAn,{getCellsAsJSON:r,proposedName:s,closeModal:o}))};return tl("global.save",a),b.jsx(Wt,{content:Md("global.save"),children:b.jsx(Xi,{onClick:a,id:"save-button","aria-label":"Save",className:"rectangle",color:n?"yellow":"gray",children:b.jsx(goe,{strokeWidth:1.5})})})};function KAn(e){var t=e.Pos;function n(_,$,R){if($.line===R.line&&$.ch>=R.ch-1){var I=_.getLine($.line),Q=I.charCodeAt($.ch);55296<=Q&&Q<=55551&&(R.ch+=1)}return{start:$,end:R}}var r=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],i=r.length,o=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],s=me("");function a(_){_.setOption("disableInput",!0),_.setOption("showCursorWhenSelecting",!1),e.signal(_,"vim-mode-change",{mode:"normal"}),_.on("cursorActivity",vme),j(_),e.on(_.getInputField(),"paste",c(_))}function l(_){_.setOption("disableInput",!1),_.off("cursorActivity",vme),e.off(_.getInputField(),"paste",c(_)),_.state.vim=null,X_&&clearTimeout(X_)}function c(_){var $=_.state.vim;return $.onPasteFn||($.onPasteFn=function(){$.insertMode||(_.setCursor(_t(_.getCursor(),0,1)),Me.enterInsertMode(_,{},$))}),$.onPasteFn}var u=/[\d]/,f=[e.isWordChar,function(_){return _&&!e.isWordChar(_)&&!/\s/.test(_)}],d=[function(_){return/\S/.test(_)}],h=["<",">"],p=["-",'"',".",":","_","/","+"],g=/^\w$/,v;try{v=new RegExp("^[\\p{Lu}]$","u")}catch{v=/^[A-Z]$/}function y(_,$){return $>=_.firstLine()&&$<=_.lastLine()}function O(_){return/^[a-z]$/.test(_)}function m(_){return"()[]{}".indexOf(_)!=-1}function w(_){return u.test(_)}function S(_){return v.test(_)}function E(_){return/^\s*$/.test(_)}function C(_){return".?!".indexOf(_)!=-1}function k(_,$){for(var R=0;R<$.length;R++)if($[R]==_)return!0;return!1}var P={};function D(_,$,R,I,Q){if($===void 0&&!Q)throw Error("defaultValue is required unless callback is provided");if(R||(R="string"),P[_]={type:R,defaultValue:$,callback:Q},I)for(var B=0;B<I.length;B++)P[I[B]]=P[_];$&&M(_,$)}function M(_,$,R,I){var Q=P[_];I=I||{};var B=I.scope;if(!Q)return new Error("Unknown option: "+_);if(Q.type=="boolean"){if($&&$!==!0)return new Error("Invalid argument: "+_+"="+$);$!==!1&&($=!0)}Q.callback?(B!=="local"&&Q.callback($,void 0),B!=="global"&&R&&Q.callback($,R)):(B!=="local"&&(Q.value=Q.type=="boolean"?!!$:$),B!=="global"&&R&&(R.state.vim.options[_]={value:$}))}function L(_,$,R){var I=P[_];R=R||{};var Q=R.scope;if(!I)return new Error("Unknown option: "+_);if(I.callback){let B=$&&I.callback(void 0,$);return Q!=="global"&&B!==void 0?B:Q!=="local"?I.callback():void 0}else return(Q!=="global"&&$&&$.state.vim.options[_]||Q!=="local"&&I||{}).value}D("filetype",void 0,"string",["ft"],function(_,$){if($!==void 0)if(_===void 0){let R=$.getOption("mode");return R=="null"?"":R}else{let R=_==""?"null":_;$.setOption("mode",R)}}),D("textwidth",80,"number",["tw"],function(_,$){if($!==void 0)if(_===void 0){var R=$.getOption("textwidth");return R}else{var I=Math.round(_);I>1&&$.setOption("textwidth",I)}});var A=function(){var _=100,$=-1,R=0,I=0,Q=new Array(_);function B(re,he,pe){var $e=$%_,Te=Q[$e];function Se(Ne){var qe=++$%_,Bt=Q[qe];Bt&&Bt.clear(),Q[qe]=re.setBookmark(Ne)}if(Te){var xe=Te.find();xe&&!An(xe,he)&&Se(he)}else Se(he);Se(pe),R=$,I=$-_+1,I<0&&(I=0)}function X(re,he){$+=he,$>R?$=R:$<I&&($=I);var pe=Q[(_+$)%_];if(pe&&!pe.find()){var $e=he>0?1:-1,Te,Se=re.getCursor();do if($+=$e,pe=Q[(_+$)%_],pe&&(Te=pe.find())&&!An(Se,Te))break;while($<R&&$>I)}return pe}function J(re,he){var pe=$,$e=X(re,he);return $=pe,$e&&$e.find()}return{cachedCursor:void 0,add:B,find:J,move:X}},T=function(_){return _?{changes:_.changes,expectCursorActivityForChange:_.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class N{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=T()}exitMacroRecordMode(){var $=z.macroModeState;$.onRecordingDone&&$.onRecordingDone(),$.onRecordingDone=void 0,$.isRecording=!1}enterMacroRecordMode($,R){var I=z.registerController.getRegister(R);if(I){if(I.clear(),this.latestRegister=R,$.openDialog){var Q=Pm("span",{class:"cm-vim-message"},"recording @"+R);this.onRecordingDone=$.openDialog(Q,null,{bottom:!0})}this.isRecording=!0}}}function j(_){return _.state.vim||(_.state.vim={inputState:new te,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{},expectLiteralNext:!1}),_.state.vim}var z;function W(){z={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:A(),macroModeState:new N,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new nt({}),searchHistoryController:new Re,exCommandHistoryController:new Re};for(var _ in P){var $=P[_];$.value=$.defaultValue}}var F,q={enterVimMode:a,leaveVimMode:l,buildKeyMap:function(){},getRegisterController:function(){return z.registerController},resetVimGlobalState_:W,getVimGlobalState_:function(){return z},maybeInitVimState_:j,suppressErrorLogging:!1,InsertModeKey:XB,map:function(_,$,R){Df.map(_,$,R)},unmap:function(_,$){return Df.unmap(_,$)},noremap:function(_,$,R){Df.map(_,$,R,!0)},mapclear:function(_){var $=r.length,R=i,I=r.slice(0,$-R);if(r=r.slice($-R),_)for(var Q=I.length-1;Q>=0;Q--){var B=I[Q];if(_!==B.context)if(B.context)this._mapCommand(B);else{var X=["normal","insert","visual"];for(var J in X)if(X[J]!==_){var re=Object.assign({},B);re.context=X[J],this._mapCommand(re)}}}},langmap:de,vimKeyFromEvent:ae,setOption:M,getOption:L,defineOption:D,defineEx:function(_,$,R){if(!$)$=_;else if(_.indexOf($)!==0)throw new Error('(Vim.defineEx) "'+$+'" is not a prefix of "'+_+'", command not registered');gme[_]=R,Df.commandMap_[$]={name:_,shortName:$,type:"api"}},handleKey:function(_,$,R){var I=this.findKey(_,$,R);if(typeof I=="function")return I()},multiSelectHandleKey:_ct,findKey:function(_,$,R){var I=j(_),Q=_;function B(){var pe=z.macroModeState;if(pe.isRecording){if($=="q")return pe.exitMacroRecordMode(),Ee(Q),!0;R!="mapping"&&Sct(pe,$)}}function X(){if($=="<Esc>"){if(I.visualMode)_i(Q);else if(I.insertMode)Am(Q);else return;return Ee(Q),!0}}function J(){if(X())return!0;I.inputState.keyBuffer.push($);var pe=I.inputState.keyBuffer.join(""),$e=$.length==1,Te=G.matchCommand(pe,r,I.inputState,"insert"),Se=I.inputState.changeQueue;if(Te.type=="none")return Ee(Q),!1;if(Te.type=="partial"){if(Te.expectLiteralNext&&(I.expectLiteralNext=!0),F&&window.clearTimeout(F),F=$e&&window.setTimeout(function(){I.insertMode&&I.inputState.keyBuffer.length&&Ee(Q)},L("insertModeEscKeysTimeout")),$e){var xe=Q.listSelections();(!Se||Se.removed.length!=xe.length)&&(Se=I.inputState.changeQueue=new we),Se.inserted+=$;for(var Ne=0;Ne<xe.length;Ne++){var qe=rr(xe[Ne].anchor,xe[Ne].head),Bt=Ci(xe[Ne].anchor,xe[Ne].head),kt=Q.getRange(qe,Q.state.overwrite?_t(Bt,0,1):Bt);Se.removed[Ne]=(Se.removed[Ne]||"")+kt}}return!$e}if(I.expectLiteralNext=!1,F&&window.clearTimeout(F),Te.command&&Se){for(var xe=Q.listSelections(),Ne=0;Ne<xe.length;Ne++){var Gt=xe[Ne].head;Q.replaceRange(Se.removed[Ne]||"",_t(Gt,0,-Se.inserted.length),Gt,"+input")}z.macroModeState.lastInsertModeChanges.changes.pop()}return Te.command||Ee(Q),Te.command}function re(){if(B()||X())return!0;I.inputState.keyBuffer.push($);var pe=I.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test(pe))return!0;var $e=/^(\d*)(.*)$/.exec(pe);if(!$e)return Ee(Q),!1;var Te=I.visualMode?"visual":"normal",Se=$e[2]||$e[1];I.inputState.operatorShortcut&&I.inputState.operatorShortcut.slice(-1)==Se&&(Se=I.inputState.operatorShortcut);var xe=G.matchCommand(Se,r,I.inputState,Te);return xe.type=="none"?(Ee(Q),!1):xe.type=="partial"?(xe.expectLiteralNext&&(I.expectLiteralNext=!0),!0):xe.type=="clear"?(Ee(Q),!0):(I.expectLiteralNext=!1,I.inputState.keyBuffer.length=0,$e=/^(\d*)(.*)$/.exec(pe),$e&&$e[1]&&$e[1]!="0"&&I.inputState.pushRepeatDigit($e[1]),xe.command)}var he;return I.insertMode?he=J():he=re(),he===!1?!I.insertMode&&$.length===1?function(){return!0}:void 0:he===!0?function(){return!0}:function(){return Q.operation(function(){Q.curOp.isVimOp=!0;try{he.type=="keyToKey"?ee(Q,he.toKeys,he):G.processCommand(Q,I,he)}catch(pe){throw Q.state.vim=void 0,j(Q),q.suppressErrorLogging||console.log(pe),pe}return!0})}},handleEx:function(_,$){Df.processCommand(_,$)},defineMotion:Oe,defineAction:pt,defineOperator:ye,mapCommand:xct,_mapCommand:mme,defineRegister:je,exitVisualMode:_i,exitInsertMode:Am},U=[],V=!1,H;function Z(_){if(_[0]=="<"){var $=_.toLowerCase().slice(1,-1),R=$.split("-");if($=R.pop()||"",$=="lt")_="<";else if($=="space")_=" ";else if($=="cr")_=`
`;else if(ce[$]){var I=H.value,Q={key:ce[$],target:{value:I,selectionEnd:I.length,selectionStart:I.length}};H.onKeyDown&&H.onKeyDown(Q,H.value,X),H&&H.onKeyUp&&H.onKeyUp(Q,H.value,X);return}}if(_==`
`){var B=H;H=null,B.onClose&&B.onClose(B.value)}else H.value=(H.value||"")+_;function X(J){typeof J=="string"?H.value=J:H=null}}function ee(_,$,R){var I=V;if(R){if(U.indexOf(R)!=-1)return;U.push(R),V=R.noremap!=!1}try{for(var Q=j(_),B=/<(?:[CSMA]-)*\w+>|./gi,X;X=B.exec($);){var J=X[0],re=Q.insertMode;if(H){Z(J);continue}var he=q.handleKey(_,J,"mapping");if(!he&&re&&Q.insertMode){if(J[0]=="<"){var pe=J.toLowerCase().slice(1,-1),$e=pe.split("-");if(pe=$e.pop()||"",pe=="lt")J="<";else if(pe=="space")J=" ";else if(pe=="cr")J=`
`;else if(ce.hasOwnProperty(pe)){J=ce[pe],wme(_,J);continue}else J=J[0],B.lastIndex=X.index+1}_.replaceSelection(J)}}}finally{if(U.pop(),V=U.length?I:!1,!U.length&&H){var Te=H;H=null,U_(_,Te)}}}var se={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},fe={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},ce={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(se)).forEach(function(_){ce[(se[_]||"").toLowerCase()]=ce[_.toLowerCase()]=_});function ae(_,$){var B;var R=_.key;if(!fe[R]){R.length>1&&R[0]=="n"&&(R=R.replace("Numpad","")),R=se[R]||R;var I="";if(_.ctrlKey&&(I+="C-"),_.altKey&&(I+="A-"),_.metaKey&&(I+="M-"),e.isMac&&_.altKey&&!_.metaKey&&!_.ctrlKey&&(I=I.slice(2)),(I||R.length>1)&&_.shiftKey&&(I+="S-"),$&&!$.expectLiteralNext&&R.length==1){if(s.keymap&&R in s.keymap)(s.remapCtrl!=!1||!I)&&(R=s.keymap[R]);else if(R.charCodeAt(0)>255){var Q=((B=_.code)==null?void 0:B.slice(-1))||"";_.shiftKey||(Q=Q.toLowerCase()),Q&&(R=Q)}}return I+=R,I.length>1&&(I="<"+I+">"),I}}function de(_,$){s.string!==_&&(s=me(_)),s.remapCtrl=$}function me(_){let $={};if(!_)return{keymap:$,string:""};function R(I){return I.split(/\\?(.)/).filter(Boolean)}return _.split(/((?:[^\\,]|\\.)+),/).map(I=>{if(!I)return;const Q=I.split(/((?:[^\\;]|\\.)+);/);if(Q.length==3){const B=R(Q[1]),X=R(Q[2]);if(B.length!==X.length)return;for(let J=0;J<B.length;++J)$[B[J]]=X[J]}else if(Q.length==1){const B=R(I);if(B.length%2!==0)return;for(let X=0;X<B.length;X+=2)$[B[X]]=B[X+1]}}),{keymap:$,string:_}}D("langmap",void 0,"string",["lmap"],function(_,$){if(_===void 0)return s.string;de(_)});class te{constructor(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null,this.changeQueue=null}pushRepeatDigit($){this.operator?this.motionRepeat=this.motionRepeat.concat($):this.prefixRepeat=this.prefixRepeat.concat($)}getRepeat(){var $=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&($=1,this.prefixRepeat.length>0&&($*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&($*=parseInt(this.motionRepeat.join(""),10))),$}}function Ee(_,$){_.state.vim.inputState=new te,_.state.vim.expectLiteralNext=!1,e.signal(_,"vim-command-done",$)}function we(){this.removed=[],this.inserted=""}class ke{constructor($,R,I){this.clear(),this.keyBuffer=[$||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!R,this.blockwise=!!I}setText($,R,I){this.keyBuffer=[$||""],this.linewise=!!R,this.blockwise=!!I}pushText($,R){R&&(this.linewise||this.keyBuffer.push(`
`),this.linewise=!0),this.keyBuffer.push($)}pushInsertModeChanges($){this.insertModeChanges.push(T($))}pushSearchQuery($){this.searchQueries.push($)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join("")}}function je(_,$){var R=z.registerController.registers;if(!_||_.length!=1)throw Error("Register name must be 1 character");if(R[_])throw Error("Register already defined "+_);R[_]=$,p.push(_)}class nt{constructor($){this.registers=$,this.unnamedRegister=$['"']=new ke,$["."]=new ke,$[":"]=new ke,$["/"]=new ke,$["+"]=new ke}pushText($,R,I,Q,B){if($!=="_"){Q&&I.charAt(I.length-1)!==`
`&&(I+=`
`);var X=this.isValidRegister($)?this.getRegister($):null;if(!X){switch(R){case"yank":this.registers[0]=new ke(I,Q,B);break;case"delete":case"change":I.indexOf(`
`)==-1?this.registers["-"]=new ke(I,Q):(this.shiftNumericRegisters_(),this.registers[1]=new ke(I,Q));break}this.unnamedRegister.setText(I,Q,B);return}var J=S($);J?X.pushText(I,Q):X.setText(I,Q,B),$==="+"&&navigator.clipboard.writeText(I),this.unnamedRegister.setText(X.toString(),Q)}}getRegister($){return this.isValidRegister($)?($=$.toLowerCase(),this.registers[$]||(this.registers[$]=new ke),this.registers[$]):this.unnamedRegister}isValidRegister($){return $&&(k($,p)||g.test($))}shiftNumericRegisters_(){for(var $=9;$>=2;$--)this.registers[$]=this.getRegister(""+($-1))}}class Re{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch($,R){var I=this.historyBuffer,Q=R?-1:1;this.initialPrefix===null&&(this.initialPrefix=$);for(var B=this.iterator+Q;R?B>=0:B<I.length;B+=Q)for(var X=I[B],J=0;J<=X.length;J++)if(this.initialPrefix==X.substring(0,J))return this.iterator=B,X;if(B>=I.length)return this.iterator=I.length,this.initialPrefix;if(B<0)return $}pushInput($){var R=this.historyBuffer.indexOf($);R>-1&&this.historyBuffer.splice(R,1),$.length&&this.historyBuffer.push($)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var G={matchCommand:function(_,$,R,I){var Q=yn(_,$,I,R);if(!Q.full&&!Q.partial)return{type:"none"};if(!Q.full&&Q.partial)return{type:"partial",expectLiteralNext:Q.partial.length==1&&Q.partial[0].keys.slice(-11)=="<character>"};for(var B,X=0;X<Q.full.length;X++){var J=Q.full[X];B||(B=J)}if(B.keys.slice(-11)=="<character>"||B.keys.slice(-10)=="<register>"){var re=ri(_);if(!re||re.length>1)return{type:"clear"};R.selectedCharacter=re}return{type:"full",command:B}},processCommand:function(_,$,R){switch($.inputState.repeatOverride=R.repeatOverride,R.type){case"motion":this.processMotion(_,$,R);break;case"operator":this.processOperator(_,$,R);break;case"operatorMotion":this.processOperatorMotion(_,$,R);break;case"action":this.processAction(_,$,R);break;case"search":this.processSearch(_,$,R);break;case"ex":case"keyToEx":this.processEx(_,$,R);break}},processMotion:function(_,$,R){$.inputState.motion=R.motion,$.inputState.motionArgs=ht(R.motionArgs),this.evalInput(_,$)},processOperator:function(_,$,R){var I=$.inputState;if(I.operator)if(I.operator==R.operator){I.motion="expandToLine",I.motionArgs={linewise:!0,repeat:1},this.evalInput(_,$);return}else Ee(_);I.operator=R.operator,I.operatorArgs=ht(R.operatorArgs),R.keys.length>1&&(I.operatorShortcut=R.keys),R.exitVisualBlock&&($.visualBlock=!1,Do(_)),$.visualMode&&this.evalInput(_,$)},processOperatorMotion:function(_,$,R){var I=$.visualMode,Q=ht(R.operatorMotionArgs);Q&&I&&Q.visualLine&&($.visualLine=!0),this.processOperator(_,$,R),I||this.processMotion(_,$,R)},processAction:function(_,$,R){var I=$.inputState,Q=I.getRepeat(),B=!!Q,X=ht(R.actionArgs)||{repeat:1};I.selectedCharacter&&(X.selectedCharacter=I.selectedCharacter),R.operator&&this.processOperator(_,$,R),R.motion&&this.processMotion(_,$,R),(R.motion||R.operator)&&this.evalInput(_,$),X.repeat=Q||1,X.repeatIsExplicit=B,X.registerName=I.registerName,Ee(_),$.lastMotion=null,R.isEdit&&this.recordLastEdit($,I,R),Me[R.action](_,X,$)},processSearch:function(_,$,R){if(!_.getSearchCursor)return;var I=R.searchArgs.forward,Q=R.searchArgs.wholeWordOnly;Rf(_).setReversed(!I);var B=I?"/":"?",X=Rf(_).getQuery(),J=_.getScrollInfo();function re(Ne,qe,Bt){z.searchHistoryController.pushInput(Ne),z.searchHistoryController.reset();try{H_(_,Ne,qe,Bt)}catch{Dr(_,"Invalid regex: "+Ne),Ee(_);return}G.processMotion(_,$,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:R.searchArgs.toJumplist}})}function he(Ne){_.scrollTo(J.left,J.top),re(Ne,!0,!0);var qe=z.macroModeState;qe.isRecording&&Cct(qe,Ne)}function pe(Ne,qe,Bt){var kt=ae(Ne),Gt,Mr;kt=="<Up>"||kt=="<Down>"?(Gt=kt=="<Up>",Mr=Ne.target?Ne.target.selectionEnd:0,qe=z.searchHistoryController.nextMatch(qe,Gt)||"",Bt(qe),Mr&&Ne.target&&(Ne.target.selectionEnd=Ne.target.selectionStart=Math.min(Mr,Ne.target.value.length))):kt&&kt!="<Left>"&&kt!="<Right>"&&z.searchHistoryController.reset();var na;try{na=H_(_,qe,!0,!0)}catch{}na?_.scrollIntoView(hme(_,!I,na),30):(UB(_),_.scrollTo(J.left,J.top))}function $e(Ne,qe,Bt){var kt=ae(Ne);kt=="<Esc>"||kt=="<C-c>"||kt=="<C-[>"||kt=="<BS>"&&qe==""?(z.searchHistoryController.pushInput(qe),z.searchHistoryController.reset(),H_(_,X),UB(_),_.scrollTo(J.left,J.top),e.e_stop(Ne),Ee(_),Bt(),_.focus()):kt=="<Up>"||kt=="<Down>"?e.e_stop(Ne):kt=="<C-u>"&&(e.e_stop(Ne),Bt(""))}switch(R.searchArgs.querySrc){case"prompt":var Te=z.macroModeState;if(Te.isPlaying){let qe=Te.replaySearchQueries.shift();re(qe,!0,!1)}else U_(_,{onClose:he,prefix:B,desc:"(JavaScript regexp)",onKeyUp:pe,onKeyDown:$e});break;case"wordUnderCursor":var Se=Tt(_,{noSymbol:!0}),xe=!0;if(Se||(Se=Tt(_,{noSymbol:!1}),xe=!1),!Se){Dr(_,"No word under cursor"),Ee(_);return}let Ne=_.getLine(Se.start.line).substring(Se.start.ch,Se.end.ch);xe&&Q?Ne="\\b"+Ne+"\\b":Ne=Rr(Ne),z.jumpList.cachedCursor=_.getCursor(),_.setCursor(Se.start),re(Ne,!0,!1);break}},processEx:function(_,$,R){function I(B){z.exCommandHistoryController.pushInput(B),z.exCommandHistoryController.reset(),Df.processCommand(_,B),_.state.vim&&Ee(_)}function Q(B,X,J){var re=ae(B),he,pe;(re=="<Esc>"||re=="<C-c>"||re=="<C-[>"||re=="<BS>"&&X=="")&&(z.exCommandHistoryController.pushInput(X),z.exCommandHistoryController.reset(),e.e_stop(B),Ee(_),J(),_.focus()),re=="<Up>"||re=="<Down>"?(e.e_stop(B),he=re=="<Up>",pe=B.target?B.target.selectionEnd:0,X=z.exCommandHistoryController.nextMatch(X,he)||"",J(X),pe&&B.target&&(B.target.selectionEnd=B.target.selectionStart=Math.min(pe,B.target.value.length))):re=="<C-u>"?(e.e_stop(B),J("")):re&&re!="<Left>"&&re!="<Right>"&&z.exCommandHistoryController.reset()}R.type=="keyToEx"?Df.processCommand(_,R.exArgs.input):$.visualMode?U_(_,{onClose:I,prefix:":",value:"'<,'>",onKeyDown:Q,selectValueOnOpen:!1}):U_(_,{onClose:I,prefix:":",onKeyDown:Q})},evalInput:function(_,$){var R=$.inputState,I=R.motion,Q=R.motionArgs||{repeat:1},B=R.operator,X=R.operatorArgs||{},J=R.registerName,re=$.sel,he=Qt($.visualMode?at(_,re.head):_.getCursor("head")),pe=Qt($.visualMode?at(_,re.anchor):_.getCursor("anchor")),$e=Qt(he),Te=Qt(pe),Se,xe,Ne;if(B&&this.recordLastEdit($,R),R.repeatOverride!==void 0?Ne=R.repeatOverride:Ne=R.getRepeat(),Ne>0&&Q.explicitRepeat?Q.repeatIsExplicit=!0:(Q.noRepeat||!Q.explicitRepeat&&Ne===0)&&(Ne=1,Q.repeatIsExplicit=!1),R.selectedCharacter&&(Q.selectedCharacter=X.selectedCharacter=R.selectedCharacter),Q.repeat=Ne,Ee(_),I){var qe=le[I](_,he,Q,$,R);if($.lastMotion=le[I],!qe)return;if(Q.toJumplist){var Bt=z.jumpList,kt=Bt.cachedCursor;kt?(Be(_,kt,qe),delete Bt.cachedCursor):Be(_,he,qe)}qe instanceof Array?(xe=qe[0],Se=qe[1]):Se=qe,Se||(Se=Qt(he)),$.visualMode?($.visualBlock&&Se.ch===1/0||(Se=at(_,Se,$e)),xe&&(xe=at(_,xe)),xe=xe||Te,re.anchor=xe,re.head=Se,Do(_),ar(_,$,"<",Ht(xe,Se)?xe:Se),ar(_,$,">",Ht(xe,Se)?Se:xe)):B||(Se=at(_,Se,$e),_.setCursor(Se.line,Se.ch))}if(B){if(X.lastSel){xe=Te;var Gt=X.lastSel,Mr=Math.abs(Gt.head.line-Gt.anchor.line),na=Math.abs(Gt.head.ch-Gt.anchor.ch);Gt.visualLine?Se=new t(Te.line+Mr,Te.ch):Gt.visualBlock?Se=new t(Te.line+Mr,Te.ch+na):Gt.head.line==Gt.anchor.line?Se=new t(Te.line,Te.ch+na):Se=new t(Te.line+Mr,Te.ch),$.visualMode=!0,$.visualLine=Gt.visualLine,$.visualBlock=Gt.visualBlock,re=$.sel={anchor:xe,head:Se},Do(_)}else $.visualMode&&(X.lastSel={anchor:Qt(re.anchor),head:Qt(re.head),visualBlock:$.visualBlock,visualLine:$.visualLine});var No,Ss,Fn,qn,Ha;if($.visualMode){No=rr(re.head,re.anchor),Ss=Ci(re.head,re.anchor),Fn=$.visualLine||X.linewise,qn=$.visualBlock?"block":Fn?"line":"char";var Es=n(_,No,Ss);if(Ha=ta(_,{anchor:Es.start,head:Es.end},qn),Fn){var es=Ha.ranges;if(qn=="block")for(var Yd=0;Yd<es.length;Yd++)es[Yd].head.ch=Ar(_,es[Yd].head.line);else qn=="line"&&(es[0].head=new t(es[0].head.line+1,0))}}else{if(No=Qt(xe||Te),Ss=Qt(Se||$e),Ht(Ss,No)){var YB=No;No=Ss,Ss=YB}Fn=Q.linewise||X.linewise,Fn?ir(_,No,Ss):Q.forward&&ne(_,No,Ss),qn="char";var kct=!Q.inclusive||Fn,Es=n(_,No,Ss);Ha=ta(_,{anchor:Es.start,head:Es.end},qn,kct)}_.setSelections(Ha.ranges,Ha.primary),$.lastMotion=null,X.repeat=Ne,X.registerName=J,X.linewise=Fn;var GB=Fe[B](_,X,Ha.ranges,Te,Se);$.visualMode&&_i(_,GB!=null),GB&&_.setCursor(GB)}},recordLastEdit:function(_,$,R){var I=z.macroModeState;I.isPlaying||(_.lastEditInputState=$,_.lastEditActionCommand=R,I.lastInsertModeChanges.changes=[],I.lastInsertModeChanges.expectCursorActivityForChange=!1,I.lastInsertModeChanges.visualBlock=_.visualBlock?_.sel.head.line-_.sel.anchor.line:0)}},le={moveToTopLine:function(_,$,R){var I=HB(_).top+R.repeat-1;return new t(I,cn(_.getLine(I)))},moveToMiddleLine:function(_){var $=HB(_),R=Math.floor(($.top+$.bottom)*.5);return new t(R,cn(_.getLine(R)))},moveToBottomLine:function(_,$,R){var I=HB(_).bottom-R.repeat+1;return new t(I,cn(_.getLine(I)))},expandToLine:function(_,$,R){var I=$;return new t(I.line+R.repeat-1,1/0)},findNext:function(_,$,R){var I=Rf(_),Q=I.getQuery();if(Q){var B=!R.forward;return B=I.isReversed()?!B:B,dme(_,Q),hme(_,B,Q,R.repeat)}},findAndSelectNextInclusive:function(_,$,R,I,Q){var B=Rf(_),X=B.getQuery();if(X){var J=!R.forward;J=B.isReversed()?!J:J;var re=yct(_,J,X,R.repeat,I);if(re){if(Q.operator)return re;var he=re[0],pe=new t(re[1].line,re[1].ch-1);if(I.visualMode){(I.visualLine||I.visualBlock)&&(I.visualLine=!1,I.visualBlock=!1,e.signal(_,"vim-mode-change",{mode:"visual",subMode:""}));var $e=I.sel.anchor;if($e)return B.isReversed()?R.forward?[$e,he]:[$e,pe]:R.forward?[$e,pe]:[$e,he]}else I.visualMode=!0,I.visualLine=!1,I.visualBlock=!1,e.signal(_,"vim-mode-change",{mode:"visual",subMode:""});return J?[pe,he]:[he,pe]}}},goToMark:function(_,$,R,I){var Q=dM(_,I,R.selectedCharacter||"");return Q?R.linewise?{line:Q.line,ch:cn(_.getLine(Q.line))}:Q:null},moveToOtherHighlightedEnd:function(_,$,R,I){if(I.visualBlock&&R.sameLine){var Q=I.sel;return[at(_,new t(Q.anchor.line,Q.head.ch)),at(_,new t(Q.head.line,Q.anchor.ch))]}else return[I.sel.head,I.sel.anchor]},jumpToMark:function(_,$,R,I){for(var Q=$,B=0;B<R.repeat;B++){var X=Q;for(var J in I.marks)if(O(J)){var re=I.marks[J].find(),he=R.forward?Ht(re,X):Ht(X,re);if(!he&&!(R.linewise&&re.line==X.line)){var pe=An(X,Q),$e=R.forward?xs(X,re,Q):xs(Q,re,X);(pe||$e)&&(Q=re)}}}return R.linewise&&(Q=new t(Q.line,cn(_.getLine(Q.line)))),Q},moveByCharacters:function(_,$,R){var I=$,Q=R.repeat,B=R.forward?I.ch+Q:I.ch-Q;return new t(I.line,B)},moveByLines:function(_,$,R,I){var Q=$,B=Q.ch;switch(I.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:B=I.lastHPos;break;default:I.lastHPos=B}var X=R.repeat+(R.repeatOffset||0),J=R.forward?Q.line+X:Q.line-X,re=_.firstLine(),he=_.lastLine(),pe=_.findPosV(Q,R.forward?X:-X,"line",I.lastHSPos),$e=R.forward?pe.line>J:pe.line<J;return $e&&(J=pe.line,B=pe.ch),J<re&&Q.line==re?this.moveToStartOfLine(_,$,R,I):J>he&&Q.line==he?xn(_,$,R,I,!0):(R.toFirstChar&&(B=cn(_.getLine(J)),I.lastHPos=B),I.lastHSPos=_.charCoords(new t(J,B),"div").left,new t(J,B))},moveByDisplayLines:function(_,$,R,I){var Q=$;switch(I.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:I.lastHSPos=_.charCoords(Q,"div").left}var B=R.repeat,X=_.findPosV(Q,R.forward?B:-B,"line",I.lastHSPos);if(X.hitSide)if(R.forward){var J=_.charCoords(X,"div"),re={top:J.top+8,left:I.lastHSPos};X=_.coordsChar(re,"div")}else{var he=_.charCoords(new t(_.firstLine(),0),"div");he.left=I.lastHSPos,X=_.coordsChar(he,"div")}return I.lastHPos=X.ch,X},moveByPage:function(_,$,R){var I=$,Q=R.repeat;return _.findPosV(I,R.forward?Q:-Q,"page")},moveByParagraph:function(_,$,R){var I=R.forward?1:-1;return Ua(_,$,R.repeat,I).start},moveBySentence:function(_,$,R){var I=R.forward?1:-1;return qB(_,$,R.repeat,I)},moveByScroll:function(_,$,R,I){var Q=_.getScrollInfo(),B=null,X=R.repeat;X||(X=Q.clientHeight/(2*_.defaultTextHeight()));var J=_.charCoords($,"local");if(R.repeat=X,B=le.moveByDisplayLines(_,$,R,I),!B)return null;var re=_.charCoords(B,"local");return _.scrollTo(null,Q.top+re.top-J.top),B},moveByWords:function(_,$,R){return Ur(_,$,R.repeat,!!R.forward,!!R.wordEnd,!!R.bigWord)},moveTillCharacter:function(_,$,R){var I=R.repeat,Q=br(_,I,R.forward,R.selectedCharacter,$),B=R.forward?-1:1;return it(B,R),Q?(Q.ch+=B,Q):null},moveToCharacter:function(_,$,R){var I=R.repeat;return it(0,R),br(_,I,R.forward,R.selectedCharacter,$)||$},moveToSymbol:function(_,$,R){var I=R.repeat;return R.selectedCharacter&&or(_,I,R.forward,R.selectedCharacter)||$},moveToColumn:function(_,$,R,I){var Q=R.repeat;return I.lastHPos=Q-1,I.lastHSPos=_.charCoords($,"div").left,Wn(_,Q)},moveToEol:function(_,$,R,I){return xn(_,$,R,I,!1)},moveToFirstNonWhiteSpaceCharacter:function(_,$){var R=$;return new t(R.line,cn(_.getLine(R.line)))},moveToMatchedSymbol:function(_,$){for(var R=$,I=R.line,Q=R.ch,B=_.getLine(I),X;Q<B.length;Q++)if(X=B.charAt(Q),X&&m(X)){var J=_.getTokenTypeAt(new t(I,Q+1));if(J!=="string"&&J!=="comment")break}if(Q<B.length){var re=X==="<"||X===">"?/[(){}[\]<>]/:/[(){}[\]]/,he=_.findMatchingBracket(new t(I,Q),{bracketRegex:re});return he.to}else return R},moveToStartOfLine:function(_,$){return new t($.line,0)},moveToLineOrEdgeOfDocument:function(_,$,R){var I=R.forward?_.lastLine():_.firstLine();return R.repeatIsExplicit&&(I=R.repeat-_.getOption("firstLineNumber")),new t(I,cn(_.getLine(I)))},moveToStartOfDisplayLine:function(_){return _.execCommand("goLineLeft"),_.getCursor()},moveToEndOfDisplayLine:function(_){_.execCommand("goLineRight");var $=_.getCursor();return $.sticky=="before"&&$.ch--,$},textObjectManipulation:function(_,$,R,I){var Q={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},B={"'":!0,'"':!0,"`":!0},X=R.selectedCharacter||"";X=="b"?X="(":X=="B"&&(X="{");var J=!R.textObjectInner,re,he;if(Q[X]){if(he=!0,re=fM(_,$,X,J),!re){var pe=_.getSearchCursor(new RegExp("\\"+X,"g"),$);pe.find()&&(re=fM(_,pe.from(),X,J))}}else if(B[X])he=!0,re=VB(_,$,X,J);else if(X==="W"||X==="w")for(var $e=R.repeat||1;$e-- >0;){var Te=Tt(_,{inclusive:J,innerWord:!J,bigWord:X==="W",noSymbol:X==="W",multiline:!0},re&&re.end);Te&&(re||(re=Te),re.end=Te.end)}else if(X==="p")if(re=Ua(_,$,R.repeat,0,J),R.linewise=!0,I.visualMode)I.visualLine||(I.visualLine=!0);else{var Se=I.inputState.operatorArgs;Se&&(Se.linewise=!0),re.end.line--}else if(X==="t")re=ue(_,$,J);else if(X==="s"){var xe=_.getLine($.line);$.ch>0&&C(xe[$.ch])&&($.ch-=1);var Ne=qv(_,$,R.repeat,1,J),qe=qv(_,$,R.repeat,-1,J);E(_.getLine(qe.line)[qe.ch])&&E(_.getLine(Ne.line)[Ne.ch-1])&&(qe={line:qe.line,ch:qe.ch+1}),re={start:qe,end:Ne}}return re?_.state.vim.visualMode?pi(_,re.start,re.end,he):[re.start,re.end]:null},repeatLastCharacterSearch:function(_,$,R){var I=z.lastCharacterSearch,Q=R.repeat,B=R.forward===I.forward,X=(I.increment?1:0)*(B?-1:1);_.moveH(-X,"char"),R.inclusive=!!B;var J=br(_,Q,B,I.selectedCharacter);return J?(J.ch+=X,J):(_.moveH(X,"char"),$)}};function Oe(_,$){le[_]=$}function Ue(_,$){for(var R=[],I=0;I<$;I++)R.push(_);return R}var Fe={change:function(_,$,R){var I,Q,B=_.state.vim,X=R[0].anchor,J=R[0].head;if(B.visualMode)if($.fullLine)J.ch=Number.MAX_VALUE,J.line--,_.setSelection(X,J),Q=_.getSelection(),_.replaceSelection(""),I=X;else{Q=_.getSelection();var pe=Ue("",R.length);_.replaceSelections(pe),I=rr(R[0].head,R[0].anchor)}else{Q=_.getRange(X,J);var re=B.lastEditInputState;if((re==null?void 0:re.motion)=="moveByWords"&&!E(Q)){var he=/\s+$/.exec(Q);he&&re.motionArgs&&re.motionArgs.forward&&(J=_t(J,0,-he[0].length),Q=Q.slice(0,-he[0].length))}$.linewise&&(X=new t(X.line,cn(_.getLine(X.line))),J.line>X.line&&(J=new t(J.line-1,Number.MAX_VALUE))),_.replaceRange("",X,J),I=X}z.registerController.pushText($.registerName,"change",Q,$.linewise,R.length>1),Me.enterInsertMode(_,{head:I},_.state.vim)},delete:function(_,$,R){var I,Q,B=_.state.vim;if(B.visualBlock){Q=_.getSelection();var re=Ue("",R.length);_.replaceSelections(re),I=rr(R[0].head,R[0].anchor)}else{var X=R[0].anchor,J=R[0].head;$.linewise&&J.line!=_.firstLine()&&X.line==_.lastLine()&&X.line==J.line-1&&(X.line==_.firstLine()?X.ch=0:X=new t(X.line-1,Ar(_,X.line-1))),Q=_.getRange(X,J),_.replaceRange("",X,J),I=X,$.linewise&&(I=le.moveToFirstNonWhiteSpaceCharacter(_,X))}return z.registerController.pushText($.registerName,"delete",Q,$.linewise,B.visualBlock),at(_,I)},indent:function(_,$,R){var I=_.state.vim,Q=I.visualMode?$.repeat||0:1;if(_.indentMore)for(var B=0;B<Q;B++)$.indentRight?_.indentMore():_.indentLess();else{var X=R[0].anchor.line,J=I.visualBlock?R[R.length-1].anchor.line:R[0].head.line;$.linewise&&J--;for(var re=X;re<=J;re++)for(var B=0;B<Q;B++)_.indentLine(re,$.indentRight)}return le.moveToFirstNonWhiteSpaceCharacter(_,R[0].anchor)},indentAuto:function(_,$,R){return _.execCommand("indentAuto"),le.moveToFirstNonWhiteSpaceCharacter(_,R[0].anchor)},hardWrap:function(_,$,R,I){if(_.hardWrap){var Q=R[0].anchor.line,B=R[0].head.line;$.linewise&&B--;var X=_.hardWrap({from:Q,to:B});return X>Q&&$.linewise&&X--,$.keepCursor?I:new t(X,0)}},changeCase:function(_,$,R,I,Q){for(var B=_.getSelections(),X=[],J=$.toLower,re=0;re<B.length;re++){var he=B[re],pe="";if(J===!0)pe=he.toLowerCase();else if(J===!1)pe=he.toUpperCase();else for(var $e=0;$e<he.length;$e++){var Te=he.charAt($e);pe+=S(Te)?Te.toLowerCase():Te.toUpperCase()}X.push(pe)}return _.replaceSelections(X),$.shouldMoveCursor?Q:!_.state.vim.visualMode&&$.linewise&&R[0].anchor.line+1==R[0].head.line?le.moveToFirstNonWhiteSpaceCharacter(_,I):$.linewise?I:rr(R[0].anchor,R[0].head)},yank:function(_,$,R,I){var Q=_.state.vim,B=_.getSelection(),X=Q.visualMode?rr(Q.sel.anchor,Q.sel.head,R[0].head,R[0].anchor):I;return z.registerController.pushText($.registerName,"yank",B,$.linewise,Q.visualBlock),X}};function ye(_,$){Fe[_]=$}var Me={jumpListWalk:function(_,$,R){if(!R.visualMode){var I=$.repeat||1,Q=$.forward,B=z.jumpList,X=B.move(_,Q?I:-I),J=X?X.find():void 0;J=J||_.getCursor(),_.setCursor(J)}},scroll:function(_,$,R){if(!R.visualMode){var I=$.repeat||1,Q=_.defaultTextHeight(),B=_.getScrollInfo().top,X=Q*I,J=$.forward?B+X:B-X,re=Qt(_.getCursor()),he=_.charCoords(re,"local");if($.forward)J>he.top?(re.line+=(J-he.top)/Q,re.line=Math.ceil(re.line),_.setCursor(re),he=_.charCoords(re,"local"),_.scrollTo(null,he.top)):_.scrollTo(null,J);else{var pe=J+_.getScrollInfo().clientHeight;pe<he.bottom?(re.line-=(he.bottom-pe)/Q,re.line=Math.floor(re.line),_.setCursor(re),he=_.charCoords(re,"local"),_.scrollTo(null,he.bottom-_.getScrollInfo().clientHeight)):_.scrollTo(null,J)}}},scrollToCursor:function(_,$){var R=_.getCursor().line,I=_.charCoords(new t(R,0),"local"),Q=_.getScrollInfo().clientHeight,B=I.top;switch($.position){case"center":B=I.bottom-Q/2;break;case"bottom":var X=new t(R,_.getLine(R).length-1),J=_.charCoords(X,"local"),re=J.bottom-B;B=B-Q+re;break}_.scrollTo(null,B)},replayMacro:function(_,$,R){var I=$.selectedCharacter||"",Q=$.repeat||1,B=z.macroModeState;for(I=="@"?I=B.latestRegister:B.latestRegister=I;Q--;)wct(_,R,B,I)},enterMacroRecordMode:function(_,$){var R=z.macroModeState,I=$.selectedCharacter;z.registerController.isValidRegister(I)&&R.enterMacroRecordMode(_,I)},toggleOverwrite:function(_){_.state.overwrite?(_.toggleOverwrite(!1),_.setOption("keyMap","vim-insert"),e.signal(_,"vim-mode-change",{mode:"insert"})):(_.toggleOverwrite(!0),_.setOption("keyMap","vim-replace"),e.signal(_,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(_,$,R){if(!_.getOption("readOnly")){R.insertMode=!0,R.insertModeRepeat=$&&$.repeat||1;var I=$?$.insertAt:null,Q=R.sel,B=$.head||_.getCursor("head"),X=_.listSelections().length;if(I=="eol")B=new t(B.line,Ar(_,B.line));else if(I=="bol")B=new t(B.line,0);else if(I=="charAfter"){var J=n(_,B,_t(B,0,1));B=J.end}else if(I=="firstNonBlank"){var J=n(_,B,le.moveToFirstNonWhiteSpaceCharacter(_,B));B=J.end}else if(I=="startOfSelectedArea"){if(!R.visualMode)return;R.visualBlock?(B=new t(Math.min(Q.head.line,Q.anchor.line),Math.min(Q.head.ch,Q.anchor.ch)),X=Math.abs(Q.head.line-Q.anchor.line)+1):Q.head.line<Q.anchor.line?B=Q.head:B=new t(Q.anchor.line,0)}else if(I=="endOfSelectedArea"){if(!R.visualMode)return;R.visualBlock?(B=new t(Math.min(Q.head.line,Q.anchor.line),Math.max(Q.head.ch,Q.anchor.ch)+1),X=Math.abs(Q.head.line-Q.anchor.line)+1):Q.head.line>=Q.anchor.line?B=_t(Q.head,0,1):B=new t(Q.anchor.line,0)}else if(I=="inplace"){if(R.visualMode)return}else I=="lastEdit"&&(B=pme(_)||B);_.setOption("disableInput",!1),$&&$.replace?(_.toggleOverwrite(!0),_.setOption("keyMap","vim-replace"),e.signal(_,"vim-mode-change",{mode:"replace"})):(_.toggleOverwrite(!1),_.setOption("keyMap","vim-insert"),e.signal(_,"vim-mode-change",{mode:"insert"})),z.macroModeState.isPlaying||(_.on("change",yme),R.insertEnd&&R.insertEnd.clear(),R.insertEnd=_.setBookmark(B,{insertLeft:!0}),e.on(_.getInputField(),"keydown",Ome)),R.visualMode&&_i(_),Li(_,B,X)}},toggleVisualMode:function(_,$,R){var I=$.repeat,Q=_.getCursor(),B;if(R.visualMode)R.visualLine!=!!$.linewise||R.visualBlock!=!!$.blockwise?(R.visualLine=!!$.linewise,R.visualBlock=!!$.blockwise,e.signal(_,"vim-mode-change",{mode:"visual",subMode:R.visualLine?"linewise":R.visualBlock?"blockwise":""}),Do(_)):_i(_);else{R.visualMode=!0,R.visualLine=!!$.linewise,R.visualBlock=!!$.blockwise,B=at(_,new t(Q.line,Q.ch+I-1));var X=n(_,Q,B);R.sel={anchor:X.start,head:X.end},e.signal(_,"vim-mode-change",{mode:"visual",subMode:R.visualLine?"linewise":R.visualBlock?"blockwise":""}),Do(_),ar(_,R,"<",rr(Q,B)),ar(_,R,">",Ci(Q,B))}},reselectLastSelection:function(_,$,R){var I=R.lastSelection;if(R.visualMode&&eo(_,R),I){var Q=I.anchorMark.find(),B=I.headMark.find();if(!Q||!B)return;R.sel={anchor:Q,head:B},R.visualMode=!0,R.visualLine=I.visualLine,R.visualBlock=I.visualBlock,Do(_),ar(_,R,"<",rr(Q,B)),ar(_,R,">",Ci(Q,B)),e.signal(_,"vim-mode-change",{mode:"visual",subMode:R.visualLine?"linewise":R.visualBlock?"blockwise":""})}},joinLines:function(_,$,R){var I,Q;if(R.visualMode){if(I=_.getCursor("anchor"),Q=_.getCursor("head"),Ht(Q,I)){var B=Q;Q=I,I=B}Q.ch=Ar(_,Q.line)-1}else{var X=Math.max($.repeat,2);I=_.getCursor(),Q=at(_,new t(I.line+X-1,1/0))}for(var J=0,re=I.line;re<Q.line;re++){J=Ar(_,I.line);var he="",pe=0;if(!$.keepSpaces){var $e=_.getLine(I.line+1);pe=$e.search(/\S/),pe==-1?pe=$e.length:he=" "}_.replaceRange(he,new t(I.line,J),new t(I.line+1,pe))}var Te=at(_,new t(I.line,J));R.visualMode&&_i(_,!1),_.setCursor(Te)},newLineAndEnterInsertMode:function(_,$,R){R.insertMode=!0;var I=Qt(_.getCursor());if(I.line===_.firstLine()&&!$.after)_.replaceRange(`
`,new t(_.firstLine(),0)),_.setCursor(_.firstLine(),0);else{I.line=$.after?I.line:I.line-1,I.ch=Ar(_,I.line),_.setCursor(I);var Q=e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent;Q(_)}this.enterInsertMode(_,{repeat:$.repeat},R)},paste:function(_,$,R){var I=z.registerController.getRegister($.registerName);if($.registerName==="+")navigator.clipboard.readText().then(B=>{this.continuePaste(_,$,R,B,I)});else{var Q=I.toString();this.continuePaste(_,$,R,Q,I)}},continuePaste:function(_,$,R,I,Q){var B=Qt(_.getCursor());if(I){if($.matchIndent){var X=_.getOption("tabSize"),J=function(Es){var es=Es.split("	").length-1,Yd=Es.split(" ").length-1;return es*X+Yd*1},re=_.getLine(_.getCursor().line),he=J(re.match(/^\s*/)[0]),pe=I.replace(/\n$/,""),$e=I!==pe,Te=J(I.match(/^\s*/)[0]),I=pe.replace(/^\s*/gm,function(Es){var es=he+(J(Es)-Te);if(es<0)return"";if(_.getOption("indentWithTabs")){var Yd=Math.floor(es/X);return Array(Yd+1).join("	")}else return Array(es+1).join(" ")});I+=$e?`
`:""}if($.repeat>1)var I=Array($.repeat+1).join(I);var Se=Q.linewise,xe=Q.blockwise;if(xe){I=I.split(`
`),Se&&I.pop();for(var Ne=0;Ne<I.length;Ne++)I[Ne]=I[Ne]==""?" ":I[Ne];B.ch+=$.after?1:0,B.ch=Math.min(Ar(_,B.line),B.ch)}else Se?R.visualMode?I=R.visualLine?I.slice(0,-1):`
`+I.slice(0,I.length-1)+`
`:$.after?(I=`
`+I.slice(0,I.length-1),B.ch=Ar(_,B.line)):B.ch=0:B.ch+=$.after?1:0;var qe;if(R.visualMode){R.lastPastedText=I;var Bt,kt=Ro(_,R),Gt=kt[0],Mr=kt[1],na=_.getSelection(),No=_.listSelections(),Ss=new Array(No.length).join("1").split("1");R.lastSelection&&(Bt=R.lastSelection.headMark.find()),z.registerController.unnamedRegister.setText(na),xe?(_.replaceSelections(Ss),Mr=new t(Gt.line+I.length-1,Gt.ch),_.setCursor(Gt),Ji(_,Mr),_.replaceSelections(I),qe=Gt):R.visualBlock?(_.replaceSelections(Ss),_.setCursor(Gt),_.replaceRange(I,Gt,Gt),qe=Gt):(_.replaceRange(I,Gt,Mr),qe=_.posFromIndex(_.indexFromPos(Gt)+I.length-1)),Bt&&(R.lastSelection.headMark=_.setBookmark(Bt)),Se&&(qe.ch=0)}else if(xe){_.setCursor(B);for(var Ne=0;Ne<I.length;Ne++){var Fn=B.line+Ne;Fn>_.lastLine()&&_.replaceRange(`
`,new t(Fn,0));var qn=Ar(_,Fn);qn<B.ch&&Ii(_,Fn,B.ch)}_.setCursor(B),Ji(_,new t(B.line+I.length-1,B.ch)),_.replaceSelections(I),qe=B}else if(_.replaceRange(I,B),Se){var Fn=$.after?B.line+1:B.line;qe=new t(Fn,cn(_.getLine(Fn)))}else qe=Qt(B),/\n/.test(I)||(qe.ch+=I.length-($.after?1:0));R.visualMode&&_i(_,!1),_.setCursor(qe)}},undo:function(_,$){_.operation(function(){hi(_,e.commands.undo,$.repeat)(),_.setCursor(at(_,_.getCursor("start")))})},redo:function(_,$){hi(_,e.commands.redo,$.repeat)()},setRegister:function(_,$,R){R.inputState.registerName=$.selectedCharacter},insertRegister:function(_,$,R){var I=$.selectedCharacter,Q=z.registerController.getRegister(I),B=Q&&Q.toString();B&&_.replaceSelection(B)},oneNormalCommand:function(_,$,R){Am(_,!0),R.insertModeReturn=!0,e.on(_,"vim-command-done",function I(){R.visualMode||(R.insertModeReturn&&(R.insertModeReturn=!1,R.insertMode||Me.enterInsertMode(_,{},R)),e.off(_,"vim-command-done",I))})},setMark:function(_,$,R){var I=$.selectedCharacter;I&&ar(_,R,I,_.getCursor())},replace:function(_,$,R){var I=$.selectedCharacter||"",Q=_.getCursor(),B,X,J=_.listSelections();if(R.visualMode)Q=_.getCursor("start"),X=_.getCursor("end");else{var re=_.getLine(Q.line);B=Q.ch+$.repeat,B>re.length&&(B=re.length),X=new t(Q.line,B)}var he=n(_,Q,X);if(Q=he.start,X=he.end,I==`
`)R.visualMode||_.replaceRange("",Q,X),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(_);else{var pe=_.getRange(Q,X);if(pe=pe.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,I),pe=pe.replace(/[^\n]/g,I),R.visualBlock){var $e=new Array(_.getOption("tabSize")+1).join(" ");pe=_.getSelection(),pe=pe.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,I);var Te=pe.replace(/\t/g,$e).replace(/[^\n]/g,I).split(`
`);_.replaceSelections(Te)}else _.replaceRange(pe,Q,X);R.visualMode?(Q=Ht(J[0].anchor,J[0].head)?J[0].anchor:J[0].head,_.setCursor(Q),_i(_,!1)):_.setCursor(_t(X,0,-1))}},incrementNumberToken:function(_,$){for(var R=_.getCursor(),I=_.getLine(R.line),Q=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,B,X,J,re;(B=Q.exec(I))!==null&&(X=B.index,J=X+B[0].length,!(R.ch<J)););if(!(!$.backtrack&&J<=R.ch)){if(B){var he=B[2]||B[4],pe=B[3]||B[5],$e=$.increase?1:-1,Te={"0b":2,0:8,"":10,"0x":16}[he.toLowerCase()],Se=parseInt(B[1]+pe,Te)+$e*$.repeat;re=Se.toString(Te);var xe=he?new Array(pe.length-re.length+1+B[1].length).join("0"):"";re.charAt(0)==="-"?re="-"+he+xe+re.substr(1):re=he+xe+re;var Ne=new t(R.line,X),qe=new t(R.line,J);_.replaceRange(re,Ne,qe)}else return;_.setCursor(new t(R.line,X+re.length-1))}},repeatLastEdit:function(_,$,R){var I=R.lastEditInputState;if(I){var Q=$.repeat;Q&&$.repeatIsExplicit?I.repeatOverride=Q:Q=I.repeatOverride||Q,xme(_,R,Q,!1)}},indent:function(_,$){_.indentLine(_.getCursor().line,$.indentRight)},exitInsertMode:function(_,$){Am(_)}};function pt(_,$){Me[_]=$}function at(_,$,R){var I=_.state.vim,Q=I.insertMode||I.visualMode,B=Math.min(Math.max(_.firstLine(),$.line),_.lastLine()),X=_.getLine(B),J=X.length-1+ +!!Q,re=Math.min(Math.max(0,$.ch),J),he=X.charCodeAt(re);if(56320<=he&&he<=57343){var pe=1;R&&R.line==B&&R.ch>re&&(pe=-1),re+=pe,re>J&&(re-=2)}return new t(B,re)}function ht(_){var $={};for(var R in _)_.hasOwnProperty(R)&&($[R]=_[R]);return $}function _t(_,$,R){return typeof $=="object"&&(R=$.ch,$=$.line),new t(_.line+$,_.ch+R)}function yn(_,$,R,I){I.operator&&(R="operatorPending");for(var Q,B=[],X=[],J=V?$.length-i:0,re=J;re<$.length;re++){var he=$[re];R=="insert"&&he.context!="insert"||he.context&&he.context!=R||I.operator&&he.type=="action"||!(Q=_n(_,he.keys))||(Q=="partial"&&B.push(he),Q=="full"&&X.push(he))}return{partial:B.length&&B,full:X.length&&X}}function _n(_,$){const R=$.slice(-11)=="<character>",I=$.slice(-10)=="<register>";if(R||I){var Q=$.length-(R?11:10),B=_.slice(0,Q),X=$.slice(0,Q);return B==X&&_.length>Q?"full":X.indexOf(B)==0?"partial":!1}else return _==$?"full":$.indexOf(_)==0?"partial":!1}function ri(_){var $=/^.*(<[^>]+>)$/.exec(_),R=$?$[1]:_.slice(-1);if(R.length>1)switch(R){case"<CR>":case"<S-CR>":R=`
`;break;case"<Space>":case"<S-Space>":R=" ";break;default:R="";break}return R}function hi(_,$,R){return function(){for(var I=0;I<R;I++)$(_)}}function Qt(_){return new t(_.line,_.ch)}function An(_,$){return _.ch==$.ch&&_.line==$.line}function Ht(_,$){return _.line<$.line||_.line==$.line&&_.ch<$.ch}function rr(_,$){return arguments.length>2&&($=rr.apply(void 0,Array.prototype.slice.call(arguments,1))),Ht(_,$)?_:$}function Ci(_,$){return arguments.length>2&&($=Ci.apply(void 0,Array.prototype.slice.call(arguments,1))),Ht(_,$)?$:_}function xs(_,$,R){var I=Ht(_,$),Q=Ht($,R);return I&&Q}function Ar(_,$){return _.getLine($).length}function Rn(_){return _.trim?_.trim():_.replace(/^\s+|\s+$/g,"")}function Rr(_){return _.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Ii(_,$,R){var I=Ar(_,$),Q=new Array(R-I+1).join(" ");_.setCursor(new t($,I)),_.replaceRange(Q,_.getCursor())}function Ji(_,$){var R=[],I=_.listSelections(),Q=Qt(_.clipPos($)),B=!An($,Q),X=_.getCursor("head"),J=ji(I,X),re=An(I[J].head,I[J].anchor),he=I.length-1,pe=he-J>J?he:0,$e=I[pe].anchor,Te=Math.min($e.line,Q.line),Se=Math.max($e.line,Q.line),xe=$e.ch,Ne=Q.ch,qe=I[pe].head.ch-xe,Bt=Ne-xe;qe>0&&Bt<=0?(xe++,B||Ne--):qe<0&&Bt>=0?(xe--,re||Ne++):qe<0&&Bt==-1&&(xe--,Ne++);for(var kt=Te;kt<=Se;kt++){var Gt={anchor:new t(kt,xe),head:new t(kt,Ne)};R.push(Gt)}return _.setSelections(R),$.ch=Ne,$e.ch=xe,$e}function Li(_,$,R){for(var I=[],Q=0;Q<R;Q++){var B=_t($,Q,0);I.push({anchor:B,head:B})}_.setSelections(I,0)}function ji(_,$,R){for(var I=0;I<_.length;I++){var Q=R!="head"&&An(_[I].anchor,$),B=R!="anchor"&&An(_[I].head,$);if(Q||B)return I}return-1}function Ro(_,$){var R=$.lastSelection,I=function(){var B=_.listSelections(),X=B[0],J=B[B.length-1],re=Ht(X.anchor,X.head)?X.anchor:X.head,he=Ht(J.anchor,J.head)?J.head:J.anchor;return[re,he]},Q=function(){var B=_.getCursor(),X=_.getCursor(),J=R.visualBlock;if(J){var re=J.width,he=J.height;X=new t(B.line+he,B.ch+re);for(var pe=[],$e=B.line;$e<X.line;$e++){var Te=new t($e,B.ch),Se=new t($e,X.ch),xe={anchor:Te,head:Se};pe.push(xe)}_.setSelections(pe)}else{var Ne=R.anchorMark.find(),qe=R.headMark.find(),Bt=qe.line-Ne.line,kt=qe.ch-Ne.ch;X={line:X.line+Bt,ch:Bt?X.ch:kt+X.ch},R.visualLine&&(B=new t(B.line,0),X=new t(X.line,Ar(_,X.line))),_.setSelection(B,X)}return[B,X]};return $.visualMode?I():Q()}function eo(_,$){var R=$.sel.anchor,I=$.sel.head;$.lastPastedText&&(I=_.posFromIndex(_.indexFromPos(R)+$.lastPastedText.length),$.lastPastedText=null),$.lastSelection={anchorMark:_.setBookmark(R),headMark:_.setBookmark(I),anchor:Qt(R),head:Qt(I),visualMode:$.visualMode,visualLine:$.visualLine,visualBlock:$.visualBlock}}function pi(_,$,R,I){var Q=_.state.vim.sel,B=I?$:Q.head,X=I?$:Q.anchor,J;return Ht(R,$)&&(J=R,R=$,$=J),Ht(B,X)?(B=rr($,B),X=Ci(X,R)):(X=rr($,X),B=Ci(B,R),B=_t(B,0,-1),B.ch==-1&&B.line!=_.firstLine()&&(B=new t(B.line-1,Ar(_,B.line-1)))),[X,B]}function Do(_,$,R){var I=_.state.vim;$=$||I.sel,R||(R=I.visualLine?"line":I.visualBlock?"block":"char");var Q=ta(_,$,R);_.setSelections(Q.ranges,Q.primary)}function ta(_,$,R,I){var Q=Qt($.head),B=Qt($.anchor);if(R=="char"){var X=!I&&!Ht($.head,$.anchor)?1:0,J=Ht($.head,$.anchor)?1:0;return Q=_t($.head,0,X),B=_t($.anchor,0,J),{ranges:[{anchor:B,head:Q}],primary:0}}else if(R=="line"){if(Ht($.head,$.anchor))Q.ch=0,B.ch=Ar(_,B.line);else{B.ch=0;var re=_.lastLine();Q.line>re&&(Q.line=re),Q.ch=Ar(_,Q.line)}return{ranges:[{anchor:B,head:Q}],primary:0}}else if(R=="block"){var he=Math.min(B.line,Q.line),pe=B.ch,$e=Math.max(B.line,Q.line),Te=Q.ch;pe<Te?Te+=1:pe+=1;for(var Se=$e-he+1,xe=Q.line==he?0:Se-1,Ne=[],qe=0;qe<Se;qe++)Ne.push({anchor:new t(he+qe,pe),head:new t(he+qe,Te)});return{ranges:Ne,primary:xe}}throw"never happens"}function ws(_){var $=_.getCursor("head");return _.getSelection().length==1&&($=rr($,_.getCursor("anchor"))),$}function _i(_,$){var R=_.state.vim;$!==!1&&_.setCursor(at(_,R.sel.head)),eo(_,R),R.visualMode=!1,R.visualLine=!1,R.visualBlock=!1,R.insertMode||e.signal(_,"vim-mode-change",{mode:"normal"})}function ne(_,$,R){var I=_.getRange($,R);if(/\n\s*$/.test(I)){var Q=I.split(`
`);Q.pop();for(var B=Q.pop();Q.length>0&&B&&E(B);B=Q.pop())R.line--,R.ch=0;B?(R.line--,R.ch=Ar(_,R.line)):R.ch=0}}function ir(_,$,R){$.ch=0,R.ch=0,R.line++}function cn(_){if(!_)return 0;var $=_.search(/\S/);return $==-1?_.length:$}function Tt(_,{inclusive:$,innerWord:R,bigWord:I,noSymbol:Q,multiline:B},X){var J=X||ws(_),re=_.getLine(J.line),he=re,pe=J.line,$e=pe,Te=J.ch,Se,xe=Q?f[0]:d[0];if(R&&/\s/.test(re.charAt(Te)))xe=function(Mr){return/\s/.test(Mr)};else{for(;!xe(re.charAt(Te));)if(Te++,Te>=re.length){if(!B)return null;Te--,Se=sr(_,J,!0,I,!0);break}I?xe=d[0]:(xe=f[0],xe(re.charAt(Te))||(xe=f[1]))}for(var Ne=Te,qe=Te;xe(re.charAt(qe))&&qe>=0;)qe--;if(qe++,Se)Ne=Se.to,$e=Se.line,he=_.getLine($e),!he&&Ne==0&&Ne++;else for(;xe(re.charAt(Ne))&&Ne<re.length;)Ne++;if($){var Bt=Ne,kt=J.ch<=qe&&/\s/.test(re.charAt(J.ch));if(!kt)for(;/\s/.test(he.charAt(Ne))&&Ne<he.length;)Ne++;if(Bt==Ne||kt){for(var Gt=qe;/\s/.test(re.charAt(qe-1))&&qe>0;)qe--;!qe&&!kt&&(qe=Gt)}}return{start:new t(pe,qe),end:new t($e,Ne)}}function ue(_,$,R){var I=$;if(!e.findMatchingTag||!e.findEnclosingTag)return{start:I,end:I};var Q=e.findMatchingTag(_,$)||e.findEnclosingTag(_,$);return!Q||!Q.open||!Q.close?{start:I,end:I}:R?{start:Q.open.from,end:Q.close.to}:{start:Q.open.to,end:Q.close.from}}function Be(_,$,R){An($,R)||z.jumpList.add(_,$,R)}function it(_,$){z.lastCharacterSearch.increment=_,z.lastCharacterSearch.forward=$.forward,z.lastCharacterSearch.selectedCharacter=$.selectedCharacter}var xt={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},hr={bracket:{isComplete:function(_){if(_.nextCh===_.symb){if(_.depth++,_.depth>=1)return!0}else _.nextCh===_.reverseSymb&&_.depth--;return!1}},section:{init:function(_){_.curMoveThrough=!0,_.symb=(_.forward?"]":"[")===_.symb?"{":"}"},isComplete:function(_){return _.index===0&&_.nextCh===_.symb}},comment:{isComplete:function(_){var $=_.lastCh==="*"&&_.nextCh==="/";return _.lastCh=_.nextCh,$}},method:{init:function(_){_.symb=_.symb==="m"?"{":"}",_.reverseSymb=_.symb==="{"?"}":"{"},isComplete:function(_){return _.nextCh===_.symb}},preprocess:{init:function(_){_.index=0},isComplete:function(_){if(_.nextCh==="#"){var $=_.lineText.match(/^#(\w+)/)[1];if($==="endif"){if(_.forward&&_.depth===0)return!0;_.depth++}else if($==="if"){if(!_.forward&&_.depth===0)return!0;_.depth--}if($==="else"&&_.depth===0)return!0}return!1}}};function or(_,$,R,I){var Q=Qt(_.getCursor()),B=R?1:-1,X=R?_.lineCount():-1,J=Q.ch,re=Q.line,he=_.getLine(re),pe={lineText:he,nextCh:he.charAt(J),lastCh:null,index:J,symb:I,reverseSymb:(R?{")":"(","}":"{"}:{"(":")","{":"}"})[I],forward:R,depth:0,curMoveThrough:!1},$e=xt[I];if(!$e)return Q;var Te=hr[$e].init,Se=hr[$e].isComplete;for(Te&&Te(pe);re!==X&&$;){if(pe.index+=B,pe.nextCh=pe.lineText.charAt(pe.index),!pe.nextCh){if(re+=B,pe.lineText=_.getLine(re)||"",B>0)pe.index=0;else{var xe=pe.lineText.length;pe.index=xe>0?xe-1:0}pe.nextCh=pe.lineText.charAt(pe.index)}Se(pe)&&(Q.line=re,Q.ch=pe.index,$--)}return pe.nextCh||pe.curMoveThrough?new t(re,pe.index):Q}function sr(_,$,R,I,Q){var B=$.line,X=$.ch,J=_.getLine(B),re=R?1:-1,he=I?d:f;if(Q&&J==""){if(B+=re,J=_.getLine(B),!y(_,B))return null;X=R?0:J.length}for(;;){if(Q&&J=="")return{from:0,to:0,line:B};for(var pe=re>0?J.length:-1,$e=pe,Te=pe;X!=pe;){for(var Se=!1,xe=0;xe<he.length&&!Se;++xe)if(he[xe](J.charAt(X))){for($e=X;X!=pe&&he[xe](J.charAt(X));)X+=re;if(Te=X,Se=$e!=Te,$e==$.ch&&B==$.line&&Te==$e+re)continue;return{from:Math.min($e,Te+1),to:Math.max($e,Te),line:B}}Se||(X+=re)}if(B+=re,!y(_,B))return null;J=_.getLine(B),X=re>0?0:J.length}}function Ur(_,$,R,I,Q,B){var X=Qt($),J=[];(I&&!Q||!I&&Q)&&R++;for(var re=!(I&&Q),he=0;he<R;he++){var pe=sr(_,$,I,B,re);if(!pe){var $e=Ar(_,_.lastLine());J.push(I?{line:_.lastLine(),from:$e,to:$e}:{line:0,from:0,to:0});break}J.push(pe),$=new t(pe.line,I?pe.to-1:pe.from)}var Te=J.length!=R,Se=J[0],xe=J.pop();return I&&!Q?(!Te&&(Se.from!=X.ch||Se.line!=X.line)&&(xe=J.pop()),xe&&new t(xe.line,xe.from)):I&&Q?xe&&new t(xe.line,xe.to-1):!I&&Q?(!Te&&(Se.to!=X.ch||Se.line!=X.line)&&(xe=J.pop()),xe&&new t(xe.line,xe.to)):xe&&new t(xe.line,xe.from)}function xn(_,$,R,I,Q){var B=$,X=new t(B.line+R.repeat-1,1/0),J=_.clipPos(X);return J.ch--,Q||(I.lastHPos=1/0,I.lastHSPos=_.charCoords(J,"div").left),X}function br(_,$,R,I,Q){if(I){for(var B=Q||_.getCursor(),X=B.ch,J,re=0;re<$;re++){var he=_.getLine(B.line);if(J=Mo(X,he,I,R,!0),J==-1)return;X=J}if(J!=null)return new t(_.getCursor().line,J)}}function Wn(_,$){var R=_.getCursor().line;return at(_,new t(R,$-1))}function ar(_,$,R,I){!k(R,h)&&!g.test(R)||($.marks[R]&&$.marks[R].clear(),$.marks[R]=_.setBookmark(I))}function Mo(_,$,R,I,Q){var B;return I?(B=$.indexOf(R,_+1),B!=-1&&!Q&&(B-=1)):(B=$.lastIndexOf(R,_-1),B!=-1&&!Q&&(B+=1)),B}function Ua(_,$,R,I,Q){var B=$.line,X=_.firstLine(),J=_.lastLine(),re,he,pe=B;function $e(qe){return!_.getLine(qe)}function Te(qe,Bt,kt){return kt?$e(qe)!=$e(qe+Bt):!$e(qe)&&$e(qe+Bt)}if(I){for(;X<=pe&&pe<=J&&R>0;)Te(pe,I)&&R--,pe+=I;return{start:new t(pe,0),end:$}}var Se=_.state.vim;if(Se.visualLine&&Te(B,1,!0)){var xe=Se.sel.anchor;Te(xe.line,-1,!0)&&(!Q||xe.line!=B)&&(B+=1)}var Ne=$e(B);for(pe=B;pe<=J&&R;pe++)Te(pe,1,!0)&&(!Q||$e(pe)!=Ne)&&R--;for(he=new t(pe,0),pe>J&&!Ne?Ne=!0:Q=!1,pe=B;pe>X&&!((!Q||$e(pe)==Ne||pe==B)&&Te(pe,-1,!0));pe--);return re=new t(pe,0),{start:re,end:he}}function qv(_,$,R,I,Q){function B(he){he.pos+he.dir<0||he.pos+he.dir>=he.line.length?he.line=null:he.pos+=he.dir}function X(he,pe,$e,Te){var Se=he.getLine(pe),xe={line:Se,ln:pe,pos:$e,dir:Te};if(xe.line==="")return{ln:xe.ln,pos:xe.pos};var Ne=xe.pos;for(B(xe);xe.line!==null;){if(Ne=xe.pos,C(xe.line[xe.pos]))if(Q){for(B(xe);xe.line!==null&&E(xe.line[xe.pos]);)Ne=xe.pos,B(xe);return{ln:xe.ln,pos:Ne+1}}else return{ln:xe.ln,pos:xe.pos+1};B(xe)}return{ln:xe.ln,pos:Ne+1}}function J(he,pe,$e,Te){var Se=he.getLine(pe),xe={line:Se,ln:pe,pos:$e,dir:Te};if(xe.line==="")return{ln:xe.ln,pos:xe.pos};var Ne=xe.pos;for(B(xe);xe.line!==null;){if(!E(xe.line[xe.pos])&&!C(xe.line[xe.pos]))Ne=xe.pos;else if(C(xe.line[xe.pos]))return Q?E(xe.line[xe.pos+1])?{ln:xe.ln,pos:xe.pos+1}:{ln:xe.ln,pos:Ne}:{ln:xe.ln,pos:Ne};B(xe)}return xe.line=Se,Q&&E(xe.line[xe.pos])?{ln:xe.ln,pos:xe.pos}:{ln:xe.ln,pos:Ne}}for(var re={ln:$.line,pos:$.ch};R>0;)I<0?re=J(_,re.ln,re.pos,I):re=X(_,re.ln,re.pos,I),R--;return new t(re.ln,re.pos)}function qB(_,$,R,I){function Q(re,he){if(he.pos+he.dir<0||he.pos+he.dir>=he.line.length){if(he.ln+=he.dir,!y(re,he.ln)){he.line=null,he.ln=null,he.pos=null;return}he.line=re.getLine(he.ln),he.pos=he.dir>0?0:he.line.length-1}else he.pos+=he.dir}function B(re,he,pe,$e){var qe=re.getLine(he),Te=qe==="",Se={line:qe,ln:he,pos:pe,dir:$e},xe={ln:Se.ln,pos:Se.pos},Ne=Se.line==="";for(Q(re,Se);Se.line!==null;){if(xe.ln=Se.ln,xe.pos=Se.pos,Se.line===""&&!Ne)return{ln:Se.ln,pos:Se.pos};if(Te&&Se.line!==""&&!E(Se.line[Se.pos]))return{ln:Se.ln,pos:Se.pos};C(Se.line[Se.pos])&&!Te&&(Se.pos===Se.line.length-1||E(Se.line[Se.pos+1]))&&(Te=!0),Q(re,Se)}var qe=re.getLine(xe.ln);xe.pos=0;for(var Bt=qe.length-1;Bt>=0;--Bt)if(!E(qe[Bt])){xe.pos=Bt;break}return xe}function X(re,he,pe,$e){var Ne=re.getLine(he),Te={line:Ne,ln:he,pos:pe,dir:$e},Se={ln:Te.ln,pos:null},xe=Te.line==="";for(Q(re,Te);Te.line!==null;){if(Te.line===""&&!xe)return Se.pos!==null?Se:{ln:Te.ln,pos:Te.pos};if(C(Te.line[Te.pos])&&Se.pos!==null&&!(Te.ln===Se.ln&&Te.pos+1===Se.pos))return Se;Te.line!==""&&!E(Te.line[Te.pos])&&(xe=!1,Se={ln:Te.ln,pos:Te.pos}),Q(re,Te)}var Ne=re.getLine(Se.ln);Se.pos=0;for(var qe=0;qe<Ne.length;++qe)if(!E(Ne[qe])){Se.pos=qe;break}return Se}for(var J={ln:$.line,pos:$.ch};R>0;)I<0?J=X(_,J.ln,J.pos,I):J=B(_,J.ln,J.pos,I),R--;return new t(J.ln,J.pos)}function fM(_,$,R,I){var Q=$,B={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[R],X={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[R],J=_.getLine(Q.line).charAt(Q.ch),re=J===X?1:0,he=_.scanForBracket(new t(Q.line,Q.ch+re),-1,void 0,{bracketRegex:B}),pe=_.scanForBracket(new t(Q.line,Q.ch+re),1,void 0,{bracketRegex:B});if(!he||!pe)return null;var $e=he.pos,Te=pe.pos;if($e.line==Te.line&&$e.ch>Te.ch||$e.line>Te.line){var Se=$e;$e=Te,Te=Se}return I?Te.ch+=1:$e.ch+=1,{start:$e,end:Te}}function VB(_,$,R,I){var Q=Qt($),B=_.getLine(Q.line),X=B.split(""),J,re,he,pe,$e=X.indexOf(R);if(Q.ch<$e)Q.ch=$e;else if($e<Q.ch&&X[Q.ch]==R){var Te=/string/.test(_.getTokenTypeAt(_t($,0,1))),Se=/string/.test(_.getTokenTypeAt($)),xe=Te&&!Se;xe||(re=Q.ch,--Q.ch)}if(X[Q.ch]==R&&!re)J=Q.ch+1;else for(he=Q.ch;he>-1&&!J;he--)X[he]==R&&(J=he+1);if(J&&!re)for(he=J,pe=X.length;he<pe&&!re;he++)X[he]==R&&(re=he);return!J||!re?{start:Q,end:Q}:(I&&(--J,++re),{start:new t(Q.line,J),end:new t(Q.line,re)})}D("pcre",!0,"boolean");class V_{getQuery(){return z.query}setQuery($){z.query=$}getOverlay(){return this.searchOverlay}setOverlay($){this.searchOverlay=$}isReversed(){return z.isReversed}setReversed($){z.isReversed=$}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate($){this.annotate=$}}function Rf(_){var $=_.state.vim;return $.searchState_||($.searchState_=new V_)}function lct(_){return lme(_,"/")}function cct(_){return cme(_,"/")}function lme(_,$){var R=cme(_,$)||[];if(!R.length)return[];var I=[];if(R[0]===0){for(var Q=0;Q<R.length;Q++)typeof R[Q]=="number"&&I.push(_.substring(R[Q]+1,R[Q+1]));return I}}function cme(_,$){$||($="/");for(var R=!1,I=[],Q=0;Q<_.length;Q++){var B=_.charAt(Q);!R&&B==$&&I.push(Q),R=!R&&B=="\\"}return I}function uct(_){for(var $="|(){",R="}",I=!1,Q=[],B=-1;B<_.length;B++){var X=_.charAt(B)||"",J=_.charAt(B+1)||"",re=J&&$.indexOf(J)!=-1;I?((X!=="\\"||!re)&&Q.push(X),I=!1):X==="\\"?(I=!0,J&&R.indexOf(J)!=-1&&(re=!0),(!re||J==="\\")&&Q.push(X)):(Q.push(X),re&&J!=="\\"&&Q.push("\\"))}return Q.join("")}var ume={"\\n":`
`,"\\r":"\r","\\t":"	"};function fct(_){for(var $=!1,R=[],I=-1;I<_.length;I++){var Q=_.charAt(I)||"",B=_.charAt(I+1)||"";ume[Q+B]?(R.push(ume[Q+B]),I++):$?(R.push(Q),$=!1):Q==="\\"?($=!0,w(B)||B==="$"?R.push("$"):B!=="/"&&B!=="\\"&&R.push("\\")):(Q==="$"&&R.push("$"),R.push(Q),B==="/"&&R.push("\\"))}return R.join("")}var fme={"\\/":"/","\\\\":"\\","\\n":`
`,"\\r":"\r","\\t":"	","\\&":"&"};function dct(_){for(var $=new e.StringStream(_),R=[];!$.eol();){for(;$.peek()&&$.peek()!="\\";)R.push($.next());var I=!1;for(var Q in fme)if($.match(Q,!0)){I=!0,R.push(fme[Q]);break}I||R.push($.next())}return R.join("")}function hct(_,$,R){var I=z.registerController.getRegister("/");if(I.setText(_),_ instanceof RegExp)return _;var Q=cct(_),B,X;if(!Q.length)B=_;else{B=_.substring(0,Q[0]);var J=_.substring(Q[0]);X=J.indexOf("i")!=-1}if(!B)return null;L("pcre")||(B=uct(B)),R&&($=/^[^A-Z]*$/.test(B));var re=new RegExp(B,$||X?"im":"m");return re}function Pm(_){typeof _=="string"&&(_=document.createElement(_));for(var $,R=1;R<arguments.length;R++)if($=arguments[R])if(typeof $!="object"&&($=document.createTextNode($)),$.nodeType)_.appendChild($);else for(var I in $)Object.prototype.hasOwnProperty.call($,I)&&(I[0]==="$"?_.style[I.slice(1)]=$[I]:_.setAttribute(I,$[I]));return _}function Dr(_,$){var R=Pm("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},$);_.openNotification?_.openNotification(R,{bottom:!0,duration:5e3}):alert(R.innerText)}function pct(_,$){return Pm("div",{$display:"flex"},Pm("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1},_,Pm("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$width:"100%"})),$&&Pm("span",{$color:"#888"},$))}function U_(_,$){if(U.length){$.value||($.value=""),H=$;return}var R=pct($.prefix,$.desc);if(_.openDialog)_.openDialog(R,$.onClose,{onKeyDown:$.onKeyDown,onKeyUp:$.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:$.value});else{var I="";typeof $.prefix!="string"&&$.prefix&&(I+=$.prefix.textContent),$.desc&&(I+=" "+$.desc),$.onClose(prompt(I,""))}}function gct(_,$){if(_ instanceof RegExp&&$ instanceof RegExp){for(var R=["global","multiline","ignoreCase","source"],I=0;I<R.length;I++){var Q=R[I];if(_[Q]!==$[Q])return!1}return!0}return!1}function H_(_,$,R,I){if($){var Q=Rf(_),B=hct($,!!R,!!I);if(B)return dme(_,B),gct(B,Q.getQuery())||Q.setQuery(B),B}}function mct(_){if(_.source.charAt(0)=="^")var $=!0;return{token:function(R){if($&&!R.sol()){R.skipToEnd();return}var I=R.match(_,!1);if(I)return I[0].length==0?(R.next(),"searching"):!R.sol()&&(R.backUp(1),!_.exec(R.next()+I[0]))?(R.next(),null):(R.match(_),"searching");for(;!R.eol()&&(R.next(),!R.match(_,!1)););},query:_}}var X_=0;function dme(_,$){clearTimeout(X_);var R=Rf(_);R.highlightTimeout=X_,X_=setTimeout(function(){if(_.state.vim){var I=Rf(_);I.highlightTimeout=null;var Q=I.getOverlay();(!Q||$!=Q.query)&&(Q&&_.removeOverlay(Q),Q=mct($),_.addOverlay(Q),_.showMatchesOnScrollbar&&(I.getScrollbarAnnotate()&&I.getScrollbarAnnotate().clear(),I.setScrollbarAnnotate(_.showMatchesOnScrollbar($))),I.setOverlay(Q))}},50)}function hme(_,$,R,I){return _.operation(function(){I===void 0&&(I=1);for(var Q=_.getCursor(),B=_.getSearchCursor(R,Q),X=0;X<I;X++){var J=B.find($);if(X==0&&J&&An(B.from(),Q)){var re=$?B.from():B.to();J=B.find($),J&&!J[0]&&An(B.from(),re)&&_.getLine(re.line).length==re.ch&&(J=B.find($))}if(!J&&(B=_.getSearchCursor(R,$?new t(_.lastLine()):new t(_.firstLine(),0)),!B.find($)))return}return B.from()})}function yct(_,$,R,I,Q){return _.operation(function(){I===void 0&&(I=1);var B=_.getCursor(),X=_.getSearchCursor(R,B),J=X.find(!$);!Q.visualMode&&J&&An(X.from(),B)&&X.find(!$);for(var re=0;re<I;re++)if(J=X.find($),!J&&(X=_.getSearchCursor(R,$?new t(_.lastLine()):new t(_.firstLine(),0)),!X.find($)))return;return[X.from(),X.to()]})}function UB(_){var $=Rf(_);$.highlightTimeout&&(clearTimeout($.highlightTimeout),$.highlightTimeout=null),_.removeOverlay(Rf(_).getOverlay()),$.setOverlay(null),$.getScrollbarAnnotate()&&($.getScrollbarAnnotate().clear(),$.setScrollbarAnnotate(null))}function vct(_,$,R){return typeof _!="number"&&(_=_.line),$ instanceof Array?k(_,$):typeof R=="number"?_>=$&&_<=R:_==$}function HB(_){var $=_.getScrollInfo(),R=6,I=10,Q=_.coordsChar({left:0,top:R+$.top},"local"),B=$.clientHeight-I+$.top,X=_.coordsChar({left:0,top:B},"local");return{top:Q.line,bottom:X.line}}function dM(_,$,R){if(R=="'"||R=="`")return z.jumpList.find(_,-1)||new t(0,0);if(R==".")return pme(_);var I=$.marks[R];return I&&I.find()}function pme(_){if(_.getLastEditEnd)return _.getLastEditEnd();for(var $=_.doc.history.done,R=$.length;R--;)if($[R].changes)return Qt($[R].changes[0].to)}class bct{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand($,R,I){var Q=this;$.operation(function(){$.curOp.isVimOp=!0,Q._processCommand($,R,I)})}_processCommand($,R,I){var Q=$.state.vim,B=z.registerController.getRegister(":"),X=B.toString(),J=new e.StringStream(R);B.setText(R);var re=I||{};re.input=R;try{this.parseInput_($,J,re)}catch($e){throw Dr($,$e+""),$e}Q.visualMode&&_i($);var he,pe;if(!re.commandName)re.line!==void 0&&(pe="move");else if(he=this.matchCommand_(re.commandName),he){if(pe=he.name,he.excludeFromCommandHistory&&B.setText(X),this.parseCommandArgs_(J,re,he),he.type=="exToKey"){ee($,he.toKeys,he);return}else if(he.type=="exToEx"){this.processCommand($,he.toInput);return}}if(!pe){Dr($,'Not an editor command ":'+R+'"');return}try{gme[pe]($,re),(!he||!he.possiblyAsync)&&re.callback&&re.callback()}catch($e){throw Dr($,$e+""),$e}}parseInput_($,R,I){var B,X;R.eatWhile(":"),R.eat("%")?(I.line=$.firstLine(),I.lineEnd=$.lastLine()):(I.line=this.parseLineSpec_($,R),I.line!==void 0&&R.eat(",")&&(I.lineEnd=this.parseLineSpec_($,R))),I.line==null?$.state.vim.visualMode?(I.selectionLine=(B=dM($,$.state.vim,"<"))==null?void 0:B.line,I.selectionLineEnd=(X=dM($,$.state.vim,">"))==null?void 0:X.line):I.selectionLine=$.getCursor().line:(I.selectionLine=I.line,I.selectionLineEnd=I.lineEnd);var Q=R.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return Q?I.commandName=Q[1]:I.commandName=R.match(/.*/)[0],I}parseLineSpec_($,R){var I=R.match(/^(\d+)/);if(I)return parseInt(I[1],10)-1;switch(R.next()){case".":return this.parseLineSpecOffset_(R,$.getCursor().line);case"$":return this.parseLineSpecOffset_(R,$.lastLine());case"'":var Q=R.next(),B=dM($,$.state.vim,Q);if(!B)throw new Error("Mark not set");return this.parseLineSpecOffset_(R,B.line);case"-":case"+":return R.backUp(1),this.parseLineSpecOffset_(R,$.getCursor().line);default:R.backUp(1);return}}parseLineSpecOffset_($,R){var I=$.match(/^([+-])?(\d+)/);if(I){var Q=parseInt(I[2],10);I[1]=="-"?R-=Q:R+=Q}return R}parseCommandArgs_($,R,I){if(!$.eol()){R.argString=$.match(/.*/)[0];var Q=I.argDelimiter||/\s+/,B=Rn(R.argString).split(Q);B.length&&B[0]&&(R.args=B)}}matchCommand_($){for(var R=$.length;R>0;R--){var I=$.substring(0,R);if(this.commandMap_[I]){var Q=this.commandMap_[I];if(Q.name.indexOf($)===0)return Q}}return null}buildCommandMap_(){this.commandMap_={};for(var $=0;$<o.length;$++){var R=o[$],I=R.shortName||R.name;this.commandMap_[I]=R}}map($,R,I,Q){if($!=":"&&$.charAt(0)==":"){if(I)throw Error("Mode not supported for ex mappings");var B=$.substring(1);R!=":"&&R.charAt(0)==":"?this.commandMap_[B]={name:B,type:"exToEx",toInput:R.substring(1),user:!0}:this.commandMap_[B]={name:B,type:"exToKey",toKeys:R,user:!0}}else{var X={keys:$,type:"keyToKey",toKeys:R,noremap:!!Q};I&&(X.context=I),r.unshift(X)}}unmap($,R){if($!=":"&&$.charAt(0)==":"){if(R)throw Error("Mode not supported for ex mappings");var I=$.substring(1);if(this.commandMap_[I]&&this.commandMap_[I].user)return delete this.commandMap_[I],!0}else for(var Q=$,B=0;B<r.length;B++)if(Q==r[B].keys&&r[B].context===R)return r.splice(B,1),!0}}var gme={colorscheme:function(_,$){if(!$.args||$.args.length<1){Dr(_,_.getOption("theme"));return}_.setOption("theme",$.args[0])},map:function(_,$,R,I){var Q=$.args;if(!Q||Q.length<2){_&&Dr(_,"Invalid mapping: "+$.input);return}Df.map(Q[0],Q[1],R,I)},imap:function(_,$){this.map(_,$,"insert")},nmap:function(_,$){this.map(_,$,"normal")},vmap:function(_,$){this.map(_,$,"visual")},omap:function(_,$){this.map(_,$,"operatorPending")},noremap:function(_,$){this.map(_,$,void 0,!0)},inoremap:function(_,$){this.map(_,$,"insert",!0)},nnoremap:function(_,$){this.map(_,$,"normal",!0)},vnoremap:function(_,$){this.map(_,$,"visual",!0)},onoremap:function(_,$){this.map(_,$,"operatorPending",!0)},unmap:function(_,$,R){var I=$.args;(!I||I.length<1||!Df.unmap(I[0],R))&&_&&Dr(_,"No such mapping: "+$.input)},mapclear:function(_,$){q.mapclear()},imapclear:function(_,$){q.mapclear("insert")},nmapclear:function(_,$){q.mapclear("normal")},vmapclear:function(_,$){q.mapclear("visual")},omapclear:function(_,$){q.mapclear("operatorPending")},move:function(_,$){G.processCommand(_,_.state.vim,{keys:"",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:$.line+1})},set:function(_,$){var R=$.args,I=$.setCfg||{};if(!R||R.length<1){_&&Dr(_,"Invalid mapping: "+$.input);return}var Q=R[0].split("="),B=Q.shift()||"",X=Q.length>0?Q.join("="):void 0,J=!1,re=!1;if(B.charAt(B.length-1)=="?"){if(X)throw Error("Trailing characters: "+$.argString);B=B.substring(0,B.length-1),J=!0}else B.charAt(B.length-1)=="!"&&(B=B.substring(0,B.length-1),re=!0);X===void 0&&B.substring(0,2)=="no"&&(B=B.substring(2),X=!1);var he=P[B]&&P[B].type=="boolean";if(he&&(re?X=!L(B,_,I):X==null&&(X=!0)),!he&&X===void 0||J){var pe=L(B,_,I);pe instanceof Error?Dr(_,pe.message):pe===!0||pe===!1?Dr(_," "+(pe?"":"no")+B):Dr(_,"  "+B+"="+pe)}else{var $e=M(B,X,_,I);$e instanceof Error&&Dr(_,$e.message)}},setlocal:function(_,$){$.setCfg={scope:"local"},this.set(_,$)},setglobal:function(_,$){$.setCfg={scope:"global"},this.set(_,$)},registers:function(_,$){var R=$.args,I=z.registerController.registers,Q=`----------Registers----------

`;if(R)for(var J=R.join(""),re=0;re<J.length;re++){var B=J.charAt(re);if(z.registerController.isValidRegister(B)){var he=I[B]||new ke;Q+='"'+B+"    "+he.toString()+`
`}}else for(var B in I){var X=I[B].toString();X.length&&(Q+='"'+B+"    "+X+`
`)}Dr(_,Q)},sort:function(_,$){var R,I,Q,B,X;function J(){if($.argString){var Fn=new e.StringStream($.argString);if(Fn.eat("!")&&(R=!0),Fn.eol())return;if(!Fn.eatSpace())return"Invalid arguments";var qn=Fn.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!qn||!Fn.eol())return"Invalid arguments";if(qn[1]){I=qn[1].indexOf("i")!=-1,Q=qn[1].indexOf("u")!=-1;var Ha=qn[1].indexOf("d")!=-1||qn[1].indexOf("n")!=-1,Es=qn[1].indexOf("x")!=-1,es=qn[1].indexOf("o")!=-1;if(Number(Ha)+Number(Es)+Number(es)>1)return"Invalid arguments";B=Ha&&"decimal"||Es&&"hex"||es&&"octal"}qn[2]&&(X=new RegExp(qn[2].substr(1,qn[2].length-2),I?"i":""))}}var re=J();if(re){Dr(_,re+": "+$.argString);return}var he=$.line||_.firstLine(),pe=$.lineEnd||$.line||_.lastLine();if(he==pe)return;var $e=new t(he,0),Te=new t(pe,Ar(_,pe)),Se=_.getRange($e,Te).split(`
`),xe=B=="decimal"?/(-?)([\d]+)/:B=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:B=="octal"?/([0-7]+)/:null,Ne=B=="decimal"?10:B=="hex"?16:B=="octal"?8:void 0,qe=[],Bt=[];if(B||X)for(var kt=0;kt<Se.length;kt++){var Gt=X?Se[kt].match(X):null;Gt&&Gt[0]!=""?qe.push(Gt):xe&&xe.exec(Se[kt])?qe.push(Se[kt]):Bt.push(Se[kt])}else Bt=Se;function Mr(Fn,qn){if(R){var Ha;Ha=Fn,Fn=qn,qn=Ha}I&&(Fn=Fn.toLowerCase(),qn=qn.toLowerCase());var Es=xe&&xe.exec(Fn),es=xe&&xe.exec(qn);if(!Es||!es)return Fn<qn?-1:1;var Yd=parseInt((Es[1]+Es[2]).toLowerCase(),Ne),YB=parseInt((es[1]+es[2]).toLowerCase(),Ne);return Yd-YB}function na(Fn,qn){if(R){var Ha;Ha=Fn,Fn=qn,qn=Ha}return I&&(Fn[0]=Fn[0].toLowerCase(),qn[0]=qn[0].toLowerCase()),Fn[0]<qn[0]?-1:1}if(qe.sort(X?na:Mr),X)for(var kt=0;kt<qe.length;kt++)qe[kt]=qe[kt].input;else B||Bt.sort(Mr);if(Se=R?qe.concat(Bt):Bt.concat(qe),Q){var No=Se,Ss;Se=[];for(var kt=0;kt<No.length;kt++)No[kt]!=Ss&&Se.push(No[kt]),Ss=No[kt]}_.replaceRange(Se.join(`
`),$e,Te)},vglobal:function(_,$){this.global(_,$)},normal:function(_,$){var R=$.argString;if(R&&R[0]=="!"&&(R=R.slice(1),V=!0),R=R.trimStart(),!R){Dr(_,"Argument is required.");return}var I=$.line;if(typeof I=="number")for(var Q=isNaN($.lineEnd)?I:$.lineEnd,B=I;B<=Q;B++)_.setCursor(B,0),ee(_,$.argString.trimStart()),_.state.vim.insertMode&&Am(_,!0);else ee(_,$.argString.trimStart()),_.state.vim.insertMode&&Am(_,!0)},global:function(_,$){var R=$.argString;if(!R){Dr(_,"Regular Expression missing from global");return}var I=$.commandName[0]==="v";R[0]==="!"&&$.commandName[0]==="g"&&(I=!0,R=R.slice(1));var Q=$.line!==void 0?$.line:_.firstLine(),B=$.lineEnd||$.line||_.lastLine(),X=lct(R),J=R,re="";if(X&&X.length&&(J=X[0],re=X.slice(1,X.length).join("/")),J)try{H_(_,J,!0,!0)}catch{Dr(_,"Invalid regex: "+J);return}for(var he=Rf(_).getQuery(),pe=[],$e=Q;$e<=B;$e++){var Te=_.getLine($e),Se=he.test(Te);Se!==I&&pe.push(re?_.getLineHandle($e):Te)}if(!re){Dr(_,pe.join(`
`));return}var xe=0,Ne=function(){if(xe<pe.length){var qe=pe[xe++],Bt=_.getLineNumber(qe);if(Bt==null){Ne();return}var kt=Bt+1+re;Df.processCommand(_,kt,{callback:Ne})}else _.releaseLineHandles&&_.releaseLineHandles()};Ne()},substitute:function(_,$){if(!_.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var R=$.argString,I=R?lme(R,R[0]):[],Q="",B="",X,J,re,he=!1,pe=!1;if(I&&I.length)Q=I[0],L("pcre")&&Q!==""&&(Q=new RegExp(Q).source),B=I[1],B!==void 0&&(L("pcre")?B=dct(B.replace(/([^\\])&/g,"$1$$&")):B=fct(B),z.lastSubstituteReplacePart=B),X=I[2]?I[2].split(" "):[];else if(R&&R.length){Dr(_,"Substitutions should be of the form :s/pattern/replace/");return}if(X&&(J=X[0],re=parseInt(X[1]),J&&(J.indexOf("c")!=-1&&(he=!0),J.indexOf("g")!=-1&&(pe=!0),L("pcre")?Q=Q+"/"+J:Q=Q.replace(/\//g,"\\/")+"/"+J)),Q)try{H_(_,Q,!0,!0)}catch{Dr(_,"Invalid regex: "+Q);return}if(B=B||z.lastSubstituteReplacePart,B===void 0){Dr(_,"No previous substitute regular expression");return}var $e=Rf(_),Te=$e.getQuery(),Se=$.line!==void 0?$.line:_.getCursor().line,xe=$.lineEnd||Se;Se==_.firstLine()&&xe==_.lastLine()&&(xe=1/0),re&&(Se=xe,xe=Se+re-1);var Ne=at(_,new t(Se,0)),qe=_.getSearchCursor(Te,Ne);Oct(_,he,pe,Se,xe,qe,Te,B,$.callback)},startinsert:function(_,$){ee(_,$.argString=="!"?"A":"i",{})},redo:e.commands.redo,undo:e.commands.undo,write:function(_){e.commands.save?e.commands.save(_):_.save&&_.save()},nohlsearch:function(_){UB(_)},yank:function(_){var $=Qt(_.getCursor()),R=$.line,I=_.getLine(R);z.registerController.pushText("0","yank",I,!0,!0)},delete:function(_,$){var R=$.selectionLine,I=isNaN($.selectionLineEnd)?R:$.selectionLineEnd;Fe.delete(_,{linewise:!0},[{anchor:new t(R,0),head:new t(I+1,0)}])},join:function(_,$){var R=$.selectionLine,I=isNaN($.selectionLineEnd)?R:$.selectionLineEnd;_.setCursor(new t(R,0)),Me.joinLines(_,{repeat:I-R},_.state.vim)},delmarks:function(_,$){if(!$.argString||!Rn($.argString)){Dr(_,"Argument required");return}for(var R=_.state.vim,I=new e.StringStream(Rn($.argString));!I.eol();){I.eatSpace();var Q=I.pos;if(!I.match(/[a-zA-Z]/,!1)){Dr(_,"Invalid argument: "+$.argString.substring(Q));return}var B=I.next();if(I.match("-",!0)){if(!I.match(/[a-zA-Z]/,!1)){Dr(_,"Invalid argument: "+$.argString.substring(Q));return}var X=B,J=I.next();if(X&&J&&O(X)==O(J)){var re=X.charCodeAt(0),he=J.charCodeAt(0);if(re>=he){Dr(_,"Invalid argument: "+$.argString.substring(Q));return}for(var pe=0;pe<=he-re;pe++){var $e=String.fromCharCode(re+pe);delete R.marks[$e]}}else{Dr(_,"Invalid argument: "+X+"-");return}}else B&&delete R.marks[B]}}},Df=new bct;function Oct(_,$,R,I,Q,B,X,J,re){_.state.vim.exMode=!0;var he=!1,pe,$e,Te;function Se(){_.operation(function(){for(;!he;)xe(),qe();Bt()})}function xe(){var Gt=_.getRange(B.from(),B.to()),Mr=Gt.replace(X,J),na=B.to().line;B.replace(Mr),$e=B.to().line,Q+=$e-na,Te=$e<na}function Ne(){var Gt=pe&&Qt(B.to()),Mr=B.findNext();return Mr&&!Mr[0]&&Gt&&An(B.from(),Gt)&&(Mr=B.findNext()),Mr}function qe(){for(;Ne()&&vct(B.from(),I,Q);)if(!(!R&&B.from().line==$e&&!Te)){_.scrollIntoView(B.from(),30),_.setSelection(B.from(),B.to()),pe=B.from(),he=!1;return}he=!0}function Bt(Gt){if(Gt&&Gt(),_.focus(),pe){_.setCursor(pe);var Mr=_.state.vim;Mr.exMode=!1,Mr.lastHPos=Mr.lastHSPos=pe.ch}re&&re()}function kt(Gt,Mr,na){e.e_stop(Gt);var No=ae(Gt);switch(No){case"y":xe(),qe();break;case"n":qe();break;case"a":var Ss=re;re=void 0,_.operation(Se),re=Ss;break;case"l":xe();case"q":case"<Esc>":case"<C-c>":case"<C-[>":Bt(na);break}return he&&Bt(na),!0}if(qe(),he){Dr(_,"No matches for "+X.source);return}if(!$){Se(),re&&re();return}U_(_,{prefix:Pm("span","replace with ",Pm("strong",J)," (y/n/a/q/l)"),onKeyDown:kt})}function Am(_,$){var R=_.state.vim,I=z.macroModeState,Q=z.registerController.getRegister("."),B=I.isPlaying,X=I.lastInsertModeChanges;B||(_.off("change",yme),R.insertEnd&&R.insertEnd.clear(),R.insertEnd=void 0,e.off(_.getInputField(),"keydown",Ome)),!B&&R.insertModeRepeat>1&&(xme(_,R,R.insertModeRepeat-1,!0),R.lastEditInputState.repeatOverride=R.insertModeRepeat),delete R.insertModeRepeat,R.insertMode=!1,$||_.setCursor(_.getCursor().line,_.getCursor().ch-1),_.setOption("keyMap","vim"),_.setOption("disableInput",!0),_.toggleOverwrite(!1),Q.setText(X.changes.join("")),e.signal(_,"vim-mode-change",{mode:"normal"}),I.isRecording&&Ect(I)}function mme(_){r.unshift(_)}function xct(_,$,R,I,Q){var B={keys:_,type:$};B[$]=R,B[$+"Args"]=I;for(var X in Q)B[X]=Q[X];mme(B)}D("insertModeEscKeysTimeout",200,"number");function wct(_,$,R,I){var Q=z.registerController.getRegister(I);if(I==":"){Q.keyBuffer[0]&&Df.processCommand(_,Q.keyBuffer[0]),R.isPlaying=!1;return}var B=Q.keyBuffer,X=0;R.isPlaying=!0,R.replaySearchQueries=Q.searchQueries.slice(0);for(var J=0;J<B.length;J++)for(var re=B[J],he,pe,$e=/<(?:[CSMA]-)*\w+>|./gi;he=$e.exec(re);)if(pe=he[0],q.handleKey(_,pe,"macro"),$.insertMode){var Te=Q.insertModeChanges[X++].changes;z.macroModeState.lastInsertModeChanges.changes=Te,Sme(_,Te,1),Am(_)}R.isPlaying=!1}function Sct(_,$){if(!_.isPlaying){var R=_.latestRegister,I=z.registerController.getRegister(R);I&&I.pushText($)}}function Ect(_){if(!_.isPlaying){var $=_.latestRegister,R=z.registerController.getRegister($);R&&R.pushInsertModeChanges&&R.pushInsertModeChanges(_.lastInsertModeChanges)}}function Cct(_,$){if(!_.isPlaying){var R=_.latestRegister,I=z.registerController.getRegister(R);I&&I.pushSearchQuery&&I.pushSearchQuery($)}}function yme(_,$){var R=z.macroModeState,I=R.lastInsertModeChanges;if(!R.isPlaying)for(var Q=_.state.vim;$;){if(I.expectCursorActivityForChange=!0,I.ignoreCount>1)I.ignoreCount--;else if($.origin=="+input"||$.origin=="paste"||$.origin===void 0){var B=_.listSelections().length;B>1&&(I.ignoreCount=B);var X=$.text.join(`
`);if(I.maybeReset&&(I.changes=[],I.maybeReset=!1),X)if(_.state.overwrite&&!/\n/.test(X))I.changes.push([X]);else{if(X.length>1){var J=Q&&Q.insertEnd&&Q.insertEnd.find(),re=_.getCursor();if(J&&J.line==re.line){var he=J.ch-re.ch;he>0&&he<X.length&&(I.changes.push([X,he]),X="")}}X&&I.changes.push(X)}}$=$.next}}function vme(_){var Q;var $=_.state.vim;if($.insertMode){var R=z.macroModeState;if(R.isPlaying)return;var I=R.lastInsertModeChanges;I.expectCursorActivityForChange?I.expectCursorActivityForChange=!1:(I.maybeReset=!0,$.insertEnd&&$.insertEnd.clear(),$.insertEnd=_.setBookmark(_.getCursor(),{insertLeft:!0}))}else(Q=_.curOp)!=null&&Q.isVimOp||bme(_,$)}function bme(_,$){var R=_.getCursor("anchor"),I=_.getCursor("head");if($.visualMode&&!_.somethingSelected()?_i(_,!1):!$.visualMode&&!$.insertMode&&_.somethingSelected()&&($.visualMode=!0,$.visualLine=!1,e.signal(_,"vim-mode-change",{mode:"visual"})),$.visualMode){var Q=Ht(I,R)?0:-1,B=Ht(I,R)?-1:0;I=_t(I,0,Q),R=_t(R,0,B),$.sel={anchor:R,head:I},ar(_,$,"<",rr(I,R)),ar(_,$,">",Ci(I,R))}else $.insertMode||($.lastHPos=_.getCursor().ch)}function XB(_,$){this.keyName=_,this.key=$.key,this.ctrlKey=$.ctrlKey,this.altKey=$.altKey,this.metaKey=$.metaKey,this.shiftKey=$.shiftKey}function Ome(_){var $=z.macroModeState,R=$.lastInsertModeChanges,I=e.keyName?e.keyName(_):_.key;I&&(I.indexOf("Delete")!=-1||I.indexOf("Backspace")!=-1)&&(R.maybeReset&&(R.changes=[],R.maybeReset=!1),R.changes.push(new XB(I,_)))}function xme(_,$,R,I){var Q=z.macroModeState;Q.isPlaying=!0;var B=$.lastEditActionCommand,X=$.inputState;function J(){B?G.processAction(_,$,B):G.evalInput(_,$)}function re(pe){if(Q.lastInsertModeChanges.changes.length>0){pe=$.lastEditActionCommand?pe:1;var $e=Q.lastInsertModeChanges;Sme(_,$e.changes,pe)}}if($.inputState=$.lastEditInputState,B&&B.interlaceInsertRepeat)for(var he=0;he<R;he++)J(),re(1);else I||J(),re(R);$.inputState=X,$.insertMode&&!I&&Am(_),Q.isPlaying=!1}function wme(_,$){e.lookupKey($,"vim-insert",function(I){return typeof I=="string"?e.commands[I](_):I(_),!0})}function Sme(_,$,R){var I=_.getCursor("head"),Q=z.macroModeState.lastInsertModeChanges.visualBlock;Q&&(Li(_,I,Q+1),R=_.listSelections().length,_.setCursor(I));for(var B=0;B<R;B++){Q&&_.setCursor(_t(I,B,0));for(var X=0;X<$.length;X++){var J=$[X];if(J instanceof XB)wme(_,J.keyName);else if(typeof J=="string")_.replaceSelection(J);else{var re=_.getCursor(),he=_t(re,0,J[0].length-(J[1]||0));_.replaceRange(J[0],re,J[1]?re:he),_.setCursor(he)}}}Q&&_.setCursor(_t(I,0,1))}function ZB(_){var $=new _.constructor;return Object.keys(_).forEach(function(R){if(R!="insertEnd"){var I=_[R];Array.isArray(I)?I=I.slice():I&&typeof I=="object"&&I.constructor!=Object&&(I=ZB(I)),$[R]=I}}),_.sel&&($.sel={head:_.sel.head&&Qt(_.sel.head),anchor:_.sel.anchor&&Qt(_.sel.anchor)}),$}function _ct(_,$,R){var B=j(_),I=_,Q=!1,B=q.maybeInitVimState_(I),X=B.visualBlock||B.wasInVisualBlock,J=I.isInMultiSelectMode();if(B.wasInVisualBlock&&!J?B.wasInVisualBlock=!1:J&&B.visualBlock&&(B.wasInVisualBlock=!0),$=="<Esc>"&&!B.insertMode&&!B.visualMode&&J&&B.status=="<Esc>")Ee(I);else if(X||!J||I.inVirtualSelectionMode)Q=q.handleKey(I,$,R);else{var re=ZB(B),he=B.inputState.changeQueueList||[];I.operation(function(){var $e;I.curOp&&(I.curOp.isVimOp=!0);var pe=0;I.forEachSelection(function(){I.state.vim.inputState.changeQueue=he[pe];var Te=I.getCursor("head"),Se=I.getCursor("anchor"),xe=Ht(Te,Se)?0:-1,Ne=Ht(Te,Se)?-1:0;Te=_t(Te,0,xe),Se=_t(Se,0,Ne),I.state.vim.sel.head=Te,I.state.vim.sel.anchor=Se,Q=q.handleKey(I,$,R),I.virtualSelection&&(he[pe]=I.state.vim.inputState.changeQueue,I.state.vim=ZB(re)),pe++}),($e=I.curOp)!=null&&$e.cursorActivity&&!Q&&(I.curOp.cursorActivity=!1),I.state.vim=B,B.inputState.changeQueueList=he,B.inputState.changeQueue=null},!0)}return Q&&!B.visualMode&&!B.insert&&B.visualMode!=I.somethingSelected()&&bme(I,B),Q}return W(),q}function Ya(e,t){var n=t.ch,r=t.line+1;r<1&&(r=1,n=0),r>e.lines&&(r=e.lines,n=Number.MAX_VALUE);var i=e.line(r);return Math.min(i.from+Math.max(0,n),i.to)}function Ou(e,t){let n=e.lineAt(t);return{line:n.number-1,ch:t-n.from}}class vh{constructor(t,n){this.line=t,this.ch=n}}function vtt(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||[]).concat(n)}}function btt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else{var r=e._handlers,i=r&&r[t];if(i){var o=i.indexOf(n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ott(e,t,...n){var r,i=(r=e._handlers)===null||r===void 0?void 0:r[t];if(i)for(var o=0;o<i.length;++o)i[o](...n)}function i$e(e,...t){if(e)for(var n=0;n<e.length;++n)e[n](...t)}let xee;try{xee=new RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{xee=/[\w]/}function eT(e,t){var n=e.cm6;if(!n.state.readOnly){var r="input.type.compose";if(e.curOp&&(e.curOp.lastChange||(r="input.type.compose.start")),t.annotations)try{t.annotations.some(function(i){i.value=="input"&&(i.value=r)})}catch(i){console.error(i)}else t.userEvent=r;return n.dispatch(t)}}function o$e(e,t){var n;e.curOp&&(e.curOp.$changeStart=void 0),(t?uae:b3)(e.cm6);let r=(n=e.curOp)===null||n===void 0?void 0:n.$changeStart;r!=null&&e.cm6.dispatch({selection:{anchor:r}})}var JAn={};class vn{openDialog(t,n,r){return tRn(this,t,n,r)}openNotification(t,n){return eRn(this,t,n)}constructor(t){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=t,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(t,n){vtt(this,t,n)}off(t,n){btt(this,t,n)}signal(t,n,r){Ott(this,t,n,r)}indexFromPos(t){return Ya(this.cm6.state.doc,t)}posFromIndex(t){return Ou(this.cm6.state.doc,t)}foldCode(t){let n=this.cm6,r=n.state.selection.ranges,i=this.cm6.state.doc,o=Ya(i,t),s=Ae.create([Ae.range(o,o)],0).ranges;n.state.selection.ranges=s,W6e(n),n.state.selection.ranges=r}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(t,n){typeof t=="object"&&(n=t.ch,t=t.line);var r=Ya(this.cm6.state.doc,{line:t,ch:n||0});this.cm6.dispatch({selection:{anchor:r}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(t){var n=this.cm6.state.selection.main,r=t=="head"||!t?n.head:t=="anchor"?n.anchor:t=="start"?n.from:t=="end"?n.to:null;if(r==null)throw new Error("Invalid cursor type");return this.posFromIndex(r)}listSelections(){var t=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(n=>({anchor:Ou(t,n.anchor),head:Ou(t,n.head)}))}setSelections(t,n){var r=this.cm6.state.doc,i=t.map(o=>Ae.range(Ya(r,o.anchor),Ya(r,o.head)));this.cm6.dispatch({selection:Ae.create(i,n)})}setSelection(t,n,r){var i=this.cm6.state.doc,o=[Ae.range(Ya(i,t),Ya(i,n))];this.cm6.dispatch({selection:Ae.create(o,0)}),r&&r.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(t){var n=this.cm6.state.doc;return t<0||t>=n.lines?"":this.cm6.state.doc.line(t+1).text}getLineHandle(t){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:t,index:this.indexFromPos(new vh(t,0))}}getLineNumber(t){var n=this.$lineHandleChanges;if(!n)return null;for(var r=t.index,i=0;i<n.length;i++)if(r=n[i].changes.mapPos(r,1,qo.TrackAfter),r==null)return null;var o=this.posFromIndex(r);return o.ch==0?o.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(t,n){var r=this.cm6.state.doc;return this.cm6.state.sliceDoc(Ya(r,t),Ya(r,n))}replaceRange(t,n,r,i){r||(r=n);var o=this.cm6.state.doc,s=Ya(o,n),a=Ya(o,r);eT(this,{changes:{from:s,to:a,insert:t}})}replaceSelection(t){eT(this,this.cm6.state.replaceSelection(t))}replaceSelections(t){var n=this.cm6.state.selection.ranges,r=n.map((i,o)=>({from:i.from,to:i.to,insert:t[o]||""}));eT(this,{changes:r})}getSelection(){return this.getSelections().join(`
`)}getSelections(){var t=this.cm6;return t.state.selection.ranges.map(n=>t.state.sliceDoc(n.from,n.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(t=>!t.empty)}getInputField(){return this.cm6.contentDOM}clipPos(t){var n=this.cm6.state.doc,r=t.ch,i=t.line+1;i<1&&(i=1,r=0),i>n.lines&&(i=n.lines,r=Number.MAX_VALUE);var o=n.line(i);return r=Math.min(Math.max(0,r),o.to-o.from),new vh(i-1,r)}getValue(){return this.cm6.state.doc.toString()}setValue(t){var n=this.cm6;return n.dispatch({changes:{from:0,to:n.state.doc.length,insert:t},selection:Ae.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(t,n){var r=this.cm6.state,i=Ya(r.doc,t),o=qu(r,i+1,-1);return o&&o.end?{to:Ou(r.doc,o.end.from)}:(o=qu(r,i,1),o&&o.end?{to:Ou(r.doc,o.end.from)}:{to:void 0})}scanForBracket(t,n,r,i){return iRn(this,t,n,r,i)}indentLine(t,n){n?this.indentMore():this.indentLess()}indentMore(){s8(this.cm6)}indentLess(){gae(this.cm6)}execCommand(t){if(t=="indentAuto")vn.commands.indentAuto(this);else if(t=="goLineLeft")$ze(this.cm6);else if(t=="goLineRight"){kze(this.cm6);let n=this.cm6.state,r=n.selection.main.head;r<n.doc.length&&n.sliceDoc(r,r+1)!==`
`&&d8t(this.cm6)}else console.log(t+" is not implemented")}setBookmark(t,n){var r=n!=null&&n.insertLeft?1:-1,i=this.indexFromPos(t),o=new aRn(this,i,r);return o}addOverlay({query:t}){let n=new Tv({regexp:!0,search:t.source,caseSensitive:!/i/.test(t.flags)});if(n.valid){n.forVim=!0,this.cm6Query=n;let r=B0.of(n);return this.cm6.dispatch({effects:r}),n}}removeOverlay(t){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let n=B0.of(this.cm6Query);this.cm6.dispatch({effects:n})}getSearchCursor(t,n){var r=this,i=null,o=null;n.ch==null&&(n.ch=Number.MAX_VALUE);var s=Ya(r.cm6.state.doc,n),a=t.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(d,h){return h||"\\"+d});function l(d,h=0,p=d.length){return new ble(d,a,{ignoreCase:t.ignoreCase},h,p)}function c(d){var h=r.cm6.state.doc;if(d>h.length)return null;let p=l(h,d).next();return p.done?null:p.value}var u=1e4;function f(d,h){var p=r.cm6.state.doc;for(let g=1;;g++){let v=Math.max(d,h-g*u),y=l(p,v,h),O=null;for(;!y.next().done;)O=y.value;if(O&&(v==d||O.from>v+10))return O;if(v==d)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(d){var h=r.cm6.state.doc;if(d){let p=i?i.from==i.to?i.to-1:i.from:s;i=f(0,p)}else{let p=i?i.from==i.to?i.to+1:i.to:s;i=c(p)}return o=i&&{from:Ou(h,i.from),to:Ou(h,i.to),match:i.match},i&&i.match},from:function(){return o==null?void 0:o.from},to:function(){return o==null?void 0:o.to},replace:function(d){i&&(eT(r,{changes:{from:i.from,to:i.to,insert:d}}),i.to=i.from+d.length,o&&(o.to=Ou(r.cm6.state.doc,i.to)))}}}findPosV(t,n,r,i){let{cm6:o}=this;const s=o.state.doc;let a=r=="page"?o.dom.clientHeight:0;const l=Ya(s,t);let c=Ae.range(l,l,i),u=Math.round(Math.abs(n));for(let d=0;d<u;d++)r=="page"?c=o.moveVertically(c,n>0,a):r=="line"&&(c=o.moveVertically(c,n>0));let f=Ou(s,c.head);return(n<0&&c.head==0&&i!=0&&t.line==0&&t.ch!=0||n>0&&c.head==s.length&&f.ch!=i&&t.line==f.line)&&(f.hitSide=!0),f}charCoords(t,n){var r=this.cm6.contentDOM.getBoundingClientRect(),i=Ya(this.cm6.state.doc,t),o=this.cm6.coordsAtPos(i),s=-r.top;return{left:((o==null?void 0:o.left)||0)-r.left,top:((o==null?void 0:o.top)||0)+s,bottom:((o==null?void 0:o.bottom)||0)+s}}coordsChar(t,n){var r=this.cm6.contentDOM.getBoundingClientRect(),i=this.cm6.posAtCoords({x:t.left+r.left,y:t.top+r.top})||0;return Ou(this.cm6.state.doc,i)}getScrollInfo(){var t=this.cm6.scrollDOM;return{left:t.scrollLeft,top:t.scrollTop,height:t.scrollHeight,width:t.scrollWidth,clientHeight:t.clientHeight,clientWidth:t.clientWidth}}scrollTo(t,n){t!=null&&(this.cm6.scrollDOM.scrollLeft=t),n!=null&&(this.cm6.scrollDOM.scrollTop=n)}scrollIntoView(t,n){if(t){var r=this.indexFromPos(t);this.cm6.dispatch({effects:Ve.scrollIntoView(r)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(t,n){this.cm6.dom.style.width=t+4+"px",this.cm6.dom.style.height=n+"px",this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(t){this.$lineHandleChanges&&this.$lineHandleChanges.push(t);for(let r in this.marks)this.marks[r].update(t.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(r=>r.map(t.changes)));var n=this.curOp=this.curOp||{};t.changes.iterChanges((r,i,o,s,a)=>{(n.$changeStart==null||n.$changeStart>o)&&(n.$changeStart=o),this.$lastChangeEndOffset=s;var l={text:a.toJSON()};n.lastChange?n.lastChange.next=n.lastChange=l:n.lastChange=n.change=l},!0),n.changeHandlers||(n.changeHandlers=this._handlers.change&&this._handlers.change.slice())}onSelectionChange(){var t=this.curOp=this.curOp||{};t.cursorActivityHandlers||(t.cursorActivityHandlers=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice()),this.curOp.cursorActivity=!0}operation(t,n){this.curOp||(this.curOp={$d:0}),this.curOp.$d++;try{var r=t()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return r}onBeforeEndOperation(){var t=this.curOp,n=!1;t&&(t.change&&i$e(t.changeHandlers,this,t.change),t&&t.cursorActivity&&(i$e(t.cursorActivityHandlers,this,null),t.isVimOp&&(n=!0)),this.curOp=null),n&&this.scrollIntoView()}moveH(t,n){if(n=="char"){var r=this.getCursor();this.setCursor(r.line,r.ch+t)}}setOption(t,n){switch(t){case"keyMap":this.state.keyMap=n;break;case"textwidth":this.state.textwidth=n;break}}getOption(t){switch(t){case"firstLineNumber":return 1;case"tabSize":return this.cm6.state.tabSize||4;case"readOnly":return this.cm6.state.readOnly;case"indentWithTabs":return this.cm6.state.facet(Gg)=="	";case"indentUnit":return this.cm6.state.facet(Gg).length||2;case"textwidth":return this.state.textwidth;case"keyMap":return this.state.keyMap||"vim"}}toggleOverwrite(t){this.state.overwrite=t}getTokenTypeAt(t){var n,r=this.indexFromPos(t),i=D6e(this.cm6.state,r),o=i==null?void 0:i.resolve(r),s=((n=o==null?void 0:o.type)===null||n===void 0?void 0:n.name)||"";return/comment/i.test(s)?"comment":/string/i.test(s)?"string":""}overWriteSelection(t){var n=this.cm6.state.doc,r=this.cm6.state.selection,i=r.ranges.map(o=>{if(o.empty){var s=o.to<n.length?n.sliceString(o.from,o.to+1):"";if(s&&!/\n/.test(s))return Ae.range(o.from,o.to+1)}return o});this.cm6.dispatch({selection:Ae.create(i,r.mainIndex)}),this.replaceSelection(t)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(t){var n=this.cm6.state.selection;this.virtualSelection=Ae.create(n.ranges,n.mainIndex);for(var r=0;r<this.virtualSelection.ranges.length;r++){var i=this.virtualSelection.ranges[r];i&&(this.cm6.dispatch({selection:Ae.create([i])}),t(),this.virtualSelection.ranges[r]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(t){return lRn(this,t)}}vn.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform);vn.Pos=vh;vn.StringStream=rae;vn.commands={cursorCharLeft:function(e){hae(e.cm6)},redo:function(e){o$e(e,!1)},undo:function(e){o$e(e,!0)},newlineAndIndent:function(e){Wze({state:e.cm6.state,dispatch:t=>eT(e,t)})},indentAuto:function(e){Vze(e.cm6)},newlineAndIndentContinueComment:void 0,save:void 0};vn.isWordChar=function(e){return xee.test(e)};vn.keys=JAn;vn.addClass=function(e,t){};vn.rmClass=function(e,t){};vn.e_preventDefault=function(e){e.preventDefault()};vn.e_stop=function(e){var t,n;(t=e==null?void 0:e.stopPropagation)===null||t===void 0||t.call(e),(n=e==null?void 0:e.preventDefault)===null||n===void 0||n.call(e)};vn.lookupKey=function(t,n,r){var i=vn.keys[t];i&&r(i)};vn.on=vtt;vn.off=btt;vn.signal=Ott;vn.findMatchingTag=oRn;vn.findEnclosingTag=sRn;vn.keyName=void 0;function xtt(e,t,n){var r=document.createElement("div");return r.appendChild(t),r}function wtt(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}function eRn(e,t,n){wtt(e,a);var r=xtt(e,t,n&&n.bottom),i=!1,o,s=n&&typeof n.duration<"u"?n.duration:5e3;function a(){i||(i=!0,clearTimeout(o),r.remove(),Ett(e,r))}return r.onclick=function(l){l.preventDefault(),a()},Stt(e,r),s&&(o=setTimeout(a,s)),a}function Stt(e,t){var n=e.state.dialog;e.state.dialog=t,t&&n!==t&&(n&&n.contains(document.activeElement)&&e.focus(),n&&n.parentElement?n.parentElement.replaceChild(t,n):n&&n.remove(),vn.signal(e,"dialog"))}function Ett(e,t){e.state.dialog==t&&(e.state.dialog=null,vn.signal(e,"dialog"))}function tRn(e,t,n,r){r||(r={}),wtt(e,void 0);var i=xtt(e,t,r.bottom),o=!1;Stt(e,i);function s(l){if(typeof l=="string")a.value=l;else{if(o)return;o=!0,Ett(e,i),e.state.dialog||e.focus(),r.onClose&&r.onClose(i)}}var a=i.getElementsByTagName("input")[0];return a&&(r.value&&(a.value=r.value,r.selectValueOnOpen!==!1&&a.select()),r.onInput&&vn.on(a,"input",function(l){r.onInput(l,a.value,s)}),r.onKeyUp&&vn.on(a,"keyup",function(l){r.onKeyUp(l,a.value,s)}),vn.on(a,"keydown",function(l){r&&r.onKeyDown&&r.onKeyDown(l,a.value,s)||(l.keyCode==13&&n(a.value),(l.keyCode==27||r.closeOnEnter!==!1&&l.keyCode==13)&&(a.blur(),vn.e_stop(l),s()))}),r.closeOnBlur!==!1&&vn.on(a,"blur",function(){setTimeout(function(){document.activeElement!==a&&s()})}),a.focus()),s}var nRn={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function rRn(e){return e&&e.bracketRegex||/[(){}[\]]/}function iRn(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,s=i&&i.maxScanLines||1e3,a=[],l=rRn(i),c=n>0?Math.min(t.line+s,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-s),u=t.line;u!=c;u+=n){var f=e.getLine(u);if(f){var d=n>0?0:f.length-1,h=n>0?f.length:-1;if(!(f.length>o))for(u==t.line&&(d=t.ch-(n<0?1:0));d!=h;d+=n){var p=f.charAt(d);if(l.test(p)){var g=nRn[p];if(g&&g.charAt(1)==">"==n>0)a.push(p);else if(a.length)a.pop();else return{pos:new vh(u,d),ch:p}}}}}return u-n==(n>0?e.lastLine():e.firstLine())?!1:null}function oRn(e,t){}function sRn(e,t){var n,r,i=e.cm6.state,o=e.indexFromPos(t);if(o<i.doc.length){var s=i.sliceDoc(o,o+1);s=="<"&&o++}for(var a=D6e(i,o),l=(a==null?void 0:a.resolve(o))||null;l;){if(((n=l.firstChild)===null||n===void 0?void 0:n.type.name)=="OpenTag"&&((r=l.lastChild)===null||r===void 0?void 0:r.type.name)=="CloseTag")return{open:s$e(i.doc,l.firstChild),close:s$e(i.doc,l.lastChild)};l=l.parent}}function s$e(e,t){return{from:Ou(e,t.from),to:Ou(e,t.to)}}let aRn=class{constructor(t,n,r){this.cm=t,this.id=t.$mid++,this.offset=n,this.assoc=r,t.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(t){this.offset!=null&&(this.offset=t.mapPos(this.offset,this.assoc,qo.TrackDel))}};function lRn(e,t){for(var n,r=t.column||e.getOption("textwidth")||80,i=t.allowMerge!=!1,o=Math.min(t.from,t.to),s=Math.max(t.from,t.to);o<=s;){var a=e.getLine(o);if(a.length>r){var l=p(a,r,5);if(l){var c=(n=/^\s*/.exec(a))===null||n===void 0?void 0:n[0];e.replaceRange(`
`+c,new vh(o,l.start),new vh(o,l.end))}s++}else if(i&&/\S/.test(a)&&o!=s){var u=e.getLine(o+1);if(u&&/\S/.test(u)){var f=a.replace(/\s+$/,""),d=u.replace(/^\s+/,""),h=f+" "+d,l=p(h,r,5);l&&l.start>f.length||h.length<r?(e.replaceRange(" ",new vh(o,f.length),new vh(o+1,u.length-d.length)),o--,s--):f.length<a.length&&e.replaceRange("",new vh(o,f.length),new vh(o,a.length))}}o++}return o;function p(g,v,y){if(!(g.length<v)){var O=g.slice(0,v),m=g.slice(v),w=/^(?:(\s+)|(\S+)(\s+))/.exec(m),S=/(?:(\s+)|(\s+)(\S+))$/.exec(O),E=0,C=0;if(S&&!S[2]&&(E=v-S[1].length,C=v),w&&!w[2]&&(E||(E=v),C=v+w[1].length),E)return{start:E,end:C};if(S&&S[2]&&S.index>y)return{start:S.index,end:S.index+S[2].length};if(w&&w[2])return E=v+w[2].length,{start:E,end:E+w[3].length}}}}let wee=X4t||function(){let e={cursorBlinkRate:1200};return function(){return e}}();class cRn{constructor(t,n,r,i,o,s,a,l,c,u){this.left=t,this.top=n,this.height=r,this.fontFamily=i,this.fontSize=o,this.fontWeight=s,this.color=a,this.className=l,this.letter=c,this.partial=u}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",t.style.height=this.height+"px",t.style.lineHeight=this.height+"px",t.style.fontFamily=this.fontFamily,t.style.fontSize=this.fontSize,t.style.fontWeight=this.fontWeight,t.style.color=this.partial?"transparent":this.color,t.className=this.className,t.textContent=this.letter}eq(t){return this.left==t.left&&this.top==t.top&&this.height==t.height&&this.fontFamily==t.fontFamily&&this.fontSize==t.fontSize&&this.fontWeight==t.fontWeight&&this.color==t.color&&this.className==t.className&&this.letter==t.letter}}class uRn{constructor(t,n){this.view=t,this.rangePieces=[],this.cursors=[],this.cm=n,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=t.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer cm-vimCursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),t.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let n=wee(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=n+"ms"}update(t){(t.selectionSet||t.geometryChanged||t.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),fRn(t)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:t}=this.view,n=[];for(let r of t.selection.ranges){let i=r==t.selection.main,o=gRn(this.cm,this.view,r,i);o&&n.push(o)}return{cursors:n}}drawSel({cursors:t}){if(t.length!=this.cursors.length||t.some((n,r)=>!n.eq(this.cursors[r]))){let n=this.cursorLayer.children;if(n.length!==t.length){this.cursorLayer.textContent="";for(const r of t)this.cursorLayer.appendChild(r.draw())}else t.forEach((r,i)=>r.adjust(n[i]));this.cursors=t}}destroy(){this.cursorLayer.remove()}}function fRn(e){return wee(e.startState)!=wee(e.state)}const dRn={".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-fat-cursor":{position:"absolute",background:"#ff9696",border:"none",whiteSpace:"pre"},"&:not(.cm-focused) .cm-fat-cursor":{background:"none",outline:"solid 1px #ff9696",color:"transparent !important"}},hRn=Ks.highest(Ve.theme(dRn));function pRn(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==ti.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft,top:t.top-e.scrollDOM.scrollTop}}function gRn(e,t,n,r){var i,o;let s=n.head,a=!1,l=1,c=e.state.vim;if(c&&(!c.insertMode||e.state.overwrite)){if(a=!0,c.visualBlock&&!r)return null;n.anchor<n.head&&s--,e.state.overwrite?l=.2:c.status&&(l=.5)}if(a){let f=s<t.state.doc.length&&t.state.sliceDoc(s,s+1);f&&/[\uDC00-\uDFFF]/.test(f)&&s>1&&(s--,f=t.state.sliceDoc(s,s+1));let d=t.coordsAtPos(s,1);if(!d)return null;let h=pRn(t),p=t.domAtPos(s),g=p?p.node:t.contentDOM;for(;p&&p.node instanceof HTMLElement;)g=p.node,p={node:p.node.childNodes[p.offset],offset:0};if(!(g instanceof HTMLElement)){if(!g.parentNode)return null;g=g.parentNode}let v=getComputedStyle(g),y=d.left,O=(o=(i=t).coordsForChar)===null||o===void 0?void 0:o.call(i,s);if(O&&(y=O.left),!f||f==`
`||f=="\r")f=" ";else if(f=="	"){f=" ";var u=t.coordsAtPos(s+1,-1);u&&(y=u.left-(u.left-d.left)/parseInt(v.tabSize))}else/[\uD800-\uDBFF]/.test(f)&&s<t.state.doc.length-1&&(f+=t.state.sliceDoc(s+1,s+2));let m=d.bottom-d.top;return new cRn(y-h.left,d.top-h.top+m*(1-l),m*l,v.fontFamily,v.fontSize,v.fontWeight,v.color,r?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",f,l!=1)}else return null}var mRn=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent);const Jm=KAn(vn),yRn=250,vRn=Ve.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:"none"},".cm-vim-panel":{padding:"0px 10px",fontFamily:"monospace",minHeight:"1.3em"},".cm-vim-panel input":{border:"none",outline:"none",backgroundColor:"inherit"},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"}}),bRn=jr.fromClass(class{constructor(e){this.status="",this.query=null,this.decorations=st.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=e;const t=this.cm=new vn(e);Jm.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new uRn(e,t),this.updateClass(),this.cm.on("vim-command-done",()=>{t.state.vim&&(t.state.vim.status=""),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on("vim-mode-change",n=>{t.state.vim&&(t.state.vim.mode=n.mode,n.subMode&&(t.state.vim.mode+=" block"),t.state.vim.status="",this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on("dialog",()=>{this.cm.state.statusbar?this.updateStatus():e.dispatch({effects:Ctt.of(!!this.cm.state.dialog)})}),this.dom=document.createElement("span"),this.dom.style.cssText="position: absolute; right: 10px; top: 1px",this.statusButton=document.createElement("span"),this.statusButton.onclick=n=>{Jm.handleKey(this.cm,"<Esc>","user"),this.cm.focus()},this.statusButton.style.cssText="cursor: pointer"}update(e){var t;if((e.viewportChanged||e.docChanged)&&this.query&&this.highlight(this.query),e.docChanged&&this.cm.onChange(e),e.selectionSet&&this.cm.onSelectionChange(),e.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),e.transactions){for(let n of e.transactions)for(let r of n.effects)if(r.is(B0))if(!((t=r.value)===null||t===void 0?void 0:t.forVim))this.highlight(null);else{let o=r.value.create();this.highlight(o)}}this.blockCursor.update(e)}updateClass(){const e=this.cm.state;!e.vim||e.vim.insertMode&&!e.overwrite?this.view.scrollDOM.classList.remove("cm-vimMode"):this.view.scrollDOM.classList.add("cm-vimMode")}updateStatus(){let e=this.cm.state.statusbar,t=this.cm.state.vim;if(!e||!t)return;let n=this.cm.state.dialog;if(n)n.parentElement!=e&&(e.textContent="",e.appendChild(n));else{e.textContent="";var r=(t.mode||"normal").toUpperCase();t.insertModeReturn&&(r+="(C-O)"),this.statusButton.textContent=`--${r}--`,e.appendChild(this.statusButton)}this.dom.textContent=t.status,e.appendChild(this.dom)}destroy(){Jm.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(e){if(this.query=e,!e)return this.decorations=st.none;let{view:t}=this,n=new Ol;for(let r=0,i=t.visibleRanges,o=i.length;r<o;r++){let{from:s,to:a}=i[r];for(;r<o-1&&a>i[r+1].from-2*yRn;)a=i[++r].to;e.highlight(t.state,s,a,(l,c)=>{n.add(l,c,xRn)})}return this.decorations=n.finish()}handleKey(e,t){const n=this.cm;let r=n.state.vim;if(!r)return;const i=Jm.vimKeyFromEvent(e,r);if(vn.signal(this.cm,"inputEvent",{type:"handleKey",key:i}),!i)return;if(i=="<Esc>"&&!r.insertMode&&!r.visualMode&&this.query){const a=r.searchState_;a&&(n.removeOverlay(a.getOverlay()),a.setOverlay(null))}if(i==="<C-c>"&&!vn.isMac&&n.somethingSelected())return this.waitForCopy=!0,!0;r.status=(r.status||"")+i;let s=Jm.multiSelectHandleKey(n,i,"user");return r=Jm.maybeInitVimState_(n),!s&&r.insertMode&&n.state.overwrite&&(e.key&&e.key.length==1&&!/\n/.test(e.key)?(s=!0,n.overWriteSelection(e.key)):e.key=="Backspace"&&(s=!0,vn.commands.cursorCharLeft(n))),s&&(vn.signal(this.cm,"vim-keypress",i),e.preventDefault(),e.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!s}},{eventHandlers:{copy:function(e,t){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var n=this.cm,r=n.state.vim;r&&(r.insertMode?n.setSelection(n.getCursor(),n.getCursor()):n.operation(()=>{n.curOp&&(n.curOp.isVimOp=!0),Jm.handleKey(n,"<Esc>","user")}))}))},compositionstart:function(e,t){this.useNextTextInput=!0,vn.signal(this.cm,"inputEvent",e)},compositionupdate:function(e,t){vn.signal(this.cm,"inputEvent",e)},compositionend:function(e,t){vn.signal(this.cm,"inputEvent",e)},keypress:function(e,t){vn.signal(this.cm,"inputEvent",e),this.lastKeydown=="Dead"&&this.handleKey(e,t)},keydown:function(e,t){vn.signal(this.cm,"inputEvent",e),this.lastKeydown=e.key,this.lastKeydown=="Unidentified"||this.lastKeydown=="Process"||this.lastKeydown=="Dead"?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(e,t))}},provide:()=>[Ve.inputHandler.of((e,t,n,r)=>{var i,o,s=_tt(e);if(!s)return!1;var a=(i=s.state)===null||i===void 0?void 0:i.vim,l=s.state.vimPlugin;if(a&&!a.insertMode&&!(!((o=s.curOp)===null||o===void 0)&&o.isVimOp)){if(r==="\0\0")return!0;if(vn.signal(s,"inputEvent",{type:"text",text:r,from:t,to:n}),r.length==1&&l.useNextTextInput){if(a.expectLiteralNext&&e.composing)return l.compositionText=r,!1;if(l.compositionText){var c=l.compositionText;l.compositionText="";var u=e.state.selection.main.head,f=e.state.sliceDoc(u-c.length,u);if(c===f){var d=s.getCursor();s.replaceRange("",s.posFromIndex(u-c.length),d)}}return l.handleKey({key:r,preventDefault:()=>{},stopPropagation:()=>{}}),ORn(e),!0}}return!1})],decorations:e=>e.decorations});function ORn(e){var t=e.scrollDOM.parentElement;if(t){if(mRn){e.contentDOM.textContent="\0\0",e.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var n=e.scrollDOM.nextSibling,r=window.getSelection(),i=r&&{anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset};e.scrollDOM.remove(),t.insertBefore(e.scrollDOM,n);try{i&&r&&(r.setPosition(i.anchorNode,i.anchorOffset),i.focusNode&&r.extend(i.focusNode,i.focusOffset))}catch(o){console.error(o)}e.focus(),e.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}const xRn=st.mark({class:"cm-searchMatch"}),Ctt=jt.define(),wRn=di.define({create:()=>!1,update(e,t){for(let n of t.effects)n.is(Ctt)&&(e=n.value);return e},provide:e=>I0.from(e,t=>t?SRn:null)});function SRn(e){let t=document.createElement("div");t.className="cm-vim-panel";let n=e.cm;return n.state.dialog&&t.appendChild(n.state.dialog),{top:!1,dom:t}}function ERn(e){let t=document.createElement("div");t.className="cm-vim-panel";let n=e.cm;return n.state.statusbar=t,n.state.vimPlugin.updateStatus(),{dom:t}}function CRn(e={}){return[vRn,bRn,hRn,e.status?I0.of(ERn):wRn]}function _tt(e){return e.cm||null}function ktt(e){const t=e.state.selection.main;return t.from===0&&t.to===0}function $tt(e,t=!1){const n=e.state.selection.main,r=e.state.doc.length;return t&&n.from===r-1&&n.to===r-1?!0:n.from===r&&n.to===r}function a$e(e){var n;const t=(n=_tt(e))==null?void 0:n.state.vim;return t?!t.mode&&!t.insertMode&&!t.visualMode?!0:t.mode==="normal":!1}function _Rn(e){return[wi.of([{key:"j",run:t=>$tt(t,!0)&&a$e(t)?(e.focusDown(),!0):!1}]),wi.of([{key:"k",run:t=>ktt(t)&&a$e(t)?(e.focusUp(),!0):!1}])]}const kRn=["default","vim"];function $Rn(e,t){switch(e.preset){case"default":return[wi.of(x3),wi.of([{key:"Escape",preventDefault:!0,run:n=>(n.contentDOM.blur(),!0)}])];case"vim":return Jm.defineEx("dcell","dcell",()=>{t.deleteCell()}),[_Rn(t),Ks.highest(TRn("d",n=>n.state.doc.toString()==="",n=>n.state.doc.toString()===""?(t.deleteCell(),!0):!1)),CRn({status:!1}),wi.of(x3)];default:return Ld(e.preset),[]}}function TRn(e,t,n){let r="",i=0;return wi.of([{any:(o,s)=>{const a=s.key,l=s.timeStamp;return a!==e||!t(o)?(r="",i=0,!1):r===e&&l-i<500&&n(o)?(r="",i=0,!0):(r=a,i=l,!1)}}])}const Ttt="marimo:copilot:signedIn",PRn=F6t(Ttt,null,void 0,{getOnInit:!0});function ARn(){return localStorage.getItem(Ttt)==="true"}function Ptt(){const e=ARn(),t=oNe();return e&&t.completion.copilot}function RRn(){return fdt(uR,e=>e.completion.copilot)}var q4={},Att={},ope={exports:{}},qS=typeof Reflect=="object"?Reflect:null,l$e=qS&&typeof qS.apply=="function"?qS.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},CL;qS&&typeof qS.ownKeys=="function"?CL=qS.ownKeys:Object.getOwnPropertySymbols?CL=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:CL=function(t){return Object.getOwnPropertyNames(t)};function DRn(e){console&&console.warn&&console.warn(e)}var Rtt=Number.isNaN||function(t){return t!==t};function Fr(){Fr.init.call(this)}ope.exports=Fr;ope.exports.once=LRn;Fr.EventEmitter=Fr;Fr.prototype._events=void 0;Fr.prototype._eventsCount=0;Fr.prototype._maxListeners=void 0;var c$e=10;function ZQ(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Fr,"defaultMaxListeners",{enumerable:!0,get:function(){return c$e},set:function(e){if(typeof e!="number"||e<0||Rtt(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c$e=e}});Fr.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Fr.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Rtt(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Dtt(e){return e._maxListeners===void 0?Fr.defaultMaxListeners:e._maxListeners}Fr.prototype.getMaxListeners=function(){return Dtt(this)};Fr.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i=t==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var s;if(n.length>0&&(s=n[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[t];if(l===void 0)return!1;if(typeof l=="function")l$e(l,this,n);else for(var c=l.length,u=jtt(l,c),r=0;r<c;++r)l$e(u[r],this,n);return!0};function Mtt(e,t,n,r){var i,o,s;if(ZQ(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s=="function"?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=Dtt(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,DRn(a)}return e}Fr.prototype.addListener=function(t,n){return Mtt(this,t,n,!1)};Fr.prototype.on=Fr.prototype.addListener;Fr.prototype.prependListener=function(t,n){return Mtt(this,t,n,!0)};function MRn(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Ntt(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=MRn.bind(r);return i.listener=n,r.wrapFn=i,i}Fr.prototype.once=function(t,n){return ZQ(n),this.on(t,Ntt(this,t,n)),this};Fr.prototype.prependOnceListener=function(t,n){return ZQ(n),this.prependListener(t,Ntt(this,t,n)),this};Fr.prototype.removeListener=function(t,n){var r,i,o,s,a;if(ZQ(n),i=this._events,i===void 0)return this;if(r=i[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(o=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){a=r[s].listener,o=s;break}if(o<0)return this;o===0?r.shift():NRn(r,o),r.length===1&&(i[t]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",t,a||n)}return this};Fr.prototype.off=Fr.prototype.removeListener;Fr.prototype.removeAllListeners=function(t){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var o=Object.keys(r),s;for(i=0;i<o.length;++i)s=o[i],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(i=n.length-1;i>=0;i--)this.removeListener(t,n[i]);return this};function Itt(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?IRn(i):jtt(i,i.length)}Fr.prototype.listeners=function(t){return Itt(this,t,!0)};Fr.prototype.rawListeners=function(t){return Itt(this,t,!1)};Fr.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Ltt.call(e,t)};Fr.prototype.listenerCount=Ltt;function Ltt(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Fr.prototype.eventNames=function(){return this._eventsCount>0?CL(this._events):[]};function jtt(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function NRn(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function IRn(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function LRn(e,t){return new Promise(function(n,r){function i(s){e.removeListener(t,o),r(s)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",i),n([].slice.call(arguments))}Ftt(e,t,o,{once:!0}),t!=="error"&&jRn(e,i,{once:!0})})}function jRn(e,t,n){typeof e.on=="function"&&Ftt(e,"error",t,n)}function Ftt(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function i(o){r.once&&e.removeEventListener(t,i),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var ztt=ope.exports;(function(e){var t=ft&&ft.__awaiter||function(o,s,a,l){function c(u){return u instanceof a?u:new a(function(f){f(u)})}return new(a||(a=Promise))(function(u,f){function d(g){try{p(l.next(g))}catch(v){f(v)}}function h(g){try{p(l.throw(g))}catch(v){f(v)}}function p(g){g.done?u(g.value):c(g.value).then(d,h)}p((l=l.apply(o,s||[])).next())})},n=ft&&ft.__generator||function(o,s){var a={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},l,c,u,f;return f={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function d(p){return function(g){return h([p,g])}}function h(p){if(l)throw new TypeError("Generator is already executing.");for(;a;)try{if(l=1,c&&(u=p[0]&2?c.return:p[0]?c.throw||((u=c.return)&&u.call(c),0):c.next)&&!(u=u.call(c,p[1])).done)return u;switch(c=0,u&&(p=[p[0]&2,u.value]),p[0]){case 0:case 1:u=p;break;case 4:return a.label++,{value:p[1],done:!1};case 5:a.label++,c=p[1],p=[0];continue;case 7:p=a.ops.pop(),a.trys.pop();continue;default:if(u=a.trys,!(u=u.length>0&&u[u.length-1])&&(p[0]===6||p[0]===2)){a=0;continue}if(p[0]===3&&(!u||p[1]>u[0]&&p[1]<u[3])){a.label=p[1];break}if(p[0]===6&&a.label<u[1]){a.label=u[1],u=p;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(p);break}u[2]&&a.ops.pop(),a.trys.pop();continue}p=s.call(o,a)}catch(g){p=[6,g],c=0}finally{l=u=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}};Object.defineProperty(e,"__esModule",{value:!0}),e.defaultNextRequest=void 0;var r=ztt;e.defaultNextRequest=function(){var o=-1;return function(){return++o}};var i=function(){function o(s,a){a===void 0&&(a=e.defaultNextRequest()),this.batch=[],this.batchStarted=!1,this.lastId=-1,this.transports=s,this.requests={},this.connectPromise=this.connect(),this.requestChannel=new r.EventEmitter,this.nextID=a}return o.prototype.connect=function(){var s=this;return Promise.all(this.transports.map(function(a){return t(s,void 0,void 0,function(){return n(this,function(l){switch(l.label){case 0:return a.subscribe("error",this.handleError.bind(this)),a.subscribe("notification",this.handleNotification.bind(this)),[4,a.connect()];case 1:return l.sent(),[2]}})})}))},o.prototype.getPrimaryTransport=function(){return this.transports[0]},o.prototype.request=function(s,a,l){return a===void 0&&(a=!1),t(this,void 0,void 0,function(){var c,u,f,d,h=this;return n(this,function(p){return c=this.nextID().toString(),u=a?null:c,f={request:this.makeRequest(s.method,s.params||[],u),internalID:c},this.batchStarted?(d=new Promise(function(g,v){h.batch.push({resolve:g,reject:v,request:f})}),[2,d]):[2,this.getPrimaryTransport().sendData(f,l)]})})},o.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach(function(s){s.unsubscribe(),s.close()})},o.prototype.startBatch=function(){this.batchStarted=!0},o.prototype.stopBatch=function(){if(this.batchStarted===!1)throw new Error("cannot end that which has never started");if(this.batch.length===0){this.batchStarted=!1;return}this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1},o.prototype.makeRequest=function(s,a,l){return l?{jsonrpc:"2.0",id:l,method:s,params:a}:{jsonrpc:"2.0",method:s,params:a}},o.prototype.handleError=function(s){this.requestChannel.emit("error",s)},o.prototype.handleNotification=function(s){this.requestChannel.emit("notification",s)},o}();e.default=i})(Att);var spe={},Wv={},YQ={},Q_={};(function(e){var t=ft&&ft.__extends||function(){var r=function(i,o){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,a){s.__proto__=a}||function(s,a){for(var l in a)a.hasOwnProperty(l)&&(s[l]=a[l])},r(i,o)};return function(i,o){r(i,o);function s(){this.constructor=i}i.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.convertJSONToRPCError=e.JSONRPCError=e.ERR_UNKNOWN=e.ERR_MISSIING_ID=e.ERR_TIMEOUT=void 0,e.ERR_TIMEOUT=7777,e.ERR_MISSIING_ID=7878,e.ERR_UNKNOWN=7979;var n=function(r){t(i,r);function i(o,s,a){var l=this.constructor,c=r.call(this,o)||this;return c.message=o,c.code=s,c.data=a,Object.setPrototypeOf(c,l.prototype),c}return i}(Error);e.JSONRPCError=n,e.convertJSONToRPCError=function(r){if(r.error){var i=r.error,o=i.message,s=i.code,a=i.data;return new n(o,s,a)}return new n("Unknown error",e.ERR_UNKNOWN,r)}})(Q_);Object.defineProperty(YQ,"__esModule",{value:!0});YQ.TransportRequestManager=void 0;var FRn=ztt,rw=Q_,zRn=function(){function e(){this.pendingRequest={},this.pendingBatchRequest={},this.transportEventChannel=new FRn.EventEmitter}return e.prototype.addRequest=function(t,n){return this.transportEventChannel.emit("pending",t),t instanceof Array?(this.addBatchReq(t,n),Promise.resolve()):this.addReq(t.internalID,n)},e.prototype.settlePendingRequest=function(t,n){var r=this;t.forEach(function(i){var o=r.pendingRequest[i.internalID];if(delete r.pendingBatchRequest[i.internalID],o!==void 0){if(n){o.reject(n);return}o.resolve(),(i.request.id===null||i.request.id===void 0)&&delete r.pendingRequest[i.internalID]}})},e.prototype.isPendingRequest=function(t){return this.pendingRequest.hasOwnProperty(t)},e.prototype.resolveResponse=function(t,n){n===void 0&&(n=!0);var r=t;try{return r=JSON.parse(t),this.checkJSONRPC(r)===!1?void 0:r instanceof Array?this.resolveBatch(r,n):this.resolveRes(r,n)}catch{var i=new rw.JSONRPCError("Bad response format",rw.ERR_UNKNOWN,t);return n&&this.transportEventChannel.emit("error",i),i}},e.prototype.addBatchReq=function(t,n){var r=this;return t.forEach(function(i){var o=i.resolve,s=i.reject,a=i.request.internalID;r.pendingBatchRequest[a]=!0,r.pendingRequest[a]={resolve:o,reject:s}}),Promise.resolve()},e.prototype.addReq=function(t,n){var r=this;return new Promise(function(i,o){n!==null&&n&&r.setRequestTimeout(t,n,o),r.pendingRequest[t]={resolve:i,reject:o}})},e.prototype.checkJSONRPC=function(t){var n=[t];return t instanceof Array&&(n=t),n.every(function(r){return r.result!==void 0||r.error!==void 0||r.method!==void 0})},e.prototype.processResult=function(t,n){if(t.error){var r=rw.convertJSONToRPCError(t);n.reject(r);return}n.resolve(t.result)},e.prototype.resolveBatch=function(t,n){var r=this,i=t.map(function(s){return r.resolveRes(s,n)}),o=i.filter(function(s){return s});if(o.length>0)return o[0]},e.prototype.resolveRes=function(t,n){var r=t.id,i=t.error,o=this.pendingRequest[r];if(o){delete this.pendingRequest[r],this.processResult(t,o),this.transportEventChannel.emit("response",t);return}if(r===void 0&&i===void 0){this.transportEventChannel.emit("notification",t);return}var s;return i&&(s=rw.convertJSONToRPCError(t)),n&&i&&s&&this.transportEventChannel.emit("error",s),s},e.prototype.setRequestTimeout=function(t,n,r){var i=this;setTimeout(function(){delete i.pendingRequest[t],r(new rw.JSONRPCError("Request timeout request took longer than "+n+" ms to resolve",rw.ERR_TIMEOUT))},n)},e}();YQ.TransportRequestManager=zRn;Object.defineProperty(Wv,"__esModule",{value:!0});var Qtt=Wv.Transport=void 0,QRn=YQ,BRn=function(){function e(){this.transportRequestManager=new QRn.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return e.prototype.subscribe=function(t,n){this.transportRequestManager.transportEventChannel.addListener(t,n)},e.prototype.unsubscribe=function(t,n){if(!t)return this.transportRequestManager.transportEventChannel.removeAllListeners();t&&n&&this.transportRequestManager.transportEventChannel.removeListener(t,n)},e.prototype.parseData=function(t){return t instanceof Array?t.map(function(n){return n.request.request}):t.request},e}();Qtt=Wv.Transport=BRn;var B_={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getNotifications=e.getBatchRequests=e.isNotification=void 0,e.isNotification=function(t){return t.request.id===void 0||t.request.id===null},e.getBatchRequests=function(t){return t instanceof Array?t.filter(function(n){var r=n.request.request.id;return r!=null}).map(function(n){return n.request}):[]},e.getNotifications=function(t){return t instanceof Array?t.filter(function(n){return e.isNotification(n.request)}).map(function(n){return n.request}):e.isNotification(t)?[t]:[]}})(B_);var WRn=ft&&ft.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(spe,"__esModule",{value:!0});var qRn=Wv,VRn=B_,u$e=Q_,URn=function(e){WRn(t,e);function t(n,r,i){var o=e.call(this)||this;return o.connection=n,o.reqUri=r,o.resUri=i,o}return t.prototype.connect=function(){var n=this;return this.connection.on(this.resUri,function(r){n.transportRequestManager.resolveResponse(r)}),Promise.resolve()},t.prototype.sendData=function(n,r){r===void 0&&(r=null);var i=this.transportRequestManager.addRequest(n,r),o=VRn.getNotifications(n),s=this.parseData(n);try{return this.connection.emit(this.reqUri,s),this.transportRequestManager.settlePendingRequest(o),i}catch(l){var a=new u$e.JSONRPCError(l.message,u$e.ERR_UNKNOWN,l);return this.transportRequestManager.settlePendingRequest(o,a),Promise.reject(a)}},t.prototype.close=function(){this.connection.removeAllListeners()},t}(qRn.Transport);spe.default=URn;var nM={},Ns=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Ka={searchParams:"URLSearchParams"in Ns,iterable:"Symbol"in Ns&&"iterator"in Symbol,blob:"FileReader"in Ns&&"Blob"in Ns&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in Ns,arrayBuffer:"ArrayBuffer"in Ns};function HRn(e){return e&&DataView.prototype.isPrototypeOf(e)}if(Ka.arrayBuffer)var XRn=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],ZRn=ArrayBuffer.isView||function(e){return e&&XRn.indexOf(Object.prototype.toString.call(e))>-1};function W_(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function ape(e){return typeof e!="string"&&(e=String(e)),e}function lpe(e){var t={next:function(){var n=e.shift();return{done:n===void 0,value:n}}};return Ka.iterable&&(t[Symbol.iterator]=function(){return t}),t}function Go(e){this.map={},e instanceof Go?e.forEach(function(t,n){this.append(n,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}Go.prototype.append=function(e,t){e=W_(e),t=ape(t);var n=this.map[e];this.map[e]=n?n+", "+t:t};Go.prototype.delete=function(e){delete this.map[W_(e)]};Go.prototype.get=function(e){return e=W_(e),this.has(e)?this.map[e]:null};Go.prototype.has=function(e){return this.map.hasOwnProperty(W_(e))};Go.prototype.set=function(e,t){this.map[W_(e)]=ape(t)};Go.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)};Go.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),lpe(e)};Go.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),lpe(e)};Go.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),lpe(e)};Ka.iterable&&(Go.prototype[Symbol.iterator]=Go.prototype.entries);function hH(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function Btt(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function YRn(e){var t=new FileReader,n=Btt(t);return t.readAsArrayBuffer(e),n}function GRn(e){var t=new FileReader,n=Btt(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=r?r[1]:"utf-8";return t.readAsText(e,i),n}function KRn(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function f$e(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function Wtt(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:Ka.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Ka.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Ka.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Ka.arrayBuffer&&Ka.blob&&HRn(e)?(this._bodyArrayBuffer=f$e(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Ka.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||ZRn(e))?this._bodyArrayBuffer=f$e(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Ka.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Ka.blob&&(this.blob=function(){var e=hH(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=hH(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(Ka.blob)return this.blob().then(YRn);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=hH(this);if(e)return e;if(this._bodyBlob)return GRn(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(KRn(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Ka.formData&&(this.formData=function(){return this.text().then(tDn)}),this.json=function(){return this.text().then(JSON.parse)},this}var JRn=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function eDn(e){var t=e.toUpperCase();return JRn.indexOf(t)>-1?t:e}function AO(e,t){if(!(this instanceof AO))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var n=t.body;if(e instanceof AO){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Go(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&e._bodyInit!=null&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new Go(t.headers)),this.method=eDn(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in Ns){var o=new AbortController;return o.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}AO.prototype.clone=function(){return new AO(this,{body:this._bodyInit})};function tDn(e){var t=new FormData;return e.trim().split("&").forEach(function(n){if(n){var r=n.split("="),i=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}}),t}function nDn(e){var t=new Go,n=e.replace(/\r?\n[\t ]+/g," ");return n.split("\r").map(function(r){return r.indexOf(`
`)===0?r.substr(1,r.length):r}).forEach(function(r){var i=r.split(":"),o=i.shift().trim();if(o){var s=i.join(":").trim();try{t.append(o,s)}catch(a){console.warn("Response "+a.message)}}}),t}Wtt.call(AO.prototype);function dp(e,t){if(!(this instanceof dp))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new Go(t.headers),this.url=t.url||"",this._initBody(e)}Wtt.call(dp.prototype);dp.prototype.clone=function(){return new dp(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Go(this.headers),url:this.url})};dp.error=function(){var e=new dp(null,{status:200,statusText:""});return e.status=0,e.type="error",e};var rDn=[301,302,303,307,308];dp.redirect=function(e,t){if(rDn.indexOf(t)===-1)throw new RangeError("Invalid status code");return new dp(null,{status:t,headers:{location:e}})};var R1=Ns.DOMException;try{new R1}catch{R1=function(t,n){this.message=t,this.name=n;var r=Error(t);this.stack=r.stack},R1.prototype=Object.create(Error.prototype),R1.prototype.constructor=R1}function qtt(e,t){return new Promise(function(n,r){var i=new AO(e,t);if(i.signal&&i.signal.aborted)return r(new R1("Aborted","AbortError"));var o=new XMLHttpRequest;function s(){o.abort()}o.onload=function(){var c={status:o.status,statusText:o.statusText,headers:nDn(o.getAllResponseHeaders()||"")};c.url="responseURL"in o?o.responseURL:c.headers.get("X-Request-URL");var u="response"in o?o.response:o.responseText;setTimeout(function(){n(new dp(u,c))},0)},o.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.onabort=function(){setTimeout(function(){r(new R1("Aborted","AbortError"))},0)};function a(c){try{return c===""&&Ns.location.href?Ns.location.href:c}catch{return c}}if(o.open(i.method,a(i.url),!0),i.credentials==="include"?o.withCredentials=!0:i.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(Ka.blob?o.responseType="blob":Ka.arrayBuffer&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof Go||Ns.Headers&&t.headers instanceof Ns.Headers)){var l=[];Object.getOwnPropertyNames(t.headers).forEach(function(c){l.push(W_(c)),o.setRequestHeader(c,ape(t.headers[c]))}),i.headers.forEach(function(c,u){l.indexOf(u)===-1&&o.setRequestHeader(u,c)})}else i.headers.forEach(function(c,u){o.setRequestHeader(u,c)});i.signal&&(i.signal.addEventListener("abort",s),o.onreadystatechange=function(){o.readyState===4&&i.signal.removeEventListener("abort",s)}),o.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}qtt.polyfill=!0;Ns.fetch||(Ns.fetch=qtt,Ns.Headers=Go,Ns.Request=AO,Ns.Response=dp);var iDn=self.fetch.bind(self),oDn=ft&&ft.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sDn=ft&&ft.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(f){s(f)}}function l(u){try{c(r.throw(u))}catch(f){s(f)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})},aDn=ft&&ft.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},lDn=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nM,"__esModule",{value:!0});nM.HTTPTransport=void 0;var cDn=lDn(iDn),uDn=Wv,pH=B_,d$e=Q_,Vtt=function(e){oDn(t,e);function t(n,r){var i=e.call(this)||this;return i.onlyNotifications=function(o){return o instanceof Array?o.every(function(s){return s.request.request.id===null||s.request.request.id===void 0}):o.request.id===null||o.request.id===void 0},i.uri=n,i.credentials=r&&r.credentials,i.headers=t.setupHeaders(r&&r.headers),i.injectedFetcher=r==null?void 0:r.fetcher,i}return t.prototype.connect=function(){return Promise.resolve()},t.prototype.sendData=function(n,r){return r===void 0&&(r=null),sDn(this,void 0,void 0,function(){var i,o,s,a,l,c,f,u,f;return aDn(this,function(d){switch(d.label){case 0:i=this.transportRequestManager.addRequest(n,r),o=pH.getNotifications(n),s=pH.getBatchRequests(n),a=this.injectedFetcher||cDn.default,d.label=1;case 1:return d.trys.push([1,4,,5]),[4,a(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(n)),credentials:this.credentials})];case 2:return l=d.sent(),this.transportRequestManager.settlePendingRequest(o),this.onlyNotifications(n)?[2,Promise.resolve()]:[4,l.text()];case 3:return c=d.sent(),f=this.transportRequestManager.resolveResponse(c),f?(this.transportRequestManager.settlePendingRequest(s,f),[2,Promise.reject(f)]):[3,5];case 4:return u=d.sent(),f=new d$e.JSONRPCError(u.message,d$e.ERR_UNKNOWN,u),this.transportRequestManager.settlePendingRequest(o,f),this.transportRequestManager.settlePendingRequest(pH.getBatchRequests(n),f),[2,Promise.reject(f)];case 5:return[2,i]}})})},t.prototype.close=function(){},t.setupHeaders=function(n){var r=new Headers(n);return r.set("Content-Type","application/json"),r},t}(uDn.Transport);nM.HTTPTransport=Vtt;nM.default=Vtt;var cpe={},_w=null;typeof WebSocket<"u"?_w=WebSocket:typeof MozWebSocket<"u"?_w=MozWebSocket:typeof global<"u"?_w=global.WebSocket||global.MozWebSocket:typeof window<"u"?_w=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(_w=self.WebSocket||self.MozWebSocket);const fDn=_w,dDn=Object.freeze(Object.defineProperty({__proto__:null,default:fDn},Symbol.toStringTag,{value:"Module"})),hDn=cu(dDn);var pDn=ft&&ft.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gDn=ft&&ft.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(f){s(f)}}function l(u){try{c(r.throw(u))}catch(f){s(f)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})},mDn=ft&&ft.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},yDn=ft&&ft.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cpe,"__esModule",{value:!0});var vDn=yDn(hDn),bDn=Wv,h$e=B_,p$e=Q_,ODn=function(e){pDn(t,e);function t(n){var r=e.call(this)||this;return r.uri=n,r.connection=new vDn.default(n),r}return t.prototype.connect=function(){var n=this;return new Promise(function(r,i){var o=function(){n.connection.removeEventListener("open",o),r()};n.connection.addEventListener("open",o),n.connection.addEventListener("message",function(s){var a=s.data;n.transportRequestManager.resolveResponse(a)})})},t.prototype.sendData=function(n,r){return r===void 0&&(r=5e3),gDn(this,void 0,void 0,function(){var i,o,s;return mDn(this,function(a){i=this.transportRequestManager.addRequest(n,r),o=h$e.getNotifications(n);try{this.connection.send(JSON.stringify(this.parseData(n))),this.transportRequestManager.settlePendingRequest(o)}catch(l){s=new p$e.JSONRPCError(l.message,p$e.ERR_UNKNOWN,l),this.transportRequestManager.settlePendingRequest(o,s),this.transportRequestManager.settlePendingRequest(h$e.getBatchRequests(n),s),i=Promise.reject(s)}return[2,i]})})},t.prototype.close=function(){this.connection.close()},t}(bDn.Transport);cpe.default=ODn;var upe={},xDn=ft&&ft.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),g$e=ft&&ft.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(f){s(f)}}function l(u){try{c(r.throw(u))}catch(f){s(f)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})},m$e=ft&&ft.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(upe,"__esModule",{value:!0});var wDn=Wv,SDn=B_,EDn=function(e){var t=400,n=window.screen.height,r=0,i=0;return window.open(e,"inspector:popup","left="+r+",top="+i+",width="+t+",height="+n+",resizable,scrollbars=yes,status=1")},CDn=function(e){xDn(t,e);function t(n){var r=e.call(this)||this;return r.messageHandler=function(i){r.transportRequestManager.resolveResponse(JSON.stringify(i.data))},r.uri=n,r.postMessageID="post-message-transport-"+Math.random(),r}return t.prototype.createWindow=function(n){return new Promise(function(r,i){var o;o=EDn(n),setTimeout(function(){r(o)},3e3)})},t.prototype.connect=function(){var n=this,r=/^(http|https):\/\/.*$/;return new Promise(function(i,o){return g$e(n,void 0,void 0,function(){var s;return m$e(this,function(a){switch(a.label){case 0:return r.test(this.uri)||o(new Error("Bad URI")),s=this,[4,this.createWindow(this.uri)];case 1:return s.frame=a.sent(),window.addEventListener("message",this.messageHandler),i(),[2]}})})})},t.prototype.sendData=function(n,r){return g$e(this,void 0,void 0,function(){var i,o;return m$e(this,function(s){return i=this.transportRequestManager.addRequest(n,null),o=SDn.getNotifications(n),this.frame&&(this.frame.postMessage(n.request,this.uri),this.transportRequestManager.settlePendingRequest(o)),[2,i]})})},t.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},t}(wDn.Transport);upe.default=CDn;var fpe={},_Dn=ft&&ft.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),y$e=ft&&ft.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(f){s(f)}}function l(u){try{c(r.throw(u))}catch(f){s(f)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})},v$e=ft&&ft.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(fpe,"__esModule",{value:!0});var kDn=Wv,$Dn=B_,TDn=function(e){_Dn(t,e);function t(n){var r=e.call(this)||this;return r.messageHandler=function(i){r.transportRequestManager.resolveResponse(JSON.stringify(i.data))},r.uri=n,r.postMessageID="post-message-transport-"+Math.random(),r}return t.prototype.createWindow=function(n){var r=this;return new Promise(function(i,o){var s,a=document.createElement("iframe");a.setAttribute("id",r.postMessageID),a.setAttribute("width","0px"),a.setAttribute("height","0px"),a.setAttribute("style","visiblity:hidden;border:none;outline:none;"),a.addEventListener("load",function(){i(s)}),a.setAttribute("src",n),window.document.body.appendChild(a),s=a.contentWindow})},t.prototype.connect=function(){var n=this,r=/^(http|https):\/\/.*$/;return new Promise(function(i,o){return y$e(n,void 0,void 0,function(){var s;return v$e(this,function(a){switch(a.label){case 0:return r.test(this.uri)||o(new Error("Bad URI")),s=this,[4,this.createWindow(this.uri)];case 1:return s.frame=a.sent(),window.addEventListener("message",this.messageHandler),i(),[2]}})})})},t.prototype.sendData=function(n,r){return y$e(this,void 0,void 0,function(){var i,o;return v$e(this,function(s){return i=this.transportRequestManager.addRequest(n,null),o=$Dn.getNotifications(n),this.frame&&(this.frame.postMessage(n.request,"*"),this.transportRequestManager.settlePendingRequest(o)),[2,i]})})},t.prototype.close=function(){var n=document.getElementById(this.postMessageID);n==null||n.remove(),window.removeEventListener("message",this.messageHandler)},t}(kDn.Transport);fpe.default=TDn;var dpe={},b$e=ft&&ft.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(f){s(f)}}function l(u){try{c(r.throw(u))}catch(f){s(f)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})},O$e=ft&&ft.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(dpe,"__esModule",{value:!0});var PDn=function(){function e(t){this.requestManager=t}return e.prototype.startBatch=function(){return this.requestManager.startBatch()},e.prototype.stopBatch=function(){return this.requestManager.stopBatch()},e.prototype.request=function(t,n){return b$e(this,void 0,void 0,function(){return O$e(this,function(r){switch(r.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2,this.requestManager.request(t,!1,n)]}})})},e.prototype.notify=function(t){return b$e(this,void 0,void 0,function(){return O$e(this,function(n){switch(n.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2,this.requestManager.request(t,!0,null)]}})})},e.prototype.onNotification=function(t){this.requestManager.requestChannel.addListener("notification",t)},e.prototype.onError=function(t){this.requestManager.requestChannel.addListener("error",t)},e.prototype.close=function(){this.requestManager.close()},e}();dpe.default=PDn;(function(e){var t=ft&&ft.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.PostMessageIframeTransport=e.PostMessageWindowTransport=e.JSONRPCError=e.WebSocketTransport=e.EventEmitterTransport=e.HTTPTransport=e.RequestManager=e.Client=void 0;var n=t(Att);e.RequestManager=n.default;var r=t(spe);e.EventEmitterTransport=r.default;var i=t(nM);e.HTTPTransport=i.default;var o=t(cpe);e.WebSocketTransport=o.default;var s=t(upe);e.PostMessageWindowTransport=s.default;var a=t(fpe);e.PostMessageIframeTransport=a.default;var l=Q_;Object.defineProperty(e,"JSONRPCError",{enumerable:!0,get:function(){return l.JSONRPCError}});var c=t(dpe);e.Client=c.default,e.default=c.default})(q4);var Dh={},Ox={},hpe={},V4={},Pt={},xo={};Object.defineProperty(xo,"__esModule",{value:!0});xo.stringArray=xo.array=xo.func=xo.error=xo.number=xo.string=xo.boolean=void 0;function ADn(e){return e===!0||e===!1}xo.boolean=ADn;function Utt(e){return typeof e=="string"||e instanceof String}xo.string=Utt;function RDn(e){return typeof e=="number"||e instanceof Number}xo.number=RDn;function DDn(e){return e instanceof Error}xo.error=DDn;function MDn(e){return typeof e=="function"}xo.func=MDn;function Htt(e){return Array.isArray(e)}xo.array=Htt;function NDn(e){return Htt(e)&&e.every(t=>Utt(t))}xo.stringArray=NDn;Object.defineProperty(Pt,"__esModule",{value:!0});Pt.Message=Pt.NotificationType9=Pt.NotificationType8=Pt.NotificationType7=Pt.NotificationType6=Pt.NotificationType5=Pt.NotificationType4=Pt.NotificationType3=Pt.NotificationType2=Pt.NotificationType1=Pt.NotificationType0=Pt.NotificationType=Pt.RequestType9=Pt.RequestType8=Pt.RequestType7=Pt.RequestType6=Pt.RequestType5=Pt.RequestType4=Pt.RequestType3=Pt.RequestType2=Pt.RequestType1=Pt.RequestType=Pt.RequestType0=Pt.AbstractMessageSignature=Pt.ParameterStructures=Pt.ResponseError=Pt.ErrorCodes=void 0;const y1=xo;var See;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(See||(Pt.ErrorCodes=See={}));class ppe extends Error{constructor(t,n,r){super(n),this.code=y1.number(t)?t:See.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,ppe.prototype)}toJson(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),t}}Pt.ResponseError=ppe;class ja{constructor(t){this.kind=t}static is(t){return t===ja.auto||t===ja.byName||t===ja.byPosition}toString(){return this.kind}}Pt.ParameterStructures=ja;ja.auto=new ja("auto");ja.byPosition=new ja("byPosition");ja.byName=new ja("byName");class Ni{constructor(t,n){this.method=t,this.numberOfParams=n}get parameterStructures(){return ja.auto}}Pt.AbstractMessageSignature=Ni;class IDn extends Ni{constructor(t){super(t,0)}}Pt.RequestType0=IDn;class LDn extends Ni{constructor(t,n=ja.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}Pt.RequestType=LDn;class jDn extends Ni{constructor(t,n=ja.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}Pt.RequestType1=jDn;class FDn extends Ni{constructor(t){super(t,2)}}Pt.RequestType2=FDn;class zDn extends Ni{constructor(t){super(t,3)}}Pt.RequestType3=zDn;class QDn extends Ni{constructor(t){super(t,4)}}Pt.RequestType4=QDn;class BDn extends Ni{constructor(t){super(t,5)}}Pt.RequestType5=BDn;class WDn extends Ni{constructor(t){super(t,6)}}Pt.RequestType6=WDn;class qDn extends Ni{constructor(t){super(t,7)}}Pt.RequestType7=qDn;class VDn extends Ni{constructor(t){super(t,8)}}Pt.RequestType8=VDn;class UDn extends Ni{constructor(t){super(t,9)}}Pt.RequestType9=UDn;class HDn extends Ni{constructor(t,n=ja.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}Pt.NotificationType=HDn;class XDn extends Ni{constructor(t){super(t,0)}}Pt.NotificationType0=XDn;class ZDn extends Ni{constructor(t,n=ja.auto){super(t,1),this._parameterStructures=n}get parameterStructures(){return this._parameterStructures}}Pt.NotificationType1=ZDn;class YDn extends Ni{constructor(t){super(t,2)}}Pt.NotificationType2=YDn;class GDn extends Ni{constructor(t){super(t,3)}}Pt.NotificationType3=GDn;class KDn extends Ni{constructor(t){super(t,4)}}Pt.NotificationType4=KDn;class JDn extends Ni{constructor(t){super(t,5)}}Pt.NotificationType5=JDn;class eMn extends Ni{constructor(t){super(t,6)}}Pt.NotificationType6=eMn;class tMn extends Ni{constructor(t){super(t,7)}}Pt.NotificationType7=tMn;class nMn extends Ni{constructor(t){super(t,8)}}Pt.NotificationType8=nMn;class rMn extends Ni{constructor(t){super(t,9)}}Pt.NotificationType9=rMn;var x$e;(function(e){function t(i){const o=i;return o&&y1.string(o.method)&&(y1.string(o.id)||y1.number(o.id))}e.isRequest=t;function n(i){const o=i;return o&&y1.string(o.method)&&i.id===void 0}e.isNotification=n;function r(i){const o=i;return o&&(o.result!==void 0||!!o.error)&&(y1.string(o.id)||y1.number(o.id)||o.id===null)}e.isResponse=r})(x$e||(Pt.Message=x$e={}));var Lg={},w$e;Object.defineProperty(Lg,"__esModule",{value:!0});Lg.LRUCache=Lg.LinkedMap=Lg.Touch=void 0;var ya;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(ya||(Lg.Touch=ya={}));class Xtt{constructor(){this[w$e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var t;return(t=this._head)==null?void 0:t.value}get last(){var t;return(t=this._tail)==null?void 0:t.value}has(t){return this._map.has(t)}get(t,n=ya.None){const r=this._map.get(t);if(r)return n!==ya.None&&this.touch(r,n),r.value}set(t,n,r=ya.None){let i=this._map.get(t);if(i)i.value=n,r!==ya.None&&this.touch(i,r);else{switch(i={key:t,value:n,next:void 0,previous:void 0},r){case ya.None:this.addItemLast(i);break;case ya.First:this.addItemFirst(i);break;case ya.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(t,i),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){const n=this._map.get(t);if(n)return this._map.delete(t),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,n){const r=this._state;let i=this._head;for(;i;){if(n?t.bind(n)(i.value,i.key,this):t(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){const t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.key,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}values(){const t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:n.value,done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}entries(){const t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const i={value:[n.key,n.value],done:!1};return n=n.next,i}else return{value:void 0,done:!0}}};return r}[(w$e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(t){if(t>=this.size)return;if(t===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>t;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}addItemFirst(t){if(!this._head&&!this._tail)this._tail=t;else if(this._head)t.next=this._head,this._head.previous=t;else throw new Error("Invalid list");this._head=t,this._state++}addItemLast(t){if(!this._head&&!this._tail)this._head=t;else if(this._tail)t.previous=this._tail,this._tail.next=t;else throw new Error("Invalid list");this._tail=t,this._state++}removeItem(t){if(t===this._head&&t===this._tail)this._head=void 0,this._tail=void 0;else if(t===this._head){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this._head=t.next}else if(t===this._tail){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this._tail=t.previous}else{const n=t.next,r=t.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}t.next=void 0,t.previous=void 0,this._state++}touch(t,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==ya.First&&n!==ya.Last)){if(n===ya.First){if(t===this._head)return;const r=t.next,i=t.previous;t===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),t.previous=void 0,t.next=this._head,this._head.previous=t,this._head=t,this._state++}else if(n===ya.Last){if(t===this._tail)return;const r=t.next,i=t.previous;t===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),t.next=void 0,t.previous=this._tail,this._tail.next=t,this._tail=t,this._state++}}}toJSON(){const t=[];return this.forEach((n,r)=>{t.push([r,n])}),t}fromJSON(t){this.clear();for(const[n,r]of t)this.set(n,r)}}Lg.LinkedMap=Xtt;class iMn extends Xtt{constructor(t,n=1){super(),this._limit=t,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(t){this._limit=t,this.checkTrim()}get ratio(){return this._ratio}set ratio(t){this._ratio=Math.min(Math.max(0,t),1),this.checkTrim()}get(t,n=ya.AsNew){return super.get(t,n)}peek(t){return super.get(t,ya.None)}set(t,n){return super.set(t,n,ya.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}Lg.LRUCache=iMn;var GQ={};Object.defineProperty(GQ,"__esModule",{value:!0});GQ.Disposable=void 0;var S$e;(function(e){function t(n){return{dispose:n}}e.create=t})(S$e||(GQ.Disposable=S$e={}));var hp={},Tm={};Object.defineProperty(Tm,"__esModule",{value:!0});let Eee;function Cee(){if(Eee===void 0)throw new Error("No runtime abstraction layer installed");return Eee}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Eee=n}e.install=t})(Cee||(Cee={}));Tm.default=Cee;Object.defineProperty(hp,"__esModule",{value:!0});hp.Emitter=hp.Event=void 0;const oMn=Tm;var E$e;(function(e){const t={dispose(){}};e.None=function(){return t}})(E$e||(hp.Event=E$e={}));class sMn{add(t,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===t)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];const n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],t))}catch(a){(0,oMn.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class KQ{constructor(t){this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new sMn),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);const i={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),i.dispose=KQ._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}hp.Emitter=KQ;KQ._noop=function(){};var ov={};Object.defineProperty(ov,"__esModule",{value:!0});ov.CancellationTokenSource=ov.CancellationToken=void 0;const aMn=Tm,lMn=xo,_ee=hp;var U4;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:_ee.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:_ee.Event.None});function t(n){const r=n;return r&&(r===e.None||r===e.Cancelled||lMn.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(U4||(ov.CancellationToken=U4={}));const cMn=Object.freeze(function(e,t){const n=(0,aMn.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}});class C$e{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?cMn:(this._emitter||(this._emitter=new _ee.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class uMn{get token(){return this._token||(this._token=new C$e),this._token}cancel(){this._token?this._token.cancel():this._token=U4.Cancelled}dispose(){this._token?this._token instanceof C$e&&this._token.dispose():this._token=U4.None}}ov.CancellationTokenSource=uMn;var lC={};Object.defineProperty(lC,"__esModule",{value:!0});lC.SharedArrayReceiverStrategy=lC.SharedArraySenderStrategy=void 0;const fMn=ov;var CA;(function(e){e.Continue=0,e.Cancelled=1})(CA||(CA={}));class dMn{constructor(){this.buffers=new Map}enableCancellation(t){if(t.id===null)return;const n=new SharedArrayBuffer(4),r=new Int32Array(n,0,1);r[0]=CA.Continue,this.buffers.set(t.id,n),t.$cancellationData=n}async sendCancellation(t,n){const r=this.buffers.get(n);if(r===void 0)return;const i=new Int32Array(r,0,1);Atomics.store(i,0,CA.Cancelled)}cleanup(t){this.buffers.delete(t)}dispose(){this.buffers.clear()}}lC.SharedArraySenderStrategy=dMn;class hMn{constructor(t){this.data=new Int32Array(t,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===CA.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class pMn{constructor(t){this.token=new hMn(t)}cancel(){}dispose(){}}class gMn{constructor(){this.kind="request"}createCancellationTokenSource(t){const n=t.$cancellationData;return n===void 0?new fMn.CancellationTokenSource:new pMn(n)}}lC.SharedArrayReceiverStrategy=gMn;var d0={},rM={};Object.defineProperty(rM,"__esModule",{value:!0});rM.Semaphore=void 0;const mMn=Tm;class yMn{constructor(t=1){if(t<=0)throw new Error("Capacity must be greater than 0");this._capacity=t,this._active=0,this._waiting=[]}lock(t){return new Promise((n,r)=>{this._waiting.push({thunk:t,resolve:n,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,mMn.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const t=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const n=t.thunk();n instanceof Promise?n.then(r=>{this._active--,t.resolve(r),this.runNext()},r=>{this._active--,t.reject(r),this.runNext()}):(this._active--,t.resolve(n),this.runNext())}catch(n){this._active--,t.reject(n),this.runNext()}}}rM.Semaphore=yMn;Object.defineProperty(d0,"__esModule",{value:!0});d0.ReadableStreamMessageReader=d0.AbstractMessageReader=d0.MessageReader=void 0;const kee=Tm,kw=xo,gH=hp,vMn=rM;var _$e;(function(e){function t(n){let r=n;return r&&kw.func(r.listen)&&kw.func(r.dispose)&&kw.func(r.onError)&&kw.func(r.onClose)&&kw.func(r.onPartialMessage)}e.is=t})(_$e||(d0.MessageReader=_$e={}));class Ztt{constructor(){this.errorEmitter=new gH.Emitter,this.closeEmitter=new gH.Emitter,this.partialMessageEmitter=new gH.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t){this.errorEmitter.fire(this.asError(t))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(t){this.partialMessageEmitter.fire(t)}asError(t){return t instanceof Error?t:new Error(`Reader received error. Reason: ${kw.string(t.message)?t.message:"unknown"}`)}}d0.AbstractMessageReader=Ztt;var $ee;(function(e){function t(n){let r,i;const o=new Map;let s;const a=new Map;if(n===void 0||typeof n=="string")r=n??"utf-8";else{if(r=n.charset??"utf-8",n.contentDecoder!==void 0&&(i=n.contentDecoder,o.set(i.name,i)),n.contentDecoders!==void 0)for(const l of n.contentDecoders)o.set(l.name,l);if(n.contentTypeDecoder!==void 0&&(s=n.contentTypeDecoder,a.set(s.name,s)),n.contentTypeDecoders!==void 0)for(const l of n.contentTypeDecoders)a.set(l.name,l)}return s===void 0&&(s=(0,kee.default)().applicationJson.decoder,a.set(s.name,s)),{charset:r,contentDecoder:i,contentDecoders:o,contentTypeDecoder:s,contentTypeDecoders:a}}e.fromOptions=t})($ee||($ee={}));class bMn extends Ztt{constructor(t,n){super(),this.readable=t,this.options=$ee.fromOptions(n),this.buffer=(0,kee.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new vMn.Semaphore(1)}set partialMessageTimeout(t){this._partialMessageTimeout=t}get partialMessageTimeout(){return this._partialMessageTimeout}listen(t){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=t;const n=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),n}onData(t){try{for(this.buffer.append(t);;){if(this.nextMessageLength===-1){const r=this.buffer.tryReadHeaders(!0);if(!r)return;const i=r.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property.
${JSON.stringify(Object.fromEntries(r))}`));return}const o=parseInt(i);if(isNaN(o)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=o}const n=this.buffer.tryReadBody(this.nextMessageLength);if(n===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(n):n,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}catch(n){this.fireError(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,kee.default)().timer.setTimeout((t,n)=>{this.partialMessageTimer=void 0,t===this.messageToken&&(this.firePartialMessage({messageToken:t,waitingTime:n}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}d0.ReadableStreamMessageReader=bMn;var h0={};Object.defineProperty(h0,"__esModule",{value:!0});h0.WriteableStreamMessageWriter=h0.AbstractMessageWriter=h0.MessageWriter=void 0;const k$e=Tm,tT=xo,OMn=rM,$$e=hp,xMn="Content-Length: ",T$e=`\r
`;var P$e;(function(e){function t(n){let r=n;return r&&tT.func(r.dispose)&&tT.func(r.onClose)&&tT.func(r.onError)&&tT.func(r.write)}e.is=t})(P$e||(h0.MessageWriter=P$e={}));class Ytt{constructor(){this.errorEmitter=new $$e.Emitter,this.closeEmitter=new $$e.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t,n,r){this.errorEmitter.fire([this.asError(t),n,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(t){return t instanceof Error?t:new Error(`Writer received error. Reason: ${tT.string(t.message)?t.message:"unknown"}`)}}h0.AbstractMessageWriter=Ytt;var Tee;(function(e){function t(n){return n===void 0||typeof n=="string"?{charset:n??"utf-8",contentTypeEncoder:(0,k$e.default)().applicationJson.encoder}:{charset:n.charset??"utf-8",contentEncoder:n.contentEncoder,contentTypeEncoder:n.contentTypeEncoder??(0,k$e.default)().applicationJson.encoder}}e.fromOptions=t})(Tee||(Tee={}));class wMn extends Ytt{constructor(t,n){super(),this.writable=t,this.options=Tee.fromOptions(n),this.errorCount=0,this.writeSemaphore=new OMn.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(t){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(t,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{const i=[];return i.push(xMn,r.byteLength.toString(),T$e),i.push(T$e),this.doWrite(t,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(t,n,r){try{return await this.writable.write(n.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,t),Promise.reject(i)}}handleError(t,n){this.errorCount++,this.fireError(t,n,this.errorCount)}end(){this.writable.end()}}h0.WriteableStreamMessageWriter=wMn;var JQ={};Object.defineProperty(JQ,"__esModule",{value:!0});JQ.AbstractMessageBuffer=void 0;const SMn=13,EMn=10,CMn=`\r
`;class _Mn{constructor(t="utf-8"){this._encoding=t,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(t){const n=typeof t=="string"?this.fromString(t,this._encoding):t;this._chunks.push(n),this._totalLength+=n.byteLength}tryReadHeaders(t=!1){if(this._chunks.length===0)return;let n=0,r=0,i=0,o=0;e:for(;r<this._chunks.length;){const c=this._chunks[r];for(i=0;i<c.length;){switch(c[i]){case SMn:switch(n){case 0:n=1;break;case 2:n=3;break;default:n=0}break;case EMn:switch(n){case 1:n=2;break;case 3:n=4,i++;break e;default:n=0}break;default:n=0}i++}o+=c.byteLength,r++}if(n!==4)return;const s=this._read(o+i),a=new Map,l=this.toString(s,"ascii").split(CMn);if(l.length<2)return a;for(let c=0;c<l.length-2;c++){const u=l[c],f=u.indexOf(":");if(f===-1)throw new Error(`Message header must separate key and value using ':'
${u}`);const d=u.substr(0,f),h=u.substr(f+1).trim();a.set(t?d.toLowerCase():d,h)}return a}tryReadBody(t){if(!(this._totalLength<t))return this._read(t)}get numberOfBytes(){return this._totalLength}_read(t){if(t===0)return this.emptyBuffer();if(t>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===t){const o=this._chunks[0];return this._chunks.shift(),this._totalLength-=t,this.asNative(o)}if(this._chunks[0].byteLength>t){const o=this._chunks[0],s=this.asNative(o,t);return this._chunks[0]=o.slice(t),this._totalLength-=t,s}const n=this.allocNative(t);let r=0,i=0;for(;t>0;){const o=this._chunks[i];if(o.byteLength>t){const s=o.slice(0,t);n.set(s,r),r+=t,this._chunks[i]=o.slice(t),this._totalLength-=t,t-=t}else n.set(o,r),r+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,t-=o.byteLength}return n}}JQ.AbstractMessageBuffer=_Mn;var Gtt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;const t=Tm,n=xo,r=Pt,i=Lg,o=hp,s=ov;var a;(function(A){A.type=new r.NotificationType("$/cancelRequest")})(a||(a={}));var l;(function(A){function T(N){return typeof N=="string"||typeof N=="number"}A.is=T})(l||(e.ProgressToken=l={}));var c;(function(A){A.type=new r.NotificationType("$/progress")})(c||(c={}));class u{constructor(){}}e.ProgressType=u;var f;(function(A){function T(N){return n.func(N)}A.is=T})(f||(f={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var d;(function(A){A[A.Off=0]="Off",A[A.Messages=1]="Messages",A[A.Compact=2]="Compact",A[A.Verbose=3]="Verbose"})(d||(e.Trace=d={}));var h;(function(A){A.Off="off",A.Messages="messages",A.Compact="compact",A.Verbose="verbose"})(h||(e.TraceValues=h={})),function(A){function T(j){if(!n.string(j))return A.Off;switch(j=j.toLowerCase(),j){case"off":return A.Off;case"messages":return A.Messages;case"compact":return A.Compact;case"verbose":return A.Verbose;default:return A.Off}}A.fromString=T;function N(j){switch(j){case A.Off:return"off";case A.Messages:return"messages";case A.Compact:return"compact";case A.Verbose:return"verbose";default:return"off"}}A.toString=N}(d||(e.Trace=d={}));var p;(function(A){A.Text="text",A.JSON="json"})(p||(e.TraceFormat=p={})),function(A){function T(N){return n.string(N)?(N=N.toLowerCase(),N==="json"?A.JSON:A.Text):A.Text}A.fromString=T}(p||(e.TraceFormat=p={}));var g;(function(A){A.type=new r.NotificationType("$/setTrace")})(g||(e.SetTraceNotification=g={}));var v;(function(A){A.type=new r.NotificationType("$/logTrace")})(v||(e.LogTraceNotification=v={}));var y;(function(A){A[A.Closed=1]="Closed",A[A.Disposed=2]="Disposed",A[A.AlreadyListening=3]="AlreadyListening"})(y||(e.ConnectionErrors=y={}));class O extends Error{constructor(T,N){super(N),this.code=T,Object.setPrototypeOf(this,O.prototype)}}e.ConnectionError=O;var m;(function(A){function T(N){const j=N;return j&&n.func(j.cancelUndispatched)}A.is=T})(m||(e.ConnectionStrategy=m={}));var w;(function(A){function T(N){const j=N;return j&&(j.kind===void 0||j.kind==="id")&&n.func(j.createCancellationTokenSource)&&(j.dispose===void 0||n.func(j.dispose))}A.is=T})(w||(e.IdCancellationReceiverStrategy=w={}));var S;(function(A){function T(N){const j=N;return j&&j.kind==="request"&&n.func(j.createCancellationTokenSource)&&(j.dispose===void 0||n.func(j.dispose))}A.is=T})(S||(e.RequestCancellationReceiverStrategy=S={}));var E;(function(A){A.Message=Object.freeze({createCancellationTokenSource(N){return new s.CancellationTokenSource}});function T(N){return w.is(N)||S.is(N)}A.is=T})(E||(e.CancellationReceiverStrategy=E={}));var C;(function(A){A.Message=Object.freeze({sendCancellation(N,j){return N.sendNotification(a.type,{id:j})},cleanup(N){}});function T(N){const j=N;return j&&n.func(j.sendCancellation)&&n.func(j.cleanup)}A.is=T})(C||(e.CancellationSenderStrategy=C={}));var k;(function(A){A.Message=Object.freeze({receiver:E.Message,sender:C.Message});function T(N){const j=N;return j&&E.is(j.receiver)&&C.is(j.sender)}A.is=T})(k||(e.CancellationStrategy=k={}));var P;(function(A){function T(N){const j=N;return j&&n.func(j.handleMessage)}A.is=T})(P||(e.MessageStrategy=P={}));var D;(function(A){function T(N){const j=N;return j&&(k.is(j.cancellationStrategy)||m.is(j.connectionStrategy)||P.is(j.messageStrategy))}A.is=T})(D||(e.ConnectionOptions=D={}));var M;(function(A){A[A.New=1]="New",A[A.Listening=2]="Listening",A[A.Closed=3]="Closed",A[A.Disposed=4]="Disposed"})(M||(M={}));function L(A,T,N,j){const z=N!==void 0?N:e.NullLogger;let W=0,F=0,q=0;const U="2.0";let V;const H=new Map;let Z;const ee=new Map,se=new Map;let fe,ce=new i.LinkedMap,ae=new Map,de=new Set,me=new Map,te=d.Off,Ee=p.Text,we,ke=M.New;const je=new o.Emitter,nt=new o.Emitter,Re=new o.Emitter,G=new o.Emitter,le=new o.Emitter,Oe=j&&j.cancellationStrategy?j.cancellationStrategy:k.Message;function Ue(ue){if(ue===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+ue.toString()}function Fe(ue){return ue===null?"res-unknown-"+(++q).toString():"res-"+ue.toString()}function ye(){return"not-"+(++F).toString()}function Me(ue,Be){r.Message.isRequest(Be)?ue.set(Ue(Be.id),Be):r.Message.isResponse(Be)?ue.set(Fe(Be.id),Be):ue.set(ye(),Be)}function pt(ue){}function at(){return ke===M.Listening}function ht(){return ke===M.Closed}function _t(){return ke===M.Disposed}function yn(){(ke===M.New||ke===M.Listening)&&(ke=M.Closed,nt.fire(void 0))}function _n(ue){je.fire([ue,void 0,void 0])}function ri(ue){je.fire(ue)}A.onClose(yn),A.onError(_n),T.onClose(yn),T.onError(ri);function hi(){fe||ce.size===0||(fe=(0,t.default)().timer.setImmediate(()=>{fe=void 0,An()}))}function Qt(ue){r.Message.isRequest(ue)?rr(ue):r.Message.isNotification(ue)?xs(ue):r.Message.isResponse(ue)?Ci(ue):Ar(ue)}function An(){if(ce.size===0)return;const ue=ce.shift();try{const Be=j==null?void 0:j.messageStrategy;P.is(Be)?Be.handleMessage(ue,Qt):Qt(ue)}finally{hi()}}const Ht=ue=>{try{if(r.Message.isNotification(ue)&&ue.method===a.type.method){const Be=ue.params.id,it=Ue(Be),xt=ce.get(it);if(r.Message.isRequest(xt)){const or=j==null?void 0:j.connectionStrategy,sr=or&&or.cancelUndispatched?or.cancelUndispatched(xt,pt):void 0;if(sr&&(sr.error!==void 0||sr.result!==void 0)){ce.delete(it),me.delete(Be),sr.id=xt.id,Ji(sr,ue.method,Date.now()),T.write(sr).catch(()=>z.error("Sending response for canceled message failed."));return}}const hr=me.get(Be);if(hr!==void 0){hr.cancel(),ji(ue);return}else de.add(Be)}Me(ce,ue)}finally{hi()}};function rr(ue){if(_t())return;function Be(xn,br,Wn){const ar={jsonrpc:U,id:ue.id};xn instanceof r.ResponseError?ar.error=xn.toJson():ar.result=xn===void 0?null:xn,Ji(ar,br,Wn),T.write(ar).catch(()=>z.error("Sending response failed."))}function it(xn,br,Wn){const ar={jsonrpc:U,id:ue.id,error:xn.toJson()};Ji(ar,br,Wn),T.write(ar).catch(()=>z.error("Sending response failed."))}function xt(xn,br,Wn){xn===void 0&&(xn=null);const ar={jsonrpc:U,id:ue.id,result:xn};Ji(ar,br,Wn),T.write(ar).catch(()=>z.error("Sending response failed."))}Li(ue);const hr=H.get(ue.method);let or,sr;hr&&(or=hr.type,sr=hr.handler);const Ur=Date.now();if(sr||V){const xn=ue.id??String(Date.now()),br=w.is(Oe.receiver)?Oe.receiver.createCancellationTokenSource(xn):Oe.receiver.createCancellationTokenSource(ue);ue.id!==null&&de.has(ue.id)&&br.cancel(),ue.id!==null&&me.set(xn,br);try{let Wn;if(sr)if(ue.params===void 0){if(or!==void 0&&or.numberOfParams!==0){it(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${ue.method} defines ${or.numberOfParams} params but received none.`),ue.method,Ur);return}Wn=sr(br.token)}else if(Array.isArray(ue.params)){if(or!==void 0&&or.parameterStructures===r.ParameterStructures.byName){it(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${ue.method} defines parameters by name but received parameters by position`),ue.method,Ur);return}Wn=sr(...ue.params,br.token)}else{if(or!==void 0&&or.parameterStructures===r.ParameterStructures.byPosition){it(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${ue.method} defines parameters by position but received parameters by name`),ue.method,Ur);return}Wn=sr(ue.params,br.token)}else V&&(Wn=V(ue.method,ue.params,br.token));const ar=Wn;Wn?ar.then?ar.then(Mo=>{me.delete(xn),Be(Mo,ue.method,Ur)},Mo=>{me.delete(xn),Mo instanceof r.ResponseError?it(Mo,ue.method,Ur):Mo&&n.string(Mo.message)?it(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${ue.method} failed with message: ${Mo.message}`),ue.method,Ur):it(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${ue.method} failed unexpectedly without providing any details.`),ue.method,Ur)}):(me.delete(xn),Be(Wn,ue.method,Ur)):(me.delete(xn),xt(Wn,ue.method,Ur))}catch(Wn){me.delete(xn),Wn instanceof r.ResponseError?Be(Wn,ue.method,Ur):Wn&&n.string(Wn.message)?it(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${ue.method} failed with message: ${Wn.message}`),ue.method,Ur):it(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${ue.method} failed unexpectedly without providing any details.`),ue.method,Ur)}}else it(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${ue.method}`),ue.method,Ur)}function Ci(ue){if(!_t())if(ue.id===null)ue.error?z.error(`Received response message without id: Error is: 
${JSON.stringify(ue.error,void 0,4)}`):z.error("Received response message without id. No further error information provided.");else{const Be=ue.id,it=ae.get(Be);if(Ro(ue,it),it!==void 0){ae.delete(Be);try{if(ue.error){const xt=ue.error;it.reject(new r.ResponseError(xt.code,xt.message,xt.data))}else if(ue.result!==void 0)it.resolve(ue.result);else throw new Error("Should never happen.")}catch(xt){xt.message?z.error(`Response handler '${it.method}' failed with message: ${xt.message}`):z.error(`Response handler '${it.method}' failed unexpectedly.`)}}}}function xs(ue){if(_t())return;let Be,it;if(ue.method===a.type.method){const xt=ue.params.id;de.delete(xt),ji(ue);return}else{const xt=ee.get(ue.method);xt&&(it=xt.handler,Be=xt.type)}if(it||Z)try{if(ji(ue),it)if(ue.params===void 0)Be!==void 0&&Be.numberOfParams!==0&&Be.parameterStructures!==r.ParameterStructures.byName&&z.error(`Notification ${ue.method} defines ${Be.numberOfParams} params but received none.`),it();else if(Array.isArray(ue.params)){const xt=ue.params;ue.method===c.type.method&&xt.length===2&&l.is(xt[0])?it({token:xt[0],value:xt[1]}):(Be!==void 0&&(Be.parameterStructures===r.ParameterStructures.byName&&z.error(`Notification ${ue.method} defines parameters by name but received parameters by position`),Be.numberOfParams!==ue.params.length&&z.error(`Notification ${ue.method} defines ${Be.numberOfParams} params but received ${xt.length} arguments`)),it(...xt))}else Be!==void 0&&Be.parameterStructures===r.ParameterStructures.byPosition&&z.error(`Notification ${ue.method} defines parameters by position but received parameters by name`),it(ue.params);else Z&&Z(ue.method,ue.params)}catch(xt){xt.message?z.error(`Notification handler '${ue.method}' failed with message: ${xt.message}`):z.error(`Notification handler '${ue.method}' failed unexpectedly.`)}else Re.fire(ue)}function Ar(ue){if(!ue){z.error("Received empty message.");return}z.error(`Received message which is neither a response nor a notification message:
${JSON.stringify(ue,null,4)}`);const Be=ue;if(n.string(Be.id)||n.number(Be.id)){const it=Be.id,xt=ae.get(it);xt&&xt.reject(new Error("The received response has neither a result nor an error property."))}}function Rn(ue){if(ue!=null)switch(te){case d.Verbose:return JSON.stringify(ue,null,4);case d.Compact:return JSON.stringify(ue);default:return}}function Rr(ue){if(!(te===d.Off||!we))if(Ee===p.Text){let Be;(te===d.Verbose||te===d.Compact)&&ue.params&&(Be=`Params: ${Rn(ue.params)}

`),we.log(`Sending request '${ue.method} - (${ue.id})'.`,Be)}else eo("send-request",ue)}function Ii(ue){if(!(te===d.Off||!we))if(Ee===p.Text){let Be;(te===d.Verbose||te===d.Compact)&&(ue.params?Be=`Params: ${Rn(ue.params)}

`:Be=`No parameters provided.

`),we.log(`Sending notification '${ue.method}'.`,Be)}else eo("send-notification",ue)}function Ji(ue,Be,it){if(!(te===d.Off||!we))if(Ee===p.Text){let xt;(te===d.Verbose||te===d.Compact)&&(ue.error&&ue.error.data?xt=`Error data: ${Rn(ue.error.data)}

`:ue.result?xt=`Result: ${Rn(ue.result)}

`:ue.error===void 0&&(xt=`No result returned.

`)),we.log(`Sending response '${Be} - (${ue.id})'. Processing request took ${Date.now()-it}ms`,xt)}else eo("send-response",ue)}function Li(ue){if(!(te===d.Off||!we))if(Ee===p.Text){let Be;(te===d.Verbose||te===d.Compact)&&ue.params&&(Be=`Params: ${Rn(ue.params)}

`),we.log(`Received request '${ue.method} - (${ue.id})'.`,Be)}else eo("receive-request",ue)}function ji(ue){if(!(te===d.Off||!we||ue.method===v.type.method))if(Ee===p.Text){let Be;(te===d.Verbose||te===d.Compact)&&(ue.params?Be=`Params: ${Rn(ue.params)}

`:Be=`No parameters provided.

`),we.log(`Received notification '${ue.method}'.`,Be)}else eo("receive-notification",ue)}function Ro(ue,Be){if(!(te===d.Off||!we))if(Ee===p.Text){let it;if((te===d.Verbose||te===d.Compact)&&(ue.error&&ue.error.data?it=`Error data: ${Rn(ue.error.data)}

`:ue.result?it=`Result: ${Rn(ue.result)}

`:ue.error===void 0&&(it=`No result returned.

`)),Be){const xt=ue.error?` Request failed: ${ue.error.message} (${ue.error.code}).`:"";we.log(`Received response '${Be.method} - (${ue.id})' in ${Date.now()-Be.timerStart}ms.${xt}`,it)}else we.log(`Received response ${ue.id} without active response promise.`,it)}else eo("receive-response",ue)}function eo(ue,Be){if(!we||te===d.Off)return;const it={isLSPMessage:!0,type:ue,message:Be,timestamp:Date.now()};we.log(it)}function pi(){if(ht())throw new O(y.Closed,"Connection is closed.");if(_t())throw new O(y.Disposed,"Connection is disposed.")}function Do(){if(at())throw new O(y.AlreadyListening,"Connection is already listening")}function ta(){if(!at())throw new Error("Call listen() first.")}function ws(ue){return ue===void 0?null:ue}function _i(ue){if(ue!==null)return ue}function ne(ue){return ue!=null&&!Array.isArray(ue)&&typeof ue=="object"}function ir(ue,Be){switch(ue){case r.ParameterStructures.auto:return ne(Be)?_i(Be):[ws(Be)];case r.ParameterStructures.byName:if(!ne(Be))throw new Error("Received parameters by name but param is not an object literal.");return _i(Be);case r.ParameterStructures.byPosition:return[ws(Be)];default:throw new Error(`Unknown parameter structure ${ue.toString()}`)}}function cn(ue,Be){let it;const xt=ue.numberOfParams;switch(xt){case 0:it=void 0;break;case 1:it=ir(ue.parameterStructures,Be[0]);break;default:it=[];for(let hr=0;hr<Be.length&&hr<xt;hr++)it.push(ws(Be[hr]));if(Be.length<xt)for(let hr=Be.length;hr<xt;hr++)it.push(null);break}return it}const Tt={sendNotification:(ue,...Be)=>{pi();let it,xt;if(n.string(ue)){it=ue;const or=Be[0];let sr=0,Ur=r.ParameterStructures.auto;r.ParameterStructures.is(or)&&(sr=1,Ur=or);let xn=Be.length;const br=xn-sr;switch(br){case 0:xt=void 0;break;case 1:xt=ir(Ur,Be[sr]);break;default:if(Ur===r.ParameterStructures.byName)throw new Error(`Received ${br} parameters for 'by Name' notification parameter structure.`);xt=Be.slice(sr,xn).map(Wn=>ws(Wn));break}}else{const or=Be;it=ue.method,xt=cn(ue,or)}const hr={jsonrpc:U,method:it,params:xt};return Ii(hr),T.write(hr).catch(or=>{throw z.error("Sending notification failed."),or})},onNotification:(ue,Be)=>{pi();let it;return n.func(ue)?Z=ue:Be&&(n.string(ue)?(it=ue,ee.set(ue,{type:void 0,handler:Be})):(it=ue.method,ee.set(ue.method,{type:ue,handler:Be}))),{dispose:()=>{it!==void 0?ee.delete(it):Z=void 0}}},onProgress:(ue,Be,it)=>{if(se.has(Be))throw new Error(`Progress handler for token ${Be} already registered`);return se.set(Be,it),{dispose:()=>{se.delete(Be)}}},sendProgress:(ue,Be,it)=>Tt.sendNotification(c.type,{token:Be,value:it}),onUnhandledProgress:G.event,sendRequest:(ue,...Be)=>{pi(),ta();let it,xt,hr;if(n.string(ue)){it=ue;const xn=Be[0],br=Be[Be.length-1];let Wn=0,ar=r.ParameterStructures.auto;r.ParameterStructures.is(xn)&&(Wn=1,ar=xn);let Mo=Be.length;s.CancellationToken.is(br)&&(Mo=Mo-1,hr=br);const Ua=Mo-Wn;switch(Ua){case 0:xt=void 0;break;case 1:xt=ir(ar,Be[Wn]);break;default:if(ar===r.ParameterStructures.byName)throw new Error(`Received ${Ua} parameters for 'by Name' request parameter structure.`);xt=Be.slice(Wn,Mo).map(qv=>ws(qv));break}}else{const xn=Be;it=ue.method,xt=cn(ue,xn);const br=ue.numberOfParams;hr=s.CancellationToken.is(xn[br])?xn[br]:void 0}const or=W++;let sr;hr&&(sr=hr.onCancellationRequested(()=>{const xn=Oe.sender.sendCancellation(Tt,or);return xn===void 0?(z.log(`Received no promise from cancellation strategy when cancelling id ${or}`),Promise.resolve()):xn.catch(()=>{z.log(`Sending cancellation messages for id ${or} failed`)})}));const Ur={jsonrpc:U,id:or,method:it,params:xt};return Rr(Ur),typeof Oe.sender.enableCancellation=="function"&&Oe.sender.enableCancellation(Ur),new Promise(async(xn,br)=>{const Wn=Ua=>{xn(Ua),Oe.sender.cleanup(or),sr==null||sr.dispose()},ar=Ua=>{br(Ua),Oe.sender.cleanup(or),sr==null||sr.dispose()},Mo={method:it,timerStart:Date.now(),resolve:Wn,reject:ar};try{await T.write(Ur),ae.set(or,Mo)}catch(Ua){throw z.error("Sending request failed."),Mo.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,Ua.message?Ua.message:"Unknown reason")),Ua}})},onRequest:(ue,Be)=>{pi();let it=null;return f.is(ue)?(it=void 0,V=ue):n.string(ue)?(it=null,Be!==void 0&&(it=ue,H.set(ue,{handler:Be,type:void 0}))):Be!==void 0&&(it=ue.method,H.set(ue.method,{type:ue,handler:Be})),{dispose:()=>{it!==null&&(it!==void 0?H.delete(it):V=void 0)}}},hasPendingResponse:()=>ae.size>0,trace:async(ue,Be,it)=>{let xt=!1,hr=p.Text;it!==void 0&&(n.boolean(it)?xt=it:(xt=it.sendNotification||!1,hr=it.traceFormat||p.Text)),te=ue,Ee=hr,te===d.Off?we=void 0:we=Be,xt&&!ht()&&!_t()&&await Tt.sendNotification(g.type,{value:d.toString(ue)})},onError:je.event,onClose:nt.event,onUnhandledNotification:Re.event,onDispose:le.event,end:()=>{T.end()},dispose:()=>{if(_t())return;ke=M.Disposed,le.fire(void 0);const ue=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const Be of ae.values())Be.reject(ue);ae=new Map,me=new Map,de=new Set,ce=new i.LinkedMap,n.func(T.dispose)&&T.dispose(),n.func(A.dispose)&&A.dispose()},listen:()=>{pi(),Do(),ke=M.Listening,A.listen(Ht)},inspect:()=>{(0,t.default)().console.log("inspect")}};return Tt.onNotification(v.type,ue=>{if(te===d.Off||!we)return;const Be=te===d.Verbose||te===d.Compact;we.log(ue.message,Be?ue.verbose:void 0)}),Tt.onNotification(c.type,ue=>{const Be=se.get(ue.token);Be?Be(ue.value):G.fire(ue)}),Tt}e.createMessageConnection=L})(Gtt);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;const t=Pt;Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return t.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return t.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return t.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return t.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return t.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return t.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return t.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return t.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return t.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return t.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return t.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return t.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return t.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return t.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return t.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return t.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return t.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return t.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return t.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return t.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return t.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return t.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return t.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return t.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return t.ParameterStructures}});const n=Lg;Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=GQ;Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=hp;Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const o=ov;Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const s=lC;Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return s.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return s.SharedArrayReceiverStrategy}});const a=d0;Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const l=h0;Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return l.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return l.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return l.WriteableStreamMessageWriter}});const c=JQ;Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return c.AbstractMessageBuffer}});const u=Gtt;Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return u.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return u.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return u.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return u.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return u.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return u.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return u.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return u.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return u.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return u.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return u.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return u.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return u.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return u.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return u.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return u.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return u.MessageStrategy}});const f=Tm;e.RAL=f.default})(V4);Object.defineProperty(hpe,"__esModule",{value:!0});const Ch=V4;class eB extends Ch.AbstractMessageBuffer{constructor(t="utf-8"){super(t),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return eB.emptyBuffer}fromString(t,n){return new TextEncoder().encode(t)}toString(t,n){return n==="ascii"?this.asciiDecoder.decode(t):new TextDecoder(n).decode(t)}asNative(t,n){return n===void 0?t:t.slice(0,n)}allocNative(t){return new Uint8Array(t)}}eB.emptyBuffer=new Uint8Array(0);class kMn{constructor(t){this.socket=t,this._onData=new Ch.Emitter,this._messageListener=n=>{n.data.arrayBuffer().then(i=>{this._onData.fire(new Uint8Array(i))},()=>{(0,Ch.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(t){return this.socket.addEventListener("close",t),Ch.Disposable.create(()=>this.socket.removeEventListener("close",t))}onError(t){return this.socket.addEventListener("error",t),Ch.Disposable.create(()=>this.socket.removeEventListener("error",t))}onEnd(t){return this.socket.addEventListener("end",t),Ch.Disposable.create(()=>this.socket.removeEventListener("end",t))}onData(t){return this._onData.event(t)}}class $Mn{constructor(t){this.socket=t}onClose(t){return this.socket.addEventListener("close",t),Ch.Disposable.create(()=>this.socket.removeEventListener("close",t))}onError(t){return this.socket.addEventListener("error",t),Ch.Disposable.create(()=>this.socket.removeEventListener("error",t))}onEnd(t){return this.socket.addEventListener("end",t),Ch.Disposable.create(()=>this.socket.removeEventListener("end",t))}write(t,n){if(typeof t=="string"){if(n!==void 0&&n!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${n}`);this.socket.send(t)}else this.socket.send(t);return Promise.resolve()}end(){this.socket.close()}}const TMn=new TextEncoder,Ktt=Object.freeze({messageBuffer:Object.freeze({create:e=>new eB(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{if(t.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${t.charset}`);return Promise.resolve(TMn.encode(JSON.stringify(e,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{if(!(e instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(t.charset).decode(e)))}})}),stream:Object.freeze({asReadableStream:e=>new kMn(e),asWritableStream:e=>new $Mn(e)}),console,timer:Object.freeze({setTimeout(e,t,...n){const r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){const n=setTimeout(e,0,...t);return{dispose:()=>clearTimeout(n)}},setInterval(e,t,...n){const r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function Pee(){return Ktt}(function(e){function t(){Ch.RAL.install(Ktt)}e.install=t})(Pee||(Pee={}));hpe.default=Pee;(function(e){var t=ft&&ft.__createBinding||(Object.create?function(l,c,u,f){f===void 0&&(f=u);var d=Object.getOwnPropertyDescriptor(c,u);(!d||("get"in d?!c.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return c[u]}}),Object.defineProperty(l,f,d)}:function(l,c,u,f){f===void 0&&(f=u),l[f]=c[u]}),n=ft&&ft.__exportStar||function(l,c){for(var u in l)u!=="default"&&!Object.prototype.hasOwnProperty.call(c,u)&&t(c,l,u)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.BrowserMessageWriter=e.BrowserMessageReader=void 0,hpe.default.install();const i=V4;n(V4,e);class o extends i.AbstractMessageReader{constructor(c){super(),this._onData=new i.Emitter,this._messageListener=u=>{this._onData.fire(u.data)},c.addEventListener("error",u=>this.fireError(u)),c.onmessage=this._messageListener}listen(c){return this._onData.event(c)}}e.BrowserMessageReader=o;class s extends i.AbstractMessageWriter{constructor(c){super(),this.port=c,this.errorCount=0,c.addEventListener("error",u=>this.fireError(u))}write(c){try{return this.port.postMessage(c),Promise.resolve()}catch(u){return this.handleError(u,c),Promise.reject(u)}}handleError(c,u){this.errorCount++,this.fireError(c,u,this.errorCount)}end(){}}e.BrowserMessageWriter=s;function a(l,c,u,f){return u===void 0&&(u=i.NullLogger),i.ConnectionStrategy.is(f)&&(f={connectionStrategy:f}),(0,i.createMessageConnection)(l,c,u,f)}e.createMessageConnection=a})(Ox);var A$e=Ox,Jtt={},Aee;(function(e){function t(n){return typeof n=="string"}e.is=t})(Aee||(Aee={}));var H4;(function(e){function t(n){return typeof n=="string"}e.is=t})(H4||(H4={}));var Ree;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(Ree||(Ree={}));var _A;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(_A||(_A={}));var Mu;(function(e){function t(r,i){return r===Number.MAX_VALUE&&(r=_A.MAX_VALUE),i===Number.MAX_VALUE&&(i=_A.MAX_VALUE),{line:r,character:i}}e.create=t;function n(r){let i=r;return Ce.objectLiteral(i)&&Ce.uinteger(i.line)&&Ce.uinteger(i.character)}e.is=n})(Mu||(Mu={}));var Yi;(function(e){function t(r,i,o,s){if(Ce.uinteger(r)&&Ce.uinteger(i)&&Ce.uinteger(o)&&Ce.uinteger(s))return{start:Mu.create(r,i),end:Mu.create(o,s)};if(Mu.is(r)&&Mu.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${o}, ${s}]`)}e.create=t;function n(r){let i=r;return Ce.objectLiteral(i)&&Mu.is(i.start)&&Mu.is(i.end)}e.is=n})(Yi||(Yi={}));var kA;(function(e){function t(r,i){return{uri:r,range:i}}e.create=t;function n(r){let i=r;return Ce.objectLiteral(i)&&Yi.is(i.range)&&(Ce.string(i.uri)||Ce.undefined(i.uri))}e.is=n})(kA||(kA={}));var Dee;(function(e){function t(r,i,o,s){return{targetUri:r,targetRange:i,targetSelectionRange:o,originSelectionRange:s}}e.create=t;function n(r){let i=r;return Ce.objectLiteral(i)&&Yi.is(i.targetRange)&&Ce.string(i.targetUri)&&Yi.is(i.targetSelectionRange)&&(Yi.is(i.originSelectionRange)||Ce.undefined(i.originSelectionRange))}e.is=n})(Dee||(Dee={}));var X4;(function(e){function t(r,i,o,s){return{red:r,green:i,blue:o,alpha:s}}e.create=t;function n(r){const i=r;return Ce.objectLiteral(i)&&Ce.numberRange(i.red,0,1)&&Ce.numberRange(i.green,0,1)&&Ce.numberRange(i.blue,0,1)&&Ce.numberRange(i.alpha,0,1)}e.is=n})(X4||(X4={}));var Mee;(function(e){function t(r,i){return{range:r,color:i}}e.create=t;function n(r){const i=r;return Ce.objectLiteral(i)&&Yi.is(i.range)&&X4.is(i.color)}e.is=n})(Mee||(Mee={}));var Nee;(function(e){function t(r,i,o){return{label:r,textEdit:i,additionalTextEdits:o}}e.create=t;function n(r){const i=r;return Ce.objectLiteral(i)&&Ce.string(i.label)&&(Ce.undefined(i.textEdit)||Xh.is(i))&&(Ce.undefined(i.additionalTextEdits)||Ce.typedArray(i.additionalTextEdits,Xh.is))}e.is=n})(Nee||(Nee={}));var Iee;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(Iee||(Iee={}));var Lee;(function(e){function t(r,i,o,s,a,l){const c={startLine:r,endLine:i};return Ce.defined(o)&&(c.startCharacter=o),Ce.defined(s)&&(c.endCharacter=s),Ce.defined(a)&&(c.kind=a),Ce.defined(l)&&(c.collapsedText=l),c}e.create=t;function n(r){const i=r;return Ce.objectLiteral(i)&&Ce.uinteger(i.startLine)&&Ce.uinteger(i.startLine)&&(Ce.undefined(i.startCharacter)||Ce.uinteger(i.startCharacter))&&(Ce.undefined(i.endCharacter)||Ce.uinteger(i.endCharacter))&&(Ce.undefined(i.kind)||Ce.string(i.kind))}e.is=n})(Lee||(Lee={}));var Z4;(function(e){function t(r,i){return{location:r,message:i}}e.create=t;function n(r){let i=r;return Ce.defined(i)&&kA.is(i.location)&&Ce.string(i.message)}e.is=n})(Z4||(Z4={}));var jee;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(jee||(jee={}));var Fee;(function(e){e.Unnecessary=1,e.Deprecated=2})(Fee||(Fee={}));var zee;(function(e){function t(n){const r=n;return Ce.objectLiteral(r)&&Ce.string(r.href)}e.is=t})(zee||(zee={}));var $A;(function(e){function t(r,i,o,s,a,l){let c={range:r,message:i};return Ce.defined(o)&&(c.severity=o),Ce.defined(s)&&(c.code=s),Ce.defined(a)&&(c.source=a),Ce.defined(l)&&(c.relatedInformation=l),c}e.create=t;function n(r){var i;let o=r;return Ce.defined(o)&&Yi.is(o.range)&&Ce.string(o.message)&&(Ce.number(o.severity)||Ce.undefined(o.severity))&&(Ce.integer(o.code)||Ce.string(o.code)||Ce.undefined(o.code))&&(Ce.undefined(o.codeDescription)||Ce.string((i=o.codeDescription)===null||i===void 0?void 0:i.href))&&(Ce.string(o.source)||Ce.undefined(o.source))&&(Ce.undefined(o.relatedInformation)||Ce.typedArray(o.relatedInformation,Z4.is))}e.is=n})($A||($A={}));var RO;(function(e){function t(r,i,...o){let s={title:r,command:i};return Ce.defined(o)&&o.length>0&&(s.arguments=o),s}e.create=t;function n(r){let i=r;return Ce.defined(i)&&Ce.string(i.title)&&Ce.string(i.command)}e.is=n})(RO||(RO={}));var Xh;(function(e){function t(o,s){return{range:o,newText:s}}e.replace=t;function n(o,s){return{range:{start:o,end:o},newText:s}}e.insert=n;function r(o){return{range:o,newText:""}}e.del=r;function i(o){const s=o;return Ce.objectLiteral(s)&&Ce.string(s.newText)&&Yi.is(s.range)}e.is=i})(Xh||(Xh={}));var vb;(function(e){function t(r,i,o){const s={label:r};return i!==void 0&&(s.needsConfirmation=i),o!==void 0&&(s.description=o),s}e.create=t;function n(r){const i=r;return Ce.objectLiteral(i)&&Ce.string(i.label)&&(Ce.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(Ce.string(i.description)||i.description===void 0)}e.is=n})(vb||(vb={}));var Is;(function(e){function t(n){const r=n;return Ce.string(r)}e.is=t})(Is||(Is={}));var ag;(function(e){function t(o,s,a){return{range:o,newText:s,annotationId:a}}e.replace=t;function n(o,s,a){return{range:{start:o,end:o},newText:s,annotationId:a}}e.insert=n;function r(o,s){return{range:o,newText:"",annotationId:s}}e.del=r;function i(o){const s=o;return Xh.is(s)&&(vb.is(s.annotationId)||Is.is(s.annotationId))}e.is=i})(ag||(ag={}));var TA;(function(e){function t(r,i){return{textDocument:r,edits:i}}e.create=t;function n(r){let i=r;return Ce.defined(i)&&PA.is(i.textDocument)&&Array.isArray(i.edits)}e.is=n})(TA||(TA={}));var cC;(function(e){function t(r,i,o){let s={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}e.create=t;function n(r){let i=r;return i&&i.kind==="create"&&Ce.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||Ce.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||Ce.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Is.is(i.annotationId))}e.is=n})(cC||(cC={}));var uC;(function(e){function t(r,i,o,s){let a={kind:"rename",oldUri:r,newUri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),s!==void 0&&(a.annotationId=s),a}e.create=t;function n(r){let i=r;return i&&i.kind==="rename"&&Ce.string(i.oldUri)&&Ce.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||Ce.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||Ce.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Is.is(i.annotationId))}e.is=n})(uC||(uC={}));var fC;(function(e){function t(r,i,o){let s={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}e.create=t;function n(r){let i=r;return i&&i.kind==="delete"&&Ce.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||Ce.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||Ce.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Is.is(i.annotationId))}e.is=n})(fC||(fC={}));var Y4;(function(e){function t(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>Ce.string(i.kind)?cC.is(i)||uC.is(i)||fC.is(i):TA.is(i)))}e.is=t})(Y4||(Y4={}));class $I{constructor(t,n){this.edits=t,this.changeAnnotations=n}insert(t,n,r){let i,o;if(r===void 0?i=Xh.insert(t,n):Is.is(r)?(o=r,i=ag.insert(t,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(r),i=ag.insert(t,n,o)),this.edits.push(i),o!==void 0)return o}replace(t,n,r){let i,o;if(r===void 0?i=Xh.replace(t,n):Is.is(r)?(o=r,i=ag.replace(t,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),o=this.changeAnnotations.manage(r),i=ag.replace(t,n,o)),this.edits.push(i),o!==void 0)return o}delete(t,n){let r,i;if(n===void 0?r=Xh.del(t):Is.is(n)?(i=n,r=ag.del(t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=ag.del(t,i)),this.edits.push(r),i!==void 0)return i}add(t){this.edits.push(t)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(t){if(t===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}}class R$e{constructor(t){this._annotations=t===void 0?Object.create(null):t,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(t,n){let r;if(Is.is(t)?r=t:(r=this.nextId(),n=t),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(n===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=n,this._size++,r}nextId(){return this._counter++,this._counter.toString()}}class PMn{constructor(t){this._textEditChanges=Object.create(null),t!==void 0?(this._workspaceEdit=t,t.documentChanges?(this._changeAnnotations=new R$e(t.changeAnnotations),t.changeAnnotations=this._changeAnnotations.all(),t.documentChanges.forEach(n=>{if(TA.is(n)){const r=new $I(n.edits,this._changeAnnotations);this._textEditChanges[n.textDocument.uri]=r}})):t.changes&&Object.keys(t.changes).forEach(n=>{const r=new $I(t.changes[n]);this._textEditChanges[n]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(t){if(PA.is(t)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const n={uri:t.uri,version:t.version};let r=this._textEditChanges[n.uri];if(!r){const i=[],o={textDocument:n,edits:i};this._workspaceEdit.documentChanges.push(o),r=new $I(i,this._changeAnnotations),this._textEditChanges[n.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let n=this._textEditChanges[t];if(!n){let r=[];this._workspaceEdit.changes[t]=r,n=new $I(r),this._textEditChanges[t]=n}return n}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new R$e,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(t,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;vb.is(n)||Is.is(n)?i=n:r=n;let o,s;if(i===void 0?o=cC.create(t,r):(s=Is.is(i)?i:this._changeAnnotations.manage(i),o=cC.create(t,r,s)),this._workspaceEdit.documentChanges.push(o),s!==void 0)return s}renameFile(t,n,r,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let o;vb.is(r)||Is.is(r)?o=r:i=r;let s,a;if(o===void 0?s=uC.create(t,n,i):(a=Is.is(o)?o:this._changeAnnotations.manage(o),s=uC.create(t,n,i,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}deleteFile(t,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;vb.is(n)||Is.is(n)?i=n:r=n;let o,s;if(i===void 0?o=fC.create(t,r):(s=Is.is(i)?i:this._changeAnnotations.manage(i),o=fC.create(t,r,s)),this._workspaceEdit.documentChanges.push(o),s!==void 0)return s}}var Qee;(function(e){function t(r){return{uri:r}}e.create=t;function n(r){let i=r;return Ce.defined(i)&&Ce.string(i.uri)}e.is=n})(Qee||(Qee={}));var Bee;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){let i=r;return Ce.defined(i)&&Ce.string(i.uri)&&Ce.integer(i.version)}e.is=n})(Bee||(Bee={}));var PA;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){let i=r;return Ce.defined(i)&&Ce.string(i.uri)&&(i.version===null||Ce.integer(i.version))}e.is=n})(PA||(PA={}));var Wee;(function(e){function t(r,i,o,s){return{uri:r,languageId:i,version:o,text:s}}e.create=t;function n(r){let i=r;return Ce.defined(i)&&Ce.string(i.uri)&&Ce.string(i.languageId)&&Ce.integer(i.version)&&Ce.string(i.text)}e.is=n})(Wee||(Wee={}));var G4;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(n){const r=n;return r===e.PlainText||r===e.Markdown}e.is=t})(G4||(G4={}));var dC;(function(e){function t(n){const r=n;return Ce.objectLiteral(n)&&G4.is(r.kind)&&Ce.string(r.value)}e.is=t})(dC||(dC={}));var qee;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(qee||(qee={}));var Vee;(function(e){e.PlainText=1,e.Snippet=2})(Vee||(Vee={}));var Uee;(function(e){e.Deprecated=1})(Uee||(Uee={}));var Hee;(function(e){function t(r,i,o){return{newText:r,insert:i,replace:o}}e.create=t;function n(r){const i=r;return i&&Ce.string(i.newText)&&Yi.is(i.insert)&&Yi.is(i.replace)}e.is=n})(Hee||(Hee={}));var Xee;(function(e){e.asIs=1,e.adjustIndentation=2})(Xee||(Xee={}));var Zee;(function(e){function t(n){const r=n;return r&&(Ce.string(r.detail)||r.detail===void 0)&&(Ce.string(r.description)||r.description===void 0)}e.is=t})(Zee||(Zee={}));var Yee;(function(e){function t(n){return{label:n}}e.create=t})(Yee||(Yee={}));var Gee;(function(e){function t(n,r){return{items:n||[],isIncomplete:!!r}}e.create=t})(Gee||(Gee={}));var AA;(function(e){function t(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function n(r){const i=r;return Ce.string(i)||Ce.objectLiteral(i)&&Ce.string(i.language)&&Ce.string(i.value)}e.is=n})(AA||(AA={}));var Kee;(function(e){function t(n){let r=n;return!!r&&Ce.objectLiteral(r)&&(dC.is(r.contents)||AA.is(r.contents)||Ce.typedArray(r.contents,AA.is))&&(n.range===void 0||Yi.is(n.range))}e.is=t})(Kee||(Kee={}));var Jee;(function(e){function t(n,r){return r?{label:n,documentation:r}:{label:n}}e.create=t})(Jee||(Jee={}));var ete;(function(e){function t(n,r,...i){let o={label:n};return Ce.defined(r)&&(o.documentation=r),Ce.defined(i)?o.parameters=i:o.parameters=[],o}e.create=t})(ete||(ete={}));var tte;(function(e){e.Text=1,e.Read=2,e.Write=3})(tte||(tte={}));var nte;(function(e){function t(n,r){let i={range:n};return Ce.number(r)&&(i.kind=r),i}e.create=t})(nte||(nte={}));var rte;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(rte||(rte={}));var ite;(function(e){e.Deprecated=1})(ite||(ite={}));var ote;(function(e){function t(n,r,i,o,s){let a={name:n,kind:r,location:{uri:o,range:i}};return s&&(a.containerName=s),a}e.create=t})(ote||(ote={}));var ste;(function(e){function t(n,r,i,o){return o!==void 0?{name:n,kind:r,location:{uri:i,range:o}}:{name:n,kind:r,location:{uri:i}}}e.create=t})(ste||(ste={}));var ate;(function(e){function t(r,i,o,s,a,l){let c={name:r,detail:i,kind:o,range:s,selectionRange:a};return l!==void 0&&(c.children=l),c}e.create=t;function n(r){let i=r;return i&&Ce.string(i.name)&&Ce.number(i.kind)&&Yi.is(i.range)&&Yi.is(i.selectionRange)&&(i.detail===void 0||Ce.string(i.detail))&&(i.deprecated===void 0||Ce.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}e.is=n})(ate||(ate={}));var lte;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(lte||(lte={}));var RA;(function(e){e.Invoked=1,e.Automatic=2})(RA||(RA={}));var cte;(function(e){function t(r,i,o){let s={diagnostics:r};return i!=null&&(s.only=i),o!=null&&(s.triggerKind=o),s}e.create=t;function n(r){let i=r;return Ce.defined(i)&&Ce.typedArray(i.diagnostics,$A.is)&&(i.only===void 0||Ce.typedArray(i.only,Ce.string))&&(i.triggerKind===void 0||i.triggerKind===RA.Invoked||i.triggerKind===RA.Automatic)}e.is=n})(cte||(cte={}));var ute;(function(e){function t(r,i,o){let s={title:r},a=!0;return typeof i=="string"?(a=!1,s.kind=i):RO.is(i)?s.command=i:s.edit=i,a&&o!==void 0&&(s.kind=o),s}e.create=t;function n(r){let i=r;return i&&Ce.string(i.title)&&(i.diagnostics===void 0||Ce.typedArray(i.diagnostics,$A.is))&&(i.kind===void 0||Ce.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||RO.is(i.command))&&(i.isPreferred===void 0||Ce.boolean(i.isPreferred))&&(i.edit===void 0||Y4.is(i.edit))}e.is=n})(ute||(ute={}));var fte;(function(e){function t(r,i){let o={range:r};return Ce.defined(i)&&(o.data=i),o}e.create=t;function n(r){let i=r;return Ce.defined(i)&&Yi.is(i.range)&&(Ce.undefined(i.command)||RO.is(i.command))}e.is=n})(fte||(fte={}));var dte;(function(e){function t(r,i){return{tabSize:r,insertSpaces:i}}e.create=t;function n(r){let i=r;return Ce.defined(i)&&Ce.uinteger(i.tabSize)&&Ce.boolean(i.insertSpaces)}e.is=n})(dte||(dte={}));var hte;(function(e){function t(r,i,o){return{range:r,target:i,data:o}}e.create=t;function n(r){let i=r;return Ce.defined(i)&&Yi.is(i.range)&&(Ce.undefined(i.target)||Ce.string(i.target))}e.is=n})(hte||(hte={}));var pte;(function(e){function t(r,i){return{range:r,parent:i}}e.create=t;function n(r){let i=r;return Ce.objectLiteral(i)&&Yi.is(i.range)&&(i.parent===void 0||e.is(i.parent))}e.is=n})(pte||(pte={}));var gte;(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(gte||(gte={}));var mte;(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(mte||(mte={}));var yte;(function(e){function t(n){const r=n;return Ce.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=t})(yte||(yte={}));var vte;(function(e){function t(r,i){return{range:r,text:i}}e.create=t;function n(r){const i=r;return i!=null&&Yi.is(i.range)&&Ce.string(i.text)}e.is=n})(vte||(vte={}));var bte;(function(e){function t(r,i,o){return{range:r,variableName:i,caseSensitiveLookup:o}}e.create=t;function n(r){const i=r;return i!=null&&Yi.is(i.range)&&Ce.boolean(i.caseSensitiveLookup)&&(Ce.string(i.variableName)||i.variableName===void 0)}e.is=n})(bte||(bte={}));var Ote;(function(e){function t(r,i){return{range:r,expression:i}}e.create=t;function n(r){const i=r;return i!=null&&Yi.is(i.range)&&(Ce.string(i.expression)||i.expression===void 0)}e.is=n})(Ote||(Ote={}));var xte;(function(e){function t(r,i){return{frameId:r,stoppedLocation:i}}e.create=t;function n(r){const i=r;return Ce.defined(i)&&Yi.is(r.stoppedLocation)}e.is=n})(xte||(xte={}));var K4;(function(e){e.Type=1,e.Parameter=2;function t(n){return n===1||n===2}e.is=t})(K4||(K4={}));var J4;(function(e){function t(r){return{value:r}}e.create=t;function n(r){const i=r;return Ce.objectLiteral(i)&&(i.tooltip===void 0||Ce.string(i.tooltip)||dC.is(i.tooltip))&&(i.location===void 0||kA.is(i.location))&&(i.command===void 0||RO.is(i.command))}e.is=n})(J4||(J4={}));var wte;(function(e){function t(r,i,o){const s={position:r,label:i};return o!==void 0&&(s.kind=o),s}e.create=t;function n(r){const i=r;return Ce.objectLiteral(i)&&Mu.is(i.position)&&(Ce.string(i.label)||Ce.typedArray(i.label,J4.is))&&(i.kind===void 0||K4.is(i.kind))&&i.textEdits===void 0||Ce.typedArray(i.textEdits,Xh.is)&&(i.tooltip===void 0||Ce.string(i.tooltip)||dC.is(i.tooltip))&&(i.paddingLeft===void 0||Ce.boolean(i.paddingLeft))&&(i.paddingRight===void 0||Ce.boolean(i.paddingRight))}e.is=n})(wte||(wte={}));var Ste;(function(e){function t(n){return{kind:"snippet",value:n}}e.createSnippet=t})(Ste||(Ste={}));var Ete;(function(e){function t(n,r,i,o){return{insertText:n,filterText:r,range:i,command:o}}e.create=t})(Ete||(Ete={}));var Cte;(function(e){function t(n){return{items:n}}e.create=t})(Cte||(Cte={}));var _te;(function(e){e.Invoked=0,e.Automatic=1})(_te||(_te={}));var kte;(function(e){function t(n,r){return{range:n,text:r}}e.create=t})(kte||(kte={}));var $te;(function(e){function t(n,r){return{triggerKind:n,selectedCompletionInfo:r}}e.create=t})($te||($te={}));var Tte;(function(e){function t(n){const r=n;return Ce.objectLiteral(r)&&H4.is(r.uri)&&Ce.string(r.name)}e.is=t})(Tte||(Tte={}));const AMn=[`
`,`\r
`,"\r"];var Pte;(function(e){function t(o,s,a,l){return new RMn(o,s,a,l)}e.create=t;function n(o){let s=o;return!!(Ce.defined(s)&&Ce.string(s.uri)&&(Ce.undefined(s.languageId)||Ce.string(s.languageId))&&Ce.uinteger(s.lineCount)&&Ce.func(s.getText)&&Ce.func(s.positionAt)&&Ce.func(s.offsetAt))}e.is=n;function r(o,s){let a=o.getText(),l=i(s,(u,f)=>{let d=u.range.start.line-f.range.start.line;return d===0?u.range.start.character-f.range.start.character:d}),c=a.length;for(let u=l.length-1;u>=0;u--){let f=l[u],d=o.offsetAt(f.range.start),h=o.offsetAt(f.range.end);if(h<=c)a=a.substring(0,d)+f.newText+a.substring(h,a.length);else throw new Error("Overlapping edit");c=d}return a}e.applyEdits=r;function i(o,s){if(o.length<=1)return o;const a=o.length/2|0,l=o.slice(0,a),c=o.slice(a);i(l,s),i(c,s);let u=0,f=0,d=0;for(;u<l.length&&f<c.length;)s(l[u],c[f])<=0?o[d++]=l[u++]:o[d++]=c[f++];for(;u<l.length;)o[d++]=l[u++];for(;f<c.length;)o[d++]=c[f++];return o}})(Pte||(Pte={}));class RMn{constructor(t,n,r,i){this._uri=t,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content}update(t,n){this._content=t.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let t=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(t.push(i),r=!1);let o=n.charAt(i);r=o==="\r"||o===`
`,o==="\r"&&i+1<n.length&&n.charAt(i+1)===`
`&&i++}r&&n.length>0&&t.push(n.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return Mu.create(0,t);for(;r<i;){let s=Math.floor((r+i)/2);n[s]>t?i=s:r=s+1}let o=r-1;return Mu.create(o,t-n[o])}offsetAt(t){let n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;let r=n[t.line],i=t.line+1<n.length?n[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,i),r)}get lineCount(){return this.getLineOffsets().length}}var Ce;(function(e){const t=Object.prototype.toString;function n(h){return typeof h<"u"}e.defined=n;function r(h){return typeof h>"u"}e.undefined=r;function i(h){return h===!0||h===!1}e.boolean=i;function o(h){return t.call(h)==="[object String]"}e.string=o;function s(h){return t.call(h)==="[object Number]"}e.number=s;function a(h,p,g){return t.call(h)==="[object Number]"&&p<=h&&h<=g}e.numberRange=a;function l(h){return t.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}e.integer=l;function c(h){return t.call(h)==="[object Number]"&&0<=h&&h<=2147483647}e.uinteger=c;function u(h){return t.call(h)==="[object Function]"}e.func=u;function f(h){return h!==null&&typeof h=="object"}e.objectLiteral=f;function d(h,p){return Array.isArray(h)&&h.every(p)}e.typedArray=d})(Ce||(Ce={}));const DMn=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return ag},get ChangeAnnotation(){return vb},get ChangeAnnotationIdentifier(){return Is},get CodeAction(){return ute},get CodeActionContext(){return cte},get CodeActionKind(){return lte},get CodeActionTriggerKind(){return RA},get CodeDescription(){return zee},get CodeLens(){return fte},get Color(){return X4},get ColorInformation(){return Mee},get ColorPresentation(){return Nee},get Command(){return RO},get CompletionItem(){return Yee},get CompletionItemKind(){return qee},get CompletionItemLabelDetails(){return Zee},get CompletionItemTag(){return Uee},get CompletionList(){return Gee},get CreateFile(){return cC},get DeleteFile(){return fC},get Diagnostic(){return $A},get DiagnosticRelatedInformation(){return Z4},get DiagnosticSeverity(){return jee},get DiagnosticTag(){return Fee},get DocumentHighlight(){return nte},get DocumentHighlightKind(){return tte},get DocumentLink(){return hte},get DocumentSymbol(){return ate},get DocumentUri(){return Aee},EOL:AMn,get FoldingRange(){return Lee},get FoldingRangeKind(){return Iee},get FormattingOptions(){return dte},get Hover(){return Kee},get InlayHint(){return wte},get InlayHintKind(){return K4},get InlayHintLabelPart(){return J4},get InlineCompletionContext(){return $te},get InlineCompletionItem(){return Ete},get InlineCompletionList(){return Cte},get InlineCompletionTriggerKind(){return _te},get InlineValueContext(){return xte},get InlineValueEvaluatableExpression(){return Ote},get InlineValueText(){return vte},get InlineValueVariableLookup(){return bte},get InsertReplaceEdit(){return Hee},get InsertTextFormat(){return Vee},get InsertTextMode(){return Xee},get Location(){return kA},get LocationLink(){return Dee},get MarkedString(){return AA},get MarkupContent(){return dC},get MarkupKind(){return G4},get OptionalVersionedTextDocumentIdentifier(){return PA},get ParameterInformation(){return Jee},get Position(){return Mu},get Range(){return Yi},get RenameFile(){return uC},get SelectedCompletionInfo(){return kte},get SelectionRange(){return pte},get SemanticTokenModifiers(){return mte},get SemanticTokenTypes(){return gte},get SemanticTokens(){return yte},get SignatureInformation(){return ete},get StringValue(){return Ste},get SymbolInformation(){return ote},get SymbolKind(){return rte},get SymbolTag(){return ite},get TextDocument(){return Pte},get TextDocumentEdit(){return TA},get TextDocumentIdentifier(){return Qee},get TextDocumentItem(){return Wee},get TextEdit(){return Xh},get URI(){return H4},get VersionedTextDocumentIdentifier(){return Bee},WorkspaceChange:PMn,get WorkspaceEdit(){return Y4},get WorkspaceFolder(){return Tte},get WorkspaceSymbol(){return ste},get integer(){return Ree},get uinteger(){return _A}},Symbol.toStringTag,{value:"Module"})),gpe=cu(DMn);var Mn={};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.ProtocolNotificationType=Mn.ProtocolNotificationType0=Mn.ProtocolRequestType=Mn.ProtocolRequestType0=Mn.RegistrationType=Mn.MessageDirection=void 0;const hC=Ox;var D$e;(function(e){e.clientToServer="clientToServer",e.serverToClient="serverToClient",e.both="both"})(D$e||(Mn.MessageDirection=D$e={}));class MMn{constructor(t){this.method=t}}Mn.RegistrationType=MMn;class NMn extends hC.RequestType0{constructor(t){super(t)}}Mn.ProtocolRequestType0=NMn;class IMn extends hC.RequestType{constructor(t){super(t,hC.ParameterStructures.byName)}}Mn.ProtocolRequestType=IMn;class LMn extends hC.NotificationType0{constructor(t){super(t)}}Mn.ProtocolNotificationType0=LMn;class jMn extends hC.NotificationType{constructor(t){super(t,hC.ParameterStructures.byName)}}Mn.ProtocolNotificationType=jMn;var ent={},Vi={};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.objectLiteral=Vi.typedArray=Vi.stringArray=Vi.array=Vi.func=Vi.error=Vi.number=Vi.string=Vi.boolean=void 0;function FMn(e){return e===!0||e===!1}Vi.boolean=FMn;function tnt(e){return typeof e=="string"||e instanceof String}Vi.string=tnt;function zMn(e){return typeof e=="number"||e instanceof Number}Vi.number=zMn;function QMn(e){return e instanceof Error}Vi.error=QMn;function BMn(e){return typeof e=="function"}Vi.func=BMn;function nnt(e){return Array.isArray(e)}Vi.array=nnt;function WMn(e){return nnt(e)&&e.every(t=>tnt(t))}Vi.stringArray=WMn;function qMn(e,t){return Array.isArray(e)&&e.every(t)}Vi.typedArray=qMn;function VMn(e){return e!==null&&typeof e=="object"}Vi.objectLiteral=VMn;var tB={};Object.defineProperty(tB,"__esModule",{value:!0});tB.ImplementationRequest=void 0;const M$e=Mn;var N$e;(function(e){e.method="textDocument/implementation",e.messageDirection=M$e.MessageDirection.clientToServer,e.type=new M$e.ProtocolRequestType(e.method)})(N$e||(tB.ImplementationRequest=N$e={}));var nB={};Object.defineProperty(nB,"__esModule",{value:!0});nB.TypeDefinitionRequest=void 0;const I$e=Mn;var L$e;(function(e){e.method="textDocument/typeDefinition",e.messageDirection=I$e.MessageDirection.clientToServer,e.type=new I$e.ProtocolRequestType(e.method)})(L$e||(nB.TypeDefinitionRequest=L$e={}));var pC={};Object.defineProperty(pC,"__esModule",{value:!0});pC.DidChangeWorkspaceFoldersNotification=pC.WorkspaceFoldersRequest=void 0;const e7=Mn;var j$e;(function(e){e.method="workspace/workspaceFolders",e.messageDirection=e7.MessageDirection.serverToClient,e.type=new e7.ProtocolRequestType0(e.method)})(j$e||(pC.WorkspaceFoldersRequest=j$e={}));var F$e;(function(e){e.method="workspace/didChangeWorkspaceFolders",e.messageDirection=e7.MessageDirection.clientToServer,e.type=new e7.ProtocolNotificationType(e.method)})(F$e||(pC.DidChangeWorkspaceFoldersNotification=F$e={}));var rB={};Object.defineProperty(rB,"__esModule",{value:!0});rB.ConfigurationRequest=void 0;const z$e=Mn;var Q$e;(function(e){e.method="workspace/configuration",e.messageDirection=z$e.MessageDirection.serverToClient,e.type=new z$e.ProtocolRequestType(e.method)})(Q$e||(rB.ConfigurationRequest=Q$e={}));var gC={};Object.defineProperty(gC,"__esModule",{value:!0});gC.ColorPresentationRequest=gC.DocumentColorRequest=void 0;const t7=Mn;var B$e;(function(e){e.method="textDocument/documentColor",e.messageDirection=t7.MessageDirection.clientToServer,e.type=new t7.ProtocolRequestType(e.method)})(B$e||(gC.DocumentColorRequest=B$e={}));var W$e;(function(e){e.method="textDocument/colorPresentation",e.messageDirection=t7.MessageDirection.clientToServer,e.type=new t7.ProtocolRequestType(e.method)})(W$e||(gC.ColorPresentationRequest=W$e={}));var mC={};Object.defineProperty(mC,"__esModule",{value:!0});mC.FoldingRangeRefreshRequest=mC.FoldingRangeRequest=void 0;const n7=Mn;var q$e;(function(e){e.method="textDocument/foldingRange",e.messageDirection=n7.MessageDirection.clientToServer,e.type=new n7.ProtocolRequestType(e.method)})(q$e||(mC.FoldingRangeRequest=q$e={}));var V$e;(function(e){e.method="workspace/foldingRange/refresh",e.messageDirection=n7.MessageDirection.serverToClient,e.type=new n7.ProtocolRequestType0(e.method)})(V$e||(mC.FoldingRangeRefreshRequest=V$e={}));var iB={};Object.defineProperty(iB,"__esModule",{value:!0});iB.DeclarationRequest=void 0;const U$e=Mn;var H$e;(function(e){e.method="textDocument/declaration",e.messageDirection=U$e.MessageDirection.clientToServer,e.type=new U$e.ProtocolRequestType(e.method)})(H$e||(iB.DeclarationRequest=H$e={}));var oB={};Object.defineProperty(oB,"__esModule",{value:!0});oB.SelectionRangeRequest=void 0;const X$e=Mn;var Z$e;(function(e){e.method="textDocument/selectionRange",e.messageDirection=X$e.MessageDirection.clientToServer,e.type=new X$e.ProtocolRequestType(e.method)})(Z$e||(oB.SelectionRangeRequest=Z$e={}));var p0={};Object.defineProperty(p0,"__esModule",{value:!0});p0.WorkDoneProgressCancelNotification=p0.WorkDoneProgressCreateRequest=p0.WorkDoneProgress=void 0;const UMn=Ox,r7=Mn;var Y$e;(function(e){e.type=new UMn.ProgressType;function t(n){return n===e.type}e.is=t})(Y$e||(p0.WorkDoneProgress=Y$e={}));var G$e;(function(e){e.method="window/workDoneProgress/create",e.messageDirection=r7.MessageDirection.serverToClient,e.type=new r7.ProtocolRequestType(e.method)})(G$e||(p0.WorkDoneProgressCreateRequest=G$e={}));var K$e;(function(e){e.method="window/workDoneProgress/cancel",e.messageDirection=r7.MessageDirection.clientToServer,e.type=new r7.ProtocolNotificationType(e.method)})(K$e||(p0.WorkDoneProgressCancelNotification=K$e={}));var g0={};Object.defineProperty(g0,"__esModule",{value:!0});g0.CallHierarchyOutgoingCallsRequest=g0.CallHierarchyIncomingCallsRequest=g0.CallHierarchyPrepareRequest=void 0;const yC=Mn;var J$e;(function(e){e.method="textDocument/prepareCallHierarchy",e.messageDirection=yC.MessageDirection.clientToServer,e.type=new yC.ProtocolRequestType(e.method)})(J$e||(g0.CallHierarchyPrepareRequest=J$e={}));var eTe;(function(e){e.method="callHierarchy/incomingCalls",e.messageDirection=yC.MessageDirection.clientToServer,e.type=new yC.ProtocolRequestType(e.method)})(eTe||(g0.CallHierarchyIncomingCallsRequest=eTe={}));var tTe;(function(e){e.method="callHierarchy/outgoingCalls",e.messageDirection=yC.MessageDirection.clientToServer,e.type=new yC.ProtocolRequestType(e.method)})(tTe||(g0.CallHierarchyOutgoingCallsRequest=tTe={}));var jl={};Object.defineProperty(jl,"__esModule",{value:!0});jl.SemanticTokensRefreshRequest=jl.SemanticTokensRangeRequest=jl.SemanticTokensDeltaRequest=jl.SemanticTokensRequest=jl.SemanticTokensRegistrationType=jl.TokenFormat=void 0;const im=Mn;var nTe;(function(e){e.Relative="relative"})(nTe||(jl.TokenFormat=nTe={}));var DA;(function(e){e.method="textDocument/semanticTokens",e.type=new im.RegistrationType(e.method)})(DA||(jl.SemanticTokensRegistrationType=DA={}));var rTe;(function(e){e.method="textDocument/semanticTokens/full",e.messageDirection=im.MessageDirection.clientToServer,e.type=new im.ProtocolRequestType(e.method),e.registrationMethod=DA.method})(rTe||(jl.SemanticTokensRequest=rTe={}));var iTe;(function(e){e.method="textDocument/semanticTokens/full/delta",e.messageDirection=im.MessageDirection.clientToServer,e.type=new im.ProtocolRequestType(e.method),e.registrationMethod=DA.method})(iTe||(jl.SemanticTokensDeltaRequest=iTe={}));var oTe;(function(e){e.method="textDocument/semanticTokens/range",e.messageDirection=im.MessageDirection.clientToServer,e.type=new im.ProtocolRequestType(e.method),e.registrationMethod=DA.method})(oTe||(jl.SemanticTokensRangeRequest=oTe={}));var sTe;(function(e){e.method="workspace/semanticTokens/refresh",e.messageDirection=im.MessageDirection.serverToClient,e.type=new im.ProtocolRequestType0(e.method)})(sTe||(jl.SemanticTokensRefreshRequest=sTe={}));var sB={};Object.defineProperty(sB,"__esModule",{value:!0});sB.ShowDocumentRequest=void 0;const aTe=Mn;var lTe;(function(e){e.method="window/showDocument",e.messageDirection=aTe.MessageDirection.serverToClient,e.type=new aTe.ProtocolRequestType(e.method)})(lTe||(sB.ShowDocumentRequest=lTe={}));var aB={};Object.defineProperty(aB,"__esModule",{value:!0});aB.LinkedEditingRangeRequest=void 0;const cTe=Mn;var uTe;(function(e){e.method="textDocument/linkedEditingRange",e.messageDirection=cTe.MessageDirection.clientToServer,e.type=new cTe.ProtocolRequestType(e.method)})(uTe||(aB.LinkedEditingRangeRequest=uTe={}));var Oa={};Object.defineProperty(Oa,"__esModule",{value:!0});Oa.WillDeleteFilesRequest=Oa.DidDeleteFilesNotification=Oa.DidRenameFilesNotification=Oa.WillRenameFilesRequest=Oa.DidCreateFilesNotification=Oa.WillCreateFilesRequest=Oa.FileOperationPatternKind=void 0;const xf=Mn;var fTe;(function(e){e.file="file",e.folder="folder"})(fTe||(Oa.FileOperationPatternKind=fTe={}));var dTe;(function(e){e.method="workspace/willCreateFiles",e.messageDirection=xf.MessageDirection.clientToServer,e.type=new xf.ProtocolRequestType(e.method)})(dTe||(Oa.WillCreateFilesRequest=dTe={}));var hTe;(function(e){e.method="workspace/didCreateFiles",e.messageDirection=xf.MessageDirection.clientToServer,e.type=new xf.ProtocolNotificationType(e.method)})(hTe||(Oa.DidCreateFilesNotification=hTe={}));var pTe;(function(e){e.method="workspace/willRenameFiles",e.messageDirection=xf.MessageDirection.clientToServer,e.type=new xf.ProtocolRequestType(e.method)})(pTe||(Oa.WillRenameFilesRequest=pTe={}));var gTe;(function(e){e.method="workspace/didRenameFiles",e.messageDirection=xf.MessageDirection.clientToServer,e.type=new xf.ProtocolNotificationType(e.method)})(gTe||(Oa.DidRenameFilesNotification=gTe={}));var mTe;(function(e){e.method="workspace/didDeleteFiles",e.messageDirection=xf.MessageDirection.clientToServer,e.type=new xf.ProtocolNotificationType(e.method)})(mTe||(Oa.DidDeleteFilesNotification=mTe={}));var yTe;(function(e){e.method="workspace/willDeleteFiles",e.messageDirection=xf.MessageDirection.clientToServer,e.type=new xf.ProtocolRequestType(e.method)})(yTe||(Oa.WillDeleteFilesRequest=yTe={}));var m0={};Object.defineProperty(m0,"__esModule",{value:!0});m0.MonikerRequest=m0.MonikerKind=m0.UniquenessLevel=void 0;const vTe=Mn;var bTe;(function(e){e.document="document",e.project="project",e.group="group",e.scheme="scheme",e.global="global"})(bTe||(m0.UniquenessLevel=bTe={}));var OTe;(function(e){e.$import="import",e.$export="export",e.local="local"})(OTe||(m0.MonikerKind=OTe={}));var xTe;(function(e){e.method="textDocument/moniker",e.messageDirection=vTe.MessageDirection.clientToServer,e.type=new vTe.ProtocolRequestType(e.method)})(xTe||(m0.MonikerRequest=xTe={}));var y0={};Object.defineProperty(y0,"__esModule",{value:!0});y0.TypeHierarchySubtypesRequest=y0.TypeHierarchySupertypesRequest=y0.TypeHierarchyPrepareRequest=void 0;const vC=Mn;var wTe;(function(e){e.method="textDocument/prepareTypeHierarchy",e.messageDirection=vC.MessageDirection.clientToServer,e.type=new vC.ProtocolRequestType(e.method)})(wTe||(y0.TypeHierarchyPrepareRequest=wTe={}));var STe;(function(e){e.method="typeHierarchy/supertypes",e.messageDirection=vC.MessageDirection.clientToServer,e.type=new vC.ProtocolRequestType(e.method)})(STe||(y0.TypeHierarchySupertypesRequest=STe={}));var ETe;(function(e){e.method="typeHierarchy/subtypes",e.messageDirection=vC.MessageDirection.clientToServer,e.type=new vC.ProtocolRequestType(e.method)})(ETe||(y0.TypeHierarchySubtypesRequest=ETe={}));var bC={};Object.defineProperty(bC,"__esModule",{value:!0});bC.InlineValueRefreshRequest=bC.InlineValueRequest=void 0;const i7=Mn;var CTe;(function(e){e.method="textDocument/inlineValue",e.messageDirection=i7.MessageDirection.clientToServer,e.type=new i7.ProtocolRequestType(e.method)})(CTe||(bC.InlineValueRequest=CTe={}));var _Te;(function(e){e.method="workspace/inlineValue/refresh",e.messageDirection=i7.MessageDirection.serverToClient,e.type=new i7.ProtocolRequestType0(e.method)})(_Te||(bC.InlineValueRefreshRequest=_Te={}));var v0={};Object.defineProperty(v0,"__esModule",{value:!0});v0.InlayHintRefreshRequest=v0.InlayHintResolveRequest=v0.InlayHintRequest=void 0;const OC=Mn;var kTe;(function(e){e.method="textDocument/inlayHint",e.messageDirection=OC.MessageDirection.clientToServer,e.type=new OC.ProtocolRequestType(e.method)})(kTe||(v0.InlayHintRequest=kTe={}));var $Te;(function(e){e.method="inlayHint/resolve",e.messageDirection=OC.MessageDirection.clientToServer,e.type=new OC.ProtocolRequestType(e.method)})($Te||(v0.InlayHintResolveRequest=$Te={}));var TTe;(function(e){e.method="workspace/inlayHint/refresh",e.messageDirection=OC.MessageDirection.serverToClient,e.type=new OC.ProtocolRequestType0(e.method)})(TTe||(v0.InlayHintRefreshRequest=TTe={}));var zu={};Object.defineProperty(zu,"__esModule",{value:!0});zu.DiagnosticRefreshRequest=zu.WorkspaceDiagnosticRequest=zu.DocumentDiagnosticRequest=zu.DocumentDiagnosticReportKind=zu.DiagnosticServerCancellationData=void 0;const rnt=Ox,HMn=Vi,xC=Mn;var PTe;(function(e){function t(n){const r=n;return r&&HMn.boolean(r.retriggerRequest)}e.is=t})(PTe||(zu.DiagnosticServerCancellationData=PTe={}));var ATe;(function(e){e.Full="full",e.Unchanged="unchanged"})(ATe||(zu.DocumentDiagnosticReportKind=ATe={}));var RTe;(function(e){e.method="textDocument/diagnostic",e.messageDirection=xC.MessageDirection.clientToServer,e.type=new xC.ProtocolRequestType(e.method),e.partialResult=new rnt.ProgressType})(RTe||(zu.DocumentDiagnosticRequest=RTe={}));var DTe;(function(e){e.method="workspace/diagnostic",e.messageDirection=xC.MessageDirection.clientToServer,e.type=new xC.ProtocolRequestType(e.method),e.partialResult=new rnt.ProgressType})(DTe||(zu.WorkspaceDiagnosticRequest=DTe={}));var MTe;(function(e){e.method="workspace/diagnostic/refresh",e.messageDirection=xC.MessageDirection.serverToClient,e.type=new xC.ProtocolRequestType0(e.method)})(MTe||(zu.DiagnosticRefreshRequest=MTe={}));var Wi={};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.DidCloseNotebookDocumentNotification=Wi.DidSaveNotebookDocumentNotification=Wi.DidChangeNotebookDocumentNotification=Wi.NotebookCellArrayChange=Wi.DidOpenNotebookDocumentNotification=Wi.NotebookDocumentSyncRegistrationType=Wi.NotebookDocument=Wi.NotebookCell=Wi.ExecutionSummary=Wi.NotebookCellKind=void 0;const MA=gpe,ad=Vi,pp=Mn;var Ate;(function(e){e.Markup=1,e.Code=2;function t(n){return n===1||n===2}e.is=t})(Ate||(Wi.NotebookCellKind=Ate={}));var Rte;(function(e){function t(i,o){const s={executionOrder:i};return(o===!0||o===!1)&&(s.success=o),s}e.create=t;function n(i){const o=i;return ad.objectLiteral(o)&&MA.uinteger.is(o.executionOrder)&&(o.success===void 0||ad.boolean(o.success))}e.is=n;function r(i,o){return i===o?!0:i==null||o===null||o===void 0?!1:i.executionOrder===o.executionOrder&&i.success===o.success}e.equals=r})(Rte||(Wi.ExecutionSummary=Rte={}));var o7;(function(e){function t(o,s){return{kind:o,document:s}}e.create=t;function n(o){const s=o;return ad.objectLiteral(s)&&Ate.is(s.kind)&&MA.DocumentUri.is(s.document)&&(s.metadata===void 0||ad.objectLiteral(s.metadata))}e.is=n;function r(o,s){const a=new Set;return o.document!==s.document&&a.add("document"),o.kind!==s.kind&&a.add("kind"),o.executionSummary!==s.executionSummary&&a.add("executionSummary"),(o.metadata!==void 0||s.metadata!==void 0)&&!i(o.metadata,s.metadata)&&a.add("metadata"),(o.executionSummary!==void 0||s.executionSummary!==void 0)&&!Rte.equals(o.executionSummary,s.executionSummary)&&a.add("executionSummary"),a}e.diff=r;function i(o,s){if(o===s)return!0;if(o==null||s===null||s===void 0||typeof o!=typeof s||typeof o!="object")return!1;const a=Array.isArray(o),l=Array.isArray(s);if(a!==l)return!1;if(a&&l){if(o.length!==s.length)return!1;for(let c=0;c<o.length;c++)if(!i(o[c],s[c]))return!1}if(ad.objectLiteral(o)&&ad.objectLiteral(s)){const c=Object.keys(o),u=Object.keys(s);if(c.length!==u.length||(c.sort(),u.sort(),!i(c,u)))return!1;for(let f=0;f<c.length;f++){const d=c[f];if(!i(o[d],s[d]))return!1}}return!0}})(o7||(Wi.NotebookCell=o7={}));var NTe;(function(e){function t(r,i,o,s){return{uri:r,notebookType:i,version:o,cells:s}}e.create=t;function n(r){const i=r;return ad.objectLiteral(i)&&ad.string(i.uri)&&MA.integer.is(i.version)&&ad.typedArray(i.cells,o7.is)}e.is=n})(NTe||(Wi.NotebookDocument=NTe={}));var wC;(function(e){e.method="notebookDocument/sync",e.messageDirection=pp.MessageDirection.clientToServer,e.type=new pp.RegistrationType(e.method)})(wC||(Wi.NotebookDocumentSyncRegistrationType=wC={}));var ITe;(function(e){e.method="notebookDocument/didOpen",e.messageDirection=pp.MessageDirection.clientToServer,e.type=new pp.ProtocolNotificationType(e.method),e.registrationMethod=wC.method})(ITe||(Wi.DidOpenNotebookDocumentNotification=ITe={}));var LTe;(function(e){function t(r){const i=r;return ad.objectLiteral(i)&&MA.uinteger.is(i.start)&&MA.uinteger.is(i.deleteCount)&&(i.cells===void 0||ad.typedArray(i.cells,o7.is))}e.is=t;function n(r,i,o){const s={start:r,deleteCount:i};return o!==void 0&&(s.cells=o),s}e.create=n})(LTe||(Wi.NotebookCellArrayChange=LTe={}));var jTe;(function(e){e.method="notebookDocument/didChange",e.messageDirection=pp.MessageDirection.clientToServer,e.type=new pp.ProtocolNotificationType(e.method),e.registrationMethod=wC.method})(jTe||(Wi.DidChangeNotebookDocumentNotification=jTe={}));var FTe;(function(e){e.method="notebookDocument/didSave",e.messageDirection=pp.MessageDirection.clientToServer,e.type=new pp.ProtocolNotificationType(e.method),e.registrationMethod=wC.method})(FTe||(Wi.DidSaveNotebookDocumentNotification=FTe={}));var zTe;(function(e){e.method="notebookDocument/didClose",e.messageDirection=pp.MessageDirection.clientToServer,e.type=new pp.ProtocolNotificationType(e.method),e.registrationMethod=wC.method})(zTe||(Wi.DidCloseNotebookDocumentNotification=zTe={}));var lB={};Object.defineProperty(lB,"__esModule",{value:!0});lB.InlineCompletionRequest=void 0;const QTe=Mn;var BTe;(function(e){e.method="textDocument/inlineCompletion",e.messageDirection=QTe.MessageDirection.clientToServer,e.type=new QTe.ProtocolRequestType(e.method)})(BTe||(lB.InlineCompletionRequest=BTe={}));(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;const t=Mn,n=gpe,r=Vi,i=tB;Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const o=nB;Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return o.TypeDefinitionRequest}});const s=pC;Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const a=rB;Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const l=gC;Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return l.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return l.ColorPresentationRequest}});const c=mC;Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return c.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return c.FoldingRangeRefreshRequest}});const u=iB;Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return u.DeclarationRequest}});const f=oB;Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return f.SelectionRangeRequest}});const d=p0;Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return d.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return d.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return d.WorkDoneProgressCancelNotification}});const h=g0;Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return h.CallHierarchyPrepareRequest}});const p=jl;Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return p.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return p.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return p.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return p.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return p.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return p.SemanticTokensRegistrationType}});const g=sB;Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return g.ShowDocumentRequest}});const v=aB;Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return v.LinkedEditingRangeRequest}});const y=Oa;Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return y.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return y.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return y.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return y.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return y.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return y.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return y.WillDeleteFilesRequest}});const O=m0;Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return O.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return O.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return O.MonikerRequest}});const m=y0;Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return m.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return m.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return m.TypeHierarchySupertypesRequest}});const w=bC;Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return w.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return w.InlineValueRefreshRequest}});const S=v0;Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return S.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return S.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return S.InlayHintRefreshRequest}});const E=zu;Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return E.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return E.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return E.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return E.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return E.DiagnosticRefreshRequest}});const C=Wi;Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return C.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return C.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return C.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return C.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return C.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return C.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return C.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return C.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return C.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return C.DidCloseNotebookDocumentNotification}});const k=lB;Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return k.InlineCompletionRequest}});var P;(function(ne){function ir(cn){const Tt=cn;return r.string(Tt)||r.string(Tt.language)||r.string(Tt.scheme)||r.string(Tt.pattern)}ne.is=ir})(P||(e.TextDocumentFilter=P={}));var D;(function(ne){function ir(cn){const Tt=cn;return r.objectLiteral(Tt)&&(r.string(Tt.notebookType)||r.string(Tt.scheme)||r.string(Tt.pattern))}ne.is=ir})(D||(e.NotebookDocumentFilter=D={}));var M;(function(ne){function ir(cn){const Tt=cn;return r.objectLiteral(Tt)&&(r.string(Tt.notebook)||D.is(Tt.notebook))&&(Tt.language===void 0||r.string(Tt.language))}ne.is=ir})(M||(e.NotebookCellTextDocumentFilter=M={}));var L;(function(ne){function ir(cn){if(!Array.isArray(cn))return!1;for(let Tt of cn)if(!r.string(Tt)&&!P.is(Tt)&&!M.is(Tt))return!1;return!0}ne.is=ir})(L||(e.DocumentSelector=L={}));var A;(function(ne){ne.method="client/registerCapability",ne.messageDirection=t.MessageDirection.serverToClient,ne.type=new t.ProtocolRequestType(ne.method)})(A||(e.RegistrationRequest=A={}));var T;(function(ne){ne.method="client/unregisterCapability",ne.messageDirection=t.MessageDirection.serverToClient,ne.type=new t.ProtocolRequestType(ne.method)})(T||(e.UnregistrationRequest=T={}));var N;(function(ne){ne.Create="create",ne.Rename="rename",ne.Delete="delete"})(N||(e.ResourceOperationKind=N={}));var j;(function(ne){ne.Abort="abort",ne.Transactional="transactional",ne.TextOnlyTransactional="textOnlyTransactional",ne.Undo="undo"})(j||(e.FailureHandlingKind=j={}));var z;(function(ne){ne.UTF8="utf-8",ne.UTF16="utf-16",ne.UTF32="utf-32"})(z||(e.PositionEncodingKind=z={}));var W;(function(ne){function ir(cn){const Tt=cn;return Tt&&r.string(Tt.id)&&Tt.id.length>0}ne.hasId=ir})(W||(e.StaticRegistrationOptions=W={}));var F;(function(ne){function ir(cn){const Tt=cn;return Tt&&(Tt.documentSelector===null||L.is(Tt.documentSelector))}ne.is=ir})(F||(e.TextDocumentRegistrationOptions=F={}));var q;(function(ne){function ir(Tt){const ue=Tt;return r.objectLiteral(ue)&&(ue.workDoneProgress===void 0||r.boolean(ue.workDoneProgress))}ne.is=ir;function cn(Tt){const ue=Tt;return ue&&r.boolean(ue.workDoneProgress)}ne.hasWorkDoneProgress=cn})(q||(e.WorkDoneProgressOptions=q={}));var U;(function(ne){ne.method="initialize",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(U||(e.InitializeRequest=U={}));var V;(function(ne){ne.unknownProtocolVersion=1})(V||(e.InitializeErrorCodes=V={}));var H;(function(ne){ne.method="initialized",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolNotificationType(ne.method)})(H||(e.InitializedNotification=H={}));var Z;(function(ne){ne.method="shutdown",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType0(ne.method)})(Z||(e.ShutdownRequest=Z={}));var ee;(function(ne){ne.method="exit",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolNotificationType0(ne.method)})(ee||(e.ExitNotification=ee={}));var se;(function(ne){ne.method="workspace/didChangeConfiguration",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolNotificationType(ne.method)})(se||(e.DidChangeConfigurationNotification=se={}));var fe;(function(ne){ne.Error=1,ne.Warning=2,ne.Info=3,ne.Log=4,ne.Debug=5})(fe||(e.MessageType=fe={}));var ce;(function(ne){ne.method="window/showMessage",ne.messageDirection=t.MessageDirection.serverToClient,ne.type=new t.ProtocolNotificationType(ne.method)})(ce||(e.ShowMessageNotification=ce={}));var ae;(function(ne){ne.method="window/showMessageRequest",ne.messageDirection=t.MessageDirection.serverToClient,ne.type=new t.ProtocolRequestType(ne.method)})(ae||(e.ShowMessageRequest=ae={}));var de;(function(ne){ne.method="window/logMessage",ne.messageDirection=t.MessageDirection.serverToClient,ne.type=new t.ProtocolNotificationType(ne.method)})(de||(e.LogMessageNotification=de={}));var me;(function(ne){ne.method="telemetry/event",ne.messageDirection=t.MessageDirection.serverToClient,ne.type=new t.ProtocolNotificationType(ne.method)})(me||(e.TelemetryEventNotification=me={}));var te;(function(ne){ne.None=0,ne.Full=1,ne.Incremental=2})(te||(e.TextDocumentSyncKind=te={}));var Ee;(function(ne){ne.method="textDocument/didOpen",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolNotificationType(ne.method)})(Ee||(e.DidOpenTextDocumentNotification=Ee={}));var we;(function(ne){function ir(Tt){let ue=Tt;return ue!=null&&typeof ue.text=="string"&&ue.range!==void 0&&(ue.rangeLength===void 0||typeof ue.rangeLength=="number")}ne.isIncremental=ir;function cn(Tt){let ue=Tt;return ue!=null&&typeof ue.text=="string"&&ue.range===void 0&&ue.rangeLength===void 0}ne.isFull=cn})(we||(e.TextDocumentContentChangeEvent=we={}));var ke;(function(ne){ne.method="textDocument/didChange",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolNotificationType(ne.method)})(ke||(e.DidChangeTextDocumentNotification=ke={}));var je;(function(ne){ne.method="textDocument/didClose",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolNotificationType(ne.method)})(je||(e.DidCloseTextDocumentNotification=je={}));var nt;(function(ne){ne.method="textDocument/didSave",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolNotificationType(ne.method)})(nt||(e.DidSaveTextDocumentNotification=nt={}));var Re;(function(ne){ne.Manual=1,ne.AfterDelay=2,ne.FocusOut=3})(Re||(e.TextDocumentSaveReason=Re={}));var G;(function(ne){ne.method="textDocument/willSave",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolNotificationType(ne.method)})(G||(e.WillSaveTextDocumentNotification=G={}));var le;(function(ne){ne.method="textDocument/willSaveWaitUntil",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(le||(e.WillSaveTextDocumentWaitUntilRequest=le={}));var Oe;(function(ne){ne.method="workspace/didChangeWatchedFiles",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolNotificationType(ne.method)})(Oe||(e.DidChangeWatchedFilesNotification=Oe={}));var Ue;(function(ne){ne.Created=1,ne.Changed=2,ne.Deleted=3})(Ue||(e.FileChangeType=Ue={}));var Fe;(function(ne){function ir(cn){const Tt=cn;return r.objectLiteral(Tt)&&(n.URI.is(Tt.baseUri)||n.WorkspaceFolder.is(Tt.baseUri))&&r.string(Tt.pattern)}ne.is=ir})(Fe||(e.RelativePattern=Fe={}));var ye;(function(ne){ne.Create=1,ne.Change=2,ne.Delete=4})(ye||(e.WatchKind=ye={}));var Me;(function(ne){ne.method="textDocument/publishDiagnostics",ne.messageDirection=t.MessageDirection.serverToClient,ne.type=new t.ProtocolNotificationType(ne.method)})(Me||(e.PublishDiagnosticsNotification=Me={}));var pt;(function(ne){ne.Invoked=1,ne.TriggerCharacter=2,ne.TriggerForIncompleteCompletions=3})(pt||(e.CompletionTriggerKind=pt={}));var at;(function(ne){ne.method="textDocument/completion",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(at||(e.CompletionRequest=at={}));var ht;(function(ne){ne.method="completionItem/resolve",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(ht||(e.CompletionResolveRequest=ht={}));var _t;(function(ne){ne.method="textDocument/hover",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(_t||(e.HoverRequest=_t={}));var yn;(function(ne){ne.Invoked=1,ne.TriggerCharacter=2,ne.ContentChange=3})(yn||(e.SignatureHelpTriggerKind=yn={}));var _n;(function(ne){ne.method="textDocument/signatureHelp",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(_n||(e.SignatureHelpRequest=_n={}));var ri;(function(ne){ne.method="textDocument/definition",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(ri||(e.DefinitionRequest=ri={}));var hi;(function(ne){ne.method="textDocument/references",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(hi||(e.ReferencesRequest=hi={}));var Qt;(function(ne){ne.method="textDocument/documentHighlight",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(Qt||(e.DocumentHighlightRequest=Qt={}));var An;(function(ne){ne.method="textDocument/documentSymbol",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(An||(e.DocumentSymbolRequest=An={}));var Ht;(function(ne){ne.method="textDocument/codeAction",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(Ht||(e.CodeActionRequest=Ht={}));var rr;(function(ne){ne.method="codeAction/resolve",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(rr||(e.CodeActionResolveRequest=rr={}));var Ci;(function(ne){ne.method="workspace/symbol",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(Ci||(e.WorkspaceSymbolRequest=Ci={}));var xs;(function(ne){ne.method="workspaceSymbol/resolve",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(xs||(e.WorkspaceSymbolResolveRequest=xs={}));var Ar;(function(ne){ne.method="textDocument/codeLens",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(Ar||(e.CodeLensRequest=Ar={}));var Rn;(function(ne){ne.method="codeLens/resolve",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(Rn||(e.CodeLensResolveRequest=Rn={}));var Rr;(function(ne){ne.method="workspace/codeLens/refresh",ne.messageDirection=t.MessageDirection.serverToClient,ne.type=new t.ProtocolRequestType0(ne.method)})(Rr||(e.CodeLensRefreshRequest=Rr={}));var Ii;(function(ne){ne.method="textDocument/documentLink",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(Ii||(e.DocumentLinkRequest=Ii={}));var Ji;(function(ne){ne.method="documentLink/resolve",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(Ji||(e.DocumentLinkResolveRequest=Ji={}));var Li;(function(ne){ne.method="textDocument/formatting",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(Li||(e.DocumentFormattingRequest=Li={}));var ji;(function(ne){ne.method="textDocument/rangeFormatting",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(ji||(e.DocumentRangeFormattingRequest=ji={}));var Ro;(function(ne){ne.method="textDocument/rangesFormatting",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(Ro||(e.DocumentRangesFormattingRequest=Ro={}));var eo;(function(ne){ne.method="textDocument/onTypeFormatting",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(eo||(e.DocumentOnTypeFormattingRequest=eo={}));var pi;(function(ne){ne.Identifier=1})(pi||(e.PrepareSupportDefaultBehavior=pi={}));var Do;(function(ne){ne.method="textDocument/rename",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(Do||(e.RenameRequest=Do={}));var ta;(function(ne){ne.method="textDocument/prepareRename",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(ta||(e.PrepareRenameRequest=ta={}));var ws;(function(ne){ne.method="workspace/executeCommand",ne.messageDirection=t.MessageDirection.clientToServer,ne.type=new t.ProtocolRequestType(ne.method)})(ws||(e.ExecuteCommandRequest=ws={}));var _i;(function(ne){ne.method="workspace/applyEdit",ne.messageDirection=t.MessageDirection.serverToClient,ne.type=new t.ProtocolRequestType("workspace/applyEdit")})(_i||(e.ApplyWorkspaceEditRequest=_i={}))})(ent);var cB={};Object.defineProperty(cB,"__esModule",{value:!0});cB.createProtocolConnection=void 0;const WTe=Ox;function XMn(e,t,n,r){return WTe.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,WTe.createMessageConnection)(e,t,n,r)}cB.createProtocolConnection=XMn;(function(e){var t=ft&&ft.__createBinding||(Object.create?function(o,s,a,l){l===void 0&&(l=a);var c=Object.getOwnPropertyDescriptor(s,a);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(o,l,c)}:function(o,s,a,l){l===void 0&&(l=a),o[l]=s[a]}),n=ft&&ft.__exportStar||function(o,s){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(s,a)&&t(s,o,a)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,n(Ox,e),n(gpe,e),n(Mn,e),n(ent,e);var r=cB;Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(o){o.lspReservedErrorRangeStart=-32899,o.RequestFailed=-32803,o.ServerCancelled=-32802,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800})(i||(e.LSPErrorCodes=i={}))})(Jtt);(function(e){var t=ft&&ft.__createBinding||(Object.create?function(o,s,a,l){l===void 0&&(l=a);var c=Object.getOwnPropertyDescriptor(s,a);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(o,l,c)}:function(o,s,a,l){l===void 0&&(l=a),o[l]=s[a]}),n=ft&&ft.__exportStar||function(o,s){for(var a in o)a!=="default"&&!Object.prototype.hasOwnProperty.call(s,a)&&t(s,o,a)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;const r=A$e;n(A$e,e),n(Jtt,e);function i(o,s,a,l){return(0,r.createMessageConnection)(o,s,a,l)}e.createProtocolConnection=i})(Dh);const mH=1e4,ZMn=500,YMn=Object.fromEntries(Object.entries(Dh.CompletionItemKind).map(([e,t])=>[t,e])),mpe=e=>e.reduce((t,n)=>n,""),int=mt.define({combine:mpe}),ont=mt.define({combine:mpe}),snt=mt.define({combine:mpe});class ant{constructor(t){this.rootUri=t.rootUri,this.workspaceFolders=t.workspaceFolders,this.autoClose=t.autoClose,this.plugins=[],this.transport=t.transport,this.requestManager=new q4.RequestManager([this.transport]),this.client=new q4.Client(this.requestManager),this.client.onNotification(r=>{this.processNotification(r)});const n=this.transport;n&&n.connection&&n.connection.addEventListener("message",r=>{const i=JSON.parse(r.data);i.method&&i.id&&n.connection.send(JSON.stringify({jsonrpc:"2.0",id:i.id,result:null}))}),this.initializePromise=this.initialize()}async initialize(){const{capabilities:t}=await this.request("initialize",{capabilities:{textDocument:{hover:{dynamicRegistration:!0,contentFormat:["plaintext","markdown"]},moniker:{},synchronization:{dynamicRegistration:!0,willSave:!1,didSave:!1,willSaveWaitUntil:!1},completion:{dynamicRegistration:!0,completionItem:{snippetSupport:!1,commitCharactersSupport:!0,documentationFormat:["plaintext","markdown"],deprecatedSupport:!1,preselectSupport:!1},contextSupport:!1},signatureHelp:{dynamicRegistration:!0,signatureInformation:{documentationFormat:["plaintext","markdown"]}},declaration:{dynamicRegistration:!0,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!0}}},initializationOptions:null,processId:null,rootUri:this.rootUri,workspaceFolders:this.workspaceFolders},mH*3);this.capabilities=t,this.notify("initialized",{}),this.ready=!0}close(){this.client.close()}textDocumentDidOpen(t){return this.notify("textDocument/didOpen",t)}textDocumentDidChange(t){return this.notify("textDocument/didChange",t)}async textDocumentHover(t){return await this.request("textDocument/hover",t,mH)}async textDocumentCompletion(t){return await this.request("textDocument/completion",t,mH)}attachPlugin(t){this.plugins.push(t)}detachPlugin(t){const n=this.plugins.indexOf(t);n!==-1&&(this.plugins.splice(n,1),this.autoClose&&this.close())}request(t,n,r){return this.client.request({method:t,params:n},r)}notify(t,n){return this.client.notify({method:t,params:n})}processNotification(t){for(const n of this.plugins)n.processNotification(t)}}class GMn{constructor(t,n){this.view=t,this.allowHTMLContent=n,this.client=this.view.state.facet(int),this.documentUri=this.view.state.facet(ont),this.languageId=this.view.state.facet(snt),this.documentVersion=0,this.changesTimeout=0,this.client.attachPlugin(this),this.initialize({documentText:this.view.state.doc.toString()})}update({docChanged:t}){t&&(this.changesTimeout&&clearTimeout(this.changesTimeout),this.changesTimeout=self.setTimeout(()=>{this.sendChange({documentText:this.view.state.doc.toString()})},ZMn))}destroy(){this.client.detachPlugin(this)}async initialize({documentText:t}){this.client.initializePromise&&await this.client.initializePromise,this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:t,version:this.documentVersion}})}async sendChange({documentText:t}){if(this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:this.documentVersion++},contentChanges:[{text:t}]})}catch(n){console.error(n)}}requestDiagnostics(t){this.sendChange({documentText:t.state.doc.toString()})}async requestHoverTooltip(t,{line:n,character:r}){if(!this.client.ready||!this.client.capabilities.hoverProvider)return null;this.sendChange({documentText:t.state.doc.toString()});const i=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:n,character:r}});if(!i)return null;const{contents:o,range:s}=i;let a=Jk(t.state.doc,{line:n,character:r}),l;if(s&&(a=Jk(t.state.doc,s.start),l=Jk(t.state.doc,s.end)),a===null)return null;const c=document.createElement("div");return c.classList.add("documentation"),this.allowHTMLContent?c.innerHTML=_L(o):c.textContent=_L(o),{pos:a,end:l,create:u=>({dom:c}),above:!0}}async requestCompletion(t,{line:n,character:r},{triggerKind:i,triggerCharacter:o}){if(!this.client.ready||!this.client.capabilities.completionProvider)return null;this.sendChange({documentText:t.state.doc.toString()});const s=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:n,character:r},context:{triggerKind:i,triggerCharacter:o}});if(!s)return null;let l=("items"in s?s.items:s).map(({detail:h,label:p,kind:g,textEdit:v,documentation:y,sortText:O,filterText:m})=>{var w;const S={label:p,detail:h,apply:(w=v==null?void 0:v.newText)!==null&&w!==void 0?w:p,type:g&&YMn[g].toLowerCase(),sortText:O??p,filterText:m??p};return y&&(S.info=_L(y)),S});const[c,u]=JMn(l),f=t.matchBefore(u);let{pos:d}=t;if(f){d=f.from;const h=f.text.toLowerCase();/^\w+$/.test(h)&&(l=l.filter(({filterText:p})=>p.toLowerCase().startsWith(h)).sort(({apply:p},{apply:g})=>{switch(!0){case(p.startsWith(f.text)&&!g.startsWith(f.text)):return-1;case(!p.startsWith(f.text)&&g.startsWith(f.text)):return 1}return 0}))}return{from:d,options:l}}processNotification(t){try{switch(t.method){case"textDocument/publishDiagnostics":this.processDiagnostics(t.params)}}catch(n){console.error(n)}}processDiagnostics(t){if(t.uri!==this.documentUri)return;const n=t.diagnostics.map(({range:r,message:i,severity:o})=>({from:Jk(this.view.state.doc,r.start),to:Jk(this.view.state.doc,r.end),severity:{[Dh.DiagnosticSeverity.Error]:"error",[Dh.DiagnosticSeverity.Warning]:"warning",[Dh.DiagnosticSeverity.Information]:"info",[Dh.DiagnosticSeverity.Hint]:"info"}[o],message:i})).filter(({from:r,to:i})=>r!==null&&i!==null&&r!==void 0&&i!==void 0).sort((r,i)=>{switch(!0){case r.from<i.from:return-1;case r.from>i.from:return 1}return 0});this.view.dispatch(FZt(this.view.state,n))}}function KMn(e){let t=null;return[int.of(e.client||new ant({...e,autoClose:!0})),ont.of(e.documentUri),snt.of(e.languageId),jr.define(n=>t=new GMn(n,e.allowHTMLContent)),Gse((n,r)=>{var i;return(i=t==null?void 0:t.requestHoverTooltip(n,qTe(n.state.doc,r)))!==null&&i!==void 0?i:null}),L8({override:[async n=>{var r,i,o;if(t==null)return null;const{state:s,pos:a,explicit:l}=n,c=s.doc.lineAt(a);let u=Dh.CompletionTriggerKind.Invoked,f;return!l&&(!((o=(i=(r=t.client.capabilities)===null||r===void 0?void 0:r.completionProvider)===null||i===void 0?void 0:i.triggerCharacters)===null||o===void 0)&&o.includes(c.text[a-c.from-1]))&&(u=Dh.CompletionTriggerKind.TriggerCharacter,f=c.text[a-c.from-1]),u===Dh.CompletionTriggerKind.Invoked&&!n.matchBefore(/\w+$/)?null:await t.requestCompletion(n,qTe(s.doc,a),{triggerKind:u,triggerCharacter:f})}]})]}function Jk(e,t){if(t.line>=e.lines)return;const n=e.line(t.line+1).from+t.character;if(!(n>e.length))return n}function qTe(e,t){const n=e.lineAt(t);return{line:n.number-1,character:t-n.from}}function _L(e){return Array.isArray(e)?e.map(t=>_L(t)+`

`).join(""):typeof e=="string"?e:e.value}function VTe(e){let t="",n=Array.from(e).join("");return/\w/.test(n)&&(t+="\\w",n=n.replace(/\w/g,"")),`[${t}${n.replace(/[^\w\s]/g,"\\$&")}]`}function JMn(e){const t=new Set,n=new Set;for(const{apply:i}of e){const[o,...s]=i;t.add(o);for(const a of s)n.add(a)}const r=VTe(t)+VTe(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}class s7{static create(t,n,r,i,o){let s=i+(i<<8)+t+(n<<4)|0;return new s7(t,n,r,s,o,[],[])}constructor(t,n,r,i,o,s,a){this.type=t,this.value=n,this.from=r,this.hash=i,this.end=o,this.children=s,this.positions=a,this.hashProp=[[Zt.contextHash,i]]}addChild(t,n){t.prop(Zt.contextHash)!=this.hash&&(t=new Bn(t.type,t.children,t.positions,t.length,this.hashProp)),this.children.push(t),this.positions.push(n)}toTree(t,n=this.end){let r=this.children.length-1;return r>=0&&(n=Math.max(n,this.positions[r]+this.children[r].length+this.from)),new Bn(t.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(i,o,s)=>new Bn(To.none,i,o,s,this.hashProp)})}}var rt;(function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.URL=33]="URL",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel"})(rt||(rt={}));class eNn{constructor(t,n){this.start=t,this.content=n,this.marks=[],this.parsers=[]}}class tNn{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let t=this.skipSpace(this.basePos);this.indent=this.countIndent(t,this.pos,this.indent),this.pos=t,this.next=t==this.text.length?-1:this.text.charCodeAt(t)}skipSpace(t){return a2(this.text,t)}reset(t){for(this.text=t,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(t){this.basePos=t,this.baseIndent=this.countIndent(t,this.pos,this.indent)}moveBaseColumn(t){this.baseIndent=t,this.basePos=this.findColumn(t)}addMarker(t){this.markers.push(t)}countIndent(t,n=0,r=0){for(let i=n;i<t;i++)r+=this.text.charCodeAt(i)==9?4-r%4:1;return r}findColumn(t){let n=0;for(let r=0;n<this.text.length&&r<t;n++)r+=this.text.charCodeAt(n)==9?4-r%4:1;return n}scrub(){if(!this.baseIndent)return this.text;let t="";for(let n=0;n<this.basePos;n++)t+=" ";return t+this.text.slice(this.basePos)}}function UTe(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==rt.OrderedList?bpe:vpe)(n,t,!1);return r>0&&(e.type!=rt.BulletList||ype(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}const lnt={[rt.Blockquote](e,t,n){return n.next!=62?!1:(n.markers.push(fr(rt.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(Tf(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[rt.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[rt.OrderedList]:UTe,[rt.BulletList]:UTe,[rt.Document](){return!0}};function Tf(e){return e==32||e==9||e==10||e==13}function a2(e,t=0){for(;t<e.length&&Tf(e.charCodeAt(t));)t++;return t}function HTe(e,t,n){for(;t>n&&Tf(e.charCodeAt(t-1));)t--;return t}function cnt(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function unt(e){return e.next!=62?-1:e.text.charCodeAt(e.pos+1)==32?2:1}function ype(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let i=e.pos+1;i<e.text.length;i++){let o=e.text.charCodeAt(i);if(o==e.next)r++;else if(!Tf(o))return-1}return n&&e.next==45&&hnt(e)>-1&&e.depth==t.stack.length||r<3?-1:1}function fnt(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function vpe(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||Tf(e.text.charCodeAt(e.pos+1)))&&(!n||fnt(t,rt.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function bpe(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){r++;if(r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!Tf(e.text.charCodeAt(r+1))||n&&!fnt(t,rt.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function dnt(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function hnt(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&Tf(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}const Dte=/^[ \t]*$/,pnt=/-->/,gnt=/\?>/,Mte=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,pnt],[/^\s*<\?/,gnt],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,Dte],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Dte]];function mnt(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let i=0,o=Mte.length-(n?1:0);i<o;i++)if(Mte[i][0].test(r))return i;return-1}function XTe(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function r1(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==rt.CodeText?e[r].to=n:e.push(fr(rt.CodeText,t,n))}const TI={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,o=e.lineStart+t.text.length,s=[],a=[];for(r1(s,i,o);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){r1(a,e.lineStart-1,e.lineStart);for(let l of t.markers)a.push(l)}else{if(t.indent<n)break;{if(a.length){for(let c of a)c.type==rt.CodeText?r1(s,c.from,c.to):s.push(c);a=[]}r1(s,e.lineStart-1,e.lineStart);for(let c of t.markers)s.push(c);o=e.lineStart+t.text.length;let l=e.lineStart+t.findColumn(t.baseIndent+4);l<o&&r1(s,l,o)}}return a.length&&(a=a.filter(l=>l.type!=rt.CodeText),a.length&&(t.markers=a.concat(t.markers))),e.addNode(e.buffer.writeElements(s,-i).finish(rt.CodeBlock,o-i),i),!0},FencedCode(e,t){let n=cnt(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,o=n-t.pos,s=t.skipSpace(n),a=HTe(t.text,t.text.length,s),l=[fr(rt.CodeMark,r,r+o)];s<a&&l.push(fr(rt.CodeInfo,e.lineStart+s,e.lineStart+a));for(let c=!0;e.nextLine()&&t.depth>=e.stack.length;c=!1){let u=t.pos;if(t.indent-t.baseIndent<4)for(;u<t.text.length&&t.text.charCodeAt(u)==i;)u++;if(u-t.pos>=o&&t.skipSpace(u)==t.text.length){for(let f of t.markers)l.push(f);l.push(fr(rt.CodeMark,e.lineStart+t.pos,e.lineStart+u)),e.nextLine();break}else{c||r1(l,e.lineStart-1,e.lineStart);for(let h of t.markers)l.push(h);let f=e.lineStart+t.basePos,d=e.lineStart+t.text.length;f<d&&r1(l,f,d)}}return e.addNode(e.buffer.writeElements(l,-r).finish(rt.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=unt(t);return n<0?!1:(e.startContext(rt.Blockquote,t.pos),e.addNode(rt.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(ype(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(rt.HorizontalRule,n),!0},BulletList(e,t){let n=vpe(t,e,!1);if(n<0)return!1;e.block.type!=rt.BulletList&&e.startContext(rt.BulletList,t.basePos,t.next);let r=XTe(t,t.pos+1);return e.startContext(rt.ListItem,t.basePos,r-t.baseIndent),e.addNode(rt.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=bpe(t,e,!1);if(n<0)return!1;e.block.type!=rt.OrderedList&&e.startContext(rt.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=XTe(t,t.pos+n);return e.startContext(rt.ListItem,t.basePos,r-t.baseIndent),e.addNode(rt.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=dnt(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,o=HTe(t.text,t.text.length,r),s=o;for(;s>r&&t.text.charCodeAt(s-1)==t.next;)s--;(s==o||s==r||!Tf(t.text.charCodeAt(s-1)))&&(s=t.text.length);let a=e.buffer.write(rt.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,s),i+n+1),-i);s<t.text.length&&a.write(rt.HeaderMark,s-r,o-r);let l=a.finish(rt.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(l,i),!0},HTMLBlock(e,t){let n=mnt(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=Mte[n][1],o=[],s=i!=Dte;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){s=!1;break}for(let c of t.markers)o.push(c)}s&&e.nextLine();let a=i==pnt?rt.CommentBlock:i==gnt?rt.ProcessingInstructionBlock:rt.HTMLBlock,l=e.prevLineEnd();return e.addNode(e.buffer.writeElements(o,-r).finish(a,l-r),r),!0},SetextHeading:void 0};class nNn{constructor(t){this.stage=0,this.elts=[],this.pos=0,this.start=t.start,this.advance(t.content)}nextLine(t,n,r){if(this.stage==-1)return!1;let i=r.content+`
`+n.scrub(),o=this.advance(i);return o>-1&&o<i.length?this.complete(t,r,o):!1}finish(t,n){return(this.stage==2||this.stage==3)&&a2(n.content,this.pos)==n.content.length?this.complete(t,n,n.content.length):!1}complete(t,n,r){return t.addLeafElement(n,fr(rt.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(t){return t?(this.pos=t.to-this.start,this.elts.push(t),this.stage++,!0):(t===!1&&(this.stage=-1),!1)}advance(t){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(Cnt(t,this.pos,this.start,!0)))return-1;if(t.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(fr(rt.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Snt(t,a2(t,this.pos),this.start)))return-1}else if(this.stage==2){let n=a2(t,this.pos),r=0;if(n>this.pos){let i=Ent(t,n,this.start);if(i){let o=yH(t,i.to-this.start);o>0&&(this.nextStage(i),r=o)}}return r||(r=yH(t,this.pos)),r>0&&r<t.length?r:-1}else return yH(t,this.pos)}}}function yH(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!Tf(n))return-1}return t}class rNn{nextLine(t,n,r){let i=n.depth<t.stack.length?-1:hnt(n),o=n.next;if(i<0)return!1;let s=fr(rt.HeaderMark,t.lineStart+n.pos,t.lineStart+i);return t.nextLine(),t.addLeafElement(r,fr(o==61?rt.SetextHeading1:rt.SetextHeading2,r.start,t.prevLineEnd(),[...t.parser.parseInline(r.content,r.start),s])),!0}finish(){return!1}}const iNn={LinkReference(e,t){return t.content.charCodeAt(0)==91?new nNn(t):null},SetextHeading(){return new rNn}},oNn=[(e,t)=>dnt(t)>=0,(e,t)=>cnt(t)>=0,(e,t)=>unt(t)>=0,(e,t)=>vpe(t,e,!0)>=0,(e,t)=>bpe(t,e,!0)>=0,(e,t)=>ype(t,e,!0)>=0,(e,t)=>mnt(t,e,!0)>=0],sNn={text:"",end:0};class aNn{constructor(t,n,r,i){this.parser=t,this.input=n,this.ranges=i,this.line=new tNn,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=s7.create(rt.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new fNn(r,n):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:t}=this;for(;;){for(;t.depth<this.stack.length;)this.finishContext();for(let r of t.markers)this.addNode(r.type,r.from,r.to);if(t.pos<t.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(t.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let i=r(this,t);if(i!=!1){if(i==!0)return null;t.forward();continue e}}break}let n=new eNn(this.lineStart+t.pos,t.text.slice(t.pos));for(let r of this.parser.leafBlockParsers)if(r){let i=r(this,n);i&&n.parsers.push(i)}e:for(;this.nextLine()&&t.pos!=t.text.length;){if(t.indent<t.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,t,n))break e}for(let r of n.parsers)if(r.nextLine(this,t,n))return null;n.content+=`
`+t.scrub();for(let r of t.markers)n.marks.push(r)}return this.finishLeaf(n),null}stopAt(t){if(this.stoppedAt!=null&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}reuseFragment(t){if(!this.fragments.moveTo(this.absoluteLineStart+t,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let n=this.fragments.takeNodes(this);return n?(this.absoluteLineStart+=n,this.lineStart=_nt(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(t=this.depth-1){return this.parser.nodeSet.types[this.stack[t].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(t){let n=sNn;if(n.end=t,t>=this.to)n.text="";else if(n.text=this.lineChunkAt(t),n.end+=n.text.length,this.ranges.length>1){let r=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<n.end;){i++;let o=this.ranges[i].from,s=this.lineChunkAt(o);n.end=o+s.length,n.text=n.text.slice(0,this.ranges[i-1].to-r)+s,r=n.end-n.text.length}}return n}readLine(){let{line:t}=this,{text:n,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,t.reset(n);t.depth<this.stack.length;t.depth++){let i=this.stack[t.depth],o=this.parser.skipContextMarkup[i.type];if(!o)throw new Error("Unhandled block context "+rt[i.type]);if(!o(i,this,t))break;t.forward()}}lineChunkAt(t){let n=this.input.chunk(t),r;if(this.input.lineChunks)r=n==`
`?"":n;else{let i=n.indexOf(`
`);r=i<0?n:n.slice(0,i)}return t+r.length>this.to?r.slice(0,this.to-t):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(t,n,r=0){this.block=s7.create(t,r,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(t,n,r=0){this.startContext(this.parser.getNodeType(t),n,r)}addNode(t,n,r){typeof t=="number"&&(t=new Bn(this.parser.nodeSet.types[t],SC,SC,(r??this.prevLineEnd())-n)),this.block.addChild(t,n-this.block.from)}addElement(t){this.block.addChild(t.toTree(this.parser.nodeSet),t.from-this.block.from)}addLeafElement(t,n){this.addNode(this.buffer.writeElements(Ite(n.children,t.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let t=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(t.toTree(this.parser.nodeSet),t.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(t){return this.ranges.length>1?ynt(this.ranges,0,t.topNode,this.ranges[0].from,this.reusePlaceholders):t}finishLeaf(t){for(let r of t.parsers)if(r.finish(this,t))return;let n=Ite(this.parser.parseInline(t.content,t.start),t.marks);this.addNode(this.buffer.writeElements(n,-t.start).finish(rt.Paragraph,t.content.length),t.start)}elt(t,n,r,i){return typeof t=="string"?fr(this.parser.getNodeType(t),n,r,i):new Ont(t,n)}get buffer(){return new bnt(this.parser.nodeSet)}}function ynt(e,t,n,r,i){let o=e[t].to,s=[],a=[],l=n.from+r;function c(u,f){for(;f?u>=o:u>o;){let d=e[t+1].from-o;r+=d,u+=d,t++,o=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){c(u.from+r,!0);let f=u.from+r,d,h=i.get(u.tree);h?d=h:u.to+r>o?(d=ynt(e,t,u,r,i),c(u.to+r,!1)):d=u.toTree(),s.push(d),a.push(f-l)}return c(n.to+r,!1),new Bn(n.type,s,a,n.to+r-l,n.tree?n.tree.propValues:void 0)}class uB extends Wz{constructor(t,n,r,i,o,s,a,l,c){super(),this.nodeSet=t,this.blockParsers=n,this.leafBlockParsers=r,this.blockNames=i,this.endLeafBlock=o,this.skipContextMarkup=s,this.inlineParsers=a,this.inlineNames=l,this.wrappers=c,this.nodeTypes=Object.create(null);for(let u of t.types)this.nodeTypes[u.name]=u.id}createParse(t,n,r){let i=new aNn(this,t,n,r);for(let o of this.wrappers)i=o(i,t,n,r);return i}configure(t){let n=Nte(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,o=this.blockParsers.slice(),s=this.leafBlockParsers.slice(),a=this.blockNames.slice(),l=this.inlineParsers.slice(),c=this.inlineNames.slice(),u=this.endLeafBlock.slice(),f=this.wrappers;if(e$(n.defineNodes)){i=Object.assign({},i);let d=r.types.slice(),h;for(let p of n.defineNodes){let{name:g,block:v,composite:y,style:O}=typeof p=="string"?{name:p}:p;if(d.some(S=>S.name==g))continue;y&&(i[d.length]=(S,E,C)=>y(E,C,S.value));let m=d.length,w=y?["Block","BlockContext"]:v?m>=rt.ATXHeading1&&m<=rt.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;d.push(To.define({id:m,name:g,props:w&&[[Zt.group,w]]})),O&&(h||(h={}),Array.isArray(O)||O instanceof Xf?h[g]=O:Object.assign(h,O))}r=new r_(d),h&&(r=r.extend(YO(h)))}if(e$(n.props)&&(r=r.extend(...n.props)),e$(n.remove))for(let d of n.remove){let h=this.blockNames.indexOf(d),p=this.inlineNames.indexOf(d);h>-1&&(o[h]=s[h]=void 0),p>-1&&(l[p]=void 0)}if(e$(n.parseBlock))for(let d of n.parseBlock){let h=a.indexOf(d.name);if(h>-1)o[h]=d.parse,s[h]=d.leaf;else{let p=d.before?PI(a,d.before):d.after?PI(a,d.after)+1:a.length-1;o.splice(p,0,d.parse),s.splice(p,0,d.leaf),a.splice(p,0,d.name)}d.endLeaf&&u.push(d.endLeaf)}if(e$(n.parseInline))for(let d of n.parseInline){let h=c.indexOf(d.name);if(h>-1)l[h]=d.parse;else{let p=d.before?PI(c,d.before):d.after?PI(c,d.after)+1:c.length-1;l.splice(p,0,d.parse),c.splice(p,0,d.name)}}return n.wrap&&(f=f.concat(n.wrap)),new uB(r,o,s,a,u,i,l,c,f)}getNodeType(t){let n=this.nodeTypes[t];if(n==null)throw new RangeError(`Unknown node type '${t}'`);return n}parseInline(t,n){let r=new cNn(this,t,n);e:for(let i=n;i<r.end;){let o=r.char(i);for(let s of this.inlineParsers)if(s){let a=s(r,o,i);if(a>=0){i=a;continue e}}i++}return r.resolveMarkers(0)}}function e$(e){return e!=null&&e.length>0}function Nte(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=Nte(e[0]);if(e.length==1)return t;let n=Nte(e.slice(1));if(!n||!t)return t||n;let r=(s,a)=>(s||SC).concat(a||SC),i=t.wrap,o=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?o?(s,a,l,c)=>i(o(s,a,l,c),a,l,c):i:o}}function PI(e,t){let n=e.indexOf(t);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${t}`);return n}let vnt=[To.none];for(let e=1,t;t=rt[e];e++)vnt[e]=To.define({id:e,name:t,props:e>=rt.Escape?[]:[[Zt.group,e in lnt?["Block","BlockContext"]:["Block","LeafBlock"]]],top:t=="Document"});const SC=[];let bnt=class{constructor(t){this.nodeSet=t,this.content=[],this.nodes=[]}write(t,n,r,i=0){return this.content.push(t,n,r,4+i*4),this}writeElements(t,n=0){for(let r of t)r.writeTo(this,n);return this}finish(t,n){return Bn.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:t,length:n})}},NA=class{constructor(t,n,r,i=SC){this.type=t,this.from=n,this.to=r,this.children=i}writeTo(t,n){let r=t.content.length;t.writeElements(this.children,n),t.content.push(this.type,this.from+n,this.to+n,t.content.length+4-r)}toTree(t){return new bnt(t).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class Ont{constructor(t,n){this.tree=t,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return SC}writeTo(t,n){t.nodes.push(this.tree),t.content.push(t.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function fr(e,t,n,r){return new NA(e,t,n,r)}const xnt={resolve:"Emphasis",mark:"EmphasisMark"},wnt={resolve:"Emphasis",mark:"EmphasisMark"},t$={},ZTe={};class Gf{constructor(t,n,r,i){this.type=t,this.from=n,this.to=r,this.side=i}}const YTe="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let IA=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{IA=new RegExp("[\\p{Pc}|\\p{Pd}|\\p{Pe}|\\p{Pf}|\\p{Pi}|\\p{Po}|\\p{Ps}]","u")}catch{}const vH={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let i=0;i<YTe.length;i++)if(YTe.charCodeAt(i)==r)return e.append(fr(rt.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(fr(rt.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,o=0;for(;r<e.end;r++)if(e.char(r)==96){if(o++,o==i&&e.char(r+1)!=96)return e.append(fr(rt.InlineCode,n,r+1,[fr(rt.CodeMark,n,n+i),fr(rt.CodeMark,r+1-i,r+1)]))}else o=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(fr(rt.URL,n,n+1+i[0].length));let o=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(o)return e.append(fr(rt.Comment,n,n+1+o[0].length));let s=/^\?[^]*?\?>/.exec(r);if(s)return e.append(fr(rt.ProcessingInstruction,n,n+1+s[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return a?e.append(fr(rt.HTMLTag,n,n+1+a[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),o=e.slice(r,r+1),s=IA.test(i),a=IA.test(o),l=/\s|^$/.test(i),c=/\s|^$/.test(o),u=!c&&(!a||l||s),f=!l&&(!s||c||a),d=u&&(t==42||!f||s),h=f&&(t==42||!u||a);return e.append(new Gf(t==95?xnt:wnt,n,r,(d?1:0)|(h?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(fr(rt.HardBreak,n,n+2));if(t==32){let r=n+1;for(;e.char(r)==32;)r++;if(e.char(r)==10&&r>=n+2)return e.append(fr(rt.HardBreak,n,r+1))}return-1},Link(e,t,n){return t==91?e.append(new Gf(t$,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new Gf(ZTe,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let r=e.parts.length-1;r>=0;r--){let i=e.parts[r];if(i instanceof Gf&&(i.type==t$||i.type==ZTe)){if(!i.side||e.skipSpace(i.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[r]=null,-1;let o=e.takeContent(r),s=e.parts[r]=lNn(e,o,i.type==t$?rt.Link:rt.Image,i.from,n+1);if(i.type==t$)for(let a=0;a<r;a++){let l=e.parts[a];l instanceof Gf&&l.type==t$&&(l.side=0)}return s.to}}return-1}};function lNn(e,t,n,r,i){let{text:o}=e,s=e.char(i),a=i;if(t.unshift(fr(rt.LinkMark,r,r+(n==rt.Image?2:1))),t.push(fr(rt.LinkMark,i-1,i)),s==40){let l=e.skipSpace(i+1),c=Snt(o,l-e.offset,e.offset),u;c&&(l=e.skipSpace(c.to),u=Ent(o,l-e.offset,e.offset),u&&(l=e.skipSpace(u.to))),e.char(l)==41&&(t.push(fr(rt.LinkMark,i,i+1)),a=l+1,c&&t.push(c),u&&t.push(u),t.push(fr(rt.LinkMark,l,a)))}else if(s==91){let l=Cnt(o,i-e.offset,e.offset,!1);l&&(t.push(l),a=l.to)}return fr(n,r,a,t)}function Snt(e,t,n){if(e.charCodeAt(t)==60){for(let i=t+1;i<e.length;i++){let o=e.charCodeAt(i);if(o==62)return fr(rt.URL,t+n,i+1+n);if(o==60||o==10)return!1}return null}else{let i=0,o=t;for(let s=!1;o<e.length;o++){let a=e.charCodeAt(o);if(Tf(a))break;if(s)s=!1;else if(a==40)i++;else if(a==41){if(!i)break;i--}else a==92&&(s=!0)}return o>t?fr(rt.URL,t+n,o+n):o==e.length?null:!1}}function Ent(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let o=t+1,s=!1;o<e.length;o++){let a=e.charCodeAt(o);if(s)s=!1;else{if(a==i)return fr(rt.LinkTitle,t+n,o+1+n);a==92&&(s=!0)}}return null}function Cnt(e,t,n,r){for(let i=!1,o=t+1,s=Math.min(e.length,o+999);o<s;o++){let a=e.charCodeAt(o);if(i)i=!1;else{if(a==93)return r?!1:fr(rt.LinkLabel,t+n,o+1+n);if(r&&!Tf(a)&&(r=!1),a==91)return!1;a==92&&(i=!0)}}return null}class cNn{constructor(t,n,r){this.parser=t,this.text=n,this.offset=r,this.parts=[]}char(t){return t>=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,n){return this.text.slice(t-this.offset,n-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,n,r,i,o){return this.append(new Gf(t,n,r,(i?1:0)|(o?2:0)))}addElement(t){return this.append(t)}resolveMarkers(t){for(let r=t;r<this.parts.length;r++){let i=this.parts[r];if(!(i instanceof Gf&&i.type.resolve&&i.side&2))continue;let o=i.type==xnt||i.type==wnt,s=i.to-i.from,a,l=r-1;for(;l>=t;l--){let g=this.parts[l];if(g instanceof Gf&&g.side&1&&g.type==i.type&&!(o&&(i.side&1||g.side&2)&&(g.to-g.from+s)%3==0&&((g.to-g.from)%3||s%3))){a=g;break}}if(!a)continue;let c=i.type.resolve,u=[],f=a.from,d=i.to;if(o){let g=Math.min(2,a.to-a.from,s);f=a.to-g,d=i.from+g,c=g==1?"Emphasis":"StrongEmphasis"}a.type.mark&&u.push(this.elt(a.type.mark,f,a.to));for(let g=l+1;g<r;g++)this.parts[g]instanceof NA&&u.push(this.parts[g]),this.parts[g]=null;i.type.mark&&u.push(this.elt(i.type.mark,i.from,d));let h=this.elt(c,f,d,u);this.parts[l]=o&&a.from!=f?new Gf(a.type,a.from,f,a.side):null,(this.parts[r]=o&&i.to!=d?new Gf(i.type,d,i.to,i.side):null)?this.parts.splice(r,0,h):this.parts[r]=h}let n=[];for(let r=t;r<this.parts.length;r++){let i=this.parts[r];i instanceof NA&&n.push(i)}return n}findOpeningDelimiter(t){for(let n=this.parts.length-1;n>=0;n--){let r=this.parts[n];if(r instanceof Gf&&r.type==t)return n}return null}takeContent(t){let n=this.resolveMarkers(t);return this.parts.length=t,n}skipSpace(t){return a2(this.text,t-this.offset)+this.offset}elt(t,n,r,i){return typeof t=="string"?fr(this.parser.getNodeType(t),n,r,i):new Ont(t,n)}}function Ite(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let i of t){for(;r<n.length&&n[r].to<i.to;)r++;if(r<n.length&&n[r].from<i.from){let o=n[r];o instanceof NA&&(n[r]=new NA(o.type,o.from,o.to,Ite(o.children,[i])))}else n.splice(r++,0,i)}return n}const uNn=[rt.CodeBlock,rt.ListItem,rt.OrderedList,rt.BulletList];class fNn{constructor(t,n){this.fragments=t,this.input=n,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,t.length&&(this.fragment=t[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(t,n){for(;this.fragment&&this.fragment.to<=t;)this.nextFragment();if(!this.fragment||this.fragment.from>(t?t-1:0))return!1;if(this.fragmentEnd<0){let o=this.fragment.to;for(;o>0&&this.input.read(o-1,o)!=`
`;)o--;this.fragmentEnd=o?o-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let i=t+this.fragment.offset;for(;r.to<=i;)if(!r.parent())return!1;for(;;){if(r.from>=i)return this.fragment.from<=n;if(!r.childAfter(i))return!1}}matches(t){let n=this.cursor.tree;return n&&n.prop(Zt.contextHash)==t}takeNodes(t){let n=this.cursor,r=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),o=t.absoluteLineStart,s=o,a=t.block.children.length,l=s,c=a;for(;;){if(n.to-r>i){if(n.type.isAnonymous&&n.firstChild())continue;break}let u=_nt(n.from-r,t.ranges);if(n.to-r<=t.ranges[t.rangeI].to)t.addNode(n.tree,u);else{let f=new Bn(t.parser.nodeSet.types[rt.Paragraph],[],[],0,t.block.hashProp);t.reusePlaceholders.set(f,n.tree),t.addNode(f,u)}if(n.type.is("Block")&&(uNn.indexOf(n.type.id)<0?(s=n.to-r,a=t.block.children.length):(s=l,a=c,l=n.to-r,c=t.block.children.length)),!n.nextSibling())break}for(;t.block.children.length>a;)t.block.children.pop(),t.block.positions.pop();return s-o}}function _nt(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,o=t[r].from;i<e&&(n-=o-i)}return n}const dNn=YO({"Blockquote/...":K.quote,HorizontalRule:K.contentSeparator,"ATXHeading1/... SetextHeading1/...":K.heading1,"ATXHeading2/... SetextHeading2/...":K.heading2,"ATXHeading3/...":K.heading3,"ATXHeading4/...":K.heading4,"ATXHeading5/...":K.heading5,"ATXHeading6/...":K.heading6,"Comment CommentBlock":K.comment,Escape:K.escape,Entity:K.character,"Emphasis/...":K.emphasis,"StrongEmphasis/...":K.strong,"Link/... Image/...":K.link,"OrderedList/... BulletList/...":K.list,"BlockQuote/...":K.quote,"InlineCode CodeText":K.monospace,URL:K.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":K.processingInstruction,"CodeInfo LinkLabel":K.labelName,LinkTitle:K.string,Paragraph:K.content}),hNn=new uB(new r_(vnt).extend(dNn),Object.keys(TI).map(e=>TI[e]),Object.keys(TI).map(e=>iNn[e]),Object.keys(TI),oNn,lnt,Object.keys(vH).map(e=>vH[e]),Object.keys(vH),[]);function pNn(e,t,n){let r=[];for(let i=e.firstChild,o=t;;i=i.nextSibling){let s=i?i.from:n;if(s>o&&r.push({from:o,to:s}),!i)break;o=i.to}return r}function gNn(e){let{codeParser:t,htmlParser:n}=e;return{wrap:Ise((i,o)=>{let s=i.type.id;if(t&&(s==rt.CodeBlock||s==rt.FencedCode)){let a="";if(s==rt.FencedCode){let c=i.node.getChild(rt.CodeInfo);c&&(a=o.read(c.from,c.to))}let l=t(a);if(l)return{parser:l,overlay:c=>c.type.id==rt.CodeText}}else if(n&&(s==rt.HTMLBlock||s==rt.HTMLTag))return{parser:n,overlay:pNn(i.node,i.from,i.to)};return null})}}const mNn={resolve:"Strikethrough",mark:"StrikethroughMark"},yNn={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":K.strikethrough}},{name:"StrikethroughMark",style:K.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),o=/\s|^$/.test(r),s=/\s|^$/.test(i),a=IA.test(r),l=IA.test(i);return e.addDelimiter(mNn,n,n+2,!s&&(!l||o||a),!o&&(!a||s||l))},after:"Emphasis"}]};function l2(e,t,n=0,r,i=0){let o=0,s=!0,a=-1,l=-1,c=!1,u=()=>{r.push(e.elt("TableCell",i+a,i+l,e.parser.parseInline(t.slice(a,l),i+a)))};for(let f=n;f<t.length;f++){let d=t.charCodeAt(f);d==124&&!c?((!s||a>-1)&&o++,s=!1,r&&(a>-1&&u(),r.push(e.elt("TableDelimiter",f+i,f+i+1))),a=l=-1):(c||d!=32&&d!=9)&&(a<0&&(a=f),l=f+1),c=!c&&d==92}return a>-1&&(o++,r&&u()),o}function GTe(e,t){for(let n=t;n<e.length;n++){let r=e.charCodeAt(n);if(r==124)return!0;r==92&&n++}return!1}const knt=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class KTe{constructor(){this.rows=null}nextLine(t,n,r){if(this.rows==null){this.rows=!1;let i;if((n.next==45||n.next==58||n.next==124)&&knt.test(i=n.text.slice(n.pos))){let o=[];l2(t,r.content,0,o,r.start)==l2(t,i,n.pos)&&(this.rows=[t.elt("TableHeader",r.start,r.start+r.content.length,o),t.elt("TableDelimiter",t.lineStart+n.pos,t.lineStart+n.text.length)])}}else if(this.rows){let i=[];l2(t,n.text,n.pos,i,t.lineStart),this.rows.push(t.elt("TableRow",t.lineStart+n.pos,t.lineStart+n.text.length,i))}return!1}finish(t,n){return this.rows?(t.addLeafElement(n,t.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const vNn={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":K.heading}},"TableRow",{name:"TableCell",style:K.content},{name:"TableDelimiter",style:K.processingInstruction}],parseBlock:[{name:"Table",leaf(e,t){return GTe(t.content,0)?new KTe:null},endLeaf(e,t,n){if(n.parsers.some(i=>i instanceof KTe)||!GTe(t.text,t.basePos))return!1;let r=e.scanLine(e.absoluteLineEnd+1).text;return knt.test(r)&&l2(e,t.text,t.basePos)==l2(e,r,t.basePos)},before:"SetextHeading"}]};class bNn{nextLine(){return!1}finish(t,n){return t.addLeafElement(n,t.elt("Task",n.start,n.start+n.content.length,[t.elt("TaskMarker",n.start,n.start+3),...t.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const ONn={defineNodes:[{name:"Task",block:!0,style:K.list},{name:"TaskMarker",style:K.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new bNn:null},after:"SetextHeading"}]},JTe=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy,e2e=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,xNn=/[\w-]+\.[\w-]+($|\/)/,t2e=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,n2e=/\/[a-zA-Z\d@.]+/gy;function r2e(e,t,n,r){let i=0;for(let o=t;o<n;o++)e[o]==r&&i++;return i}function wNn(e,t){e2e.lastIndex=t;let n=e2e.exec(e);if(!n||xNn.exec(n[0])[0].indexOf("_")>-1)return-1;let r=t+n[0].length;for(;;){let i=e[r-1],o;if(/[?!.,:*_~]/.test(i)||i==")"&&r2e(e,t,r,")")>r2e(e,t,r,"("))r--;else if(i==";"&&(o=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+o.index;else break}return r}function i2e(e,t){t2e.lastIndex=t;let n=t2e.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r=="_"||r=="-"?-1:t+n[0].length-(r=="."?1:0)}const SNn={parseInline:[{name:"Autolink",parse(e,t,n){let r=n-e.offset;JTe.lastIndex=r;let i=JTe.exec(e.text),o=-1;return!i||(i[1]||i[2]?o=wNn(e.text,r+i[0].length):i[3]?o=i2e(e.text,r):(o=i2e(e.text,r+i[0].length),o>-1&&i[0]=="xmpp:"&&(n2e.lastIndex=o,i=n2e.exec(e.text),i&&(o=i.index+i[0].length))),o<0)?-1:(e.addElement(e.elt("URL",n,o+e.offset)),o+e.offset)}}]},ENn=[vNn,ONn,yNn,SNn];function $nt(e,t,n){return(r,i,o)=>{if(i!=e||r.char(o+1)==e)return-1;let s=[r.elt(n,o,o+1)];for(let a=o+1;a<r.end;a++){let l=r.char(a);if(l==e)return r.addElement(r.elt(t,o,a+1,s.concat(r.elt(n,a,a+1))));if(l==92&&s.push(r.elt("Escape",a,a+++2)),Tf(l))break}return-1}}const CNn={defineNodes:[{name:"Superscript",style:K.special(K.content)},{name:"SuperscriptMark",style:K.processingInstruction}],parseInline:[{name:"Superscript",parse:$nt(94,"Superscript","SuperscriptMark")}]},_Nn={defineNodes:[{name:"Subscript",style:K.special(K.content)},{name:"SubscriptMark",style:K.processingInstruction}],parseInline:[{name:"Subscript",parse:$nt(126,"Subscript","SubscriptMark")}]},kNn={defineNodes:[{name:"Emoji",style:K.character}],parseInline:[{name:"Emoji",parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt("Emoji",n,n+1+r[0].length))}}]},$Nn=54,TNn=1,PNn=55,ANn=2,RNn=56,DNn=3,o2e=4,MNn=5,a7=6,Tnt=7,Pnt=8,Ant=9,Rnt=10,NNn=11,INn=12,LNn=13,bH=57,jNn=14,s2e=58,Dnt=20,FNn=22,Mnt=23,zNn=24,Lte=26,Nnt=27,QNn=28,BNn=31,WNn=34,qNn=36,VNn=37,UNn=0,HNn=1,XNn={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},ZNn={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},a2e={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function YNn(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function Int(e){return e==9||e==10||e==13||e==32}let l2e=null,c2e=null,u2e=0;function jte(e,t){let n=e.pos+t;if(u2e==n&&c2e==e)return l2e;let r=e.peek(t);for(;Int(r);)r=e.peek(++t);let i="";for(;YNn(r);)i+=String.fromCharCode(r),r=e.peek(++t);return c2e=e,u2e=n,l2e=i?i.toLowerCase():r==GNn||r==KNn?void 0:null}const Lnt=60,l7=62,Ope=47,GNn=63,KNn=33,JNn=45;function f2e(e,t){this.name=e,this.parent=t,this.hash=t?t.hash:0;for(let n=0;n<e.length;n++)this.hash+=(this.hash<<4)+e.charCodeAt(n)+(e.charCodeAt(n)<<8)}const eIn=[a7,Rnt,Tnt,Pnt,Ant],tIn=new Mle({start:null,shift(e,t,n,r){return eIn.indexOf(t)>-1?new f2e(jte(r,1)||"",e):e},reduce(e,t){return t==Dnt&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==a7||i==qNn?new f2e(jte(r,1)||"",e):e},hash(e){return e?e.hash:0},strict:!1}),nIn=new $l((e,t)=>{if(e.next!=Lnt){e.next<0&&t.context&&e.acceptToken(bH);return}e.advance();let n=e.next==Ope;n&&e.advance();let r=jte(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?jNn:a7);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(NNn);if(i&&ZNn[i])return e.acceptToken(bH,-2);if(t.dialectEnabled(UNn))return e.acceptToken(INn);for(let o=t.context;o;o=o.parent)if(o.name==r)return;e.acceptToken(LNn)}else{if(r=="script")return e.acceptToken(Tnt);if(r=="style")return e.acceptToken(Pnt);if(r=="textarea")return e.acceptToken(Ant);if(XNn.hasOwnProperty(r))return e.acceptToken(Rnt);i&&a2e[i]&&a2e[i][r]?e.acceptToken(bH,-1):e.acceptToken(a7)}},{contextual:!0}),rIn=new $l(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(s2e);break}if(e.next==JNn)t++;else if(e.next==l7&&t>=2){n>=3&&e.acceptToken(s2e,-2);break}else t=0;e.advance()}});function iIn(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const oIn=new $l((e,t)=>{if(e.next==Ope&&e.peek(1)==l7){let n=t.dialectEnabled(HNn)||iIn(t.context);e.acceptToken(n?MNn:o2e,2)}else e.next==l7&&e.acceptToken(o2e,1)});function xpe(e,t,n){let r=2+e.length;return new $l(i=>{for(let o=0,s=0,a=0;;a++){if(i.next<0){a&&i.acceptToken(t);break}if(o==0&&i.next==Lnt||o==1&&i.next==Ope||o>=2&&o<r&&i.next==e.charCodeAt(o-2))o++,s++;else if((o==2||o==r)&&Int(i.next))s++;else if(o==r&&i.next==l7){a>s?i.acceptToken(t,-s):i.acceptToken(n,-(s-2));break}else if((i.next==10||i.next==13)&&a){i.acceptToken(t,1);break}else o=s=0;i.advance()}})}const sIn=xpe("script",$Nn,TNn),aIn=xpe("style",PNn,ANn),lIn=xpe("textarea",RNn,DNn),cIn=YO({"Text RawText":K.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":K.angleBracket,TagName:K.tagName,"MismatchedCloseTag/TagName":[K.tagName,K.invalid],AttributeName:K.attributeName,"AttributeValue UnquotedAttributeValue":K.attributeValue,Is:K.definitionOperator,"EntityReference CharacterReference":K.character,Comment:K.blockComment,ProcessingInst:K.processingInstruction,DoctypeDecl:K.documentMeta}),uIn=lO.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:"+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:tIn,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[cIn],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|c`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bX`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UV`P!cpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pT`POv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!cpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({W`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!a`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!a`!cpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYkWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]``P!a`!cp!^^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebhSkWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXhSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vchS`P!a`!cpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!`h`P!cpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WihSkWc!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QchSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXiS`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[sIn,aIn,lIn,oIn,nIn,rIn,0,1,2,3,4,5],topRules:{Document:[0,15]},dialects:{noMatch:0,selfClosing:485},tokenPrec:487});function jnt(e,t){let n=Object.create(null);for(let r of e.getChildren(Mnt)){let i=r.getChild(zNn),o=r.getChild(Lte)||r.getChild(Nnt);i&&(n[t.read(i.from,i.to)]=o?o.type.id==Lte?t.read(o.from+1,o.to-1):t.read(o.from,o.to):"")}return n}function d2e(e,t){let n=e.getChild(FNn);return n?t.read(n.from,n.to):" "}function OH(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||(r=jnt(e.node.parent.firstChild,t))))return{parser:i.parser};return null}function Fnt(e=[],t=[]){let n=[],r=[],i=[],o=[];for(let a of e)(a.tag=="script"?n:a.tag=="style"?r:a.tag=="textarea"?i:o).push(a);let s=t.length?Object.create(null):null;for(let a of t)(s[a.name]||(s[a.name]=[])).push(a);return Ise((a,l)=>{let c=a.type.id;if(c==QNn)return OH(a,l,n);if(c==BNn)return OH(a,l,r);if(c==WNn)return OH(a,l,i);if(c==Dnt&&o.length){let u=a.node,f=u.firstChild,d=f&&d2e(f,l),h;if(d){for(let p of o)if(p.tag==d&&(!p.attrs||p.attrs(h||(h=jnt(u,l))))){let g=u.lastChild,v=g.type.id==VNn?g.from:u.to;if(v>f.to)return{parser:p.parser,overlay:[{from:f.to,to:v}]}}}}if(s&&c==Mnt){let u=a.node,f;if(f=u.firstChild){let d=s[l.read(f.from,f.to)];if(d)for(let h of d){if(h.tagName&&h.tagName!=d2e(u.parent,l))continue;let p=u.lastChild;if(p.type.id==Lte){let g=p.from+1,v=p.lastChild,y=p.to-(v&&v.isError?0:1);if(y>g)return{parser:h.parser,overlay:[{from:g,to:y}]}}else if(p.type.id==Nnt)return{parser:h.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}const fIn=96,h2e=1,dIn=97,hIn=98,p2e=2,znt=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],pIn=58,gIn=40,Qnt=95,mIn=91,kL=45,yIn=46,vIn=35,bIn=37,OIn=38,xIn=92,wIn=10;function c7(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function SIn(e){return e>=48&&e<=57}const EIn=new $l((e,t)=>{for(let n=!1,r=0,i=0;;i++){let{next:o}=e;if(c7(o)||o==kL||o==Qnt||n&&SIn(o))!n&&(o!=kL||i>0)&&(n=!0),r===i&&o==kL&&r++,e.advance();else if(o==xIn&&e.peek(1)!=wIn)e.advance(),e.next>-1&&e.advance(),n=!0;else{n&&e.acceptToken(o==gIn?dIn:r==2&&t.canShift(p2e)?p2e:hIn);break}}}),CIn=new $l(e=>{if(znt.includes(e.peek(-1))){let{next:t}=e;(c7(t)||t==Qnt||t==vIn||t==yIn||t==mIn||t==pIn||t==kL||t==OIn)&&e.acceptToken(fIn)}}),_In=new $l(e=>{if(!znt.includes(e.peek(-1))){let{next:t}=e;if(t==bIn&&(e.advance(),e.acceptToken(h2e)),c7(t)){do e.advance();while(c7(e.next));e.acceptToken(h2e)}}}),kIn=YO({"AtKeyword import charset namespace keyframes media supports":K.definitionKeyword,"from to selector":K.keyword,NamespaceName:K.namespace,KeyframeName:K.labelName,KeyframeRangeName:K.operatorKeyword,TagName:K.tagName,ClassName:K.className,PseudoClassName:K.constant(K.className),IdName:K.labelName,"FeatureName PropertyName":K.propertyName,AttributeName:K.attributeName,NumberLiteral:K.number,KeywordQuery:K.keyword,UnaryQueryOp:K.operatorKeyword,"CallTag ValueName":K.atom,VariableName:K.variableName,Callee:K.operatorKeyword,Unit:K.unit,"UniversalSelector NestingSelector":K.definitionOperator,MatchOp:K.compareOperator,"ChildOp SiblingOp, LogicOp":K.logicOperator,BinOp:K.arithmeticOperator,Important:K.modifier,Comment:K.blockComment,ColorLiteral:K.color,"ParenthesizedContent StringLiteral":K.string,":":K.punctuation,"PseudoOp #":K.derefOperator,"; ,":K.separator,"( )":K.paren,"[ ]":K.squareBracket,"{ }":K.brace}),$In={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},TIn={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},PIn={__proto__:null,not:128,only:128},AIn=lO.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO<<HaO8rQWO,5;ZOOQP1G/U1G/UOOQS-E8T-E8TO${QdO'#EWO8zQWO,5;WOOQT1G.u1G.uOOQP<<Ha<<HaOOQS7+$k7+$kO9SQdO7+%ZOOQO7+%b7+%bOOQO,5:i,5:iO3QQdO'#E^O6tQWO,5:wOOQS,5:w,5:wOOQS-E8Z-E8ZOOQS1G0S1G0SO9ZQtO,5:tOOQS-E8W-E8WOOQO<<Hm<<HmOOQPAN={AN={O:XQdO,5:rOOQO-E8U-E8UOOQO<<Hu<<HuOOQO,5:x,5:xOOQO-E8[-E8[OOQS1G0c1G0c",stateData:":k~O#WOS#XQQ~OUYOXYO]VO^VOtWOxXO!YaO!ZZO!g[O!i]O!k^O!n_O!t`O#URO#_TO~OQfOUYOXYO]VO^VOtWOxXO!YaO!ZZO!g[O!i]O!k^O!n_O!t`O#UeO#_TO~O#R#dP~P!ZO#XjO~O#UlO~O]qO^qOpoOtrOxsO|tO!PvO#SuO#_nO~O!RwO~P#pO`}O#TzO#UyO~O#U!OO~O#U!QO~OQ!ZOb!TOf!ZOh!ZOn!YO#T!WO#U!SO#b!UO~Ob!]O!b!_O!e!`O#U![O!R#eP~Oh!eOn!YO#U!dO~Oh!gO#U!gO~Ob!]O!b!_O!e!`O#U![O~O!W#eP~P%gO]WX]!UX^WXpWXtWXxWX|WX!PWX!RWX#SWX#_WX~O]!lO~O!W!mO#R#dX!Q#dX~O#R#dX!Q#dX~P!ZO#Y!pO#Z!pO#[!rO~OUYOXYO]VO^VOtWOxXO#URO#_TO~OpoO!RwO~O`!yO#TzO#UyO~O!Q#dP~P!ZOb#QO~Ob#RO~Ov#SOz#TO~OP#VObgXjgX!WgX!bgX!egX#UgXagXQgXfgXhgXngXpgX!VgX#RgX#TgX#bgXvgX!QgX~Ob!]Oj#WO!b!_O!e!`O#U![O!W#eP~Ob#ZO~Ob!]O!b!_O!e!`O#U#[O~Op#`O!`#_O!R#eX!W#eX~Ob#cO~Oj#WO!W#eO~O!W#fO~Oh#gOn!YO~O!R#hO~O!RwO!`#_O~O!RwO!W#kO~O!W!}X#R!}X!Q!}X~P!ZO!W!mO#R#da!Q#da~O#Y!pO#Z!pO#[#rO~O]qO^qOtrOxsO|tO!PvO#SuO#_nO~Op!{a!R!{aa!{a~P.QOv#tOz#uO~O]qO^qOtrOxsO#_nO~Op{i|{i!P{i!R{i#S{ia{i~P/ROp}i|}i!P}i!R}i#S}ia}i~P/ROp!Oi|!Oi!P!Oi!R!Oi#S!Oia!Oi~P/RO!Q#vO~Oa#cP~P(^Oa#`P~P${Oa#}Oj#WO~O!W$PO~Oh$QOo$QO~O]!^Xa![X!`![X~O]$RO~Oa$SO!`#_O~Op#`O!R#ea!W#ea~O!`#_Op!aa!R!aa!W!aaa!aa~O!W$XO~O!Q$`O#U$ZO#b$YO~Oj#WOp$bO!V$dO!W!Ti#R!Ti!Q!Ti~P${O!W!}a#R!}a!Q!}a~P!ZO!W!mO#R#di!Q#di~Oa#cX~P#pOa$hO~Oj#WOQ!yXa!yXb!yXf!yXh!yXn!yXp!yX#T!yX#U!yX#b!yX~Op$jOa#`X~P${Oa$lO~Oj#WOv$mO~Oa$nO~O!`#_Op#Oa!R#Oa!W#Oa~Oa$pO~P.QOP#VOpgX!RgX~O#b$YOp!qX!R!qX~Op$rO!RwO~O!Q$vO#U$ZO#b$YO~Oj#WOQ!|Xb!|Xf!|Xh!|Xn!|Xp!|X!V!|X!W!|X#R!|X#T!|X#U!|X#b!|X!Q!|X~Op$bO!V$yO!W!Tq#R!Tq!Q!Tq~P${Oj#WOv$zO~OpoOa#ca~Op$jOa#`a~Oa$}O~P${Oj#WOQ!|ab!|af!|ah!|an!|ap!|a!V!|a!W!|a#R!|a#T!|a#U!|a#b!|a!Q!|a~Oa!zap!za~P${O#Wo#X#bj!P#b~",goto:"-Y#gPPP#hP#kP#t$TP#t$d#tPP$jPPP$p$y$yP%]P$yP$y%w&ZPPP&s&y#tP'PP#tP'VP#tP#t#tPPP']'r(PPP#kPP(W(W(b(WP(WP(W(WP#kP#kP#kP(e#kP(h(k(n(u#kP#kP(z)Q)a)o)u*P*V*a*g*mPPPPPPPPPP*s*|P+i+lP,b,e,k,tRkQ_bOPdhw!m#nkYOPdhotuvw!m#Q#c#nkSOPdhotuvw!m#Q#c#nQmTR!snQ{VR!wqQ!w}Q#Y!XR#s!yq!ZZ]!T!l#R#T#W#l#u#z$R$b$c$j$o${p!ZZ]!T!l#R#T#W#l#u#z$R$b$c$j$o${U$]#h$_$rR$q$[q!XZ]!T!l#R#T#W#l#u#z$R$b$c$j$o${p!ZZ]!T!l#R#T#W#l#u#z$R$b$c$j$o${Q!e^R#g!fQ|VR!xqQ!w|R#s!xQ!PWR!zrQ!RXR!{sQxUQ!vpQ#d!bQ#j!iQ#k!jQ$t$^R%Q$sSgPwQ!ohQ#m!mR$e#nZfPhw!m#na!a[`a!V!]!_#_#`R#]!]R!f^R!h_R#i!hS$^#h$_R%O$rV$[#h$_$rQ!qjR#q!qQdOShPwU!kdh#nR#n!mQ#z#RU$i#z$o${Q$o$RR${$jQ$k#zR$|$kQpUS!up$gR$g#wQ$c#lR$x$cQ!ngS#o!n#pR#p!oQ#a!^R$V#aQ$_#hR$u$_Q$s$^R%P$s_cOPdhw!m#n^UOPdhw!m#nQ!toQ!|tQ!}uQ#OvQ#w#QR$W#cR#{#RQ!VZQ!c]Q#U!TQ#l!l[#y#R#z$R$j$o${Q#|#TQ$O#WS$a#l$cQ$f#uR$w$bR#x#QQiPR#PwQ!b[Q!jaR#X!VU!^[a!VQ!i`Q#^!]Q#b!_Q$T#_R$U#`",nodeNames:"⚠ Unit VariableName Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent , PseudoClassName ArgList IdSelector # IdName ] AttributeSelector [ AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles",maxTerm:114,nodeProps:[["openedBy",17,"(",48,"{"],["closedBy",18,")",49,"}"]],propSources:[kIn],skippedNodes:[0,3,85],repeatNodeCount:10,tokenData:"J^~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Ab![!]B]!]!^CX!^!_$}!_!`Cj!`!aC{!a!b$}!b!cDw!c!}$}!}#OFa#O#P$}#P#QFr#Q#R6d#R#T$}#T#UGT#U#c$}#c#dHf#d#o$}#o#pH{#p#q6d#q#rI^#r#sIo#s#y$}#y#z%u#z$f$}$f$g%u$g#BY$}#BY#BZ%u#BZ$IS$}$IS$I_%u$I_$I|$}$I|$JO%u$JO$JT$}$JT$JU%u$JU$KV$}$KV$KW%u$KW&FU$}&FU&FV%u&FV;'S$};'S;=`JW<%lO$}`%QSOy%^z;'S%^;'S;=`%o<%lO%^`%cSo`Oy%^z;'S%^;'S;=`%o<%lO%^`%rP;=`<%l%^~%zh#W~OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^~'mh#W~o`OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^l)[UOy%^z#]%^#]#^)n#^;'S%^;'S;=`%o<%lO%^l)sUo`Oy%^z#a%^#a#b*V#b;'S%^;'S;=`%o<%lO%^l*[Uo`Oy%^z#d%^#d#e*n#e;'S%^;'S;=`%o<%lO%^l*sUo`Oy%^z#c%^#c#d+V#d;'S%^;'S;=`%o<%lO%^l+[Uo`Oy%^z#f%^#f#g+n#g;'S%^;'S;=`%o<%lO%^l+sUo`Oy%^z#h%^#h#i,V#i;'S%^;'S;=`%o<%lO%^l,[Uo`Oy%^z#T%^#T#U,n#U;'S%^;'S;=`%o<%lO%^l,sUo`Oy%^z#b%^#b#c-V#c;'S%^;'S;=`%o<%lO%^l-[Uo`Oy%^z#h%^#h#i-n#i;'S%^;'S;=`%o<%lO%^l-uS!V[o`Oy%^z;'S%^;'S;=`%o<%lO%^~.UWOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o<%lO.R~.sOh~~.vRO;'S.R;'S;=`/P;=`O.R~/SXOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o;=`<%l.R<%lO.R~/rP;=`<%l.Rn/zYtQOy%^z!Q%^!Q![0j![!c%^!c!i0j!i#T%^#T#Z0j#Z;'S%^;'S;=`%o<%lO%^l0oYo`Oy%^z!Q%^!Q![1_![!c%^!c!i1_!i#T%^#T#Z1_#Z;'S%^;'S;=`%o<%lO%^l1dYo`Oy%^z!Q%^!Q![2S![!c%^!c!i2S!i#T%^#T#Z2S#Z;'S%^;'S;=`%o<%lO%^l2ZYf[o`Oy%^z!Q%^!Q![2y![!c%^!c!i2y!i#T%^#T#Z2y#Z;'S%^;'S;=`%o<%lO%^l3QYf[o`Oy%^z!Q%^!Q![3p![!c%^!c!i3p!i#T%^#T#Z3p#Z;'S%^;'S;=`%o<%lO%^l3uYo`Oy%^z!Q%^!Q![4e![!c%^!c!i4e!i#T%^#T#Z4e#Z;'S%^;'S;=`%o<%lO%^l4lYf[o`Oy%^z!Q%^!Q![5[![!c%^!c!i5[!i#T%^#T#Z5[#Z;'S%^;'S;=`%o<%lO%^l5aYo`Oy%^z!Q%^!Q![6P![!c%^!c!i6P!i#T%^#T#Z6P#Z;'S%^;'S;=`%o<%lO%^l6WSf[o`Oy%^z;'S%^;'S;=`%o<%lO%^d6gUOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^d7QSzSo`Oy%^z;'S%^;'S;=`%o<%lO%^b7cSXQOy%^z;'S%^;'S;=`%o<%lO%^~7rWOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W<%lO7o~8_RO;'S7o;'S;=`8h;=`O7o~8kXOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W;=`<%l7o<%lO7o~9ZP;=`<%l7on9cSb^Oy%^z;'S%^;'S;=`%o<%lO%^~9tOa~n9{UUQjWOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^n:fWjW!PQOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l<cYo`Oy%^z{%^{|=R|}%^}!O=R!O!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l=WUo`Oy%^z!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l=qUo`#b[Oy%^z!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l>[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[CIn,_In,EIn,1,2,3,4,new nF("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:e=>$In[e]||-1},{term:56,get:e=>TIn[e]||-1},{term:98,get:e=>PIn[e]||-1}],tokenPrec:1169});let xH=null;function wH(){if(!xH&&typeof document=="object"&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!="cssText"&&r!="cssFloat"&&typeof e[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));xH=t.sort().map(r=>({type:"property",label:r}))}return xH||[]}const g2e=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(e=>({type:"class",label:e})),m2e=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(e=>({type:"keyword",label:e})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(e=>({type:"constant",label:e}))),RIn=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(e=>({type:"type",label:e})),Fm=/^(\w[\w-]*|-\w[\w-]*|)$/,DIn=/^-(-[\w-]*)?$/;function MIn(e,t){var n;if((e.name=="("||e.type.isError)&&(e=e.parent||e),e.name!="ArgList")return!1;let r=(n=e.parent)===null||n===void 0?void 0:n.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:t.sliceString(r.from,r.to)=="var"}const y2e=new Nse,NIn=["Declaration"];function IIn(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function Bnt(e,t,n){if(t.to-t.from>4096){let r=y2e.get(t);if(r)return r;let i=[],o=new Set,s=t.cursor(Wr.IncludeAnonymous);if(s.firstChild())do for(let a of Bnt(e,s.node,n))o.has(a.label)||(o.add(a.label),i.push(a));while(s.nextSibling());return y2e.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(o=>{var s;if(n(o)&&o.matchContext(NIn)&&((s=o.node.nextSibling)===null||s===void 0?void 0:s.name)==":"){let a=e.sliceString(o.from,o.to);i.has(a)||(i.add(a),r.push({label:a,type:"variable"}))}}),r}}const Wnt=e=>t=>{let{state:n,pos:r}=t,i=kr(n).resolveInner(r,-1),o=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(o||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:wH(),validFor:Fm};if(i.name=="ValueName")return{from:i.from,options:m2e,validFor:Fm};if(i.name=="PseudoClassName")return{from:i.from,options:g2e,validFor:Fm};if(e(i)||(t.explicit||o)&&MIn(i,n.doc))return{from:e(i)||o?i.from:r,options:Bnt(n.doc,IIn(i),e),validFor:DIn};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:wH(),validFor:Fm};return{from:i.from,options:RIn,validFor:Fm}}if(!t.explicit)return null;let s=i.resolve(r),a=s.childBefore(r);return a&&a.name==":"&&s.name=="PseudoClassSelector"?{from:r,options:g2e,validFor:Fm}:a&&a.name==":"&&s.name=="Declaration"||s.name=="ArgList"?{from:r,options:m2e,validFor:Fm}:s.name=="Block"||s.name=="Styles"?{from:r,options:wH(),validFor:Fm}:null},qnt=Wnt(e=>e.name=="VariableName"),LA=Gb.define({name:"css",parser:AIn.configure({props:[i_.add({Declaration:U5()}),Sv.add({"Block KeyframeList":TP})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Vnt(){return new j0(LA,LA.data.of({autocomplete:qnt}))}const LIn=Object.freeze(Object.defineProperty({__proto__:null,css:Vnt,cssCompletionSource:qnt,cssLanguage:LA,defineCSSCompletionSource:Wnt},Symbol.toStringTag,{value:"Module"})),jIn=309,v2e=1,FIn=2,zIn=3,QIn=310,BIn=312,WIn=313,qIn=4,VIn=5,UIn=0,Fte=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Unt=125,HIn=59,zte=47,XIn=42,ZIn=43,YIn=45,GIn=60,KIn=44,JIn=new Mle({start:!1,shift(e,t){return t==qIn||t==VIn||t==BIn?e:t==WIn},strict:!1}),e5n=new $l((e,t)=>{let{next:n}=e;(n==Unt||n==-1||t.context)&&e.acceptToken(QIn)},{contextual:!0,fallback:!0}),t5n=new $l((e,t)=>{let{next:n}=e,r;Fte.indexOf(n)>-1||n==zte&&((r=e.peek(1))==zte||r==XIn)||n!=Unt&&n!=HIn&&n!=-1&&!t.context&&e.acceptToken(jIn)},{contextual:!0}),n5n=new $l((e,t)=>{let{next:n}=e;if((n==ZIn||n==YIn)&&(e.advance(),n==e.next)){e.advance();let r=!t.context&&t.canShift(v2e);e.acceptToken(r?v2e:FIn)}},{contextual:!0});function SH(e,t){return e>=65&&e<=90||e>=97&&e<=122||e==95||e>=192||!t&&e>=48&&e<=57}const r5n=new $l((e,t)=>{if(e.next!=GIn||!t.dialectEnabled(UIn)||(e.advance(),e.next==zte))return;let n=0;for(;Fte.indexOf(e.next)>-1;)e.advance(),n++;if(SH(e.next,!0)){for(e.advance(),n++;SH(e.next,!1);)e.advance(),n++;for(;Fte.indexOf(e.next)>-1;)e.advance(),n++;if(e.next==KIn)return;for(let r=0;;r++){if(r==7){if(!SH(e.next,!0))return;break}if(e.next!="extends".charCodeAt(r))break;e.advance(),n++}}e.acceptToken(zIn,-n)}),i5n=YO({"get set async static":K.modifier,"for while do if else switch try catch finally return throw break continue default case":K.controlKeyword,"in of await yield void typeof delete instanceof":K.operatorKeyword,"let var const using function class extends":K.definitionKeyword,"import export from":K.moduleKeyword,"with debugger as new":K.keyword,TemplateString:K.special(K.string),super:K.atom,BooleanLiteral:K.bool,this:K.self,null:K.null,Star:K.modifier,VariableName:K.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":K.function(K.variableName),VariableDefinition:K.definition(K.variableName),Label:K.labelName,PropertyName:K.propertyName,PrivatePropertyName:K.special(K.propertyName),"CallExpression/MemberExpression/PropertyName":K.function(K.propertyName),"FunctionDeclaration/VariableDefinition":K.function(K.definition(K.variableName)),"ClassDeclaration/VariableDefinition":K.definition(K.className),PropertyDefinition:K.definition(K.propertyName),PrivatePropertyDefinition:K.definition(K.special(K.propertyName)),UpdateOp:K.updateOperator,"LineComment Hashbang":K.lineComment,BlockComment:K.blockComment,Number:K.number,String:K.string,Escape:K.escape,ArithOp:K.arithmeticOperator,LogicOp:K.logicOperator,BitOp:K.bitwiseOperator,CompareOp:K.compareOperator,RegExp:K.regexp,Equals:K.definitionOperator,Arrow:K.function(K.punctuation),": Spread":K.punctuation,"( )":K.paren,"[ ]":K.squareBracket,"{ }":K.brace,"InterpolationStart InterpolationEnd":K.special(K.brace),".":K.derefOperator,", ;":K.separator,"@":K.meta,TypeName:K.typeName,TypeDefinition:K.definition(K.typeName),"type enum interface implements namespace module declare":K.definitionKeyword,"abstract global Privacy readonly override":K.modifier,"is keyof unique infer":K.operatorKeyword,JSXAttributeValue:K.attributeValue,JSXText:K.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":K.angleBracket,"JSXIdentifier JSXNameSpacedName":K.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":K.attributeName,"JSXBuiltin/JSXIdentifier":K.standard(K.tagName)}),o5n={__proto__:null,export:18,as:23,from:31,default:34,async:39,function:40,extends:52,this:56,true:64,false:64,null:76,void:80,typeof:84,super:102,new:136,delete:152,yield:161,await:165,class:170,public:227,private:227,protected:227,readonly:229,instanceof:248,satisfies:251,in:252,const:254,import:286,keyof:339,unique:343,infer:349,is:385,abstract:405,implements:407,type:409,let:412,var:414,using:417,interface:423,enum:427,namespace:433,module:435,declare:439,global:443,for:462,of:471,while:474,with:478,do:482,if:486,else:488,switch:492,case:498,try:504,catch:508,finally:512,return:516,throw:520,break:524,continue:528,debugger:532},s5n={__proto__:null,async:123,get:125,set:127,declare:187,public:189,private:189,protected:189,static:191,abstract:193,override:195,readonly:201,accessor:203,new:389},a5n={__proto__:null,"<":143},l5n=lO.deserialize({version:14,states:"$=WO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ08SO'#ChO+RO!bO'#CiO+aO#tO'#CiO+oO?MpO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DyO0fQ^O'#EROOQ07b'#EZ'#EZO1PQWO'#EWOOQO'#El'#ElOOQO'#Ie'#IeO1XQWO'#GmO1dQWO'#EkO1iQWO'#EkO3kQ08SO'#JiO6[Q08SO'#JjO6xQWO'#FZO6}Q&jO'#FqOOQ07b'#Fc'#FcO7YO,YO'#FcO7hQ7[O'#FxO9UQWO'#FwOOQ07b'#Jj'#JjOOQ07`'#Ji'#JiO9ZQWO'#GqOOQU'#KV'#KVO9fQWO'#IRO9kQ07hO'#ISOOQU'#JW'#JWOOQU'#IW'#IWQ`Q^OOO`Q^OOO%[Q^O'#DqO9sQ^O'#D}O9zQ^O'#EPO9aQWO'#GmO:RQ7[O'#CnO:aQWO'#EjO:lQWO'#EuO:qQ7[O'#FbO;`QWO'#GmOOQO'#KW'#KWO;eQWO'#KWO;sQWO'#GuO;sQWO'#GvO;sQWO'#GxO9aQWO'#G{O<jQWO'#HOO>RQWO'#CdO>cQWO'#H[O>kQWO'#HbO>kQWO'#HdO`Q^O'#HfO>kQWO'#HhO>kQWO'#HkO>pQWO'#HqO>uQ07iO'#HwO%[Q^O'#HyO?QQ07iO'#H{O?]Q07iO'#H}O9kQ07hO'#IPO?hQ08SO'#ChO@jQ`O'#DiQOQWOOO%[Q^O'#EPOAQQWO'#ESO:RQ7[O'#EjOA]QWO'#EjOAhQpO'#FbOOQU'#Cf'#CfOOQ07`'#Dn'#DnOOQ07`'#Jm'#JmO%[Q^O'#JmOOQO'#Jq'#JqOOQO'#Ib'#IbOBhQ`O'#EcOOQ07`'#Eb'#EbOOQ07`'#Jt'#JtOCdQ07pO'#EcOCnQ`O'#EVOOQO'#Jp'#JpODSQ`O'#JqOEaQ`O'#EVOCnQ`O'#EcPEnO!0LbO'#CaPOOO)CDu)CDuOOOO'#IX'#IXOEyO!bO,59TOOQ07b,59T,59TOOOO'#IY'#IYOFXO#tO,59TO%[Q^O'#D`OOOO'#I['#I[OFgO?MpO,59xOOQ07b,59x,59xOFuQ^O'#I]OGYQWO'#JkOI[QrO'#JkO+}Q^O'#JkOIcQWO,5:OOIyQWO'#ElOJWQWO'#JzOJcQWO'#JyOJcQWO'#JyOJkQWO,5;YOJpQWO'#JxOOQ07f,5:Z,5:ZOJwQ^O,5:ZOLxQ08SO,5:eOMiQWO,5:mONSQ07hO'#JwONZQWO'#JvO9ZQWO'#JvONoQWO'#JvONwQWO,5;XON|QWO'#JvO!#UQrO'#JjOOQ07b'#Ch'#ChO%[Q^O'#ERO!#tQpO,5:rOOQO'#Jr'#JrOOQO-E<c-E<cO9aQWO,5=XO!$[QWO,5=XO!$aQ^O,5;VO!&dQ7[O'#EgO!'}QWO,5;VO!)mQ7[O'#DsO!)tQ^O'#DxO!*OQ`O,5;`O!*WQ`O,5;`O%[Q^O,5;`OOQU'#FR'#FROOQU'#FT'#FTO%[Q^O,5;aO%[Q^O,5;aO%[Q^O,5;aO%[Q^O,5;aO%[Q^O,5;aO%[Q^O,5;aO%[Q^O,5;aO%[Q^O,5;aO%[Q^O,5;aO%[Q^O,5;aO%[Q^O,5;aOOQU'#FX'#FXO!*fQ^O,5;rOOQ07b,5;w,5;wOOQ07b,5;x,5;xO!,iQWO,5;xOOQ07b,5;y,5;yO%[Q^O'#IiO!,qQ07hO,5<eO!&dQ7[O,5;aO!-`Q7[O,5;aO%[Q^O,5;uO!-gQ&jO'#FgO!.dQ&jO'#KOO!.OQ&jO'#KOO!.kQ&jO'#KOOOQO'#KO'#KOO!/PQ&jO,5<POOOS,5<],5<]O!/bQ^O'#FsOOOS'#Ih'#IhO7YO,YO,5;}O!/iQ&jO'#FuOOQ07b,5;},5;}O!0YQMhO'#CuOOQ07b'#Cy'#CyO!0mQWO'#CyO!0rO?MpO'#C}O!1`Q7[O,5<bO!1gQWO,5<dO!3SQ!LQO'#GSO!3aQWO'#GTO!3fQWO'#GTO!5UQ!LQO'#GXO!6QQ`O'#G]OOQO'#Gh'#GhO!(SQ7[O'#GgOOQO'#Gj'#GjO!(SQ7[O'#GiO!6sQMhO'#JdOOQ07b'#Jd'#JdO!6}QWO'#JcO!7]QWO'#JbO!7eQWO'#CtOOQ07b'#Cw'#CwOOQ07b'#DR'#DROOQ07b'#DT'#DTO1SQWO'#DVO!(SQ7[O'#FzO!(SQ7[O'#F|O!7mQWO'#GOO!7rQWO'#GPO!3fQWO'#GVO!(SQ7[O'#G[O!7wQWO'#EmO!8fQWO,5<cOOQ07`'#Cq'#CqO!8nQWO'#EnO!9hQ`O'#EoOOQ07`'#Jx'#JxO!9oQ07hO'#KXO9kQ07hO,5=]O`Q^O,5>mOOQU'#J`'#J`OOQU,5>n,5>nOOQU-E<U-E<UO!;qQ08SO,5:]O!>_Q08SO,5:iO%[Q^O,5:iO!@xQ08SO,5:kOOQO,5@r,5@rO!AiQ7[O,5=XO!AwQ07hO'#JaO9UQWO'#JaO!BYQ07hO,59YO!BeQ`O,59YO!BmQ7[O,59YO:RQ7[O,59YO!BxQWO,5;VO!CQQWO'#HZO!CfQWO'#K[O%[Q^O,5;zO!9cQ`O,5;|O!CnQWO,5=tO!CsQWO,5=tO!CxQWO,5=tO9kQ07hO,5=tO;sQWO,5=dOOQO'#Cu'#CuO!DWQ`O,5=aO!D`Q7[O,5=bO!DkQWO,5=dO!DpQpO,5=gO!DxQWO'#KWO>pQWO'#HQO9aQWO'#HSO!D}QWO'#HSO:RQ7[O'#HUO!ESQWO'#HUOOQU,5=j,5=jO!EXQWO'#HVO!EjQWO'#CnO!EoQWO,59OO!EyQWO,59OO!HOQ^O,59OOOQU,59O,59OO!H`Q07hO,59OO%[Q^O,59OO!JkQ^O'#H^OOQU'#H_'#H_OOQU'#H`'#H`O`Q^O,5=vO!KRQWO,5=vO`Q^O,5=|O`Q^O,5>OO!KWQWO,5>QO`Q^O,5>SO!K]QWO,5>VO!KbQ^O,5>]OOQU,5>c,5>cO%[Q^O,5>cO9kQ07hO,5>eOOQU,5>g,5>gO# lQWO,5>gOOQU,5>i,5>iO# lQWO,5>iOOQU,5>k,5>kO#!YQ`O'#D[O%[Q^O'#JmO#!dQ`O'#JmO##RQ`O'#DjO##dQ`O'#DjO#%uQ^O'#DjO#%|QWO'#JlO#&UQWO,5:TO#&ZQWO'#EpO#&iQWO'#J{O#&qQWO,5;ZO#&vQ`O'#DjO#'TQ`O'#EUOOQ07b,5:n,5:nO%[Q^O,5:nO#'[QWO,5:nO>pQWO,5;UO!BeQ`O,5;UO!BmQ7[O,5;UO:RQ7[O,5;UO#'dQWO,5@XO#'iQ$ISO,5:rOOQO-E<`-E<`O#(oQ07pO,5:}OCnQ`O,5:qO#(yQ`O,5:qOCnQ`O,5:}O!BYQ07hO,5:qOOQ07`'#Ef'#EfOOQO,5:},5:}O%[Q^O,5:}O#)WQ07hO,5:}O#)cQ07hO,5:}O!BeQ`O,5:qOOQO,5;T,5;TO#)qQ07hO,5:}POOO'#IV'#IVP#*VO!0LbO,58{POOO,58{,58{OOOO-E<V-E<VOOQ07b1G.o1G.oOOOO-E<W-E<WO#*bQpO,59zOOOO-E<Y-E<YOOQ07b1G/d1G/dO#*gQrO,5>wO+}Q^O,5>wOOQO,5>},5>}O#*qQ^O'#I]OOQO-E<Z-E<ZO#+OQWO,5@VO#+WQrO,5@VO#+_QWO,5@eOOQ07b1G/j1G/jO%[Q^O,5@fO#+gQWO'#IcOOQO-E<a-E<aO#+_QWO,5@eOOQ07`1G0t1G0tOOQ07f1G/u1G/uOOQ07f1G0X1G0XO%[Q^O,5@cO#+{Q07hO,5@cO#,^Q07hO,5@cO#,eQWO,5@bO9ZQWO,5@bO#,mQWO,5@bO#,{QWO'#IfO#,eQWO,5@bOOQ07`1G0s1G0sO!*OQ`O,5:tO!*ZQ`O,5:tOOQO,5:v,5:vO#-mQWO,5:vO#-uQ7[O1G2sO9aQWO1G2sOOQ07b1G0q1G0qO#.TQ08SO1G0qO#/YQ08QO,5;ROOQ07b'#GR'#GRO#/vQ08SO'#JdO!$aQ^O1G0qO#2OQ7[O'#JnO#2YQWO,5:_O#2_QrO'#JoO%[Q^O'#JoO#2iQWO,5:dOOQ07b'#D['#D[OOQ07b1G0z1G0zO%[Q^O1G0zOOQ07b1G1d1G1dO#2nQWO1G0zO#5VQ08SO1G0{O#5^Q08SO1G0{O#7wQ08SO1G0{O#8OQ08SO1G0{O#:YQ08SO1G0{O#:pQ08SO1G0{O#=jQ08SO1G0{O#=qQ08SO1G0{O#@UQ08SO1G0{O#@cQ08SO1G0{O#BaQ08SO1G0{O#EaQ(CYO'#ChO#G_Q(CYO1G1^O#GfQ(CYO'#JjO!,lQWO1G1dO#GvQ08SO,5?TOOQ07`-E<g-E<gO#HjQ08SO1G0{OOQ07b1G0{1G0{O#JuQ08SO1G1aO#KiQ&jO,5<TO#KqQ&jO,5<UO#KyQ&jO'#FlO#LbQWO'#FkOOQO'#KP'#KPOOQO'#Ig'#IgO#LgQ&jO1G1kOOQ07b1G1k1G1kOOOS1G1v1G1vO#LxQ(CYO'#JiO#MSQWO,5<_O!*fQ^O,5<_OOOS-E<f-E<fOOQ07b1G1i1G1iO#MXQ`O'#KOOOQ07b,5<a,5<aO#MaQ`O,5<aOOQ07b,59e,59eO!&dQ7[O'#DPOOOO'#IZ'#IZO#MfO?MpO,59iOOQ07b,59i,59iO%[Q^O1G1|O!7rQWO'#IkO#MqQ7[O,5<uOOQ07b,5<r,5<rO!(SQ7[O'#InO#NaQ7[O,5=RO!(SQ7[O'#IpO$ SQ7[O,5=TO!&dQ7[O,5=VOOQO1G2O1G2OO$ ^QpO'#CqO$ qQ!LQO'#EnO$!pQ`O'#G]O$#^QpO,5<nO$#eQWO'#KSO9ZQWO'#KSO$#sQWO,5<pO!(SQ7[O,5<oO$#xQWO'#GUO$$ZQWO,5<oO$$`QpO'#GRO$$mQpO'#KTO$$wQWO'#KTO!&dQ7[O'#KTO$$|QWO,5<sO$%RQ`O'#G^O!5{Q`O'#G^O$%dQWO'#G`O$%iQWO'#GbO!3fQWO'#GeO$%nQ07hO'#ImO$%yQ`O,5<wOOQ07f,5<w,5<wO$&QQ`O'#G^O$&`Q`O'#G_O$&hQ`O'#G_O$&mQ7[O,5=RO$&}Q7[O,5=TOOQ07b,5=W,5=WO!(SQ7[O,5?}O!(SQ7[O,5?}O$'_QWO'#IrO$'jQWO,5?|O$'rQWO,59`O$(cQ7[O,59qOOQ07b,59q,59qO$)UQ7[O,5<fO$)wQ7[O,5<hO@bQWO,5<jOOQ07b,5<k,5<kO$*RQWO,5<qO$*WQ7[O,5<vO$*hQWO'#JvO!$aQ^O1G1}O$*mQWO1G1}O9ZQWO'#JyO9ZQWO'#EpO%[Q^O'#EpO9ZQWO'#ItO$*rQ07hO,5@sOOQU1G2w1G2wOOQU1G4X1G4XOOQ07b1G/w1G/wO!,iQWO1G/wO$,wQ08SO1G0TOOQU1G2s1G2sO!&dQ7[O1G2sO%[Q^O1G2sO#-xQWO1G2sO$.{Q7[O'#EgOOQ07`,5?{,5?{O$/VQ07hO,5?{OOQU1G.t1G.tO!BYQ07hO1G.tO!BeQ`O1G.tO!BmQ7[O1G.tO$/hQWO1G0qO$/mQWO'#ChO$/xQWO'#K]O$0QQWO,5=uO$0VQWO'#K]O$0[QWO'#K]O$0jQWO'#IzO$0xQWO,5@vO$1QQrO1G1fOOQ07b1G1h1G1hO9aQWO1G3`O@bQWO1G3`O$1XQWO1G3`O$1^QWO1G3`OOQU1G3`1G3`O!DkQWO1G3OO!&dQ7[O1G2{O$1cQWO1G2{OOQU1G2|1G2|O!&dQ7[O1G2|O$1hQWO1G2|O$1pQ`O'#GzOOQU1G3O1G3OO!5{Q`O'#IvO!DpQpO1G3ROOQU1G3R1G3ROOQU,5=l,5=lO$1xQ7[O,5=nO9aQWO,5=nO$%iQWO,5=pO9UQWO,5=pO!BeQ`O,5=pO!BmQ7[O,5=pO:RQ7[O,5=pO$2WQWO'#KZO$2cQWO,5=qOOQU1G.j1G.jO$2hQ07hO1G.jO@bQWO1G.jO$2sQWO1G.jO9kQ07hO1G.jO$4xQrO,5@xO$5YQWO,5@xO9ZQWO,5@xO$5eQ^O,5=xO$5lQWO,5=xOOQU1G3b1G3bO`Q^O1G3bOOQU1G3h1G3hOOQU1G3j1G3jO>kQWO1G3lO$5qQ^O1G3nO$9uQ^O'#HmOOQU1G3q1G3qO$:SQWO'#HsO>pQWO'#HuOOQU1G3w1G3wO$:[Q^O1G3wO9kQ07hO1G3}OOQU1G4P1G4POOQ07`'#GY'#GYO9kQ07hO1G4RO9kQ07hO1G4TO$>cQWO,5@XO!*fQ^O,5;[O9ZQWO,5;[O>pQWO,5:UO!*fQ^O,5:UO!BeQ`O,5:UO$>hQ(CYO,5:UOOQO,5;[,5;[O$>rQ`O'#I^O$?YQWO,5@WOOQ07b1G/o1G/oO$?bQ`O'#IdO$?lQWO,5@gOOQ07`1G0u1G0uO##dQ`O,5:UOOQO'#Ia'#IaO$?tQ`O,5:pOOQ07f,5:p,5:pO#'_QWO1G0YOOQ07b1G0Y1G0YO%[Q^O1G0YOOQ07b1G0p1G0pO>pQWO1G0pO!BeQ`O1G0pO!BmQ7[O1G0pOOQ07`1G5s1G5sO!BYQ07hO1G0]OOQO1G0i1G0iO%[Q^O1G0iO$?{Q07hO1G0iO$@WQ07hO1G0iO!BeQ`O1G0]OCnQ`O1G0]O$@fQ07hO1G0iOOQO1G0]1G0]O$@zQ08SO1G0iPOOO-E<T-E<TPOOO1G.g1G.gOOOO1G/f1G/fO$AUQpO,5<eO$A^QrO1G4cOOQO1G4i1G4iO%[Q^O,5>wO$AhQWO1G5qO$ApQWO1G6PO$AxQrO1G6QO9ZQWO,5>}O$BSQ08SO1G5}O%[Q^O1G5}O$BdQ07hO1G5}O$BuQWO1G5|O$BuQWO1G5|O9ZQWO1G5|O$B}QWO,5?QO9ZQWO,5?QOOQO,5?Q,5?QO$CcQWO,5?QO$*hQWO,5?QOOQO-E<d-E<dOOQO1G0`1G0`OOQO1G0b1G0bO!,lQWO1G0bOOQU7+(_7+(_O!&dQ7[O7+(_O%[Q^O7+(_O$CqQWO7+(_O$C|Q7[O7+(_O$D[Q08SO,5=RO$FgQ08SO,5=TO$HrQ08SO,5=RO$KTQ08SO,5=TO$MfQ08SO,59qO% nQ08SO,5<fO%#yQ08SO,5<hO%&UQ08SO,5<vOOQ07b7+&]7+&]O%(gQ08SO7+&]O%)ZQ7[O'#I_O%)eQWO,5@YOOQ07b1G/y1G/yO%)mQ^O'#I`O%)zQWO,5@ZO%*SQrO,5@ZOOQ07b1G0O1G0OO%*^QWO7+&fOOQ07b7+&f7+&fO%*cQ(CYO,5:eO%[Q^O7+&xO%*mQ(CYO,5:]O%*zQ(CYO,5:iO%+UQ(CYO,5:kOOQ07b7+'O7+'OOOQO1G1o1G1oOOQO1G1p1G1pO%+`QtO,5<WO!*fQ^O,5<VOOQO-E<e-E<eOOQ07b7+'V7+'VOOOS7+'b7+'bOOOS1G1y1G1yO%+kQWO1G1yOOQ07b1G1{1G1{O%+pQpO,59kOOOO-E<X-E<XOOQ07b1G/T1G/TO%+wQ08SO7+'hOOQ07b,5?V,5?VO%,kQpO,5?VOOQ07b1G2a1G2aP!&dQ7[O'#IkPOQ07b-E<i-E<iO%-ZQ7[O,5?YOOQ07b-E<l-E<lO%-|Q7[O,5?[OOQ07b-E<n-E<nO%.WQpO1G2qO%._QpO'#CqO%.uQ7[O'#JyO%.|Q^O'#EpOOQ07b1G2Y1G2YO%/WQWO'#IjO%/lQWO,5@nO%/lQWO,5@nO%/tQWO,5@nO%0PQWO,5@nOOQO1G2[1G2[O%0_Q7[O1G2ZO!(SQ7[O1G2ZO%0oQ!LQO'#IlO%0|QWO,5@oO!&dQ7[O,5@oO%1UQpO,5@oOOQ07b1G2_1G2_OOQ07`,5<x,5<xOOQ07`,5<y,5<yO$*hQWO,5<yOC_QWO,5<yO!BeQ`O,5<xOOQO'#Ga'#GaO%1`QWO,5<zOOQ07`,5<|,5<|O$*hQWO,5=POOQO,5?X,5?XOOQO-E<k-E<kOOQ07f1G2c1G2cO!5{Q`O,5<xO%1hQWO,5<yO$%dQWO,5<zO!5{Q`O,5<yO!(SQ7[O'#InO%2[Q7[O1G2mO!(SQ7[O'#IpO%2}Q7[O1G2oO%3XQ7[O1G5iO%3cQ7[O1G5iOOQO,5?^,5?^OOQO-E<p-E<pOOQO1G.z1G.zO!9cQ`O,59sO%[Q^O,59sO%3pQWO1G2UO!(SQ7[O1G2]O%3uQ08SO7+'iOOQ07b7+'i7+'iO!$aQ^O7+'iO%4iQWO,5;[OOQ07`,5?`,5?`OOQ07`-E<r-E<rOOQ07b7+%c7+%cO%4nQpO'#KUO#'_QWO7+(_O%4xQrO7+(_O$CtQWO7+(_O%5PQ08QO'#ChO%5dQ08QO,5<}O%6UQWO,5<}OOQ07`1G5g1G5gOOQU7+$`7+$`O!BYQ07hO7+$`O!BeQ`O7+$`O!$aQ^O7+&]O%6ZQWO'#IyO%6rQWO,5@wOOQO1G3a1G3aO9aQWO,5@wO%6rQWO,5@wO%6zQWO,5@wOOQO,5?f,5?fOOQO-E<x-E<xOOQ07b7+'Q7+'QO%7PQWO7+(zO9kQ07hO7+(zO9aQWO7+(zO@bQWO7+(zOOQU7+(j7+(jO%7UQ08QO7+(gO!&dQ7[O7+(gO%7`QpO7+(hOOQU7+(h7+(hO!&dQ7[O7+(hO%7gQWO'#KYO%7rQWO,5=fOOQO,5?b,5?bOOQO-E<t-E<tOOQU7+(m7+(mO%9RQ`O'#HTOOQU1G3Y1G3YO!&dQ7[O1G3YO%[Q^O1G3YO%9YQWO1G3YO%9eQ7[O1G3YO9kQ07hO1G3[O$%iQWO1G3[O9UQWO1G3[O!BeQ`O1G3[O!BmQ7[O1G3[O%9sQWO'#IxO%:XQWO,5@uO%:aQ`O,5@uOOQ07`1G3]1G3]OOQU7+$U7+$UO@bQWO7+$UO9kQ07hO7+$UO%:lQWO7+$UO%[Q^O1G6dO%[Q^O1G6eO%:qQ07hO1G6dO%:{Q^O1G3dO%;SQWO1G3dO%;XQ^O1G3dOOQU7+(|7+(|O9kQ07hO7+)WO`Q^O7+)YOOQU'#K`'#K`OOQU'#I{'#I{O%;`Q^O,5>XOOQU,5>X,5>XO%[Q^O'#HnO%;mQWO'#HpOOQU,5>_,5>_O9ZQWO,5>_OOQU,5>a,5>aOOQU7+)c7+)cOOQU7+)i7+)iOOQU7+)m7+)mOOQU7+)o7+)oO%;rQ`O1G5sO%<WQ(CYO1G0vO%<bQWO1G0vOOQO1G/p1G/pO%<mQ(CYO1G/pO>pQWO1G/pO!*fQ^O'#DjOOQO,5>x,5>xOOQO-E<[-E<[OOQO,5?O,5?OOOQO-E<b-E<bO!BeQ`O1G/pOOQO-E<_-E<_OOQ07f1G0[1G0[OOQ07b7+%t7+%tO#'_QWO7+%tOOQ07b7+&[7+&[O>pQWO7+&[O!BeQ`O7+&[OOQO7+%w7+%wO$@zQ08SO7+&TOOQO7+&T7+&TO%[Q^O7+&TO%<wQ07hO7+&TO!BYQ07hO7+%wO!BeQ`O7+%wO%=SQ07hO7+&TO%=bQ08SO7++iO%[Q^O7++iO%=rQWO7++hO%=rQWO7++hOOQO1G4l1G4lO9ZQWO1G4lO%=zQWO1G4lOOQO7+%|7+%|O#'_QWO<<KyO%4xQrO<<KyO%>YQWO<<KyOOQU<<Ky<<KyO!&dQ7[O<<KyO%[Q^O<<KyO%>bQWO<<KyO%>mQ08SO,5?YO%@xQ08SO,5?[O%CTQ08SO1G2ZO%EfQ08SO1G2mO%GqQ08SO1G2oO%I|Q7[O,5>yOOQO-E<]-E<]O%JWQrO,5>zO%[Q^O,5>zOOQO-E<^-E<^O%JbQWO1G5uOOQ07b<<JQ<<JQO%JjQ(CYO1G0qO%LtQ(CYO1G0{O%L{Q(CYO1G0{O& PQ(CYO1G0{O& WQ(CYO1G0{O&!{Q(CYO1G0{O&#cQ(CYO1G0{O&%vQ(CYO1G0{O&%}Q(CYO1G0{O&'{Q(CYO1G0{O&(YQ(CYO1G0{O&*WQ(CYO1G0{O&*kQ08SO<<JdO&+pQ(CYO1G0{O&-fQ(CYO'#JdO&/iQ(CYO1G1aO&/vQ(CYO1G0TO!*fQ^O'#FnOOQO'#KQ'#KQOOQO1G1r1G1rO&0QQWO1G1qO&0VQ(CYO,5?TOOOS7+'e7+'eOOOO1G/V1G/VOOQ07b1G4q1G4qO!(SQ7[O7+(]O&2gQrO'#ChO&2qQWO,5?UO9ZQWO,5?UOOQO-E<h-E<hO&3PQWO1G6YO&3PQWO1G6YO&3XQWO1G6YO&3dQ7[O7+'uO&3tQpO,5?WO&4OQWO,5?WO!&dQ7[O,5?WOOQO-E<j-E<jO&4TQpO1G6ZO&4_QWO1G6ZOOQ07`1G2e1G2eO$*hQWO1G2eOOQ07`1G2d1G2dO&4gQWO1G2fO!&dQ7[O1G2fOOQ07`1G2k1G2kO!BeQ`O1G2dOC_QWO1G2eO&4lQWO1G2fO&4tQWO1G2eO&5hQ7[O,5?YOOQ07b-E<m-E<mO&6ZQ7[O,5?[OOQ07b-E<o-E<oO!(SQ7[O7++TOOQ07b1G/_1G/_O&6eQWO1G/_OOQ07b7+'p7+'pO&6jQ7[O7+'wO&6zQ08SO<<KTOOQ07b<<KT<<KTO&7nQWO1G0vO!&dQ7[O'#IsO&7sQWO,5@pO!&dQ7[O1G2iOOQU<<Gz<<GzO!BYQ07hO<<GzO&7{Q08SO<<IwOOQ07b<<Iw<<IwOOQO,5?e,5?eO&8oQWO,5?eO&8tQWO,5?eOOQO-E<w-E<wO&9SQWO1G6cO&9SQWO1G6cO9aQWO1G6cO@bQWO<<LfOOQU<<Lf<<LfO&9[QWO<<LfO9kQ07hO<<LfOOQU<<LR<<LRO%7UQ08QO<<LROOQU<<LS<<LSO%7`QpO<<LSO&9aQ`O'#IuO&9lQWO,5@tO!*fQ^O,5@tOOQU1G3Q1G3QO%.|Q^O'#JmOOQO'#Iw'#IwO9kQ07hO'#IwO&9tQ`O,5=oOOQU,5=o,5=oO&9{Q`O'#EcO&:aQWO7+(tO&:fQWO7+(tOOQU7+(t7+(tO!&dQ7[O7+(tO%[Q^O7+(tO&:nQWO7+(tOOQU7+(v7+(vO9kQ07hO7+(vO$%iQWO7+(vO9UQWO7+(vO!BeQ`O7+(vO&:yQWO,5?dOOQO-E<v-E<vOOQO'#HW'#HWO&;UQWO1G6aO9kQ07hO<<GpOOQU<<Gp<<GpO@bQWO<<GpO&;^QWO7+,OO&;cQWO7+,PO%[Q^O7+,OO%[Q^O7+,POOQU7+)O7+)OO&;hQWO7+)OO&;mQ^O7+)OO&;tQWO7+)OOOQU<<Lr<<LrOOQU<<Lt<<LtOOQU-E<y-E<yOOQU1G3s1G3sO&;yQWO,5>YOOQU,5>[,5>[O&<OQWO1G3yO9ZQWO7+&bO!*fQ^O7+&bOOQO7+%[7+%[O&<TQ(CYO1G6QO>pQWO7+%[OOQ07b<<I`<<I`OOQ07b<<Iv<<IvO>pQWO<<IvOOQO<<Io<<IoO$@zQ08SO<<IoO%[Q^O<<IoOOQO<<Ic<<IcO!BYQ07hO<<IcO&<_Q07hO<<IoO&<jQ08SO<= TO&<zQWO<= SOOQO7+*W7+*WO9ZQWO7+*WOOQUANAeANAeO&=SQWOANAeO!&dQ7[OANAeO#'_QWOANAeO%4xQrOANAeO%[Q^OANAeO&=[Q08SO7+'uO&?mQ08SO,5?YO&AxQ08SO,5?[O&DTQ08SO7+'wO&FfQrO1G4fO&FpQ(CYO7+&]O&HtQ(CYO,5=RO&J{Q(CYO,5=TO&K]Q(CYO,5=RO&KmQ(CYO,5=TO&K}Q(CYO,59qO&NQQ(CYO,5<fO'!TQ(CYO,5<hO'$WQ(CYO,5<vO'%|Q(CYO7+'hO'&ZQ(CYO7+'iO'&hQWO,5<YOOQO7+']7+']O'&mQ7[O<<KwOOQO1G4p1G4pO'&tQWO1G4pO''PQWO1G4pO''_QWO7++tO''_QWO7++tO!&dQ7[O1G4rO''gQpO1G4rO''qQWO7++uOOQ07`7+(P7+(PO$*hQWO7+(QO''yQpO7+(QOOQ07`7+(O7+(OO$*hQWO7+(PO'(QQWO7+(QO!&dQ7[O7+(QOC_QWO7+(PO'(VQ7[O<<NoOOQ07b7+$y7+$yO'(aQpO,5?_OOQO-E<q-E<qO'(kQ08QO7+(TOOQUAN=fAN=fO9aQWO1G5POOQO1G5P1G5PO'({QWO1G5PO')QQWO7++}O')QQWO7++}O9kQ07hOANBQO@bQWOANBQOOQUANBQANBQOOQUANAmANAmOOQUANAnANAnO')YQWO,5?aOOQO-E<s-E<sO')eQ(CYO1G6`OOQO,5?c,5?cOOQO-E<u-E<uOOQU1G3Z1G3ZO%.|Q^O,5<zOOQU<<L`<<L`O!&dQ7[O<<L`O&:aQWO<<L`O')oQWO<<L`O%[Q^O<<L`OOQU<<Lb<<LbO9kQ07hO<<LbO$%iQWO<<LbO9UQWO<<LbO')wQ`O1G5OO'*SQWO7++{OOQUAN=[AN=[O9kQ07hOAN=[OOQU<= j<= jOOQU<= k<= kO'*[QWO<= jO'*aQWO<= kOOQU<<Lj<<LjO'*fQWO<<LjO'*kQ^O<<LjOOQU1G3t1G3tO>pQWO7+)eO'*rQWO<<I|O'*}Q(CYO<<I|OOQO<<Hv<<HvOOQ07bAN?bAN?bOOQOAN?ZAN?ZO$@zQ08SOAN?ZOOQOAN>}AN>}O%[Q^OAN?ZOOQO<<Mr<<MrOOQUG27PG27PO!&dQ7[OG27PO#'_QWOG27PO'+XQWOG27PO%4xQrOG27PO'+aQ(CYO<<JdO'+nQ(CYO1G2ZO'-dQ(CYO,5?YO'/gQ(CYO,5?[O'1jQ(CYO1G2mO'3mQ(CYO1G2oO'5pQ(CYO<<KTO'5}Q(CYO<<IwOOQO1G1t1G1tO!(SQ7[OANAcOOQO7+*[7+*[O'6[QWO7+*[O'6gQWO<= `O'6oQpO7+*^OOQ07`<<Kl<<KlO$*hQWO<<KlOOQ07`<<Kk<<KkO'6yQpO<<KlO$*hQWO<<KkOOQO7+*k7+*kO9aQWO7+*kO'7QQWO<= iOOQUG27lG27lO9kQ07hOG27lO!*fQ^O1G4{O'7YQWO7++zO&:aQWOANAzOOQUANAzANAzO!&dQ7[OANAzO'7bQWOANAzOOQUANA|ANA|O9kQ07hOANA|O$%iQWOANA|OOQO'#HX'#HXOOQO7+*j7+*jOOQUG22vG22vOOQUANEUANEUOOQUANEVANEVOOQUANBUANBUO'7jQWOANBUOOQU<<MP<<MPO!*fQ^OAN?hOOQOG24uG24uO$@zQ08SOG24uO#'_QWOLD,kOOQULD,kLD,kO!&dQ7[OLD,kO'7oQWOLD,kO'7wQ(CYO7+'uO'9mQ(CYO,5?YO';pQ(CYO,5?[O'=sQ(CYO7+'wO'?iQ7[OG26}OOQO<<Mv<<MvOOQ07`ANAWANAWO$*hQWOANAWOOQ07`ANAVANAVOOQO<<NV<<NVOOQULD-WLD-WO'?yQ(CYO7+*gOOQUG27fG27fO&:aQWOG27fO!&dQ7[OG27fOOQUG27hG27hO9kQ07hOG27hOOQUG27pG27pO'@TQ(CYOG25SOOQOLD*aLD*aOOQU!$(!V!$(!VO#'_QWO!$(!VO!&dQ7[O!$(!VO'@_Q08SOG26}OOQ07`G26rG26rOOQULD-QLD-QO&:aQWOLD-QOOQULD-SLD-SOOQU!)9Eq!)9EqO#'_QWO!)9EqOOQU!$(!l!$(!lOOQU!.K;]!.K;]O'BpQ(CYOG26}O!*fQ^O'#DyO1PQWO'#EWO'DfQrO'#JiO!*fQ^O'#DqO'DmQ^O'#D}O'DtQrO'#ChO'G[QrO'#ChO!*fQ^O'#EPO'GlQ^O,5;VO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O,5;aO!*fQ^O'#IiO'IoQWO,5<eO'IwQ7[O,5;aO'KbQ7[O,5;aO!*fQ^O,5;uO!&dQ7[O'#GgO'IwQ7[O'#GgO!&dQ7[O'#GiO'IwQ7[O'#GiO1SQWO'#DVO1SQWO'#DVO!&dQ7[O'#FzO'IwQ7[O'#FzO!&dQ7[O'#F|O'IwQ7[O'#F|O!&dQ7[O'#G[O'IwQ7[O'#G[O!*fQ^O,5:iO'KiQ`O'#D[O!*fQ^O,5@fO'GlQ^O1G0qO'KsQ(CYO'#ChO!*fQ^O1G1|O!&dQ7[O'#InO'IwQ7[O'#InO!&dQ7[O'#IpO'IwQ7[O'#IpO'K}QpO'#CqO!&dQ7[O,5<oO'IwQ7[O,5<oO'GlQ^O1G1}O!*fQ^O7+&xO!&dQ7[O1G2ZO'IwQ7[O1G2ZO!&dQ7[O'#InO'IwQ7[O'#InO!&dQ7[O'#IpO'IwQ7[O'#IpO!&dQ7[O1G2]O'IwQ7[O1G2]O'GlQ^O7+'iO'GlQ^O7+&]O!&dQ7[OANAcO'IwQ7[OANAcO'LbQWO'#EkO'LgQWO'#EkO'LoQWO'#FZO'LtQWO'#EuO'LyQWO'#JzO'MUQWO'#JxO'MaQWO,5;VO'MfQ7[O,5<bO'MmQWO'#GTO'MrQWO'#GTO'MwQWO,5<cO'NPQWO,5;VO'NXQ(CYO1G1^O'N`QWO,5<oO'NeQWO,5<oO'NjQWO,5<qO'NoQWO,5<qO'NtQWO1G1}O'NyQWO1G0qO( OQ7[O<<KwO( VQ7[O<<KwO7hQ7[O'#FxO9UQWO'#FwOA]QWO'#EjO!*fQ^O,5;rO!3fQWO'#GTO!3fQWO'#GTO!3fQWO'#GVO!3fQWO'#GVO!(SQ7[O7+(]O!(SQ7[O7+(]O%.WQpO1G2qO%.WQpO1G2qO!&dQ7[O,5=VO!&dQ7[O,5=V",stateData:"(!Z~O'tOS'uOSSOS'vRQ~OPYOQYORfOX!VO`qOczOdyOlkOnYOokOpkOvkOxYOzYO!PWO!TkO!UkO![XO!fuO!kZO!nYO!oYO!pYO!rvO!twO!wxO!{]O#s!PO$T|O%b}O%d!QO%f!OO%g!OO%h!OO%k!RO%m!SO%p!TO%q!TO%s!UO&P!WO&V!XO&X!YO&Z!ZO&]![O&`!]O&f!^O&l!_O&n!`O&p!aO&r!bO&t!cO'{SO'}TO(QUO(XVO(g[O(uiO~OVtO~P`OPYOQYORfOc!jOd!iOlkOnYOokOpkOvkOxYOzYO!PWO!TkO!UkO![!eO!fuO!kZO!nYO!oYO!pYO!rvO!t!gO!w!hO$T!kO'{!dO'}TO(QUO(XVO(g[O(uiO~O`!wOo!nO!P!oO!_!yO!`!vO!a!vO!{:jO#P!pO#Q!pO#R!xO#S!pO#T!pO#W!zO#X!zO'|!lO'}TO(QUO([!mO(g!sO~O'v!{O~OP[XZ[X`[Xn[X|[X}[X!P[X!Y[X!h[X!i[X!k[X!o[X#[[X#geX#j[X#k[X#l[X#m[X#n[X#o[X#p[X#q[X#r[X#t[X#v[X#x[X#y[X$O[X'r[X(X[X(i[X(p[X(q[X~O!d$|X~P(qO^!}O'}#PO(O!}O(P#PO~O^#QO(P#PO(Q#PO(R#QO~Ot#SO!R#TO(Y#TO(Z#VO~OPYOQYORfOc!jOd!iOlkOnYOokOpkOvkOxYOzYO!PWO!TkO!UkO![!eO!fuO!kZO!nYO!oYO!pYO!rvO!t!gO!w!hO$T!kO'{:nO'}TO(QUO(XVO(g[O(uiO~O!X#ZO!Y#WO!V(_P!V(mP~P+}O!Z#cO~P`OPYOQYORfOc!jOd!iOnYOokOpkOvkOxYOzYO!PWO!TkO!UkO![!eO!fuO!kZO!nYO!oYO!pYO!rvO!t!gO!w!hO$T!kO'}TO(QUO(XVO(g[O(uiO~Ol#mO!X#iO!{]O#e#lO#f#iO'{:oO!j(jP~P.iO!k#oO'{#nO~O!w#sO!{]O%b#tO~O#g#uO~O!d#vO#g#uO~OP$^OZ$eOn$RO|#zO}#{O!P#|O!Y$bO!h$TO!i#xO!k#yO!o$^O#j$PO#k$QO#l$QO#m$QO#n$SO#o$TO#p$TO#q$dO#r$TO#t$UO#v$WO#x$YO#y$ZO(XVO(i$[O(p#}O(q$OO~O`(]X'r(]X'p(]X!j(]X!V(]X![(]X%c(]X!d(]X~P1qO#[$fO$O$fOP(^XZ(^Xn(^X|(^X}(^X!P(^X!Y(^X!h(^X!k(^X!o(^X#j(^X#k(^X#l(^X#m(^X#n(^X#o(^X#p(^X#q(^X#r(^X#t(^X#v(^X#x(^X#y(^X(X(^X(i(^X(p(^X(q(^X![(^X%c(^X~O`(^X!i(^X'r(^X'p(^X!V(^X!j(^Xr(^X!d(^X~P4XO#[$fO~O$Y$hO$[$gO$c$mO~ORfO![$nO$f$oO$h$qO~Og%WOl%XOn$uOo$tOp$tOv%YOx%ZOz%[O!P$|O![$}O!f%aO!k$yO#f%bO$T%_O$o%]O$q%^O$t%`O'{$sO'}TO(QUO(X$vO(p%OO(q%QOf(UP~O!k%cO~O!P%fO![%gO'{%eO~O!d%kO~O`%lO'r%lO~O'|!lO~P%[O%h%sO~P%[Og%WO!k%cO'{%eO'|!lO~Od%zO!k%cO'{%eO~O#r$TO~O|&PO![%|O!k&OO%d&SO'{%eO'|!lO'}TO(QUO_)OP~O!w#sO~O%m&UO!P(zX![(zX'{(zX~O'{&VO~O!t&[O#s!PO%d!QO%f!OO%g!OO%h!OO%k!RO%m!SO%p!TO%q!TO~Oc&aOd&`O!w&^O%b&_O%u&]O~P;xOc&dOdyO![&cO!t&[O!wxO!{]O#s!PO%b}O%f!OO%g!OO%h!OO%k!RO%m!SO%p!TO%q!TO%s!UO~Oa&gO#[&jO%d&eO'|!lO~P<}O!k&kO!t&oO~O!k#oO~O![XO~O`%lO'q&wO'r%lO~O`%lO'q&zO'r%lO~O`%lO'q&|O'r%lO~O'p[X!V[Xr[X!j[X&T[X![[X%c[X!d[X~P(qO!_'ZO!`'SO!a'SO'|!lO'}TO(QUO~Oo'QO!P'PO!X'TO(['OO!Z(`P!Z(oP~P@UOj'^O!['[O'{%eO~Od'cO!k%cO'{%eO~O|&PO!k&OO~Oo!nO!P!oO!{:jO#P!pO#Q!pO#S!pO#T!pO'|!lO'}TO(QUO([!mO(g!sO~O!_'iO!`'hO!a'hO#R!pO#W'jO#X'jO~PApO`%lOg%WO!d#vO!k%cO'r%lO(i'lO~O!o'pO#['nO~PCOOo!nO!P!oO'}TO(QUO([!mO(g!sO~O![XOo(eX!P(eX!_(eX!`(eX!a(eX!{(eX#P(eX#Q(eX#R(eX#S(eX#T(eX#W(eX#X(eX'|(eX'}(eX(Q(eX([(eX(g(eX~O!`'hO!a'hO'|!lO~PCnO'w'tO'x'tO'y'vO~O^!}O'}'xO(O!}O(P'xO~O^#QO(P'xO(Q'xO(R#QO~Ot#SO!R#TO(Y#TO(Z'|O~O!X(OO!V'PX!V'VX!Y'PX!Y'VX~P+}O!Y(QO!V(_X~OP$^OZ$eOn$RO|#zO}#{O!P#|O!Y(QO!h$TO!i#xO!k#yO!o$^O#j$PO#k$QO#l$QO#m$QO#n$SO#o$TO#p$TO#q$dO#r$TO#t$UO#v$WO#x$YO#y$ZO(XVO(i$[O(p#}O(q$OO~O!V(_X~PGbO!V(VO~O!V(lX!Y(lX!d(lX!j(lX(i(lX~O#[(lX#g#`X!Z(lX~PIhO#[(WO!V(nX!Y(nX~O!Y(XO!V(mX~O!V([O~O#[$fO~PIhO!Z(]O~P`O|#zO}#{O!P#|O!i#xO!k#yO(XVOP!maZ!man!ma!Y!ma!h!ma!o!ma#j!ma#k!ma#l!ma#m!ma#n!ma#o!ma#p!ma#q!ma#r!ma#t!ma#v!ma#x!ma#y!ma(i!ma(p!ma(q!ma~O`!ma'r!ma'p!ma!V!ma!j!mar!ma![!ma%c!ma!d!ma~PKOO!j(^O~O!d#vO#[(_O(i'lO!Y(kX`(kX'r(kX~O!j(kX~PMnO!P%fO![%gO!{]O#e(dO#f(cO'{%eO~O!Y(eO!j(jX~O!j(gO~O!P%fO![%gO#f(cO'{%eO~OP(^XZ(^Xn(^X|(^X}(^X!P(^X!Y(^X!h(^X!i(^X!k(^X!o(^X#j(^X#k(^X#l(^X#m(^X#n(^X#o(^X#p(^X#q(^X#r(^X#t(^X#v(^X#x(^X#y(^X(X(^X(i(^X(p(^X(q(^X~O!d#vO!j(^X~P! [O|(hO}(iO!i#xO!k#yO!{!za!P!za~O!w!za%b!za![!za#e!za#f!za'{!za~P!#`O!w(mO~OPYOQYORfOc!jOd!iOlkOnYOokOpkOvkOxYOzYO!PWO!TkO!UkO![XO!fuO!kZO!nYO!oYO!pYO!rvO!t!gO!w!hO$T!kO'{!dO'}TO(QUO(XVO(g[O(uiO~Og%WOl%XOn$uOo$tOp$tOv%YOx%ZOz;WO!P$|O![$}O!f<hO!k$yO#f;^O$T%_O$o;YO$q;[O$t%`O'{(qO'}TO(QUO(X$vO(p%OO(q%QO~O#g(sO~Og%WOl%XOn$uOo$tOp$tOv%YOx%ZOz%[O!P$|O![$}O!f%aO!k$yO#f%bO$T%_O$o%]O$q%^O$t%`O'{(qO'}TO(QUO(X$vO(p%OO(q%QO~Of(bP~P!(SO!X(wO!j(cP~P%[O([(yO(g[O~O!P({O!k#yO([(yO(g[O~OP:iOQ:iORfOc<dOd!iOlkOn:iOokOpkOvkOx:iOz:iO!PWO!TkO!UkO![!eO!f:lO!kZO!n:iO!o:iO!p:iO!r:mO!t:pO!w!hO$T!kO'{)ZO'}TO(QUO(XVO(g[O(u<bO~O})^O!k#yO~O!Y$bO`$ma'r$ma'p$ma!j$ma!V$ma![$ma%c$ma!d$ma~O#s)bO~P!&dO|)eO!d)dO![$ZX$W$ZX$Y$ZX$[$ZX$c$ZX~O!d)dO![(rX$W(rX$Y(rX$[(rX$c(rX~O|)eO~P!.OO|)eO![(rX$W(rX$Y(rX$[(rX$c(rX~O![)gO$W)kO$Y)fO$[)fO$c)lO~O!X)oO~P!*fO$Y$hO$[$gO$c)sO~Oj$uX|$uX!P$uX!i$uX(p$uX(q$uX~OfiXf$uXjiX!YiX#[iX~P!/tOo)uO~Ot)vO(Y)wO(Z)yO~Oj*SO|){O!P)|O(p%OO(q%QO~Of)zO~P!0}Of*TO~Og%WOl%XOn$uOo$tOp$tOv%YOx%ZOz;WO!P*VO![*WO!f<hO!k$yO#f;^O$T%_O$o;YO$q;[O$t%`O'}TO(QUO(X$vO(p%OO(q%QO~O!X*ZO'{*UO!j(vP~P!1lO#g*]O~O!k*^O~Og%WOl%XOn$uOo$tOp$tOv%YOx%ZOz;WO!P$|O![$}O!f<hO!k$yO#f;^O$T%_O$o;YO$q;[O$t%`O'{*`O'}TO(QUO(X$vO(p%OO(q%QO~O!X*cO!V(wP~P!3kOn*oO!P*gO!_*mO!`*fO!a*fO!k*^O#W*nO%Y*iO'|!lO([!mO~O!Z*lO~P!5`O!i#xOj(WX|(WX!P(WX(p(WX(q(WX!Y(WX#[(WX~Of(WX#|(WX~P!6XOj*tO#[*sOf(VX!Y(VX~O!Y*uOf(UX~O'{&VOf(UP~O!k*|O~O'{(qO~Ol+QO!P%fO!X#iO![%gO!{]O#e#lO#f#iO'{%eO!j(jP~O!d#vO#g+RO~O!P%fO!X+TO!Y(XO![%gO'{%eO!V(mP~Oo'WO!P+VO!X+UO'}TO(QUO([(yO~O!Z(oP~P!9SO!Y+WO`({X'r({X~OP$^OZ$eOn$RO|#zO}#{O!P#|O!h$TO!i#xO!k#yO!o$^O#j$PO#k$QO#l$QO#m$QO#n$SO#o$TO#p$TO#q$dO#r$TO#t$UO#v$WO#x$YO#y$ZO(XVO(i$[O(p#}O(q$OO~O`!ea!Y!ea'r!ea'p!ea!V!ea!j!ear!ea![!ea%c!ea!d!ea~P!9zO|#zO}#{O!P#|O!i#xO!k#yO(XVOP!qaZ!qan!qa!Y!qa!h!qa!o!qa#j!qa#k!qa#l!qa#m!qa#n!qa#o!qa#p!qa#q!qa#r!qa#t!qa#v!qa#x!qa#y!qa(i!qa(p!qa(q!qa~O`!qa'r!qa'p!qa!V!qa!j!qar!qa![!qa%c!qa!d!qa~P!<eO|#zO}#{O!P#|O!i#xO!k#yO(XVOP!saZ!san!sa!Y!sa!h!sa!o!sa#j!sa#k!sa#l!sa#m!sa#n!sa#o!sa#p!sa#q!sa#r!sa#t!sa#v!sa#x!sa#y!sa(i!sa(p!sa(q!sa~O`!sa'r!sa'p!sa!V!sa!j!sar!sa![!sa%c!sa!d!sa~P!?OOg%WOj+aO!['[O%c+`O~O!d+cO`(TX![(TX'r(TX!Y(TX~O`%lO![XO'r%lO~Og%WO!k%cO~Og%WO!k%cO'{%eO~O!d#vO#g(sO~Oa+nO%d+oO'{+kO'}TO(QUO!Z)PP~O!Y+pO_)OX~OZ+tO~O_+uO~O![%|O'{%eO'|!lO_)OP~Og%WO#[+zO~Og%WOj+}O![$}O~O![,PO~O|,RO![XO~O%h%sO~O!w,WO~Od,]O~Oa,^O'{#nO'}TO(QUO!Z(}P~Od%zO~O%d!QO'{&VO~P<}OZ,cO_,bO~OPYOQYORfOczOdyOlkOnYOokOpkOvkOxYOzYO!PWO!TkO!UkO!fuO!kZO!nYO!oYO!pYO!rvO!wxO!{]O%b}O'}TO(QUO(XVO(g[O(uiO~O![!eO!t!gO$T!kO'{!dO~P!FRO_,bO`%lO'r%lO~OPYOQYORfOc!jOd!iOlkOnYOokOpkOvkOxYOzYO!PWO!TkO!UkO![!eO!fuO!kZO!nYO!oYO!pYO!rvO!w!hO$T!kO'{!dO'}TO(QUO(XVO(g[O(uiO~O`,hO!twO#s!OO%f!OO%g!OO%h!OO~P!HkO!k&kO~O&V,nO~O![,pO~O&h,rO&j,sOP&eaQ&eaR&eaX&ea`&eac&ead&eal&ean&eao&eap&eav&eax&eaz&ea!P&ea!T&ea!U&ea![&ea!f&ea!k&ea!n&ea!o&ea!p&ea!r&ea!t&ea!w&ea!{&ea#s&ea$T&ea%b&ea%d&ea%f&ea%g&ea%h&ea%k&ea%m&ea%p&ea%q&ea%s&ea&P&ea&V&ea&X&ea&Z&ea&]&ea&`&ea&f&ea&l&ea&n&ea&p&ea&r&ea&t&ea'p&ea'{&ea'}&ea(Q&ea(X&ea(g&ea(u&ea!Z&ea&^&eaa&ea&c&ea~O'{,xO~Og!bX!Y!OX!Z!OX!d!OX!d!bX!k!bX#[!OX~O!Y!bX!Z!bX~P# qO!d,}O#[,|Og(aX!Y#dX!Y(aX!Z#dX!Z(aX!d(aX!k(aX~Og%WO!d-PO!k%cO!Y!^X!Z!^X~Oo!nO!P!oO'}TO(QUO([!mO~OP:iOQ:iORfOc<dOd!iOlkOn:iOokOpkOvkOx:iOz:iO!PWO!TkO!UkO![!eO!f:lO!kZO!n:iO!o:iO!p:iO!r:mO!t:pO!w!hO$T!kO'}TO(QUO(XVO(g[O(u<bO~O'{;dO~P##uO!Y-TO!Z(`X~O!Z-VO~O!d,}O#[,|O!Y#dX!Z#dX~O!Y-WO!Z(oX~O!Z-YO~O!`-ZO!a-ZO'|!lO~P##dO!Z-^O~P'_Oj-aO!['[O~O!V-fO~Oo!za!_!za!`!za!a!za#P!za#Q!za#R!za#S!za#T!za#W!za#X!za'|!za'}!za(Q!za([!za(g!za~P!#`O!o-kO#[-iO~PCOO!`-mO!a-mO'|!lO~PCnO`%lO#[-iO'r%lO~O`%lO!d#vO#[-iO'r%lO~O`%lO!d#vO!o-kO#[-iO'r%lO(i'lO~O'w'tO'x'tO'y-rO~Or-sO~O!V'Pa!Y'Pa~P!9zO!X-wO!V'PX!Y'PX~P%[O!Y(QO!V(_a~O!V(_a~PGbO!Y(XO!V(ma~O!P%fO!X-{O![%gO'{%eO!V'VX!Y'VX~O#[-}O!Y(ka!j(ka`(ka'r(ka~O!d#vO~P#+{O!Y(eO!j(ja~O!P%fO![%gO#f.RO'{%eO~Ol.WO!P%fO!X.TO![%gO!{]O#e.VO#f.TO'{%eO!Y'YX!j'YX~O}.[O!k#yO~Og%WOj._O!['[O%c.^O~O`#_i!Y#_i'r#_i'p#_i!V#_i!j#_ir#_i![#_i%c#_i!d#_i~P!9zOj<nO|){O!P)|O(p%OO(q%QO~O#g#Za`#Za#[#Za'r#Za!Y#Za!j#Za![#Za!V#Za~P#.wO#g(WXP(WXZ(WX`(WXn(WX}(WX!h(WX!k(WX!o(WX#j(WX#k(WX#l(WX#m(WX#n(WX#o(WX#p(WX#q(WX#r(WX#t(WX#v(WX#x(WX#y(WX'r(WX(X(WX(i(WX!j(WX!V(WX'p(WXr(WX![(WX%c(WX!d(WX~P!6XO!Y.lOf(bX~P!0}Of.nO~O!Y.oO!j(cX~P!9zO!j.rO~O!V.tO~OP$^O|#zO}#{O!P#|O!i#xO!k#yO!o$^O(XVOZ#ii`#iin#ii!Y#ii!h#ii#k#ii#l#ii#m#ii#n#ii#o#ii#p#ii#q#ii#r#ii#t#ii#v#ii#x#ii#y#ii'r#ii(i#ii(p#ii(q#ii'p#ii!V#ii!j#iir#ii![#ii%c#ii!d#ii~O#j#ii~P#2sO#j$PO~P#2sOP$^O|#zO}#{O!P#|O!i#xO!k#yO!o$^O#j$PO#k$QO#l$QO#m$QO(XVOZ#ii`#ii!Y#ii!h#ii#n#ii#o#ii#p#ii#q#ii#r#ii#t#ii#v#ii#x#ii#y#ii'r#ii(i#ii(p#ii(q#ii'p#ii!V#ii!j#iir#ii![#ii%c#ii!d#ii~On#ii~P#5eOn$RO~P#5eOP$^On$RO|#zO}#{O!P#|O!i#xO!k#yO!o$^O#j$PO#k$QO#l$QO#m$QO#n$SO(XVO`#ii!Y#ii#t#ii#v#ii#x#ii#y#ii'r#ii(i#ii(p#ii(q#ii'p#ii!V#ii!j#iir#ii![#ii%c#ii!d#ii~OZ#ii!h#ii#o#ii#p#ii#q#ii#r#ii~P#8VOZ$eO!h$TO#o$TO#p$TO#q$dO#r$TO~P#8VOP$^OZ$eOn$RO|#zO}#{O!P#|O!h$TO!i#xO!k#yO!o$^O#j$PO#k$QO#l$QO#m$QO#n$SO#o$TO#p$TO#q$dO#r$TO#t$UO(XVO(q$OO`#ii!Y#ii#x#ii#y#ii'r#ii(i#ii(p#ii'p#ii!V#ii!j#iir#ii![#ii%c#ii!d#ii~O#v$WO~P#;WO#v#ii~P#;WOP$^OZ$eOn$RO|#zO}#{O!P#|O!h$TO!i#xO!k#yO!o$^O#j$PO#k$QO#l$QO#m$QO#n$SO#o$TO#p$TO#q$dO#r$TO#t$UO(XVO`#ii!Y#ii#x#ii#y#ii'r#ii(i#ii'p#ii!V#ii!j#iir#ii![#ii%c#ii!d#ii~O#v#ii(p#ii(q#ii~P#=xO#v$WO(p#}O(q$OO~P#=xOP$^OZ$eOn$RO|#zO}#{O!P#|O!h$TO!i#xO!k#yO!o$^O#j$PO#k$QO#l$QO#m$QO#n$SO#o$TO#p$TO#q$dO#r$TO#t$UO#v$WO#x$YO(XVO(p#}O(q$OO~O`#ii!Y#ii#y#ii'r#ii(i#ii'p#ii!V#ii!j#iir#ii![#ii%c#ii!d#ii~P#@pOP[XZ[Xn[X|[X}[X!P[X!h[X!i[X!k[X!o[X#[[X#geX#j[X#k[X#l[X#m[X#n[X#o[X#p[X#q[X#r[X#t[X#v[X#x[X#y[X$O[X(X[X(i[X(p[X(q[X!Y[X!Z[X~O#|[X~P#CZOP$^OZ;QOn:tO|#zO}#{O!P#|O!h:vO!i#xO!k#yO!o$^O#j:rO#k:sO#l:sO#m:sO#n:uO#o:vO#p:vO#q;PO#r:vO#t:wO#v:yO#x:{O#y:|O(XVO(i$[O(p#}O(q$OO~O#|.vO~P#EhO#[;RO$O;RO#|(^X!Z(^X~P! [O`']a!Y']a'r']a'p']a!j']a!V']ar']a![']a%c']a!d']a~P!9zOP#iiZ#ii`#iin#ii}#ii!Y#ii!h#ii!i#ii!k#ii!o#ii#j#ii#k#ii#l#ii#m#ii#n#ii#o#ii#p#ii#q#ii#r#ii#t#ii#v#ii#x#ii#y#ii'r#ii(X#ii(i#ii'p#ii!V#ii!j#iir#ii![#ii%c#ii!d#ii~P#.wO`#}i!Y#}i'r#}i'p#}i!V#}i!j#}ir#}i![#}i%c#}i!d#}i~P!9zO$Y.{O$[.{O~O$Y.|O$[.|O~O!d)dO#[.}O![$`X$W$`X$Y$`X$[$`X$c$`X~O!X/OO~O![)gO$W/QO$Y)fO$[)fO$c/RO~O!Y:}O!Z(]X~P#EhO!Z/SO~O!d)dO$c(rX~O$c/UO~Ot)vO(Y)wO(Z/XO~O!V/]O~P!&dO(p%OOj%Za|%Za!P%Za(q%Za!Y%Za#[%Za~Of%Za#|%Za~P#MxO(q%QOj%]a|%]a!P%]a(p%]a!Y%]a#[%]a~Of%]a#|%]a~P#NkO!YeX!deX!jeX!j$uX(ieX~P!/tO!X/fO!Y(XO'{/eO!V(mP!V(wP~P!1lOn*oO!_*mO!`*fO!a*fO!k*^O#W*nO%Y*iO'|!lO~Oo'WO!P/gO!X+UO!Z*lO'}TO(QUO([;aO!Z(oP~P$!UO!j/hO~P#.wO!Y/iO!d#vO(i'lO!j(vX~O!j/nO~O!P%fO!X*ZO![%gO'{%eO!j(vP~O#g/pO~O!V$uX!Y$uX!d$|X~P!/tO!Y/qO!V(wX~P#.wO!d/sO~O!V/uO~Og%WOn/yO!d#vO!k%cO(i'lO~O'{/{O~O!d+cO~O`%lO!Y0PO'r%lO~O!Z0RO~P!5`O!`0SO!a0SO'|!lO([!mO~O!P0UO([!mO~O#W0VO~Of%Za!Y%Za#[%Za#|%Za~P!0}Of%]a!Y%]a#[%]a#|%]a~P!0}O'{&VOf'fX!Y'fX~O!Y*uOf(Ua~Of0`O~O|0aO}0aO!P0bOjya(pya(qya!Yya#[ya~Ofya#|ya~P$'wO|){O!P)|Oj$na(p$na(q$na!Y$na#[$na~Of$na#|$na~P$(mO|){O!P)|Oj$pa(p$pa(q$pa!Y$pa#[$pa~Of$pa#|$pa~P$)`O#g0dO~Of%Oa!Y%Oa#[%Oa#|%Oa~P!0}O!d#vO~O#g0gO~O!Y+WO`({a'r({a~O|#zO}#{O!P#|O!i#xO!k#yO(XVOP!qiZ!qin!qi!Y!qi!h!qi!o!qi#j!qi#k!qi#l!qi#m!qi#n!qi#o!qi#p!qi#q!qi#r!qi#t!qi#v!qi#x!qi#y!qi(i!qi(p!qi(q!qi~O`!qi'r!qi'p!qi!V!qi!j!qir!qi![!qi%c!qi!d!qi~P$*}Og%WOn$uOo$tOp$tOv%YOx%ZOz;WO!P$|O![$}O!f<hO!k$yO#f;^O$T%_O$o;YO$q;[O$t%`O'}TO(QUO(X$vO(p%OO(q%QO~Ol0qO'{0pO~P$-hO!d+cO`(Ta![(Ta'r(Ta!Y(Ta~O#g0wO~OZ[X!YeX!ZeX~O!Y0xO!Z)PX~O!Z0zO~OZ0{O~Oa0}O'{+kO'}TO(QUO~O![%|O'{%eO_'nX!Y'nX~O!Y+pO_)Oa~O!j1QO~P!9zOZ1TO~O_1UO~O#[1XO~Oj1[O![$}O~O([(yO!Z(|P~Og%WOj1eO![1bO%c1dO~OZ1oO!Y1mO!Z(}X~O!Z1pO~O_1rO`%lO'r%lO~O'{#nO'}TO(QUO~O#[$fO$O$fOP(^XZ(^Xn(^X|(^X}(^X!P(^X!Y(^X!h(^X!k(^X!o(^X#j(^X#k(^X#l(^X#m(^X#n(^X#o(^X#p(^X#q(^X#t(^X#v(^X#x(^X#y(^X(X(^X(i(^X(p(^X(q(^X~O#r1uO&T1vO`(^X!i(^X~P$3OO#[$fO#r1uO&T1vO~O`1xO~P%[O`1zO~O&^1}OP&[iQ&[iR&[iX&[i`&[ic&[id&[il&[in&[io&[ip&[iv&[ix&[iz&[i!P&[i!T&[i!U&[i![&[i!f&[i!k&[i!n&[i!o&[i!p&[i!r&[i!t&[i!w&[i!{&[i#s&[i$T&[i%b&[i%d&[i%f&[i%g&[i%h&[i%k&[i%m&[i%p&[i%q&[i%s&[i&P&[i&V&[i&X&[i&Z&[i&]&[i&`&[i&f&[i&l&[i&n&[i&p&[i&r&[i&t&[i'p&[i'{&[i'}&[i(Q&[i(X&[i(g&[i(u&[i!Z&[ia&[i&c&[i~Oa2TO!Z2RO&c2SO~P`O![XO!k2VO~O&j,sOP&eiQ&eiR&eiX&ei`&eic&eid&eil&ein&eio&eip&eiv&eix&eiz&ei!P&ei!T&ei!U&ei![&ei!f&ei!k&ei!n&ei!o&ei!p&ei!r&ei!t&ei!w&ei!{&ei#s&ei$T&ei%b&ei%d&ei%f&ei%g&ei%h&ei%k&ei%m&ei%p&ei%q&ei%s&ei&P&ei&V&ei&X&ei&Z&ei&]&ei&`&ei&f&ei&l&ei&n&ei&p&ei&r&ei&t&ei'p&ei'{&ei'}&ei(Q&ei(X&ei(g&ei(u&ei!Z&ei&^&eia&ei&c&ei~O!V2]O~O!Y!^a!Z!^a~P#EhOo!nO!P!oO!X2cO([!mO!Y'QX!Z'QX~P@UO!Y-TO!Z(`a~O!Y'WX!Z'WX~P!9SO!Y-WO!Z(oa~O!Z2jO~P'_O`%lO#[2sO'r%lO~O`%lO!d#vO#[2sO'r%lO~O`%lO!d#vO!o2wO#[2sO'r%lO(i'lO~O`%lO'r%lO~P!9zO!Y$bOr$ma~O!V'Pi!Y'Pi~P!9zO!Y(QO!V(_i~O!Y(XO!V(mi~O!V(ni!Y(ni~P!9zO!Y(ki!j(ki`(ki'r(ki~P!9zO#[2yO!Y(ki!j(ki`(ki'r(ki~O!Y(eO!j(ji~O!P%fO![%gO!{]O#e3OO#f2}O'{%eO~O!P%fO![%gO#f2}O'{%eO~Oj3VO!['[O%c3UO~Og%WOj3VO!['[O%c3UO~O#g%ZaP%ZaZ%Za`%Zan%Za}%Za!h%Za!i%Za!k%Za!o%Za#j%Za#k%Za#l%Za#m%Za#n%Za#o%Za#p%Za#q%Za#r%Za#t%Za#v%Za#x%Za#y%Za'r%Za(X%Za(i%Za!j%Za!V%Za'p%Zar%Za![%Za%c%Za!d%Za~P#MxO#g%]aP%]aZ%]a`%]an%]a}%]a!h%]a!i%]a!k%]a!o%]a#j%]a#k%]a#l%]a#m%]a#n%]a#o%]a#p%]a#q%]a#r%]a#t%]a#v%]a#x%]a#y%]a'r%]a(X%]a(i%]a!j%]a!V%]a'p%]ar%]a![%]a%c%]a!d%]a~P#NkO#g%ZaP%ZaZ%Za`%Zan%Za}%Za!Y%Za!h%Za!i%Za!k%Za!o%Za#j%Za#k%Za#l%Za#m%Za#n%Za#o%Za#p%Za#q%Za#r%Za#t%Za#v%Za#x%Za#y%Za'r%Za(X%Za(i%Za!j%Za!V%Za'p%Za#[%Zar%Za![%Za%c%Za!d%Za~P#.wO#g%]aP%]aZ%]a`%]an%]a}%]a!Y%]a!h%]a!i%]a!k%]a!o%]a#j%]a#k%]a#l%]a#m%]a#n%]a#o%]a#p%]a#q%]a#r%]a#t%]a#v%]a#x%]a#y%]a'r%]a(X%]a(i%]a!j%]a!V%]a'p%]a#[%]ar%]a![%]a%c%]a!d%]a~P#.wO#gyaPyaZya`yanya!hya!iya!kya!oya#jya#kya#lya#mya#nya#oya#pya#qya#rya#tya#vya#xya#yya'rya(Xya(iya!jya!Vya'pyarya![ya%cya!dya~P$'wO#g$naP$naZ$na`$nan$na}$na!h$na!i$na!k$na!o$na#j$na#k$na#l$na#m$na#n$na#o$na#p$na#q$na#r$na#t$na#v$na#x$na#y$na'r$na(X$na(i$na!j$na!V$na'p$nar$na![$na%c$na!d$na~P$(mO#g$paP$paZ$pa`$pan$pa}$pa!h$pa!i$pa!k$pa!o$pa#j$pa#k$pa#l$pa#m$pa#n$pa#o$pa#p$pa#q$pa#r$pa#t$pa#v$pa#x$pa#y$pa'r$pa(X$pa(i$pa!j$pa!V$pa'p$par$pa![$pa%c$pa!d$pa~P$)`O#g%OaP%OaZ%Oa`%Oan%Oa}%Oa!Y%Oa!h%Oa!i%Oa!k%Oa!o%Oa#j%Oa#k%Oa#l%Oa#m%Oa#n%Oa#o%Oa#p%Oa#q%Oa#r%Oa#t%Oa#v%Oa#x%Oa#y%Oa'r%Oa(X%Oa(i%Oa!j%Oa!V%Oa'p%Oa#[%Oar%Oa![%Oa%c%Oa!d%Oa~P#.wO`#_q!Y#_q'r#_q'p#_q!V#_q!j#_qr#_q![#_q%c#_q!d#_q~P!9zOf'RX!Y'RX~P!(SO!Y.lOf(ba~O!X3aO!Y'SX!j'SX~P%[O!Y.oO!j(ca~O!Y.oO!j(ca~P!9zO!V3dO~O#|!ma!Z!ma~PKOO#|!ea!Y!ea!Z!ea~P#EhO#|!qa!Z!qa~P!<eO#|!sa!Z!sa~P!?OORfO![3vO$a3wO~O!Z3{O~Or3|O~P#.wO`$jq!Y$jq'r$jq'p$jq!V$jq!j$jqr$jq![$jq%c$jq!d$jq~P!9zO!V3}O~P#.wO|){O!P)|O(q%QOj'ba(p'ba!Y'ba#['ba~Of'ba#|'ba~P%,rO|){O!P)|Oj'da(p'da(q'da!Y'da#['da~Of'da#|'da~P%-eO(i$[O~P#.wO!VeX!V$uX!YeX!Y$uX!d$|X#[eX~P!/tO'{;jO~P!1lOlkO'{4PO~P.iO!P%fO!X4RO![%gO'{%eO!Y'^X!j'^X~O!Y/iO!j(va~O!Y/iO!d#vO!j(va~O!Y/iO!d#vO(i'lO!j(va~Of$wi!Y$wi#[$wi#|$wi~P!0}O!X4ZO!V'`X!Y'`X~P!3kO!Y/qO!V(wa~O!Y/qO!V(wa~P#.wO!d#vO#r4cO~On4fO!d#vO(i'lO~O(p%OOj%Zi|%Zi!P%Zi(q%Zi!Y%Zi#[%Zi~Of%Zi#|%Zi~P%1sO(q%QOj%]i|%]i!P%]i(p%]i!Y%]i#[%]i~Of%]i#|%]i~P%2fOf(Vi!Y(Vi~P!0}O#[4mOf(Vi!Y(Vi~P!0}O!j4pO~O`$kq!Y$kq'r$kq'p$kq!V$kq!j$kqr$kq![$kq%c$kq!d$kq~P!9zO!V4tO~O!Y4uO![(xX~P#.wO!i#xO~P4XO`$uX![$uX%W[X'r$uX!Y$uX~P!/tO%W4wO`kXjkX|kX!PkX![kX'rkX(pkX(qkX!YkX~O%W4wO~Oa4}O%d5OO'{+kO'}TO(QUO!Y'mX!Z'mX~O!Y0xO!Z)Pa~OZ5SO~O_5TO~O`%lO'r%lO~P#.wO![$}O~P#.wO!Y5]O#[5_O!Z(|X~O!Z5`O~Oo!nO!P5aO!_!yO!`!vO!a!vO!{:jO#P!pO#Q!pO#R!pO#S!pO#T!pO#W5fO#X!zO'|!lO'}TO(QUO([!mO(g!sO~O!Z5eO~P%7wOj5kO![1bO%c5jO~Og%WOj5kO![1bO%c5jO~Oa5rO'{#nO'}TO(QUO!Y'lX!Z'lX~O!Y1mO!Z(}a~O'}TO(QUO([5tO~O_5xO~O#r5{O&T5|O~PMnO!j5}O~P%[O`6PO~O`6PO~P%[Oa2TO!Z6UO&c2SO~P`O!d6WO~O!d6YOg(ai!Y(ai!Z(ai!d(ai!k(ai~O!Y#di!Z#di~P#EhO#[6ZO!Y#di!Z#di~O!Y!^i!Z!^i~P#EhO`%lO#[6dO'r%lO~O`%lO!d#vO#[6dO'r%lO~O!Y(kq!j(kq`(kq'r(kq~P!9zO!Y(eO!j(jq~O!P%fO![%gO#f6kO'{%eO~O!['[O%c6nO~Oj6qO!['[O%c6nO~O#g'baP'baZ'ba`'ban'ba}'ba!h'ba!i'ba!k'ba!o'ba#j'ba#k'ba#l'ba#m'ba#n'ba#o'ba#p'ba#q'ba#r'ba#t'ba#v'ba#x'ba#y'ba'r'ba(X'ba(i'ba!j'ba!V'ba'p'bar'ba!['ba%c'ba!d'ba~P%,rO#g'daP'daZ'da`'dan'da}'da!h'da!i'da!k'da!o'da#j'da#k'da#l'da#m'da#n'da#o'da#p'da#q'da#r'da#t'da#v'da#x'da#y'da'r'da(X'da(i'da!j'da!V'da'p'dar'da!['da%c'da!d'da~P%-eO#g$wiP$wiZ$wi`$win$wi}$wi!Y$wi!h$wi!i$wi!k$wi!o$wi#j$wi#k$wi#l$wi#m$wi#n$wi#o$wi#p$wi#q$wi#r$wi#t$wi#v$wi#x$wi#y$wi'r$wi(X$wi(i$wi!j$wi!V$wi'p$wi#[$wir$wi![$wi%c$wi!d$wi~P#.wO#g%ZiP%ZiZ%Zi`%Zin%Zi}%Zi!h%Zi!i%Zi!k%Zi!o%Zi#j%Zi#k%Zi#l%Zi#m%Zi#n%Zi#o%Zi#p%Zi#q%Zi#r%Zi#t%Zi#v%Zi#x%Zi#y%Zi'r%Zi(X%Zi(i%Zi!j%Zi!V%Zi'p%Zir%Zi![%Zi%c%Zi!d%Zi~P%1sO#g%]iP%]iZ%]i`%]in%]i}%]i!h%]i!i%]i!k%]i!o%]i#j%]i#k%]i#l%]i#m%]i#n%]i#o%]i#p%]i#q%]i#r%]i#t%]i#v%]i#x%]i#y%]i'r%]i(X%]i(i%]i!j%]i!V%]i'p%]ir%]i![%]i%c%]i!d%]i~P%2fOf'Ra!Y'Ra~P!0}O!Y'Sa!j'Sa~P!9zO!Y.oO!j(ci~O#|#_i!Y#_i!Z#_i~P#EhOP$^O|#zO}#{O!P#|O!i#xO!k#yO!o$^O(XVOZ#iin#ii!h#ii#k#ii#l#ii#m#ii#n#ii#o#ii#p#ii#q#ii#r#ii#t#ii#v#ii#x#ii#y#ii#|#ii(i#ii(p#ii(q#ii!Y#ii!Z#ii~O#j#ii~P%JwO#j:rO~P%JwOP$^O|#zO}#{O!P#|O!i#xO!k#yO!o$^O#j:rO#k:sO#l:sO#m:sO(XVOZ#ii!h#ii#n#ii#o#ii#p#ii#q#ii#r#ii#t#ii#v#ii#x#ii#y#ii#|#ii(i#ii(p#ii(q#ii!Y#ii!Z#ii~On#ii~P%MSOn:tO~P%MSOP$^On:tO|#zO}#{O!P#|O!i#xO!k#yO!o$^O#j:rO#k:sO#l:sO#m:sO#n:uO(XVO#t#ii#v#ii#x#ii#y#ii#|#ii(i#ii(p#ii(q#ii!Y#ii!Z#ii~OZ#ii!h#ii#o#ii#p#ii#q#ii#r#ii~P& _OZ;QO!h:vO#o:vO#p:vO#q;PO#r:vO~P& _OP$^OZ;QOn:tO|#zO}#{O!P#|O!h:vO!i#xO!k#yO!o$^O#j:rO#k:sO#l:sO#m:sO#n:uO#o:vO#p:vO#q;PO#r:vO#t:wO(XVO(q$OO#x#ii#y#ii#|#ii(i#ii(p#ii!Y#ii!Z#ii~O#v:yO~P&#yO#v#ii~P&#yOP$^OZ;QOn:tO|#zO}#{O!P#|O!h:vO!i#xO!k#yO!o$^O#j:rO#k:sO#l:sO#m:sO#n:uO#o:vO#p:vO#q;PO#r:vO#t:wO(XVO#x#ii#y#ii#|#ii(i#ii!Y#ii!Z#ii~O#v#ii(p#ii(q#ii~P&&UO#v:yO(p#}O(q$OO~P&&UOP$^OZ;QOn:tO|#zO}#{O!P#|O!h:vO!i#xO!k#yO!o$^O#j:rO#k:sO#l:sO#m:sO#n:uO#o:vO#p:vO#q;PO#r:vO#t:wO#v:yO#x:{O(XVO(p#}O(q$OO~O#y#ii#|#ii(i#ii!Y#ii!Z#ii~P&(gO`#zy!Y#zy'r#zy'p#zy!V#zy!j#zyr#zy![#zy%c#zy!d#zy~P!9zOj<oO|){O!P)|O(p%OO(q%QO~OP#iiZ#iin#ii}#ii!h#ii!i#ii!k#ii!o#ii#j#ii#k#ii#l#ii#m#ii#n#ii#o#ii#p#ii#q#ii#r#ii#t#ii#v#ii#x#ii#y#ii#|#ii(X#ii(i#ii!Y#ii!Z#ii~P&+_O!i#xOP(WXZ(WXj(WXn(WX|(WX}(WX!P(WX!h(WX!k(WX!o(WX#j(WX#k(WX#l(WX#m(WX#n(WX#o(WX#p(WX#q(WX#r(WX#t(WX#v(WX#x(WX#y(WX#|(WX(X(WX(i(WX(p(WX(q(WX!Y(WX!Z(WX~O#|#}i!Y#}i!Z#}i~P#EhO#|!qi!Z!qi~P$*}O!Z7TO~O!Y']a!Z']a~P#EhOP[XZ[Xn[X|[X}[X!P[X!V[X!Y[X!h[X!i[X!k[X!o[X#[[X#geX#j[X#k[X#l[X#m[X#n[X#o[X#p[X#q[X#r[X#t[X#v[X#x[X#y[X$O[X(X[X(i[X(p[X(q[X~O!d%TX#r%TX~P&0aO!d#vO(i'lO!Y'^a!j'^a~O!Y/iO!j(vi~O!Y/iO!d#vO!j(vi~Of$wq!Y$wq#[$wq#|$wq~P!0}O!V'`a!Y'`a~P#.wO!d7[O~O!Y/qO!V(wi~P#.wO!Y/qO!V(wi~O!V7`O~O!d#vO#r7eO~On7fO!d#vO(i'lO~O|){O!P)|O(q%QOj'ca(p'ca!Y'ca#['ca~Of'ca#|'ca~P&5PO|){O!P)|Oj'ea(p'ea(q'ea!Y'ea#['ea~Of'ea#|'ea~P&5rO!V7hO~Of$yq!Y$yq#[$yq#|$yq~P!0}O`$ky!Y$ky'r$ky'p$ky!V$ky!j$kyr$ky![$ky%c$ky!d$ky~P!9zO!d6YO~O!Y4uO![(xa~O`#_y!Y#_y'r#_y'p#_y!V#_y!j#_yr#_y![#_y%c#_y!d#_y~P!9zOZ7mO~Oa7oO'{+kO'}TO(QUO~O!Y0xO!Z)Pi~O_7sO~O([(yO!Y'iX!Z'iX~O!Y5]O!Z(|a~O!Z7|O~P%7wOo!nO!P7}O'}TO(QUO([!mO(g!sO~O![1bO~O![1bO%c8PO~Oj8SO![1bO%c8PO~OZ8XO!Y'la!Z'la~O!Y1mO!Z(}i~O!j8]O~O!j8^O~O!j8aO~O!j8aO~P%[O`8cO~O!d8dO~O!j8eO~O!Y(ni!Z(ni~P#EhO`%lO#[8mO'r%lO~O!Y(ky!j(ky`(ky'r(ky~P!9zO!Y(eO!j(jy~O!['[O%c8pO~O#g$wqP$wqZ$wq`$wqn$wq}$wq!Y$wq!h$wq!i$wq!k$wq!o$wq#j$wq#k$wq#l$wq#m$wq#n$wq#o$wq#p$wq#q$wq#r$wq#t$wq#v$wq#x$wq#y$wq'r$wq(X$wq(i$wq!j$wq!V$wq'p$wq#[$wqr$wq![$wq%c$wq!d$wq~P#.wO#g'caP'caZ'ca`'can'ca}'ca!h'ca!i'ca!k'ca!o'ca#j'ca#k'ca#l'ca#m'ca#n'ca#o'ca#p'ca#q'ca#r'ca#t'ca#v'ca#x'ca#y'ca'r'ca(X'ca(i'ca!j'ca!V'ca'p'car'ca!['ca%c'ca!d'ca~P&5PO#g'eaP'eaZ'ea`'ean'ea}'ea!h'ea!i'ea!k'ea!o'ea#j'ea#k'ea#l'ea#m'ea#n'ea#o'ea#p'ea#q'ea#r'ea#t'ea#v'ea#x'ea#y'ea'r'ea(X'ea(i'ea!j'ea!V'ea'p'ear'ea!['ea%c'ea!d'ea~P&5rO#g$yqP$yqZ$yq`$yqn$yq}$yq!Y$yq!h$yq!i$yq!k$yq!o$yq#j$yq#k$yq#l$yq#m$yq#n$yq#o$yq#p$yq#q$yq#r$yq#t$yq#v$yq#x$yq#y$yq'r$yq(X$yq(i$yq!j$yq!V$yq'p$yq#[$yqr$yq![$yq%c$yq!d$yq~P#.wO!Y'Si!j'Si~P!9zO#|#_q!Y#_q!Z#_q~P#EhO(p%OOP%ZaZ%Zan%Za}%Za!h%Za!i%Za!k%Za!o%Za#j%Za#k%Za#l%Za#m%Za#n%Za#o%Za#p%Za#q%Za#r%Za#t%Za#v%Za#x%Za#y%Za#|%Za(X%Za(i%Za!Y%Za!Z%Za~Oj%Za|%Za!P%Za(q%Za~P&F}O(q%QOP%]aZ%]an%]a}%]a!h%]a!i%]a!k%]a!o%]a#j%]a#k%]a#l%]a#m%]a#n%]a#o%]a#p%]a#q%]a#r%]a#t%]a#v%]a#x%]a#y%]a#|%]a(X%]a(i%]a!Y%]a!Z%]a~Oj%]a|%]a!P%]a(p%]a~P&IUOj<oO|){O!P)|O(q%QO~P&F}Oj<oO|){O!P)|O(p%OO~P&IUO|0aO}0aO!P0bOPyaZyajyanya!hya!iya!kya!oya#jya#kya#lya#mya#nya#oya#pya#qya#rya#tya#vya#xya#yya#|ya(Xya(iya(pya(qya!Yya!Zya~O|){O!P)|OP$naZ$naj$nan$na}$na!h$na!i$na!k$na!o$na#j$na#k$na#l$na#m$na#n$na#o$na#p$na#q$na#r$na#t$na#v$na#x$na#y$na#|$na(X$na(i$na(p$na(q$na!Y$na!Z$na~O|){O!P)|OP$paZ$paj$pan$pa}$pa!h$pa!i$pa!k$pa!o$pa#j$pa#k$pa#l$pa#m$pa#n$pa#o$pa#p$pa#q$pa#r$pa#t$pa#v$pa#x$pa#y$pa#|$pa(X$pa(i$pa(p$pa(q$pa!Y$pa!Z$pa~OP%OaZ%Oan%Oa}%Oa!h%Oa!i%Oa!k%Oa!o%Oa#j%Oa#k%Oa#l%Oa#m%Oa#n%Oa#o%Oa#p%Oa#q%Oa#r%Oa#t%Oa#v%Oa#x%Oa#y%Oa#|%Oa(X%Oa(i%Oa!Y%Oa!Z%Oa~P&+_O#|$jq!Y$jq!Z$jq~P#EhO#|$kq!Y$kq!Z$kq~P#EhO!Z8|O~O#|8}O~P!0}O!d#vO!Y'^i!j'^i~O!d#vO(i'lO!Y'^i!j'^i~O!Y/iO!j(vq~O!V'`i!Y'`i~P#.wO!Y/qO!V(wq~O!V9TO~P#.wO!V9TO~Of(Vy!Y(Vy~P!0}O!Y'ga!['ga~P#.wO`%Vq![%Vq'r%Vq!Y%Vq~P#.wOZ9YO~O!Y0xO!Z)Pq~O#[9^O!Y'ia!Z'ia~O!Y5]O!Z(|i~P#EhO![1bO%c9bO~O'}TO(QUO([9gO~O!Y1mO!Z(}q~O!j9jO~O!j9kO~O!j9lO~O!j9lO~P%[O#[9oO!Y#dy!Z#dy~O!Y#dy!Z#dy~P#EhO!['[O%c9tO~O#|#zy!Y#zy!Z#zy~P#EhOP$wiZ$win$wi}$wi!h$wi!i$wi!k$wi!o$wi#j$wi#k$wi#l$wi#m$wi#n$wi#o$wi#p$wi#q$wi#r$wi#t$wi#v$wi#x$wi#y$wi#|$wi(X$wi(i$wi!Y$wi!Z$wi~P&+_O|){O!P)|O(q%QOP'baZ'baj'ban'ba}'ba!h'ba!i'ba!k'ba!o'ba#j'ba#k'ba#l'ba#m'ba#n'ba#o'ba#p'ba#q'ba#r'ba#t'ba#v'ba#x'ba#y'ba#|'ba(X'ba(i'ba(p'ba!Y'ba!Z'ba~O|){O!P)|OP'daZ'daj'dan'da}'da!h'da!i'da!k'da!o'da#j'da#k'da#l'da#m'da#n'da#o'da#p'da#q'da#r'da#t'da#v'da#x'da#y'da#|'da(X'da(i'da(p'da(q'da!Y'da!Z'da~O(p%OOP%ZiZ%Zij%Zin%Zi|%Zi}%Zi!P%Zi!h%Zi!i%Zi!k%Zi!o%Zi#j%Zi#k%Zi#l%Zi#m%Zi#n%Zi#o%Zi#p%Zi#q%Zi#r%Zi#t%Zi#v%Zi#x%Zi#y%Zi#|%Zi(X%Zi(i%Zi(q%Zi!Y%Zi!Z%Zi~O(q%QOP%]iZ%]ij%]in%]i|%]i}%]i!P%]i!h%]i!i%]i!k%]i!o%]i#j%]i#k%]i#l%]i#m%]i#n%]i#o%]i#p%]i#q%]i#r%]i#t%]i#v%]i#x%]i#y%]i#|%]i(X%]i(i%]i(p%]i!Y%]i!Z%]i~O#|$ky!Y$ky!Z$ky~P#EhO#|#_y!Y#_y!Z#_y~P#EhO!d#vO!Y'^q!j'^q~O!Y/iO!j(vy~O!V'`q!Y'`q~P#.wO!V9}O~P#.wO!Y0xO!Z)Py~O!Y5]O!Z(|q~O![1bO%c:UO~O!j:XO~O!['[O%c:^O~OP$wqZ$wqn$wq}$wq!h$wq!i$wq!k$wq!o$wq#j$wq#k$wq#l$wq#m$wq#n$wq#o$wq#p$wq#q$wq#r$wq#t$wq#v$wq#x$wq#y$wq#|$wq(X$wq(i$wq!Y$wq!Z$wq~P&+_O|){O!P)|O(q%QOP'caZ'caj'can'ca}'ca!h'ca!i'ca!k'ca!o'ca#j'ca#k'ca#l'ca#m'ca#n'ca#o'ca#p'ca#q'ca#r'ca#t'ca#v'ca#x'ca#y'ca#|'ca(X'ca(i'ca(p'ca!Y'ca!Z'ca~O|){O!P)|OP'eaZ'eaj'ean'ea}'ea!h'ea!i'ea!k'ea!o'ea#j'ea#k'ea#l'ea#m'ea#n'ea#o'ea#p'ea#q'ea#r'ea#t'ea#v'ea#x'ea#y'ea#|'ea(X'ea(i'ea(p'ea(q'ea!Y'ea!Z'ea~OP$yqZ$yqn$yq}$yq!h$yq!i$yq!k$yq!o$yq#j$yq#k$yq#l$yq#m$yq#n$yq#o$yq#p$yq#q$yq#r$yq#t$yq#v$yq#x$yq#y$yq#|$yq(X$yq(i$yq!Y$yq!Z$yq~P&+_Of%_!Z!Y%_!Z#[%_!Z#|%_!Z~P!0}O!Y'iq!Z'iq~P#EhO!Y#d!Z!Z#d!Z~P#EhO#g%_!ZP%_!ZZ%_!Z`%_!Zn%_!Z}%_!Z!Y%_!Z!h%_!Z!i%_!Z!k%_!Z!o%_!Z#j%_!Z#k%_!Z#l%_!Z#m%_!Z#n%_!Z#o%_!Z#p%_!Z#q%_!Z#r%_!Z#t%_!Z#v%_!Z#x%_!Z#y%_!Z'r%_!Z(X%_!Z(i%_!Z!j%_!Z!V%_!Z'p%_!Z#[%_!Zr%_!Z![%_!Z%c%_!Z!d%_!Z~P#.wOP%_!ZZ%_!Zn%_!Z}%_!Z!h%_!Z!i%_!Z!k%_!Z!o%_!Z#j%_!Z#k%_!Z#l%_!Z#m%_!Z#n%_!Z#o%_!Z#p%_!Z#q%_!Z#r%_!Z#t%_!Z#v%_!Z#x%_!Z#y%_!Z#|%_!Z(X%_!Z(i%_!Z!Y%_!Z!Z%_!Z~P&+_Or(]X~P1qO'|!lO~P!*fO!VeX!YeX#[eX~P&0aOP[XZ[Xn[X|[X}[X!P[X!Y[X!YeX!h[X!i[X!k[X!o[X#[[X#[eX#geX#j[X#k[X#l[X#m[X#n[X#o[X#p[X#q[X#r[X#t[X#v[X#x[X#y[X$O[X(X[X(i[X(p[X(q[X~O!deX!j[X!jeX(ieX~P'EROP:iOQ:iORfOc<dOd!iOlkOn:iOokOpkOvkOx:iOz:iO!PWO!TkO!UkO![XO!f:lO!kZO!n:iO!o:iO!p:iO!r:mO!t:pO!w!hO$T!kO'{)ZO'}TO(QUO(XVO(g[O(u<bO~O!Y:}O!Z$ma~Og%WOl%XOn$uOo$tOp$tOv%YOx%ZOz;XO!P$|O![$}O!f<iO!k$yO#f;_O$T%_O$o;ZO$q;]O$t%`O'{(qO'}TO(QUO(X$vO(p%OO(q%QO~O#s)bO~P'IwOn!bX(i!bX~P# qO!Z[X!ZeX~P'ERO!VeX!V$uX!YeX!Y$uX#[eX~P!/tO#g:qO~O!d#vO#g:qO~O#[;RO~O#r:vO~O#[;bO!Y(nX!Z(nX~O#[;RO!Y(lX!Z(lX~O#g;cO~Of;eO~P!0}O#g;kO~O#g;lO~O!d#vO#g;mO~O!d#vO#g;cO~O#|;nO~P#EhO#g;oO~O#g;pO~O#g;uO~O#g;vO~O#g;wO~O#g;xO~O#|;yO~P!0}O#|;zO~P!0}O!i#P#Q#S#T#W#e#f#q(u$o$q$t%W%b%c%d%k%m%p%q%s%u~'vS#k!U't'|#lo#j#mn|'u$Y'u'{$[([~",goto:"$4`)TPPPPP)UPP)XP)jP*z/PPPPP5wPP6_PP<U?kP@OP@OPPP@OPBOP@OP@OP@OPBSPPBXPBsPGlPPPGpPPPPGpJrPPPJxKtPGpPNSPPPP!!bGpPPPGpPGpP!$pGpP!(V!)X!)bP!*U!*Y!*UPPPPP!-f!)XPP!-v!.pP!1dGpGp!1i!4t!9[!9[!=YPPP!=bGpPPPPPPPPPPP!@pP!A}PPGp!C`PGpPGpGpGpGpPGp!DrP!G{P!KQP!KU!K`!Kd!KdP!GxP!Kh!KhP!NmP!NqGpGp!Nw##{@OP@OP@O@OP#%X@O@O#'c@O#*R@O#,V@O@O#,u#/R#/R#/W#/a#/R#/jP#/RP@O#0S@O#3s@O@O5wPPP#7jPPP#8T#8TP#8TP#8k#8TPP#8qP#8hP#8h#9U#8h#9p#9v5t)X#9y)XP#:Q#:Q#:QP)XP)XP)XP)XPP)XP#:W#:ZP#:Z)XP#:_P#:bP)XP)XP)XP)XP)XP)X)XPP#:h#:n#:y#;P#;V#;]#;c#;q#;w#;}#<X#<_#<i#<y#=P#=q#>T#>Z#>a#>o#?U#@s#AR#AY#Bn#B|#Dh#Dv#D|#ES#EY#Ed#Ej#Ep#Ez#F^#FdPPPPPPPPPP#FjPPPPPPP#G_#Jf#Ku#K|#LUPPPP$#[$&S$,l$,o$,r$-_$-b$-e$-l$-tP$-zP$.h$.l$/d$0r$0w$1_PP$1d$1j$1nP$1q$1u$1y$2o$3W$3o$3s$3v$3y$4P$4S$4W$4[R!|RoqOXst!Z#d%k&n&p&q&s,k,p1}2QY!vQ'[-]1b5dQ%qvQ%yyQ&Q|Q&f!VS'S!e-TQ'b!iS'h!r!yU*f$}*W*kQ+i%zQ+v&SQ,[&`Q-Z'ZQ-e'cQ-m'iQ0S*mQ1l,]R;`:m%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$b$f%k%q&O&g&j&n&p&q&s&w'P'^'n(O(Q(W(_(s(w({)z+R+V,h,k,p-a-i-w-}.o.v/g0b0g0w1e1u1v1x1z1}2Q2S2s2y3a5a5k5{5|6P6d7}8S8c8mS#q]:j!r)]$]$n'T)o,|-P/O2c3v5_6Z9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<eQ*x%[Q+n%|Q,^&cQ,e&kQ.f;WQ0n+aQ0r+cQ0}+oQ1t,cQ3R._Q4}0xQ5r1mQ6p3VQ6|;XQ7o5OR8s6q'OkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$]$b$f$n%k%q&O&g&j&k&n&p&q&s&w'P'T'^'n(O(Q(W(_(s(w({)o)z+R+V+a,h,k,p,|-P-a-i-w-}._.o.v/O/g0b0g0w1e1u1v1x1z1}2Q2S2c2s2y3V3a3v5_5a5k5{5|6P6Z6d6q7}8S8c8m9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<et!nQ!r!v!y!z'S'Z'['h'i'j-T-Z-]-m1b5d5f$z$ti#v#x$d$e$y$|%P%R%]%^%b)v)|*O*Q*S*V*]*c*s*t+`+c+z+}.^.l/^/f/p/q/s0W0Y0d1X1[1d3U4O4Z4c4m4u4w5j6n7[7e8P8p8}9b9t:U:^;P;Q;S;T;U;V;Y;Z;[;];^;_;f;g;h;i;k;l;o;p;q;r;s;t;u;v;y;z<b<j<k<n<oQ&T|Q'Q!eU'W%g*W-WQ+n%|Q,^&cQ0c*|Q0}+oQ1S+uQ1s,bQ1t,cQ4}0xQ5W1UQ5r1mQ5u1oQ5v1rQ7o5OQ7r5TQ8[5xQ9]7sR9h8XrnOXst!V!Z#d%k&e&n&p&q&s,k,p1}2QR,`&g&x^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$]$b$f$n%k%q&O&g&j&k&n&p&q&s&w'P'^'n(Q(W(_(s(w({)o)z+R+V+a,h,k,p,|-P-a-i-w-}._.o.v/O/g0b0g0w1e1u1v1x1z1}2Q2S2c2s2y3V3a3v5_5a5k5{5|6P6Z6d6q7}8S8c8m9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<d<e[#]WZ#W#Z'T(O!b%hm#h#i#l$y%c%f(X(c(d(e*V*Z*^+T+U+W,g,}-{.R.S.T.V/f/i2V2}3O4R6Y6kQ%txQ%xyS%}|&SQ&Z!TQ'_!hQ'a!iQ(l#sS+h%y%zQ+l%|Q,V&^Q,Z&`S-d'b'cQ.a(mQ0v+iQ0|+oQ1O+pQ1R+tQ1g,WS1k,[,]Q2o-eQ4|0xQ5Q0{Q5V1TQ5q1lQ7n5OQ7q5SQ9X7mR:P9Y!O${i#x%P%R%]%^%b*O*Q*]*s*t.l/p0W0Y0d4O4m8}<b<j<k!S%vy!i!u%x%y%z'R'a'b'c'g'q*e+h+i-Q-d-e-l/z0v2h2o2v4eQ+b%tQ+{&WQ,O&XQ,Y&`Q.`(lQ1f,VU1j,Z,[,]Q3W.aQ5l1gS5p1k1lQ8W5q#[<f#v$d$e$y$|)v)|*S*V*c+`+c+z+}.^/^/f/q/s1X1[1d3U4Z4c4u4w5j6n7[7e8P8p9b9t:U:^;S;U;Y;[;^;f;h;k;o;q;s;u;y<n<oo<g;P;Q;T;V;Z;];_;g;i;l;p;r;t;v;zW%Ui%W*u<bS&W!Q&eQ&X!RQ&Y!SR+y&U${%Ti#v#x$d$e$y$|%P%R%]%^%b)v)|*O*Q*S*V*]*c*s*t+`+c+z+}.^.l/^/f/p/q/s0W0Y0d1X1[1d3U4O4Z4c4m4u4w5j6n7[7e8P8p8}9b9t:U:^;P;Q;S;T;U;V;Y;Z;[;];^;_;f;g;h;i;k;l;o;p;q;r;s;t;u;v;y;z<b<j<k<n<oT)w$v)xV*y%[;W;XW'W!e%g*W-WS(z#z#{Q+s&PS.Y(h(iQ1],PQ4n0aR7w5]'OkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$]$b$f$n%k%q&O&g&j&k&n&p&q&s&w'P'T'^'n(O(Q(W(_(s(w({)o)z+R+V+a,h,k,p,|-P-a-i-w-}._.o.v/O/g0b0g0w1e1u1v1x1z1}2Q2S2c2s2y3V3a3v5_5a5k5{5|6P6Z6d6q7}8S8c8m9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<e$i$ac#Y#e%o%p%r'}(T(o(v)O)P)Q)R)S)T)U)V)W)X)Y)[)_)c)m+^+r-R-p-u-z-|.k.q.u.w.x.y/Y0e2^2a2q2x3`3e3f3g3h3i3j3k3l3m3n3o3p3q3t3u3z4r4z6]6c6h6v6w7Q7R7y8g8k8t8z8{9q:R:Y:k<XT#TV#U'PkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$]$b$f$n%k%q&O&g&j&k&n&p&q&s&w'P'T'^'n(O(Q(W(_(s(w({)o)z+R+V+a,h,k,p,|-P-a-i-w-}._.o.v/O/g0b0g0w1e1u1v1x1z1}2Q2S2c2s2y3V3a3v5_5a5k5{5|6P6Z6d6q7}8S8c8m9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<eQ'U!eR2d-Tv!nQ!e!r!v!y!z'S'Z'['h'i'j-T-Z-]-m1b5d5fU*e$}*W*kS/z*f*mQ0T*nQ1_,RQ4e0SR4h0VnqOXst!Z#d%k&n&p&q&s,k,p1}2QQ&u!^Q'r!xS(n#u:qQ+f%wQ,T&ZQ,U&]Q-b'`Q-o'kS.j(s;cS0f+R;mQ0t+gQ1a,SQ2U,rQ2W,sQ2`-OQ2m-cQ2p-gS4s0g;wQ4x0uS4{0w;xQ6[2bQ6`2nQ6e2uQ7l4yQ8h6^Q8i6aQ8l6fR9n8e$d$`c#Y#e%p%r'}(T(o(v)O)P)Q)R)S)T)U)V)W)X)Y)[)_)c)m+^+r-R-p-u-z-|.k.q.u.x.y/Y0e2^2a2q2x3`3e3f3g3h3i3j3k3l3m3n3o3p3q3t3u3z4r4z6]6c6h6v6w7Q7R7y8g8k8t8z8{9q:R:Y:k<XS(k#p'eU*r%S(r3sS+]%o.wQ3S0nQ6m3RQ8r6pR9u8s$d$_c#Y#e%p%r'}(T(o(v)O)P)Q)R)S)T)U)V)W)X)Y)[)_)c)m+^+r-R-p-u-z-|.k.q.u.x.y/Y0e2^2a2q2x3`3e3f3g3h3i3j3k3l3m3n3o3p3q3t3u3z4r4z6]6c6h6v6w7Q7R7y8g8k8t8z8{9q:R:Y:k<XS(j#p'eS(|#{$`S+[%o.wS.Z(i(kQ.z)^Q0k+]R3P.['OkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$]$b$f$n%k%q&O&g&j&k&n&p&q&s&w'P'T'^'n(O(Q(W(_(s(w({)o)z+R+V+a,h,k,p,|-P-a-i-w-}._.o.v/O/g0b0g0w1e1u1v1x1z1}2Q2S2c2s2y3V3a3v5_5a5k5{5|6P6Z6d6q7}8S8c8m9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<eS#q]:jQ&p!XQ&q!YQ&s![Q&t!]R1|,nQ']!hQ+_%tQ-`'_S.](l+bQ2k-_W3T.`.a0m0oQ6_2lU6l3Q3S3WS8o6m6oS9s8q8rS:[9r9uQ:d:]R:g:eU!wQ'[-]T5b1b5d!Q_OXZ`st!V!Z#d#h%c%k&e&g&n&p&q&s(e,k,p.S1}2Q]!pQ!r'[-]1b5dT#q]:j%[{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$b$f%k%q&O&g&j&k&n&p&q&s&w'P'^'n(O(Q(W(_(s(w({)z+R+V+a,h,k,p-a-i-w-}._.o.v/g0b0g0w1e1u1v1x1z1}2Q2S2s2y3V3a5a5k5{5|6P6d6q7}8S8c8mS(z#z#{S.Y(h(i!s<O$]$n'T)o,|-P/O2c3v5_6Z9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<em!tQ!r!v!y!z'['h'i'j-]-m1b5d5fQ'p!uS(a#g1wS-k'g'sQ/l*YQ/x*eQ2w-nQ4V/mS4`/y0TQ7W4QS7c4f4hQ9P7XR9W7fQ#wbQ'o!uS(`#g1wS(b#m+QQ+S%dQ+d%uQ+j%{U-j'g'p'sQ.O(aQ/k*YQ/w*eQ/}*hQ0s+eQ1h,XS2t-k-nQ2|.WS4U/l/mS4_/x0TQ4b/|Q4d0OQ5n1iQ6g2wQ7V4QQ7Z4VS7_4`4hQ7d4gQ8U5oS9O7W7XQ9S7`Q9U7cQ9e8VQ9{9PQ9|9TQ:O9WQ:W9fQ:`9}Q<R;|Q<^<VR<_<WV!wQ'[-]%[aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$b$f%k%q&O&g&j&k&n&p&q&s&w'P'^'n(O(Q(W(_(s(w({)z+R+V+a,h,k,p-a-i-w-}._.o.v/g0b0g0w1e1u1v1x1z1}2Q2S2s2y3V3a5a5k5{5|6P6d6q7}8S8c8mS#wz!j!r;{$]$n'T)o,|-P/O2c3v5_6Z9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<eR<R<d%[bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$b$f%k%q&O&g&j&k&n&p&q&s&w'P'^'n(O(Q(W(_(s(w({)z+R+V+a,h,k,p-a-i-w-}._.o.v/g0b0g0w1e1u1v1x1z1}2Q2S2s2y3V3a5a5k5{5|6P6d6q7}8S8c8mQ%dj!S%uy!i!u%x%y%z'R'a'b'c'g'q*e+h+i-Q-d-e-l/z0v2h2o2v4eS%{z!jQ+e%vQ,X&`W1i,Y,Z,[,]U5o1j1k1lS8V5p5qQ9f8W!r;|$]$n'T)o,|-P/O2c3v5_6Z9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<eQ<V<cR<W<d%OeOPXYstuvw!Z!`!g!o#S#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$b$f%k%q&O&g&j&n&p&q&s&w'P'^'n(Q(W(_(s(w({)z+R+V+a,h,k,p-a-i-w-}._.o.v/g0b0g0w1e1u1v1x1z1}2Q2S2s2y3V3a5a5k5{5|6P6d6q7}8S8c8mY#bWZ#W#Z(O!b%hm#h#i#l$y%c%f(X(c(d(e*V*Z*^+T+U+W,g,}-{.R.S.T.V/f/i2V2}3O4R6Y6kQ,f&k!p;}$]$n)o,|-P/O2c3v5_6Z9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<eR<Q'TU'X!e%g*WR2f-W%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$b$f%k%q&O&g&j&n&p&q&s&w'P'^'n(O(Q(W(_(s(w({)z+R+V,h,k,p-a-i-w-}.o.v/g0b0g0w1e1u1v1x1z1}2Q2S2s2y3a5a5k5{5|6P6d7}8S8c8m!r)]$]$n'T)o,|-P/O2c3v5_6Z9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<eQ,e&kQ0n+aQ3R._Q6p3VR8s6q!b$Vc#Y%o'}(T(o(v)X)Y)_)c+r-p-u-z-|.k.q/Y0e2q2x3`3q4r4z6c6h6v8k9q:k!P:x)[)m-R.w2^2a3e3o3p3t3z6]6w7Q7R7y8g8t8z8{:R:Y<X!f$Xc#Y%o'}(T(o(v)U)V)X)Y)_)c+r-p-u-z-|.k.q/Y0e2q2x3`3q4r4z6c6h6v8k9q:k!T:z)[)m-R.w2^2a3e3l3m3o3p3t3z6]6w7Q7R7y8g8t8z8{:R:Y<X!^$]c#Y%o'}(T(o(v)_)c+r-p-u-z-|.k.q/Y0e2q2x3`3q4r4z6c6h6v8k9q:kQ4O/dz<e)[)m-R.w2^2a3e3t3z6]6w7Q7R7y8g8t8z8{:R:Y<XQ<j<lR<k<m'OkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$]$b$f$n%k%q&O&g&j&k&n&p&q&s&w'P'T'^'n(O(Q(W(_(s(w({)o)z+R+V+a,h,k,p,|-P-a-i-w-}._.o.v/O/g0b0g0w1e1u1v1x1z1}2Q2S2c2s2y3V3a3v5_5a5k5{5|6P6Z6d6q7}8S8c8m9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<eS$oh$pR3w.}'VgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$]$b$f$n$p%k%q&O&g&j&k&n&p&q&s&w'P'T'^'n(O(Q(W(_(s(w({)o)z+R+V+a,h,k,p,|-P-a-i-w-}._.o.v.}/O/g0b0g0w1e1u1v1x1z1}2Q2S2c2s2y3V3a3v5_5a5k5{5|6P6Z6d6q7}8S8c8m9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<eT$kf$qQ$ifS)f$l)jR)r$qT$jf$qT)h$l)j'VhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$]$b$f$n$p%k%q&O&g&j&k&n&p&q&s&w'P'T'^'n(O(Q(W(_(s(w({)o)z+R+V+a,h,k,p,|-P-a-i-w-}._.o.v.}/O/g0b0g0w1e1u1v1x1z1}2Q2S2c2s2y3V3a3v5_5a5k5{5|6P6Z6d6q7}8S8c8m9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<eT$oh$pQ$rhR)q$p%[jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#y#|$P$Q$R$S$T$U$V$W$X$Y$Z$b$f%k%q&O&g&j&k&n&p&q&s&w'P'^'n(O(Q(W(_(s(w({)z+R+V+a,h,k,p-a-i-w-}._.o.v/g0b0g0w1e1u1v1x1z1}2Q2S2s2y3V3a5a5k5{5|6P6d6q7}8S8c8m!s<c$]$n'T)o,|-P/O2c3v5_6Z9^9o:i:l:m:p:q:r:s:t:u:v:w:x:y:z:{:|:};R;`;b;c;e;m;n;w;x<e#elOPXZst!Z!`!o#S#d#o#|$n%k&g&j&k&n&p&q&s&w'P'^({)o+V+a,h,k,p-a._/O/g0b1e1u1v1x1z1}2Q2S3V3v5a5k5{5|6P6q7}8S8c!O%Si#x%P%R%]%^%b*O*Q*]*s*t.l/p0W0Y0d4O4m8}<b<j<k#[(r#v$d$e$y$|)v)|*S*V*c+`+c+z+}.^/^/f/q/s1X1[1d3U4Z4c4u4w5j6n7[7e8P8p9b9t:U:^;S;U;Y;[;^;f;h;k;o;q;s;u;y<n<oQ*}%`Q/Z){o3s;P;Q;T;V;Z;];_;g;i;l;p;r;t;v;z!O$zi#x%P%R%]%^%b*O*Q*]*s*t.l/p0W0Y0d4O4m8}<b<j<kQ*_${U*h$}*W*kQ+O%aQ0O*i#[<T#v$d$e$y$|)v)|*S*V*c+`+c+z+}.^/^/f/q/s1X1[1d3U4Z4c4u4w5j6n7[7e8P8p9b9t:U:^;S;U;Y;[;^;f;h;k;o;q;s;u;y<n<on<U;P;Q;T;V;Z;];_;g;i;l;p;r;t;v;zQ<Y<fQ<Z<gQ<[<hR<]<i!O%Si#x%P%R%]%^%b*O*Q*]*s*t.l/p0W0Y0d4O4m8}<b<j<k#[(r#v$d$e$y$|)v)|*S*V*c+`+c+z+}.^/^/f/q/s1X1[1d3U4Z4c4u4w5j6n7[7e8P8p9b9t:U:^;S;U;Y;[;^;f;h;k;o;q;s;u;y<n<oo3s;P;Q;T;V;Z;];_;g;i;l;p;r;t;v;znoOXst!Z#d%k&n&p&q&s,k,p1}2QS*b$|*VQ,y&zQ,z&|R4Y/q$z%Ti#v#x$d$e$y$|%P%R%]%^%b)v)|*O*Q*S*V*]*c*s*t+`+c+z+}.^.l/^/f/p/q/s0W0Y0d1X1[1d3U4O4Z4c4m4u4w5j6n7[7e8P8p8}9b9t:U:^;P;Q;S;T;U;V;Y;Z;[;];^;_;f;g;h;i;k;l;o;p;q;r;s;t;u;v;y;z<b<j<k<n<oQ+|&XQ1Z,OQ5Z1YR7v5[V*j$}*W*kU*j$}*W*kT5c1b5dU/|*g/g5aT4g0U7}Q+d%uQ/}*hQ0s+eQ1h,XQ5n1iQ8U5oQ9e8VR:W9f!O%Pi#x%P%R%]%^%b*O*Q*]*s*t.l/p0W0Y0d4O4m8}<b<j<kr*O$w(t*P*q+P/o0[0]3^4W4q7U7g9z<S<`<aS0W*p0X#[;S#v$d$e$y$|)v)|*S*V*c+`+c+z+}.^/^/f/q/s1X1[1d3U4Z4c4u4w5j6n7[7e8P8p9b9t:U:^;S;U;Y;[;^;f;h;k;o;q;s;u;y<n<on;T;P;Q;T;V;Z;];_;g;i;l;p;r;t;v;z!^;f(p)a*X*a.b.e.i/V/[/d/t0l1W1Y3Z4X4]5Y5[6r6u7]7a7i7k9R9V:_<l<m`;g3r6x6{7P8u9v9y:hS;q.d3[T;r6z8x!O%Ri#x%P%R%]%^%b*O*Q*]*s*t.l/p0W0Y0d4O4m8}<b<j<kv*Q$w(t*R*p+P/`/o0[0]3^4W4i4q7U7g9z<S<`<aS0Y*q0Z#[;U#v$d$e$y$|)v)|*S*V*c+`+c+z+}.^/^/f/q/s1X1[1d3U4Z4c4u4w5j6n7[7e8P8p9b9t:U:^;S;U;Y;[;^;f;h;k;o;q;s;u;y<n<on;V;P;Q;T;V;Z;];_;g;i;l;p;r;t;v;z!b;h(p)a*X*a.c.d.i/V/[/d/t0l1W1Y3X3Z4X4]5Y5[6r6s6u7]7a7i7k9R9V:_<l<md;i3r6y6z7P8u8v9v9w9y:hS;s.e3]T;t6{8yrnOXst!V!Z#d%k&e&n&p&q&s,k,p1}2QQ&b!UR,h&krnOXst!V!Z#d%k&e&n&p&q&s,k,p1}2QR&b!UQ,Q&YR1V+ysnOXst!V!Z#d%k&e&n&p&q&s,k,p1}2QQ1c,VS5i1f1gU8O5g5h5lS9a8Q8RS:S9`9cQ:a:TR:f:bQ&i!VR,a&eR5u1oS%}|&SR1O+pQ&n!WR,k&oR,q&tT2O,p2QR,u&uQ,t&uR2X,uQ'u!{R-q'uSsOtQ#dXT%ns#dQ#OTR'w#OQ#RUR'y#RQ)x$vR/W)xQ#UVR'{#UQ#XWU(R#X(S-xQ(S#YR-x(TQ-U'UR2e-UQ.m(tR3_.mQ.p(vS3b.p3cR3c.qQ-]'[R2i-]Y!rQ'[-]1b5dR'f!rU#_W%f*VU(Y#_(Z-yQ(Z#`R-y(UQ-X'XR2g-Xt`OXst!V!Z#d%k&e&g&n&p&q&s,k,p1}2QS#hZ%cU#r`#h.SR.S(eQ(f#jQ.P(bW.X(f.P2z6iQ2z.QR6i2{Q)j$lR/P)jQ$phR)p$pQ$ccU)`$c-t;OQ-t:kR;O)mQ/j*YW4S/j4T7Y9QU4T/k/l/mS7Y4U4VR9Q7Z$X)}$w(p(t)a*X*a*p*q*z*{+P.d.e.g.h.i/V/[/`/b/d/o/t0[0]0l1W1Y3X3Y3Z3^3r4W4X4]4i4k4q5Y5[6r6s6t6u6z6{6}7O7P7U7]7a7g7i7k8u8v8w9R9V9v9w9x9y9z:_:h<S<`<a<l<mQ/r*aU4[/r4^7^Q4^/tR7^4]S*k$}*WR0Q*kr*P$w(t*p*q+P/o0[0]3^4W4q7U7g9z<S<`<a!^.b(p)a*X*a.d.e.i/V/[/d/t0l1W1Y3Z4X4]5Y5[6r6u7]7a7i7k9R9V:_<l<mU/a*P.b6xa6x3r6z6{7P8u9v9y:hQ0X*pQ3[.dU4j0X3[8xR8x6zv*R$w(t*p*q+P/`/o0[0]3^4W4i4q7U7g9z<S<`<a!b.c(p)a*X*a.d.e.i/V/[/d/t0l1W1Y3X3Z4X4]5Y5[6r6s6u7]7a7i7k9R9V:_<l<mU/c*R.c6ye6y3r6z6{7P8u8v9v9w9y:hQ0Z*qQ3].eU4l0Z3]8yR8y6{Q*v%VR0_*vQ4v0lR7j4vQ+X%iR0j+XQ5^1]S7x5^9_R9_7yQ,S&ZR1`,SQ5d1bR7{5dQ1n,^S5s1n8YR8Y5uQ0y+lW5P0y5R7p9ZQ5R0|Q7p5QR9Z7qQ+q%}R1P+qQ2Q,pR6T2QYrOXst#dQ&r!ZQ+Z%kQ,j&nQ,l&pQ,m&qQ,o&sQ1{,kS2O,p2QR6S1}Q%mpQ&v!_Q&y!aQ&{!bQ&}!cQ'm!uQ+Y%jQ+f%wQ+x&TQ,`&iQ,w&xW-h'g'o'p'sQ-o'kQ0P*jQ0t+gS1q,a,dQ2Y,vQ2Z,yQ2[,zQ2p-gW2r-j-k-n-pQ4x0uQ5U1SQ5X1WQ5m1hQ5w1sQ6R1|U6b2q2t2wQ6e2uQ7l4yQ7t5WQ7u5YQ7z5cQ8T5nQ8Z5vS8j6c6gQ8l6fQ9[7rQ9d8UQ9i8[Q9p8kQ:Q9]Q:V9eQ:Z9qR:c:WQ%wyQ'`!iQ'k!uU+g%x%y%zQ-O'RU-c'a'b'cS-g'g'qQ/v*eS0u+h+iQ2b-QS2n-d-eQ2u-lQ4a/zQ4y0vQ6^2hQ6a2oQ6f2vR7b4eS$xi<bR*w%WU%Vi%W<bR0^*uQ$wiS(p#v+cQ(t#xS)a$d$eQ*X$yS*a$|*VQ*p%PQ*q%RQ*z%]Q*{%^Q+P%bQ.d;SQ.e;UQ.g;YQ.h;[Q.i;^Q/V)vS/[)|/^Q/`*OQ/b*QQ/d*SQ/o*]S/t*c/fQ0[*sQ0]*th0l+`.^1d3U5j6n8P8p9b9t:U:^Q1W+zQ1Y+}Q3X;fQ3Y;hQ3Z;kQ3^.lS3r;P;QQ4W/pQ4X/qQ4]/sQ4i0WQ4k0YQ4q0dQ5Y1XQ5[1[Q6r;oQ6s;qQ6t;sQ6u;uQ6z;TQ6{;VQ6};ZQ7O;]Q7P;_Q7U4OQ7]4ZQ7a4cQ7g4mQ7i4uQ7k4wQ8u;lQ8v;gQ8w;iQ9R7[Q9V7eQ9v;pQ9w;rQ9x;tQ9y;vQ9z8}Q:_;yQ:h;zQ<S<bQ<`<jQ<a<kQ<l<nR<m<onpOXst!Z#d%k&n&p&q&s,k,p1}2QQ!fPS#fZ#oQ&x!`U'd!o5a7}Q'z#SQ(}#|Q)n$nS,d&g&jQ,i&kQ,v&wQ,{'PQ-_'^Q.s({Q/T)oS0h+V/gQ0o+aQ1y,hQ2l-aQ3S._Q3y/OQ4o0bQ5h1eQ5y1uQ5z1vQ6O1xQ6Q1zQ6V2SQ6m3VQ7S3vQ8R5kQ8_5{Q8`5|Q8b6PQ8r6qQ9c8SR9m8c#YcOPXZst!Z!`!o#d#o#|%k&g&j&k&n&p&q&s&w'P'^({+V+a,h,k,p-a._/g0b1e1u1v1x1z1}2Q2S3V5a5k5{5|6P6q7}8S8cQ#YWQ#eYQ%ouQ%pvS%rw!gS'}#W(QQ(T#ZQ(o#uQ(v#yQ)O$PQ)P$QQ)Q$RQ)R$SQ)S$TQ)T$UQ)U$VQ)V$WQ)W$XQ)X$YQ)Y$ZQ)[$]Q)_$bQ)c$fW)m$n)o/O3vQ+^%qQ+r&OS-R'T2cQ-p'nS-u(O-wQ-z(WQ-|(_Q.k(sQ.q(wQ.u:iQ.w:lQ.x:mQ.y:pQ/Y)zQ0e+RQ2^,|Q2a-PQ2q-iQ2x-}Q3`.oQ3e:qQ3f:rQ3g:sQ3h:tQ3i:uQ3j:vQ3k:wQ3l:xQ3m:yQ3n:zQ3o:{Q3p:|Q3q.vQ3t;RQ3u;`Q3z:}Q4r0gQ4z0wQ6];bQ6c2sQ6h2yQ6v3aQ6w;cQ7Q;eQ7R;mQ7y5_Q8g6ZQ8k6dQ8t;nQ8z;wQ8{;xQ9q8mQ:R9^Q:Y9oQ:k#SR<X<eR#[WR'V!el!tQ!r!v!y!z'['h'i'j-]-m1b5d5fS'R!e-TS-Q'S'ZR2h-ZR(u#xR(x#yQ!fQT-['[-]]!qQ!r'[-]1b5dQ#p]R'e:jY!uQ'[-]1b5dQ'g!rS'q!v!yS's!z5fS-l'h'iQ-n'jR2v-mT#kZ%cS#jZ%cS%im,gU(b#h#i#lS.Q(c(dQ.U(eQ0i+WQ2{.RU2|.S.T.VS6j2}3OR8n6kd#^W#W#Z%f(O(X*V+T-{/fr#gZm#h#i#l%c(c(d(e+W.R.S.T.V2}3O6kS*Y$y*^Q/m*ZQ1w,gQ2_,}Q4Q/iQ6X2VQ7X4RQ8f6YT<P'T+UV#aW%f*VU#`W%f*VS(P#W(XU(U#Z+T/fS-S'T+UT-v(O-{V'Y!e%g*WQ$lfR)t$qT)i$l)jR3x.}T*[$y*^T*d$|*VQ0m+`Q3Q.^Q5g1dQ6o3UQ8Q5jQ8q6nQ9`8PQ9r8pQ:T9bQ:]9tQ:b:UR:e:^nqOXst!Z#d%k&n&p&q&s,k,p1}2QQ&h!VR,`&etmOXst!U!V!Z#d%k&e&n&p&q&s,k,p1}2QR,g&kT%jm,gR1^,PR,_&cQ&R|R+w&SR+m%|T&l!W&oT&m!W&oT2P,p2Q",nodeNames:"⚠ ArithOp ArithOp JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:372,context:JIn,nodeProps:[["isolate",-8,4,5,13,33,35,48,50,52,""],["group",-26,8,16,18,65,201,205,209,210,212,215,218,228,230,236,238,240,242,245,251,257,259,261,263,265,267,268,"Statement",-32,12,13,28,31,32,38,48,51,52,54,59,67,75,79,81,83,84,106,107,116,117,134,137,139,140,141,142,144,145,164,165,167,"Expression",-23,27,29,33,37,39,41,168,170,172,173,175,176,177,179,180,181,183,184,185,195,197,199,200,"Type",-3,87,99,105,"ClassItem"],["openedBy",22,"<",34,"InterpolationStart",53,"[",57,"{",72,"(",157,"JSXStartCloseTag"],["closedBy",23,">",36,"InterpolationEnd",47,"]",58,"}",73,")",162,"JSXEndTag"]],propSources:[i5n],skippedNodes:[0,4,5,271],repeatNodeCount:37,tokenData:"$HR(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$.S!c!}Er!}#O$/^#O#P$0h#P#Q$6P#Q#R$7Z#R#SEr#S#T$8h#T#o$9r#o#p$>S#p#q$>x#q#r$@Y#r#s$Af#s$f%Z$f$g+g$g#BYEr#BY#BZ$Bp#BZ$ISEr$IS$I_$Bp$I_$I|Er$I|$I}$E{$I}$JO$E{$JO$JTEr$JT$JU$Bp$JU$KVEr$KV$KW$Bp$KW&FUEr&FU&FV$Bp&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$Bp?HUOEr(n%d_$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$f&j(OpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(OpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$f&j(Op(R!b't(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST(P#S$f&j'u(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$f&j(Op(R!b'u(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$f&j!o$Ip(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#t$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/|3l_'}$(n$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$f&j(R!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$f&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$a`$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$a``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$a`$f&j(R!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(R!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$a`(R!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k#%|:hh$f&j(Op(R!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__VS$f&j(Op(R!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]VS$f&j(R!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXVS$f&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSVSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWVS(R!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]VS$f&j(OpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWVS(OpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYVS(Op(R!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S#%|C}i$f&j(g!L^(Op(R!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr#%|EoP;=`<%lCr(CSFRk$f&j(Op(R!b$Y#t'{&;d([!LYOY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$f&j(Op(R!b$Y#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv(CSJPP;=`<%lEr%#SJ_`$f&j(Op(R!b#l$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#SKl_$f&j$O$Id(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&COLva(q&;`$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#SNW`$f&j#x$Id(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/|! c_(Q$)`$f&j(OpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$f&j(OpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$f&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$a`$f&j(OpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(OpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$a`(OpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b(*Q!'t_!k(!b$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z!'l!)O_!jM|$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'+h!*[b$f&j(Op(R!b'|#)d#m$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S!+o`$f&j(Op(R!b#j$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&-O!,|`$f&j(Op(R!bn&%`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&C[!.Z_!Y&;l$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS!/ec$f&j(Op(R!b|'<nOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z!'d!0ya$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z!'d!2Z_!XMt$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l!3eg$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l!5Vg$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l!6wc$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l!8_c$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS!9uf$f&j(Op(R!b#k$IdOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z(r!;fb$f&j(Op(R!b!USOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z(Q!<w`$f&j(R!b!USOY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n&n!>Q^$f&j!USOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y&n!?Td$f&j!USO!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@hX!USOY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@cS!AYW!US#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!ATS!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!ArS!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!ArS!BnP;=`<%l!ArS!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@cS!CTP;=`<%l!@c&n!C][$f&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW&n!DWX$f&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW&n!DvP;=`<%l!CW&n!EOX$f&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y&n!EnP;=`<%l!=y(Q!Ezl$f&j(R!b!USOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GyZ(R!b!USOY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr!f!Hse(R!b!USOY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}!f!JZX(R!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU!f!JyP;=`<%l!JU!f!KPP;=`<%l!Gr(Q!KZ^$f&j(R!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS(Q!LYP;=`<%l!KS(Q!L`P;=`<%l!<n'`!Ll`$f&j(Op!USOY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc'`!Mwl$f&j(Op!USOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rt# vZ(Op!USOY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# ot#!pe(Op!USOY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)rt#$WX(OpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$Rt#$vP;=`<%l#$Rt#$|P;=`<%l# o'`#%W^$f&j(OpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P'`#&VP;=`<%l#%P'`#&]P;=`<%l!Lc(r#&kn$f&j(Op(R!b!USOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#W#(r](Op(R!b!USOY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i#W#)th(Op(R!b!USOY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g#W#+gZ(Op(R!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`#W#,]P;=`<%l#+`#W#,cP;=`<%l#(i(r#,o`$f&j(Op(R!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f(r#-tP;=`<%l#,f(r#-zP;=`<%l!;Z(CS#.[b$f&j(Op(R!b'v(;d!USOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z(CS#/o_$f&j(Op(R!bS(;dOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d(Bb#0w]$f&j(R!bS(;dOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n(AO#1wX$f&jS(;dOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p(;d#2iSS(;dOY#2dZ;'S#2d;'S;=`#2u<%lO#2d(;d#2xP;=`<%l#2d(AO#3OP;=`<%l#1p(<v#3YW(R!bS(;dOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R(<v#3uP;=`<%l#3R(Bb#3{P;=`<%l#0n(Ap#4X]$f&j(OpS(;dOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O(<U#5XW(OpS(;dOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q(<U#5tP;=`<%l#5Q(Ap#5zP;=`<%l#4O(=h#6WY(Op(R!bS(;dOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}(=h#6yP;=`<%l#5}(CS#7PP;=`<%l#/d%#W#7ab$f&j$O$Id(Op(R!b!USOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z+h#8vb$W#t$f&j(Op(R!b!USOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z$/l#:Zp$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#<jk$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#>j_$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?rd$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#A]f$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#Bzc$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#Dbe$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#E|g$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#Gpi$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%Gh#Il_!d$b$f&j#|%<f(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_`l$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(@^#LS^g!*v!h'.r(Op(R!b(uSOY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$h&j(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g$Kh#M}Z#n$Id(Op(R!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g$Kh#NyX$O$Id(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g$Kh$ oX#o$Id(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g%Gh$!ga#[%?x$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#W$#w_#g$Ih$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%Gh$%VafBf#o$Id$c#|$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$&g_#o$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$'qa#n$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$)R`#n$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'+h$*`c(i$Ip$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P$+k!P!^%Z!^!_*g!_!a%Z!a!b$,u!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'+`$+v_}'#p$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$-Q`$f&j#y$Id(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&^$.__!{!Ln$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(@^$/i_!P(8n$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$0mZ$f&jO!^$1`!^!_$1v!_#i$1`#i#j$1{#j#l$1`#l#m$3n#m#o$1`#o#p$1v#p;'S$1`;'S;=`$5y<%lO$1`(n$1gT^#S$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$1{O^#S(n$2Q[$f&jO!Q&c!Q![$2v![!^&c!_!c&c!c!i$2v!i#T&c#T#Z$2v#Z#o&c#o#p$5^#p;'S&c;'S;=`&w<%lO&c(n$2{Z$f&jO!Q&c!Q![$3n![!^&c!_!c&c!c!i$3n!i#T&c#T#Z$3n#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3sZ$f&jO!Q&c!Q![$4f![!^&c!_!c&c!c!i$4f!i#T&c#T#Z$4f#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$4kZ$f&jO!Q&c!Q![$1`![!^&c!_!c&c!c!i$1`!i#T&c#T#Z$1`#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$5aR!Q![$5j!c!i$5j#T#Z$5j#S$5mS!Q![$5j!c!i$5j#T#Z$5j#q#r$1v(n$5|P;=`<%l$1`!2r$6[_!V!+S$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$7f`#v$Id$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&,v$8s_$f&j(Op(R!b(X&%WOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS$:Rk$f&j(Op(R!b'{&;d$[#t([!LYOY%ZYZ&cZr%Zrs&}st%Ztu$9ruw%Zwx(rx}%Z}!O$;v!O!Q%Z!Q![$9r![!^%Z!^!_*g!_!c%Z!c!}$9r!}#O%Z#O#P&c#P#R%Z#R#S$9r#S#T%Z#T#o$9r#o#p*g#p$g%Z$g;'S$9r;'S;=`$=|<%lO$9r+d$<Rk$f&j(Op(R!b$[#tOY%ZYZ&cZr%Zrs&}st%Ztu$;vuw%Zwx(rx}%Z}!O$;v!O!Q%Z!Q![$;v![!^%Z!^!_*g!_!c%Z!c!}$;v!}#O%Z#O#P&c#P#R%Z#R#S$;v#S#T%Z#T#o$;v#o#p*g#p$g%Z$g;'S$;v;'S;=`$=v<%lO$;v+d$=yP;=`<%l$;v(CS$>PP;=`<%l$9r!5p$>]X![!3l(Op(R!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g&CO$?Ta(p&;`$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$,u#q;'S%Z;'S;=`+a<%lO%Z%#`$@g_!Z$I`r`$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(r$Aq_!pS$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS$CR|$f&j(Op(R!b't(;d$Y#t'{&;d([!LYOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$Bp#BZ$ISEr$IS$I_$Bp$I_$JTEr$JT$JU$Bp$JU$KVEr$KV$KW$Bp$KW&FUEr&FU&FV$Bp&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$Bp?HUOEr(CS$F^k$f&j(Op(R!b'u(;d$Y#t'{&;d([!LYOY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[t5n,n5n,r5n,2,3,4,5,6,7,8,9,10,11,12,13,e5n,new nF("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOt~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(Z~~",141,332),new nF("j~RQYZXz{^~^O'x~~aP!P!Qd~iO'y~~",25,315)],topRules:{Script:[0,6],SingleExpression:[1,269],SingleClassItem:[2,270]},dialects:{jsx:0,ts:14826},dynamicPrecedences:{69:1,79:1,81:1,165:1,193:1},specialized:[{term:319,get:e=>o5n[e]||-1},{term:334,get:e=>s5n[e]||-1},{term:70,get:e=>a5n[e]||-1}],tokenPrec:14850}),wpe=[Ti("function ${name}(${params}) {\n	${}\n}",{label:"function",detail:"definition",type:"keyword"}),Ti("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n	${}\n}",{label:"for",detail:"loop",type:"keyword"}),Ti("for (let ${name} of ${collection}) {\n	${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Ti("do {\n	${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Ti("while (${}) {\n	${}\n}",{label:"while",detail:"loop",type:"keyword"}),Ti(`try {
	\${}
} catch (\${error}) {
	\${}
}`,{label:"try",detail:"/ catch block",type:"keyword"}),Ti("if (${}) {\n	${}\n}",{label:"if",detail:"block",type:"keyword"}),Ti(`if (\${}) {
	\${}
} else {
	\${}
}`,{label:"if",detail:"/ else block",type:"keyword"}),Ti(`class \${name} {
	constructor(\${params}) {
		\${}
	}
}`,{label:"class",detail:"definition",type:"keyword"}),Ti('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Ti('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Hnt=wpe.concat([Ti("interface ${name} {\n	${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Ti("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Ti("enum ${name} {\n	${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),b2e=new Nse,Xnt=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function n$(e){return(t,n)=>{let r=t.node.getChild("VariableDefinition");return r&&n(r,e),!0}}const c5n=["FunctionDeclaration"],u5n={FunctionDeclaration:n$("function"),ClassDeclaration:n$("class"),ClassExpression:()=>!0,EnumDeclaration:n$("constant"),TypeAliasDeclaration:n$("type"),NamespaceDeclaration:n$("namespace"),VariableDefinition(e,t){e.matchContext(c5n)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function Znt(e,t){let n=b2e.get(t);if(n)return n;let r=[],i=!0;function o(s,a){let l=e.sliceString(s.from,s.to);r.push({label:l,type:a})}return t.cursor(Wr.IncludeAnonymous).iterate(s=>{if(i)i=!1;else if(s.name){let a=u5n[s.name];if(a&&a(s,o)||Xnt.has(s.name))return!1}else if(s.to-s.from>8192){for(let a of Znt(e,s.node))r.push(a);return!1}}),b2e.set(t,r),r}const u7=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Spe=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function Ynt(e){let t=kr(e.state).resolveInner(e.pos,-1);if(Spe.indexOf(t.name)>-1)return null;let n=t.name=="VariableName"||t.to-t.from<20&&u7.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let i=t;i;i=i.parent)Xnt.has(i.name)&&(r=r.concat(Znt(e.state.doc,i)));return{options:r,from:n?t.from:e.pos,validFor:u7}}function EH(e,t,n){var r;let i=[];for(;;){let o=t.firstChild,s;if((o==null?void 0:o.name)=="VariableName")return i.push(e(o)),{path:i.reverse(),name:n};if((o==null?void 0:o.name)=="MemberExpression"&&((r=s=o.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")i.push(e(s)),t=o;else return null}}function Gnt(e){let t=r=>e.state.doc.sliceString(r.from,r.to),n=kr(e.state).resolveInner(e.pos,-1);return n.name=="PropertyName"?EH(t,n.parent,t(n)):(n.name=="."||n.name=="?.")&&n.parent.name=="MemberExpression"?EH(t,n.parent,""):Spe.indexOf(n.name)>-1?null:n.name=="VariableName"||n.to-n.from<20&&u7.test(t(n))?{path:[],name:t(n)}:n.name=="MemberExpression"?EH(t,n,""):e.explicit?{path:[],name:""}:null}function f5n(e,t){let n=[],r=new Set;for(let i=0;;i++){for(let s of(Object.getOwnPropertyNames||Object.keys)(e)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(s)||r.has(s))continue;r.add(s);let a;try{a=e[s]}catch{continue}n.push({label:s,type:typeof a=="function"?/^[A-Z]/.test(s)?"class":t?"function":"method":t?"variable":"property",boost:-i})}let o=Object.getPrototypeOf(e);if(!o)return n;e=o}}function d5n(e){let t=new Map;return n=>{let r=Gnt(n);if(!r)return null;let i=e;for(let s of r.path)if(i=i[s],!i)return null;let o=t.get(i);return o||t.set(i,o=f5n(i,!r.path.length)),{from:n.pos-r.name.length,options:o,validFor:u7}}}const sf=Gb.define({name:"javascript",parser:l5n.configure({props:[i_.add({IfStatement:U5({except:/^\s*({|else\b)/}),TryStatement:U5({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:G7t,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),r=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:r?1:2)*e.unit},Block:V5({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":U5({except:/^{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),Sv.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":TP,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Knt={test:e=>/^JSX/.test(e.name),facet:Xz({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Epe=sf.configure({dialect:"ts"},"typescript"),Cpe=sf.configure({dialect:"jsx",props:[Kse.add(e=>e.isTop?[Knt]:void 0)]}),_pe=sf.configure({dialect:"jsx ts",props:[Kse.add(e=>e.isTop?[Knt]:void 0)]},"typescript");let Jnt=e=>({label:e,type:"keyword"});const ert="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Jnt),h5n=ert.concat(["declare","implements","private","protected","public"].map(Jnt));function trt(e={}){let t=e.jsx?e.typescript?_pe:Cpe:e.typescript?Epe:sf,n=e.typescript?Hnt.concat(h5n):wpe.concat(ert);return new j0(t,[sf.data.of({autocomplete:RBe(Spe,Ele(n))}),sf.data.of({autocomplete:Ynt}),e.jsx?nrt:[]])}function p5n(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function O2e(e,t,n=e.length){for(let r=t==null?void 0:t.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return e.sliceString(r.from,Math.min(r.to,n));return""}const g5n=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),nrt=Ve.inputHandler.of((e,t,n,r,i)=>{if((g5n?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||r!=">"&&r!="/"||!sf.isActiveAt(e.state,t,-1))return!1;let o=i(),{state:s}=o,a=s.changeByRange(l=>{var c;let{head:u}=l,f=kr(s).resolveInner(u-1,-1),d;if(f.name=="JSXStartTag"&&(f=f.parent),!(s.doc.sliceString(u-1,u)!=r||f.name=="JSXAttributeValue"&&f.to>u)){if(r==">"&&f.name=="JSXFragmentTag")return{range:l,changes:{from:u,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let h=f.parent,p=h.parent;if(p&&h.from==u-2&&((d=O2e(s.doc,p.firstChild,u))||((c=p.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let g=`${d}>`;return{range:Ae.cursor(u+g.length,-1),changes:{from:u,insert:g}}}}else if(r==">"){let h=p5n(f);if(h&&!/^\/?>|^<\//.test(s.doc.sliceString(u,u+2))&&(d=O2e(s.doc,h,u)))return{range:l,changes:{from:u,insert:`</${d}>`}}}}return{range:l}});return a.changes.empty?!1:(e.dispatch([o,s.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function m5n(e,t){return t||(t={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},e.getRules().forEach((n,r)=>{n.meta.docs.recommended&&(t.rules[r]=2)})),n=>{let{state:r}=n,i=[];for(let{from:o,to:s}of sf.findRegions(r)){let a=r.doc.lineAt(o),l={line:a.number-1,col:o-a.from,pos:o};for(let c of e.verify(r.sliceDoc(o,s),t))i.push(y5n(c,r.doc,l))}return i}}function x2e(e,t,n,r){return n.line(e+r.line).from+t+(e==1?r.col-1:-1)}function y5n(e,t,n){let r=x2e(e.line,e.column,t,n),i={from:r,to:e.endLine!=null&&e.endColumn!=1?x2e(e.endLine,e.endColumn,t,n):r,message:e.message,source:e.ruleId?"eslint:"+e.ruleId:"eslint",severity:e.severity==1?"warning":"error"};if(e.fix){let{range:o,text:s}=e.fix,a=o[0]+n.pos-r,l=o[1]+n.pos-r;i.actions=[{name:"fix",apply(c,u){c.dispatch({changes:{from:u+a,to:u+l,insert:s},scrollIntoView:!0})}}]}return i}const AI=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:nrt,completionPath:Gnt,esLint:m5n,javascript:trt,javascriptLanguage:sf,jsxLanguage:Cpe,localCompletionSource:Ynt,scopeCompletionSource:d5n,snippets:wpe,tsxLanguage:_pe,typescriptLanguage:Epe,typescriptSnippets:Hnt},Symbol.toStringTag,{value:"Module"})),r$=["_blank","_self","_top","_parent"],CH=["ascii","utf-8","utf-16","latin1","latin1"],_H=["get","post","put","delete"],kH=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],wc=["true","false"],Ct={},v5n={a:{attrs:{href:null,ping:null,type:null,media:null,target:r$,hreflang:null}},abbr:Ct,address:Ct,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Ct,aside:Ct,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Ct,base:{attrs:{href:null,target:r$}},bdi:Ct,bdo:Ct,blockquote:{attrs:{cite:null}},body:Ct,br:Ct,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:kH,formmethod:_H,formnovalidate:["novalidate"],formtarget:r$,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Ct,center:Ct,cite:Ct,code:Ct,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Ct,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Ct,div:Ct,dl:Ct,dt:Ct,em:Ct,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Ct,figure:Ct,footer:Ct,form:{attrs:{action:null,name:null,"accept-charset":CH,autocomplete:["on","off"],enctype:kH,method:_H,novalidate:["novalidate"],target:r$}},h1:Ct,h2:Ct,h3:Ct,h4:Ct,h5:Ct,h6:Ct,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Ct,hgroup:Ct,hr:Ct,html:{attrs:{manifest:null}},i:Ct,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:kH,formmethod:_H,formnovalidate:["novalidate"],formtarget:r$,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Ct,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Ct,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Ct,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:CH,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Ct,noscript:Ct,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Ct,param:{attrs:{name:null,value:null}},pre:Ct,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Ct,rt:Ct,ruby:Ct,samp:Ct,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:CH}},section:Ct,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Ct,source:{attrs:{src:null,type:null,media:null}},span:Ct,strong:Ct,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Ct,summary:Ct,sup:Ct,table:Ct,tbody:Ct,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Ct,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Ct,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Ct,time:{attrs:{datetime:null}},title:Ct,tr:Ct,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Ct,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Ct},rrt={accesskey:null,class:null,contenteditable:wc,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:wc,autocorrect:wc,autocapitalize:wc,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":wc,"aria-autocomplete":["inline","list","both","none"],"aria-busy":wc,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":wc,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":wc,"aria-hidden":wc,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":wc,"aria-multiselectable":wc,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":wc,"aria-relevant":null,"aria-required":wc,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},irt="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of irt)rrt[e]=null;class jA{constructor(t,n){this.tags=Object.assign(Object.assign({},v5n),t),this.globalAttrs=Object.assign(Object.assign({},rrt),n),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}jA.default=new jA;function EC(e,t,n=e.length){if(!t)return"";let r=t.firstChild,i=r&&r.getChild("TagName");return i?e.sliceString(i.from,Math.min(i.to,n)):""}function CC(e,t=!1){for(;e;e=e.parent)if(e.name=="Element")if(t)t=!1;else return e;return null}function ort(e,t,n){let r=n.tags[EC(e,CC(t))];return(r==null?void 0:r.children)||n.allTags}function kpe(e,t){let n=[];for(let r=CC(t);r&&!r.type.isTop;r=CC(r.parent)){let i=EC(e,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(t.name=="EndTag"||t.from>=r.firstChild.to)&&n.push(i)}return n}const srt=/^[:\-\.\w\u00b7-\uffff]*$/;function w2e(e,t,n,r,i){let o=/\s*>/.test(e.sliceDoc(i,i+5))?"":">",s=CC(n,!0);return{from:r,to:i,options:ort(e.doc,s,t).map(a=>({label:a,type:"type"})).concat(kpe(e.doc,n).map((a,l)=>({label:"/"+a,apply:"/"+a+o,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function S2e(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:kpe(e.doc,t).map((o,s)=>({label:o,apply:o+i,type:"type",boost:99-s})),validFor:srt}}function b5n(e,t,n,r){let i=[],o=0;for(let s of ort(e.doc,n,t))i.push({label:"<"+s,type:"type"});for(let s of kpe(e.doc,n))i.push({label:"</"+s+">",type:"type",boost:99-o++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function O5n(e,t,n,r,i){let o=CC(n),s=o?t.tags[EC(e.doc,o)]:null,a=s&&s.attrs?Object.keys(s.attrs):[],l=s&&s.globalAttrs===!1?a:a.length?a.concat(t.globalAttrNames):t.globalAttrNames;return{from:r,to:i,options:l.map(c=>({label:c,type:"property"})),validFor:srt}}function x5n(e,t,n,r,i){var o;let s=(o=n.parent)===null||o===void 0?void 0:o.getChild("AttributeName"),a=[],l;if(s){let c=e.sliceDoc(s.from,s.to),u=t.globalAttrs[c];if(!u){let f=CC(n),d=f?t.tags[EC(e.doc,f)]:null;u=(d==null?void 0:d.attrs)&&d.attrs[c]}if(u){let f=e.sliceDoc(r,i).toLowerCase(),d='"',h='"';/^['"]/.test(f)?(l=f[0]=='"'?/^[^"]*$/:/^[^']*$/,d="",h=e.sliceDoc(i,i+1)==f[0]?"":f[0],f=f.slice(1),r++):l=/^[^\s<>='"]*$/;for(let p of u)a.push({label:p,apply:d+p+h,type:"constant"})}}return{from:r,to:i,options:a,validFor:l}}function art(e,t){let{state:n,pos:r}=t,i=kr(n).resolveInner(r,-1),o=i.resolve(r);for(let s=r,a;o==i&&(a=i.childBefore(s));){let l=a.lastChild;if(!l||!l.type.isError||l.from<l.to)break;o=i=a,s=l.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?S2e(n,i,i.from,r):w2e(n,e,i,i.from,r):i.name=="StartTag"?w2e(n,e,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?S2e(n,i,r,r):t.explicit&&(i.name=="OpenTag"||i.name=="SelfClosingTag")||i.name=="AttributeName"?O5n(n,e,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?x5n(n,e,i,i.name=="Is"?r:i.from,r):t.explicit&&(o.name=="Element"||o.name=="Text"||o.name=="Document")?b5n(n,e,i,r):null}function lrt(e){return art(jA.default,e)}function crt(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new jA(t,n):jA.default;return i=>art(r,i)}const w5n=sf.parser.configure({top:"SingleExpression"}),urt=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Epe.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Cpe.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:_pe.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:w5n},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:sf.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:LA.parser}],frt=[{name:"style",parser:LA.parser.configure({top:"Styles"})}].concat(irt.map(e=>({name:e,parser:sf.parser}))),$pe=Gb.define({name:"html",parser:uIn.configure({props:[i_.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let r=e.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;t=r=i}return t&&!((n=t.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?e.lineIndent(t.from)+e.unit:null}}),Sv.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:n.name=="CloseTag"?n.from:e.to}}}),nze.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),c2=$pe.configure({wrap:Fnt(urt,frt)});function drt(e={}){let t="",n;e.matchClosingTags===!1&&(t="noMatch"),e.selfClosingTags===!0&&(t=(t?t+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=Fnt((e.nestedLanguages||[]).concat(urt),(e.nestedAttributes||[]).concat(frt)));let r=n?$pe.configure({wrap:n,dialect:t}):t?c2.configure({dialect:t}):c2;return new j0(r,[c2.data.of({autocomplete:crt(e)}),e.autoCloseTags!==!1?hrt:[],trt().support,Vnt().support])}const E2e=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),hrt=Ve.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=">"&&r!="/"||!c2.isActiveAt(e.state,t,-1))return!1;let o=i(),{state:s}=o,a=s.changeByRange(l=>{var c,u,f;let d=s.doc.sliceString(l.from-1,l.to)==r,{head:h}=l,p=kr(s).resolveInner(h-1,-1),g;if((p.name=="TagName"||p.name=="StartTag")&&(p=p.parent),d&&r==">"&&p.name=="OpenTag"){if(((u=(c=p.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(g=EC(s.doc,p.parent,h))&&!E2e.has(g)){let v=h+(s.doc.sliceString(h,h+1)===">"?1:0),y=`</${g}>`;return{range:l,changes:{from:h,to:v,insert:y}}}}else if(d&&r=="/"&&p.name=="IncompleteCloseTag"){let v=p.parent;if(p.from==h-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=EC(s.doc,v,h))&&!E2e.has(g)){let y=h+(s.doc.sliceString(h,h+1)===">"?1:0),O=`${g}>`;return{range:Ae.cursor(h+O.length,-1),changes:{from:h,to:y,insert:O}}}}return{range:l}});return a.changes.empty?!1:(e.dispatch([o,s.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),S5n=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:hrt,html:drt,htmlCompletionSource:lrt,htmlCompletionSourceWith:crt,htmlLanguage:c2,htmlPlain:$pe},Symbol.toStringTag,{value:"Module"})),prt=Xz({commentTokens:{block:{open:"<!--",close:"-->"}}}),grt=new Zt,mrt=hNn.configure({props:[Sv.add(e=>!e.is("Block")||e.is("Document")||Qte(e)!=null?void 0:(t,n)=>({from:n.doc.lineAt(t.from).to,to:t.to})),grt.add(Qte),i_.add({Document:()=>null}),ky.add({Document:prt})]});function Qte(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function E5n(e,t){let n=e;for(;;){let r=n.nextSibling,i;if(!r||(i=Qte(r.type))!=null&&i<=t)break;n=r}return n.to}const C5n=F6e.of((e,t,n)=>{for(let r=kr(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let i=r.type.prop(grt);if(i==null)continue;let o=E5n(r,i);if(o>n)return{from:n,to:o}}return null});function Tpe(e){return new Wl(prt,e,[C5n],"markdown")}const yrt=Tpe(mrt),_5n=mrt.configure([ENn,_Nn,CNn,kNn,{props:[Sv.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]),Ppe=Tpe(_5n);function k5n(e,t){return n=>{if(n&&e){let r=null;if(n=/\S*/.exec(n)[0],typeof e=="function"?r=e(n):r=_e.matchLanguageName(e,n,!0),r instanceof _e)return r.support?r.support.language.parser:Kb.getSkippingParser(r.load());if(r)return r.parser}return t?t.parser:null}}let RI=class{constructor(t,n,r,i,o,s,a){this.node=t,this.from=n,this.to=r,this.spaceBefore=i,this.spaceAfter=o,this.type=s,this.item=a}blank(t,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(t!=null){for(;r.length<t;)r+=" ";return r}else{for(let i=this.to-this.from-r.length-this.spaceAfter.length;i>0;i--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(t,n){let r=this.node.name=="OrderedList"?String(+brt(this.item,t)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}};function vrt(e,t){let n=[];for(let i=e;i&&i.name!="Document";i=i.parent)(i.name=="ListItem"||i.name=="Blockquote"||i.name=="FencedCode")&&n.push(i);let r=[];for(let i=n.length-1;i>=0;i--){let o=n[i],s,a=t.lineAt(o.from),l=o.from-a.from;if(o.name=="FencedCode")r.push(new RI(o,l,l,"","","",null));else if(o.name=="Blockquote"&&(s=/^ *>( ?)/.exec(a.text.slice(l))))r.push(new RI(o,l,l+s[0].length,"",s[1],">",null));else if(o.name=="ListItem"&&o.parent.name=="OrderedList"&&(s=/^( *)\d+([.)])( *)/.exec(a.text.slice(l)))){let c=s[3],u=s[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),r.push(new RI(o.parent,l,l+u,s[1],c,s[2],o))}else if(o.name=="ListItem"&&o.parent.name=="BulletList"&&(s=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(l)))){let c=s[4],u=s[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let f=s[2];s[3]&&(f+=s[3].replace(/[xX]/," ")),r.push(new RI(o.parent,l,l+u,s[1],c,f,o))}}return r}function brt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function $H(e,t,n,r=0){for(let i=-1,o=e;;){if(o.name=="ListItem"){let a=brt(o,t),l=+a[2];if(i>=0){if(l!=i+1)return;n.push({from:o.from+a[1].length,to:o.from+a[0].length,insert:String(i+2+r)})}i=l}let s=o.nextSibling;if(!s)break;o=s}}function Ape(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(Gg)!="	")return e;let r=Ed(e,4,n),i="";for(let o=r;o>0;)o>=4?(i+="	",o-=4):(i+=" ",o--);return i+e.slice(n)}const Ort=({state:e,dispatch:t})=>{let n=kr(e),{doc:r}=e,i=null,o=e.changeByRange(s=>{if(!s.empty||!Ppe.isActiveAt(e,s.from))return i={range:s};let a=s.from,l=r.lineAt(a),c=vrt(n.resolveInner(a,-1),r);for(;c.length&&c[c.length-1].from>a-l.from;)c.pop();if(!c.length)return i={range:s};let u=c[c.length-1];if(u.to-u.spaceAfter.length>a-l.from)return i={range:s};let f=a>=u.to-u.spaceAfter.length&&!/\S/.test(l.text.slice(u.to));if(u.item&&f){let v=u.node.firstChild,y=u.node.getChild("ListItem","ListItem");if(v.to>=a||y&&y.to<a||l.from>0&&!/[^\s>]/.test(r.lineAt(l.from-1).text)){let O=c.length>1?c[c.length-2]:null,m,w="";O&&O.item?(m=l.from+O.from,w=O.marker(r,1)):m=l.from+(O?O.to:0);let S=[{from:m,to:a,insert:w}];return u.node.name=="OrderedList"&&$H(u.item,r,S,-2),O&&O.node.name=="OrderedList"&&$H(O.item,r,S),{range:Ae.cursor(m+w.length),changes:S}}else{let O=_2e(c,e,l);return{range:Ae.cursor(a+O.length+1),changes:{from:l.from,insert:O+e.lineBreak}}}}if(u.node.name=="Blockquote"&&f&&l.from){let v=r.lineAt(l.from-1),y=/>\s*$/.exec(v.text);if(y&&y.index==u.from){let O=e.changes([{from:v.from+y.index,to:v.to},{from:l.from+u.from,to:l.to}]);return{range:s.map(O),changes:O}}}let d=[];u.node.name=="OrderedList"&&$H(u.item,r,d);let h=u.item&&u.item.from<l.from,p="";if(!h||/^[\s\d.)\-+*>]*/.exec(l.text)[0].length>=u.to)for(let v=0,y=c.length-1;v<=y;v++)p+=v==y&&!h?c[v].marker(r,1):c[v].blank(v<y?Ed(l.text,4,c[v+1].from)-p.length:null);let g=a;for(;g>l.from&&/\s/.test(l.text.charAt(g-l.from-1));)g--;return p=Ape(p,e),$5n(u.node,e.doc)&&(p=_2e(c,e,l)+e.lineBreak+p),d.push({from:g,to:a,insert:e.lineBreak+p}),{range:Ae.cursor(g+p.length+1),changes:d}});return i?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)};function C2e(e){return e.name=="QuoteMark"||e.name=="ListMark"}function $5n(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return!1;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return!1;let i=t.lineAt(n.to),o=t.lineAt(r.from),s=/^[\s>]*$/.test(i.text);return i.number+(s?0:1)<o.number}function _2e(e,t,n){let r="";for(let i=0,o=e.length-2;i<=o;i++)r+=e[i].blank(i<o?Ed(n.text,4,e[i+1].from)-r.length:null,i<o);return Ape(r,t)}function T5n(e,t){let n=e.resolveInner(t,-1),r=t;C2e(n)&&(r=n.from,n=n.parent);for(let i;i=n.childBefore(r);)if(C2e(i))r=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")n=i.lastChild,r=n.to;else break;return n}const xrt=({state:e,dispatch:t})=>{let n=kr(e),r=null,i=e.changeByRange(o=>{let s=o.from,{doc:a}=e;if(o.empty&&Ppe.isActiveAt(e,o.from)){let l=a.lineAt(s),c=vrt(T5n(n,s),a);if(c.length){let u=c[c.length-1],f=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(s-l.from>f&&!/\S/.test(l.text.slice(f,s-l.from)))return{range:Ae.cursor(l.from+f),changes:{from:l.from+f,to:s}};if(s-l.from==f&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let d=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let h=u.blank(Ed(l.text,4,u.to)-Ed(l.text,4,u.from));return d==l.from&&(h=Ape(h,e)),{range:Ae.cursor(d+h.length),changes:{from:d,to:l.from+u.to,insert:h}}}if(d<s)return{range:Ae.cursor(d),changes:{from:d,to:s}}}}}return r={range:o}});return r?!1:(t(e.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},wrt=[{key:"Enter",run:Ort},{key:"Backspace",run:xrt}],Bte=drt({matchClosingTags:!1});function Srt(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=yrt,completeHTMLTags:o=!0}=e;if(!(i instanceof uB))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let s=e.extensions?[e.extensions]:[],a=[Bte.support],l;n instanceof j0?(a.push(n.support),l=n.language):n&&(l=n);let c=t||l?k5n(t,l):void 0;s.push(gNn({codeParser:c,htmlParser:Bte.language.parser})),r&&a.push(Ks.high(wi.of(wrt)));let u=Tpe(i.configure(s));return o&&a.push(u.data.of({autocomplete:P5n})),new j0(u,a)}function P5n(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=kr(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:n-r[0].length,to:n,options:A5n(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let TH=null;function A5n(){if(TH)return TH;let e=lrt(new Sle(dn.create({extensions:Bte}),0,!0));return TH=e?e.options:[]}const R5n=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:yrt,deleteMarkupBackward:xrt,insertNewlineContinueMarkup:Ort,markdown:Srt,markdownKeymap:wrt,markdownLanguage:Ppe},Symbol.toStringTag,{value:"Module"}));function We(e){return new j0(iae.define(e))}function zm(e){return Pe(()=>import("./index-Bj7JCWn6.js"),__vite__mapDeps([]),import.meta.url).then(t=>t.sql({dialect:t[e]}))}const D5n=[_e.of({name:"C",extensions:["c","h","ino"],load(){return Pe(()=>import("./index-DIiBDiRV.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.cpp())}}),_e.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return Pe(()=>import("./index-DIiBDiRV.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.cpp())}}),_e.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return zm("Cassandra")}}),_e.of({name:"CSS",extensions:["css"],load(){return Pe(()=>Promise.resolve().then(()=>LIn),void 0,import.meta.url).then(e=>e.css())}}),_e.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return Pe(()=>Promise.resolve().then(()=>S5n),void 0,import.meta.url).then(e=>e.html())}}),_e.of({name:"Java",extensions:["java"],load(){return Pe(()=>import("./index-B8ssAYfT.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.java())}}),_e.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return Pe(()=>Promise.resolve().then(()=>AI),void 0,import.meta.url).then(e=>e.javascript())}}),_e.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return Pe(()=>import("./index-VL9hpEEh.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.json())}}),_e.of({name:"JSX",extensions:["jsx"],load(){return Pe(()=>Promise.resolve().then(()=>AI),void 0,import.meta.url).then(e=>e.javascript({jsx:!0}))}}),_e.of({name:"LESS",extensions:["less"],load(){return Pe(()=>import("./index-B5p9-YL9.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.less())}}),_e.of({name:"Liquid",extensions:["liquid"],load(){return Pe(()=>import("./index-Ic0tloZN.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.liquid())}}),_e.of({name:"MariaDB SQL",load(){return zm("MariaSQL")}}),_e.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return Pe(()=>Promise.resolve().then(()=>R5n),void 0,import.meta.url).then(e=>e.markdown())}}),_e.of({name:"MS SQL",load(){return zm("MSSQL")}}),_e.of({name:"MySQL",load(){return zm("MySQL")}}),_e.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return Pe(()=>import("./index-B63hZ2rY.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.php())}}),_e.of({name:"PLSQL",extensions:["pls"],load(){return zm("PLSQL")}}),_e.of({name:"PostgreSQL",load(){return zm("PostgreSQL")}}),_e.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return Pe(()=>Promise.resolve().then(()=>wGt),void 0,import.meta.url).then(e=>e.python())}}),_e.of({name:"Rust",extensions:["rs"],load(){return Pe(()=>import("./index-D_62SrFD.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.rust())}}),_e.of({name:"Sass",extensions:["sass"],load(){return Pe(()=>import("./index-C2cu4p0i.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.sass({indented:!0}))}}),_e.of({name:"SCSS",extensions:["scss"],load(){return Pe(()=>import("./index-C2cu4p0i.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.sass())}}),_e.of({name:"SQL",extensions:["sql"],load(){return zm("StandardSQL")}}),_e.of({name:"SQLite",load(){return zm("SQLite")}}),_e.of({name:"TSX",extensions:["tsx"],load(){return Pe(()=>Promise.resolve().then(()=>AI),void 0,import.meta.url).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),_e.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return Pe(()=>Promise.resolve().then(()=>AI),void 0,import.meta.url).then(e=>e.javascript({typescript:!0}))}}),_e.of({name:"WebAssembly",extensions:["wat","wast"],load(){return Pe(()=>import("./index-DQiRLb70.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.wast())}}),_e.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return Pe(()=>import("./index-9x0-cKu4.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.xml())}}),_e.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return Pe(()=>import("./index-BOyBi27p.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.yaml())}}),_e.of({name:"APL",extensions:["dyalog","apl"],load(){return Pe(()=>import("./apl-B4CMkyY2.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.apl))}}),_e.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return Pe(()=>import("./asciiarmor-Df11BRmG.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.asciiArmor))}}),_e.of({name:"ASN.1",extensions:["asn","asn1"],load(){return Pe(()=>import("./asn1-CGOzndHr.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.asn1({})))}}),_e.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return Pe(()=>import("./asterisk-B-8jnY81.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.asterisk))}}),_e.of({name:"Brainfuck",extensions:["b","bf"],load(){return Pe(()=>import("./brainfuck-C4LP7Hcl.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.brainfuck))}}),_e.of({name:"Cobol",extensions:["cob","cpy"],load(){return Pe(()=>import("./cobol-XrqhtCFE.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.cobol))}}),_e.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return Pe(()=>import("./clike-DWq2Y8ae.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.csharp))}}),_e.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return Pe(()=>import("./clojure-BMjYHr_A.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.clojure))}}),_e.of({name:"ClojureScript",extensions:["cljs"],load(){return Pe(()=>import("./clojure-BMjYHr_A.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.clojure))}}),_e.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return Pe(()=>import("./css-BnMrqG3P.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.gss))}}),_e.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return Pe(()=>import("./cmake-BQqOBYOt.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.cmake))}}),_e.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return Pe(()=>import("./coffeescript-S37ZYGWr.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.coffeeScript))}}),_e.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return Pe(()=>import("./commonlisp-5jcOZwOE.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.commonLisp))}}),_e.of({name:"Cypher",extensions:["cyp","cypher"],load(){return Pe(()=>import("./cypher-C_CwsFkJ.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.cypher))}}),_e.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return Pe(()=>import("./python-BuPzkPfP.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.cython))}}),_e.of({name:"Crystal",extensions:["cr"],load(){return Pe(()=>import("./crystal-Bqrh1sWW.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.crystal))}}),_e.of({name:"D",extensions:["d"],load(){return Pe(()=>import("./d-pRatUO7H.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.d))}}),_e.of({name:"Dart",extensions:["dart"],load(){return Pe(()=>import("./clike-DWq2Y8ae.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.dart))}}),_e.of({name:"diff",extensions:["diff","patch"],load(){return Pe(()=>import("./diff-DbItnlRl.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.diff))}}),_e.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return Pe(()=>import("./dockerfile-CUtPLAxz.js"),__vite__mapDeps([27,28]),import.meta.url).then(e=>We(e.dockerFile))}}),_e.of({name:"DTD",extensions:["dtd"],load(){return Pe(()=>import("./dtd-DF_7sFjM.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.dtd))}}),_e.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return Pe(()=>import("./dylan-DwRh75JA.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.dylan))}}),_e.of({name:"EBNF",load(){return Pe(()=>import("./ebnf-CDyGwa7X.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.ebnf))}}),_e.of({name:"ECL",extensions:["ecl"],load(){return Pe(()=>import("./ecl-Cabwm37j.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.ecl))}}),_e.of({name:"edn",extensions:["edn"],load(){return Pe(()=>import("./clojure-BMjYHr_A.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.clojure))}}),_e.of({name:"Eiffel",extensions:["e"],load(){return Pe(()=>import("./eiffel-Bgzt68ye.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.eiffel))}}),_e.of({name:"Elm",extensions:["elm"],load(){return Pe(()=>import("./elm-vLlmbW-K.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.elm))}}),_e.of({name:"Erlang",extensions:["erl"],load(){return Pe(()=>import("./erlang-BNw1qcRV.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.erlang))}}),_e.of({name:"Esper",load(){return Pe(()=>import("./sql-C4g8LzGK.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.esper))}}),_e.of({name:"Factor",extensions:["factor"],load(){return Pe(()=>import("./factor-d5JhjZd4.js"),__vite__mapDeps([36,28]),import.meta.url).then(e=>We(e.factor))}}),_e.of({name:"FCL",load(){return Pe(()=>import("./fcl-Kvtd6kyn.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.fcl))}}),_e.of({name:"Forth",extensions:["forth","fth","4th"],load(){return Pe(()=>import("./forth-Ffai-XNe.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.forth))}}),_e.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return Pe(()=>import("./fortran-DYz_wnZ1.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.fortran))}}),_e.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return Pe(()=>import("./mllike-C_8OmSiT.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.fSharp))}}),_e.of({name:"Gas",extensions:["s"],load(){return Pe(()=>import("./gas-Bneqetm1.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.gas))}}),_e.of({name:"Gherkin",extensions:["feature"],load(){return Pe(()=>import("./gherkin-heZmZLOM.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.gherkin))}}),_e.of({name:"Go",extensions:["go"],load(){return Pe(()=>import("./go-CTD25R5P.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.go))}}),_e.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return Pe(()=>import("./groovy-DKLxxR9y.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.groovy))}}),_e.of({name:"Haskell",extensions:["hs"],load(){return Pe(()=>import("./haskell-BWDZoCOh.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.haskell))}}),_e.of({name:"Haxe",extensions:["hx"],load(){return Pe(()=>import("./haxe-pv4rovob.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.haxe))}}),_e.of({name:"HXML",extensions:["hxml"],load(){return Pe(()=>import("./haxe-pv4rovob.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.hxml))}}),_e.of({name:"HTTP",load(){return Pe(()=>import("./http-DBlCnlav.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.http))}}),_e.of({name:"IDL",extensions:["pro"],load(){return Pe(()=>import("./idl-BEugSyMb.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.idl))}}),_e.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return Pe(()=>import("./javascript-D2tAW_ZI.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.jsonld))}}),_e.of({name:"Jinja2",extensions:["j2","jinja","jinja2"],load(){return Pe(()=>import("./jinja2-C4DGRd-O.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.jinja2))}}),_e.of({name:"Julia",extensions:["jl"],load(){return Pe(()=>import("./julia-DuME0IfC.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.julia))}}),_e.of({name:"Kotlin",extensions:["kt","kts"],load(){return Pe(()=>import("./clike-DWq2Y8ae.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.kotlin))}}),_e.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return Pe(()=>import("./livescript-k3uCVVjK.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.liveScript))}}),_e.of({name:"Lua",extensions:["lua"],load(){return Pe(()=>import("./lua-BgMRiT3U.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.lua))}}),_e.of({name:"mIRC",extensions:["mrc"],load(){return Pe(()=>import("./mirc-CjQqDB4T.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.mirc))}}),_e.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return Pe(()=>import("./mathematica-DTrFuWx2.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.mathematica))}}),_e.of({name:"Modelica",extensions:["mo"],load(){return Pe(()=>import("./modelica-Dc1JOy9r.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.modelica))}}),_e.of({name:"MUMPS",extensions:["mps"],load(){return Pe(()=>import("./mumps-BT43cFF4.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.mumps))}}),_e.of({name:"Mbox",extensions:["mbox"],load(){return Pe(()=>import("./mbox-CNhZ1qSd.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.mbox))}}),_e.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return Pe(()=>import("./nginx-DdIZxoE0.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.nginx))}}),_e.of({name:"NSIS",extensions:["nsh","nsi"],load(){return Pe(()=>import("./nsis-DmB9U-bu.js"),__vite__mapDeps([59,28]),import.meta.url).then(e=>We(e.nsis))}}),_e.of({name:"NTriples",extensions:["nt","nq"],load(){return Pe(()=>import("./ntriples-BfvgReVJ.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.ntriples))}}),_e.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return Pe(()=>import("./clike-DWq2Y8ae.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.objectiveC))}}),_e.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return Pe(()=>import("./clike-DWq2Y8ae.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.objectiveCpp))}}),_e.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return Pe(()=>import("./mllike-C_8OmSiT.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.oCaml))}}),_e.of({name:"Octave",extensions:["m"],load(){return Pe(()=>import("./octave-Ck1zUtKM.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.octave))}}),_e.of({name:"Oz",extensions:["oz"],load(){return Pe(()=>import("./oz-BzwKVEFT.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.oz))}}),_e.of({name:"Pascal",extensions:["p","pas"],load(){return Pe(()=>import("./pascal-B1wCu0_E.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.pascal))}}),_e.of({name:"Perl",extensions:["pl","pm"],load(){return Pe(()=>import("./perl-CdXCOZ3F.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.perl))}}),_e.of({name:"Pig",extensions:["pig"],load(){return Pe(()=>import("./pig-CevX1Tat.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.pig))}}),_e.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return Pe(()=>import("./powershell-CFHJl5sT.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.powerShell))}}),_e.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return Pe(()=>import("./properties-C78fOPTZ.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.properties))}}),_e.of({name:"ProtoBuf",extensions:["proto"],load(){return Pe(()=>import("./protobuf-ChK-085T.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.protobuf))}}),_e.of({name:"Puppet",extensions:["pp"],load(){return Pe(()=>import("./puppet-DMA9R1ak.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.puppet))}}),_e.of({name:"Q",extensions:["q"],load(){return Pe(()=>import("./q-ZnEupP5q.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.q))}}),_e.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return Pe(()=>import("./r-DUYO_cvP.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.r))}}),_e.of({name:"RPM Changes",load(){return Pe(()=>import("./rpm-CTu-6PCP.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.rpmChanges))}}),_e.of({name:"RPM Spec",extensions:["spec"],load(){return Pe(()=>import("./rpm-CTu-6PCP.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.rpmSpec))}}),_e.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return Pe(()=>import("./ruby-B2Rjki9n.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.ruby))}}),_e.of({name:"SAS",extensions:["sas"],load(){return Pe(()=>import("./sas-B4kiWyti.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.sas))}}),_e.of({name:"Scala",extensions:["scala"],load(){return Pe(()=>import("./clike-DWq2Y8ae.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.scala))}}),_e.of({name:"Scheme",extensions:["scm","ss"],load(){return Pe(()=>import("./scheme-C41bIUwD.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.scheme))}}),_e.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return Pe(()=>import("./shell-CjFT_Tl9.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.shell))}}),_e.of({name:"Sieve",extensions:["siv","sieve"],load(){return Pe(()=>import("./sieve-C3Gn_uJK.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.sieve))}}),_e.of({name:"Smalltalk",extensions:["st"],load(){return Pe(()=>import("./smalltalk-CnHTOXQT.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.smalltalk))}}),_e.of({name:"Solr",load(){return Pe(()=>import("./solr-DwvJdyUN.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.solr))}}),_e.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return Pe(()=>import("./mllike-C_8OmSiT.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.sml))}}),_e.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return Pe(()=>import("./sparql-DkYu6x3z.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.sparql))}}),_e.of({name:"Spreadsheet",alias:["excel","formula"],load(){return Pe(()=>import("./spreadsheet-BCZA_wO0.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.spreadsheet))}}),_e.of({name:"Squirrel",extensions:["nut"],load(){return Pe(()=>import("./clike-DWq2Y8ae.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.squirrel))}}),_e.of({name:"Stylus",extensions:["styl"],load(){return Pe(()=>import("./stylus-Bj4jd1Fz.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.stylus))}}),_e.of({name:"Swift",extensions:["swift"],load(){return Pe(()=>import("./swift-BzpIVaGY.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.swift))}}),_e.of({name:"sTeX",load(){return Pe(()=>import("./stex-C3f8Ysf7.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.stex))}}),_e.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return Pe(()=>import("./stex-C3f8Ysf7.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.stex))}}),_e.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return Pe(()=>import("./verilog-C6RDOZhf.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.verilog))}}),_e.of({name:"Tcl",extensions:["tcl"],load(){return Pe(()=>import("./tcl-DVfN8rqt.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.tcl))}}),_e.of({name:"Textile",extensions:["textile"],load(){return Pe(()=>import("./textile-CnDTJFAw.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.textile))}}),_e.of({name:"TiddlyWiki",load(){return Pe(()=>import("./tiddlywiki-DO-Gjzrf.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.tiddlyWiki))}}),_e.of({name:"Tiki wiki",load(){return Pe(()=>import("./tiki-DGYXhP31.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.tiki))}}),_e.of({name:"TOML",extensions:["toml"],load(){return Pe(()=>import("./toml-BXUEaScT.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.toml))}}),_e.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return Pe(()=>import("./troff-wAsdV37c.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.troff))}}),_e.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return Pe(()=>import("./ttcn-CiGrtVSZ.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.ttcn))}}),_e.of({name:"TTCN_CFG",extensions:["cfg"],load(){return Pe(()=>import("./ttcn-cfg-BIkV9KBc.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.ttcnCfg))}}),_e.of({name:"Turtle",extensions:["ttl"],load(){return Pe(()=>import("./turtle-B1tBg_DP.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.turtle))}}),_e.of({name:"Web IDL",extensions:["webidl"],load(){return Pe(()=>import("./webidl-ZXfAyPTL.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.webIDL))}}),_e.of({name:"VB.NET",extensions:["vb"],load(){return Pe(()=>import("./vb-CmGdzxic.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.vb))}}),_e.of({name:"VBScript",extensions:["vbs"],load(){return Pe(()=>import("./vbscript-BuJXcnF6.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.vbScript))}}),_e.of({name:"Velocity",extensions:["vtl"],load(){return Pe(()=>import("./velocity-D8B20fx6.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.velocity))}}),_e.of({name:"Verilog",extensions:["v"],load(){return Pe(()=>import("./verilog-C6RDOZhf.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.verilog))}}),_e.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return Pe(()=>import("./vhdl-lSbBsy5d.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.vhdl))}}),_e.of({name:"XQuery",extensions:["xy","xquery"],load(){return Pe(()=>import("./xquery-WRlm2TX8.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.xQuery))}}),_e.of({name:"Yacas",extensions:["ys"],load(){return Pe(()=>import("./yacas-BJ4BC0dw.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.yacas))}}),_e.of({name:"Z80",extensions:["z80"],load(){return Pe(()=>import("./z80-Hz9HOZM7.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.z80))}}),_e.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return Pe(()=>import("./mscgen-BA5vi2Kp.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.mscgen))}}),_e.of({name:"Xù",extensions:["xu"],load(){return Pe(()=>import("./mscgen-BA5vi2Kp.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.xu))}}),_e.of({name:"MsGenny",extensions:["msgenny"],load(){return Pe(()=>import("./mscgen-BA5vi2Kp.js"),__vite__mapDeps([]),import.meta.url).then(e=>We(e.msgenny))}}),_e.of({name:"Vue",extensions:["vue"],load(){return Pe(()=>import("./index-BdkLV6x2.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.vue())}}),_e.of({name:"Angular Template",load(){return Pe(()=>import("./index-BgR-ektG.js"),__vite__mapDeps([]),import.meta.url).then(e=>e.angular())}})];function k2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $2e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k2e(Object(n),!0).forEach(function(r){M5n(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function M5n(e,t,n){return t=N5n(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N5n(e){var t=I5n(e,"string");return typeof t=="symbol"?t:String(t)}function I5n(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const L5n=Ert({});function Ert(e){return t.withOptions=n=>Ert($2e($2e({},e),n)),t;function t(n,...r){const i=typeof n=="string"?[n]:n.raw,{escapeSpecialCharacters:o=Array.isArray(n)}=e;let s="";for(let c=0;c<i.length;c++){let u=i[c];o&&(u=u.replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`").replace(/\\\$/g,"$").replace(/\\{/g,"{")),s+=u,c<r.length&&(s+=r[c])}const a=s.split(`
`);let l=null;for(const c of a){const u=c.match(/^(\s+)\S+/);if(u){const f=u[1].length;l?l=Math.min(l,f):l=f}}if(l!==null){const c=l;s=a.map(u=>u[0]===" "||u[0]==="	"?u.slice(c):u).join(`
`)}return s.trim().replace(/\\n/g,`
`)}}const Crt=["","f","r","fr","rf"],j5n=[['"""','"""'],["'''","'''"],['"','"'],["'","'"]],F5n=Crt.flatMap(e=>j5n.map(([t,n])=>[e+t,n])),T2e=F5n.map(([e,t])=>[e,new RegExp(`^mo\\.md\\(\\s*${e}(.*)${t}\\s*\\)$`,"s")]);class z5n{constructor(){ve(this,"type","markdown");ve(this,"lastQuotePrefix","")}transformIn(t){if(!this.isSupported(t))throw new Error("Not supported");for(const[n,r]of T2e){const i=t.match(r);if(i){const o=i[1].trim(),[s,a]=Q5n(n);this.lastQuotePrefix=s;const l=o.replaceAll(`\\${a}`,a),c=t.indexOf(o);return[L5n(l),c]}}return[t,0]}transformOut(t){const n=this.lastQuotePrefix;if(!t.includes(`
`)){const a=t.replaceAll('"','\\"'),l=`mo.md(${n}"`;return[l+a+'")',l.length]}const i=`mo.md(
    ${n}"""
`,o=t.replaceAll('"""','\\"""');return[i+B5n(o)+`
    """
)`,i.length+1]}isSupported(t){return t.trim().split(`
`).map(r=>r.startsWith("mo.md(")).filter(Boolean).length>1?!1:T2e.some(([,r])=>r.test(t))}getExtension(){return[Srt({codeLanguages:D5n,extensions:[{wrap:Ise((t,n)=>{const r=n.read(t.from,t.to),i=[],o=/{(.*?)}/g;let s;for(;(s=o.exec(r))!==null;){const a=s.index+1,l=o.lastIndex-1;i.push({from:a,to:l})}return i.length===0?null:{parser:DS.parser,overlays:i}})}]}),L8({activateOnTyping:!0,override:[W5n]}),Fle().support]}}function Q5n(e){const t=[...Crt].sort((n,r)=>r.length-n.length);for(const n of t)if(e.startsWith(n))return[n,e.slice(n.length)];return["",e]}function B5n(e){return e.split(`
`).map(t=>t.trim()===""?t:`    ${t}`).join(`
`)}const W5n=async e=>{var r;if(!e.explicit&&!e.matchBefore(/:\w*$/))return null;const t=await q5n(),n=((r=e.matchBefore(/:\w*$/))==null?void 0:r.text.slice(1))??"";return{from:e.pos-n.length-1,options:t,validFor:/^[\w:]*$/}},q5n=Y2t(async()=>{const e=await fetch("https://unpkg.com/emojilib@3.0.11/dist/emoji-en-US.json").then(t=>t.json());return Object.entries(e).map(([t,n])=>({shortcode:n[0],label:n.map(r=>`:${r}`).join(" "),emoji:t,displayLabel:`${t} ${n[0].replaceAll("_"," ")}`,apply:t,type:"emoji"}))}),_rt=mt.define({combine:e=>e[0]}),Wte=new wv,krt=jt.define();async function Rpe(e,t){const n=pn.mapValues(e,i=>sv(i)),r=await tSt({codes:n,lineLength:oNe().formatting.line_length});for(const[i,o]of pn.entries(r)){const s=n[i],a=e[i];a&&o!==s&&(t({cellId:i,code:o,formattingChange:!0}),Drt(a,o))}}function $rt(e){const t=g9t(yae());return Rpe(t,e)}function u2(e){return e?e.state.field(Nd).type:"python"}function Trt(e){return!e||u2(e)==="markdown"?!1:DO.markdown().isSupported(sv(e))||sv(e).trim()===""}function Prt(e,t,n){if(u2(t)==="markdown"){qte(t,"python");return}if(Trt(t)){if(sv(t).trim()===""){const r='mo.md(rf"")';n({cellId:e,code:r,formattingChange:!0}),Drt(t,r)}qte(t,"markdown")}}const DO={python:()=>new CGt,markdown:()=>new z5n},PH=[DO.python(),DO.markdown()],Dpe=new wv,Art=jt.define(),Nd=di.define({create(){return DO.python()},update(e,t){for(const n of t.effects)if(n.is(Art))return n.value;return e},provide:e=>I0.from(e,t=>t.type==="python"?null:U5n)});function V5n(e){const t=(n,r)=>{const i=PH[r%PH.length];return i.isSupported(n)?i:t(n,r+1)};return[wi.of([{key:"F4",preventDefault:!0,run:n=>{const r=n.state.field(Nd),i=PH.findIndex(a=>a.type===r.type),o=n.state.doc.toString(),s=t(o,i+1);return r===s?!1:(Rrt(n,s),!0)}}])]}function Rrt(e,t){const n=e.state.field(Nd),r=e.state.doc.toString(),i=e.state.facet(_rt),[o,s]=n.transformOut(r),[a,l]=t.transformIn(o);let c=e.state.selection.main.head;c+=s,c-=l,c=mae(c,0,a.length),e.dispatch({effects:[Art.of(t),Dpe.reconfigure(t.getExtension(i)),Wte.reconfigure([]),krt.of(!0)],changes:{from:0,to:e.state.doc.length,insert:a},selection:Ae.cursor(c)}),e.dispatch({effects:[Wte.reconfigure([t8()])]})}function U5n(e){const t=document.createElement("div");return t.textContent=e.state.field(Nd).type,t.style.padding="0.2rem 0.5rem",t.style.display="flex",t.style.justifyContent="flex-end",{dom:t,update(n){t.textContent=n.state.field(Nd).type}}}function H5n(e){return[_rt.of(e),V5n(),Dpe.of(DO.python().getExtension(e)),Nd]}function qte(e,t){const n=DO[t];Rrt(e,n())}function X5n(e,t){const n=e.state.field(Nd);return Dpe.reconfigure(n.getExtension(t))}function sv(e){return e.state.field(Nd).transformOut(e.state.doc.toString())[0]}function Drt(e,t){const n=e.state.field(Nd),[r]=n.transformIn(t);return e.dispatch({changes:{from:0,to:e.state.doc.length,insert:r}}),r}function Mpe(e){return[...Cv().map(n=>{const r=sv(n);return r===e?null:r}).filter(Boolean).sort((n,r)=>n.startsWith("import")&&!r.startsWith("import")?-1:!n.startsWith("import")&&r.startsWith("import")?1:0),e].join(`
`)}class Z5n extends ant{constructor(){super(...arguments);ve(this,"documentVersion",0)}_request(n,r){return this.request(n,r)}isDisabled(){return!Ptt()}async textDocumentDidOpen(n){return this.isDisabled()?n:super.textDocumentDidOpen(n)}async textDocumentCompletion(n){return this.isDisabled()?[]:super.textDocumentCompletion(n)}async textDocumentDidChange(n){return this.isDisabled()?n:super.textDocumentDidChange({...n,contentChanges:[{text:Mpe(n.contentChanges[0].text)}],textDocument:Dh.VersionedTextDocumentIdentifier.create(n.textDocument.uri,++this.documentVersion)})}textDocumentHover(n){return this.isDisabled()?Promise.resolve({contents:[]}):super.textDocumentHover(n)}signOut(){return this._request("signOut",{})}signInInitiate(){return this._request("signInInitiate",{})}signInConfirm(n){return this._request("signInConfirm",n)}async signedIn(){const{status:n,user:r}=await this._request("checkStatus",{});return At.debug("Copilot#signedIn",n,r),n==="SignedIn"||n==="AlreadySignedIn"||n==="OK"}acceptCompletion(n){return this._request("notifyAccepted",n)}rejectCompletions(n){return this._request("notifyRejected",n)}async getCompletion(n){if(this.isDisabled())return{completions:[]};const r=this.documentVersion;return this._request("getCompletions",{doc:{...n.doc,version:r}})}}async function Y5n(e,t=5){for(let n=0;n<t;n++)try{return await G5n(e)}catch{await new Promise(r=>setTimeout(r,1e3*(n+1)))}throw new Error(`Failed to connect to ${e}`)}async function G5n(e){return new Promise((t,n)=>{const r=new WebSocket(e);r.onopen=()=>{r.close(),t(e)},r.onerror=i=>{r.close(),n(new Error(`Failed to connect to ${e}: ${i.type}`))}})}const $L="/marimo.py",Npe="copilot",f7=`file://${$L}`,Mrt=K6(()=>new K5n);class K5n extends Qtt{constructor(){super();ve(this,"delegate");this.delegate=void 0}async connect(){return await RRn(),await Y5n(P2e(),3),this.delegate||(this.delegate=new q4.WebSocketTransport(P2e())),this.delegate.connect()}close(){var n;(n=this.delegate)==null||n.close()}async sendData(n,r){var i;return(i=this.delegate)==null?void 0:i.sendData(n,r)}}const tS=K6(()=>new Z5n({rootUri:f7,documentUri:f7,languageId:Npe,workspaceFolders:null,transport:Mrt()}));function J5n(){return KMn({rootUri:f7,documentUri:f7,workspaceFolders:[],transport:Mrt(),client:tS(),languageId:Npe})}function P2e(){const e=window.location.port+0;return`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.hostname}:${e}/copilot`}const Nrt=x.memo(()=>{const[e,t]=tc(PRn),[n,r]=x.useState(),[i,o]=x.useState(),[s,a]=x.useState(!1);x.useEffect(()=>{const d=tS();d.initializePromise.catch(()=>{t(!1),r("notConnected")}),d.signedIn().then(h=>{t(h),r(h?"signedIn":"signedOut")}).catch(()=>{t(!1),r("notConnected")})},[]);const l=async d=>{d.preventDefault(),a(!0);try{const h=tS(),{verificationUri:p,status:g,userCode:v}=await h.signInInitiate();g==="OK"||g==="AlreadySignedIn"?t(!0):(r("signingIn"),o({url:p,code:v}))}finally{a(!1)}},c=async d=>{if(d.preventDefault(),!i)return;const h=tS();try{a(!0);const{status:p}=await h.signInConfirm({userCode:i.code});p==="OK"||p==="AlreadySignedIn"?(t(!0),r("signedIn")):r("signInFailed")}catch{for(let p=0;p<3;p++)if(await new Promise(v=>setTimeout(v,1e3)),await h.signedIn()){t(!0),r("signedIn");return}r("signInFailed")}finally{a(!1)}},u=async d=>{d.preventDefault();const h=tS();t(!1),r("signedOut"),await h.signOut()};return(()=>{switch(n??(e?"signedIn":"connecting")){case"connecting":return b.jsx(Ls,{className:"font-normal flex",children:"Connecting..."});case"signedOut":return b.jsx(St,{onClick:l,size:"xs",variant:"link",children:"Sign in to GitHub Copilot"});case"signingIn":return b.jsxs("ol",{className:"ml-4 text-sm list-decimal [&>li]:mt-2",children:[b.jsx("li",{children:b.jsxs("div",{className:"flex items-center",children:["Copy this code:",b.jsx("strong",{className:"ml-2",children:i==null?void 0:i.code}),b.jsx(WO,{className:"ml-2 cursor-pointer opacity-60 hover:opacity-100 h-3 w-3",onClick:()=>{i&&(navigator.clipboard.writeText(i.code),yr({description:"Copied to clipboard"}))}})]})}),b.jsxs("li",{children:["Enter the code at this link:",b.jsx("a",{href:i==null?void 0:i.url,target:"_blank",rel:"noreferrer",className:pv({variant:"link",size:"xs"}),children:i==null?void 0:i.url})]}),b.jsxs("li",{children:["Click here when done:",b.jsxs(St,{size:"xs",onClick:c,className:"ml-1",children:[s&&b.jsx(Nb,{className:"h-3 w-3 mr-1 animate-spin"}),"Done"]})]})]});case"signInFailed":return b.jsxs("div",{className:"flex flex-col gap-1",children:[b.jsx("div",{className:"text-destructive text-sm",children:"Sign in failed. Please try again."}),s?b.jsx(Nb,{className:"h-3 w-3 mr-1 animate-spin"}):b.jsx(St,{onClick:l,size:"xs",variant:"link",children:"Connect to GitHub Copilot"})]});case"signedIn":return b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs(Ls,{className:"font-normal flex",children:[b.jsx(dm,{className:"h-4 w-4 mr-1"}),"Connected"]}),b.jsx(St,{onClick:u,size:"xs",variant:"text",children:"Disconnect"})]});case"notConnected":return b.jsxs("div",{className:"flex flex-col gap-1",children:[b.jsxs(Ls,{className:"font-normal flex",children:[b.jsx(rc,{className:"h-4 w-4 mr-1"}),"Unable to connect"]}),b.jsxs("div",{className:"text-sm",children:["For troubleshooting, see the"," ",b.jsx("a",{className:"hyperlink",href:"https://docs.marimo.io/getting_started/index.html#github-copilot",target:"_blank",rel:"noreferrer",children:"docs"}),"."]})]})}})()});Nrt.displayName="CopilotConfig";const Irt=({children:e})=>b.jsx("div",{className:"text-md font-semibold text-muted-foreground uppercase tracking-wide  mb-1",children:e}),iw=({children:e})=>b.jsx("div",{className:"text-sm font-semibold underline-offset-2 text-accent-foreground uppercase tracking-wide",children:e}),Lrt=({children:e})=>b.jsx("p",{className:"text-sm text-muted-foreground",children:e}),eLn=()=>{const[e,t]=fR(),n=$8({resolver:T8(Sj),defaultValues:e}),r=async o=>{await noe({config:o}).then(()=>{t(o)})},i=yp();return b.jsx(dle,{...n,children:b.jsxs("form",{onChange:n.handleSubmit(r),className:"flex flex-col gap-5",children:[b.jsxs("div",{children:[b.jsx(Irt,{children:"User Config"}),b.jsx(Lrt,{children:"Settings applied to all marimo notebooks"})]}),b.jsxs("div",{className:"flex flex-col gap-3",children:[b.jsx(iw,{children:"Editor"}),b.jsx("div",{children:b.jsx(Zn,{control:n.control,name:"save.autosave",render:({field:o})=>b.jsxs(wr,{className:"flex flex-row items-start space-x-2 space-y-0",children:[b.jsx(Sr,{children:b.jsx(kh,{"data-testid":"autosave-checkbox",checked:o.value==="after_delay",disabled:o.disabled,onCheckedChange:s=>{o.onChange(s?"after_delay":"off")}})}),b.jsx(Vn,{className:"font-normal",children:"Autosave"})]})})}),b.jsx(Zn,{control:n.control,name:"save.autosave_delay",render:({field:o})=>b.jsxs(wr,{className:"mb-2",children:[b.jsx(Vn,{children:"Autosave delay (seconds)"}),b.jsx(Sr,{children:b.jsx("span",{className:"inline-flex mr-2",children:b.jsx(Wo,{"data-testid":"autosave-delay-input",type:"number",className:"m-0 w-20 inline-flex",disabled:n.getValues("save.autosave")!=="after_delay",...o,value:o.value/1e3,min:1,onChange:s=>o.onChange(Number.parseInt(s.target.value)*1e3)})})}),b.jsx(yi,{})]})}),b.jsx("div",{children:b.jsx(Zn,{control:n.control,name:"save.format_on_save",render:({field:o})=>b.jsxs(wr,{className:"flex flex-row items-start space-x-2 space-y-0",children:[b.jsx(Sr,{children:b.jsx(kh,{"data-testid":"format-on-save-checkbox",checked:o.value,disabled:o.disabled,onCheckedChange:s=>{o.onChange(s)}})}),b.jsx(Vn,{className:"font-normal",children:"Format on save"})]})})}),b.jsx(Zn,{control:n.control,name:"formatting.line_length",render:({field:o})=>b.jsxs(wr,{className:"mb-2",children:[b.jsx(Vn,{children:"Line length"}),b.jsx(Us,{children:"Maximum line length when formatting code."}),b.jsx(Sr,{children:b.jsx("span",{className:"inline-flex mr-2",children:b.jsx(Wo,{"data-testid":"line-length-input",type:"number",className:"m-0 w-20 inline-flex",...o,value:o.value,min:1,max:1e3,onChange:s=>o.onChange(s.target.valueAsNumber)})})}),b.jsx(yi,{})]})}),b.jsx(Zn,{control:n.control,name:"completion.activate_on_typing",render:({field:o})=>b.jsxs("div",{className:"flex flex-col space-y-1",children:[b.jsxs(wr,{className:"flex flex-row items-start space-x-2 space-y-0",children:[b.jsx(Sr,{children:b.jsx(kh,{"data-testid":"autocomplete-checkbox",checked:o.value,disabled:o.disabled,onCheckedChange:s=>{o.onChange(!!s)}})}),b.jsx(Vn,{className:"font-normal",children:"Autocomplete"})]}),b.jsx(Us,{children:"When unchecked, code completion is still available through a hotkey."})]})}),b.jsx(Zn,{control:n.control,name:"keymap.preset",render:({field:o})=>b.jsxs(wr,{children:[b.jsx(Vn,{children:"Keymap"}),b.jsx(Sr,{children:b.jsx($h,{"data-testid":"keymap-select",onChange:s=>o.onChange(s.target.value),value:o.value,disabled:o.disabled,className:"inline-flex mr-2",children:kRn.map(s=>b.jsx("option",{value:s,children:s},s))})}),b.jsx(yi,{})]})})]}),b.jsxs("div",{className:"flex flex-col gap-3",children:[b.jsx(iw,{children:"Display"}),b.jsx(Zn,{control:n.control,name:"display.theme",render:({field:o})=>b.jsxs(wr,{children:[b.jsx(Vn,{children:"Theme"}),b.jsx(Sr,{children:b.jsx($h,{"data-testid":"theme-select",onChange:s=>o.onChange(s.target.value),value:o.value,disabled:o.disabled,className:"inline-flex mr-2",children:bht.map(s=>b.jsx("option",{value:s,children:s},s))})}),b.jsx(yi,{})]})}),b.jsx(Zn,{control:n.control,name:"display.code_editor_font_size",render:({field:o})=>b.jsxs(wr,{className:"mb-2",children:[b.jsx(Vn,{children:"Code editor font size"}),b.jsx(Sr,{children:b.jsx("span",{className:"inline-flex mr-2",children:b.jsx(Wo,{"data-testid":"code-editor-font-size-input",type:"number",className:"m-0 w-20 inline-flex",...o,value:o.value,min:8,max:20,onChange:s=>o.onChange(s.target.valueAsNumber)})})}),b.jsx(yi,{})]})}),b.jsx(Zn,{control:n.control,name:"display.cell_output",render:({field:o})=>b.jsxs(wr,{className:"mb-2",children:[b.jsx(Vn,{children:"Cell output area"}),b.jsx(Sr,{children:b.jsx($h,{"data-testid":"cell-output-select",onChange:s=>o.onChange(s.target.value),value:o.value,disabled:o.disabled,className:"inline-flex mr-2",children:["above","below"].map(s=>b.jsx("option",{value:s,children:s},s))})}),b.jsx(yi,{}),b.jsx(Us,{children:"Where to display cell's output."})]})})]}),b.jsxs("div",{className:"flex flex-col gap-3",children:[b.jsx(iw,{children:"Package Management"}),b.jsx(Zn,{control:n.control,disabled:i,name:"package_management.manager",render:({field:o})=>b.jsxs(wr,{children:[b.jsx(Vn,{children:"Manager"}),b.jsx(Sr,{children:b.jsx($h,{"data-testid":"package-manager-select",onChange:s=>o.onChange(s.target.value),value:o.value,disabled:o.disabled,className:"inline-flex mr-2",children:Fre.map(s=>b.jsx("option",{value:s,children:s},s))})}),b.jsx(yi,{})]})})]}),b.jsxs("div",{className:"flex flex-col gap-3",children:[b.jsx(iw,{children:"Runtime"}),b.jsx(Zn,{control:n.control,name:"runtime.auto_instantiate",render:({field:o})=>b.jsxs(wr,{className:"flex flex-row items-start space-x-2 space-y-0",children:[b.jsx(Sr,{children:b.jsx(kh,{"data-testid":"auto-instantiate-checkbox",disabled:o.disabled,checked:o.value,onCheckedChange:o.onChange})}),b.jsx(Vn,{className:"font-normal",children:"Autorun on startup"})]})})]}),b.jsxs("div",{className:"flex flex-col gap-3",children:[b.jsx(iw,{children:"AI Assist"}),b.jsxs("p",{className:"text-sm text-muted-secondary",children:["You will need to store an API key in your"," ",b.jsx(Oee,{className:"inline",children:"~/.marimo.toml"})," file. See the"," ",b.jsx("a",{className:"text-link hover:underline",href:"https://docs.marimo.io/guides/ai_completion.html",target:"_blank",rel:"noreferrer",children:"documentation"})," ","for more information."]}),b.jsx(Zn,{control:n.control,disabled:i,name:"ai.open_ai.base_url",render:({field:o})=>b.jsxs(wr,{className:"mb-2",children:[b.jsx(Vn,{children:"Base URL"}),b.jsx(Sr,{children:b.jsx(Wo,{"data-testid":"code-editor-font-size-input",className:"m-0 inline-flex",...o,value:o.value,placeholder:"https://api.openai.com",onChange:s=>o.onChange(s.target.value)})}),b.jsx(yi,{})]})}),b.jsx(Zn,{control:n.control,disabled:i,name:"ai.open_ai.model",render:({field:{value:o,onChange:s,...a}})=>b.jsxs(wr,{className:"mb-2",children:[b.jsx(Vn,{children:"Model"}),b.jsx(Sr,{children:b.jsx(Wo,{"data-testid":"code-editor-font-size-input",className:"m-0 inline-flex",...a,defaultValue:o,placeholder:"gpt-3.5-turbo",onBlur:l=>s(l.target.value)})}),b.jsx(yi,{})]})})]}),b.jsxs("div",{className:"flex flex-col gap-3",children:[b.jsx(iw,{children:"GitHub Copilot"}),b.jsx(Zn,{control:n.control,disabled:i,name:"completion.copilot",render:({field:o})=>b.jsxs("div",{className:"flex flex-col gap-2",children:[b.jsxs(wr,{className:"flex flex-row items-center space-x-2 space-y-0",children:[b.jsx(Sr,{children:b.jsx(Qb,{"data-testid":"copilot-switch",size:"sm",checked:o.value,disabled:o.disabled,onCheckedChange:s=>{o.onChange(!!s)}})}),b.jsx(Vn,{className:"font-normal flex",children:"Enable"})]}),o.value&&b.jsx(Nrt,{})]})})]})]})})},tLn=()=>{const[e,t]=Qre(),n=$8({resolver:T8(yZ),defaultValues:e}),r=async i=>{await eLe({config:i}).then(()=>{t(i)}).catch(()=>{t(i)})};return x.useEffect(()=>{window.dispatchEvent(new Event("resize"))},[e.width]),b.jsx(dle,{...n,children:b.jsxs("form",{onChange:n.handleSubmit(r),className:"flex flex-col gap-4",children:[b.jsxs("div",{children:[b.jsx(Irt,{children:"Application Config"}),b.jsx(Lrt,{children:"Settings applied to this notebook"})]}),b.jsx(Zn,{control:n.control,name:"width",render:({field:i})=>b.jsxs(wr,{children:[b.jsx(Vn,{children:"Width"}),b.jsx(Sr,{children:b.jsx($h,{"data-testid":"app-width-select",onChange:o=>i.onChange(o.target.value),value:i.value,disabled:i.disabled,className:"inline-flex mr-2",children:zre.map(o=>b.jsx("option",{value:o,children:o},o))})}),b.jsx(yi,{})]})})]})})},nLn=()=>b.jsxs(Joe,{children:[b.jsx(ese,{asChild:!0,children:b.jsx(Xi,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",color:"hint-green",children:b.jsx(Wt,{content:"Settings",children:b.jsx(ECt,{strokeWidth:1.8})})})}),b.jsxs(Az,{className:"w-80 h-[90vh] overflow-auto",align:"end",side:"bottom",onFocusOutside:e=>e.preventDefault(),children:[b.jsx(tLn,{}),b.jsx("div",{className:"h-px bg-border my-4"}),b.jsx(eLn,{})]})]}),jrt={keyBy(e,t){const n=new Map,r=new Set;for(const i of e){const o=t(i);n.has(o)&&r.add(o),n.set(o,i)}return r.size>0&&console.trace(`Duplicate keys: ${[...r].join(", ")}`),n}};var Frt={exports:{}},iM={},Vte={exports:{}};(function(e,t){(function(n,r){r(t)})(ft,function(n){function r(ce){return function(de,me,te,Ee,we,ke,je){return ce(de,me,je)}}function i(ce){return function(de,me,te,Ee){if(!de||!me||typeof de!="object"||typeof me!="object")return ce(de,me,te,Ee);var we=Ee.get(de),ke=Ee.get(me);if(we&&ke)return we===me&&ke===de;Ee.set(de,me),Ee.set(me,de);var je=ce(de,me,te,Ee);return Ee.delete(de),Ee.delete(me),je}}function o(ce,ae){var de={};for(var me in ce)de[me]=ce[me];for(var me in ae)de[me]=ae[me];return de}function s(ce){return ce.constructor===Object||ce.constructor==null}function a(ce){return typeof ce.then=="function"}function l(ce,ae){return ce===ae||ce!==ce&&ae!==ae}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",d="[object RegExp]",h="[object Map]",p="[object Number]",g="[object Object]",v="[object Set]",y="[object String]",O=Object.prototype.toString;function m(ce){var ae=ce.areArraysEqual,de=ce.areDatesEqual,me=ce.areMapsEqual,te=ce.areObjectsEqual,Ee=ce.areRegExpsEqual,we=ce.areSetsEqual,ke=ce.createIsNestedEqual,je=ke(nt);function nt(Re,G,le){if(Re===G)return!0;if(!Re||!G||typeof Re!="object"||typeof G!="object")return Re!==Re&&G!==G;if(s(Re)&&s(G))return te(Re,G,je,le);var Oe=Array.isArray(Re),Ue=Array.isArray(G);if(Oe||Ue)return Oe===Ue&&ae(Re,G,je,le);var Fe=O.call(Re);return Fe!==O.call(G)?!1:Fe===f?de(Re,G,je,le):Fe===d?Ee(Re,G,je,le):Fe===h?me(Re,G,je,le):Fe===v?we(Re,G,je,le):Fe===g||Fe===c?a(Re)||a(G)?!1:te(Re,G,je,le):Fe===u||Fe===p||Fe===y?l(Re.valueOf(),G.valueOf()):!1}return nt}function w(ce,ae,de,me){var te=ce.length;if(ae.length!==te)return!1;for(;te-- >0;)if(!de(ce[te],ae[te],te,te,ce,ae,me))return!1;return!0}var S=i(w);function E(ce,ae){return l(ce.valueOf(),ae.valueOf())}function C(ce,ae,de,me){var te=ce.size===ae.size;if(!te)return!1;if(!ce.size)return!0;var Ee={},we=0;return ce.forEach(function(ke,je){if(te){var nt=!1,Re=0;ae.forEach(function(G,le){!nt&&!Ee[Re]&&(nt=de(je,le,we,Re,ce,ae,me)&&de(ke,G,je,le,ce,ae,me))&&(Ee[Re]=!0),Re++}),we++,te=nt}}),te}var k=i(C),P="_owner",D=Object.prototype.hasOwnProperty;function M(ce,ae,de,me){var te=Object.keys(ce),Ee=te.length;if(Object.keys(ae).length!==Ee)return!1;for(var we;Ee-- >0;){if(we=te[Ee],we===P){var ke=!!ce.$$typeof,je=!!ae.$$typeof;if((ke||je)&&ke!==je)return!1}if(!D.call(ae,we)||!de(ce[we],ae[we],we,we,ce,ae,me))return!1}return!0}var L=i(M);function A(ce,ae){return ce.source===ae.source&&ce.flags===ae.flags}function T(ce,ae,de,me){var te=ce.size===ae.size;if(!te)return!1;if(!ce.size)return!0;var Ee={};return ce.forEach(function(we,ke){if(te){var je=!1,nt=0;ae.forEach(function(Re,G){!je&&!Ee[nt]&&(je=de(we,Re,ke,G,ce,ae,me))&&(Ee[nt]=!0),nt++}),te=je}}),te}var N=i(T),j=Object.freeze({areArraysEqual:w,areDatesEqual:E,areMapsEqual:C,areObjectsEqual:M,areRegExpsEqual:A,areSetsEqual:T,createIsNestedEqual:r}),z=Object.freeze({areArraysEqual:S,areDatesEqual:E,areMapsEqual:k,areObjectsEqual:L,areRegExpsEqual:A,areSetsEqual:N,createIsNestedEqual:r}),W=m(j);function F(ce,ae){return W(ce,ae,void 0)}var q=m(o(j,{createIsNestedEqual:function(){return l}}));function U(ce,ae){return q(ce,ae,void 0)}var V=m(z);function H(ce,ae){return V(ce,ae,new WeakMap)}var Z=m(o(z,{createIsNestedEqual:function(){return l}}));function ee(ce,ae){return Z(ce,ae,new WeakMap)}function se(ce){return m(o(j,ce(j)))}function fe(ce){var ae=m(o(z,ce(z)));return function(de,me,te){return te===void 0&&(te=new WeakMap),ae(de,me,te)}}n.circularDeepEqual=H,n.circularShallowEqual=ee,n.createCustomCircularEqual=fe,n.createCustomEqual=se,n.deepEqual=F,n.sameValueZeroEqual=l,n.shallowEqual=U,Object.defineProperty(n,"__esModule",{value:!0})})})(Vte,Vte.exports);var Ipe=Vte.exports,Ute={exports:{}};function zrt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=zrt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function A2e(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=zrt(e))&&(r&&(r+=" "),r+=t);return r}Ute.exports=A2e,Ute.exports.clsx=A2e;var Lpe=Ute.exports,Cn={},rLn=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(Cn,"__esModule",{value:!0});Cn.bottom=jpe;Cn.childrenEqual=sLn;Cn.cloneLayout=Qrt;Cn.cloneLayoutItem=bb;Cn.collides=fB;Cn.compact=Wrt;Cn.compactItem=qrt;Cn.compactType=OLn;Cn.correctBounds=Vrt;Cn.fastPositionEqual=aLn;Cn.fastRGLPropsEqual=void 0;Cn.getAllCollisions=Urt;Cn.getFirstCollision=X1;Cn.getLayoutItem=Fpe;Cn.getStatics=zpe;Cn.modifyLayout=Brt;Cn.moveElement=rT;Cn.moveElementAwayFromCollision=Xte;Cn.noop=void 0;Cn.perc=cLn;Cn.resizeItemInDirection=gLn;Cn.setTopLeft=yLn;Cn.setTransform=mLn;Cn.sortLayoutItems=Upe;Cn.sortLayoutItemsByColRow=Grt;Cn.sortLayoutItemsByRowCol=Yrt;Cn.synchronizeLayoutWithChildren=vLn;Cn.validateLayout=bLn;Cn.withLayoutItem=oLn;var R2e=Ipe,nT=iLn(x);function iLn(e){return e&&e.__esModule?e:{default:e}}function jpe(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function Qrt(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=bb(e[n]);return t}function Brt(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function oLn(e,t,n){let r=Fpe(e,t);return r?(r=n(bb(r)),e=Brt(e,r),[e,r]):[e,null]}function bb(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function sLn(e,t){return(0,R2e.deepEqual)(nT.default.Children.map(e,n=>n==null?void 0:n.key),nT.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,R2e.deepEqual)(nT.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),nT.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Cn.fastRGLPropsEqual=rLn;function aLn(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function fB(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Wrt(e,t,n,r){const i=zpe(e),o=Upe(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=bb(o[a]);c.static||(c=qrt(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const lLn={x:"w",y:"h"};function Hte(e,t,n,r){const i=lLn[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;fB(t,a)&&Hte(e,a,n+t[i],r)}}t[r]=n}function qrt(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(jpe(e),t.y);t.y>0&&!X1(e,t);)t.y--;else if(a)for(;t.x>0&&!X1(e,t);)t.x--;let l;for(;(l=X1(e,t))&&!(n===null&&o);)if(a?Hte(i,t,l.x+l.w,"x"):Hte(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!X1(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function Vrt(e,t){const n=zpe(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;X1(n,o);)o.y++}return e}function Fpe(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function X1(e,t){for(let n=0,r=e.length;n<r;n++)if(fB(e[n],t))return e[n]}function Urt(e,t){return e.filter(n=>fB(n,t))}function zpe(e){return e.filter(t=>t.static)}function rT(e,t,n,r,i,o,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=Upe(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const h=Urt(f,t),p=h.length>0;if(p&&l)return Qrt(e);if(p&&o)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let g=0,v=h.length;g<v;g++){const y=h[g];`${t.i}${t.x}${t.y}${y.i}${y.x}${y.y}`,!y.moved&&(y.static?e=Xte(e,y,t,i,s):e=Xte(e,t,y,i,s))}return e}function Xte(e,t,n,r,i,o){const s=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},d=X1(e,f),h=d&&d.y+d.h>t.y,p=d&&t.x+t.w>d.x;if(d){if(h&&a)return rT(e,n,void 0,t.y+1,r,l,i);if(h&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(p&&s)return rT(e,t,n.x,void 0,r,l,i)}else return`${n.i}${f.x}${f.y}`,rT(e,n,s?f.x:void 0,a?f.y:void 0,r,l,i)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:rT(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function cLn(e){return e*100+"%"}const Hrt=(e,t,n,r)=>e+n>r?t:n,Xrt=(e,t,n)=>e<0?t:n,Zrt=e=>Math.max(0,e),Qpe=e=>Math.max(0,e),Bpe=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:Xrt(s,e.height,i),top:Qpe(s)}},Wpe=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:Hrt(e.left,e.width,s,n),left:Zrt(i)}},qpe=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:Hrt(e.left,e.width,o,n),top:Qpe(r),left:Zrt(s)}},Vpe=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:Xrt(r,e.height,o),top:Qpe(r)}},uLn=function(){return Bpe(arguments.length<=0?void 0:arguments[0],Wpe(...arguments))},fLn=function(){return Bpe(arguments.length<=0?void 0:arguments[0],qpe(...arguments))},dLn=function(){return Vpe(arguments.length<=0?void 0:arguments[0],Wpe(...arguments))},hLn=function(){return Vpe(arguments.length<=0?void 0:arguments[0],qpe(...arguments))},pLn={n:Bpe,ne:uLn,e:Wpe,se:dLn,s:Vpe,sw:hLn,w:qpe,nw:fLn};function gLn(e,t,n,r){const i=pLn[e];return i?i(t,{...t,...n},r):n}function mLn(e){let{top:t,left:n,width:r,height:i}=e;const o=`translate(${n}px,${t}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${r}px`,height:`${i}px`,position:"absolute"}}function yLn(e){let{top:t,left:n,width:r,height:i}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${i}px`,position:"absolute"}}function Upe(e,t){return t==="horizontal"?Grt(e):t==="vertical"?Yrt(e):e}function Yrt(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function Grt(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function vLn(e,t,n,r,i){e=e||[];const o=[];nT.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Fpe(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(bb(l)):c?o.push(bb({...c,i:a.key})):o.push(bb({w:1,h:1,x:0,y:jpe(o),i:String(a.key)}))});const s=Vrt(o,{cols:n});return i?s:Wrt(s,r,n)}function bLn(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++)if(typeof o[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function OLn(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const xLn=()=>{};Cn.noop=xLn;var Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.calcGridColWidth=dB;Ip.calcGridItemPosition=wLn;Ip.calcGridItemWHPx=Zte;Ip.calcWH=ELn;Ip.calcXY=SLn;Ip.clamp=Z1;function dB(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Zte(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function wLn(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=dB(e),u={};return o&&o.resizing?(u.width=Math.round(o.resizing.width),u.height=Math.round(o.resizing.height)):(u.width=Zte(r,c,s[0]),u.height=Zte(i,l,s[1])),o&&o.dragging?(u.top=Math.round(o.dragging.top),u.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(u.top=Math.round(o.resizing.top),u.left=Math.round(o.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function SLn(e,t,n,r,i){const{margin:o,cols:s,rowHeight:a,maxRows:l}=e,c=dB(e);let u=Math.round((n-o[0])/(c+o[0])),f=Math.round((t-o[1])/(a+o[1]));return u=Z1(u,0,s-r),f=Z1(f,0,l-i),{x:u,y:f}}function ELn(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=dB(e);let f=Math.round((t+s[0])/(u+s[0])),d=Math.round((n+s[1])/(c+s[1])),h=Z1(f,0,l-r),p=Z1(d,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(h=Z1(f,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(p=Z1(d,0,a)),{w:h,h:p}}function Z1(e,t,n){return Math.max(Math.min(e,n),t)}var hB={},pB={exports:{}},Krt={};function Jrt(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Jrt(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function D2e(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Jrt(e))&&(r&&(r+=" "),r+=t);return r}const CLn=Object.freeze(Object.defineProperty({__proto__:null,clsx:D2e,default:D2e},Symbol.toStringTag,{value:"Module"})),_Ln=cu(CLn);var Ki={},Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});Lp.dontSetMe=ALn;Lp.findInArray=kLn;Lp.int=PLn;Lp.isFunction=$Ln;Lp.isNum=TLn;function kLn(e,t){for(var n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function $Ln(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function TLn(e){return typeof e=="number"&&!isNaN(e)}function PLn(e){return parseInt(e,10)}function ALn(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var xx={};Object.defineProperty(xx,"__esModule",{value:!0});xx.browserPrefixToKey=tit;xx.browserPrefixToStyle=RLn;xx.default=void 0;xx.getPrefix=eit;var AH=["Moz","Webkit","O","ms"];function eit(){var e,t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";var r=(e=window.document)===null||e===void 0||(t=e.documentElement)===null||t===void 0?void 0:t.style;if(!r||n in r)return"";for(var i=0;i<AH.length;i++)if(tit(n,AH[i])in r)return AH[i];return""}function tit(e,t){return t?"".concat(t).concat(DLn(e)):e}function RLn(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function DLn(e){for(var t="",n=!0,r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}var MLn=eit();xx.default=MLn;function Yte(e){"@babel/helpers - typeof";return Yte=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yte(e)}Object.defineProperty(Ki,"__esModule",{value:!0});Ki.addClassName=sit;Ki.addEvent=LLn;Ki.addUserSelectStyles=XLn;Ki.createCSSTransform=qLn;Ki.createSVGTransform=VLn;Ki.getTouch=ULn;Ki.getTouchIdentifier=HLn;Ki.getTranslation=Hpe;Ki.innerHeight=QLn;Ki.innerWidth=BLn;Ki.matchesSelector=oit;Ki.matchesSelectorAndParentsTo=ILn;Ki.offsetXYFromParent=WLn;Ki.outerHeight=FLn;Ki.outerWidth=zLn;Ki.removeClassName=ait;Ki.removeEvent=jLn;Ki.removeUserSelectStyles=ZLn;var Jc=Lp,M2e=NLn(xx);function nit(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(nit=function(i){return i?n:t})(e)}function NLn(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||Yte(e)!=="object"&&typeof e!="function")return{default:e};var n=nit(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function N2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rit(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N2e(Object(n),!0).forEach(function(r){iit(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iit(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var DI="";function oit(e,t){return DI||(DI=(0,Jc.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Jc.isFunction)(e[n])})),(0,Jc.isFunction)(e[DI])?e[DI](t):!1}function ILn(e,t,n){var r=e;do{if(oit(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function LLn(e,t,n,r){if(e){var i=rit({capture:!0},r);e.addEventListener?e.addEventListener(t,n,i):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}}function jLn(e,t,n,r){if(e){var i=rit({capture:!0},r);e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}}function FLn(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Jc.int)(n.borderTopWidth),t+=(0,Jc.int)(n.borderBottomWidth),t}function zLn(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Jc.int)(n.borderLeftWidth),t+=(0,Jc.int)(n.borderRightWidth),t}function QLn(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Jc.int)(n.paddingTop),t-=(0,Jc.int)(n.paddingBottom),t}function BLn(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Jc.int)(n.paddingLeft),t-=(0,Jc.int)(n.paddingRight),t}function WLn(e,t,n){var r=t===t.ownerDocument.body,i=r?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-i.left)/n,s=(e.clientY+t.scrollTop-i.top)/n;return{x:o,y:s}}function qLn(e,t){var n=Hpe(e,t,"px");return iit({},(0,M2e.browserPrefixToKey)("transform",M2e.default),n)}function VLn(e,t){var n=Hpe(e,t,"");return n}function Hpe(e,t,n){var r=e.x,i=e.y,o="translate(".concat(r).concat(n,",").concat(i).concat(n,")");if(t){var s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);o="translate(".concat(s,", ").concat(a,")")+o}return o}function ULn(e,t){return e.targetTouches&&(0,Jc.findInArray)(e.targetTouches,function(n){return t===n.identifier})||e.changedTouches&&(0,Jc.findInArray)(e.changedTouches,function(n){return t===n.identifier})}function HLn(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function XLn(e){if(e){var t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&sit(e.body,"react-draggable-transparent-selection")}}function ZLn(e){if(e)try{if(e.body&&ait(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{var t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function sit(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function ait(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var jp={};Object.defineProperty(jp,"__esModule",{value:!0});jp.canDragX=KLn;jp.canDragY=JLn;jp.createCoreData=tjn;jp.createDraggableData=njn;jp.getBoundPosition=YLn;jp.getControlPosition=ejn;jp.snapToGrid=GLn;var Cc=Lp,nS=Ki;function YLn(e,t,n){if(!e.props.bounds)return[t,n];var r=e.props.bounds;r=typeof r=="string"?r:rjn(r);var i=Xpe(e);if(typeof r=="string"){var o=i.ownerDocument,s=o.defaultView,a;if(r==="parent"?a=i.parentNode:a=o.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');var l=a,c=s.getComputedStyle(i),u=s.getComputedStyle(l);r={left:-i.offsetLeft+(0,Cc.int)(u.paddingLeft)+(0,Cc.int)(c.marginLeft),top:-i.offsetTop+(0,Cc.int)(u.paddingTop)+(0,Cc.int)(c.marginTop),right:(0,nS.innerWidth)(l)-(0,nS.outerWidth)(i)-i.offsetLeft+(0,Cc.int)(u.paddingRight)-(0,Cc.int)(c.marginRight),bottom:(0,nS.innerHeight)(l)-(0,nS.outerHeight)(i)-i.offsetTop+(0,Cc.int)(u.paddingBottom)-(0,Cc.int)(c.marginBottom)}}return(0,Cc.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Cc.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Cc.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Cc.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function GLn(e,t,n){var r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function KLn(e){return e.props.axis==="both"||e.props.axis==="x"}function JLn(e){return e.props.axis==="both"||e.props.axis==="y"}function ejn(e,t,n){var r=typeof t=="number"?(0,nS.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;var i=Xpe(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,nS.offsetXYFromParent)(r||e,o,n.props.scale)}function tjn(e,t,n){var r=e.state,i=!(0,Cc.isNum)(r.lastX),o=Xpe(e);return i?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-r.lastX,deltaY:n-r.lastY,lastX:r.lastX,lastY:r.lastY,x:t,y:n}}function njn(e,t){var n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function rjn(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Xpe(e){var t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var gB={},mB={};Object.defineProperty(mB,"__esModule",{value:!0});mB.default=ijn;function ijn(){}function d7(e){"@babel/helpers - typeof";return d7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d7(e)}Object.defineProperty(gB,"__esModule",{value:!0});gB.default=void 0;var RH=sjn(x),Sc=Zpe(lm),ojn=Zpe(as),la=Ki,Qm=jp,DH=Lp,i$=Zpe(mB);function Zpe(e){return e&&e.__esModule?e:{default:e}}function lit(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(lit=function(i){return i?n:t})(e)}function sjn(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||d7(e)!=="object"&&typeof e!="function")return{default:e};var n=lit(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function I2e(e,t){return ujn(e)||cjn(e,t)||ljn(e,t)||ajn()}function ajn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ljn(e,t){if(e){if(typeof e=="string")return L2e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L2e(e,t)}}function L2e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cjn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function ujn(e){if(Array.isArray(e))return e}function fjn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j2e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function djn(e,t,n){return t&&j2e(e.prototype,t),n&&j2e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hjn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gte(e,t)}function Gte(e,t){return Gte=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Gte(e,t)}function pjn(e){var t=mjn();return function(){var r=h7(e),i;if(t){var o=h7(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return gjn(this,i)}}function gjn(e,t){if(t&&(d7(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return da(e)}function da(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mjn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h7(e){return h7=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},h7(e)}function xu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zf={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},Bm=zf.mouse,yB=function(e){hjn(n,e);var t=pjn(n);function n(){var r;fjn(this,n);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=t.call.apply(t,[this].concat(o)),xu(da(r),"state",{dragging:!1,lastX:NaN,lastY:NaN,touchIdentifier:null}),xu(da(r),"mounted",!1),xu(da(r),"handleDragStart",function(a){if(r.props.onMouseDown(a),!r.props.allowAnyClick&&typeof a.button=="number"&&a.button!==0)return!1;var l=r.findDOMNode();if(!l||!l.ownerDocument||!l.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");var c=l.ownerDocument;if(!(r.props.disabled||!(a.target instanceof c.defaultView.Node)||r.props.handle&&!(0,la.matchesSelectorAndParentsTo)(a.target,r.props.handle,l)||r.props.cancel&&(0,la.matchesSelectorAndParentsTo)(a.target,r.props.cancel,l))){a.type==="touchstart"&&a.preventDefault();var u=(0,la.getTouchIdentifier)(a);r.setState({touchIdentifier:u});var f=(0,Qm.getControlPosition)(a,u,da(r));if(f!=null){var d=f.x,h=f.y,p=(0,Qm.createCoreData)(da(r),d,h);(0,i$.default)("DraggableCore: handleDragStart: %j",p),(0,i$.default)("calling",r.props.onStart);var g=r.props.onStart(a,p);g===!1||r.mounted===!1||(r.props.enableUserSelectHack&&(0,la.addUserSelectStyles)(c),r.setState({dragging:!0,lastX:d,lastY:h}),(0,la.addEvent)(c,Bm.move,r.handleDrag),(0,la.addEvent)(c,Bm.stop,r.handleDragStop))}}}),xu(da(r),"handleDrag",function(a){var l=(0,Qm.getControlPosition)(a,r.state.touchIdentifier,da(r));if(l!=null){var c=l.x,u=l.y;if(Array.isArray(r.props.grid)){var f=c-r.state.lastX,d=u-r.state.lastY,h=(0,Qm.snapToGrid)(r.props.grid,f,d),p=I2e(h,2);if(f=p[0],d=p[1],!f&&!d)return;c=r.state.lastX+f,u=r.state.lastY+d}var g=(0,Qm.createCoreData)(da(r),c,u);(0,i$.default)("DraggableCore: handleDrag: %j",g);var v=r.props.onDrag(a,g);if(v===!1||r.mounted===!1){try{r.handleDragStop(new MouseEvent("mouseup"))}catch{var y=document.createEvent("MouseEvents");y.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),r.handleDragStop(y)}return}r.setState({lastX:c,lastY:u})}}),xu(da(r),"handleDragStop",function(a){if(r.state.dragging){var l=(0,Qm.getControlPosition)(a,r.state.touchIdentifier,da(r));if(l!=null){var c=l.x,u=l.y;if(Array.isArray(r.props.grid)){var f=c-r.state.lastX||0,d=u-r.state.lastY||0,h=(0,Qm.snapToGrid)(r.props.grid,f,d),p=I2e(h,2);f=p[0],d=p[1],c=r.state.lastX+f,u=r.state.lastY+d}var g=(0,Qm.createCoreData)(da(r),c,u),v=r.props.onStop(a,g);if(v===!1||r.mounted===!1)return!1;var y=r.findDOMNode();y&&r.props.enableUserSelectHack&&(0,la.removeUserSelectStyles)(y.ownerDocument),(0,i$.default)("DraggableCore: handleDragStop: %j",g),r.setState({dragging:!1,lastX:NaN,lastY:NaN}),y&&((0,i$.default)("DraggableCore: Removing handlers"),(0,la.removeEvent)(y.ownerDocument,Bm.move,r.handleDrag),(0,la.removeEvent)(y.ownerDocument,Bm.stop,r.handleDragStop))}}}),xu(da(r),"onMouseDown",function(a){return Bm=zf.mouse,r.handleDragStart(a)}),xu(da(r),"onMouseUp",function(a){return Bm=zf.mouse,r.handleDragStop(a)}),xu(da(r),"onTouchStart",function(a){return Bm=zf.touch,r.handleDragStart(a)}),xu(da(r),"onTouchEnd",function(a){return Bm=zf.touch,r.handleDragStop(a)}),r}return djn(n,[{key:"componentDidMount",value:function(){this.mounted=!0;var i=this.findDOMNode();i&&(0,la.addEvent)(i,zf.touch.start,this.onTouchStart,{passive:!1})}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.findDOMNode();if(i){var o=i.ownerDocument;(0,la.removeEvent)(o,zf.mouse.move,this.handleDrag),(0,la.removeEvent)(o,zf.touch.move,this.handleDrag),(0,la.removeEvent)(o,zf.mouse.stop,this.handleDragStop),(0,la.removeEvent)(o,zf.touch.stop,this.handleDragStop),(0,la.removeEvent)(i,zf.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,la.removeUserSelectStyles)(o)}}},{key:"findDOMNode",value:function(){var i,o,s;return(i=this.props)!==null&&i!==void 0&&i.nodeRef?(o=this.props)===null||o===void 0||(s=o.nodeRef)===null||s===void 0?void 0:s.current:ojn.default.findDOMNode(this)}},{key:"render",value:function(){return RH.cloneElement(RH.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}]),n}(RH.Component);gB.default=yB;xu(yB,"displayName","DraggableCore");xu(yB,"propTypes",{allowAnyClick:Sc.default.bool,disabled:Sc.default.bool,enableUserSelectHack:Sc.default.bool,offsetParent:function(t,n){if(t[n]&&t[n].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Sc.default.arrayOf(Sc.default.number),handle:Sc.default.string,cancel:Sc.default.string,nodeRef:Sc.default.object,onStart:Sc.default.func,onDrag:Sc.default.func,onStop:Sc.default.func,onMouseDown:Sc.default.func,scale:Sc.default.number,className:DH.dontSetMe,style:DH.dontSetMe,transform:DH.dontSetMe});xu(yB,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){function t(V){"@babel/helpers - typeof";return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},t(V)}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var n=p(x),r=d(lm),i=d(as),o=d(_Ln),s=Ki,a=jp,l=Lp,c=d(gB),u=d(mB),f=["axis","bounds","children","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"];function d(V){return V&&V.__esModule?V:{default:V}}function h(V){if(typeof WeakMap!="function")return null;var H=new WeakMap,Z=new WeakMap;return(h=function(se){return se?Z:H})(V)}function p(V,H){if(!H&&V&&V.__esModule)return V;if(V===null||t(V)!=="object"&&typeof V!="function")return{default:V};var Z=h(H);if(Z&&Z.has(V))return Z.get(V);var ee={},se=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var fe in V)if(fe!=="default"&&Object.prototype.hasOwnProperty.call(V,fe)){var ce=se?Object.getOwnPropertyDescriptor(V,fe):null;ce&&(ce.get||ce.set)?Object.defineProperty(ee,fe,ce):ee[fe]=V[fe]}return ee.default=V,Z&&Z.set(V,ee),ee}function g(){return g=Object.assign||function(V){for(var H=1;H<arguments.length;H++){var Z=arguments[H];for(var ee in Z)Object.prototype.hasOwnProperty.call(Z,ee)&&(V[ee]=Z[ee])}return V},g.apply(this,arguments)}function v(V,H){if(V==null)return{};var Z=y(V,H),ee,se;if(Object.getOwnPropertySymbols){var fe=Object.getOwnPropertySymbols(V);for(se=0;se<fe.length;se++)ee=fe[se],!(H.indexOf(ee)>=0)&&Object.prototype.propertyIsEnumerable.call(V,ee)&&(Z[ee]=V[ee])}return Z}function y(V,H){if(V==null)return{};var Z={},ee=Object.keys(V),se,fe;for(fe=0;fe<ee.length;fe++)se=ee[fe],!(H.indexOf(se)>=0)&&(Z[se]=V[se]);return Z}function O(V,H){var Z=Object.keys(V);if(Object.getOwnPropertySymbols){var ee=Object.getOwnPropertySymbols(V);H&&(ee=ee.filter(function(se){return Object.getOwnPropertyDescriptor(V,se).enumerable})),Z.push.apply(Z,ee)}return Z}function m(V){for(var H=1;H<arguments.length;H++){var Z=arguments[H]!=null?arguments[H]:{};H%2?O(Object(Z),!0).forEach(function(ee){q(V,ee,Z[ee])}):Object.getOwnPropertyDescriptors?Object.defineProperties(V,Object.getOwnPropertyDescriptors(Z)):O(Object(Z)).forEach(function(ee){Object.defineProperty(V,ee,Object.getOwnPropertyDescriptor(Z,ee))})}return V}function w(V,H){return P(V)||k(V,H)||E(V,H)||S()}function S(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E(V,H){if(V){if(typeof V=="string")return C(V,H);var Z=Object.prototype.toString.call(V).slice(8,-1);if(Z==="Object"&&V.constructor&&(Z=V.constructor.name),Z==="Map"||Z==="Set")return Array.from(V);if(Z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z))return C(V,H)}}function C(V,H){(H==null||H>V.length)&&(H=V.length);for(var Z=0,ee=new Array(H);Z<H;Z++)ee[Z]=V[Z];return ee}function k(V,H){var Z=V==null?null:typeof Symbol<"u"&&V[Symbol.iterator]||V["@@iterator"];if(Z!=null){var ee=[],se=!0,fe=!1,ce,ae;try{for(Z=Z.call(V);!(se=(ce=Z.next()).done)&&(ee.push(ce.value),!(H&&ee.length===H));se=!0);}catch(de){fe=!0,ae=de}finally{try{!se&&Z.return!=null&&Z.return()}finally{if(fe)throw ae}}return ee}}function P(V){if(Array.isArray(V))return V}function D(V,H){if(!(V instanceof H))throw new TypeError("Cannot call a class as a function")}function M(V,H){for(var Z=0;Z<H.length;Z++){var ee=H[Z];ee.enumerable=ee.enumerable||!1,ee.configurable=!0,"value"in ee&&(ee.writable=!0),Object.defineProperty(V,ee.key,ee)}}function L(V,H,Z){return H&&M(V.prototype,H),Z&&M(V,Z),Object.defineProperty(V,"prototype",{writable:!1}),V}function A(V,H){if(typeof H!="function"&&H!==null)throw new TypeError("Super expression must either be null or a function");V.prototype=Object.create(H&&H.prototype,{constructor:{value:V,writable:!0,configurable:!0}}),Object.defineProperty(V,"prototype",{writable:!1}),H&&T(V,H)}function T(V,H){return T=Object.setPrototypeOf||function(ee,se){return ee.__proto__=se,ee},T(V,H)}function N(V){var H=W();return function(){var ee=F(V),se;if(H){var fe=F(this).constructor;se=Reflect.construct(ee,arguments,fe)}else se=ee.apply(this,arguments);return j(this,se)}}function j(V,H){if(H&&(t(H)==="object"||typeof H=="function"))return H;if(H!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return z(V)}function z(V){if(V===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V}function W(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function F(V){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},F(V)}function q(V,H,Z){return H in V?Object.defineProperty(V,H,{value:Z,enumerable:!0,configurable:!0,writable:!0}):V[H]=Z,V}var U=function(V){A(Z,V);var H=N(Z);function Z(ee){var se;return D(this,Z),se=H.call(this,ee),q(z(se),"onDragStart",function(fe,ce){(0,u.default)("Draggable: onDragStart: %j",ce);var ae=se.props.onStart(fe,(0,a.createDraggableData)(z(se),ce));if(ae===!1)return!1;se.setState({dragging:!0,dragged:!0})}),q(z(se),"onDrag",function(fe,ce){if(!se.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",ce);var ae=(0,a.createDraggableData)(z(se),ce),de={x:ae.x,y:ae.y};if(se.props.bounds){var me=de.x,te=de.y;de.x+=se.state.slackX,de.y+=se.state.slackY;var Ee=(0,a.getBoundPosition)(z(se),de.x,de.y),we=w(Ee,2),ke=we[0],je=we[1];de.x=ke,de.y=je,de.slackX=se.state.slackX+(me-de.x),de.slackY=se.state.slackY+(te-de.y),ae.x=de.x,ae.y=de.y,ae.deltaX=de.x-se.state.x,ae.deltaY=de.y-se.state.y}var nt=se.props.onDrag(fe,ae);if(nt===!1)return!1;se.setState(de)}),q(z(se),"onDragStop",function(fe,ce){if(!se.state.dragging)return!1;var ae=se.props.onStop(fe,(0,a.createDraggableData)(z(se),ce));if(ae===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",ce);var de={dragging:!1,slackX:0,slackY:0},me=!!se.props.position;if(me){var te=se.props.position,Ee=te.x,we=te.y;de.x=Ee,de.y=we}se.setState(de)}),se.state={dragging:!1,dragged:!1,x:ee.position?ee.position.x:ee.defaultPosition.x,y:ee.position?ee.position.y:ee.defaultPosition.y,prevPropsPosition:m({},ee.position),slackX:0,slackY:0,isElementSVG:!1},ee.position&&!(ee.onDrag||ee.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),se}return L(Z,[{key:"componentDidMount",value:function(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"findDOMNode",value:function(){var se,fe,ce;return(se=(fe=this.props)===null||fe===void 0||(ce=fe.nodeRef)===null||ce===void 0?void 0:ce.current)!==null&&se!==void 0?se:i.default.findDOMNode(this)}},{key:"render",value:function(){var se,fe=this.props;fe.axis,fe.bounds;var ce=fe.children,ae=fe.defaultPosition,de=fe.defaultClassName,me=fe.defaultClassNameDragging,te=fe.defaultClassNameDragged,Ee=fe.position,we=fe.positionOffset;fe.scale;var ke=v(fe,f),je={},nt=null,Re=!!Ee,G=!Re||this.state.dragging,le=Ee||ae,Oe={x:(0,a.canDragX)(this)&&G?this.state.x:le.x,y:(0,a.canDragY)(this)&&G?this.state.y:le.y};this.state.isElementSVG?nt=(0,s.createSVGTransform)(Oe,we):je=(0,s.createCSSTransform)(Oe,we);var Ue=(0,o.default)(ce.props.className||"",de,(se={},q(se,me,this.state.dragging),q(se,te,this.state.dragged),se));return n.createElement(c.default,g({},ke,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),n.cloneElement(n.Children.only(ce),{className:Ue,style:m(m({},ce.props.style),je),transform:nt}))}}],[{key:"getDerivedStateFromProps",value:function(se,fe){var ce=se.position,ae=fe.prevPropsPosition;return ce&&(!ae||ce.x!==ae.x||ce.y!==ae.y)?((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:ce,prevPropsPosition:ae}),{x:ce.x,y:ce.y,prevPropsPosition:m({},ce)}):null}}]),Z}(n.Component);e.default=U,q(U,"displayName","Draggable"),q(U,"propTypes",m(m({},c.default.propTypes),{},{axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe})),q(U,"defaultProps",m(m({},c.default.defaultProps),{},{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1}))})(Krt);var cit=Krt,uit=cit.default,yjn=cit.DraggableCore;pB.exports=uit;pB.exports.default=uit;pB.exports.DraggableCore=yjn;var fit=pB.exports,vB={exports:{}},oM={},Ype={};Ype.__esModule=!0;Ype.cloneElement=Sjn;var vjn=bjn(x);function bjn(e){return e&&e.__esModule?e:{default:e}}function F2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function z2e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F2e(Object(n),!0).forEach(function(r){Ojn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ojn(e,t,n){return t=xjn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xjn(e){var t=wjn(e,"string");return typeof t=="symbol"?t:String(t)}function wjn(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sjn(e,t){return t.style&&e.props.style&&(t.style=z2e(z2e({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),vjn.default.cloneElement(e,t)}var sM={};sM.__esModule=!0;sM.resizableProps=void 0;var fn=Ejn(lm);function Ejn(e){return e&&e.__esModule?e:{default:e}}var Cjn={axis:fn.default.oneOf(["both","x","y","none"]),className:fn.default.string,children:fn.default.element.isRequired,draggableOpts:fn.default.shape({allowAnyClick:fn.default.bool,cancel:fn.default.string,children:fn.default.node,disabled:fn.default.bool,enableUserSelectHack:fn.default.bool,offsetParent:fn.default.node,grid:fn.default.arrayOf(fn.default.number),handle:fn.default.string,nodeRef:fn.default.object,onStart:fn.default.func,onDrag:fn.default.func,onStop:fn.default.func,onMouseDown:fn.default.func,scale:fn.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="y"){var o;return(o=fn.default.number).isRequired.apply(o,n)}return fn.default.number.apply(fn.default,n)},handle:fn.default.oneOfType([fn.default.node,fn.default.func]),handleSize:fn.default.arrayOf(fn.default.number),lockAspectRatio:fn.default.bool,maxConstraints:fn.default.arrayOf(fn.default.number),minConstraints:fn.default.arrayOf(fn.default.number),onResizeStop:fn.default.func,onResizeStart:fn.default.func,onResize:fn.default.func,resizeHandles:fn.default.arrayOf(fn.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:fn.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(i.axis==="both"||i.axis==="x"){var o;return(o=fn.default.number).isRequired.apply(o,n)}return fn.default.number.apply(fn.default,n)}};sM.resizableProps=Cjn;oM.__esModule=!0;oM.default=void 0;var o$=Pjn(x),_jn=fit,kjn=Ype,$jn=sM,Tjn=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function dit(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(dit=function(i){return i?n:t})(e)}function Pjn(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=dit(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Kte(){return Kte=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kte.apply(this,arguments)}function Ajn(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Q2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function MH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q2e(Object(n),!0).forEach(function(r){Rjn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rjn(e,t,n){return t=Djn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Djn(e){var t=Mjn(e,"string");return typeof t=="symbol"?t:String(t)}function Mjn(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Njn(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Jte(e,t)}function Jte(e,t){return Jte=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Jte(e,t)}var Gpe=function(e){Njn(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(i,o){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[i,o];if(c){var u=this.props.width/this.props.height,f=i-this.props.width,d=o-this.props.height;Math.abs(f)>Math.abs(d*u)?o=i/u:i=o*u}var h=i,p=o,g=this.slack||[0,0],v=g[0],y=g[1];return i+=v,o+=y,a&&(i=Math.max(a[0],i),o=Math.max(a[1],o)),l&&(i=Math.min(l[0],i),o=Math.min(l[1],o)),this.slack=[v+(h-i),y+(p-o)],[i,o]},n.resizeHandler=function(i,o){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;i==="onResizeStart"&&s.resetData();var d=(s.props.axis==="both"||s.props.axis==="x")&&o!=="n"&&o!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&o!=="e"&&o!=="w";if(!(!d&&!h)){var p=o[0],g=o[o.length-1],v=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(g==="w"){var y=v.left-s.lastHandleRect.left;u+=y}if(p==="n"){var O=v.top-s.lastHandleRect.top;f+=O}}s.lastHandleRect=v,g==="w"&&(u=-u),p==="n"&&(f=-f);var m=s.props.width+(d?u/s.props.transformScale:0),w=s.props.height+(h?f/s.props.transformScale:0),S=s.runConstraints(m,w);m=S[0],w=S[1];var E=m!==s.props.width||w!==s.props.height,C=typeof s.props[i]=="function"?s.props[i]:null,k=i==="onResize"&&!E;C&&!k&&(a.persist==null||a.persist(),C(a,{node:c,size:{width:m,height:w},handle:o})),i==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(i,o){var s=this.props.handle;if(!s)return o$.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+i,ref:o});if(typeof s=="function")return s(i,o);var a=typeof s.type=="string",l=MH({ref:o},a?{}:{handleAxis:i});return o$.cloneElement(s,l)},n.render=function(){var i=this,o=this.props,s=o.children,a=o.className,l=o.draggableOpts;o.width,o.height,o.handle,o.handleSize,o.lockAspectRatio,o.axis,o.minConstraints,o.maxConstraints,o.onResize,o.onResizeStop,o.onResizeStart;var c=o.resizeHandles;o.transformScale;var u=Ajn(o,Tjn);return(0,kjn.cloneElement)(s,MH(MH({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var d,h=(d=i.handleRefs[f])!=null?d:i.handleRefs[f]=o$.createRef();return o$.createElement(_jn.DraggableCore,Kte({},l,{nodeRef:h,key:"resizableHandle-"+f,onStop:i.resizeHandler("onResizeStop",f),onStart:i.resizeHandler("onResizeStart",f),onDrag:i.resizeHandler("onResize",f)}),i.renderResizeHandle(f,h))}))}))},t}(o$.Component);oM.default=Gpe;Gpe.propTypes=$jn.resizableProps;Gpe.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var bB={};bB.__esModule=!0;bB.default=void 0;var NH=zjn(x),Ijn=hit(lm),Ljn=hit(oM),jjn=sM,Fjn=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function hit(e){return e&&e.__esModule?e:{default:e}}function pit(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(pit=function(i){return i?n:t})(e)}function zjn(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=pit(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function ene(){return ene=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ene.apply(this,arguments)}function B2e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function p7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?B2e(Object(n),!0).forEach(function(r){Qjn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B2e(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qjn(e,t,n){return t=Bjn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bjn(e){var t=Wjn(e,"string");return typeof t=="symbol"?t:String(t)}function Wjn(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qjn(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Vjn(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,tne(e,t)}function tne(e,t){return tne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},tne(e,t)}var git=function(e){Vjn(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r=e.call.apply(e,[this].concat(o))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(i,o){return o.propsWidth!==i.width||o.propsHeight!==i.height?{width:i.width,height:i.height,propsWidth:i.width,propsHeight:i.height}:null};var n=t.prototype;return n.render=function(){var i=this.props,o=i.handle,s=i.handleSize;i.onResize;var a=i.onResizeStart,l=i.onResizeStop,c=i.draggableOpts,u=i.minConstraints,f=i.maxConstraints,d=i.lockAspectRatio,h=i.axis;i.width,i.height;var p=i.resizeHandles,g=i.style,v=i.transformScale,y=qjn(i,Fjn);return NH.createElement(Ljn.default,{axis:h,draggableOpts:c,handle:o,handleSize:s,height:this.state.height,lockAspectRatio:d,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:p,transformScale:v,width:this.state.width},NH.createElement("div",ene({},y,{style:p7(p7({},g),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(NH.Component);bB.default=git;git.propTypes=p7(p7({},jjn.resizableProps),{},{children:Ijn.default.element});vB.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};vB.exports.Resizable=oM.default;vB.exports.ResizableBox=bB.default;var Ujn=vB.exports,jg={};Object.defineProperty(jg,"__esModule",{value:!0});jg.resizeHandleType=jg.resizeHandleAxesType=jg.default=void 0;var gn=mit(lm),Hjn=mit(x);function mit(e){return e&&e.__esModule?e:{default:e}}const Xjn=jg.resizeHandleAxesType=gn.default.arrayOf(gn.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),Zjn=jg.resizeHandleType=gn.default.oneOfType([gn.default.node,gn.default.func]);jg.default={className:gn.default.string,style:gn.default.object,width:gn.default.number,autoSize:gn.default.bool,cols:gn.default.number,draggableCancel:gn.default.string,draggableHandle:gn.default.string,verticalCompact:function(e){e.verticalCompact},compactType:gn.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Cn.validateLayout(t,"layout")},margin:gn.default.arrayOf(gn.default.number),containerPadding:gn.default.arrayOf(gn.default.number),rowHeight:gn.default.number,maxRows:gn.default.number,isBounded:gn.default.bool,isDraggable:gn.default.bool,isResizable:gn.default.bool,allowOverlap:gn.default.bool,preventCollision:gn.default.bool,useCSSTransforms:gn.default.bool,transformScale:gn.default.number,isDroppable:gn.default.bool,resizeHandles:Xjn,resizeHandle:Zjn,onLayoutChange:gn.default.func,onDragStart:gn.default.func,onDrag:gn.default.func,onDragStop:gn.default.func,onResizeStart:gn.default.func,onResize:gn.default.func,onResizeStop:gn.default.func,onDrop:gn.default.func,droppingItem:gn.default.shape({i:gn.default.string.isRequired,w:gn.default.number.isRequired,h:gn.default.number.isRequired}),children:function(e,t){const n=e[t],r={};Hjn.default.Children.forEach(n,function(i){if((i==null?void 0:i.key)!=null){if(r[i.key])throw new Error('Duplicate child key "'+i.key+'" found! This will cause problems in ReactGridLayout.');r[i.key]=!0}})},innerRef:gn.default.any};Object.defineProperty(hB,"__esModule",{value:!0});hB.default=void 0;var ow=Kpe(x),lr=Kpe(lm),Yjn=fit,Gjn=Ujn,sw=Cn,_s=Ip,W2e=jg,Kjn=Kpe(Lpe);function Kpe(e){return e&&e.__esModule?e:{default:e}}function uh(e,t,n){return t=Jjn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jjn(e){var t=e3n(e,"string");return typeof t=="symbol"?t:String(t)}function e3n(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Jpe extends ow.default.Component{constructor(){super(...arguments),uh(this,"state",{resizing:null,dragging:null,className:""}),uh(this,"elementRef",ow.default.createRef()),uh(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:i,transformScale:o}=this.props;if(!i)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/o,f=l.left/o,d=c.top/o,h=l.top/o;s.left=u-f+a.scrollLeft,s.top=d-h+a.scrollTop,this.setState({dragging:s});const{x:p,y:g}=(0,_s.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return i.call(this,this.props.i,p,g,{e:t,node:r,newPosition:s})}),uh(this,"onDrag",(t,n)=>{let{node:r,deltaX:i,deltaY:o}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+o,l=this.state.dragging.left+i;const{isBounded:c,i:u,w:f,h:d,containerWidth:h}=this.props,p=this.getPositionParams();if(c){const{offsetParent:m}=r;if(m){const{margin:w,rowHeight:S,containerPadding:E}=this.props,C=m.clientHeight-(0,_s.calcGridItemWHPx)(d,S,w[1]);a=(0,_s.clamp)(a-E[1],0,C);const k=(0,_s.calcGridColWidth)(p),P=h-(0,_s.calcGridItemWHPx)(f,k,w[0]);l=(0,_s.clamp)(l-E[0],0,P)}}const g={top:a,left:l};this.setState({dragging:g});const{containerPadding:v}=this.props,{x:y,y:O}=(0,_s.calcXY)(p,a-v[1],l-v[0],f,d);return s.call(this,u,y,O,{e:t,node:r,newPosition:g})}),uh(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:s,i:a,containerPadding:l}=this.props,{left:c,top:u}=this.state.dragging,f={top:u,left:c};this.setState({dragging:null});const{x:d,y:h}=(0,_s.calcXY)(this.getPositionParams(),u-l[1],c-l[0],o,s);return i.call(this,a,d,h,{e:t,node:r,newPosition:f})}),uh(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),uh(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),uh(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,_s.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,_s.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,sw.fastPositionEqual)(r,i)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const i=t.droppingPosition||{left:0,top:0},{dragging:o}=this.state,s=o&&n.left!==i.left||n.top!==i.top;if(!o)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-o.left,l=n.top-o.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:i}=this.props;let o;return i?o=(0,sw.setTransform)(t):(o=(0,sw.setTopLeft)(t),n&&(o.left=(0,sw.perc)(t.left/r),o.width=(0,sw.perc)(t.width/r))),o}mixinDraggable(t,n){return ow.default.createElement(Yjn.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,i)=>n(r,i,t)}mixinResizable(t,n,r){const{cols:i,minW:o,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:f}=this.props,d=this.getPositionParams(),h=(0,_s.calcGridItemPosition)(d,0,0,i,0).width,p=(0,_s.calcGridItemPosition)(d,0,0,o,s),g=(0,_s.calcGridItemPosition)(d,0,0,a,l),v=[p.width,p.height],y=[Math.min(g.width,h),Math.min(g.height,1/0)];return ow.default.createElement(Gjn.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:v,maxConstraints:y,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:f},t)}onResizeHandler(t,n,r,i){let{node:o,size:s,handle:a}=n;const l=this.props[i];if(!l)return;const{x:c,y:u,i:f,maxH:d,minH:h,containerWidth:p}=this.props,{minW:g,maxW:v}=this.props;let y=s;o&&(y=(0,sw.resizeItemInDirection)(a,r,s,p),this.setState({resizing:i==="onResizeStop"?null:y}));let{w:O,h:m}=(0,_s.calcWH)(this.getPositionParams(),y.width,y.height,c,u,a);O=(0,_s.clamp)(O,Math.max(g,1),v),m=(0,_s.clamp)(m,h,d),l.call(this,f,O,m,{e:t,node:o,size:y,handle:a})}render(){const{x:t,y:n,w:r,h:i,isDraggable:o,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,_s.calcGridItemPosition)(this.getPositionParams(),t,n,r,i,this.state),u=ow.default.Children.only(this.props.children);let f=ow.default.cloneElement(u,{ref:this.elementRef,className:(0,Kjn.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,o),f}}hB.default=Jpe;uh(Jpe,"propTypes",{children:lr.default.element,cols:lr.default.number.isRequired,containerWidth:lr.default.number.isRequired,rowHeight:lr.default.number.isRequired,margin:lr.default.array.isRequired,maxRows:lr.default.number.isRequired,containerPadding:lr.default.array.isRequired,x:lr.default.number.isRequired,y:lr.default.number.isRequired,w:lr.default.number.isRequired,h:lr.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:lr.default.string.isRequired,resizeHandles:W2e.resizeHandleAxesType,resizeHandle:W2e.resizeHandleType,onDragStop:lr.default.func,onDragStart:lr.default.func,onDrag:lr.default.func,onResizeStop:lr.default.func,onResizeStart:lr.default.func,onResize:lr.default.func,isDraggable:lr.default.bool.isRequired,isResizable:lr.default.bool.isRequired,isBounded:lr.default.bool.isRequired,static:lr.default.bool,useCSSTransforms:lr.default.bool.isRequired,transformScale:lr.default.number,className:lr.default.string,handle:lr.default.string,cancel:lr.default.string,droppingPosition:lr.default.shape({e:lr.default.object.isRequired,left:lr.default.number.isRequired,top:lr.default.number.isRequired})});uh(Jpe,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(iM,"__esModule",{value:!0});iM.default=void 0;var i1=i3n(x),IH=Ipe,t3n=ege(Lpe),Kt=Cn,n3n=Ip,q2e=ege(hB),r3n=ege(jg);function ege(e){return e&&e.__esModule?e:{default:e}}function yit(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(yit=function(r){return r?n:t})(e)}function i3n(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=yit(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function ga(e,t,n){return t=o3n(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o3n(e){var t=s3n(e,"string");return typeof t=="symbol"?t:String(t)}function s3n(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const V2e="react-grid-layout";let vit=!1;try{vit=/firefox/i.test(navigator.userAgent)}catch{}let OB=class extends i1.Component{constructor(){super(...arguments),ga(this,"state",{activeDrag:null,layout:(0,Kt.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Kt.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),ga(this,"dragEnterCounter",0),ga(this,"onDragStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,Kt.getLayoutItem)(a,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,Kt.cloneLayoutItem)(l),oldLayout:a,activeDrag:c}),this.props.onDragStart(a,l,l,null,o,s)}),ga(this,"onDrag",(t,n,r,i)=>{let{e:o,node:s}=i;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:f}=this.props,d=(0,Kt.getLayoutItem)(l,t);if(!d)return;const h={w:d.w,h:d.h,x:d.x,y:d.y,placeholder:!0,i:t};l=(0,Kt.moveElement)(l,d,n,r,!0,f,(0,Kt.compactType)(this.props),c,u),this.props.onDrag(l,a,d,h,o,s),this.setState({layout:u?l:(0,Kt.compact)(l,(0,Kt.compactType)(this.props),c),activeDrag:h})}),ga(this,"onDragStop",(t,n,r,i)=>{let{e:o,node:s}=i;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:f}=this.props,d=(0,Kt.getLayoutItem)(l,t);if(!d)return;l=(0,Kt.moveElement)(l,d,n,r,!0,u,(0,Kt.compactType)(this.props),c,f);const p=f?l:(0,Kt.compact)(l,(0,Kt.compactType)(this.props),c);this.props.onDragStop(p,a,d,null,o,s);const{oldLayout:g}=this.state;this.setState({activeDrag:null,layout:p,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(p,g)}),ga(this,"onResizeStart",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a}=this.state,l=(0,Kt.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,Kt.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,o,s))}),ga(this,"onResize",(t,n,r,i)=>{let{e:o,node:s,size:a,handle:l}=i;const{oldResizeItem:c}=this.state,{layout:u}=this.state,{cols:f,preventCollision:d,allowOverlap:h}=this.props;let p=!1,g,v,y;const[O,m]=(0,Kt.withLayoutItem)(u,t,S=>{let E;return v=S.x,y=S.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(v=S.x+(S.w-n),n=S.x!==v&&v<0?S.w:n,v=v<0?0:v),["ne","n","nw"].indexOf(l)!==-1&&(y=S.y+(S.h-r),r=S.y!==y&&y<0?S.h:r,y=y<0?0:y),p=!0),d&&!h&&(E=(0,Kt.getAllCollisions)(u,{...S,w:n,h:r,x:v,y}).filter(k=>k.i!==S.i).length>0,E&&(y=S.y,r=S.h,v=S.x,n=S.w,p=!1)),S.w=n,S.h=r,S});if(!m)return;g=O,p&&(g=(0,Kt.moveElement)(O,m,v,y,!0,this.props.preventCollision,(0,Kt.compactType)(this.props),f,h));const w={w:m.w,h:m.h,x:m.x,y:m.y,static:!0,i:t};this.props.onResize(g,c,m,w,o,s),this.setState({layout:h?g:(0,Kt.compact)(g,(0,Kt.compactType)(this.props),f),activeDrag:w})}),ga(this,"onResizeStop",(t,n,r,i)=>{let{e:o,node:s}=i;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,f=(0,Kt.getLayoutItem)(a,t),d=u?a:(0,Kt.compact)(a,(0,Kt.compactType)(this.props),c);this.props.onResizeStop(d,l,f,null,o,s);const{oldLayout:h}=this.state;this.setState({activeDrag:null,layout:d,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(d,h)}),ga(this,"onDragOver",t=>{var O;if(t.preventDefault(),t.stopPropagation(),vit&&!((O=t.nativeEvent.target)!=null&&O.classList.contains(V2e)))return!1;const{droppingItem:n,onDropDragOver:r,margin:i,cols:o,rowHeight:s,maxRows:a,width:l,containerPadding:c,transformScale:u}=this.props,f=r==null?void 0:r(t);if(f===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const d={...n,...f},{layout:h}=this.state,p=t.currentTarget.getBoundingClientRect(),g=t.clientX-p.left,v=t.clientY-p.top,y={left:g/u,top:v/u,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:m,top:w}=this.state.droppingPosition;(m!=g||w!=v)&&this.setState({droppingPosition:y})}}else{const m={cols:o,margin:i,maxRows:a,rowHeight:s,containerWidth:l,containerPadding:c||i},w=(0,n3n.calcXY)(m,v,g,d.w,d.h);this.setState({droppingDOMNode:i1.createElement("div",{key:d.i}),droppingPosition:y,layout:[...h,{...d,x:w.x,y:w.y,static:!1,isDraggable:!0}]})}}),ga(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,i=(0,Kt.compact)(r.filter(o=>o.i!==t.i),(0,Kt.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:i,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),ga(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ga(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),ga(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,i=r.find(o=>o.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,i,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,IH.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Kt.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Kt.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Kt.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Kt.fastRGLPropsEqual)(this.props,t,IH.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,i=n.layout;this.onLayoutMaybeChanged(r,i)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Kt.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,IH.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:i,containerPadding:o,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return i1.createElement(q2e.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:i,containerPadding:o||i,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},i1.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Kt.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:i,cols:o,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:f,isBounded:d,useCSSTransforms:h,transformScale:p,draggableCancel:g,draggableHandle:v,resizeHandles:y,resizeHandle:O}=this.props,{mounted:m,droppingPosition:w}=this.state,S=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,E=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,C=r.resizeHandles||y,k=S&&d&&r.isBounded!==!1;return i1.createElement(q2e.default,{containerWidth:i,cols:o,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:g,handle:v,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:S,isResizable:E,isBounded:k,useCSSTransforms:h&&m,usePercentages:!m,transformScale:p,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?w:void 0,resizeHandles:C,resizeHandle:O},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:i}=this.props,o=(0,t3n.default)(V2e,t),s={height:this.containerHeight(),...n};return i1.createElement("div",{ref:i,className:o,style:s,onDrop:r?this.onDrop:Kt.noop,onDragLeave:r?this.onDragLeave:Kt.noop,onDragEnter:r?this.onDragEnter:Kt.noop,onDragOver:r?this.onDragOver:Kt.noop},i1.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};iM.default=OB;ga(OB,"displayName","ReactGridLayout");ga(OB,"propTypes",r3n.default);ga(OB,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:Kt.noop,onDragStart:Kt.noop,onDrag:Kt.noop,onDragStop:Kt.noop,onResizeStart:Kt.noop,onResize:Kt.noop,onResizeStop:Kt.noop,onDrop:Kt.noop,onDropDragOver:Kt.noop});var xB={},wx={};Object.defineProperty(wx,"__esModule",{value:!0});wx.findOrGenerateResponsiveLayout=c3n;wx.getBreakpointFromWidth=a3n;wx.getColsFromBreakpoint=l3n;wx.sortBreakpoints=tge;var MI=Cn;function a3n(e,t){const n=tge(e);let r=n[0];for(let i=1,o=n.length;i<o;i++){const s=n[i];t>e[s]&&(r=s)}return r}function l3n(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function c3n(e,t,n,r,i,o){if(e[n])return(0,MI.cloneLayout)(e[n]);let s=e[r];const a=tge(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,MI.cloneLayout)(s||[]),(0,MI.compact)((0,MI.correctBounds)(s,{cols:i}),o,i)}function tge(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(xB,"__esModule",{value:!0});xB.default=void 0;var U2e=f3n(x),Pl=bit(lm),LH=Ipe,VS=Cn,o1=wx,u3n=bit(iM);function bit(e){return e&&e.__esModule?e:{default:e}}function Oit(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Oit=function(r){return r?n:t})(e)}function f3n(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Oit(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function nne(){return nne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nne.apply(this,arguments)}function g7(e,t,n){return t=d3n(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d3n(e){var t=h3n(e,"string");return typeof t=="symbol"?t:String(t)}function h3n(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const H2e=e=>Object.prototype.toString.call(e);function NI(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class nge extends U2e.Component{constructor(){super(...arguments),g7(this,"state",this.generateInitialState()),g7(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:i}=this.props,o=(0,o1.getBreakpointFromWidth)(n,t),s=(0,o1.getColsFromBreakpoint)(o,i),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,o1.findOrGenerateResponsiveLayout)(r,n,o,o,s,a),breakpoint:o,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,LH.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:i}=n;return{layout:(0,o1.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,i,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,LH.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,LH.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:i,compactType:o}=this.props,s=this.props.breakpoint||(0,o1.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,o1.getColsFromBreakpoint)(s,r),c={...i};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,VS.cloneLayout)(this.state.layout));let d=(0,o1.findOrGenerateResponsiveLayout)(c,n,s,a,l,o);d=(0,VS.synchronizeLayoutWithChildren)(d,this.props.children,l,o,this.props.allowOverlap),c[s]=d,this.props.onLayoutChange(d,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:d,cols:l})}const u=NI(this.props.margin,s),f=NI(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:i,margin:o,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return U2e.createElement(u3n.default,nne({},u,{margin:NI(o,this.state.breakpoint),containerPadding:NI(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}xB.default=nge;g7(nge,"propTypes",{breakpoint:Pl.default.string,breakpoints:Pl.default.object,allowOverlap:Pl.default.bool,cols:Pl.default.object,margin:Pl.default.oneOfType([Pl.default.array,Pl.default.object]),containerPadding:Pl.default.oneOfType([Pl.default.array,Pl.default.object]),layouts(e,t){if(H2e(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+H2e(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,VS.validateLayout)(e.layouts[n],"layouts."+n)})},width:Pl.default.number.isRequired,onBreakpointChange:Pl.default.func,onLayoutChange:Pl.default.func,onWidthChange:Pl.default.func});g7(nge,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:VS.noop,onLayoutChange:VS.noop,onWidthChange:VS.noop});var rge={},xit=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i<o.length;i++){var s=o[i];n.call(r,s[1],s[0])}},t}()}(),rne=typeof window<"u"&&typeof document<"u"&&window.document===document,m7=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),p3n=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(m7):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),g3n=2;function m3n(e,t){var n=!1,r=!1,i=0;function o(){n&&(n=!1,e()),r&&a()}function s(){p3n(o)}function a(){var l=Date.now();if(n){if(l-i<g3n)return;r=!0}else n=!0,r=!1,setTimeout(s,t);i=l}return a}var y3n=20,v3n=["top","right","bottom","left","width","height","size","weight"],b3n=typeof MutationObserver<"u",O3n=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=m3n(this.refresh.bind(this),y3n)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!rne||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),b3n?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!rne||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=v3n.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),wit=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},_C=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||m7},Sit=wB(0,0,0,0);function y7(e){return parseFloat(e)||0}function X2e(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,i){var o=e["border-"+i+"-width"];return r+y7(o)},0)}function x3n(e){for(var t=["top","right","bottom","left"],n={},r=0,i=t;r<i.length;r++){var o=i[r],s=e["padding-"+o];n[o]=y7(s)}return n}function w3n(e){var t=e.getBBox();return wB(0,0,t.width,t.height)}function S3n(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Sit;var r=_C(e).getComputedStyle(e),i=x3n(r),o=i.left+i.right,s=i.top+i.bottom,a=y7(r.width),l=y7(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+o)!==t&&(a-=X2e(r,"left","right")+o),Math.round(l+s)!==n&&(l-=X2e(r,"top","bottom")+s)),!C3n(e)){var c=Math.round(a+o)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return wB(i.left,i.top,a,l)}var E3n=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof _C(e).SVGGraphicsElement}:function(e){return e instanceof _C(e).SVGElement&&typeof e.getBBox=="function"}}();function C3n(e){return e===_C(e).document.documentElement}function _3n(e){return rne?E3n(e)?w3n(e):S3n(e):Sit}function k3n(e){var t=e.x,n=e.y,r=e.width,i=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return wit(s,{x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:i+n,left:t}),s}function wB(e,t,n,r){return{x:e,y:t,width:n,height:r}}var $3n=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=wB(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=_3n(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),T3n=function(){function e(t,n){var r=k3n(n);wit(this,{target:t,contentRect:r})}return e}(),P3n=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new xit,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof _C(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new $3n(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof _C(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new T3n(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Eit=typeof WeakMap<"u"?new WeakMap:new xit,Cit=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=O3n.getInstance(),r=new P3n(t,n,this);Eit.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Cit.prototype[e]=function(){var t;return(t=Eit.get(this))[e].apply(t,arguments)}});var A3n=function(){return typeof m7.ResizeObserver<"u"?m7.ResizeObserver:Cit}();const R3n=Object.freeze(Object.defineProperty({__proto__:null,default:A3n},Symbol.toStringTag,{value:"Module"})),D3n=cu(R3n);Object.defineProperty(rge,"__esModule",{value:!0});rge.default=Q3n;var II=L3n(x),M3n=ige(lm),N3n=ige(D3n),I3n=ige(Lpe);function ige(e){return e&&e.__esModule?e:{default:e}}function _it(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(_it=function(r){return r?n:t})(e)}function L3n(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=_it(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function ine(){return ine=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ine.apply(this,arguments)}function aw(e,t,n){return t=j3n(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j3n(e){var t=F3n(e,"string");return typeof t=="symbol"?t:String(t)}function F3n(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const z3n="react-grid-layout";function Q3n(e){var t;return t=class extends II.Component{constructor(){super(...arguments),aw(this,"state",{width:1280}),aw(this,"elementRef",II.createRef()),aw(this,"mounted",!1),aw(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new N3n.default(i=>{if(this.elementRef.current instanceof HTMLElement){const s=i[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...i}=this.props;return r&&!this.mounted?II.createElement("div",{className:(0,I3n.default)(this.props.className,z3n),style:this.props.style,ref:this.elementRef}):II.createElement(e,ine({innerRef:this.elementRef},i,this.state))}},aw(t,"defaultProps",{measureBeforeMount:!1}),aw(t,"propTypes",{measureBeforeMount:M3n.default.bool}),t}(function(e){e.exports=iM.default,e.exports.utils=Cn,e.exports.calculateUtils=Ip,e.exports.Responsive=xB.default,e.exports.Responsive.utils=wx,e.exports.WidthProvider=rge.default})(Frt);var Z2e=Frt.exports;const oge=x.memo(({code:e,className:t})=>{const{theme:n}=mp();return b.jsx("div",{className:be(t,"text-muted-foreground flex flex-col overflow-hidden"),children:b.jsx(Dle,{minHeight:"10px",theme:n==="dark"?"dark":"light",height:"100%",className:"tiny-code",editable:!1,basicSetup:!1,extensions:[Fle(),ZZt({syntaxHighlighting:!0,highlightSpecialChars:!1,history:!1,drawSelection:!1,defaultKeymap:!1,historyKeymap:!1})],value:e})})});oge.displayName="TinyCode";const B3n=10;function W3n(){const[e,t]=x.useState(!1),[n,r]=ie.useState({x:0,y:0}),[i,o]=ie.useState(!1);return{isDragging:e&&i,onDragStart:c=>{t(!0),r({x:c.clientX,y:c.clientY})},onDragMove:c=>{if(e){const u=c.clientX-n.x,f=c.clientY-n.y;o(Math.hypot(u,f)>B3n)}},onDragStop:()=>{t(!1),o(!1)}}}function SB(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var q3n=["color"],V3n=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=SB(e,q3n);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M0.25 1C0.25 0.585786 0.585786 0.25 1 0.25H14C14.4142 0.25 14.75 0.585786 14.75 1V14C14.75 14.4142 14.4142 14.75 14 14.75H1C0.585786 14.75 0.25 14.4142 0.25 14V1ZM1.75 1.75V13.25H13.25V1.75H1.75Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}),x.createElement("rect",{x:"7",y:"5",width:"1",height:"1",rx:".5",fill:r}),x.createElement("rect",{x:"7",y:"3",width:"1",height:"1",rx:".5",fill:r}),x.createElement("rect",{x:"7",y:"7",width:"1",height:"1",rx:".5",fill:r}),x.createElement("rect",{x:"5",y:"7",width:"1",height:"1",rx:".5",fill:r}),x.createElement("rect",{x:"3",y:"7",width:"1",height:"1",rx:".5",fill:r}),x.createElement("rect",{x:"9",y:"7",width:"1",height:"1",rx:".5",fill:r}),x.createElement("rect",{x:"11",y:"7",width:"1",height:"1",rx:".5",fill:r}),x.createElement("rect",{x:"7",y:"9",width:"1",height:"1",rx:".5",fill:r}),x.createElement("rect",{x:"7",y:"11",width:"1",height:"1",rx:".5",fill:r}))}),U3n=["color"],H3n=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=SB(e,U3n);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),X3n=["color"],Z3n=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=SB(e,X3n);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Y3n=["color"],G3n=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=SB(e,Y3n);return x.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),x.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))});const K3n=Z2e.WidthProvider(Z2e.Responsive),J3n=[0,0],one="grid-drag-handle",eFn=({layout:e,setLayout:t,cells:n,mode:r})=>{const i=r==="read",o=new Set(e.cells.map(w=>w.i)),[s,a]=x.useState(null),[l,c]=x.useState(!1),u=x.useMemo(()=>({lg:e.columns}),[e.columns]);x.useEffect(()=>{const w=document.getElementById("App");return e.bordered?w==null||w.classList.add("grid-bordered"):w==null||w.classList.remove("grid-bordered"),()=>{w==null||w.classList.remove("grid-bordered")}},[e.bordered]);const{isDragging:f,...d}=W3n(),h=!i&&!l,p=jrt.keyBy(e.cells,w=>w.i),g=w=>S=>{const E=new Set(e.scrollableCells);S?E.add(w):E.delete(w),t({...e,scrollableCells:E})},v=w=>S=>{const E=new Map(e.cellSide);S===E.get(w)?E.delete(w):E.set(w,S),t({...e,cellSide:E})},y={};e.maxWidth&&(y.maxWidth=`${e.maxWidth}px`),h&&(y.backgroundImage="repeating-linear-gradient(var(--gray-4) 0 1px, transparent 1px 100%), repeating-linear-gradient(90deg, var(--gray-4) 0 1px, transparent 1px 100%)",y.backgroundSize=`calc((100% / ${e.columns})) ${e.rowHeight}px`);const O=b.jsx(K3n,{breakpoint:"lg",layouts:{lg:e.cells},style:y,cols:u,allowOverlap:!1,className:be("w-full mx-auto bg-background flex-1 min-h-full",h&&"bg-[var(--slate-2)] border-r",i&&"disable-animation px-4 ",e.bordered&&"border-t border-x rounded-t shadow-sm",e.bordered&&i&&"pt-4 w-[calc(100%-2rem)]",!e.maxWidth&&"min-w-[800px]"),margin:J3n,isBounded:!1,compactType:null,preventCollision:!0,rowHeight:e.rowHeight,onLayoutChange:w=>t({...e,cells:w}),droppingItem:s?{i:s.i,w:s.w||2,h:s.h||2}:void 0,onDrop:(w,S,E)=>{d.onDragStop(),S&&t({...e,cells:[...w,S]})},onDragStart:(w,S,E,C,k)=>{d.onDragStart(k)},onDrag:(w,S,E,C,k)=>{d.onDragMove(k)},onDragStop:()=>{d.onDragStop()},onResizeStop:()=>{window.dispatchEvent(new Event("resize"))},isDraggable:h,isDroppable:h,isResizable:h,draggableHandle:h?`.${one}`:"noop",children:n.filter(w=>o.has(w.id)).map(w=>{const S=p.get(w.id),E=e.scrollableCells.has(w.id)??!1,C=e.cellSide.get(w.id),k=b.jsx(sne,{code:w.code,mode:r,cellId:w.id,output:w.output,status:w.status,isScrollable:E,side:C,hidden:w.errored||w.interrupted||w.stopped});return h?b.jsx(kit,{id:w.id,isDragging:f,side:C,setSide:v(w.id),isScrollable:E,setIsScrollable:g(w.id),display:(S==null?void 0:S.y)===0?"bottom":"top",onDelete:()=>{t({...e,cells:e.cells.filter(P=>P.i!==w.id)})},children:k},w.id):b.jsx("div",{children:k},w.id)})});if(i)return O;const m=n.filter(w=>!o.has(w.id));return b.jsxs(b.Fragment,{children:[b.jsx(tFn,{layout:e,setLayout:t,isLocked:l,setIsLocked:c}),b.jsxs("div",{className:be("relative flex gap-2 px-2 z-10 flex-1"),children:[b.jsx("div",{className:be("flex-grow overflow-auto transparent-when-disconnected"),children:O}),b.jsxs("div",{className:"flex-none flex flex-col w-[300px] p-2 gap-2 overflow-auto h-full bg-[var(--slate-2)] border-t border-x rounded-t shadow-sm transparent-when-disconnected",children:[b.jsx("div",{className:"text font-bold text-[var(--slate-20)] flex-shrink-0",children:"Outputs"}),m.map(w=>b.jsx("div",{draggable:!0,unselectable:"on","data-cell-id":w.id,onDragStart:S=>{const E=S.currentTarget.offsetHeight;a({i:w.id,w:e.columns/4,h:Math.ceil(E/e.rowHeight)||1}),S.dataTransfer.setData("text/plain","")},className:be(one,"droppable-element bg-background border-border border overflow-hidden p-2 rounded flex-shrink-0"),children:b.jsx(sne,{code:w.code,className:"select-none pointer-events-none",mode:r,cellId:w.id,output:w.output,isScrollable:!1,status:w.status,hidden:!1})},w.id))]})]})]})},sne=x.memo(({output:e,cellId:t,status:n,mode:r,code:i,hidden:o,isScrollable:s,side:a,className:l})=>{const c=n==="running"||n==="queued";return(e==null||e.data==="")&&r!=="read"?b.jsx(oge,{className:l,code:i}):b.jsx("div",{className:be(l,"h-full w-full p-2 overflow-x-auto",o&&"invisible",s?"overflow-y-auto":"overflow-y-hidden",a==="top"&&"flex items-start",a==="bottom"&&"flex items-end",a==="left"&&"flex justify-start",a==="right"&&"flex justify-end"),children:b.jsx(RP,{allowExpand:!1,output:e,cellId:t,stale:c})})});sne.displayName="GridCell";const tFn=({layout:e,setLayout:t,isLocked:n,setIsLocked:r})=>b.jsxs("div",{className:"flex flex-row absolute left-5 top-4 gap-4 w-full justify-end pr-[350px]",children:[b.jsxs("div",{className:"flex flex-row items-center gap-2",children:[b.jsx(Ls,{htmlFor:"columns",children:"Columns"}),b.jsx(Wo,{"data-testid":"grid-columns-input",id:"columns",type:"number",value:e.columns,className:"w-[60px]",placeholder:"# of Columns",min:1,onChange:i=>{t({...e,columns:i.target.valueAsNumber})}})]}),b.jsxs("div",{className:"flex flex-row items-center gap-2",children:[b.jsx(Ls,{htmlFor:"rowHeight",children:"Row Height (px)"}),b.jsx(Wo,{"data-testid":"grid-row-height-input",id:"rowHeight",type:"number",value:e.rowHeight,className:"w-[60px]",placeholder:"Row Height (px)",min:1,onChange:i=>{t({...e,rowHeight:i.target.valueAsNumber})}})]}),b.jsxs("div",{className:"flex flex-row items-center gap-2",children:[b.jsx(Ls,{htmlFor:"maxWidth",children:"Max Width (px)"}),b.jsx(Wo,{"data-testid":"grid-max-width-input",id:"maxWidth",type:"number",value:e.maxWidth,className:"w-[70px]",step:100,placeholder:"Full",onChange:i=>{t({...e,maxWidth:i.target.value?i.target.valueAsNumber:void 0})}})]}),b.jsxs("div",{className:"flex flex-row items-center gap-2",children:[b.jsxs(Ls,{className:"flex flex-row items-center gap-1",htmlFor:"lock",children:[b.jsx(V3n,{className:"h-3 w-3"}),"Bordered"]}),b.jsx(Qb,{"data-testid":"grid-bordered-switch",id:"lock",checked:e.bordered,size:"sm",onCheckedChange:i=>{t({...e,bordered:i})}})]}),b.jsxs("div",{className:"flex flex-row items-center gap-2",children:[b.jsxs(Ls,{className:"flex flex-row items-center gap-1",htmlFor:"lock",children:[b.jsx(ALe,{className:"h-3 w-3"}),"Lock Grid"]}),b.jsx(Qb,{"data-testid":"grid-lock-switch",id:"lock",checked:n,size:"sm",onCheckedChange:r})]})]}),kit=ie.forwardRef(({children:e,isDragging:t,className:n,onDelete:r,isScrollable:i,setIsScrollable:o,side:s,setSide:a,display:l,...c},u)=>{const[f,d]=x.useState();return b.jsxs("div",{ref:u,...c,className:be(n,"relative z-10 hover:z-20","bg-background border-transparent hover:border-[var(--sky-8)] border",f&&"border-[var(--sky-8)] z-20",!f&&"hover-actions-parent",t&&"bg-[var(--slate-2)] border-border z-20"),children:[e,b.jsx(nFn,{onDelete:r,isScrollable:i,setIsScrollable:o,side:s,setSide:a,display:l,setPopoverOpened:d,popoverOpened:f})]})});kit.displayName="EditableGridCell";const nFn=({display:e,onDelete:t,side:n,setSide:r,isScrollable:i,setIsScrollable:o,popoverOpened:s,setPopoverOpened:a})=>{const l="h-4 w-4 opacity-60 hover:opacity-100",c=n==="left"?SLe:n==="right"?wLe:void 0;return b.jsxs("div",{className:be("absolute right-0 p-1 bg-[var(--sky-8)] text-white h-6 z-10 flex gap-2",!s&&"hover-action",e==="top"&&"-top-6 rounded-t",e==="bottom"&&"-bottom-6 rounded-b"),children:[b.jsxs(Bb,{open:s==="side",onOpenChange:u=>a(u?"side":void 0),children:[b.jsx(Wb,{asChild:!0,children:c?b.jsx(c,{className:l}):b.jsx(gEt,{className:l})}),b.jsx(R0,{side:"bottom",children:pn.entries(rFn).map(([u,f])=>b.jsxs(ll,{onSelect:()=>r(u),children:[b.jsx(f,{className:"h-4 w-3 mr-2"}),b.jsx("span",{className:"flex-1",children:RR(u)}),u===n&&b.jsx(dm,{className:"h-4 w-4"})]},u))})]}),b.jsxs(Bb,{open:s==="scroll",onOpenChange:u=>a(u?"scroll":void 0),children:[b.jsx(Wb,{asChild:!0,children:b.jsx(wCt,{className:l})}),b.jsx(R0,{side:"bottom",children:b.jsxs(ll,{onSelect:()=>o(!i),children:[b.jsx("span",{className:"flex-1",children:"Scrollable"}),b.jsx(Qb,{"data-testid":"grid-scrollable-switch",checked:i,size:"sm",onCheckedChange:o})]})})]}),b.jsx(HEt,{className:be(one,"cursor-move",l)}),b.jsx(rc,{className:l,onClick:()=>t()})]})},rFn={left:SLe,right:wLe},iFn={type:"grid",name:"Grid",validator:Y.object({columns:Y.number().min(1),rowHeight:Y.number().min(1),maxWidth:Y.number().optional(),bordered:Y.boolean().optional(),cells:Y.array(Y.object({position:Y.tuple([Y.number(),Y.number(),Y.number(),Y.number()]).nullable(),scrollable:Y.boolean().optional(),alignment:Y.enum(["top","bottom","left","right"]).optional()}))}),deserializeLayout:(e,t)=>{if(e.cells.length===0)return{columns:e.columns,rowHeight:e.rowHeight,scrollableCells:new Set,cellSide:new Map,cells:[]};e.cells.length!==t.length&&At.warn("Number of cells in layout does not match number of cells in notebook");const n=new Set,r=new Map,i=e.cells.flatMap((o,s)=>{const a=o.position;if(!a)return[];const l=t[s];return l?(o.scrollable&&n.add(l.id),o.side&&r.set(l.id,o.side),{i:l.id,x:a[0],y:a[1],w:a[2],h:a[3]}):[]});return{columns:e.columns,rowHeight:e.rowHeight,maxWidth:e.maxWidth,bordered:e.bordered,cells:i,cellSide:r,scrollableCells:n}},serializeLayout:(e,t)=>{const n=jrt.keyBy(e.cells,i=>i.i),r=t.map(i=>{const o=n.get(i.id);if(!o)return{position:null};const s={position:[o.x,o.y,o.w,o.h]};return e.scrollableCells.has(i.id)&&(s.scrollable=!0),e.cellSide.has(i.id)&&(s.side=e.cellSide.get(i.id)),s});return{columns:e.columns,rowHeight:e.rowHeight,maxWidth:e.maxWidth,bordered:e.bordered,cells:r}},Component:eFn,getInitialLayout:()=>({columns:24,rowHeight:20,maxWidth:1400,bordered:!0,scrollableCells:new Set,cellSide:new Map,cells:[]})},$it=({invisible:e,appConfig:t,className:n,children:r})=>b.jsx("div",{className:be("px-1 sm:px-16 md:px-32",n),children:b.jsx("div",{className:be("m-auto pb-24 sm:pb-12",t.width==="normal"&&"max-w-contentWidth min-w-[400px]",t.width==="medium"&&"max-w-contentWidthMedium min-w-[400px]",e&&"invisible"),children:r})});function Tit(e,t){const[n,r]=x.useState(!0);return x.useEffect(()=>{const i=Math.max(Math.min((e-1)*15,100),0),o=setTimeout(()=>{r(!1),t!=="read"&&requestAnimationFrame(()=>{oFn()})},i);return()=>clearTimeout(o)},[]),{invisible:n}}function oFn(){const e=Cv();e.length>0&&e[0].focus()}const sFn=({cells:e,appConfig:t,mode:n})=>{const{invisible:r}=Tit(e.length,n),[i,o]=x.useState(()=>Jh()),a=(()=>{const l=e.some(f=>f.code),u=new URLSearchParams(window.location.search).get("include-code");return n==="read"&&u!=="false"&&l})();return b.jsxs($it,{invisible:r,appConfig:t,children:[e.map(l=>b.jsx(Pit,{cellId:l.id,output:l.output,status:l.status,code:l.code,config:l.config,stopped:l.stopped,showCode:i&&a,errored:l.errored,mode:n,runStartTimestamp:l.runStartTimestamp,interrupted:l.interrupted},l.id)),a&&b.jsx("div",{className:be("right-0 top-0 z-50 m-4",Jh()?"absolute":"fixed"),children:b.jsxs(St,{variant:"secondary",onClick:()=>o(l=>!l),size:"sm","data-testid":"show-code",children:[b.jsx(foe,{className:"w-4 h-4 mr-2"}),i?"Hide code":"Show code"]})})]})},Pit=x.memo(({output:e,cellId:t,status:n,stopped:r,errored:i,config:o,interrupted:s,runStartTimestamp:a,code:l,showCode:c,mode:u})=>{const f=x.useRef(null),d=U4e({status:n,output:e,interrupted:s,runStartTimestamp:a},!1),h=be("Cell","hover-actions-parent",{published:!c,interactive:u==="edit","has-error":i,stopped:r}),p=Od.create(t),g=i||s||r;return u==="read"&&c?b.jsxs("div",{tabIndex:-1,id:p,ref:f,className:h,children:[b.jsx(RP,{allowExpand:!0,output:e,className:"output-area",cellId:t,stale:d}),b.jsx("div",{className:"tray",children:b.jsx(Wle,{initiallyHideCode:o.hide_code,code:l})})]}):g?null:b.jsx("div",{tabIndex:-1,id:p,ref:f,className:h,children:b.jsx(RP,{allowExpand:u==="edit",output:e,className:"output-area",cellId:t,stale:d})})});Pit.displayName="VerticalCell";const aFn={type:"vertical",name:"Vertical",validator:Y.any(),Component:sFn,deserializeLayout:e=>e,serializeLayout:e=>e,getInitialLayout:()=>null},sge=[iFn,aFn];function lFn(e,t,n){const r=sge.find(i=>i.type===e);if(r===void 0)throw new Error(`Unknown layout type: ${e}`);return r.deserializeLayout(t,n)}function age(){return{selectedLayout:"vertical",layoutData:{}}}const{reducer:cFn,createActions:uFn}=ZO(age,{setLayoutView:(e,t)=>({...e,selectedLayout:t}),setLayoutData:(e,t)=>({...e,selectedLayout:t.layoutView,layoutData:{...e.layoutData,[t.layoutView]:t.data}}),setCurrentLayoutData:(e,t)=>({...e,layoutData:{...e.layoutData,[e.selectedLayout]:t}})}),lge=hn(age()),cge=()=>Gi(lge),uge=()=>{const e=vl(lge);return x.useMemo(()=>uFn(n=>{e(r=>cFn(r,n))}),[e])};function fFn(){const e=yae(),{layoutData:t,selectedLayout:n}=Tn.get(lge);if(n==="vertical"||t===void 0)return;const r=t[n],i=sge.find(o=>o.type===n);if(i===void 0){At.error(`Unknown layout type: ${n}`);return}return{type:n,data:i.serializeLayout(r,Yze(e))}}const dFn=()=>{const{selectedLayout:e}=cge(),{setLayoutView:t}=uge(),n=["vertical","grid"];return yp()?null:b.jsxs($v,{"data-testid":"layout-select",value:e,onValueChange:r=>t(r),children:[b.jsx(ym,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:b.jsx(v_,{placeholder:"Select a view"})}),b.jsx(vm,{children:b.jsxs(Jg,{children:[b.jsx(M8,{children:"View as"}),n.map(r=>b.jsx(Kl,{value:r,children:b.jsxs("div",{className:"flex items-center gap-1.5 leading-5",children:[hFn(r),b.jsx("span",{children:pFn(r)})]})},r))]})})]})};function hFn(e){switch(e){case"vertical":return b.jsx(iCt,{className:"h-4 w-4"});case"grid":return b.jsx(UEt,{className:"h-4 w-4"});default:return b.jsx(az,{className:"h-4 w-4"})}}function pFn(e){switch(e){case"vertical":return"Vertical";case"grid":return"Grid";default:return"Unknown"}}function gFn(){const e=document.querySelector("marimo-mode");if(e===null||!(e instanceof HTMLElement))throw new Error("internal-error: marimo-mode tag not found");const t=e.dataset.mode;switch(t){case"read":return"read";case"edit":return"edit";default:throw new Error(`internal-error: unknown mode ${t}`)}}function mFn(e){return e==="read"?"read":e==="edit"?"present":"edit"}const Ait=gFn();async function yFn(e){const t=Tn.get(TL);if(t.mode==="present"){await e();return}Tn.set(TL,{...t,mode:"present"}),await new Promise(n=>setTimeout(n,100)),await new Promise(n=>requestAnimationFrame(n)),await new Promise(n=>requestAnimationFrame(n)),await e(),Tn.set(TL,{...t,mode:"edit"})}const TL=hn({mode:Ait,cellAnchor:null});function vFn(e,t){const n=new V5e(e,t),[r,i]=x.useState(()=>n.get());return[r,s=>{i(s),n.set(s)}]}const bFn=3;function OFn(){const[e,t]=vFn("marimo:commands",[]);return{recentCommands:e,addRecentCommand:n=>{const r=xFn([n,...e]);t(r.slice(0,bFn))}}}function xFn(e){return[...new Set(e)]}function Rit(e){return e.dropdown!==void 0}function PL(e,t=""){return e.flatMap(n=>Rit(n)?PL(n.dropdown,`${t+n.label} > `):{...n,label:t+n.label})}function wFn(e){const t=document.getElementById(`output-${e}`);t&&(t.classList.add("printing-output"),b4e(t,"result.png").finally(()=>{t.classList.remove("printing-output")}))}const f2=({children:e,layerTop:t=!1})=>{const[n,r]=ie.Children.toArray(e),i=t?"top-[-1px] left-[-1px]":"bottom-[-1px] right-[-1px]";return b.jsxs("div",{className:"multi-icon relative w-fit",children:[n,b.jsx("div",{className:`second-icon absolute ${i} rounded-full`,children:r})]})};function rS(e){const t=e.current;if(t===null)throw new ReferenceError("Attempting to dereference null object.");return t}function SFn(){const e=s_(),t=Dit();return Jn(()=>t(Gze(e)))}function EFn(e){const t=Dit();return Jn(()=>{e!==void 0&&t([e])})}function Dit(){const e=s_();return Jn(async n=>{if(n.length===0)return;const{cellHandles:r}=e,i=[];for(const o of n){const s=rS(r[o]);i.push(sv(s.editorView)),s.registerRun()}Sa.INSTANCE.registerRunStart(),await K5e(n,i).catch(o=>{At.error(o),Sa.INSTANCE.registerRunEnd()})})}const Y2e=({value:e,onChange:t,placeholder:n,...r})=>{const i=x.useRef(null),o=Mit(e,t);return HQ(()=>{const s=o.onBlur,a=i.current;if(a)return a.addEventListener("blur",s),()=>{a.removeEventListener("blur",s)}}),b.jsx(Wo,{"data-testid":"cell-name-input",value:o.value,onChange:o.onChange,ref:i,placeholder:n,className:"shadow-none! hover:shadow-none focus:shadow-none focus-visible:shadow-none",onKeyDown:tp.onEnter(tp.stopPropagation()),...r})},CFn=({value:e,cellId:t,className:n})=>{const{updateCellName:r}=wp(),i=Mit(e,o=>r({cellId:t,name:o}));return e===Vb?null:b.jsx(Wt,{content:"Click to rename",children:b.jsx("span",{className:be("outline-none border hover:border-cyan-500/40 focus:border-cyan-500/40",n),contentEditable:!0,suppressContentEditableWarning:!0,onChange:i.onChange,onBlur:i.onBlur,onKeyDown:tp.onEnter(o=>{o.target instanceof HTMLElement&&o.target.blur()}),children:e})})};function Mit(e,t){const[n,r]=x.useState(e),i=o=>{if(o===e)return;if(!o||o===Vb){t(o);return}const s=LLt(o,l9t());t(s)};return{value:n===Vb?"":n,onChange:o=>{const s=o.target.value,a=Eq(s);r(a)},onBlur:o=>{if(o.target instanceof HTMLInputElement){const s=o.target.value;i(Eq(s))}else if(o.target instanceof HTMLSpanElement){const s=o.target.innerText.trim();i(Eq(s))}}}}const fge=hn(null),_Fn=hn(!1),Nit=e=>b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 448 512",...e,children:b.jsx("path",{d:"M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z"})}),Iit=e=>b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 640 512",...e,children:b.jsx("path",{d:"M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1zM338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z"})});function dge({cell:e}){const{createNewCell:t,updateCellConfig:n,updateCellCode:r,updateCellName:i,deleteCell:o,moveCell:s,sendToTop:a,sendToBottom:l}=wp(),c=EFn(e==null?void 0:e.cellId),{openModal:u}=$m(),f=vl(fge),d=Gi(yht);if(!e)return[];const{cellId:h,config:p,getEditorView:g,name:v,hasOutput:y,status:O}=e,m=g(),w=async()=>{const C={disabled:!p.disabled};await Mb({configs:{[h]:C}}),n({cellId:h,config:C})},S=async()=>{const C={hide_code:!p.hide_code};await Mb({configs:{[h]:C}}),n({cellId:h,config:C}),m&&(C.hide_code?m.contentDOM.blur():m.focus())};return[[{icon:b.jsx(kCt,{size:13,strokeWidth:1.5}),label:"Name",disableClick:!0,handle:C=>{C==null||C.stopPropagation(),C==null||C.preventDefault()},handleHeadless:()=>{u(b.jsxs(gm,{children:[b.jsx(YC,{children:b.jsx(Ov,{children:"Rename cell"})}),b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsx(Ls,{htmlFor:"cell-name",children:"Cell name"}),b.jsx(Y2e,{placeholder:`cell_${h}`,value:v,onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),C.stopPropagation(),u(null))},onChange:C=>i({cellId:h,name:C})})]})]}))},rightElement:b.jsx(Y2e,{placeholder:`cell_${h}`,value:v,onChange:C=>i({cellId:h,name:C})})},{icon:b.jsx(sP,{size:13,strokeWidth:1.5}),label:"Run cell",hotkey:"cell.run",hidden:O==="running"||O==="queued"||O==="disabled-transitively"||p.disabled===!0,handle:()=>c()},{icon:b.jsx(NLe,{size:13,strokeWidth:1.5}),label:"AI completion",hidden:!d,handle:()=>{f(C=>C===h?null:h)},hotkey:"cell.aiCompletion"},{icon:b.jsx(sz,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!y,handle:()=>wFn(h)},{icon:b.jsx(foe,{size:13,strokeWidth:1.5}),label:"Format cell",hotkey:"cell.format",handle:()=>{m&&Rpe({[h]:m},r)}},{icon:u2(m)==="python"?b.jsx(Iit,{}):b.jsx(Nit,{}),label:u2(m)==="python"?"View as Markdown":"View as Python",hotkey:"cell.viewAsMarkdown",hidden:!Trt(m)&&u2(m)!=="markdown",handle:()=>{m&&Prt(h,m,r)}},{icon:p.hide_code?b.jsx(TLe,{size:13,strokeWidth:1.5}):b.jsx(FEt,{size:13,strokeWidth:1.5}),label:p.hide_code===!0?"Show code":"Hide code",handle:S,hotkey:"cell.hideCode"},{icon:p.disabled?b.jsx(BLe,{size:13,strokeWidth:1.5}):b.jsx(QLe,{size:13,strokeWidth:1.5}),label:p.disabled===!0?"Enable cell":"Disable cell",rightElement:b.jsx(Qb,{"data-testid":"cell-disable-switch",checked:!p.disabled,size:"sm",onCheckedChange:w}),handle:w}],[{icon:b.jsxs(f2,{children:[b.jsx(Tve,{size:13,strokeWidth:1.5}),b.jsx(GZ,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>t({cellId:h,before:!0})},{icon:b.jsxs(f2,{children:[b.jsx(Tve,{size:13,strokeWidth:1.5}),b.jsx(P0,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>t({cellId:h,before:!1})},{icon:b.jsx(GZ,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>s({cellId:h,before:!0})},{icon:b.jsx(P0,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>s({cellId:h,before:!1})},{icon:b.jsx(AEt,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>a({cellId:h})},{icon:b.jsx($Et,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>l({cellId:h})}],[{label:"Delete",variant:"danger",icon:b.jsx(AR,{size:13,strokeWidth:1.5}),handle:async()=>{await J5e(h),o({cellId:h})}}]].map(C=>C.filter(k=>!k.hidden)).filter(C=>C.length>0)}const Lit=hn(null),kFn=hn(e=>{const t=e(Lit),{cellData:n,cellHandles:r,cellRuntime:i}=e(mc);if(!t)return null;const o=n[t],s=i[t],a=r[t].current;if(!o||!s||!a)return null;const l=()=>a.editorView;return{cellId:t,name:o.name,config:o.config,status:s.status,getEditorView:l,hasOutput:s.output!==null}});function $Fn(){const{theme:e}=mp(),[t,n]=fR(),[r,i]=Qre(),o=async l=>{await noe({config:l}).then(()=>{n(l)})},s=async l=>{await eLe({config:l}).then(()=>{i(l)})};return[...zre.filter(l=>l!==r.width).map(l=>({label:`App config > Set width=${l}`,handle:()=>{s({...r,width:l})}})),{label:"Config > Toggle dark mode",handle:()=>{o({...t,display:{...t.display,theme:e==="dark"?"light":"dark"}})}},{label:"Config > Switch keymap to  VIM",hidden:t.keymap.preset==="vim",handle:()=>{o({...t,keymap:{...t.keymap,preset:"vim"}})}},{label:"Config > Switch keymap to default (current: VIM)",hidden:t.keymap.preset==="default",handle:()=>{o({...t,keymap:{...t.keymap,preset:"default"}})}},{label:t.completion.copilot?"Config > Disable GitHub Copilot":"Config > Enable GitHub Copilot",handle:()=>{o({...t,completion:{...t.completion,copilot:!t.completion.copilot}})}}].filter(l=>!l.hidden)}const hge=hn(!1),TFn=()=>{const[e,t]=tc(hge),n=zAn(),r=Gi(kFn);let i=dge({cell:r}).flat();i=PL(i);const o=$Fn();let s=Vit();s=[...PL(s),...PL(o)];const a=s.filter(p=>!p.hotkey),l=pn.keyBy(a,p=>p.label),{recentCommands:c,addRecentCommand:u}=OFn(),f=new Set(c);ie.useEffect(()=>{const p=g=>{XQ(Er.getHotkey("global.commandPalette").key)(g)&&(g.preventDefault(),t(v=>!v))};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[t]);const d=p=>{const g=n[p];if(!g)return null;const v=Er.getHotkey(p);return b.jsxs(hP,{onSelect:()=>{u(p),t(!1),requestAnimationFrame(()=>{g()})},value:v.name,children:[b.jsx("span",{children:v.name}),b.jsx(W1e,{children:b.jsx(W4,{shortcut:v.key})})]},p)},h=(p,g,v)=>b.jsxs(hP,{onSelect:()=>{u(p),t(!1),requestAnimationFrame(()=>{g()})},value:p,children:[b.jsx("span",{children:p}),v&&b.jsx(W1e,{children:b.jsx(W4,{shortcut:Er.getHotkey(v).key})})]},p);return b.jsxs(iMt,{open:e,onOpenChange:t,children:[b.jsx(Tz,{placeholder:"Type to search..."}),b.jsxs(Yoe,{children:[b.jsx(Pz,{children:"No results found."}),c.length>0&&b.jsxs(b.Fragment,{children:[b.jsx(Uj,{heading:"Recently Used",children:c.map(p=>{if(BAn(p))return d(p);const g=l[p];return g&&!Rit(g)?h(g.label,g.handleHeadless||g.handle):null})}),b.jsx(Goe,{})]}),b.jsxs(Uj,{heading:"Commands",children:[Er.iterate().map(p=>f.has(p)?null:d(p)),a.map(p=>f.has(p.label)?null:h(p.label,p.handleHeadless||p.handle)),i.map(p=>f.has(p.label)?null:h(`Cell > ${p.label}`,p.handleHeadless||p.handle))]})]})]})},PFn=/\/@file\/([^\s/]+)\.([\dA-Za-z]+)/g,v2=class v2{constructor(){ve(this,"virtualFiles",new Map);Gre(v2.INSTANCE,"VirtualFileTracker")}track(t){const{cell_id:n,output:r}=t;if(r)switch(r.mimetype){case"application/json":case"text/html":{const i=this.virtualFiles.get(n),o=AFn(r.data);i==null||i.forEach(s=>o.add(s)),this.virtualFiles.set(n,o);return}default:return}}removeForCellId(t){this.virtualFiles.delete(t)}};ve(v2,"INSTANCE",new v2);let FA=v2;function AFn(e){if(!e)return new Set;const t=new Set,r=(typeof e=="string"?e:JSON.stringify(e)).match(PFn);if(r)for(const i of r)t.add(i);return t}function jit(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=i=>{var o;t((o=i.target)==null?void 0:o.result)},r.onerror=i=>{n(new Error(`Failed to read blob: ${i.type}`))},r.readAsDataURL(e)})}function Fit(e){return new Promise((t,n)=>{var r;try{const[i,o]=e.split(",",2),s=(r=/^data:(.+);base64$/.exec(i))==null?void 0:r[1],a=atob(o),l=a.length,c=new Uint8Array(l);for(let f=0;f<l;f++)c[f]=a.charCodeAt(f);const u=new Blob([c],{type:s});t(u)}catch(i){n(RFn(i))}})}function RFn(e){return e instanceof Error?e:new Error(`${e}`)}const DFn={merge(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}};async function MFn(){const e={},t=DFn.merge(...FA.INSTANCE.virtualFiles.values());for(const n of t)try{const r=await fetch(n);(r.headers.get("Content-Type")??"")||At.warn(`Content-Type header missing for virtual file ${n}`);const o=await r.blob(),s=await jit(o);e[n]={base64:s}}catch(r){At.warn(`Error downloading virtual file ${n}`,r)}return e}function NFn(e=Y5e()){const t=window.fetch;return window.fetch=async(n,r)=>{const i=n instanceof Request?n.url:n.toString(),o=i.startsWith("/")||i.startsWith("./")?new URL(i,window.location.origin):new URL(i);if(e[o.pathname]){const{base64:s}=e[o.pathname],a=await Fit(s);return new Response(a)}return t(n,r)},()=>{window.fetch=t}}function IFn(e,t=Y5e()){const n=e.http;return e.http=async r=>{if(t[r]){const{base64:i}=t[r];return(await Fit(i)).text()}return n(r)},()=>{e.http=n}}const v7={dirname:e=>MO.guessDeliminator(e).dirname(e),basename:e=>MO.guessDeliminator(e).basename(e)};class MO{constructor(t){this.deliminator=t}static guessDeliminator(t){return t.includes("/")?new MO("/"):new MO("\\")}join(...t){return t.filter(Boolean).join(this.deliminator)}basename(t){return t.split(this.deliminator).pop()??""}dirname(t){const n=t.split(this.deliminator);return n.pop(),n.join(this.deliminator)}}async function zit(){const e=yae(),t=jre(),n=`https://cdn.jsdelivr.net/npm/@marimo-team/frontend@${t}/dist`,r=await T5();return jFn({notebookState:e,version:t,assetUrl:n,existingDocument:document,files:await MFn(),code:r.contents})}async function LFn(e){const{filename:t}=e,n=await zit(),i=(v7.basename(t)??"notebook.py").split(".").shift()??"app";WR(new Blob([n],{type:"text/html"}),`${i}.html`)}function jFn(e){const{version:t,notebookState:n,assetUrl:r,existingDocument:i,files:o,code:s}=e,a=i.head.cloneNode(!0);a.querySelectorAll("link[as=font]").forEach(v=>v.remove());const l=["marimo-filename","marimo-version","marimo-user-config","marimo-app-config"],c=`
  <!DOCTYPE html>
  <html>
    <head>
      <base href="/">
      ${a.innerHTML}
    </head>

    <body>
      <div id="root"></div>
      <marimo-mode data-mode="read" hidden=""></marimo-mode>
      ${l.map(v=>{const y=i.querySelector(v);if(!y)throw new Error(`Element ${v} not found.`);return y.outerHTML}).join(`
`)}
      <script data-marimo="true">
        window.__MARIMO_STATIC__ = {};
        window.__MARIMO_STATIC__.version = "${t}";
        window.__MARIMO_STATIC__.notebookState = ${JSON.stringify({cellIds:n.cellIds,cellData:pn.mapValues(n.cellData,UOe),cellRuntime:pn.mapValues(n.cellRuntime,UOe)})};
        window.__MARIMO_STATIC__.assetUrl = "${r}";
        window.__MARIMO_STATIC__.files = ${JSON.stringify(o)};
      <\/script>

      <marimo-code hidden="">
        ${encodeURIComponent(s)}
      </marimo-code>
    </body>
  </html>
  `,u=new DOMParser().parseFromString(c,"text/html"),f=i.body,d=v=>{const y=v.cloneNode(!0);y instanceof HTMLElement&&y.setAttribute("crossorigin","anonymous"),u.body.append(v.cloneNode(!0))};return f.querySelectorAll("style[href]").forEach(d),f.querySelectorAll("script[src]").forEach(d),f.querySelectorAll("link[href]").forEach(d),u.querySelectorAll("script").forEach(v=>{const y=v.getAttribute("src");y?(v.setAttribute("src",G2e(y,r)),v.setAttribute("crossorigin","anonymous")):Object.hasOwn(v.dataset,"marimo")||v.remove()}),u.querySelectorAll("link").forEach(v=>{const y=v.getAttribute("href");y?(v.setAttribute("href",G2e(y,r)),v.setAttribute("crossorigin","anonymous")):v.remove()}),u.querySelectorAll("style").forEach(v=>v.remove()),u.head.innerHTML=`
  ${u.head.innerHTML}
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  <link href="https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500;700&family=Lora&family=PT+Sans:wght@400;700&display=swap" rel="stylesheet">
  `.trim(),`<!DOCTYPE html>
${u.documentElement.outerHTML}`}function G2e(e,t){if(e.startsWith("./"))return`${t}${e.slice(1)}`;if(e.startsWith("/"))return`${t}${e}`;const n=new URL(e);return n.origin!==window.location.origin?`${t}${n.pathname}`:e}const FFn=hn(BNe());function Qit(){return tc(FFn)}const LI="https://static.marimo.app",zFn=({onClose:e})=>{const[t,n]=x.useState(""),r=x.useRef(Math.random().toString(36).slice(2,6)).current,i=`${t}-${r}`,o=`${LI}/static/${i}`;return b.jsx(gm,{className:"w-fit",children:b.jsxs("form",{onSubmit:async s=>{s.preventDefault(),e();const a=await zit(),l=yr({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${LI}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:a,path:i})}).catch(()=>{l.dismiss(),yr({title:"Error uploading static page",description:b.jsxs("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",b.jsx("a",{href:qre.issuesPage,target:"_blank",rel:"noreferrer",className:"underline",children:"GitHub"}),"."]})})}),l.dismiss(),yr({title:"Static page uploaded!",description:b.jsxs("div",{children:["The URL has been copied to your clipboard.",b.jsx("br",{}),"You can share it with anyone."]})})},children:[b.jsxs(YC,{children:[b.jsx(Ov,{children:"Share static notebook"}),b.jsxs(mE,{children:["You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on"," ",b.jsx("a",{href:LI,target:"_blank",rel:"noreferrer",children:LI}),"."]})]}),b.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[b.jsx(Wo,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:t,placeholder:"Notebook slug",onChange:s=>{const a=s.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,"");n(a)},required:!0,autoComplete:"off"}),b.jsxs("div",{className:"font-semibold text-sm text-muted-foreground gap-2 flex flex-col",children:["Anyone will be able to access your notebook at this URL:",b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(QFn,{text:o}),b.jsx("span",{className:"text-primary",children:o})]})]})]}),b.jsxs(FR,{children:[b.jsx(St,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:e,children:"Cancel"}),b.jsx(St,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:()=>{navigator.clipboard.writeText(o)},children:"Create"})]})]})})},QFn=e=>{const[t,n]=ie.useState(!1),r=tp.stopPropagation(i=>{i.preventDefault(),navigator.clipboard.writeText(e.text),n(!0),setTimeout(()=>n(!1),2e3)});return b.jsx(Wt,{content:"Copied!",open:t,children:b.jsx(St,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:b.jsx(WO,{size:14,strokeWidth:1.5})})})};function Bit(){const{openConfirm:e}=$m();return()=>{e({title:"Restart Kernel",description:"This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.",variant:"destructive",confirmAction:b.jsx(wz,{onClick:async()=>{await G5e(),window.location.reload()},"aria-label":"Confirm Restart",children:"Restart"})})}}function Wit(){return{selectedPanel:"variables",isOpen:!1,panelLocation:"left"}}const{reducer:BFn,createActions:WFn}=ZO(Wit,{openApplication:(e,t)=>({...e,selectedPanel:t,isOpen:e.isOpen?e.selectedPanel!==t:!0}),openPanel:e=>({...e,isOpen:!0}),closePanel:e=>({...e,isOpen:!1}),togglePanel:e=>({...e,isOpen:!e.isOpen}),setIsOpen:(e,t)=>({...e,isOpen:t}),changePanelLocation:(e,t)=>({...e,panelLocation:t})}),qit=hn(Wit()),pge=()=>{const e=Gi(qit);return e.isOpen?e:{...e,selectedPanel:void 0}};function EB(){const e=vl(qit);return x.useMemo(()=>WFn(n=>{e(r=>BFn(r,n))}),[e])}const gge={errors:zLe,files:qEt,variables:oz,dependencies:fCt,outline:MLe,documentation:coe,logs:hoe},qFn=pn.keys(gge),jH=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Vit(){const[e]=Qit(),{openModal:t,closeModal:n}=$m(),{openApplication:r}=EB(),{selectedPanel:i}=pge(),o=s_(),{updateCellConfig:s}=wp(),a=Bit(),l=vl(hge),c=vl(mtt),u=m9t(o),f=y9t(o);return[{icon:b.jsx(CCt,{size:14,strokeWidth:1.5}),label:"Share",handle:jH,dropdown:[{icon:b.jsx(PLe,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",handle:async()=>{t(b.jsx(zFn,{onClose:n}))}},{icon:b.jsx(tCt,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",handle:async()=>{const h=await T5(),p=toe({code:h.contents});window.navigator.clipboard.writeText(p),yr({title:"Copied",description:"Link copied to clipboard."})}}]},{icon:b.jsx(iz,{size:14,strokeWidth:1.5}),label:"Download",handle:jH,dropdown:[{icon:b.jsx(WEt,{size:14,strokeWidth:1.5}),label:"Download as HTML",handle:async()=>{if(!e){yr({variant:"danger",title:"Error",description:"Notebooks must be named to be exported."});return}await LFn({filename:e})}},{icon:b.jsx(sz,{size:14,strokeWidth:1.5}),label:"Download as PNG",handle:async()=>{const h=yr({title:"Starting download",description:"Downloading as PNG..."});await yFn(async()=>{const p=document.getElementById("App");p&&(await new Promise(g=>setTimeout(g,2e3)),await b4e(p,e||"screenshot.png"))}),h.dismiss()}},{icon:b.jsx(MEt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{const h=await T5();WR(new Blob([h.contents],{type:"text/plain"}),v7.basename(e||"notebook.py"))}}]},{divider:!0,icon:b.jsx(hCt,{size:14,strokeWidth:1.5}),label:"Helper panel",handle:jH,dropdown:qFn.map(h=>{const p=gge[h];return{label:RR(h),rightElement:b.jsx("div",{className:"w-8 flex justify-end",children:i===h&&b.jsx(dm,{size:14})}),icon:b.jsx(p,{size:14,strokeWidth:1.5}),handle:()=>r(h)}})},{icon:b.jsx(REt,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!e,handle:async()=>{const h=await T5();navigator.clipboard.writeText(h.contents),yr({title:"Copied",description:"Code copied to clipboard."})}},{icon:b.jsx(BLe,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:u.length===0,handle:async()=>{const h=u.map(g=>g.id),p=pn.fromEntries(h.map(g=>[g,{disabled:!1}]));await Mb({configs:p}),h.forEach(g=>s({cellId:g,config:{disabled:!1}}))}},{icon:b.jsx(QLe,{size:14,strokeWidth:1.5}),label:"Disable all cells",hidden:f.length===0,handle:async()=>{const h=f.map(g=>g.id),p=pn.fromEntries(h.map(g=>[g,{disabled:!0}]));await Mb({configs:p}),h.forEach(g=>s({cellId:g,config:{disabled:!0}}))}},{divider:!0,icon:b.jsx($Le,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>l(h=>!h)},{icon:b.jsx(JEt,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>c(h=>!h)},{icon:b.jsx(coe,{size:14,strokeWidth:1.5}),label:"Open documentation",handle:()=>{window.open("https://docs.marimo.io","_blank")}},{divider:!0,icon:b.jsx(vCt,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:a}].filter(h=>!h.hidden)}const VFn=()=>{const e=Vit(),t=b.jsx(Xi,{"aria-label":"Config",shape:"circle",size:"small",className:"h-[27px] w-[27px]","data-testid":"notebook-menu-dropdown",color:"hint-green",children:b.jsx(oCt,{strokeWidth:1.8})}),n=i=>b.jsxs(b.Fragment,{children:[i.icon&&b.jsx("span",{className:"flex-0 mr-2",children:i.icon}),b.jsx("span",{className:"flex-1",children:i.label}),i.hotkey&&ipe(i.hotkey),i.rightElement]}),r=i=>b.jsx(ll,{variant:i.variant,onSelect:o=>i.handle(o),"data-testid":`notebook-menu-dropdown-${i.label}`,children:n(i)},i.label);return b.jsxs(Bb,{modal:!1,children:[b.jsx(Wb,{asChild:!0,children:t}),b.jsxs(R0,{align:"end",className:"no-print w-[220px]",children:[e.map(i=>i.hidden?null:i.dropdown?b.jsxs(F5t,{children:[b.jsx(c4e,{"data-testid":`notebook-menu-dropdown-${i.label}`,children:n(i)}),b.jsx(j5t,{children:b.jsx(u4e,{children:i.dropdown.map(r)})})]},i.label):b.jsxs(ie.Fragment,{children:[i.divider&&b.jsx(qb,{}),r(i)]},i.label)),b.jsx(qb,{}),b.jsx("div",{className:"flex-1 px-2 text-xs text-muted-foreground",children:b.jsxs("span",{children:["Version: ",jre()]})})]})]})},xa=k6t({findText:"",replaceText:"",caseSensitive:!1,wholeWord:!1,regexp:!1,isOpen:!1,currentView:void 0},(e,t)=>{if(t===void 0)return e;switch(t.type){case"setFind":return{...e,findText:t.find};case"setReplace":return{...e,replaceText:t.replace};case"setCaseSensitive":return{...e,caseSensitive:t.caseSensitive};case"setWholeWord":return{...e,wholeWord:t.wholeWord};case"setRegex":return{...e,regexp:t.regexp};case"setIsOpen":return{...e,isOpen:t.isOpen};case"setCurrentView":return{...e,currentView:{view:t.view,range:t.range}};case"clearCurrentView":return{...e,currentView:void 0}}});function Uit(e){if(document.querySelector('[role="dialog"][data-state="open"]'))return!1;if(e){const r=e.state.selection.main,i=e.state.sliceDoc(r.from,r.to);i?(Tn.set(xa,{type:"setFind",find:i}),Tn.set(xa,{type:"setCurrentView",view:e,range:{from:r.from,to:r.to}})):Tn.set(xa,{type:"setCurrentView",view:e,range:{from:0,to:0}})}return Tn.get(xa).isOpen?(Tn.set(xa,{type:"setIsOpen",isOpen:!1}),requestAnimationFrame(()=>{Tn.set(xa,{type:"setIsOpen",isOpen:!0})}),!0):(Tn.set(xa,{type:"setIsOpen",isOpen:!0}),!0)}function UFn(){return Tn.get(xa).isOpen?(Tn.set(xa,{type:"setIsOpen",isOpen:!1}),!0):!1}function b7(e){return bi("create"in e,'Expected query to have a "create" method'),e}function CB(e){return()=>{const t=Tn.get(xa),n=new Tv({search:t.findText,caseSensitive:t.caseSensitive,regexp:t.regexp,replace:t.replaceText,wholeWord:t.wholeWord});return n.valid?e({query:b7(n).create(),search:n}):!1}}const Hit=e=>CB(({query:t})=>{const n=Cv(),r=Tn.get(xa).currentView||{view:n[0],range:{from:0,to:0}};let i=r.range.to;e==="prev"&&(n.reverse(),i=r.range.from);let o=n.indexOf(r.view);o<0&&(o=0);const s=[...n,...n].slice(o);for(const a of s){const l=e==="next"?t.nextMatch(a.state,0,i??0):t.prevMatch(a.state,i??a.state.doc.length,a.state.doc.length);if(!l){i=null,a.dispatch({selection:Ae.single(0)});continue}const c=Ae.single(l.from,l.to);return a.dispatch({selection:c,effects:[Ve.scrollIntoView(c.main,{y:"center"})],userEvent:"select.search"}),Tn.set(xa,{type:"setCurrentView",view:a,range:{from:l.from,to:l.to}}),l}return!1}),ane=Hit("next"),K2e=Hit("prev"),HFn=CB(({query:e})=>{var i;const t=Cv(),n=[];for(const o of t){if(o.state.readOnly)continue;const s=(i=e.matchAll(o.state,1e9))==null?void 0:i.map(l=>{const{from:c,to:u}=l;return{from:c,to:u,insert:e.getReplacement(l)}});if(!s||s.length===0)continue;const a=o.state.doc.toString();n.push(()=>{o.dispatch({changes:[{from:0,to:o.state.doc.length,insert:a}],userEvent:"input.replace.all"})}),o.dispatch({changes:s,userEvent:"input.replace.all"})}return()=>{for(const o of n)o()}}),XFn=CB(({query:e})=>{const t=Cv(),n=Tn.get(xa).currentView||{view:t[0],range:{from:0,to:0}};let r=n.range.from,i=t.indexOf(n.view);i<0&&(i=0);const o=[...t,...t].slice(i);for(const s of o){const a=e.nextMatch(s.state,0,r??0);if(!a){r=null,s.dispatch({selection:Ae.single(0)});continue}const l=s.state.toText(e.getReplacement(a));return s.dispatch({changes:[{from:a.from,to:a.to,insert:l}],userEvent:"input.replace"}),ane()}return!1}),ZFn=CB(({query:e})=>{const t=Cv();let n=0;const r=new Map;for(const i of t){const o=e.matchAll(i.state,1e9)||[];for(const s of o){const{from:a,to:l}=s,c=r.get(i)||new Map;c.set(`${a}:${l}`,n++),r.set(i,c)}}return{count:n,position:r}}),Mh=typeof document<"u"?ie.useLayoutEffect:()=>{},Aa=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},O7=e=>e&&"window"in e&&e.window===e?e:Aa(e).defaultView||window;function J2e(e){if(YFn())e.focus({preventScroll:!0});else{let t=GFn(e);e.focus(),KFn(t)}}let jI=null;function YFn(){if(jI==null){jI=!1;try{document.createElement("div").focus({get preventScroll(){return jI=!0,!0}})}catch{}}return jI}function GFn(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function KFn(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function JFn(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function e4n(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function t4n(){return e4n(/^Mac/i)}function n4n(){return JFn(/Android/i)}let $w=new Map,lne=new Set;function ePe(){if(typeof window>"u")return;function e(r){return"propertyName"in r}let t=r=>{if(!e(r)||!r.target)return;let i=$w.get(r.target);i||(i=new Set,$w.set(r.target,i),r.target.addEventListener("transitioncancel",n,{once:!0})),i.add(r.propertyName)},n=r=>{if(!e(r)||!r.target)return;let i=$w.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),$w.delete(r.target)),$w.size===0)){for(let o of lne)o();lne.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?ePe():document.addEventListener("DOMContentLoaded",ePe));function r4n(e){requestAnimationFrame(()=>{$w.size===0?e():lne.add(e)})}function i4n(e){return e.mozInputSource===0&&e.isTrusted?!0:n4n()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}const o4n=ie.createContext({register:()=>{}});o4n.displayName="PressResponderContext";let aM=null,s4n=new Set,d2=new Map,NO=!1,cne=!1;function mge(e,t){for(let n of s4n)n(e,t)}function a4n(e){return!(e.metaKey||!t4n()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function x7(e){NO=!0,a4n(e)&&(aM="keyboard",mge("keyboard",e))}function Nu(e){aM="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(NO=!0,mge("pointer",e))}function Xit(e){i4n(e)&&(NO=!0,aM="virtual")}function Zit(e){e.target===window||e.target===document||(!NO&&!cne&&(aM="virtual",mge("virtual",e)),NO=!1,cne=!1)}function Yit(){NO=!1,cne=!0}function tPe(e){if(typeof window>"u"||d2.get(O7(e)))return;const t=O7(e),n=Aa(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){NO=!0,r.apply(this,arguments)},n.addEventListener("keydown",x7,!0),n.addEventListener("keyup",x7,!0),n.addEventListener("click",Xit,!0),t.addEventListener("focus",Zit,!0),t.addEventListener("blur",Yit,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Nu,!0),n.addEventListener("pointermove",Nu,!0),n.addEventListener("pointerup",Nu,!0)):(n.addEventListener("mousedown",Nu,!0),n.addEventListener("mousemove",Nu,!0),n.addEventListener("mouseup",Nu,!0)),t.addEventListener("beforeunload",()=>{Git(e)},{once:!0}),d2.set(t,{focus:r})}const Git=(e,t)=>{const n=O7(e),r=Aa(e);t&&r.removeEventListener("DOMContentLoaded",t),d2.has(n)&&(n.HTMLElement.prototype.focus=d2.get(n).focus,r.removeEventListener("keydown",x7,!0),r.removeEventListener("keyup",x7,!0),r.removeEventListener("click",Xit,!0),n.removeEventListener("focus",Zit,!0),n.removeEventListener("blur",Yit,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Nu,!0),r.removeEventListener("pointermove",Nu,!0),r.removeEventListener("pointerup",Nu,!0)):(r.removeEventListener("mousedown",Nu,!0),r.removeEventListener("mousemove",Nu,!0),r.removeEventListener("mouseup",Nu,!0)),d2.delete(n))};function l4n(e){const t=Aa(e);let n;return t.readyState!=="loading"?tPe(e):(n=()=>{tPe(e)},t.addEventListener("DOMContentLoaded",n)),()=>Git(e,n)}typeof document<"u"&&l4n();function c4n(){return aM}function u4n(e){const t=Aa(e);if(c4n()==="virtual"){let n=t.activeElement;r4n(()=>{t.activeElement===n&&e.isConnected&&J2e(e)})}else J2e(e)}function f4n(e){const t=O7(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!=="none"&&r!=="hidden"&&r!=="collapse";if(i){const{getComputedStyle:o}=e.ownerDocument.defaultView;let{display:s,visibility:a}=o(e);i=s!=="none"&&a!=="hidden"&&a!=="collapse"}return i}function d4n(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Kit(e,t){return e.nodeName!=="#comment"&&f4n(e)&&d4n(e,t)&&(!e.parentElement||Kit(e.parentElement,e))}const nPe=ie.createContext(null);let li=null;function h4n(e){let{children:t,contain:n,restoreFocus:r,autoFocus:i}=e,o=x.useRef(null),s=x.useRef(null),a=x.useRef([]),{parentNode:l}=x.useContext(nPe)||{},c=x.useMemo(()=>new fne({scopeRef:a}),[a]);Mh(()=>{let d=l||yo.root;if(yo.getTreeNode(d.scopeRef)&&li&&!w7(li,d.scopeRef)){let h=yo.getTreeNode(li);h&&(d=h)}d.addChild(c),yo.addNode(c)},[c,l]),Mh(()=>{let d=yo.getTreeNode(a);d&&(d.contain=!!n)},[n]),Mh(()=>{var d;let h=(d=o.current)===null||d===void 0?void 0:d.nextSibling,p=[];for(;h&&h!==s.current;)p.push(h),h=h.nextSibling;a.current=p},[t]),b4n(a,r,n),y4n(a,n),x4n(a,r,n),v4n(a,i),x.useEffect(()=>{const d=Aa(a.current?a.current[0]:void 0).activeElement;let h=null;if(ka(d,a.current)){for(let p of yo.traverse())p.scopeRef&&ka(d,p.scopeRef.current)&&(h=p);h===yo.getTreeNode(a)&&(li=h.scopeRef)}},[a]),Mh(()=>()=>{var d,h,p;let g=(p=(h=yo.getTreeNode(a))===null||h===void 0||(d=h.parent)===null||d===void 0?void 0:d.scopeRef)!==null&&p!==void 0?p:null;(a===li||w7(a,li))&&(!g||yo.getTreeNode(g))&&(li=g),yo.removeTreeNode(a)},[a]);let u=x.useMemo(()=>p4n(a),[]),f=x.useMemo(()=>({focusManager:u,parentNode:c}),[c,u]);return ie.createElement(nPe.Provider,{value:f},ie.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:o}),t,ie.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:s}))}function p4n(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:o,accept:s}=t,a=r||Aa(n[0]).activeElement,l=n[0].previousElementSibling,c=Y1(n),u=Qy(c,{tabbable:i,accept:s},n);u.currentNode=ka(a,n)?a:l;let f=u.nextNode();return!f&&o&&(u.currentNode=l,f=u.nextNode()),f&&wg(f,!0),f},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:o,accept:s}=t,a=r||Aa(n[0]).activeElement,l=n[n.length-1].nextElementSibling,c=Y1(n),u=Qy(c,{tabbable:i,accept:s},n);u.currentNode=ka(a,n)?a:l;let f=u.previousNode();return!f&&o&&(u.currentNode=l,f=u.previousNode()),f&&wg(f,!0),f},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,o=Y1(n),s=Qy(o,{tabbable:r,accept:i},n);s.currentNode=n[0].previousElementSibling;let a=s.nextNode();return a&&wg(a,!0),a},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,o=Y1(n),s=Qy(o,{tabbable:r,accept:i},n);s.currentNode=n[n.length-1].nextElementSibling;let a=s.previousNode();return a&&wg(a,!0),a}}}const yge=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],g4n=yge.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";yge.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const m4n=yge.join(':not([hidden]):not([tabindex="-1"]),');function Y1(e){return e[0].parentElement}function iT(e){let t=yo.getTreeNode(li);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function y4n(e,t){let n=x.useRef(),r=x.useRef();Mh(()=>{let i=e.current;if(!t){r.current&&(cancelAnimationFrame(r.current),r.current=void 0);return}const o=Aa(i?i[0]:void 0);let s=c=>{if(c.key!=="Tab"||c.altKey||c.ctrlKey||c.metaKey||!iT(e))return;let u=o.activeElement,f=e.current;if(!f||!ka(u,f))return;let d=Y1(f),h=Qy(d,{tabbable:!0},f);if(!u)return;h.currentNode=u;let p=c.shiftKey?h.previousNode():h.nextNode();p||(h.currentNode=c.shiftKey?f[f.length-1].nextElementSibling:f[0].previousElementSibling,p=c.shiftKey?h.previousNode():h.nextNode()),c.preventDefault(),p&&wg(p,!0)},a=c=>{(!li||w7(li,e))&&ka(c.target,e.current)?(li=e,n.current=c.target):iT(e)&&!une(c.target,e)?n.current?n.current.focus():li&&li.current&&S7(li.current):iT(e)&&(n.current=c.target)},l=c=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{if(o.activeElement&&iT(e)&&!une(o.activeElement,e))if(li=e,o.body.contains(c.target)){var u;n.current=c.target,(u=n.current)===null||u===void 0||u.focus()}else li.current&&S7(li.current)})};return o.addEventListener("keydown",s,!1),o.addEventListener("focusin",a,!1),i==null||i.forEach(c=>c.addEventListener("focusin",a,!1)),i==null||i.forEach(c=>c.addEventListener("focusout",l,!1)),()=>{o.removeEventListener("keydown",s,!1),o.removeEventListener("focusin",a,!1),i==null||i.forEach(c=>c.removeEventListener("focusin",a,!1)),i==null||i.forEach(c=>c.removeEventListener("focusout",l,!1))}},[e,t]),Mh(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function Jit(e){return une(e)}function ka(e,t){return!e||!t?!1:t.some(n=>n.contains(e))}function une(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of yo.traverse(yo.getTreeNode(t)))if(n&&ka(e,n.current))return!0;return!1}function w7(e,t){var n;let r=(n=yo.getTreeNode(t))===null||n===void 0?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function wg(e,t=!1){if(e!=null&&!t)try{u4n(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function S7(e,t=!0){let n=e[0].previousElementSibling,r=Y1(e),i=Qy(r,{tabbable:t},e);i.currentNode=n;let o=i.nextNode();t&&!o&&(r=Y1(e),i=Qy(r,{tabbable:!1},e),i.currentNode=n,o=i.nextNode()),wg(o)}function v4n(e,t){const n=ie.useRef(t);x.useEffect(()=>{if(n.current){li=e;const r=Aa(e.current?e.current[0]:void 0);!ka(r.activeElement,li.current)&&e.current&&S7(e.current)}n.current=!1},[e])}function b4n(e,t,n){Mh(()=>{if(t||n)return;let r=e.current;const i=Aa(r?r[0]:void 0);let o=s=>{let a=s.target;ka(a,e.current)?li=e:Jit(a)||(li=null)};return i.addEventListener("focusin",o,!1),r==null||r.forEach(s=>s.addEventListener("focusin",o,!1)),()=>{i.removeEventListener("focusin",o,!1),r==null||r.forEach(s=>s.removeEventListener("focusin",o,!1))}},[e,t,n])}function O4n(e){let t=yo.getTreeNode(li);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(t==null?void 0:t.scopeRef)===e}function x4n(e,t,n){const r=x.useRef(typeof document<"u"?Aa(e.current?e.current[0]:void 0).activeElement:null);Mh(()=>{let i=e.current;const o=Aa(i?i[0]:void 0);if(!t||n)return;let s=()=>{(!li||w7(li,e))&&ka(o.activeElement,e.current)&&(li=e)};return o.addEventListener("focusin",s,!1),i==null||i.forEach(a=>a.addEventListener("focusin",s,!1)),()=>{o.removeEventListener("focusin",s,!1),i==null||i.forEach(a=>a.removeEventListener("focusin",s,!1))}},[e,n]),Mh(()=>{const i=Aa(e.current?e.current[0]:void 0);if(!t)return;let o=s=>{if(s.key!=="Tab"||s.altKey||s.ctrlKey||s.metaKey||!iT(e))return;let a=i.activeElement;if(!ka(a,e.current))return;let l=yo.getTreeNode(e);if(!l)return;let c=l.nodeToRestore,u=Qy(i.body,{tabbable:!0});u.currentNode=a;let f=s.shiftKey?u.previousNode():u.nextNode();if((!c||!i.body.contains(c)||c===i.body)&&(c=void 0,l.nodeToRestore=void 0),(!f||!ka(f,e.current))&&c){u.currentNode=c;do f=s.shiftKey?u.previousNode():u.nextNode();while(ka(f,e.current));s.preventDefault(),s.stopPropagation(),f?wg(f,!0):Jit(c)?wg(c,!0):a.blur()}};return n||i.addEventListener("keydown",o,!0),()=>{n||i.removeEventListener("keydown",o,!0)}},[e,t,n]),Mh(()=>{const i=Aa(e.current?e.current[0]:void 0);if(!t)return;let o=yo.getTreeNode(e);if(o){var s;return o.nodeToRestore=(s=r.current)!==null&&s!==void 0?s:void 0,()=>{let a=yo.getTreeNode(e);if(!a)return;let l=a.nodeToRestore;if(t&&l&&(ka(i.activeElement,e.current)||i.activeElement===i.body&&O4n(e))){let c=yo.clone();requestAnimationFrame(()=>{if(i.activeElement===i.body){let u=c.getTreeNode(e);for(;u;){if(u.nodeToRestore&&u.nodeToRestore.isConnected){wg(u.nodeToRestore);return}u=u.parent}for(u=c.getTreeNode(e);u;){if(u.scopeRef&&u.scopeRef.current&&yo.getTreeNode(u.scopeRef)){S7(u.scopeRef.current,!0);return}u=u.parent}}})}}}},[e,t])}function Qy(e,t,n){let r=t!=null&&t.tabbable?m4n:g4n,i=Aa(e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(o){var s;return!(t==null||(s=t.from)===null||s===void 0)&&s.contains(o)?NodeFilter.FILTER_REJECT:o.matches(r)&&Kit(o)&&(!n||ka(o,n))&&(!(t!=null&&t.accept)||t.accept(o))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}class vge{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,n,r){let i=this.fastMap.get(n??null);if(!i)return;let o=new fne({scopeRef:t});i.addChild(o),o.parent=i,this.fastMap.set(t,o),r&&(o.nodeToRestore=r)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let n=this.fastMap.get(t);if(!n)return;let r=n.parent;for(let o of this.traverse())o!==n&&n.nodeToRestore&&o.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&ka(o.nodeToRestore,n.scopeRef.current)&&(o.nodeToRestore=n.nodeToRestore);let i=n.children;r&&(r.removeChild(n),i.size>0&&i.forEach(o=>r&&r.addChild(o))),this.fastMap.delete(n.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let n of t.children)yield*this.traverse(n)}clone(){var t;let n=new vge;var r;for(let i of this.traverse())n.addTreeNode(i.scopeRef,(r=(t=i.parent)===null||t===void 0?void 0:t.scopeRef)!==null&&r!==void 0?r:null,i.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new fne({scopeRef:null}),this.fastMap.set(null,this.root)}}class fne{addChild(t){this.children.add(t),t.parent=this}removeChild(t){this.children.delete(t),t.parent=void 0}constructor(t){this.children=new Set,this.contain=!1,this.scopeRef=t.scopeRef}}let yo=new vge;const bge=jt.define();function w4n(){const e=Tn.get(xa),t=Cv();for(const n of t)n.state.readOnly||n.dispatch({effects:bge.of(new Tv({search:e.findText,caseSensitive:e.caseSensitive,regexp:e.regexp,replace:e.replaceText,wholeWord:e.wholeWord}))})}function rPe(){const e=Cv();for(const t of e)t.state.readOnly||t.dispatch({effects:bge.of(new Tv({search:""}))})}const AL=di.define({create(){const e=Tn.get(xa),t=new Tv({search:e.findText,caseSensitive:e.caseSensitive,regexp:e.regexp,replace:e.replaceText,wholeWord:e.wholeWord});return b7(t).create()},update(e,t){for(const n of t.effects)n.is(bge)&&(e=b7(n.value).create());return e}}),S4n=st.mark({class:"cm-searchMatch"}),E4n=st.mark({class:"cm-searchMatch cm-searchMatch-selected"}),C4n=250,_4n=jr.fromClass(class{constructor(e){ve(this,"decorations");this.view=e,this.decorations=this.highlight(e.state.field(AL))}update(e){const t=e.state.field(AL);(t!=e.startState.field(AL)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight(e){if(!e.spec.valid)return st.none;const{view:t}=this,n=new Ol,r=t.visibleRanges,i=r.length;for(let o=0;o<i;o++){let{to:s}=r[o];const{from:a}=r[o];for(;o<i-1&&s>r[o+1].from-2*C4n;)s=r[++o].to;e.highlight(t.state,a,s,(l,c)=>{const u=t.state.selection.ranges.some(f=>f.from==l&&f.to==c);n.add(l,c,u?E4n:S4n)})}return n.finish()}},{decorations:e=>e.decorations}),k4n=Ve.baseTheme({"&light .cm-searchMatch":{backgroundColor:"#99ff7780"},"&dark .cm-searchMatch":{backgroundColor:"#22bb0070"},"&light .cm-searchMatch-selected":{backgroundColor:"transparent"},"&dark .cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff88 !important"}});function $4n(e,t){const n=e.state,r=new Tv({search:t,caseSensitive:!0,regexp:!1,replace:"",wholeWord:!0}),o=b7(r).create().nextMatch(n,0,0);o&&(e.focus(),e.dispatch({selection:{anchor:o.from,head:o.from}}))}const T4n=()=>{var l;const[e,t]=x.useState(!1),[n,r]=tc(xa),[i,o]=x.useState();if(tl("cell.findAndReplace",()=>e&&n.isOpen?!1:Uit()),x.useEffect(()=>{if(!n.isOpen){rPe();return}if(n.findText===""){o(void 0),rPe();return}const c=ZFn();o(c===!1?void 0:c),w4n()},[n.findText,n.isOpen,n.caseSensitive,n.regexp,n.wholeWord]),!n.isOpen)return null;const s=n.currentView,a=s&&i?(l=i.position.get(s.view))==null?void 0:l.get(`${s.range.from}:${s.range.to}`):void 0;return b.jsx(h4n,{restoreFocus:!0,autoFocus:!0,children:b.jsxs("div",{onFocus:()=>t(!0),onClick:c=>{c.stopPropagation(),c.preventDefault()},onBlur:()=>t(!1),className:"fixed top-0 right-0 w-[500px] flex flex-col bg-[var(--sage-1)] p-4 z-50 mt-2 mr-3 rounded-md shadow-lg border gap-2",onKeyDown:c=>{c.key==="Escape"&&r({type:"setIsOpen",isOpen:!1})},children:[b.jsx("div",{className:"absolute top-0 right-0",children:b.jsx(St,{"data-testid":"close-find-replace-button",onClick:()=>r({type:"setIsOpen",isOpen:!1}),size:"xs",variant:"text",children:b.jsx(rc,{className:"w-4 h-4"})})}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("div",{className:"flex flex-col flex-2 gap-2 w-[55%]",children:[b.jsx(Wo,{"data-testid":"find-input",value:n.findText,autoFocus:!0,className:"mr-2 mb-0",placeholder:"Find",onKeyDown:c=>{c.key==="Enter"&&(c.shiftKey?K2e():ane())},onChange:c=>{r({type:"setFind",find:c.target.value})}}),b.jsx(Wo,{"data-testid":"replace-input",value:n.replaceText,placeholder:"Replace",onChange:c=>{r({type:"setReplace",replace:c.target.value})}})]}),b.jsxs("div",{className:"flex flex-col gap-2",children:[b.jsxs("div",{className:"flex items-center gap-[2px]",children:[b.jsx(Wt,{content:"Case Sensitive",children:b.jsx(qT,{size:"sm",pressed:n.caseSensitive,"data-state":n.caseSensitive?"on":"off",onPressedChange:c=>r({type:"setCaseSensitive",caseSensitive:c}),children:b.jsx(kLe,{className:"w-4 h-4"})})}),b.jsx(Wt,{content:"Match Whole Word",children:b.jsx(qT,{size:"sm",pressed:n.wholeWord,"data-state":n.wholeWord?"on":"off",onPressedChange:c=>r({type:"setWholeWord",wholeWord:c}),children:b.jsx(RCt,{className:"w-4 h-4"})})}),b.jsx(Wt,{content:"Use Regular Expression",children:b.jsx(qT,{size:"sm",pressed:n.regexp,"data-state":n.regexp?"on":"off",onPressedChange:c=>r({type:"setRegex",regexp:c}),children:b.jsx(bCt,{className:"w-4 h-4"})})})]}),b.jsxs("div",{className:"flex items-center gap-[2px]",children:[b.jsx(St,{"data-testid":"replace-next-button",size:"xs",variant:"outline",className:"h-6 text-xs",onClick:()=>XFn(),disabled:n.findText===""||n.replaceText==="",children:"Replace Next"}),b.jsx(St,{"data-testid":"replace-all-button",size:"xs",variant:"outline",className:"h-6 text-xs",onClick:()=>{const c=HFn();if(!c)return;const{dismiss:u}=yr({title:"Replaced all occurrences",action:b.jsx(St,{"data-testid":"undo-replace-all-button",size:"sm",variant:"outline",onClick:()=>{c(),u()},children:"Undo"})})},disabled:n.findText===""||n.replaceText==="",children:"Replace All"})]})]})]}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Wt,{content:"Find Previous",children:b.jsx(St,{"data-testid":"find-prev-button",size:"xs",variant:"secondary",onClick:()=>K2e(),children:b.jsx(ELe,{className:"w-4 h-4"})})}),b.jsx(Wt,{content:"Find Next",children:b.jsx(St,{"data-testid":"find-next-button",size:"xs",variant:"secondary",onClick:()=>ane(),children:b.jsx(OEt,{className:"w-4 h-4"})})}),i!=null&&a==null&&b.jsxs("span",{className:"text-sm",children:[i.count," matches"]}),i!=null&&a!=null&&b.jsxs("span",{className:"text-sm",children:[a+1," of ",i.count]})]})]})})},P4n=200;function eot(e){const[t,n]=x.useState(!1);return x.useEffect(()=>{if(!e)return;n(!1);const r=setTimeout(()=>{n(!0)},P4n);return()=>clearTimeout(r)},[e]),e&&t}const A4n=()=>{const e=vl(hge),t=()=>e(n=>!n);return b.jsx(Wt,{content:Md("global.commandPalette"),children:b.jsx(Xi,{"data-testid":"command-palette-button",onClick:t,shape:"rectangle",color:"white",children:b.jsx($Le,{strokeWidth:1.5})})})},R4n=({filename:e,needsSave:t,onSaveNotebook:n,getCellsAsJSON:r,presenting:i,onTogglePresenting:o,onInterrupt:s,onRun:a,onShutdown:l,closed:c,running:u,needsRun:f,undoAvailable:d,appWidth:h})=>{const{undoDeleteCell:p}=wp(),g=y=>{y.preventDefault(),y.stopPropagation(),n()};let v=null;return!c&&d&&(v=b.jsx(Wt,{content:"Undo cell deletion",children:b.jsx(Xi,{"data-testid":"undo-delete-cell",size:"medium",color:"hint-green",shape:"circle",onClick:p,children:b.jsx(TCt,{size:16,strokeWidth:1.5})})})),b.jsxs(b.Fragment,{children:[!i&&b.jsx(T4n,{}),!c&&b.jsxs("div",{className:M4n,children:[i&&b.jsx(dFn,{}),b.jsx(VFn,{}),b.jsx(nLn,{}),b.jsx(ZAn,{onShutdown:()=>{l(),setTimeout(()=>{window.close()},200)}})]}),b.jsxs("div",{className:be(I4n,h==="normal"&&"xl:flex-row"),children:[c?b.jsx(GAn,{filename:e,getCellsAsJSON:r,needsSave:t}):b.jsx(Wt,{content:Md("global.save"),children:b.jsx(Xi,{"data-testid":"save-button",id:"save-button",shape:"rectangle",color:t?"yellow":"hint-green",onClick:g,children:b.jsx(goe,{strokeWidth:1.5})})}),b.jsx(Wt,{content:Md("global.hideCode"),children:b.jsx(Xi,{"data-testid":"hide-code-button",id:"preview-button",shape:"rectangle",color:"white",onClick:o,children:i?b.jsx(ILe,{strokeWidth:1.5}):b.jsx(eCt,{strokeWidth:1.5})})}),b.jsx(A4n,{}),b.jsx(HAn,{})]}),b.jsxs("div",{className:N4n,children:[v,!c&&b.jsx(D4n,{running:u,needsRun:f,onRun:a,onInterrupt:s})]})]})},D4n=({running:e,needsRun:t,onRun:n,onInterrupt:r})=>eot(e)?b.jsx(Wt,{content:Md("global.interrupt"),children:b.jsx(Xi,{"data-testid":"interrupt-button",size:"medium",color:"yellow",shape:"circle",onClick:r,children:b.jsx(az,{strokeWidth:1.5,size:16})})}):t?b.jsx(Wt,{content:Md("global.runStale"),children:b.jsx(Xi,{"data-testid":"run-button",size:"medium",color:"yellow",shape:"circle",onClick:n,children:b.jsx(sP,{strokeWidth:1.5,size:16})})}):b.jsx(Wt,{content:"Nothing to run",children:b.jsx(Xi,{"data-testid":"run-button",className:"inactive-button",color:"disabled",size:"medium",shape:"circle",children:b.jsx(sP,{strokeWidth:1.5,size:16})})}),M4n="absolute top-3 right-5 m-0 flex items-center space-x-3 min-h-[28px] no-print pointer-events-auto z-30",N4n="absolute bottom-5 right-5 flex items-center space-x-3 no-print pointer-events-auto z-30",I4n="absolute bottom-5 left-4 m-0 flex flex-col-reverse gap-2 items-center no-print pointer-events-auto z-30",tot=({flexibleWidth:e=!1,resetOnBlur:t=!1,placeholderText:n="",initialValue:r=null,onFocusCallback:i=Yc.NOOP,onBlurCallback:o=Yc.NOOP,onChangeCallback:s=Yc.NOOP,handle:a=x.createRef(),...l})=>{const[c,u]=x.useState(r),[f,d]=x.useState([]),[h,p]=x.useState(null),[g,v]=x.useState(!1);x.useImperativeHandle(a,()=>({get suggestions(){return f}}));const y=x.useRef(null),O=x.useRef(null);x.useEffect(()=>{u(r)},[r]);function m(N){v(!0),i()}async function w(N){v(!1),t&&(N.preventDefault(),u(r)),o()}async function S(N){u(N.target.value),s(N.target.value)}const E=v7.dirname(c||""),C=v7.basename(c||""),k=f.filter(N=>N.startsWith(C));zd(async()=>{if(!g){p(null),d([]);return}const N=await tLe({path:E});p(null);const j=N.files.map(z=>z.path.slice(N.root.length+1));d(j)},[E,g]);function P(N){const j=c===null?"":c,z=f[N].slice(C.length);u(`${j+z}/`),y.current!=null&&y.current.focus()}function D(N,j){j.preventDefault(),j.button===0&&!f[N].endsWith(".py")&&P(N)}function M(N){switch(N.key){case"Down":case"ArrowDown":p(j=>j==null?0:(j+1)%f.length),N.preventDefault();break;case"Up":case"ArrowUp":p(j=>j===null||j===0?f.length-1:j-1),N.preventDefault();break;case"Enter":case"ArrowRight":if(h===null)break;N.preventDefault(),N.stopPropagation(),f[h].endsWith(".py")||P(h);break;case"Esc":case"Escape":y.current!==null&&y.current.blur(),N.preventDefault();break}}x.useEffect(()=>{if(h!==null&&O.current!=null){const N=O.current,j=N.parentElement;if(j===null)At.error("Expected elem to have parent; elem:",N);else{const z=j.scrollTop,W=[z,z+j.offsetHeight];N.offsetTop<W[0]?O.current.scrollIntoView(!0):N.offsetTop+N.offsetHeight>W[1]&&O.current.scrollIntoView(!1)}}},[h]);const L=k.length===0||y.current==null?null:b.jsx("ul",{className:"autocomplete-list",style:{maxWidth:y.current.offsetWidth,width:y.current.offsetWidth},children:k.map((N,j)=>{const z=N.endsWith(".py"),W=z?"📄":"📁 ",F=h===j;return b.jsxs("li",{className:be({file:z,directory:!z,"active-suggestion":F}),onMouseDown:q=>D(j,q),ref:F?O:null,children:[W," ",N]},N)})});let A;e&&(A=Math.min(60,Math.max(n.length,c===null?0:c.length)));const T=!g&&n!==""?n:c===null?"":c;return b.jsxs("div",{className:"DirCompletionInput",children:[b.jsx(dtt,{"data-testid":"dir-completion-input",type:"text",spellCheck:"false",value:T,style:{width:"unset"},autoComplete:"off",ref:y,size:A,onFocus:m,onChange:S,onBlur:w,onKeyDown:M,...l}),L]})},L4n=({filename:e,setFilename:t})=>{const{openAlert:n}=$m(),r=e===null?"untitled marimo app":e,[i,o]=x.useState(!1),[s,a]=x.useState(!1),l=x.useRef(null);function c(){const v=document.getElementById("filename-input");if(v===null)throw new Error("Could not find filename form");const y=v.value;y.length===0||y===".py"?(n(b.jsxs(bz,{children:[b.jsx(Oz,{className:"text-destructive",children:"Oops!"}),b.jsx(Qoe,{children:"The filename can't be empty. Make sure to enter a non-empty name."})]})),v.blur()):y.endsWith(".py")?t(y).then(()=>{v.blur()}):t(`${y}.py`).then(()=>{v.blur()})}function u(v){v.preventDefault(),c()}function f(v){v.preventDefault(),c()}function d(){o(!0)}function h(){o(!1)}function p(v){const y=l.current;if(y===null)return;const O=v.endsWith(".py")?v:`${v}.py`;O.length>3&&!y.suggestions.includes(O)?a(!0):a(!1)}const g=i?"visible":"hidden";return b.jsx("div",{id:"Filename",children:b.jsxs("form",{id:"filename-form",onSubmit:u,children:[b.jsx("div",{})," ",b.jsxs("div",{style:{position:"relative"},children:[b.jsx(tot,{placeholderText:r,initialValue:e,onChangeCallback:p,onFocusCallback:d,onBlurCallback:h,resetOnBlur:!0,flexibleWidth:!0,handle:l,id:"filename-input",className:e===null?"missing-filename":"filename"}),b.jsx(Xi,{type:"submit","data-testid":"filename-form-submit-button",color:s?"green":"gray",onMouseDown:f,style:{marginRight:"0px",padding:"0px",position:"absolute",top:"0.25rem",right:"-44px",width:"30px",height:"30px",visibility:g},children:b.jsx(dm,{size:16,strokeWidth:1.5})}),b.jsx(Xi,{color:"gray","data-testid":"filename-form-cancel-button",style:{marginRight:"0px",padding:"0px",position:"absolute",top:"0.25rem",right:"-86px",width:"30px",height:"30px",visibility:g},children:b.jsx(rc,{size:16,strokeWidth:1.5})})]})]})})};var vo=(e=>(e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED",e))(vo||{}),oT=(e=>(e.KERNEL_DISCONNECTED="KERNEL_DISCONNECTED",e.ALREADY_RUNNING="ALREADY_RUNNING",e.MALFORMED_QUERY="MALFORMED_QUERY",e))(oT||{});const j4n=hn({state:vo.CONNECTING});(!globalThis.EventTarget||!globalThis.Event)&&console.error(`
  PartySocket requires a global 'EventTarget' class to be available!
  You can polyfill this global by adding this to your code before any partysocket imports: 
  
  \`\`\`
  import 'partysocket/event-target-polyfill';
  \`\`\`
  Please file an issue at https://github.com/partykit/partykit if you're still having trouble.
`);var not=class extends Event{constructor(t,n){super("error",n);ve(this,"message");ve(this,"error");this.message=t.message,this.error=t}},rot=class extends Event{constructor(t=1e3,n="",r){super("close",r);ve(this,"code");ve(this,"reason");ve(this,"wasClean",!0);this.code=t,this.reason=n}},FH={Event,ErrorEvent:not,CloseEvent:rot};function F4n(e,t){if(!e)throw new Error(t)}function z4n(e){return new e.constructor(e.type,e)}function Q4n(e){return"data"in e?new MessageEvent(e.type,e):"code"in e||"reason"in e?new rot(e.code||1999,e.reason||"unknown reason",e):"error"in e?new not(e.error,e):new Event(e.type,e)}var DRe,B4n=typeof process<"u"&&typeof((DRe=process.versions)==null?void 0:DRe.node)<"u"&&typeof document>"u",FI=B4n?Q4n:z4n,s1={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},iPe=!1,W4n=class v1 extends EventTarget{constructor(n,r,i={}){super();ve(this,"_ws");ve(this,"_retryCount",-1);ve(this,"_uptimeTimeout");ve(this,"_connectTimeout");ve(this,"_shouldReconnect",!0);ve(this,"_connectLock",!1);ve(this,"_binaryType","blob");ve(this,"_closeCalled",!1);ve(this,"_messageQueue",[]);ve(this,"_debugLogger",console.log.bind(console));ve(this,"_url");ve(this,"_protocols");ve(this,"_options");ve(this,"onclose",null);ve(this,"onerror",null);ve(this,"onmessage",null);ve(this,"onopen",null);ve(this,"_handleOpen",n=>{this._debug("open event");const{minUptime:r=s1.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),r),F4n(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(i=>{var o;return(o=this._ws)==null?void 0:o.send(i)}),this._messageQueue=[],this.onopen&&this.onopen(n),this.dispatchEvent(FI(n))});ve(this,"_handleMessage",n=>{this._debug("message event"),this.onmessage&&this.onmessage(n),this.dispatchEvent(FI(n))});ve(this,"_handleError",n=>{this._debug("error event",n.message),this._disconnect(void 0,n.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(n),this._debug("exec error listeners"),this.dispatchEvent(FI(n)),this._connect()});ve(this,"_handleClose",n=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(n),this.dispatchEvent(FI(n))});this._url=n,this._protocols=r,this._options=i,this._options.startClosed&&(this._shouldReconnect=!1),this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return v1.CONNECTING}get OPEN(){return v1.OPEN}get CLOSING(){return v1.CLOSING}get CLOSED(){return v1.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(n){this._binaryType=n,this._ws&&(this._ws.binaryType=n)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((r,i)=>(typeof i=="string"?r+=i.length:i instanceof Blob?r+=i.size:r+=i.byteLength,r),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?v1.CLOSED:v1.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}close(n=1e3,r){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(n,r)}reconnect(n,r){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(n,r),this._connect())}send(n){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",n),this._ws.send(n);else{const{maxEnqueuedMessages:r=s1.maxEnqueuedMessages}=this._options;this._messageQueue.length<r&&(this._debug("enqueue",n),this._messageQueue.push(n))}}_debug(...n){this._options.debug&&this._debugLogger("RWS>",...n)}_getNextDelay(){const{reconnectionDelayGrowFactor:n=s1.reconnectionDelayGrowFactor,minReconnectionDelay:r=s1.minReconnectionDelay,maxReconnectionDelay:i=s1.maxReconnectionDelay}=this._options;let o=0;return this._retryCount>0&&(o=r*Math.pow(n,this._retryCount-1),o>i&&(o=i)),this._debug("next delay",o),o}_wait(){return new Promise(n=>{setTimeout(n,this._getNextDelay())})}_getNextProtocols(n){if(!n)return Promise.resolve(null);if(typeof n=="string"||Array.isArray(n))return Promise.resolve(n);if(typeof n=="function"){const r=n();if(!r)return Promise.resolve(null);if(typeof r=="string"||Array.isArray(r))return Promise.resolve(r);if(r.then)return r}throw Error("Invalid protocols")}_getNextUrl(n){if(typeof n=="string")return Promise.resolve(n);if(typeof n=="function"){const r=n();if(typeof r=="string")return Promise.resolve(r);if(r.then)return r}throw Error("Invalid URL")}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:n=s1.maxRetries,connectionTimeout:r=s1.connectionTimeout}=this._options;if(this._retryCount>=n){this._debug("max retries reached",this._retryCount,">=",n);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([i,o])=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!iPe&&(console.error(`‼️ No WebSocket implementation available. You should define options.WebSocket. 

For example, if you're using node.js, run \`npm install ws\`, and then in your code:

import PartySocket from 'partysocket';
import WS from 'ws';

const partysocket = new PartySocket({
  host: "127.0.0.1:1999",
  room: "test-room",
  WebSocket: WS
});

`),iPe=!0);const s=this._options.WebSocket||WebSocket;this._debug("connect",{url:i,protocols:o}),this._ws=o?new s(i,o):new s(i),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),r)}).catch(i=>{this._connectLock=!1,this._handleError(new FH.ErrorEvent(Error(i.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new FH.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(n=1e3,r){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(n,r),this._handleClose(new FH.CloseEvent(n,r,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}};/*!
 * Reconnecting WebSocket
 * by Pedro Ladaria <pedro.ladaria@gmail.com>
 * https://github.com/pladaria/reconnecting-websocket
 * License MIT
 */class q4n{constructor(){ve(this,"CONNECTING",WebSocket.CONNECTING);ve(this,"OPEN",WebSocket.OPEN);ve(this,"CLOSING",WebSocket.CLOSING);ve(this,"CLOSED",WebSocket.CLOSED);ve(this,"binaryType","blob");ve(this,"bufferedAmount",0);ve(this,"extensions","");ve(this,"protocol","");ve(this,"url","");ve(this,"onclose",null);ve(this,"onerror",null);ve(this,"onmessage",null);ve(this,"onopen",null);ve(this,"readyState",WebSocket.OPEN);ve(this,"retryCount",0);ve(this,"shouldReconnect",!1)}addEventListener(t,n,r){}removeEventListener(t,n,r){}dispatchEvent(t){return!1}reconnect(t,n){}send(t){}close(){}}function V4n(e){const{onOpen:t,onMessage:n,onClose:r,onError:i,...o}=e,[s]=x.useState(()=>yp()?new jwt(rP.INSTANCE):e.static?new q4n:new W4n(o.url,void 0,{maxRetries:10,debug:!1}));return x.useEffect(()=>(t&&s.addEventListener("open",t),r&&s.addEventListener("close",r),i&&s.addEventListener("error",i),n&&s.addEventListener("message",n),()=>{t&&s.removeEventListener("open",t),r&&s.removeEventListener("close",r),i&&s.removeEventListener("error",i),n&&s.removeEventListener("message",n)}),[]),s}function iot(){return{}}const{reducer:U4n,createActions:H4n}=ZO(iot,{setVariables:(e,t)=>{const n={...e},r={};for(const i of t)r[i.name]={...n[i.name],...i};return r},addVariables:(e,t)=>{const n={...e};for(const r of t)n[r.name]={...n[r.name],...r};return n},setMetadata:(e,t)=>{const n={...e};for(const{name:r,value:i,dataType:o}of t)n[r]&&(n[r]={...n[r],value:i,dataType:o});return n}}),oot=hn(iot()),sot=()=>Gi(oot);function X4n(){const e=vl(oot);return x.useMemo(()=>H4n(n=>{e(r=>U4n(r,n))}),[e])}const{reducer:Z4n,createActions:Y4n}=ZO(()=>({banners:[]}),{addBanner:(e,t)=>({...e,banners:[...e.banners,t]}),removeBanner:(e,t)=>({...e,banners:e.banners.filter(n=>n.id!==t)}),clearBanners:e=>({...e,banners:[]})}),aot=hn({banners:[]}),G4n=()=>Gi(aot);function lot(){const e=vl(aot);return x.useMemo(()=>Y4n(n=>{e(r=>Z4n(r,n))}),[e])}function K4n(e){return e.kind==="missing"}function J4n(e){return e.kind==="installing"}const{reducer:e7n,createActions:t7n}=ZO(()=>({packageAlert:null}),{addPackageAlert:(e,t)=>({...e,packageAlert:{id:J6(),...t}}),clearPackageAlert:(e,t)=>e.packageAlert!==null&&e.packageAlert.id===t?{...e,packageAlert:null}:e}),cot=hn({packageAlert:null}),n7n=()=>Gi(cot);function uot(){const e=vl(cot);return x.useMemo(()=>t7n(n=>{e(r=>e7n(r,n))}),[e])}function r7n(e){const t=document.baseURI,n=new URL(t),r=n.protocol==="https:"?"wss":"ws";n.protocol=r,n.pathname=`${i7n(n.pathname)}/ws`;const i=new URLSearchParams(window.location.search);return i.set("session_id",e),n.search=i.toString(),n.toString()}function i7n(e){return e.endsWith("/")?e.slice(0,-1):e}function o7n(e){const t=x.useRef(!0),{autoInstantiate:n,sessionId:r,setCells:i}=e,{showBoundary:o}=kht(),{handleCellMessage:s}=wp(),{setVariables:a,setMetadata:l}=X4n(),{setLayoutData:c}=uge(),[u,f]=tc(j4n),{addBanner:d}=lot(),{addPackageAlert:h}=uot(),p=y=>{const O=FNe(y.data);switch(O.op){case"reload":window.location.reload();return;case"kernel-ready":{const{codes:m,names:w,layout:S,configs:E,resumed:C,ui_values:k,cell_ids:P,last_executed_code:D={}}=O.data,M=m.map((N,j)=>{const z=P[j];let W=!1;if(n||C){const F=D[z];F&&(W=F!==N)}else W=!0;return O$({id:z,code:N,edited:W,name:w[j],lastCodeRun:D[z]??null,config:E[j]})}),L=age();if(S){const N=lFn(S.type,S.data,M);L.selectedLayout=S.type,L.layoutData[S.type]=N,c({layoutView:S.type,data:N})}if(i(M,L),C){for(const[N,j]of pn.entries(k||{}))ef.set(N,j);return}const A=[],T=[];ef.entries.forEach((N,j)=>{A.push(j),T.push(N.value)}),n&&(Sa.INSTANCE.registerRunStart(),rSt({objectIds:A,values:T}).catch(N=>{Sa.INSTANCE.registerRunEnd(),o(new Error("Failed to instantiate",{cause:N}))}));return}case"completed-run":case"interrupted":O.op==="completed-run"&&Sa.INSTANCE.registerRunEnd(),Sa.INSTANCE.running()||Sa.INSTANCE.flushUpdates();return;case"remove-ui-elements":{const{cell_id:m}=O.data;ef.removeElementsByCell(m),FA.INSTANCE.removeForCellId(m);return}case"completion-result":zle.resolve(O.data.completion_id,O.data);return;case"function-call-result":iLe.resolve(O.data.function_call_id,O.data);return;case"cell-op":{const m=O.data;s({cellId:m.cell_id,message:m}),FA.INSTANCE.track(m);return}case"variables":a(O.data.variables.map(m=>({name:m.name,declaredBy:m.declared_by,usedBy:m.used_by})));return;case"variable-values":l(O.data.variables.map(m=>({name:m.name,dataType:m.datatype,value:m.value})));return;case"alert":yr({title:O.data.title,description:Da({html:O.data.description}),variant:O.data.variant});return;case"banner":d({...O.data,id:J6()});return;case"missing-package-alert":h({...O.data,kind:"missing"});return;case"installing-package-alert":h({...O.data,kind:"installing"});return;case"query-params-append":{const m=new URL(window.location.href);m.searchParams.append(O.data.key,O.data.value),window.history.pushState({},"",`${m.pathname}${m.search}`);return}case"query-params-set":{const m=new URL(window.location.href);Array.isArray(O.data.value)?(m.searchParams.delete(O.data.key),O.data.value.forEach(w=>m.searchParams.append(O.data.key,w))):m.searchParams.set(O.data.key,O.data.value),window.history.pushState({},"",`${m.pathname}${m.search}`);return}case"query-params-delete":{const m=new URL(window.location.href);O.data.value==null?m.searchParams.delete(O.data.key):m.searchParams.delete(O.data.key,O.data.value),window.history.pushState({},"",`${m.pathname}${m.search}`);return}case"query-params-clear":{const m=new URL(window.location.href);m.search="",window.history.pushState({},"",`${m.pathname}${m.search}`);return}default:Ld(O)}},g=(y,O)=>{t.current&&(t.current=!1,v.reconnect(y,O))},v=V4n({static:Jh(),url:r7n(r),onOpen:()=>{t.current=!0,f({state:vo.OPEN})},onMessage:y=>{try{p(y)}catch(O){yr({title:"Failed to handle message",description:_R(O),variant:"danger"})}},onClose:y=>{switch(y.reason){case"MARIMO_ALREADY_CONNECTED":f({state:vo.CLOSED,code:oT.ALREADY_RUNNING,reason:"another browser tab is already connected to the kernel"}),v.close();return;case"MARIMO_WRONG_KERNEL_ID":case"MARIMO_SHUTDOWN":At.warn("WebSocket closed",y.reason),f({state:vo.CLOSED,code:oT.KERNEL_DISCONNECTED,reason:"kernel not found"}),v.close();return;case"MARIMO_MALFORMED_QUERY":f({state:vo.CLOSED,code:oT.MALFORMED_QUERY,reason:"the kernel did not recognize a request; please file a bug with marimo"});return;default:f({state:vo.CONNECTING}),g(y.code,y.reason)}},onError:y=>{At.warn("WebSocket error",y),f({state:vo.CLOSED,code:oT.KERNEL_DISCONNECTED,reason:"kernel not found"}),g()}});return{connStatus:u}}const s7n=e=>b.jsx("div",{id:"Disconnected",children:b.jsx("p",{children:e.reason})});function a7n(e){const{codes:t,cellConfigs:n,config:r,connStatus:i,cellNames:o,needsSave:s,onSave:a}=e,l=x.useRef(null);x.useEffect(()=>(r.save.autosave==="after_delay"&&(l.current!==null&&clearTimeout(l.current),s&&i.state===vo.OPEN&&(l.current=setTimeout(a,r.save.autosave_delay))),()=>{l.current!==null&&clearTimeout(l.current)}),[t,n,o,r.save,i.state,a,s])}const l7n=e=>{let{transform:t}=e;return{...t,x:0}},c7n=({children:e,disabled:t})=>{const n=s_(),{dropCellOver:r}=wp(),i=JLt(obe(Ase,{activationConstraint:{distance:8}}),obe(Tse,{coordinateGetter:E3t})),o=n.cellIds,s=Jn(a=>{const{active:l,over:c}=a;c!==null&&l.id!==c.id&&r({cellId:l.id,overCellId:c.id})});return b.jsx(t3t,{sensors:i,collisionDetection:tjt,modifiers:[l7n],onDragEnd:s,children:b.jsx(p3t,{items:o,disabled:t,strategy:d3t,children:e})})},u7n=ie.memo(c7n);function f7n(){return[wi.of([{key:"Escape",preventDefault:!1,run:UFn},{key:Er.getHotkey("cell.selectNextOccurrence").key,preventDefault:!0,run:_Be},{key:Er.getHotkey("cell.findAndReplace").key,preventDefault:!0,run:Uit}]),CBe(),_4n,AL,k4n]}function d7n(e,t,n=window){const r=(t==null?void 0:t.top)??0,i=(t==null?void 0:t.bottom)??0,o=e.getBoundingClientRect();if(o.top<r){n.scrollBy({top:o.top-r,behavior:"smooth"});return}else if(o.bottom>window.innerHeight-i){n.scrollBy({top:o.bottom-window.innerHeight+i,behavior:"smooth"});return}}function h7n(e,t){return wi.of([{key:Er.getHotkey("cell.format").key,preventDefault:!0,run:n=>(Rpe({[e]:n},t),!0)},{key:Er.getHotkey("cell.viewAsMarkdown").key,preventDefault:!0,run:n=>(Prt(e,n,t),!0)}])}function p7n(){return Ve.updateListener.of(e=>{if(e.heightChanged&&e.docChanged){const t=e.view.dom.getElementsByClassName("cm-activeLine cm-line");if(t.length===1){const n=t[0],r=document.getElementById("App");bi(r,"App not found"),d7n(n,{top:30,bottom:150},r)}}})}function g7n(e,t){const{onRun:n,deleteCell:r,createAbove:i,createBelow:o,moveUp:s,moveDown:a,focusUp:l,focusDown:c,sendToTop:u,sendToBottom:f,moveToNextCell:d,toggleHideCode:h,aiCellCompletion:p}=t,g=[{key:Er.getHotkey("cell.run").key,preventDefault:!0,stopPropagation:!0,run:()=>(n(),!0)},{key:Er.getHotkey("cell.runAndNewBelow").key,preventDefault:!0,stopPropagation:!0,run:v=>(n(),v.contentDOM.blur(),d({cellId:e,before:!1}),!0)},{key:Er.getHotkey("cell.runAndNewAbove").key,preventDefault:!0,stopPropagation:!0,run:v=>(n(),v.contentDOM.blur(),d({cellId:e,before:!0}),!0)},{key:Er.getHotkey("cell.delete").key,preventDefault:!0,stopPropagation:!0,run:v=>(v.state.doc.length===0&&r(),!0)},{key:Er.getHotkey("cell.moveDown").key,preventDefault:!0,stopPropagation:!0,run:()=>(a(),!0)},{key:Er.getHotkey("cell.moveUp").key,preventDefault:!0,stopPropagation:!0,run:()=>(s(),!0)},{key:"ArrowUp",preventDefault:!0,stopPropagation:!0,run:v=>cK(v.state)?!1:ktt(v)?(l(),!0):!1},{key:"ArrowDown",preventDefault:!0,stopPropagation:!0,run:v=>cK(v.state)?!1:$tt(v)?(c(),!0):!1},{key:Er.getHotkey("cell.focusDown").key,preventDefault:!0,stopPropagation:!0,run:()=>(c(),!0)},{key:Er.getHotkey("cell.focusUp").key,preventDefault:!0,stopPropagation:!0,run:()=>(l(),!0)},{key:Er.getHotkey("cell.sendToBottom").key,preventDefault:!0,stopPropagation:!0,run:()=>(f({cellId:e}),!0)},{key:Er.getHotkey("cell.sendToTop").key,preventDefault:!0,stopPropagation:!0,run:()=>(u({cellId:e}),!0)},{key:Er.getHotkey("cell.createAbove").key,preventDefault:!0,stopPropagation:!0,run:v=>(v.contentDOM.blur(),i(),!0)},{key:Er.getHotkey("cell.createBelow").key,preventDefault:!0,stopPropagation:!0,run:v=>(v.contentDOM.blur(),o(),!0)},{key:Er.getHotkey("cell.hideCode").key,preventDefault:!0,stopPropagation:!0,run:v=>{var O;const y=h();return eF(v),y?(v.contentDOM.blur(),(O=document.getElementById(Od.create(e)))==null||O.focus()):v.contentDOM.focus(),!0}},{key:Er.getHotkey("cell.aiCompletion").key,preventDefault:!0,stopPropagation:!0,run:v=>(p()&&v.contentDOM.focus(),!0)}];return[Ks.highest(wi.of(g))]}function m7n(e,t){const{updateCellCode:n}=t;return[Ve.updateListener.of(i=>{const o=i.transactions.some(s=>s.effects.some(a=>a.is(krt)));if(i.docChanged){const s=sv(i.view);n({cellId:e,code:s,formattingChange:o})}}),h7n(e,n)]}function y7n(e,t,n=void 0){let r=()=>{};return(...i)=>(r(),new Promise((o,s)=>{const a=setTimeout(()=>o(e(...i)),t);r=()=>{clearTimeout(a),n!==void 0&&s(n)}}))}var v7n=Object.defineProperty,b7n=(e,t,n)=>t in e?v7n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fot=(e,t,n)=>(b7n(e,typeof t!="symbol"?t+"":t,n),n);const Oge=di.define({create(){return{suggestion:null}},update(e,t){const n=t.effects.find(r=>r.is(dot));return t.state.doc&&n&&t.state.doc==n.value.doc?{suggestion:n.value.text}:{suggestion:null}}}),dot=jt.define();function O7n(e,t){const n=e.state.selection.main.head,r=[],i=st.widget({widget:new x7n(t),side:1});return r.push(i.range(n)),st.set(r)}let x7n=class extends hu{constructor(t){super(),fot(this,"suggestion"),this.suggestion=t}toDOM(){const t=document.createElement("span");return t.style.opacity="0.4",t.className="cm-inline-suggestion",t.textContent=this.suggestion,t}get lineBreaks(){return this.suggestion.split(`
`).length-1}};const w7n=e=>jr.fromClass(class{async update(t){const n=t.state.doc;if(!t.docChanged)return;const r=await e(t.state);t.view.dispatch({effects:dot.of({text:r,doc:n})})}}),S7n=jr.fromClass(class{constructor(){fot(this,"decorations"),this.decorations=st.none}update(e){var t;const n=(t=e.state.field(Oge))==null?void 0:t.suggestion;if(!n){this.decorations=st.none;return}this.decorations=O7n(e.view,n)}},{decorations:e=>e.decorations}),E7n=Ks.highest(wi.of([{key:"Tab",run:e=>{var t;const n=(t=e.state.field(Oge))==null?void 0:t.suggestion;return n?(e.dispatch({...C7n(e.state,n,e.state.selection.main.head,e.state.selection.main.head)}),!0):!1}}]));function C7n(e,t,n,r){return{...e.changeByRange(i=>{if(i==e.selection.main)return{changes:{from:n,to:r,insert:t},range:Ae.cursor(n+t.length)};const o=r-n;return!i.empty||o&&e.sliceDoc(i.from-o,i.from)!=e.sliceDoc(n,r)?{range:i}:{changes:{from:i.from-o,to:i.from,insert:t},range:Ae.cursor(i.from-o+t.length)}}),userEvent:"input.complete"}}function _7n(e){const{delay:t=500}=e,n=y7n(e.fetchFn,t);return[Oge,w7n(n),S7n,E7n]}const k7n=()=>[_7n({delay:500,fetchFn:async e=>{if(!Ptt())return"";await new Promise(s=>setTimeout(s,10));const t=e.doc.toString(),n=Mpe(t),r=n.split(`
`).length-t.split(`
`).length,i=$7n(e.doc,e.selection.main.head);return i.line+=r,(await tS().getCompletion({doc:{source:n,tabSize:e.tabSize,indentSize:1,insertSpaces:!0,path:$L,version:0,uri:`file://${$L}`,relativePath:$L,languageId:Npe,position:i}})).completions.map(s=>s.displayText)[0]??""}}),J5n().slice(0,-2)];function $7n(e,t){const n=e.lineAt(t);return{line:n.number-1,character:t-n.from}}function T7n(){return[Gse(async(e,t)=>{const n=await hot(e,t,["tooltip"]);return n===null||n==="cancelled"?null:n},{hideOnChange:!0}),D7n]}async function hot(e,t,n){const r=Od.findElement(e.dom);if(!r)return At.error("Failed to find active cell."),null;const i=Od.parse(r.id),{startToken:o,endToken:s}=P7n(e.state.doc,t),a=await zle.request({document:e.state.doc.slice(0,s).toString(),cellId:i});if(!a)return"cancelled";const l=e.state.doc.slice(o,s).toString();return hK.asHoverTooltip({position:s,message:a,exactName:l,excludeTypes:n})??null}function P7n(e,t){let n=t,r=t;for(;n>0;){const i=e.sliceString(n-1,n);if(!/\w/.test(i))break;n--}for(;r<e.length;){const i=e.sliceString(r,r+1);if(!/\w/.test(i))break;r++}return{startToken:n,endToken:r}}function A7n(e){const{head:t}=e.selection.main,n=e.doc.sliceString(t-1,t);return/\w/.test(n)}const R7n=Coe(async(e,t)=>{const n=await hot(e,t);n!=="cancelled"&&Tn.set(Qle,{documentation:(n==null?void 0:n.html)??null})},300),D7n=Ve.updateListener.of(e=>{if(e.selectionSet&&A7n(e.state)){const t=e.state.selection.main.head;R7n(e.view,t)}});function M7n(e){return[Xse(e),wi.of([{key:"ArrowRight",preventDefault:!0,run:t=>oPe(t,e)},{key:"Tab",preventDefault:!0,run:t=>oPe(t,e)}])]}function oPe(e,t){return e.state.doc.length===0?(e.dispatch({changes:{from:0,to:e.state.doc.length,insert:t}}),e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}}),!0):!1}function N7n(e){const{beforeText:t,linkText:n,afterText:r,onClick:i}=e,o=document.createElement("span");o.append(document.createTextNode(t));const s=document.createElement("span");return s.textContent=n,s.classList.add("cm-clickable-placeholder"),s.onclick=a=>{a.stopPropagation(),i()},o.append(s),o.append(document.createTextNode(r)),[Xse(o),Ve.theme({".cm-clickable-placeholder":{cursor:"pointer !important",pointerEvents:"auto",color:"var(--slate-10)",textDecoration:"underline",textDecorationThickness:"0.1em",textUnderlineOffset:"0.2em"},".cm-clickable-placeholder:hover":{color:"var(--sky-11)"}})]}const I7n=({cellId:e,showPlaceholder:t,enableAI:n,cellMovementCallbacks:r,cellCodeCallbacks:i,completionConfig:o,keymapConfig:s,theme:a})=>[$Rn(s,r),g7n(e,r),m7n(e,i),L7n(o,a),t?Ks.highest(M7n("import marimo as mo")):n?N7n({beforeText:"Start coding or ",linkText:"generate",afterText:" with AI.",onClick:r.aiCellCompletion}):[]],L7n=(e,t)=>[Ve.lineWrapping,Use(),O6e(),x6e(),P6e(),Hse(),T6e(),w6e(),v7t({position:"fixed",parent:document.querySelector("#App")??void 0}),p7n(),t==="dark"?KBe:[],T7n(),k7n(),Y6e(),QBe(),Ks.high(wi.of(qBe)),tze(),j6e(),Gg.of("    "),Gz(nae,{fallback:!0}),wi.of([...H6e,...XBe]),H5n(e),Wte.of(t8()),dn.allowMultipleSelections.of(!0),f7n(),wi.of([{key:"Tab",run:n=>LBe(n)||s8(n),preventDefault:!0}]),wi.of([...fae,Uze])],j7n=new B5e,F7n=e=>{const t=ie.useRef(null),{consoleOutputs:n,stale:r,cellName:i,cellId:o,onSubmitDebugger:s}=e,a=n.length>0;if(x.useLayoutEffect(()=>{const u=t.current;if(!u)return;const f=120,d=u.scrollHeight-u.clientHeight;d-u.scrollTop<f&&(u.scrollTop=d)}),!a&&i===Vb)return null;const l=u=>b.jsx("span",{dangerouslySetInnerHTML:{__html:j7n.ansi_to_html(u)}}),c=[...n].reverse();return b.jsxs("div",{title:r?"This console output is stale":void 0,"data-testid":"console-output-area",ref:t,className:be("console-output-area overflow-hidden rounded-b-lg flex flex-col-reverse w-full",r&&"marimo-output-stale",a?"p-5":"p-3"),children:[c.map((u,f)=>u.channel==="pdb"?null:u.channel==="stdin"?u.response==null?b.jsxs("div",{className:"flex gap-2 items-center",children:[l(u.data),b.jsx(Wo,{"data-testid":"console-input",type:"text",autoComplete:"off",autoFocus:!0,className:"m-0",placeholder:"stdin",onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&s(d.currentTarget.value,f)}})]},f):b.jsxs("div",{className:"flex gap-2 items-center",children:[l(u.data),b.jsx("span",{className:"text-[var(--sky-11)]",children:u.response})]},f):b.jsx(ie.Fragment,{children:vae({message:u})},f)),b.jsx(CFn,{value:i,cellId:o,className:"bg-[var(--slate-4)] border-[var(--slate-4)] hover:bg-[var(--slate-5)] dark:bg-[var(--sky-5)] dark:border-[var(--sky-5)] dark:bg-[var(--sky-6)] dark:text-[var(--sky-12)] text-[var(--slate-12)] rounded-tl rounded-br-lg absolute right-0 bottom-0 text-xs px-1.5 py-0.5 font-mono"})]})},sPe=({appClosed:e,onClick:t,tooltipContent:n})=>b.jsx(Wt,{content:n,usePortal:!1,children:b.jsx(Xi,{onClick:t,className:`ShoulderButton ${e?" inactive-button":""}`,shape:"circle",size:"small",color:"hint-green","data-testid":"create-cell-button",children:b.jsx(poe,{strokeWidth:1.8})})});function z7n(e,t,n,r){return e?"disabled":t&&!n?"yellow":n||r?"disabled":"hint-green"}const Q7n=e=>{const{onClick:t,appClosed:n,needsRun:r,status:i,config:o,edited:s}=e,a=i==="stale"||i==="disabled-transitively",l=i==="running"||i==="queued",c=n||l||!o.disabled&&a&&!s,u=z7n(n,r,l,c),d=eot(i==="running");if(o.disabled)return b.jsx(Wt,{content:"Add code to notebook",usePortal:!1,children:b.jsx(Xi,{className:be(!r&&"hover-action",c&&"inactive-button"),onClick:t,color:u,shape:"circle",size:"small","data-testid":"run-button",children:b.jsx(YEt,{strokeWidth:1.8})})});if(!o.disabled&&a&&!s)return b.jsx(Wt,{content:"This cell can't be run because it has a disabled ancestor",usePortal:!1,children:b.jsx(Xi,{className:be(!r&&"hover-action",c&&"inactive-button"),onClick:t,color:u,shape:"circle",size:"small","data-testid":"run-button",children:b.jsx(sP,{strokeWidth:1.8})})});if(d)return b.jsx(Wt,{content:Md("global.interrupt"),usePortal:!1,children:b.jsx(Xi,{className:be(n&&"inactive-button"),onClick:XZ,color:"yellow",shape:"circle",size:"small","data-testid":"run-button",children:b.jsx(az,{strokeWidth:1.5})})});let h="";return n?h="App disconnected":i==="queued"?h="This cell is already queued to run":h=Md("cell.run"),b.jsx(Wt,{content:h,usePortal:!1,children:b.jsx(Xi,{className:be(!r&&"hover-action",c&&"inactive-button"),onClick:t,color:u,shape:"circle",size:"small","data-testid":"run-button",children:b.jsx(sP,{strokeWidth:1.8})})})},B7n=e=>{const{status:t,appClosed:n,onClick:r}=e,i=t==="running"||t==="queued";let o=null;return n?o="App disconnected":t==="running"?o="A cell can't be deleted when it's running":t==="queued"?o="A cell can't be deleted when it's queued to run":o="Delete",b.jsx(Wt,{content:o,usePortal:!1,children:b.jsx(St,{variant:"ghost",size:"icon",onClick:r,"data-testid":"delete-button",className:be("hover:bg-transparent text-destructive/60 hover:text-destructive",{DeleteButton:!0,"inactive-button":n||i,running:i}),style:{boxShadow:"none"},children:b.jsx(AR,{size:14})})})};function W7n(e){const t=x.useRef(e),[n,r]=x.useState(e);return x.useEffect(()=>{const o=setInterval(()=>{r(i3.now().toMilliseconds())},17);return()=>clearInterval(o)},[]),n-t.current}const q7n=({editing:e,status:t,disabled:n,edited:r,interrupted:i,elapsedTime:o,runStartTimestamp:s})=>{if(!e)return null;if(n&&t==="running")return At.error("CellStatusComponent: disabled and running"),null;if(n&&t==="stale")return b.jsx(Wt,{content:"This cell is stale, but it's disabled and can't be run",usePortal:!1,children:b.jsx("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"stale",children:b.jsxs(f2,{children:[b.jsx(VM,{className:"h-5 w-5",strokeWidth:1.5}),b.jsx(P5,{className:"h-3 w-3",strokeWidth:2.5})]})})});if(n)return b.jsx(Wt,{content:"This cell is disabled",usePortal:!1,children:b.jsx("div",{className:"cell-status-icon cell-status-disabled","data-testid":"cell-status","data-status":"disabled",children:b.jsx(VM,{className:"h-5 w-5",strokeWidth:1.5})})});if(t==="disabled-transitively")return b.jsx(Wt,{content:"An ancestor of this cell is disabled, so it can't be run",usePortal:!1,children:b.jsx("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"disabled-transitively",children:b.jsxs(f2,{layerTop:!0,children:[b.jsx(FLe,{className:"h-5 w-5",strokeWidth:1.5}),b.jsx(VM,{className:"h-3 w-3",strokeWidth:2.5})]})})});if(t==="stale")return b.jsx(Wt,{content:"This cell is stale, but an ancestor is disabled so it can't be run",usePortal:!1,children:b.jsx("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"stale",children:b.jsxs(f2,{children:[b.jsx(P5,{className:"h-5 w-5",strokeWidth:1}),b.jsx(VM,{className:"h-3 w-3",strokeWidth:2.5})]})})});if(t==="running")return b.jsx(Wt,{content:"This cell is running",usePortal:!1,children:b.jsx("div",{className:"cell-status-icon elapsed-time running","data-testid":"cell-status","data-status":"running",children:b.jsx(V7n,{startTime:i3.fromSeconds(s)||i3.now()})})});if(t==="queued")return b.jsx(Wt,{content:"This cell is queued to run",usePortal:!1,children:b.jsx("div",{className:"cell-status-icon cell-status-queued","data-testid":"cell-status","data-status":"queued",children:b.jsx(aCt,{className:"h-5 w-5",strokeWidth:1.5})})});if(r||i){const a=dne(o),l=i?"This cell was interrupted when it was last run":"This cell has been modified since it was last run",c=i?`This cell ran for ${a} before being interrupted`:`This cell took ${a} to run`;return b.jsxs("div",{className:"cell-status-icon flex items-center gap-2",children:[b.jsx(Wt,{content:l,usePortal:!1,children:b.jsx("div",{className:"cell-status-stale","data-testid":"cell-status","data-status":"outdated",children:b.jsx(P5,{className:"h-5 w-5",strokeWidth:1.5})})}),a&&b.jsx(Wt,{content:c,usePortal:!1,children:b.jsx("div",{className:"elapsed-time hover-action","data-testid":"cell-status","data-status":"outdated",children:b.jsx("span",{children:a})})})]})}if(o!==null){const a=dne(o);return b.jsx(Wt,{content:`This cell took ${a} to run`,usePortal:!1,children:b.jsx("div",{className:"cell-status-icon elapsed-time hover-action","data-testid":"cell-status","data-status":"idle",children:b.jsx("span",{children:a})})})}return null};function dne(e){if(e===null)return"";if(e>1e3*60){const t=(e/6e4).toFixed(0),n=(e%(1e3*60)/1e3).toFixed(0);return`${t.toString()}m${n.toString()}s`}else return e>1e3?`${(e/1e3).toFixed(2).toString()}s`:`${e.toFixed(0).toString()}ms`}const V7n=e=>{const t=W7n(e.startTime.toMilliseconds());return b.jsx("span",{children:dne(t)})};function pot(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const got=ie.createContext(null),mot=x.memo(()=>x.useContext(got));mot.displayName="DragHandle";const yot=ie.forwardRef(({cellId:e,...t},n)=>{const{attributes:r,listeners:i,setNodeRef:o,transform:s,transition:a,isDragging:l}=x3t({id:e.toString()}),c={transform:s?bP.Transform.toString({x:0,y:s.y,scaleX:1,scaleY:1}):void 0,transition:a,zIndex:l?2:void 0,position:"relative"},u=pot(n,o),f=b.jsx("div",{...r,...i,"data-testid":"drag-button",className:"py-[1px] mx-2 cursor-grab opacity-50 hover:opacity-100 hover-action hover:bg-muted rounded border border-transparent hover:border-border active:bg-accent",children:b.jsx(XEt,{strokeWidth:1,size:20})}),d=!!s;return b.jsx("div",{tabIndex:-1,ref:u,...t,className:be(t.className,d&&"is-moving"),style:c,children:b.jsx(got.Provider,{value:f,children:t.children})})});yot.displayName="SortableCell";const U7n=x.memo(yot),H7n=({children:e,...t},n)=>{const[r,i]=x.useState(!1),o=dge({cell:t}),s=zoe();return x.useImperativeHandle(n,()=>({toggle:()=>i(a=>!a)})),b.jsxs(Joe,{open:r,onOpenChange:i,children:[b.jsxs(aoe,{delayDuration:400,disableHoverableContent:!0,children:[!r&&b.jsx(oP,{className:"w-full bg-card",tabIndex:-1,children:b.jsxs("div",{className:"text-foreground-muted flex flex-col text-center",children:[b.jsxs("span",{children:[b.jsx("span",{className:"text-foreground font-semibold",children:"Drag "}),"to move cell"]}),b.jsxs("span",{children:[b.jsx("span",{className:"text-foreground font-semibold",children:"Click "}),"to open menu"]})]})}),b.jsx(loe,{children:b.jsx(ese,{className:"flex",children:e})})]}),b.jsx(Az,{className:"w-[300px] p-0 pt-1",...s,children:b.jsxs($z,{children:[b.jsx(Tz,{placeholder:"Search actions...",className:"h-6 m-1"}),b.jsx(Pz,{children:"No results"}),o.map((a,l)=>b.jsxs(x.Fragment,{children:[b.jsx(Uj,{children:a.map(c=>b.jsx(hP,{onSelect:()=>{c.disableClick||(c.handle(),i(!1))},variant:c.variant,children:b.jsxs("div",{className:"flex items-center flex-1",children:[c.icon&&b.jsx("div",{className:"mr-2 w-5",children:c.icon}),b.jsx("div",{className:"flex-1",children:c.label}),b.jsxs("div",{className:"flex-shrink-0 text-sm",children:[c.hotkey&&ipe(c.hotkey),c.rightElement]})]})},c.label))},l),l<o.length-1&&b.jsx(Goe,{})]},l))]})})]})},X7n=ie.memo(ie.forwardRef(H7n)),vot="ContextMenu",[Z7n,AKn]=uo(vot,[Nz]),Pf=Nz(),[Y7n,bot]=Z7n(vot),G7n=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[s,a]=x.useState(!1),l=Pf(t),c=Xs(r),u=x.useCallback(f=>{a(f),c(f)},[c]);return x.createElement(Y7n,{scope:t,open:s,onOpenChange:u,modal:o},x.createElement(FFe,oe({},l,{dir:i,open:s,onOpenChange:u,modal:o}),n))},K7n="ContextMenuTrigger",J7n=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=e,o=bot(K7n,n),s=Pf(n),a=x.useRef({x:0,y:0}),l=x.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),c=x.useRef(0),u=x.useCallback(()=>window.clearTimeout(c.current),[]),f=d=>{a.current={x:d.clientX,y:d.clientY},o.onOpenChange(!0)};return x.useEffect(()=>u,[u]),x.useEffect(()=>void(r&&u()),[r,u]),x.createElement(x.Fragment,null,x.createElement(zFe,oe({},s,{virtualRef:l})),x.createElement(Ot.span,oe({"data-state":o.open?"open":"closed","data-disabled":r?"":void 0},i,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Xe(e.onContextMenu,d=>{u(),f(d),d.preventDefault()}),onPointerDown:r?e.onPointerDown:Xe(e.onPointerDown,zI(d=>{u(),c.current=window.setTimeout(()=>f(d),700)})),onPointerMove:r?e.onPointerMove:Xe(e.onPointerMove,zI(u)),onPointerCancel:r?e.onPointerCancel:Xe(e.onPointerCancel,zI(u)),onPointerUp:r?e.onPointerUp:Xe(e.onPointerUp,zI(u))})))}),e6n=e=>{const{__scopeContextMenu:t,...n}=e,r=Pf(t);return x.createElement(QFe,oe({},r,n))},t6n="ContextMenuContent",n6n=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=bot(t6n,n),o=Pf(n),s=x.useRef(!1);return x.createElement(BFe,oe({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,a),!a.defaultPrevented&&s.current&&a.preventDefault(),s.current=!1},onInteractOutside:a=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,a),!a.defaultPrevented&&!i.modal&&(s.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),r6n=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Pf(n);return x.createElement(WFe,oe({},i,r,{ref:t}))}),i6n=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Pf(n);return x.createElement(qFe,oe({},i,r,{ref:t}))}),o6n=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Pf(n);return x.createElement(VFe,oe({},i,r,{ref:t}))}),s6n=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Pf(n);return x.createElement(UFe,oe({},i,r,{ref:t}))}),a6n=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Pf(n);return x.createElement(HFe,oe({},i,r,{ref:t}))}),l6n=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Pf(n);return x.createElement(XFe,oe({},i,r,{ref:t}))}),c6n=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Pf(n);return x.createElement(ZFe,oe({},i,r,{ref:t}))}),u6n=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Pf(n);return x.createElement(YFe,oe({},i,r,{ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))});function zI(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const f6n=G7n,d6n=J7n,h6n=e6n,Oot=n6n,xot=r6n,wot=i6n,Sot=o6n,Eot=s6n,Cot=a6n,_ot=l6n,kot=c6n,$ot=u6n,p6n=f6n,g6n=d6n,m6n=x.forwardRef(({className:e,inset:t,children:n,...r},i)=>b.jsxs(kot,{ref:i,className:N3e({className:e,inset:t}),...r,children:[n,b.jsx(Z3n,{className:"ml-auto h-4 w-4"})]}));m6n.displayName=kot.displayName;const Tot="data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",y6n=x.forwardRef(({className:e,...t},n)=>b.jsx($ot,{ref:n,className:be(kz({subcontent:!0}),Tot,e),...t}));y6n.displayName=$ot.displayName;const Pot=x.forwardRef(({className:e,...t},n)=>b.jsx(h6n,{children:b.jsx(Oot,{ref:n,className:be(kz(),Tot,e),...t})}));Pot.displayName=Oot.displayName;const Aot=x.forwardRef(({className:e,inset:t,variant:n,...r},i)=>b.jsx(wot,{ref:i,className:Hoe({className:e,inset:t,variant:n}),...r}));Aot.displayName=wot.displayName;const v6n=x.forwardRef(({className:e,children:t,checked:n,...r},i)=>b.jsxs(Sot,{ref:i,className:yE({className:e}),checked:n,...r,children:[b.jsx("span",{className:yE(),children:b.jsx(Cot,{children:b.jsx(H3n,{className:"h-4 w-4"})})}),t]}));v6n.displayName=Sot.displayName;const b6n=x.forwardRef(({className:e,children:t,...n},r)=>b.jsxs(Eot,{ref:r,className:yE({className:e}),...n,children:[b.jsx("span",{className:yE(),children:b.jsx(Cot,{children:b.jsx(G3n,{className:"h-4 w-4 fill-current"})})}),t]}));b6n.displayName=Eot.displayName;const O6n=x.forwardRef(({className:e,inset:t,...n},r)=>b.jsx(xot,{ref:r,className:L3e({className:e,inset:t}),...n}));O6n.displayName=xot.displayName;const Rot=x.forwardRef(({className:e,...t},n)=>b.jsx(_ot,{ref:n,className:be(Xoe({className:e})),...t}));Rot.displayName=_ot.displayName;const x6n=({children:e,...t})=>{const n=dge({cell:t}),[r,i]=ie.useState(),o=[{label:"Copy",icon:b.jsx(WO,{size:13,strokeWidth:1.5}),handle:()=>{document.execCommand("copy")}},{label:"Cut",icon:b.jsx(xCt,{size:13,strokeWidth:1.5}),handle:()=>{document.execCommand("cut")}},{label:"Paste",icon:b.jsx(DEt,{size:13,strokeWidth:1.5}),handle:async()=>{const{getEditorView:s}=t,a=s();if(!a)return;const l=await navigator.clipboard.readText();if(l){const{from:c,to:u}=a.state.selection.main,f=a.state.update({changes:{from:c,to:u,insert:l}});a.dispatch(f)}}},{icon:b.jsx(sz,{size:13,strokeWidth:1.5}),label:"Download image",hidden:!r,handle:()=>{if(r){const s=document.createElement("a");s.download="image.png",s.href=r.src,s.click()}}}];return b.jsxs(p6n,{children:[b.jsx(g6n,{onContextMenu:s=>{s.target instanceof HTMLImageElement?i(s.target):i(void 0)},asChild:!0,children:e}),b.jsx(Pot,{className:"w-[300px]",children:[o,...n].map((s,a)=>b.jsxs(x.Fragment,{children:[s.map(l=>l.hidden?null:b.jsx(Aot,{onSelect:c=>{l.handle(c)},variant:l.variant,children:b.jsxs("div",{className:"flex items-center flex-1",children:[l.icon&&b.jsx("div",{className:"mr-2 w-5",children:l.icon}),b.jsx("div",{className:"flex-1",children:l.label}),b.jsxs("div",{className:"flex-shrink-0 text-sm",children:[l.hotkey&&ipe(l.hotkey),l.rightElement]})]})},l.label)),a<s.length-1&&b.jsx(Rot,{})]},a))})]})},w6n=({editorView:e,languageAdapter:t,canUseMarkdown:n})=>{if(!n&&t!=="markdown")return null;const r=t==="markdown"?"python":"markdown",i=t==="markdown"?Nit:Iit;return b.jsx("div",{className:"absolute top-0 right-5 z-20 hover-action",children:b.jsx(Wt,{content:`View as ${RR(r)}`,children:b.jsx(St,{"data-testid":"language-toggle-button",variant:"text",size:"xs",className:"opacity-80",children:b.jsx(i,{className:"cursor-pointer",fill:"var(--sky-11)",fontSize:20,onClick:()=>{qte(e,r)}})})})})};var Dot={modified:{doc:""},original:{doc:""}},Mot=x.createContext(Dot);function S6n(e,t){return oe({},e,t,{modified:oe({},e.modified,t.modified),original:oe({},e.original,t.original)})}var xge=()=>x.useContext(Mot),E6n=e=>{var{children:t,theme:n}=e,[r,i]=x.useReducer(S6n,oe({},Dot,{theme:n}));return x.useEffect(()=>i({theme:n}),[n]),b.jsx(Mot.Provider,{value:oe({},r,{dispatch:i}),children:t})},C6n=["extensions","value","selection","onChange"],Not=e=>{var{extensions:t=[],value:n,selection:r,onChange:i}=e,o=$o(e,C6n),{theme:s,dispatch:a}=xge(),l=Q1(oe({},o,{theme:s})),c=Ve.updateListener.of(u=>{if(u.docChanged&&typeof i=="function"){var f=u.state.doc,d=f.toString();i(d,u)}});return x.useEffect(()=>a({original:{doc:n,selection:r,extensions:[c,...l,...t]},originalExtension:{onChange:i,option:o,extension:[t,c]}}),[e]),null};Not.displayName="CodeMirrorMerge.Original";var _6n=["extensions","value","selection","onChange"],Iot=e=>{var{extensions:t=[],value:n,selection:r,onChange:i}=e,o=$o(e,_6n),{theme:s,dispatch:a}=xge(),l=Q1(oe({},o,{theme:s})),c=Ve.updateListener.of(u=>{if(u.docChanged&&typeof i=="function"){var f=u.state.doc,d=f.toString();i(d,u)}});return x.useEffect(()=>a({modified:{doc:n,selection:r,extensions:[c,...l,...t]},modifiedExtension:{onChange:i,option:o,extension:[c,t]}}),[e]),null};Iot.displayName="CodeMirrorMerge.Modified";class oo{constructor(t,n,r,i){this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}offset(t,n){return new oo(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}}function IO(e,t,n,r,i,o){if(e==r)return[];let s=wge(e,t,n,r,i,o),a=Sge(e,t+s,n,r,i+s,o);t+=s,n-=a,i+=s,o-=a;let l=n-t,c=o-i;if(!l||!c)return[new oo(t,n,i,o)];if(l>c){let f=e.slice(t,n).indexOf(r.slice(i,o));if(f>-1)return[new oo(t,t+f,i,i),new oo(t+f+c,n,o,o)]}else if(c>l){let f=r.slice(i,o).indexOf(e.slice(t,n));if(f>-1)return[new oo(t,t,i,i+f),new oo(n,n,i+f+l,o)]}if(l==1||c==1)return[new oo(t,n,i,o)];let u=Fot(e,t,n,r,i,o);if(u){let[f,d,h]=u;return IO(e,t,f,r,i,d).concat(IO(e,f+h,n,r,d+h,o))}return k6n(e,t,n,r,i,o)}let sT=1e9;function k6n(e,t,n,r,i,o){let s=n-t,a=o-i;if(sT<1e9&&Math.min(s,a)>sT*16)return Math.min(s,a)>sT*64?[new oo(t,n,i,o)]:aPe(e,t,n,r,i,o);let l=Math.ceil((s+a)/2);zH.reset(l),QH.reset(l);let c=(h,p)=>e.charCodeAt(t+h)==r.charCodeAt(i+p),u=(h,p)=>e.charCodeAt(n-h-1)==r.charCodeAt(o-p-1),f=(s-a)%2!=0?QH:null,d=f?null:zH;for(let h=0;h<l;h++){if(h>sT)return aPe(e,t,n,r,i,o);let p=zH.advance(h,s,a,l,f,!1,c)||QH.advance(h,s,a,l,d,!0,u);if(p)return $6n(e,t,n,t+p[0],r,i,o,i+p[1])}return[new oo(t,n,i,o)]}class Lot{constructor(){this.vec=[]}reset(t){this.len=t<<1;for(let n=0;n<this.len;n++)this.vec[n]=-1;this.vec[t+1]=0,this.start=this.end=0}advance(t,n,r,i,o,s,a){for(let l=-t+this.start;l<=t-this.end;l+=2){let c=i+l,u=l==-t||l!=t&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,f=u-l;for(;u<n&&f<r&&a(u,f);)u++,f++;if(this.vec[c]=u,u>n)this.end+=2;else if(f>r)this.start+=2;else if(o){let d=i+(n-r)-l;if(d>=0&&d<this.len&&o.vec[d]!=-1)if(s){let h=o.vec[d];if(h>=n-u)return[h,i+h-d]}else{let h=n-o.vec[d];if(u>=h)return[u,f]}}}return null}}const zH=new Lot,QH=new Lot;function $6n(e,t,n,r,i,o,s,a){let l=!1;return!kC(e,r)&&++r==n&&(l=!0),!kC(i,a)&&++a==s&&(l=!0),l?[new oo(t,n,o,s)]:IO(e,t,r,i,o,a).concat(IO(e,r,n,i,a,s))}function jot(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n=n<<1;return n}function wge(e,t,n,r,i,o){if(t==n||t==o||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let s=jot(n-t,o-i);for(let a=t,l=i;;){let c=a+s,u=l+s;if(c>n||u>o||e.slice(a,c)!=r.slice(l,u)){if(s==1)return a-t-(kC(e,a)?0:1);s=s>>1}else{if(c==n||u==o)return c-t;a=c,l=u}}}function Sge(e,t,n,r,i,o){if(t==n||i==o||e.charCodeAt(n-1)!=r.charCodeAt(o-1))return 0;let s=jot(n-t,o-i);for(let a=n,l=o;;){let c=a-s,u=l-s;if(c<t||u<i||e.slice(c,a)!=r.slice(u,l)){if(s==1)return n-a-(kC(e,a)?0:1);s=s>>1}else{if(c==t||u==i)return n-c;a=c,l=u}}}function hne(e,t,n,r,i,o,s,a){let l=r.slice(i,o),c=null;for(;;){if(c||s<a)return c;for(let u=t+s;;){kC(e,u)||u++;let f=u+s;if(kC(e,f)||(f+=f==u+1?1:-1),f>=n)break;let d=e.slice(u,f),h=-1;for(;(h=l.indexOf(d,h+1))!=-1;){let p=wge(e,f,n,r,i+h+d.length,o),g=Sge(e,t,u,r,i,i+h),v=d.length+p+g;(!c||c[2]<v)&&(c=[u-g,i+h-g,v])}u=f}if(a<0)return c;s=s>>1}}function Fot(e,t,n,r,i,o){let s=n-t,a=o-i;if(s<a){let l=Fot(r,i,o,e,t,n);return l&&[l[1],l[0],l[2]]}return s<4||a*2<s?null:hne(e,t,n,r,i,o,Math.floor(s/4),-1)}function aPe(e,t,n,r,i,o){let s=n-t,a=o-i,l;if(s<a){let d=hne(r,i,o,e,t,n,Math.floor(s/6),50);l=d&&[d[1],d[0],d[2]]}else l=hne(e,t,n,r,i,o,Math.floor(a/6),50);if(!l)return[new oo(t,n,i,o)];let[c,u,f]=l;return IO(e,t,c,r,i,u).concat(IO(e,c+f,n,r,u+f,o))}function zot(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];r.toA>i.fromA-t&&r.toB>i.fromB-t&&(e[n-1]=new oo(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}function T6n(e,t,n){for(;;){zot(n,1);let r=!1;for(let i=0;i<n.length;i++){let o=n[i],s,a;(s=wge(e,o.fromA,o.toA,t,o.fromB,o.toB))&&(o=n[i]=new oo(o.fromA+s,o.toA,o.fromB+s,o.toB)),(a=Sge(e,o.fromA,o.toA,t,o.fromB,o.toB))&&(o=n[i]=new oo(o.fromA,o.toA-a,o.fromB,o.toB-a));let l=o.toA-o.fromA,c=o.toB-o.fromB;if(l&&c)continue;let u=o.fromA-(i?n[i-1].toA:0),f=(i<n.length-1?n[i+1].fromA:e.length)-o.toA;if(!u||!f)continue;let d=l?e.slice(o.fromA,o.toA):t.slice(o.fromB,o.toB);u<=d.length&&e.slice(o.fromA-u,o.fromA)==d.slice(d.length-u)?(n[i]=new oo(o.fromA-u,o.toA-u,o.fromB-u,o.toB-u),r=!0):f<=d.length&&e.slice(o.toA,o.toA+f)==d.slice(0,f)&&(n[i]=new oo(o.fromA+f,o.toA+f,o.fromB+f,o.toB+f),r=!0)}if(!r)break}return n}function P6n(e,t,n){for(let r=0,i=0;i<e.length;i++){let o=e[i],s=o.toA-o.fromA,a=o.toB-o.fromB;if(s&&a||s>3||a>3){let l=i==e.length-1?t.length:e[i+1].fromA,c=o.fromA-r,u=l-o.toA,f=cPe(t,o.fromA,Math.min(c,5)),d=lPe(t,o.toA,Math.min(u,5)),h=o.fromA-f,p=d-o.toA;if(!s||!a){let g=Math.max(s,a),[v,y,O]=s?[t,o.fromA,o.toA]:[n,o.fromB,o.toB],m,w;h&&p?(g>h&&t.slice(f,o.fromA)==v.slice(O-h,O)?(o=e[i]=new oo(f,f+s,o.fromB-h,o.toB-h),f=o.fromA,d=lPe(t,o.toA,Math.min(l-o.toA,5))):g>p&&t.slice(o.toA,d)==v.slice(y,y+p)&&(o=e[i]=new oo(d-s,d,o.fromB+p,o.toB+p),d=o.toA,f=cPe(t,o.fromA,Math.min(o.fromA-r,5))),h=o.fromA-f,p=d-o.toA):!h&&!p&&(w=o.fromA-(m=A6n(t,o.fromA,c)))&&t.slice(m,o.fromA)==v.slice(O-w,O)&&(o=e[i]=new oo(m,m+s,o.fromB-w,o.toB-w))}(h||p)&&(o=e[i]=new oo(o.fromA-h,o.toA+p,o.fromB-h,o.toB+p)),r=o.toA}}return zot(e,3),e}let Ob;try{Ob=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Qot(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Bot(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?Qot(n)?1:0:Ob?!qot(n)||t==e.length-1?Ob.test(String.fromCharCode(n))?1:0:Ob.test(e.slice(t,t+2))?2:0:0}function Wot(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?Qot(n)?1:0:Ob?!Vot(n)||t==1?Ob.test(String.fromCharCode(n))?1:0:Ob.test(e.slice(t-2,t))?2:0:0}function lPe(e,t,n){if(t==e.length||!Wot(e,t))return t;for(let r=t,i=t+n;;){let o=Bot(e,r);if(!o)return r;if(r+=o,r>i)return t}}function cPe(e,t,n){if(!t||!Bot(e,t))return t;for(let r=t,i=t-n;;){let o=Wot(e,r);if(!o)return r;if(r-=o,r<i)return t}}function A6n(e,t,n){for(let r=t,i=t-n;;){let o=r?e.charCodeAt(r-1):10;if(o==10)return r;if(r--,r<i||o!=32&&o!=9)return t}}const qot=e=>e>=55296&&e<=56319,Vot=e=>e>=56320&&e<=57343;function kC(e,t){return!t||t==e.length||!qot(e.charCodeAt(t-1))||!Vot(e.charCodeAt(t))}function R6n(e,t,n){var r;return sT=((r=n==null?void 0:n.scanLimit)!==null&&r!==void 0?r:1e9)>>1,T6n(e,t,IO(e,0,e.length,t,0,t.length))}function Uot(e,t,n){return P6n(R6n(e,t,n),e,t)}const _h=mt.define({combine:e=>e[0]}),pne=jt.define(),$C=di.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(pne)&&(e=n.value);return e}});class US{constructor(t,n,r,i,o){this.changes=t,this.fromA=n,this.toA=r,this.fromB=i,this.toB=o}offset(t,n){return t||n?new US(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(t,n,r){return Hot(Uot(t.toString(),n.toString(),r),t,n,0,0)}static updateA(t,n,r,i,o){return pPe(hPe(t,i,!0,r.length),t,n,r,o)}static updateB(t,n,r,i,o){return pPe(hPe(t,i,!1,n.length),t,n,r,o)}}function uPe(e,t,n,r){let i=n.lineAt(e),o=r.lineAt(t);return i.to==e&&o.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[i.from,o.from]}function fPe(e,t,n,r){let i=n.lineAt(e),o=r.lineAt(t);return i.from==e&&o.from==t?[e,t]:[i.to+1,o.to+1]}function Hot(e,t,n,r,i){let o=[];for(let s=0;s<e.length;s++){let a=e[s],[l,c]=uPe(a.fromA+r,a.fromB+i,t,n),[u,f]=fPe(a.toA+r,a.toB+i,t,n),d=[a.offset(-l+r,-c+i)];for(;s<e.length-1;){let h=e[s+1],[p,g]=uPe(h.fromA+r,h.fromB+i,t,n);if(p>u+1&&g>f+1)break;d.push(h.offset(-l+r,-c+i)),[u,f]=fPe(h.toA+r,h.toB+i,t,n),s++}o.push(new US(d,l,Math.max(l,u),c,Math.max(c,f)))}return o}const QI=1e3;function dPe(e,t,n,r){let i=0,o=e.length;for(;;){if(i==o){let u=0,f=0;i&&({toA:u,toB:f}=e[i-1]);let d=t-(n?u:f);return[u+d,f+d]}let s=i+o>>1,a=e[s],[l,c]=n?[a.fromA,a.toA]:[a.fromB,a.toB];if(l>t)o=s;else if(c<=t)i=s+1;else return r?[a.fromA,a.fromB]:[a.toA,a.toB]}}function hPe(e,t,n,r){let i=[];return t.iterChangedRanges((o,s,a,l)=>{let c=0,u=n?t.length:r,f=0,d=n?r:t.length;o>QI&&([c,f]=dPe(e,o-QI,n,!0)),s<t.length-QI&&([u,d]=dPe(e,s+QI,n,!1));let h=l-a-(s-o),p,[g,v]=n?[h,0]:[0,h];i.length&&(p=i[i.length-1]).toA>=c?i[i.length-1]={fromA:p.fromA,fromB:p.fromB,toA:u,toB:d,diffA:p.diffA+g,diffB:p.diffB+v}:i.push({fromA:c,toA:u,fromB:f,toB:d,diffA:g,diffB:v})}),i}function pPe(e,t,n,r,i){if(!e.length)return t;let o=0,s=0,a=0,l=[];for(let c of e){let u=c.fromA+s,f=c.toA+s+c.diffA,d=c.fromB+a,h=c.toB+a+c.diffB;for(;o<t.length;){let p=t[o];if(p.toA+s<=u&&p.toB+a<=d)l.push(p.offset(s,a));else if(p.fromA+s>f)break;o++}for(let p of Hot(Uot(n.sliceString(u,f),r.sliceString(d,h),i),n,r,u,d))l.push(p);for(s+=c.diffA,a+=c.diffB;o<t.length;){let p=t[o];if(p.fromA>f+s&&p.fromB>h+a)break;o++}}for(;o<t.length;)l.push(t[o++].offset(s,a));return l}const Xot=jr.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=yPe(e))}update(e){(e.docChanged||e.viewportChanged||D6n(e.startState,e.state)||M6n(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=yPe(e.view))}},{decorations:e=>e.deco}),BI=Ks.low(_6e({class:"cm-changeGutter",markers:e=>{var t;return((t=e.plugin(Xot))===null||t===void 0?void 0:t.gutter)||Dn.empty}}));function D6n(e,t){return e.field($C,!1)!=t.field($C,!1)}function M6n(e,t){return e.facet(_h)!=t.facet(_h)}const gPe=st.line({class:"cm-changedLine"}),N6n=st.mark({class:"cm-changedText"}),I6n=st.mark({tagName:"ins",class:"cm-insertedLine"}),L6n=st.mark({tagName:"del",class:"cm-deletedLine"}),mPe=new class extends np{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function j6n(e,t,n,r,i,o){let s=n?e.fromA:e.fromB,a=n?e.toA:e.toB,l=0;if(s!=a){i.add(s,s,gPe),i.add(s,a,n?L6n:I6n),o&&o.add(s,s,mPe);for(let c=t.iterRange(s,a-1),u=s;!c.next().done;){if(c.lineBreak){u++,i.add(u,u,gPe),o&&o.add(u,u,mPe);continue}let f=u+c.value.length;if(r)for(;l<e.changes.length;){let d=e.changes[l],h=s+(n?d.fromA:d.fromB),p=s+(n?d.toA:d.toB),g=Math.max(u,h),v=Math.min(f,p);if(g<v&&i.add(g,v,N6n),p<f)l++;else break}u=f}}}function yPe(e){let t=e.state.field($C),{side:n,highlightChanges:r,markGutter:i}=e.state.facet(_h),o=n=="a",s=new Ol,a=i?new Ol:null,{from:l,to:c}=e.viewport;for(let u of t){if((o?u.fromA:u.fromB)>=c)break;(o?u.toA:u.toB)>l&&j6n(u,e.state.doc,o,r,s,a)}return{deco:s.finish(),gutter:a&&a.finish()}}class WI extends hu{constructor(t){super(),this.height=t}eq(t){return this.height==t.height}toDOM(){let t=document.createElement("div");return t.className="cm-mergeSpacer",t.style.height=this.height+"px",t}updateDOM(t){return t.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}const E7=jt.define({map:(e,t)=>e.map(t)}),aT=di.define({create:()=>st.none,update:(e,t)=>{for(let n of t.effects)if(n.is(E7))return n.value;return e.map(t.changes)},provide:e=>Ve.decorations.from(e)}),qI=.01;function F6n(e,t,n){let r=new Ol,i=new Ol,o=e.state.field(aT).iter(),s=t.state.field(aT).iter(),a=0,l=0,c=0,u=0;for(let p=0;;p++){let g=p<n.length?n[p]:null;if(a<(g?g.fromA:e.state.doc.length)){let v=e.lineBlockAt(a).top+c,y=t.lineBlockAt(l).top+u,O=v-y;O<-qI?(c-=O,r.add(a,a,st.widget({widget:new WI(-O),block:!0,side:-1}))):O>qI&&(u+=O,i.add(l,l,st.widget({widget:new WI(O),block:!0,side:-1})))}if(!g)break;for(a=g.toA,l=g.toB;o.value&&o.from<a;)c-=o.value.spec.widget.height,o.next();for(;s.value&&s.from<l;)u-=s.value.spec.widget.height,s.next()}for(;o.value;)c-=o.value.spec.widget.height,o.next();for(;s.value;)u-=s.value.spec.widget.height,s.next();let f=e.contentHeight+c-(t.contentHeight+u);f<qI?r.add(e.state.doc.length,e.state.doc.length,st.widget({widget:new WI(-f),block:!0,side:1})):f>qI&&i.add(t.state.doc.length,t.state.doc.length,st.widget({widget:new WI(f),block:!0,side:1}));let d=r.finish(),h=i.finish();Dn.eq([d],[e.state.field(aT)])||e.dispatch({effects:E7.of(d)}),Dn.eq([h],[t.state.field(aT)])||t.dispatch({effects:E7.of(h)})}const gne=jt.define({map:(e,t)=>t.mapPos(e)});class z6n extends hu{constructor(t){super(),this.lines=t}eq(t){return this.lines==t.lines}toDOM(t){let n=document.createElement("div");return n.className="cm-collapsedLines",n.textContent="⦚ "+t.state.phrase("$ unchanged lines",this.lines)+" ⦚",n.addEventListener("click",r=>{let i=t.posAtDOM(r.target);t.dispatch({effects:gne.of(i)});let{side:o,sibling:s}=t.state.facet(_h);s&&s().dispatch({effects:gne.of(Q6n(i,t.state.field($C),o=="a"))})}),n}ignoreEvent(t){return t instanceof MouseEvent}get estimatedHeight(){return 27}}function Q6n(e,t,n){let r=0,i=0;for(let o=0;;o++){let s=o<t.length?t[o]:null;if(!s||(n?s.fromA:s.fromB)>=e)return i+(e-r);[r,i]=n?[s.toA,s.toB]:[s.toB,s.toA]}}const B6n=di.define({create(e){return st.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(gne)&&(e=e.update({filter:r=>r!=n.value}));return e},provide:e=>Ve.decorations.from(e)});function vPe({margin:e=3,minSize:t=4}){return B6n.init(n=>W6n(n,e,t))}function W6n(e,t,n){let r=new Ol,i=e.facet(_h).side=="a",o=e.field($C),s=1;for(let a=0;;a++){let l=a<o.length?o[a]:null,c=a?s+t:1,u=l?e.doc.lineAt(i?l.fromA:l.fromB).number-1-t:e.doc.lines,f=u-c+1;if(f>=n&&r.add(e.doc.line(c).from,e.doc.line(u).to,st.replace({widget:new z6n(f),block:!0})),!l)break;s=e.doc.lineAt(Math.min(e.doc.length,i?l.toA:l.toB)).number}return r.finish()}const q6n=Ve.styleModule.of(new Xg({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),V6n=Ve.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb2266, #22bb2266) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff8866, #88ff8866) bottom/100% 2px no-repeat"},".cm-insertedLine, .cm-deletedLine":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer"},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"}}),bPe=new wv,VI=new wv;class OPe{constructor(t){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=t.diffConfig;let n=[Ks.low(Xot),V6n,q6n,aT,Ve.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(d=>d.effects.some(h=>h.is(E7)))&&this.measure()})],r=[_h.of({side:"a",sibling:()=>this.b,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&r.push(BI);let i=dn.create({doc:t.a.doc,selection:t.a.selection,extensions:[t.a.extensions||[],Ve.editorAttributes.of({class:"cm-merge-a"}),VI.of(r),n]}),o=[_h.of({side:"b",sibling:()=>this.a,highlightChanges:t.highlightChanges!==!1,markGutter:t.gutter!==!1})];t.gutter!==!1&&o.push(BI);let s=dn.create({doc:t.b.doc,selection:t.b.selection,extensions:[t.b.extensions||[],Ve.editorAttributes.of({class:"cm-merge-b"}),VI.of(o),n]});this.chunks=US.build(i.doc,s.doc,this.diffConf);let a=[$C.init(()=>this.chunks),bPe.of(t.collapseUnchanged?vPe(t.collapseUnchanged):[])];i=i.update({effects:jt.appendConfig.of(a)}).state,s=s.update({effects:jt.appendConfig.of(a)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let l=t.orientation||"a-b",c=document.createElement("div");c.className="cm-mergeViewEditor";let u=document.createElement("div");u.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?c:u),this.editorDOM.appendChild(l=="a-b"?u:c),this.a=new Ve({state:i,parent:c,root:t.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new Ve({state:s,parent:u,root:t.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!t.revertControls,t.revertControls=="b-to-a",t.renderRevertControl),t.parent&&t.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(t,n){if(t.some(r=>r.docChanged)){let r=t[t.length-1],i=t.reduce((s,a)=>s.compose(a.changes),Oo.empty(t[0].startState.doc.length));this.chunks=n==this.a?US.updateA(this.chunks,r.newDoc,this.b.state.doc,i,this.diffConf):US.updateB(this.chunks,this.a.state.doc,r.newDoc,i,this.diffConf),n.update([...t,r.state.update({effects:pne.of(this.chunks)})]);let o=n==this.a?this.b:this.a;o.update([o.state.update({effects:pne.of(this.chunks)})]),this.scheduleMeasure()}else n.update(t)}reconfigure(t){if("diffConfig"in t&&(this.diffConf=t.diffConfig),"orientation"in t){let o=t.orientation!="b-a";if(o!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let s=this.a.dom.parentNode,a=this.b.dom.parentNode;s.remove(),a.remove(),this.editorDOM.insertBefore(o?s:a,this.editorDOM.firstChild),this.editorDOM.appendChild(o?a:s),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in t||"renderRevertControl"in t){let o=!!this.revertDOM,s=this.revertToA,a=this.renderRevert;"revertControls"in t&&(o=!!t.revertControls,s=t.revertControls=="b-to-a"),"renderRevertControl"in t&&(a=t.renderRevertControl),this.setupRevertControls(o,s,a)}let n="highlightChanges"in t,r="gutter"in t,i="collapseUnchanged"in t;if(n||r||i){let o=[],s=[];if(n||r){let a=this.a.state.facet(_h),l=r?t.gutter!==!1:a.markGutter,c=n?t.highlightChanges!==!1:a.highlightChanges;o.push(VI.reconfigure([_h.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:l}),l?BI:[]])),s.push(VI.reconfigure([_h.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:l}),l?BI:[]]))}if(i){let a=bPe.reconfigure(t.collapseUnchanged?vPe(t.collapseUnchanged):[]);o.push(a),s.push(a)}this.a.dispatch({effects:o}),this.b.dispatch({effects:s})}this.scheduleMeasure()}setupRevertControls(t,n,r){this.revertToA=n,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=r,!t&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):t&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",i=>this.revertClicked(i)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let t=this.dom.ownerDocument.defaultView||window;this.measuring=t.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){F6n(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let t=this.revertDOM,n=t.firstChild,r=this.a.viewport,i=this.b.viewport;for(let o=0;o<this.chunks.length;o++){let s=this.chunks[o];if(s.fromA>r.to||s.fromB>i.to)break;if(s.fromA<r.from||s.fromB<i.from)continue;let a=this.a.lineBlockAt(s.fromA).top+"px";for(;n&&+n.dataset.chunk<o;)n=xPe(n);n&&n.dataset.chunk==String(o)?(n.style.top!=a&&(n.style.top=a),n=n.nextSibling):t.insertBefore(this.renderRevertButton(a,o),n)}for(;n;)n=xPe(n)}renderRevertButton(t,n){let r;if(this.renderRevert)r=this.renderRevert();else{r=document.createElement("button");let i=this.a.state.phrase("Revert this chunk");r.setAttribute("aria-label",i),r.setAttribute("title",i),r.textContent=this.revertToLeft?"⇜":"⇝"}return r.style.top=t,r.setAttribute("data-chunk",String(n)),r}revertClicked(t){let n=t.target,r;for(;n&&n.parentNode!=this.revertDOM;)n=n.parentNode;if(n&&(r=this.chunks[n.dataset.chunk])){let[i,o,s,a,l,c]=this.revertToA?[this.b,this.a,r.fromB,r.toB,r.fromA,r.toA]:[this.a,this.b,r.fromA,r.toA,r.fromB,r.toB],u=i.state.sliceDoc(s,Math.max(s,a-1));s!=a&&c<=o.state.doc.length&&(u+=i.state.lineBreak),o.dispatch({changes:{from:l,to:Math.min(o.state.doc.length,c),insert:u},userEvent:"revert"}),t.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}}function xPe(e){let t=e.nextSibling;return e.remove(),t}var U6n=["className","children","orientation","revertControls","highlightChanges","gutter","collapseUnchanged","destroyRerender","renderRevertControl"],H6n=["modified","modifiedExtension","original","originalExtension","theme","dispatch"],Zot=ie.forwardRef((e,t)=>{var{className:n,children:r,orientation:i,revertControls:o,highlightChanges:s,gutter:a,collapseUnchanged:l,destroyRerender:c=!0,renderRevertControl:u}=e,f=$o(e,U6n),d=xge(),{modified:h,modifiedExtension:p,original:g,originalExtension:v,theme:y,dispatch:O}=d,m=$o(d,H6n),w=x.useRef(null),S=x.useRef(),E={orientation:i,revertControls:o,highlightChanges:s,gutter:a,collapseUnchanged:l,renderRevertControl:u};x.useImperativeHandle(t,()=>({container:w.current,view:S.current,modified:h,original:g,config:oe({a:g,b:h,parent:w.current},E)}),[w,S,h,g,E]),x.useEffect(()=>{!S.current&&w.current&&(S.current=new OPe(oe({a:oe({},g,{extensions:[...(v==null?void 0:v.extension)||[],...Q1(oe({},v==null?void 0:v.option,{theme:y}))]}),b:oe({},h,{extensions:[...(p==null?void 0:p.extension)||[],...Q1(oe({},p==null?void 0:p.option,{theme:y}))]}),parent:w.current},E)))},[S,w]),x.useEffect(()=>{if(g&&g.doc&&S.current){var k,P=(k=S.current)==null?void 0:k.a.state.doc.toString();if(P!==g.doc){var D;(D=S.current)==null||D.a.dispatch({changes:{from:0,to:P.length,insert:g.doc||""}})}}if(h&&h.doc&&S.current){var M,L=(M=S.current)==null?void 0:M.b.state.doc.toString();if(L!==h.doc){var A;(A=S.current)==null||A.b.dispatch({changes:{from:0,to:L.length,insert:h.doc||""}})}}if(c&&S.current){var T=S.current.a.state.selection.ranges[0].from,N=S.current.b.state.selection.ranges[0].from;S.current.destroy(),S.current=new OPe(oe({a:oe({},g,{extensions:[...(v==null?void 0:v.extension)||[],...Q1(oe({},v==null?void 0:v.option,{theme:y}))]}),b:oe({},h,{extensions:[...(p==null?void 0:p.extension)||[],...Q1(oe({},p==null?void 0:p.option,{theme:y}))]}),parent:w.current},E)),T&&(S.current.a.focus(),S.current.a.dispatch({selection:{anchor:T,head:T}})),N&&(S.current.b.focus(),S.current.b.dispatch({selection:{anchor:N,head:N}}))}},[S,y,w.current,g,h,v,p,c]),x.useEffect(()=>()=>S.current&&S.current.destroy(),[]),x.useEffect(()=>{if(S.current){var k={};m.orientation!==i&&(k.orientation=i),m.revertControls!==o&&(k.revertControls=o),m.highlightChanges!==s&&(k.highlightChanges=s),m.gutter!==a&&(k.gutter=a),m.collapseUnchanged!==l&&(k.collapseUnchanged=l),m.renderRevertControl!==u&&(k.collapseUnchanged=l),Object.keys(k).length&&O&&S.current&&(S.current.reconfigure(oe({},k)),O(oe({},k)))}},[O,S,i,o,s,a,l,u]);var C="cm-merge-theme";return b.jsx("div",oe({ref:w,className:""+C+(n?" "+n:"")},f,{children:r}))});Zot.displayName="CodeMirrorMerge.Internal";var X6n=["theme"],Z6n=ie.forwardRef((e,t)=>{var{theme:n}=e,r=$o(e,X6n);return b.jsx(E6n,{theme:n,children:b.jsx(Zot,oe({},r,{ref:t}))})}),q_=Z6n;q_.Original=Not;q_.Modified=Iot;q_.displayName="CodeMirrorMerge";const By=()=>{},Qu=By(),BH=Object,Xn=e=>e===Qu,Sg=e=>typeof e=="function",av=(e,t)=>({...e,...t}),Y6n=e=>Sg(e.then),UI=new WeakMap;let G6n=0;const zA=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,o;if(BH(e)===e&&!r&&n!=RegExp){if(i=UI.get(e),i)return i;if(i=++G6n+"~",UI.set(e,i),n==Array){for(i="@",o=0;o<e.length;o++)i+=zA(e[o])+",";UI.set(e,i)}if(n==BH){i="#";const s=BH.keys(e).sort();for(;!Xn(o=s.pop());)Xn(e[o])||(i+=o+":"+zA(e[o])+",");UI.set(e,i)}}else i=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},fg=new WeakMap,WH={},HI={},Ege="undefined",_B=typeof window!=Ege,mne=typeof document!=Ege,K6n=()=>_B&&typeof window.requestAnimationFrame!=Ege,Yot=(e,t)=>{const n=fg.get(e);return[()=>!Xn(t)&&e.get(t)||WH,r=>{if(!Xn(t)){const i=e.get(t);t in HI||(HI[t]=i),n[5](t,av(i,r),i||WH)}},n[6],()=>!Xn(t)&&t in HI?HI[t]:!Xn(t)&&e.get(t)||WH]};let yne=!0;const J6n=()=>yne,[vne,bne]=_B&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[By,By],ezn=()=>{const e=mne&&document.visibilityState;return Xn(e)||e!=="hidden"},tzn=e=>(mne&&document.addEventListener("visibilitychange",e),vne("focus",e),()=>{mne&&document.removeEventListener("visibilitychange",e),bne("focus",e)}),nzn=e=>{const t=()=>{yne=!0,e()},n=()=>{yne=!1};return vne("online",t),vne("offline",n),()=>{bne("online",t),bne("offline",n)}},rzn={isOnline:J6n,isVisible:ezn},izn={initFocus:tzn,initReconnect:nzn},wPe=!ie.useId,QA=!_B||"Deno"in window,ozn=e=>K6n()?window.requestAnimationFrame(e):setTimeout(e,1),qH=QA?x.useEffect:x.useLayoutEffect,VH=typeof navigator<"u"&&navigator.connection,SPe=!QA&&VH&&(["slow-2g","2g"].includes(VH.effectiveType)||VH.saveData),Cge=e=>{if(Sg(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?zA(e):"",[e,t]};let szn=0;const One=()=>++szn,Got=0,Kot=1,Jot=2,azn=3;var s$={__proto__:null,ERROR_REVALIDATE_EVENT:azn,FOCUS_EVENT:Got,MUTATE_EVENT:Jot,RECONNECT_EVENT:Kot};async function est(...e){const[t,n,r,i]=e,o=av({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const c=o.revalidate!==!1,u=h=>typeof a=="function"?a(h):a!==!1,f=o.throwOnError;if(Sg(n)){const h=n,p=[],g=t.keys();for(const v of g)!/^\$(inf|sub)\$/.test(v)&&h(t.get(v)._k)&&p.push(v);return Promise.all(p.map(d))}return d(n);async function d(h){const[p]=Cge(h);if(!p)return;const[g,v]=Yot(t,p),[y,O,m,w]=fg.get(t),S=y[p],E=()=>c&&(delete m[p],delete w[p],S&&S[0])?S[0](Jot).then(()=>g().data):g().data;if(e.length<3)return E();let C=r,k;const P=One();O[p]=[P,0];const D=!Xn(l),M=g(),L=M.data,A=M._c,T=Xn(A)?L:A;if(D&&(l=Sg(l)?l(T,L):l,v({data:l,_c:T})),Sg(C))try{C=C(T)}catch(j){k=j}if(C&&Y6n(C))if(C=await C.catch(j=>{k=j}),P!==O[p][0]){if(k)throw k;return C}else k&&D&&u(k)&&(s=!0,C=T,v({data:C,_c:Qu}));s&&(k||(Sg(s)&&(C=s(C,T)),v({data:C,error:Qu,_c:Qu}))),O[p][1]=One();const N=await E();if(v({_c:Qu}),k){if(f)throw k;return}return s?N:C}}const EPe=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},lzn=(e,t)=>{if(!fg.has(e)){const n=av(izn,t),r={},i=est.bind(Qu,e);let o=By;const s={},a=(u,f)=>{const d=s[u]||[];return s[u]=d,d.push(f),()=>d.splice(d.indexOf(f),1)},l=(u,f,d)=>{e.set(u,f);const h=s[u];if(h)for(const p of h)p(f,d)},c=()=>{if(!fg.has(e)&&(fg.set(e,[r,{},{},{},i,l,a]),!QA)){const u=n.initFocus(setTimeout.bind(Qu,EPe.bind(Qu,r,Got))),f=n.initReconnect(setTimeout.bind(Qu,EPe.bind(Qu,r,Kot)));o=()=>{u&&u(),f&&f(),fg.delete(e)}}};return c(),[e,i,c,o]}return[e,fg.get(e)[4]]},czn=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Xn(o)&&s>o||setTimeout(r,a,i)},uzn=(e,t)=>zA(e)==zA(t),[tst,fzn]=lzn(new Map),dzn=av({onLoadingSlow:By,onSuccess:By,onError:By,onErrorRetry:czn,onDiscarded:By,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:SPe?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:SPe?5e3:3e3,compare:uzn,isPaused:()=>!1,cache:tst,mutate:fzn,fallback:{}},rzn),hzn=(e,t)=>{const n=av(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:s}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=av(i,s))}return n},pzn=x.createContext({}),nst=_B&&window.__SWR_DEVTOOLS_USE__,gzn=nst?window.__SWR_DEVTOOLS_USE__:[],mzn=()=>{nst&&(window.__SWR_DEVTOOLS_REACT__=ie)},yzn=e=>Sg(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],vzn=()=>av(dzn,x.useContext(pzn)),bzn=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=Cge(t),[,,,a]=fg.get(tst),l=a[s];return Xn(l)?n(...o):(delete a[s],l)}),r),Ozn=gzn.concat(bzn),xzn=e=>function(...n){const r=vzn(),[i,o,s]=yzn(n),a=hzn(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(Ozn);for(let f=u.length;f--;)l=u[f](l);return l(i,o||a.fetcher||null,a)},wzn=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};mzn();const CPe=ie.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),UH={dedupe:!0},Szn=(e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:f,keepPreviousData:d}=n,[h,p,g,v]=fg.get(r),[y,O]=Cge(e),m=x.useRef(!1),w=x.useRef(!1),S=x.useRef(y),E=x.useRef(t),C=x.useRef(n),k=()=>C.current,P=()=>k().isVisible()&&k().isOnline(),[D,M,L,A]=Yot(r,y),T=x.useRef({}).current,N=Xn(s)?n.fallback[y]:s,j=(te,Ee)=>{for(const we in T){const ke=we;if(ke==="data"){if(!i(te[ke],Ee[ke])&&(!Xn(te[ke])||!i(ee,Ee[ke])))return!1}else if(Ee[ke]!==te[ke])return!1}return!0},z=x.useMemo(()=>{const te=!y||!t?!1:Xn(a)?k().isPaused()||o?!1:Xn(l)?!0:l:a,Ee=G=>{const le=av(G);return delete le._k,te?{isValidating:!0,isLoading:!0,...le}:le},we=D(),ke=A(),je=Ee(we),nt=we===ke?je:Ee(ke);let Re=je;return[()=>{const G=Ee(D());return j(G,Re)?(Re.data=G.data,Re.isLoading=G.isLoading,Re.isValidating=G.isValidating,Re.error=G.error,Re):(Re=G,G)},()=>nt]},[r,y]),W=Nie.useSyncExternalStore(x.useCallback(te=>L(y,(Ee,we)=>{j(we,Ee)||te()}),[r,y]),z[0],z[1]),F=!m.current,q=h[y]&&h[y].length>0,U=W.data,V=Xn(U)?N:U,H=W.error,Z=x.useRef(V),ee=d?Xn(U)?Z.current:U:V,se=q&&!Xn(H)?!1:F&&!Xn(a)?a:k().isPaused()?!1:o?Xn(V)?!1:l:Xn(V)||l,fe=!!(y&&t&&F&&se),ce=Xn(W.isValidating)?fe:W.isValidating,ae=Xn(W.isLoading)?fe:W.isLoading,de=x.useCallback(async te=>{const Ee=E.current;if(!y||!Ee||w.current||k().isPaused())return!1;let we,ke,je=!0;const nt=te||{},Re=!g[y]||!nt.dedupe,G=()=>wPe?!w.current&&y===S.current&&m.current:y===S.current,le={isValidating:!1,isLoading:!1},Oe=()=>{M(le)},Ue=()=>{const ye=g[y];ye&&ye[1]===ke&&delete g[y]},Fe={isValidating:!0};Xn(D().data)&&(Fe.isLoading=!0);try{if(Re&&(M(Fe),n.loadingTimeout&&Xn(D().data)&&setTimeout(()=>{je&&G()&&k().onLoadingSlow(y,n)},n.loadingTimeout),g[y]=[Ee(O),One()]),[we,ke]=g[y],we=await we,Re&&setTimeout(Ue,n.dedupingInterval),!g[y]||g[y][1]!==ke)return Re&&G()&&k().onDiscarded(y),!1;le.error=Qu;const ye=p[y];if(!Xn(ye)&&(ke<=ye[0]||ke<=ye[1]||ye[1]===0))return Oe(),Re&&G()&&k().onDiscarded(y),!1;const Me=D().data;le.data=i(Me,we)?Me:we,Re&&G()&&k().onSuccess(we,y,n)}catch(ye){Ue();const Me=k(),{shouldRetryOnError:pt}=Me;Me.isPaused()||(le.error=ye,Re&&G()&&(Me.onError(ye,y,Me),(pt===!0||Sg(pt)&&pt(ye))&&P()&&Me.onErrorRetry(ye,y,Me,at=>{const ht=h[y];ht&&ht[0]&&ht[0](s$.ERROR_REVALIDATE_EVENT,at)},{retryCount:(nt.retryCount||0)+1,dedupe:!0})))}return je=!1,Oe(),!0},[y,r]),me=x.useCallback((...te)=>est(r,S.current,...te),[]);if(qH(()=>{E.current=t,C.current=n,Xn(U)||(Z.current=U)}),qH(()=>{if(!y)return;const te=de.bind(Qu,UH);let Ee=0;const ke=wzn(y,h,(je,nt={})=>{if(je==s$.FOCUS_EVENT){const Re=Date.now();k().revalidateOnFocus&&Re>Ee&&P()&&(Ee=Re+k().focusThrottleInterval,te())}else if(je==s$.RECONNECT_EVENT)k().revalidateOnReconnect&&P()&&te();else{if(je==s$.MUTATE_EVENT)return de();if(je==s$.ERROR_REVALIDATE_EVENT)return de(nt)}});return w.current=!1,S.current=y,m.current=!0,M({_k:O}),se&&(Xn(V)||QA?te():ozn(te)),()=>{w.current=!0,ke()}},[y]),qH(()=>{let te;function Ee(){const ke=Sg(c)?c(D().data):c;ke&&te!==-1&&(te=setTimeout(we,ke))}function we(){!D().error&&(u||k().isVisible())&&(f||k().isOnline())?de(UH).then(Ee):Ee()}return Ee(),()=>{te&&(clearTimeout(te),te=-1)}},[c,u,f,y]),x.useDebugValue(ee),o&&Xn(V)&&y){if(!wPe&&QA)throw new Error("Fallback data is required when using suspense in SSR.");E.current=t,C.current=n,w.current=!1;const te=v[y];if(!Xn(te)){const Ee=me(te);CPe(Ee)}if(Xn(H)){const Ee=de(UH);Xn(ee)||(Ee.status="fulfilled",Ee.value=!0),CPe(Ee)}else throw H}return{mutate:me,get data(){return T.data=!0,ee},get error(){return T.error=!0,H},get isValidating(){return T.isValidating=!0,ce},get isLoading(){return T.isLoading=!0,ae}}},HH=xzn(Szn);var BA={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},WA={code:"1",name:"function_call",parse:e=>{if(e==null||typeof e!="object"||!("function_call"in e)||typeof e.function_call!="object"||e.function_call==null||!("name"in e.function_call)||!("arguments"in e.function_call)||typeof e.function_call.name!="string"||typeof e.function_call.arguments!="string")throw new Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},qA={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},VA={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},UA={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},HA={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},XA={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},ZA={code:"7",name:"tool_calls",parse:e=>{if(e==null||typeof e!="object"||!("tool_calls"in e)||typeof e.tool_calls!="object"||e.tool_calls==null||!Array.isArray(e.tool_calls)||e.tool_calls.some(t=>{t==null||typeof t!="object"||!("id"in t)||typeof t.id!="string"||!("type"in t)||typeof t.type!="string"||!("function"in t)||t.function==null||typeof t.function!="object"||!("arguments"in t.function)||typeof t.function.name!="string"||t.function.arguments}))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},YA={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},Ezn=[BA,WA,qA,VA,UA,HA,XA,ZA,YA],Czn={[BA.code]:BA,[WA.code]:WA,[qA.code]:qA,[VA.code]:VA,[UA.code]:UA,[HA.code]:HA,[XA.code]:XA,[ZA.code]:ZA,[YA.code]:YA};BA.name+"",BA.code,WA.name+"",WA.code,qA.name+"",qA.code,VA.name+"",VA.code,UA.name+"",UA.code,HA.name+"",HA.code,XA.name+"",XA.code,ZA.name+"",ZA.code,YA.name+"",YA.code;var _zn=Ezn.map(e=>e.code),rst=e=>{const t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!_zn.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,i=e.slice(t+1),o=JSON.parse(i);return Czn[r].parse(o)},kzn=10;function $zn(e,t){const n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return e.length=0,n}async function*Tzn(e,{isAborted:t}={}){const n=new TextDecoder,r=[];let i=0;for(;;){const{value:o}=await e.read();if(o&&(r.push(o),i+=o.length,o[o.length-1]!==kzn))continue;if(r.length===0)break;const s=$zn(r,i);i=0;const a=n.decode(s,{stream:!0}).split(`
`).filter(l=>l!=="").map(rst);for(const l of a)yield l;if(t!=null&&t()){e.cancel();break}}}function Pzn(e){const t=new TextDecoder;return e?function(n){return t.decode(n,{stream:!0}).split(`
`).filter(i=>i!=="").map(rst).filter(Boolean)}:function(n){return n?t.decode(n,{stream:!0}):""}}var Azn="X-Experimental-Stream-Data";async function Rzn({api:e,prompt:t,credentials:n,headers:r,body:i,setCompletion:o,setLoading:s,setError:a,setAbortController:l,onResponse:c,onFinish:u,onError:f,onData:d}){try{s(!0),a(void 0);const h=new AbortController;l(h),o("");const p=await fetch(e,{method:"POST",body:JSON.stringify({prompt:t,...i}),credentials:n,headers:{"Content-Type":"application/json",...r},signal:h.signal}).catch(O=>{throw O});if(c)try{await c(p)}catch(O){throw O}if(!p.ok)throw new Error(await p.text()||"Failed to fetch the chat response.");if(!p.body)throw new Error("The response body is empty.");let g="";const v=p.body.getReader();if(p.headers.get(Azn)==="true")for await(const{type:O,value:m}of Tzn(v,{isAborted:()=>h===null}))switch(O){case"text":{g+=m,o(g);break}case"data":{d==null||d(m);break}}else{const O=Pzn();for(;;){const{done:m,value:w}=await v.read();if(m)break;if(g+=O(w),o(g),h===null){v.cancel();break}}}return u&&u(t,g),l(null),g}catch(h){if(h.name==="AbortError")return l(null),null;h instanceof Error&&f&&f(h),a(h)}finally{s(!1)}}function Dzn({api:e="/api/completion",id:t,initialCompletion:n="",initialInput:r="",credentials:i,headers:o,body:s,onResponse:a,onFinish:l,onError:c}={}){const u=x.useId(),f=t||u,{data:d,mutate:h}=HH([e,f],null,{fallbackData:n}),{data:p=!1,mutate:g}=HH([f,"loading"],null),{data:v,mutate:y}=HH([f,"streamData"],null),[O,m]=x.useState(void 0),w=d,[S,E]=x.useState(null),C=x.useRef({credentials:i,headers:o,body:s});x.useEffect(()=>{C.current={credentials:i,headers:o,body:s}},[i,o,s]);const k=x.useCallback(async(j,z)=>Rzn({api:e,prompt:j,credentials:C.current.credentials,headers:{...C.current.headers,...z==null?void 0:z.headers},body:{...C.current.body,...z==null?void 0:z.body},setCompletion:W=>h(W,!1),setLoading:g,setError:m,setAbortController:E,onResponse:a,onFinish:l,onError:c,onData:W=>{y([...v||[],...W||[]],!1)}}),[h,g,e,C,E,a,l,c,m,v,y]),P=x.useCallback(()=>{S&&(S.abort(),E(null))},[S]),D=x.useCallback(j=>{h(j,!1)},[h]),M=x.useCallback(async(j,z)=>k(j,z),[k]),[L,A]=x.useState(r),T=x.useCallback(j=>{if(j.preventDefault(),!!L)return M(L)},[L,M]);return{completion:w,complete:M,error:O,setCompletion:D,stop:P,input:L,setInput:A,handleInputChange:j=>{A(j.target.value)},handleSubmit:T,isLoading:p,data:v}}const Mzn=q_.Original,Nzn=q_.Modified,Izn=({onChange:e,currentCode:t,declineChange:n,acceptChange:r,enabled:i,children:o})=>{const[s,a]=tc(_Fn),{completion:l,input:c,stop:u,isLoading:f,setCompletion:d,handleInputChange:h,handleSubmit:p}=Dzn({api:"/api/ai/completion",headers:Nr.headers(),body:{includeOtherCode:s?Mpe(t):"",code:t},onError:y=>{yr({title:"Completion failed",description:_R(y)})}}),g=ie.useRef(null);x.useEffect(()=>{i&&g.current&&(g.current.focus(),g.current.select())},[i]);const v=[Ble(),Ve.lineWrapping];return b.jsxs("div",{className:"flex flex-col w-full rounded-[inherit] overflow-hidden",children:[b.jsxs("div",{className:be("flex items-center gap-2 border-b px-3 transition-[height] rounded-[inherit] rounded-b-none duration-300 overflow-hidden",i&&"h-10 visible",!i&&"h-0 invisible"),children:[b.jsx(NLe,{className:"text-[var(--blue-10)]",size:16}),b.jsx("input",{className:"h-8 outline-none px-2 focus-visible:shadow-none flex-1 rounded-none border-none focus:border-none",value:c,ref:g,onChange:h,placeholder:"Type for completion",onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),p(y)),y.key==="Escape"&&(y.preventDefault(),n(),d(""))}}),f&&b.jsxs(St,{"data-testid":"stop-completion-button",variant:"text",size:"xs",className:"mb-0",onClick:u,children:[b.jsx(Nb,{className:"animate-spin mr-1",size:14}),"Stop"]}),!f&&l&&b.jsx(St,{"data-testid":"accept-completion-button",variant:"text",size:"xs",className:"mb-0",disabled:f,onClick:()=>{r(l),d("")},children:b.jsx("span",{className:"text-[var(--grass-11)] opacity-100",children:"Accept"})}),b.jsx("div",{className:"h-full w-px bg-border mx-2"}),b.jsx(Wt,{content:"Include code from other cells",children:b.jsxs("div",{className:"flex flex-row items-start gap-1",children:[b.jsx(kh,{"data-testid":"include-other-cells-checkbox",id:"include-other-cells",checked:s,onCheckedChange:y=>a(!!y)}),b.jsx(Ls,{htmlFor:"include-other-cells",className:"text-muted-foreground text-xs",children:"Include all code"})]})}),b.jsx(St,{"data-testid":"decline-completion-button",variant:"text",size:"icon",disabled:f,onClick:()=>{u(),n(),d("")},children:b.jsx(rc,{className:"text-[var(--red-10)]",size:16})})]}),l&&i&&b.jsxs(q_,{className:"cm",children:[b.jsx(Mzn,{onChange:e,value:t,extensions:v}),b.jsx(Nzn,{value:l,editable:!1,readOnly:!0,extensions:v})]}),(!l||!i)&&o]})},Lzn=({theme:e,showPlaceholder:t,allowFocus:n,id:r,code:i,status:o,serializedEditorState:s,runCell:a,updateCellCode:l,createNewCell:c,deleteCell:u,focusCell:f,moveCell:d,moveToNextCell:h,updateCellConfig:p,clearSerializedEditorState:g,userConfig:v,editorViewRef:y,hidden:O})=>{var Z;const[m,w]=x.useState(!1),[S,E]=tc(fge),[C,k]=x.useState(),P=vl(Lit),D=x.useRef(null),M=o==="running"||o==="queued",{sendToTop:L,sendToBottom:A}=wp(),T=Jn(()=>M?!1:(u({cellId:r}),!0)),N=x.useCallback(()=>c({cellId:r,before:!1}),[r,c]),j=x.useCallback(()=>c({cellId:r,before:!0}),[r,c]),z=x.useCallback(()=>d({cellId:r,before:!1}),[r,d]),W=x.useCallback(()=>d({cellId:r,before:!0}),[r,d]),F=x.useCallback(()=>f({cellId:r,before:!1}),[r,f]),q=x.useCallback(()=>f({cellId:r,before:!0}),[r,f]),U=Jn(()=>{const ee={hide_code:!O};return Mb({configs:{[r]:ee}}),p({cellId:r,config:ee}),ee.hide_code||!1}),V=x.useMemo(()=>{var se;const ee=I7n({cellId:r,showPlaceholder:t,enableAI:!!((se=v.ai.open_ai)!=null&&se.api_key),cellCodeCallbacks:{updateCellCode:l},cellMovementCallbacks:{onRun:a,deleteCell:T,createAbove:j,createBelow:N,moveUp:W,moveDown:z,focusUp:q,focusDown:F,sendToTop:L,sendToBottom:A,moveToNextCell:h,toggleHideCode:U,aiCellCompletion:()=>{let fe=!1;return E(ce=>ce===r?(fe=!0,null):r),fe}},completionConfig:v.completion,keymapConfig:v.keymap,theme:e});return ee.push(jr.define(fe=>{const ce=fe.state.field(Nd);return k(ce.type),{update(ae){const de=ae.state.doc.toString(),me=ae.state.field(Nd);me.type!=="markdown"&&w(DO.markdown().isSupported(de)),k(me.type)}}})),ee},[r,v.keymap,v.completion,(Z=v.ai.open_ai)==null?void 0:Z.api_key,e,t,j,N,q,F,W,z,h,L,A,U,l,T,a,E]);x.useEffect(()=>{let ee;s===null?y.current===null?(y.current=new Ve({state:dn.create({doc:i,extensions:V})}),ee=!0):(y.current.dispatch({effects:[jt.reconfigure.of([V]),X5n(y.current,v.completion)]}),ee=!1):(y.current=new Ve({state:dn.fromJSON(s,{doc:i,extensions:V},{history:yze})}),ee=!0,g({cellId:r})),y.current!==null&&D.current!==null&&D.current.replaceChildren(y.current.dom),ee&&n&&requestAnimationFrame(()=>{var se,fe;(se=y.current)==null||se.focus(),(fe=y.current)==null||fe.dom.scrollIntoView({behavior:"smooth",block:"center"})})},[y,V,v.completion,g,r,s]);const H=async()=>{var ee;O&&(await Mb({configs:{[r]:{hide_code:!1}}}),p({cellId:r,config:{hide_code:!1}}),(ee=y.current)==null||ee.focus())};return b.jsx(Izn,{enabled:S===r,currentCode:i,declineChange:()=>{var ee;E(null),(ee=y.current)==null||ee.focus()},onChange:ee=>{var se;(se=y.current)==null||se.dispatch({changes:{from:0,to:y.current.state.doc.length,insert:ee}})},acceptChange:ee=>{var se,fe;(se=y.current)==null||se.dispatch({changes:{from:0,to:y.current.state.doc.length,insert:ee}}),(fe=y.current)==null||fe.focus(),E(null)},children:b.jsxs("div",{className:"relative w-full",onFocus:()=>P(r),children:[m&&b.jsx("div",{className:"absolute top-1 right-1",children:b.jsx(w6n,{editorView:rS(y),languageAdapter:C,canUseMarkdown:m})}),O&&b.jsx(aWe,{onClick:H}),b.jsx(ist,{className:be(O&&"opacity-20 h-8 overflow-hidden"),editorView:y.current,ref:D})]})})},ist=ie.forwardRef((e,t)=>{const{className:n,editorView:r}=e,i=x.useRef(null);return x.useEffect(()=>{r!==null&&i.current!==null&&i.current.children.length===0&&i.current.append(r.dom)},[r,i]),b.jsx("div",{className:be("cm",n),ref:pot(t,i)})});ist.displayName="CellCodeMirrorEditor";const jzn=x.memo(Lzn),Fzn=({theme:e,showPlaceholder:t,allowFocus:n,id:r,code:i,output:o,consoleOutputs:s,status:a,runStartTimestamp:l,runElapsedTimeMs:c,edited:u,interrupted:f,errored:d,stopped:h,serializedEditorState:p,mode:g,debuggerActive:v,appClosed:y,showDeleteButton:O,updateCellCode:m,prepareForRun:w,createNewCell:S,deleteCell:E,focusCell:C,moveCell:k,setStdinResponse:P,moveToNextCell:D,updateCellConfig:M,clearSerializedEditorState:L,sendToBottom:A,sendToTop:T,userConfig:N,config:j,name:z},W)=>{At.debug("Rendering Cell",r);const F=x.useRef(null),q=x.useRef(null),U=x.useRef(null),V=vl(fge),H=u||f,Z=a==="running"||a==="queued",ee=U4e({status:a,output:o,runStartTimestamp:l,interrupted:f},u),se=(a==="queued"||u||a==="stale")&&!f,fe=g==="edit",ce=x.useCallback(()=>{const le=sv(rS(U));return eF(rS(U)),w({cellId:r}),le},[r,U,w]);x.useImperativeHandle(W,()=>({get editorView(){return rS(U)},registerRun:ce}),[U,ce]);const ae=x.useCallback(()=>U.current,[U]),de=Jn(async()=>{if(Z)return;const le=ce();Sa.INSTANCE.registerRunStart(),await K5e([r],[le]).catch(Oe=>{At.error("Error running cell",Oe),Sa.INSTANCE.registerRunEnd()})}),me=x.useCallback(()=>S({cellId:r,before:!1}),[r,S]),te=x.useCallback(()=>S({cellId:r,before:!0}),[r,S]),Ee=x.useCallback(le=>{F.current!==null&&!F.current.contains(le.relatedTarget)&&U.current!==null&&eF(U.current)},[]),we=x.useCallback(le=>{if(!(F.current!==document.activeElement||U.current===null||cK(U.current.state)!=="active")){for(const Oe of Ple)if(le.key===Oe.key&&Oe.run){Oe.run(U.current),le.preventDefault(),le.stopPropagation();break}U.current.focus()}},[F,U]),ke=b.jsx(RP,{allowExpand:fe,output:o,className:"output-area",cellId:r,stale:ee}),je=bd("Cell","hover-actions-parent",{published:!fe,interactive:fe,"needs-run":H,"has-error":d,stopped:h,disabled:j.disabled,stale:a==="stale"||a==="disabled-transitively"}),nt=Od.create(r);if(qAn(fe?F.current:null,{"cell.run":de,"cell.runAndNewBelow":()=>{de(),D({cellId:r,before:!1})},"cell.runAndNewAbove":()=>{de(),D({cellId:r,before:!0})},"cell.createAbove":te,"cell.createBelow":me,"cell.moveUp":()=>k({cellId:r,before:!0}),"cell.moveDown":()=>k({cellId:r,before:!1}),"cell.hideCode":()=>{var Oe,Ue,Fe;const le={hide_code:!j.hide_code};Mb({configs:{[r]:le}}),M({cellId:r,config:le}),le.hide_code?((Oe=U.current)==null||Oe.contentDOM.blur(),(Ue=F.current)==null||Ue.focus()):(Fe=U.current)==null||Fe.focus()},"cell.focusDown":()=>D({cellId:r,before:!1}),"cell.focusUp":()=>D({cellId:r,before:!0}),"cell.sendToBottom":()=>A({cellId:r}),"cell.sendToTop":()=>T({cellId:r}),"cell.aiCompletion":()=>{let le=!1;V(Oe=>Oe===r?(le=!0,null):r),le&&rS(U).focus()},"cell.cellActions":()=>{var le;(le=q.current)==null||le.toggle()}}),VAn(fe?F.current:null,{ArrowDown:()=>(D({cellId:r,before:!1,noCreate:!0}),!0),ArrowUp:()=>(D({cellId:r,before:!0,noCreate:!0}),!0),...N.keymap.preset==="vim"&&j.hide_code?{j:()=>(D({cellId:r,before:!1,noCreate:!0}),!0),k:()=>(D({cellId:r,before:!0,noCreate:!0}),!0)}:{}}),!fe)return d||f||h?null:b.jsx("div",{tabIndex:-1,id:nt,ref:F,className:je,children:ke});const Re=()=>j.disabled?"This cell is disabled":a==="stale"||a==="disabled-transitively"?"This cell has a disabled ancestor":void 0,G=!b9t(o);return b.jsx(x6n,{cellId:r,config:j,status:a,getEditorView:ae,hasOutput:G,name:z,children:b.jsxs(U7n,{tabIndex:-1,id:nt,ref:F,className:je,"data-status":a,onBlur:Ee,onKeyDown:we,cellId:r,title:Re(),children:[N.display.cell_output==="above"&&ke,b.jsxs("div",{className:"tray",children:[b.jsxs("div",{className:"absolute flex flex-col gap-[2px] justify-center h-full left-[-34px] z-2 hover-action",children:[b.jsx(sPe,{tooltipContent:Md("cell.createAbove"),appClosed:y,onClick:y?void 0:te}),b.jsx("div",{className:"flex-1"}),b.jsx(sPe,{tooltipContent:Md("cell.createBelow"),appClosed:y,onClick:y?void 0:me})]}),b.jsx(jzn,{theme:e,showPlaceholder:t,allowFocus:n,id:r,code:i,status:a,serializedEditorState:p,runCell:de,updateCellCode:m,createNewCell:S,deleteCell:E,focusCell:C,moveCell:k,moveToNextCell:D,updateCellConfig:M,clearSerializedEditorState:L,userConfig:N,editorViewRef:U,hidden:j.hide_code}),b.jsxs("div",{className:"shoulder-right",children:[b.jsx(q7n,{status:a,interrupted:f,editing:fe,edited:u,disabled:j.disabled??!1,elapsedTime:c,runStartTimestamp:l}),b.jsxs("div",{className:"flex align-bottom",children:[b.jsx(Q7n,{edited:u,onClick:y?Yc.NOOP:de,appClosed:y,status:a,config:j,needsRun:H}),b.jsx(X7n,{ref:q,cellId:r,status:a,getEditorView:ae,name:z,config:j,hasOutput:G,children:b.jsx(mot,{})})]})]}),b.jsx("div",{className:"shoulder-bottom hover-action",children:O?b.jsx(B7n,{appClosed:y,status:a,onClick:()=>{!Z&&!y&&E({cellId:r})}}):null})]}),N.display.cell_output==="below"&&ke,b.jsx(F7n,{consoleOutputs:s,stale:se,cellName:z,onSubmitDebugger:(le,Oe)=>{P({cellId:r,response:le,outputIndex:Oe}),eSt({text:le})},cellId:r,debuggerActive:v})]})})},zzn=x.memo(x.forwardRef(Fzn)),Qzn=e=>{const{banners:t}=G4n(),{removeBanner:n}=lot();return t.length===0?null:b.jsx("div",{className:"flex flex-col gap-4 mb-5",children:t.map(r=>b.jsxs(gE,{kind:r.variant||"info",className:"flex flex-col rounded p-3",children:[b.jsxs("div",{className:"flex justify-between",children:[b.jsxs("span",{className:"font-bold text-lg flex items-center mb-2",children:[b.jsx(xLe,{className:"w-5 h-5 inline-block mr-2"}),r.title]}),b.jsx(St,{"data-testid":"remove-banner-button",variant:"text",size:"icon",onClick:()=>n(r.id),children:b.jsx(rc,{className:"w-5 h-5"})})]}),b.jsxs("div",{className:"flex justify-between items-end",children:[b.jsx("span",{children:Da({html:r.description})}),r.action==="restart"&&b.jsx(Bzn,{})]})]},r.id))})},Bzn=()=>{const e=Bit();return b.jsxs(St,{"data-testid":"restart-session-button",variant:"link",size:"sm",onClick:e,children:[b.jsx(OCt,{className:"w-4 h-4 mr-2"}),"Restart"]})},Wzn=e=>{const{packageAlert:t}=n7n(),{clearPackageAlert:n}=uot(),[r]=fR();if(t===null)return null;if(K4n(t))return b.jsx("div",{className:"flex flex-col gap-4 mb-5 fixed top-5 left-5 w-[400px] z-[200] opacity-95",children:b.jsxs(gE,{kind:"danger",className:"flex flex-col rounded py-3 px-5 animate-in slide-in-from-left",children:[b.jsxs("div",{className:"flex justify-between",children:[b.jsxs("span",{className:"font-bold text-lg flex items-center mb-2",children:[b.jsx(RLe,{className:"w-5 h-5 inline-block mr-2"}),"Missing packages"]}),b.jsx(St,{variant:"text","data-testid":"remove-banner-button",size:"icon",onClick:()=>n(t.id),children:b.jsx(rc,{className:"w-5 h-5"})})]}),b.jsxs("div",{className:"flex flex-col gap-4 justify-between items-start text-muted-foreground text-base",children:[b.jsxs("div",{children:[b.jsx("p",{children:"The following packages were not found:"}),b.jsx("ul",{className:"list-disc ml-4 mt-1",children:t.packages.map((i,o)=>b.jsxs("li",{className:"flex items-center gap-1 font-mono text-sm",children:[b.jsx(CLe,{size:"1rem"}),i]},o))})]}),b.jsx("div",{className:"ml-auto flex flex-row items-baseline",children:t.isolated?b.jsxs(b.Fragment,{children:[b.jsx(Hzn,{manager:r.package_management.manager,clearPackageAlert:()=>n(t.id)}),yp()?null:b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"px-2 text-sm",children:"with"})," ",b.jsx(Xzn,{})]})]}):b.jsxs("p",{children:["If you set up a"," ",b.jsx("a",{href:"https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments",className:"text-accent-foreground hover:underline",target:"_blank",rel:"noreferrer",children:"virtual environment"}),", marimo can install these packages for you."]})})]})]})});if(J4n(t)){const{status:i,title:o,titleIcon:s,description:a}=qzn(t.packages);return i==="installed"&&setTimeout(()=>n(t.id),1e4),b.jsx("div",{className:"flex flex-col gap-4 mb-5 fixed top-5 left-5 w-[400px] z-[200] opacity-95",children:b.jsxs(gE,{kind:i==="failed"?"danger":"info",className:"flex flex-col rounded pt-3 pb-4 px-5",children:[b.jsxs("div",{className:"flex justify-between",children:[b.jsxs("span",{className:"font-bold text-lg flex items-center mb-2",children:[s,o]}),b.jsx(St,{variant:"text","data-testid":"remove-banner-button",size:"icon",onClick:()=>n(t.id),children:b.jsx(rc,{className:"w-5 h-5"})})]}),b.jsx("div",{className:be("flex flex-col gap-4 justify-between items-start text-muted-foreground text-base",i==="installed"&&"text-accent-foreground"),children:b.jsxs("div",{children:[b.jsx("p",{children:a}),b.jsx("ul",{className:"list-disc ml-4 mt-1",children:Object.entries(t.packages).map(([l,c],u)=>b.jsxs("li",{className:be("flex items-center gap-1 font-mono text-sm",c==="installing"&&"font-semibold",c==="failed"&&"text-destructive",c==="installed"&&"text-accent-foreground",c==="installed"&&i==="failed"&&"text-muted-foreground"),children:[b.jsx(Vzn,{status:c}),l]},u))})]})})]})})}else return Ld(t),null};function qzn(e){const t=new Set(Object.values(e)),n=t.has("queued")||t.has("installing")?"installing":t.has("failed")?"failed":"installed";return n==="installing"?{status:"installing",title:"Installing packages",titleIcon:b.jsx(doe,{className:"w-5 h-5 inline-block mr-2"}),description:"Installing packages:"}:n==="installed"?{status:"installed",title:"All packages installed!",titleIcon:b.jsx(dCt,{className:"w-5 h-5 inline-block mr-2"}),description:"Installed packages:"}:{status:"failed",title:"Some packages failed to install",titleIcon:b.jsx(RLe,{className:"w-5 h-5 inline-block mr-2"}),description:"See terminal for error logs."}}const Vzn=({status:e})=>{switch(e){case"queued":return b.jsx(CLe,{size:"1rem"});case"installing":return b.jsx(doe,{size:"1rem"});case"installed":return b.jsx(dm,{size:"1rem"});case"failed":return b.jsx(rc,{size:"1rem"});default:return Ld(e),null}};async function Uzn(e,t){t(),Sa.INSTANCE.registerRunStart(),await sSt({manager:e})}const Hzn=({manager:e,clearPackageAlert:t})=>b.jsxs(St,{variant:"outline","data-testid":"install-packages-button",size:"sm",onClick:()=>Uzn(e,t),children:[b.jsx(doe,{className:"w-4 h-4 mr-2"}),b.jsx("span",{className:"font-semibold",children:"Install"})]}),Xzn=()=>{const[e,t]=fR(),n=$8({resolver:T8(Sj),defaultValues:e}),r=async i=>{await noe({config:i}).then(()=>{t(i)})};return b.jsx(dle,{...n,children:b.jsx("form",{onChange:n.handleSubmit(r),className:"flex flex-col gap-5",children:b.jsx("div",{className:"flex flex-col gap-3",children:b.jsx(Zn,{control:n.control,name:"package_management.manager",render:({field:i})=>b.jsxs(wr,{children:[b.jsx(Sr,{children:b.jsx($h,{"data-testid":"install-package-manager-select",onChange:o=>i.onChange(o.target.value),value:i.value,disabled:i.disabled,className:"inline-flex mr-2",children:Fre.map(o=>b.jsx("option",{value:o,children:o},o))})}),b.jsx(yi,{})]})})})})})},Zzn=({notebook:e,mode:t,userConfig:n,appConfig:r,connStatus:i})=>{const{updateCellCode:o,prepareForRun:s,deleteCell:a,moveCell:l,moveToNextCell:c,updateCellConfig:u,clearSerializedEditorState:f,focusCell:d,createNewCell:h,focusBottomCell:p,focusTopCell:g,scrollToTarget:v,foldAll:y,unfoldAll:O,sendToBottom:m,sendToTop:w,setStdinResponse:S}=wp(),{theme:E}=mp(),{togglePanel:C}=EB(),{invisible:k}=Tit(e.cellIds.length,t);tl("global.focusTop",g),tl("global.focusBottom",p),tl("global.toggleSidebar",C),tl("global.foldCode",y),tl("global.unfoldCode",O),tl("global.formatAll",()=>{$rt(o)}),tl("cell.hideCode",Yc.NOOP),tl("cell.format",Yc.NOOP);const P=Jn(M=>{J5e(M.cellId),a(M)});x.useEffect(()=>{e.scrollKey!==null&&v()},[e.cellIds,e.scrollKey,v]);const D=Kze(e);return b.jsxs($it,{className:"pb-[40vh]",invisible:k,appConfig:r,children:[b.jsx(Wzn,{}),b.jsx(Qzn,{}),D.map(M=>b.jsx(zzn,{theme:E,showPlaceholder:D.length===1,allowFocus:!k,id:M.id,code:M.code,output:M.output,consoleOutputs:M.consoleOutputs,status:M.status,updateCellCode:o,prepareForRun:s,edited:M.edited,interrupted:M.interrupted,errored:M.errored,stopped:M.stopped,runStartTimestamp:M.runStartTimestamp,runElapsedTimeMs:M.runElapsedTimeMs,serializedEditorState:M.serializedEditorState,showDeleteButton:D.length>1&&!M.config.hide_code,createNewCell:h,deleteCell:P,focusCell:d,moveToNextCell:c,setStdinResponse:S,updateCellConfig:u,clearSerializedEditorState:f,moveCell:l,mode:t,appClosed:i.state!==vo.OPEN,ref:e.cellHandles[M.id],sendToBottom:m,sendToTop:w,userConfig:n,debuggerActive:M.debuggerActive,config:M.config,name:M.name},M.id.toString()))]})},ost=x.memo(({appConfig:e,mode:t,children:n})=>{const r=s_(),{selectedLayout:i,layoutData:o}=cge(),{setCurrentLayoutData:s}=uge();if(t==="edit")return n;const a=sge.find(f=>f.type===i);if(!a)return n;const l=Kze(r),c=a.Component;return b.jsx(c,{appConfig:e,mode:t,cells:l,layout:o[i]||a.getInitialLayout(l),setLayout:s})});ost.displayName="CellsRenderer";const _Pe=({userConfig:e,appConfig:t})=>{const n=s_(),{setCells:r,updateCellCode:i}=wp(),[o,s]=tc(TL),[a,l]=Qit(),[c,u]=x.useState(),f=cge(),{openModal:d,closeModal:h,openAlert:p}=$m(),g=o.mode==="edit",v=o.mode==="present",y=o.mode==="read",O=f9t(n);function m(){p("Failed to save notebook: not connected to a kernel.")}x.useEffect(()=>(Sa.INSTANCE.start(),()=>{Sa.INSTANCE.stop()}),[]);const{connStatus:w}=o7n({autoInstantiate:e.runtime.auto_instantiate||o.mode==="read",setCells:(U,V)=>{r(U);const H=U.map(se=>se.name),Z=U.map(se=>se.code),ee=U.map(se=>se.config);u({names:H,codes:Z,configs:ee,layout:V})},sessionId:Z5e()}),S=Jn(U=>w.state!==vo.OPEN?(m(),Promise.resolve(null)):Kwt(U).then(()=>(l(U),U)).catch(V=>(p(V.message),null))),E=Yze(n),C=E.map(U=>U.id),k=E.map(U=>U.code),P=E.map(U=>U.name),D=E.map(U=>U.config),M=h9t(n,f,c),L=Jn((U,V)=>{if(k.length!==0&&!y){if(w.state!==vo.OPEN){m();return}At.log("saving to ",U),Jwt({cellIds:C,codes:k,names:P,filename:U,configs:D,layout:fFn()}).then(()=>{V&&(yr({title:"Notebook saved"}),e.save.format_on_save&&$rt(i)),u({names:P,codes:k,configs:D,layout:f})})}}),A=Jn((U=!1)=>{a!==null&&w.state===vo.OPEN&&L(a,U)}),T=Jn(()=>{A(!0),a===null&&w.state!==vo.CLOSED&&d(b.jsx(Jzn,{onClose:h,onSubmitSaveDialog:N}))});a7n({onSave:A,needsSave:M,codes:k,cellConfigs:D,cellNames:P,connStatus:w,config:e}),nD(window,"beforeunload",U=>{if(!Jh()&&M)return U.preventDefault(),U.returnValue="You have unsaved changes. Are you sure you want to quit?"});const N=U=>{const V=new FormData(U.currentTarget).get("SaveDialogInput");if(typeof V!="string"){alert("Filename cannot be empty");return}if(V.length===0||V===".py"){alert("Filename cannot be empty");return}const H=V.endsWith(".py")?V:`${V}.py`;S(H).then(Z=>{Z!==null&&L(Z,!0)})},j=SFn(),z=x.useCallback(()=>{const U=document.getElementsByClassName("output-area"),V=window.innerHeight||document.documentElement.clientHeight;let H=null;for(const Z of Array.from(U)){const ee=Z.getBoundingClientRect();if(ee.top>=0&&ee.top<=V||ee.bottom>=0&&ee.bottom<=V){H=Od.parse(Z.parentNode.id);break}}s(Z=>({mode:mFn(Z.mode),cellAnchor:H})),requestAnimationFrame(()=>{var Z;H!==null&&((Z=document.getElementById(Od.create(H)))==null||Z.scrollIntoView())})},[s]);tl("global.runStale",()=>{j()}),tl("global.save",T),tl("global.interrupt",()=>{XZ()}),tl("global.hideCode",()=>{y||z()});const W=Jn(()=>JSON.stringify({filename:a,cells:E.map(U=>({name:U.name,code:U.code}))},null,2)),F=b.jsx(Zzn,{notebook:n,connStatus:w,mode:o.mode,userConfig:e,appConfig:t}),q=b.jsxs(b.Fragment,{children:[w.state===vo.OPEN&&O&&b.jsx(Gzn,{}),w.state===vo.CLOSED&&b.jsx(Kzn,{}),w.state===vo.CLOSED&&b.jsx(Yzn,{})]});return b.jsxs(b.Fragment,{children:[q,b.jsxs("div",{id:"App",className:be(w.state===vo.CLOSED&&"disconnected","bg-background w-full h-full text-textColor","flex flex-col overflow-y-auto overflow-x-hidden",t.width==="full"&&"config-width-full"),children:[b.jsxs("div",{className:be((g||v)&&"pt-4 sm:pt-12 pb-2 mb-4",y&&"sm:pt-8"),children:[g&&b.jsx("div",{id:"Welcome",children:b.jsx(L4n,{filename:a,setFilename:S})}),w.state===vo.CLOSED&&b.jsx(s7n,{reason:w.reason})]}),E.length>0&&b.jsx(ost,{appConfig:t,mode:o.mode,children:b.jsx(u7n,{disabled:!g,children:F})})]}),(g||v)&&b.jsx(R4n,{filename:a,needsSave:M,onSaveNotebook:T,getCellsAsJSON:W,presenting:v,onTogglePresenting:z,onInterrupt:XZ,onShutdown:nSt,onRun:j,closed:w.state===vo.CLOSED,running:O,needsRun:p9t(n),undoAvailable:n.history.length>0,appWidth:t.width})]})},sst="absolute top-3 left-4 m-0 flex items-center space-x-3 min-h-[28px] no-print pointer-events-auto z-30",Yzn=()=>b.jsx(Wt,{content:"App disconnected",children:b.jsx("div",{className:sst,children:b.jsx(PCt,{className:"closed-app-icon"})})}),Gzn=()=>b.jsx("div",{className:sst,"data-testid":"loading-indicator",title:"Marimo is busy computing. Hang tight!",onClick:d9t,children:b.jsx(KEt,{className:"running-app-icon",size:30,strokeWidth:1})}),Kzn=()=>b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"noise"}),b.jsx("div",{className:"disconnected-gradient"})]}),Jzn=e=>{const{onClose:t,onSubmitSaveDialog:n}=e,r="Cancel";return b.jsx(gm,{className:"w-fit",children:b.jsxs("form",{onSubmit:i=>{i.preventDefault(),n(i),t()},onKeyDown:i=>{var o;i.key==="Escape"?t():i.key==="Enter"&&((o=document.activeElement)==null?void 0:o.ariaLabel)!==r&&(n(i),t())},children:[b.jsx(Ov,{className:"text-accent mb-6",children:"Save?"}),b.jsxs("div",{className:"flex items-center gap-5 mb-6 ml-4 mr-16",children:[b.jsx(Ls,{className:"text-md text-muted-foreground",children:"Save as"}),b.jsx(tot,{name:"SaveDialogInput",className:"missing-filename"})]}),b.jsxs(FR,{children:[b.jsx(St,{"data-testid":"cancel-save-dialog-button","aria-label":r,variant:"secondary",onClick:t,children:"Cancel"}),b.jsx(St,{"data-testid":"submit-save-dialog-button","aria-label":"Save",variant:"default",type:"submit",children:"Save"})]})]})})},ast="ToastProvider",[_ge,e8n,t8n]=jC("Toast"),[lst,RKn]=uo("Toast",[t8n]),[n8n,kB]=lst(ast),cst=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:s}=e,[a,l]=x.useState(null),[c,u]=x.useState(0),f=x.useRef(!1),d=x.useRef(!1);return x.createElement(_ge.Provider,{scope:t},x.createElement(n8n,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:o,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:x.useCallback(()=>u(h=>h+1),[]),onToastRemove:x.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:d},s))};cst.propTypes={label(e){if(e.label&&typeof e.label=="string"&&!e.label.trim()){const t=`Invalid prop \`label\` supplied to \`${ast}\`. Expected non-empty \`string\`.`;return new Error(t)}return null}};const r8n="ToastViewport",i8n=["F8"],xne="toast.viewportPause",wne="toast.viewportResume",o8n=x.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=i8n,label:i="Notifications ({hotkey})",...o}=e,s=kB(r8n,n),a=e8n(n),l=x.useRef(null),c=x.useRef(null),u=x.useRef(null),f=x.useRef(null),d=Yt(t,f,s.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=s.toastCount>0;x.useEffect(()=>{const v=y=>{var O;r.every(w=>y[w]||y.code===w)&&((O=f.current)===null||O===void 0||O.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[r]),x.useEffect(()=>{const v=l.current,y=f.current;if(p&&v&&y){const O=()=>{if(!s.isClosePausedRef.current){const E=new CustomEvent(xne);y.dispatchEvent(E),s.isClosePausedRef.current=!0}},m=()=>{if(s.isClosePausedRef.current){const E=new CustomEvent(wne);y.dispatchEvent(E),s.isClosePausedRef.current=!1}},w=E=>{!v.contains(E.relatedTarget)&&m()},S=()=>{v.contains(document.activeElement)||m()};return v.addEventListener("focusin",O),v.addEventListener("focusout",w),v.addEventListener("pointermove",O),v.addEventListener("pointerleave",S),window.addEventListener("blur",O),window.addEventListener("focus",m),()=>{v.removeEventListener("focusin",O),v.removeEventListener("focusout",w),v.removeEventListener("pointermove",O),v.removeEventListener("pointerleave",S),window.removeEventListener("blur",O),window.removeEventListener("focus",m)}}},[p,s.isClosePausedRef]);const g=x.useCallback(({tabbingDirection:v})=>{const O=a().map(m=>{const w=m.ref.current,S=[w,...x8n(w)];return v==="forwards"?S:S.reverse()});return(v==="forwards"?O.reverse():O).flat()},[a]);return x.useEffect(()=>{const v=f.current;if(v){const y=O=>{const m=O.altKey||O.ctrlKey||O.metaKey;if(O.key==="Tab"&&!m){const k=document.activeElement,P=O.shiftKey;if(O.target===v&&P){var S;(S=c.current)===null||S===void 0||S.focus();return}const L=g({tabbingDirection:P?"backwards":"forwards"}),A=L.findIndex(T=>T===k);if(XH(L.slice(A+1)))O.preventDefault();else{var E,C;P?(E=c.current)===null||E===void 0||E.focus():(C=u.current)===null||C===void 0||C.focus()}}};return v.addEventListener("keydown",y),()=>v.removeEventListener("keydown",y)}},[a,g]),x.createElement(_St,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:p?void 0:"none"}},p&&x.createElement(kPe,{ref:c,onFocusFromOutsideViewport:()=>{const v=g({tabbingDirection:"forwards"});XH(v)}}),x.createElement(_ge.Slot,{scope:n},x.createElement(Ot.ol,oe({tabIndex:-1},o,{ref:d}))),p&&x.createElement(kPe,{ref:u,onFocusFromOutsideViewport:()=>{const v=g({tabbingDirection:"backwards"});XH(v)}}))}),s8n="ToastFocusProxy",kPe=x.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,o=kB(s8n,n);return x.createElement(nz,oe({"aria-hidden":!0,tabIndex:0},i,{ref:t,style:{position:"fixed"},onFocus:s=>{var a;const l=s.relatedTarget;!((a=o.viewport)!==null&&a!==void 0&&a.contains(l))&&r()}}))}),$B="Toast",a8n="toast.swipeStart",l8n="toast.swipeMove",c8n="toast.swipeCancel",u8n="toast.swipeEnd",f8n=x.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:o,...s}=e,[a=!0,l]=ko({prop:r,defaultProp:i,onChange:o});return x.createElement(Gs,{present:n||a},x.createElement(ust,oe({open:a},s,{ref:t,onClose:()=>l(!1),onPause:Xs(e.onPause),onResume:Xs(e.onResume),onSwipeStart:Xe(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Xe(e.onSwipeMove,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Xe(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Xe(e.onSwipeEnd,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})))}),[d8n,h8n]=lst($B,{onClose(){}}),ust=x.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:o,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...p}=e,g=kB($B,n),[v,y]=x.useState(null),O=Yt(t,T=>y(T)),m=x.useRef(null),w=x.useRef(null),S=i||g.duration,E=x.useRef(0),C=x.useRef(S),k=x.useRef(0),{onToastAdd:P,onToastRemove:D}=g,M=Xs(()=>{var T;(v==null?void 0:v.contains(document.activeElement))&&((T=g.viewport)===null||T===void 0||T.focus()),s()}),L=x.useCallback(T=>{!T||T===1/0||(window.clearTimeout(k.current),E.current=new Date().getTime(),k.current=window.setTimeout(M,T))},[M]);x.useEffect(()=>{const T=g.viewport;if(T){const N=()=>{L(C.current),c==null||c()},j=()=>{const z=new Date().getTime()-E.current;C.current=C.current-z,window.clearTimeout(k.current),l==null||l()};return T.addEventListener(xne,j),T.addEventListener(wne,N),()=>{T.removeEventListener(xne,j),T.removeEventListener(wne,N)}}},[g.viewport,S,l,c,L]),x.useEffect(()=>{o&&!g.isClosePausedRef.current&&L(S)},[o,S,g.isClosePausedRef,L]),x.useEffect(()=>(P(),()=>D()),[P,D]);const A=x.useMemo(()=>v?pst(v):null,[v]);return g.viewport?x.createElement(x.Fragment,null,A&&x.createElement(p8n,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0},A),x.createElement(d8n,{scope:n,onClose:M},as.createPortal(x.createElement(_ge.ItemSlot,{scope:n},x.createElement(CSt,{asChild:!0,onEscapeKeyDown:Xe(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||M(),g.isFocusedToastEscapeKeyDownRef.current=!1})},x.createElement(Ot.li,oe({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":g.swipeDirection},p,{ref:O,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Xe(e.onKeyDown,T=>{T.key==="Escape"&&(a==null||a(T.nativeEvent),T.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,M()))}),onPointerDown:Xe(e.onPointerDown,T=>{T.button===0&&(m.current={x:T.clientX,y:T.clientY})}),onPointerMove:Xe(e.onPointerMove,T=>{if(!m.current)return;const N=T.clientX-m.current.x,j=T.clientY-m.current.y,z=!!w.current,W=["left","right"].includes(g.swipeDirection),F=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,q=W?F(0,N):0,U=W?0:F(0,j),V=T.pointerType==="touch"?10:2,H={x:q,y:U},Z={originalEvent:T,delta:H};z?(w.current=H,XI(l8n,f,Z,{discrete:!1})):$Pe(H,g.swipeDirection,V)?(w.current=H,XI(a8n,u,Z,{discrete:!1}),T.target.setPointerCapture(T.pointerId)):(Math.abs(N)>V||Math.abs(j)>V)&&(m.current=null)}),onPointerUp:Xe(e.onPointerUp,T=>{const N=w.current,j=T.target;if(j.hasPointerCapture(T.pointerId)&&j.releasePointerCapture(T.pointerId),w.current=null,m.current=null,N){const z=T.currentTarget,W={originalEvent:T,delta:N};$Pe(N,g.swipeDirection,g.swipeThreshold)?XI(u8n,h,W,{discrete:!0}):XI(c8n,d,W,{discrete:!0}),z.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})))),g.viewport))):null});ust.propTypes={type(e){if(e.type&&!["foreground","background"].includes(e.type)){const t=`Invalid prop \`type\` supplied to \`${$B}\`. Expected \`foreground | background\`.`;return new Error(t)}return null}};const p8n=e=>{const{__scopeToast:t,children:n,...r}=e,i=kB($B,t),[o,s]=x.useState(!1),[a,l]=x.useState(!1);return b8n(()=>s(!0)),x.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:x.createElement(VC,{asChild:!0},x.createElement(nz,r,o&&x.createElement(x.Fragment,null,i.label," ",n)))},g8n=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return x.createElement(Ot.div,oe({},r,{ref:t}))}),m8n=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return x.createElement(Ot.div,oe({},r,{ref:t}))}),y8n="ToastAction",fst=x.forwardRef((e,t)=>{const{altText:n,...r}=e;return n?x.createElement(hst,{altText:n,asChild:!0},x.createElement(dst,oe({},r,{ref:t}))):null});fst.propTypes={altText(e){return e.altText?null:new Error(`Missing prop \`altText\` expected on \`${y8n}\``)}};const v8n="ToastClose",dst=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=h8n(v8n,n);return x.createElement(hst,{asChild:!0},x.createElement(Ot.button,oe({type:"button"},r,{ref:t,onClick:Xe(e.onClick,i.onClose)})))}),hst=x.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return x.createElement(Ot.div,oe({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0},i,{ref:t}))});function pst(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),O8n(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...pst(r))}}),t}function XI(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Kre(i,o):i.dispatchEvent(o)}const $Pe=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),o=r>i;return t==="left"||t==="right"?o&&r>n:!o&&i>n};function b8n(e=()=>{}){const t=Xs(e);Qa(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function O8n(e){return e.nodeType===e.ELEMENT_NODE}function x8n(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function XH(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}const w8n=cst,gst=o8n,mst=f8n,yst=g8n,vst=m8n,bst=fst,Ost=dst,S8n=w8n,xst=x.forwardRef(({className:e,...t},n)=>b.jsx(gst,{ref:n,className:be("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));xst.displayName=gst.displayName;const E8n=Ao("data-[swipe=move]:transition-none group relative pointer-events-auto flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full data-[state=closed]:slide-out-to-right-full",{variants:{variant:{default:"bg-background border",danger:"group destructive text-error border-destructive bg-[var(--red-1)] shadow-smError"}},defaultVariants:{variant:"default"}}),wst=x.forwardRef(({className:e,variant:t,...n},r)=>b.jsx(mst,{ref:r,className:be(E8n({variant:t}),e),...n}));wst.displayName=mst.displayName;const C8n=x.forwardRef(({className:e,...t},n)=>b.jsx(bst,{ref:n,className:be("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-destructive/30 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));C8n.displayName=bst.displayName;const Sst=x.forwardRef(({className:e,...t},n)=>b.jsx(Ost,{ref:n,className:be("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-500 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:b.jsx(rc,{className:"h-4 w-4"})}));Sst.displayName=Ost.displayName;const Est=x.forwardRef(({className:e,...t},n)=>b.jsx(yst,{ref:n,className:be("text-sm font-semibold",e),...t}));Est.displayName=yst.displayName;const Cst=x.forwardRef(({className:e,...t},n)=>b.jsx(vst,{ref:n,className:be("text-sm opacity-90",e),...t}));Cst.displayName=vst.displayName;const TPe=()=>{const{toasts:e}=Uwt();return b.jsxs(S8n,{children:[e.map(function({id:t,title:n,description:r,action:i,...o}){return b.jsxs(wst,{...o,children:[b.jsxs("div",{className:"grid gap-1",children:[n&&b.jsx(Est,{children:n}),r&&b.jsx(Cst,{children:r})]}),i,b.jsx(Sst,{})]},t)}),b.jsx(xst,{})]})};var to=function(){return to=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},to.apply(this,arguments)};var _st={exports:{}},a$={};/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var PPe;function _8n(){if(PPe)return a$;PPe=1;var e=ie,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},d=null,h=null;c!==void 0&&(d=""+c),l.key!==void 0&&(d=""+l.key),l.ref!==void 0&&(h=l.ref);for(u in l)r.call(l,u)&&!o.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:d,ref:h,props:f,_owner:i.current}}return a$.Fragment=n,a$.jsx=s,a$.jsxs=s,a$}_st.exports=_8n();var kst=_st.exports;function k8n(e){return e.mode==="multiple"}function $8n(e){return e.mode==="range"}function T8n(e){return e.mode==="single"}var P8n={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function A8n(e,t){return GO(e,"LLLL y",t)}function R8n(e,t){return GO(e,"d",t)}function D8n(e,t){return GO(e,"LLLL",t)}function M8n(e){return"".concat(e)}function N8n(e,t){return GO(e,"cccccc",t)}function I8n(e,t){return GO(e,"yyyy",t)}var L8n=Object.freeze({__proto__:null,formatCaption:A8n,formatDay:R8n,formatMonthCaption:D8n,formatWeekNumber:M8n,formatWeekdayName:N8n,formatYearCaption:I8n}),j8n=function(e,t,n){return GO(e,"do MMMM (EEEE)",n)},F8n=function(){return"Month: "},z8n=function(){return"Go to next month"},Q8n=function(){return"Go to previous month"},B8n=function(e,t){return GO(e,"cccc",t)},W8n=function(e){return"Week n. ".concat(e)},q8n=function(){return"Year: "},V8n=Object.freeze({__proto__:null,labelDay:j8n,labelMonthDropdown:F8n,labelNext:z8n,labelPrevious:Q8n,labelWeekNumber:W8n,labelWeekday:B8n,labelYearDropdown:q8n});function U8n(){var e="buttons",t=P8n,n=fze,r={},i={},o=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:L8n,labels:V8n,locale:n,modifiersClassNames:r,modifiers:i,numberOfMonths:o,styles:s,today:a,mode:"default"}}function H8n(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,o=e.fromDate,s=e.toDate;return r?o=H6t(r):t&&(o=new Date(t,0,1)),i?s=U6t(i):n&&(s=new Date(n,11,31)),{fromDate:o?v3(o):void 0,toDate:s?v3(s):void 0}}var $st=x.createContext(void 0);function X8n(e){var t,n=e.initialProps,r=U8n(),i=H8n(n),o=i.fromDate,s=i.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!o||!s)&&(a="buttons");var l;(T8n(n)||k8n(n)||$8n(n))&&(l=n.onSelect);var c=to(to(to({},r),n),{captionLayout:a,classNames:to(to({},r.classNames),n.classNames),components:to({},n.components),formatters:to(to({},r.formatters),n.formatters),fromDate:o,labels:to(to({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:to(to({},r.modifiers),n.modifiers),modifiersClassNames:to(to({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:to(to({},r.styles),n.styles),toDate:s});return kst.jsx($st.Provider,{value:c,children:e.children})}function Z8n(){var e=x.useContext($st);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}x.createContext(void 0);x.forwardRef(function(e,t){var n=Z8n(),r=n.classNames,i=n.styles,o=[r.button_reset,r.button];e.className&&o.push(e.className);var s=o.join(" "),a=to(to({},i.button_reset),i.button);return e.style&&Object.assign(a,e.style),kst.jsx("button",to({},e,{ref:t,type:"button",className:s,style:a}))});x.createContext(void 0);x.createContext(void 0);var gp;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(gp||(gp={}));gp.Selected;gp.Disabled;gp.Hidden;gp.Today;gp.RangeEnd;gp.RangeMiddle;gp.RangeStart;gp.Outside;x.createContext(void 0);x.createContext(void 0);x.createContext(void 0);const{createElement:TC,createContext:Y8n,createRef:DKn,forwardRef:Tst,useCallback:Ec,useContext:Pst,useEffect:xb,useImperativeHandle:Ast,useLayoutEffect:G8n,useMemo:K8n,useRef:Ml,useState:h2}=YS,APe=YS.useId,J8n=G8n,TB=Y8n(null);TB.displayName="PanelGroupContext";const wb=J8n,e9n=typeof APe=="function"?APe:()=>null;let t9n=0;function kge(e=null){const t=e9n(),n=Ml(e||t||null);return n.current===null&&(n.current=""+t9n++),e??n.current}function Rst({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:f,order:d,style:h,tagName:p="div",...g}){const v=Pst(TB);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:O,getPanelSize:m,getPanelStyle:w,groupId:S,isPanelCollapsed:E,reevaluatePanelConstraints:C,registerPanel:k,resizePanel:P,unregisterPanel:D}=v,M=kge(s),L=Ml({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:M,idIsFromProps:s!==void 0,order:d});Ml({didLogMissingDefaultSizeWarning:!1}),wb(()=>{const{callbacks:T,constraints:N}=L.current,j={...N};L.current.id=M,L.current.idIsFromProps=s!==void 0,L.current.order=d,T.onCollapse=c,T.onExpand=u,T.onResize=f,N.collapsedSize=n,N.collapsible=r,N.defaultSize=i,N.maxSize=a,N.minSize=l,(j.collapsedSize!==N.collapsedSize||j.collapsible!==N.collapsible||j.maxSize!==N.maxSize||j.minSize!==N.minSize)&&C(L.current,j)}),wb(()=>{const T=L.current;return k(T),()=>{D(T)}},[d,M,k,D]),Ast(o,()=>({collapse:()=>{y(L.current)},expand:()=>{O(L.current)},getId(){return M},getSize(){return m(L.current)},isCollapsed(){return E(L.current)},isExpanded(){return!E(L.current)},resize:T=>{P(L.current,T)}}),[y,O,m,E,M,P]);const A=w(L.current,i);return TC(p,{...g,children:e,className:t,id:s,style:{...A,...h},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":S,"data-panel-id":M,"data-panel-size":parseFloat(""+A.flexGrow).toFixed(1)})}const Sne=Tst((e,t)=>TC(Rst,{...e,forwardedRef:t}));Rst.displayName="Panel";Sne.displayName="forwardRef(Panel)";let Ene=null,G1=null;function n9n(e,t){if(t){const n=(t&Lst)!==0,r=(t&jst)!==0,i=(t&Fst)!==0,o=(t&zst)!==0;if(n)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function r9n(){G1!==null&&(document.head.removeChild(G1),Ene=null,G1=null)}function ZH(e,t){const n=n9n(e,t);Ene!==n&&(Ene=n,G1===null&&(G1=document.createElement("style"),document.head.appendChild(G1)),G1.innerHTML=`*{cursor: ${n}!important;}`)}function Dst(e){return e.type==="keydown"}function Mst(e){return e.type.startsWith("mouse")}function Nst(e){return e.type.startsWith("touch")}function PB(e){if(Mst(e))return{x:e.clientX,y:e.clientY};if(Nst(e)){const t=e.touches[0];if(t&&t.clientX&&t.clientY)return{x:t.clientX,y:t.clientY}}return{x:1/0,y:1/0}}function i9n(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function o9n(e,t,n){return n?e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y:e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function s9n(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:MPe(e),b:MPe(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Sn(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:DPe(RPe(n.a)),b:DPe(RPe(n.b))};if(i.a===i.b){const o=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let a=o.length;for(;a--;){const l=o[a];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(i.a-i.b)}const a9n=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function l9n(e){var t;const n=getComputedStyle((t=Ist(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function c9n(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||l9n(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||a9n.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function RPe(e){let t=e.length;for(;t--;){const n=e[t];if(Sn(n,"Missing node"),c9n(n))return n}return null}function DPe(e){return e&&Number(getComputedStyle(e).zIndex)||0}function MPe(e){const t=[];for(;e;)t.push(e),e=Ist(e);return t}function Ist(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const Lst=1,jst=2,Fst=4,zst=8,u9n=i9n()==="coarse";let lv=[],AB=!1,vy=new Map,RB=new Map;const GA=new Set;function f9n(e,t,n,r,i){var o;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},l=(o=vy.get(s))!==null&&o!==void 0?o:0;return vy.set(s,l+1),GA.add(a),C7(),function(){var u;RB.delete(e),GA.delete(a);const f=(u=vy.get(s))!==null&&u!==void 0?u:1;vy.set(s,f-1),C7(),f===1&&vy.delete(s)}}function ZI(e){const{target:t}=e,{x:n,y:r}=PB(e);AB=!0,$ge({target:t,x:n,y:r}),C7(),lv.length>0&&(Tge("down",e),e.preventDefault())}function Wm(e){const{x:t,y:n}=PB(e);if(!AB){const{target:r}=e;$ge({target:r,x:t,y:n})}Tge("move",e),Qst(),lv.length>0&&e.preventDefault()}function qm(e){const{target:t}=e,{x:n,y:r}=PB(e);RB.clear(),AB=!1,lv.length>0&&e.preventDefault(),Tge("up",e),$ge({target:t,x:n,y:r}),Qst(),C7()}function $ge({target:e,x:t,y:n}){lv.splice(0);let r=null;e instanceof HTMLElement&&(r=e),GA.forEach(i=>{const{element:o,hitAreaMargins:s}=i,a=o.getBoundingClientRect(),{bottom:l,left:c,right:u,top:f}=a,d=u9n?s.coarse:s.fine;if(t>=c-d&&t<=u+d&&n>=f-d&&n<=l+d){if(r!==null&&o!==r&&!o.contains(r)&&!r.contains(o)&&s9n(r,o)>0){let p=r,g=!1;for(;p&&!p.contains(o);){if(o9n(p.getBoundingClientRect(),a,!0)){g=!0;break}p=p.parentElement}if(g)return}lv.push(i)}})}function YH(e,t){RB.set(e,t)}function Qst(){let e=!1,t=!1;lv.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:t=!0});let n=0;RB.forEach(r=>{n|=r}),e&&t?ZH("intersection",n):e?ZH("horizontal",n):t?ZH("vertical",n):r9n()}function C7(){vy.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",qm),n.removeEventListener("mousedown",ZI),n.removeEventListener("mouseleave",Wm),n.removeEventListener("mousemove",Wm),n.removeEventListener("touchmove",Wm),n.removeEventListener("touchstart",ZI)}),window.removeEventListener("mouseup",qm),window.removeEventListener("touchcancel",qm),window.removeEventListener("touchend",qm),GA.size>0&&(AB?(lv.length>0&&vy.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",qm),n.addEventListener("mouseleave",Wm),n.addEventListener("mousemove",Wm),n.addEventListener("touchmove",Wm,{passive:!1}))}),window.addEventListener("mouseup",qm),window.addEventListener("touchcancel",qm),window.addEventListener("touchend",qm)):vy.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("mousedown",ZI),n.addEventListener("mousemove",Wm),n.addEventListener("touchmove",Wm,{passive:!1}),n.addEventListener("touchstart",ZI))}))}function Tge(e,t){GA.forEach(n=>{const{setResizeHandlerState:r}=n,i=lv.includes(n);r(e,i,t)})}function Sn(e,t){if(!e)throw console.error(t),Error(t)}const Pge=10;function LO(e,t,n=Pge){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function dg(e,t,n=Pge){return LO(e,t,n)===0}function Ac(e,t,n){return LO(e,t,n)===0}function d9n(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const i=e[r],o=t[r];if(!Ac(i,o,n))return!1}return!0}function iS({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];Sn(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:o,maxSize:s=100,minSize:a=0}=r;if(LO(n,a)<0)if(o){const l=(i+a)/2;LO(n,l)<0?n=i:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(Pge)),n}function lT({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:o}){if(Ac(e,0))return t;const s=[...t],[a,l]=r;Sn(a!=null,"Invalid first pivot index"),Sn(l!=null,"Invalid second pivot index");let c=0;if(o==="keyboard"){{const f=e<0?l:a,d=n[f];Sn(d,`Panel constraints not found for index ${f}`);const{collapsedSize:h=0,collapsible:p,minSize:g=0}=d;if(p){const v=t[f];if(Sn(v!=null,`Previous layout not found for panel index ${f}`),Ac(v,h)){const y=g-v;LO(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}{const f=e<0?a:l,d=n[f];Sn(d,`No panel constraints found for index ${f}`);const{collapsedSize:h=0,collapsible:p,minSize:g=0}=d;if(p){const v=t[f];if(Sn(v!=null,`Previous layout not found for panel index ${f}`),Ac(v,g)){const y=v-h;LO(y,Math.abs(e))>0&&(e=e<0?0-y:y)}}}}{const f=e<0?1:-1;let d=e<0?l:a,h=0;for(;;){const g=t[d];Sn(g!=null,`Previous layout not found for panel index ${d}`);const y=iS({panelConstraints:n,panelIndex:d,size:100})-g;if(h+=y,d+=f,d<0||d>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-p:p}{let d=e<0?a:l;for(;d>=0&&d<n.length;){const h=Math.abs(e)-Math.abs(c),p=t[d];Sn(p!=null,`Previous layout not found for panel index ${d}`);const g=p-h,v=iS({panelConstraints:n,panelIndex:d,size:g});if(!Ac(p,v)&&(c+=p-v,s[d]=v,c.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?d--:d++}}if(d9n(i,s))return i;{const f=e<0?l:a,d=t[f];Sn(d!=null,`Previous layout not found for panel index ${f}`);const h=d+c,p=iS({panelConstraints:n,panelIndex:f,size:h});if(s[f]=p,!Ac(p,h)){let g=h-p,y=e<0?l:a;for(;y>=0&&y<n.length;){const O=s[y];Sn(O!=null,`Previous layout not found for panel index ${y}`);const m=O+g,w=iS({panelConstraints:n,panelIndex:y,size:m});if(Ac(O,w)||(g-=w-O,s[y]=w),Ac(g,0))break;e>0?y--:y++}}}const u=s.reduce((f,d)=>d+f,0);return Ac(u,100)?s:i}function h9n({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,o=0,s=0;const a=n[0];Sn(a!=null,"No pivot index found"),t.forEach((f,d)=>{const{constraints:h}=f,{maxSize:p=100,minSize:g=0}=h;d===a?(r=g,i=p):(o+=g,s+=p)});const l=Math.min(i,100-o),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function KA(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function Bst(e,t,n=document){const i=KA(e,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return i??null}function Wst(e,t,n){const r=Bst(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function qst(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function DB(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function p9n(e,t,n,r=document){var i,o,s,a;const l=DB(t,r),c=KA(e,r),u=l?c.indexOf(l):-1,f=(i=(o=n[u])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,d=(s=(a=n[u+1])===null||a===void 0?void 0:a.id)!==null&&s!==void 0?s:null;return[f,d]}function g9n({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:s}){Ml({didWarnAboutMissingResizeHandle:!1}),wb(()=>{if(!o)return;const a=KA(n,o);for(let l=0;l<i.length-1;l++){const{valueMax:c,valueMin:u,valueNow:f}=h9n({layout:r,panelsArray:i,pivotIndices:[l,l+1]}),d=a[l];if(d!=null){const h=i[l];Sn(h,`No panel data found for index "${l}"`),d.setAttribute("aria-controls",h.id),d.setAttribute("aria-valuemax",""+Math.round(c)),d.setAttribute("aria-valuemin",""+Math.round(u)),d.setAttribute("aria-valuenow",f!=null?""+Math.round(f):"")}}return()=>{a.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,i,o]),xb(()=>{if(!o)return;const a=t.current;Sn(a,"Eager values not found");const{panelDataArray:l}=a,c=qst(n,o);Sn(c!=null,`No group found for id "${n}"`);const u=KA(n,o);Sn(u,`No resize handles found for group id "${n}"`);const f=u.map(d=>{const h=d.getAttribute("data-panel-resize-handle-id");Sn(h,"Resize handle element has no handle id attribute");const[p,g]=p9n(n,h,l,o);if(p==null||g==null)return()=>{};const v=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const O=l.findIndex(m=>m.id===p);if(O>=0){const m=l[O];Sn(m,`No panel data found for index ${O}`);const w=r[O],{collapsedSize:S=0,collapsible:E,minSize:C=0}=m.constraints;if(w!=null&&E){const k=lT({delta:Ac(w,S)?C-S:S-w,initialLayout:r,panelConstraints:l.map(P=>P.constraints),pivotIndices:Wst(n,h,o),prevLayout:r,trigger:"keyboard"});r!==k&&s(k)}}break}}};return d.addEventListener("keydown",v),()=>{d.removeEventListener("keydown",v)}});return()=>{f.forEach(d=>d())}},[o,e,t,n,r,i,s])}function NPe(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Vst(e,t){const n=e==="horizontal",{x:r,y:i}=PB(t);return n?r:i}function m9n(e,t,n,r,i){const o=n==="horizontal",s=DB(t,i);Sn(s,`No resize handle element found for id "${t}"`);const a=s.getAttribute("data-panel-group-id");Sn(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=Vst(n,e),u=qst(a,i);Sn(u,`No group element found for id "${a}"`);const f=u.getBoundingClientRect(),d=o?f.width:f.height;return(c-l)/d*100}function y9n(e,t,n,r,i,o){if(Dst(e)){const s=n==="horizontal";let a=0;e.shiftKey?a=100:i!=null?a=i:a=10;let l=0;switch(e.key){case"ArrowDown":l=s?0:a;break;case"ArrowLeft":l=s?-a:0;break;case"ArrowRight":l=s?a:0;break;case"ArrowUp":l=s?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:m9n(e,t,n,r,o)}function v9n({panelDataArray:e}){const t=Array(e.length),n=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const s=n[o];Sn(s,`Panel constraints not found for index ${o}`);const{defaultSize:a}=s;a!=null&&(r++,t[o]=a,i-=a)}for(let o=0;o<e.length;o++){const s=n[o];Sn(s,`Panel constraints not found for index ${o}`);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=i/l;r++,t[o]=c,i-=c}return t}function lw(e,t,n){t.forEach((r,i)=>{const o=e[i];Sn(o,`Panel data not found for index ${i}`);const{callbacks:s,constraints:a,id:l}=o,{collapsedSize:c=0,collapsible:u}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:d,onExpand:h,onResize:p}=s;p&&p(r,f),u&&(d||h)&&(h&&(f==null||dg(f,c))&&!dg(r,c)&&h(),d&&(f==null||!dg(f,c))&&dg(r,c)&&d())}})}function YI(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function b9n({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:o=3}){const s=n[i];let a;return s==null?a=e!=null?e.toFixed(o):"1":r.length===1?a="1":a=s.toFixed(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function O9n(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function IPe(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function Ust(e){return`react-resizable-panels:${e}`}function Hst(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=t;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function Xst(e,t){try{const n=Ust(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function x9n(e,t,n){var r,i;const o=(r=Xst(e,n))!==null&&r!==void 0?r:{},s=Hst(t);return(i=o[s])!==null&&i!==void 0?i:null}function w9n(e,t,n,r,i){var o;const s=Ust(e),a=Hst(t),l=(o=Xst(e,i))!==null&&o!==void 0?o:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function LPe({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((o,s)=>o+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!Ac(r,100))for(let o=0;o<t.length;o++){const s=n[o];Sn(s!=null,`No layout data found for index ${o}`);const a=100/r*s;n[o]=a}let i=0;for(let o=0;o<t.length;o++){const s=n[o];Sn(s!=null,`No layout data found for index ${o}`);const a=iS({panelConstraints:t,panelIndex:o,size:s});s!=a&&(i+=s-a,n[o]=a)}if(!Ac(i,0))for(let o=0;o<t.length;o++){const s=n[o];Sn(s!=null,`No layout data found for index ${o}`);const a=s+i,l=iS({panelConstraints:t,panelIndex:o,size:a});if(s!==l&&(i-=l-s,n[o]=l,Ac(i,0)))break}return n}const S9n=100,cT={getItem:e=>(IPe(cT),cT.getItem(e)),setItem:(e,t)=>{IPe(cT),cT.setItem(e,t)}},jPe={};function Zst({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=cT,style:c,tagName:u="div",...f}){const d=kge(o),h=Ml(null),[p,g]=h2(null),[v,y]=h2([]),O=Ml({}),m=Ml(new Map),w=Ml(0),S=Ml({autoSaveId:e,direction:r,dragState:p,id:d,keyboardResizeBy:a,onLayout:s,storage:l}),E=Ml({layout:v,panelDataArray:[],panelDataArrayChanged:!1});Ml({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),Ast(i,()=>({getId:()=>S.current.id,getLayout:()=>{const{layout:V}=E.current;return V},setLayout:V=>{const{onLayout:H}=S.current,{layout:Z,panelDataArray:ee}=E.current,se=LPe({layout:V,panelConstraints:ee.map(fe=>fe.constraints)});NPe(Z,se)||(y(se),E.current.layout=se,H&&H(se),lw(ee,se,O.current))}}),[]),wb(()=>{S.current.autoSaveId=e,S.current.direction=r,S.current.dragState=p,S.current.id=d,S.current.onLayout=s,S.current.storage=l}),g9n({committedValuesRef:S,eagerValuesRef:E,groupId:d,layout:v,panelDataArray:E.current.panelDataArray,setLayout:y,panelGroupElement:h.current}),xb(()=>{const{panelDataArray:V}=E.current;if(e){if(v.length===0||v.length!==V.length)return;let H=jPe[e];H==null&&(H=O9n(w9n,S9n),jPe[e]=H);const Z=[...V],ee=new Map(m.current);H(e,Z,ee,v,l)}},[e,v,l]),xb(()=>{});const C=Ec(V=>{const{onLayout:H}=S.current,{layout:Z,panelDataArray:ee}=E.current;if(V.constraints.collapsible){const se=ee.map(de=>de.constraints),{collapsedSize:fe=0,panelSize:ce,pivotIndices:ae}=a1(ee,V,Z);if(Sn(ce!=null,`Panel size not found for panel "${V.id}"`),!dg(ce,fe)){m.current.set(V.id,ce);const me=Tw(ee,V)===ee.length-1?ce-fe:fe-ce,te=lT({delta:me,initialLayout:Z,panelConstraints:se,pivotIndices:ae,prevLayout:Z,trigger:"imperative-api"});YI(Z,te)||(y(te),E.current.layout=te,H&&H(te),lw(ee,te,O.current))}}},[]),k=Ec(V=>{const{onLayout:H}=S.current,{layout:Z,panelDataArray:ee}=E.current;if(V.constraints.collapsible){const se=ee.map(me=>me.constraints),{collapsedSize:fe=0,panelSize:ce=0,minSize:ae=0,pivotIndices:de}=a1(ee,V,Z);if(dg(ce,fe)){const me=m.current.get(V.id),te=me!=null&&me>=ae?me:ae,we=Tw(ee,V)===ee.length-1?ce-te:te-ce,ke=lT({delta:we,initialLayout:Z,panelConstraints:se,pivotIndices:de,prevLayout:Z,trigger:"imperative-api"});YI(Z,ke)||(y(ke),E.current.layout=ke,H&&H(ke),lw(ee,ke,O.current))}}},[]),P=Ec(V=>{const{layout:H,panelDataArray:Z}=E.current,{panelSize:ee}=a1(Z,V,H);return Sn(ee!=null,`Panel size not found for panel "${V.id}"`),ee},[]),D=Ec((V,H)=>{const{panelDataArray:Z}=E.current,ee=Tw(Z,V);return b9n({defaultSize:H,dragState:p,layout:v,panelData:Z,panelIndex:ee})},[p,v]),M=Ec(V=>{const{layout:H,panelDataArray:Z}=E.current,{collapsedSize:ee=0,collapsible:se,panelSize:fe}=a1(Z,V,H);return Sn(fe!=null,`Panel size not found for panel "${V.id}"`),se===!0&&dg(fe,ee)},[]),L=Ec(V=>{const{layout:H,panelDataArray:Z}=E.current,{collapsedSize:ee=0,collapsible:se,panelSize:fe}=a1(Z,V,H);return Sn(fe!=null,`Panel size not found for panel "${V.id}"`),!se||LO(fe,ee)>0},[]),A=Ec(V=>{const{panelDataArray:H}=E.current;H.push(V),H.sort((Z,ee)=>{const se=Z.order,fe=ee.order;return se==null&&fe==null?0:se==null?-1:fe==null?1:se-fe}),E.current.panelDataArrayChanged=!0},[]);wb(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:V,onLayout:H,storage:Z}=S.current,{layout:ee,panelDataArray:se}=E.current;let fe=null;if(V){const ae=x9n(V,se,Z);ae&&(m.current=new Map(Object.entries(ae.expandToSizes)),fe=ae.layout)}fe==null&&(fe=v9n({panelDataArray:se}));const ce=LPe({layout:fe,panelConstraints:se.map(ae=>ae.constraints)});NPe(ee,ce)||(y(ce),E.current.layout=ce,H&&H(ce),lw(se,ce,O.current))}}),wb(()=>{const V=E.current;return()=>{V.layout=[]}},[]);const T=Ec(V=>function(Z){Z.preventDefault();const ee=h.current;if(!ee)return()=>null;const{direction:se,dragState:fe,id:ce,keyboardResizeBy:ae,onLayout:de}=S.current,{layout:me,panelDataArray:te}=E.current,{initialLayout:Ee}=fe??{},we=Wst(ce,V,ee);let ke=y9n(Z,V,se,fe,ae,ee);if(ke===0)return;const je=se==="horizontal";document.dir==="rtl"&&je&&(ke=-ke);const nt=te.map(le=>le.constraints),Re=lT({delta:ke,initialLayout:Ee??me,panelConstraints:nt,pivotIndices:we,prevLayout:me,trigger:Dst(Z)?"keyboard":"mouse-or-touch"}),G=!YI(me,Re);(Mst(Z)||Nst(Z))&&w.current!=ke&&(w.current=ke,G?YH(V,0):je?YH(V,ke<0?Lst:jst):YH(V,ke<0?Fst:zst)),G&&(y(Re),E.current.layout=Re,de&&de(Re),lw(te,Re,O.current))},[]),N=Ec((V,H)=>{const{onLayout:Z}=S.current,{layout:ee,panelDataArray:se}=E.current,fe=se.map(Ee=>Ee.constraints),{panelSize:ce,pivotIndices:ae}=a1(se,V,ee);Sn(ce!=null,`Panel size not found for panel "${V.id}"`);const me=Tw(se,V)===se.length-1?ce-H:H-ce,te=lT({delta:me,initialLayout:ee,panelConstraints:fe,pivotIndices:ae,prevLayout:ee,trigger:"imperative-api"});YI(ee,te)||(y(te),E.current.layout=te,Z&&Z(te),lw(se,te,O.current))},[]),j=Ec((V,H)=>{const{layout:Z,panelDataArray:ee}=E.current,{collapsedSize:se=0,collapsible:fe}=H,{collapsedSize:ce=0,collapsible:ae,maxSize:de=100,minSize:me=0}=V.constraints,{panelSize:te}=a1(ee,V,Z);te!=null&&(fe&&ae&&dg(te,se)?dg(se,ce)||N(V,ce):te<me?N(V,me):te>de&&N(V,de))},[N]),z=Ec((V,H)=>{const{direction:Z}=S.current,{layout:ee}=E.current;if(!h.current)return;const se=DB(V,h.current);Sn(se,`Drag handle element not found for id "${V}"`);const fe=Vst(Z,H);g({dragHandleId:V,dragHandleRect:se.getBoundingClientRect(),initialCursorPosition:fe,initialLayout:ee})},[]),W=Ec(()=>{g(null)},[]),F=Ec(V=>{const{panelDataArray:H}=E.current,Z=Tw(H,V);Z>=0&&(H.splice(Z,1),delete O.current[V.id],E.current.panelDataArrayChanged=!0)},[]),q=K8n(()=>({collapsePanel:C,direction:r,dragState:p,expandPanel:k,getPanelSize:P,getPanelStyle:D,groupId:d,isPanelCollapsed:M,isPanelExpanded:L,reevaluatePanelConstraints:j,registerPanel:A,registerResizeHandle:T,resizePanel:N,startDragging:z,stopDragging:W,unregisterPanel:F,panelGroupElement:h.current}),[C,p,r,k,P,D,d,M,L,j,A,T,N,z,W,F]),U={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return TC(TB.Provider,{value:q},TC(u,{...f,children:t,className:n,id:o,ref:h,style:{...U,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":d}))}const Yst=Tst((e,t)=>TC(Zst,{...e,forwardedRef:t}));Zst.displayName="PanelGroup";Yst.displayName="forwardRef(PanelGroup)";function Tw(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function a1(e,t,n){const r=Tw(e,t),o=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:o}}function E9n({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){xb(()=>{if(e||n==null||r==null)return;const i=DB(t,r);if(i==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const a=i.getAttribute("data-panel-group-id");Sn(a,`No group element found for id "${a}"`);const l=KA(a,r),c=Bst(a,t,r);Sn(c!==null,`No resize element found for id "${t}"`);const u=s.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,e,t,n])}function Gst({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:i,onDragging:o,style:s={},tabIndex:a=0,tagName:l="div",...c}){const u=Ml(null),f=Ml({onDragging:o});xb(()=>{f.current.onDragging=o});const d=Pst(TB);if(d===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:h,groupId:p,registerResizeHandle:g,startDragging:v,stopDragging:y,panelGroupElement:O}=d,m=kge(i),[w,S]=h2("inactive"),[E,C]=h2(!1),[k,P]=h2(null),D=Ml({state:w});return wb(()=>{D.current.state=w}),xb(()=>{if(n)P(null);else{const L=g(m);P(()=>L)}},[n,m,g]),xb(()=>{var L,A;if(n||k==null)return;const T=u.current;Sn(T,"Element ref not attached");const N=(j,z,W)=>{if(z)switch(j){case"down":{S("drag"),v(m,W);const{onDragging:F}=f.current;F&&F(!0);break}case"move":{const{state:F}=D.current;F!=="drag"&&S("hover"),k(W);break}case"up":{S("hover"),y();const{onDragging:F}=f.current;F&&F(!1);break}}else S("inactive")};return f9n(m,T,h,{coarse:(L=r==null?void 0:r.coarse)!==null&&L!==void 0?L:15,fine:(A=r==null?void 0:r.fine)!==null&&A!==void 0?A:5},N)},[h,n,r,g,m,k,v,y]),E9n({disabled:n,handleId:m,resizeHandler:k,panelGroupElement:O}),TC(l,{...c,children:e,className:t,id:i,onBlur:()=>C(!1),onFocus:()=>C(!0),ref:u,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...s},tabIndex:a,"data-panel-group-direction":h,"data-panel-group-id":p,"data-resize-handle":"","data-resize-handle-active":w==="drag"?"pointer":E?"keyboard":void 0,"data-resize-handle-state":w,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":m})}Gst.displayName="PanelResizeHandle";const C9n=({children:e})=>{const{openModal:t,closeModal:n}=$m();return b.jsx(vd,{onClick:()=>t(b.jsx(k9n,{onClose:n})),children:e})},_9n={"😡":1,"🙁":2,"😐":3,"🙂":4,"😍":5},k9n=({onClose:e})=>b.jsx(gm,{className:"w-fit",children:b.jsxs("form",{onSubmit:async t=>{t.preventDefault();const n=new FormData(t.target),r=n.get("rating"),i=n.get("message");fetch("https://marimo.io/api/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rating:r,message:i})}),e(),yr({title:"Feedback sent!",description:"Thank you for your feedback!"})},children:[b.jsxs(YC,{children:[b.jsx(Ov,{children:"Send Feedback"}),b.jsxs(mE,{children:["Let us know what you think about marimo! If you have a bug that you would like to report, please use the"," ",b.jsx("a",{href:qre.issuesPage,target:"_blank",rel:"noreferrer",className:"underline",children:"GitHub issue tracker"}),"."]}),b.jsx(mE,{children:"Your feedback is anonymous and will help us improve marimo. Thank you!"})]}),b.jsxs("div",{className:"flex flex-col gap-6 py-4",children:[b.jsx("div",{className:"flex gap-5 justify-center",children:Object.entries(_9n).map(([t,n])=>b.jsxs("label",{className:"flex flex-col items-center select-none",children:[b.jsx("input",{type:"radio",className:"peer hidden",name:"rating",value:n,"aria-label":t},t),b.jsx("span",{className:"text-4xl peer-checked:opacity-100 opacity-40 cursor-pointer",children:t})]},t))}),b.jsx(Dz,{id:"message",name:"message",autoFocus:!0,placeholder:"Your feedback",rows:5,required:!0,autoComplete:"off"})]}),b.jsxs(FR,{children:[b.jsx(St,{"data-testid":"feedback-cancel-button",variant:"secondary",onClick:e,children:"Cancel"}),b.jsx(St,{"data-testid":"feedback-send-button","aria-label":"Save",variant:"default",type:"submit",children:"Send"})]})]})}),$9n=()=>{const{selectedPanel:e}=pge(),{openApplication:t}=EB(),n=Gi(r9t),r=(i,o)=>{const s=gge[i];return b.jsx(s,{className:be("h-5 w-5",o)})};return b.jsxs("footer",{className:"h-10 py-2 bg-background flex items-center text-muted-foreground text-md px-4 border-t border-border select-none no-print text-sm shadow-[0_0_4px_1px_rgba(0,0,0,0.1)] z-50",children:[b.jsxs(Vm,{tooltip:"View errors",selected:e==="errors",onClick:()=>t("errors"),children:[r("errors",n>0?"text-destructive":""),b.jsx("span",{className:"ml-1 font-mono mt-[0.125rem]",children:n})]}),b.jsx(Vm,{tooltip:"View files",selected:e==="files",onClick:()=>t("files"),children:r("files")}),b.jsx(Vm,{tooltip:"Explore variables",selected:e==="variables",onClick:()=>t("variables"),children:r("variables")}),b.jsx(Vm,{tooltip:"Explore dependencies",selected:e==="dependencies",onClick:()=>t("dependencies"),children:r("dependencies")}),b.jsx(Vm,{tooltip:"View outline",selected:e==="outline",onClick:()=>t("outline"),children:r("outline")}),b.jsx(Vm,{tooltip:"View documentation",selected:e==="documentation",onClick:()=>t("documentation"),children:r("documentation")}),b.jsx(Vm,{tooltip:"Notebook logs",selected:e==="logs",onClick:()=>t("logs"),children:r("logs")}),b.jsx(C9n,{children:b.jsx(Vm,{tooltip:"Send feedback!",selected:!1,children:b.jsx(sCt,{className:"h-5 w-5"})})}),b.jsx("div",{className:"mx-auto"})]})},Vm=({children:e,tooltip:t,selected:n,className:r,...i})=>b.jsx(Wt,{content:t,side:"top",children:b.jsx("div",{className:be("h-full flex items-center p-2 text-sm mx-[1px] shadow-inset font-mono cursor-pointer rounded",!n&&"hover:bg-[var(--sage-3)]",n&&"bg-[var(--sage-4)]",r),...i,children:e})}),FPe=Y.record(Y.tuple([Y.number(),Y.number()]));let l$=null;function T9n(e){return{getItem(t){if(!l$)return l$??null;if(e==="left")return l$;try{const n=FPe.parse(JSON.parse(l$));return JSON.stringify(pn.mapValues(n,r=>r.reverse()))}catch{return null}},setItem(t,n){if(e!=="left")try{const r=FPe.parse(JSON.parse(n));n=JSON.stringify(pn.mapValues(r,i=>i.reverse()))}catch{return null}l$=n||null}}}const P9n=()=>{const e=s9t();return e.length===0?b.jsxs("div",{className:"mx-6 my-6 flex flex-row gap-2 items-center rounded-lg",children:[b.jsx(pCt,{className:"text-accent-foreground"}),b.jsxs("span",{className:"mt-[0.25rem] text-accent-foreground",children:[" ","No errors!"," "]})]}):b.jsx("div",{className:"flex flex-col overflow-auto",children:e.map(t=>b.jsxs("div",{children:[b.jsx("div",{className:"text-xs font-mono font-semibold bg-muted border-y px-2 py-1",children:b.jsx(Xm,{cellId:t.cellId})}),b.jsx("div",{className:"px-2",children:b.jsx(Jze,{errors:t.output.data},t.cellId)},t.cellId)]},t.cellId))})},A9n=()=>{const e=Gi(n9t);if(e.items.length===0)return b.jsxs("div",{className:"mx-6 my-6 flex flex-row gap-2 items-center rounded-lg",children:[b.jsx(MLe,{className:"text-muted-foreground"}),b.jsx("span",{className:"mt-[0.25rem] text-muted-foreground",children:"No outline"})]});const t=(r,i)=>{const s=document.querySelectorAll(`[id="${CSS.escape(r)}"]`)[i];s&&(s.scrollIntoView({behavior:"smooth",block:"start"}),s.classList.add("outline-item-highlight"),setTimeout(()=>{s.classList.remove("outline-item-highlight")},3e3))},n=new Map;return b.jsx("div",{className:"flex flex-col overflow-auto py-4 pl-2",children:e.items.map(r=>{const i=n.get(r.id)??0;return n.set(r.id,i+1),b.jsx("div",{className:be("px-2 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l",r.level===1&&"font-semibold",r.level===2&&"ml-3",r.level===3&&"ml-6",r.level===4&&"ml-9"),onClick:()=>t(r.id,i),children:r.name},r.id)})})};function Af(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Af(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const{useDebugValue:R9n}=ie,{useSyncExternalStoreWithSelector:D9n}=p5e,M9n=e=>e;function Kst(e,t=M9n,n){const r=D9n(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return R9n(r),r}const zPe=(e,t)=>{const n=Mie(e),r=(i,o=t)=>Kst(n,i,o);return Object.assign(r,n),r},N9n=(e,t)=>e?zPe(e,t):zPe;function uc(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var Cne="http://www.w3.org/1999/xhtml";const QPe={svg:"http://www.w3.org/2000/svg",xhtml:Cne,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function MB(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),QPe.hasOwnProperty(t)?{space:QPe[t],local:e}:e}function I9n(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Cne&&t.documentElement.namespaceURI===Cne?t.createElement(e):t.createElementNS(n,e)}}function L9n(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Jst(e){var t=MB(e);return(t.local?L9n:I9n)(t)}function j9n(){}function Age(e){return e==null?j9n:function(){return this.querySelector(e)}}function F9n(e){typeof e!="function"&&(e=Age(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=new Array(s),l,c,u=0;u<s;++u)(l=o[u])&&(c=e.call(l,l.__data__,u,o))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new lu(r,this._parents)}function z9n(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Q9n(){return[]}function eat(e){return e==null?Q9n:function(){return this.querySelectorAll(e)}}function B9n(e){return function(){return z9n(e.apply(this,arguments))}}function W9n(e){typeof e=="function"?e=B9n(e):e=eat(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(r.push(e.call(l,l.__data__,c,s)),i.push(l));return new lu(r,i)}function tat(e){return function(){return this.matches(e)}}function nat(e){return function(t){return t.matches(e)}}var q9n=Array.prototype.find;function V9n(e){return function(){return q9n.call(this.children,e)}}function U9n(){return this.firstElementChild}function H9n(e){return this.select(e==null?U9n:V9n(typeof e=="function"?e:nat(e)))}var X9n=Array.prototype.filter;function Z9n(){return Array.from(this.children)}function Y9n(e){return function(){return X9n.call(this.children,e)}}function G9n(e){return this.selectAll(e==null?Z9n:Y9n(typeof e=="function"?e:nat(e)))}function K9n(e){typeof e!="function"&&(e=tat(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],l,c=0;c<s;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&a.push(l);return new lu(r,this._parents)}function rat(e){return new Array(e.length)}function J9n(){return new lu(this._enter||this._groups.map(rat),this._parents)}function _7(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}_7.prototype={constructor:_7,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function eQn(e){return function(){return e}}function tQn(e,t,n,r,i,o){for(var s=0,a,l=t.length,c=o.length;s<c;++s)(a=t[s])?(a.__data__=o[s],r[s]=a):n[s]=new _7(e,o[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function nQn(e,t,n,r,i,o,s){var a,l,c=new Map,u=t.length,f=o.length,d=new Array(u),h;for(a=0;a<u;++a)(l=t[a])&&(d[a]=h=s.call(l,l.__data__,a,t)+"",c.has(h)?i[a]=l:c.set(h,l));for(a=0;a<f;++a)h=s.call(e,o[a],a,o)+"",(l=c.get(h))?(r[a]=l,l.__data__=o[a],c.delete(h)):n[a]=new _7(e,o[a]);for(a=0;a<u;++a)(l=t[a])&&c.get(d[a])===l&&(i[a]=l)}function rQn(e){return e.__data__}function iQn(e,t){if(!arguments.length)return Array.from(this,rQn);var n=t?nQn:tQn,r=this._parents,i=this._groups;typeof e!="function"&&(e=eQn(e));for(var o=i.length,s=new Array(o),a=new Array(o),l=new Array(o),c=0;c<o;++c){var u=r[c],f=i[c],d=f.length,h=oQn(e.call(u,u&&u.__data__,c,r)),p=h.length,g=a[c]=new Array(p),v=s[c]=new Array(p),y=l[c]=new Array(d);n(u,f,g,v,y,h,t);for(var O=0,m=0,w,S;O<p;++O)if(w=g[O]){for(O>=m&&(m=O+1);!(S=v[m])&&++m<p;);w._next=S||null}}return s=new lu(s,r),s._enter=a,s._exit=l,s}function oQn(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sQn(){return new lu(this._exit||this._groups.map(rat),this._parents)}function aQn(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function lQn(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),l=0;l<s;++l)for(var c=n[l],u=r[l],f=c.length,d=a[l]=new Array(f),h,p=0;p<f;++p)(h=c[p]||u[p])&&(d[p]=h);for(;l<i;++l)a[l]=n[l];return new lu(a,this._parents)}function cQn(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function uQn(e){e||(e=fQn);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,l=i[o]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(t)}return new lu(i,this._parents).order()}function fQn(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dQn(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function hQn(){return Array.from(this)}function pQn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function gQn(){let e=0;for(const t of this)++e;return e}function mQn(){return!this.node()}function yQn(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&e.call(a,a.__data__,o,i);return this}function vQn(e){return function(){this.removeAttribute(e)}}function bQn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function OQn(e,t){return function(){this.setAttribute(e,t)}}function xQn(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function wQn(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function SQn(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function EQn(e,t){var n=MB(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?bQn:vQn:typeof t=="function"?n.local?SQn:wQn:n.local?xQn:OQn)(n,t))}function iat(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function CQn(e){return function(){this.style.removeProperty(e)}}function _Qn(e,t,n){return function(){this.style.setProperty(e,t,n)}}function kQn(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function $Qn(e,t,n){return arguments.length>1?this.each((t==null?CQn:typeof t=="function"?kQn:_Qn)(e,t,n??"")):PC(this.node(),e)}function PC(e,t){return e.style.getPropertyValue(t)||iat(e).getComputedStyle(e,null).getPropertyValue(t)}function TQn(e){return function(){delete this[e]}}function PQn(e,t){return function(){this[e]=t}}function AQn(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function RQn(e,t){return arguments.length>1?this.each((t==null?TQn:typeof t=="function"?AQn:PQn)(e,t)):this.node()[e]}function oat(e){return e.trim().split(/^|\s+/)}function Rge(e){return e.classList||new sat(e)}function sat(e){this._node=e,this._names=oat(e.getAttribute("class")||"")}sat.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function aat(e,t){for(var n=Rge(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function lat(e,t){for(var n=Rge(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function DQn(e){return function(){aat(this,e)}}function MQn(e){return function(){lat(this,e)}}function NQn(e,t){return function(){(t.apply(this,arguments)?aat:lat)(this,e)}}function IQn(e,t){var n=oat(e+"");if(arguments.length<2){for(var r=Rge(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?NQn:t?DQn:MQn)(n,t))}function LQn(){this.textContent=""}function jQn(e){return function(){this.textContent=e}}function FQn(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function zQn(e){return arguments.length?this.each(e==null?LQn:(typeof e=="function"?FQn:jQn)(e)):this.node().textContent}function QQn(){this.innerHTML=""}function BQn(e){return function(){this.innerHTML=e}}function WQn(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function qQn(e){return arguments.length?this.each(e==null?QQn:(typeof e=="function"?WQn:BQn)(e)):this.node().innerHTML}function VQn(){this.nextSibling&&this.parentNode.appendChild(this)}function UQn(){return this.each(VQn)}function HQn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function XQn(){return this.each(HQn)}function ZQn(e){var t=typeof e=="function"?e:Jst(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function YQn(){return null}function GQn(e,t){var n=typeof e=="function"?e:Jst(e),r=t==null?YQn:typeof t=="function"?t:Age(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function KQn(){var e=this.parentNode;e&&e.removeChild(this)}function JQn(){return this.each(KQn)}function eBn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tBn(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nBn(e){return this.select(e?tBn:eBn)}function rBn(e){return arguments.length?this.property("__data__",e):this.node().__data__}function iBn(e){return function(t){e.call(this,t,this.__data__)}}function oBn(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function sBn(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function aBn(e,t,n){return function(){var r=this.__on,i,o=iBn(t);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function lBn(e,t,n){var r=oBn(e+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(i=0,u=a[l];i<o;++i)if((s=r[i]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?aBn:sBn,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function cat(e,t,n){var r=iat(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function cBn(e,t){return function(){return cat(this,e,t)}}function uBn(e,t){return function(){return cat(this,e,t.apply(this,arguments))}}function fBn(e,t){return this.each((typeof t=="function"?uBn:cBn)(e,t))}function*dBn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var uat=[null];function lu(e,t){this._groups=e,this._parents=t}function lM(){return new lu([[document.documentElement]],uat)}function hBn(){return this}lu.prototype=lM.prototype={constructor:lu,select:F9n,selectAll:W9n,selectChild:H9n,selectChildren:G9n,filter:K9n,data:iQn,enter:J9n,exit:sQn,join:aQn,merge:lQn,selection:hBn,order:cQn,sort:uQn,call:dQn,nodes:hQn,node:pQn,size:gQn,empty:mQn,each:yQn,attr:EQn,style:$Qn,property:RQn,classed:IQn,text:zQn,html:qQn,raise:UQn,lower:XQn,append:ZQn,insert:GQn,remove:JQn,clone:nBn,datum:rBn,on:lBn,dispatch:fBn,[Symbol.iterator]:dBn};function ed(e){return typeof e=="string"?new lu([[document.querySelector(e)]],[document.documentElement]):new lu([[e]],uat)}function pBn(e){let t;for(;t=e.sourceEvent;)e=t;return e}function hh(e,t){if(e=pBn(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const gBn={passive:!1},JA={capture:!0,passive:!1};function GH(e){e.stopImmediatePropagation()}function HS(e){e.preventDefault(),e.stopImmediatePropagation()}function fat(e){var t=e.document.documentElement,n=ed(e).on("dragstart.drag",HS,JA);"onselectstart"in t?n.on("selectstart.drag",HS,JA):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function dat(e,t){var n=e.document.documentElement,r=ed(e).on("dragstart.drag",null);t&&(r.on("click.drag",HS,JA),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const GI=e=>()=>e;function _ne(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}_ne.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function mBn(e){return!e.ctrlKey&&!e.button}function yBn(){return this.parentNode}function vBn(e,t){return t??{x:e.x,y:e.y}}function bBn(){return navigator.maxTouchPoints||"ontouchstart"in this}function OBn(){var e=mBn,t=yBn,n=vBn,r=bBn,i={},o=MD("start","drag","end"),s=0,a,l,c,u,f=0;function d(w){w.on("mousedown.drag",h).filter(r).on("touchstart.drag",v).on("touchmove.drag",y,gBn).on("touchend.drag touchcancel.drag",O).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,S){if(!(u||!e.call(this,w,S))){var E=m(this,t.call(this,w,S),w,S,"mouse");E&&(ed(w.view).on("mousemove.drag",p,JA).on("mouseup.drag",g,JA),fat(w.view),GH(w),c=!1,a=w.clientX,l=w.clientY,E("start",w))}}function p(w){if(HS(w),!c){var S=w.clientX-a,E=w.clientY-l;c=S*S+E*E>f}i.mouse("drag",w)}function g(w){ed(w.view).on("mousemove.drag mouseup.drag",null),dat(w.view,c),HS(w),i.mouse("end",w)}function v(w,S){if(e.call(this,w,S)){var E=w.changedTouches,C=t.call(this,w,S),k=E.length,P,D;for(P=0;P<k;++P)(D=m(this,C,w,S,E[P].identifier,E[P]))&&(GH(w),D("start",w,E[P]))}}function y(w){var S=w.changedTouches,E=S.length,C,k;for(C=0;C<E;++C)(k=i[S[C].identifier])&&(HS(w),k("drag",w,S[C]))}function O(w){var S=w.changedTouches,E=S.length,C,k;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),C=0;C<E;++C)(k=i[S[C].identifier])&&(GH(w),k("end",w,S[C]))}function m(w,S,E,C,k,P){var D=o.copy(),M=hh(P||E,S),L,A,T;if((T=n.call(w,new _ne("beforestart",{sourceEvent:E,target:d,identifier:k,active:s,x:M[0],y:M[1],dx:0,dy:0,dispatch:D}),C))!=null)return L=T.x-M[0]||0,A=T.y-M[1]||0,function N(j,z,W){var F=M,q;switch(j){case"start":i[k]=N,q=s++;break;case"end":delete i[k],--s;case"drag":M=hh(W||z,S),q=s;break}D.call(j,w,new _ne(j,{sourceEvent:z,subject:T,target:d,identifier:k,active:q,x:M[0]+L,y:M[1]+A,dx:M[0]-F[0],dy:M[1]-F[1],dispatch:D}),C)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:GI(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:GI(w),d):t},d.subject=function(w){return arguments.length?(n=typeof w=="function"?w:GI(w),d):n},d.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:GI(!!w),d):r},d.on=function(){var w=o.on.apply(o,arguments);return w===o?d:w},d.clickDistance=function(w){return arguments.length?(f=(w=+w)*w,d):Math.sqrt(f)},d}var xBn=MD("start","end","cancel","interrupt"),wBn=[],hat=0,BPe=1,kne=2,RL=3,WPe=4,$ne=5,DL=6;function NB(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;SBn(e,n,{name:t,index:r,group:i,on:xBn,tween:wBn,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:hat})}function Dge(e,t){var n=Zd(e,t);if(n.state>hat)throw new Error("too late; already scheduled");return n}function Fp(e,t){var n=Zd(e,t);if(n.state>RL)throw new Error("too late; already running");return n}function Zd(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function SBn(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Bfe(o,0,n.time);function o(c){n.state=BPe,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,f,d,h;if(n.state!==BPe)return l();for(u in r)if(h=r[u],h.name===n.name){if(h.state===RL)return eCe(s);h.state===WPe?(h.state=DL,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[u]):+u<t&&(h.state=DL,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[u])}if(eCe(function(){n.state===RL&&(n.state=WPe,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=kne,n.on.call("start",e,e.__data__,n.index,n.group),n.state===kne){for(n.state=RL,i=new Array(d=n.tween.length),u=0,f=-1;u<d;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=h);i.length=f+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=$ne,1),f=-1,d=i.length;++f<d;)i[f].call(e,u);n.state===$ne&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=DL,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function ML(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>kne&&r.state<$ne,r.state=DL,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function EBn(e){return this.each(function(){ML(this,e)})}function CBn(e,t){var n,r;return function(){var i=Fp(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function _Bn(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Fp(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=a;break}l===c&&i.push(a)}o.tween=i}}function kBn(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Zd(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?CBn:_Bn)(n,e,t))}function Mge(e,t,n){var r=e._id;return e.each(function(){var i=Fp(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Zd(i,r).value[t]}}function pat(e,t){var n;return(typeof t=="number"?Ru:t instanceof dO?eA:(n=dO(t))?(t=n,eA):gue)(e,t)}function $Bn(e){return function(){this.removeAttribute(e)}}function TBn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function PBn(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function ABn(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function RBn(e,t,n){var r,i,o;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===i?o:(i=l,o=t(r=s,a)))}}function DBn(e,t,n){var r,i,o;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===i?o:(i=l,o=t(r=s,a)))}}function MBn(e,t){var n=MB(e),r=n==="transform"?LUe:pat;return this.attrTween(e,typeof t=="function"?(n.local?DBn:RBn)(n,r,Mge(this,"attr."+e,t)):t==null?(n.local?TBn:$Bn)(n):(n.local?ABn:PBn)(n,r,t))}function NBn(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function IBn(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function LBn(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&IBn(e,o)),n}return i._value=t,i}function jBn(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&NBn(e,o)),n}return i._value=t,i}function FBn(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=MB(e);return this.tween(n,(r.local?LBn:jBn)(r,t))}function zBn(e,t){return function(){Dge(this,e).delay=+t.apply(this,arguments)}}function QBn(e,t){return t=+t,function(){Dge(this,e).delay=t}}function BBn(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?zBn:QBn)(t,e)):Zd(this.node(),t).delay}function WBn(e,t){return function(){Fp(this,e).duration=+t.apply(this,arguments)}}function qBn(e,t){return t=+t,function(){Fp(this,e).duration=t}}function VBn(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?WBn:qBn)(t,e)):Zd(this.node(),t).duration}function UBn(e,t){if(typeof t!="function")throw new Error;return function(){Fp(this,e).ease=t}}function HBn(e){var t=this._id;return arguments.length?this.each(UBn(t,e)):Zd(this.node(),t).ease}function XBn(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Fp(this,e).ease=n}}function ZBn(e){if(typeof e!="function")throw new Error;return this.each(XBn(this._id,e))}function YBn(e){typeof e!="function"&&(e=tat(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],l,c=0;c<s;++c)(l=o[c])&&e.call(l,l.__data__,c,o)&&a.push(l);return new om(r,this._parents,this._name,this._id)}function GBn(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var l=t[a],c=n[a],u=l.length,f=s[a]=new Array(u),d,h=0;h<u;++h)(d=l[h]||c[h])&&(f[h]=d);for(;a<r;++a)s[a]=t[a];return new om(s,this._parents,this._name,this._id)}function KBn(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function JBn(e,t,n){var r,i,o=KBn(t)?Dge:Fp;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function eWn(e,t){var n=this._id;return arguments.length<2?Zd(this.node(),n).on.on(e):this.each(JBn(n,e,t))}function tWn(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function nWn(){return this.on("end.remove",tWn(this._id))}function rWn(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Age(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],l=a.length,c=o[s]=new Array(l),u,f,d=0;d<l;++d)(u=a[d])&&(f=e.call(u,u.__data__,d,a))&&("__data__"in u&&(f.__data__=u.__data__),c[d]=f,NB(c[d],t,n,d,c,Zd(u,n)));return new om(o,this._parents,t,n)}function iWn(e){var t=this._name,n=this._id;typeof e!="function"&&(e=eat(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var l=r[a],c=l.length,u,f=0;f<c;++f)if(u=l[f]){for(var d=e.call(u,u.__data__,f,l),h,p=Zd(u,n),g=0,v=d.length;g<v;++g)(h=d[g])&&NB(h,t,n,g,d,p);o.push(d),s.push(u)}return new om(o,s,t,n)}var oWn=lM.prototype.constructor;function sWn(){return new oWn(this._groups,this._parents)}function aWn(e,t){var n,r,i;return function(){var o=PC(this,e),s=(this.style.removeProperty(e),PC(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function gat(e){return function(){this.style.removeProperty(e)}}function lWn(e,t,n){var r,i=n+"",o;return function(){var s=PC(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function cWn(e,t,n){var r,i,o;return function(){var s=PC(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),PC(this,e))),s===l?null:s===r&&l===i?o:(i=l,o=t(r=s,a))}}function uWn(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var l=Fp(this,e),c=l.on,u=l.value[o]==null?a||(a=gat(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(s,i=u),l.on=r}}function fWn(e,t,n){var r=(e+="")=="transform"?IUe:pat;return t==null?this.styleTween(e,aWn(e,r)).on("end.style."+e,gat(e)):typeof t=="function"?this.styleTween(e,cWn(e,r,Mge(this,"style."+e,t))).each(uWn(this._id,e)):this.styleTween(e,lWn(e,r,t),n).on("end.style."+e,null)}function dWn(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function hWn(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&dWn(e,s,n)),r}return o._value=t,o}function pWn(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,hWn(e,t,n??""))}function gWn(e){return function(){this.textContent=e}}function mWn(e){return function(){var t=e(this);this.textContent=t??""}}function yWn(e){return this.tween("text",typeof e=="function"?mWn(Mge(this,"text",e)):gWn(e==null?"":e+""))}function vWn(e){return function(t){this.textContent=e.call(this,t)}}function bWn(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&vWn(i)),t}return r._value=e,r}function OWn(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,bWn(e))}function xWn(){for(var e=this._name,t=this._id,n=mat(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=Zd(l,t);NB(l,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new om(r,this._parents,e,n)}function wWn(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},l={value:function(){--i===0&&o()}};n.each(function(){var c=Fp(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),i===0&&o()})}var SWn=0;function om(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function mat(){return++SWn}var Hp=lM.prototype;om.prototype={constructor:om,select:rWn,selectAll:iWn,selectChild:Hp.selectChild,selectChildren:Hp.selectChildren,filter:YBn,merge:GBn,selection:sWn,transition:xWn,call:Hp.call,nodes:Hp.nodes,node:Hp.node,size:Hp.size,empty:Hp.empty,each:Hp.each,on:eWn,attr:MBn,attrTween:FBn,style:fWn,styleTween:pWn,text:yWn,textTween:OWn,remove:nWn,tween:kBn,delay:BBn,duration:VBn,ease:HBn,easeVarying:ZBn,end:wWn,[Symbol.iterator]:Hp[Symbol.iterator]};function EWn(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var CWn={time:null,delay:0,duration:250,ease:EWn};function _Wn(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function kWn(e){var t,n;e instanceof om?(t=e._id,e=e._name):(t=mat(),(n=CWn).time=B9(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,c=0;c<a;++c)(l=s[c])&&NB(l,e,t,c,s,n||_Wn(l,t));return new om(r,this._parents,e,t)}lM.prototype.interrupt=EBn;lM.prototype.transition=kWn;const KI=e=>()=>e;function $Wn(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Eg(e,t,n){this.k=e,this.x=t,this.y=n}Eg.prototype={constructor:Eg,scale:function(e){return e===1?this:new Eg(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Eg(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var b0=new Eg(1,0,0);Eg.prototype;function KH(e){e.stopImmediatePropagation()}function c$(e){e.preventDefault(),e.stopImmediatePropagation()}function TWn(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function PWn(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function qPe(){return this.__zoom||b0}function AWn(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function RWn(){return navigator.maxTouchPoints||"ontouchstart"in this}function DWn(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function MWn(){var e=TWn,t=PWn,n=DWn,r=AWn,i=RWn,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=jUe,c=MD("start","zoom","end"),u,f,d,h=500,p=150,g=0,v=10;function y(T){T.property("__zoom",qPe).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",D).filter(i).on("touchstart.zoom",M).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",A).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(T,N,j,z){var W=T.selection?T.selection():T;W.property("__zoom",qPe),T!==W?S(T,N,j,z):W.interrupt().each(function(){E(this,arguments).event(z).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},y.scaleBy=function(T,N,j,z){y.scaleTo(T,function(){var W=this.__zoom.k,F=typeof N=="function"?N.apply(this,arguments):N;return W*F},j,z)},y.scaleTo=function(T,N,j,z){y.transform(T,function(){var W=t.apply(this,arguments),F=this.__zoom,q=j==null?w(W):typeof j=="function"?j.apply(this,arguments):j,U=F.invert(q),V=typeof N=="function"?N.apply(this,arguments):N;return n(m(O(F,V),q,U),W,s)},j,z)},y.translateBy=function(T,N,j,z){y.transform(T,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof j=="function"?j.apply(this,arguments):j),t.apply(this,arguments),s)},null,z)},y.translateTo=function(T,N,j,z,W){y.transform(T,function(){var F=t.apply(this,arguments),q=this.__zoom,U=z==null?w(F):typeof z=="function"?z.apply(this,arguments):z;return n(b0.translate(U[0],U[1]).scale(q.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof j=="function"?-j.apply(this,arguments):-j),F,s)},z,W)};function O(T,N){return N=Math.max(o[0],Math.min(o[1],N)),N===T.k?T:new Eg(N,T.x,T.y)}function m(T,N,j){var z=N[0]-j[0]*T.k,W=N[1]-j[1]*T.k;return z===T.x&&W===T.y?T:new Eg(T.k,z,W)}function w(T){return[(+T[0][0]+ +T[1][0])/2,(+T[0][1]+ +T[1][1])/2]}function S(T,N,j,z){T.on("start.zoom",function(){E(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(z).end()}).tween("zoom",function(){var W=this,F=arguments,q=E(W,F).event(z),U=t.apply(W,F),V=j==null?w(U):typeof j=="function"?j.apply(W,F):j,H=Math.max(U[1][0]-U[0][0],U[1][1]-U[0][1]),Z=W.__zoom,ee=typeof N=="function"?N.apply(W,F):N,se=l(Z.invert(V).concat(H/Z.k),ee.invert(V).concat(H/ee.k));return function(fe){if(fe===1)fe=ee;else{var ce=se(fe),ae=H/ce[2];fe=new Eg(ae,V[0]-ce[0]*ae,V[1]-ce[1]*ae)}q.zoom(null,fe)}})}function E(T,N,j){return!j&&T.__zooming||new C(T,N)}function C(T,N){this.that=T,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(T,N),this.taps=0}C.prototype={event:function(T){return T&&(this.sourceEvent=T),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(T,N){return this.mouse&&T!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&T!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&T!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(T){var N=ed(this.that).datum();c.call(T,this.that,new $Wn(T,{sourceEvent:this.sourceEvent,target:y,type:T,transform:this.that.__zoom,dispatch:c}),N)}};function k(T,...N){if(!e.apply(this,arguments))return;var j=E(this,N).event(T),z=this.__zoom,W=Math.max(o[0],Math.min(o[1],z.k*Math.pow(2,r.apply(this,arguments)))),F=hh(T);if(j.wheel)(j.mouse[0][0]!==F[0]||j.mouse[0][1]!==F[1])&&(j.mouse[1]=z.invert(j.mouse[0]=F)),clearTimeout(j.wheel);else{if(z.k===W)return;j.mouse=[F,z.invert(F)],ML(this),j.start()}c$(T),j.wheel=setTimeout(q,p),j.zoom("mouse",n(m(O(z,W),j.mouse[0],j.mouse[1]),j.extent,s));function q(){j.wheel=null,j.end()}}function P(T,...N){if(d||!e.apply(this,arguments))return;var j=T.currentTarget,z=E(this,N,!0).event(T),W=ed(T.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",H,!0),F=hh(T,j),q=T.clientX,U=T.clientY;fat(T.view),KH(T),z.mouse=[F,this.__zoom.invert(F)],ML(this),z.start();function V(Z){if(c$(Z),!z.moved){var ee=Z.clientX-q,se=Z.clientY-U;z.moved=ee*ee+se*se>g}z.event(Z).zoom("mouse",n(m(z.that.__zoom,z.mouse[0]=hh(Z,j),z.mouse[1]),z.extent,s))}function H(Z){W.on("mousemove.zoom mouseup.zoom",null),dat(Z.view,z.moved),c$(Z),z.event(Z).end()}}function D(T,...N){if(e.apply(this,arguments)){var j=this.__zoom,z=hh(T.changedTouches?T.changedTouches[0]:T,this),W=j.invert(z),F=j.k*(T.shiftKey?.5:2),q=n(m(O(j,F),z,W),t.apply(this,N),s);c$(T),a>0?ed(this).transition().duration(a).call(S,q,z,T):ed(this).call(y.transform,q,z,T)}}function M(T,...N){if(e.apply(this,arguments)){var j=T.touches,z=j.length,W=E(this,N,T.changedTouches.length===z).event(T),F,q,U,V;for(KH(T),q=0;q<z;++q)U=j[q],V=hh(U,this),V=[V,this.__zoom.invert(V),U.identifier],W.touch0?!W.touch1&&W.touch0[2]!==V[2]&&(W.touch1=V,W.taps=0):(W.touch0=V,F=!0,W.taps=1+!!u);u&&(u=clearTimeout(u)),F&&(W.taps<2&&(f=V[0],u=setTimeout(function(){u=null},h)),ML(this),W.start())}}function L(T,...N){if(this.__zooming){var j=E(this,N).event(T),z=T.changedTouches,W=z.length,F,q,U,V;for(c$(T),F=0;F<W;++F)q=z[F],U=hh(q,this),j.touch0&&j.touch0[2]===q.identifier?j.touch0[0]=U:j.touch1&&j.touch1[2]===q.identifier&&(j.touch1[0]=U);if(q=j.that.__zoom,j.touch1){var H=j.touch0[0],Z=j.touch0[1],ee=j.touch1[0],se=j.touch1[1],fe=(fe=ee[0]-H[0])*fe+(fe=ee[1]-H[1])*fe,ce=(ce=se[0]-Z[0])*ce+(ce=se[1]-Z[1])*ce;q=O(q,Math.sqrt(fe/ce)),U=[(H[0]+ee[0])/2,(H[1]+ee[1])/2],V=[(Z[0]+se[0])/2,(Z[1]+se[1])/2]}else if(j.touch0)U=j.touch0[0],V=j.touch0[1];else return;j.zoom("touch",n(m(q,U,V),j.extent,s))}}function A(T,...N){if(this.__zooming){var j=E(this,N).event(T),z=T.changedTouches,W=z.length,F,q;for(KH(T),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),F=0;F<W;++F)q=z[F],j.touch0&&j.touch0[2]===q.identifier?delete j.touch0:j.touch1&&j.touch1[2]===q.identifier&&delete j.touch1;if(j.touch1&&!j.touch0&&(j.touch0=j.touch1,delete j.touch1),j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2&&(q=hh(q,this),Math.hypot(f[0]-q[0],f[1]-q[1])<v)){var U=ed(this).on("dblclick.zoom");U&&U.apply(this,arguments)}}}return y.wheelDelta=function(T){return arguments.length?(r=typeof T=="function"?T:KI(+T),y):r},y.filter=function(T){return arguments.length?(e=typeof T=="function"?T:KI(!!T),y):e},y.touchable=function(T){return arguments.length?(i=typeof T=="function"?T:KI(!!T),y):i},y.extent=function(T){return arguments.length?(t=typeof T=="function"?T:KI([[+T[0][0],+T[0][1]],[+T[1][0],+T[1][1]]]),y):t},y.scaleExtent=function(T){return arguments.length?(o[0]=+T[0],o[1]=+T[1],y):[o[0],o[1]]},y.translateExtent=function(T){return arguments.length?(s[0][0]=+T[0][0],s[1][0]=+T[1][0],s[0][1]=+T[0][1],s[1][1]=+T[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(T){return arguments.length?(n=T,y):n},y.duration=function(T){return arguments.length?(a=+T,y):a},y.interpolate=function(T){return arguments.length?(l=T,y):l},y.on=function(){var T=c.on.apply(c,arguments);return T===c?y:T},y.clickDistance=function(T){return arguments.length?(g=(T=+T)*T,y):Math.sqrt(g)},y.tapDistance=function(T){return arguments.length?(v=+T,y):v},y}const IB=x.createContext(null),NWn=IB.Provider,sm={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},yat=sm.error001();function Mi(e,t){const n=x.useContext(IB);if(n===null)throw new Error(yat);return Kst(n,e,t)}const ea=()=>{const e=x.useContext(IB);if(e===null)throw new Error(yat);return x.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},IWn=e=>e.userSelectionActive?"none":"all";function LWn({position:e,children:t,className:n,style:r,...i}){const o=Mi(IWn),s=`${e}`.split("-");return ie.createElement("div",{className:Af(["react-flow__panel",n,...s]),style:{...r,pointerEvents:o},...i},t)}function jWn({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:ie.createElement(LWn,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ie.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const FWn=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...u})=>{const f=x.useRef(null),[d,h]=x.useState({x:0,y:0,width:0,height:0}),p=Af(["react-flow__edge-textwrapper",c]);return x.useEffect(()=>{if(f.current){const g=f.current.getBBox();h({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),typeof n>"u"||!n?null:ie.createElement("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...u},i&&ie.createElement("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),ie.createElement("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:f,style:r},n),l)};var zWn=x.memo(FWn);const Nge=e=>({width:e.offsetWidth,height:e.offsetHeight}),AC=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ige=(e={x:0,y:0},t)=>({x:AC(e.x,t[0][0],t[1][0]),y:AC(e.y,t[0][1],t[1][1])}),VPe=(e,t,n)=>e<t?AC(Math.abs(e-t),1,50)/50:e>n?-AC(Math.abs(e-n),1,50)/50:0,vat=(e,t)=>{const n=VPe(e.x,35,t.width-35)*20,r=VPe(e.y,35,t.height-35)*20;return[n,r]},bat=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},QWn=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Lge=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),BWn=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),UPe=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Tne=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},WWn=e=>Gu(e.width)&&Gu(e.height)&&Gu(e.x)&&Gu(e.y),Gu=e=>!isNaN(e)&&isFinite(e),_o=Symbol.for("internals"),Oat=["Enter"," ","Escape"],qWn=(e,t)=>{},VWn=e=>"nativeEvent"in e;function Pne(e){var i,o;const t=VWn(e)?e.nativeEvent:e,n=((o=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:o[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const xat=e=>"clientX"in e,O0=(e,t)=>{var o,s;const n=xat(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},k7=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},cM=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:f,markerStart:d,interactionWidth:h=20})=>ie.createElement(ie.Fragment,null,ie.createElement("path",{id:e,style:u,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:d}),h&&ie.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&Gu(n)&&Gu(r)?ie.createElement(zWn,{x:n,y:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null);cM.displayName="BaseEdge";function u$(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function wat({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[o,a,i,s]}function Sat({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:a}){const l=e*.125+i*.375+s*.375+n*.125,c=t*.125+o*.375+a*.375+r*.125,u=Math.abs(l-e),f=Math.abs(c-t);return[l,c,u,f]}var jO;(function(e){e.Strict="strict",e.Loose="loose"})(jO||(jO={}));var Wy;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Wy||(Wy={}));var eR;(function(e){e.Partial="partial",e.Full="full"})(eR||(eR={}));var by;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(by||(by={}));var tR;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(tR||(tR={}));var $t;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})($t||($t={}));function HPe({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===$t.Left||e===$t.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function Eat({sourceX:e,sourceY:t,sourcePosition:n=$t.Bottom,targetX:r,targetY:i,targetPosition:o=$t.Top}){const[s,a]=HPe({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,c]=HPe({pos:o,x1:r,y1:i,x2:e,y2:t}),[u,f,d,h]=Sat({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${e},${t} C${s},${a} ${l},${c} ${r},${i}`,u,f,d,h]}const jge=x.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=$t.Bottom,targetPosition:o=$t.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:p,interactionWidth:g})=>{const[v,y,O]=Eat({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return ie.createElement(cM,{path:v,labelX:y,labelY:O,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:p,interactionWidth:g})});jge.displayName="SimpleBezierEdge";const XPe={[$t.Left]:{x:-1,y:0},[$t.Right]:{x:1,y:0},[$t.Top]:{x:0,y:-1},[$t.Bottom]:{x:0,y:1}},UWn=({source:e,sourcePosition:t=$t.Bottom,target:n})=>t===$t.Left||t===$t.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},ZPe=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function HWn({source:e,sourcePosition:t=$t.Bottom,target:n,targetPosition:r=$t.Top,center:i,offset:o}){const s=XPe[t],a=XPe[r],l={x:e.x+s.x*o,y:e.y+s.y*o},c={x:n.x+a.x*o,y:n.y+a.y*o},u=UWn({source:l,sourcePosition:t,target:c}),f=u.x!==0?"x":"y",d=u[f];let h=[],p,g;const v={x:0,y:0},y={x:0,y:0},[O,m,w,S]=wat({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*a[f]===-1){p=i.x||O,g=i.y||m;const C=[{x:p,y:l.y},{x:p,y:c.y}],k=[{x:l.x,y:g},{x:c.x,y:g}];s[f]===d?h=f==="x"?C:k:h=f==="x"?k:C}else{const C=[{x:l.x,y:c.y}],k=[{x:c.x,y:l.y}];if(f==="x"?h=s.x===d?k:C:h=s.y===d?C:k,t===r){const A=Math.abs(e[f]-n[f]);if(A<=o){const T=Math.min(o-1,o-A);s[f]===d?v[f]=(l[f]>e[f]?-1:1)*T:y[f]=(c[f]>n[f]?-1:1)*T}}if(t!==r){const A=f==="x"?"y":"x",T=s[f]===a[A],N=l[A]>c[A],j=l[A]<c[A];(s[f]===1&&(!T&&N||T&&j)||s[f]!==1&&(!T&&j||T&&N))&&(h=f==="x"?C:k)}const P={x:l.x+v.x,y:l.y+v.y},D={x:c.x+y.x,y:c.y+y.y},M=Math.max(Math.abs(P.x-h[0].x),Math.abs(D.x-h[0].x)),L=Math.max(Math.abs(P.y-h[0].y),Math.abs(D.y-h[0].y));M>=L?(p=(P.x+D.x)/2,g=h[0].y):(p=h[0].x,g=(P.y+D.y)/2)}return[[e,{x:l.x+v.x,y:l.y+v.y},...h,{x:c.x+y.x,y:c.y+y.y},n],p,g,w,S]}function XWn(e,t,n,r){const i=Math.min(ZPe(e,t)/2,ZPe(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${o+i*c},${s}Q ${o},${s} ${o},${s+i*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${o},${s+i*l}Q ${o},${s} ${o+i*a},${s}`}function Ane({sourceX:e,sourceY:t,sourcePosition:n=$t.Bottom,targetX:r,targetY:i,targetPosition:o=$t.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20}){const[u,f,d,h,p]=HWn({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:a,y:l},offset:c});return[u.reduce((v,y,O)=>{let m="";return O>0&&O<u.length-1?m=XWn(u[O-1],y,u[O+1],s):m=`${O===0?"M":"L"}${y.x} ${y.y}`,v+=m,v},""),f,d,h,p]}const LB=x.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,sourcePosition:f=$t.Bottom,targetPosition:d=$t.Top,markerEnd:h,markerStart:p,pathOptions:g,interactionWidth:v})=>{const[y,O,m]=Ane({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:d,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset});return ie.createElement(cM,{path:y,labelX:O,labelY:m,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:h,markerStart:p,interactionWidth:v})});LB.displayName="SmoothStepEdge";const Fge=x.memo(e=>{var t;return ie.createElement(LB,{...e,pathOptions:x.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});Fge.displayName="StepEdge";function ZWn({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,a]=wat({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,a]}const zge=x.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:f,markerStart:d,interactionWidth:h})=>{const[p,g,v]=ZWn({sourceX:e,sourceY:t,targetX:n,targetY:r});return ie.createElement(cM,{path:p,labelX:g,labelY:v,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:u,markerEnd:f,markerStart:d,interactionWidth:h})});zge.displayName="StraightEdge";function JI(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function YPe({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case $t.Left:return[t-JI(t-r,o),n];case $t.Right:return[t+JI(r-t,o),n];case $t.Top:return[t,n-JI(n-i,o)];case $t.Bottom:return[t,n+JI(i-n,o)]}}function Cat({sourceX:e,sourceY:t,sourcePosition:n=$t.Bottom,targetX:r,targetY:i,targetPosition:o=$t.Top,curvature:s=.25}){const[a,l]=YPe({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[c,u]=YPe({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[f,d,h,p]=Sat({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${r},${i}`,f,d,h,p]}const $7=x.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=$t.Bottom,targetPosition:o=$t.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:p,pathOptions:g,interactionWidth:v})=>{const[y,O,m]=Cat({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:g==null?void 0:g.curvature});return ie.createElement(cM,{path:y,labelX:O,labelY:m,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:p,interactionWidth:v})});$7.displayName="BezierEdge";const Qge=x.createContext(null),YWn=Qge.Provider;Qge.Consumer;const GWn=()=>x.useContext(Qge),KWn=e=>"id"in e&&"source"in e&&"target"in e,JWn=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Rne=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,eqn=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),tqn=(e,t)=>{if(!e.source||!e.target)return t;let n;return KWn(e)?n={...e}:n={...e,id:JWn(e)},eqn(n,t)?t:t.concat(n)},Dne=({x:e,y:t},[n,r,i],o,[s,a])=>{const l={x:(e-n)/i,y:(t-r)/i};return o?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},_at=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),XS=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],i={x:e.position.x-n,y:e.position.y-r};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:i}},Bge=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const{x:o,y:s}=XS(i,t).positionAbsolute;return QWn(r,Lge({x:o,y:s,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return BWn(n)},kat=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1,a=[0,0])=>{const l={x:(t.x-n)/i,y:(t.y-r)/i,width:t.width/i,height:t.height/i},c=[];return e.forEach(u=>{const{width:f,height:d,selectable:h=!0,hidden:p=!1}=u;if(s&&!h||p)return!1;const{positionAbsolute:g}=XS(u,a),v={x:g.x,y:g.y,width:f||0,height:d||0},y=Tne(l,v),O=typeof f>"u"||typeof d>"u"||f===null||d===null,m=o&&y>0,w=(f||0)*(d||0);(O||m||y>=w||u.dragging)&&c.push(u)}),c},$at=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},Tat=(e,t,n,r,i,o=.1)=>{const s=t/(e.width*(1+o)),a=n/(e.height*(1+o)),l=Math.min(s,a),c=AC(l,r,i),u=e.x+e.width/2,f=e.y+e.height/2,d=t/2-u*c,h=n/2-f*c;return{x:d,y:h,zoom:c}},b1=(e,t=0)=>e.transition().duration(t);function GPe(e,t,n,r){return(t[n]||[]).reduce((i,o)=>{var s,a;return`${e.id}-${o.id}-${n}`!==r&&i.push({id:o.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+o.x+o.width/2,y:(((a=e.positionAbsolute)==null?void 0:a.y)??0)+o.y+o.height/2}),i},[])}function nqn(e,t,n,r,i,o){const{x:s,y:a}=O0(e),c=t.elementsFromPoint(s,a).find(p=>p.classList.contains("react-flow__handle"));if(c){const p=c.getAttribute("data-nodeid");if(p){const g=Wge(void 0,c),v=c.getAttribute("data-handleid"),y=o({nodeId:p,id:v,type:g});if(y){const O=i.find(m=>m.nodeId===p&&m.type===g&&m.id===v);return{handle:{id:v,type:g,nodeId:p,x:(O==null?void 0:O.x)||n.x,y:(O==null?void 0:O.y)||n.y},validHandleResult:y}}}}let u=[],f=1/0;if(i.forEach(p=>{const g=Math.sqrt((p.x-n.x)**2+(p.y-n.y)**2);if(g<=r){const v=o(p);g<=f&&(g<f?u=[{handle:p,validHandleResult:v}]:g===f&&u.push({handle:p,validHandleResult:v}),f=g)}}),!u.length)return{handle:null,validHandleResult:Pat()};if(u.length===1)return u[0];const d=u.some(({validHandleResult:p})=>p.isValid),h=u.some(({handle:p})=>p.type==="target");return u.find(({handle:p,validHandleResult:g})=>h?p.type==="target":d?g.isValid:!0)||u[0]}const rqn={source:null,target:null,sourceHandle:null,targetHandle:null},Pat=()=>({handleDomNode:null,isValid:!1,connection:rqn,endHandle:null});function Aat(e,t,n,r,i,o,s){const a=i==="target",l=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),c={...Pat(),handleDomNode:l};if(l){const u=Wge(void 0,l),f=l.getAttribute("data-nodeid"),d=l.getAttribute("data-handleid"),h=l.classList.contains("connectable"),p=l.classList.contains("connectableend"),g={source:a?f:n,sourceHandle:a?d:r,target:a?n:f,targetHandle:a?r:d};c.connection=g,h&&p&&(t===jO.Strict?a&&u==="source"||!a&&u==="target":f!==n||d!==r)&&(c.endHandle={nodeId:f,handleId:d,type:u},c.isValid=o(g))}return c}function iqn({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,o)=>{if(o[_o]){const{handleBounds:s}=o[_o];let a=[],l=[];s&&(a=GPe(o,s,"source",`${t}-${n}-${r}`),l=GPe(o,s,"target",`${t}-${n}-${r}`)),i.push(...a,...l)}return i},[])}function Wge(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function JH(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function oqn(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Rat({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:c}){const u=bat(e.target),{connectionMode:f,domNode:d,autoPanOnConnect:h,connectionRadius:p,onConnectStart:g,panBy:v,getNodes:y,cancelConnection:O}=o();let m=0,w;const{x:S,y:E}=O0(e),C=u==null?void 0:u.elementFromPoint(S,E),k=Wge(l,C),P=d==null?void 0:d.getBoundingClientRect();if(!P||!k)return;let D,M=O0(e,P),L=!1,A=null,T=!1,N=null;const j=iqn({nodes:y(),nodeId:n,handleId:t,handleType:k}),z=()=>{if(!h)return;const[q,U]=vat(M,P);v({x:q,y:U}),m=requestAnimationFrame(z)};s({connectionPosition:M,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:k,connectionStartHandle:{nodeId:n,handleId:t,type:k},connectionEndHandle:null}),g==null||g(e,{nodeId:n,handleId:t,handleType:k});function W(q){const{transform:U}=o();M=O0(q,P);const{handle:V,validHandleResult:H}=nqn(q,u,Dne(M,U,!1,[1,1]),p,j,Z=>Aat(Z,f,n,t,i?"target":"source",a,u));if(w=V,L||(z(),L=!0),N=H.handleDomNode,A=H.connection,T=H.isValid,s({connectionPosition:w&&T?_at({x:w.x,y:w.y},U):M,connectionStatus:oqn(!!w,T),connectionEndHandle:H.endHandle}),!w&&!T&&!N)return JH(D);A.source!==A.target&&N&&(JH(D),D=N,N.classList.add("connecting","react-flow__handle-connecting"),N.classList.toggle("valid",T),N.classList.toggle("react-flow__handle-valid",T))}function F(q){var U,V;(w||N)&&A&&T&&(r==null||r(A)),(V=(U=o()).onConnectEnd)==null||V.call(U,q),l&&(c==null||c(q)),JH(D),O(),cancelAnimationFrame(m),L=!1,T=!1,A=null,N=null,u.removeEventListener("mousemove",W),u.removeEventListener("mouseup",F),u.removeEventListener("touchmove",W),u.removeEventListener("touchend",F)}u.addEventListener("mousemove",W),u.addEventListener("mouseup",F),u.addEventListener("touchmove",W),u.addEventListener("touchend",F)}const KPe=()=>!0,sqn=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),aqn=(e,t,n)=>r=>{const{connectionStartHandle:i,connectionEndHandle:o,connectionClickStartHandle:s}=r;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n}},Dat=x.forwardRef(({type:e="source",position:t=$t.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:u,onTouchStart:f,...d},h)=>{var P,D;const p=s||null,g=e==="target",v=ea(),y=GWn(),{connectOnClick:O,noPanClassName:m}=Mi(sqn,uc),{connecting:w,clickConnecting:S}=Mi(aqn(y,p,e),uc);y||(D=(P=v.getState()).onError)==null||D.call(P,"010",sm.error010());const E=M=>{const{defaultEdgeOptions:L,onConnect:A,hasDefaultEdges:T}=v.getState(),N={...L,...M};if(T){const{edges:j,setEdges:z}=v.getState();z(tqn(N,j))}A==null||A(N),a==null||a(N)},C=M=>{if(!y)return;const L=xat(M);i&&(L&&M.button===0||!L)&&Rat({event:M,handleId:p,nodeId:y,onConnect:E,isTarget:g,getState:v.getState,setState:v.setState,isValidConnection:n||v.getState().isValidConnection||KPe}),L?u==null||u(M):f==null||f(M)},k=M=>{const{onClickConnectStart:L,onClickConnectEnd:A,connectionClickStartHandle:T,connectionMode:N,isValidConnection:j}=v.getState();if(!y||!T&&!i)return;if(!T){L==null||L(M,{nodeId:y,handleId:p,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,handleId:p}});return}const z=bat(M.target),W=n||j||KPe,{connection:F,isValid:q}=Aat({nodeId:y,id:p,type:e},N,T.nodeId,T.handleId||null,T.type,W,z);q&&E(F),A==null||A(M),v.setState({connectionClickStartHandle:null})};return ie.createElement("div",{"data-handleid":p,"data-nodeid":y,"data-handlepos":t,"data-id":`${y}-${p}-${e}`,className:Af(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,c,{source:!g,target:g,connectable:r,connectablestart:i,connectableend:o,connecting:S,connectionindicator:r&&(i&&!w||o&&w)}]),onMouseDown:C,onTouchStart:C,onClick:O?k:void 0,ref:h,...d},l)});Dat.displayName="Handle";var qy=x.memo(Dat);const Mat=({data:e,isConnectable:t,targetPosition:n=$t.Top,sourcePosition:r=$t.Bottom})=>ie.createElement(ie.Fragment,null,ie.createElement(qy,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,ie.createElement(qy,{type:"source",position:r,isConnectable:t}));Mat.displayName="DefaultNode";var Mne=x.memo(Mat);const Nat=({data:e,isConnectable:t,sourcePosition:n=$t.Bottom})=>ie.createElement(ie.Fragment,null,e==null?void 0:e.label,ie.createElement(qy,{type:"source",position:n,isConnectable:t}));Nat.displayName="InputNode";var Iat=x.memo(Nat);const Lat=({data:e,isConnectable:t,targetPosition:n=$t.Top})=>ie.createElement(ie.Fragment,null,ie.createElement(qy,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);Lat.displayName="OutputNode";var jat=x.memo(Lat);const qge=()=>null;qge.displayName="GroupNode";const lqn=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),e5=e=>e.id;function cqn(e,t){return uc(e.selectedNodes.map(e5),t.selectedNodes.map(e5))&&uc(e.selectedEdges.map(e5),t.selectedEdges.map(e5))}const Fat=x.memo(({onSelectionChange:e})=>{const t=ea(),{selectedNodes:n,selectedEdges:r}=Mi(lqn,cqn);return x.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChange.forEach(o=>o(i))},[n,r,e]),null});Fat.displayName="SelectionListener";const uqn=e=>!!e.onSelectionChange;function fqn({onSelectionChange:e}){const t=Mi(uqn);return e||t?ie.createElement(Fat,{onSelectionChange:e}):null}const dqn=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function cw(e,t){x.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function wn(e,t,n){x.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const hqn=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:o,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:u,nodesFocusable:f,edgesFocusable:d,edgesUpdatable:h,elevateNodesOnSelect:p,minZoom:g,maxZoom:v,nodeExtent:y,onNodesChange:O,onEdgesChange:m,elementsSelectable:w,connectionMode:S,snapGrid:E,snapToGrid:C,translateExtent:k,connectOnClick:P,defaultEdgeOptions:D,fitView:M,fitViewOptions:L,onNodesDelete:A,onEdgesDelete:T,onNodeDrag:N,onNodeDragStart:j,onNodeDragStop:z,onSelectionDrag:W,onSelectionDragStart:F,onSelectionDragStop:q,noPanClassName:U,nodeOrigin:V,rfId:H,autoPanOnConnect:Z,autoPanOnNodeDrag:ee,onError:se,connectionRadius:fe,isValidConnection:ce,nodeDragThreshold:ae})=>{const{setNodes:de,setEdges:me,setDefaultNodesAndEdges:te,setMinZoom:Ee,setMaxZoom:we,setTranslateExtent:ke,setNodeExtent:je,reset:nt}=Mi(dqn,uc),Re=ea();return x.useEffect(()=>{const G=r==null?void 0:r.map(le=>({...le,...D}));return te(n,G),()=>{nt()}},[]),wn("defaultEdgeOptions",D,Re.setState),wn("connectionMode",S,Re.setState),wn("onConnect",i,Re.setState),wn("onConnectStart",o,Re.setState),wn("onConnectEnd",s,Re.setState),wn("onClickConnectStart",a,Re.setState),wn("onClickConnectEnd",l,Re.setState),wn("nodesDraggable",c,Re.setState),wn("nodesConnectable",u,Re.setState),wn("nodesFocusable",f,Re.setState),wn("edgesFocusable",d,Re.setState),wn("edgesUpdatable",h,Re.setState),wn("elementsSelectable",w,Re.setState),wn("elevateNodesOnSelect",p,Re.setState),wn("snapToGrid",C,Re.setState),wn("snapGrid",E,Re.setState),wn("onNodesChange",O,Re.setState),wn("onEdgesChange",m,Re.setState),wn("connectOnClick",P,Re.setState),wn("fitViewOnInit",M,Re.setState),wn("fitViewOnInitOptions",L,Re.setState),wn("onNodesDelete",A,Re.setState),wn("onEdgesDelete",T,Re.setState),wn("onNodeDrag",N,Re.setState),wn("onNodeDragStart",j,Re.setState),wn("onNodeDragStop",z,Re.setState),wn("onSelectionDrag",W,Re.setState),wn("onSelectionDragStart",F,Re.setState),wn("onSelectionDragStop",q,Re.setState),wn("noPanClassName",U,Re.setState),wn("nodeOrigin",V,Re.setState),wn("rfId",H,Re.setState),wn("autoPanOnConnect",Z,Re.setState),wn("autoPanOnNodeDrag",ee,Re.setState),wn("onError",se,Re.setState),wn("connectionRadius",fe,Re.setState),wn("isValidConnection",ce,Re.setState),wn("nodeDragThreshold",ae,Re.setState),cw(e,de),cw(t,me),cw(g,Ee),cw(v,we),cw(k,ke),cw(y,je),null},JPe={display:"none"},pqn={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},zat="react-flow__node-desc",Qat="react-flow__edge-desc",gqn="react-flow__aria-live",mqn=e=>e.ariaLiveMessage;function yqn({rfId:e}){const t=Mi(mqn);return ie.createElement("div",{id:`${gqn}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:pqn},t)}function vqn({rfId:e,disableKeyboardA11y:t}){return ie.createElement(ie.Fragment,null,ie.createElement("div",{id:`${zat}-${e}`,style:JPe},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ie.createElement("div",{id:`${Qat}-${e}`,style:JPe},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&ie.createElement(yqn,{rfId:e}))}var nR=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=x.useState(!1),i=x.useRef(!1),o=x.useRef(new Set([])),[s,a]=x.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),u=c.reduce((f,d)=>f.concat(...d),[]);return[c,u]}return[[],[]]},[e]);return x.useEffect(()=>{const l=typeof document<"u"?document:null,c=(t==null?void 0:t.target)||l;if(e!==null){const u=h=>{if(i.current=h.ctrlKey||h.metaKey||h.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&Pne(h))return!1;const g=tAe(h.code,a);o.current.add(h[g]),eAe(s,o.current,!1)&&(h.preventDefault(),r(!0))},f=h=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&Pne(h))return!1;const g=tAe(h.code,a);eAe(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[g]),h.key==="Meta"&&o.current.clear(),i.current=!1},d=()=>{o.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",u),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",d),()=>{c==null||c.removeEventListener("keydown",u),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",d)}}},[e,r]),n};function eAe(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function tAe(e,t){return t.includes(e)?"code":"key"}function Bat(e,t,n,r){var s,a;if(!e.parentNode)return n;const i=t.get(e.parentNode),o=XS(i,r);return Bat(i,t,{x:(n.x??0)+o.x,y:(n.y??0)+o.y,z:(((s=i[_o])==null?void 0:s.z)??0)>(n.z??0)?((a=i[_o])==null?void 0:a.z)??0:n.z??0},r)}function Wat(e,t,n){e.forEach(r=>{var i;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:o,y:s,z:a}=Bat(r,e,{...r.position,z:((i=r[_o])==null?void 0:i.z)??0},t);r.positionAbsolute={x:o,y:s},r[_o].z=a,n!=null&&n[r.id]&&(r[_o].isParent=!0)}})}function eX(e,t,n,r){const i=new Map,o={},s=r?1e3:0;return e.forEach(a=>{var d;const l=(Gu(a.zIndex)?a.zIndex:0)+(a.selected?s:0),c=t.get(a.id),u={...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(o[a.parentNode]=!0);const f=(c==null?void 0:c.type)&&(c==null?void 0:c.type)!==a.type;Object.defineProperty(u,_o,{enumerable:!1,value:{handleBounds:f||(d=c==null?void 0:c[_o])==null?void 0:d.handleBounds,z:l}}),i.set(a.id,u)}),Wat(i,n,o),i}function qat(e,t={}){const{getNodes:n,width:r,height:i,minZoom:o,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:f}=e(),d=t.initial&&!c&&u;if(a&&l&&(d||!t.initial)){const p=n().filter(v=>{var O;const y=t.includeHiddenNodes?v.width&&v.height:!v.hidden;return(O=t.nodes)!=null&&O.length?y&&t.nodes.some(m=>m.id===v.id):y}),g=p.every(v=>v.width&&v.height);if(p.length>0&&g){const v=Bge(p,f),{x:y,y:O,zoom:m}=Tat(v,r,i,t.minZoom??o,t.maxZoom??s,t.padding??.1),w=b0.translate(y,O).scale(m);return typeof t.duration=="number"&&t.duration>0?a.transform(b1(l,t.duration),w):a.transform(l,w),!0}}return!1}function bqn(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[_o]:r[_o],selected:n.selected})}),new Map(t)}function Oqn(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function t5({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:o,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=n();e!=null&&e.length&&(l&&r({nodeInternals:bqn(e,i)}),s==null||s(e)),t!=null&&t.length&&(c&&r({edges:Oqn(t,o)}),a==null||a(t))}const uw=()=>{},xqn={zoomIn:uw,zoomOut:uw,zoomTo:uw,getZoom:()=>1,setViewport:uw,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:uw,fitBounds:uw,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},wqn=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),Sqn=()=>{const e=ea(),{d3Zoom:t,d3Selection:n}=Mi(wqn,uc);return x.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(b1(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(b1(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(b1(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[s,a,l]=e.getState().transform,c=b0.translate(i.x??s,i.y??a).scale(i.zoom??l);t.transform(b1(n,o==null?void 0:o.duration),c)},getViewport:()=>{const[i,o,s]=e.getState().transform;return{x:i,y:o,zoom:s}},fitView:i=>qat(e.getState,i),setCenter:(i,o,s)=>{const{width:a,height:l,maxZoom:c}=e.getState(),u=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:c,f=a/2-i*u,d=l/2-o*u,h=b0.translate(f,d).scale(u);t.transform(b1(n,s==null?void 0:s.duration),h)},fitBounds:(i,o)=>{const{width:s,height:a,minZoom:l,maxZoom:c}=e.getState(),{x:u,y:f,zoom:d}=Tat(i,s,a,l,c,(o==null?void 0:o.padding)??.1),h=b0.translate(u,f).scale(d);t.transform(b1(n,o==null?void 0:o.duration),h)},project:i=>{const{transform:o,snapToGrid:s,snapGrid:a}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Dne(i,o,s,a)},screenToFlowPosition:i=>{const{transform:o,snapToGrid:s,snapGrid:a,domNode:l}=e.getState();if(!l)return i;const{x:c,y:u}=l.getBoundingClientRect(),f={x:i.x-c,y:i.y-u};return Dne(f,o,s,a)},flowToScreenPosition:i=>{const{transform:o,domNode:s}=e.getState();if(!s)return i;const{x:a,y:l}=s.getBoundingClientRect(),c=_at(i,o);return{x:c.x+a,y:c.y+l}},viewportInitialized:!0}:xqn,[t,n])};function Vge(){const e=Sqn(),t=ea(),n=x.useCallback(()=>t.getState().getNodes().map(g=>({...g})),[]),r=x.useCallback(g=>t.getState().nodeInternals.get(g),[]),i=x.useCallback(()=>{const{edges:g=[]}=t.getState();return g.map(v=>({...v}))},[]),o=x.useCallback(g=>{const{edges:v=[]}=t.getState();return v.find(y=>y.id===g)},[]),s=x.useCallback(g=>{const{getNodes:v,setNodes:y,hasDefaultNodes:O,onNodesChange:m}=t.getState(),w=v(),S=typeof g=="function"?g(w):g;if(O)y(S);else if(m){const E=S.length===0?w.map(C=>({type:"remove",id:C.id})):S.map(C=>({item:C,type:"reset"}));m(E)}},[]),a=x.useCallback(g=>{const{edges:v=[],setEdges:y,hasDefaultEdges:O,onEdgesChange:m}=t.getState(),w=typeof g=="function"?g(v):g;if(O)y(w);else if(m){const S=w.length===0?v.map(E=>({type:"remove",id:E.id})):w.map(E=>({item:E,type:"reset"}));m(S)}},[]),l=x.useCallback(g=>{const v=Array.isArray(g)?g:[g],{getNodes:y,setNodes:O,hasDefaultNodes:m,onNodesChange:w}=t.getState();if(m){const E=[...y(),...v];O(E)}else if(w){const S=v.map(E=>({item:E,type:"add"}));w(S)}},[]),c=x.useCallback(g=>{const v=Array.isArray(g)?g:[g],{edges:y=[],setEdges:O,hasDefaultEdges:m,onEdgesChange:w}=t.getState();if(m)O([...y,...v]);else if(w){const S=v.map(E=>({item:E,type:"add"}));w(S)}},[]),u=x.useCallback(()=>{const{getNodes:g,edges:v=[],transform:y}=t.getState(),[O,m,w]=y;return{nodes:g().map(S=>({...S})),edges:v.map(S=>({...S})),viewport:{x:O,y:m,zoom:w}}},[]),f=x.useCallback(({nodes:g,edges:v})=>{const{nodeInternals:y,getNodes:O,edges:m,hasDefaultNodes:w,hasDefaultEdges:S,onNodesDelete:E,onEdgesDelete:C,onNodesChange:k,onEdgesChange:P}=t.getState(),D=(g||[]).map(N=>N.id),M=(v||[]).map(N=>N.id),L=O().reduce((N,j)=>{const z=!D.includes(j.id)&&j.parentNode&&N.find(F=>F.id===j.parentNode);return(typeof j.deletable=="boolean"?j.deletable:!0)&&(D.includes(j.id)||z)&&N.push(j),N},[]),A=m.filter(N=>typeof N.deletable=="boolean"?N.deletable:!0),T=A.filter(N=>M.includes(N.id));if(L||T){const N=$at(L,A),j=[...T,...N],z=j.reduce((W,F)=>(W.includes(F.id)||W.push(F.id),W),[]);if((S||w)&&(S&&t.setState({edges:m.filter(W=>!z.includes(W.id))}),w&&(L.forEach(W=>{y.delete(W.id)}),t.setState({nodeInternals:new Map(y)}))),z.length>0&&(C==null||C(j),P&&P(z.map(W=>({id:W,type:"remove"})))),L.length>0&&(E==null||E(L),k)){const W=L.map(F=>({id:F.id,type:"remove"}));k(W)}}},[]),d=x.useCallback(g=>{const v=WWn(g),y=v?null:t.getState().nodeInternals.get(g.id);return!v&&!y?[null,null,v]:[v?g:UPe(y),y,v]},[]),h=x.useCallback((g,v=!0,y)=>{const[O,m,w]=d(g);return O?(y||t.getState().getNodes()).filter(S=>{if(!w&&(S.id===m.id||!S.positionAbsolute))return!1;const E=UPe(S),C=Tne(E,O);return v&&C>0||C>=O.width*O.height}):[]},[]),p=x.useCallback((g,v,y=!0)=>{const[O]=d(g);if(!O)return!1;const m=Tne(O,v);return y&&m>0||m>=O.width*O.height},[]);return x.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:o,setNodes:s,setEdges:a,addNodes:l,addEdges:c,toObject:u,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:p}),[e,n,r,i,o,s,a,l,c,u,f,h,p])}const Eqn={actInsideInputWithModifier:!1};var Cqn=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=ea(),{deleteElements:r}=Vge(),i=nR(e,Eqn),o=nR(t);x.useEffect(()=>{if(i){const{edges:s,getNodes:a}=n.getState(),l=a().filter(u=>u.selected),c=s.filter(u=>u.selected);r({nodes:l,edges:c}),n.setState({nodesSelectionActive:!1})}},[i]),x.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function _qn(e){const t=ea();x.useEffect(()=>{let n;const r=()=>{var o,s;if(!e.current)return;const i=Nge(e.current);(i.height===0||i.width===0)&&((s=(o=t.getState()).onError)==null||s.call(o,"004",sm.error004())),t.setState({width:i.width||500,height:i.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const Uge={position:"absolute",width:"100%",height:"100%",top:0,left:0},kqn=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,n5=e=>({x:e.x,y:e.y,zoom:e.k}),fw=(e,t)=>e.target.closest(`.${t}`),nAe=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),rAe=e=>{const t=e.ctrlKey&&k7()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},$qn=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Tqn=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=Wy.Free,zoomOnDoubleClick:c=!0,elementsSelectable:u,panOnDrag:f=!0,defaultViewport:d,translateExtent:h,minZoom:p,maxZoom:g,zoomActivationKeyCode:v,preventScrolling:y=!0,children:O,noWheelClassName:m,noPanClassName:w})=>{const S=x.useRef(),E=ea(),C=x.useRef(!1),k=x.useRef(!1),P=x.useRef(null),D=x.useRef({x:0,y:0,zoom:0}),{d3Zoom:M,d3Selection:L,d3ZoomHandler:A,userSelectionActive:T}=Mi($qn,uc),N=nR(v),j=x.useRef(0),z=x.useRef(!1),W=x.useRef();return _qn(P),x.useEffect(()=>{if(P.current){const F=P.current.getBoundingClientRect(),q=MWn().scaleExtent([p,g]).translateExtent(h),U=ed(P.current).call(q),V=b0.translate(d.x,d.y).scale(AC(d.zoom,p,g)),H=[[0,0],[F.width,F.height]],Z=q.constrain()(V,H,h);q.transform(U,Z),q.wheelDelta(rAe),E.setState({d3Zoom:q,d3Selection:U,d3ZoomHandler:U.on("wheel.zoom"),transform:[Z.x,Z.y,Z.k],domNode:P.current.closest(".react-flow")})}},[]),x.useEffect(()=>{L&&M&&(s&&!N&&!T?L.on("wheel.zoom",F=>{if(fw(F,m))return!1;F.preventDefault(),F.stopImmediatePropagation();const q=L.property("__zoom").k||1,U=k7();if(F.ctrlKey&&o&&U){const ae=hh(F),de=rAe(F),me=q*Math.pow(2,de);M.scaleTo(L,me,ae,F);return}const V=F.deltaMode===1?20:1;let H=l===Wy.Vertical?0:F.deltaX*V,Z=l===Wy.Horizontal?0:F.deltaY*V;!U&&F.shiftKey&&l!==Wy.Vertical&&(H=F.deltaY*V,Z=0),M.translateBy(L,-(H/q)*a,-(Z/q)*a,{internal:!0});const ee=n5(L.property("__zoom")),{onViewportChangeStart:se,onViewportChange:fe,onViewportChangeEnd:ce}=E.getState();clearTimeout(W.current),z.current||(z.current=!0,t==null||t(F,ee),se==null||se(ee)),z.current&&(e==null||e(F,ee),fe==null||fe(ee),W.current=setTimeout(()=>{n==null||n(F,ee),ce==null||ce(ee),z.current=!1},150))},{passive:!1}):typeof A<"u"&&L.on("wheel.zoom",function(F,q){if(!y||fw(F,m))return null;F.preventDefault(),A.call(this,F,q)},{passive:!1}))},[T,s,l,L,M,A,N,o,y,m,t,e,n]),x.useEffect(()=>{M&&M.on("start",F=>{var V,H;if(!F.sourceEvent||F.sourceEvent.internal)return null;j.current=(V=F.sourceEvent)==null?void 0:V.button;const{onViewportChangeStart:q}=E.getState(),U=n5(F.transform);C.current=!0,D.current=U,((H=F.sourceEvent)==null?void 0:H.type)==="mousedown"&&E.setState({paneDragging:!0}),q==null||q(U),t==null||t(F.sourceEvent,U)})},[M,t]),x.useEffect(()=>{M&&(T&&!C.current?M.on("zoom",null):T||M.on("zoom",F=>{var U;const{onViewportChange:q}=E.getState();if(E.setState({transform:[F.transform.x,F.transform.y,F.transform.k]}),k.current=!!(r&&nAe(f,j.current??0)),(e||q)&&!((U=F.sourceEvent)!=null&&U.internal)){const V=n5(F.transform);q==null||q(V),e==null||e(F.sourceEvent,V)}}))},[T,M,e,f,r]),x.useEffect(()=>{M&&M.on("end",F=>{if(!F.sourceEvent||F.sourceEvent.internal)return null;const{onViewportChangeEnd:q}=E.getState();if(C.current=!1,E.setState({paneDragging:!1}),r&&nAe(f,j.current??0)&&!k.current&&r(F.sourceEvent),k.current=!1,(n||q)&&kqn(D.current,F.transform)){const U=n5(F.transform);D.current=U,clearTimeout(S.current),S.current=setTimeout(()=>{q==null||q(U),n==null||n(F.sourceEvent,U)},s?150:0)}})},[M,s,f,n,r]),x.useEffect(()=>{M&&M.filter(F=>{const q=N||i,U=o&&F.ctrlKey;if((f===!0||Array.isArray(f)&&f.includes(1))&&F.button===1&&F.type==="mousedown"&&(fw(F,"react-flow__node")||fw(F,"react-flow__edge")))return!0;if(!f&&!q&&!s&&!c&&!o||T||!c&&F.type==="dblclick"||fw(F,m)&&F.type==="wheel"||fw(F,w)&&(F.type!=="wheel"||s&&F.type==="wheel"&&!N)||!o&&F.ctrlKey&&F.type==="wheel"||!q&&!s&&!U&&F.type==="wheel"||!f&&(F.type==="mousedown"||F.type==="touchstart")||Array.isArray(f)&&!f.includes(F.button)&&(F.type==="mousedown"||F.type==="touchstart"))return!1;const V=Array.isArray(f)&&f.includes(F.button)||!F.button||F.button<=1;return(!F.ctrlKey||F.type==="wheel")&&V})},[T,M,i,o,s,c,f,u,N]),ie.createElement("div",{className:"react-flow__renderer",ref:P,style:Uge},O)},Pqn=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Aqn(){const{userSelectionActive:e,userSelectionRect:t}=Mi(Pqn,uc);return e&&t?ie.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function iAe(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,i=t.position.y+t.height-n.height;if(r>0||i>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),i>0&&(n.style.height+=i),t.position.x<0){const o=Math.abs(t.position.x);n.position.x=n.position.x-o,n.style.width+=o,t.position.x=0}if(t.position.y<0){const o=Math.abs(t.position.y);n.position.y=n.position.y-o,n.style.height+=o,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function Vat(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,i)=>{const o=e.filter(a=>a.id===i.id);if(o.length===0)return r.push(i),r;const s={...i};for(const a of o)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position<"u"&&(s.position=a.position),typeof a.positionAbsolute<"u"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&iAe(r,s);break}case"dimensions":{typeof a.dimensions<"u"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle<"u"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&iAe(r,s);break}case"remove":return r}return r.push(s),r},n)}function Uat(e,t){return Vat(e,t)}function Rqn(e,t){return Vat(e,t)}const uy=(e,t)=>({id:e,type:"select",selected:t});function oS(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(uy(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(uy(r.id,!1))),n},[])}const tX=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Dqn=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Hat=x.memo(({isSelecting:e,selectionMode:t=eR.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:o,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:u,children:f})=>{const d=x.useRef(null),h=ea(),p=x.useRef(0),g=x.useRef(0),v=x.useRef(),{userSelectionActive:y,elementsSelectable:O,dragging:m}=Mi(Dqn,uc),w=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,g.current=0},S=A=>{o==null||o(A),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},E=A=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){A.preventDefault();return}s==null||s(A)},C=a?A=>a(A):void 0,k=A=>{const{resetSelectedElements:T,domNode:N}=h.getState();if(v.current=N==null?void 0:N.getBoundingClientRect(),!O||!e||A.button!==0||A.target!==d.current||!v.current)return;const{x:j,y:z}=O0(A,v.current);T(),h.setState({userSelectionRect:{width:0,height:0,startX:j,startY:z,x:j,y:z}}),r==null||r(A)},P=A=>{const{userSelectionRect:T,nodeInternals:N,edges:j,transform:z,onNodesChange:W,onEdgesChange:F,nodeOrigin:q,getNodes:U}=h.getState();if(!e||!v.current||!T)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const V=O0(A,v.current),H=T.startX??0,Z=T.startY??0,ee={...T,x:V.x<H?V.x:H,y:V.y<Z?V.y:Z,width:Math.abs(V.x-H),height:Math.abs(V.y-Z)},se=U(),fe=kat(N,ee,z,t===eR.Partial,!0,q),ce=$at(fe,j).map(de=>de.id),ae=fe.map(de=>de.id);if(p.current!==ae.length){p.current=ae.length;const de=oS(se,ae);de.length&&(W==null||W(de))}if(g.current!==ce.length){g.current=ce.length;const de=oS(j,ce);de.length&&(F==null||F(de))}h.setState({userSelectionRect:ee})},D=A=>{if(A.button!==0)return;const{userSelectionRect:T}=h.getState();!y&&T&&A.target===d.current&&(S==null||S(A)),h.setState({nodesSelectionActive:p.current>0}),w(),i==null||i(A)},M=A=>{y&&(h.setState({nodesSelectionActive:p.current>0}),i==null||i(A)),w()},L=O&&(e||y);return ie.createElement("div",{className:Af(["react-flow__pane",{dragging:m,selection:e}]),onClick:L?void 0:tX(S,d),onContextMenu:tX(E,d),onWheel:tX(C,d),onMouseEnter:L?void 0:l,onMouseDown:L?k:void 0,onMouseMove:L?P:c,onMouseUp:L?D:void 0,onMouseLeave:L?M:u,ref:d,style:Uge},f,ie.createElement(Aqn,null))});Hat.displayName="Pane";function Xat(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:Xat(n,t):!1}function oAe(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function Mqn(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||!Xat(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var o,s;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=i.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((s=i.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode,width:i.width,height:i.height,expandParent:i.expandParent}})}function Nqn(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function Zat(e,t,n,r,i=[0,0],o){const s=Nqn(e,e.extent||r);let a=s;if(e.extent==="parent"&&!e.expandParent)if(e.parentNode&&e.width&&e.height){const u=n.get(e.parentNode),{x:f,y:d}=XS(u,i).positionAbsolute;a=u&&Gu(f)&&Gu(d)&&Gu(u.width)&&Gu(u.height)?[[f+e.width*i[0],d+e.height*i[1]],[f+u.width-e.width+e.width*i[0],d+u.height-e.height+e.height*i[1]]]:a}else o==null||o("005",sm.error005()),a=s;else if(e.extent&&e.parentNode&&e.extent!=="parent"){const u=n.get(e.parentNode),{x:f,y:d}=XS(u,i).positionAbsolute;a=[[e.extent[0][0]+f,e.extent[0][1]+d],[e.extent[1][0]+f,e.extent[1][1]+d]]}let l={x:0,y:0};if(e.parentNode){const u=n.get(e.parentNode);l=XS(u,i).positionAbsolute}const c=a&&a!=="parent"?Ige(t,a):t;return{position:{x:c.x-l.x,y:c.y-l.y},positionAbsolute:c}}function nX({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(i=>({...n.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?r.find(i=>i.id===e):r[0],r]}const sAe=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const o=Array.from(i),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return o.map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(c.left-s.left-a.x)/n,y:(c.top-s.top-a.y)/n,...Nge(l)}})};function f$(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function Nne({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeInternals:a,onError:l}=t.getState(),c=a.get(e);if(!c){l==null||l("012",sm.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):i([e])}function Iqn(){const e=ea();return x.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:i,snapToGrid:o}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,l={x:(s-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:o?i[0]*Math.round(l.x/i[0]):l.x,ySnapped:o?i[1]*Math.round(l.y/i[1]):l.y,...l}},[])}function rX(e){return(t,n,r)=>e==null?void 0:e(t,r)}function Yat({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:s}){const a=ea(),[l,c]=x.useState(!1),u=x.useRef([]),f=x.useRef({x:null,y:null}),d=x.useRef(0),h=x.useRef(null),p=x.useRef({x:0,y:0}),g=x.useRef(null),v=x.useRef(!1),y=x.useRef(!1),O=Iqn();return x.useEffect(()=>{if(e!=null&&e.current){const m=ed(e.current),w=({x:C,y:k})=>{const{nodeInternals:P,onNodeDrag:D,onSelectionDrag:M,updateNodePositions:L,nodeExtent:A,snapGrid:T,snapToGrid:N,nodeOrigin:j,onError:z}=a.getState();f.current={x:C,y:k};let W=!1,F={x:0,y:0,x2:0,y2:0};if(u.current.length>1&&A){const U=Bge(u.current,j);F=Lge(U)}if(u.current=u.current.map(U=>{const V={x:C-U.distance.x,y:k-U.distance.y};N&&(V.x=T[0]*Math.round(V.x/T[0]),V.y=T[1]*Math.round(V.y/T[1]));const H=[[A[0][0],A[0][1]],[A[1][0],A[1][1]]];u.current.length>1&&A&&!U.extent&&(H[0][0]=U.positionAbsolute.x-F.x+A[0][0],H[1][0]=U.positionAbsolute.x+(U.width??0)-F.x2+A[1][0],H[0][1]=U.positionAbsolute.y-F.y+A[0][1],H[1][1]=U.positionAbsolute.y+(U.height??0)-F.y2+A[1][1]);const Z=Zat(U,V,P,H,j,z);return W=W||U.position.x!==Z.position.x||U.position.y!==Z.position.y,U.position=Z.position,U.positionAbsolute=Z.positionAbsolute,U}),!W)return;L(u.current,!0,!0),c(!0);const q=i?D:rX(M);if(q&&g.current){const[U,V]=nX({nodeId:i,dragItems:u.current,nodeInternals:P});q(g.current,U,V)}},S=()=>{if(!h.current)return;const[C,k]=vat(p.current,h.current);if(C!==0||k!==0){const{transform:P,panBy:D}=a.getState();f.current.x=(f.current.x??0)-C/P[2],f.current.y=(f.current.y??0)-k/P[2],D({x:C,y:k})&&w(f.current)}d.current=requestAnimationFrame(S)},E=C=>{var j;const{nodeInternals:k,multiSelectionActive:P,nodesDraggable:D,unselectNodesAndEdges:M,onNodeDragStart:L,onSelectionDragStart:A}=a.getState();y.current=!0;const T=i?L:rX(A);(!s||!o)&&!P&&i&&((j=k.get(i))!=null&&j.selected||M()),i&&o&&s&&Nne({id:i,store:a,nodeRef:e});const N=O(C);if(f.current=N,u.current=Mqn(k,D,N,i),T&&u.current){const[z,W]=nX({nodeId:i,dragItems:u.current,nodeInternals:k});T(C.sourceEvent,z,W)}};if(t)m.on(".drag",null);else{const C=OBn().on("start",k=>{const{domNode:P,nodeDragThreshold:D}=a.getState();D===0&&E(k);const M=O(k);f.current=M,h.current=(P==null?void 0:P.getBoundingClientRect())||null,p.current=O0(k.sourceEvent,h.current)}).on("drag",k=>{var L,A;const P=O(k),{autoPanOnNodeDrag:D,nodeDragThreshold:M}=a.getState();if(!v.current&&y.current&&D&&(v.current=!0,S()),!y.current){const T=P.xSnapped-(((L=f==null?void 0:f.current)==null?void 0:L.x)??0),N=P.ySnapped-(((A=f==null?void 0:f.current)==null?void 0:A.y)??0);Math.sqrt(T*T+N*N)>M&&E(k)}(f.current.x!==P.xSnapped||f.current.y!==P.ySnapped)&&u.current&&y.current&&(g.current=k.sourceEvent,p.current=O0(k.sourceEvent,h.current),w(P))}).on("end",k=>{if(y.current&&(c(!1),v.current=!1,y.current=!1,cancelAnimationFrame(d.current),u.current)){const{updateNodePositions:P,nodeInternals:D,onNodeDragStop:M,onSelectionDragStop:L}=a.getState(),A=i?M:rX(L);if(P(u.current,!1,!1),A){const[T,N]=nX({nodeId:i,dragItems:u.current,nodeInternals:D});A(k.sourceEvent,T,N)}}}).filter(k=>{const P=k.target;return!k.button&&(!n||!oAe(P,`.${n}`,e))&&(!r||oAe(P,r,e))});return m.call(C),()=>{m.on(".drag",null)}}}},[e,t,n,r,o,a,i,s,O]),l}function Gat(){const e=ea();return x.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:o,getNodes:s,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:u}=e.getState(),f=s().filter(O=>O.selected&&(O.draggable||u&&typeof O.draggable>"u")),d=a?l[0]:5,h=a?l[1]:5,p=n.isShiftPressed?4:1,g=n.x*d*p,v=n.y*h*p,y=f.map(O=>{if(O.positionAbsolute){const m={x:O.positionAbsolute.x+g,y:O.positionAbsolute.y+v};a&&(m.x=l[0]*Math.round(m.x/l[0]),m.y=l[1]*Math.round(m.y/l[1]));const{positionAbsolute:w,position:S}=Zat(O,m,r,i,void 0,c);O.position=S,O.positionAbsolute=w}return O});o(y,!0,!1)},[])}const ZS={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var d$=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:u,onMouseEnter:f,onMouseMove:d,onMouseLeave:h,onContextMenu:p,onDoubleClick:g,style:v,className:y,isDraggable:O,isSelectable:m,isConnectable:w,isFocusable:S,selectNodesOnDrag:E,sourcePosition:C,targetPosition:k,hidden:P,resizeObserver:D,dragHandle:M,zIndex:L,isParent:A,noDragClassName:T,noPanClassName:N,initialized:j,disableKeyboardA11y:z,ariaLabel:W,rfId:F,hasHandleBounds:q})=>{const U=ea(),V=x.useRef(null),H=x.useRef(C),Z=x.useRef(k),ee=x.useRef(r),se=m||O||u||f||d||h,fe=Gat(),ce=f$(n,U.getState,f),ae=f$(n,U.getState,d),de=f$(n,U.getState,h),me=f$(n,U.getState,p),te=f$(n,U.getState,g),Ee=je=>{const{nodeDragThreshold:nt}=U.getState();if(m&&(!E||!O||nt>0)&&Nne({id:n,store:U,nodeRef:V}),u){const Re=U.getState().nodeInternals.get(n);Re&&u(je,{...Re})}},we=je=>{if(!Pne(je))if(Oat.includes(je.key)&&m){const nt=je.key==="Escape";Nne({id:n,store:U,unselect:nt,nodeRef:V})}else!z&&O&&c&&Object.prototype.hasOwnProperty.call(ZS,je.key)&&(U.setState({ariaLiveMessage:`Moved selected node ${je.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~s}`}),fe({x:ZS[je.key].x,y:ZS[je.key].y,isShiftPressed:je.shiftKey}))};x.useEffect(()=>()=>{V.current&&(D==null||D.unobserve(V.current))},[]),x.useEffect(()=>{if(V.current&&!P){const je=V.current;(!j||!q)&&(D==null||D.unobserve(je),D==null||D.observe(je))}},[P,j,q]),x.useEffect(()=>{const je=ee.current!==r,nt=H.current!==C,Re=Z.current!==k;V.current&&(je||nt||Re)&&(je&&(ee.current=r),nt&&(H.current=C),Re&&(Z.current=k),U.getState().updateNodeDimensions([{id:n,nodeElement:V.current,forceUpdate:!0}]))},[n,r,C,k]);const ke=Yat({nodeRef:V,disabled:P||!O,noDragClassName:T,handleSelector:M,nodeId:n,isSelectable:m,selectNodesOnDrag:E});return P?null:ie.createElement("div",{className:Af(["react-flow__node",`react-flow__node-${r}`,{[N]:O},y,{selected:c,selectable:m,parent:A,dragging:ke}]),ref:V,style:{zIndex:L,transform:`translate(${a}px,${l}px)`,pointerEvents:se?"all":"none",visibility:j?"visible":"hidden",...v},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:ce,onMouseMove:ae,onMouseLeave:de,onContextMenu:me,onClick:Ee,onDoubleClick:te,onKeyDown:S?we:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":z?void 0:`${zat}-${F}`,"aria-label":W},ie.createElement(YWn,{value:n},ie.createElement(e,{id:n,data:i,type:r,xPos:o,yPos:s,selected:c,isConnectable:w,sourcePosition:C,targetPosition:k,dragging:ke,dragHandle:M,zIndex:L})))};return t.displayName="NodeWrapper",x.memo(t)};const Lqn=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Bge(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function jqn({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ea(),{width:i,height:o,x:s,y:a,transformString:l,userSelectionActive:c}=Mi(Lqn,uc),u=Gat(),f=x.useRef(null);if(x.useEffect(()=>{var p;n||(p=f.current)==null||p.focus({preventScroll:!0})},[n]),Yat({nodeRef:f}),c||!i||!o)return null;const d=e?p=>{const g=r.getState().getNodes().filter(v=>v.selected);e(p,g)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(ZS,p.key)&&u({x:ZS[p.key].x,y:ZS[p.key].y,isShiftPressed:p.shiftKey})};return ie.createElement("div",{className:Af(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l}},ie.createElement("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:o,top:a,left:s}}))}var Fqn=x.memo(jqn);const zqn=e=>e.nodesSelectionActive,Kat=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:u,selectionKeyCode:f,selectionOnDrag:d,selectionMode:h,onSelectionStart:p,onSelectionEnd:g,multiSelectionKeyCode:v,panActivationKeyCode:y,zoomActivationKeyCode:O,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:S,panOnScroll:E,panOnScrollSpeed:C,panOnScrollMode:k,zoomOnDoubleClick:P,panOnDrag:D,defaultViewport:M,translateExtent:L,minZoom:A,maxZoom:T,preventScrolling:N,onSelectionContextMenu:j,noWheelClassName:z,noPanClassName:W,disableKeyboardA11y:F})=>{const q=Mi(zqn),U=nR(f),V=nR(y),H=V||D,Z=V||E,ee=U||d&&H!==!0;return Cqn({deleteKeyCode:a,multiSelectionKeyCode:v}),ie.createElement(Tqn,{onMove:l,onMoveStart:c,onMoveEnd:u,onPaneContextMenu:o,elementsSelectable:m,zoomOnScroll:w,zoomOnPinch:S,panOnScroll:Z,panOnScrollSpeed:C,panOnScrollMode:k,zoomOnDoubleClick:P,panOnDrag:!U&&H,defaultViewport:M,translateExtent:L,minZoom:A,maxZoom:T,zoomActivationKeyCode:O,preventScrolling:N,noWheelClassName:z,noPanClassName:W},ie.createElement(Hat,{onSelectionStart:p,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:H,isSelecting:!!ee,selectionMode:h},e,q&&ie.createElement(Fqn,{onSelectionContextMenu:j,noPanClassName:W,disableKeyboardA11y:F})))};Kat.displayName="FlowRenderer";var Qqn=x.memo(Kat);function Bqn(e){return Mi(x.useCallback(n=>e?kat(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function Wqn(e){const t={input:d$(e.input||Iat),default:d$(e.default||Mne),output:d$(e.output||jat),group:d$(e.group||qge)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=d$(e[o]||Mne),i),n);return{...t,...r}}const qqn=({x:e,y:t,width:n,height:r,origin:i})=>!n||!r?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-n*i[0],y:t-r*i[1]},Vqn=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Jat=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:s}=Mi(Vqn,uc),a=Bqn(e.onlyRenderVisibleElements),l=x.useRef(),c=x.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const u=new ResizeObserver(f=>{const d=f.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));o(d)});return l.current=u,u},[]);return x.useEffect(()=>()=>{var u;(u=l==null?void 0:l.current)==null||u.disconnect()},[]),ie.createElement("div",{className:"react-flow__nodes",style:Uge},a.map(u=>{var S,E,C;let f=u.type||"default";e.nodeTypes[f]||(s==null||s("003",sm.error003(f)),f="default");const d=e.nodeTypes[f]||e.nodeTypes.default,h=!!(u.draggable||t&&typeof u.draggable>"u"),p=!!(u.selectable||i&&typeof u.selectable>"u"),g=!!(u.connectable||n&&typeof u.connectable>"u"),v=!!(u.focusable||r&&typeof u.focusable>"u"),y=e.nodeExtent?Ige(u.positionAbsolute,e.nodeExtent):u.positionAbsolute,O=(y==null?void 0:y.x)??0,m=(y==null?void 0:y.y)??0,w=qqn({x:O,y:m,width:u.width??0,height:u.height??0,origin:e.nodeOrigin});return ie.createElement(d,{key:u.id,id:u.id,className:u.className,style:u.style,type:f,data:u.data,sourcePosition:u.sourcePosition||$t.Bottom,targetPosition:u.targetPosition||$t.Top,hidden:u.hidden,xPos:O,yPos:m,xPosOrigin:w.x,yPosOrigin:w.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!u.selected,isDraggable:h,isSelectable:p,isConnectable:g,isFocusable:v,resizeObserver:c,dragHandle:u.dragHandle,zIndex:((S=u[_o])==null?void 0:S.z)??0,isParent:!!((E=u[_o])!=null&&E.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!u.width&&!!u.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:u.ariaLabel,hasHandleBounds:!!((C=u[_o])!=null&&C.handleBounds)})}))};Jat.displayName="NodeRenderer";var Uqn=x.memo(Jat);const Hqn=(e,t,n)=>n===$t.Left?e-t:n===$t.Right?e+t:e,Xqn=(e,t,n)=>n===$t.Top?e-t:n===$t.Bottom?e+t:e,aAe="react-flow__edgeupdater",lAe=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:a})=>ie.createElement("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:Af([aAe,`${aAe}-${a}`]),cx:Hqn(t,r,e),cy:Xqn(n,r,e),r,stroke:"transparent",fill:"transparent"}),Zqn=()=>!0;var dw=e=>{const t=({id:n,className:r,type:i,data:o,onClick:s,onEdgeDoubleClick:a,selected:l,animated:c,label:u,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:g,style:v,source:y,target:O,sourceX:m,sourceY:w,targetX:S,targetY:E,sourcePosition:C,targetPosition:k,elementsSelectable:P,hidden:D,sourceHandleId:M,targetHandleId:L,onContextMenu:A,onMouseEnter:T,onMouseMove:N,onMouseLeave:j,edgeUpdaterRadius:z,onEdgeUpdate:W,onEdgeUpdateStart:F,onEdgeUpdateEnd:q,markerEnd:U,markerStart:V,rfId:H,ariaLabel:Z,isFocusable:ee,isUpdatable:se,pathOptions:fe,interactionWidth:ce})=>{const ae=x.useRef(null),[de,me]=x.useState(!1),[te,Ee]=x.useState(!1),we=ea(),ke=x.useMemo(()=>`url('#${Rne(V,H)}')`,[V,H]),je=x.useMemo(()=>`url('#${Rne(U,H)}')`,[U,H]);if(D)return null;const nt=yn=>{var Ht;const{edges:_n,addSelectedEdges:ri,unselectNodesAndEdges:hi,multiSelectionActive:Qt}=we.getState(),An=_n.find(rr=>rr.id===n);An&&(P&&(we.setState({nodesSelectionActive:!1}),An.selected&&Qt?(hi({nodes:[],edges:[An]}),(Ht=ae.current)==null||Ht.blur()):ri([n])),s&&s(yn,An))},Re=u$(n,we.getState,a),G=u$(n,we.getState,A),le=u$(n,we.getState,T),Oe=u$(n,we.getState,N),Ue=u$(n,we.getState,j),Fe=(yn,_n)=>{if(yn.button!==0)return;const{edges:ri,isValidConnection:hi}=we.getState(),Qt=_n?O:y,An=(_n?L:M)||null,Ht=_n?"target":"source",rr=hi||Zqn,Ci=_n,xs=ri.find(Rr=>Rr.id===n);Ee(!0),F==null||F(yn,xs,Ht);const Ar=Rr=>{Ee(!1),q==null||q(Rr,xs,Ht)};Rat({event:yn,handleId:An,nodeId:Qt,onConnect:Rr=>W==null?void 0:W(xs,Rr),isTarget:Ci,getState:we.getState,setState:we.setState,isValidConnection:rr,edgeUpdaterType:Ht,onEdgeUpdateEnd:Ar})},ye=yn=>Fe(yn,!0),Me=yn=>Fe(yn,!1),pt=()=>me(!0),at=()=>me(!1),ht=!P&&!s,_t=yn=>{var _n;if(Oat.includes(yn.key)&&P){const{unselectNodesAndEdges:ri,addSelectedEdges:hi,edges:Qt}=we.getState();yn.key==="Escape"?((_n=ae.current)==null||_n.blur(),ri({edges:[Qt.find(Ht=>Ht.id===n)]})):hi([n])}};return ie.createElement("g",{className:Af(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:l,animated:c,inactive:ht,updating:de}]),onClick:nt,onDoubleClick:Re,onContextMenu:G,onMouseEnter:le,onMouseMove:Oe,onMouseLeave:Ue,onKeyDown:ee?_t:void 0,tabIndex:ee?0:void 0,role:ee?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":Z===null?void 0:Z||`Edge from ${y} to ${O}`,"aria-describedby":ee?`${Qat}-${H}`:void 0,ref:ae},!te&&ie.createElement(e,{id:n,source:y,target:O,selected:l,animated:c,label:u,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:g,data:o,style:v,sourceX:m,sourceY:w,targetX:S,targetY:E,sourcePosition:C,targetPosition:k,sourceHandleId:M,targetHandleId:L,markerStart:ke,markerEnd:je,pathOptions:fe,interactionWidth:ce}),se&&ie.createElement(ie.Fragment,null,(se==="source"||se===!0)&&ie.createElement(lAe,{position:C,centerX:m,centerY:w,radius:z,onMouseDown:ye,onMouseEnter:pt,onMouseOut:at,type:"source"}),(se==="target"||se===!0)&&ie.createElement(lAe,{position:k,centerX:S,centerY:E,radius:z,onMouseDown:Me,onMouseEnter:pt,onMouseOut:at,type:"target"})))};return t.displayName="EdgeWrapper",x.memo(t)};function Yqn(e){const t={default:dw(e.default||$7),straight:dw(e.bezier||zge),step:dw(e.step||Fge),smoothstep:dw(e.step||LB),simplebezier:dw(e.simplebezier||jge)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=dw(e[o]||$7),i),n);return{...t,...r}}function cAe(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,i=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case $t.Top:return{x:r+o/2,y:i};case $t.Right:return{x:r+o,y:i+s/2};case $t.Bottom:return{x:r+o/2,y:i+s};case $t.Left:return{x:r,y:i+s/2}}}function uAe(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const Gqn=(e,t,n,r,i,o)=>{const s=cAe(n,e,t),a=cAe(o,r,i);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function Kqn({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:o,width:s,height:a,transform:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+r,t.y+o)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=Lge({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),f=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),d=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(f*d)>0}function fAe(e){var r,i,o,s,a;const t=((r=e==null?void 0:e[_o])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const Jqn=[{level:0,isMaxLevel:!0,edges:[]}];function eVn(e,t,n=!1){let r=-1;const i=e.reduce((s,a)=>{var u,f;const l=Gu(a.zIndex);let c=l?a.zIndex:0;if(n){const d=t.get(a.target),h=t.get(a.source),p=a.selected||(d==null?void 0:d.selected)||(h==null?void 0:h.selected),g=Math.max(((u=h==null?void 0:h[_o])==null?void 0:u.z)||0,((f=d==null?void 0:d[_o])==null?void 0:f.z)||0,1e3);c=(l?a.zIndex:0)+(p?g:0)}return s[c]?s[c].push(a):s[c]=[a],r=c>r?c:r,s},{}),o=Object.entries(i).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===r}});return o.length===0?Jqn:o}function tVn(e,t,n){const r=Mi(x.useCallback(i=>e?i.edges.filter(o=>{const s=t.get(o.source),a=t.get(o.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&Kqn({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return eVn(r,t,n)}const nVn=({color:e="none",strokeWidth:t=1})=>ie.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),rVn=({color:e="none",strokeWidth:t=1})=>ie.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),dAe={[tR.Arrow]:nVn,[tR.ArrowClosed]:rVn};function iVn(e){const t=ea();return x.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(dAe,e)?dAe[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",sm.error009(e)),null)},[e])}const oVn=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=iVn(t);return l?ie.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0"},ie.createElement(l,{color:n,strokeWidth:s})):null},sVn=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((i,o)=>([o.markerStart,o.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=Rne(s,t);r.includes(a)||(i.push({id:a,color:s.color||e,...s}),r.push(a))}}),i),[]).sort((i,o)=>i.id.localeCompare(o.id))},elt=({defaultColor:e,rfId:t})=>{const n=Mi(x.useCallback(sVn({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,s)=>o.id!==i[s].id)));return ie.createElement("defs",null,n.map(r=>ie.createElement(oVn,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};elt.displayName="MarkerDefinitions";var aVn=x.memo(elt);const lVn=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),tlt=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:o,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:f,edgeUpdaterRadius:d,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:g,children:v})=>{const{edgesFocusable:y,edgesUpdatable:O,elementsSelectable:m,width:w,height:S,connectionMode:E,nodeInternals:C,onError:k}=Mi(lVn,uc),P=tVn(t,C,n);return w?ie.createElement(ie.Fragment,null,P.map(({level:D,edges:M,isMaxLevel:L})=>ie.createElement("svg",{key:D,style:{zIndex:D},width:w,height:S,className:"react-flow__edges react-flow__container"},L&&ie.createElement(aVn,{defaultColor:e,rfId:r}),ie.createElement("g",null,M.map(A=>{const[T,N,j]=fAe(C.get(A.source)),[z,W,F]=fAe(C.get(A.target));if(!j||!F)return null;let q=A.type||"default";i[q]||(k==null||k("011",sm.error011(q)),q="default");const U=i[q]||i.default,V=E===jO.Strict?W.target:(W.target??[]).concat(W.source??[]),H=uAe(N.source,A.sourceHandle),Z=uAe(V,A.targetHandle),ee=(H==null?void 0:H.position)||$t.Bottom,se=(Z==null?void 0:Z.position)||$t.Top,fe=!!(A.focusable||y&&typeof A.focusable>"u"),ce=typeof s<"u"&&(A.updatable||O&&typeof A.updatable>"u");if(!H||!Z)return k==null||k("008",sm.error008(H,A)),null;const{sourceX:ae,sourceY:de,targetX:me,targetY:te}=Gqn(T,H,ee,z,Z,se);return ie.createElement(U,{key:A.id,id:A.id,className:Af([A.className,o]),type:q,data:A.data,selected:!!A.selected,animated:!!A.animated,hidden:!!A.hidden,label:A.label,labelStyle:A.labelStyle,labelShowBg:A.labelShowBg,labelBgStyle:A.labelBgStyle,labelBgPadding:A.labelBgPadding,labelBgBorderRadius:A.labelBgBorderRadius,style:A.style,source:A.source,target:A.target,sourceHandleId:A.sourceHandle,targetHandleId:A.targetHandle,markerEnd:A.markerEnd,markerStart:A.markerStart,sourceX:ae,sourceY:de,targetX:me,targetY:te,sourcePosition:ee,targetPosition:se,elementsSelectable:m,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:f,edgeUpdaterRadius:d,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:g,rfId:r,ariaLabel:A.ariaLabel,isFocusable:fe,isUpdatable:ce,pathOptions:"pathOptions"in A?A.pathOptions:void 0,interactionWidth:A.interactionWidth})})))),v):null};tlt.displayName="EdgeRenderer";var cVn=x.memo(tlt);const uVn=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function fVn({children:e}){const t=Mi(uVn);return ie.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function dVn(e){const t=Vge(),n=x.useRef(!1);x.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const hVn={[$t.Left]:$t.Right,[$t.Right]:$t.Left,[$t.Top]:$t.Bottom,[$t.Bottom]:$t.Top},nlt=({nodeId:e,handleType:t,style:n,type:r=by.Bezier,CustomComponent:i,connectionStatus:o})=>{var E,C,k;const{fromNode:s,handleId:a,toX:l,toY:c,connectionMode:u}=Mi(x.useCallback(P=>({fromNode:P.nodeInternals.get(e),handleId:P.connectionHandleId,toX:(P.connectionPosition.x-P.transform[0])/P.transform[2],toY:(P.connectionPosition.y-P.transform[1])/P.transform[2],connectionMode:P.connectionMode}),[e]),uc),f=(E=s==null?void 0:s[_o])==null?void 0:E.handleBounds;let d=f==null?void 0:f[t];if(u===jO.Loose&&(d=d||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!d)return null;const h=a?d.find(P=>P.id===a):d[0],p=h?h.x+h.width/2:(s.width??0)/2,g=h?h.y+h.height/2:s.height??0,v=(((C=s.positionAbsolute)==null?void 0:C.x)??0)+p,y=(((k=s.positionAbsolute)==null?void 0:k.y)??0)+g,O=h==null?void 0:h.position,m=O?hVn[O]:null;if(!O||!m)return null;if(i)return ie.createElement(i,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:v,fromY:y,toX:l,toY:c,fromPosition:O,toPosition:m,connectionStatus:o});let w="";const S={sourceX:v,sourceY:y,sourcePosition:O,targetX:l,targetY:c,targetPosition:m};return r===by.Bezier?[w]=Cat(S):r===by.Step?[w]=Ane({...S,borderRadius:0}):r===by.SmoothStep?[w]=Ane(S):r===by.SimpleBezier?[w]=Eat(S):w=`M${v},${y} ${l},${c}`,ie.createElement("path",{d:w,fill:"none",className:"react-flow__connection-path",style:n})};nlt.displayName="ConnectionLine";const pVn=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function gVn({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:s,width:a,height:l,connectionStatus:c}=Mi(pVn,uc);return!(i&&o&&a&&s)?null:ie.createElement("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},ie.createElement("g",{className:Af(["react-flow__connection",c])},ie.createElement(nlt,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:c})))}function hAe(e,t){return x.useRef(null),ea(),x.useMemo(()=>t(e),[e])}const rlt=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:o,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:u,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:g,onSelectionEnd:v,connectionLineType:y,connectionLineStyle:O,connectionLineComponent:m,connectionLineContainerStyle:w,selectionKeyCode:S,selectionOnDrag:E,selectionMode:C,multiSelectionKeyCode:k,panActivationKeyCode:P,zoomActivationKeyCode:D,deleteKeyCode:M,onlyRenderVisibleElements:L,elementsSelectable:A,selectNodesOnDrag:T,defaultViewport:N,translateExtent:j,minZoom:z,maxZoom:W,preventScrolling:F,defaultMarkerColor:q,zoomOnScroll:U,zoomOnPinch:V,panOnScroll:H,panOnScrollSpeed:Z,panOnScrollMode:ee,zoomOnDoubleClick:se,panOnDrag:fe,onPaneClick:ce,onPaneMouseEnter:ae,onPaneMouseMove:de,onPaneMouseLeave:me,onPaneScroll:te,onPaneContextMenu:Ee,onEdgeUpdate:we,onEdgeContextMenu:ke,onEdgeMouseEnter:je,onEdgeMouseMove:nt,onEdgeMouseLeave:Re,edgeUpdaterRadius:G,onEdgeUpdateStart:le,onEdgeUpdateEnd:Oe,noDragClassName:Ue,noWheelClassName:Fe,noPanClassName:ye,elevateEdgesOnSelect:Me,disableKeyboardA11y:pt,nodeOrigin:at,nodeExtent:ht,rfId:_t})=>{const yn=hAe(e,Wqn),_n=hAe(t,Yqn);return dVn(o),ie.createElement(Qqn,{onPaneClick:ce,onPaneMouseEnter:ae,onPaneMouseMove:de,onPaneMouseLeave:me,onPaneContextMenu:Ee,onPaneScroll:te,deleteKeyCode:M,selectionKeyCode:S,selectionOnDrag:E,selectionMode:C,onSelectionStart:g,onSelectionEnd:v,multiSelectionKeyCode:k,panActivationKeyCode:P,zoomActivationKeyCode:D,elementsSelectable:A,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:U,zoomOnPinch:V,zoomOnDoubleClick:se,panOnScroll:H,panOnScrollSpeed:Z,panOnScrollMode:ee,panOnDrag:fe,defaultViewport:N,translateExtent:j,minZoom:z,maxZoom:W,onSelectionContextMenu:p,preventScrolling:F,noDragClassName:Ue,noWheelClassName:Fe,noPanClassName:ye,disableKeyboardA11y:pt},ie.createElement(fVn,null,ie.createElement(cVn,{edgeTypes:_n,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeUpdate:we,onlyRenderVisibleElements:L,onEdgeContextMenu:ke,onEdgeMouseEnter:je,onEdgeMouseMove:nt,onEdgeMouseLeave:Re,onEdgeUpdateStart:le,onEdgeUpdateEnd:Oe,edgeUpdaterRadius:G,defaultMarkerColor:q,noPanClassName:ye,elevateEdgesOnSelect:!!Me,disableKeyboardA11y:pt,rfId:_t},ie.createElement(gVn,{style:O,type:y,component:m,containerStyle:w})),ie.createElement("div",{className:"react-flow__edgelabel-renderer"}),ie.createElement(Uqn,{nodeTypes:yn,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:u,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:h,selectNodesOnDrag:T,onlyRenderVisibleElements:L,noPanClassName:ye,noDragClassName:Ue,disableKeyboardA11y:pt,nodeOrigin:at,nodeExtent:ht,rfId:_t})))};rlt.displayName="GraphView";var mVn=x.memo(rlt);const Ine=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Um={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Ine,nodeExtent:Ine,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:jO.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:qWn,isValidConnection:void 0},yVn=()=>N9n((e,t)=>({...Um,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:eX(n,r,i,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(i=>({...r,...i}))})},setDefaultNodesAndEdges:(n,r)=>{const i=typeof n<"u",o=typeof r<"u",s=i?eX(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:o?r:[],hasDefaultNodes:i,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:o,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:c}=t(),u=l==null?void 0:l.querySelector(".react-flow__viewport");if(!u)return;const f=window.getComputedStyle(u),{m22:d}=new window.DOMMatrixReadOnly(f.transform),h=n.reduce((g,v)=>{const y=i.get(v.id);if(y){const O=Nge(v.nodeElement);!!(O.width&&O.height&&(y.width!==O.width||y.height!==O.height||v.forceUpdate))&&(i.set(y.id,{...y,[_o]:{...y[_o],handleBounds:{source:sAe(".source",v.nodeElement,d,c),target:sAe(".target",v.nodeElement,d,c)}},...O}),g.push({id:y.id,type:"dimensions",dimensions:O}))}return g},[]);Wat(i,c);const p=s||o&&!s&&qat(t,{initial:!0,...a});e({nodeInternals:new Map(i),fitViewOnInitDone:p}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,i=!1)=>{const{triggerNodeChanges:o}=t(),s=n.map(a=>{const l={id:a.id,type:"position",dragging:i};return r&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});o(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:i,hasDefaultNodes:o,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(o){const c=Uat(n,a()),u=eX(c,i,s,l);e({nodeInternals:u})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let s,a=null;r?s=n.map(l=>uy(l,!0)):(s=oS(o(),n),a=oS(i,[])),t5({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let s,a=null;r?s=n.map(l=>uy(l,!0)):(s=oS(i,n),a=oS(o(),[])),t5({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:i,getNodes:o}=t(),s=n||o(),a=r||i,l=s.map(u=>(u.selected=!1,uy(u.id,!1))),c=a.map(u=>uy(u.id,!1));t5({changedNodes:l,changedEdges:c,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:i}=t();r==null||r.scaleExtent([n,i]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:i}=t();r==null||r.scaleExtent([i,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),o=r().filter(a=>a.selected).map(a=>uy(a.id,!1)),s=n.filter(a=>a.selected).map(a=>uy(a.id,!1));t5({changedNodes:o,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=Ige(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:o,d3Zoom:s,d3Selection:a,translateExtent:l}=t();if(!s||!a||!n.x&&!n.y)return!1;const c=b0.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),u=[[0,0],[i,o]],f=s==null?void 0:s.constrain()(c,u,l);return s.transform(a,f),r[0]!==f.x||r[1]!==f.y||r[2]!==f.k},cancelConnection:()=>e({connectionNodeId:Um.connectionNodeId,connectionHandleId:Um.connectionHandleId,connectionHandleType:Um.connectionHandleType,connectionStatus:Um.connectionStatus,connectionStartHandle:Um.connectionStartHandle,connectionEndHandle:Um.connectionEndHandle}),reset:()=>e({...Um})}),Object.is),Hge=({children:e})=>{const t=x.useRef(null);return t.current||(t.current=yVn()),ie.createElement(NWn,{value:t.current},e)};Hge.displayName="ReactFlowProvider";const ilt=({children:e})=>x.useContext(IB)?ie.createElement(ie.Fragment,null,e):ie.createElement(Hge,null,e);ilt.displayName="ReactFlowWrapper";const vVn={input:Iat,default:Mne,output:jat,group:qge},bVn={default:$7,straight:zge,step:Fge,smoothstep:LB,simplebezier:jge},OVn=[0,0],xVn=[15,15],wVn={x:0,y:0,zoom:1},SVn={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},olt=x.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=vVn,edgeTypes:s=bVn,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:u,onMoveStart:f,onMoveEnd:d,onConnect:h,onConnectStart:p,onConnectEnd:g,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:O,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:E,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:P,onNodesDelete:D,onEdgesDelete:M,onSelectionChange:L,onSelectionDragStart:A,onSelectionDrag:T,onSelectionDragStop:N,onSelectionContextMenu:j,onSelectionStart:z,onSelectionEnd:W,connectionMode:F=jO.Strict,connectionLineType:q=by.Bezier,connectionLineStyle:U,connectionLineComponent:V,connectionLineContainerStyle:H,deleteKeyCode:Z="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:se=!1,selectionMode:fe=eR.Full,panActivationKeyCode:ce="Space",multiSelectionKeyCode:ae=k7()?"Meta":"Control",zoomActivationKeyCode:de=k7()?"Meta":"Control",snapToGrid:me=!1,snapGrid:te=xVn,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:we=!0,nodesDraggable:ke,nodesConnectable:je,nodesFocusable:nt,nodeOrigin:Re=OVn,edgesFocusable:G,edgesUpdatable:le,elementsSelectable:Oe,defaultViewport:Ue=wVn,minZoom:Fe=.5,maxZoom:ye=2,translateExtent:Me=Ine,preventScrolling:pt=!0,nodeExtent:at,defaultMarkerColor:ht="#b1b1b7",zoomOnScroll:_t=!0,zoomOnPinch:yn=!0,panOnScroll:_n=!1,panOnScrollSpeed:ri=.5,panOnScrollMode:hi=Wy.Free,zoomOnDoubleClick:Qt=!0,panOnDrag:An=!0,onPaneClick:Ht,onPaneMouseEnter:rr,onPaneMouseMove:Ci,onPaneMouseLeave:xs,onPaneScroll:Ar,onPaneContextMenu:Rn,children:Rr,onEdgeUpdate:Ii,onEdgeContextMenu:Ji,onEdgeDoubleClick:Li,onEdgeMouseEnter:ji,onEdgeMouseMove:Ro,onEdgeMouseLeave:eo,onEdgeUpdateStart:pi,onEdgeUpdateEnd:Do,edgeUpdaterRadius:ta=10,onNodesChange:ws,onEdgesChange:_i,noDragClassName:ne="nodrag",noWheelClassName:ir="nowheel",noPanClassName:cn="nopan",fitView:Tt=!1,fitViewOptions:ue,connectOnClick:Be=!0,attributionPosition:it,proOptions:xt,defaultEdgeOptions:hr,elevateNodesOnSelect:or=!0,elevateEdgesOnSelect:sr=!1,disableKeyboardA11y:Ur=!1,autoPanOnConnect:xn=!0,autoPanOnNodeDrag:br=!0,connectionRadius:Wn=20,isValidConnection:ar,onError:Mo,style:Ua,id:qv,nodeDragThreshold:qB,...fM},VB)=>{const V_=qv||"1";return ie.createElement("div",{...fM,style:{...Ua,...SVn},ref:VB,className:Af(["react-flow",i]),"data-testid":"rf__wrapper",id:qv},ie.createElement(ilt,null,ie.createElement(mVn,{onInit:c,onMove:u,onMoveStart:f,onMoveEnd:d,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:O,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:E,nodeTypes:o,edgeTypes:s,connectionLineType:q,connectionLineStyle:U,connectionLineComponent:V,connectionLineContainerStyle:H,selectionKeyCode:ee,selectionOnDrag:se,selectionMode:fe,deleteKeyCode:Z,multiSelectionKeyCode:ae,panActivationKeyCode:ce,zoomActivationKeyCode:de,onlyRenderVisibleElements:Ee,selectNodesOnDrag:we,defaultViewport:Ue,translateExtent:Me,minZoom:Fe,maxZoom:ye,preventScrolling:pt,zoomOnScroll:_t,zoomOnPinch:yn,zoomOnDoubleClick:Qt,panOnScroll:_n,panOnScrollSpeed:ri,panOnScrollMode:hi,panOnDrag:An,onPaneClick:Ht,onPaneMouseEnter:rr,onPaneMouseMove:Ci,onPaneMouseLeave:xs,onPaneScroll:Ar,onPaneContextMenu:Rn,onSelectionContextMenu:j,onSelectionStart:z,onSelectionEnd:W,onEdgeUpdate:Ii,onEdgeContextMenu:Ji,onEdgeDoubleClick:Li,onEdgeMouseEnter:ji,onEdgeMouseMove:Ro,onEdgeMouseLeave:eo,onEdgeUpdateStart:pi,onEdgeUpdateEnd:Do,edgeUpdaterRadius:ta,defaultMarkerColor:ht,noDragClassName:ne,noWheelClassName:ir,noPanClassName:cn,elevateEdgesOnSelect:sr,rfId:V_,disableKeyboardA11y:Ur,nodeOrigin:Re,nodeExtent:at}),ie.createElement(hqn,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:p,onConnectEnd:g,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:ke,nodesConnectable:je,nodesFocusable:nt,edgesFocusable:G,edgesUpdatable:le,elementsSelectable:Oe,elevateNodesOnSelect:or,minZoom:Fe,maxZoom:ye,nodeExtent:at,onNodesChange:ws,onEdgesChange:_i,snapToGrid:me,snapGrid:te,connectionMode:F,translateExtent:Me,connectOnClick:Be,defaultEdgeOptions:hr,fitView:Tt,fitViewOptions:ue,onNodesDelete:D,onEdgesDelete:M,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:P,onSelectionDrag:T,onSelectionDragStart:A,onSelectionDragStop:N,noPanClassName:cn,nodeOrigin:Re,rfId:V_,autoPanOnConnect:xn,autoPanOnNodeDrag:br,onError:Mo,connectionRadius:Wn,isValidConnection:ar,nodeDragThreshold:qB}),ie.createElement(fqn,{onSelectionChange:L}),Rr,ie.createElement(jWn,{proOptions:xt,position:it}),ie.createElement(vqn,{rfId:V_,disableKeyboardA11y:Ur})))});olt.displayName="ReactFlow";function slt(e){return t=>{const[n,r]=x.useState(t),i=x.useCallback(o=>r(s=>e(o,s)),[]);return[n,r,i]}}const EVn=slt(Uat),CVn=slt(Rqn);function alt(e){return Math.min(e*11+35,200)}function pAe(e,t,n){return{type:"smoothstep",pathOptions:{offset:20,borderRadius:100},data:{direction:n},markerEnd:{type:tR.Arrow},id:`${e}-${t}-${n}`,source:e,sourceHandle:n,targetHandle:n,target:t}}function _Vn(e,t,n){const r=Tn.get(t).code.trim().split(`
`).length,i=alt(r);return{id:e,data:{atom:t},width:250,type:"custom",height:i,position:{x:0,y:n+20}}}function gAe(e,t,n){let r=0;const i=[],o=[];let s=0;for(const a of e){const l=_Vn(a,t[s],r);i.push(l),r=l.position.y+(l.height||0),s++}for(const a of Object.values(n)){const{declaredBy:l,usedBy:c}=a;for(const u of l)for(const f of c)o.push(pAe(u,f,"inputs"),pAe(u,f,"outputs"))}return{nodes:i,edges:o}}function kVn(e){return Math.min(Math.max(e-50*2,100),400)}const llt=x.memo(e=>{const{data:t,selected:n,id:r}=e,i=Gi(t.atom),o=a8().indexOf(r),l=n?"var(--gray-9)":"var(--gray-3)",c=Mi(({width:f})=>f),u=i.code.split(`
`).length;return b.jsxs("div",{children:[b.jsx(qy,{type:"target",id:"inputs",position:$t.Left,style:{background:l}}),b.jsx(qy,{type:"source",id:"inputs",position:$t.Left,style:{background:l}}),b.jsxs("div",{className:be("flex flex-col bg-card border border-input/50 rounded-md mx-[2px] overflow-hidden",n&&"border-primary"),style:{height:alt(u),width:kVn(c)},children:[b.jsx("div",{className:"text-muted-foreground font-semibold text-xs py-1 px-2 bg-muted border-b",children:w4e(i.name,o)}),b.jsx(oge,{code:i.code})]}),b.jsx(qy,{type:"source",id:"outputs",position:$t.Right,style:{background:l}}),b.jsx(qy,{type:"target",id:"outputs",position:$t.Right,style:{background:l}})]})});llt.displayName="CustomNode";const $Vn={custom:llt},TVn=e=>b.jsx(Hge,{children:b.jsx(PVn,{...e})}),PVn=({cellIds:e,variables:t,cellAtoms:n})=>{const{nodes:r,edges:i}=gAe(e,n,t),[o,s]=CVn([]),[a,l]=EVn(r),[c,u]=x.useState(i),[f,d]=x.useState();x.useEffect(()=>{const{nodes:O,edges:m}=gAe(e,n,t);l(O),u(m),s([])},[e,l,t,n,u,s]),x.useEffect(()=>{if(f){const O=c.filter(m=>{const{source:w,target:S,data:E}=m;return w===f&&E.direction==="outputs"||S===f&&E.direction==="inputs"});s(O)}},[f,s,c]);const h=Vge(),[p,g]=Mi(({width:O,height:m})=>[O,m]),v=aPt(()=>{h.fitView({duration:100})},100);x.useEffect(()=>{v()},[p,g,v]);const y=AVn(a,g);return b.jsx(olt,{nodes:a,edges:o,nodeTypes:$Vn,translateExtent:y,onNodeClick:(O,m)=>{const w=m.id;w!==f&&(d(w),s([]))},snapToGrid:!0,fitView:!0,elementsSelectable:!0,minZoom:1,maxZoom:1,draggable:!1,panOnScrollMode:Wy.Vertical,zoomOnDoubleClick:!1,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,edgesFocusable:!1,selectNodesOnDrag:!1,panOnDrag:!1,preventScrolling:!1,zoomOnPinch:!1,panOnScroll:!0,autoPanOnNodeDrag:!1,autoPanOnConnect:!1})};function AVn(e,t){return x.useMemo(()=>{const r=e.reduce((o,{position:s})=>Math.min(o,s.y-t/2-10),Number.POSITIVE_INFINITY),i=e.reduce((o,{position:s})=>Math.max(o,s.y+t/2+10),Number.NEGATIVE_INFINITY);return[[Number.NEGATIVE_INFINITY,r],[Number.POSITIVE_INFINITY,i]]},[e,t])}const RVn=()=>{const e=sot(),t=a8(),[n]=u9t();return b.jsx("div",{className:be("w-full h-full flex-1 mx-auto -mb-4 relative"),children:b.jsx(TVn,{cellAtoms:n,variables:e,cellIds:t})})};const K1={name:"name",type:"type-value",defs:"defs-refs"},DVn=[{id:K1.name,accessorFn:e=>[e.name,e.declaredBy],enableSorting:!0,sortingFn:"alphanumeric",header:({column:e})=>b.jsx(AT,{header:"Name",column:e}),cell:({getValue:e})=>{const[t,n]=e();return b.jsx("div",{className:"max-w-[130px]",children:b.jsx(tse,{title:t,variant:n.length>1?"destructive":"outline",className:"rounded-sm text-ellipsis block overflow-hidden max-w-fit cursor-pointer font-medium",onClick:()=>{navigator.clipboard.writeText(t),yr({title:"Copied to clipboard"})},children:t})})}},{id:K1.type,accessorFn:e=>[e.dataType,e.value],enableSorting:!0,sortingFn:"alphanumeric",header:({column:e})=>b.jsx(AT,{header:b.jsxs("div",{className:"flex flex-col gap-1",children:[b.jsx("span",{children:"Type"}),b.jsx("span",{children:"Value"})]}),column:e}),cell:({getValue:e})=>{const[t,n]=e();return b.jsxs("div",{className:"max-w-[150px]",children:[b.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap text-muted-foreground font-mono text-xs",children:t}),b.jsx("div",{className:"text-ellipsis overflow-hidden whitespace-nowrap",title:n,children:n})]})}},{id:K1.defs,accessorFn:e=>[e.declaredBy,e.usedBy,e.name],enableSorting:!0,sortingFn:"basic",header:({column:e})=>b.jsx(AT,{header:b.jsxs("div",{className:"flex flex-col gap-1",children:[b.jsx("span",{children:"Declared By"}),b.jsx("span",{children:"Used By"})]}),column:e}),cell:({getValue:e})=>{const[t,n,r]=e(),i=o=>{const s=Zze(o);s&&$4n(s,r)};return b.jsxs("div",{className:"flex flex-col gap-1 py-1",children:[b.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-center",children:[b.jsx("span",{title:"Declared by",children:b.jsx(jEt,{className:"w-3.5 h-3.5 text-muted-foreground"})}),t.length===1?b.jsx(zT,{variant:"focus",cellId:t[0],onClick:()=>i(t[0])}):b.jsx("div",{className:"text-destructive flex flex-row gap-2",children:t.slice(0,3).map((o,s)=>b.jsxs("span",{className:"flex",children:[b.jsx(zT,{variant:"focus",cellId:o,className:"whitespace-nowrap text-destructive",onClick:()=>i(o)},o),s<t.length-1&&", "]},o))})]}),b.jsxs("div",{className:"flex flex-row overflow-auto gap-2 items-baseline",children:[b.jsx("span",{title:"Used by",children:b.jsx(FLe,{className:"w-3.5 h-3.5 text-muted-foreground"})}),n.slice(0,3).map((o,s)=>b.jsxs("span",{className:"flex",children:[b.jsx(zT,{variant:"focus",cellId:o,className:"whitespace-nowrap",onClick:()=>i(o)},o),s<n.length-1&&", "]},o)),n.length>3&&b.jsxs("div",{className:"whitespace-nowrap text-muted-foreground text-xs",children:["+",n.length-3," more"]})]})]})}}];function MVn(e,t,n){t||(t={id:K1.defs,desc:!1});let r=[];switch(t.id){case K1.name:r=KW(e,i=>i.name);break;case K1.type:r=KW(e,i=>i.dataType);break;case K1.defs:r=KW(e,i=>n.get(i.declaredBy[0]));break}return t.desc?r.reverse():r}const clt=x.memo(({className:e,cellIds:t,variables:n})=>{const[r,i]=ie.useState([]),o=x.useMemo(()=>{const a=new Map;return t.forEach((l,c)=>a.set(l,c)),MVn(Object.values(n),r[0],a)},[n,r,t]),s=_Fe({data:o,columns:DVn,getCoreRowModel:EFe(),manualSorting:!0,onSortingChange:i,getSortedRowModel:CFe(),state:{sorting:r}});return b.jsxs(fse,{className:be("w-full overflow-hidden text-sm flex-1",e),children:[b.jsx(dse,{children:b.jsx(OS,{className:"whitespace-nowrap text-xs",children:s.getFlatHeaders().map(a=>b.jsx(pse,{children:Zj(a.column.columnDef.header,a.getContext())},a.id))})}),b.jsx(hse,{children:s.getRowModel().rows.map(a=>b.jsx(OS,{className:"hover:bg-accent",children:a.getVisibleCells().map(l=>b.jsx(Yj,{children:Zj(l.column.columnDef.cell,l.getContext())},l.id))},a.id))})]})});clt.displayName="VariableTable";const NVn=()=>{const e=sot(),t=a8();return b.jsx(clt,{className:"flex-1",cellIds:t,variables:e})},IVn=()=>{const e=a9t(),{clearLogs:t}=wp();return e.length===0?b.jsxs("div",{className:"mx-6 my-6 flex flex-row gap-2 items-center rounded-lg",children:[b.jsx(hoe,{className:"text-muted-foreground"}),b.jsx("span",{className:"mt-[0.25rem] text-muted-foreground",children:"No logs"})]}):b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"flex flex-row justify-end px-2 py-1",children:b.jsx("button",{"data-testid":"clear-logs-button",className:"text-xs font-semibold text-accent-foreground",onClick:t,children:"Clear"})}),b.jsx("div",{className:"overflow-auto flex-1",children:b.jsx(LVn,{logs:e,className:"min-w-[300px]"})})]})},LVn=({logs:e,className:t})=>{const n="opacity-70 group-hover:bg-[var(--gray-3)] group-hover:opacity-100";return b.jsx("div",{className:be("flex flex-col",t),children:b.jsx("pre",{className:"grid text-xs font-mono gap-1 whitespace-break-spaces font-semibold align-left",children:b.jsx("div",{className:"grid grid-cols-[30px,1fr]",style:{whiteSpace:"pre-wrap"},children:e.map((r,i)=>b.jsxs("div",{className:"contents group",children:[b.jsx("span",{className:be(n,"text-right col-span-1 py-1 pr-1"),children:i+1}),b.jsx("span",{className:be(n,"px-2 flex gap-x-1.5 py-1 flex-wrap"),children:jVn(r)})]},i))})})})};function jVn(e){const t=pze(e.timestamp),n=FVn[e.level],r=e.level.toUpperCase();return b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)]",children:["[",t,"]"]}),b.jsx("span",{className:be("flex-shrink-0",n),children:r}),b.jsxs("span",{className:"flex-shrink-0 text-[var(--gray-10)]",children:["(",b.jsx(zT,{cellId:e.cellId}),")"]}),e.message]})}const FVn={stdout:"text-[var(--grass-9)]",stderr:"text-[var(--red-9)]"},zVn=()=>{const{documentation:e}=Gi(Qle);return e?b.jsx("div",{className:"p-3 overflow-y-auto overflow-x-hidden h-full docs-documentation flex flex-col gap-4",children:Da({html:e})}):b.jsxs("div",{className:"mx-6 my-6 flex flex-row gap-2 items-center rounded-lg",children:[b.jsx(coe,{className:"text-accent-foreground"}),b.jsx("span",{className:"mt-[0.25rem] text-accent-foreground",children:"No documentation"})]})};function QVn(e,t){var n=x.useRef(null),r=x.useRef(null);r.current=t;var i=x.useRef(null);x.useEffect(function(){o()});var o=x.useCallback(function(){var s=i.current,a=r.current,l=s||(a?a instanceof Element?a:a.current:null);n.current&&n.current.element===l&&n.current.subscriber===e||(n.current&&n.current.cleanup&&n.current.cleanup(),n.current={element:l,subscriber:e,cleanup:l?e(l):void 0})},[e]);return x.useEffect(function(){return function(){n.current&&n.current.cleanup&&(n.current.cleanup(),n.current=null)}},[]),x.useCallback(function(s){i.current=s,o()},[o])}function mAe(e,t,n){return e[t]?e[t][0]?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function BVn(e){e===void 0&&(e={});var t=e.onResize,n=x.useRef(void 0);n.current=t;var r=e.round||Math.round,i=x.useRef(),o=x.useState({width:void 0,height:void 0}),s=o[0],a=o[1],l=x.useRef(!1);x.useEffect(function(){return l.current=!1,function(){l.current=!0}},[]);var c=x.useRef({width:void 0,height:void 0}),u=QVn(x.useCallback(function(f){return(!i.current||i.current.box!==e.box||i.current.round!==r)&&(i.current={box:e.box,round:r,instance:new ResizeObserver(function(d){var h=d[0],p=e.box==="border-box"?"borderBoxSize":e.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",g=mAe(h,p,"inlineSize"),v=mAe(h,p,"blockSize"),y=g?r(g):void 0,O=v?r(v):void 0;if(c.current.width!==y||c.current.height!==O){var m={width:y,height:O};c.current.width=y,c.current.height=O,n.current?n.current(m):l.current||a(m)}})}),i.current.instance.observe(f,{box:e.box}),function(){i.current&&i.current.instance.unobserve(f)}},[e.box,r]),e.ref);return x.useMemo(function(){return{ref:u,width:s.width,height:s.height}},[u,s.width,s.height])}const ult=x.createContext(null);function gu(){const e=x.useContext(ult);if(e===null)throw new Error("No Tree Api Provided");return e}const flt=x.createContext(null);function WVn(){const e=x.useContext(flt);if(e===null)throw new Error("Provide a NodesContext");return e}const dlt=x.createContext(null);function qVn(){const e=x.useContext(dlt);if(e===null)throw new Error("Provide a DnDContext");return e}const hlt=x.createContext(0);function plt(){x.useContext(hlt)}function NL(e,t,n){return Math.max(Math.min(e,n),t)}function glt(e){return e&&e.isLeaf}function mlt(e){return e&&e.isInternal&&!e.isOpen}function ylt(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const vlt=(e,t)=>{let n=e;for(;n;){if(n.id===t.id)return!0;n=n.parent}return!1},blt=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function VVn(){}function Xge(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let n of e.children){const r=Xge(n,t);if(r)return r}return null}function T7(e,t){if(t(e),e.children)for(let n of e.children)T7(n,t)}function Olt(e){const t=wlt(e);let n;for(let r=0;r<t.length;++r)if(t[r]===e){n=UVn(t,r);break}n==null||n.focus()}function xlt(e){const t=wlt(e);let n;for(let r=0;r<t.length;++r)if(t[r]===e){n=HVn(t,r);break}n==null||n.focus()}function UVn(e,t){return t+1<e.length?e[t+1]:e[0]}function HVn(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function wlt(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(t=>t===e||!e.contains(t))}function uT(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function Slt(e){return e===null?null:D1(e)}function D1(e){return typeof e=="string"?e:e.id}function XVn(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Elt(e,...t){if(e)return e(...t)}function Clt(e){return new Promise((t,n)=>{let r=0;function i(){r+=1,r===100&&n(),e()?t():setTimeout(i,10)}i()})}function _lt(e){var t,n;const r=e.focusedNode;return r?r.isOpen?0:r.parent?r.childIndex+1:0:(n=(t=e.root.children)===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0}function klt(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const ZVn=Object.freeze(Object.defineProperty({__proto__:null,access:uT,bound:NL,dfs:Xge,focusNextElement:Olt,focusPrevElement:xlt,getInsertIndex:_lt,getInsertParentId:klt,identify:D1,identifyNull:Slt,indexOf:blt,isClosed:mlt,isDescendant:vlt,isItem:glt,isOpenWithEmptyChildren:ylt,mergeRefs:XVn,noop:VVn,safeRun:Elt,waitFor:Clt,walk:T7},Symbol.toStringTag,{value:"Module"})),YVn={display:"flex",alignItems:"center",zIndex:1},GVn={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},KVn={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},JVn=ie.memo(function({top:t,left:n,indent:r}){const i={position:"absolute",pointerEvents:"none",top:t-2+"px",left:n+"px",right:r+"px"};return b.jsxs("div",{style:Object.assign(Object.assign({},YVn),i),children:[b.jsx("div",{style:Object.assign({},KVn)}),b.jsx("div",{style:Object.assign({},GVn)})]})});function eUn({node:e,attrs:t,innerRef:n,children:r}){return b.jsx("div",Object.assign({},t,{ref:n,onFocus:i=>i.stopPropagation(),onClick:e.handleClick,children:r}))}function tUn(e){return b.jsxs("div",{ref:e.dragHandle,style:e.style,children:[b.jsx("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"🌳":e.node.isOpen?"🗁":"🗀"})," ",e.node.isEditing?b.jsx(rUn,Object.assign({},e)):b.jsx(nUn,Object.assign({},e))]})}function nUn(e){return b.jsx(b.Fragment,{children:b.jsx("span",{children:e.node.data.name})})}function rUn({node:e}){const t=x.useRef();return x.useEffect(()=>{var n,r;(n=t.current)===null||n===void 0||n.focus(),(r=t.current)===null||r===void 0||r.select()},[]),b.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:n=>{var r;n.key==="Escape"&&e.reset(),n.key==="Enter"&&e.submit(((r=t.current)===null||r===void 0?void 0:r.value)||"")}})}function iX(e){return{type:"EDIT",id:e}}function iUn(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function hw(e){return{type:"FOCUS",id:e}}function oUn(){return{type:"TREE_BLUR"}}function sUn(e={id:null,treeFocused:!1},t){return t.type==="FOCUS"?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):t.type==="TREE_BLUR"?Object.assign(Object.assign({},e),{treeFocused:!1}):e}class P7{constructor(t){this.handleClick=n=>{n.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():n.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=t.tree,this.id=t.id,this.data=t.data,this.level=t.level,this.children=t.children,this.parent=t.parent,this.isDraggable=t.isDraggable,this.rowIndex=t.rowIndex}get isRoot(){return this.id===rR}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var t;return this.isSelected&&!(!((t=this.prev)===null||t===void 0)&&t.isSelected)}get isSelectedEnd(){var t;return this.isSelected&&!(!((t=this.next)===null||t===void 0)&&t.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(t=>t.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var t,n;const r=this.childIndex;return(n=(t=this.parent)===null||t===void 0?void 0:t.children[r+1])!==null&&n!==void 0?n:null}isAncestorOf(t){if(!t)return!1;let n=t;for(;n;){if(n.id===this.id)return!0;n=n.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(t){this.tree.submit(this,t)}reset(){this.tree.reset()}clone(){return new P7(Object.assign({},this))}edit(){return this.tree.edit(this)}}const rR="__REACT_ARBORIST_INTERNAL_ROOT__";function yAe(e){var t;function n(o,s,a){const l=e.accessId(o),c=new P7({tree:e,data:o,level:s,parent:a,id:l,children:null,isDraggable:e.isDraggable(o),rowIndex:null}),u=e.accessChildren(o);return u&&(c.children=u.map(f=>n(f,s+1,c))),c}const r=new P7({tree:e,id:rR,data:{id:rR},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),i=(t=e.props.data)!==null&&t!==void 0?t:[];return r.children=i.map(o=>n(o,0,r)),r}const Lne={open(e,t){return{type:"VISIBILITY_OPEN",id:e,filtered:t}},close(e,t){return{type:"VISIBILITY_CLOSE",id:e,filtered:t}},toggle(e,t){return{type:"VISIBILITY_TOGGLE",id:e,filtered:t}},clear(e){return{type:"VISIBILITY_CLEAR",filtered:e}}};function vAe(e={},t){if(t.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},e),{[t.id]:!0});if(t.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},e),{[t.id]:!1});if(t.type==="VISIBILITY_TOGGLE"){const n=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!n})}else return t.type==="VISIBILITY_CLEAR"?{}:e}function aUn(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:vAe(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:vAe(e.unfiltered,t)}):e}const RC=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:(t=e==null?void 0:e.initialOpenState)!==null&&t!==void 0?t:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},If={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:D1(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(D1)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(D1)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:D1(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:D1(e)})};function lUn(e=RC().nodes.selection,t){const n=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return t.ids.length===0?e:(t.ids.forEach(r=>n.add(r)),Object.assign(Object.assign({},e),{ids:new Set(n)}));case"SELECTION_REMOVE":return t.ids.length===0?e:(t.ids.forEach(r=>n.delete(r)),Object.assign(Object.assign({},e),{ids:new Set(n)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}const DC={cursor(e){return{type:"DND_CURSOR",cursor:e}},dragStart(e,t){return{type:"DND_DRAG_START",id:e,dragIds:t}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(e,t){return{type:"DND_HOVERING",parentId:e,index:t}}};function cUn(e=RC().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return RC().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const uUn={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},fUn=e=>{if(!e)return{display:"none"};const{x:t,y:n}=e;return{transform:`translate(${t}px, ${n}px)`}},dUn=e=>{if(!e)return{display:"none"};const{x:t,y:n}=e;return{transform:`translate(${t+10}px, ${n+10}px)`}};function $lt({offset:e,mouse:t,id:n,dragIds:r,isDragging:i}){return b.jsxs(hUn,{isDragging:i,children:[b.jsx(pUn,{offset:e,children:b.jsx(mUn,{id:n,dragIds:r})}),b.jsx(gUn,{mouse:t,count:r.length})]})}const hUn=x.memo(function(t){return t.isDragging?b.jsx("div",{style:uUn,children:t.children}):null});function pUn(e){return b.jsx("div",{className:"row preview",style:fUn(e.offset),children:e.children})}function gUn(e){const{count:t,mouse:n}=e;return t>1?b.jsx("div",{className:"selected-count",style:dUn(n),children:t}):null}const mUn=x.memo(function(t){const n=gu(),r=n.get(t.id);return r?b.jsx(n.renderNode,{preview:!0,node:r,style:{paddingLeft:r.level*n.indent,opacity:.2,background:"transparent"},tree:n}):null});var bAe=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function yUn(e,t){return!!(e===t||bAe(e)&&bAe(t))}function vUn(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!yUn(e[n],t[n]))return!1;return!0}function oX(e,t){t===void 0&&(t=vUn);var n,r=[],i,o=!1;function s(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return o&&n===this&&t(a,r)||(i=e.apply(this,a),o=!0,n=this,r=a),i}return s}var bUn=typeof performance=="object"&&typeof performance.now=="function",OAe=bUn?function(){return performance.now()}:function(){return Date.now()};function xAe(e){cancelAnimationFrame(e.id)}function OUn(e,t){var n=OAe();function r(){OAe()-n>=t?e.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var sX=-1;function wAe(e){if(e===void 0&&(e=!1),sX===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),sX=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return sX}var pw=null;function SAe(e){if(e===void 0&&(e=!1),pw===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?pw="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?pw="negative":pw="positive-ascending"),document.body.removeChild(t),pw}return pw}var xUn=150,wUn=function(t,n){return t};function SUn(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,o=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,l=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(f){s1t(d,f);function d(p){var g;return g=f.call(this,p)||this,g._instanceProps=l(g.props,L0e(g)),g._outerRef=void 0,g._resetIsScrollingTimeoutId=null,g.state={instance:L0e(g),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof g.props.initialScrollOffset=="number"?g.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},g._callOnItemsRendered=void 0,g._callOnItemsRendered=oX(function(v,y,O,m){return g.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:O,visibleStopIndex:m})}),g._callOnScroll=void 0,g._callOnScroll=oX(function(v,y,O){return g.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:O})}),g._getItemStyle=void 0,g._getItemStyle=function(v){var y=g.props,O=y.direction,m=y.itemSize,w=y.layout,S=g._getItemStyleCache(c&&m,c&&w,c&&O),E;if(S.hasOwnProperty(v))E=S[v];else{var C=n(g.props,v,g._instanceProps),k=i(g.props,v,g._instanceProps),P=O==="horizontal"||w==="horizontal",D=O==="rtl",M=P?C:0;S[v]=E={position:"absolute",left:D?void 0:M,right:D?M:void 0,top:P?0:C,height:P?"100%":k,width:P?k:"100%"}}return E},g._getItemStyleCache=void 0,g._getItemStyleCache=oX(function(v,y,O){return{}}),g._onScrollHorizontal=function(v){var y=v.currentTarget,O=y.clientWidth,m=y.scrollLeft,w=y.scrollWidth;g.setState(function(S){if(S.scrollOffset===m)return null;var E=g.props.direction,C=m;if(E==="rtl")switch(SAe()){case"negative":C=-m;break;case"positive-descending":C=w-O-m;break}return C=Math.max(0,Math.min(C,w-O)),{isScrolling:!0,scrollDirection:S.scrollOffset<C?"forward":"backward",scrollOffset:C,scrollUpdateWasRequested:!1}},g._resetIsScrollingDebounced)},g._onScrollVertical=function(v){var y=v.currentTarget,O=y.clientHeight,m=y.scrollHeight,w=y.scrollTop;g.setState(function(S){if(S.scrollOffset===w)return null;var E=Math.max(0,Math.min(w,m-O));return{isScrolling:!0,scrollDirection:S.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},g._resetIsScrollingDebounced)},g._outerRefSetter=function(v){var y=g.props.outerRef;g._outerRef=v,typeof y=="function"?y(v):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=v)},g._resetIsScrollingDebounced=function(){g._resetIsScrollingTimeoutId!==null&&xAe(g._resetIsScrollingTimeoutId),g._resetIsScrollingTimeoutId=OUn(g._resetIsScrolling,xUn)},g._resetIsScrolling=function(){g._resetIsScrollingTimeoutId=null,g.setState({isScrolling:!1},function(){g._getItemStyleCache(-1,null)})},g}d.getDerivedStateFromProps=function(g,v){return EUn(g,v),u(g),null};var h=d.prototype;return h.scrollTo=function(g){g=Math.max(0,g),this.setState(function(v){return v.scrollOffset===g?null:{scrollDirection:v.scrollOffset<g?"forward":"backward",scrollOffset:g,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},h.scrollToItem=function(g,v){v===void 0&&(v="auto");var y=this.props,O=y.itemCount,m=y.layout,w=this.state.scrollOffset;g=Math.max(0,Math.min(g,O-1));var S=0;if(this._outerRef){var E=this._outerRef;m==="vertical"?S=E.scrollWidth>E.clientWidth?wAe():0:S=E.scrollHeight>E.clientHeight?wAe():0}this.scrollTo(o(this.props,g,v,w,this._instanceProps,S))},h.componentDidMount=function(){var g=this.props,v=g.direction,y=g.initialScrollOffset,O=g.layout;if(typeof y=="number"&&this._outerRef!=null){var m=this._outerRef;v==="horizontal"||O==="horizontal"?m.scrollLeft=y:m.scrollTop=y}this._callPropsCallbacks()},h.componentDidUpdate=function(){var g=this.props,v=g.direction,y=g.layout,O=this.state,m=O.scrollOffset,w=O.scrollUpdateWasRequested;if(w&&this._outerRef!=null){var S=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(SAe()){case"negative":S.scrollLeft=-m;break;case"positive-ascending":S.scrollLeft=m;break;default:var E=S.clientWidth,C=S.scrollWidth;S.scrollLeft=C-E-m;break}else S.scrollLeft=m;else S.scrollTop=m}this._callPropsCallbacks()},h.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&xAe(this._resetIsScrollingTimeoutId)},h.render=function(){var g=this.props,v=g.children,y=g.className,O=g.direction,m=g.height,w=g.innerRef,S=g.innerElementType,E=g.innerTagName,C=g.itemCount,k=g.itemData,P=g.itemKey,D=P===void 0?wUn:P,M=g.layout,L=g.outerElementType,A=g.outerTagName,T=g.style,N=g.useIsScrolling,j=g.width,z=this.state.isScrolling,W=O==="horizontal"||M==="horizontal",F=W?this._onScrollHorizontal:this._onScrollVertical,q=this._getRangeToRender(),U=q[0],V=q[1],H=[];if(C>0)for(var Z=U;Z<=V;Z++)H.push(x.createElement(v,{data:k,key:D(Z,k),index:Z,isScrolling:N?z:void 0,style:this._getItemStyle(Z)}));var ee=r(this.props,this._instanceProps);return x.createElement(L||A||"div",{className:y,onScroll:F,ref:this._outerRefSetter,style:oe({position:"relative",height:m,width:j,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:O},T)},x.createElement(S||E||"div",{children:H,ref:w,style:{height:W?"100%":ee,pointerEvents:z?"none":void 0,width:W?ee:"100%"}}))},h._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var g=this.props.itemCount;if(g>0){var v=this._getRangeToRender(),y=v[0],O=v[1],m=v[2],w=v[3];this._callOnItemsRendered(y,O,m,w)}}if(typeof this.props.onScroll=="function"){var S=this.state,E=S.scrollDirection,C=S.scrollOffset,k=S.scrollUpdateWasRequested;this._callOnScroll(E,C,k)}},h._getRangeToRender=function(){var g=this.props,v=g.itemCount,y=g.overscanCount,O=this.state,m=O.isScrolling,w=O.scrollDirection,S=O.scrollOffset;if(v===0)return[0,0,0,0];var E=s(this.props,S,this._instanceProps),C=a(this.props,E,S,this._instanceProps),k=!m||w==="backward"?Math.max(1,y):1,P=!m||w==="forward"?Math.max(1,y):1;return[Math.max(0,E-k),Math.max(0,Math.min(v-1,C+P)),E,C]},d}(x.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var EUn=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},CUn=SUn({getItemOffset:function(t,n){var r=t.itemSize;return n*r},getItemSize:function(t,n){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var n=t.itemCount,r=t.itemSize;return r*n},getOffsetForIndexAndAlignment:function(t,n,r,i,o,s){var a=t.direction,l=t.height,c=t.itemCount,u=t.itemSize,f=t.layout,d=t.width,h=a==="horizontal"||f==="horizontal",p=h?d:l,g=Math.max(0,c*u-p),v=Math.min(g,n*u),y=Math.max(0,n*u-p+u+s);switch(r==="smart"&&(i>=y-p&&i<=v+p?r="auto":r="center"),r){case"start":return v;case"end":return y;case"center":{var O=Math.round(y+(v-y)/2);return O<Math.ceil(p/2)?0:O>g+Math.floor(p/2)?g:O}case"auto":default:return i>=y&&i<=v?i:i<y?y:v}},getStartIndexForOffset:function(t,n){var r=t.itemCount,i=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(n/i)))},getStopIndexForStartIndex:function(t,n,r){var i=t.direction,o=t.height,s=t.itemCount,a=t.itemSize,l=t.layout,c=t.width,u=i==="horizontal"||l==="horizontal",f=n*a,d=u?c:o,h=Math.ceil((d+r-f)/a);return Math.max(0,Math.min(s-1,n+h-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function _Un(){var e,t;const n=gu(),i=qVn().cursor;if(!i||i.type!=="line")return null;const o=n.indent,s=n.rowHeight*i.index+((t=(e=n.props.padding)!==null&&e!==void 0?e:n.props.paddingTop)!==null&&t!==void 0?t:0),a=o*i.level,l=n.renderCursor;return b.jsx(l,{top:s,left:a,indent:o})}var kUn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const $Un=x.forwardRef(function(t,n){const{children:r}=t,i=kUn(t,["children"]),o=gu();return b.jsxs("div",Object.assign({ref:n},i,{onClick:s=>{s.currentTarget===s.target&&o.deselectAll()},children:[b.jsx(TUn,{}),r]}))}),TUn=()=>{const e=gu();return b.jsx("div",{style:{height:e.visibleNodes.length*e.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:b.jsx(_Un,{})})};var PUn=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const AUn=x.forwardRef(function(t,n){var r,i,o,s,{style:a}=t,l=PUn(t,["style"]);const c=gu(),u=(i=(r=c.props.padding)!==null&&r!==void 0?r:c.props.paddingTop)!==null&&i!==void 0?i:0,f=(s=(o=c.props.padding)!==null&&o!==void 0?o:c.props.paddingBottom)!==null&&s!==void 0?s:0;return b.jsx("div",Object.assign({ref:n,style:Object.assign(Object.assign({},a),{height:`${parseFloat(a.height)+u+f}px`})},l))});var Tlt=x.createContext({dragDropManager:void 0}),Iu;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Iu||(Iu={}));function nn(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(!e){var o;if(t===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;o=new Error(t.replace(/%s/g,function(){return r[s++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}var Zge="dnd-core/INIT_COORDS",jB="dnd-core/BEGIN_DRAG",Yge="dnd-core/PUBLISH_DRAG_SOURCE",FB="dnd-core/HOVER",zB="dnd-core/DROP",QB="dnd-core/END_DRAG";function EAe(e,t){return{type:Zge,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function IL(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?IL=function(n){return typeof n}:IL=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},IL(e)}function RUn(e,t,n){return t.split(".").reduce(function(r,i){return r&&r[i]?r[i]:n||null},e)}function DUn(e,t){return e.filter(function(n){return n!==t})}function Plt(e){return IL(e)==="object"}function MUn(e,t){var n=new Map,r=function(s){n.set(s,n.has(s)?n.get(s)+1:1)};e.forEach(r),t.forEach(r);var i=[];return n.forEach(function(o,s){o===1&&i.push(s)}),i}function NUn(e,t){return e.filter(function(n){return t.indexOf(n)>-1})}var IUn={type:Zge,payload:{clientOffset:null,sourceClientOffset:null}};function LUn(e){return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},i=r.publishSource,o=i===void 0?!0:i,s=r.clientOffset,a=r.getSourceClientOffset,l=e.getMonitor(),c=e.getRegistry();e.dispatch(EAe(s)),jUn(n,l,c);var u=QUn(n,l);if(u===null){e.dispatch(IUn);return}var f=null;if(s){if(!a)throw new Error("getSourceClientOffset must be defined");FUn(a),f=a(u)}e.dispatch(EAe(s,f));var d=c.getSource(u),h=d.beginDrag(l,u);if(h!=null){zUn(h),c.pinSource(u);var p=c.getSourceType(u);return{type:jB,payload:{itemType:p,item:h,sourceId:u,clientOffset:s||null,sourceClientOffset:f||null,isSourcePublic:!!o}}}}}function jUn(e,t,n){nn(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(r){nn(n.getSource(r),"Expected sourceIds to be registered.")})}function FUn(e){nn(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function zUn(e){nn(Plt(e),"Item must be an object.")}function QUn(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function BUn(e){return function(){var n=e.getMonitor();if(n.isDragging())return{type:Yge}}}function jne(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(n){return n===t}):e===t}function WUn(e){return function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.clientOffset;qUn(n);var o=n.slice(0),s=e.getMonitor(),a=e.getRegistry();VUn(o,s,a);var l=s.getItemType();return UUn(o,a,l),HUn(o,s,a),{type:FB,payload:{targetIds:o,clientOffset:i||null}}}}function qUn(e){nn(Array.isArray(e),"Expected targetIds to be an array.")}function VUn(e,t,n){nn(t.isDragging(),"Cannot call hover while not dragging."),nn(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r<e.length;r++){var i=e[r];nn(e.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");var o=n.getTarget(i);nn(o,"Expected targetIds to be registered.")}}function UUn(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],o=t.getTargetType(i);jne(o,n)||e.splice(r,1)}}function HUn(e,t,n){e.forEach(function(r){var i=n.getTarget(r);i.hover(t,r)})}function CAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _Ae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CAe(Object(n),!0).forEach(function(r){XUn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CAe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XUn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZUn(e){return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.getMonitor(),i=e.getRegistry();YUn(r);var o=JUn(r);o.forEach(function(s,a){var l=GUn(s,a,i,r),c={type:zB,payload:{dropResult:_Ae(_Ae({},n),l)}};e.dispatch(c)})}}function YUn(e){nn(e.isDragging(),"Cannot call drop while not dragging."),nn(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function GUn(e,t,n,r){var i=n.getTarget(e),o=i?i.drop(r,e):void 0;return KUn(o),typeof o>"u"&&(o=t===0?{}:r.getDropResult()),o}function KUn(e){nn(typeof e>"u"||Plt(e),"Drop result must either be an object or undefined.")}function JUn(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function eHn(e){return function(){var n=e.getMonitor(),r=e.getRegistry();tHn(n);var i=n.getSourceId();if(i!=null){var o=r.getSource(i,!0);o.endDrag(n,i),r.unpinSource()}return{type:QB}}}function tHn(e){nn(e.isDragging(),"Cannot call endDrag while not dragging.")}function nHn(e){return{beginDrag:LUn(e),publishDragSource:BUn(e),hover:WUn(e),drop:ZUn(e),endDrag:eHn(e)}}function rHn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kAe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function iHn(e,t,n){return t&&kAe(e.prototype,t),n&&kAe(e,n),e}function h$(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var oHn=function(){function e(t,n){var r=this;rHn(this,e),h$(this,"store",void 0),h$(this,"monitor",void 0),h$(this,"backend",void 0),h$(this,"isSetUp",!1),h$(this,"handleRefCountChange",function(){var i=r.store.getState().refCount>0;r.backend&&(i&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!i&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}return iHn(e,[{key:"receiveBackend",value:function(n){this.backend=n}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var n=this,r=this.store.dispatch;function i(s){return function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];var u=s.apply(n,l);typeof u<"u"&&r(u)}}var o=nHn(this);return Object.keys(o).reduce(function(s,a){var l=o[a];return s[a]=i(l),s},{})}},{key:"dispatch",value:function(n){this.store.dispatch(n)}}]),e}();function vu(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var $Ae=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),aX=function(){return Math.random().toString(36).substring(7).split("").join(".")},TAe={INIT:"@@redux/INIT"+aX(),REPLACE:"@@redux/REPLACE"+aX(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+aX()}};function sHn(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Alt(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(vu(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(vu(1));return n(Alt)(e,t)}if(typeof e!="function")throw new Error(vu(2));var i=e,o=t,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(vu(3));return o}function f(g){if(typeof g!="function")throw new Error(vu(4));if(l)throw new Error(vu(5));var v=!0;return c(),a.push(g),function(){if(v){if(l)throw new Error(vu(6));v=!1,c();var O=a.indexOf(g);a.splice(O,1),s=null}}}function d(g){if(!sHn(g))throw new Error(vu(7));if(typeof g.type>"u")throw new Error(vu(8));if(l)throw new Error(vu(9));try{l=!0,o=i(o,g)}finally{l=!1}for(var v=s=a,y=0;y<v.length;y++){var O=v[y];O()}return g}function h(g){if(typeof g!="function")throw new Error(vu(10));i=g,d({type:TAe.REPLACE})}function p(){var g,v=f;return g={subscribe:function(O){if(typeof O!="object"||O===null)throw new Error(vu(11));function m(){O.next&&O.next(u())}m();var w=v(m);return{unsubscribe:w}}},g[$Ae]=function(){return this},g}return d({type:TAe.INIT}),r={dispatch:d,subscribe:f,getState:u,replaceReducer:h},r[$Ae]=p,r}var aHn=function(t,n){return t===n};function lHn(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function cHn(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:aHn;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function PAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function AAe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PAe(Object(n),!0).forEach(function(r){uHn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PAe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uHn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var RAe={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function fHn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:RAe,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case Zge:case jB:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case FB:return lHn(e.clientOffset,n.clientOffset)?e:AAe(AAe({},e),{},{clientOffset:n.clientOffset});case QB:case zB:return RAe;default:return e}}var Gge="dnd-core/ADD_SOURCE",Kge="dnd-core/ADD_TARGET",Jge="dnd-core/REMOVE_SOURCE",BB="dnd-core/REMOVE_TARGET";function dHn(e){return{type:Gge,payload:{sourceId:e}}}function hHn(e){return{type:Kge,payload:{targetId:e}}}function pHn(e){return{type:Jge,payload:{sourceId:e}}}function gHn(e){return{type:BB,payload:{targetId:e}}}function DAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DAe(Object(n),!0).forEach(function(r){mHn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DAe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mHn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yHn={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function vHn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yHn,t=arguments.length>1?arguments[1]:void 0,n=t.payload;switch(t.type){case jB:return bu(bu({},e),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Yge:return bu(bu({},e),{},{isSourcePublic:!0});case FB:return bu(bu({},e),{},{targetIds:n.targetIds});case BB:return e.targetIds.indexOf(n.targetId)===-1?e:bu(bu({},e),{},{targetIds:DUn(e.targetIds,n.targetId)});case zB:return bu(bu({},e),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case QB:return bu(bu({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function bHn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Gge:case Kge:return e+1;case Jge:case BB:return e-1;default:return e}}var A7=[],eme=[];A7.__IS_NONE__=!0;eme.__IS_ALL__=!0;function OHn(e,t){if(e===A7)return!1;if(e===eme||typeof t>"u")return!0;var n=NUn(t,e);return n.length>0}function xHn(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case FB:break;case Gge:case Kge:case BB:case Jge:return A7;case jB:case Yge:case QB:case zB:default:return eme}var t=e.payload,n=t.targetIds,r=n===void 0?[]:n,i=t.prevTargetIds,o=i===void 0?[]:i,s=MUn(r,o),a=s.length>0||!cHn(r,o);if(!a)return A7;var l=o[o.length-1],c=r[r.length-1];return l!==c&&(l&&s.push(l),c&&s.push(c)),s}function wHn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function MAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NAe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MAe(Object(n),!0).forEach(function(r){SHn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MAe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SHn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EHn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:xHn(e.dirtyHandlerIds,{type:t.type,payload:NAe(NAe({},t.payload),{},{prevTargetIds:RUn(e,"dragOperation.targetIds",[])})}),dragOffset:fHn(e.dragOffset,t),refCount:bHn(e.refCount,t),dragOperation:vHn(e.dragOperation,t),stateId:wHn(e.stateId)}}function CHn(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Rlt(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _Hn(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return!t||!n||!r?null:Rlt(CHn(t,r),n)}function kHn(e){var t=e.clientOffset,n=e.initialClientOffset;return!t||!n?null:Rlt(t,n)}function $Hn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IAe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function THn(e,t,n){return t&&IAe(e.prototype,t),n&&IAe(e,n),e}function LAe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var PHn=function(){function e(t,n){$Hn(this,e),LAe(this,"store",void 0),LAe(this,"registry",void 0),this.store=t,this.registry=n}return THn(e,[{key:"subscribeToStateChange",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=i.handlerIds;nn(typeof n=="function","listener must be a function."),nn(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var s=this.store.getState().stateId,a=function(){var c=r.store.getState(),u=c.stateId;try{var f=u===s||u===s+1&&!OHn(c.dirtyHandlerIds,o);f||n()}finally{s=u}};return this.store.subscribe(a)}},{key:"subscribeToOffsetChange",value:function(n){var r=this;nn(typeof n=="function","listener must be a function.");var i=this.store.getState().dragOffset,o=function(){var a=r.store.getState().dragOffset;a!==i&&(i=a,n())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n);return nn(r,"Expected to find a valid source. sourceId=".concat(n)),this.isDragging()?!1:r.canDrag(this,n)}},{key:"canDropOnTarget",value:function(n){if(!n)return!1;var r=this.registry.getTarget(n);if(nn(r,"Expected to find a valid target. targetId=".concat(n)),!this.isDragging()||this.didDrop())return!1;var i=this.registry.getTargetType(n),o=this.getItemType();return jne(i,o)&&r.canDrop(this,n)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n,!0);if(nn(r,"Expected to find a valid source. sourceId=".concat(n)),!this.isDragging()||!this.isSourcePublic())return!1;var i=this.registry.getSourceType(n),o=this.getItemType();return i!==o?!1:r.isDragging(this,n)}},{key:"isOverTarget",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!n)return!1;var i=r.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(n),s=this.getItemType();if(s&&!jne(o,s))return!1;var a=this.getTargetIds();if(!a.length)return!1;var l=a.indexOf(n);return i?l===a.length-1:l>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return _Hn(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return kHn(this.store.getState().dragOffset)}}]),e}(),AHn=0;function RHn(){return AHn++}function LL(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?LL=function(n){return typeof n}:LL=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},LL(e)}function DHn(e){nn(typeof e.canDrag=="function","Expected canDrag to be a function."),nn(typeof e.beginDrag=="function","Expected beginDrag to be a function."),nn(typeof e.endDrag=="function","Expected endDrag to be a function.")}function MHn(e){nn(typeof e.canDrop=="function","Expected canDrop to be a function."),nn(typeof e.hover=="function","Expected hover to be a function."),nn(typeof e.drop=="function","Expected beginDrag to be a function.")}function Fne(e,t){if(t&&Array.isArray(e)){e.forEach(function(n){return Fne(n,!1)});return}nn(typeof e=="string"||LL(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const jAe=typeof global<"u"?global:self,Dlt=jAe.MutationObserver||jAe.WebKitMutationObserver;function Mlt(e){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),e()}}}function NHn(e){let t=1;const n=new Dlt(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}const IHn=typeof Dlt=="function"?NHn:Mlt;class LHn{enqueueTask(t){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const n=this.index;if(this.index++,t[n].call(),this.index>this.capacity){for(let r=0,i=t.length-this.index;r<i;r++)t[r]=t[r+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=IHn(this.flush),this.requestErrorThrow=Mlt(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class jHn{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}class FHn{create(t){const n=this.freeTasks,r=n.length?n.pop():new jHn(this.onError,i=>n[n.length]=i);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}const Nlt=new LHn,zHn=new FHn(Nlt.registerPendingError);function QHn(e){Nlt.enqueueTask(zHn.create(e))}function BHn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FAe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function WHn(e,t,n){return t&&FAe(e.prototype,t),n&&FAe(e,n),e}function gw(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qHn(e,t){return XHn(e)||HHn(e,t)||UHn(e,t)||VHn()}function VHn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UHn(e,t){if(e){if(typeof e=="string")return zAe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zAe(e,t)}}function zAe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function HHn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function XHn(e){if(Array.isArray(e))return e}function ZHn(e){var t=RHn().toString();switch(e){case Iu.SOURCE:return"S".concat(t);case Iu.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function QAe(e){switch(e[0]){case"S":return Iu.SOURCE;case"T":return Iu.TARGET;default:nn(!1,"Cannot parse handler ID: ".concat(e))}}function BAe(e,t){var n=e.entries(),r=!1;do{var i=n.next(),o=i.done,s=qHn(i.value,2),a=s[1];if(a===t)return!0;r=!!o}while(!r);return!1}var YHn=function(){function e(t){BHn(this,e),gw(this,"types",new Map),gw(this,"dragSources",new Map),gw(this,"dropTargets",new Map),gw(this,"pinnedSourceId",null),gw(this,"pinnedSource",null),gw(this,"store",void 0),this.store=t}return WHn(e,[{key:"addSource",value:function(n,r){Fne(n),DHn(r);var i=this.addHandler(Iu.SOURCE,n,r);return this.store.dispatch(dHn(i)),i}},{key:"addTarget",value:function(n,r){Fne(n,!0),MHn(r);var i=this.addHandler(Iu.TARGET,n,r);return this.store.dispatch(hHn(i)),i}},{key:"containsHandler",value:function(n){return BAe(this.dragSources,n)||BAe(this.dropTargets,n)}},{key:"getSource",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;nn(this.isSourceId(n),"Expected a valid source ID.");var i=r&&n===this.pinnedSourceId,o=i?this.pinnedSource:this.dragSources.get(n);return o}},{key:"getTarget",value:function(n){return nn(this.isTargetId(n),"Expected a valid target ID."),this.dropTargets.get(n)}},{key:"getSourceType",value:function(n){return nn(this.isSourceId(n),"Expected a valid source ID."),this.types.get(n)}},{key:"getTargetType",value:function(n){return nn(this.isTargetId(n),"Expected a valid target ID."),this.types.get(n)}},{key:"isSourceId",value:function(n){var r=QAe(n);return r===Iu.SOURCE}},{key:"isTargetId",value:function(n){var r=QAe(n);return r===Iu.TARGET}},{key:"removeSource",value:function(n){var r=this;nn(this.getSource(n),"Expected an existing source."),this.store.dispatch(pHn(n)),QHn(function(){r.dragSources.delete(n),r.types.delete(n)})}},{key:"removeTarget",value:function(n){nn(this.getTarget(n),"Expected an existing target."),this.store.dispatch(gHn(n)),this.dropTargets.delete(n),this.types.delete(n)}},{key:"pinSource",value:function(n){var r=this.getSource(n);nn(r,"Expected an existing source."),this.pinnedSourceId=n,this.pinnedSource=r}},{key:"unpinSource",value:function(){nn(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(n,r,i){var o=ZHn(n);return this.types.set(o,r),n===Iu.SOURCE?this.dragSources.set(o,i):n===Iu.TARGET&&this.dropTargets.set(o,i),o}}]),e}();function GHn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=KHn(r),o=new PHn(i,new YHn(i)),s=new oHn(i,o),a=e(s,t,n);return s.receiveBackend(a),s}function KHn(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Alt(EHn,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var JHn=["children"];function eXn(e,t){return iXn(e)||rXn(e,t)||nXn(e,t)||tXn()}function tXn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nXn(e,t){if(e){if(typeof e=="string")return WAe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return WAe(e,t)}}function WAe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function rXn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function iXn(e){if(Array.isArray(e))return e}function oXn(e,t){if(e==null)return{};var n=sXn(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sXn(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var qAe=0,jL=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),aXn=x.memo(function(t){var n=t.children,r=oXn(t,JHn),i=lXn(r),o=eXn(i,2),s=o[0],a=o[1];return x.useEffect(function(){if(a){var l=Ilt();return++qAe,function(){--qAe===0&&(l[jL]=null)}}},[]),b.jsx(Tlt.Provider,Object.assign({value:s},{children:n}),void 0)});function lXn(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var n=cXn(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[n,r]}function cXn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ilt(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=t;return i[jL]||(i[jL]={dragDropManager:GHn(e,t,n,r)}),i[jL]}function Ilt(){return typeof global<"u"?global:window}function uXn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VAe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fXn(e,t,n){return t&&VAe(e.prototype,t),n&&VAe(e,n),e}function UAe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var lX=!1,cX=!1,dXn=function(){function e(t){uXn(this,e),UAe(this,"internalMonitor",void 0),UAe(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return fXn(e,[{key:"receiveHandlerId",value:function(n){this.sourceId=n}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){nn(!lX,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return lX=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{lX=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;nn(!cX,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return cX=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{cX=!1}}},{key:"subscribeToStateChange",value:function(n,r){return this.internalMonitor.subscribeToStateChange(n,r)}},{key:"isDraggingSource",value:function(n){return this.internalMonitor.isDraggingSource(n)}},{key:"isOverTarget",value:function(n,r){return this.internalMonitor.isOverTarget(n,r)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(n){return this.internalMonitor.subscribeToOffsetChange(n)}},{key:"canDragSource",value:function(n){return this.internalMonitor.canDragSource(n)}},{key:"canDropOnTarget",value:function(n){return this.internalMonitor.canDropOnTarget(n)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e}();function hXn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HAe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pXn(e,t,n){return t&&HAe(e.prototype,t),n&&HAe(e,n),e}function XAe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var uX=!1,gXn=function(){function e(t){hXn(this,e),XAe(this,"internalMonitor",void 0),XAe(this,"targetId",null),this.internalMonitor=t.getMonitor()}return pXn(e,[{key:"receiveHandlerId",value:function(n){this.targetId=n}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(n,r){return this.internalMonitor.subscribeToStateChange(n,r)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;nn(!uX,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return uX=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{uX=!1}}},{key:"isOver",value:function(n){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,n):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e}();function mXn(e){if(typeof e.type!="string"){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function yXn(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!x.isValidElement(t)){var r=t;return e(r,n),r}var i=t;mXn(i);var o=n?function(s){return e(s,n)}:e;return vXn(i,o)}}function Llt(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{var i=yXn(r);t[n]=function(){return i}}}),t}function ZAe(e,t){typeof e=="function"?e(t):e.current=t}function vXn(e,t){var n=e.ref;return nn(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?x.cloneElement(e,{ref:function(i){ZAe(n,i),ZAe(t,i)}}):x.cloneElement(e,{ref:t})}function FL(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?FL=function(n){return typeof n}:FL=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},FL(e)}function zne(e){return e!==null&&FL(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Qne(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l<o.length;l++){var c=o[l];if(!a(c))return!1;var u=e[c],f=t[c];if(i=n?n.call(r,u,f,c):void 0,i===!1||i===void 0&&u!==f)return!1}return!0}function bXn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YAe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function OXn(e,t,n){return t&&YAe(e.prototype,t),n&&YAe(e,n),e}function ca(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xXn=function(){function e(t){var n=this;bXn(this,e),ca(this,"hooks",Llt({dragSource:function(i,o){n.clearDragSource(),n.dragSourceOptions=o||null,zne(i)?n.dragSourceRef=i:n.dragSourceNode=i,n.reconnectDragSource()},dragPreview:function(i,o){n.clearDragPreview(),n.dragPreviewOptions=o||null,zne(i)?n.dragPreviewRef=i:n.dragPreviewNode=i,n.reconnectDragPreview()}})),ca(this,"handlerId",null),ca(this,"dragSourceRef",null),ca(this,"dragSourceNode",void 0),ca(this,"dragSourceOptionsInternal",null),ca(this,"dragSourceUnsubscribe",void 0),ca(this,"dragPreviewRef",null),ca(this,"dragPreviewNode",void 0),ca(this,"dragPreviewOptionsInternal",null),ca(this,"dragPreviewUnsubscribe",void 0),ca(this,"lastConnectedHandlerId",null),ca(this,"lastConnectedDragSource",null),ca(this,"lastConnectedDragSourceOptions",null),ca(this,"lastConnectedDragPreview",null),ca(this,"lastConnectedDragPreviewOptions",null),ca(this,"backend",void 0),this.backend=t}return OXn(e,[{key:"receiveHandlerId",value:function(n){this.handlerId!==n&&(this.handlerId=n,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(n){this.dragSourceOptionsInternal=n}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(n){this.dragPreviewOptionsInternal=n}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var n=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(r&&this.disconnectDragSource(),!!this.handlerId){if(!n){this.lastConnectedDragSource=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=n,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,n,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var n=this.dragPreview,r=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Qne(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Qne(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),e}();function wXn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GAe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function SXn(e,t,n){return t&&GAe(e.prototype,t),n&&GAe(e,n),e}function oh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var EXn=function(){function e(t){var n=this;wXn(this,e),oh(this,"hooks",Llt({dropTarget:function(i,o){n.clearDropTarget(),n.dropTargetOptions=o,zne(i)?n.dropTargetRef=i:n.dropTargetNode=i,n.reconnect()}})),oh(this,"handlerId",null),oh(this,"dropTargetRef",null),oh(this,"dropTargetNode",void 0),oh(this,"dropTargetOptionsInternal",null),oh(this,"unsubscribeDropTarget",void 0),oh(this,"lastConnectedHandlerId",null),oh(this,"lastConnectedDropTarget",null),oh(this,"lastConnectedDropTargetOptions",null),oh(this,"backend",void 0),this.backend=t}return SXn(e,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var n=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();n&&this.disconnectDropTarget();var r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(n){n!==this.handlerId&&(this.handlerId=n,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(n){this.dropTargetOptionsInternal=n}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Qne(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),e}();function CXn(e,t,n){var r=n.getRegistry(),i=r.addTarget(e,t);return[i,function(){return r.removeTarget(i)}]}function _Xn(e,t,n){var r=n.getRegistry(),i=r.addSource(e,t);return[i,function(){return r.removeSource(i)}]}var FO=typeof window<"u"?x.useLayoutEffect:x.useEffect;function zL(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zL=function(n){return typeof n}:zL=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},zL(e)}function kXn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KAe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $Xn(e,t,n){return t&&KAe(e.prototype,t),n&&KAe(e,n),e}function fX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var TXn=function(){function e(t,n,r){kXn(this,e),fX(this,"spec",void 0),fX(this,"monitor",void 0),fX(this,"connector",void 0),this.spec=t,this.monitor=n,this.connector=r}return $Xn(e,[{key:"beginDrag",value:function(){var n,r=this.spec,i=this.monitor,o=null;return zL(r.item)==="object"?o=r.item:typeof r.item=="function"?o=r.item(i):o={},(n=o)!==null&&n!==void 0?n:null}},{key:"canDrag",value:function(){var n=this.spec,r=this.monitor;return typeof n.canDrag=="boolean"?n.canDrag:typeof n.canDrag=="function"?n.canDrag(r):!0}},{key:"isDragging",value:function(n,r){var i=this.spec,o=this.monitor,s=i.isDragging;return s?s(o):r===n.getSourceId()}},{key:"endDrag",value:function(){var n=this.spec,r=this.monitor,i=this.connector,o=n.end;o&&o(r.getItem(),r),i.reconnect()}}]),e}();function PXn(e,t,n){var r=x.useMemo(function(){return new TXn(e,t,n)},[t,n]);return x.useEffect(function(){r.spec=e},[e]),r}function Sx(){var e=x.useContext(Tlt),t=e.dragDropManager;return nn(t!=null,"Expected drag drop context"),t}function AXn(e){return x.useMemo(function(){var t=e.type;return nn(t!=null,"spec.type must be defined"),t},[e])}function RXn(e,t){return IXn(e)||NXn(e,t)||MXn(e,t)||DXn()}function DXn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MXn(e,t){if(e){if(typeof e=="string")return JAe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JAe(e,t)}}function JAe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NXn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function IXn(e){if(Array.isArray(e))return e}function LXn(e,t,n){var r=Sx(),i=PXn(e,t,n),o=AXn(e);FO(function(){if(o!=null){var a=_Xn(o,i,r),l=RXn(a,2),c=l[0],u=l[1];return t.receiveHandlerId(c),n.receiveHandlerId(c),u}},[r,t,n,i,o])}function jXn(e){return BXn(e)||QXn(e)||zXn(e)||FXn()}function FXn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zXn(e,t){if(e){if(typeof e=="string")return Bne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bne(e,t)}}function QXn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function BXn(e){if(Array.isArray(e))return Bne(e)}function Bne(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jlt(e,t){var n=jXn(t||[]);return t==null&&typeof e!="function"&&n.push(e),x.useMemo(function(){return typeof e=="function"?e():e},n)}function WXn(){var e=Sx();return x.useMemo(function(){return new dXn(e)},[e])}function qXn(e,t){var n=Sx(),r=x.useMemo(function(){return new xXn(n.getBackend())},[n]);return FO(function(){return r.dragSourceOptions=e||null,r.reconnect(),function(){return r.disconnectDragSource()}},[r,e]),FO(function(){return r.dragPreviewOptions=t||null,r.reconnect(),function(){return r.disconnectDragPreview()}},[r,t]),r}function VXn(e,t){return ZXn(e)||XXn(e,t)||HXn(e,t)||UXn()}function UXn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HXn(e,t){if(e){if(typeof e=="string")return eRe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eRe(e,t)}}function eRe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function XXn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function ZXn(e){if(Array.isArray(e))return e}function Flt(e,t,n){var r=x.useState(function(){return t(e)}),i=VXn(r,2),o=i[0],s=i[1],a=x.useCallback(function(){var l=t(e);ett(o,l)||(s(l),n&&n())},[o,e,n]);return FO(a),[o,a]}function YXn(e,t){return eZn(e)||JXn(e,t)||KXn(e,t)||GXn()}function GXn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KXn(e,t){if(e){if(typeof e=="string")return tRe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tRe(e,t)}}function tRe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function JXn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function eZn(e){if(Array.isArray(e))return e}function tZn(e,t,n){var r=Flt(e,t,n),i=YXn(r,2),o=i[0],s=i[1];return FO(function(){var l=e.getHandlerId();if(l!=null)return e.subscribeToStateChange(s,{handlerIds:[l]})},[e,s]),o}function zlt(e,t,n){return tZn(t,e||function(){return{}},function(){return n.reconnect()})}function nZn(e){return x.useMemo(function(){return e.hooks.dragSource()},[e])}function rZn(e){return x.useMemo(function(){return e.hooks.dragPreview()},[e])}function iZn(e,t){var n=jlt(e,t);nn(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var r=WXn(),i=qXn(n.options,n.previewOptions);return LXn(n,r,i),[zlt(n.collect,r,i),nZn(i),rZn(i)]}function oZn(e){var t=e.accept;return x.useMemo(function(){return nn(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function sZn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nRe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aZn(e,t,n){return t&&nRe(e.prototype,t),n&&nRe(e,n),e}function rRe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var lZn=function(){function e(t,n){sZn(this,e),rRe(this,"spec",void 0),rRe(this,"monitor",void 0),this.spec=t,this.monitor=n}return aZn(e,[{key:"canDrop",value:function(){var n=this.spec,r=this.monitor;return n.canDrop?n.canDrop(r.getItem(),r):!0}},{key:"hover",value:function(){var n=this.spec,r=this.monitor;n.hover&&n.hover(r.getItem(),r)}},{key:"drop",value:function(){var n=this.spec,r=this.monitor;if(n.drop)return n.drop(r.getItem(),r)}}]),e}();function cZn(e,t){var n=x.useMemo(function(){return new lZn(e,t)},[t]);return x.useEffect(function(){n.spec=e},[e]),n}function uZn(e,t){return pZn(e)||hZn(e,t)||dZn(e,t)||fZn()}function fZn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dZn(e,t){if(e){if(typeof e=="string")return iRe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iRe(e,t)}}function iRe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hZn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function pZn(e){if(Array.isArray(e))return e}function gZn(e,t,n){var r=Sx(),i=cZn(e,t),o=oZn(e);FO(function(){var a=CXn(o,i,r),l=uZn(a,2),c=l[0],u=l[1];return t.receiveHandlerId(c),n.receiveHandlerId(c),u},[r,t,i,n,o.map(function(s){return s.toString()}).join("|")])}function mZn(){var e=Sx();return x.useMemo(function(){return new gXn(e)},[e])}function yZn(e){var t=Sx(),n=x.useMemo(function(){return new EXn(t.getBackend())},[t]);return FO(function(){return n.dropTargetOptions=e||null,n.reconnect(),function(){return n.disconnectDropTarget()}},[e]),n}function vZn(e){return x.useMemo(function(){return e.hooks.dropTarget()},[e])}function Qlt(e,t){var n=jlt(e,t),r=mZn(),i=yZn(n.options);return gZn(n,r,i),[zlt(n.collect,r,i),vZn(i)]}function bZn(e,t){return SZn(e)||wZn(e,t)||xZn(e,t)||OZn()}function OZn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xZn(e,t){if(e){if(typeof e=="string")return oRe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oRe(e,t)}}function oRe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wZn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function SZn(e){if(Array.isArray(e))return e}function EZn(e){var t=Sx(),n=t.getMonitor(),r=Flt(n,e),i=bZn(r,2),o=i[0],s=i[1];return x.useEffect(function(){return n.subscribeToOffsetChange(s)}),x.useEffect(function(){return n.subscribeToStateChange(s)}),o}function Blt(e){var t=null,n=function(){return t==null&&(t=e()),t};return n}function CZn(e,t){return e.filter(function(n){return n!==t})}function _Zn(e,t){var n=new Set,r=function(s){return n.add(s)};e.forEach(r),t.forEach(r);var i=[];return n.forEach(function(o){return i.push(o)}),i}function kZn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sRe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $Zn(e,t,n){return t&&sRe(e.prototype,t),n&&sRe(e,n),e}function aRe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var TZn=function(){function e(t){kZn(this,e),aRe(this,"entered",[]),aRe(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return $Zn(e,[{key:"enter",value:function(n){var r=this,i=this.entered.length,o=function(a){return r.isNodeInDocument(a)&&(!a.contains||a.contains(n))};return this.entered=_Zn(this.entered.filter(o),[n]),i===0&&this.entered.length>0}},{key:"leave",value:function(n){var r=this.entered.length;return this.entered=CZn(this.entered.filter(this.isNodeInDocument),n),r>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e}(),PZn=Blt(function(){return/firefox/i.test(navigator.userAgent)}),Wlt=Blt(function(){return!!window.safari});function AZn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lRe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function RZn(e,t,n){return t&&lRe(e.prototype,t),n&&lRe(e,n),e}function p$(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cRe=function(){function e(t,n){AZn(this,e),p$(this,"xs",void 0),p$(this,"ys",void 0),p$(this,"c1s",void 0),p$(this,"c2s",void 0),p$(this,"c3s",void 0);for(var r=t.length,i=[],o=0;o<r;o++)i.push(o);i.sort(function(k,P){return t[k]<t[P]?-1:1});for(var s=[],a=[],l,c,u=0;u<r-1;u++)l=t[u+1]-t[u],c=n[u+1]-n[u],s.push(l),a.push(c/l);for(var f=[a[0]],d=0;d<s.length-1;d++){var h=a[d],p=a[d+1];if(h*p<=0)f.push(0);else{l=s[d];var g=s[d+1],v=l+g;f.push(3*v/((v+g)/h+(v+l)/p))}}f.push(a[a.length-1]);for(var y=[],O=[],m,w=0;w<f.length-1;w++){m=a[w];var S=f[w],E=1/s[w],C=S+f[w+1]-m-m;y.push((m-S-C)*E),O.push(C*E*E)}this.xs=t,this.ys=n,this.c1s=f,this.c2s=y,this.c3s=O}return RZn(e,[{key:"interpolate",value:function(n){var r=this.xs,i=this.ys,o=this.c1s,s=this.c2s,a=this.c3s,l=r.length-1;if(n===r[l])return i[l];for(var c=0,u=a.length-1,f;c<=u;){f=Math.floor(.5*(c+u));var d=r[f];if(d<n)c=f+1;else if(d>n)u=f-1;else return i[f]}l=Math.max(0,u);var h=n-r[l],p=h*h;return i[l]+o[l]*h+s[l]*p+a[l]*h*p}}]),e}(),DZn=1;function qlt(e){var t=e.nodeType===DZn?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top,i=n.left;return{x:i,y:r}}function r5(e){return{x:e.clientX,y:e.clientY}}function MZn(e){var t;return e.nodeName==="IMG"&&(PZn()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function NZn(e,t,n,r){var i=e?t.width:n,o=e?t.height:r;return Wlt()&&e&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}function IZn(e,t,n,r,i){var o=MZn(t),s=o?e:t,a=qlt(s),l={x:n.x-a.x,y:n.y-a.y},c=e.offsetWidth,u=e.offsetHeight,f=r.anchorX,d=r.anchorY,h=NZn(o,t,c,u),p=h.dragPreviewWidth,g=h.dragPreviewHeight,v=function(){var C=new cRe([0,.5,1],[l.y,l.y/u*g,l.y+g-u]),k=C.interpolate(d);return Wlt()&&o&&(k+=(window.devicePixelRatio-1)*g),k},y=function(){var C=new cRe([0,.5,1],[l.x,l.x/c*p,l.x+p-c]);return C.interpolate(f)},O=i.offsetX,m=i.offsetY,w=O===0||O,S=m===0||m;return{x:w?O:y(),y:S?m:v()}}var Vlt="__NATIVE_FILE__",Ult="__NATIVE_URL__",Hlt="__NATIVE_TEXT__",Xlt="__NATIVE_HTML__";const uRe=Object.freeze(Object.defineProperty({__proto__:null,FILE:Vlt,HTML:Xlt,TEXT:Hlt,URL:Ult},Symbol.toStringTag,{value:"Module"}));function dX(e,t,n){var r=t.reduce(function(i,o){return i||e.getData(o)},"");return r??n}var mw;function i5(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Wne=(mw={},i5(mw,Vlt,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),i5(mw,Xlt,{exposeProperties:{html:function(t,n){return dX(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),i5(mw,Ult,{exposeProperties:{urls:function(t,n){return dX(t,n,"").split(`
`)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),i5(mw,Hlt,{exposeProperties:{text:function(t,n){return dX(t,n,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),mw);function LZn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fRe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function jZn(e,t,n){return t&&fRe(e.prototype,t),n&&fRe(e,n),e}function dRe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var FZn=function(){function e(t){LZn(this,e),dRe(this,"item",void 0),dRe(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return jZn(e,[{key:"initializeExposedProperties",value:function(){var n=this;Object.keys(this.config.exposeProperties).forEach(function(r){Object.defineProperty(n.item,r,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(r,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(n){var r=this;if(n){var i={};Object.keys(this.config.exposeProperties).forEach(function(o){i[o]={value:r.config.exposeProperties[o](n,r.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,i)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(n,r){return r===n.getSourceId()}},{key:"endDrag",value:function(){}}]),e}();function zZn(e,t){var n=new FZn(Wne[e]);return n.loadDataTransfer(t),n}function hX(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(Wne).filter(function(n){var r=Wne[n].matchesTypes;return r.some(function(i){return t.indexOf(i)>-1})})[0]||null}function QZn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hRe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function BZn(e,t,n){return t&&hRe(e.prototype,t),n&&hRe(e,n),e}function pX(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var WZn=function(){function e(t,n){QZn(this,e),pX(this,"ownerDocument",null),pX(this,"globalContext",void 0),pX(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=n}return BZn(e,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var n;return(n=this.globalContext)!==null&&n!==void 0&&n.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var n;return((n=this.optionsArgs)===null||n===void 0?void 0:n.rootElement)||this.window}}]),e}();function pRe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gRe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pRe(Object(n),!0).forEach(function(r){kn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pRe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qZn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mRe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function VZn(e,t,n){return t&&mRe(e.prototype,t),n&&mRe(e,n),e}function kn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var UZn=function(){function e(t,n,r){var i=this;qZn(this,e),kn(this,"options",void 0),kn(this,"actions",void 0),kn(this,"monitor",void 0),kn(this,"registry",void 0),kn(this,"enterLeaveCounter",void 0),kn(this,"sourcePreviewNodes",new Map),kn(this,"sourcePreviewNodeOptions",new Map),kn(this,"sourceNodes",new Map),kn(this,"sourceNodeOptions",new Map),kn(this,"dragStartSourceIds",null),kn(this,"dropTargetIds",[]),kn(this,"dragEnterTargetIds",[]),kn(this,"currentNativeSource",null),kn(this,"currentNativeHandle",null),kn(this,"currentDragSourceNode",null),kn(this,"altKeyPressed",!1),kn(this,"mouseMoveTimeoutTimer",null),kn(this,"asyncEndDragFrameId",null),kn(this,"dragOverTargetIds",null),kn(this,"lastClientOffset",null),kn(this,"hoverRafId",null),kn(this,"getSourceClientOffset",function(o){var s=i.sourceNodes.get(o);return s&&qlt(s)||null}),kn(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),kn(this,"isNodeInDocument",function(o){return!!(o&&i.document&&i.document.body&&i.document.body.contains(o))}),kn(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=i.currentDragSourceNode;o==null||i.isNodeInDocument(o)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),kn(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),kn(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var s=i.dragStartSourceIds;i.dragStartSourceIds=null;var a=r5(o);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:a});var l=o.dataTransfer,c=hX(l);if(i.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){var u=i.monitor.getSourceId(),f=i.sourceNodes.get(u),d=i.sourcePreviewNodes.get(u)||f;if(d){var h=i.getCurrentSourcePreviewNodeOptions(),p=h.anchorX,g=h.anchorY,v=h.offsetX,y=h.offsetY,O={anchorX:p,anchorY:g},m={offsetX:v,offsetY:y},w=IZn(f,d,a,O,m);l.setDragImage(d,w.x,w.y)}}try{l==null||l.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(o.target);var S=i.getCurrentSourcePreviewNodeOptions(),E=S.captureDraggingState;E?i.actions.publishDragSource():setTimeout(function(){return i.actions.publishDragSource()},0)}else if(c)i.beginDragNativeItem(c);else{if(l&&!l.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),kn(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),kn(this,"handleTopDragEnterCapture",function(o){i.dragEnterTargetIds=[];var s=i.enterLeaveCounter.enter(o.target);if(!(!s||i.monitor.isDragging())){var a=o.dataTransfer,l=hX(a);l&&i.beginDragNativeItem(l,a)}}),kn(this,"handleTopDragEnter",function(o){var s=i.dragEnterTargetIds;if(i.dragEnterTargetIds=[],!!i.monitor.isDragging()){i.altKeyPressed=o.altKey,s.length>0&&i.actions.hover(s,{clientOffset:r5(o)});var a=s.some(function(l){return i.monitor.canDropOnTarget(l)});a&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect()))}}),kn(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),kn(this,"handleTopDragOver",function(o){var s=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}i.altKeyPressed=o.altKey,i.lastClientOffset=r5(o),i.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(i.hoverRafId=requestAnimationFrame(function(){i.monitor.isDragging()&&i.actions.hover(s||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null}));var a=(s||[]).some(function(l){return i.monitor.canDropOnTarget(l)});a?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),kn(this,"handleTopDragLeaveCapture",function(o){i.isDraggingNativeItem()&&o.preventDefault();var s=i.enterLeaveCounter.leave(o.target);s&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),kn(this,"handleTopDropCapture",function(o){if(i.dropTargetIds=[],i.isDraggingNativeItem()){var s;o.preventDefault(),(s=i.currentNativeSource)===null||s===void 0||s.loadDataTransfer(o.dataTransfer)}else hX(o.dataTransfer)&&o.preventDefault();i.enterLeaveCounter.reset()}),kn(this,"handleTopDrop",function(o){var s=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(s,{clientOffset:r5(o)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),kn(this,"handleSelectStart",function(o){var s=o.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(o.preventDefault(),s.dragDrop()))}),this.options=new WZn(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new TZn(this.isNodeInDocument)}return VZn(e,[{key:"profile",value:function(){var n,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((n=this.dragStartSourceIds)===null||n===void 0?void 0:n.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var n=this.rootElement;if(n!==void 0){if(n.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");n.__isReactDndBackendSetUp=!0,this.addEventListeners(n)}}},{key:"teardown",value:function(){var n=this.rootElement;if(n!==void 0&&(n.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(n,r,i){var o=this;return this.sourcePreviewNodeOptions.set(n,i),this.sourcePreviewNodes.set(n,r),function(){o.sourcePreviewNodes.delete(n),o.sourcePreviewNodeOptions.delete(n)}}},{key:"connectDragSource",value:function(n,r,i){var o=this;this.sourceNodes.set(n,r),this.sourceNodeOptions.set(n,i);var s=function(c){return o.handleDragStart(c,n)},a=function(c){return o.handleSelectStart(c)};return r.setAttribute("draggable","true"),r.addEventListener("dragstart",s),r.addEventListener("selectstart",a),function(){o.sourceNodes.delete(n),o.sourceNodeOptions.delete(n),r.removeEventListener("dragstart",s),r.removeEventListener("selectstart",a),r.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(n,r){var i=this,o=function(c){return i.handleDragEnter(c,n)},s=function(c){return i.handleDragOver(c,n)},a=function(c){return i.handleDrop(c,n)};return r.addEventListener("dragenter",o),r.addEventListener("dragover",s),r.addEventListener("drop",a),function(){r.removeEventListener("dragenter",o),r.removeEventListener("dragover",s),r.removeEventListener("drop",a)}}},{key:"addEventListeners",value:function(n){n.addEventListener&&(n.addEventListener("dragstart",this.handleTopDragStart),n.addEventListener("dragstart",this.handleTopDragStartCapture,!0),n.addEventListener("dragend",this.handleTopDragEndCapture,!0),n.addEventListener("dragenter",this.handleTopDragEnter),n.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),n.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),n.addEventListener("dragover",this.handleTopDragOver),n.addEventListener("dragover",this.handleTopDragOverCapture,!0),n.addEventListener("drop",this.handleTopDrop),n.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(n){n.removeEventListener&&(n.removeEventListener("dragstart",this.handleTopDragStart),n.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),n.removeEventListener("dragend",this.handleTopDragEndCapture,!0),n.removeEventListener("dragenter",this.handleTopDragEnter),n.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),n.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),n.removeEventListener("dragover",this.handleTopDragOver),n.removeEventListener("dragover",this.handleTopDragOverCapture,!0),n.removeEventListener("drop",this.handleTopDrop),n.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var n=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(n);return gRe({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var n=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(n);return gRe({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}},{key:"isDraggingNativeItem",value:function(){var n=this.monitor.getItemType();return Object.keys(uRe).some(function(r){return uRe[r]===n})}},{key:"beginDragNativeItem",value:function(n,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=zZn(n,r),this.currentNativeHandle=this.registry.addSource(n,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(n){var r=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=n;var i=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=r.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",r.endDragIfSourceWasRemovedFromDOM,!0)},i)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var n;(n=this.window)===null||n===void 0||n.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(n,r){n.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}},{key:"handleDragEnter",value:function(n,r){this.dragEnterTargetIds.unshift(r)}},{key:"handleDragOver",value:function(n,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}},{key:"handleDrop",value:function(n,r){this.dropTargetIds.unshift(r)}}]),e}(),o5;function HZn(){return o5||(o5=new Image,o5.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),o5}var XZn=function(t,n,r){return new UZn(t,n,r)};function ZZn(e){const t=gu(),n=t.selectedIds,[r,i,o]=iZn(()=>({canDrag:()=>e.isDraggable,type:"NODE",item:()=>{const s=t.isSelected(e.id)?Array.from(n):[e.id];return t.dispatch(DC.dragStart(e.id,s)),{id:e.id}},end:()=>{t.hideCursor();let{parentId:s,index:a,dragIds:l}=t.state.dnd;t.canDrop()&&(Elt(t.props.onMove,{dragIds:l,parentId:s===rR?null:s,index:a===null?0:a,dragNodes:t.dragNodes,parentNode:t.get(s)}),t.open(s)),t.dispatch(DC.dragEnd())}}),[n,e]);return x.useEffect(()=>{o(HZn())},[o]),i}function YZn(e,t){const n=e.getBoundingClientRect(),r=t.x-Math.round(n.x),i=t.y-Math.round(n.y),o=n.height,s=i<o/2,a=!s,l=o/4,c=i>l&&i<o-l;return{x:r,inTopHalf:s,inBottomHalf:a,inMiddle:c,atTop:!c&&s,atBottom:!c&&a}}function GZn(e,t,n,r){return e?e.isInternal?r.atTop?[t,e]:r.inMiddle?[e,e]:[e,n]:r.inTopHalf?[t,e]:[e,n]:[t,null]}function s5(e,t){return{parentId:e||null,index:t}}function yw(e,t){return{type:"line",index:e,level:t}}function KZn(e){return{type:"highlight",id:e}}function gX(e,t){var n;let r=e;for(;r.parent&&r.level>t;)r=r.parent;const i=((n=r.parent)===null||n===void 0?void 0:n.id)||null,o=blt(r)+1;return{parentId:i,index:o}}function Zlt(e){var t;const n=YZn(e.element,e.offset),r=e.indent,i=Math.round(Math.max(0,n.x-r)/r),{node:o,nextNode:s,prevNode:a}=e,[l,c]=GZn(o,a,s,n);if(o&&o.isInternal&&n.inMiddle)return{drop:s5(o.id,null),cursor:KZn(o.id)};if(!l)return{drop:s5((t=c==null?void 0:c.parent)===null||t===void 0?void 0:t.id,0),cursor:yw(0,0)};if(glt(l)){const u=NL(i,(c==null?void 0:c.level)||0,l.level);return{drop:gX(l,u),cursor:yw(l.rowIndex+1,u)}}if(mlt(l)){const u=NL(i,(c==null?void 0:c.level)||0,l.level);return{drop:gX(l,u),cursor:yw(l.rowIndex+1,u)}}if(ylt(l)){const u=NL(i,0,l.level+1);return u>l.level?{drop:s5(l.id,0),cursor:yw(l.rowIndex+1,u)}:{drop:gX(l,u),cursor:yw(l.rowIndex+1,u)}}return{drop:s5(l==null?void 0:l.id,0),cursor:yw(l.rowIndex+1,l.level+1)}}function JZn(e,t){const n=gu(),[r,i]=Qlt(()=>({accept:"NODE",canDrop:()=>n.canDrop(),hover:(o,s)=>{const a=s.getClientOffset();if(!e.current||!a)return;const{cursor:l,drop:c}=Zlt({element:e.current,offset:a,indent:n.indent,node:t,prevNode:t.prev,nextNode:t.next});c&&n.dispatch(DC.hovering(c.parentId,c.index)),s.canDrop()?l&&n.showCursor(l):n.hideCursor()},drop:(o,s)=>{if(!s.canDrop())return null}}),[t,e.current,n.props]);return i}function eYn(e){const t=gu(),n=t.at(e);if(!n)throw new Error(`Could not find node for index: ${e}`);return x.useMemo(()=>{const r=n.clone();return t.visibleNodes[e]=r,r},[...Object.values(n.state),n])}const tYn=ie.memo(function({index:t,style:n}){plt(),WVn();const r=gu(),i=eYn(t),o=x.useRef(null),s=ZZn(i),a=JZn(o,i),l=x.useCallback(g=>{o.current=g,a(g)},[a]),c=r.indent*i.level,u=x.useMemo(()=>({paddingLeft:c}),[c]),f=x.useMemo(()=>{var g,v;return Object.assign(Object.assign({},n),{top:parseFloat(n.top)+((v=(g=r.props.padding)!==null&&g!==void 0?g:r.props.paddingTop)!==null&&v!==void 0?v:0)})},[n,r.props.padding,r.props.paddingTop]),d={role:"treeitem","aria-level":i.level+1,"aria-selected":i.isSelected,style:f,tabIndex:-1,className:r.props.rowClassName};x.useEffect(()=>{var g;!i.isEditing&&i.isFocused&&((g=o.current)===null||g===void 0||g.focus({preventScroll:!0}))},[i.isEditing,i.isFocused,o.current]);const h=r.renderNode,p=r.renderRow;return b.jsx(p,{node:i,innerRef:l,attrs:d,children:b.jsx(h,{node:i,tree:r,style:u,dragHandle:s})})});let mX="",yRe=null;function Ylt(){plt();const e=gu();return b.jsx("div",{role:"tree",style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var n;if(e.isEditing)return;if(t.key==="Backspace"){if(!e.props.onDelete)return;const i=Array.from(e.selectedIds);if(i.length>1){let o=e.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=e.lastNode),e.focus(o,{scroll:!1}),e.delete(Array.from(i))}else{const o=e.focusedNode;if(o){const s=o.nextSibling,a=o.parent;e.focus(s||a,{scroll:!1}),e.delete(o)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),Olt(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),xlt(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();const i=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(i);return}else{if(!i)return;const o=e.focusedNode;o?o.isSelected?e.selectContiguous(i):e.selectMulti(i):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();const i=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(i);return}else{if(!i)return;const o=e.focusedNode;o?o.isSelected?e.selectContiguous(i):e.selectMulti(i):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){const i=e.focusedNode;if(!i)return;i.isInternal&&i.isOpen?e.focus(e.nextNode):i.isInternal&&e.open(i.id);return}if(t.key==="ArrowLeft"){const i=e.focusedNode;if(!i||i.isRoot)return;i.isInternal&&i.isOpen?e.close(i.id):!((n=i.parent)===null||n===void 0)&&n.isRoot||e.focus(i.parent);return}if(t.key==="a"&&t.metaKey&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key==="a"&&!t.metaKey&&e.props.onCreate){e.createLeaf();return}if(t.key==="A"&&!t.metaKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key==="Home"){t.preventDefault(),e.focus(e.firstNode);return}if(t.key==="End"){t.preventDefault(),e.focus(e.lastNode);return}if(t.key==="Enter"){const i=e.focusedNode;if(!i||!i.isEditable||!e.props.onRename)return;setTimeout(()=>{i&&e.edit(i)});return}if(t.key===" "){t.preventDefault();const i=e.focusedNode;if(!i)return;i.isLeaf?(i.select(),i.activate()):i.toggle();return}if(t.key==="*"){const i=e.focusedNode;if(!i)return;e.openSiblings(i);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(yRe),mX+=t.key,yRe=setTimeout(()=>{mX=""},600);const r=e.visibleNodes.find(i=>{const o=i.data.name;return typeof o=="string"?o.toLowerCase().startsWith(mX):!1});r&&e.focus(r.id)},children:b.jsx(CUn,{className:e.props.className,outerRef:e.listEl,itemCount:e.visibleNodes.length,height:e.height,width:e.width,itemSize:e.rowHeight,overscanCount:e.overscanCount,itemKey:t=>{var n;return((n=e.visibleNodes[t])===null||n===void 0?void 0:n.id)||t},outerElementType:$Un,innerElementType:AUn,onScroll:e.props.onScroll,onItemsRendered:e.onItemsRendered.bind(e),ref:e.list,children:tYn})})}function vRe(e){return e.isFiltered?rYn(e.root,e.isMatch.bind(e)):nYn(e.root)}function nYn(e){const t=[];function n(r){var i;r.level>=0&&t.push(r),r.isOpen&&((i=r.children)===null||i===void 0||i.forEach(n))}return n(e),t.forEach(Glt),t}function rYn(e,t){const n={},r=[];function i(s){if(!s.isRoot&&t(s)){n[s.id]=!0;let l=s.parent;for(;l;)n[l.id]=!0,l=l.parent}if(s.children)for(let l of s.children)i(l)}function o(s){var a;s.level>=0&&n[s.id]&&r.push(s),s.isOpen&&((a=s.children)===null||a===void 0||a.forEach(o))}return i(e),o(e),r.forEach(Glt),r}function Glt(e,t){e.rowIndex=t}const bRe=e=>e.reduce((t,n,r)=>(t[n.id]=r,t),{});var yX=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(f){s(f)}}function l(u){try{c(r.throw(u))}catch(f){s(f)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};const{safeRun:ks,identify:Xp,identifyNull:Lf}=ZVn;class p2{constructor(t,n,r,i){this.store=t,this.props=n,this.list=r,this.listEl=i,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=yAe(this),this.visibleNodes=vRe(this),this.idToIndex=bRe(this.visibleNodes)}update(t){this.props=t,this.root=yAe(this),this.visibleNodes=vRe(this),this.idToIndex=bRe(this.visibleNodes)}dispatch(t){return this.store.dispatch(t)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var t;return(t=this.props.width)!==null&&t!==void 0?t:300}get height(){var t;return(t=this.props.height)!==null&&t!==void 0?t:500}get indent(){var t;return(t=this.props.indent)!==null&&t!==void 0?t:24}get rowHeight(){var t;return(t=this.props.rowHeight)!==null&&t!==void 0?t:24}get overscanCount(){var t;return(t=this.props.overscanCount)!==null&&t!==void 0?t:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var t;const n=(t=this.props.searchMatch)!==null&&t!==void 0?t:(r,i)=>JSON.stringify(Object.values(r.data)).toLocaleLowerCase().includes(i.toLocaleLowerCase());return r=>n(r,this.searchTerm)}accessChildren(t){var n;const r=this.props.childrenAccessor||"children";return(n=uT(t,r))!==null&&n!==void 0?n:null}accessId(t){const n=this.props.idAccessor||"id",r=uT(t,n);if(!r)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return r}get firstNode(){var t;return(t=this.visibleNodes[0])!==null&&t!==void 0?t:null}get lastNode(){var t;return(t=this.visibleNodes[this.visibleNodes.length-1])!==null&&t!==void 0?t:null}get focusedNode(){var t;return(t=this.get(this.state.nodes.focus.id))!==null&&t!==void 0?t:null}get mostRecentNode(){var t;return(t=this.get(this.state.nodes.selection.mostRecent))!==null&&t!==void 0?t:null}get nextNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t+1)}get prevNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t-1)}get(t){return t&&t in this.idToIndex&&this.visibleNodes[this.idToIndex[t]]||null}at(t){return this.visibleNodes[t]||null}nodesBetween(t,n){var r;if(t===null||n===null)return[];const i=(r=this.indexOf(t))!==null&&r!==void 0?r:0,o=this.indexOf(n);if(o===null)return[];const s=Math.min(i,o),a=Math.max(i,o);return this.visibleNodes.slice(s,a+1)}indexOf(t){const n=Slt(t);return n?this.idToIndex[n]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(t={}){var n,r;return yX(this,void 0,void 0,function*(){const i=t.parentId===void 0?klt(this):t.parentId,o=(n=t.index)!==null&&n!==void 0?n:_lt(this),s=(r=t.type)!==null&&r!==void 0?r:"leaf",a=yield ks(this.props.onCreate,{type:s,parentId:i,index:o,parentNode:this.get(i)});a&&(this.focus(a),setTimeout(()=>{this.edit(a).then(()=>{this.select(a),this.activate(a)})}))})}delete(t){return yX(this,void 0,void 0,function*(){if(!t)return;const r=(Array.isArray(t)?t:[t]).map(Xp),i=r.map(o=>this.get(o)).filter(o=>!!o);yield ks(this.props.onDelete,{nodes:i,ids:r})})}edit(t){const n=Xp(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(iX(n)),new Promise(r=>{p2.editPromise=r})}submit(t,n){return yX(this,void 0,void 0,function*(){if(!t)return;const r=Xp(t);yield ks(this.props.onRename,{id:r,name:n,node:this.get(r)}),this.dispatch(iX(null)),this.resolveEdit({cancelled:!1,value:n}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(iX(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(t){const n=this.get(Lf(t));n&&ks(this.props.onActivate,n)}resolveEdit(t){const n=p2.editPromise;n&&n(t),p2.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let t=[];for(let n of Array.from(this.selectedIds)){const r=this.get(n);r&&t.push(r)}return t}focus(t,n={}){t&&(this.props.selectionFollowsFocus?this.select(t):(this.dispatch(hw(Xp(t))),n.scroll!==!1&&this.scrollTo(t),this.focusedNode&&ks(this.props.onFocus,this.focusedNode)))}pageUp(){var t,n;const r=this.visibleStartIndex,o=this.visibleStopIndex-r;let s=(n=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&n!==void 0?n:0;s>r?s=r:s=Math.max(r-o,0),this.focus(this.at(s))}pageDown(){var t,n;const r=this.visibleStartIndex,i=this.visibleStopIndex,o=i-r;let s=(n=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&n!==void 0?n:0;s<i?s=i:s=Math.min(s+o,this.visibleNodes.length-1),this.focus(this.at(s))}select(t,n={}){if(!t)return;const r=n.focus!==!1,i=Xp(t);r&&this.dispatch(hw(i)),this.dispatch(If.only(i)),this.dispatch(If.anchor(i)),this.dispatch(If.mostRecent(i)),this.scrollTo(i,n.align),this.focusedNode&&r&&ks(this.props.onFocus,this.focusedNode),ks(this.props.onSelect,this.selectedNodes)}deselect(t){if(!t)return;const n=Xp(t);this.dispatch(If.remove(n))}selectMulti(t){const n=this.get(Lf(t));n&&(this.dispatch(hw(n.id)),this.dispatch(If.add(n.id)),this.dispatch(If.anchor(n.id)),this.dispatch(If.mostRecent(n.id)),this.scrollTo(n),this.focusedNode&&ks(this.props.onFocus,this.focusedNode),ks(this.props.onSelect,this.selectedNodes))}selectContiguous(t){if(!t)return;const n=Xp(t),{anchor:r,mostRecent:i}=this.state.nodes.selection;this.dispatch(hw(n)),this.dispatch(If.remove(this.nodesBetween(r,i))),this.dispatch(If.add(this.nodesBetween(r,Lf(n)))),this.dispatch(If.mostRecent(n)),this.scrollTo(n),this.focusedNode&&ks(this.props.onFocus,this.focusedNode),ks(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),ks(this.props.onSelect,this.selectedNodes)}selectAll(){var t;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(hw((t=this.lastNode)===null||t===void 0?void 0:t.id)),this.focusedNode&&ks(this.props.onFocus,this.focusedNode),ks(this.props.onSelect,this.selectedNodes)}setSelection(t){var n;const r=new Set((n=t.ids)===null||n===void 0?void 0:n.map(Xp)),i=Lf(t.anchor),o=Lf(t.mostRecent);this.dispatch(If.set({ids:r,anchor:i,mostRecent:o})),ks(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:t}=this.state.dnd;switch(t.type){case"highlight":return t.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(t=>this.get(t)).filter(t=>!!t)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var t;if(this.isFiltered)return!1;const n=(t=this.get(this.state.dnd.parentId))!==null&&t!==void 0?t:this.root,r=this.dragNodes,i=this.props.disableDrop;for(const o of r)if(!o||!n||o.isInternal&&vlt(n,o))return!1;return typeof i=="function"?!i({parentNode:n,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof i=="string"?!n.data[i]:typeof i=="boolean"?!i:!0}hideCursor(){this.dispatch(DC.cursor({type:"none"}))}showCursor(t){this.dispatch(DC.cursor(t))}open(t){const n=Lf(t);n&&(this.isOpen(n)||(this.dispatch(Lne.open(n,this.isFiltered)),ks(this.props.onToggle,n)))}close(t){const n=Lf(t);n&&this.isOpen(n)&&(this.dispatch(Lne.close(n,this.isFiltered)),ks(this.props.onToggle,n))}toggle(t){const n=Lf(t);if(n)return this.isOpen(n)?this.close(n):this.open(n)}openParents(t){const n=Lf(t);if(!n)return;const r=Xge(this.root,n);let i=r==null?void 0:r.parent;for(;i;)this.open(i.id),i=i.parent}openSiblings(t){const n=t.parent;if(!n)this.toggle(t.id);else if(n.children){const r=t.isOpen;for(let i of n.children)i.isInternal&&(r?this.close(i.id):this.open(i.id));this.scrollTo(this.focusedNode)}}openAll(){T7(this.root,t=>{t.isInternal&&t.open()})}closeAll(){T7(this.root,t=>{t.isInternal&&t.close()})}scrollTo(t,n="smart"){if(!t)return;const r=Xp(t);return this.openParents(r),Clt(()=>r in this.idToIndex).then(()=>{var i;const o=this.idToIndex[r];o!==void 0&&((i=this.list.current)===null||i===void 0||i.scrollToItem(o,n))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var t;return!!(!((t=this.props.searchTerm)===null||t===void 0)&&t.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(t){return t?this.state.nodes.selection.ids.has(t):!1}isOpen(t){var n,r,i;if(!t)return!1;if(t===rR)return!0;const o=(n=this.props.openByDefault)!==null&&n!==void 0?n:!0;return this.isFiltered?(r=this.state.nodes.open.filtered[t])!==null&&r!==void 0?r:!0:(i=this.state.nodes.open.unfiltered[t])!==null&&i!==void 0?i:o}isEditable(t){var n;const r=this.props.disableEdit||(()=>!1);return(n=!uT(t,r))!==null&&n!==void 0?n:!0}isDraggable(t){var n;const r=this.props.disableDrag||(()=>!1);return(n=!uT(t,r))!==null&&n!==void 0?n:!0}isDragging(t){const n=Lf(t);return n?this.state.nodes.drag.id===n:!1}isFocused(t){return this.hasFocus&&this.state.nodes.focus.id===t}isMatch(t){return this.matchFn(t)}willReceiveDrop(t){const n=Lf(t);if(!n)return!1;const{destinationParentId:r,destinationIndex:i}=this.state.nodes.drag;return n===r&&i===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch(hw(t.id))}onBlur(){this.dispatch(oUn())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Ylt}get renderRow(){return this.props.renderRow||eUn}get renderNode(){return this.props.children||tUn}get renderDragPreview(){return this.props.renderDragPreview||$lt}get renderCursor(){return this.props.renderCursor||JVn}}function ma(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var iYn=typeof Symbol=="function"&&Symbol.observable||"@@observable",ORe=iYn,vX=()=>Math.random().toString(36).substring(7).split("").join("."),oYn={INIT:`@@redux/INIT${vX()}`,REPLACE:`@@redux/REPLACE${vX()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${vX()}`},R7=oYn;function sYn(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Klt(e,t,n){if(typeof e!="function")throw new Error(ma(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ma(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ma(1));return n(Klt)(e,t)}let r=e,i=t,o=new Map,s=o,a=0,l=!1;function c(){s===o&&(s=new Map,o.forEach((v,y)=>{s.set(y,v)}))}function u(){if(l)throw new Error(ma(3));return i}function f(v){if(typeof v!="function")throw new Error(ma(4));if(l)throw new Error(ma(5));let y=!0;c();const O=a++;return s.set(O,v),function(){if(y){if(l)throw new Error(ma(6));y=!1,c(),s.delete(O),o=null}}}function d(v){if(!sYn(v))throw new Error(ma(7));if(typeof v.type>"u")throw new Error(ma(8));if(typeof v.type!="string")throw new Error(ma(17));if(l)throw new Error(ma(9));try{l=!0,i=r(i,v)}finally{l=!1}return(o=s).forEach(O=>{O()}),v}function h(v){if(typeof v!="function")throw new Error(ma(10));r=v,d({type:R7.REPLACE})}function p(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(ma(11));function O(){const w=y;w.next&&w.next(u())}return O(),{unsubscribe:v(O)}},[ORe](){return this}}}return d({type:R7.INIT}),{dispatch:d,subscribe:f,getState:u,replaceReducer:h,[ORe]:p}}function aYn(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:R7.INIT})>"u")throw new Error(ma(12));if(typeof n(void 0,{type:R7.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ma(13))})}function xRe(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const s=t[o];typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let i;try{aYn(n)}catch(o){i=o}return function(s={},a){if(i)throw i;let l=!1;const c={};for(let u=0;u<r.length;u++){const f=r[u],d=n[f],h=s[f],p=d(h,a);if(typeof p>"u")throw a&&a.type,new Error(ma(14));c[f]=p,l=l||p!==h}return l=l||r.length!==Object.keys(s).length,l?c:s}}function lYn(e=RC().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}const cYn=xRe({nodes:xRe({focus:sUn,edit:iUn,open:aUn,selection:lUn,drag:lYn}),dnd:cUn}),uYn=RC();function fYn({treeProps:e,imperativeHandle:t,children:n}){const r=x.useRef(null),i=x.useRef(null),o=x.useRef(Klt(cYn,RC(e))),s=Nie.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>uYn),a=x.useMemo(()=>new p2(o.current,e,r,i),[]),l=x.useRef(0);return x.useMemo(()=>{l.current+=1,a.update(e)},[...Object.values(e),s.nodes.open]),x.useImperativeHandle(t,()=>a),x.useEffect(()=>{a.props.selection?a.select(a.props.selection,{focus:!1}):a.deselectAll()},[a.props.selection]),x.useEffect(()=>{a.props.searchTerm||o.current.dispatch(Lne.clear(!0))},[a.props.searchTerm]),b.jsx(ult.Provider,{value:a,children:b.jsx(hlt.Provider,{value:l.current,children:b.jsx(flt.Provider,{value:s.nodes,children:b.jsx(dlt.Provider,{value:s.dnd,children:b.jsx(aXn,Object.assign({backend:XZn,options:{rootElement:a.props.dndRootElement||void 0}},e.dndManager&&{manager:e.dndManager},{children:n}))})})})})}function dYn(){const e=gu(),[,t]=Qlt(()=>({accept:"NODE",canDrop:(n,r)=>r.isOver({shallow:!0})?e.canDrop():!1,hover:(n,r)=>{if(!r.isOver({shallow:!0}))return;const i=r.getClientOffset();if(!e.listEl.current||!i)return;const{cursor:o,drop:s}=Zlt({element:e.listEl.current,offset:i,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});s&&e.dispatch(DC.hovering(s.parentId,s.index)),r.canDrop()?o&&e.showCursor(o):e.hideCursor()}}),[e]);t(e.listEl)}function hYn(e){return dYn(),e.children}function pYn(){const t=gu().props.renderContainer||Ylt;return b.jsx(b.Fragment,{children:b.jsx(t,{})})}function gYn(){const e=gu(),{offset:t,mouse:n,item:r,isDragging:i}=EZn(s=>({offset:s.getSourceClientOffset(),mouse:s.getClientOffset(),item:s.getItem(),isDragging:s.isDragging()})),o=e.props.renderDragPreview||$lt;return b.jsx(o,{offset:t,mouse:n,id:(r==null?void 0:r.id)||null,dragIds:(r==null?void 0:r.dragIds)||[],isDragging:i})}class QL{constructor(t){this.root=mYn(t)}get data(){var t,n;return(n=(t=this.root.children)===null||t===void 0?void 0:t.map(r=>r.data))!==null&&n!==void 0?n:[]}create(t){const n=t.parentId?this.find(t.parentId):this.root;if(!n)return null;n.addChild(t.data,t.index)}move(t){const n=this.find(t.id),r=t.parentId?this.find(t.parentId):this.root;!n||!r||(r.addChild(n.data,t.index),n.drop())}update(t){const n=this.find(t.id);n&&n.update(t.changes)}drop(t){const n=this.find(t.id);n&&n.drop()}find(t,n=this.root){if(!n)return null;if(n.id===t)return n;if(n.children){for(let r of n.children){const i=this.find(t,r);if(i)return i}return null}return null}}function mYn(e){const t=new Jlt({id:"ROOT"},null);return t.children=e.map(n=>tme(n,t)),t}function tme(e,t){const n=new Jlt(e,t);return e.children&&(n.children=e.children.map(r=>tme(r,n))),n}class Jlt{constructor(t,n){this.data=t,this.parent=n,this.id=t.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(t,n){var r,i;const o=tme(t,this);this.children=(r=this.children)!==null&&r!==void 0?r:[],this.children.splice(n,0,o),this.data.children=(i=this.data.children)!==null&&i!==void 0?i:[],this.data.children.splice(n,0,t)}removeChild(t){var n,r;(n=this.children)===null||n===void 0||n.splice(t,1),(r=this.data.children)===null||r===void 0||r.splice(t,1)}update(t){if(this.hasParent()){const n=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),t),n),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let yYn=0;function vYn(e){const[t,n]=x.useState(e),r=x.useMemo(()=>new QL(t),[t]);return[t,{onMove:c=>{for(const u of c.dragIds)r.move({id:u,parentId:c.parentId,index:c.index});n(r.data)},onRename:({name:c,id:u})=>{r.update({id:u,changes:{name:c}}),n(r.data)},onCreate:({parentId:c,index:u,type:f})=>{const d={id:`simple-tree-id-${yYn++}`,name:""};return f==="internal"&&(d.children=[]),r.create({parentId:c,index:u,data:d}),n(r.data),d},onDelete:c=>{c.ids.forEach(u=>r.drop({id:u})),n(r.data)}}]}function bYn(e){if(e.initialData&&e.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
Use the data prop if you want to provide your own handlers.`);if(e.initialData){const[t,n]=vYn(e.initialData);return Object.assign(Object.assign(Object.assign({},e),n),{data:t})}else return e}function OYn(e,t){const n=bYn(e);return b.jsxs(fYn,{treeProps:n,imperativeHandle:t,children:[b.jsx(hYn,{children:b.jsx(pYn,{})}),b.jsx(gYn,{})]})}const xYn=x.forwardRef(OYn);function wYn(e){const t=e.split(".").pop();if(t===void 0)return"unknown";switch(t.toLowerCase()){case"py":return"python";case"txt":case"md":return"text";case"png":case"jpg":case"jpeg":case"gif":return"image";case"csv":return"data";case"json":return"json";case"js":case"ts":case"tsx":case"html":case"css":case"toml":case"yaml":case"yml":return"code";default:return"unknown"}}const SYn={directory:VEt,python:$ve,json:zEt,code:$ve,text:hoe,image:sz,data:LEt,unknown:QEt},l1="    ",EYn={directory:e=>`os.listdir("${e}")`,python:e=>`with open("${e}", "r") as _f:
${l1}...
`,json:e=>`with open("${e}", "r") as _f:
${l1}_data = json.load(_f)
`,code:e=>`with open("${e}", "r") as _f:
${l1}...
`,text:e=>`with open("${e}", "r") as _f:
${l1}...
`,image:e=>`with open("${e}", "rb") as _f:
${l1}...
`,data:e=>`with open("${e}", "r") as _f:
${l1}...
`,unknown:e=>`with open("${e}", "r") as _f:
${l1}...
`},bX=new Map,CYn=({file:e})=>{const{theme:t}=mp(),[n,r]=x.useState(""),{data:i,loading:o,error:s,setData:a}=zd(async()=>{const h=await fSt({path:e.path}),p=h.contents||"";return r(bX.get(e.path)||p),h},[e.path]),l=async()=>{n!==(i==null?void 0:i.contents)&&await uSt({path:e.path,contents:n}).then(h=>{h.success&&(a(p=>p?{...p,contents:n}:void 0),r(n))})},c=x.useRef(n);if(c.current=n,x.useEffect(()=>()=>{if(!i)return;const h=c.current;h===i.contents?bX.delete(e.path):bX.set(e.path,h)},[e.path,i==null?void 0:i.contents]),s)return b.jsx(pE,{error:s});if(o||!i)return null;const u=i.mimeType||"text/plain";if(!i.contents)return b.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[b.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),b.jsx("div",{children:i.file.name}),b.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),b.jsx("div",{children:u})]});const f=()=>{if(wRe(u)){const h=e8(i.contents,u);jz(h,i.file.name);return}WR(new Blob([i.contents||n],{type:u}),i.file.name)},d=b.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[b.jsx(Wt,{content:"Download",children:b.jsx(Xi,{size:"small",onClick:f,children:b.jsx(iz,{})})}),!wRe(u)&&b.jsxs(b.Fragment,{children:[b.jsx(Wt,{content:"Copy contents to clipboard",children:b.jsx(Xi,{size:"small",onClick:()=>{navigator.clipboard.writeText(n)},children:b.jsx(WO,{})})}),b.jsx(Wt,{content:Md("global.save"),children:b.jsx(Xi,{size:"small",color:n===i.contents?void 0:"green",onClick:l,disabled:n===i.contents,children:b.jsx(goe,{})})})]})]});return u.startsWith("image/")?b.jsxs(b.Fragment,{children:[d,b.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:b.jsx(kYn,{base64:i.contents,mime:u})})]}):u==="text/csv"?b.jsxs(b.Fragment,{children:[d,b.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:b.jsx(_Yn,{contents:i.contents})})]}):u.startsWith("audio/")?b.jsxs(b.Fragment,{children:[d,b.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:b.jsx($Yn,{base64:i.contents,mime:u})})]}):u.startsWith("video/")?b.jsxs(b.Fragment,{children:[d,b.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:b.jsx(TYn,{base64:i.contents,mime:u})})]}):b.jsxs(b.Fragment,{children:[d,b.jsx("div",{className:"flex-1 overflow-auto",children:b.jsx(uWe,{theme:t==="dark"?"dark":"light",language:SRe[u]||SRe.default,className:"border-b",extensions:[Ve.lineWrapping,wi.of([{key:Er.getHotkey("global.save").key,stopPropagation:!0,run:()=>n!==i.contents?(l(),!0):!1}])],value:n,onChange:r})})]})},_Yn=({contents:e})=>{const t=x.useMemo(()=>cWt(e),[e]),n=x.useMemo(()=>n8e(t,[],null),[t]);return b.jsx(O4e,{data:t,columns:n,wrapperClassName:"h-full justify-between pb-1 px-1",pagination:!0,pageSize:10,className:"rounded-none border-b flex overflow-hidden",rowSelection:pn.EMPTY})},kYn=({mime:e,base64:t})=>b.jsx("img",{src:e8(t,e),alt:"Preview"}),$Yn=({mime:e,base64:t})=>b.jsx("audio",{controls:!0,src:e8(t,e)}),TYn=({mime:e,base64:t})=>b.jsx("video",{controls:!0,src:e8(t,e)}),wRe=e=>e?e.startsWith("image/")||e.startsWith("audio/")||e.startsWith("video/"):!1,SRe={"application/javascript":"javascript","text/markdown":"markdown","text/html":"html","text/css":"css","text/x-python":"python","application/json":"json","application/xml":"xml","text/x-yaml":"yaml","text/csv":"markdown","text/plain":"markdown",default:"markdown"};class PYn{constructor(t){ve(this,"delegate",new QL([]));ve(this,"rootPath","");ve(this,"onChange",Yc.NOOP);ve(this,"path",new MO("/"));ve(this,"initialize",async t=>{if(this.onChange=t,this.delegate.data.length===0)try{const n=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new QL(n.files),this.rootPath=n.root,this.path=MO.guessDeliminator(n.root)}catch(n){yr({title:"Failed",description:_R(n)})}this.onChange(this.delegate.data)});ve(this,"refreshAll",async t=>{const n=[this.rootPath,...t.map(i=>{var o;return(o=this.delegate.find(i))==null?void 0:o.data.path})].filter(Boolean),r=await Promise.all(n.map(i=>this.callbacks.listFiles({path:i}).catch(()=>({files:[]}))));for(const[i,o]of n.entries()){const s=r[i];o===this.rootPath?this.delegate=new QL(s.files):this.delegate.update({id:o,changes:{children:s.files}})}this.onChange(this.delegate.data)});ve(this,"handleResponse",t=>{if(!t.success){yr({title:"Failed",description:t.message});return}});this.callbacks=t}async expand(t){const n=this.delegate.find(t);if(!n||!n.data.isDirectory)return!1;if(n.children&&n.children.length>0)return!0;const r=await this.callbacks.listFiles({path:n.data.path});return this.delegate.update({id:t,changes:{children:r.files}}),this.onChange(this.delegate.data),!0}async rename(t,n){const r=this.delegate.find(t);if(!r)return;const i=r.data.path,o=this.path.join(this.path.dirname(i),n);await this.callbacks.renameFileOrFolder({path:i,newPath:o}).then(this.handleResponse),this.delegate.update({id:t,changes:{name:n,path:o}}),this.onChange(this.delegate.data)}async move(t,n){var i;const r=n?((i=this.delegate.find(n))==null?void 0:i.data.path)??n:this.rootPath;await Promise.all(t.map(o=>{this.delegate.move({id:o,parentId:n,index:0});const s=this.delegate.find(o);if(!s)return Promise.resolve();const a=this.path.join(r,this.path.basename(s.data.path));return this.delegate.update({id:o,changes:{path:a}}),this.callbacks.renameFileOrFolder({path:s.data.path,newPath:a}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([r])}async delete(t){const n=this.delegate.find(t);n&&(await this.callbacks.deleteFileOrFolder({path:n.data.path}).then(this.handleResponse),this.delegate.drop({id:t}),this.onChange(this.delegate.data))}}const ect=hn(new PYn({listFiles:tLe,createFileOrFolder:nLe,deleteFileOrFolder:lSt,renameFileOrFolder:cSt})),AYn=hn({});async function RYn(){await Tn.get(ect).refreshAll([])}const DYn=1024*1024*50;function tct(e={}){return Poe({multiple:!0,maxSize:DYn,onError:t=>{console.error(t),yr({title:"File upload failed",description:t.message,variant:"danger"})},onDropRejected:t=>{yr({title:"File upload failed",description:b.jsx("div",{className:"flex flex-col gap-1",children:t.map(n=>b.jsxs("div",{children:[n.file.name," (",n.errors.map(r=>r.message).join(", "),")"]},n.file.name))}),variant:"danger"})},onDrop:async t=>{for(const n of t){const r=(await jit(n)).split(",")[1];await nLe({path:"",type:"file",name:n.name,contents:r})}await RYn()},...e})}const MYn=({height:e})=>{const[t]=tc(ect),[n,r]=x.useState([]),[i,o]=tc(AYn),[s,a]=x.useState(null);return HQ(()=>{t.initialize(r)}),s?b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"flex items-center pl-1 pr-3 flex-shrink-0 border-b justify-between",children:[b.jsx(St,{onClick:()=>a(null),"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:b.jsx(ELe,{size:16})}),b.jsx("span",{className:"font-bold",children:s.name})]}),b.jsx(CYn,{file:s})]}):b.jsxs(b.Fragment,{children:[b.jsx(IYn,{onRefresh:()=>t.refreshAll(Object.keys(i).filter(l=>i[l]))}),b.jsx(xYn,{width:"100%",height:e-26,className:"h-full",data:n,initialOpenState:i,openByDefault:!1,renderCursor:()=>null,disableDrop:({parentNode:l})=>!l.data.isDirectory,onDelete:async({ids:l})=>{for(const c of l)await t.delete(c)},onRename:async({id:l,name:c})=>{await t.rename(l,c)},onMove:async({dragIds:l,parentId:c})=>{await t.move(l,c)},onSelect:l=>{const c=l[0];c&&(c.data.isDirectory||a(c.data))},onToggle:async l=>{if(await t.expand(l)){const u=i[l]??!1;o({...i,[l]:!u})}},padding:15,rowHeight:30,indent:NYn,overscanCount:1e3,disableMultiSelection:!0,children:FYn})]})},NYn=15,IYn=({onRefresh:e})=>{const{getRootProps:t,getInputProps:n}=tct({noDrag:!0,noDragEventsBubbling:!0});return b.jsxs("div",{className:"flex items-center justify-end px-2 flex-shrink-0 border-b",children:[b.jsx(Wt,{content:"Upload file",children:b.jsx("button",{"data-testid":"file-explorer-upload-button",...t({}),className:pv({variant:"text",size:"xs",className:"mb-0"}),children:b.jsx(jLe,{size:16})})}),b.jsx("input",{...n({}),type:"file"}),b.jsx(Wt,{content:"Refresh",children:b.jsx(St,{"data-testid":"file-explorer-refresh-button",onClick:e,variant:"text",size:"xs",className:"mb-0",children:b.jsx(DLe,{size:16})})})]})},LYn=({node:e})=>b.jsx("span",{className:"flex-1",onClick:t=>{e.data.isDirectory||(t.stopPropagation(),e.select())},children:e.data.name}),jYn=({node:e})=>{const t=x.useRef(null);return x.useEffect(()=>{var n,r;(n=t.current)==null||n.focus(),(r=t.current)==null||r.setSelectionRange(0,e.data.name.lastIndexOf("."))},[e.data.name]),b.jsx("input",{ref:t,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:e.data.name,onClick:n=>n.stopPropagation(),onBlur:()=>e.reset(),onKeyDown:n=>{n.key==="Escape"&&e.reset(),n.key==="Enter"&&e.submit(n.currentTarget.value)}})},FYn=({node:e,style:t,dragHandle:n})=>{const r=e.data.isDirectory?"directory":wYn(e.data.name),i=SYn[r],{openConfirm:o}=$m(),s=async l=>{l.stopPropagation(),l.preventDefault(),o({title:"Open notebook",description:"This will close the current notebook and open the selected notebook. You'll lose all data that's in memory.",confirmAction:b.jsx(xz,{onClick:async()=>{await aSt({path:e.data.path})},"aria-label":"Confirm",children:"Open"})})},a=async l=>{l.stopPropagation(),l.preventDefault(),o({title:"Delete file",description:`Are you sure you want to delete ${e.data.name}?`,confirmAction:b.jsx(wz,{onClick:async()=>{await e.tree.delete(e.id)},"aria-label":"Confirm",children:"Delete"})})};return b.jsxs("div",{style:t,ref:n,className:be("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),draggable:!0,onClick:l=>{l.stopPropagation(),e.data.isDirectory&&e.toggle()},children:[b.jsx(zYn,{node:e}),b.jsxs("span",{className:be("flex items-center gap-2 px-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1",e.willReceiveDrop&&e.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground"),children:[b.jsx(i,{className:"w-5 h-5 flex-shrink-0",strokeWidth:1.5}),e.isEditing?b.jsx(jYn,{node:e}):b.jsx(LYn,{node:e}),b.jsxs(Bb,{modal:!1,children:[b.jsx(Wb,{asChild:!0,tabIndex:-1,onClick:l=>l.stopPropagation(),children:b.jsx(St,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:b.jsx(lCt,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),b.jsxs(R0,{align:"end",className:"no-print w-[220px]",onClick:l=>l.stopPropagation(),onCloseAutoFocus:l=>l.preventDefault(),children:[!e.data.isDirectory&&!yp()&&b.jsxs(ll,{onSelect:()=>e.select(),children:[b.jsx(ACt,{className:"mr-2",size:14,strokeWidth:1.5}),"Open file"]}),b.jsxs(ll,{onSelect:()=>e.edit(),children:[b.jsx(gCt,{className:"mr-2",size:14,strokeWidth:1.5}),"Rename"]}),b.jsxs(ll,{onSelect:()=>{yr({title:"Copied to clipboard",description:"Code to open the file has been copied to your clipboard. You can also drag and drop this file into the editor"});const{path:l}=e.data,c=EYn[r](l);navigator.clipboard.writeText(c)},children:[b.jsx(WO,{className:"mr-2",size:14,strokeWidth:1.5}),"Copy snippet to clipboard"]}),e.data.isMarimoFile&&b.jsxs(b.Fragment,{children:[b.jsx(qb,{}),b.jsxs(ll,{onSelect:s,children:[b.jsx(yCt,{className:"mr-2",size:14,strokeWidth:1.5}),"Open notebook"]})]}),b.jsx(qb,{}),b.jsxs(ll,{onSelect:a,variant:"danger",children:[b.jsx(AR,{className:"mr-2",size:14,strokeWidth:1.5}),"Delete"]})]})]})]})]})},zYn=({node:e})=>e.data.isDirectory?e.isOpen?b.jsx(P0,{className:"w-5 h-5 flex-shrink-0"}):b.jsx(uoe,{className:"w-5 h-5 flex-shrink-0"}):b.jsx("span",{className:"w-5 h-5 flex-shrink-0"}),QYn=()=>{const{ref:e,height:t=1}=BVn(),{getRootProps:n,getInputProps:r,isDragActive:i}=tct({noClick:!0,noKeyboard:!0});return b.jsxs("div",{...n(),className:be("flex flex-col flex-1 overflow-hidden relative"),children:[b.jsx("input",{...r()}),i&&b.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),b.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:b.jsx(MYn,{height:t})})]})},BYn=({children:e})=>{const{isOpen:t,selectedPanel:n}=pge(),{setIsOpen:r}=EB(),i=ie.useRef(null),o="left";x.useEffect(()=>{if(!i.current)return;const u=i.current.isCollapsed();t&&u&&i.current.expand(),!t&&!u&&i.current.collapse(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{window.dispatchEvent(new Event("resize"))})})},[t]);const s=b.jsx(Sne,{id:"app",className:"relative h-full",children:e},`app-${o}`),a=b.jsx(Gst,{onDragging:u=>{u||window.dispatchEvent(new Event("resize"))},className:be("border-border no-print z-10",t?"resize-handle":"resize-handle-collapsed","vertical")}),l=b.jsxs("div",{className:"flex flex-col h-full flex-1 overflow-hidden mr-[-4px]",children:[b.jsxs("div",{className:"p-3 border-b flex justify-between items-center",children:[b.jsx("div",{className:"text-sm text-[var(--slate-11)] uppercase tracking-wide font-semibold flex-1",children:n}),b.jsx(St,{"data-testid":"close-helper-pane",className:"m-0",size:"xs",variant:"text",onClick:()=>r(!1),children:b.jsx(rc,{className:"w-4 h-4"})})]}),n==="files"&&b.jsx(QYn,{}),n==="errors"&&b.jsx(P9n,{}),n==="variables"&&b.jsx(NVn,{}),n==="dependencies"&&b.jsx(RVn,{}),n==="outline"&&b.jsx(A9n,{}),n==="documentation"&&b.jsx(zVn,{}),n==="logs"&&b.jsx(IVn,{})]}),c=b.jsx(Sne,{ref:i,id:"helper",collapsedSize:0,collapsible:!0,className:be("bg-white dark:bg-[var(--slate-1)] rounded-lg no-print shadow-mdNeutral",t&&"m-4"),minSize:10,defaultSize:0,maxSize:45,onResize:(u,f)=>{var d;f===0&&u===10&&((d=i.current)==null||d.resize(30))},onCollapse:()=>r(!1),onExpand:()=>r(!0),children:b.jsxs("span",{className:"flex flex-row h-full",children:[l," ",a]})},`helper-${o}`);return b.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden absolute inset-0",children:[b.jsxs(Yst,{autoSaveId:"marimo:chrome",direction:"horizontal",storage:T9n(o),children:[c,s]},o),b.jsx($9n,{})]})},WYn=()=>Jh()?b.jsxs("div",{className:"px-4 py-2 bg-[var(--sky-2)] border-b border-[var(--sky-7)] text-md text-[var(--sky-11)] font-semibold flex justify-between items-center gap-4",children:[b.jsxs("span",{children:["This is a static Python notebook built using"," ",b.jsx("a",{href:"https://github.com/marimo-team/marimo",target:"_blank",className:"underline",children:"marimo"}),".",b.jsx("br",{}),"Some interactive features may not work, see ways to run or edit this."]}),b.jsx("span",{className:"flex-shrink-0",children:b.jsx(qYn,{})})]}):null,qYn=()=>{let e=BNe()||"notebook.py";const t=e.lastIndexOf("/");t!==-1&&(e=e.slice(t+1));const n=window.location.href,r=pht(),i=toe({code:r});return b.jsxs(_z,{children:[b.jsx(rMt,{asChild:!0,children:b.jsx(St,{"data-testid":"static-notebook-dialog-trigger",variant:"secondary",children:"Run or edit this notebook"})}),b.jsxs(gm,{children:[b.jsxs(YC,{children:[b.jsx(Ov,{children:e}),b.jsxs(mE,{className:"pt-4 text-md text-left",children:["This is a static notebook built using"," ",b.jsx("a",{href:"https://github.com/marimo-team/marimo",target:"_blank",className:"text-link hover:underline",children:"marimo"}),". marimo is an open-source next-generation Python notebook.",b.jsx("hr",{className:"my-3"}),"In order to edit this notebook, you will need to download the code locally, install marimo, and run the following in your terminal:",b.jsxs("div",{className:"font-mono text-sm bg-[var(--sky-2)] rounded-md my-3 p-2 border border-[var(--sky-7)]",children:["pip install marimo",b.jsx("br",{}),"marimo edit ",e]}),!n.endsWith(".html")&&b.jsxs(b.Fragment,{children:["or",b.jsxs("div",{className:"font-mono text-sm bg-[var(--sky-2)] rounded-md my-3 p-2 border border-[var(--sky-7)] break-all",children:["marimo edit ",window.location.href]})]}),b.jsx("hr",{className:"my-3"}),"You may also be able to run this notebook entirely in the browser via WebAssembly at:"," ",b.jsxs("a",{href:i,target:"_blank",className:"text-link hover:underline",children:[i.slice(0,40),"..."]}),b.jsx("br",{}),b.jsxs("div",{className:"text-sm text-muted-foreground pt-2",children:[b.jsx("strong",{children:"Note:"})," This feature is experimental and may not work for all notebooks. Additionally, some dependencies may not be available in the browser."]})]})]}),b.jsxs("div",{className:"flex gap-4 flex-wrap",children:[b.jsxs(St,{"data-testid":"copy-static-notebook-dialog-button",variant:"secondary",onClick:()=>{window.navigator.clipboard.writeText(r),yr({title:"Copied to clipboard"})},children:[b.jsx(WO,{className:"w-4 h-4 mr-1"}),"Copy code"]}),b.jsxs(St,{"data-testid":"download-static-notebook-dialog-button",variant:"secondary",onClick:()=>{WR(new Blob([r],{type:"text/plain"}),e)},children:[b.jsx(iz,{className:"w-4 h-4 mr-1"}),"Download code"]})]})]})]})},VYn=()=>b.jsxs("div",{className:"flex flex-col h-full flex-1 items-center justify-center p-4",children:[b.jsx(Nb,{className:"size-20 animate-spin text-primary",strokeWidth:1}),b.jsx("div",{className:"mt-2 text-muted-foreground font-semibold text-lg",children:"Initializing..."})]}),UYn=()=>null,nct=x.memo(()=>{const[e]=fR(),[t]=Qre();x.useEffect(()=>{LAn()},[]);const n=Ait==="read"?b.jsxs(b.Fragment,{children:[b.jsx(WYn,{}),b.jsx(_Pe,{userConfig:e,appConfig:t}),b.jsx(TPe,{})]}):b.jsxs(BYn,{children:[b.jsx(_Pe,{userConfig:e,appConfig:t}),b.jsx(TPe,{}),b.jsx(TFn,{})]});return b.jsx(Vre,{children:b.jsx(UC,{children:b.jsx(X8n,{initialProps:{},children:b.jsx(XYn,{children:b.jsxs(XAn,{children:[b.jsx(Sht,{variables:{"--marimo-code-editor-font-size":HYn(e.display.code_editor_font_size)},children:n}),b.jsx(UYn,{})]})})})})})});nct.displayName="MarimoApp";function HYn(e){return`${e/16}rem`}const XYn=({children:e})=>{if(!yp())return e;const{loading:t,error:n}=zd(async()=>(await rP.INSTANCE.initialized.promise,!0),[]);if(t)return b.jsx(VYn,{});if(n)throw n;return e};var Oy,g2,rct,D7,ict=-1,uM=function(e){addEventListener("pageshow",function(t){t.persisted&&(ict=t.timeStamp,e(t))},!0)},oct=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},nme=function(){var e=oct();return e&&e.activationStart||0},cv=function(e,t){var n=oct(),r="navigate";return ict>=0?r="back-forward-cache":n&&(document.prerendering||nme()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},WB=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch{}},uv=function(e,t,n,r){var i,o;return function(s){t.value>=0&&(s||r)&&((o=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=o,t.rating=function(a,l){return a>l[1]?"poor":a>l[0]?"needs-improvement":"good"}(t.value,n),e(t))}},rme=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},ime=function(e){var t=function(n){n.type!=="pagehide"&&document.visibilityState!=="hidden"||e(n)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},ome=function(e){var t=!1;return function(n){t||(e(n),t=!0)}},sS=-1,ERe=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},M7=function(e){document.visibilityState==="hidden"&&sS>-1&&(sS=e.type==="visibilitychange"?e.timeStamp:0,ZYn())},CRe=function(){addEventListener("visibilitychange",M7,!0),addEventListener("prerenderingchange",M7,!0)},ZYn=function(){removeEventListener("visibilitychange",M7,!0),removeEventListener("prerenderingchange",M7,!0)},sme=function(){return sS<0&&(sS=ERe(),CRe(),uM(function(){setTimeout(function(){sS=ERe(),CRe()},0)})),{get firstHiddenTime(){return sS}}},ame=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},_Re=[1800,3e3],YYn=function(e,t){t=t||{},ame(function(){var n,r=sme(),i=cv("FCP"),o=WB("paint",function(s){s.forEach(function(a){a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<r.firstHiddenTime&&(i.value=Math.max(a.startTime-nme(),0),i.entries.push(a),n(!0)))})});o&&(n=uv(e,i,_Re,t.reportAllChanges),uM(function(s){i=cv("FCP"),n=uv(e,i,_Re,t.reportAllChanges),rme(function(){i.value=performance.now()-s.timeStamp,n(!0)})}))})},kRe=[.1,.25],GYn=function(e,t){t=t||{},YYn(ome(function(){var n,r=cv("CLS",0),i=0,o=[],s=function(l){l.forEach(function(c){if(!c.hadRecentInput){var u=o[0],f=o[o.length-1];i&&c.startTime-f.startTime<1e3&&c.startTime-u.startTime<5e3?(i+=c.value,o.push(c)):(i=c.value,o=[c])}}),i>r.value&&(r.value=i,r.entries=o,n())},a=WB("layout-shift",s);a&&(n=uv(e,r,kRe,t.reportAllChanges),ime(function(){s(a.takeRecords()),n(!0)}),uM(function(){i=0,r=cv("CLS",0),n=uv(e,r,kRe,t.reportAllChanges),rme(function(){return n()})}),setTimeout(n,0))}))},fT={passive:!0,capture:!0},KYn=new Date,$Re=function(e,t){Oy||(Oy=t,g2=e,rct=new Date,act(removeEventListener),sct())},sct=function(){if(g2>=0&&g2<rct-KYn){var e={entryType:"first-input",name:Oy.type,target:Oy.target,cancelable:Oy.cancelable,startTime:Oy.timeStamp,processingStart:Oy.timeStamp+g2};D7.forEach(function(t){t(e)}),D7=[]}},JYn=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;e.type=="pointerdown"?function(n,r){var i=function(){$Re(n,r),s()},o=function(){s()},s=function(){removeEventListener("pointerup",i,fT),removeEventListener("pointercancel",o,fT)};addEventListener("pointerup",i,fT),addEventListener("pointercancel",o,fT)}(t,e):$Re(t,e)}},act=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,JYn,fT)})},TRe=[100,300],eGn=function(e,t){t=t||{},ame(function(){var n,r=sme(),i=cv("FID"),o=function(l){l.startTime<r.firstHiddenTime&&(i.value=l.processingStart-l.startTime,i.entries.push(l),n(!0))},s=function(l){l.forEach(o)},a=WB("first-input",s);n=uv(e,i,TRe,t.reportAllChanges),a&&ime(ome(function(){s(a.takeRecords()),a.disconnect()})),a&&uM(function(){var l;i=cv("FID"),n=uv(e,i,TRe,t.reportAllChanges),D7=[],g2=-1,Oy=null,act(addEventListener),l=o,D7.push(l),sct()})})},PRe=[2500,4e3],OX={},tGn=function(e,t){t=t||{},ame(function(){var n,r=sme(),i=cv("LCP"),o=function(l){var c=l[l.length-1];c&&c.startTime<r.firstHiddenTime&&(i.value=Math.max(c.startTime-nme(),0),i.entries=[c],n())},s=WB("largest-contentful-paint",o);if(s){n=uv(e,i,PRe,t.reportAllChanges);var a=ome(function(){OX[i.id]||(o(s.takeRecords()),s.disconnect(),OX[i.id]=!0,n(!0))});["keydown","click"].forEach(function(l){addEventListener(l,function(){return setTimeout(a,0)},!0)}),ime(a),uM(function(l){i=cv("LCP"),n=uv(e,i,PRe,t.reportAllChanges),rme(function(){i.value=performance.now()-l.timeStamp,OX[i.id]=!0,n(!0)})})}})};function nGn(){At.log("Reporting vitals");const e=t=>{const n=t.rating==="good"?"green":t.rating==="needs-improvement"?"orange":"red";At.log(`%c [Metric ${t.name}] ${t.value}`,`background:${n}; color:white; padding:2px 0; border-radius:2px`)};GYn(e),eGn(e),tGn(e)}const rGn=typeof window<"u"&&window.parent!==window;function iGn(){!rGn||yp()||(At.log("Registering VS Code bindings"),sGn(),oGn(),aGn(),lGn())}function oGn(){window.addEventListener("copy",()=>{var t;const e=((t=window.getSelection())==null?void 0:t.toString())??"";Sb({command:"copy",text:e})}),window.addEventListener("cut",()=>{var t;const e=((t=window.getSelection())==null?void 0:t.toString())??"";B4()&&document.execCommand("insertText",!1,""),Sb({command:"cut",text:e})}),window.addEventListener("message",e=>{const t=e.data;switch(t.command){case"paste":B4()&&document.execCommand("insertText",!1,t.text);return}})}function sGn(){document.addEventListener("keydown",e=>{var t,n;if((e.ctrlKey||e.metaKey)&&e.key==="c"){const r=((t=window.getSelection())==null?void 0:t.toString())??"";Sb({command:"copy",text:r});return}if((e.ctrlKey||e.metaKey)&&e.key==="x"){const r=((n=window.getSelection())==null?void 0:n.toString())??"";document.execCommand("insertText",!1,""),Sb({command:"cut",text:r});return}if((e.ctrlKey||e.metaKey)&&e.key==="v"){Sb({command:"paste"});return}})}function aGn(){document.addEventListener("click",e=>{const t=e.target;if(t.tagName!=="A")return;const n=t.getAttribute("href");n&&(n.startsWith("http://")||n.startsWith("https://"))&&(e.preventDefault(),Sb({command:"external_link",url:n}))})}function lGn(){document.addEventListener("contextmenu",e=>{e.preventDefault(),Sb({command:"context_menu"})})}function Sb(e){var t;(t=window.parent)==null||t.postMessage(e,"*")}iGn();Jh()&&(NFn(),IFn(M9e));const ARe=BL.createRoot(document.getElementById("root"));try{ARe.render(b.jsx(YMe,{store:Tn,children:b.jsx(sNe,{children:b.jsx(nct,{})})}))}catch(e){const t=()=>{throw e};ARe.render(b.jsx(Vre,{children:b.jsx(t,{})}))}finally{nGn()}export{mp as $,ed as A,gS as B,Emt as C,Hin as D,Xin as E,Zin as F,Yin as G,Kin as H,Jin as I,Gin as J,ton as K,non as L,eon as M,oue as N,ron as O,ion as P,oon as Q,ie as R,kg as S,son as T,i1e as U,ntt as V,aon as W,con as X,lon as Y,_mt as Z,Pe as _,t$e as a,k_t as a$,zd as a0,At as a1,b as a2,$l as a3,lO as a4,Mle as a5,Xf as a6,K as a7,YO as a8,Gb as a9,Ppe as aA,D5n as aB,pE as aC,Dle as aD,G7t as aE,Wnt as aF,nze as aG,nF as aH,nUe as aI,Ooe as aJ,zTt as aK,ITt as aL,tje as aM,QTt as aN,ep as aO,Wve as aP,YLe as aQ,Gve as aR,lz as aS,B2t as aT,L2t as aU,NTt as aV,T2t as aW,A5 as aX,F$t as aY,iPt as aZ,nje as a_,Ise as aa,j0 as ab,_e as ac,Sv as ad,TP as ae,RBe as af,Ele as ag,i_ as ah,V5 as ai,U5 as aj,Ti as ak,Epe as al,sf as am,LA as an,trt as ao,Vnt as ap,Ve as aq,kr as ar,Ae as as,lrt as at,l5n as au,iae as av,Zt as aw,drt as ax,Fle as ay,Srt as az,F_t as b,lu as b0,uat as b1,z9n as b2,P_t as b3,j_t as b4,i_t as b5,A_t as b6,H2t as b7,z2t as b8,dE as b9,vQt as bA,d_ as bB,mr as bC,YVe as bD,KVe as bE,qin as bF,uue as bG,Cp as bH,Qc as bI,JLe as ba,hz as bb,moe as bc,Soe as bd,P2t as be,r_t as bf,dz as bg,GW as bh,KW as bi,asn as bj,MG as bk,ob as bl,qUe as bm,Qon as bn,Lae as bo,DP as bp,Ag as bq,p8 as br,d8 as bs,yg as bt,EE as bu,k3 as bv,gQt as bw,mQt as bx,CE as by,yQt as bz,Fve as c,Lve as d,yoe as e,B_t as f,wf as g,cz as h,Lb as i,Ekt as j,Ib as k,qO as l,vp as m,tY as n,Ckt as o,lm as p,KLe as q,x as r,xd as s,boe as t,HLe as u,F2t as v,r1e as w,Tkt as x,ft as y,woe as z};
