@nuxt/devtools-nightly 2.6.2-29262790.e0897e3 → 2.6.3-29305195.ffe8e62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/module-main.mjs +4 -1
- package/dist/client/200.html +23 -23
- package/dist/client/404.html +23 -23
- package/dist/client/_nuxt/__blank-h7gh4972.js +1 -0
- package/dist/client/_nuxt/analyze-build-o31un95o.js +1 -0
- package/dist/client/_nuxt/assets-ijn70e0e.js +16 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/8f177d65-065f-4999-b72e-a7002d81e832.json +1 -0
- package/dist/client/_nuxt/{client-oeqdl4pb.js → client-hkqvtzyx.js} +1 -1
- package/dist/client/_nuxt/code-diff.vue-ks5inqe1.js +8 -0
- package/dist/client/_nuxt/code-snippets.vue-fktt4wo7.js +1 -0
- package/dist/client/_nuxt/components-nrkyular.js +1 -0
- package/dist/client/_nuxt/composable-item.vue-muj4egrg.js +1 -0
- package/dist/client/_nuxt/custom-_name_-sastovgn.js +1 -0
- package/dist/client/_nuxt/data-schema-button.vue-lvtywu8v.js +1 -0
- package/dist/client/_nuxt/data-schema-drawer-d2h29pvp.js +2 -0
- package/dist/client/_nuxt/debug-ojofjmad.js +1 -0
- package/dist/client/_nuxt/{default-cd1e72op.js → default-5qrltejs.js} +1 -1
- package/dist/client/_nuxt/dhu0gk53.js +15 -0
- package/dist/client/_nuxt/duration-display.vue-l0zz5iex.js +1 -0
- package/dist/client/_nuxt/{entry.css-mloq4mxl.css → entry.css-ojy5yvlc.css} +1 -1
- package/dist/client/_nuxt/error-404-hppt9fyq.js +1 -0
- package/dist/client/_nuxt/error-404.css-z2gtwy9t.css +1 -0
- package/dist/client/_nuxt/{error-500-j0vg9v2z.js → error-500-kwotgex3.js} +1 -1
- package/dist/client/_nuxt/error-500.css-liy0brxy.css +1 -0
- package/dist/client/_nuxt/{error-ic0ozysy.js → error-f539iokd.js} +5 -5
- package/dist/client/_nuxt/filepath-item.vue-o10im3k0.js +1 -0
- package/dist/client/_nuxt/full-lr9mszjf.js +1 -0
- package/dist/client/_nuxt/help-fab.vue-ccxsygj1.js +1 -0
- package/dist/client/_nuxt/hooks-f1e8gpah.js +1 -0
- package/dist/client/_nuxt/imports-ef637i60.js +1 -0
- package/dist/client/_nuxt/index-o4fev5kn.js +1 -0
- package/dist/client/_nuxt/launch-page.vue-d9vho9p3.js +1 -0
- package/dist/client/_nuxt/modules-n79akg6b.js +1 -0
- package/dist/client/_nuxt/nbadge-oue9c82s.js +1 -0
- package/dist/client/_nuxt/ncheckbox.vue-etq1y8d3.js +1 -0
- package/dist/client/_nuxt/ncode-block.vue-j1bpwykw.js +2 -0
- package/dist/client/_nuxt/ndrawer.vue-ilrmffso.js +1 -0
- package/dist/client/_nuxt/ndropdown.vue-k3h66pr6.js +1 -0
- package/dist/client/_nuxt/nicon-title.vue-mr03t3pg.js +1 -0
- package/dist/client/_nuxt/nlink.vue-kbbnnpki.js +1 -0
- package/dist/client/_nuxt/nmarkdown.vue-n5lhcplj.js +1 -0
- package/dist/client/_nuxt/nnavbar.vue-c0cuycee.js +1 -0
- package/dist/client/_nuxt/none-gvv6segf.js +1 -0
- package/dist/client/_nuxt/nsection-block-du3m72ip.js +1 -0
- package/dist/client/_nuxt/nselect-tabs.vue-b5h7lk5k.js +1 -0
- package/dist/client/_nuxt/nselect.vue-h5zj1ys3.js +1 -0
- package/dist/client/_nuxt/nswitch.vue-ihk2zmam.js +1 -0
- package/dist/client/_nuxt/open-graph-buo7wkea.js +3 -0
- package/dist/client/_nuxt/overview-mn9k8iwf.js +1 -0
- package/dist/client/_nuxt/pages-d3rxkw4v.js +1 -0
- package/dist/client/_nuxt/payload-k4mgtyo4.js +1 -0
- package/dist/client/_nuxt/pinia-mw6ma9cs.js +1 -0
- package/dist/client/_nuxt/plugins-lc4myp3l.js +1 -0
- package/dist/client/_nuxt/render-tree-d2cseufi.js +1 -0
- package/dist/client/_nuxt/runtime-configs-fccwjp76.js +1 -0
- package/dist/client/_nuxt/server-discovery-ds1n0smw.js +1 -0
- package/dist/client/_nuxt/server-route-inputs.vue-iasqmu8r.js +1 -0
- package/dist/client/_nuxt/server-routes-i8deon2o.js +9 -0
- package/dist/client/_nuxt/server-tasks-jtagzli4.js +1 -0
- package/dist/client/_nuxt/settings-k0po1y50.js +1 -0
- package/dist/client/_nuxt/stacktrace-list.vue-jidqmsbk.js +1 -0
- package/dist/client/_nuxt/{state-components-fmip3o43.js → state-components-mj20cbdp.js} +1 -1
- package/dist/client/_nuxt/state-editor.vue-dp4bb7sn.js +1 -0
- package/dist/client/_nuxt/state-modules-jx38b43q.js +1 -0
- package/dist/client/_nuxt/storage-kju6q05j.js +1 -0
- package/dist/client/_nuxt/terminals-n5k4jvha.js +1 -0
- package/dist/client/_nuxt/timeline-djisb56a.js +31 -0
- package/dist/client/_nuxt/{unocss-runtime-cdytntxi.js → unocss-runtime-g6e7se3f.js} +1 -1
- package/dist/client/_nuxt/vendor/json-editor-vue-nstwj98r.js +3857 -0
- package/dist/client/_nuxt/vendor/quicktype-core-o057hwfl.js +1007 -0
- package/dist/client/_nuxt/vendor/{shiki-imfwxqoq.js → shiki-jxvjmls6.js} +10 -10
- package/dist/client/_nuxt/vendor/unocss-deq9h1iz.js +3 -0
- package/dist/client/_nuxt/vendor/vis-je6lvt05.js +132 -0
- package/dist/client/_nuxt/vendor/xterm-elw8536o.js +9 -0
- package/dist/client/_nuxt/virtual-files-b37upgv5.js +1 -0
- package/dist/client/_nuxt/{vue-devtools-e1zi4cxv.js → vue-devtools-tmml5ml7.js} +1 -1
- package/dist/client/_nuxt/vue-virtual-scroller.esm-kqx3l34g.js +2 -0
- package/dist/client/discovery/index.html +9 -9
- package/dist/client/index.html +23 -23
- package/dist/module.json +3 -3
- package/dist/runtime/auth/index.html +3 -3
- package/dist/webcomponents/index.d.mts +2 -1
- package/dist/webcomponents/index.mjs +15 -12
- package/package.json +37 -37
- package/dist/client/_nuxt/__blank-n1wcnoye.js +0 -1
- package/dist/client/_nuxt/analyze-build-fh5wjd0q.js +0 -1
- package/dist/client/_nuxt/assets-bzxr3w72.js +0 -16
- package/dist/client/_nuxt/builds/meta/63896340-9d78-4e9c-84bd-699e1a845f90.json +0 -1
- package/dist/client/_nuxt/code-diff.vue-fiw237cr.js +0 -8
- package/dist/client/_nuxt/code-snippets.vue-j4pkblda.js +0 -1
- package/dist/client/_nuxt/components-j3lttcpl.js +0 -1
- package/dist/client/_nuxt/composable-item.vue-i02l2pm0.js +0 -1
- package/dist/client/_nuxt/custom-_name_-l6ts2roa.js +0 -1
- package/dist/client/_nuxt/data-schema-button.vue-iijut474.js +0 -1
- package/dist/client/_nuxt/data-schema-drawer-lt93lwpm.js +0 -2
- package/dist/client/_nuxt/debug-fwygqk9h.js +0 -1
- package/dist/client/_nuxt/duration-display.vue-mr4ha0rw.js +0 -1
- package/dist/client/_nuxt/error-404-e0s0g25b.js +0 -1
- package/dist/client/_nuxt/error-404.css-kgnrxm6x.css +0 -1
- package/dist/client/_nuxt/error-500.css-bay4acf7.css +0 -1
- package/dist/client/_nuxt/exr9a447.js +0 -15
- package/dist/client/_nuxt/filepath-item.vue-d1242mwo.js +0 -1
- package/dist/client/_nuxt/full-bfioidtn.js +0 -1
- package/dist/client/_nuxt/help-fab.vue-ixaulkxo.js +0 -1
- package/dist/client/_nuxt/hooks-kptnjvf4.js +0 -1
- package/dist/client/_nuxt/imports-dtfxammr.js +0 -1
- package/dist/client/_nuxt/index-j70msn1o.js +0 -1
- package/dist/client/_nuxt/launch-page.vue-l4yiouqj.js +0 -1
- package/dist/client/_nuxt/modules-otw5avhb.js +0 -1
- package/dist/client/_nuxt/nbadge-n6knum9m.js +0 -1
- package/dist/client/_nuxt/ncheckbox.vue-eky8wwbi.js +0 -1
- package/dist/client/_nuxt/ncode-block.vue-ctkw4rc7.js +0 -2
- package/dist/client/_nuxt/ndrawer.vue-eoa1ezod.js +0 -1
- package/dist/client/_nuxt/ndropdown.vue-eqlurxkg.js +0 -1
- package/dist/client/_nuxt/nicon-title.vue-ejocqf9t.js +0 -1
- package/dist/client/_nuxt/nlink.vue-ei9z0suh.js +0 -1
- package/dist/client/_nuxt/nmarkdown.vue-mk2gi3ky.js +0 -1
- package/dist/client/_nuxt/nnavbar.vue-f2sp4ze2.js +0 -1
- package/dist/client/_nuxt/none-kmovzp4i.js +0 -1
- package/dist/client/_nuxt/nsection-block-k7wumoo5.js +0 -1
- package/dist/client/_nuxt/nselect-tabs.vue-nesot227.js +0 -1
- package/dist/client/_nuxt/nselect.vue-gfxwax16.js +0 -1
- package/dist/client/_nuxt/nswitch.vue-bpoo3j7g.js +0 -1
- package/dist/client/_nuxt/open-graph-be6rqypz.js +0 -3
- package/dist/client/_nuxt/overview-jr1m1hiu.js +0 -1
- package/dist/client/_nuxt/pages-h1izipi5.js +0 -1
- package/dist/client/_nuxt/payload-i762mjgr.js +0 -1
- package/dist/client/_nuxt/pinia-gvd7c6wo.js +0 -1
- package/dist/client/_nuxt/plugins-n08ssy4p.js +0 -1
- package/dist/client/_nuxt/render-tree-o669vj2r.js +0 -1
- package/dist/client/_nuxt/runtime-configs-gugrk4qi.js +0 -1
- package/dist/client/_nuxt/server-discovery-nvtt0ywx.js +0 -1
- package/dist/client/_nuxt/server-route-inputs.vue-k1tky4fi.js +0 -1
- package/dist/client/_nuxt/server-routes-cplspg0l.js +0 -9
- package/dist/client/_nuxt/server-tasks-npdtysm9.js +0 -1
- package/dist/client/_nuxt/settings-bcilmyyp.js +0 -1
- package/dist/client/_nuxt/stacktrace-list.vue-nx0wt00p.js +0 -1
- package/dist/client/_nuxt/state-editor.vue-jnq3txny.js +0 -1
- package/dist/client/_nuxt/state-modules-cw76405z.js +0 -1
- package/dist/client/_nuxt/storage-oc19wzm6.js +0 -1
- package/dist/client/_nuxt/terminals-bld5blwh.js +0 -1
- package/dist/client/_nuxt/timeline-lsjuoisa.js +0 -31
- package/dist/client/_nuxt/vendor/json-editor-vue-m9gzt21j.js +0 -3869
- package/dist/client/_nuxt/vendor/quicktype-core-dsrweb93.js +0 -1007
- package/dist/client/_nuxt/vendor/unocss-oyl7opas.js +0 -2
- package/dist/client/_nuxt/vendor/vis-n7jjo36l.js +0 -89
- package/dist/client/_nuxt/vendor/xterm-dbpzgj7s.js +0 -9
- package/dist/client/_nuxt/virtual-files-n7quks4q.js +0 -1
- package/dist/client/_nuxt/vue-virtual-scroller.esm-k5helfir.js +0 -2
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
-webkit-text-size-adjust: 100%;
|
|
23
23
|
}
|
|
24
24
|
.discovery {
|
|
25
|
-
height:
|
|
25
|
+
height: 100dvh;
|
|
26
26
|
}
|
|
27
27
|
</style>
|
|
28
28
|
</head>
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
<p>Please enable JavaScript in your browser settings or upgrade to a browser that supports JavaScript.</p>
|
|
34
34
|
</noscript>
|
|
35
35
|
<script>(()=>{var c1=Object.create;var ru=Object.defineProperty;var f1=Object.getOwnPropertyDescriptor;var d1=Object.getOwnPropertyNames;var p1=Object.getPrototypeOf,h1=Object.prototype.hasOwnProperty;var z=(n,e)=>()=>(n&&(e=n(n=0)),e);var Ct=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Fe=(n,e)=>{for(var i in e)ru(n,i,{get:e[i],enumerable:!0})},g1=(n,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of d1(e))!h1.call(n,l)&&l!==i&&ru(n,l,{get:()=>e[l],enumerable:!(o=f1(e,l))||o.enumerable});return n};var dn=(n,e,i)=>(i=n!=null?c1(p1(n)):{},g1(e||!n||!n.__esModule?ru(i,"default",{value:n,enumerable:!0}):i,n));var Vs,iu=z(()=>{Vs=[]});var m1,y1,pn,Ae,st=z(()=>{({toString:m1,hasOwnProperty:y1}=Object.prototype),pn=n=>m1.call(n),Ae=Object.hasOwn||((n,e)=>y1.call(n,e))});function gi(){return[performance.timeOrigin.toString(16),(1e4*performance.now()).toString(16),Math.random().toString(16).slice(2)].join("-")}var Ys=z(()=>{});var Et,er=z(()=>{Et=class{subscriber;value;constructor(e,i){this.subscriber=null,this.value=e,this.shouldUpdate=typeof i=="function"?i:this.shouldUpdate}get readonly(){let e=this;return{subscribe:this.subscribe.bind(this),subscribeSync:this.subscribeSync.bind(this),unsubscribe:this.unsubscribe.bind(this),get value(){return e.value}}}subscribe(e){return this.subscriber={callback:e,subscriber:this.subscriber},()=>this.unsubscribe(e)}subscribeSync(e){let i=this.subscribe(e);return e(this.value,i),i}unsubscribe(e){let i=this,o=this.subscriber;for(;o!==null;){if(o.callback===e){o.callback=null,i.subscriber=o.subscriber;break}i=o,o=o.subscriber}}shouldUpdate(e,i){return e!==i}set(e){return this.#e(e)!==!1}asyncSet(e){let i=this.#e(e);return i===!1?Promise.resolve(!1):Promise.all(i).then(()=>!0)}#e(e){if(!this.shouldUpdate(e,this.value))return!1;let i=[],o=this.subscriber;for(this.value=e;o!==null;){let{callback:l}=o;l!==null&&i.push(l(e,()=>this.unsubscribe(l))),o=o.subscriber}return i}}});function v1(n){let e=fh(n),i=new Map;return function(l){let c=i.get(l);return c===void 0&&(c=new Ks(e,l),i.set(l,c),b1(e,i)),c}}function w1(n){let e=fh(n);return function(o){return e?.getItem(o)??null}}function fh(n){let e="__storage_test__"+Math.random(),i;try{i=window[n]}catch{return null}try{i.setItem(e,e),i.removeItem(e)}catch(o){if(!(o instanceof DOMException&&(o.code===22||o.code===1014||o.name==="QuotaExceededError"||o.name==="NS_ERROR_DOM_QUOTA_REACHED")&&i.length!==0))return null}return i}function b1(n,e){n!==null&&!Qs.has(n)&&(Qs.set(n,e),Qs.size===1&&addEventListener("storage",i=>{let o=Qs.get(i.storageArea);if(o!==void 0){let l=o.get(i.key);l&&l.forceSync()}}))}var ou,su,Qs,Ks,au=z(()=>{er();ou=v1("localStorage"),su=w1("localStorage"),Qs=new Map;Ks=class extends Et{#e;#t;constructor(e,i){super(e?.getItem(i)??null),this.#e=e,this.#t=i}#n(){return this.#e?.getItem(this.#t)??null}get storage(){return this.#e}get key(){return this.#t}get(){return this.value}set(e){if(this.#e){let i=this.#n();if(e!==i)return this.#e.setItem(this.#t,e),super.set(e)}return!1}delete(){this.#e&&this.#e.removeItem(this.#t)}forceSync(){return this.#e?super.set(this.#n()):!1}}});function ph(n){return x1.includes(n)}function xo(){return matchMedia("(prefers-color-scheme:dark)")}function hh(n,e){let i=n;switch(n){case!0:n="dark";break;case!1:n="light";break;case"disabled":case"disable":case"off":n="light-only";break;case"only":n="dark-only";break}if(i!==n&&console.warn(`Used legacy value "${i}" for ColorSheme, value replaced for "${n}"`),n!=="light-only"&&n!=="dark-only"&&e){let o=su(dh);ph(o)&&(n=o)}return n}function k1(n){switch(n){case"light":case"dark":return"manual";case"light-only":case"dark-only":return"only";case"auto":return"auto";default:return n}}function lu(n){let e=mi(n);return e==="auto"?xo().matches?"dark":"light":e}function mi(n){switch(n){case"auto":return"auto";case"dark":case"dark-only":return"dark";case"light":case"light-only":default:return"light"}}function Xs(n="auto",e=!1){return lu(hh(n,e))}var dh,x1,Js,Zs,yi=z(()=>{au();dh="discoveryjs:color-scheme",x1=Object.freeze(["auto","light","dark"]),Js=Object.freeze(["auto","light","dark","light-only","dark-only"]);Zs=class{#e;#t;#n;#o;#r;#i;persistent;state;value;serializedValue;mode;constructor(e="auto",i=!1){this.#e=i?ou(dh):null,this.#o=[],this.#r=hh(e,i),this.#i=lu(this.#r),Object.defineProperties(this,{persistent:{get:()=>this.#e!==null},state:{get:()=>this.#r},value:{get:()=>this.#i},serializedValue:{get:()=>mi(this.#r)},mode:{get:()=>k1(this.#r)}}),this.#t=this.#e?.subscribe(o=>{ph(o)&&o!==this.serializedValue&&this.mode!=="only"&&this.set(o)}),this.#n=()=>{let o=xo(),l=()=>{this.state==="auto"&&this.set("auto")};return o.addEventListener("change",l),()=>o.removeEventListener("change",l)}}subscribe(e,i=!1){let o={fn:e};return this.#o.push(o),i&&o.fn(this.#i,this.#r),()=>{let l=o!==null?this.#o.indexOf(o):-1;o=null,l!==-1&&this.#o.splice(l,1)}}destroy(){this.#t?.(),this.#t=void 0,this.#n?.(),this.#n=void 0}set(e){let i=this.serializedValue,o=this.#i,l=this.#r;if(!Js.includes(e)){console.warn(`Bad value "${e}" for ColorScheme#state, value ignored`);return}this.#r=e,this.#i=lu(e),this.serializedValue!==i&&this.#e?.set(this.serializedValue),(this.#r!==l||this.#i!==o)&&this.#o.forEach(({fn:c})=>c(this.#i,this.#r))}toggle(e=!1){switch(this.#r){case"auto":this.set(xo().matches?"dark":"light");return;case"dark":this.set(e&&!xo().matches?"auto":"light");return;case"light":this.set(e&&xo().matches?"auto":"dark");return}console.warn(`ColorScheme is locked for changes (mode=${this.#r})`)}}});function mh(n,e,i){e in i||(i[e]=[n.style.getPropertyValue(e),n.style.getPropertyPriority(e)])}function uu(n,e){let i=gh.get(n)||Object.create(null),o=Xs(e)==="dark";for(let[l,c]of Object.entries(C1))mh(n,l,i),n.style.setProperty(l,c);for(let[l,c]of Object.entries(D1))mh(n,l,i),o?n.style.setProperty(l,c):n.style.removeProperty(l);return gh.set(n,i),o}var gh,C1,D1,cu=z(()=>{yi();gh=new WeakMap,C1={"font-family":"Tahoma, Verdana, Arial, sans-serif","font-size":"14px","line-height":"1.6","-webkit-text-size-adjust":"none","text-size-adjust":"none","background-color":"var(--discovery-background-color, white)",color:"var(--discovery-color, black)"},D1={"--discovery-background-color":"#242424","--discovery-color":"#cccccc"}});function $(n,e,i){let o=document.createElement(n);typeof e=="string"&&(e={class:e});for(let l in e)if(Ae(e,l)){let c=e[l];if(typeof c>"u")continue;typeof c=="function"?o.addEventListener(l.slice(2),c):o.setAttribute(l,c)}return Array.isArray(i)?o.append(...i):typeof i=="string"&&(o.innerHTML=i),o}function yh(n){return document.createTextNode(String(n))}function fu(n){return n.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Dr(...n){let e=document.createDocumentFragment();return n.forEach(i=>e.appendChild(i instanceof Node?i:yh(i))),e}var vh,Rt,Oe=z(()=>{st();vh=(()=>{let n=!1;try{let e={get passive(){return n=!0,!1}},i=()=>{};window.addEventListener("test-passive",i,e),window.removeEventListener("test-passive",i)}catch{}return n})(),Rt=vh?Object.freeze({passive:!0,capture:!0}):!0});async function ko(n,e){let i=$("style",null,":host{display:none}"),o=new Set;Array.isArray(e)&&(n.append(...e.map(l=>{switch(typeof l=="string"&&(l={type:"style",content:l}),l.type){case"style":case"inline":return $("style",{media:l.media},l.content);case"link":case"external":{let c,f,d=new Promise((m,y)=>{c=m,f=y});return o.add(d),$("link",{rel:"stylesheet",href:l.href,media:l.media,onerror(m){o.delete(d),f(m)},onload(){o.delete(d),c()}})}default:throw new Error(`Unknown type "${l.type}" for a style descriptor`)}})),o.size&&(n.append(i),await Promise.all(o),i.remove()))}var ea=z(()=>{Oe()});function A1(n){if(!n||typeof n!="object")return"value is not an object";let{name:e,test:i,decode:o}=n;return typeof e!="string"?"missed name":typeof i!="function"?"missed test function":typeof o!="function"?"missed decode function":!1}function S1(n){let e=A1(n);if(e)throw new Error(`Bad encoding config${n?.name?` "${n.name}"`:""}: ${e}`);let{name:i,test:o,streaming:l,decode:c}=n;return Object.freeze(l?{name:i||"unknown",test:o,streaming:!0,decode:c}:{name:i||"unknown",test:o,streaming:!1,decode:c})}function ta(n){if(!n)return[];if(!Array.isArray(n))throw new Error("Encodings must be an array");return n.map(S1)}var du=z(()=>{});function pu(n){return typeof n=="object"&&n!==null&&(typeof n[Symbol.iterator]=="function"||typeof n[Symbol.asyncIterator]=="function")}function hu(n,e,i,o){switch(i&&typeof i.toJSON=="function"&&(i=i.toJSON()),o!==null&&(i=o.call(n,String(e),i)),typeof i){case"function":case"symbol":i=void 0;break;case"object":if(i!==null){let l=i.constructor;(l===String||l===Number||l===Boolean)&&(i=i.valueOf())}break}return i}function E1(n){return typeof n=="function"?n:Array.isArray(n)?[...new Set(n.map(i=>{let o=i&&i.constructor;return o===String||o===Number?String(i):null}).filter(i=>typeof i=="string"))]:null}function M1(n){return typeof n=="number"?!Number.isFinite(n)||n<1?!1:" ".repeat(Math.min(n,10)):typeof n=="string"&&n.slice(0,10)||!1}function gu(n,e){(n===null||Array.isArray(n)||typeof n!="object")&&(n={replacer:n,space:e});let i=E1(n.replacer),o=Object.keys;if(Array.isArray(i)){let l=i;o=()=>l,i=null}return{...n,replacer:i,getKeys:o,space:M1(n.space)}}var Co=z(()=>{});function F1(n,e){return n.name==="SyntaxError"&&e.jsonParseOffset&&(n.message=n.message.replace(/at position (\d+)/,(i,o)=>"at position "+(Number(o)+e.jsonParseOffset))),n}function N1(n,e){let i=n.length;n.length+=e.length;for(let o=0;o<e.length;o++)n[i+o]=e[o]}async function na(n){let e=typeof n=="function"?n():n;if(pu(e)){let i=new mu;try{for await(let o of e){if(typeof o!="string"&&!ArrayBuffer.isView(o))throw new TypeError("Invalid chunk: Expected string, TypedArray or Buffer");i.push(o)}return i.finish()}catch(o){throw F1(o,i)}}throw new TypeError("Invalid chunk emitter: Expected an Iterable, AsyncIterable, generator, async generator, or a function returning an Iterable or AsyncIterable")}var Do,L1,T1,mu,yu=z(()=>{Co();Do=1,L1=2,T1=new TextDecoder;mu=class{constructor(){this.value=void 0,this.valueStack=null,this.stack=new Array(100),this.lastFlushDepth=0,this.flushDepth=0,this.stateString=!1,this.stateStringEscape=!1,this.pendingByteSeq=null,this.pendingChunk=null,this.chunkOffset=0,this.jsonParseOffset=0}parseAndAppend(e,i){this.stack[this.lastFlushDepth-1]===Do?(i&&(this.jsonParseOffset--,e="{"+e+"}"),Object.assign(this.valueStack.value,JSON.parse(e))):(i&&(this.jsonParseOffset--,e="["+e+"]"),N1(this.valueStack.value,JSON.parse(e)))}prepareAddition(e){let{value:i}=this.valueStack;if(Array.isArray(i)?i.length!==0:Object.keys(i).length!==0){if(e[0]===",")return this.jsonParseOffset++,e.slice(1);if(e[0]!=="}"&&e[0]!=="]")return this.jsonParseOffset-=3,"[[]"+e}return e}flush(e,i,o){let l=e.slice(i,o);if(this.jsonParseOffset=this.chunkOffset+i,this.pendingChunk!==null&&(l=this.pendingChunk+l,this.jsonParseOffset-=this.pendingChunk.length,this.pendingChunk=null),this.flushDepth===this.lastFlushDepth)this.flushDepth>0?this.parseAndAppend(this.prepareAddition(l),!0):(this.value=JSON.parse(l),this.valueStack={value:this.value,prev:null});else if(this.flushDepth>this.lastFlushDepth){for(let c=this.flushDepth-1;c>=this.lastFlushDepth;c--)l+=this.stack[c]===Do?"}":"]";this.lastFlushDepth===0?(this.value=JSON.parse(l),this.valueStack={value:this.value,prev:null}):this.parseAndAppend(this.prepareAddition(l),!0);for(let c=this.lastFlushDepth||1;c<this.flushDepth;c++){let f=this.valueStack.value;if(this.stack[c-1]===Do){let d;for(d in f);f=f[d]}else f=f[f.length-1];this.valueStack={value:f,prev:this.valueStack}}}else{l=this.prepareAddition(l);for(let c=this.lastFlushDepth-1;c>=this.flushDepth;c--)this.jsonParseOffset--,l=(this.stack[c]===Do?"{":"[")+l;this.parseAndAppend(l,!1);for(let c=this.lastFlushDepth-1;c>=this.flushDepth;c--)this.valueStack=this.valueStack.prev}this.lastFlushDepth=this.flushDepth}push(e){if(typeof e!="string"){if(this.pendingByteSeq!==null){let c=e;e=new Uint8Array(this.pendingByteSeq.length+c.length),e.set(this.pendingByteSeq),e.set(c,this.pendingByteSeq.length),this.pendingByteSeq=null}if(e[e.length-1]>127)for(let c=0;c<e.length;c++){let f=e[e.length-1-c];if(f>>6===3){c++,(c!==4&&f>>3===30||c!==3&&f>>4===14||c!==2&&f>>5===6)&&(this.pendingByteSeq=e.slice(e.length-c),e=e.slice(0,-c));break}}e=T1.decode(e)}let i=e.length,o=0,l=0;e:for(let c=0;c<i;c++){if(this.stateString){for(;c<i;c++)if(this.stateStringEscape)this.stateStringEscape=!1;else switch(e.charCodeAt(c)){case 34:this.stateString=!1;continue e;case 92:this.stateStringEscape=!0}break}switch(e.charCodeAt(c)){case 34:this.stateString=!0,this.stateStringEscape=!1;break;case 44:l=c;break;case 123:l=c+1,this.stack[this.flushDepth++]=Do;break;case 91:l=c+1,this.stack[this.flushDepth++]=L1;break;case 93:case 125:l=c+1,this.flushDepth--,this.flushDepth<this.lastFlushDepth&&(this.flush(e,o,l),o=l);break;case 9:case 10:case 13:case 32:o===c&&o++,l===c&&l++;break}}l>o&&this.flush(e,o,l),l<i&&(this.pendingChunk!==null?this.pendingChunk+=e:this.pendingChunk=e.slice(l,i)),this.chunkOffset+=i}finish(){return this.pendingChunk!==null&&(this.flush("",0,0),this.pendingChunk=null),this.value}}});var vu=z(()=>{Co()});function P1(n){return n>=55296&&n<=56319}function j1(n){return n>=56320&&n<=57343}function wh(n){if(!/[^\x20\x21\x23-\x5B\x5D-\x7F]/.test(n))return n.length+2;let e=0,i=!1;for(let o=0;o<n.length;o++){let l=n.charCodeAt(o);if(l<2048)e+=B1[l];else if(P1(l)){e+=6,i=!0;continue}else j1(l)?e=i?e-2:e+6:e+=3;i=!1}return e+2}function z1(n){let e=0;return n<0&&(e=1,n=-n),n>=1e9&&(e+=9,n=(n-n%1e9)/1e9),n>=1e4?n>=1e6?e+(n>=1e8?9:n>=1e7?8:7):e+(n>=1e5?6:5):e+(n>=100?n>=1e3?4:3:n>=10?2:1)}function R1(n){switch(typeof n){case"string":return wh(n);case"number":return Number.isFinite(n)?Number.isInteger(n)?z1(n):String(n).length:4;case"boolean":return n?4:5;case"undefined":case"object":return 4;default:return 0}}function Ao(n,...e){let{replacer:i,getKeys:o,...l}=gu(...e),c=!!l.continueOnCircular,f=l.space?.length||0,d=new Map,g=new Map,m=new Set,y=[],k={"":n},C=!1,M=0,E=0,F=0;return N(k,"",n),M===0&&(M+=9),{bytes:isNaN(M)?1/0:M+E,spaceBytes:f>0&&isNaN(M)?1/0:E,circular:[...m]};function N(A,b,L){if(!C)if(L=hu(A,b,L,i),L===null||typeof L!="object")(L!==void 0||Array.isArray(A))&&(M+=R1(L));else{if(y.includes(L)){m.add(L),M+=4,c||(C=!0);return}if(g.has(L)){M+=g.get(L);return}F++;let T=F,I=M,B=0;if(y.push(L),Array.isArray(L)){B=L.length;for(let R=0;R<B;R++)N(L,R,L[R])}else{let R=M;for(let U of o(L))if(N(L,U,L[U]),R!==M){let W=d.get(U);W===void 0&&d.set(U,W=wh(U)+1),M+=W,B++,R=M}}M+=B===0?2:1+B,f>0&&B>0&&(E+=(Array.isArray(L)?0:B)+(1+y.length*f)*(B+1)-f),y.pop(),T!==F&&g.set(L,M-I)}}}var O1,I1,B1,bh=z(()=>{Co();O1=typeof Object.hasOwn=="function"?Object.hasOwn:(n,e)=>Object.hasOwnProperty.call(n,e),I1={8:"\\b",9:"\\t",10:"\\n",12:"\\f",13:"\\r",34:'\\"',92:"\\\\"},B1=Uint8Array.from({length:2048},(n,e)=>O1(I1,e)?2:e<32?6:e<128?1:2)});var xh=z(()=>{yu();vu();Co()});var wu=z(()=>{yu();vu();bh();xh()});var bu,kh=z(()=>{wu();bu=Object.freeze({name:"json",test:()=>!0,streaming:!0,decode:na})});function cD(n,e,i,o=new Array(i)){let l=e&15,c=e&48,f=i,d=0,g=0;switch(c){case Ch:{d=o[0]=n.readIntVar(),f--,g=1;break}case Dh:{d=n.readIntVar();break}}switch(l){case iD:{for(let m=0;m<f;m++)o[g+m]=n.readVlq();break}case oD:{for(let m=0;m<f;m++)o[g+m]=n.readIntVar();break}case sD:{let m=n.readBytes(Math.ceil(f/2));for(let y=0,k=0;y<f;y++)k=y&1?k>>4:m[y>>1],o[g+y]=k&8?n.readVlq()*8+(k&7):k&7;break}case aD:{let m=n.readBytes(Math.ceil(f/2));for(let y=0,k=0;y<f;y++){k=y&1?k>>4:m[y>>1];let C=k&4?-1:1;o[g+y]=k&8?C*(n.readVlq()*4+(k&3)):C*(k&3)}break}case Mh:{let m=e>>8,y=(1<<m)-1,k=n.readBytes(Math.ceil(f*m/8)),C=0,M=0,E=0;for(let F=0;F<f;F++){for(;M<m;)E|=k[C++]<<M,M+=8;o[g+F]=E&y,E>>=m,M-=m}break}case Lh:{let m=e>>8,y=(1<<m)-1,k=n.readBytes(Math.ceil(f*m/8)),C=0,M=0,E=0;for(let F=0;F<f;F++){for(;M<m;)E|=k[C++]<<M,M+=8;o[g+F]=E&1?-((E&y)>>1):(E&y)>>1,E>>=m,M-=m}break}case lD:{let m=o[0]=n.readIntVar(),y=n.readIntVar();for(let k=1;k<i;k++)o[k]=m+=y;break}case Eh:case ku:{let m=l===ku,y=e>>8,k=m?e&rD|y&nD:y;if(Th[y]>1){let C=n.readTypeIndex(f,k);for(let M=0;M<f;M++)o[g+M]=n.readNumber(C[M])}else{let C=31-Math.clz32(k);for(let M=0;M<f;M++)o[g+M]=n.readNumber(C)}break}default:throw new Error(`Unknown numeric array encoding method: ${l}`)}switch(c){case Ch:{o[0]=d;for(let m=1;m<i;m++)o[m]+=o[m-1];break}case Dh:{for(let m=0;m<i;m++)o[m]+=d;break}}return o}function fD(n){return n===Sh||n===9}function Fh(n){try{let{version:e}=Nh(n);if(fD(e))return!0;throw new Error(`Unsupported jsonxl version "${e}", expected "${Sh}"`)}catch{return!1}}function Nh(n){if(n.byteLength<Eo)throw new Error(`Header length must be at least ${Eo} bytes`);let e=new Uint8Array(n.buffer,n.byteOffset,Eo);if(e.subarray(0,8).some((c,f)=>c!==q1[f]))throw new Error("Bad magic number");let i=new DataView(e.buffer,e.byteOffset,Eo),o=i.getUint16(8,!0),l=i.getUint16(10,!0);return{version:o,flags:l,headerSize:Eo}}function pD(n){let e=dD.decode(n.readBytes(n.readVlq())),i=n.readNumericArray(),o=n.readNumericArray(),l=n.readNumericArray(),c=new Array(i);for(let f=0,d=0,g=0,m=0,y="";f<i.length;f++){let k=i[f],C=e.slice(d,d+=k>>2);k&2&&(C=y.slice(0,o[g++])+C),k&1&&(C=C+y.slice(-l[m++])),c[f]=C,y=C}return c}function Ah(n,e){let i=0;for(let o=0;o<n.length;o++)n[o]===e&&i++;return i}function Oh(n,e){function i(d={}){let g=0,m;for(;m=c.readObjectEntry(g++);)d[m.key]=l(m.type);return d}function o(d=c.readArrayLength()){if(d===0)return[];let g=c.readArrayHeader(),m=g>>16,y=g&65535,k=m&1,C=m>>5&1,M=m>>9&1,E=m>>1&255|(m&1)<<4,F=new Array(d),N=Th[E]>1?c.readTypeIndex(d,E,!0):null;if(E&uD)if(N===null)switch(E){case ra:F.fill(null);break;case ia:F.fill(!0);break;case oa:F.fill(!1);break}else for(let A=0;A<d;A++)switch(N[A]){case ra:F[A]=null;break;case ia:F[A]=!0;break;case oa:F[A]=!1;break}if(E&xu)for(let A=0;A<d;A++)(N===null||N[A]===xu)&&(F[A]=c.readString());if(E&So)if(E===So)c.readNumbers(y,d,F);else{let A=Ah(N,So),b=c.readNumbers(y,A);for(let L=0,T=0;L<d;L++)N[L]===So&&(F[L]=b[T++])}if(E&vi)if(M){let A=E===vi?d:Ah(N,vi),b=c.readNumericArray(A),L=o();for(let T=0,I=0,B=0;T<d;T++)(N===null||N[T]===vi)&&(F[T]=L.slice(B,B+=b[I++]))}else for(let A=0;A<d;A++)(N===null||N[A]===vi)&&(F[A]=o());if(E&Mo){let A=E===Mo?F:[];for(let b=0,L=0;b<d;b++)(N===null||N[b]===Mo)&&(F[b]=A[L++]={});if(C){let b=c.readVlq(),L=new Array(b);for(let T=0;T<b;T++)L[T]=c.readString();for(let T=0;T<b;T++){let I=L[T],B=o(A.length);for(let R=0;R<A.length;R++)B[R]!==void 0&&(A[R][I]=B[R])}}if(k)for(let b=0;b<A.length;b++)i(A[b])}return F}function l(d){switch(1<<(d&7)){case ra:return null;case xu:return c.readString();case So:return c.readNumber(d>>3);case Mo:return i();case ia:return!0;case oa:return!1;case vi:return o()}}let c=new hD(n,e),f=l(c.readUint8());if(c.pos!==n.byteLength)throw new Error("End of input is not reached");return f}var q1,Sh,_1,W1,ra,So,xu,Mo,ia,oa,vi,$1,U1,G1,V1,Y1,Q1,K1,Z1,J1,X1,eD,tD,nD,rD,Eh,ku,iD,oD,sD,aD,Mh,Lh,lD,Ch,Dh,MF,uD,Th,Eo,dD,hD,Ih=z(()=>{q1=new Uint8Array([0,0,74,83,79,78,88,76]),Sh=9,_1=268435455,W1=4294967295,ra=2,So=4,xu=8,Mo=16,ia=32,oa=64,vi=128,$1=0,U1=1,G1=2,V1=3,Y1=4,Q1=5,K1=6,Z1=8,J1=9,X1=10,eD=11,tD=12,nD=224,rD=7936,Eh=0,ku=1,iD=2,oD=3,sD=4,aD=5,Mh=6,Lh=7,lD=8,Ch=16,Dh=32,MF=~Mo,uD=ra|ia|oa,Th=new Uint8Array(256).map((n,e)=>{for(let i=0;i<8;i++)n+=e>>i&1;return n});Eo=12;dD=new TextDecoder("utf8",{ignoreBOM:!0});hD=class{constructor(n,e){this.view=new DataView(n.buffer,n.byteOffset,n.byteLength),this.bytes=n,this.pos=0,typeof e=="function"&&e(this),this.consumeHeader(),this.loadStrings(),this.loadArrayLengths(),this.loadArrayHeaders(),this.loadObjectEntries()}consumeHeader(){let{version:n,flags:e,headerSize:i}=Nh(this.view);return this.pos+=i,{version:n,flags:e}}loadStrings(){this.strings=pD(this),this.stringRefs=this.readNumericArray(),this.stringRefsCursor=0}loadArrayHeaders(){this.arrayHeaders=this.readNumericArray(),this.arrayHeaderRefs=this.readNumericArray(),this.arrayHeaderRefsCursor=0}loadArrayLengths(){this.arrayLengths=this.readNumericArray(),this.arrayLengthsCursor=0}loadObjectEntries(){let n=this.readVlq(),e=this.readVlq();this.objectEntries=new Array(n),this.objectKeys=e?this.stringRefs.slice(-e).map(i=>this.strings[i]):[];for(let i=0;i<n;i++)this.objectEntries[i]={dict:this.readNumericArray(),refs:this.readNumericArray(),cursor:0}}readString(){return this.strings[this.stringRefs[this.stringRefsCursor++]]}readArrayHeader(){return this.arrayHeaders[this.arrayHeaderRefs[this.arrayHeaderRefsCursor++]]}readArrayLength(){return this.arrayLengths[this.arrayLengthsCursor++]}readObjectEntry(n){let e=this.objectEntries[n],i=e.refs[e.cursor++],o=e.dict[i];return o===0?null:{key:this.objectKeys[o>>8],type:o&255}}readBytes(n){return this.bytes.subarray(this.pos,this.pos+=n)}readTypeIndex(n,e,i){let o=0,l=0,c=0;for(;e>0;)e&1&&(o|=c<<(l++<<2)),c++,e>>=1;let f=new Uint8Array(n),d=32-Math.clz32(l-1),g=(1<<d)-1,m=this.readBytes(Math.ceil(d*n/8)),y=0,k=0,C=0;for(let M=0;M<n;M++){C<d&&(k|=m[y++]<<C,C+=8);let E=o>>((k&g)<<2)&15;f[M]=i?1<<E:E,k>>=d,C-=d}return f}readVlq(){let n=this.view.getUint8(this.pos);if(!(n&1))n=n>>1,this.pos+=1;else if(!(n&2))n=this.view.getUint8(this.pos+1)<<6|n>>2,this.pos+=2;else if(!(n&4))n=this.view.getUint16(this.pos+1,!0)<<5|n>>3,this.pos+=3;else{let e=this.view.getUint32(this.pos,!0);n=e>>>3&_1,this.pos+=4,e>>>31&&(n+=this.readUintVar()*(1<<28))}return n}readUintVar(){let n=this.view.getUint8(this.pos++),e=n&127,i=128;for(;n&128;)n=this.view.getUint8(this.pos++),e+=(n&127)*i,i*=128;return e}readIntVar(){let n=this.readUintVar();return n&1?-(n-1)/2:n<=W1?n>>>1:n/2}readUint8(){let n=this.view.getUint8(this.pos);return this.pos++,n}readInt8(){let n=this.view.getInt8(this.pos);return this.pos++,n}readUint16(){let n=this.view.getUint16(this.pos,!0);return this.pos+=2,n}readInt16(){let n=this.view.getInt16(this.pos,!0);return this.pos+=2,n}readUint24(){let n=this.view.getUint16(this.pos,!0)|this.view.getUint8(this.pos+2)<<16;return this.pos+=3,n}readInt24(){let n=this.view.getUint16(this.pos,!0),e=this.view.getUint8(this.pos+2),i=e&128?(e<<16|n)-16777216:e<<16|n;return this.pos+=3,i}readUint32(){let n=this.view.getUint32(this.pos,!0);return this.pos+=4,n}readInt32(){let n=this.view.getInt32(this.pos,!0);return this.pos+=4,n}readFloat32(){let n=this.view.getFloat32(this.pos,!0);return this.pos+=4,n}readFloat64(){let n=this.view.getFloat64(this.pos,!0);return this.pos+=8,n}readNumber(n){switch(n){case $1:return this.readUint8();case U1:return this.readUint16();case G1:return this.readUint24();case V1:return this.readUint32();case Y1:return this.readUintVar();case Z1:return this.readInt8();case J1:return this.readInt16();case X1:return this.readInt24();case eD:return this.readInt32();case tD:return this.readIntVar();case Q1:return this.readFloat32();case K1:return this.readFloat64()}}readNumericArrayEncoding(){let n=this.readUint8();switch(n&15){case Eh:case ku:case Mh:case Lh:n|=this.readUint8()<<8;break}return n}readNumericArray(n=this.readVlq()){if(n===0)return[];let e=this.readNumericArrayEncoding();return this.readNumbers(e,n)}readNumbers(n,e,i){return cD(this,n,e,i)}}});var sa,Cu=z(()=>{Ih();sa=Object.freeze({name:"jsonxl/snapshot9",test:Fh,streaming:!1,decode:Oh})});var Bh=z(()=>{kh();Cu()});function mD(n){try{return new URL(n,location.origin).origin===location.origin}catch{return!1}}function yD(n){return n.ok}function vD(n){return n.headers.get("x-file-encoded-size")||n.headers.get("content-length")}function wD(n){return n.headers.get("x-file-size")||(mD(n.url)&&!n.headers.get("content-encoding")?n.headers.get("content-length"):void 0)}function bD(n){return n.headers.get("x-file-created-at")||n.headers.get("last-modified")||void 0}function xD(n){let e=n?Object.keys(n):[],i=["name","createdAt","elapsedTime","data"];return!(e.length!==4||e.some(o=>!i.includes(o)))}function kD(n,e,{size:i,encoding:o}){let l=null;if(xD(n)){let{data:F,...N}=n;n=F,e={...e,createdAt:F.createdAt},l=N}let c=n,f=l||{},{type:d,name:g,encoding:m,size:y,encodedSize:k,createdAt:C,...M}=e||{};return{resource:{type:d||"unknown",name:g||"unknown",encoding:o,...Number.isFinite(i)?{size:i}:null,...Number.isFinite(k)?{encodedSize:k}:null,createdAt:new Date((typeof C=="string"?Date.parse(C):C)||Date.now()),...M},meta:f,data:c}}async function CD(n){let e=[],i=0;for await(let c of n)e.push(c),i+=c.byteLength;let o=new Uint8Array(i),l=0;for(let c of e)o.set(c,l),l+=c.length;return o}async function DD(n,e,i,o){let c=n.getReader(),f=Date.now(),d=[...ta(e),sa,bu],g=0,m="unknown",y=0;await o("receiving",k(!1));try{let E=await c.read(),{value:F,done:N}=E;if(N)throw new Error("Empty payload");for(let{name:A,test:b,streaming:L,decode:T}of d)if(b(F))return m=A,{data:await(L?T(C(E)):CD(C(E)).then(M(T))),encoding:m,size:y,decodingTime:g};throw new Error("No matched encoding found for the payload")}finally{c.releaseLock()}function k(E){return{done:E,elapsed:Date.now()-f,units:"bytes",completed:y,total:i}}async function*C(E){for(;;){let{value:F,done:N}=E||await c.read();if(E=void 0,N)break;for(let A=0;A<F.length;A+=1048576){let b=performance.now(),L=A===0&&F.length-A<1048576?F:F.slice(A,A+1048576);yield L,g+=performance.now()-b,y+=L.length,await o("receiving",k(!1))}}await o("receiving",k(!0))}function M(E){return async F=>{await o("decoding",void 0,m);let N=performance.now();try{return await E(F)}finally{g=performance.now()-N}}}}async function AD(n,e){try{await e.asyncSet({stage:"request"});let i=new Date,{method:o,stream:l,resource:c,options:f,data:d}=await n(),g=new Date,m=c?.size,{encodings:y}=f||{},{data:k,encoding:C="unknown",size:M=void 0,decodingTime:E=0}=d?{data:d}:await DD(l,y,Number(m)||0,(I,B,R)=>e.asyncSet({stage:I,progress:B,step:R}));await e.asyncSet({stage:"received"});let{data:F,resource:N,meta:A}=kD(k,c,{size:M,encoding:C}),b=new Date,L=Number(b)-Number(i),T=Math.round(E||0);return{loadMethod:o,resource:N,meta:A,data:F,timings:{time:L,start:i,end:b,loadingTime:L-T,decodingTime:T,requestTime:Number(g)-Number(i),requestStart:i,requestEnd:g,responseTime:Number(b)-Number(g),responseStart:g,responseEnd:b}}}catch(i){throw console.error("[Discovery] Error loading data:",i),await e.asyncSet({stage:"error",error:i}),i}}function la(n,e){let i=new Et({stage:"inited"});return{state:i,dataset:n(i),...e}}function ua(n){return e=>AD(n,e)}function Lo(n,e){return la(ua(()=>({method:"stream",stream:n,resource:e?.resource,options:e})))}function ca(n,e){let i=Ph(n);return la(ua(()=>({method:"file",stream:n.stream(),resource:e?.resource||i,options:e})),{title:"Load data from file: "+(i?.name||"unknown")})}function Du(n,e){let o=(n.dataTransfer||n.clipboardData||n.target)?.files?.[0];if(n.stopPropagation(),n.preventDefault(),!o)throw new Error("Can't extract a file from an event object");return ca(o,e)}function Au(n,e){return e=e||{},la(ua(async()=>{let i=await fetch(n,e.fetch),o=Ph(i,e);if(o&&i.body)return{method:"fetch",stream:i.body,resource:e.resource||o,options:e};let l=i.headers.get("content-type")||"",c=await i.text();if(l.toLowerCase().startsWith("application/json"))try{let f=JSON.parse(c);c=f.error||f}catch{}throw c=new Error(c),c.isFetchError=!0,c.status=i.status,c.statusText=i.statusText,c.stack=null,c}),{title:`Load data from url: ${n}`})}function Su(n){let e,i=new ReadableStream({start(f){e=f},cancel(){e=null}}),o,l=null,c=new Promise(f=>{o=d=>f({method:"push",stream:i,resource:d?l=d:n?.resource,options:n})});return n=n||{},la(ua(()=>c),{start(f){o(f)},push(f){o(),e?.enqueue(f)},finish(f){e?.close(),e=null,f!==void 0&&isFinite(f)&&l!==null&&(l.encodedSize=Number(f)),l=null}})}function fa({dataset:n,state:e},i){return new Promise((o,l)=>e.subscribeSync(async(c,f)=>{if(c.stage==="error"){f(),l(c.error);return}let{stage:d,progress:g,step:m}=c;await i.setState({stage:d,progress:g},m),d==="received"&&(f(),o(n))}))}function Ph(n,e){if(n instanceof Response){let i=e?.isResponseOk||yD,o=e?.getContentSize||wD,l=e?.getContentEncodedSize||vD,c=e?.getContentCreatedAt||bD;if(i(n))return{type:"url",name:n.url,size:Number(o(n))||null,encodedSize:Number(l(n)),createdAt:c(n)}}if(n instanceof File)return{type:"file",name:n.name,size:n.size,createdAt:n.lastModified};if(n instanceof Blob)return{size:n.size};if(ArrayBuffer.isView(n))return{size:n.byteLength};if(typeof n=="string")return{size:n.length}}var aa,wi=z(()=>{er();du();Bh();aa={stream:Lo,event:Du,file:ca,url:Au,push:Su}});function Rh(n,e,i){let{value:o,title:l,duration:c}=Hh[n],f=0,d=null;if(e){let{done:g,elapsed:m,units:y,completed:k,total:C}=e;C?(f=g?1:k/C,d=y==="bytes"?Math.round(f*100)+"%":`${k}/${C}`):(f=g?1:.1+Math.min(.9,m/2e4),d=y==="bytes"?(k/(1024*1024)).toFixed(1)+"MB":String(k))}return{stageTitle:l,progressValue:o+f*c,progressText:d,stepText:i||"",title:d?`${l} (${d})${i?":":"..."}`:n!=="done"?`${l}${i?":":"..."}`:l}}var Hh,SD,jh,zh,ED,Ar,da=z(()=>{er();Oe();Hh={inited:{value:0,duration:0,title:"Init"},request:{value:0,duration:.1,title:"Awaiting data"},receiving:{value:.1,duration:.8,title:"Receiving data"},decoding:{value:.9,duration:.015,title:"Decoding data"},received:{value:.915,duration:.01,title:"Await app ready"},prepare:{value:.925,duration:.055,title:"Processing data (prepare)"},initui:{value:.98,duration:.02,title:"Rendering UI"},done:{value:1,duration:0,title:"Done!"},error:{value:1,duration:0,title:"Error"}},SD=n=>n|0,jh=n=>typeof n=="function"?n:()=>{},zh=n=>new Promise(e=>setTimeout(e,n)),ED=async()=>{if(!document.hidden)return Promise.race([new Promise(requestAnimationFrame).then(()=>zh(0)),zh(12)])};Ar=class extends Et{startTime;lastStageStartTime;awaitRepaintPenaltyTime;finished;awaitRepaint;timings;onTiming;onFinish;appearanceDelay;domReady;el;#e;#t;constructor({onTiming:e,onFinish:i,domReady:o}){super({stage:"inited",progress:null,error:null}),this.startTime=null,this.lastStageStartTime=null,this.awaitRepaintPenaltyTime=0,this.finished=!1,this.awaitRepaint=null,this.timings=[],this.onTiming=jh(e),this.onFinish=jh(i),this.domReady=o||Promise.resolve(),this.el=$("div","view-progress skip-fast-track",[$("div","content main-secondary",[this.#e=$("span","main"),this.#t=$("span","secondary")]),$("div","progress")])}recordTiming(e,i,o=performance.now()){let l={stage:e,title:Hh[e].title,duration:SD(o-i)};this.lastStageStartTime=o,this.timings.push(l),this.onTiming(l)}async#n(e=!1,i=performance.now()){let o=i-(this.awaitRepaint||0),l=i-(this.lastStageStartTime||0);if(e||o>65&&l>200){let c=performance.now();await ED(),this.awaitRepaintPenaltyTime+=performance.now()-c,this.awaitRepaint=performance.now()}}async setState(e,i){let o=this.value.stage,{stage:l=o,progress:c=null,error:f=null}=e;if(this.finished)return;if(f){this.set("stage"in e?{stage:l,progress:c,error:f}:{...this.value,error:f}),this.finish(f);return}this.set({stage:l,progress:c,error:f});let d=l!==o,g=performance.now();o==="inited"&&(this.startTime=g),d&&(this.lastStageStartTime!==null&&this.recordTiming(o,this.lastStageStartTime,g),this.lastStageStartTime=g,this.awaitRepaint=g);let{title:m,stepText:y,progressValue:k}=Rh(l,c,i);this.el.style.setProperty("--progress",String(k)),this.#e.textContent=m,this.#t.textContent=y,this.el.offsetWidth,await this.#n(d,g)}async setStateStep(e){let{title:i,stepText:o}=Rh(this.value.stage,this.value.progress,e);this.#e.textContent=i,this.#t.textContent=o,this.el.offsetWidth,await this.#n(!0)}finish(e){this.finished||(this.finished=!0,this.lastStageStartTime!==null&&this.recordTiming(this.value.stage,this.lastStageStartTime),this.recordTiming(e?"error":"done",this.startTime||this.lastStageStartTime||performance.now()),this.set({stage:"done",progress:null,error:e||null}),this.onFinish(Object.assign([...this.timings],{awaitRepaintPenaltyTime:Math.round(this.awaitRepaintPenaltyTime)})),this.el.classList.add("done"),this.el.classList.toggle("error",!!e))}dispose(){this.finish(),this.el.remove()}}});function MD(n){return new Ar({domReady:n,onTiming:({title:e,duration:i})=>console.log(`[Discovery/preloader] ${e} \u2013 ${i}ms`)})}function LD(n){if(n&&!Ae(aa,n))throw new Error(`dataSource "${n}" is not supported`)}function TD(n,e,i){let{darkmode:o,darkmodePersistent:l,colorScheme:c=o,colorSchemePersistent:f=l}=i,d=Xs(c,f);uu(e,d)&&n.setAttribute("darkmode","")}function pa(n){n=n||{};let e=n.container||document.body,i=document.createElement("div"),o=i.attachShadow({mode:"open"}),l=n.dataSource;LD(l),TD(i,e,n);let c=n.data,f=c?l==="push"?aa.push(n.loadDataOptions):aa[l||"url"](n.data,n.loadDataOptions):{dataset:Promise.resolve(),state:void 0};if(c&&l==="push"){let{start:y,push:k,finish:C}=f;globalThis.discoveryLoader={start:y,push:k,finish(...M){delete globalThis.discoveryLoader,C(...M)}}}let d=ko(o,n.styles),g=n.progressbar||MD(d),m=n.embed?FD(f.state):()=>{};return f.state&&fa(f,g).catch(()=>{}),o.append(g.el),e.append(i),Object.assign(f.dataset,{el:i,shadowRoot:o,progressbar:g,disposeEmbed:m})}function FD(n){let e=gi(),i=window.parent,o=[],l=(g,m)=>{let y={from:"discoveryjs-app",id:e,type:g,payload:m};i.postMessage(y,"*")},c=()=>l("destroy",null),f=g=>{let{id:m,type:y}=g.data||{};if(m===e)switch(y){case"defineAction":case"setPageHash":case"setRouterPreventLocationUpdate":{o.push(g.data);break}default:console.error(`[Discovery/preloader] Unknown preload message type "${y}"`)}};if(i===window)return;addEventListener("message",f,!1),addEventListener("unload",c,!1),l("preinit",{page:{hash:location.hash||"#"}});let d=n?n.subscribeSync(g=>{let{stage:m}=g;return(m==="error"||m==="received")&&d(),l("loadingState",g)}):()=>{};return()=>(removeEventListener("message",f,!1),removeEventListener("unload",c,!1),d(),c(),{hostId:e,postponeMessages:o})}var qh=z(()=>{st();Ys();yi();cu();ea();wi();da();pa.colorScheme=!0});var Wh,_h=z(()=>{Wh="AGFzbQEAAAABEANgAABgAX8Bf2ADf39/AX8CEwEHaW1wb3J0cwZtZW1vcnkCAAADBgUAAQICAQYMAn8AQbMKC38BQQALBygDC2lucHV0T2Zmc2V0AwAMb3V0cHV0T2Zmc2V0AwEHaW5mbGF0ZQAECAEACuoIBQwAPwBBAXZBEHQkAQvEAQEEfyMAIgEiAiAAaiEEAkADQCAARSAEQQFrLQAAQT1Hcg0BIARBAWshBCAAQQFrIQAMAAsLA0AgAS0AAC0AswhBEnQgAUEBai0AAC0AswhBDHRyIAFBAmotAAAtALMIQQZ0ciABQQNqLQAALQCzCHIhAyACIANBEHY6AAAgAkEBaiADQQh2OgAAIAJBAmogAzoAACABQQRqIQEgAkEDaiECIAEgBEkNAAsCfyAAQQJ2QQNsCwJ/IABBA3FBBmxBA3YLagsrACACIAAgAk8NAANAIAAgAS0AADoAACABQQFqIQEgAEEBaiIAIAJJDQALCxAAIAEgACACIAFr/AsAIAIL1wYBGn8gABABIRMjACEBIwEhAiABQQMiBnQhBQN/An8CQAJ/AkACQAJAAkACfwJAAn8CQAJAAkACQAJAAkACQAJAIAVBA3YoAgAgBUEHcXZBASAGdEEBa3EhByAFIAZqIQUgAw4IAAQJBQcFDgUOCyAHQQFxIQQgB0EBdg4CAAECCyACIAVBB2pBA3YiAUEEaiIJIAIgAS8BACIaahACIQIgCSAaakEDdCEFDA4LQRVBCEEHQQlBCEEAQZABEANBgAIQA0GYAhADQaACIgsQA0HAAhADIQ5BBQwHC0EODA0LIAdBBXZBH3EgB0EfcUGBAmoiC2pBAWohDCAHQQp2QQRqIQ1BACIKQQBBFiIOEANBAwwMCyAIQQF0IAdyIBJBAWoiEi0AgANrIghBAE4NDCASQQF0LwHAAiAIQQF0ai8BoAMhCCADQQNrQQF2DgIABQYLIAhBEEkEQCAIIAogC09BBHRqIREgCkEBagwCCyAIQRBGIBFsIREgCiAIQRVGQQN0aiEPIAhBDmsMCgtBASEGQQMhAyAHIA9qQQNqCyEPIBEgCiAPEAMhCkEAIAogDEkNBiAMIQ5BBQwBCyAKLQCgCCAHOgAAIApBAWoiCiANSQ0IQQMLIQNBAEHAAkGgAxADIA4hCgNAIApBAWsiCi0AACIQIBAtAIADQQFqOgCAAyAKDQALA0AgCiAKLwHAAiAKQQF2LQCAA0EBdGo7AcICIApBAmoiCkE+SQ0AC0EAIQoDQCAKLQAAQQF0IhAvAcACIhEgCjsBoAMgECARQQJqOwHAAiAKQQFqIgogDkkNAAtBACIKDAQLIAhBgAJJBEAgAiAIOgAAIAJBAWohAkEADAQLIAhBgAJGDQRBAyEVQRwhFkECIRcgCEGBAmshCAwBC0EBIhchFUEfIRYgCCALayEICyAVIBVBAWogCCAVcWogCCAXdkEBa0EAIAggFUsiGCAIIBZJIhlxGyIGdEH/ASAZGyAIIBgbaiEUIAYgBg0DGkEAIQcLIBQgB2ohFCADQQdJBH8gFCEaQQchA0EQBSACIAIgFGsgAiAaahACIQJBBSEDQQALCyESQQEhBkEAIQgMAgsgAiMBayAEDQJBAyEGQQAhAwwBCyEGIANBAWohAwwACwsLcAIAQaAICxMQERUACAcJBgoFCwQMAw0CDgEPAEHeCAtQPgAAAD80NTY3ODk6Ozw9AAAAAAAAAAABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZAAAAAAAAGhscHR4fICEiIyQlJicoKSorLC0uLzAxMjM="});function Mu(n){let e=n.length;for(;e>0&&n[e-1]==="=";)e--;let i=new Uint8Array(3*Math.ceil(e/4)),o,l,c,f;for(let d=0,g=0;d<e;)o=To[n.charCodeAt(d++)&255],l=To[n.charCodeAt(d++)&255],c=To[n.charCodeAt(d++)&255],f=To[n.charCodeAt(d++)&255],i[g++]=o<<2|l>>4,i[g++]=l<<4|c>>2,i[g++]=c<<6|f;return i.subarray(0,(e>>2)*3+(e%4*6>>3))}function ID(n,e={}){let i=Mu(n),o={imports:e},l=new WebAssembly.Module(i);return new WebAssembly.Instance(l,o)}function BD(){let n=new WebAssembly.Memory({initial:32}),e=ID(Wh,{memory:n}),{inputOffset:i,outputOffset:o,inflate:l}=e.exports,c=new Uint8Array(n.buffer,i,o),f=new Uint8Array(n.buffer,o);return function(d){let g=l(OD.encodeInto(d,c).written);return f.subarray(0,g)}}function Lu(n){return Eu===null&&(Eu=BD()),Eu(n)}var $h,To,OD,Eu,Uh=z(()=>{_h();$h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",To=new Uint8Array(256),OD=new TextEncoder,Eu=null;for(let n=0;n<$h.length;n++)To[$h.charCodeAt(n)]=n});function Gh(n,e,i,o){let l=document.body,c=String(Math.random()).slice(2,18).padStart(16,"0"),f=pa({...o,loadDataOptions:{...o.loadDataOptions,encodings:o.encodings,fetch:{headers:{"Cache-Control":"no-cache, no-transform","x-data-request-id":c}}},container:l});return PD(),o.dataSource==="url"&&o.data&&zD(f,c),Promise.all([n,f]).then(([d,g])=>d({...i,styles:e},f.progressbar,f.disposeEmbed?.(),g)).then(()=>{f.el.remove()},d=>{let g=document.querySelector("body > .discovery"),m=document.createElement("div");if(m.firstChild&&(m.className="action-buttons",f.progressbar.el.before(m)),!d.supressLoadDataError){let y=document.createElement("pre"),k=document.createElement("div"),C=String(d),M=String(d.stack||"");M.startsWith(C)&&(M=M.slice(C.length)),k.className="error-type-badge",k.dataset.type=d.isFetchError?"server":"client",y.className="error",y.append(k,C+(M?`
|
|
36
|
-
`+M.replace(/^[\r\n]+/,""):"")),f.progressbar.el.replaceWith(y)}f.disposeEmbed?.(),f.progressbar.dispose(),g&&g.remove()})}function PD(){let{push:n}=window.discoveryLoader||{};typeof n=="function"&&(window.discoveryLoader.push=function(e,i,o){o?e=i?Lu(e).slice():new TextDecoder().decode(Lu(e)):i&&(e=Mu(e)),n(e)})}function jD(){let n=document.createElement("div");return n.className="data-status",n.innerHTML='<div class="header">Getting data: <span class="elapsed-time"></span></div><div class="output"></div>',n.firstChild.addEventListener("click",function(){n.classList.toggle("collapsed")},!0),n.elapsedTimeEl=n.querySelector(":scope > .header > .elapsed-time"),n}function zD(n,e){let i=!1,o=!0,l=!1,c=jD(),f=()=>{n.progressbar.value.stage==="request"&&!c.parentNode&&n.progressbar.el.getRootNode().append(c)},d=setTimeout(()=>{if(n.progressbar.value.stage!=="request")return;n.progressbar.subscribe(({stage:N},A)=>{N!=="request"&&(A(),c.classList.add("finished"),g.close(),o=!1)});let g=new EventSource("data-status?data-request-id="+e),m=null,y,k,C,M,E,F=N=>{if(!(!o||!isFinite(N)||k!==void 0&&N<=k)){if(clearTimeout(C),k=Number(N),y&&k-y>=1e3&&(c.elapsedTimeEl.textContent=Fu(k-y,i?1:0)),m)for(let{started:A,elapsedTimeEl:b}of m.values())A&&(b.textContent=Fu(k-A,1));M=Date.now(),C=setTimeout(()=>F(k+(Date.now()-M)-5),42)}};g.addEventListener("message",N=>{try{let A=JSON.parse(N.data);switch(A.type){case"start":setTimeout(f,3e3),y=A.timestamp,l=!0;break;case"finish":break;case"crash":if(i=!0,f(),m)for(let{started:b,el:L}of m.values())b&&(L.classList.add("crashed"),L.classList.remove("started"),L.classList.toggle("collapsed",L!==E));break;case"stderr":case"stdout":{let b=document.createElement("div");if(b.className=A.type,b.append(String(A.chunk)),!m)f(),c.lastChild.append(b),Tu(b);else{let L=m.get(A.stepId);L&&(L.contentEl.append(b),L.el.classList.add("has-output"),Tu(b),A.type=="stderr"&&(E=L.el))}break}case"plan":{let b=Vh(A.plan.steps);m=b.map,c.lastChild.innerHTML="",c.lastChild.appendChild(b.el),m&&f();break}case"plan-step-event":{let b=m.get(A.stepId);if(b)switch(A.stepEvent){case"start":b.started=A.timestamp,b.el.classList.add("started"),Tu(b.el);break;case"finish":b.elapsedTimeEl.textContent=Fu(A.timestamp-b.started),b.started=!1,b.el.classList.remove("started"),b.el.classList.add("finished");break;case"summary":b.summaryEl.innerHTML=HD(A.data);break;default:console.warn("Unhandled data status SSE pipeline step event",A)}else console.warn("Pipeline step not found",A);break}default:console.warn("Unhandled data status SSE event",A)}F(A.timestamp)}catch(A){console.error("SSE message parse error",A)}}),g.addEventListener("server-time",({data:N})=>{F(N)}),g.addEventListener("done",()=>{g.close(),o=!1})},150);n.then(()=>clearTimeout(d),g=>{if(o=!1,!!l){i?(g.supressLoadDataError=!0,n.el.classList.add("generate-data-crash")):c.classList.add("compliment-error","collapsed");for(let m of c.querySelectorAll(".plan-step.started"))m.classList.remove("started");c.classList.add("crashed"),c.firstChild.firstChild.textContent="Retrieving data failed "+(c.elapsedTimeEl.textContent?"in ":"")}})}function Tu(n){try{typeof n.scrollIntoViewIfNeeded=="function"?n.scrollIntoViewIfNeeded(!1):n.scrollIntoView({block:"nearest"})}catch{}}function Vh(n,e=0,i=new Map){let o=document.createElement("ul");o.className="plan-step-list",o.style.setProperty("--level",e);for(let l of n){let c=o.appendChild(document.createElement("li")),f=c.appendChild(document.createElement("div")),d=f.appendChild(document.createElement("span")),g=f.appendChild(document.createElement("span")),m=f.appendChild(document.createElement("span")),y=f.appendChild(document.createElement("span")),k=f.appendChild(document.createElement("span")),C=c.appendChild(document.createElement("div"));i.set(l.id,{step:l,el:c,elapsedTimeEl:k,summaryEl:y,contentEl:C,started:!1}),c.className="plan-step collapsed",f.className="plan-step__header",f.addEventListener("click",()=>c.classList.toggle("collapsed")),d.className="plan-step__header-toggle",g.className="plan-step__header-status",m.className="plan-step__header-content",m.textContent=l.name||"Untitled",y.className="plan-step__header-summary",k.className="plan-step__elapsed-time",C.className="plan-step__content",l.steps&&c.append(Vh(l.steps,e+1,i).el)}return{el:o,map:i.size?i:null}}function RD(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function HD(n,e=!0){let i=e&&typeof n!="number"?RD(String(n)):String(n);return i.length>3?i.replace(/\.\d+(eE[-+]?\d+)?|\B(?=(\d{3})+(\D|$))/g,o=>o||'<span class="num-delim"></span>'):i}function Fu(n,e=1){return n<1e3?n+"ms":n<1e4?(n/1e3).toFixed(e)+"s":n<6e4?Math.round(n/1e3)+"s":`${Math.floor(n/6e4)}:${String(Math.floor(n/1e3)%60).padStart(2,"0")}`}var ha,Nu,Ou=z(()=>{qh();Uh();ha=({darkmode:n,darkmodePersistent:e,colorScheme:i=n,colorSchemePersistent:o=e})=>pa.colorScheme?{colorScheme:i,colorSchemePersistent:o}:{darkmode:i,darkmodePersistent:o},Nu=n=>document.querySelector(`style[type="discovery/style"][src=${JSON.stringify(n)}]`).firstChild.nodeValue});function Yh(n){let e=[].filter(i=>{if(typeof i=="function")return!0;console.warn('[discovery-cli] "prepare" module should return a function, but got '+typeof i)});e.length&&n.setPrepare(async(i,...o)=>{for(let l of e)i=await l(i,...o)||i;return i})}var Qh=z(()=>{});var Iu,Kh=z(()=>{Iu=null});var Zh,Jh=z(()=>{Zh=[]});var Bu,Pu=z(()=>{Bu="1.0.0-beta.92"});var Xh,eg=z(()=>{Xh="1.0.0-beta.13"});function bi(n,e){return e!==void 0&&(Re(e)?e.forEach(i=>n.add(i)):n.add(e)),n}function ga(n,e,i){n.has(e)?n.get(e).add(i):n.set(e,new Set([i]))}function tg(n,e){return n&&Mt(n,e)?n[e]:void 0}function hn(n){return n!==null&&typeof n=="object"&&n.constructor===Object}function tr(n){return qD.call(n)==="[object RegExp]"}function Pn(n){return n&&(Re(n)||Mt(n,"length")&&isFinite(n.length))}function Re(n){return Array.isArray(n)||ArrayBuffer.isView(n)}function Sr(n,e=0){let i=parseInt(n,10);return isNaN(i)?e:i}function Vt(n){if(Re(n))return n.length>0;if(hn(n)){for(let e in n)if(Mt(n,e))return!0;return!1}return!!n}var Mt,qD,jn=z(()=>{Mt=Object.hasOwn||((n,e)=>Object.hasOwnProperty.call(n,e)),qD=Object.prototype.toString});function ju(){this.yy={}}var _D,WD,ma,ng=z(()=>{_D=function(){return{yy:{},options:{ranges:!0},rules:[/^(?:\/\/.*?(?:\n|\r\n?|\u2028|\u2029|$)|\/\*(?:.|\s)*?(?:\*\/|$))/,/^\s+/,/^\//,/^<(?!=)/,/^/,/^(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*\(?)/,/^/,(e,i)=>{if(e[0]!==(i==="template"?"}":"`"))return null;for(let o=1;o<e.length;o++){if(e[o]==="`")return o+1;if(e[o]==="$"&&e[o+1]==="{")return o+2;e[o]==="\\"&&o++}return null},(e,i)=>{if(e[0]!==(i==="template"?"}":"`"))return null;for(let o=1;o<e.length;o++){if(e[o]==="`")return o+1;if(e[o]==="$"&&e[o+1]==="{")return o+2;e[o]==="\\"&&o++}return null},/^/,/^\(/,/^\)/,/^\[/,/^\]/,/^\{/,/^\}/,/^(?:(true|false|null|undefined|Infinity|NaN)\b)/,/^and\b/,/^or\b/,/^is\b/,/^has\s+no\b/,/^has\b/,/^in\b/,/^not\s+in\b/,/^not\b/,/^no\b/,/^(?:(asc|desc)(NA?|AN?)?\b)/,/^(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*\()/,/^(?:\$(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*\()/,/^(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*)/,/^(?:\$(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*)/,/^(?:[_\d]*\.)?[_\d]+(?:[eE][-+]?[_\d]+)?\b/,/^(?:\d*\.)?\d+(?:[eE][-+]?\d+)?\b/,/^0[xX][_0-9a-fA-F]+/,/^0[xX][0-9a-fA-F]+/,/^(?:"(?:\\[\\"]|[^"])*")/,/^(?:'(?:\\[\\']|[^'])*')/,/^(?:\/(?:\\.|[^/])+\/[gimsu]*)/,/^@/,/^#/,/^\$\$/,/^\$/,/^=>/,/^=/,/^!=/,/^~=/,/^>=/,/^<=/,/^</,/^>/,/^\.\.\(/,/^\.\(/,/^\.\[/,/^\.\.\./,/^\.\./,/^\./,/^\?\?/,/^\?/,/^,/,/^:/,/^;/,/^\-/,/^\+/,/^\*/,/^\//,/^\%/,/^(?:\|)/,/^./,/^$/],conditions:{preventPrimitive:{rules:[0,1,2,3,4,7,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],inclusive:!0},preventKeyword:{rules:[5,6],inclusive:!1},template:{rules:[8,9],inclusive:!1},INITIAL:{rules:[0,1,7,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],inclusive:!0}},performAction(e,i,o,l){let c=l;switch(o){case 0:{e.commentRanges.push(i.yylloc.range);break}case 1:break;case 2:{return this.popState(),40;break}case 3:{return this.popState(),44;break}case 4:{this.done=!1,this.popState();break}case 5:{if(this.popState(),i.yytext.endsWith("(")){this.unput(i.yytext);return}return e.pps(),i.yytext=this.ident(i.yytext),14;break}case 6:{this.done=!1,this.popState();break}case 7:{let f=i.yytext.endsWith("`")?"TEMPLATE":"TPL_START";return i.yytext=this.toStringLiteral(i.yytext,!0,1+ +(f!=="TEMPLATE")),f==="TEMPLATE"&&e.pps(),f;break}case 8:{let f=i.yytext.endsWith("`")?"TPL_END":"TPL_CONTINUE";return i.yytext=this.toStringLiteral(i.yytext,!0,1+ +(f!=="TPL_END")),this.popState(),f==="TPL_END"&&e.pps(),f;break}case 9:{this.parseError("Unexpected end of input");break}case 10:return 21;case 11:{return e.pps(),22;break}case 12:return 61;case 13:{return e.pps(),63;break}case 14:return 84;case 15:{if(this.bracketStack[this.bracketStack.length-1]!=="TPL_END")return e.pps(),85;this.unput("}"),this.begin("template");break}case 16:{return i.yytext=this.toLiteral(i.yytext),57;break}case 17:return 36;case 18:return 37;case 19:return 30;case 20:return 35;case 21:return 33;case 22:return 32;case 23:return 34;case 24:return 25;case 25:return 26;case 26:return 95;case 27:{return i.yytext=this.ident(i.yytext.slice(0,-1)),70;break}case 28:{return i.yytext=this.ident(i.yytext.slice(1,-1)),72;break}case 29:{return e.pps(),i.yytext=this.ident(i.yytext),14;break}case 30:{return e.pps(),i.yytext=this.ident(i.yytext.slice(1)),15;break}case 31:{return e.pps(),i.yytext=this.toNumberLiteral(i.yytext,!0),55;break}case 32:{return e.pps(),i.yytext=this.toNumberLiteral(i.yytext),55;break}case 33:{return e.pps(),i.yytext=this.toNumberLiteral(i.yytext,!0,!0),55;break}case 34:{return e.pps(),i.yytext=this.toNumberLiteral(i.yytext,!1,!0),55;break}case 35:{return e.pps(),i.yytext=this.toStringLiteral(i.yytext),54;break}case 36:{return e.pps(),i.yytext=this.toStringLiteral(i.yytext),54;break}case 37:{return e.pps(),i.yytext=this.toRegExp(i.yytext),56;break}case 38:{return e.pps(),51;break}case 39:{return e.pps(),52;break}case 40:{return e.pps(),53;break}case 41:{return e.pps(),9;break}case 42:return 20;case 43:return 42;case 44:return 43;case 45:return 48;case 46:return 47;case 47:return 45;case 48:return 44;case 49:return 46;case 50:return 69;case 51:return 66;case 52:return 67;case 53:return 89;case 54:{return e.pps(),e.pks(),68;break}case 55:{return e.pps(),e.pks(),65;break}case 56:return 38;case 57:return 17;case 58:return 73;case 59:return 11;case 60:return 10;case 61:return 27;case 62:return 28;case 63:return 39;case 64:return 40;case 65:return 41;case 66:return 29;case 67:{this.parseError(`Bad input on line ${i.yylloc.first_line} column ${i.yylloc.first_column}
|
|
36
|
+
`+M.replace(/^[\r\n]+/,""):"")),f.progressbar.el.replaceWith(y)}f.disposeEmbed?.(),f.progressbar.dispose(),g&&g.remove()})}function PD(){let{push:n}=window.discoveryLoader||{};typeof n=="function"&&(window.discoveryLoader.push=function(e,i,o){o?e=i?Lu(e).slice():new TextDecoder().decode(Lu(e)):i&&(e=Mu(e)),n(e)})}function jD(){let n=document.createElement("div");return n.className="data-status",n.innerHTML='<div class="header">Getting data: <span class="elapsed-time"></span></div><div class="output"></div>',n.firstChild.addEventListener("click",function(){n.classList.toggle("collapsed")},!0),n.elapsedTimeEl=n.querySelector(":scope > .header > .elapsed-time"),n}function zD(n,e){let i=!1,o=!0,l=!1,c=jD(),f=()=>{n.progressbar.value.stage==="request"&&!c.parentNode&&n.progressbar.el.getRootNode().append(c)},d=setTimeout(()=>{if(n.progressbar.value.stage!=="request")return;n.progressbar.subscribe(({stage:N},A)=>{N!=="request"&&(A(),c.classList.add("finished"),g.close(),o=!1)});let g=new EventSource("data-status?data-request-id="+e),m=null,y,k,C,M,E,F=N=>{if(!(!o||!isFinite(N)||k!==void 0&&N<=k)){if(clearTimeout(C),k=Number(N),y&&k-y>=1e3&&(c.elapsedTimeEl.textContent=Fu(k-y,i?1:0)),m)for(let{started:A,elapsedTimeEl:b}of m.values())A&&(b.textContent=Fu(k-A,1));M=Date.now(),C=setTimeout(()=>F(k+(Date.now()-M)-5),42)}};g.addEventListener("message",N=>{try{let A=JSON.parse(N.data);switch(A.type){case"start":setTimeout(f,3e3),y=A.timestamp,l=!0;break;case"finish":break;case"crash":if(i=!0,f(),m)for(let{started:b,el:L}of m.values())b&&(L.classList.add("crashed"),L.classList.remove("started"),L.classList.toggle("collapsed",L!==E));break;case"stderr":case"stdout":{let b=document.createElement("div");if(b.className=A.type,b.append(String(A.chunk)),!m)f(),c.lastChild.append(b),Tu(b);else{let L=m.get(A.stepId);L&&(L.contentEl.append(b),L.el.classList.add("has-output"),Tu(b),A.type=="stderr"&&(E=L.el))}break}case"plan":{let b=Vh(A.plan.steps);m=b.map,c.lastChild.innerHTML="",c.lastChild.appendChild(b.el),m&&f();break}case"plan-step-event":{let b=m.get(A.stepId);if(b)switch(A.stepEvent){case"start":b.started=A.timestamp,b.el.classList.add("started"),Tu(b.el);break;case"finish":b.elapsedTimeEl.textContent=Fu(A.timestamp-b.started),b.started=!1,b.el.classList.remove("started"),b.el.classList.add("finished");break;case"summary":b.summaryEl.innerHTML=HD(A.data);break;default:console.warn("Unhandled data status SSE pipeline step event",A)}else console.warn("Pipeline step not found",A);break}default:console.warn("Unhandled data status SSE event",A)}F(A.timestamp)}catch(A){console.error("SSE message parse error",A)}}),g.addEventListener("server-time",({data:N})=>{F(N)}),g.addEventListener("done",()=>{g.close(),o=!1})},150);n.then(()=>clearTimeout(d),g=>{if(o=!1,!!l){i?(g.supressLoadDataError=!0,n.el.classList.add("generate-data-crash")):c.classList.add("compliment-error","collapsed");for(let m of c.querySelectorAll(".plan-step.started"))m.classList.remove("started");c.classList.add("crashed"),c.firstChild.firstChild.textContent="Retrieving data failed "+(c.elapsedTimeEl.textContent?"in ":"")}})}function Tu(n){try{typeof n.scrollIntoViewIfNeeded=="function"?n.scrollIntoViewIfNeeded(!1):n.scrollIntoView({block:"nearest"})}catch{}}function Vh(n,e=0,i=new Map){let o=document.createElement("ul");o.className="plan-step-list",o.style.setProperty("--level",e);for(let l of n){let c=o.appendChild(document.createElement("li")),f=c.appendChild(document.createElement("div")),d=f.appendChild(document.createElement("span")),g=f.appendChild(document.createElement("span")),m=f.appendChild(document.createElement("span")),y=f.appendChild(document.createElement("span")),k=f.appendChild(document.createElement("span")),C=c.appendChild(document.createElement("div"));i.set(l.id,{step:l,el:c,elapsedTimeEl:k,summaryEl:y,contentEl:C,started:!1}),c.className="plan-step collapsed",f.className="plan-step__header",f.addEventListener("click",()=>c.classList.toggle("collapsed")),d.className="plan-step__header-toggle",g.className="plan-step__header-status",m.className="plan-step__header-content",m.textContent=l.name||"Untitled",y.className="plan-step__header-summary",k.className="plan-step__elapsed-time",C.className="plan-step__content",l.steps&&c.append(Vh(l.steps,e+1,i).el)}return{el:o,map:i.size?i:null}}function RD(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function HD(n,e=!0){let i=e&&typeof n!="number"?RD(String(n)):String(n);return i.length>3?i.replace(/\.\d+(eE[-+]?\d+)?|\B(?=(\d{3})+(\D|$))/g,o=>o||'<span class="num-delim"></span>'):i}function Fu(n,e=1){return n<1e3?n+"ms":n<1e4?(n/1e3).toFixed(e)+"s":n<6e4?Math.round(n/1e3)+"s":`${Math.floor(n/6e4)}:${String(Math.floor(n/1e3)%60).padStart(2,"0")}`}var ha,Nu,Ou=z(()=>{qh();Uh();ha=({darkmode:n,darkmodePersistent:e,colorScheme:i=n,colorSchemePersistent:o=e})=>pa.colorScheme?{colorScheme:i,colorSchemePersistent:o}:{darkmode:i,darkmodePersistent:o},Nu=n=>document.querySelector(`style[type="discovery/style"][src=${JSON.stringify(n)}]`).firstChild.nodeValue});function Yh(n){let e=[].filter(i=>{if(typeof i=="function")return!0;console.warn('[discovery-cli] "prepare" module should return a function, but got '+typeof i)});e.length&&n.setPrepare(async(i,...o)=>{for(let l of e)i=await l(i,...o)||i;return i})}var Qh=z(()=>{});var Iu,Kh=z(()=>{Iu=null});var Zh,Jh=z(()=>{Zh=[]});var Bu,Pu=z(()=>{Bu="1.0.0-beta.92"});var Xh,eg=z(()=>{Xh="1.0.0-beta.13"});function bi(n,e){return e!==void 0&&(Re(e)?e.forEach(i=>n.add(i)):n.add(e)),n}function ga(n,e,i){n.has(e)?n.get(e).add(i):n.set(e,new Set([i]))}function tg(n,e){return n&&Mt(n,e)?n[e]:void 0}function hn(n){return n!==null&&typeof n=="object"&&n.constructor===Object}function tr(n){return qD.call(n)==="[object RegExp]"}function Pn(n){return n&&(Re(n)||Mt(n,"length")&&isFinite(n.length))}function Re(n){return Array.isArray(n)||ArrayBuffer.isView(n)}function Sr(n,e=0){let i=parseInt(n,10);return isNaN(i)?e:i}function Vt(n){if(Re(n))return n.length>0;if(hn(n)){for(let e in n)if(Mt(n,e))return!0;return!1}return!!n}var Mt,qD,jn=z(()=>{Mt=Object.hasOwn||((n,e)=>Object.hasOwnProperty.call(n,e)),qD=Object.prototype.toString});function ju(){this.yy={}}var _D,WD,ma,ng=z(()=>{_D=(function(){return{yy:{},options:{ranges:!0},rules:[/^(?:\/\/.*?(?:\n|\r\n?|\u2028|\u2029|$)|\/\*(?:.|\s)*?(?:\*\/|$))/,/^\s+/,/^\//,/^<(?!=)/,/^/,/^(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*\(?)/,/^/,(e,i)=>{if(e[0]!==(i==="template"?"}":"`"))return null;for(let o=1;o<e.length;o++){if(e[o]==="`")return o+1;if(e[o]==="$"&&e[o+1]==="{")return o+2;e[o]==="\\"&&o++}return null},(e,i)=>{if(e[0]!==(i==="template"?"}":"`"))return null;for(let o=1;o<e.length;o++){if(e[o]==="`")return o+1;if(e[o]==="$"&&e[o+1]==="{")return o+2;e[o]==="\\"&&o++}return null},/^/,/^\(/,/^\)/,/^\[/,/^\]/,/^\{/,/^\}/,/^(?:(true|false|null|undefined|Infinity|NaN)\b)/,/^and\b/,/^or\b/,/^is\b/,/^has\s+no\b/,/^has\b/,/^in\b/,/^not\s+in\b/,/^not\b/,/^no\b/,/^(?:(asc|desc)(NA?|AN?)?\b)/,/^(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*\()/,/^(?:\$(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*\()/,/^(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*)/,/^(?:\$(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*)/,/^(?:[_\d]*\.)?[_\d]+(?:[eE][-+]?[_\d]+)?\b/,/^(?:\d*\.)?\d+(?:[eE][-+]?\d+)?\b/,/^0[xX][_0-9a-fA-F]+/,/^0[xX][0-9a-fA-F]+/,/^(?:"(?:\\[\\"]|[^"])*")/,/^(?:'(?:\\[\\']|[^'])*')/,/^(?:\/(?:\\.|[^/])+\/[gimsu]*)/,/^@/,/^#/,/^\$\$/,/^\$/,/^=>/,/^=/,/^!=/,/^~=/,/^>=/,/^<=/,/^</,/^>/,/^\.\.\(/,/^\.\(/,/^\.\[/,/^\.\.\./,/^\.\./,/^\./,/^\?\?/,/^\?/,/^,/,/^:/,/^;/,/^\-/,/^\+/,/^\*/,/^\//,/^\%/,/^(?:\|)/,/^./,/^$/],conditions:{preventPrimitive:{rules:[0,1,2,3,4,7,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],inclusive:!0},preventKeyword:{rules:[5,6],inclusive:!1},template:{rules:[8,9],inclusive:!1},INITIAL:{rules:[0,1,7,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],inclusive:!0}},performAction(e,i,o,l){let c=l;switch(o){case 0:{e.commentRanges.push(i.yylloc.range);break}case 1:break;case 2:{return this.popState(),40;break}case 3:{return this.popState(),44;break}case 4:{this.done=!1,this.popState();break}case 5:{if(this.popState(),i.yytext.endsWith("(")){this.unput(i.yytext);return}return e.pps(),i.yytext=this.ident(i.yytext),14;break}case 6:{this.done=!1,this.popState();break}case 7:{let f=i.yytext.endsWith("`")?"TEMPLATE":"TPL_START";return i.yytext=this.toStringLiteral(i.yytext,!0,1+ +(f!=="TEMPLATE")),f==="TEMPLATE"&&e.pps(),f;break}case 8:{let f=i.yytext.endsWith("`")?"TPL_END":"TPL_CONTINUE";return i.yytext=this.toStringLiteral(i.yytext,!0,1+ +(f!=="TPL_END")),this.popState(),f==="TPL_END"&&e.pps(),f;break}case 9:{this.parseError("Unexpected end of input");break}case 10:return 21;case 11:{return e.pps(),22;break}case 12:return 61;case 13:{return e.pps(),63;break}case 14:return 84;case 15:{if(this.bracketStack[this.bracketStack.length-1]!=="TPL_END")return e.pps(),85;this.unput("}"),this.begin("template");break}case 16:{return i.yytext=this.toLiteral(i.yytext),57;break}case 17:return 36;case 18:return 37;case 19:return 30;case 20:return 35;case 21:return 33;case 22:return 32;case 23:return 34;case 24:return 25;case 25:return 26;case 26:return 95;case 27:{return i.yytext=this.ident(i.yytext.slice(0,-1)),70;break}case 28:{return i.yytext=this.ident(i.yytext.slice(1,-1)),72;break}case 29:{return e.pps(),i.yytext=this.ident(i.yytext),14;break}case 30:{return e.pps(),i.yytext=this.ident(i.yytext.slice(1)),15;break}case 31:{return e.pps(),i.yytext=this.toNumberLiteral(i.yytext,!0),55;break}case 32:{return e.pps(),i.yytext=this.toNumberLiteral(i.yytext),55;break}case 33:{return e.pps(),i.yytext=this.toNumberLiteral(i.yytext,!0,!0),55;break}case 34:{return e.pps(),i.yytext=this.toNumberLiteral(i.yytext,!1,!0),55;break}case 35:{return e.pps(),i.yytext=this.toStringLiteral(i.yytext),54;break}case 36:{return e.pps(),i.yytext=this.toStringLiteral(i.yytext),54;break}case 37:{return e.pps(),i.yytext=this.toRegExp(i.yytext),56;break}case 38:{return e.pps(),51;break}case 39:{return e.pps(),52;break}case 40:{return e.pps(),53;break}case 41:{return e.pps(),9;break}case 42:return 20;case 43:return 42;case 44:return 43;case 45:return 48;case 46:return 47;case 47:return 45;case 48:return 44;case 49:return 46;case 50:return 69;case 51:return 66;case 52:return 67;case 53:return 89;case 54:{return e.pps(),e.pks(),68;break}case 55:{return e.pps(),e.pks(),65;break}case 56:return 38;case 57:return 17;case 58:return 73;case 59:return 11;case 60:return 10;case 61:return 27;case 62:return 28;case 63:return 39;case 64:return 40;case 65:return 41;case 66:return 29;case 67:{this.parseError(`Bad input on line ${i.yylloc.first_line} column ${i.yylloc.first_column}
|
|
37
37
|
`+this.showPosition(),{text:i.yytext,token:"BAD_TOKEN"});break}case 68:return 5}},setInput(e,i){return this.yy=i||this.yy||{},this._input=e,this._more=!1,this._backtrack=!1,this.done=!1,this.currentCondition="INITIAL",this.conditionStack=["INITIAL"],this.offset=0,this.yytext=this.match="",this.yyleng=0,this.yylineno=0,this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.yylloc.range=[0,0],this},parseError(e,i){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,i)},input(){let e=this._input[this.offset],i=/\n|\r\n?|\u2028|\u2029/g.test(e);return this.offset++,this.yyleng++,this.yytext=this.match=this.yytext+e,i?(this.yylineno++,this.yylloc.last_line++,this.yylloc.last_column=0):this.yylloc.last_column++,this.yylloc.range[1]++,e},lineColumnForOffset(e=this.offset,i=this._input,o=1,l=0){let c=/\n|\r\n?|\u2028|\u2029/g,f=o,d=l,g=0,m;for(;(m=c.exec(i))!==null;)if(m.index<e)f++,d=0,g=m.index+m[0].length;else{d+=e-g,g=-1;break}return g!==-1&&(d+=e-g),{line:f,column:d}},setMatch(e,i){let o=this._input.slice(e,i),l=e!==this.offset?this.lineColumnForOffset(e):{line:this.yylloc.last_line,column:this.yylloc.last_column},c=e!==i?this.lineColumnForOffset(i-e,o,l.line,l.column):l;this.yytext=this.match=o,this.yyleng=i-e,this.offset=i,this.yylineno=c.line-1,this.yylloc={first_line:l.line,first_column:l.column,last_line:c.line,last_column:c.column},this.yylloc.range=[e,i]},less(e){let i=this.offset-this.match.length;this.setMatch(i,i+e)},unput(e){let i=this.match.length-e.length;if(!this.match.startsWith(e,i))throw new Error("Lexer#unput() should receive a part of matched text only");this.less(i)},more(){this._more=!0},reject(){throw new Error("reject() is allowed only when options.backtrack_lexer = true")},showPosition(e=this.offset-this.match.length){let i=this._input,o=Math.max(e-20,0),l=Math.min(e+20,i.length),c=(o===0?"":"...")+i.slice(o,e).replace(/\n|\r\n?|\u2028|\u2029/g,"\\n"),f=i.slice(e,l).replace(/\n|\r\n?|\u2028|\u2029/g,"\\n")+(l===i.length?"":"...");return c+f+`
|
|
38
38
|
${"-".repeat(c.length)}^`},test_match(e,i){let o;this._more=!1,this._backtrack=!1,this.setMatch(this.offset,this.offset+e[0].length),this.matches=e;let l=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]);return!l&&this._backtrack?(Object.assign(this,o),!1):(this.eof()||(this.done=!1),typeof l=="number"&&this.yy.parser?this.yy.parser.terminals_[l]:l||!1)},eof(){return this.offset===this._input.length},next(){if(this.done)return 1;this.eof()&&(this.done=!0),this._more||(this.yytext="",this.match="");let e,i;for(let o of this.conditions[this.currentCondition].rules){let l=this.rules[o],c=this._input.slice(this.offset),f;if(typeof l=="function"){let d=l(c,this.currentCondition);switch(typeof d){case"string":f=[d];break;case"number":f=[c.slice(0,d)];break;default:f=d}}else f=c.match(l);if(f&&(!e||f[0].length>e[0].length)){e=f,i=o;break}}if(e)return this.test_match(e,i);if(this.eof())return 1;this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
39
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex(){let e;for(;!e;)e=this.next();return e},begin(e){this.currentCondition=e,this.conditionStack.push(e)},pushState(e){this.begin(e)},popState(){return this.conditionStack.pop(),this.currentCondition=this.conditionStack.length?this.conditionStack[this.conditionStack.length-1]:"INITIAL"},topState(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},stateStackSize(){return this.conditionStack.length}}}();ju.prototype={Parser:ju,lexer:_D,symbols_:{error:2,root:3,block:4,EOF:5,definitions:6,e:7,def:8,$:9,";":10,":":11,$ident:12,ident:13,IDENT:14,$IDENT:15,condConsequent:16,"?":17,condAlternate:18,query:19,"=>":20,"(":21,")":22,functionArgs:23,compareFunction:24,NOT:25,NO:26,"-":27,"+":28,"|":29,IS:30,assertion:31,IN:32,HAS:33,NOTIN:34,HASNO:35,AND:36,OR:37,"??":38,"*":39,"/":40,"%":41,"=":42,"!=":43,"<":44,"<=":45,">":46,">=":47,"~=":48,queryRoot:49,relativePath:50,"@":51,"#":52,$$:53,STRING:54,NUMBER:55,REGEXP:56,LITERAL:57,template:58,object:59,array:60,"[":61,sliceNotation:62,"]":63,"method()":64,".":65,".(":66,".[":67,"..":68,"..(":69,"METHOD(":70,arguments:71,"$METHOD(":72,",":73,functionArg:74,templateString:75,templateStart:76,templateTail:77,templateEnd:78,templateContinue:79,TEMPLATE:80,TPL_START:81,TPL_CONTINUE:82,TPL_END:83,"{":84,"}":85,objectEntries:86,objectEntry:87,objectEntryKeyLiteral:88,"...":89,arrayElements:90,arrayElement:91,assertionTerm:92,assertionList:93,compareExpr:94,ORDER:95,sliceNotationComponent:96,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",9:"$",10:";",11:":",14:"IDENT",15:"$IDENT",17:"?",20:"=>",21:"(",22:")",25:"NOT",26:"NO",27:"-",28:"+",29:"|",30:"IS",32:"IN",33:"HAS",34:"NOTIN",35:"HASNO",36:"AND",37:"OR",38:"??",39:"*",40:"/",41:"%",42:"=",43:"!=",44:"<",45:"<=",46:">",47:">=",48:"~=",51:"@",52:"#",53:"$$",54:"STRING",55:"NUMBER",56:"REGEXP",57:"LITERAL",61:"[",63:"]",65:".",66:".(",67:".[",68:"..",69:"..(",70:"METHOD(",72:"$METHOD(",73:",",80:"TEMPLATE",81:"TPL_START",82:"TPL_CONTINUE",83:"TPL_END",84:"{",85:"}",89:"...",95:"ORDER"},productions_:[0,[3,2],[4,2],[4,1],[4,1],[4,0],[6,1],[6,2],[8,2],[8,4],[8,2],[8,4],[13,1],[12,1],[16,2],[16,1],[18,2],[18,1],[18,0],[7,1],[7,2],[7,3],[7,4],[7,5],[7,1],[7,2],[7,2],[7,2],[7,2],[7,3],[7,4],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[19,1],[19,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,3],[49,2],[49,2],[49,1],[49,1],[49,3],[49,4],[49,2],[49,2],[49,3],[49,3],[49,2],[49,2],[49,3],[49,2],[49,3],[50,3],[50,4],[50,4],[50,3],[50,3],[50,4],[50,4],[50,3],[50,3],[50,4],[64,2],[64,3],[64,2],[64,3],[71,1],[71,3],[74,1],[23,1],[23,3],[58,1],[58,2],[77,1],[77,2],[77,2],[77,3],[75,1],[76,1],[79,1],[78,1],[59,2],[59,3],[59,4],[59,3],[59,4],[59,5],[86,1],[86,3],[88,1],[88,1],[88,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,3],[87,3],[87,3],[87,2],[87,2],[87,2],[87,5],[87,1],[87,2],[90,1],[90,3],[91,1],[91,1],[91,2],[60,2],[60,3],[60,4],[31,1],[31,2],[31,3],[31,4],[92,1],[92,1],[92,1],[92,1],[93,1],[93,3],[93,3],[24,1],[24,3],[94,2],[62,1],[62,2],[62,2],[62,3],[96,1],[96,2]],table:function(e){function i(C){let M=C.match(/[\x20-\x2f]/g),E=M?Math.max(...M.map(F=>F.charCodeAt()-32)):-1;for(let F=E;F>=0;F--){let N=(32+F).toString(16),A;C=C.replace(new RegExp("\\[\\x"+N+"(.+?)\\]"),(b,L)=>A=L).replace(new RegExp("\\x"+N,"g"),A)}return C=C.replace(/<([^>]+?)>/g,(F,N)=>{let A=c[N[0]],b=1;return A>>5===1&&(A=A&31|c[N[1]]<<5,b=2),N.slice(b).repeat(A)}),C}function o(C){let M=[];for(let E=0;E<C.length;E++){let F=c[C[E]];if(F&32){let N=c[C[++E]];M.push(F&31|N<<5)}else M.push(F)}return M}let c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~|=".split("").reduce((C,M,E)=>(C[M]=E,C),Object.create(null)),[f,d,...g]=e.split("=").map(i),m=d.split(";").map(C=>{let M=[];for(let E=0;E<C.length;E++)for(let F=0,N=c[C[E]];F<3;F++)M.push(N>>F*2&3);return M}),y=g.map(o),k=o(f).map(C=>{let M=m[C],E=Object.create(null);for(let F=0;F<M.length;F++){let N=M[F];if(N!==0){let A=y[N-1].shift();E[F]=N===1?A:[N-1,A]}}return E});for(let C=0;C<y[3].length;C+=2)k[y[3][C]][y[3][C+1]]=[3];return k}(`ABCDEFGHIJKHHHHLL<NM>NOPMMQRSQRTMUVWXYYMZaEFTO<TH>PMbQRSQRcMMHdefgBhBiBHj[ BjBkBk]BFHFHlBMmBnBoBpBqBrBMMsBtBMMMMXMWMMuB[!lBMMuB]vBgBMMwBUMZMxByBzB0B1B2B3B4BH5<DB6>BvBXe7BXevBgBM<E8B>9B~ <DB|>BgCgC<EhC>gCMMiC<C!>cHdjCMfMkClClCMMmCnCnBoCpCMtBqCrCvBMMMvBMUMMsCMxBHtCHtCtCHuCvCTXHXvB<FM>cHhBhBMFFMpBpCnCqCMOOMMzBzB2BMsCwCtCtCxC7BcMrCrCHMHtCtC=A1[ V[!C["lmkCpqC]]]<FA>[#[$[%[&['UqqWJkq]K]C][([)FgCCAAE];]]A];Ag;AwU[*ClmkOpqC]<FA>[+[,U[-qqWJnqK]]C(A]wAA[.A[/kAMAqi]]<Fq>CAAAAD<JA>g;AwADwzwP8|D<GA>||DMz|PDAwDPw;AwA8AwAMA|z<F|>DAAAIjqCMAA8MAAw;AAE!<FA>#wA8AwgMA|z<F|>DAAAMz|DMAA8MAAw;AAVClmkapqC<FA>&S(AwA8AwAMA|z<F|>DAAAMz|DIAA8MAAw;AwAoAwAMA|z<F|>DAAAMz|DMAA8MAAw;AwA8AwAMA|z<F|>DAAAMz|DMAA8MAAw;AAEi"<FA>UqqWZmqKCFgCCgFEB;AAAChCACIAE<IA>C<KA>Q;AwAsAwBMA|z<F|>DAAAMz|DMAA8MAAw;AAAAk<QA>EAIC;AEV*<FA>#E <FA>+A <FA>#AE!<FA>%VlqCAAE;AARClC<MA>KCIEAICAAAYl;AwE~lmkOp6y<F|>X-OFg~OAA0;AwA|wzwP8|z<F|>D||DMz|PPAw|PAAw;AAEClmkKpqC<FA>'aC(AAADwzwD8|D<GA>||DMw|PDAw|D;M;AAEi"<FA>UqqWZmqKC)B;AwA8.<Fq>CAAAMz|DMAA8MAA<Cg;AAAAAA>AI<QA>I;<FA>kAIAqi<Fq>C<OA>g;AAU!<FA>$<HA>M<QA>M;AAA8AwgMA|z<F|>DAAAMw|DM<GA>w;AwA8A0AMA6jq|qqqCAAAMz|DMAA8MAAw;AwA8A0AMA|z||q||DAAAMz|DMAA8MAAw<C;AAAAAAAAAAAAAAAAAAAAAC>AAI;AAAg<RA>D<KA>B;AAAgAkAAAqi<Fq>CAAAADAAM<GA>gB;<VA>DAAM;AAEy"<FA>+AE!<FA>,O(AAAChCACA<KA>C<KA>Q;AAAChCACIAE<IA>C<KA>QB;<HA>I;AwA8AkAMA6i<Fq>CAAAMz|DMAA8MAAw;<FA>kAAAqi<Fq>C<JA>FoAAAg;<YA>IAAAI;AAQClC<MA>KCIEAICAAAYl;<YA>MAAAM;AAAo<UA>MAAAM;AAEq"<FA>&OFgCOAAE;AAEi"<FA>&OFgCOAAE;AAE!<FA>&OFgCOAAE;AAAg<UA>MAAAM;AAAClmECAgC<FA>&OFgCO;AAAw<UA>MAAAM;<FA>/<Fq>C<HA>M<GA>g;AwA8A0AMA6z||qqqCAAAMz|DMAA8MAAw;AwA8A0AMA6jqvqqqCAAAMz|DMAA8MAAw;AwA8A0AMA6jquqqqCAAAMz|DMAA8MAAw;AwA8A0AMA|z<F|>DAAAMz|DMAA8MAAw;AwA8A0AMA6z||qvqDAAAMz|DMAA8MAAw;AwA8A0AMA6z||q||DAAAMz|DMAA8MAAw;AAAgAkAAAqi<Fq><CCAAAA><FA>gB;<FA>C<SA>Q;<FA>kAAAqi<Fq>C<OA>g;AAAIAkAAAqi<Fq>C<OA>g;AAE!<FA>UqqWJmqKCFgCCgEE;<VA>D;AAAwAkAAAqi<Fq>CAAAAD<JA>g;<FA>kAAAqi<Fq>CAAAADAAM<GA>g;<HA>IAAAAK;<HA>MAAAAP;AAAClC<MA>KCIEAICAAAIl;<FA>kAAAqi<Fq>C<HA>MAAAMAAg;<FA>kAAAqi<Fq><CCAAAA><FA>g;<UA>IgqCMAAAM;AAAIAkAAAqi<Fq>C<HA>MAAAMAAg;AAAg=BC[ D[!E["[#F[$QhBgBG]][%[&['[(KRSbcd]iB]pBqB]T]]]]zB[)0B$%qC]y[*C[[,+[-0ChBgB]]G%]]5C4C#3C'6CpBqBT9*~*|*gD+pD-G(lD[.iBpBqB]nDqDToDzDtDuD2D4D5D6D 7D 8D9D~D gE|D"jE-G&hEiEkETpEF[/sEtEuE]oEqEvE1E+4E-G'3EpBqBT4E-G'6EpBqBTqC8E7!zD9EuD~E+|E+gF+hF+iF+jF+kF+lF+mF+nF+oF+pF+qF+rF+sF+tF+uF+vF+wF+xFzF-G(0F.ToD1F2F3F 4F 5F6F7F qC8F+qChG0B$%jG-G&iG<EqC>kG+lG+pGqCqGrG+sG+zDtGzDwGuDvGxG+qC1G)2G3GjE-G&4GiEkET0B/8GqEvE~G+gH+hH+jH,kHRSbcd.qCqCqCpH0B$%<UqC>qGqCvH+xH<EqC>4H-G&3HT5HqCqCzDwGuD6HqCqCjE-G&~HiEkETiItEuEgIvElI+qCmI+qCqCnI+qC5C4C"pI+qCqCqI+qCzDsIuDzDtIuD~G+iItEuEgIvE<FqC>xI+yI+qCqC=[ [!["P[#[$[%[&['tBIsBHJ]LMNO][(oB[)fUVWXYZae]]][*jBkBlBmBnBuBvBwBxB]]r]]B]y][+B[,![-[.sB|B~B][/1B2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC]]]rC]sCtCuCvCwCxCzC#B1CPtB7CsBHJ2CLMNO(*rB8C<EzC#B>hDiDjDkDzCrD%mD*rBsDyDxD1DwDvD0D3D<CtBuBvB!!>zC$mElErBrEtB1DyEzE0EwEuBvBnExEzC&)*rBzC'2ELMNO(*rBzC'5ELMNO(*rB-rC DxD1DwDvD0D<TzC#B>3DzCrD%yF*rBtBuBv<CB">BtBuBv+zC#B9F~F|FsBgG|B~B/rC!1CzC#B<C|B~B3B4B5B6BgChCiCjCkClCmCnCoCpC><CgChCiC><CzC#B>mGnGoGrDrD-rC<CzC#B>yDxD1DuG0DyDxD1DwDvD0DzC&)*rByGzG0G.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC,mElErCzC$mElErB6G5GrEtB1DyEzE0EwEuBvB7GxEhDiDzCjD9G#BzC|G#BzC#BiHzC#BzCtB1DsBlH(*rB.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpCmHnH-rCoHnH.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC!<E|B~BgChCiCjCkClCmCnCoCpC>|B~B3B4B5B6B9BgChCiCjCkClCmCnCoCpC|B~B3B4B5B6B7B9BgChCiCjCkClCmCnCoCpC|B~B3B4B5B6BgChCiCjCkClCmCnCoCp<CCgChCi><CC|B~BgChCiClCmCnCo><FC|B~BgChCi>ClCmCnCoCrD-qHrCrHsHtHuH-rCzC#BwHyHsBzH|B~B/rC-rC0H-rC1H-rCzC%2H*rBsDrD<C-rC>yDxD1DwDvD0D7H8H9H<C.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC>zC$mElErBhItB1DyEzE0EwEuBvB|HxEkIjI<CzC#B-rC>-rCzC#B-oIrCsCtCuCvCwCxC!zC#B.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC-rCzC#B-rCrI8H9H<CyDxD1DwDvD0D>zCuI#BhItB1DyEzE0EwEuBvBvIxE1H<D-rC>wI<C-rC><CzC#B><C-rC>=FDDDEEE<jBG><gBT><mBN><lBY><kB4B><kB6B><mB0B><mB1B><mB7E><mB2B><mB3B><mB5B><mB7B><mB8B><mB9B><mB~B><mB|B><mBgC><mBhC><lBS><mBlC><mBmC>FFF<mBlD><cP><5BM><mBrD><gBsD>BCCC<jBH><lBS><mB9E>FFF<PU><mB4B><mB6B>jDjDNNNiD<bN>iDN<WZ><Wa><jBb><jBc><jBI><jBK><mBtE>~EqEqEoEoEiFiFrErE<mBjC><mBwE><mB0E><mB1E><mB2E><mB3E><5BN><mBkC><cR><mBpC><mBqC><mBtC><mBuC><RwC><mBmD><mBnD><mBuD><gBtD><mBvD>1D1[ D6D6D7D7D]8D8D9D9D~D~DmEmE<D3D><D4D><D5D><RO><5B8C>gDgD<5B~C><Rd><mBf><agB><ahB><aiB><ajB><VkB><UlB><WmB><jBnB><jBoB><mBpB><mBqB><mBrB><dsB><dtB><hBuB><hBvB><hBwB><hBxB><dyB><mBzB><mByC><mB1C><mB2C><mB5C><mB6C><PV><mBnC><mB8E><mBiC><mBuE>|EgFjFjFsEsE<mBxE><D4E><RQ><mBrC><mBsC><mBvC><RxC><mBoD><mBpD><mBwD><mByD>iEiEjEjEkEkEnEnE<5B9C><5B|C><Re><mBzC><mB0C><mB3C><mB4C><mB7C><PW>kDkDiDiD<mBoC><jBJ><jBL><mBvE>pEpEqEqEhF<mByE><mBqD><mBxD>2D2 <mBzD>hEhE|D|DgEgEhDhD<PX><mBzE><D5E><D6E><mB0D>hEhElElE=BB`),defaultActions:{50:[2,1],201:[2,159],249:[2,161]},performAction(n,e,i,o,l,c,f){let d=c.length-1;switch(l){case 1:return o.buildResult(c[d-1]);case 2:this.$={type:"Block",definitions:c[d-1],body:c[d],range:this._$.range};break;case 3:this.$={type:"Block",definitions:c[d],body:{type:"Placeholder",range:[f[d].range[1],f[d].range[1]]},range:this._$.range};break;case 4:this.$={type:"Block",definitions:[],body:c[d],range:this._$.range};break;case 5:this.$={type:"Block",definitions:[],body:{type:"Placeholder",range:[f[d].range[1],f[d].range[1]]},range:this._$.range};break;case 6:case 96:case 99:case 101:case 117:case 136:case 152:case 155:this.$=[c[d]];break;case 7:c[d-1].push(c[d]);break;case 8:this.$={type:"Definition",declarator:{type:"Declarator",name:null,range:f[d-1].range},value:null,range:this._$.range};break;case 9:this.$={type:"Definition",declarator:{type:"Declarator",name:null,range:f[d-3].range},value:c[d-1],range:this._$.range};break;case 10:this.$={type:"Definition",declarator:{type:"Declarator",name:c[d-1].name,range:f[d-1].range},value:null,range:this._$.range};break;case 11:this.$={type:"Definition",declarator:{type:"Declarator",name:c[d-3].name,range:f[d-3].range},value:c[d-1],range:this._$.range};break;case 12:case 13:case 98:case 148:case 149:this.$={type:"Identifier",name:c[d],range:this._$.range};break;case 14:case 16:case 163:this.$=c[d];break;case 15:case 17:this.$={type:"Placeholder",range:[f[d].range[1],f[d].range[1]]};break;case 18:case 162:this.$=null;break;case 19:case 52:case 53:case 64:case 65:case 138:break;case 20:case 22:this.$={type:"Function",arguments:[],body:c[d],range:this._$.range};break;case 21:this.$={type:"Function",arguments:[{type:"Identifier",name:c[d-2]}],body:c[d],range:this._$.range};break;case 23:this.$={type:"Function",arguments:c[d-3],body:c[d],range:this._$.range};break;case 24:this.$={type:"CompareFunction",compares:c[d],range:this._$.range};break;case 25:case 26:case 27:case 28:case 67:this.$={type:"Prefix",operator:c[d-1],argument:c[d],range:this._$.range};break;case 29:this.$={type:"Pipeline",left:c[d-2],right:c[d],range:this._$.range};break;case 30:this.$={type:"Pipeline",left:c[d-3],right:{type:"Block",definitions:c[d-1],body:c[d]},range:this._$.range};break;case 31:this.$={type:"Postfix",operator:c[d],argument:c[d-2],range:this._$.range};break;case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:this.$={type:"Binary",operator:c[d-1],left:c[d-2],right:c[d],range:this._$.range};break;case 51:this.$={type:"Conditional",test:c[d-2],consequent:c[d-1],alternate:c[d],range:this._$.range};break;case 54:this.$={type:"Data",range:this._$.range};break;case 55:this.$={type:"Context",range:this._$.range};break;case 56:this.$={type:"Current",range:this._$.range};break;case 57:this.$={type:"Arg1",range:this._$.range};break;case 58:this.$={type:"Reference",name:c[d],range:this._$.range};break;case 59:case 60:case 61:case 62:case 107:case 108:case 109:case 110:case 119:case 120:case 121:this.$={type:"Literal",value:c[d],range:this._$.range};break;case 63:this.$={type:"Template",values:c[d],range:this._$.range};break;case 66:this.$={type:"SliceNotation",value:null,arguments:c[d-1],range:this._$.range};break;case 68:this.$={type:"Conditional",test:null,consequent:c[d-1],alternate:c[d],range:this._$.range};break;case 69:case 73:this.$={type:"GetProperty",value:null,property:c[d],range:this._$.range};break;case 70:case 74:this.$={type:"MethodCall",value:null,method:c[d],range:this._$.range};break;case 71:this.$={type:"Parentheses",body:c[d-1],range:this._$.range};break;case 72:this.$={type:"Parentheses",body:{type:"Block",definitions:c[d-2],body:c[d-1]},range:this._$.range};break;case 75:this.$={type:"Map",value:null,query:c[d-1],range:this._$.range};break;case 76:this.$={type:"Filter",value:null,query:c[d-1],range:this._$.range};break;case 77:this.$={type:"MapRecursive",value:null,query:{type:"GetProperty",value:null,property:c[d]},range:this._$.range};break;case 78:this.$={type:"MapRecursive",value:null,query:{type:"MethodCall",value:null,method:c[d]},range:this._$.range};break;case 79:this.$={type:"MapRecursive",value:null,query:c[d-1],range:this._$.range};break;case 80:this.$={type:"Pipeline",left:null,right:c[d],range:this._$.range};break;case 81:this.$={type:"Pipeline",left:null,right:{type:"Block",definitions:c[d-1],body:c[d]},range:this._$.range};break;case 82:this.$={type:"Pick",value:c[d-2],getter:null,range:this._$.range};break;case 83:this.$={type:"Pick",value:c[d-3],getter:c[d-1],range:this._$.range};break;case 84:this.$={type:"SliceNotation",value:c[d-3],arguments:c[d-1],range:this._$.range};break;case 85:this.$={type:"GetProperty",value:c[d-2],property:c[d],range:this._$.range};break;case 86:this.$={type:"MethodCall",value:c[d-2],method:c[d],range:this._$.range};break;case 87:this.$={type:"Map",value:c[d-3],query:c[d-1],range:this._$.range};break;case 88:this.$={type:"Filter",value:c[d-3],query:c[d-1],range:this._$.range};break;case 89:this.$={type:"MapRecursive",value:c[d-2],query:{type:"GetProperty",value:null,property:c[d]},range:this._$.range};break;case 90:this.$={type:"MapRecursive",value:c[d-2],query:{type:"MethodCall",value:null,method:c[d]},range:this._$.range};break;case 91:this.$={type:"MapRecursive",value:c[d-3],query:c[d-1],range:this._$.range};break;case 92:this.$={type:"Method",reference:{type:"Identifier",name:c[d-1],range:[f[d-1].range[0],f[d-1].range[1]-1]},arguments:[],range:this._$.range},this._mn=c[d-1];break;case 93:this.$={type:"Method",reference:{type:"Identifier",name:c[d-2],range:[f[d-2].range[0],f[d-2].range[1]-1]},arguments:c[d-1],range:this._$.range},this._mn=c[d-2];break;case 94:this.$={type:"Method",reference:{type:"Reference",name:{type:"Identifier",name:c[d-1],range:[f[d-1].range[0],f[d-1].range[1]-1]},range:[f[d-1].range[0],f[d-1].range[1]-1]},arguments:[],range:this._$.range},this._mn=c[d-1];break;case 95:this.$={type:"Method",reference:{type:"Reference",name:{type:"Identifier",name:c[d-2],range:[f[d-2].range[0],f[d-2].range[1]-1]},range:[f[d-2].range[0],f[d-2].range[1]-1]},arguments:c[d-1],range:this._$.range},this._mn=c[d-2];break;case 97:case 100:case 118:case 137:case 156:c[d-2].push(c[d]);break;case 102:this.$=[c[d-1],...c[d]];break;case 103:case 158:this.$=[null,c[d]];break;case 104:case 160:this.$=[c[d-1],c[d]];break;case 105:this.$=[null,c[d-1],...c[d]];break;case 106:this.$=[c[d-2],c[d-1],...c[d]];break;case 111:case 114:this.$={type:"Object",properties:[],range:this._$.range};break;case 112:this.$={type:"Object",properties:c[d-1],range:this._$.range};break;case 113:this.$={type:"Object",properties:c[d-2],range:this._$.range};break;case 115:this.$={type:"Block",definitions:c[d-2],body:{type:"Object",properties:c[d-1]},range:this._$.range};break;case 116:this.$={type:"Block",definitions:c[d-3],body:{type:"Object",properties:c[d-2]},range:this._$.range};break;case 122:this.$={type:"ObjectEntry",key:{type:"Current"},value:null,range:this._$.range};break;case 123:this.$={type:"ObjectEntry",key:{type:"Reference",name:c[d]},value:null,range:this._$.range};break;case 124:case 126:this.$={type:"ObjectEntry",key:c[d],value:null,range:this._$.range};break;case 125:this.$={type:"ObjectEntry",key:{type:"Literal",value:this._mn},value:c[d],range:this._$.range};break;case 127:case 128:this.$={type:"ObjectEntry",key:c[d-2],value:c[d],range:this._$.range};break;case 129:this.$={type:"ObjectEntry",key:{type:"Identifier",name:"$"+c[d-2].name},value:c[d],range:this._$.range};break;case 130:this.$={type:"ObjectEntry",key:c[d-1],value:{type:"Pipeline",left:{type:"Reference",name:c[d-1]},right:c[d]},range:this._$.range};break;case 131:this.$={type:"ObjectEntry",key:c[d-1],value:{type:"Pipeline",left:{type:"GetProperty",value:null,property:c[d-1]},right:c[d]},range:this._$.range};break;case 132:this.$={type:"ObjectEntry",key:{type:"Literal",value:this._mn},value:{type:"Pipeline",left:c[d-1],right:c[d]},range:this._$.range};break;case 133:this.$={type:"ObjectEntry",key:c[d-3],value:c[d],range:this._$.range};break;case 134:this.$={type:"Spread",query:null,array:!1,range:this._$.range};break;case 135:this.$={type:"Spread",query:c[d],array:!1,range:this._$.range};break;case 139:this.$={type:"Spread",query:null,array:!0,range:this._$.range};break;case 140:this.$={type:"Spread",query:c[d],array:!0,range:this._$.range};break;case 141:this.$={type:"Array",elements:[],range:this._$.range};break;case 142:this.$={type:"Array",elements:c[d-1],range:this._$.range};break;case 143:this.$={type:"Array",elements:c[d-2],range:this._$.range};break;case 144:this.$={type:"Assertion",negation:!1,assertion:c[d],range:this._$.range};break;case 145:this.$={type:"Assertion",negation:!0,assertion:c[d],range:this._$.range};break;case 146:this.$={type:"Assertion",negation:!1,assertion:c[d-1],range:this._$.range};break;case 147:this.$={type:"Assertion",negation:!0,assertion:c[d-1],range:this._$.range};break;case 150:this.$={type:"Method",reference:{type:"Reference",name:c[d]},arguments:[],range:this._$.range};break;case 151:this.$={type:"Identifier",name:String(c[d]),range:this._$.range};break;case 153:case 154:c[d-2].push(c[d-1],c[d]);break;case 157:this.$={type:"Compare",query:c[d-1],order:c[d],range:this._$.range};break;case 159:this.$=[null,c[d-1],c[d]];break;case 161:this.$=[c[d-2],c[d-1],c[d]];break}},trace(...n){this.DEBUG&&Jison.print(...n)},parseError(n,e){if(e.recoverable)this.trace(n);else{let i=new Error(n);throw i.hash=e,i}},parse(n,...e){let d=W=>{F.length-=2*W,N.length-=W,A.length-=W},g=()=>{let W=m.lex()||1;return typeof W!="number"&&(W=this.symbols_[W]||W),W},m=Object.create(this.lexer),y=m.options&&m.options.ranges,k={...this.yy,parser:this,lexer:m};m.setInput(n,k),typeof k.parseError=="function"&&(this.parseError=k.parseError),typeof m.yylloc>"u"&&(m.yylloc={});let C=this.table,M={},E=m.yylloc,F=[0],N=[null],A=[E],b=[],L="",T=0,I=0,B=0,R,U;for(;;){let W=F[F.length-1],ne;if(this.defaultActions[W]?ne=this.defaultActions[W]:((R===null||typeof R>"u")&&(R=g()),ne=C[W]&&C[W][R]),!ne||!ne[0]){let S=function(X){let ee=F.length-1,pe=0;for(;;){if("2"in C[X])return pe;if(X===0||ee<2)return!1;ee-=2,X=F[ee],++pe}},q,Z="";if(!B){let X=[];for(let ee in C[W])ee in this.terminals_&&ee>2&&X.push("'"+this.terminals_[ee]+"'");Z=m.showPosition?"Parse error on line "+(T+1)+`:
|
|
39
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex(){let e;for(;!e;)e=this.next();return e},begin(e){this.currentCondition=e,this.conditionStack.push(e)},pushState(e){this.begin(e)},popState(){return this.conditionStack.pop(),this.currentCondition=this.conditionStack.length?this.conditionStack[this.conditionStack.length-1]:"INITIAL"},topState(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},stateStackSize(){return this.conditionStack.length}}})();ju.prototype={Parser:ju,lexer:_D,symbols_:{error:2,root:3,block:4,EOF:5,definitions:6,e:7,def:8,$:9,";":10,":":11,$ident:12,ident:13,IDENT:14,$IDENT:15,condConsequent:16,"?":17,condAlternate:18,query:19,"=>":20,"(":21,")":22,functionArgs:23,compareFunction:24,NOT:25,NO:26,"-":27,"+":28,"|":29,IS:30,assertion:31,IN:32,HAS:33,NOTIN:34,HASNO:35,AND:36,OR:37,"??":38,"*":39,"/":40,"%":41,"=":42,"!=":43,"<":44,"<=":45,">":46,">=":47,"~=":48,queryRoot:49,relativePath:50,"@":51,"#":52,$$:53,STRING:54,NUMBER:55,REGEXP:56,LITERAL:57,template:58,object:59,array:60,"[":61,sliceNotation:62,"]":63,"method()":64,".":65,".(":66,".[":67,"..":68,"..(":69,"METHOD(":70,arguments:71,"$METHOD(":72,",":73,functionArg:74,templateString:75,templateStart:76,templateTail:77,templateEnd:78,templateContinue:79,TEMPLATE:80,TPL_START:81,TPL_CONTINUE:82,TPL_END:83,"{":84,"}":85,objectEntries:86,objectEntry:87,objectEntryKeyLiteral:88,"...":89,arrayElements:90,arrayElement:91,assertionTerm:92,assertionList:93,compareExpr:94,ORDER:95,sliceNotationComponent:96,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",9:"$",10:";",11:":",14:"IDENT",15:"$IDENT",17:"?",20:"=>",21:"(",22:")",25:"NOT",26:"NO",27:"-",28:"+",29:"|",30:"IS",32:"IN",33:"HAS",34:"NOTIN",35:"HASNO",36:"AND",37:"OR",38:"??",39:"*",40:"/",41:"%",42:"=",43:"!=",44:"<",45:"<=",46:">",47:">=",48:"~=",51:"@",52:"#",53:"$$",54:"STRING",55:"NUMBER",56:"REGEXP",57:"LITERAL",61:"[",63:"]",65:".",66:".(",67:".[",68:"..",69:"..(",70:"METHOD(",72:"$METHOD(",73:",",80:"TEMPLATE",81:"TPL_START",82:"TPL_CONTINUE",83:"TPL_END",84:"{",85:"}",89:"...",95:"ORDER"},productions_:[0,[3,2],[4,2],[4,1],[4,1],[4,0],[6,1],[6,2],[8,2],[8,4],[8,2],[8,4],[13,1],[12,1],[16,2],[16,1],[18,2],[18,1],[18,0],[7,1],[7,2],[7,3],[7,4],[7,5],[7,1],[7,2],[7,2],[7,2],[7,2],[7,3],[7,4],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[19,1],[19,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,3],[49,2],[49,2],[49,1],[49,1],[49,3],[49,4],[49,2],[49,2],[49,3],[49,3],[49,2],[49,2],[49,3],[49,2],[49,3],[50,3],[50,4],[50,4],[50,3],[50,3],[50,4],[50,4],[50,3],[50,3],[50,4],[64,2],[64,3],[64,2],[64,3],[71,1],[71,3],[74,1],[23,1],[23,3],[58,1],[58,2],[77,1],[77,2],[77,2],[77,3],[75,1],[76,1],[79,1],[78,1],[59,2],[59,3],[59,4],[59,3],[59,4],[59,5],[86,1],[86,3],[88,1],[88,1],[88,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,3],[87,3],[87,3],[87,2],[87,2],[87,2],[87,5],[87,1],[87,2],[90,1],[90,3],[91,1],[91,1],[91,2],[60,2],[60,3],[60,4],[31,1],[31,2],[31,3],[31,4],[92,1],[92,1],[92,1],[92,1],[93,1],[93,3],[93,3],[24,1],[24,3],[94,2],[62,1],[62,2],[62,2],[62,3],[96,1],[96,2]],table:(function(e){function i(C){let M=C.match(/[\x20-\x2f]/g),E=M?Math.max(...M.map(F=>F.charCodeAt()-32)):-1;for(let F=E;F>=0;F--){let N=(32+F).toString(16),A;C=C.replace(new RegExp("\\[\\x"+N+"(.+?)\\]"),(b,L)=>A=L).replace(new RegExp("\\x"+N,"g"),A)}return C=C.replace(/<([^>]+?)>/g,(F,N)=>{let A=c[N[0]],b=1;return A>>5===1&&(A=A&31|c[N[1]]<<5,b=2),N.slice(b).repeat(A)}),C}function o(C){let M=[];for(let E=0;E<C.length;E++){let F=c[C[E]];if(F&32){let N=c[C[++E]];M.push(F&31|N<<5)}else M.push(F)}return M}let c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~|=".split("").reduce((C,M,E)=>(C[M]=E,C),Object.create(null)),[f,d,...g]=e.split("=").map(i),m=d.split(";").map(C=>{let M=[];for(let E=0;E<C.length;E++)for(let F=0,N=c[C[E]];F<3;F++)M.push(N>>F*2&3);return M}),y=g.map(o),k=o(f).map(C=>{let M=m[C],E=Object.create(null);for(let F=0;F<M.length;F++){let N=M[F];if(N!==0){let A=y[N-1].shift();E[F]=N===1?A:[N-1,A]}}return E});for(let C=0;C<y[3].length;C+=2)k[y[3][C]][y[3][C+1]]=[3];return k})(`ABCDEFGHIJKHHHHLL<NM>NOPMMQRSQRTMUVWXYYMZaEFTO<TH>PMbQRSQRcMMHdefgBhBiBHj[ BjBkBk]BFHFHlBMmBnBoBpBqBrBMMsBtBMMMMXMWMMuB[!lBMMuB]vBgBMMwBUMZMxByBzB0B1B2B3B4BH5<DB6>BvBXe7BXevBgBM<E8B>9B~ <DB|>BgCgC<EhC>gCMMiC<C!>cHdjCMfMkClClCMMmCnCnBoCpCMtBqCrCvBMMMvBMUMMsCMxBHtCHtCtCHuCvCTXHXvB<FM>cHhBhBMFFMpBpCnCqCMOOMMzBzB2BMsCwCtCtCxC7BcMrCrCHMHtCtC=A1[ V[!C["lmkCpqC]]]<FA>[#[$[%[&['UqqWJkq]K]C][([)FgCCAAE];]]A];Ag;AwU[*ClmkOpqC]<FA>[+[,U[-qqWJnqK]]C(A]wAA[.A[/kAMAqi]]<Fq>CAAAAD<JA>g;AwADwzwP8|D<GA>||DMz|PDAwDPw;AwA8AwAMA|z<F|>DAAAIjqCMAA8MAAw;AAE!<FA>#wA8AwgMA|z<F|>DAAAMz|DMAA8MAAw;AAVClmkapqC<FA>&S(AwA8AwAMA|z<F|>DAAAMz|DIAA8MAAw;AwAoAwAMA|z<F|>DAAAMz|DMAA8MAAw;AwA8AwAMA|z<F|>DAAAMz|DMAA8MAAw;AAEi"<FA>UqqWZmqKCFgCCgFEB;AAAChCACIAE<IA>C<KA>Q;AwAsAwBMA|z<F|>DAAAMz|DMAA8MAAw;AAAAk<QA>EAIC;AEV*<FA>#E <FA>+A <FA>#AE!<FA>%VlqCAAE;AARClC<MA>KCIEAICAAAYl;AwE~lmkOp6y<F|>X-OFg~OAA0;AwA|wzwP8|z<F|>D||DMz|PPAw|PAAw;AAEClmkKpqC<FA>'aC(AAADwzwD8|D<GA>||DMw|PDAw|D;M;AAEi"<FA>UqqWZmqKC)B;AwA8.<Fq>CAAAMz|DMAA8MAA<Cg;AAAAAA>AI<QA>I;<FA>kAIAqi<Fq>C<OA>g;AAU!<FA>$<HA>M<QA>M;AAA8AwgMA|z<F|>DAAAMw|DM<GA>w;AwA8A0AMA6jq|qqqCAAAMz|DMAA8MAAw;AwA8A0AMA|z||q||DAAAMz|DMAA8MAAw<C;AAAAAAAAAAAAAAAAAAAAAC>AAI;AAAg<RA>D<KA>B;AAAgAkAAAqi<Fq>CAAAADAAM<GA>gB;<VA>DAAM;AAEy"<FA>+AE!<FA>,O(AAAChCACA<KA>C<KA>Q;AAAChCACIAE<IA>C<KA>QB;<HA>I;AwA8AkAMA6i<Fq>CAAAMz|DMAA8MAAw;<FA>kAAAqi<Fq>C<JA>FoAAAg;<YA>IAAAI;AAQClC<MA>KCIEAICAAAYl;<YA>MAAAM;AAAo<UA>MAAAM;AAEq"<FA>&OFgCOAAE;AAEi"<FA>&OFgCOAAE;AAE!<FA>&OFgCOAAE;AAAg<UA>MAAAM;AAAClmECAgC<FA>&OFgCO;AAAw<UA>MAAAM;<FA>/<Fq>C<HA>M<GA>g;AwA8A0AMA6z||qqqCAAAMz|DMAA8MAAw;AwA8A0AMA6jqvqqqCAAAMz|DMAA8MAAw;AwA8A0AMA6jquqqqCAAAMz|DMAA8MAAw;AwA8A0AMA|z<F|>DAAAMz|DMAA8MAAw;AwA8A0AMA6z||qvqDAAAMz|DMAA8MAAw;AwA8A0AMA6z||q||DAAAMz|DMAA8MAAw;AAAgAkAAAqi<Fq><CCAAAA><FA>gB;<FA>C<SA>Q;<FA>kAAAqi<Fq>C<OA>g;AAAIAkAAAqi<Fq>C<OA>g;AAE!<FA>UqqWJmqKCFgCCgEE;<VA>D;AAAwAkAAAqi<Fq>CAAAAD<JA>g;<FA>kAAAqi<Fq>CAAAADAAM<GA>g;<HA>IAAAAK;<HA>MAAAAP;AAAClC<MA>KCIEAICAAAIl;<FA>kAAAqi<Fq>C<HA>MAAAMAAg;<FA>kAAAqi<Fq><CCAAAA><FA>g;<UA>IgqCMAAAM;AAAIAkAAAqi<Fq>C<HA>MAAAMAAg;AAAg=BC[ D[!E["[#F[$QhBgBG]][%[&['[(KRSbcd]iB]pBqB]T]]]]zB[)0B$%qC]y[*C[[,+[-0ChBgB]]G%]]5C4C#3C'6CpBqBT9*~*|*gD+pD-G(lD[.iBpBqB]nDqDToDzDtDuD2D4D5D6D 7D 8D9D~D gE|D"jE-G&hEiEkETpEF[/sEtEuE]oEqEvE1E+4E-G'3EpBqBT4E-G'6EpBqBTqC8E7!zD9EuD~E+|E+gF+hF+iF+jF+kF+lF+mF+nF+oF+pF+qF+rF+sF+tF+uF+vF+wF+xFzF-G(0F.ToD1F2F3F 4F 5F6F7F qC8F+qChG0B$%jG-G&iG<EqC>kG+lG+pGqCqGrG+sG+zDtGzDwGuDvGxG+qC1G)2G3GjE-G&4GiEkET0B/8GqEvE~G+gH+hH+jH,kHRSbcd.qCqCqCpH0B$%<UqC>qGqCvH+xH<EqC>4H-G&3HT5HqCqCzDwGuD6HqCqCjE-G&~HiEkETiItEuEgIvElI+qCmI+qCqCnI+qC5C4C"pI+qCqCqI+qCzDsIuDzDtIuD~G+iItEuEgIvE<FqC>xI+yI+qCqC=[ [!["P[#[$[%[&['tBIsBHJ]LMNO][(oB[)fUVWXYZae]]][*jBkBlBmBnBuBvBwBxB]]r]]B]y][+B[,![-[.sB|B~B][/1B2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC]]]rC]sCtCuCvCwCxCzC#B1CPtB7CsBHJ2CLMNO(*rB8C<EzC#B>hDiDjDkDzCrD%mD*rBsDyDxD1DwDvD0D3D<CtBuBvB!!>zC$mElErBrEtB1DyEzE0EwEuBvBnExEzC&)*rBzC'2ELMNO(*rBzC'5ELMNO(*rB-rC DxD1DwDvD0D<TzC#B>3DzCrD%yF*rBtBuBv<CB">BtBuBv+zC#B9F~F|FsBgG|B~B/rC!1CzC#B<C|B~B3B4B5B6BgChCiCjCkClCmCnCoCpC><CgChCiC><CzC#B>mGnGoGrDrD-rC<CzC#B>yDxD1DuG0DyDxD1DwDvD0DzC&)*rByGzG0G.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC,mElErCzC$mElErB6G5GrEtB1DyEzE0EwEuBvB7GxEhDiDzCjD9G#BzC|G#BzC#BiHzC#BzCtB1DsBlH(*rB.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpCmHnH-rCoHnH.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC!<E|B~BgChCiCjCkClCmCnCoCpC>|B~B3B4B5B6B9BgChCiCjCkClCmCnCoCpC|B~B3B4B5B6B7B9BgChCiCjCkClCmCnCoCpC|B~B3B4B5B6BgChCiCjCkClCmCnCoCp<CCgChCi><CC|B~BgChCiClCmCnCo><FC|B~BgChCi>ClCmCnCoCrD-qHrCrHsHtHuH-rCzC#BwHyHsBzH|B~B/rC-rC0H-rC1H-rCzC%2H*rBsDrD<C-rC>yDxD1DwDvD0D7H8H9H<C.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC>zC$mElErBhItB1DyEzE0EwEuBvB|HxEkIjI<CzC#B-rC>-rCzC#B-oIrCsCtCuCvCwCxC!zC#B.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC-rCzC#B-rCrI8H9H<CyDxD1DwDvD0D>zCuI#BhItB1DyEzE0EwEuBvBvIxE1H<D-rC>wI<C-rC><CzC#B><C-rC>=FDDDEEE<jBG><gBT><mBN><lBY><kB4B><kB6B><mB0B><mB1B><mB7E><mB2B><mB3B><mB5B><mB7B><mB8B><mB9B><mB~B><mB|B><mBgC><mBhC><lBS><mBlC><mBmC>FFF<mBlD><cP><5BM><mBrD><gBsD>BCCC<jBH><lBS><mB9E>FFF<PU><mB4B><mB6B>jDjDNNNiD<bN>iDN<WZ><Wa><jBb><jBc><jBI><jBK><mBtE>~EqEqEoEoEiFiFrErE<mBjC><mBwE><mB0E><mB1E><mB2E><mB3E><5BN><mBkC><cR><mBpC><mBqC><mBtC><mBuC><RwC><mBmD><mBnD><mBuD><gBtD><mBvD>1D1[ D6D6D7D7D]8D8D9D9D~D~DmEmE<D3D><D4D><D5D><RO><5B8C>gDgD<5B~C><Rd><mBf><agB><ahB><aiB><ajB><VkB><UlB><WmB><jBnB><jBoB><mBpB><mBqB><mBrB><dsB><dtB><hBuB><hBvB><hBwB><hBxB><dyB><mBzB><mByC><mB1C><mB2C><mB5C><mB6C><PV><mBnC><mB8E><mBiC><mBuE>|EgFjFjFsEsE<mBxE><D4E><RQ><mBrC><mBsC><mBvC><RxC><mBoD><mBpD><mBwD><mByD>iEiEjEjEkEkEnEnE<5B9C><5B|C><Re><mBzC><mB0C><mB3C><mB4C><mB7C><PW>kDkDiDiD<mBoC><jBJ><jBL><mBvE>pEpEqEqEhF<mByE><mBqD><mBxD>2D2 <mBzD>hEhE|D|DgEgEhDhD<PX><mBzE><D5E><D6E><mB0D>hEhElElE=BB`),defaultActions:{50:[2,1],201:[2,159],249:[2,161]},performAction(n,e,i,o,l,c,f){let d=c.length-1;switch(l){case 1:return o.buildResult(c[d-1]);case 2:this.$={type:"Block",definitions:c[d-1],body:c[d],range:this._$.range};break;case 3:this.$={type:"Block",definitions:c[d],body:{type:"Placeholder",range:[f[d].range[1],f[d].range[1]]},range:this._$.range};break;case 4:this.$={type:"Block",definitions:[],body:c[d],range:this._$.range};break;case 5:this.$={type:"Block",definitions:[],body:{type:"Placeholder",range:[f[d].range[1],f[d].range[1]]},range:this._$.range};break;case 6:case 96:case 99:case 101:case 117:case 136:case 152:case 155:this.$=[c[d]];break;case 7:c[d-1].push(c[d]);break;case 8:this.$={type:"Definition",declarator:{type:"Declarator",name:null,range:f[d-1].range},value:null,range:this._$.range};break;case 9:this.$={type:"Definition",declarator:{type:"Declarator",name:null,range:f[d-3].range},value:c[d-1],range:this._$.range};break;case 10:this.$={type:"Definition",declarator:{type:"Declarator",name:c[d-1].name,range:f[d-1].range},value:null,range:this._$.range};break;case 11:this.$={type:"Definition",declarator:{type:"Declarator",name:c[d-3].name,range:f[d-3].range},value:c[d-1],range:this._$.range};break;case 12:case 13:case 98:case 148:case 149:this.$={type:"Identifier",name:c[d],range:this._$.range};break;case 14:case 16:case 163:this.$=c[d];break;case 15:case 17:this.$={type:"Placeholder",range:[f[d].range[1],f[d].range[1]]};break;case 18:case 162:this.$=null;break;case 19:case 52:case 53:case 64:case 65:case 138:break;case 20:case 22:this.$={type:"Function",arguments:[],body:c[d],range:this._$.range};break;case 21:this.$={type:"Function",arguments:[{type:"Identifier",name:c[d-2]}],body:c[d],range:this._$.range};break;case 23:this.$={type:"Function",arguments:c[d-3],body:c[d],range:this._$.range};break;case 24:this.$={type:"CompareFunction",compares:c[d],range:this._$.range};break;case 25:case 26:case 27:case 28:case 67:this.$={type:"Prefix",operator:c[d-1],argument:c[d],range:this._$.range};break;case 29:this.$={type:"Pipeline",left:c[d-2],right:c[d],range:this._$.range};break;case 30:this.$={type:"Pipeline",left:c[d-3],right:{type:"Block",definitions:c[d-1],body:c[d]},range:this._$.range};break;case 31:this.$={type:"Postfix",operator:c[d],argument:c[d-2],range:this._$.range};break;case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:this.$={type:"Binary",operator:c[d-1],left:c[d-2],right:c[d],range:this._$.range};break;case 51:this.$={type:"Conditional",test:c[d-2],consequent:c[d-1],alternate:c[d],range:this._$.range};break;case 54:this.$={type:"Data",range:this._$.range};break;case 55:this.$={type:"Context",range:this._$.range};break;case 56:this.$={type:"Current",range:this._$.range};break;case 57:this.$={type:"Arg1",range:this._$.range};break;case 58:this.$={type:"Reference",name:c[d],range:this._$.range};break;case 59:case 60:case 61:case 62:case 107:case 108:case 109:case 110:case 119:case 120:case 121:this.$={type:"Literal",value:c[d],range:this._$.range};break;case 63:this.$={type:"Template",values:c[d],range:this._$.range};break;case 66:this.$={type:"SliceNotation",value:null,arguments:c[d-1],range:this._$.range};break;case 68:this.$={type:"Conditional",test:null,consequent:c[d-1],alternate:c[d],range:this._$.range};break;case 69:case 73:this.$={type:"GetProperty",value:null,property:c[d],range:this._$.range};break;case 70:case 74:this.$={type:"MethodCall",value:null,method:c[d],range:this._$.range};break;case 71:this.$={type:"Parentheses",body:c[d-1],range:this._$.range};break;case 72:this.$={type:"Parentheses",body:{type:"Block",definitions:c[d-2],body:c[d-1]},range:this._$.range};break;case 75:this.$={type:"Map",value:null,query:c[d-1],range:this._$.range};break;case 76:this.$={type:"Filter",value:null,query:c[d-1],range:this._$.range};break;case 77:this.$={type:"MapRecursive",value:null,query:{type:"GetProperty",value:null,property:c[d]},range:this._$.range};break;case 78:this.$={type:"MapRecursive",value:null,query:{type:"MethodCall",value:null,method:c[d]},range:this._$.range};break;case 79:this.$={type:"MapRecursive",value:null,query:c[d-1],range:this._$.range};break;case 80:this.$={type:"Pipeline",left:null,right:c[d],range:this._$.range};break;case 81:this.$={type:"Pipeline",left:null,right:{type:"Block",definitions:c[d-1],body:c[d]},range:this._$.range};break;case 82:this.$={type:"Pick",value:c[d-2],getter:null,range:this._$.range};break;case 83:this.$={type:"Pick",value:c[d-3],getter:c[d-1],range:this._$.range};break;case 84:this.$={type:"SliceNotation",value:c[d-3],arguments:c[d-1],range:this._$.range};break;case 85:this.$={type:"GetProperty",value:c[d-2],property:c[d],range:this._$.range};break;case 86:this.$={type:"MethodCall",value:c[d-2],method:c[d],range:this._$.range};break;case 87:this.$={type:"Map",value:c[d-3],query:c[d-1],range:this._$.range};break;case 88:this.$={type:"Filter",value:c[d-3],query:c[d-1],range:this._$.range};break;case 89:this.$={type:"MapRecursive",value:c[d-2],query:{type:"GetProperty",value:null,property:c[d]},range:this._$.range};break;case 90:this.$={type:"MapRecursive",value:c[d-2],query:{type:"MethodCall",value:null,method:c[d]},range:this._$.range};break;case 91:this.$={type:"MapRecursive",value:c[d-3],query:c[d-1],range:this._$.range};break;case 92:this.$={type:"Method",reference:{type:"Identifier",name:c[d-1],range:[f[d-1].range[0],f[d-1].range[1]-1]},arguments:[],range:this._$.range},this._mn=c[d-1];break;case 93:this.$={type:"Method",reference:{type:"Identifier",name:c[d-2],range:[f[d-2].range[0],f[d-2].range[1]-1]},arguments:c[d-1],range:this._$.range},this._mn=c[d-2];break;case 94:this.$={type:"Method",reference:{type:"Reference",name:{type:"Identifier",name:c[d-1],range:[f[d-1].range[0],f[d-1].range[1]-1]},range:[f[d-1].range[0],f[d-1].range[1]-1]},arguments:[],range:this._$.range},this._mn=c[d-1];break;case 95:this.$={type:"Method",reference:{type:"Reference",name:{type:"Identifier",name:c[d-2],range:[f[d-2].range[0],f[d-2].range[1]-1]},range:[f[d-2].range[0],f[d-2].range[1]-1]},arguments:c[d-1],range:this._$.range},this._mn=c[d-2];break;case 97:case 100:case 118:case 137:case 156:c[d-2].push(c[d]);break;case 102:this.$=[c[d-1],...c[d]];break;case 103:case 158:this.$=[null,c[d]];break;case 104:case 160:this.$=[c[d-1],c[d]];break;case 105:this.$=[null,c[d-1],...c[d]];break;case 106:this.$=[c[d-2],c[d-1],...c[d]];break;case 111:case 114:this.$={type:"Object",properties:[],range:this._$.range};break;case 112:this.$={type:"Object",properties:c[d-1],range:this._$.range};break;case 113:this.$={type:"Object",properties:c[d-2],range:this._$.range};break;case 115:this.$={type:"Block",definitions:c[d-2],body:{type:"Object",properties:c[d-1]},range:this._$.range};break;case 116:this.$={type:"Block",definitions:c[d-3],body:{type:"Object",properties:c[d-2]},range:this._$.range};break;case 122:this.$={type:"ObjectEntry",key:{type:"Current"},value:null,range:this._$.range};break;case 123:this.$={type:"ObjectEntry",key:{type:"Reference",name:c[d]},value:null,range:this._$.range};break;case 124:case 126:this.$={type:"ObjectEntry",key:c[d],value:null,range:this._$.range};break;case 125:this.$={type:"ObjectEntry",key:{type:"Literal",value:this._mn},value:c[d],range:this._$.range};break;case 127:case 128:this.$={type:"ObjectEntry",key:c[d-2],value:c[d],range:this._$.range};break;case 129:this.$={type:"ObjectEntry",key:{type:"Identifier",name:"$"+c[d-2].name},value:c[d],range:this._$.range};break;case 130:this.$={type:"ObjectEntry",key:c[d-1],value:{type:"Pipeline",left:{type:"Reference",name:c[d-1]},right:c[d]},range:this._$.range};break;case 131:this.$={type:"ObjectEntry",key:c[d-1],value:{type:"Pipeline",left:{type:"GetProperty",value:null,property:c[d-1]},right:c[d]},range:this._$.range};break;case 132:this.$={type:"ObjectEntry",key:{type:"Literal",value:this._mn},value:{type:"Pipeline",left:c[d-1],right:c[d]},range:this._$.range};break;case 133:this.$={type:"ObjectEntry",key:c[d-3],value:c[d],range:this._$.range};break;case 134:this.$={type:"Spread",query:null,array:!1,range:this._$.range};break;case 135:this.$={type:"Spread",query:c[d],array:!1,range:this._$.range};break;case 139:this.$={type:"Spread",query:null,array:!0,range:this._$.range};break;case 140:this.$={type:"Spread",query:c[d],array:!0,range:this._$.range};break;case 141:this.$={type:"Array",elements:[],range:this._$.range};break;case 142:this.$={type:"Array",elements:c[d-1],range:this._$.range};break;case 143:this.$={type:"Array",elements:c[d-2],range:this._$.range};break;case 144:this.$={type:"Assertion",negation:!1,assertion:c[d],range:this._$.range};break;case 145:this.$={type:"Assertion",negation:!0,assertion:c[d],range:this._$.range};break;case 146:this.$={type:"Assertion",negation:!1,assertion:c[d-1],range:this._$.range};break;case 147:this.$={type:"Assertion",negation:!0,assertion:c[d-1],range:this._$.range};break;case 150:this.$={type:"Method",reference:{type:"Reference",name:c[d]},arguments:[],range:this._$.range};break;case 151:this.$={type:"Identifier",name:String(c[d]),range:this._$.range};break;case 153:case 154:c[d-2].push(c[d-1],c[d]);break;case 157:this.$={type:"Compare",query:c[d-1],order:c[d],range:this._$.range};break;case 159:this.$=[null,c[d-1],c[d]];break;case 161:this.$=[c[d-2],c[d-1],c[d]];break}},trace(...n){this.DEBUG&&Jison.print(...n)},parseError(n,e){if(e.recoverable)this.trace(n);else{let i=new Error(n);throw i.hash=e,i}},parse(n,...e){let d=W=>{F.length-=2*W,N.length-=W,A.length-=W},g=()=>{let W=m.lex()||1;return typeof W!="number"&&(W=this.symbols_[W]||W),W},m=Object.create(this.lexer),y=m.options&&m.options.ranges,k={...this.yy,parser:this,lexer:m};m.setInput(n,k),typeof k.parseError=="function"&&(this.parseError=k.parseError),typeof m.yylloc>"u"&&(m.yylloc={});let C=this.table,M={},E=m.yylloc,F=[0],N=[null],A=[E],b=[],L="",T=0,I=0,B=0,R,U;for(;;){let W=F[F.length-1],ne;if(this.defaultActions[W]?ne=this.defaultActions[W]:((R===null||typeof R>"u")&&(R=g()),ne=C[W]&&C[W][R]),!ne||!ne[0]){let S=function(X){let ee=F.length-1,pe=0;for(;;){if("2"in C[X])return pe;if(X===0||ee<2)return!1;ee-=2,X=F[ee],++pe}},q,Z="";if(!B){let X=[];for(let ee in C[W])ee in this.terminals_&&ee>2&&X.push("'"+this.terminals_[ee]+"'");Z=m.showPosition?"Parse error on line "+(T+1)+`:
|
|
40
40
|
`+m.showPosition()+`
|
|
41
|
-
Expecting `+X.join(", ")+", got '"+(this.terminals_[R]||R)+"'":"Parse error on line "+(T+1)+": Unexpected "+(R===1?"end of input":"'"+(this.terminals_[R]||R)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[R]||R,line:m.yylineno,loc:E,expected:X})}if(B===3){if(R===1||U===1)throw new Error(Z||"Parsing halted while starting to recover from another error.");I=m.yyleng,L=m.yytext,T=m.yylineno,E=m.yylloc,R=g()}if(q===!1)throw new Error(Z||"Parsing halted. No suitable error recovery rule available.");d(q),U=R==2?null:R,R=2,W=F[F.length-1],ne=C[W]&&C[W][2],B=3}if(Array.isArray(ne[0])&&ne.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+R);switch(ne[0]){case 1:F.push(R),N.push(m.yytext),A.push(m.yylloc),F.push(ne[1]),R=null,U?(R=U,U=null):(I=m.yyleng,L=m.yytext,T=m.yylineno,E=m.yylloc,B>0&&B--);break;case 2:{let q=this.productions_[ne[1]][1],Z=A[A.length-(q||1)],S=A[A.length-1];M.$=N[N.length-q],M._$={first_line:Z.first_line,last_line:S.last_line,first_column:Z.first_column,last_column:S.last_column},y&&(M._$.range=[Z.range[0],S.range[1]]);let X=this.performAction.call(M,L,I,T,k,ne[1],N,A,...e);if(typeof X<"u")return X;q&&d(q),F.push(this.productions_[ne[1]][0]),N.push(M.$),A.push(M._$),F.push(C[F[F.length-2]][F[F.length-1]]);break}case 3:return!0}}}};WD=function(e){function i(b,L){Object.entries(L).forEach(([T,I])=>b[T]=I(b[T]))}let o=new Map([["EOF",["<end of input>"]],["IDENT",["ident"]],["$IDENT",["$ident"]],["NOT",["'not'"]],["NO",["'no'"]],["IS",["'is'"]],["IN",["'in'"]],["HAS",["'has'"]],["NOTIN",["'not in'"]],["HASNO",["'has no'"]],["AND",["'and'"]],["OR",["'or'"]],["STRING",["string"]],["TPL_START",["template"]],["TEMPLATE",["template"]],["NUMBER",["number"]],["REGEXP",["regexp"]],["LITERAL",["'true'","'false'","'null'","'undefined'","'NaN'","'Infinity'"]],["ORDER",["'asc'","'desc'","'ascN'","'descN'"]],["METHOD(",["'method('"]],["$METHOD(",["'$method('"]]]),l=b=>o.get(b)||`'${b}'`,c=function(b,L={},T){if(L.recoverable)this.trace(b);else{if(Array.isArray(L.inside)){let W=T.lexer.offset-T.lexer.match.length;T.lexer.setMatch(W+L.inside[0],W+L.inside[1])}let I=T.lexer.yylloc,B=[b.split(/\n/)[0],"",T.lexer.showPosition()],R=Array.isArray(L.expected)?[...new Set([].concat(...L.expected.map(W=>l(W.slice(1,-1)))))]:null;R&&B.push("","Expecting "+R.join(", ")+" got "+l(L.token));let U=new SyntaxError(B.join(`
|
|
41
|
+
Expecting `+X.join(", ")+", got '"+(this.terminals_[R]||R)+"'":"Parse error on line "+(T+1)+": Unexpected "+(R===1?"end of input":"'"+(this.terminals_[R]||R)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[R]||R,line:m.yylineno,loc:E,expected:X})}if(B===3){if(R===1||U===1)throw new Error(Z||"Parsing halted while starting to recover from another error.");I=m.yyleng,L=m.yytext,T=m.yylineno,E=m.yylloc,R=g()}if(q===!1)throw new Error(Z||"Parsing halted. No suitable error recovery rule available.");d(q),U=R==2?null:R,R=2,W=F[F.length-1],ne=C[W]&&C[W][2],B=3}if(Array.isArray(ne[0])&&ne.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+R);switch(ne[0]){case 1:F.push(R),N.push(m.yytext),A.push(m.yylloc),F.push(ne[1]),R=null,U?(R=U,U=null):(I=m.yyleng,L=m.yytext,T=m.yylineno,E=m.yylloc,B>0&&B--);break;case 2:{let q=this.productions_[ne[1]][1],Z=A[A.length-(q||1)],S=A[A.length-1];M.$=N[N.length-q],M._$={first_line:Z.first_line,last_line:S.last_line,first_column:Z.first_column,last_column:S.last_column},y&&(M._$.range=[Z.range[0],S.range[1]]);let X=this.performAction.call(M,L,I,T,k,ne[1],N,A,...e);if(typeof X<"u")return X;q&&d(q),F.push(this.productions_[ne[1]][0]),N.push(M.$),A.push(M._$),F.push(C[F[F.length-2]][F[F.length-1]]);break}case 3:return!0}}}};WD=(function(e){function i(b,L){Object.entries(L).forEach(([T,I])=>b[T]=I(b[T]))}let o=new Map([["EOF",["<end of input>"]],["IDENT",["ident"]],["$IDENT",["$ident"]],["NOT",["'not'"]],["NO",["'no'"]],["IS",["'is'"]],["IN",["'in'"]],["HAS",["'has'"]],["NOTIN",["'not in'"]],["HASNO",["'has no'"]],["AND",["'and'"]],["OR",["'or'"]],["STRING",["string"]],["TPL_START",["template"]],["TEMPLATE",["template"]],["NUMBER",["number"]],["REGEXP",["regexp"]],["LITERAL",["'true'","'false'","'null'","'undefined'","'NaN'","'Infinity'"]],["ORDER",["'asc'","'desc'","'ascN'","'descN'"]],["METHOD(",["'method('"]],["$METHOD(",["'$method('"]]]),l=b=>o.get(b)||`'${b}'`,c=function(b,L={},T){if(L.recoverable)this.trace(b);else{if(Array.isArray(L.inside)){let W=T.lexer.offset-T.lexer.match.length;T.lexer.setMatch(W+L.inside[0],W+L.inside[1])}let I=T.lexer.yylloc,B=[b.split(/\n/)[0],"",T.lexer.showPosition()],R=Array.isArray(L.expected)?[...new Set([].concat(...L.expected.map(W=>l(W.slice(1,-1)))))]:null;R&&B.push("","Expecting "+R.join(", ")+" got "+l(L.token));let U=new SyntaxError(B.join(`
|
|
42
42
|
`));throw U.details={rawMessage:b,text:L.text,token:L.token,expected:R,loc:{range:I.range,start:{line:I.first_line,column:I.first_column,offset:I.range[0]},end:{line:I.last_line,column:I.last_column,offset:I.range[1]}}},U}},f=new Set([`
|
|
43
43
|
`,"\r","\u2028","\u2029"]),d=new Map([["undefined",void 0],["null",null],["false",!1],["true",!0],["Infinity",1/0],["NaN",NaN]]);Object.assign(e.lexer,{ident:b=>b.replace(/\\u[0-9a-fA-F]{4}/g,L=>String.fromCharCode(parseInt(L.slice(2),16))),toLiteral:b=>d.get(b),toNumberLiteral(b,L,T=!1){if(L){let I=b.match(T?/(?:^|[^0-9a-fA-F])_|_(?:[^0-9a-fA-F]|$)/:/(?:^|\D)_|_(?:\D|$)/);if(I){let B=I[0],R=I.index+ +(B[1]==="_"),U=B==="__"?"Only one underscore is allowed":"Wrong underscore";this.parseError(U+" as numeric separator",{inside:[R,R+1]})}b=b.replace(/_/g,"")}return T?parseInt(b,16):parseFloat(b)},toStringLiteral(b,L=!1,T=1){let I=b.length-T,B="";for(let R=1;R<I;R++){if(!L&&f.has(b[R])&&this.parseError("Invalid line terminator",{inside:[R,R+1]}),b[R]!=="\\"){B+=b[R];continue}R===I-1&&this.parseError("Invalid backslash",{inside:[R,R+1]});let U=b[++R];switch(U){case"\r":R+=b[R+1]===`
|
|
44
44
|
`;break;case`
|
|
@@ -46,7 +46,7 @@ Expecting `+X.join(", ")+", got '"+(this.terminals_[R]||R)+"'":"Parse error on l
|
|
|
46
46
|
`;break;case"r":B+="\r";break;case"f":B+="\f";break;case"t":B+=" ";break;case"v":B+="\v";break;case"u":{let[W=""]=b.slice(R+1,R+5).match(/^[0-9a-f]*/i)||[];if(W.length===4){B+=String.fromCharCode(parseInt(W,16)),R+=4;break}this.parseError("Invalid Unicode escape sequence",{inside:[R-1,Math.min(R+1+W.length,I)]});break}case"x":{let[W=""]=b.slice(R+1,R+3).match(/^[0-9a-f]*/i)||[];if(W.length===2){B+=String.fromCharCode(parseInt(W,16)),R+=2;break}this.parseError("Invalid hexadecimal escape sequence",{inside:[R-1,Math.min(R+1+W.length,I)]});break}default:B+=U}}return B},toRegExp(b){let L=b.lastIndexOf("/")+1,T=b.substr(L);return T.split("").forEach((I,B,R)=>{let U=R.indexOf(I,B+1);U!==-1&&this.parseError("Duplicate flag in regexp",{inside:[L+U,L+U+1]})}),new RegExp(b.substr(1,b.lastIndexOf("/")-1),T)}}),i(e.lexer,{setInput:b=>function(L,T){let I=[];return T.commentRanges=I,T.buildResult=B=>({ast:B,commentRanges:I}),T.parseError=function(...B){return c.call(this,...B,T)},T.pks=()=>{this.eof()||this.begin("preventKeyword")},T.pps=()=>{this.eof()||this.begin("preventPrimitive")},this.bracketStack=[],this.prevToken=null,this.prevYylloc={first_line:1,last_line:1,first_column:0,last_column:0,range:[0,0]},b.call(this,L,T)}});let g=new e.Parser;g.lexer={...e.lexer},g.yy={...e.yy};let m=["AND","OR","IN","NOTIN","HAS","HASNO","IS"],y=[...m,"NOT","NO","ORDER"],k=["+","-","*","/","%","|","=","!=","~=",">=","<=","<",">"],C=[null,"?",":",";",",",".","..","(",".(","..(","METHOD(","$METHOD(","[",".[","=>",...k,...m,"NOT","NO"],M=[",","?",":",";","EOF","]",")","}","TPL_CONTINUE","TPL_END",...k,...m,"ORDER"],E=new Map(C.map(b=>[b,new Set(M)]));for(let b of[".(","..(","METHOD(","$METHOD("])E.get(b).delete(")");for(let b of["[",".["])E.get(b).delete("]");i(g.lexer,{lex:b=>function(){let T=this.offset,I=b.call(this);if(E.has(this.prevToken)&&E.get(this.prevToken).has(I)){let B={first_line:this.prevYylloc.last_line,last_line:this.yylloc.first_line,first_column:this.prevYylloc.last_column,last_column:this.yylloc.first_column,range:[this.prevYylloc.range[1],this.yylloc.range[0]]};if(this.unput(this.match),this.pushState("preventPrimitive"),this.done=!1,this.yytext="",this.yylloc=this.prevYylloc=B,T!==this.offset&&y.includes(I))switch(this._input[T]){case" ":case" ":B.last_column--,B.range[1]--;break;case`
|
|
47
47
|
`:{let R=this._input.lastIndexOf(`
|
|
48
48
|
`,T-1);B.last_line--,B.last_column=R===-1?B.last_column-1:T-R,B.range[1]--;break}}return this.prevToken="IDENT"}if(this.prevYylloc=this.yylloc,y.includes(I))switch(this._input[this.offset]){case" ":case" ":this.prevYylloc={...this.prevYylloc,last_column:this.prevYylloc.last_column+1,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]};break;case`
|
|
49
|
-
`:this.prevYylloc={...this.prevYylloc,last_line:this.prevYylloc.last_line+1,last_column:0,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]};break}return this.prevToken=I}});let F=new Map([["(",")"],[".(",")"],["..(",")"],["METHOD(",")"],["$METHOD(",")"],["[","]"],[".[","]"],["{","}"],["TPL_START","TPL_END"]]),N=new Set([")","]","}","TPL_END"]),A=b=>function(){let T=b.call(this);if(N.has(T)){let I=this.bracketStack.pop();I!==T&&this.parseError(`Expected "${I}" got "${T}"`)}return F.has(T)&&this.bracketStack.push(F.get(T)),T};return i(e.lexer,{lex:A}),i(g.lexer,{lex:A}),{parse(b,L){return L?g.parse(b):e.parse(b)},*tokenize(b,L,T){let I=L?g:e,B=Object.create(I.lexer);for(B.setInput(b,{parser:I});!B.done;){let R={type:B.lex(),value:B.match,offset:B.yylloc.range[0]};T&&(R.loc={range:B.yylloc.range,start:{line:B.yylloc.first_line,column:B.yylloc.first_column},end:{line:B.yylloc.last_line,column:B.yylloc.last_column}}),yield R}}}}(new ju),ma=WD});var zu={};Fe(zu,{compile:()=>$D,stringify:()=>GD,walk:()=>UD});function $D(n,e){e.put(e.scope.arg1?"arguments[1]":"undefined")}function UD(){}function GD(n,e){e.put("$$")}var rg=z(()=>{});var Ru={};Fe(Ru,{compile:()=>YD,stringify:()=>KD,suggest:()=>VD,walk:()=>QD});function VD(n,e){n.elements.length===0&&e.queryRoot(n.range[0]+1,n.range[1]-1)}function YD(n,e){e.put("["),e.list(n.elements,","),e.put("]")}function QD(n,e){e.list(n.elements)}function KD(n,e){e.put("["),e.list(n.elements,","),e.put("]")}var ig=z(()=>{});var Hu={};Fe(Hu,{compile:()=>JD,stringify:()=>eA,suggest:()=>ZD,walk:()=>XD});function ZD(n,e){Array.isArray(n.assertion)||(e.range(n.assertion.range,"var"),e.range(n.assertion.range,"assertion"))}function JD(n,e){if(Array.isArray(n.assertion)){e.put(n.negation?"!(":"(");for(let i=0;i<n.assertion.length;i++)if(i%2===0)e.node(n.assertion[i]);else switch(n.assertion[i]){case"and":e.put("&&");break;case"or":e.put("||");break;default:e.error("Bad conjuction operator in assertion",n)}e.put(")")}else switch(n.negation&&e.put("!"),n.assertion.type){case"Identifier":n.assertion.name?(e.put("!!"),e.tolerant&&e.put("(typeof "),e.put("a."),e.put(n.assertion.name),e.tolerant&&(e.put('==="function"?a.'),e.put(n.assertion.name)),e.put(".call(mctx,"),e.nodeOrCurrent(),e.put(")"),e.tolerant&&e.put(":false)"),e.usedAssertions.has(n.assertion.name)?e.usedAssertions.get(n.assertion.name).push(n.assertion.range):e.usedAssertions.set(n.assertion.name,n.assertion.range)):e.put("false");break;case"Method":e.put("!!"),e.node(n.assertion);break;default:e.error('Unknown assertion node type "'+n.assertion.type+'"',n.assertion)}}function XD(n,e){if(Array.isArray(n.assertion))for(let i=0;i<n.assertion.length;i++)i%2===0&&e.node(n.assertion[i]);else e.node(n.assertion)}function eA(n,e){if(n.negation&&e.put("not "),Array.isArray(n.assertion)){e.put("(");for(let i=0;i<n.assertion.length;i++)i%2===0?e.node(n.assertion[i]):(e.put(" "),e.put(n.assertion[i]),e.put(" "));e.put(")")}else e.node(n.assertion)}var og=z(()=>{});var qu={};Fe(qu,{compile:()=>nA,stringify:()=>iA,suggest:()=>tA,walk:()=>rA});function ya(n,e,i){if(i.type==="Array"){if(i.elements.length===0){n.range([i.range[0]+1,i.range[1]-1],"value-subset",e,!1);return}let o=[];for(let{type:c,range:f,value:d}of i.elements)f&&(c==="Literal"||c==="Identifier")&&o.push(d);let l=o.length?n.literalList(o):!1;for(let{type:c,range:f,value:d}of i.elements)f&&(c==="Literal"||c==="Identifier"||c==="GetProperty"&&d===null)&&n.range(f,"value-subset",e,l)}}function tA(n,e){switch(n.operator){case"in":e.range(n.left.range,"in-value",n.right,null),ya(e,n.left,n.right);break;case"not in":ya(e,n.left,n.right);break;case"has":e.range(n.right.range,"in-value",n.left,null),ya(e,n.right,n.left);break;case"has no":ya(e,n.right,n.left);break;case"=":case"!=":e.range(n.right.range,"value",n.left,null);break}}function nA(n,e){if(!(n.operator in sg)){e.error('Unknown operator "'+n.operator+'"',n);return}switch(n.operator){case"and":e.put("!");case"or":{let i=e.allocateVar();e.put(`${e.buildinFn("bool")}(${i}=`),e.node(n.left),e.put(`)?${i}:`),e.createScope(()=>e.node(n.right),o=>(e.put(")"),"("+o+","),e.scope.$ref);break}case"??":{let i=e.allocateVar();e.put(`(${i}=`),e.node(n.left),e.put(`,${i}!==null&&${i}!==undefined)?${i}:`),e.createScope(()=>e.node(n.right),o=>(e.put(")"),"("+o+","),e.scope.$ref);break}case"has no":e.put("!");case"has":e.put(e.buildinFn("in")),e.put("("),e.node(n.right),e.put(","),e.node(n.left),e.put(")");break;default:e.put(e.buildinFn(sg[n.operator])),e.put("("),e.node(n.left),e.put(","),e.node(n.right),e.put(")")}}function rA(n,e){e.node(n.left),e.node(n.right)}function iA(n,e){e.node(n.left),/^[a-z]/i.test(n.operator)?(e.put(" "),e.put(n.operator),e.put(" ")):e.put(n.operator),e.node(n.right)}var sg,ag=z(()=>{sg={in:"in","not in":"notIn",has:"has","has no":"hasNo",and:"and",or:"or","??":"nullish","+":"add","-":"sub","*":"mul","/":"div","%":"mod","=":"eq","!=":"ne","<":"lt","<=":"lte",">":"gt",">=":"gte","~=":"match"}});var _u={};Fe(_u,{compile:()=>sA,stringify:()=>lA,suggest:()=>oA,walk:()=>aA});function oA(n,e){n.body===null&&e.queryRoot(n.range[1])}function sA(n,e){n.definitions.length?(e.put("(()=>{"),e.createScope(()=>{for(let i of n.definitions)e.scope.awaitInit.add(i.declarator.name);e.list(n.definitions),e.put("return "),e.nodeOrCurrent(n.body)},i=>i+";",e.scope.$ref),e.put("})()")):n.body&&n.body.type==="Object"?(e.put("("),e.nodeOrCurrent(n.body),e.put(")")):e.nodeOrCurrent(n.body)}function aA(n,e){e.list(n.definitions),e.nodeOrNothing(n.body)}function lA(n,e){e.list(n.definitions),e.nodeOrNothing(n.body)}var lg=z(()=>{});var Wu={};Fe(Wu,{compile:()=>uA,stringify:()=>fA,walk:()=>cA});function uA(n,e){let i=n.order.startsWith("desc"),o=ug[n.order.slice(i?4:3)]||ug[""];i&&e.put("-"),e.put(e.buildinFn(o)),e.put("((_q=$=>("),e.createScope(()=>e.node(n.query),l=>l+","),e.put("))(_a),_q(_b))")}function cA(n,e){e.node(n.query)}function fA(n,e){e.node(n.query),e.put(" "),e.put(n.order)}var ug,cg=z(()=>{ug={"":"cmp",N:"cmpNatural",A:"cmpAnalytical",NA:"cmpNaturalAnalytical",AN:"cmpNaturalAnalytical"}});var $u={};Fe($u,{compile:()=>dA,stringify:()=>hA,walk:()=>pA});function dA(n,e){e.put("(_a, _b)=>{let _q;return "),e.list(n.compares,"||"),e.put("||0}")}function pA(n,e){e.list(n.compares)}function hA(n,e){e.list(n.compares,",")}var fg=z(()=>{});var Uu={};Fe(Uu,{compile:()=>gA,stringify:()=>yA,walk:()=>mA});function gA(n,e){e.put(e.buildinFn("bool")),e.put("("),e.nodeOrCurrent(n.test),e.put(")?"),e.createScope(()=>e.nodeOrCurrent(n.consequent),i=>(e.put(")"),"("+i+","),e.scope.$ref),e.put(":"),e.createScope(()=>{n.alternate?n.alternate.type==="Placeholder"?(e.put("("),e.node(n.alternate),e.put(",undefined)")):e.node(n.alternate):e.put("undefined")},i=>(e.put(")"),"("+i+","),e.scope.$ref)}function mA(n,e){e.nodeOrNothing(n.test),e.nodeOrNothing(n.consequent),e.nodeOrNothing(n.alternate)}function yA(n,e){e.nodeOrNothing(n.test),e.put("?"),e.nodeOrNothing(n.consequent),n.alternate&&(e.put(":"),e.node(n.alternate))}var dg=z(()=>{});var Gu={};Fe(Gu,{compile:()=>vA,stringify:()=>bA,walk:()=>wA});function vA(n,e){e.put("context")}function wA(){}function bA(n,e){e.put("#")}var pg=z(()=>{});var Vu={};Fe(Vu,{compile:()=>kA,stringify:()=>DA,suggest:()=>xA,walk:()=>CA});function xA(n,e){n.range&&e.range(n.range,"var")}function kA(n,e){e.put(e.scope.$ref)}function CA(){}function DA(n,e){e.put("$")}var hg=z(()=>{});var Yu={};Fe(Yu,{compile:()=>AA,stringify:()=>EA,walk:()=>SA});function AA(n,e){e.put("data")}function SA(){}function EA(n,e){e.put("@")}var gg=z(()=>{});var Qu={};Fe(Qu,{compile:()=>MA,stringify:()=>TA,walk:()=>LA});function MA(n,e){n.name&&e.put("$"+n.name)}function LA(){}function TA(n,e){e.put(n.name?"$"+n.name:"$")}var mg=z(()=>{});function Fo(n,e){return{type:"GetProperty",value:n,property:e}}function No(n){return{type:"Identifier",name:n}}var Ku=z(()=>{});var Zu={};Fe(Zu,{compile:()=>OA,stringify:()=>BA,suggest:()=>NA,walk:()=>IA});function NA(n,e){n.value===null&&e.range(n.declarator.range,"path")}function OA(n,e){if(n.declarator.name===null){e.node(n.declarator),e.nodeOrCurrent(n.value),e.put(";");return}if(e.scope.own.has(n.declarator.name)){e.error(`Identifier "$${n.declarator.name}" has already been declared`,n.declarator);return}if(FA.includes(n.declarator.name)){e.error(`Identifier "$${n.declarator.name}" is reserved for future use`,n.declarator);return}e.put("const "),e.node(n.declarator),e.put("="),e.node(n.value||Fo(null,No(n.declarator.name))),e.put(";"),e.scope.add(n.declarator.name),e.scope.own.add(n.declarator.name),e.scope.awaitInit.delete(n.declarator.name)}function IA(n,e){e.node(n.declarator),e.nodeOrNothing(n.value)}function BA(n,e){e.node(n.declarator),n.value!==null&&(e.put(":"),e.node(n.value)),e.put(";")}var FA,yg=z(()=>{Ku();FA=["data","context","ctx","array","idx","index"]});var Ju={};Fe(Ju,{compile:()=>PA,stringify:()=>zA,walk:()=>jA});function PA(n,e){e.put(e.buildinFn("filter")),e.put("("),e.nodeOrCurrent(n.value),e.put(",$=>"),e.createScope(()=>e.node(n.query),i=>(e.put(")"),"("+i+",")),e.put(")")}function jA(n,e){e.nodeOrNothing(n.value),e.node(n.query)}function zA(n,e){e.nodeOrNothing(n.value),e.put(".["),e.node(n.query),e.put("]")}var vg=z(()=>{});var Xu={};Fe(Xu,{compile:()=>RA,stringify:()=>qA,walk:()=>HA});function RA(n,e){let i=n.arguments.map(l=>"$"+l.name),o=n.arguments.find((l,c)=>c>0&&i.lastIndexOf("$"+l.name,c-1)!==-1);o&&e.error('Duplicate parameter name "$'+o.name+'" is not allowed',o),e.put("function("),e.put(String(i)||"$"),e.put("){return "),e.createScope(()=>{e.scope.arg1=!0,e.scope.$ref=i[0]||"$";for(let l of n.arguments)e.scope.add(l.name);e.node(n.body)},l=>l+","),e.put("}")}function HA(n,e){e.node(n.body)}function qA(n,e){e.put("=>"),e.node(n.body)}var wg=z(()=>{});var ec={};Fe(ec,{compile:()=>WA,stringify:()=>UA,suggest:()=>_A,walk:()=>$A});function _A(n,e){e.range(n.property.range,"path",n.value||void 0,!n.value),n.value===null&&e.range(n.property.range,"var"),n.range&&n.value===null&&n.property.range[0]!==n.range[0]&&e.queryRoot(n.range[0])}function WA(n,e){e.put(e.buildinFn("map")),e.put("("),e.nodeOrCurrent(n.value),e.put(","),n.property.type==="Identifier"?e.put(JSON.stringify(n.property.name)):e.node(n.property),e.put(")")}function $A(n,e){e.nodeOrNothing(n.value),e.node(n.property)}function UA(n,e){e.nodeOrNothing(n.value)&&e.put("."),e.node(n.property)}var bg=z(()=>{});var tc={};Fe(tc,{compile:()=>GA,stringify:()=>YA,walk:()=>VA});function GA(n,e){e.put(n.name)}function VA(){}function YA(n,e){e.put(n.name)}var xg=z(()=>{});var nc={};Fe(nc,{compile:()=>QA,stringify:()=>ZA,walk:()=>KA});function QA(n,e){e.put(typeof n.value=="string"?JSON.stringify(n.value):String(n.value))}function KA(){}function ZA(n,e){e.put(typeof n.value=="string"?JSON.stringify(n.value):String(n.value))}var kg=z(()=>{});var rc={};Fe(rc,{compile:()=>JA,stringify:()=>eS,walk:()=>XA});function JA(n,e){e.put(e.buildinFn("map")),e.put("("),e.nodeOrCurrent(n.value),e.put(",$=>"),e.createScope(()=>e.node(n.query),i=>(e.put(")"),"("+i+",")),e.put(")")}function XA(n,e){e.nodeOrNothing(n.value),e.node(n.query)}function eS(n,e){e.nodeOrNothing(n.value),e.put(".("),e.node(n.query),e.put(")")}var Cg=z(()=>{});var ic={};Fe(ic,{compile:()=>tS,stringify:()=>rS,walk:()=>nS});function tS(n,e){e.put(e.buildinFn("mapRecursive")),e.put("("),e.nodeOrCurrent(n.value),e.put(",$=>"),e.createScope(()=>e.node(n.query),i=>(e.put(")"),"("+i+",")),e.put(")")}function nS(n,e){e.nodeOrNothing(n.value),e.node(n.query)}function rS(n,e){e.nodeOrNothing(n.value),e.put(".."),e.isSimpleGetPropertyQuery(n.query)||e.isSimpleMethodCallQuery(n.query)?e.node(n.query):(e.put("("),e.node(n.query),e.put(")"))}var Dg=z(()=>{});var oc={};Fe(oc,{compile:()=>oS,stringify:()=>aS,suggest:()=>iS,walk:()=>sS});function iS(n,e){n.arguments.length===0&&e.queryRoot(n.range[1]-1)}function oS(n,e,i){let o=n.reference.type==="Identifier";e.tolerant&&e.put("(typeof "),o&&(e.usedMethods.has(n.reference.name)?e.usedMethods.get(n.reference.name).push(n.reference.range):e.usedMethods.set(n.reference.name,[n.reference.range]),e.put("m.")),e.node(n.reference),e.tolerant&&(e.put('==="function"?'),o&&e.put("m."),e.node(n.reference)),e.put(o?".call(mctx,":"("),e.nodeOrCurrent(i),n.arguments.length&&(e.put(","),e.list(n.arguments,",")),e.put(")"),e.tolerant&&e.put(":undefined)")}function sS(n,e){e.node(n.reference),e.list(n.arguments)}function aS(n,e){e.node(n.reference),e.put("("),e.list(n.arguments,","),e.put(")")}var Ag=z(()=>{});var sc={};Fe(sc,{compile:()=>lS,stringify:()=>cS,walk:()=>uS});function lS(n,e){e.node(n.method,n.value)}function uS(n,e){e.nodeOrNothing(n.value),e.node(n.method)}function cS(n,e){e.nodeOrNothing(n.value)&&e.put("."),e.node(n.method)}var Sg=z(()=>{});var ac={};Fe(ac,{compile:()=>dS,stringify:()=>hS,suggest:()=>fS,walk:()=>pS});function fS(n,e){n.properties.length===0&&e.queryRoot(n.range[0]+1,n.range[1]-1)}function dS(n,e){e.put("{"),e.list(n.properties,","),e.put("}")}function pS(n,e){e.list(n.properties)}function hS(n,e){e.put("{"),e.list(n.properties,","),e.put("}")}var Eg=z(()=>{});var lc={};Fe(lc,{compile:()=>yS,stringify:()=>wS,suggest:()=>mS,walk:()=>vS});function mS(n,e){if(n.value===null)switch(n.key.type){case"Literal":case"Identifier":e.range(n.range,"path"),e.range(n.range,"var");break;case"Current":case"Reference":e.range(n.range,"var");break}}function yS(n,e){let i=n.value;switch(n.key.type){case"Current":e.put("...null");return;case"Literal":e.node(n.key),i=i||Fo(null,No(String(n.key.value)));break;case"Identifier":e.node(n.key),i=i||Fo(null,No(n.key.name));break;case"Reference":e.node(n.key.name),i=i||n.key;break;default:e.put("["),e.node(n.key),e.put("]")}e.put(":"),e.node(i)}function vS(n,e){e.node(n.key),e.nodeOrNothing(n.value)}function wS(n,e){if(gS.has(n.key.type)){if(e.node(n.key),n.value===null)return}else e.put("["),e.node(n.key),e.put("]");e.put(":"),e.node(n.value)}var gS,Mg=z(()=>{Ku();gS=new Set(["Literal","Identifier","Reference","Current"])});var uc={};Fe(uc,{compile:()=>bS,stringify:()=>kS,walk:()=>xS});function bS(n,e){e.put("("),e.node(n.body),e.put(")")}function xS(n,e){e.node(n.body)}function kS(n,e){e.put("("),e.node(n.body),e.put(")")}var Lg=z(()=>{});var cc={};Fe(cc,{compile:()=>DS,stringify:()=>SS,suggest:()=>CS,walk:()=>AS});function CS(n,e){if(n.getter===null){let i=n.range[1]-1;e.range([i,i],"key",n.value,!1),e.queryRoot(i)}else(n.getter.type==="GetProperty"||n.getter.type==="Reference"||n.getter.type==="Literal"&&typeof n.getter.value=="string")&&e.range(n.getter.range,"key",n.value,!1)}function DS(n,e){e.put(e.buildinFn("pick")),e.put("("),e.node(n.value),n.getter&&(e.put(","),e.node(n.getter)),e.put(")")}function AS(n,e){e.node(n.value),n.getter!==null&&e.node(n.getter)}function SS(n,e){e.node(n.value),e.put("["),n.getter!==null&&e.node(n.getter),e.put("]")}var Tg=z(()=>{});var fc={};Fe(fc,{compile:()=>ES,stringify:()=>LS,walk:()=>MS});function ES(n,e){e.put("($=>("),e.createScope(()=>e.node(n.right),i=>i+","),e.put("))"),e.put("("),e.nodeOrCurrent(n.left),e.put(")")}function MS(n,e){e.node(n.left),e.node(n.right)}function LS(n,e){e.node(n.left),e.put("|"),e.node(n.right)}var Fg=z(()=>{});var dc={};Fe(dc,{compile:()=>FS,stringify:()=>OS,suggest:()=>TS,walk:()=>NS});function TS(n,e){e.queryRoot(n.range[1])}function FS(n,e){e.put(e.scope.$ref)}function NS(){}function OS(){}var Ng=z(()=>{});var pc={};Fe(pc,{compile:()=>IS,stringify:()=>PS,walk:()=>BS});function IS(n,e){if(n.operator&&n.operator.type){e.put("($=>("),e.createScope(()=>e.node(n.operator),i=>i+","),e.put("))"),e.put("("),e.node(n.argument),e.put(")");return}e.error('Unknown operator "'+n.operator+'"',n)}function BS(n,e){e.node(n.argument),n.operator&&n.operator.type&&e.node(n.operator)}function PS(n,e){e.node(n.argument),e.put(" "),e.node(n.operator)}var Og=z(()=>{});var hc={};Fe(hc,{compile:()=>jS,stringify:()=>RS,walk:()=>zS});function jS(n,e){switch(n.operator){case"no":case"not":e.put("!"),e.put(e.buildinFn("bool")),e.put("("),e.node(n.argument),e.put(")");break;case"+":case"-":e.put(n.operator),e.node(n.argument);break;case"is":e.put("!!("),e.node(n.argument),e.put(")");break;default:e.error('Unknown operator "'+n.operator+'"',n)}}function zS(n,e){e.node(n.argument),n.operator&&n.operator.type&&e.node(n.operator)}function RS(n,e){e.put(n.operator),n.operator!=="-"&&n.operator!=="+"&&e.put(" "),e.node(n.argument)}var Ig=z(()=>{});var gc={};Fe(gc,{compile:()=>qS,stringify:()=>WS,suggest:()=>HS,walk:()=>_S});function HS(n,e){n.range&&e.range(n.range,"var")}function qS(n,e){let i=n.name,o=e.scope.has(i.name),l=e.scope.awaitInit.has(i.name);if(!o||l){l?(e.put("f.unsafeRef(()=>$"),e.node(i),e.tolerant||(e.put(","),e.put(JSON.stringify(i.name)),e.put(","),e.put(JSON.stringify(i.range))),e.put(")")):e.tolerant?e.put("undefined"):e.error(`$${i.name} is not defined`,i);return}e.put("$"),e.node(i)}function _S(n,e){e.node(n.name)}function WS(n,e){e.put("$"),e.node(n.name)}var Bg=z(()=>{});var mc={};Fe(mc,{compile:()=>$S,stringify:()=>GS,walk:()=>US});function $S(n,e){e.put(e.buildinFn("slice")),e.put("("),e.nodeOrCurrent(n.value),n.arguments.slice(0,3).forEach(i=>{e.put(","),i?e.node(i):e.put("undefined")}),e.put(")")}function US(n,e){e.nodeOrNothing(n.value);for(let i of n.arguments.slice(0,3))i&&e.node(i)}function GS(n,e){let[i,o,l]=n.arguments;e.nodeOrNothing(n.value),e.put("["),i&&e.node(i),e.put(":"),o&&e.node(o),l&&(e.put(":"),e.node(l)),e.put("]")}var Pg=z(()=>{});var yc={};Fe(yc,{compile:()=>YS,stringify:()=>KS,suggest:()=>VS,walk:()=>QS});function VS(n,e){n.query===null&&e.queryRoot(n.range[1])}function YS(n,e){if(n.array){e.put("..."),e.put(e.buildinFn("ensureArray")),e.put("("),e.nodeOrCurrent(n.query),e.put(")");return}e.put("..."),e.nodeOrCurrent(n.query)}function QS(n,e){e.nodeOrNothing(n.query)}function KS(n,e){e.put("..."),e.nodeOrNothing(n.query)}var jg=z(()=>{});var vc={};Fe(vc,{compile:()=>JS,stringify:()=>eE,suggest:()=>ZS,walk:()=>XS});function ZS(n,e){for(let[i,o]of Object.entries(n.values))o===null&&e.queryRoot(n.values[Number(i)-1].range[1])}function JS(n,e){for(let[i,o]of Object.entries(n.values)){let l=Number(i);o!==null&&(l!==0&&e.put("+"),l%2===0?e.put('"'+zg(o.value,tE)+'"'):(e.put("("),e.node(o),e.put(")")))}}function XS(n,e){for(let i of n.values)i!==null&&e.node(i)}function eE(n,e){let i=n.values.length-1;for(let[o,l]of Object.entries(n.values)){let c=Number(o);c%2===0?(e.put(c===0?"`":"}"),e.put(zg(l.value,nE)),e.put(c===i?"`":"${")):l!==null&&e.node(l)}}function zg(n,e){let i="";for(let o=0;o<n.length;o++)i+=e.get(n[o])||n[o];return i}var tE,nE,Rg=z(()=>{tE=new Map([["\b","\\b"],[`
|
|
49
|
+
`:this.prevYylloc={...this.prevYylloc,last_line:this.prevYylloc.last_line+1,last_column:0,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]};break}return this.prevToken=I}});let F=new Map([["(",")"],[".(",")"],["..(",")"],["METHOD(",")"],["$METHOD(",")"],["[","]"],[".[","]"],["{","}"],["TPL_START","TPL_END"]]),N=new Set([")","]","}","TPL_END"]),A=b=>function(){let T=b.call(this);if(N.has(T)){let I=this.bracketStack.pop();I!==T&&this.parseError(`Expected "${I}" got "${T}"`)}return F.has(T)&&this.bracketStack.push(F.get(T)),T};return i(e.lexer,{lex:A}),i(g.lexer,{lex:A}),{parse(b,L){return L?g.parse(b):e.parse(b)},*tokenize(b,L,T){let I=L?g:e,B=Object.create(I.lexer);for(B.setInput(b,{parser:I});!B.done;){let R={type:B.lex(),value:B.match,offset:B.yylloc.range[0]};T&&(R.loc={range:B.yylloc.range,start:{line:B.yylloc.first_line,column:B.yylloc.first_column},end:{line:B.yylloc.last_line,column:B.yylloc.last_column}}),yield R}}}})(new ju),ma=WD});var zu={};Fe(zu,{compile:()=>$D,stringify:()=>GD,walk:()=>UD});function $D(n,e){e.put(e.scope.arg1?"arguments[1]":"undefined")}function UD(){}function GD(n,e){e.put("$$")}var rg=z(()=>{});var Ru={};Fe(Ru,{compile:()=>YD,stringify:()=>KD,suggest:()=>VD,walk:()=>QD});function VD(n,e){n.elements.length===0&&e.queryRoot(n.range[0]+1,n.range[1]-1)}function YD(n,e){e.put("["),e.list(n.elements,","),e.put("]")}function QD(n,e){e.list(n.elements)}function KD(n,e){e.put("["),e.list(n.elements,","),e.put("]")}var ig=z(()=>{});var Hu={};Fe(Hu,{compile:()=>JD,stringify:()=>eA,suggest:()=>ZD,walk:()=>XD});function ZD(n,e){Array.isArray(n.assertion)||(e.range(n.assertion.range,"var"),e.range(n.assertion.range,"assertion"))}function JD(n,e){if(Array.isArray(n.assertion)){e.put(n.negation?"!(":"(");for(let i=0;i<n.assertion.length;i++)if(i%2===0)e.node(n.assertion[i]);else switch(n.assertion[i]){case"and":e.put("&&");break;case"or":e.put("||");break;default:e.error("Bad conjuction operator in assertion",n)}e.put(")")}else switch(n.negation&&e.put("!"),n.assertion.type){case"Identifier":n.assertion.name?(e.put("!!"),e.tolerant&&e.put("(typeof "),e.put("a."),e.put(n.assertion.name),e.tolerant&&(e.put('==="function"?a.'),e.put(n.assertion.name)),e.put(".call(mctx,"),e.nodeOrCurrent(),e.put(")"),e.tolerant&&e.put(":false)"),e.usedAssertions.has(n.assertion.name)?e.usedAssertions.get(n.assertion.name).push(n.assertion.range):e.usedAssertions.set(n.assertion.name,n.assertion.range)):e.put("false");break;case"Method":e.put("!!"),e.node(n.assertion);break;default:e.error('Unknown assertion node type "'+n.assertion.type+'"',n.assertion)}}function XD(n,e){if(Array.isArray(n.assertion))for(let i=0;i<n.assertion.length;i++)i%2===0&&e.node(n.assertion[i]);else e.node(n.assertion)}function eA(n,e){if(n.negation&&e.put("not "),Array.isArray(n.assertion)){e.put("(");for(let i=0;i<n.assertion.length;i++)i%2===0?e.node(n.assertion[i]):(e.put(" "),e.put(n.assertion[i]),e.put(" "));e.put(")")}else e.node(n.assertion)}var og=z(()=>{});var qu={};Fe(qu,{compile:()=>nA,stringify:()=>iA,suggest:()=>tA,walk:()=>rA});function ya(n,e,i){if(i.type==="Array"){if(i.elements.length===0){n.range([i.range[0]+1,i.range[1]-1],"value-subset",e,!1);return}let o=[];for(let{type:c,range:f,value:d}of i.elements)f&&(c==="Literal"||c==="Identifier")&&o.push(d);let l=o.length?n.literalList(o):!1;for(let{type:c,range:f,value:d}of i.elements)f&&(c==="Literal"||c==="Identifier"||c==="GetProperty"&&d===null)&&n.range(f,"value-subset",e,l)}}function tA(n,e){switch(n.operator){case"in":e.range(n.left.range,"in-value",n.right,null),ya(e,n.left,n.right);break;case"not in":ya(e,n.left,n.right);break;case"has":e.range(n.right.range,"in-value",n.left,null),ya(e,n.right,n.left);break;case"has no":ya(e,n.right,n.left);break;case"=":case"!=":e.range(n.right.range,"value",n.left,null);break}}function nA(n,e){if(!(n.operator in sg)){e.error('Unknown operator "'+n.operator+'"',n);return}switch(n.operator){case"and":e.put("!");case"or":{let i=e.allocateVar();e.put(`${e.buildinFn("bool")}(${i}=`),e.node(n.left),e.put(`)?${i}:`),e.createScope(()=>e.node(n.right),o=>(e.put(")"),"("+o+","),e.scope.$ref);break}case"??":{let i=e.allocateVar();e.put(`(${i}=`),e.node(n.left),e.put(`,${i}!==null&&${i}!==undefined)?${i}:`),e.createScope(()=>e.node(n.right),o=>(e.put(")"),"("+o+","),e.scope.$ref);break}case"has no":e.put("!");case"has":e.put(e.buildinFn("in")),e.put("("),e.node(n.right),e.put(","),e.node(n.left),e.put(")");break;default:e.put(e.buildinFn(sg[n.operator])),e.put("("),e.node(n.left),e.put(","),e.node(n.right),e.put(")")}}function rA(n,e){e.node(n.left),e.node(n.right)}function iA(n,e){e.node(n.left),/^[a-z]/i.test(n.operator)?(e.put(" "),e.put(n.operator),e.put(" ")):e.put(n.operator),e.node(n.right)}var sg,ag=z(()=>{sg={in:"in","not in":"notIn",has:"has","has no":"hasNo",and:"and",or:"or","??":"nullish","+":"add","-":"sub","*":"mul","/":"div","%":"mod","=":"eq","!=":"ne","<":"lt","<=":"lte",">":"gt",">=":"gte","~=":"match"}});var _u={};Fe(_u,{compile:()=>sA,stringify:()=>lA,suggest:()=>oA,walk:()=>aA});function oA(n,e){n.body===null&&e.queryRoot(n.range[1])}function sA(n,e){n.definitions.length?(e.put("(()=>{"),e.createScope(()=>{for(let i of n.definitions)e.scope.awaitInit.add(i.declarator.name);e.list(n.definitions),e.put("return "),e.nodeOrCurrent(n.body)},i=>i+";",e.scope.$ref),e.put("})()")):n.body&&n.body.type==="Object"?(e.put("("),e.nodeOrCurrent(n.body),e.put(")")):e.nodeOrCurrent(n.body)}function aA(n,e){e.list(n.definitions),e.nodeOrNothing(n.body)}function lA(n,e){e.list(n.definitions),e.nodeOrNothing(n.body)}var lg=z(()=>{});var Wu={};Fe(Wu,{compile:()=>uA,stringify:()=>fA,walk:()=>cA});function uA(n,e){let i=n.order.startsWith("desc"),o=ug[n.order.slice(i?4:3)]||ug[""];i&&e.put("-"),e.put(e.buildinFn(o)),e.put("((_q=$=>("),e.createScope(()=>e.node(n.query),l=>l+","),e.put("))(_a),_q(_b))")}function cA(n,e){e.node(n.query)}function fA(n,e){e.node(n.query),e.put(" "),e.put(n.order)}var ug,cg=z(()=>{ug={"":"cmp",N:"cmpNatural",A:"cmpAnalytical",NA:"cmpNaturalAnalytical",AN:"cmpNaturalAnalytical"}});var $u={};Fe($u,{compile:()=>dA,stringify:()=>hA,walk:()=>pA});function dA(n,e){e.put("(_a, _b)=>{let _q;return "),e.list(n.compares,"||"),e.put("||0}")}function pA(n,e){e.list(n.compares)}function hA(n,e){e.list(n.compares,",")}var fg=z(()=>{});var Uu={};Fe(Uu,{compile:()=>gA,stringify:()=>yA,walk:()=>mA});function gA(n,e){e.put(e.buildinFn("bool")),e.put("("),e.nodeOrCurrent(n.test),e.put(")?"),e.createScope(()=>e.nodeOrCurrent(n.consequent),i=>(e.put(")"),"("+i+","),e.scope.$ref),e.put(":"),e.createScope(()=>{n.alternate?n.alternate.type==="Placeholder"?(e.put("("),e.node(n.alternate),e.put(",undefined)")):e.node(n.alternate):e.put("undefined")},i=>(e.put(")"),"("+i+","),e.scope.$ref)}function mA(n,e){e.nodeOrNothing(n.test),e.nodeOrNothing(n.consequent),e.nodeOrNothing(n.alternate)}function yA(n,e){e.nodeOrNothing(n.test),e.put("?"),e.nodeOrNothing(n.consequent),n.alternate&&(e.put(":"),e.node(n.alternate))}var dg=z(()=>{});var Gu={};Fe(Gu,{compile:()=>vA,stringify:()=>bA,walk:()=>wA});function vA(n,e){e.put("context")}function wA(){}function bA(n,e){e.put("#")}var pg=z(()=>{});var Vu={};Fe(Vu,{compile:()=>kA,stringify:()=>DA,suggest:()=>xA,walk:()=>CA});function xA(n,e){n.range&&e.range(n.range,"var")}function kA(n,e){e.put(e.scope.$ref)}function CA(){}function DA(n,e){e.put("$")}var hg=z(()=>{});var Yu={};Fe(Yu,{compile:()=>AA,stringify:()=>EA,walk:()=>SA});function AA(n,e){e.put("data")}function SA(){}function EA(n,e){e.put("@")}var gg=z(()=>{});var Qu={};Fe(Qu,{compile:()=>MA,stringify:()=>TA,walk:()=>LA});function MA(n,e){n.name&&e.put("$"+n.name)}function LA(){}function TA(n,e){e.put(n.name?"$"+n.name:"$")}var mg=z(()=>{});function Fo(n,e){return{type:"GetProperty",value:n,property:e}}function No(n){return{type:"Identifier",name:n}}var Ku=z(()=>{});var Zu={};Fe(Zu,{compile:()=>OA,stringify:()=>BA,suggest:()=>NA,walk:()=>IA});function NA(n,e){n.value===null&&e.range(n.declarator.range,"path")}function OA(n,e){if(n.declarator.name===null){e.node(n.declarator),e.nodeOrCurrent(n.value),e.put(";");return}if(e.scope.own.has(n.declarator.name)){e.error(`Identifier "$${n.declarator.name}" has already been declared`,n.declarator);return}if(FA.includes(n.declarator.name)){e.error(`Identifier "$${n.declarator.name}" is reserved for future use`,n.declarator);return}e.put("const "),e.node(n.declarator),e.put("="),e.node(n.value||Fo(null,No(n.declarator.name))),e.put(";"),e.scope.add(n.declarator.name),e.scope.own.add(n.declarator.name),e.scope.awaitInit.delete(n.declarator.name)}function IA(n,e){e.node(n.declarator),e.nodeOrNothing(n.value)}function BA(n,e){e.node(n.declarator),n.value!==null&&(e.put(":"),e.node(n.value)),e.put(";")}var FA,yg=z(()=>{Ku();FA=["data","context","ctx","array","idx","index"]});var Ju={};Fe(Ju,{compile:()=>PA,stringify:()=>zA,walk:()=>jA});function PA(n,e){e.put(e.buildinFn("filter")),e.put("("),e.nodeOrCurrent(n.value),e.put(",$=>"),e.createScope(()=>e.node(n.query),i=>(e.put(")"),"("+i+",")),e.put(")")}function jA(n,e){e.nodeOrNothing(n.value),e.node(n.query)}function zA(n,e){e.nodeOrNothing(n.value),e.put(".["),e.node(n.query),e.put("]")}var vg=z(()=>{});var Xu={};Fe(Xu,{compile:()=>RA,stringify:()=>qA,walk:()=>HA});function RA(n,e){let i=n.arguments.map(l=>"$"+l.name),o=n.arguments.find((l,c)=>c>0&&i.lastIndexOf("$"+l.name,c-1)!==-1);o&&e.error('Duplicate parameter name "$'+o.name+'" is not allowed',o),e.put("function("),e.put(String(i)||"$"),e.put("){return "),e.createScope(()=>{e.scope.arg1=!0,e.scope.$ref=i[0]||"$";for(let l of n.arguments)e.scope.add(l.name);e.node(n.body)},l=>l+","),e.put("}")}function HA(n,e){e.node(n.body)}function qA(n,e){e.put("=>"),e.node(n.body)}var wg=z(()=>{});var ec={};Fe(ec,{compile:()=>WA,stringify:()=>UA,suggest:()=>_A,walk:()=>$A});function _A(n,e){e.range(n.property.range,"path",n.value||void 0,!n.value),n.value===null&&e.range(n.property.range,"var"),n.range&&n.value===null&&n.property.range[0]!==n.range[0]&&e.queryRoot(n.range[0])}function WA(n,e){e.put(e.buildinFn("map")),e.put("("),e.nodeOrCurrent(n.value),e.put(","),n.property.type==="Identifier"?e.put(JSON.stringify(n.property.name)):e.node(n.property),e.put(")")}function $A(n,e){e.nodeOrNothing(n.value),e.node(n.property)}function UA(n,e){e.nodeOrNothing(n.value)&&e.put("."),e.node(n.property)}var bg=z(()=>{});var tc={};Fe(tc,{compile:()=>GA,stringify:()=>YA,walk:()=>VA});function GA(n,e){e.put(n.name)}function VA(){}function YA(n,e){e.put(n.name)}var xg=z(()=>{});var nc={};Fe(nc,{compile:()=>QA,stringify:()=>ZA,walk:()=>KA});function QA(n,e){e.put(typeof n.value=="string"?JSON.stringify(n.value):String(n.value))}function KA(){}function ZA(n,e){e.put(typeof n.value=="string"?JSON.stringify(n.value):String(n.value))}var kg=z(()=>{});var rc={};Fe(rc,{compile:()=>JA,stringify:()=>eS,walk:()=>XA});function JA(n,e){e.put(e.buildinFn("map")),e.put("("),e.nodeOrCurrent(n.value),e.put(",$=>"),e.createScope(()=>e.node(n.query),i=>(e.put(")"),"("+i+",")),e.put(")")}function XA(n,e){e.nodeOrNothing(n.value),e.node(n.query)}function eS(n,e){e.nodeOrNothing(n.value),e.put(".("),e.node(n.query),e.put(")")}var Cg=z(()=>{});var ic={};Fe(ic,{compile:()=>tS,stringify:()=>rS,walk:()=>nS});function tS(n,e){e.put(e.buildinFn("mapRecursive")),e.put("("),e.nodeOrCurrent(n.value),e.put(",$=>"),e.createScope(()=>e.node(n.query),i=>(e.put(")"),"("+i+",")),e.put(")")}function nS(n,e){e.nodeOrNothing(n.value),e.node(n.query)}function rS(n,e){e.nodeOrNothing(n.value),e.put(".."),e.isSimpleGetPropertyQuery(n.query)||e.isSimpleMethodCallQuery(n.query)?e.node(n.query):(e.put("("),e.node(n.query),e.put(")"))}var Dg=z(()=>{});var oc={};Fe(oc,{compile:()=>oS,stringify:()=>aS,suggest:()=>iS,walk:()=>sS});function iS(n,e){n.arguments.length===0&&e.queryRoot(n.range[1]-1)}function oS(n,e,i){let o=n.reference.type==="Identifier";e.tolerant&&e.put("(typeof "),o&&(e.usedMethods.has(n.reference.name)?e.usedMethods.get(n.reference.name).push(n.reference.range):e.usedMethods.set(n.reference.name,[n.reference.range]),e.put("m.")),e.node(n.reference),e.tolerant&&(e.put('==="function"?'),o&&e.put("m."),e.node(n.reference)),e.put(o?".call(mctx,":"("),e.nodeOrCurrent(i),n.arguments.length&&(e.put(","),e.list(n.arguments,",")),e.put(")"),e.tolerant&&e.put(":undefined)")}function sS(n,e){e.node(n.reference),e.list(n.arguments)}function aS(n,e){e.node(n.reference),e.put("("),e.list(n.arguments,","),e.put(")")}var Ag=z(()=>{});var sc={};Fe(sc,{compile:()=>lS,stringify:()=>cS,walk:()=>uS});function lS(n,e){e.node(n.method,n.value)}function uS(n,e){e.nodeOrNothing(n.value),e.node(n.method)}function cS(n,e){e.nodeOrNothing(n.value)&&e.put("."),e.node(n.method)}var Sg=z(()=>{});var ac={};Fe(ac,{compile:()=>dS,stringify:()=>hS,suggest:()=>fS,walk:()=>pS});function fS(n,e){n.properties.length===0&&e.queryRoot(n.range[0]+1,n.range[1]-1)}function dS(n,e){e.put("{"),e.list(n.properties,","),e.put("}")}function pS(n,e){e.list(n.properties)}function hS(n,e){e.put("{"),e.list(n.properties,","),e.put("}")}var Eg=z(()=>{});var lc={};Fe(lc,{compile:()=>yS,stringify:()=>wS,suggest:()=>mS,walk:()=>vS});function mS(n,e){if(n.value===null)switch(n.key.type){case"Literal":case"Identifier":e.range(n.range,"path"),e.range(n.range,"var");break;case"Current":case"Reference":e.range(n.range,"var");break}}function yS(n,e){let i=n.value;switch(n.key.type){case"Current":e.put("...null");return;case"Literal":e.node(n.key),i=i||Fo(null,No(String(n.key.value)));break;case"Identifier":e.node(n.key),i=i||Fo(null,No(n.key.name));break;case"Reference":e.node(n.key.name),i=i||n.key;break;default:e.put("["),e.node(n.key),e.put("]")}e.put(":"),e.node(i)}function vS(n,e){e.node(n.key),e.nodeOrNothing(n.value)}function wS(n,e){if(gS.has(n.key.type)){if(e.node(n.key),n.value===null)return}else e.put("["),e.node(n.key),e.put("]");e.put(":"),e.node(n.value)}var gS,Mg=z(()=>{Ku();gS=new Set(["Literal","Identifier","Reference","Current"])});var uc={};Fe(uc,{compile:()=>bS,stringify:()=>kS,walk:()=>xS});function bS(n,e){e.put("("),e.node(n.body),e.put(")")}function xS(n,e){e.node(n.body)}function kS(n,e){e.put("("),e.node(n.body),e.put(")")}var Lg=z(()=>{});var cc={};Fe(cc,{compile:()=>DS,stringify:()=>SS,suggest:()=>CS,walk:()=>AS});function CS(n,e){if(n.getter===null){let i=n.range[1]-1;e.range([i,i],"key",n.value,!1),e.queryRoot(i)}else(n.getter.type==="GetProperty"||n.getter.type==="Reference"||n.getter.type==="Literal"&&typeof n.getter.value=="string")&&e.range(n.getter.range,"key",n.value,!1)}function DS(n,e){e.put(e.buildinFn("pick")),e.put("("),e.node(n.value),n.getter&&(e.put(","),e.node(n.getter)),e.put(")")}function AS(n,e){e.node(n.value),n.getter!==null&&e.node(n.getter)}function SS(n,e){e.node(n.value),e.put("["),n.getter!==null&&e.node(n.getter),e.put("]")}var Tg=z(()=>{});var fc={};Fe(fc,{compile:()=>ES,stringify:()=>LS,walk:()=>MS});function ES(n,e){e.put("($=>("),e.createScope(()=>e.node(n.right),i=>i+","),e.put("))"),e.put("("),e.nodeOrCurrent(n.left),e.put(")")}function MS(n,e){e.node(n.left),e.node(n.right)}function LS(n,e){e.node(n.left),e.put("|"),e.node(n.right)}var Fg=z(()=>{});var dc={};Fe(dc,{compile:()=>FS,stringify:()=>OS,suggest:()=>TS,walk:()=>NS});function TS(n,e){e.queryRoot(n.range[1])}function FS(n,e){e.put(e.scope.$ref)}function NS(){}function OS(){}var Ng=z(()=>{});var pc={};Fe(pc,{compile:()=>IS,stringify:()=>PS,walk:()=>BS});function IS(n,e){if(n.operator&&n.operator.type){e.put("($=>("),e.createScope(()=>e.node(n.operator),i=>i+","),e.put("))"),e.put("("),e.node(n.argument),e.put(")");return}e.error('Unknown operator "'+n.operator+'"',n)}function BS(n,e){e.node(n.argument),n.operator&&n.operator.type&&e.node(n.operator)}function PS(n,e){e.node(n.argument),e.put(" "),e.node(n.operator)}var Og=z(()=>{});var hc={};Fe(hc,{compile:()=>jS,stringify:()=>RS,walk:()=>zS});function jS(n,e){switch(n.operator){case"no":case"not":e.put("!"),e.put(e.buildinFn("bool")),e.put("("),e.node(n.argument),e.put(")");break;case"+":case"-":e.put(n.operator),e.node(n.argument);break;case"is":e.put("!!("),e.node(n.argument),e.put(")");break;default:e.error('Unknown operator "'+n.operator+'"',n)}}function zS(n,e){e.node(n.argument),n.operator&&n.operator.type&&e.node(n.operator)}function RS(n,e){e.put(n.operator),n.operator!=="-"&&n.operator!=="+"&&e.put(" "),e.node(n.argument)}var Ig=z(()=>{});var gc={};Fe(gc,{compile:()=>qS,stringify:()=>WS,suggest:()=>HS,walk:()=>_S});function HS(n,e){n.range&&e.range(n.range,"var")}function qS(n,e){let i=n.name,o=e.scope.has(i.name),l=e.scope.awaitInit.has(i.name);if(!o||l){l?(e.put("f.unsafeRef(()=>$"),e.node(i),e.tolerant||(e.put(","),e.put(JSON.stringify(i.name)),e.put(","),e.put(JSON.stringify(i.range))),e.put(")")):e.tolerant?e.put("undefined"):e.error(`$${i.name} is not defined`,i);return}e.put("$"),e.node(i)}function _S(n,e){e.node(n.name)}function WS(n,e){e.put("$"),e.node(n.name)}var Bg=z(()=>{});var mc={};Fe(mc,{compile:()=>$S,stringify:()=>GS,walk:()=>US});function $S(n,e){e.put(e.buildinFn("slice")),e.put("("),e.nodeOrCurrent(n.value),n.arguments.slice(0,3).forEach(i=>{e.put(","),i?e.node(i):e.put("undefined")}),e.put(")")}function US(n,e){e.nodeOrNothing(n.value);for(let i of n.arguments.slice(0,3))i&&e.node(i)}function GS(n,e){let[i,o,l]=n.arguments;e.nodeOrNothing(n.value),e.put("["),i&&e.node(i),e.put(":"),o&&e.node(o),l&&(e.put(":"),e.node(l)),e.put("]")}var Pg=z(()=>{});var yc={};Fe(yc,{compile:()=>YS,stringify:()=>KS,suggest:()=>VS,walk:()=>QS});function VS(n,e){n.query===null&&e.queryRoot(n.range[1])}function YS(n,e){if(n.array){e.put("..."),e.put(e.buildinFn("ensureArray")),e.put("("),e.nodeOrCurrent(n.query),e.put(")");return}e.put("..."),e.nodeOrCurrent(n.query)}function QS(n,e){e.nodeOrNothing(n.query)}function KS(n,e){e.put("..."),e.nodeOrNothing(n.query)}var jg=z(()=>{});var vc={};Fe(vc,{compile:()=>JS,stringify:()=>eE,suggest:()=>ZS,walk:()=>XS});function ZS(n,e){for(let[i,o]of Object.entries(n.values))o===null&&e.queryRoot(n.values[Number(i)-1].range[1])}function JS(n,e){for(let[i,o]of Object.entries(n.values)){let l=Number(i);o!==null&&(l!==0&&e.put("+"),l%2===0?e.put('"'+zg(o.value,tE)+'"'):(e.put("("),e.node(o),e.put(")")))}}function XS(n,e){for(let i of n.values)i!==null&&e.node(i)}function eE(n,e){let i=n.values.length-1;for(let[o,l]of Object.entries(n.values)){let c=Number(o);c%2===0?(e.put(c===0?"`":"}"),e.put(zg(l.value,nE)),e.put(c===i?"`":"${")):l!==null&&e.node(l)}}function zg(n,e){let i="";for(let o=0;o<n.length;o++)i+=e.get(n[o])||n[o];return i}var tE,nE,Rg=z(()=>{tE=new Map([["\b","\\b"],[`
|
|
50
50
|
`,"\\n"],["\r","\\r"],["\f","\\f"],[" ","\\t"],["\v","\\v"],["\u2028","\\u2028"],["\u2029","\\u2029"],["\\","\\\\"],['"','\\"']]),nE=new Map([["\b","\\b"],["\f","\\f"],[" ","\\t"],["\v","\\v"],["\\","\\\\"],["$","\\$"]])});var rE,Oo,iE,wc,bc,xc,kc,Io=z(()=>{rg();ig();og();ag();lg();cg();fg();dg();pg();hg();gg();mg();yg();vg();wg();bg();xg();kg();Cg();Dg();Ag();Sg();Eg();Mg();Lg();Tg();Fg();Ng();Og();Ig();Bg();Pg();jg();Rg();rE={Arg1:zu,Array:Ru,Assertion:Hu,Binary:qu,Block:_u,Compare:Wu,Conditional:Uu,Context:Gu,Current:Vu,Data:Yu,Declarator:Qu,Definition:Zu,Filter:Ju,Function:Xu,GetProperty:ec,Identifier:tc,Literal:nc,Map:rc,MapRecursive:ic,Method:oc,MethodCall:sc,Object:ac,ObjectEntry:lc,Parentheses:uc,Pick:cc,Pipeline:fc,Placeholder:dc,Postfix:pc,Prefix:hc,Reference:gc,SliceNotation:mc,CompareFunction:$u,Spread:yc,Template:vc},Oo=n=>new Map(Object.entries(rE).map(([e,i])=>[e,i[n]]).filter(([,e])=>typeof e=="function")),iE={};Oo("build").forEach((n,e)=>iE[e]=n);wc=Oo("compile"),bc=Oo("walk"),xc=Oo("stringify"),kc=Oo("suggest")});function Bo(n,e){function i(f){if(bc.has(f.type))l(f),bc.get(f.type)(f,o),c(f);else throw new Error('Unknown node type "'+f.type+'"')}let o={node:i,nodeOrNothing(f){f!==null&&i(f)},list(f){f.forEach(i)}},l=()=>{},c=()=>{};typeof e=="function"&&(e={enter:e}),e&&(typeof e.enter=="function"&&(l=e.enter),typeof e.leave=="function"&&(c=e.leave)),i(n)}var Cc=z(()=>{Io()});function Hg(n,e){return e>=0&&e<n.length&&/[a-zA-Z_$0-9]/.test(n[e])}function Dc(n,e){let i=n.charCodeAt(e);return i===9||i===10||i===13||i===32}function oE(n,e,i){for(;e<i;e++)if(!Dc(n,e))return!1;return!0}function sE(n,e,i,o,l){let c=[];for(let f=0;f<o.length;f++){let[d,g]=o[f];if(d>=e)break;d<n||(c.push(n,d),n=g)}return(n!==i.length||!l)&&c.push(n,e),c}function aE(n,e,i,o){let l=[];for(let c=0;c<n.length;c++){let[f,d,g,m]=n[c];if(oE(e,f,d)){for(;f>=0&&Dc(e,f-1);)f--;for(;d<e.length&&Dc(e,d);)d++;if(Hg(e,f-1)){if(f===d)continue;f++}if(Hg(e,d)){if(f===d)continue;d--}}let y=sE(f,d,e,i,o);for(let k=0;k<y.length;k+=2)l.push([y[k],y[k+1],g,m])}return l}function lE(n){let e=null,i=[],o=Object.assign(new Map,{literalList:i}),l=(f,d)=>{o.has(f)?o.get(f).push(d):o.set(f,[d])},c={range(f,d,g=e,m=!0){l(g,[...f,d,m])},literalList(f){let d="l"+i.length;return i.push([d,f]),d},queryRoot(f,d=f){l(e,[f,d,"var",!0]),l(e,[f,d,"path",!0])}};return Bo(n,f=>{if(kc.has(f.type)){let d=e;e=f,kc.get(f.type)(f,c),e=d}}),o}function va(n,{ast:e,commentRanges:i}){let o=lE(e),l=i.length&&i[i.length-1][1]===n.length&&!/[\r\n]$/.test(n);for(let[c,f]of o)o.set(c,aE(f,n,i,l));return o}var qg=z(()=>{Io();Cc()});function uE(n){return n.type==="GetProperty"}function cE(n){return n.type==="MethodCall"}function wa(n){function e(l){if(xc.has(l.type))xc.get(l.type)(l,o);else throw new Error('Unknown node type "'+l.type+'"')}let i=[],o={isSimpleGetPropertyQuery:uE,isSimpleMethodCallQuery:cE,put(l){i.push(l)},node:e,nodeOrNothing(l){if(l!==null)return e(l),!0},list(l,c){if(!c){l.forEach(e);return}l.forEach((f,d)=>{d>0&&o.put(c),e(f)})}};return e(n),i.join("")}var _g=z(()=>{Io()});function Ac(n,e,i){let o=Object.assign(Object.create(SyntaxError.prototype),i),l=new Error;return o.name=n,o.message=e,Object.defineProperty(o,"stack",{get:function(){return(l.stack||"").replace(/^(.+\n){1,3}/,n+": "+e+`
|
|
51
51
|
`)}}),o}var Wg=z(()=>{});function Ec(n,e,i){return $g(n,"query",e,i)}function Mc(n,e,i){return $g(n,"method",e,i)}function $g(n,e,i=!1,o=null){function l(A){let b="s"+m.length;return m.push(A?[b,A]:[b]),b}function c(A){let b=y.get(A);return b||y.set(A,b=l()),b}function f(A,b,L,T,I){let B=[A,b,JSON.stringify(L)];if(L==="var"){if(!N.scope.size)return;B.push(JSON.stringify([...N.scope]))}else T||(T=l()),B.push(T),I&&B.push(typeof I=="string"?I:c(I));return C.push(B),T}function d(A,b,L="$"){let T=N.scope,I=M.length-1;if(N.scope=T.spawn(T.arg1||e==="method",L),A(),N.scope.captureCurrent.length){let R="stat("+N.scope.captureCurrent.reduce((U,W)=>f(...W,U),void 0)+","+N.scope.$ref+")";N.scope.firstCurrent?M[N.scope.firstCurrent]=R:M[I]+=b(R)}N.scope=T}function g(A,b){let L=!1;if(o!==null){if(o.has(A))for(let[T,I,B,R]of o.get(A))B==="var"?f(T,I,B):R===!0?N.scope.captureCurrent.push([T,I,B]):(L||(L=c(A),M.push("stat("+L+",")),B&&f(T,I,B,L,R));A.type==="Current"&&N.scope.firstCurrent===null&&(N.scope.firstCurrent=M.length)}if(wc.has(A.type))wc.get(A.type)(A,N,b);else throw new Error('Unknown node type "'+A.type+'"');L&&M.push(")")}let m=[],y=new WeakMap,k=[],C=[],M=[{toString(){if(e==="query")return["((data,context)=>{",...N.usedMethods.size||N.usedAssertions.size?["const method = (name,...args)=>m[name].apply(mctx,args);","const assertion = (name,...args)=>a[name].apply(mctx,args);","const mctx = Object.freeze({context,method,assertion});"]:[]].join(`
|
|
52
52
|
`)+`
|
|
@@ -109,10 +109,10 @@ assertions: a
|
|
|
109
109
|
href,
|
|
110
110
|
external,
|
|
111
111
|
onClick: undefined
|
|
112
|
-
} | overrideProps()`});var Jy,Xy=z(()=>{Jy={demo:{view:"progress",progress:.5,content:'text:"Loading..."'},examples:[{title:"With no label (content)",demo:{view:"progress",progress:.25}},{title:"Custom color",demo:{view:"progress",progress:.85,color:"#bdab77",content:'text:"Yellow progress"'}}]}});function ev(n){n.view.define("progress",function(e,i,o,l){let{content:c,progress:f,color:d}=i;if(e.append($("div",{class:"progress",style:`--progress: ${Math.max(0,Math.min(1,Number(f)))};--color: ${d||"unset"};`})),c){let g=$("div","content");return e.prepend(g),n.view.render(g,c,o,l)}},{usage:Jy})}var tv=z(()=>{Oe();Xy()});var PM,nv,rv=z(()=>{PM=Function("return (value) => alert(`Changed to ${value}!`)")(),nv={demo:{view:"select",data:["one","two","three","four"]},examples:[{title:"Select with value",demo:{view:"select",value:'"three"',data:["one","two","three","four"]}},{title:"Select with reset option",demo:{view:"select",resetItem:!0,value:'"three"',data:["one","two","three","four"]}},{title:"Select with placeholder",demo:{view:"select",placeholder:"placeholder",data:["one","two","three","four"]}},{title:"Select with onChange",demo:{view:"select",onChange:PM,data:["one","two","three","four"]}},{title:"Select with custom options",demo:{view:"select",item:"h1:text",data:["one","two","three","four"]}}]}});function iv(n){let e="text-match:{ text, match: #.filter }",i="{ value: $, text: #.selectVariantTextQuery.query($, #) }",o=new n.view.Popup({className:"view-select-popup"});n.view.define("select",function(l,c,f,d){function g(){if(l.innerHTML="",B!==void 0)return n.view.render(l,n.view.composeConfig({view:"menu-item",data:i,content:N},A),B,R)}let{name:m,value:y,text:k="$",placeholder:C,limit:M,minItemsFilter:E=10,resetItem:F=!1,item:N=e,itemConfig:A,beforeItems:b,afterItems:L,onInit:T,onChange:I}=c,B=y?n.query(y,f,d):d[m],R={...d,selectMinItemsFilter:E,selectCurrentValue:B,selectVariantTextQuery:k,selectResetItem:F?[{value:void 0,text:"",...F,resetItem:!0}]:[]},U=[];return b&&U.push(n.view.composeConfig(b,{onInit:T,onChange:I})),U.push({view:"context",data:`.(${i})`,modifiers:{view:"input",when:"size() >= #.selectMinItemsFilter",type:"regexp",name:"filter",className:"view-select__filter",placeholder:"Filter"},content:{view:"menu",className:"view-select__variants",data:"#.selectResetItem + .[no #.filter or text~=#.filter]",limit:M,itemConfig:n.view.composeConfig({className:[W=>W.resetItem?"reset-item":"",W=>W.value===B?"selected":""]},A),item:N,onClick(W){o.hide(),B!==W.value&&(B=W.value,R={...R,selectCurrentValue:B},g(),typeof I=="function"&&I(W.value,m,W,d))}}}),L&&U.push(n.view.composeConfig(L,{onInit:T,onChange:I})),C&&(l.dataset.placeholder=C),l.tabIndex=0,l.addEventListener("click",()=>{o.toggle(l,W=>n.view.render(W,U,f,R).then(()=>(W.querySelector(".view-select__filter input")||{focus(){}}).focus()))}),typeof T=="function"&&T(B,m,f,d),g()},{usage:nv})}var ov=z(()=>{rv()});var sv,av=z(()=>{sv={demo:{view:"tabs",name:"tabs",tabs:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],content:{view:"switch",content:[{when:'#.tabs="one"',content:'text:"One"'},{when:'#.tabs="two"',content:'text:"Two"'},{when:'#.tabs="three"',content:'text:"Three"'}]}},examples:[{title:"With before and after content",demo:{view:"tabs",name:"example",tabs:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],beforeTabs:'text:"<Content before tabs>"',afterTabs:'text:"<Content after tabs>"',content:'text:"Selected: " + #.example'}},{title:"On change handler",demo:{view:"tabs",name:"example",tabs:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],onChange:Function('return (value) => alert("changed to " + value)')(),content:'text:"Selected: " + #.example'}}]}});function lv(n){n.view.define("tabs",function(e,i,o,l){async function c(I){let B=b?y:m;if(L===I)return;let R=d||g||f?{...l,[k]:I}:null;L=I,b=!0,Array.isArray(C)&&(E.innerHTML="",d&&(N.innerHTML="",await n.view.render(N,d,o,R),E.appendChild(N)),await Promise.all(C.map(U=>n.view.render(E,n.view.composeConfig(U,{active:U.value===L}),o,l))),g&&(A.innerHTML="",await n.view.render(A,g,o,R),E.appendChild(A))),f&&(F.innerHTML="",await n.view.render(F,f,o,R)),typeof B=="function"&&B(L,k,o,l)}let{content:f,beforeTabs:d,afterTabs:g,onInit:m,onChange:y}=i,{name:k,tabs:C,tabConfig:M}=i,E=e.appendChild(document.createElement("div")),F=null,N=null,A=null,b=!1,L=NaN,T="value"in i?i.value:k in l?l[k]:void 0;return C=n.query(C,o,l),M=n.view.composeConfig({view:"tab",onClick:c},M),E.className="view-tabs-buttons",d&&(N=document.createElement("div"),N.className="view-tabs-buttons-before"),g&&(A=document.createElement("div"),A.className="view-tabs-buttons-after"),f&&(F=e.appendChild(document.createElement("div")),F.className="view-tabs-content"),typeof k!="string"&&(k="filter"),Array.isArray(C)?C=C.map(I=>{let B=typeof I;return(B==="string"||B==="number"||B==="boolean")&&(I={value:I}),(T===void 0||I.active)&&(T=I.value),n.view.composeConfig(M,I)}):C=[],c(T)},{usage:sv})}var uv=z(()=>{av()});var lf,cv,fv=z(()=>{lf=()=>alert("clicked!"),cv={demo:{view:"tabs",name:"tabs",tabs:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],content:{view:"switch",content:[{when:'#.tabs="one"',content:'text:"One"'},{when:'#.tabs="two"',content:'text:"Two"'},{when:'#.tabs="three"',content:'text:"Three"'}]}},examples:[{title:"Active & disabled tab",demo:{view:"tabs",name:"tabs",tabs:[{value:"one",text:"One"},{value:"two",text:"Two",active:!0},{value:"three",text:"Three",disabled:!0}],content:{view:"switch",content:[{when:'#.tabs="one"',content:'text:"One"'},{when:'#.tabs="two"',content:'text:"Two"'},{when:'#.tabs="three"',content:'text:"Three"'}]}}},{title:"On click handler",demo:{view:"tabs",name:"tabs",tabs:[{value:"one",text:"One",onClick:lf},{value:"two",text:"Two",onClick:lf},{value:"three",text:"Three",onClick:lf}],content:{view:"switch",content:[{when:'#.tabs="one"',content:'text:"One"'},{when:'#.tabs="two"',content:'text:"Two"'},{when:'#.tabs="three"',content:'text:"Three"'}]}}}]}});function dv(n){n.view.define("tab",function(e,i,o,l){let{content:c,active:f=!1,disabled:d=!1,onClick:g,value:m,text:y=String(m).replace(/^./,k=>k.toUpperCase())}=i;if(n.query(d,o,l)?e.classList.add("disabled"):typeof g=="function"&&(e.addEventListener("click",()=>g(m)),e.classList.add("onclick")),f&&e.classList.add("active"),c)return n.view.render(e,c,o,l);e.textContent=y},{usage:cv})}var pv=z(()=>{fv()});var Ha,uf=z(()=>{Ha={demo:{view:"context",modifiers:{view:"toggle-group",name:"toggleValue",data:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}]},content:{view:"switch",content:[{when:'#.toggleValue="one"',content:'text:"One"'},{when:'#.toggleValue="two"',content:'text:"Two"'},{when:'#.toggleValue="three"',content:'text:"Three"'}]}},examples:[{title:"With before and after content",demo:{view:"toggle-group",data:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],beforeToggles:'text:"<Content before toggles>"',afterToggles:'text:"<Content after toggles>"'}},{title:"On change handler",demo:{view:"toggle-group",name:"example",onChange:Function('return (value) => alert("changed to " + value)')(),data:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}]}}]}});function hv(n){n.view.define("toggle",function(e,i,o,l){let{content:c,disabled:f=!1,onToggle:d,value:g,text:m=String(g).replace(/^./,k=>k.toUpperCase())}=i,{checked:y=!1}=i;if(f?e.classList.add("disabled"):typeof d=="function"&&(e.addEventListener("click",()=>{y=!y,d(y,g)}),e.classList.add("onclick")),y&&e.classList.add("checked"),c)return n.view.render(e,c,o,l);e.textContent=m},{usage:Ha})}var gv=z(()=>{uf()});function mv(n){n.view.define("toggle-group",function(e,i,o,l){async function c(b,L){let T=F?m:g;N!==L&&(N=L,F=!0,Array.isArray(C)&&(e.innerHTML="",f&&(M.innerHTML="",await n.view.render(M,f,o,{...l,[y]:L}),e.appendChild(M)),d&&(E.innerHTML="",await n.view.render(E,d,o,{...l,[y]:L}),e.appendChild(E)),await Promise.all(C.map((I,B)=>n.view.render(e,n.view.composeConfig(I,{checked:I.value===N}),o[B],l)))),typeof T=="function"&&T(N,y,o,l))}let{beforeToggles:f,afterToggles:d,onInit:g,onChange:m}=i,{name:y,toggleConfig:k}=i,C=[],M=null,E=null,F=!1,N=NaN,A="value"in i?i.value:y in l?l[y]:void 0;return k=n.view.composeConfig({view:"toggle",onToggle:c},k),f&&(M=document.createElement("div"),M.className="view-toggle-group-before"),d&&(E=document.createElement("div"),E.className="view-toggle-group-after"),typeof y!="string"&&(y="filter"),Array.isArray(o)&&(C=o.map(b=>{let L=typeof b;return(L==="string"||L==="number"||L==="boolean")&&(b={value:b}),(A===void 0||b.active)&&(A=b.value),n.view.composeConfig(k,b)})),c(!0,A)},{usage:Ha})}var yv=z(()=>{uf()});function Xe(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Dt(n,e=!0){let i=e&&typeof n!="number"?Xe(String(n)):String(n);return i.length>3?i.replace(jM,o=>o||'<span class="num-delim"></span>'):i}var jM,Qt=z(()=>{jM=/\.\d+(?:eE[-+]?\d+)?|\B(?=(?:\d{3})+(?:\D|$))/g});var An=Ct((cf,ff)=>{(function(n,e){typeof cf=="object"&&typeof ff<"u"?ff.exports=e():typeof define=="function"&&define.amd?define(e):(n=n||self,n.CodeMirror=e())})(cf,function(){"use strict";var n=navigator.userAgent,e=navigator.platform,i=/gecko\/\d/i.test(n),o=/MSIE \d/.test(n),l=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(n),c=/Edge\/(\d+)/.exec(n),f=o||l||c,d=f&&(o?document.documentMode||6:+(c||l)[1]),g=!c&&/WebKit\//.test(n),m=g&&/Qt\/\d+\.\d+/.test(n),y=!c&&/Chrome\/(\d+)/.exec(n),k=y&&+y[1],C=/Opera\//.test(n),M=/Apple Computer/.test(navigator.vendor),E=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(n),F=/PhantomJS/.test(n),N=M&&(/Mobile\/\w+/.test(n)||navigator.maxTouchPoints>2),A=/Android/.test(n),b=N||A||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(n),L=N||/Mac/.test(e),T=/\bCrOS\b/.test(n),I=/win/i.test(e),B=C&&n.match(/Version\/(\d*\.\d*)/);B&&(B=Number(B[1])),B&&B>=15&&(C=!1,g=!0);var R=L&&(m||C&&(B==null||B<12.11)),U=i||f&&d>=9;function W(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var ne=function(t,r){var a=t.className,s=W(r).exec(a);if(s){var u=a.slice(s.index+s[0].length);t.className=a.slice(0,s.index)+(u?s[1]+u:"")}};function q(t){for(var r=t.childNodes.length;r>0;--r)t.removeChild(t.firstChild);return t}function Z(t,r){return q(t).appendChild(r)}function S(t,r,a,s){var u=document.createElement(t);if(a&&(u.className=a),s&&(u.style.cssText=s),typeof r=="string")u.appendChild(document.createTextNode(r));else if(r)for(var p=0;p<r.length;++p)u.appendChild(r[p]);return u}function X(t,r,a,s){var u=S(t,r,a,s);return u.setAttribute("role","presentation"),u}var ee;document.createRange?ee=function(t,r,a,s){var u=document.createRange();return u.setEnd(s||t,a),u.setStart(t,r),u}:ee=function(t,r,a){var s=document.body.createTextRange();try{s.moveToElementText(t.parentNode)}catch{return s}return s.collapse(!0),s.moveEnd("character",a),s.moveStart("character",r),s};function pe(t,r){if(r.nodeType==3&&(r=r.parentNode),t.contains)return t.contains(r);do if(r.nodeType==11&&(r=r.host),r==t)return!0;while(r=r.parentNode)}function De(t){var r=t.ownerDocument||t,a;try{a=t.activeElement}catch{a=r.body||null}for(;a&&a.shadowRoot&&a.shadowRoot.activeElement;)a=a.shadowRoot.activeElement;return a}function Pe(t,r){var a=t.className;W(r).test(a)||(t.className+=(a?" ":"")+r)}function et(t,r){for(var a=t.split(" "),s=0;s<a.length;s++)a[s]&&!W(a[s]).test(r)&&(r+=" "+a[s]);return r}var nt=function(t){t.select()};N?nt=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:f&&(nt=function(t){try{t.select()}catch{}});function Ye(t){return t.display.wrapper.ownerDocument}function yt(t){return je(t.display.wrapper)}function je(t){return t.getRootNode?t.getRootNode():t.ownerDocument}function xe(t){return Ye(t).defaultView}function we(t){var r=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,r)}}function V(t,r,a){r||(r={});for(var s in t)t.hasOwnProperty(s)&&(a!==!1||!r.hasOwnProperty(s))&&(r[s]=t[s]);return r}function le(t,r,a,s,u){r==null&&(r=t.search(/[^\s\u00a0]/),r==-1&&(r=t.length));for(var p=s||0,h=u||0;;){var v=t.indexOf(" ",p);if(v<0||v>=r)return h+(r-p);h+=v-p,h+=a-h%a,p=v+1}}var re=function(){this.id=null,this.f=null,this.time=0,this.handler=we(this.onTimeout,this)};re.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},re.prototype.set=function(t,r){this.f=r;var a=+new Date+t;(!this.id||a<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=a)};function ie(t,r){for(var a=0;a<t.length;++a)if(t[a]==r)return a;return-1}var Ee=50,Ce={toString:function(){return"CodeMirror.Pass"}},be={scroll:!1},$e={origin:"*mouse"},Me={origin:"+move"};function Ue(t,r,a){for(var s=0,u=0;;){var p=t.indexOf(" ",s);p==-1&&(p=t.length);var h=p-s;if(p==t.length||u+h>=r)return s+Math.min(h,r-u);if(u+=p-s,u+=a-u%a,s=p+1,u>=r)return s}}var ut=[""];function at(t){for(;ut.length<=t;)ut.push(Te(ut)+" ");return ut[t]}function Te(t){return t[t.length-1]}function He(t,r){for(var a=[],s=0;s<t.length;s++)a[s]=r(t[s],s);return a}function G(t,r,a){for(var s=0,u=a(r);s<t.length&&a(t[s])<=u;)s++;t.splice(s,0,r)}function ae(){}function K(t,r){var a;return Object.create?a=Object.create(t):(ae.prototype=t,a=new ae),r&&V(r,a),a}var Ne=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function vt(t){return/\w/.test(t)||t>"\x80"&&(t.toUpperCase()!=t.toLowerCase()||Ne.test(t))}function Sn(t,r){return r?r.source.indexOf("\\w")>-1&&vt(t)?!0:r.test(t):vt(t)}function ps(t){for(var r in t)if(t.hasOwnProperty(r)&&t[r])return!1;return!0}var En=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function rt(t){return t.charCodeAt(0)>=768&&En.test(t)}function zn(t,r,a){for(;(a<0?r>0:r<t.length)&&rt(t.charAt(r));)r+=a;return r}function wn(t,r,a){for(var s=r>a?-1:1;;){if(r==a)return r;var u=(r+a)/2,p=s<0?Math.ceil(u):Math.floor(u);if(p==r)return t(p)?r:a;t(p)?a=p:r=p+s}}function Rn(t,r,a,s){if(!t)return s(r,a,"ltr",0);for(var u=!1,p=0;p<t.length;++p){var h=t[p];(h.from<a&&h.to>r||r==a&&h.to==r)&&(s(Math.max(h.from,r),Math.min(h.to,a),h.level==1?"rtl":"ltr",p),u=!0)}u||s(r,a,"ltr")}var fr=null;function Hn(t,r,a){var s;fr=null;for(var u=0;u<t.length;++u){var p=t[u];if(p.from<r&&p.to>r)return u;p.to==r&&(p.from!=p.to&&a=="before"?s=u:fr=u),p.from==r&&(p.from!=p.to&&a!="before"?s=u:fr=u)}return s??fr}var al=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function a(x){return x<=247?t.charAt(x):1424<=x&&x<=1524?"R":1536<=x&&x<=1785?r.charAt(x-1536):1774<=x&&x<=2220?"r":8192<=x&&x<=8203?"w":x==8204?"b":"L"}var s=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,u=/[stwN]/,p=/[LRr]/,h=/[Lb1n]/,v=/[1n]/;function w(x,O,j){this.level=x,this.from=O,this.to=j}return function(x,O){var j=O=="ltr"?"L":"R";if(x.length==0||O=="ltr"&&!s.test(x))return!1;for(var _=x.length,H=[],Q=0;Q<_;++Q)H.push(a(x.charCodeAt(Q)));for(var te=0,se=j;te<_;++te){var ue=H[te];ue=="m"?H[te]=se:se=ue}for(var de=0,ce=j;de<_;++de){var he=H[de];he=="1"&&ce=="r"?H[de]="n":p.test(he)&&(ce=he,he=="r"&&(H[de]="R"))}for(var ve=1,me=H[0];ve<_-1;++ve){var Se=H[ve];Se=="+"&&me=="1"&&H[ve+1]=="1"?H[ve]="1":Se==","&&me==H[ve+1]&&(me=="1"||me=="n")&&(H[ve]=me),me=Se}for(var qe=0;qe<_;++qe){var ht=H[qe];if(ht==",")H[qe]="N";else if(ht=="%"){var Ve=void 0;for(Ve=qe+1;Ve<_&&H[Ve]=="%";++Ve);for(var zt=qe&&H[qe-1]=="!"||Ve<_&&H[Ve]=="1"?"1":"N",Ot=qe;Ot<Ve;++Ot)H[Ot]=zt;qe=Ve-1}}for(var it=0,It=j;it<_;++it){var mt=H[it];It=="L"&&mt=="1"?H[it]="L":p.test(mt)&&(It=mt)}for(var lt=0;lt<_;++lt)if(u.test(H[lt])){var ot=void 0;for(ot=lt+1;ot<_&&u.test(H[ot]);++ot);for(var Je=(lt?H[lt-1]:j)=="L",Bt=(ot<_?H[ot]:j)=="L",di=Je==Bt?Je?"L":"R":j,Xn=lt;Xn<ot;++Xn)H[Xn]=di;lt=ot-1}for(var kt=[],Dn,gt=0;gt<_;)if(h.test(H[gt])){var tu=gt;for(++gt;gt<_&&h.test(H[gt]);++gt);kt.push(new w(0,tu,gt))}else{var Bn=gt,xr=kt.length,kr=O=="rtl"?1:0;for(++gt;gt<_&&H[gt]!="L";++gt);for(var St=Bn;St<gt;)if(v.test(H[St])){Bn<St&&(kt.splice(xr,0,new w(1,Bn,St)),xr+=kr);var pi=St;for(++St;St<gt&&v.test(H[St]);++St);kt.splice(xr,0,new w(2,pi,St)),xr+=kr,Bn=St}else++St;Bn<gt&&kt.splice(xr,0,new w(1,Bn,gt))}return O=="ltr"&&(kt[0].level==1&&(Dn=x.match(/^\s+/))&&(kt[0].from=Dn[0].length,kt.unshift(new w(0,0,Dn[0].length))),Te(kt).level==1&&(Dn=x.match(/\s+$/))&&(Te(kt).to-=Dn[0].length,kt.push(new w(0,_-Dn[0].length,_)))),O=="rtl"?kt.reverse():kt}}();function Le(t,r){var a=t.order;return a==null&&(a=t.order=al(t.text,r)),a}var hs=[],ye=function(t,r,a){if(t.addEventListener)t.addEventListener(r,a,!1);else if(t.attachEvent)t.attachEvent("on"+r,a);else{var s=t._handlers||(t._handlers={});s[r]=(s[r]||hs).concat(a)}};function Mn(t,r){return t._handlers&&t._handlers[r]||hs}function wt(t,r,a){if(t.removeEventListener)t.removeEventListener(r,a,!1);else if(t.detachEvent)t.detachEvent("on"+r,a);else{var s=t._handlers,u=s&&s[r];if(u){var p=ie(u,a);p>-1&&(s[r]=u.slice(0,p).concat(u.slice(p+1)))}}}function Qe(t,r){var a=Mn(t,r);if(a.length)for(var s=Array.prototype.slice.call(arguments,2),u=0;u<a.length;++u)a[u].apply(null,s)}function Ke(t,r,a){return typeof r=="string"&&(r={type:r,preventDefault:function(){this.defaultPrevented=!0}}),Qe(t,a||r.type,t,r),Lt(r)||r.codemirrorIgnore}function Zt(t){var r=t._handlers&&t._handlers.cursorActivity;if(r)for(var a=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),s=0;s<r.length;++s)ie(a,r[s])==-1&&a.push(r[s])}function Pt(t,r){return Mn(t,r).length>0}function nn(t){t.prototype.on=function(r,a){ye(this,r,a)},t.prototype.off=function(r,a){wt(this,r,a)}}function bt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function qr(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function Lt(t){return t.defaultPrevented!=null?t.defaultPrevented:t.returnValue==!1}function qn(t){bt(t),qr(t)}function Wi(t){return t.target||t.srcElement}function rn(t){var r=t.which;return r==null&&(t.button&1?r=1:t.button&2?r=3:t.button&4&&(r=2)),L&&t.ctrlKey&&r==1&&(r=3),r}var ll=function(){if(f&&d<9)return!1;var t=S("div");return"draggable"in t||"dragDrop"in t}(),_r;function gs(t){if(_r==null){var r=S("span","\u200B");Z(t,S("span",[r,document.createTextNode("x")])),t.firstChild.offsetHeight!=0&&(_r=r.offsetWidth<=1&&r.offsetHeight>2&&!(f&&d<8))}var a=_r?S("span","\u200B"):S("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return a.setAttribute("cm-text",""),a}var $i;function _n(t){if($i!=null)return $i;var r=Z(t,document.createTextNode("A\u062EA")),a=ee(r,0,1).getBoundingClientRect(),s=ee(r,1,2).getBoundingClientRect();return q(t),!a||a.left==a.right?!1:$i=s.right-a.right<3}var Jt=`
|
|
112
|
+
} | overrideProps()`});var Jy,Xy=z(()=>{Jy={demo:{view:"progress",progress:.5,content:'text:"Loading..."'},examples:[{title:"With no label (content)",demo:{view:"progress",progress:.25}},{title:"Custom color",demo:{view:"progress",progress:.85,color:"#bdab77",content:'text:"Yellow progress"'}}]}});function ev(n){n.view.define("progress",function(e,i,o,l){let{content:c,progress:f,color:d}=i;if(e.append($("div",{class:"progress",style:`--progress: ${Math.max(0,Math.min(1,Number(f)))};--color: ${d||"unset"};`})),c){let g=$("div","content");return e.prepend(g),n.view.render(g,c,o,l)}},{usage:Jy})}var tv=z(()=>{Oe();Xy()});var PM,nv,rv=z(()=>{PM=Function("return (value) => alert(`Changed to ${value}!`)")(),nv={demo:{view:"select",data:["one","two","three","four"]},examples:[{title:"Select with value",demo:{view:"select",value:'"three"',data:["one","two","three","four"]}},{title:"Select with reset option",demo:{view:"select",resetItem:!0,value:'"three"',data:["one","two","three","four"]}},{title:"Select with placeholder",demo:{view:"select",placeholder:"placeholder",data:["one","two","three","four"]}},{title:"Select with onChange",demo:{view:"select",onChange:PM,data:["one","two","three","four"]}},{title:"Select with custom options",demo:{view:"select",item:"h1:text",data:["one","two","three","four"]}}]}});function iv(n){let e="text-match:{ text, match: #.filter }",i="{ value: $, text: #.selectVariantTextQuery.query($, #) }",o=new n.view.Popup({className:"view-select-popup"});n.view.define("select",function(l,c,f,d){function g(){if(l.innerHTML="",B!==void 0)return n.view.render(l,n.view.composeConfig({view:"menu-item",data:i,content:N},A),B,R)}let{name:m,value:y,text:k="$",placeholder:C,limit:M,minItemsFilter:E=10,resetItem:F=!1,item:N=e,itemConfig:A,beforeItems:b,afterItems:L,onInit:T,onChange:I}=c,B=y?n.query(y,f,d):d[m],R={...d,selectMinItemsFilter:E,selectCurrentValue:B,selectVariantTextQuery:k,selectResetItem:F?[{value:void 0,text:"",...F,resetItem:!0}]:[]},U=[];return b&&U.push(n.view.composeConfig(b,{onInit:T,onChange:I})),U.push({view:"context",data:`.(${i})`,modifiers:{view:"input",when:"size() >= #.selectMinItemsFilter",type:"regexp",name:"filter",className:"view-select__filter",placeholder:"Filter"},content:{view:"menu",className:"view-select__variants",data:"#.selectResetItem + .[no #.filter or text~=#.filter]",limit:M,itemConfig:n.view.composeConfig({className:[W=>W.resetItem?"reset-item":"",W=>W.value===B?"selected":""]},A),item:N,onClick(W){o.hide(),B!==W.value&&(B=W.value,R={...R,selectCurrentValue:B},g(),typeof I=="function"&&I(W.value,m,W,d))}}}),L&&U.push(n.view.composeConfig(L,{onInit:T,onChange:I})),C&&(l.dataset.placeholder=C),l.tabIndex=0,l.addEventListener("click",()=>{o.toggle(l,W=>n.view.render(W,U,f,R).then(()=>(W.querySelector(".view-select__filter input")||{focus(){}}).focus()))}),typeof T=="function"&&T(B,m,f,d),g()},{usage:nv})}var ov=z(()=>{rv()});var sv,av=z(()=>{sv={demo:{view:"tabs",name:"tabs",tabs:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],content:{view:"switch",content:[{when:'#.tabs="one"',content:'text:"One"'},{when:'#.tabs="two"',content:'text:"Two"'},{when:'#.tabs="three"',content:'text:"Three"'}]}},examples:[{title:"With before and after content",demo:{view:"tabs",name:"example",tabs:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],beforeTabs:'text:"<Content before tabs>"',afterTabs:'text:"<Content after tabs>"',content:'text:"Selected: " + #.example'}},{title:"On change handler",demo:{view:"tabs",name:"example",tabs:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],onChange:Function('return (value) => alert("changed to " + value)')(),content:'text:"Selected: " + #.example'}}]}});function lv(n){n.view.define("tabs",function(e,i,o,l){async function c(I){let B=b?y:m;if(L===I)return;let R=d||g||f?{...l,[k]:I}:null;L=I,b=!0,Array.isArray(C)&&(E.innerHTML="",d&&(N.innerHTML="",await n.view.render(N,d,o,R),E.appendChild(N)),await Promise.all(C.map(U=>n.view.render(E,n.view.composeConfig(U,{active:U.value===L}),o,l))),g&&(A.innerHTML="",await n.view.render(A,g,o,R),E.appendChild(A))),f&&(F.innerHTML="",await n.view.render(F,f,o,R)),typeof B=="function"&&B(L,k,o,l)}let{content:f,beforeTabs:d,afterTabs:g,onInit:m,onChange:y}=i,{name:k,tabs:C,tabConfig:M}=i,E=e.appendChild(document.createElement("div")),F=null,N=null,A=null,b=!1,L=NaN,T="value"in i?i.value:k in l?l[k]:void 0;return C=n.query(C,o,l),M=n.view.composeConfig({view:"tab",onClick:c},M),E.className="view-tabs-buttons",d&&(N=document.createElement("div"),N.className="view-tabs-buttons-before"),g&&(A=document.createElement("div"),A.className="view-tabs-buttons-after"),f&&(F=e.appendChild(document.createElement("div")),F.className="view-tabs-content"),typeof k!="string"&&(k="filter"),Array.isArray(C)?C=C.map(I=>{let B=typeof I;return(B==="string"||B==="number"||B==="boolean")&&(I={value:I}),(T===void 0||I.active)&&(T=I.value),n.view.composeConfig(M,I)}):C=[],c(T)},{usage:sv})}var uv=z(()=>{av()});var lf,cv,fv=z(()=>{lf=()=>alert("clicked!"),cv={demo:{view:"tabs",name:"tabs",tabs:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],content:{view:"switch",content:[{when:'#.tabs="one"',content:'text:"One"'},{when:'#.tabs="two"',content:'text:"Two"'},{when:'#.tabs="three"',content:'text:"Three"'}]}},examples:[{title:"Active & disabled tab",demo:{view:"tabs",name:"tabs",tabs:[{value:"one",text:"One"},{value:"two",text:"Two",active:!0},{value:"three",text:"Three",disabled:!0}],content:{view:"switch",content:[{when:'#.tabs="one"',content:'text:"One"'},{when:'#.tabs="two"',content:'text:"Two"'},{when:'#.tabs="three"',content:'text:"Three"'}]}}},{title:"On click handler",demo:{view:"tabs",name:"tabs",tabs:[{value:"one",text:"One",onClick:lf},{value:"two",text:"Two",onClick:lf},{value:"three",text:"Three",onClick:lf}],content:{view:"switch",content:[{when:'#.tabs="one"',content:'text:"One"'},{when:'#.tabs="two"',content:'text:"Two"'},{when:'#.tabs="three"',content:'text:"Three"'}]}}}]}});function dv(n){n.view.define("tab",function(e,i,o,l){let{content:c,active:f=!1,disabled:d=!1,onClick:g,value:m,text:y=String(m).replace(/^./,k=>k.toUpperCase())}=i;if(n.query(d,o,l)?e.classList.add("disabled"):typeof g=="function"&&(e.addEventListener("click",()=>g(m)),e.classList.add("onclick")),f&&e.classList.add("active"),c)return n.view.render(e,c,o,l);e.textContent=y},{usage:cv})}var pv=z(()=>{fv()});var Ha,uf=z(()=>{Ha={demo:{view:"context",modifiers:{view:"toggle-group",name:"toggleValue",data:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}]},content:{view:"switch",content:[{when:'#.toggleValue="one"',content:'text:"One"'},{when:'#.toggleValue="two"',content:'text:"Two"'},{when:'#.toggleValue="three"',content:'text:"Three"'}]}},examples:[{title:"With before and after content",demo:{view:"toggle-group",data:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}],beforeToggles:'text:"<Content before toggles>"',afterToggles:'text:"<Content after toggles>"'}},{title:"On change handler",demo:{view:"toggle-group",name:"example",onChange:Function('return (value) => alert("changed to " + value)')(),data:[{value:"one",text:"One"},{value:"two",text:"Two"},{value:"three",text:"Three"}]}}]}});function hv(n){n.view.define("toggle",function(e,i,o,l){let{content:c,disabled:f=!1,onToggle:d,value:g,text:m=String(g).replace(/^./,k=>k.toUpperCase())}=i,{checked:y=!1}=i;if(f?e.classList.add("disabled"):typeof d=="function"&&(e.addEventListener("click",()=>{y=!y,d(y,g)}),e.classList.add("onclick")),y&&e.classList.add("checked"),c)return n.view.render(e,c,o,l);e.textContent=m},{usage:Ha})}var gv=z(()=>{uf()});function mv(n){n.view.define("toggle-group",function(e,i,o,l){async function c(b,L){let T=F?m:g;N!==L&&(N=L,F=!0,Array.isArray(C)&&(e.innerHTML="",f&&(M.innerHTML="",await n.view.render(M,f,o,{...l,[y]:L}),e.appendChild(M)),d&&(E.innerHTML="",await n.view.render(E,d,o,{...l,[y]:L}),e.appendChild(E)),await Promise.all(C.map((I,B)=>n.view.render(e,n.view.composeConfig(I,{checked:I.value===N}),o[B],l)))),typeof T=="function"&&T(N,y,o,l))}let{beforeToggles:f,afterToggles:d,onInit:g,onChange:m}=i,{name:y,toggleConfig:k}=i,C=[],M=null,E=null,F=!1,N=NaN,A="value"in i?i.value:y in l?l[y]:void 0;return k=n.view.composeConfig({view:"toggle",onToggle:c},k),f&&(M=document.createElement("div"),M.className="view-toggle-group-before"),d&&(E=document.createElement("div"),E.className="view-toggle-group-after"),typeof y!="string"&&(y="filter"),Array.isArray(o)&&(C=o.map(b=>{let L=typeof b;return(L==="string"||L==="number"||L==="boolean")&&(b={value:b}),(A===void 0||b.active)&&(A=b.value),n.view.composeConfig(k,b)})),c(!0,A)},{usage:Ha})}var yv=z(()=>{uf()});function Xe(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Dt(n,e=!0){let i=e&&typeof n!="number"?Xe(String(n)):String(n);return i.length>3?i.replace(jM,o=>o||'<span class="num-delim"></span>'):i}var jM,Qt=z(()=>{jM=/\.\d+(?:eE[-+]?\d+)?|\B(?=(?:\d{3})+(?:\D|$))/g});var An=Ct((cf,ff)=>{(function(n,e){typeof cf=="object"&&typeof ff<"u"?ff.exports=e():typeof define=="function"&&define.amd?define(e):(n=n||self,n.CodeMirror=e())})(cf,(function(){"use strict";var n=navigator.userAgent,e=navigator.platform,i=/gecko\/\d/i.test(n),o=/MSIE \d/.test(n),l=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(n),c=/Edge\/(\d+)/.exec(n),f=o||l||c,d=f&&(o?document.documentMode||6:+(c||l)[1]),g=!c&&/WebKit\//.test(n),m=g&&/Qt\/\d+\.\d+/.test(n),y=!c&&/Chrome\/(\d+)/.exec(n),k=y&&+y[1],C=/Opera\//.test(n),M=/Apple Computer/.test(navigator.vendor),E=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(n),F=/PhantomJS/.test(n),N=M&&(/Mobile\/\w+/.test(n)||navigator.maxTouchPoints>2),A=/Android/.test(n),b=N||A||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(n),L=N||/Mac/.test(e),T=/\bCrOS\b/.test(n),I=/win/i.test(e),B=C&&n.match(/Version\/(\d*\.\d*)/);B&&(B=Number(B[1])),B&&B>=15&&(C=!1,g=!0);var R=L&&(m||C&&(B==null||B<12.11)),U=i||f&&d>=9;function W(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var ne=function(t,r){var a=t.className,s=W(r).exec(a);if(s){var u=a.slice(s.index+s[0].length);t.className=a.slice(0,s.index)+(u?s[1]+u:"")}};function q(t){for(var r=t.childNodes.length;r>0;--r)t.removeChild(t.firstChild);return t}function Z(t,r){return q(t).appendChild(r)}function S(t,r,a,s){var u=document.createElement(t);if(a&&(u.className=a),s&&(u.style.cssText=s),typeof r=="string")u.appendChild(document.createTextNode(r));else if(r)for(var p=0;p<r.length;++p)u.appendChild(r[p]);return u}function X(t,r,a,s){var u=S(t,r,a,s);return u.setAttribute("role","presentation"),u}var ee;document.createRange?ee=function(t,r,a,s){var u=document.createRange();return u.setEnd(s||t,a),u.setStart(t,r),u}:ee=function(t,r,a){var s=document.body.createTextRange();try{s.moveToElementText(t.parentNode)}catch{return s}return s.collapse(!0),s.moveEnd("character",a),s.moveStart("character",r),s};function pe(t,r){if(r.nodeType==3&&(r=r.parentNode),t.contains)return t.contains(r);do if(r.nodeType==11&&(r=r.host),r==t)return!0;while(r=r.parentNode)}function De(t){var r=t.ownerDocument||t,a;try{a=t.activeElement}catch{a=r.body||null}for(;a&&a.shadowRoot&&a.shadowRoot.activeElement;)a=a.shadowRoot.activeElement;return a}function Pe(t,r){var a=t.className;W(r).test(a)||(t.className+=(a?" ":"")+r)}function et(t,r){for(var a=t.split(" "),s=0;s<a.length;s++)a[s]&&!W(a[s]).test(r)&&(r+=" "+a[s]);return r}var nt=function(t){t.select()};N?nt=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:f&&(nt=function(t){try{t.select()}catch{}});function Ye(t){return t.display.wrapper.ownerDocument}function yt(t){return je(t.display.wrapper)}function je(t){return t.getRootNode?t.getRootNode():t.ownerDocument}function xe(t){return Ye(t).defaultView}function we(t){var r=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,r)}}function V(t,r,a){r||(r={});for(var s in t)t.hasOwnProperty(s)&&(a!==!1||!r.hasOwnProperty(s))&&(r[s]=t[s]);return r}function le(t,r,a,s,u){r==null&&(r=t.search(/[^\s\u00a0]/),r==-1&&(r=t.length));for(var p=s||0,h=u||0;;){var v=t.indexOf(" ",p);if(v<0||v>=r)return h+(r-p);h+=v-p,h+=a-h%a,p=v+1}}var re=function(){this.id=null,this.f=null,this.time=0,this.handler=we(this.onTimeout,this)};re.prototype.onTimeout=function(t){t.id=0,t.time<=+new Date?t.f():setTimeout(t.handler,t.time-+new Date)},re.prototype.set=function(t,r){this.f=r;var a=+new Date+t;(!this.id||a<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,t),this.time=a)};function ie(t,r){for(var a=0;a<t.length;++a)if(t[a]==r)return a;return-1}var Ee=50,Ce={toString:function(){return"CodeMirror.Pass"}},be={scroll:!1},$e={origin:"*mouse"},Me={origin:"+move"};function Ue(t,r,a){for(var s=0,u=0;;){var p=t.indexOf(" ",s);p==-1&&(p=t.length);var h=p-s;if(p==t.length||u+h>=r)return s+Math.min(h,r-u);if(u+=p-s,u+=a-u%a,s=p+1,u>=r)return s}}var ut=[""];function at(t){for(;ut.length<=t;)ut.push(Te(ut)+" ");return ut[t]}function Te(t){return t[t.length-1]}function He(t,r){for(var a=[],s=0;s<t.length;s++)a[s]=r(t[s],s);return a}function G(t,r,a){for(var s=0,u=a(r);s<t.length&&a(t[s])<=u;)s++;t.splice(s,0,r)}function ae(){}function K(t,r){var a;return Object.create?a=Object.create(t):(ae.prototype=t,a=new ae),r&&V(r,a),a}var Ne=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function vt(t){return/\w/.test(t)||t>"\x80"&&(t.toUpperCase()!=t.toLowerCase()||Ne.test(t))}function Sn(t,r){return r?r.source.indexOf("\\w")>-1&&vt(t)?!0:r.test(t):vt(t)}function ps(t){for(var r in t)if(t.hasOwnProperty(r)&&t[r])return!1;return!0}var En=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function rt(t){return t.charCodeAt(0)>=768&&En.test(t)}function zn(t,r,a){for(;(a<0?r>0:r<t.length)&&rt(t.charAt(r));)r+=a;return r}function wn(t,r,a){for(var s=r>a?-1:1;;){if(r==a)return r;var u=(r+a)/2,p=s<0?Math.ceil(u):Math.floor(u);if(p==r)return t(p)?r:a;t(p)?a=p:r=p+s}}function Rn(t,r,a,s){if(!t)return s(r,a,"ltr",0);for(var u=!1,p=0;p<t.length;++p){var h=t[p];(h.from<a&&h.to>r||r==a&&h.to==r)&&(s(Math.max(h.from,r),Math.min(h.to,a),h.level==1?"rtl":"ltr",p),u=!0)}u||s(r,a,"ltr")}var fr=null;function Hn(t,r,a){var s;fr=null;for(var u=0;u<t.length;++u){var p=t[u];if(p.from<r&&p.to>r)return u;p.to==r&&(p.from!=p.to&&a=="before"?s=u:fr=u),p.from==r&&(p.from!=p.to&&a!="before"?s=u:fr=u)}return s??fr}var al=(function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function a(x){return x<=247?t.charAt(x):1424<=x&&x<=1524?"R":1536<=x&&x<=1785?r.charAt(x-1536):1774<=x&&x<=2220?"r":8192<=x&&x<=8203?"w":x==8204?"b":"L"}var s=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,u=/[stwN]/,p=/[LRr]/,h=/[Lb1n]/,v=/[1n]/;function w(x,O,j){this.level=x,this.from=O,this.to=j}return function(x,O){var j=O=="ltr"?"L":"R";if(x.length==0||O=="ltr"&&!s.test(x))return!1;for(var _=x.length,H=[],Q=0;Q<_;++Q)H.push(a(x.charCodeAt(Q)));for(var te=0,se=j;te<_;++te){var ue=H[te];ue=="m"?H[te]=se:se=ue}for(var de=0,ce=j;de<_;++de){var he=H[de];he=="1"&&ce=="r"?H[de]="n":p.test(he)&&(ce=he,he=="r"&&(H[de]="R"))}for(var ve=1,me=H[0];ve<_-1;++ve){var Se=H[ve];Se=="+"&&me=="1"&&H[ve+1]=="1"?H[ve]="1":Se==","&&me==H[ve+1]&&(me=="1"||me=="n")&&(H[ve]=me),me=Se}for(var qe=0;qe<_;++qe){var ht=H[qe];if(ht==",")H[qe]="N";else if(ht=="%"){var Ve=void 0;for(Ve=qe+1;Ve<_&&H[Ve]=="%";++Ve);for(var zt=qe&&H[qe-1]=="!"||Ve<_&&H[Ve]=="1"?"1":"N",Ot=qe;Ot<Ve;++Ot)H[Ot]=zt;qe=Ve-1}}for(var it=0,It=j;it<_;++it){var mt=H[it];It=="L"&&mt=="1"?H[it]="L":p.test(mt)&&(It=mt)}for(var lt=0;lt<_;++lt)if(u.test(H[lt])){var ot=void 0;for(ot=lt+1;ot<_&&u.test(H[ot]);++ot);for(var Je=(lt?H[lt-1]:j)=="L",Bt=(ot<_?H[ot]:j)=="L",di=Je==Bt?Je?"L":"R":j,Xn=lt;Xn<ot;++Xn)H[Xn]=di;lt=ot-1}for(var kt=[],Dn,gt=0;gt<_;)if(h.test(H[gt])){var tu=gt;for(++gt;gt<_&&h.test(H[gt]);++gt);kt.push(new w(0,tu,gt))}else{var Bn=gt,xr=kt.length,kr=O=="rtl"?1:0;for(++gt;gt<_&&H[gt]!="L";++gt);for(var St=Bn;St<gt;)if(v.test(H[St])){Bn<St&&(kt.splice(xr,0,new w(1,Bn,St)),xr+=kr);var pi=St;for(++St;St<gt&&v.test(H[St]);++St);kt.splice(xr,0,new w(2,pi,St)),xr+=kr,Bn=St}else++St;Bn<gt&&kt.splice(xr,0,new w(1,Bn,gt))}return O=="ltr"&&(kt[0].level==1&&(Dn=x.match(/^\s+/))&&(kt[0].from=Dn[0].length,kt.unshift(new w(0,0,Dn[0].length))),Te(kt).level==1&&(Dn=x.match(/\s+$/))&&(Te(kt).to-=Dn[0].length,kt.push(new w(0,_-Dn[0].length,_)))),O=="rtl"?kt.reverse():kt}})();function Le(t,r){var a=t.order;return a==null&&(a=t.order=al(t.text,r)),a}var hs=[],ye=function(t,r,a){if(t.addEventListener)t.addEventListener(r,a,!1);else if(t.attachEvent)t.attachEvent("on"+r,a);else{var s=t._handlers||(t._handlers={});s[r]=(s[r]||hs).concat(a)}};function Mn(t,r){return t._handlers&&t._handlers[r]||hs}function wt(t,r,a){if(t.removeEventListener)t.removeEventListener(r,a,!1);else if(t.detachEvent)t.detachEvent("on"+r,a);else{var s=t._handlers,u=s&&s[r];if(u){var p=ie(u,a);p>-1&&(s[r]=u.slice(0,p).concat(u.slice(p+1)))}}}function Qe(t,r){var a=Mn(t,r);if(a.length)for(var s=Array.prototype.slice.call(arguments,2),u=0;u<a.length;++u)a[u].apply(null,s)}function Ke(t,r,a){return typeof r=="string"&&(r={type:r,preventDefault:function(){this.defaultPrevented=!0}}),Qe(t,a||r.type,t,r),Lt(r)||r.codemirrorIgnore}function Zt(t){var r=t._handlers&&t._handlers.cursorActivity;if(r)for(var a=t.curOp.cursorActivityHandlers||(t.curOp.cursorActivityHandlers=[]),s=0;s<r.length;++s)ie(a,r[s])==-1&&a.push(r[s])}function Pt(t,r){return Mn(t,r).length>0}function nn(t){t.prototype.on=function(r,a){ye(this,r,a)},t.prototype.off=function(r,a){wt(this,r,a)}}function bt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function qr(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function Lt(t){return t.defaultPrevented!=null?t.defaultPrevented:t.returnValue==!1}function qn(t){bt(t),qr(t)}function Wi(t){return t.target||t.srcElement}function rn(t){var r=t.which;return r==null&&(t.button&1?r=1:t.button&2?r=3:t.button&4&&(r=2)),L&&t.ctrlKey&&r==1&&(r=3),r}var ll=(function(){if(f&&d<9)return!1;var t=S("div");return"draggable"in t||"dragDrop"in t})(),_r;function gs(t){if(_r==null){var r=S("span","\u200B");Z(t,S("span",[r,document.createTextNode("x")])),t.firstChild.offsetHeight!=0&&(_r=r.offsetWidth<=1&&r.offsetHeight>2&&!(f&&d<8))}var a=_r?S("span","\u200B"):S("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return a.setAttribute("cm-text",""),a}var $i;function _n(t){if($i!=null)return $i;var r=Z(t,document.createTextNode("A\u062EA")),a=ee(r,0,1).getBoundingClientRect(),s=ee(r,1,2).getBoundingClientRect();return q(t),!a||a.left==a.right?!1:$i=s.right-a.right<3}var Jt=`
|
|
113
113
|
|
|
114
114
|
b`.split(/\n/).length!=3?function(t){for(var r=0,a=[],s=t.length;r<=s;){var u=t.indexOf(`
|
|
115
|
-
`,r);u==-1&&(u=t.length);var p=t.slice(r,t.charAt(u-1)=="\r"?u-1:u),h=p.indexOf("\r");h!=-1?(a.push(p.slice(0,h)),r+=h+1):(a.push(p),r=u+1)}return a}:function(t){return t.split(/\r\n?|\n/)},Wn=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch{return!1}}:function(t){var r;try{r=t.ownerDocument.selection.createRange()}catch{}return!r||r.parentElement()!=t?!1:r.compareEndPoints("StartToEnd",r)!=0},ms=function(){var t=S("div");return"oncopy"in t?!0:(t.setAttribute("oncopy","return;"),typeof t.oncopy=="function")}(),on=null;function ul(t){if(on!=null)return on;var r=Z(t,S("span","x")),a=r.getBoundingClientRect(),s=ee(r,0,1).getBoundingClientRect();return on=Math.abs(a.left-s.left)>1}var Wr={},sn={};function an(t,r){arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),Wr[t]=r}function dr(t,r){sn[t]=r}function $r(t){if(typeof t=="string"&&sn.hasOwnProperty(t))t=sn[t];else if(t&&typeof t.name=="string"&&sn.hasOwnProperty(t.name)){var r=sn[t.name];typeof r=="string"&&(r={name:r}),t=K(r,t),t.name=r.name}else{if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return $r("application/xml");if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return $r("application/json")}return typeof t=="string"?{name:t}:t||{name:"null"}}function Ur(t,r){r=$r(r);var a=Wr[r.name];if(!a)return Ur(t,"text/plain");var s=a(t,r);if($n.hasOwnProperty(r.name)){var u=$n[r.name];for(var p in u)u.hasOwnProperty(p)&&(s.hasOwnProperty(p)&&(s["_"+p]=s[p]),s[p]=u[p])}if(s.name=r.name,r.helperType&&(s.helperType=r.helperType),r.modeProps)for(var h in r.modeProps)s[h]=r.modeProps[h];return s}var $n={};function Gr(t,r){var a=$n.hasOwnProperty(t)?$n[t]:$n[t]={};V(r,a)}function bn(t,r){if(r===!0)return r;if(t.copyState)return t.copyState(r);var a={};for(var s in r){var u=r[s];u instanceof Array&&(u=u.concat([])),a[s]=u}return a}function Ui(t,r){for(var a;t.innerMode&&(a=t.innerMode(r),!(!a||a.mode==t));)r=a.state,t=a.mode;return a||{mode:t,state:r}}function Vr(t,r,a){return t.startState?t.startState(r,a):!0}var Ze=function(t,r,a){this.pos=this.start=0,this.string=t,this.tabSize=r||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=a};Ze.prototype.eol=function(){return this.pos>=this.string.length},Ze.prototype.sol=function(){return this.pos==this.lineStart},Ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ze.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ze.prototype.eat=function(t){var r=this.string.charAt(this.pos),a;if(typeof t=="string"?a=r==t:a=r&&(t.test?t.test(r):t(r)),a)return++this.pos,r},Ze.prototype.eatWhile=function(t){for(var r=this.pos;this.eat(t););return this.pos>r},Ze.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Ze.prototype.skipToEnd=function(){this.pos=this.string.length},Ze.prototype.skipTo=function(t){var r=this.string.indexOf(t,this.pos);if(r>-1)return this.pos=r,!0},Ze.prototype.backUp=function(t){this.pos-=t},Ze.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=le(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?le(this.string,this.lineStart,this.tabSize):0)},Ze.prototype.indentation=function(){return le(this.string,null,this.tabSize)-(this.lineStart?le(this.string,this.lineStart,this.tabSize):0)},Ze.prototype.match=function(t,r,a){if(typeof t=="string"){var s=function(h){return a?h.toLowerCase():h},u=this.string.substr(this.pos,t.length);if(s(u)==s(t))return r!==!1&&(this.pos+=t.length),!0}else{var p=this.string.slice(this.pos).match(t);return p&&p.index>0?null:(p&&r!==!1&&(this.pos+=p[0].length),p)}},Ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ze.prototype.hideFirstChars=function(t,r){this.lineStart+=t;try{return r()}finally{this.lineStart-=t}},Ze.prototype.lookAhead=function(t){var r=this.lineOracle;return r&&r.lookAhead(t)},Ze.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};function ge(t,r){if(r-=t.first,r<0||r>=t.size)throw new Error("There is no line "+(r+t.first)+" in the document.");for(var a=t;!a.lines;)for(var s=0;;++s){var u=a.children[s],p=u.chunkSize();if(r<p){a=u;break}r-=p}return a.lines[r]}function Ln(t,r,a){var s=[],u=r.line;return t.iter(r.line,a.line+1,function(p){var h=p.text;u==a.line&&(h=h.slice(0,a.ch)),u==r.line&&(h=h.slice(r.ch)),s.push(h),++u}),s}function Gi(t,r,a){var s=[];return t.iter(r,a,function(u){s.push(u.text)}),s}function Ut(t,r){var a=r-t.height;if(a)for(var s=t;s;s=s.parent)s.height+=a}function D(t){if(t.parent==null)return null;for(var r=t.parent,a=ie(r.lines,t),s=r.parent;s;r=s,s=s.parent)for(var u=0;s.children[u]!=r;++u)a+=s.children[u].chunkSize();return a+r.first}function P(t,r){var a=t.first;e:do{for(var s=0;s<t.children.length;++s){var u=t.children[s],p=u.height;if(r<p){t=u;continue e}r-=p,a+=u.chunkSize()}return a}while(!t.lines);for(var h=0;h<t.lines.length;++h){var v=t.lines[h],w=v.height;if(r<w)break;r-=w}return a+h}function J(t,r){return r>=t.first&&r<t.first+t.size}function oe(t,r){return String(t.lineNumberFormatter(r+t.firstLineNumber))}function Y(t,r,a){if(a===void 0&&(a=null),!(this instanceof Y))return new Y(t,r,a);this.line=t,this.ch=r,this.sticky=a}function fe(t,r){return t.line-r.line||t.ch-r.ch}function Ie(t,r){return t.sticky==r.sticky&&fe(t,r)==0}function ct(t){return Y(t.line,t.ch)}function Tt(t,r){return fe(t,r)<0?r:t}function Yr(t,r){return fe(t,r)<0?t:r}function dd(t,r){return Math.max(t.first,Math.min(r,t.first+t.size-1))}function ke(t,r){if(r.line<t.first)return Y(t.first,0);var a=t.first+t.size-1;return r.line>a?Y(a,ge(t,a).text.length):fk(r,ge(t,r.line).text.length)}function fk(t,r){var a=t.ch;return a==null||a>r?Y(t.line,r):a<0?Y(t.line,0):t}function pd(t,r){for(var a=[],s=0;s<r.length;s++)a[s]=ke(t,r[s]);return a}var ys=function(t,r){this.state=t,this.lookAhead=r},xn=function(t,r,a,s){this.state=r,this.doc=t,this.line=a,this.maxLookAhead=s||0,this.baseTokens=null,this.baseTokenPos=1};xn.prototype.lookAhead=function(t){var r=this.doc.getLine(this.line+t);return r!=null&&t>this.maxLookAhead&&(this.maxLookAhead=t),r},xn.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var r=this.baseTokens[this.baseTokenPos+1];return{type:r&&r.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},xn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},xn.fromSaved=function(t,r,a){return r instanceof ys?new xn(t,bn(t.mode,r.state),a,r.lookAhead):new xn(t,bn(t.mode,r),a)},xn.prototype.save=function(t){var r=t!==!1?bn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ys(r,this.maxLookAhead):r};function hd(t,r,a,s){var u=[t.state.modeGen],p={};bd(t,r.text,t.doc.mode,a,function(x,O){return u.push(x,O)},p,s);for(var h=a.state,v=function(x){a.baseTokens=u;var O=t.state.overlays[x],j=1,_=0;a.state=!0,bd(t,r.text,O.mode,a,function(H,Q){for(var te=j;_<H;){var se=u[j];se>H&&u.splice(j,1,H,u[j+1],se),j+=2,_=Math.min(H,se)}if(Q)if(O.opaque)u.splice(te,j-te,H,"overlay "+Q),j=te+2;else for(;te<j;te+=2){var ue=u[te+1];u[te+1]=(ue?ue+" ":"")+"overlay "+Q}},p),a.state=h,a.baseTokens=null,a.baseTokenPos=1},w=0;w<t.state.overlays.length;++w)v(w);return{styles:u,classes:p.bgClass||p.textClass?p:null}}function gd(t,r,a){if(!r.styles||r.styles[0]!=t.state.modeGen){var s=Vi(t,D(r)),u=r.text.length>t.options.maxHighlightLength&&bn(t.doc.mode,s.state),p=hd(t,r,s);u&&(s.state=u),r.stateAfter=s.save(!u),r.styles=p.styles,p.classes?r.styleClasses=p.classes:r.styleClasses&&(r.styleClasses=null),a===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return r.styles}function Vi(t,r,a){var s=t.doc,u=t.display;if(!s.mode.startState)return new xn(s,!0,r);var p=dk(t,r,a),h=p>s.first&&ge(s,p-1).stateAfter,v=h?xn.fromSaved(s,h,p):new xn(s,Vr(s.mode),p);return s.iter(p,r,function(w){cl(t,w.text,v);var x=v.line;w.stateAfter=x==r-1||x%5==0||x>=u.viewFrom&&x<u.viewTo?v.save():null,v.nextLine()}),a&&(s.modeFrontier=v.line),v}function cl(t,r,a,s){var u=t.doc.mode,p=new Ze(r,t.options.tabSize,a);for(p.start=p.pos=s||0,r==""&&md(u,a.state);!p.eol();)fl(u,p,a.state),p.start=p.pos}function md(t,r){if(t.blankLine)return t.blankLine(r);if(t.innerMode){var a=Ui(t,r);if(a.mode.blankLine)return a.mode.blankLine(a.state)}}function fl(t,r,a,s){for(var u=0;u<10;u++){s&&(s[0]=Ui(t,a).mode);var p=t.token(r,a);if(r.pos>r.start)return p}throw new Error("Mode "+t.name+" failed to advance stream.")}var yd=function(t,r,a){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=r||null,this.state=a};function vd(t,r,a,s){var u=t.doc,p=u.mode,h;r=ke(u,r);var v=ge(u,r.line),w=Vi(t,r.line,a),x=new Ze(v.text,t.options.tabSize,w),O;for(s&&(O=[]);(s||x.pos<r.ch)&&!x.eol();)x.start=x.pos,h=fl(p,x,w.state),s&&O.push(new yd(x,h,bn(u.mode,w.state)));return s?O:new yd(x,h,w.state)}function wd(t,r){if(t)for(;;){var a=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!a)break;t=t.slice(0,a.index)+t.slice(a.index+a[0].length);var s=a[1]?"bgClass":"textClass";r[s]==null?r[s]=a[2]:new RegExp("(?:^|\\s)"+a[2]+"(?:$|\\s)").test(r[s])||(r[s]+=" "+a[2])}return t}function bd(t,r,a,s,u,p,h){var v=a.flattenSpans;v==null&&(v=t.options.flattenSpans);var w=0,x=null,O=new Ze(r,t.options.tabSize,s),j,_=t.options.addModeClass&&[null];for(r==""&&wd(md(a,s.state),p);!O.eol();){if(O.pos>t.options.maxHighlightLength?(v=!1,h&&cl(t,r,s,O.pos),O.pos=r.length,j=null):j=wd(fl(a,O,s.state,_),p),_){var H=_[0].name;H&&(j="m-"+(j?H+" "+j:H))}if(!v||x!=j){for(;w<O.start;)w=Math.min(O.start,w+5e3),u(w,x);x=j}O.start=O.pos}for(;w<O.pos;){var Q=Math.min(O.pos,w+5e3);u(Q,x),w=Q}}function dk(t,r,a){for(var s,u,p=t.doc,h=a?-1:r-(t.doc.mode.innerMode?1e3:100),v=r;v>h;--v){if(v<=p.first)return p.first;var w=ge(p,v-1),x=w.stateAfter;if(x&&(!a||v+(x instanceof ys?x.lookAhead:0)<=p.modeFrontier))return v;var O=le(w.text,null,t.options.tabSize);(u==null||s>O)&&(u=v-1,s=O)}return u}function pk(t,r){if(t.modeFrontier=Math.min(t.modeFrontier,r),!(t.highlightFrontier<r-10)){for(var a=t.first,s=r-1;s>a;s--){var u=ge(t,s).stateAfter;if(u&&(!(u instanceof ys)||s+u.lookAhead<r)){a=s+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,a)}}var xd=!1,Tn=!1;function hk(){xd=!0}function gk(){Tn=!0}function vs(t,r,a){this.marker=t,this.from=r,this.to=a}function Yi(t,r){if(t)for(var a=0;a<t.length;++a){var s=t[a];if(s.marker==r)return s}}function mk(t,r){for(var a,s=0;s<t.length;++s)t[s]!=r&&(a||(a=[])).push(t[s]);return a}function yk(t,r,a){var s=a&&window.WeakSet&&(a.markedSpans||(a.markedSpans=new WeakSet));s&&t.markedSpans&&s.has(t.markedSpans)?t.markedSpans.push(r):(t.markedSpans=t.markedSpans?t.markedSpans.concat([r]):[r],s&&s.add(t.markedSpans)),r.marker.attachLine(t)}function vk(t,r,a){var s;if(t)for(var u=0;u<t.length;++u){var p=t[u],h=p.marker,v=p.from==null||(h.inclusiveLeft?p.from<=r:p.from<r);if(v||p.from==r&&h.type=="bookmark"&&(!a||!p.marker.insertLeft)){var w=p.to==null||(h.inclusiveRight?p.to>=r:p.to>r);(s||(s=[])).push(new vs(h,p.from,w?null:p.to))}}return s}function wk(t,r,a){var s;if(t)for(var u=0;u<t.length;++u){var p=t[u],h=p.marker,v=p.to==null||(h.inclusiveRight?p.to>=r:p.to>r);if(v||p.from==r&&h.type=="bookmark"&&(!a||p.marker.insertLeft)){var w=p.from==null||(h.inclusiveLeft?p.from<=r:p.from<r);(s||(s=[])).push(new vs(h,w?null:p.from-r,p.to==null?null:p.to-r))}}return s}function dl(t,r){if(r.full)return null;var a=J(t,r.from.line)&&ge(t,r.from.line).markedSpans,s=J(t,r.to.line)&&ge(t,r.to.line).markedSpans;if(!a&&!s)return null;var u=r.from.ch,p=r.to.ch,h=fe(r.from,r.to)==0,v=vk(a,u,h),w=wk(s,p,h),x=r.text.length==1,O=Te(r.text).length+(x?u:0);if(v)for(var j=0;j<v.length;++j){var _=v[j];if(_.to==null){var H=Yi(w,_.marker);H?x&&(_.to=H.to==null?null:H.to+O):_.to=u}}if(w)for(var Q=0;Q<w.length;++Q){var te=w[Q];if(te.to!=null&&(te.to+=O),te.from==null){var se=Yi(v,te.marker);se||(te.from=O,x&&(v||(v=[])).push(te))}else te.from+=O,x&&(v||(v=[])).push(te)}v&&(v=kd(v)),w&&w!=v&&(w=kd(w));var ue=[v];if(!x){var de=r.text.length-2,ce;if(de>0&&v)for(var he=0;he<v.length;++he)v[he].to==null&&(ce||(ce=[])).push(new vs(v[he].marker,null,null));for(var ve=0;ve<de;++ve)ue.push(ce);ue.push(w)}return ue}function kd(t){for(var r=0;r<t.length;++r){var a=t[r];a.from!=null&&a.from==a.to&&a.marker.clearWhenEmpty!==!1&&t.splice(r--,1)}return t.length?t:null}function bk(t,r,a){var s=null;if(t.iter(r.line,a.line+1,function(H){if(H.markedSpans)for(var Q=0;Q<H.markedSpans.length;++Q){var te=H.markedSpans[Q].marker;te.readOnly&&(!s||ie(s,te)==-1)&&(s||(s=[])).push(te)}}),!s)return null;for(var u=[{from:r,to:a}],p=0;p<s.length;++p)for(var h=s[p],v=h.find(0),w=0;w<u.length;++w){var x=u[w];if(!(fe(x.to,v.from)<0||fe(x.from,v.to)>0)){var O=[w,1],j=fe(x.from,v.from),_=fe(x.to,v.to);(j<0||!h.inclusiveLeft&&!j)&&O.push({from:x.from,to:v.from}),(_>0||!h.inclusiveRight&&!_)&&O.push({from:v.to,to:x.to}),u.splice.apply(u,O),w+=O.length-3}}return u}function Cd(t){var r=t.markedSpans;if(r){for(var a=0;a<r.length;++a)r[a].marker.detachLine(t);t.markedSpans=null}}function Dd(t,r){if(r){for(var a=0;a<r.length;++a)r[a].marker.attachLine(t);t.markedSpans=r}}function ws(t){return t.inclusiveLeft?-1:0}function bs(t){return t.inclusiveRight?1:0}function pl(t,r){var a=t.lines.length-r.lines.length;if(a!=0)return a;var s=t.find(),u=r.find(),p=fe(s.from,u.from)||ws(t)-ws(r);if(p)return-p;var h=fe(s.to,u.to)||bs(t)-bs(r);return h||r.id-t.id}function Ad(t,r){var a=Tn&&t.markedSpans,s;if(a)for(var u=void 0,p=0;p<a.length;++p)u=a[p],u.marker.collapsed&&(r?u.from:u.to)==null&&(!s||pl(s,u.marker)<0)&&(s=u.marker);return s}function Sd(t){return Ad(t,!0)}function xs(t){return Ad(t,!1)}function xk(t,r){var a=Tn&&t.markedSpans,s;if(a)for(var u=0;u<a.length;++u){var p=a[u];p.marker.collapsed&&(p.from==null||p.from<r)&&(p.to==null||p.to>r)&&(!s||pl(s,p.marker)<0)&&(s=p.marker)}return s}function Ed(t,r,a,s,u){var p=ge(t,r),h=Tn&&p.markedSpans;if(h)for(var v=0;v<h.length;++v){var w=h[v];if(w.marker.collapsed){var x=w.marker.find(0),O=fe(x.from,a)||ws(w.marker)-ws(u),j=fe(x.to,s)||bs(w.marker)-bs(u);if(!(O>=0&&j<=0||O<=0&&j>=0)&&(O<=0&&(w.marker.inclusiveRight&&u.inclusiveLeft?fe(x.to,a)>=0:fe(x.to,a)>0)||O>=0&&(w.marker.inclusiveRight&&u.inclusiveLeft?fe(x.from,s)<=0:fe(x.from,s)<0)))return!0}}}function ln(t){for(var r;r=Sd(t);)t=r.find(-1,!0).line;return t}function kk(t){for(var r;r=xs(t);)t=r.find(1,!0).line;return t}function Ck(t){for(var r,a;r=xs(t);)t=r.find(1,!0).line,(a||(a=[])).push(t);return a}function hl(t,r){var a=ge(t,r),s=ln(a);return a==s?r:D(s)}function Md(t,r){if(r>t.lastLine())return r;var a=ge(t,r),s;if(!Un(t,a))return r;for(;s=xs(a);)a=s.find(1,!0).line;return D(a)+1}function Un(t,r){var a=Tn&&r.markedSpans;if(a){for(var s=void 0,u=0;u<a.length;++u)if(s=a[u],!!s.marker.collapsed){if(s.from==null)return!0;if(!s.marker.widgetNode&&s.from==0&&s.marker.inclusiveLeft&&gl(t,r,s))return!0}}}function gl(t,r,a){if(a.to==null){var s=a.marker.find(1,!0);return gl(t,s.line,Yi(s.line.markedSpans,a.marker))}if(a.marker.inclusiveRight&&a.to==r.text.length)return!0;for(var u=void 0,p=0;p<r.markedSpans.length;++p)if(u=r.markedSpans[p],u.marker.collapsed&&!u.marker.widgetNode&&u.from==a.to&&(u.to==null||u.to!=a.from)&&(u.marker.inclusiveLeft||a.marker.inclusiveRight)&&gl(t,r,u))return!0}function Fn(t){t=ln(t);for(var r=0,a=t.parent,s=0;s<a.lines.length;++s){var u=a.lines[s];if(u==t)break;r+=u.height}for(var p=a.parent;p;a=p,p=a.parent)for(var h=0;h<p.children.length;++h){var v=p.children[h];if(v==a)break;r+=v.height}return r}function ks(t){if(t.height==0)return 0;for(var r=t.text.length,a,s=t;a=Sd(s);){var u=a.find(0,!0);s=u.from.line,r+=u.from.ch-u.to.ch}for(s=t;a=xs(s);){var p=a.find(0,!0);r-=s.text.length-p.from.ch,s=p.to.line,r+=s.text.length-p.to.ch}return r}function ml(t){var r=t.display,a=t.doc;r.maxLine=ge(a,a.first),r.maxLineLength=ks(r.maxLine),r.maxLineChanged=!0,a.iter(function(s){var u=ks(s);u>r.maxLineLength&&(r.maxLineLength=u,r.maxLine=s)})}var Qr=function(t,r,a){this.text=t,Dd(this,r),this.height=a?a(this):1};Qr.prototype.lineNo=function(){return D(this)},nn(Qr);function Dk(t,r,a,s){t.text=r,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),t.order!=null&&(t.order=null),Cd(t),Dd(t,a);var u=s?s(t):1;u!=t.height&&Ut(t,u)}function Ak(t){t.parent=null,Cd(t)}var Sk={},Ek={};function Ld(t,r){if(!t||/^\s*$/.test(t))return null;var a=r.addModeClass?Ek:Sk;return a[t]||(a[t]=t.replace(/\S+/g,"cm-$&"))}function Td(t,r){var a=X("span",null,null,g?"padding-right: .1px":null),s={pre:X("pre",[a],"CodeMirror-line"),content:a,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};r.measure={};for(var u=0;u<=(r.rest?r.rest.length:0);u++){var p=u?r.rest[u-1]:r.line,h=void 0;s.pos=0,s.addToken=Lk,_n(t.display.measure)&&(h=Le(p,t.doc.direction))&&(s.addToken=Fk(s.addToken,h)),s.map=[];var v=r!=t.display.externalMeasured&&D(p);Nk(p,s,gd(t,p,v)),p.styleClasses&&(p.styleClasses.bgClass&&(s.bgClass=et(p.styleClasses.bgClass,s.bgClass||"")),p.styleClasses.textClass&&(s.textClass=et(p.styleClasses.textClass,s.textClass||""))),s.map.length==0&&s.map.push(0,0,s.content.appendChild(gs(t.display.measure))),u==0?(r.measure.map=s.map,r.measure.cache={}):((r.measure.maps||(r.measure.maps=[])).push(s.map),(r.measure.caches||(r.measure.caches=[])).push({}))}if(g){var w=s.content.lastChild;(/\bcm-tab\b/.test(w.className)||w.querySelector&&w.querySelector(".cm-tab"))&&(s.content.className="cm-tab-wrap-hack")}return Qe(t,"renderLine",t,r.line,s.pre),s.pre.className&&(s.textClass=et(s.pre.className,s.textClass||"")),s}function Mk(t){var r=S("span","\u2022","cm-invalidchar");return r.title="\\u"+t.charCodeAt(0).toString(16),r.setAttribute("aria-label",r.title),r}function Lk(t,r,a,s,u,p,h){if(r){var v=t.splitSpaces?Tk(r,t.trailingSpace):r,w=t.cm.state.specialChars,x=!1,O;if(!w.test(r))t.col+=r.length,O=document.createTextNode(v),t.map.push(t.pos,t.pos+r.length,O),f&&d<9&&(x=!0),t.pos+=r.length;else{O=document.createDocumentFragment();for(var j=0;;){w.lastIndex=j;var _=w.exec(r),H=_?_.index-j:r.length-j;if(H){var Q=document.createTextNode(v.slice(j,j+H));f&&d<9?O.appendChild(S("span",[Q])):O.appendChild(Q),t.map.push(t.pos,t.pos+H,Q),t.col+=H,t.pos+=H}if(!_)break;j+=H+1;var te=void 0;if(_[0]==" "){var se=t.cm.options.tabSize,ue=se-t.col%se;te=O.appendChild(S("span",at(ue),"cm-tab")),te.setAttribute("role","presentation"),te.setAttribute("cm-text"," "),t.col+=ue}else _[0]=="\r"||_[0]==`
|
|
115
|
+
`,r);u==-1&&(u=t.length);var p=t.slice(r,t.charAt(u-1)=="\r"?u-1:u),h=p.indexOf("\r");h!=-1?(a.push(p.slice(0,h)),r+=h+1):(a.push(p),r=u+1)}return a}:function(t){return t.split(/\r\n?|\n/)},Wn=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch{return!1}}:function(t){var r;try{r=t.ownerDocument.selection.createRange()}catch{}return!r||r.parentElement()!=t?!1:r.compareEndPoints("StartToEnd",r)!=0},ms=(function(){var t=S("div");return"oncopy"in t?!0:(t.setAttribute("oncopy","return;"),typeof t.oncopy=="function")})(),on=null;function ul(t){if(on!=null)return on;var r=Z(t,S("span","x")),a=r.getBoundingClientRect(),s=ee(r,0,1).getBoundingClientRect();return on=Math.abs(a.left-s.left)>1}var Wr={},sn={};function an(t,r){arguments.length>2&&(r.dependencies=Array.prototype.slice.call(arguments,2)),Wr[t]=r}function dr(t,r){sn[t]=r}function $r(t){if(typeof t=="string"&&sn.hasOwnProperty(t))t=sn[t];else if(t&&typeof t.name=="string"&&sn.hasOwnProperty(t.name)){var r=sn[t.name];typeof r=="string"&&(r={name:r}),t=K(r,t),t.name=r.name}else{if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return $r("application/xml");if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return $r("application/json")}return typeof t=="string"?{name:t}:t||{name:"null"}}function Ur(t,r){r=$r(r);var a=Wr[r.name];if(!a)return Ur(t,"text/plain");var s=a(t,r);if($n.hasOwnProperty(r.name)){var u=$n[r.name];for(var p in u)u.hasOwnProperty(p)&&(s.hasOwnProperty(p)&&(s["_"+p]=s[p]),s[p]=u[p])}if(s.name=r.name,r.helperType&&(s.helperType=r.helperType),r.modeProps)for(var h in r.modeProps)s[h]=r.modeProps[h];return s}var $n={};function Gr(t,r){var a=$n.hasOwnProperty(t)?$n[t]:$n[t]={};V(r,a)}function bn(t,r){if(r===!0)return r;if(t.copyState)return t.copyState(r);var a={};for(var s in r){var u=r[s];u instanceof Array&&(u=u.concat([])),a[s]=u}return a}function Ui(t,r){for(var a;t.innerMode&&(a=t.innerMode(r),!(!a||a.mode==t));)r=a.state,t=a.mode;return a||{mode:t,state:r}}function Vr(t,r,a){return t.startState?t.startState(r,a):!0}var Ze=function(t,r,a){this.pos=this.start=0,this.string=t,this.tabSize=r||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=a};Ze.prototype.eol=function(){return this.pos>=this.string.length},Ze.prototype.sol=function(){return this.pos==this.lineStart},Ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ze.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ze.prototype.eat=function(t){var r=this.string.charAt(this.pos),a;if(typeof t=="string"?a=r==t:a=r&&(t.test?t.test(r):t(r)),a)return++this.pos,r},Ze.prototype.eatWhile=function(t){for(var r=this.pos;this.eat(t););return this.pos>r},Ze.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Ze.prototype.skipToEnd=function(){this.pos=this.string.length},Ze.prototype.skipTo=function(t){var r=this.string.indexOf(t,this.pos);if(r>-1)return this.pos=r,!0},Ze.prototype.backUp=function(t){this.pos-=t},Ze.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=le(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?le(this.string,this.lineStart,this.tabSize):0)},Ze.prototype.indentation=function(){return le(this.string,null,this.tabSize)-(this.lineStart?le(this.string,this.lineStart,this.tabSize):0)},Ze.prototype.match=function(t,r,a){if(typeof t=="string"){var s=function(h){return a?h.toLowerCase():h},u=this.string.substr(this.pos,t.length);if(s(u)==s(t))return r!==!1&&(this.pos+=t.length),!0}else{var p=this.string.slice(this.pos).match(t);return p&&p.index>0?null:(p&&r!==!1&&(this.pos+=p[0].length),p)}},Ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ze.prototype.hideFirstChars=function(t,r){this.lineStart+=t;try{return r()}finally{this.lineStart-=t}},Ze.prototype.lookAhead=function(t){var r=this.lineOracle;return r&&r.lookAhead(t)},Ze.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};function ge(t,r){if(r-=t.first,r<0||r>=t.size)throw new Error("There is no line "+(r+t.first)+" in the document.");for(var a=t;!a.lines;)for(var s=0;;++s){var u=a.children[s],p=u.chunkSize();if(r<p){a=u;break}r-=p}return a.lines[r]}function Ln(t,r,a){var s=[],u=r.line;return t.iter(r.line,a.line+1,function(p){var h=p.text;u==a.line&&(h=h.slice(0,a.ch)),u==r.line&&(h=h.slice(r.ch)),s.push(h),++u}),s}function Gi(t,r,a){var s=[];return t.iter(r,a,function(u){s.push(u.text)}),s}function Ut(t,r){var a=r-t.height;if(a)for(var s=t;s;s=s.parent)s.height+=a}function D(t){if(t.parent==null)return null;for(var r=t.parent,a=ie(r.lines,t),s=r.parent;s;r=s,s=s.parent)for(var u=0;s.children[u]!=r;++u)a+=s.children[u].chunkSize();return a+r.first}function P(t,r){var a=t.first;e:do{for(var s=0;s<t.children.length;++s){var u=t.children[s],p=u.height;if(r<p){t=u;continue e}r-=p,a+=u.chunkSize()}return a}while(!t.lines);for(var h=0;h<t.lines.length;++h){var v=t.lines[h],w=v.height;if(r<w)break;r-=w}return a+h}function J(t,r){return r>=t.first&&r<t.first+t.size}function oe(t,r){return String(t.lineNumberFormatter(r+t.firstLineNumber))}function Y(t,r,a){if(a===void 0&&(a=null),!(this instanceof Y))return new Y(t,r,a);this.line=t,this.ch=r,this.sticky=a}function fe(t,r){return t.line-r.line||t.ch-r.ch}function Ie(t,r){return t.sticky==r.sticky&&fe(t,r)==0}function ct(t){return Y(t.line,t.ch)}function Tt(t,r){return fe(t,r)<0?r:t}function Yr(t,r){return fe(t,r)<0?t:r}function dd(t,r){return Math.max(t.first,Math.min(r,t.first+t.size-1))}function ke(t,r){if(r.line<t.first)return Y(t.first,0);var a=t.first+t.size-1;return r.line>a?Y(a,ge(t,a).text.length):fk(r,ge(t,r.line).text.length)}function fk(t,r){var a=t.ch;return a==null||a>r?Y(t.line,r):a<0?Y(t.line,0):t}function pd(t,r){for(var a=[],s=0;s<r.length;s++)a[s]=ke(t,r[s]);return a}var ys=function(t,r){this.state=t,this.lookAhead=r},xn=function(t,r,a,s){this.state=r,this.doc=t,this.line=a,this.maxLookAhead=s||0,this.baseTokens=null,this.baseTokenPos=1};xn.prototype.lookAhead=function(t){var r=this.doc.getLine(this.line+t);return r!=null&&t>this.maxLookAhead&&(this.maxLookAhead=t),r},xn.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var r=this.baseTokens[this.baseTokenPos+1];return{type:r&&r.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},xn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},xn.fromSaved=function(t,r,a){return r instanceof ys?new xn(t,bn(t.mode,r.state),a,r.lookAhead):new xn(t,bn(t.mode,r),a)},xn.prototype.save=function(t){var r=t!==!1?bn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ys(r,this.maxLookAhead):r};function hd(t,r,a,s){var u=[t.state.modeGen],p={};bd(t,r.text,t.doc.mode,a,function(x,O){return u.push(x,O)},p,s);for(var h=a.state,v=function(x){a.baseTokens=u;var O=t.state.overlays[x],j=1,_=0;a.state=!0,bd(t,r.text,O.mode,a,function(H,Q){for(var te=j;_<H;){var se=u[j];se>H&&u.splice(j,1,H,u[j+1],se),j+=2,_=Math.min(H,se)}if(Q)if(O.opaque)u.splice(te,j-te,H,"overlay "+Q),j=te+2;else for(;te<j;te+=2){var ue=u[te+1];u[te+1]=(ue?ue+" ":"")+"overlay "+Q}},p),a.state=h,a.baseTokens=null,a.baseTokenPos=1},w=0;w<t.state.overlays.length;++w)v(w);return{styles:u,classes:p.bgClass||p.textClass?p:null}}function gd(t,r,a){if(!r.styles||r.styles[0]!=t.state.modeGen){var s=Vi(t,D(r)),u=r.text.length>t.options.maxHighlightLength&&bn(t.doc.mode,s.state),p=hd(t,r,s);u&&(s.state=u),r.stateAfter=s.save(!u),r.styles=p.styles,p.classes?r.styleClasses=p.classes:r.styleClasses&&(r.styleClasses=null),a===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return r.styles}function Vi(t,r,a){var s=t.doc,u=t.display;if(!s.mode.startState)return new xn(s,!0,r);var p=dk(t,r,a),h=p>s.first&&ge(s,p-1).stateAfter,v=h?xn.fromSaved(s,h,p):new xn(s,Vr(s.mode),p);return s.iter(p,r,function(w){cl(t,w.text,v);var x=v.line;w.stateAfter=x==r-1||x%5==0||x>=u.viewFrom&&x<u.viewTo?v.save():null,v.nextLine()}),a&&(s.modeFrontier=v.line),v}function cl(t,r,a,s){var u=t.doc.mode,p=new Ze(r,t.options.tabSize,a);for(p.start=p.pos=s||0,r==""&&md(u,a.state);!p.eol();)fl(u,p,a.state),p.start=p.pos}function md(t,r){if(t.blankLine)return t.blankLine(r);if(t.innerMode){var a=Ui(t,r);if(a.mode.blankLine)return a.mode.blankLine(a.state)}}function fl(t,r,a,s){for(var u=0;u<10;u++){s&&(s[0]=Ui(t,a).mode);var p=t.token(r,a);if(r.pos>r.start)return p}throw new Error("Mode "+t.name+" failed to advance stream.")}var yd=function(t,r,a){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=r||null,this.state=a};function vd(t,r,a,s){var u=t.doc,p=u.mode,h;r=ke(u,r);var v=ge(u,r.line),w=Vi(t,r.line,a),x=new Ze(v.text,t.options.tabSize,w),O;for(s&&(O=[]);(s||x.pos<r.ch)&&!x.eol();)x.start=x.pos,h=fl(p,x,w.state),s&&O.push(new yd(x,h,bn(u.mode,w.state)));return s?O:new yd(x,h,w.state)}function wd(t,r){if(t)for(;;){var a=t.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!a)break;t=t.slice(0,a.index)+t.slice(a.index+a[0].length);var s=a[1]?"bgClass":"textClass";r[s]==null?r[s]=a[2]:new RegExp("(?:^|\\s)"+a[2]+"(?:$|\\s)").test(r[s])||(r[s]+=" "+a[2])}return t}function bd(t,r,a,s,u,p,h){var v=a.flattenSpans;v==null&&(v=t.options.flattenSpans);var w=0,x=null,O=new Ze(r,t.options.tabSize,s),j,_=t.options.addModeClass&&[null];for(r==""&&wd(md(a,s.state),p);!O.eol();){if(O.pos>t.options.maxHighlightLength?(v=!1,h&&cl(t,r,s,O.pos),O.pos=r.length,j=null):j=wd(fl(a,O,s.state,_),p),_){var H=_[0].name;H&&(j="m-"+(j?H+" "+j:H))}if(!v||x!=j){for(;w<O.start;)w=Math.min(O.start,w+5e3),u(w,x);x=j}O.start=O.pos}for(;w<O.pos;){var Q=Math.min(O.pos,w+5e3);u(Q,x),w=Q}}function dk(t,r,a){for(var s,u,p=t.doc,h=a?-1:r-(t.doc.mode.innerMode?1e3:100),v=r;v>h;--v){if(v<=p.first)return p.first;var w=ge(p,v-1),x=w.stateAfter;if(x&&(!a||v+(x instanceof ys?x.lookAhead:0)<=p.modeFrontier))return v;var O=le(w.text,null,t.options.tabSize);(u==null||s>O)&&(u=v-1,s=O)}return u}function pk(t,r){if(t.modeFrontier=Math.min(t.modeFrontier,r),!(t.highlightFrontier<r-10)){for(var a=t.first,s=r-1;s>a;s--){var u=ge(t,s).stateAfter;if(u&&(!(u instanceof ys)||s+u.lookAhead<r)){a=s+1;break}}t.highlightFrontier=Math.min(t.highlightFrontier,a)}}var xd=!1,Tn=!1;function hk(){xd=!0}function gk(){Tn=!0}function vs(t,r,a){this.marker=t,this.from=r,this.to=a}function Yi(t,r){if(t)for(var a=0;a<t.length;++a){var s=t[a];if(s.marker==r)return s}}function mk(t,r){for(var a,s=0;s<t.length;++s)t[s]!=r&&(a||(a=[])).push(t[s]);return a}function yk(t,r,a){var s=a&&window.WeakSet&&(a.markedSpans||(a.markedSpans=new WeakSet));s&&t.markedSpans&&s.has(t.markedSpans)?t.markedSpans.push(r):(t.markedSpans=t.markedSpans?t.markedSpans.concat([r]):[r],s&&s.add(t.markedSpans)),r.marker.attachLine(t)}function vk(t,r,a){var s;if(t)for(var u=0;u<t.length;++u){var p=t[u],h=p.marker,v=p.from==null||(h.inclusiveLeft?p.from<=r:p.from<r);if(v||p.from==r&&h.type=="bookmark"&&(!a||!p.marker.insertLeft)){var w=p.to==null||(h.inclusiveRight?p.to>=r:p.to>r);(s||(s=[])).push(new vs(h,p.from,w?null:p.to))}}return s}function wk(t,r,a){var s;if(t)for(var u=0;u<t.length;++u){var p=t[u],h=p.marker,v=p.to==null||(h.inclusiveRight?p.to>=r:p.to>r);if(v||p.from==r&&h.type=="bookmark"&&(!a||p.marker.insertLeft)){var w=p.from==null||(h.inclusiveLeft?p.from<=r:p.from<r);(s||(s=[])).push(new vs(h,w?null:p.from-r,p.to==null?null:p.to-r))}}return s}function dl(t,r){if(r.full)return null;var a=J(t,r.from.line)&&ge(t,r.from.line).markedSpans,s=J(t,r.to.line)&&ge(t,r.to.line).markedSpans;if(!a&&!s)return null;var u=r.from.ch,p=r.to.ch,h=fe(r.from,r.to)==0,v=vk(a,u,h),w=wk(s,p,h),x=r.text.length==1,O=Te(r.text).length+(x?u:0);if(v)for(var j=0;j<v.length;++j){var _=v[j];if(_.to==null){var H=Yi(w,_.marker);H?x&&(_.to=H.to==null?null:H.to+O):_.to=u}}if(w)for(var Q=0;Q<w.length;++Q){var te=w[Q];if(te.to!=null&&(te.to+=O),te.from==null){var se=Yi(v,te.marker);se||(te.from=O,x&&(v||(v=[])).push(te))}else te.from+=O,x&&(v||(v=[])).push(te)}v&&(v=kd(v)),w&&w!=v&&(w=kd(w));var ue=[v];if(!x){var de=r.text.length-2,ce;if(de>0&&v)for(var he=0;he<v.length;++he)v[he].to==null&&(ce||(ce=[])).push(new vs(v[he].marker,null,null));for(var ve=0;ve<de;++ve)ue.push(ce);ue.push(w)}return ue}function kd(t){for(var r=0;r<t.length;++r){var a=t[r];a.from!=null&&a.from==a.to&&a.marker.clearWhenEmpty!==!1&&t.splice(r--,1)}return t.length?t:null}function bk(t,r,a){var s=null;if(t.iter(r.line,a.line+1,function(H){if(H.markedSpans)for(var Q=0;Q<H.markedSpans.length;++Q){var te=H.markedSpans[Q].marker;te.readOnly&&(!s||ie(s,te)==-1)&&(s||(s=[])).push(te)}}),!s)return null;for(var u=[{from:r,to:a}],p=0;p<s.length;++p)for(var h=s[p],v=h.find(0),w=0;w<u.length;++w){var x=u[w];if(!(fe(x.to,v.from)<0||fe(x.from,v.to)>0)){var O=[w,1],j=fe(x.from,v.from),_=fe(x.to,v.to);(j<0||!h.inclusiveLeft&&!j)&&O.push({from:x.from,to:v.from}),(_>0||!h.inclusiveRight&&!_)&&O.push({from:v.to,to:x.to}),u.splice.apply(u,O),w+=O.length-3}}return u}function Cd(t){var r=t.markedSpans;if(r){for(var a=0;a<r.length;++a)r[a].marker.detachLine(t);t.markedSpans=null}}function Dd(t,r){if(r){for(var a=0;a<r.length;++a)r[a].marker.attachLine(t);t.markedSpans=r}}function ws(t){return t.inclusiveLeft?-1:0}function bs(t){return t.inclusiveRight?1:0}function pl(t,r){var a=t.lines.length-r.lines.length;if(a!=0)return a;var s=t.find(),u=r.find(),p=fe(s.from,u.from)||ws(t)-ws(r);if(p)return-p;var h=fe(s.to,u.to)||bs(t)-bs(r);return h||r.id-t.id}function Ad(t,r){var a=Tn&&t.markedSpans,s;if(a)for(var u=void 0,p=0;p<a.length;++p)u=a[p],u.marker.collapsed&&(r?u.from:u.to)==null&&(!s||pl(s,u.marker)<0)&&(s=u.marker);return s}function Sd(t){return Ad(t,!0)}function xs(t){return Ad(t,!1)}function xk(t,r){var a=Tn&&t.markedSpans,s;if(a)for(var u=0;u<a.length;++u){var p=a[u];p.marker.collapsed&&(p.from==null||p.from<r)&&(p.to==null||p.to>r)&&(!s||pl(s,p.marker)<0)&&(s=p.marker)}return s}function Ed(t,r,a,s,u){var p=ge(t,r),h=Tn&&p.markedSpans;if(h)for(var v=0;v<h.length;++v){var w=h[v];if(w.marker.collapsed){var x=w.marker.find(0),O=fe(x.from,a)||ws(w.marker)-ws(u),j=fe(x.to,s)||bs(w.marker)-bs(u);if(!(O>=0&&j<=0||O<=0&&j>=0)&&(O<=0&&(w.marker.inclusiveRight&&u.inclusiveLeft?fe(x.to,a)>=0:fe(x.to,a)>0)||O>=0&&(w.marker.inclusiveRight&&u.inclusiveLeft?fe(x.from,s)<=0:fe(x.from,s)<0)))return!0}}}function ln(t){for(var r;r=Sd(t);)t=r.find(-1,!0).line;return t}function kk(t){for(var r;r=xs(t);)t=r.find(1,!0).line;return t}function Ck(t){for(var r,a;r=xs(t);)t=r.find(1,!0).line,(a||(a=[])).push(t);return a}function hl(t,r){var a=ge(t,r),s=ln(a);return a==s?r:D(s)}function Md(t,r){if(r>t.lastLine())return r;var a=ge(t,r),s;if(!Un(t,a))return r;for(;s=xs(a);)a=s.find(1,!0).line;return D(a)+1}function Un(t,r){var a=Tn&&r.markedSpans;if(a){for(var s=void 0,u=0;u<a.length;++u)if(s=a[u],!!s.marker.collapsed){if(s.from==null)return!0;if(!s.marker.widgetNode&&s.from==0&&s.marker.inclusiveLeft&&gl(t,r,s))return!0}}}function gl(t,r,a){if(a.to==null){var s=a.marker.find(1,!0);return gl(t,s.line,Yi(s.line.markedSpans,a.marker))}if(a.marker.inclusiveRight&&a.to==r.text.length)return!0;for(var u=void 0,p=0;p<r.markedSpans.length;++p)if(u=r.markedSpans[p],u.marker.collapsed&&!u.marker.widgetNode&&u.from==a.to&&(u.to==null||u.to!=a.from)&&(u.marker.inclusiveLeft||a.marker.inclusiveRight)&&gl(t,r,u))return!0}function Fn(t){t=ln(t);for(var r=0,a=t.parent,s=0;s<a.lines.length;++s){var u=a.lines[s];if(u==t)break;r+=u.height}for(var p=a.parent;p;a=p,p=a.parent)for(var h=0;h<p.children.length;++h){var v=p.children[h];if(v==a)break;r+=v.height}return r}function ks(t){if(t.height==0)return 0;for(var r=t.text.length,a,s=t;a=Sd(s);){var u=a.find(0,!0);s=u.from.line,r+=u.from.ch-u.to.ch}for(s=t;a=xs(s);){var p=a.find(0,!0);r-=s.text.length-p.from.ch,s=p.to.line,r+=s.text.length-p.to.ch}return r}function ml(t){var r=t.display,a=t.doc;r.maxLine=ge(a,a.first),r.maxLineLength=ks(r.maxLine),r.maxLineChanged=!0,a.iter(function(s){var u=ks(s);u>r.maxLineLength&&(r.maxLineLength=u,r.maxLine=s)})}var Qr=function(t,r,a){this.text=t,Dd(this,r),this.height=a?a(this):1};Qr.prototype.lineNo=function(){return D(this)},nn(Qr);function Dk(t,r,a,s){t.text=r,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),t.order!=null&&(t.order=null),Cd(t),Dd(t,a);var u=s?s(t):1;u!=t.height&&Ut(t,u)}function Ak(t){t.parent=null,Cd(t)}var Sk={},Ek={};function Ld(t,r){if(!t||/^\s*$/.test(t))return null;var a=r.addModeClass?Ek:Sk;return a[t]||(a[t]=t.replace(/\S+/g,"cm-$&"))}function Td(t,r){var a=X("span",null,null,g?"padding-right: .1px":null),s={pre:X("pre",[a],"CodeMirror-line"),content:a,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};r.measure={};for(var u=0;u<=(r.rest?r.rest.length:0);u++){var p=u?r.rest[u-1]:r.line,h=void 0;s.pos=0,s.addToken=Lk,_n(t.display.measure)&&(h=Le(p,t.doc.direction))&&(s.addToken=Fk(s.addToken,h)),s.map=[];var v=r!=t.display.externalMeasured&&D(p);Nk(p,s,gd(t,p,v)),p.styleClasses&&(p.styleClasses.bgClass&&(s.bgClass=et(p.styleClasses.bgClass,s.bgClass||"")),p.styleClasses.textClass&&(s.textClass=et(p.styleClasses.textClass,s.textClass||""))),s.map.length==0&&s.map.push(0,0,s.content.appendChild(gs(t.display.measure))),u==0?(r.measure.map=s.map,r.measure.cache={}):((r.measure.maps||(r.measure.maps=[])).push(s.map),(r.measure.caches||(r.measure.caches=[])).push({}))}if(g){var w=s.content.lastChild;(/\bcm-tab\b/.test(w.className)||w.querySelector&&w.querySelector(".cm-tab"))&&(s.content.className="cm-tab-wrap-hack")}return Qe(t,"renderLine",t,r.line,s.pre),s.pre.className&&(s.textClass=et(s.pre.className,s.textClass||"")),s}function Mk(t){var r=S("span","\u2022","cm-invalidchar");return r.title="\\u"+t.charCodeAt(0).toString(16),r.setAttribute("aria-label",r.title),r}function Lk(t,r,a,s,u,p,h){if(r){var v=t.splitSpaces?Tk(r,t.trailingSpace):r,w=t.cm.state.specialChars,x=!1,O;if(!w.test(r))t.col+=r.length,O=document.createTextNode(v),t.map.push(t.pos,t.pos+r.length,O),f&&d<9&&(x=!0),t.pos+=r.length;else{O=document.createDocumentFragment();for(var j=0;;){w.lastIndex=j;var _=w.exec(r),H=_?_.index-j:r.length-j;if(H){var Q=document.createTextNode(v.slice(j,j+H));f&&d<9?O.appendChild(S("span",[Q])):O.appendChild(Q),t.map.push(t.pos,t.pos+H,Q),t.col+=H,t.pos+=H}if(!_)break;j+=H+1;var te=void 0;if(_[0]==" "){var se=t.cm.options.tabSize,ue=se-t.col%se;te=O.appendChild(S("span",at(ue),"cm-tab")),te.setAttribute("role","presentation"),te.setAttribute("cm-text"," "),t.col+=ue}else _[0]=="\r"||_[0]==`
|
|
116
116
|
`?(te=O.appendChild(S("span",_[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),te.setAttribute("cm-text",_[0]),t.col+=1):(te=t.cm.options.specialCharPlaceholder(_[0]),te.setAttribute("cm-text",_[0]),f&&d<9?O.appendChild(S("span",[te])):O.appendChild(te),t.col+=1);t.map.push(t.pos,t.pos+1,te),t.pos++}}if(t.trailingSpace=v.charCodeAt(r.length-1)==32,a||s||u||x||p||h){var de=a||"";s&&(de+=s),u&&(de+=u);var ce=S("span",[O],de,p);if(h)for(var he in h)h.hasOwnProperty(he)&&he!="style"&&he!="class"&&ce.setAttribute(he,h[he]);return t.content.appendChild(ce)}t.content.appendChild(O)}}function Tk(t,r){if(t.length>1&&!/ /.test(t))return t;for(var a=r,s="",u=0;u<t.length;u++){var p=t.charAt(u);p==" "&&a&&(u==t.length-1||t.charCodeAt(u+1)==32)&&(p="\xA0"),s+=p,a=p==" "}return s}function Fk(t,r){return function(a,s,u,p,h,v,w){u=u?u+" cm-force-border":"cm-force-border";for(var x=a.pos,O=x+s.length;;){for(var j=void 0,_=0;_<r.length&&(j=r[_],!(j.to>x&&j.from<=x));_++);if(j.to>=O)return t(a,s,u,p,h,v,w);t(a,s.slice(0,j.to-x),u,p,null,v,w),p=null,s=s.slice(j.to-x),x=j.to}}}function Fd(t,r,a,s){var u=!s&&a.widgetNode;u&&t.map.push(t.pos,t.pos+r,u),!s&&t.cm.display.input.needsContentAttribute&&(u||(u=t.content.appendChild(document.createElement("span"))),u.setAttribute("cm-marker",a.id)),u&&(t.cm.display.input.setUneditable(u),t.content.appendChild(u)),t.pos+=r,t.trailingSpace=!1}function Nk(t,r,a){var s=t.markedSpans,u=t.text,p=0;if(!s){for(var h=1;h<a.length;h+=2)r.addToken(r,u.slice(p,p=a[h]),Ld(a[h+1],r.cm.options));return}for(var v=u.length,w=0,x=1,O="",j,_,H=0,Q,te,se,ue,de;;){if(H==w){Q=te=se=_="",de=null,ue=null,H=1/0;for(var ce=[],he=void 0,ve=0;ve<s.length;++ve){var me=s[ve],Se=me.marker;if(Se.type=="bookmark"&&me.from==w&&Se.widgetNode)ce.push(Se);else if(me.from<=w&&(me.to==null||me.to>w||Se.collapsed&&me.to==w&&me.from==w)){if(me.to!=null&&me.to!=w&&H>me.to&&(H=me.to,te=""),Se.className&&(Q+=" "+Se.className),Se.css&&(_=(_?_+";":"")+Se.css),Se.startStyle&&me.from==w&&(se+=" "+Se.startStyle),Se.endStyle&&me.to==H&&(he||(he=[])).push(Se.endStyle,me.to),Se.title&&((de||(de={})).title=Se.title),Se.attributes)for(var qe in Se.attributes)(de||(de={}))[qe]=Se.attributes[qe];Se.collapsed&&(!ue||pl(ue.marker,Se)<0)&&(ue=me)}else me.from>w&&H>me.from&&(H=me.from)}if(he)for(var ht=0;ht<he.length;ht+=2)he[ht+1]==H&&(te+=" "+he[ht]);if(!ue||ue.from==w)for(var Ve=0;Ve<ce.length;++Ve)Fd(r,0,ce[Ve]);if(ue&&(ue.from||0)==w){if(Fd(r,(ue.to==null?v+1:ue.to)-w,ue.marker,ue.from==null),ue.to==null)return;ue.to==w&&(ue=!1)}}if(w>=v)break;for(var zt=Math.min(v,H);;){if(O){var Ot=w+O.length;if(!ue){var it=Ot>zt?O.slice(0,zt-w):O;r.addToken(r,it,j?j+Q:Q,se,w+it.length==H?te:"",_,de)}if(Ot>=zt){O=O.slice(zt-w),w=zt;break}w=Ot,se=""}O=u.slice(p,p=a[x++]),j=Ld(a[x++],r.cm.options)}}}function Nd(t,r,a){this.line=r,this.rest=Ck(r),this.size=this.rest?D(Te(this.rest))-a+1:1,this.node=this.text=null,this.hidden=Un(t,r)}function Cs(t,r,a){for(var s=[],u,p=r;p<a;p=u){var h=new Nd(t.doc,ge(t.doc,p),p);u=p+h.size,s.push(h)}return s}var Kr=null;function Ok(t){Kr?Kr.ops.push(t):t.ownsGroup=Kr={ops:[t],delayedCallbacks:[]}}function Ik(t){var r=t.delayedCallbacks,a=0;do{for(;a<r.length;a++)r[a].call(null);for(var s=0;s<t.ops.length;s++){var u=t.ops[s];if(u.cursorActivityHandlers)for(;u.cursorActivityCalled<u.cursorActivityHandlers.length;)u.cursorActivityHandlers[u.cursorActivityCalled++].call(null,u.cm)}}while(a<r.length)}function Bk(t,r){var a=t.ownsGroup;if(a)try{Ik(a)}finally{Kr=null,r(a)}}var Qi=null;function ft(t,r){var a=Mn(t,r);if(a.length){var s=Array.prototype.slice.call(arguments,2),u;Kr?u=Kr.delayedCallbacks:Qi?u=Qi:(u=Qi=[],setTimeout(Pk,0));for(var p=function(v){u.push(function(){return a[v].apply(null,s)})},h=0;h<a.length;++h)p(h)}}function Pk(){var t=Qi;Qi=null;for(var r=0;r<t.length;++r)t[r]()}function Od(t,r,a,s){for(var u=0;u<r.changes.length;u++){var p=r.changes[u];p=="text"?zk(t,r):p=="gutter"?Bd(t,r,a,s):p=="class"?yl(t,r):p=="widget"&&Rk(t,r,s)}r.changes=null}function Ki(t){return t.node==t.text&&(t.node=S("div",null,null,"position: relative"),t.text.parentNode&&t.text.parentNode.replaceChild(t.node,t.text),t.node.appendChild(t.text),f&&d<8&&(t.node.style.zIndex=2)),t.node}function jk(t,r){var a=r.bgClass?r.bgClass+" "+(r.line.bgClass||""):r.line.bgClass;if(a&&(a+=" CodeMirror-linebackground"),r.background)a?r.background.className=a:(r.background.parentNode.removeChild(r.background),r.background=null);else if(a){var s=Ki(r);r.background=s.insertBefore(S("div",null,a),s.firstChild),t.display.input.setUneditable(r.background)}}function Id(t,r){var a=t.display.externalMeasured;return a&&a.line==r.line?(t.display.externalMeasured=null,r.measure=a.measure,a.built):Td(t,r)}function zk(t,r){var a=r.text.className,s=Id(t,r);r.text==r.node&&(r.node=s.pre),r.text.parentNode.replaceChild(s.pre,r.text),r.text=s.pre,s.bgClass!=r.bgClass||s.textClass!=r.textClass?(r.bgClass=s.bgClass,r.textClass=s.textClass,yl(t,r)):a&&(r.text.className=a)}function yl(t,r){jk(t,r),r.line.wrapClass?Ki(r).className=r.line.wrapClass:r.node!=r.text&&(r.node.className="");var a=r.textClass?r.textClass+" "+(r.line.textClass||""):r.line.textClass;r.text.className=a||""}function Bd(t,r,a,s){if(r.gutter&&(r.node.removeChild(r.gutter),r.gutter=null),r.gutterBackground&&(r.node.removeChild(r.gutterBackground),r.gutterBackground=null),r.line.gutterClass){var u=Ki(r);r.gutterBackground=S("div",null,"CodeMirror-gutter-background "+r.line.gutterClass,"left: "+(t.options.fixedGutter?s.fixedPos:-s.gutterTotalWidth)+"px; width: "+s.gutterTotalWidth+"px"),t.display.input.setUneditable(r.gutterBackground),u.insertBefore(r.gutterBackground,r.text)}var p=r.line.gutterMarkers;if(t.options.lineNumbers||p){var h=Ki(r),v=r.gutter=S("div",null,"CodeMirror-gutter-wrapper","left: "+(t.options.fixedGutter?s.fixedPos:-s.gutterTotalWidth)+"px");if(v.setAttribute("aria-hidden","true"),t.display.input.setUneditable(v),h.insertBefore(v,r.text),r.line.gutterClass&&(v.className+=" "+r.line.gutterClass),t.options.lineNumbers&&(!p||!p["CodeMirror-linenumbers"])&&(r.lineNumber=v.appendChild(S("div",oe(t.options,a),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+s.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+t.display.lineNumInnerWidth+"px"))),p)for(var w=0;w<t.display.gutterSpecs.length;++w){var x=t.display.gutterSpecs[w].className,O=p.hasOwnProperty(x)&&p[x];O&&v.appendChild(S("div",[O],"CodeMirror-gutter-elt","left: "+s.gutterLeft[x]+"px; width: "+s.gutterWidth[x]+"px"))}}}function Rk(t,r,a){r.alignable&&(r.alignable=null);for(var s=W("CodeMirror-linewidget"),u=r.node.firstChild,p=void 0;u;u=p)p=u.nextSibling,s.test(u.className)&&r.node.removeChild(u);Pd(t,r,a)}function Hk(t,r,a,s){var u=Id(t,r);return r.text=r.node=u.pre,u.bgClass&&(r.bgClass=u.bgClass),u.textClass&&(r.textClass=u.textClass),yl(t,r),Bd(t,r,a,s),Pd(t,r,s),r.node}function Pd(t,r,a){if(jd(t,r.line,r,a,!0),r.rest)for(var s=0;s<r.rest.length;s++)jd(t,r.rest[s],r,a,!1)}function jd(t,r,a,s,u){if(r.widgets)for(var p=Ki(a),h=0,v=r.widgets;h<v.length;++h){var w=v[h],x=S("div",[w.node],"CodeMirror-linewidget"+(w.className?" "+w.className:""));w.handleMouseEvents||x.setAttribute("cm-ignore-events","true"),qk(w,x,a,s),t.display.input.setUneditable(x),u&&w.above?p.insertBefore(x,a.gutter||a.text):p.appendChild(x),ft(w,"redraw")}}function qk(t,r,a,s){if(t.noHScroll){(a.alignable||(a.alignable=[])).push(r);var u=s.wrapperWidth;r.style.left=s.fixedPos+"px",t.coverGutter||(u-=s.gutterTotalWidth,r.style.paddingLeft=s.gutterTotalWidth+"px"),r.style.width=u+"px"}t.coverGutter&&(r.style.zIndex=5,r.style.position="relative",t.noHScroll||(r.style.marginLeft=-s.gutterTotalWidth+"px"))}function Zi(t){if(t.height!=null)return t.height;var r=t.doc.cm;if(!r)return 0;if(!pe(document.body,t.node)){var a="position: relative;";t.coverGutter&&(a+="margin-left: -"+r.display.gutters.offsetWidth+"px;"),t.noHScroll&&(a+="width: "+r.display.wrapper.clientWidth+"px;"),Z(r.display.measure,S("div",[t.node],null,a))}return t.height=t.node.parentNode.offsetHeight}function Nn(t,r){for(var a=Wi(r);a!=t.wrapper;a=a.parentNode)if(!a||a.nodeType==1&&a.getAttribute("cm-ignore-events")=="true"||a.parentNode==t.sizer&&a!=t.mover)return!0}function Ds(t){return t.lineSpace.offsetTop}function vl(t){return t.mover.offsetHeight-t.lineSpace.offsetHeight}function zd(t){if(t.cachedPaddingH)return t.cachedPaddingH;var r=Z(t.measure,S("pre","x","CodeMirror-line-like")),a=window.getComputedStyle?window.getComputedStyle(r):r.currentStyle,s={left:parseInt(a.paddingLeft),right:parseInt(a.paddingRight)};return!isNaN(s.left)&&!isNaN(s.right)&&(t.cachedPaddingH=s),s}function kn(t){return Ee-t.display.nativeBarWidth}function pr(t){return t.display.scroller.clientWidth-kn(t)-t.display.barWidth}function wl(t){return t.display.scroller.clientHeight-kn(t)-t.display.barHeight}function _k(t,r,a){var s=t.options.lineWrapping,u=s&&pr(t);if(!r.measure.heights||s&&r.measure.width!=u){var p=r.measure.heights=[];if(s){r.measure.width=u;for(var h=r.text.firstChild.getClientRects(),v=0;v<h.length-1;v++){var w=h[v],x=h[v+1];Math.abs(w.bottom-x.bottom)>2&&p.push((w.bottom+x.top)/2-a.top)}}p.push(a.bottom-a.top)}}function Rd(t,r,a){if(t.line==r)return{map:t.measure.map,cache:t.measure.cache};if(t.rest){for(var s=0;s<t.rest.length;s++)if(t.rest[s]==r)return{map:t.measure.maps[s],cache:t.measure.caches[s]};for(var u=0;u<t.rest.length;u++)if(D(t.rest[u])>a)return{map:t.measure.maps[u],cache:t.measure.caches[u],before:!0}}}function Wk(t,r){r=ln(r);var a=D(r),s=t.display.externalMeasured=new Nd(t.doc,r,a);s.lineN=a;var u=s.built=Td(t,s);return s.text=u.pre,Z(t.display.lineMeasure,u.pre),s}function Hd(t,r,a,s){return Cn(t,Zr(t,r),a,s)}function bl(t,r){if(r>=t.display.viewFrom&&r<t.display.viewTo)return t.display.view[mr(t,r)];var a=t.display.externalMeasured;if(a&&r>=a.lineN&&r<a.lineN+a.size)return a}function Zr(t,r){var a=D(r),s=bl(t,a);s&&!s.text?s=null:s&&s.changes&&(Od(t,s,a,Al(t)),t.curOp.forceUpdate=!0),s||(s=Wk(t,r));var u=Rd(s,r,a);return{line:r,view:s,rect:null,map:u.map,cache:u.cache,before:u.before,hasHeights:!1}}function Cn(t,r,a,s,u){r.before&&(a=-1);var p=a+(s||""),h;return r.cache.hasOwnProperty(p)?h=r.cache[p]:(r.rect||(r.rect=r.view.text.getBoundingClientRect()),r.hasHeights||(_k(t,r.view,r.rect),r.hasHeights=!0),h=Uk(t,r,a,s),h.bogus||(r.cache[p]=h)),{left:h.left,right:h.right,top:u?h.rtop:h.top,bottom:u?h.rbottom:h.bottom}}var qd={left:0,right:0,top:0,bottom:0};function _d(t,r,a){for(var s,u,p,h,v,w,x=0;x<t.length;x+=3)if(v=t[x],w=t[x+1],r<v?(u=0,p=1,h="left"):r<w?(u=r-v,p=u+1):(x==t.length-3||r==w&&t[x+3]>r)&&(p=w-v,u=p-1,r>=w&&(h="right")),u!=null){if(s=t[x+2],v==w&&a==(s.insertLeft?"left":"right")&&(h=a),a=="left"&&u==0)for(;x&&t[x-2]==t[x-3]&&t[x-1].insertLeft;)s=t[(x-=3)+2],h="left";if(a=="right"&&u==w-v)for(;x<t.length-3&&t[x+3]==t[x+4]&&!t[x+5].insertLeft;)s=t[(x+=3)+2],h="right";break}return{node:s,start:u,end:p,collapse:h,coverStart:v,coverEnd:w}}function $k(t,r){var a=qd;if(r=="left")for(var s=0;s<t.length&&(a=t[s]).left==a.right;s++);else for(var u=t.length-1;u>=0&&(a=t[u]).left==a.right;u--);return a}function Uk(t,r,a,s){var u=_d(r.map,a,s),p=u.node,h=u.start,v=u.end,w=u.collapse,x;if(p.nodeType==3){for(var O=0;O<4;O++){for(;h&&rt(r.line.text.charAt(u.coverStart+h));)--h;for(;u.coverStart+v<u.coverEnd&&rt(r.line.text.charAt(u.coverStart+v));)++v;if(f&&d<9&&h==0&&v==u.coverEnd-u.coverStart?x=p.parentNode.getBoundingClientRect():x=$k(ee(p,h,v).getClientRects(),s),x.left||x.right||h==0)break;v=h,h=h-1,w="right"}f&&d<11&&(x=Gk(t.display.measure,x))}else{h>0&&(w=s="right");var j;t.options.lineWrapping&&(j=p.getClientRects()).length>1?x=j[s=="right"?j.length-1:0]:x=p.getBoundingClientRect()}if(f&&d<9&&!h&&(!x||!x.left&&!x.right)){var _=p.parentNode.getClientRects()[0];_?x={left:_.left,right:_.left+Xr(t.display),top:_.top,bottom:_.bottom}:x=qd}for(var H=x.top-r.rect.top,Q=x.bottom-r.rect.top,te=(H+Q)/2,se=r.view.measure.heights,ue=0;ue<se.length-1&&!(te<se[ue]);ue++);var de=ue?se[ue-1]:0,ce=se[ue],he={left:(w=="right"?x.right:x.left)-r.rect.left,right:(w=="left"?x.left:x.right)-r.rect.left,top:de,bottom:ce};return!x.left&&!x.right&&(he.bogus=!0),t.options.singleCursorHeightPerLine||(he.rtop=H,he.rbottom=Q),he}function Gk(t,r){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ul(t))return r;var a=screen.logicalXDPI/screen.deviceXDPI,s=screen.logicalYDPI/screen.deviceYDPI;return{left:r.left*a,right:r.right*a,top:r.top*s,bottom:r.bottom*s}}function Wd(t){if(t.measure&&(t.measure.cache={},t.measure.heights=null,t.rest))for(var r=0;r<t.rest.length;r++)t.measure.caches[r]={}}function $d(t){t.display.externalMeasure=null,q(t.display.lineMeasure);for(var r=0;r<t.display.view.length;r++)Wd(t.display.view[r])}function Ji(t){$d(t),t.display.cachedCharWidth=t.display.cachedTextHeight=t.display.cachedPaddingH=null,t.options.lineWrapping||(t.display.maxLineChanged=!0),t.display.lineNumChars=null}function Ud(t){return y&&A?-(t.body.getBoundingClientRect().left-parseInt(getComputedStyle(t.body).marginLeft)):t.defaultView.pageXOffset||(t.documentElement||t.body).scrollLeft}function Gd(t){return y&&A?-(t.body.getBoundingClientRect().top-parseInt(getComputedStyle(t.body).marginTop)):t.defaultView.pageYOffset||(t.documentElement||t.body).scrollTop}function xl(t){var r=ln(t),a=r.widgets,s=0;if(a)for(var u=0;u<a.length;++u)a[u].above&&(s+=Zi(a[u]));return s}function As(t,r,a,s,u){if(!u){var p=xl(r);a.top+=p,a.bottom+=p}if(s=="line")return a;s||(s="local");var h=Fn(r);if(s=="local"?h+=Ds(t.display):h-=t.display.viewOffset,s=="page"||s=="window"){var v=t.display.lineSpace.getBoundingClientRect();h+=v.top+(s=="window"?0:Gd(Ye(t)));var w=v.left+(s=="window"?0:Ud(Ye(t)));a.left+=w,a.right+=w}return a.top+=h,a.bottom+=h,a}function Vd(t,r,a){if(a=="div")return r;var s=r.left,u=r.top;if(a=="page")s-=Ud(Ye(t)),u-=Gd(Ye(t));else if(a=="local"||!a){var p=t.display.sizer.getBoundingClientRect();s+=p.left,u+=p.top}var h=t.display.lineSpace.getBoundingClientRect();return{left:s-h.left,top:u-h.top}}function Ss(t,r,a,s,u){return s||(s=ge(t.doc,r.line)),As(t,s,Hd(t,s,r.ch,u),a)}function un(t,r,a,s,u,p){s=s||ge(t.doc,r.line),u||(u=Zr(t,s));function h(Q,te){var se=Cn(t,u,Q,te?"right":"left",p);return te?se.left=se.right:se.right=se.left,As(t,s,se,a)}var v=Le(s,t.doc.direction),w=r.ch,x=r.sticky;if(w>=s.text.length?(w=s.text.length,x="before"):w<=0&&(w=0,x="after"),!v)return h(x=="before"?w-1:w,x=="before");function O(Q,te,se){var ue=v[te],de=ue.level==1;return h(se?Q-1:Q,de!=se)}var j=Hn(v,w,x),_=fr,H=O(w,j,x=="before");return _!=null&&(H.other=O(w,_,x!="before")),H}function Yd(t,r){var a=0;r=ke(t.doc,r),t.options.lineWrapping||(a=Xr(t.display)*r.ch);var s=ge(t.doc,r.line),u=Fn(s)+Ds(t.display);return{left:a,right:a,top:u,bottom:u+s.height}}function kl(t,r,a,s,u){var p=Y(t,r,a);return p.xRel=u,s&&(p.outside=s),p}function Cl(t,r,a){var s=t.doc;if(a+=t.display.viewOffset,a<0)return kl(s.first,0,null,-1,-1);var u=P(s,a),p=s.first+s.size-1;if(u>p)return kl(s.first+s.size-1,ge(s,p).text.length,null,1,1);r<0&&(r=0);for(var h=ge(s,u);;){var v=Vk(t,h,u,r,a),w=xk(h,v.ch+(v.xRel>0||v.outside>0?1:0));if(!w)return v;var x=w.find(1);if(x.line==u)return x;h=ge(s,u=x.line)}}function Qd(t,r,a,s){s-=xl(r);var u=r.text.length,p=wn(function(h){return Cn(t,a,h-1).bottom<=s},u,0);return u=wn(function(h){return Cn(t,a,h).top>s},p,u),{begin:p,end:u}}function Kd(t,r,a,s){a||(a=Zr(t,r));var u=As(t,r,Cn(t,a,s),"line").top;return Qd(t,r,a,u)}function Dl(t,r,a,s){return t.bottom<=a?!1:t.top>a?!0:(s?t.left:t.right)>r}function Vk(t,r,a,s,u){u-=Fn(r);var p=Zr(t,r),h=xl(r),v=0,w=r.text.length,x=!0,O=Le(r,t.doc.direction);if(O){var j=(t.options.lineWrapping?Qk:Yk)(t,r,a,p,O,s,u);x=j.level!=1,v=x?j.from:j.to-1,w=x?j.to:j.from-1}var _=null,H=null,Q=wn(function(ve){var me=Cn(t,p,ve);return me.top+=h,me.bottom+=h,Dl(me,s,u,!1)?(me.top<=u&&me.left<=s&&(_=ve,H=me),!0):!1},v,w),te,se,ue=!1;if(H){var de=s-H.left<H.right-s,ce=de==x;Q=_+(ce?0:1),se=ce?"after":"before",te=de?H.left:H.right}else{!x&&(Q==w||Q==v)&&Q++,se=Q==0?"after":Q==r.text.length?"before":Cn(t,p,Q-(x?1:0)).bottom+h<=u==x?"after":"before";var he=un(t,Y(a,Q,se),"line",r,p);te=he.left,ue=u<he.top?-1:u>=he.bottom?1:0}return Q=zn(r.text,Q,1),kl(a,Q,se,ue,s-te)}function Yk(t,r,a,s,u,p,h){var v=wn(function(j){var _=u[j],H=_.level!=1;return Dl(un(t,Y(a,H?_.to:_.from,H?"before":"after"),"line",r,s),p,h,!0)},0,u.length-1),w=u[v];if(v>0){var x=w.level!=1,O=un(t,Y(a,x?w.from:w.to,x?"after":"before"),"line",r,s);Dl(O,p,h,!0)&&O.top>h&&(w=u[v-1])}return w}function Qk(t,r,a,s,u,p,h){var v=Qd(t,r,s,h),w=v.begin,x=v.end;/\s/.test(r.text.charAt(x-1))&&x--;for(var O=null,j=null,_=0;_<u.length;_++){var H=u[_];if(!(H.from>=x||H.to<=w)){var Q=H.level!=1,te=Cn(t,s,Q?Math.min(x,H.to)-1:Math.max(w,H.from)).right,se=te<p?p-te+1e9:te-p;(!O||j>se)&&(O=H,j=se)}}return O||(O=u[u.length-1]),O.from<w&&(O={from:w,to:O.to,level:O.level}),O.to>x&&(O={from:O.from,to:x,level:O.level}),O}var hr;function Jr(t){if(t.cachedTextHeight!=null)return t.cachedTextHeight;if(hr==null){hr=S("pre",null,"CodeMirror-line-like");for(var r=0;r<49;++r)hr.appendChild(document.createTextNode("x")),hr.appendChild(S("br"));hr.appendChild(document.createTextNode("x"))}Z(t.measure,hr);var a=hr.offsetHeight/50;return a>3&&(t.cachedTextHeight=a),q(t.measure),a||1}function Xr(t){if(t.cachedCharWidth!=null)return t.cachedCharWidth;var r=S("span","xxxxxxxxxx"),a=S("pre",[r],"CodeMirror-line-like");Z(t.measure,a);var s=r.getBoundingClientRect(),u=(s.right-s.left)/10;return u>2&&(t.cachedCharWidth=u),u||10}function Al(t){for(var r=t.display,a={},s={},u=r.gutters.clientLeft,p=r.gutters.firstChild,h=0;p;p=p.nextSibling,++h){var v=t.display.gutterSpecs[h].className;a[v]=p.offsetLeft+p.clientLeft+u,s[v]=p.clientWidth}return{fixedPos:Sl(r),gutterTotalWidth:r.gutters.offsetWidth,gutterLeft:a,gutterWidth:s,wrapperWidth:r.wrapper.clientWidth}}function Sl(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Zd(t){var r=Jr(t.display),a=t.options.lineWrapping,s=a&&Math.max(5,t.display.scroller.clientWidth/Xr(t.display)-3);return function(u){if(Un(t.doc,u))return 0;var p=0;if(u.widgets)for(var h=0;h<u.widgets.length;h++)u.widgets[h].height&&(p+=u.widgets[h].height);return a?p+(Math.ceil(u.text.length/s)||1)*r:p+r}}function El(t){var r=t.doc,a=Zd(t);r.iter(function(s){var u=a(s);u!=s.height&&Ut(s,u)})}function gr(t,r,a,s){var u=t.display;if(!a&&Wi(r).getAttribute("cm-not-content")=="true")return null;var p,h,v=u.lineSpace.getBoundingClientRect();try{p=r.clientX-v.left,h=r.clientY-v.top}catch{return null}var w=Cl(t,p,h),x;if(s&&w.xRel>0&&(x=ge(t.doc,w.line).text).length==w.ch){var O=le(x,x.length,t.options.tabSize)-x.length;w=Y(w.line,Math.max(0,Math.round((p-zd(t.display).left)/Xr(t.display))-O))}return w}function mr(t,r){if(r>=t.display.viewTo||(r-=t.display.viewFrom,r<0))return null;for(var a=t.display.view,s=0;s<a.length;s++)if(r-=a[s].size,r<0)return s}function Ft(t,r,a,s){r==null&&(r=t.doc.first),a==null&&(a=t.doc.first+t.doc.size),s||(s=0);var u=t.display;if(s&&a<u.viewTo&&(u.updateLineNumbers==null||u.updateLineNumbers>r)&&(u.updateLineNumbers=r),t.curOp.viewChanged=!0,r>=u.viewTo)Tn&&hl(t.doc,r)<u.viewTo&&Vn(t);else if(a<=u.viewFrom)Tn&&Md(t.doc,a+s)>u.viewFrom?Vn(t):(u.viewFrom+=s,u.viewTo+=s);else if(r<=u.viewFrom&&a>=u.viewTo)Vn(t);else if(r<=u.viewFrom){var p=Es(t,a,a+s,1);p?(u.view=u.view.slice(p.index),u.viewFrom=p.lineN,u.viewTo+=s):Vn(t)}else if(a>=u.viewTo){var h=Es(t,r,r,-1);h?(u.view=u.view.slice(0,h.index),u.viewTo=h.lineN):Vn(t)}else{var v=Es(t,r,r,-1),w=Es(t,a,a+s,1);v&&w?(u.view=u.view.slice(0,v.index).concat(Cs(t,v.lineN,w.lineN)).concat(u.view.slice(w.index)),u.viewTo+=s):Vn(t)}var x=u.externalMeasured;x&&(a<x.lineN?x.lineN+=s:r<x.lineN+x.size&&(u.externalMeasured=null))}function Gn(t,r,a){t.curOp.viewChanged=!0;var s=t.display,u=t.display.externalMeasured;if(u&&r>=u.lineN&&r<u.lineN+u.size&&(s.externalMeasured=null),!(r<s.viewFrom||r>=s.viewTo)){var p=s.view[mr(t,r)];if(p.node!=null){var h=p.changes||(p.changes=[]);ie(h,a)==-1&&h.push(a)}}}function Vn(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Es(t,r,a,s){var u=mr(t,r),p,h=t.display.view;if(!Tn||a==t.doc.first+t.doc.size)return{index:u,lineN:a};for(var v=t.display.viewFrom,w=0;w<u;w++)v+=h[w].size;if(v!=r){if(s>0){if(u==h.length-1)return null;p=v+h[u].size-r,u++}else p=v-r;r+=p,a+=p}for(;hl(t.doc,a)!=a;){if(u==(s<0?0:h.length-1))return null;a+=s*h[u-(s<0?1:0)].size,u+=s}return{index:u,lineN:a}}function Kk(t,r,a){var s=t.display,u=s.view;u.length==0||r>=s.viewTo||a<=s.viewFrom?(s.view=Cs(t,r,a),s.viewFrom=r):(s.viewFrom>r?s.view=Cs(t,r,s.viewFrom).concat(s.view):s.viewFrom<r&&(s.view=s.view.slice(mr(t,r))),s.viewFrom=r,s.viewTo<a?s.view=s.view.concat(Cs(t,s.viewTo,a)):s.viewTo>a&&(s.view=s.view.slice(0,mr(t,a)))),s.viewTo=a}function Jd(t){for(var r=t.display.view,a=0,s=0;s<r.length;s++){var u=r[s];!u.hidden&&(!u.node||u.changes)&&++a}return a}function Xi(t){t.display.input.showSelection(t.display.input.prepareSelection())}function Xd(t,r){r===void 0&&(r=!0);var a=t.doc,s={},u=s.cursors=document.createDocumentFragment(),p=s.selection=document.createDocumentFragment(),h=t.options.$customCursor;h&&(r=!0);for(var v=0;v<a.sel.ranges.length;v++)if(!(!r&&v==a.sel.primIndex)){var w=a.sel.ranges[v];if(!(w.from().line>=t.display.viewTo||w.to().line<t.display.viewFrom)){var x=w.empty();if(h){var O=h(t,w);O&&Ml(t,O,u)}else(x||t.options.showCursorWhenSelecting)&&Ml(t,w.head,u);x||Zk(t,w,p)}}return s}function Ml(t,r,a){var s=un(t,r,"div",null,null,!t.options.singleCursorHeightPerLine),u=a.appendChild(S("div","\xA0","CodeMirror-cursor"));if(u.style.left=s.left+"px",u.style.top=s.top+"px",u.style.height=Math.max(0,s.bottom-s.top)*t.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(t.getWrapperElement().className)){var p=Ss(t,r,"div",null,null),h=p.right-p.left;u.style.width=(h>0?h:t.defaultCharWidth())+"px"}if(s.other){var v=a.appendChild(S("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));v.style.display="",v.style.left=s.other.left+"px",v.style.top=s.other.top+"px",v.style.height=(s.other.bottom-s.other.top)*.85+"px"}}function Ms(t,r){return t.top-r.top||t.left-r.left}function Zk(t,r,a){var s=t.display,u=t.doc,p=document.createDocumentFragment(),h=zd(t.display),v=h.left,w=Math.max(s.sizerWidth,pr(t)-s.sizer.offsetLeft)-h.right,x=u.direction=="ltr";function O(ce,he,ve,me){he<0&&(he=0),he=Math.round(he),me=Math.round(me),p.appendChild(S("div",null,"CodeMirror-selected","position: absolute; left: "+ce+`px;
|
|
117
117
|
top: `+he+"px; width: "+(ve??w-ce)+`px;
|
|
118
118
|
height: `+(me-he)+"px"))}function j(ce,he,ve){var me=ge(u,ce),Se=me.text.length,qe,ht;function Ve(it,It){return Ss(t,Y(ce,it),"div",me,It)}function zt(it,It,mt){var lt=Kd(t,me,null,it),ot=It=="ltr"==(mt=="after")?"left":"right",Je=mt=="after"?lt.begin:lt.end-(/\s/.test(me.text.charAt(lt.end-1))?2:1);return Ve(Je,ot)[ot]}var Ot=Le(me,u.direction);return Rn(Ot,he||0,ve??Se,function(it,It,mt,lt){var ot=mt=="ltr",Je=Ve(it,ot?"left":"right"),Bt=Ve(It-1,ot?"right":"left"),di=he==null&&it==0,Xn=ve==null&&It==Se,kt=lt==0,Dn=!Ot||lt==Ot.length-1;if(Bt.top-Je.top<=3){var gt=(x?di:Xn)&&kt,tu=(x?Xn:di)&&Dn,Bn=gt?v:(ot?Je:Bt).left,xr=tu?w:(ot?Bt:Je).right;O(Bn,Je.top,xr-Bn,Je.bottom)}else{var kr,St,pi,nu;ot?(kr=x&&di&&kt?v:Je.left,St=x?w:zt(it,mt,"before"),pi=x?v:zt(It,mt,"after"),nu=x&&Xn&&Dn?w:Bt.right):(kr=x?zt(it,mt,"before"):v,St=!x&&di&&kt?w:Je.right,pi=!x&&Xn&&Dn?v:Bt.left,nu=x?zt(It,mt,"after"):w),O(kr,Je.top,St-kr,Je.bottom),Je.bottom<Bt.top&&O(v,Je.bottom,null,Bt.top),O(pi,Bt.top,nu-pi,Bt.bottom)}(!qe||Ms(Je,qe)<0)&&(qe=Je),Ms(Bt,qe)<0&&(qe=Bt),(!ht||Ms(Je,ht)<0)&&(ht=Je),Ms(Bt,ht)<0&&(ht=Bt)}),{start:qe,end:ht}}var _=r.from(),H=r.to();if(_.line==H.line)j(_.line,_.ch,H.ch);else{var Q=ge(u,_.line),te=ge(u,H.line),se=ln(Q)==ln(te),ue=j(_.line,_.ch,se?Q.text.length+1:null).end,de=j(H.line,se?0:null,H.ch).start;se&&(ue.top<de.top-2?(O(ue.right,ue.top,null,ue.bottom),O(v,de.top,de.left,de.bottom)):O(ue.right,ue.top,de.left-ue.right,ue.bottom)),ue.bottom<de.top&&O(v,ue.bottom,null,de.top)}a.appendChild(p)}function Ll(t){if(t.state.focused){var r=t.display;clearInterval(r.blinker);var a=!0;r.cursorDiv.style.visibility="",t.options.cursorBlinkRate>0?r.blinker=setInterval(function(){t.hasFocus()||ei(t),r.cursorDiv.style.visibility=(a=!a)?"":"hidden"},t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(r.cursorDiv.style.visibility="hidden")}}function ep(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Fl(t))}function Tl(t){t.state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&ei(t))},100)}function Fl(t,r){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),t.options.readOnly!="nocursor"&&(t.state.focused||(Qe(t,"focus",t,r),t.state.focused=!0,Pe(t.display.wrapper,"CodeMirror-focused"),!t.curOp&&t.display.selForContextMenu!=t.doc.sel&&(t.display.input.reset(),g&&setTimeout(function(){return t.display.input.reset(!0)},20)),t.display.input.receivedFocus()),Ll(t))}function ei(t,r){t.state.delayingBlurEvent||(t.state.focused&&(Qe(t,"blur",t,r),t.state.focused=!1,ne(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout(function(){t.state.focused||(t.display.shift=!1)},150))}function Ls(t){for(var r=t.display,a=r.lineDiv.offsetTop,s=Math.max(0,r.scroller.getBoundingClientRect().top),u=r.lineDiv.getBoundingClientRect().top,p=0,h=0;h<r.view.length;h++){var v=r.view[h],w=t.options.lineWrapping,x=void 0,O=0;if(!v.hidden){if(u+=v.line.height,f&&d<8){var j=v.node.offsetTop+v.node.offsetHeight;x=j-a,a=j}else{var _=v.node.getBoundingClientRect();x=_.bottom-_.top,!w&&v.text.firstChild&&(O=v.text.firstChild.getBoundingClientRect().right-_.left-1)}var H=v.line.height-x;if((H>.005||H<-.005)&&(u<s&&(p-=H),Ut(v.line,x),tp(v.line),v.rest))for(var Q=0;Q<v.rest.length;Q++)tp(v.rest[Q]);if(O>t.display.sizerWidth){var te=Math.ceil(O/Xr(t.display));te>t.display.maxLineLength&&(t.display.maxLineLength=te,t.display.maxLine=v.line,t.display.maxLineChanged=!0)}}}Math.abs(p)>2&&(r.scroller.scrollTop+=p)}function tp(t){if(t.widgets)for(var r=0;r<t.widgets.length;++r){var a=t.widgets[r],s=a.node.parentNode;s&&(a.height=s.offsetHeight)}}function Ts(t,r,a){var s=a&&a.top!=null?Math.max(0,a.top):t.scroller.scrollTop;s=Math.floor(s-Ds(t));var u=a&&a.bottom!=null?a.bottom:s+t.wrapper.clientHeight,p=P(r,s),h=P(r,u);if(a&&a.ensure){var v=a.ensure.from.line,w=a.ensure.to.line;v<p?(p=v,h=P(r,Fn(ge(r,v))+t.wrapper.clientHeight)):Math.min(w,r.lastLine())>=h&&(p=P(r,Fn(ge(r,w))-t.wrapper.clientHeight),h=w)}return{from:p,to:Math.max(h,p+1)}}function Jk(t,r){if(!Ke(t,"scrollCursorIntoView")){var a=t.display,s=a.sizer.getBoundingClientRect(),u=null,p=a.wrapper.ownerDocument;if(r.top+s.top<0?u=!0:r.bottom+s.top>(p.defaultView.innerHeight||p.documentElement.clientHeight)&&(u=!1),u!=null&&!F){var h=S("div","\u200B",null,`position: absolute;
|
|
@@ -120,7 +120,7 @@ b`.split(/\n/).length!=3?function(t){for(var r=0,a=[],s=t.length;r<=s;){var u=t.
|
|
|
120
120
|
height: `+(r.bottom-r.top+kn(t)+a.barHeight)+`px;
|
|
121
121
|
left: `+r.left+"px; width: "+Math.max(2,r.right-r.left)+"px;");t.display.lineSpace.appendChild(h),h.scrollIntoView(u),t.display.lineSpace.removeChild(h)}}}function Xk(t,r,a,s){s==null&&(s=0);var u;!t.options.lineWrapping&&r==a&&(a=r.sticky=="before"?Y(r.line,r.ch+1,"before"):r,r=r.ch?Y(r.line,r.sticky=="before"?r.ch-1:r.ch,"after"):r);for(var p=0;p<5;p++){var h=!1,v=un(t,r),w=!a||a==r?v:un(t,a);u={left:Math.min(v.left,w.left),top:Math.min(v.top,w.top)-s,right:Math.max(v.left,w.left),bottom:Math.max(v.bottom,w.bottom)+s};var x=Nl(t,u),O=t.doc.scrollTop,j=t.doc.scrollLeft;if(x.scrollTop!=null&&(to(t,x.scrollTop),Math.abs(t.doc.scrollTop-O)>1&&(h=!0)),x.scrollLeft!=null&&(yr(t,x.scrollLeft),Math.abs(t.doc.scrollLeft-j)>1&&(h=!0)),!h)break}return u}function eC(t,r){var a=Nl(t,r);a.scrollTop!=null&&to(t,a.scrollTop),a.scrollLeft!=null&&yr(t,a.scrollLeft)}function Nl(t,r){var a=t.display,s=Jr(t.display);r.top<0&&(r.top=0);var u=t.curOp&&t.curOp.scrollTop!=null?t.curOp.scrollTop:a.scroller.scrollTop,p=wl(t),h={};r.bottom-r.top>p&&(r.bottom=r.top+p);var v=t.doc.height+vl(a),w=r.top<s,x=r.bottom>v-s;if(r.top<u)h.scrollTop=w?0:r.top;else if(r.bottom>u+p){var O=Math.min(r.top,(x?v:r.bottom)-p);O!=u&&(h.scrollTop=O)}var j=t.options.fixedGutter?0:a.gutters.offsetWidth,_=t.curOp&&t.curOp.scrollLeft!=null?t.curOp.scrollLeft:a.scroller.scrollLeft-j,H=pr(t)-a.gutters.offsetWidth,Q=r.right-r.left>H;return Q&&(r.right=r.left+H),r.left<10?h.scrollLeft=0:r.left<_?h.scrollLeft=Math.max(0,r.left+j-(Q?0:10)):r.right>H+_-3&&(h.scrollLeft=r.right+(Q?0:10)-H),h}function Ol(t,r){r!=null&&(Fs(t),t.curOp.scrollTop=(t.curOp.scrollTop==null?t.doc.scrollTop:t.curOp.scrollTop)+r)}function ti(t){Fs(t);var r=t.getCursor();t.curOp.scrollToPos={from:r,to:r,margin:t.options.cursorScrollMargin}}function eo(t,r,a){(r!=null||a!=null)&&Fs(t),r!=null&&(t.curOp.scrollLeft=r),a!=null&&(t.curOp.scrollTop=a)}function tC(t,r){Fs(t),t.curOp.scrollToPos=r}function Fs(t){var r=t.curOp.scrollToPos;if(r){t.curOp.scrollToPos=null;var a=Yd(t,r.from),s=Yd(t,r.to);np(t,a,s,r.margin)}}function np(t,r,a,s){var u=Nl(t,{left:Math.min(r.left,a.left),top:Math.min(r.top,a.top)-s,right:Math.max(r.right,a.right),bottom:Math.max(r.bottom,a.bottom)+s});eo(t,u.scrollLeft,u.scrollTop)}function to(t,r){Math.abs(t.doc.scrollTop-r)<2||(i||Bl(t,{top:r}),rp(t,r,!0),i&&Bl(t),io(t,100))}function rp(t,r,a){r=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,r)),!(t.display.scroller.scrollTop==r&&!a)&&(t.doc.scrollTop=r,t.display.scrollbars.setScrollTop(r),t.display.scroller.scrollTop!=r&&(t.display.scroller.scrollTop=r))}function yr(t,r,a,s){r=Math.max(0,Math.min(r,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),!((a?r==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-r)<2)&&!s)&&(t.doc.scrollLeft=r,lp(t),t.display.scroller.scrollLeft!=r&&(t.display.scroller.scrollLeft=r),t.display.scrollbars.setScrollLeft(r))}function no(t){var r=t.display,a=r.gutters.offsetWidth,s=Math.round(t.doc.height+vl(t.display));return{clientHeight:r.scroller.clientHeight,viewHeight:r.wrapper.clientHeight,scrollWidth:r.scroller.scrollWidth,clientWidth:r.scroller.clientWidth,viewWidth:r.wrapper.clientWidth,barLeft:t.options.fixedGutter?a:0,docHeight:s,scrollHeight:s+kn(t)+r.barHeight,nativeBarWidth:r.nativeBarWidth,gutterWidth:a}}var vr=function(t,r,a){this.cm=a;var s=this.vert=S("div",[S("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),u=this.horiz=S("div",[S("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");s.tabIndex=u.tabIndex=-1,t(s),t(u),ye(s,"scroll",function(){s.clientHeight&&r(s.scrollTop,"vertical")}),ye(u,"scroll",function(){u.clientWidth&&r(u.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,f&&d<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};vr.prototype.update=function(t){var r=t.scrollWidth>t.clientWidth+1,a=t.scrollHeight>t.clientHeight+1,s=t.nativeBarWidth;if(a){this.vert.style.display="block",this.vert.style.bottom=r?s+"px":"0";var u=t.viewHeight-(r?s:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+u)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(r){this.horiz.style.display="block",this.horiz.style.right=a?s+"px":"0",this.horiz.style.left=t.barLeft+"px";var p=t.viewWidth-t.barLeft-(a?s:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+p)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(s==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:a?s:0,bottom:r?s:0}},vr.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},vr.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},vr.prototype.zeroWidthHack=function(){var t=L&&!E?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new re,this.disableVert=new re},vr.prototype.enableZeroWidthBar=function(t,r,a){t.style.visibility="";function s(){var u=t.getBoundingClientRect(),p=a=="vert"?document.elementFromPoint(u.right-1,(u.top+u.bottom)/2):document.elementFromPoint((u.right+u.left)/2,u.bottom-1);p!=t?t.style.visibility="hidden":r.set(1e3,s)}r.set(1e3,s)},vr.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var ro=function(){};ro.prototype.update=function(){return{bottom:0,right:0}},ro.prototype.setScrollLeft=function(){},ro.prototype.setScrollTop=function(){},ro.prototype.clear=function(){};function ni(t,r){r||(r=no(t));var a=t.display.barWidth,s=t.display.barHeight;ip(t,r);for(var u=0;u<4&&a!=t.display.barWidth||s!=t.display.barHeight;u++)a!=t.display.barWidth&&t.options.lineWrapping&&Ls(t),ip(t,no(t)),a=t.display.barWidth,s=t.display.barHeight}function ip(t,r){var a=t.display,s=a.scrollbars.update(r);a.sizer.style.paddingRight=(a.barWidth=s.right)+"px",a.sizer.style.paddingBottom=(a.barHeight=s.bottom)+"px",a.heightForcer.style.borderBottom=s.bottom+"px solid transparent",s.right&&s.bottom?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=s.bottom+"px",a.scrollbarFiller.style.width=s.right+"px"):a.scrollbarFiller.style.display="",s.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(a.gutterFiller.style.display="block",a.gutterFiller.style.height=s.bottom+"px",a.gutterFiller.style.width=r.gutterWidth+"px"):a.gutterFiller.style.display=""}var op={native:vr,null:ro};function sp(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&ne(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new op[t.options.scrollbarStyle](function(r){t.display.wrapper.insertBefore(r,t.display.scrollbarFiller),ye(r,"mousedown",function(){t.state.focused&&setTimeout(function(){return t.display.input.focus()},0)}),r.setAttribute("cm-not-content","true")},function(r,a){a=="horizontal"?yr(t,r):to(t,r)},t),t.display.scrollbars.addClass&&Pe(t.display.wrapper,t.display.scrollbars.addClass)}var nC=0;function wr(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++nC,markArrays:null},Ok(t.curOp)}function br(t){var r=t.curOp;r&&Bk(r,function(a){for(var s=0;s<a.ops.length;s++)a.ops[s].cm.curOp=null;rC(a)})}function rC(t){for(var r=t.ops,a=0;a<r.length;a++)iC(r[a]);for(var s=0;s<r.length;s++)oC(r[s]);for(var u=0;u<r.length;u++)sC(r[u]);for(var p=0;p<r.length;p++)aC(r[p]);for(var h=0;h<r.length;h++)lC(r[h])}function iC(t){var r=t.cm,a=r.display;cC(r),t.updateMaxLine&&ml(r),t.mustUpdate=t.viewChanged||t.forceUpdate||t.scrollTop!=null||t.scrollToPos&&(t.scrollToPos.from.line<a.viewFrom||t.scrollToPos.to.line>=a.viewTo)||a.maxLineChanged&&r.options.lineWrapping,t.update=t.mustUpdate&&new Ns(r,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function oC(t){t.updatedDisplay=t.mustUpdate&&Il(t.cm,t.update)}function sC(t){var r=t.cm,a=r.display;t.updatedDisplay&&Ls(r),t.barMeasure=no(r),a.maxLineChanged&&!r.options.lineWrapping&&(t.adjustWidthTo=Hd(r,a.maxLine,a.maxLine.text.length).left+3,r.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(a.scroller.clientWidth,a.sizer.offsetLeft+t.adjustWidthTo+kn(r)+r.display.barWidth),t.maxScrollLeft=Math.max(0,a.sizer.offsetLeft+t.adjustWidthTo-pr(r))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=a.input.prepareSelection())}function aC(t){var r=t.cm;t.adjustWidthTo!=null&&(r.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft<r.doc.scrollLeft&&yr(r,Math.min(r.display.scroller.scrollLeft,t.maxScrollLeft),!0),r.display.maxLineChanged=!1);var a=t.focus&&t.focus==De(yt(r));t.preparedSelection&&r.display.input.showSelection(t.preparedSelection,a),(t.updatedDisplay||t.startHeight!=r.doc.height)&&ni(r,t.barMeasure),t.updatedDisplay&&jl(r,t.barMeasure),t.selectionChanged&&Ll(r),r.state.focused&&t.updateInput&&r.display.input.reset(t.typing),a&&ep(t.cm)}function lC(t){var r=t.cm,a=r.display,s=r.doc;if(t.updatedDisplay&&ap(r,t.update),a.wheelStartX!=null&&(t.scrollTop!=null||t.scrollLeft!=null||t.scrollToPos)&&(a.wheelStartX=a.wheelStartY=null),t.scrollTop!=null&&rp(r,t.scrollTop,t.forceScroll),t.scrollLeft!=null&&yr(r,t.scrollLeft,!0,!0),t.scrollToPos){var u=Xk(r,ke(s,t.scrollToPos.from),ke(s,t.scrollToPos.to),t.scrollToPos.margin);Jk(r,u)}var p=t.maybeHiddenMarkers,h=t.maybeUnhiddenMarkers;if(p)for(var v=0;v<p.length;++v)p[v].lines.length||Qe(p[v],"hide");if(h)for(var w=0;w<h.length;++w)h[w].lines.length&&Qe(h[w],"unhide");a.wrapper.offsetHeight&&(s.scrollTop=r.display.scroller.scrollTop),t.changeObjs&&Qe(r,"changes",r,t.changeObjs),t.update&&t.update.finish()}function jt(t,r){if(t.curOp)return r();wr(t);try{return r()}finally{br(t)}}function dt(t,r){return function(){if(t.curOp)return r.apply(t,arguments);wr(t);try{return r.apply(t,arguments)}finally{br(t)}}}function At(t){return function(){if(this.curOp)return t.apply(this,arguments);wr(this);try{return t.apply(this,arguments)}finally{br(this)}}}function pt(t){return function(){var r=this.cm;if(!r||r.curOp)return t.apply(this,arguments);wr(r);try{return t.apply(this,arguments)}finally{br(r)}}}function io(t,r){t.doc.highlightFrontier<t.display.viewTo&&t.state.highlight.set(r,we(uC,t))}function uC(t){var r=t.doc;if(!(r.highlightFrontier>=t.display.viewTo)){var a=+new Date+t.options.workTime,s=Vi(t,r.highlightFrontier),u=[];r.iter(s.line,Math.min(r.first+r.size,t.display.viewTo+500),function(p){if(s.line>=t.display.viewFrom){var h=p.styles,v=p.text.length>t.options.maxHighlightLength?bn(r.mode,s.state):null,w=hd(t,p,s,!0);v&&(s.state=v),p.styles=w.styles;var x=p.styleClasses,O=w.classes;O?p.styleClasses=O:x&&(p.styleClasses=null);for(var j=!h||h.length!=p.styles.length||x!=O&&(!x||!O||x.bgClass!=O.bgClass||x.textClass!=O.textClass),_=0;!j&&_<h.length;++_)j=h[_]!=p.styles[_];j&&u.push(s.line),p.stateAfter=s.save(),s.nextLine()}else p.text.length<=t.options.maxHighlightLength&&cl(t,p.text,s),p.stateAfter=s.line%5==0?s.save():null,s.nextLine();if(+new Date>a)return io(t,t.options.workDelay),!0}),r.highlightFrontier=s.line,r.modeFrontier=Math.max(r.modeFrontier,s.line),u.length&&jt(t,function(){for(var p=0;p<u.length;p++)Gn(t,u[p],"text")})}}var Ns=function(t,r,a){var s=t.display;this.viewport=r,this.visible=Ts(s,t.doc,r),this.editorIsHidden=!s.wrapper.offsetWidth,this.wrapperHeight=s.wrapper.clientHeight,this.wrapperWidth=s.wrapper.clientWidth,this.oldDisplayWidth=pr(t),this.force=a,this.dims=Al(t),this.events=[]};Ns.prototype.signal=function(t,r){Pt(t,r)&&this.events.push(arguments)},Ns.prototype.finish=function(){for(var t=0;t<this.events.length;t++)Qe.apply(null,this.events[t])};function cC(t){var r=t.display;!r.scrollbarsClipped&&r.scroller.offsetWidth&&(r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth,r.heightForcer.style.height=kn(t)+"px",r.sizer.style.marginBottom=-r.nativeBarWidth+"px",r.sizer.style.borderRightWidth=kn(t)+"px",r.scrollbarsClipped=!0)}function fC(t){if(t.hasFocus())return null;var r=De(yt(t));if(!r||!pe(t.display.lineDiv,r))return null;var a={activeElt:r};if(window.getSelection){var s=xe(t).getSelection();s.anchorNode&&s.extend&&pe(t.display.lineDiv,s.anchorNode)&&(a.anchorNode=s.anchorNode,a.anchorOffset=s.anchorOffset,a.focusNode=s.focusNode,a.focusOffset=s.focusOffset)}return a}function dC(t){if(!(!t||!t.activeElt||t.activeElt==De(je(t.activeElt)))&&(t.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(t.activeElt.nodeName)&&t.anchorNode&&pe(document.body,t.anchorNode)&&pe(document.body,t.focusNode))){var r=t.activeElt.ownerDocument,a=r.defaultView.getSelection(),s=r.createRange();s.setEnd(t.anchorNode,t.anchorOffset),s.collapse(!1),a.removeAllRanges(),a.addRange(s),a.extend(t.focusNode,t.focusOffset)}}function Il(t,r){var a=t.display,s=t.doc;if(r.editorIsHidden)return Vn(t),!1;if(!r.force&&r.visible.from>=a.viewFrom&&r.visible.to<=a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo)&&a.renderedView==a.view&&Jd(t)==0)return!1;up(t)&&(Vn(t),r.dims=Al(t));var u=s.first+s.size,p=Math.max(r.visible.from-t.options.viewportMargin,s.first),h=Math.min(u,r.visible.to+t.options.viewportMargin);a.viewFrom<p&&p-a.viewFrom<20&&(p=Math.max(s.first,a.viewFrom)),a.viewTo>h&&a.viewTo-h<20&&(h=Math.min(u,a.viewTo)),Tn&&(p=hl(t.doc,p),h=Md(t.doc,h));var v=p!=a.viewFrom||h!=a.viewTo||a.lastWrapHeight!=r.wrapperHeight||a.lastWrapWidth!=r.wrapperWidth;Kk(t,p,h),a.viewOffset=Fn(ge(t.doc,a.viewFrom)),t.display.mover.style.top=a.viewOffset+"px";var w=Jd(t);if(!v&&w==0&&!r.force&&a.renderedView==a.view&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo))return!1;var x=fC(t);return w>4&&(a.lineDiv.style.display="none"),pC(t,a.updateLineNumbers,r.dims),w>4&&(a.lineDiv.style.display=""),a.renderedView=a.view,dC(x),q(a.cursorDiv),q(a.selectionDiv),a.gutters.style.height=a.sizer.style.minHeight=0,v&&(a.lastWrapHeight=r.wrapperHeight,a.lastWrapWidth=r.wrapperWidth,io(t,400)),a.updateLineNumbers=null,!0}function ap(t,r){for(var a=r.viewport,s=!0;;s=!1){if(!s||!t.options.lineWrapping||r.oldDisplayWidth==pr(t)){if(a&&a.top!=null&&(a={top:Math.min(t.doc.height+vl(t.display)-wl(t),a.top)}),r.visible=Ts(t.display,t.doc,a),r.visible.from>=t.display.viewFrom&&r.visible.to<=t.display.viewTo)break}else s&&(r.visible=Ts(t.display,t.doc,a));if(!Il(t,r))break;Ls(t);var u=no(t);Xi(t),ni(t,u),jl(t,u),r.force=!1}r.signal(t,"update",t),(t.display.viewFrom!=t.display.reportedViewFrom||t.display.viewTo!=t.display.reportedViewTo)&&(r.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Bl(t,r){var a=new Ns(t,r);if(Il(t,a)){Ls(t),ap(t,a);var s=no(t);Xi(t),ni(t,s),jl(t,s),a.finish()}}function pC(t,r,a){var s=t.display,u=t.options.lineNumbers,p=s.lineDiv,h=p.firstChild;function v(Q){var te=Q.nextSibling;return g&&L&&t.display.currentWheelTarget==Q?Q.style.display="none":Q.parentNode.removeChild(Q),te}for(var w=s.view,x=s.viewFrom,O=0;O<w.length;O++){var j=w[O];if(!j.hidden)if(!j.node||j.node.parentNode!=p){var _=Hk(t,j,x,a);p.insertBefore(_,h)}else{for(;h!=j.node;)h=v(h);var H=u&&r!=null&&r<=x&&j.lineNumber;j.changes&&(ie(j.changes,"gutter")>-1&&(H=!1),Od(t,j,x,a)),H&&(q(j.lineNumber),j.lineNumber.appendChild(document.createTextNode(oe(t.options,x)))),h=j.node.nextSibling}x+=j.size}for(;h;)h=v(h)}function Pl(t){var r=t.gutters.offsetWidth;t.sizer.style.marginLeft=r+"px",ft(t,"gutterChanged",t)}function jl(t,r){t.display.sizer.style.minHeight=r.docHeight+"px",t.display.heightForcer.style.top=r.docHeight+"px",t.display.gutters.style.height=r.docHeight+t.display.barHeight+kn(t)+"px"}function lp(t){var r=t.display,a=r.view;if(!(!r.alignWidgets&&(!r.gutters.firstChild||!t.options.fixedGutter))){for(var s=Sl(r)-r.scroller.scrollLeft+t.doc.scrollLeft,u=r.gutters.offsetWidth,p=s+"px",h=0;h<a.length;h++)if(!a[h].hidden){t.options.fixedGutter&&(a[h].gutter&&(a[h].gutter.style.left=p),a[h].gutterBackground&&(a[h].gutterBackground.style.left=p));var v=a[h].alignable;if(v)for(var w=0;w<v.length;w++)v[w].style.left=p}t.options.fixedGutter&&(r.gutters.style.left=s+u+"px")}}function up(t){if(!t.options.lineNumbers)return!1;var r=t.doc,a=oe(t.options,r.first+r.size-1),s=t.display;if(a.length!=s.lineNumChars){var u=s.measure.appendChild(S("div",[S("div",a)],"CodeMirror-linenumber CodeMirror-gutter-elt")),p=u.firstChild.offsetWidth,h=u.offsetWidth-p;return s.lineGutter.style.width="",s.lineNumInnerWidth=Math.max(p,s.lineGutter.offsetWidth-h)+1,s.lineNumWidth=s.lineNumInnerWidth+h,s.lineNumChars=s.lineNumInnerWidth?a.length:-1,s.lineGutter.style.width=s.lineNumWidth+"px",Pl(t.display),!0}return!1}function zl(t,r){for(var a=[],s=!1,u=0;u<t.length;u++){var p=t[u],h=null;if(typeof p!="string"&&(h=p.style,p=p.className),p=="CodeMirror-linenumbers")if(r)s=!0;else continue;a.push({className:p,style:h})}return r&&!s&&a.push({className:"CodeMirror-linenumbers",style:null}),a}function cp(t){var r=t.gutters,a=t.gutterSpecs;q(r),t.lineGutter=null;for(var s=0;s<a.length;++s){var u=a[s],p=u.className,h=u.style,v=r.appendChild(S("div",null,"CodeMirror-gutter "+p));h&&(v.style.cssText=h),p=="CodeMirror-linenumbers"&&(t.lineGutter=v,v.style.width=(t.lineNumWidth||1)+"px")}r.style.display=a.length?"":"none",Pl(t)}function oo(t){cp(t.display),Ft(t),lp(t)}function hC(t,r,a,s){var u=this;this.input=a,u.scrollbarFiller=S("div",null,"CodeMirror-scrollbar-filler"),u.scrollbarFiller.setAttribute("cm-not-content","true"),u.gutterFiller=S("div",null,"CodeMirror-gutter-filler"),u.gutterFiller.setAttribute("cm-not-content","true"),u.lineDiv=X("div",null,"CodeMirror-code"),u.selectionDiv=S("div",null,null,"position: relative; z-index: 1"),u.cursorDiv=S("div",null,"CodeMirror-cursors"),u.measure=S("div",null,"CodeMirror-measure"),u.lineMeasure=S("div",null,"CodeMirror-measure"),u.lineSpace=X("div",[u.measure,u.lineMeasure,u.selectionDiv,u.cursorDiv,u.lineDiv],null,"position: relative; outline: none");var p=X("div",[u.lineSpace],"CodeMirror-lines");u.mover=S("div",[p],null,"position: relative"),u.sizer=S("div",[u.mover],"CodeMirror-sizer"),u.sizerWidth=null,u.heightForcer=S("div",null,null,"position: absolute; height: "+Ee+"px; width: 1px;"),u.gutters=S("div",null,"CodeMirror-gutters"),u.lineGutter=null,u.scroller=S("div",[u.sizer,u.heightForcer,u.gutters],"CodeMirror-scroll"),u.scroller.setAttribute("tabIndex","-1"),u.wrapper=S("div",[u.scrollbarFiller,u.gutterFiller,u.scroller],"CodeMirror"),y&&k>=105&&(u.wrapper.style.clipPath="inset(0px)"),u.wrapper.setAttribute("translate","no"),f&&d<8&&(u.gutters.style.zIndex=-1,u.scroller.style.paddingRight=0),!g&&!(i&&b)&&(u.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(u.wrapper):t(u.wrapper)),u.viewFrom=u.viewTo=r.first,u.reportedViewFrom=u.reportedViewTo=r.first,u.view=[],u.renderedView=null,u.externalMeasured=null,u.viewOffset=0,u.lastWrapHeight=u.lastWrapWidth=0,u.updateLineNumbers=null,u.nativeBarWidth=u.barHeight=u.barWidth=0,u.scrollbarsClipped=!1,u.lineNumWidth=u.lineNumInnerWidth=u.lineNumChars=null,u.alignWidgets=!1,u.cachedCharWidth=u.cachedTextHeight=u.cachedPaddingH=null,u.maxLine=null,u.maxLineLength=0,u.maxLineChanged=!1,u.wheelDX=u.wheelDY=u.wheelStartX=u.wheelStartY=null,u.shift=!1,u.selForContextMenu=null,u.activeTouch=null,u.gutterSpecs=zl(s.gutters,s.lineNumbers),cp(u),a.init(u)}var Os=0,On=null;f?On=-.53:i?On=15:y?On=-.7:M&&(On=-1/3);function fp(t){var r=t.wheelDeltaX,a=t.wheelDeltaY;return r==null&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(r=t.detail),a==null&&t.detail&&t.axis==t.VERTICAL_AXIS?a=t.detail:a==null&&(a=t.wheelDelta),{x:r,y:a}}function gC(t){var r=fp(t);return r.x*=On,r.y*=On,r}function dp(t,r){y&&k==102&&(t.display.chromeScrollHack==null?t.display.sizer.style.pointerEvents="none":clearTimeout(t.display.chromeScrollHack),t.display.chromeScrollHack=setTimeout(function(){t.display.chromeScrollHack=null,t.display.sizer.style.pointerEvents=""},100));var a=fp(r),s=a.x,u=a.y,p=On;r.deltaMode===0&&(s=r.deltaX,u=r.deltaY,p=1);var h=t.display,v=h.scroller,w=v.scrollWidth>v.clientWidth,x=v.scrollHeight>v.clientHeight;if(s&&w||u&&x){if(u&&L&&g){e:for(var O=r.target,j=h.view;O!=v;O=O.parentNode)for(var _=0;_<j.length;_++)if(j[_].node==O){t.display.currentWheelTarget=O;break e}}if(s&&!i&&!C&&p!=null){u&&x&&to(t,Math.max(0,v.scrollTop+u*p)),yr(t,Math.max(0,v.scrollLeft+s*p)),(!u||u&&x)&&bt(r),h.wheelStartX=null;return}if(u&&p!=null){var H=u*p,Q=t.doc.scrollTop,te=Q+h.wrapper.clientHeight;H<0?Q=Math.max(0,Q+H-50):te=Math.min(t.doc.height,te+H+50),Bl(t,{top:Q,bottom:te})}Os<20&&r.deltaMode!==0&&(h.wheelStartX==null?(h.wheelStartX=v.scrollLeft,h.wheelStartY=v.scrollTop,h.wheelDX=s,h.wheelDY=u,setTimeout(function(){if(h.wheelStartX!=null){var se=v.scrollLeft-h.wheelStartX,ue=v.scrollTop-h.wheelStartY,de=ue&&h.wheelDY&&ue/h.wheelDY||se&&h.wheelDX&&se/h.wheelDX;h.wheelStartX=h.wheelStartY=null,de&&(On=(On*Os+de)/(Os+1),++Os)}},200)):(h.wheelDX+=s,h.wheelDY+=u))}}var Gt=function(t,r){this.ranges=t,this.primIndex=r};Gt.prototype.primary=function(){return this.ranges[this.primIndex]},Gt.prototype.equals=function(t){if(t==this)return!0;if(t.primIndex!=this.primIndex||t.ranges.length!=this.ranges.length)return!1;for(var r=0;r<this.ranges.length;r++){var a=this.ranges[r],s=t.ranges[r];if(!Ie(a.anchor,s.anchor)||!Ie(a.head,s.head))return!1}return!0},Gt.prototype.deepCopy=function(){for(var t=[],r=0;r<this.ranges.length;r++)t[r]=new Be(ct(this.ranges[r].anchor),ct(this.ranges[r].head));return new Gt(t,this.primIndex)},Gt.prototype.somethingSelected=function(){for(var t=0;t<this.ranges.length;t++)if(!this.ranges[t].empty())return!0;return!1},Gt.prototype.contains=function(t,r){r||(r=t);for(var a=0;a<this.ranges.length;a++){var s=this.ranges[a];if(fe(r,s.from())>=0&&fe(t,s.to())<=0)return a}return-1};var Be=function(t,r){this.anchor=t,this.head=r};Be.prototype.from=function(){return Yr(this.anchor,this.head)},Be.prototype.to=function(){return Tt(this.anchor,this.head)},Be.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function cn(t,r,a){var s=t&&t.options.selectionsMayTouch,u=r[a];r.sort(function(_,H){return fe(_.from(),H.from())}),a=ie(r,u);for(var p=1;p<r.length;p++){var h=r[p],v=r[p-1],w=fe(v.to(),h.from());if(s&&!h.empty()?w>0:w>=0){var x=Yr(v.from(),h.from()),O=Tt(v.to(),h.to()),j=v.empty()?h.from()==h.head:v.from()==v.head;p<=a&&--a,r.splice(--p,2,new Be(j?O:x,j?x:O))}}return new Gt(r,a)}function Yn(t,r){return new Gt([new Be(t,r||t)],0)}function Qn(t){return t.text?Y(t.from.line+t.text.length-1,Te(t.text).length+(t.text.length==1?t.from.ch:0)):t.to}function pp(t,r){if(fe(t,r.from)<0)return t;if(fe(t,r.to)<=0)return Qn(r);var a=t.line+r.text.length-(r.to.line-r.from.line)-1,s=t.ch;return t.line==r.to.line&&(s+=Qn(r).ch-r.to.ch),Y(a,s)}function Rl(t,r){for(var a=[],s=0;s<t.sel.ranges.length;s++){var u=t.sel.ranges[s];a.push(new Be(pp(u.anchor,r),pp(u.head,r)))}return cn(t.cm,a,t.sel.primIndex)}function hp(t,r,a){return t.line==r.line?Y(a.line,t.ch-r.ch+a.ch):Y(a.line+(t.line-r.line),t.ch)}function mC(t,r,a){for(var s=[],u=Y(t.first,0),p=u,h=0;h<r.length;h++){var v=r[h],w=hp(v.from,u,p),x=hp(Qn(v),u,p);if(u=v.to,p=x,a=="around"){var O=t.sel.ranges[h],j=fe(O.head,O.anchor)<0;s[h]=new Be(j?x:w,j?w:x)}else s[h]=new Be(w,w)}return new Gt(s,t.sel.primIndex)}function Hl(t){t.doc.mode=Ur(t.options,t.doc.modeOption),so(t)}function so(t){t.doc.iter(function(r){r.stateAfter&&(r.stateAfter=null),r.styles&&(r.styles=null)}),t.doc.modeFrontier=t.doc.highlightFrontier=t.doc.first,io(t,100),t.state.modeGen++,t.curOp&&Ft(t)}function gp(t,r){return r.from.ch==0&&r.to.ch==0&&Te(r.text)==""&&(!t.cm||t.cm.options.wholeLineUpdateBefore)}function ql(t,r,a,s){function u(de){return a?a[de]:null}function p(de,ce,he){Dk(de,ce,he,s),ft(de,"change",de,r)}function h(de,ce){for(var he=[],ve=de;ve<ce;++ve)he.push(new Qr(x[ve],u(ve),s));return he}var v=r.from,w=r.to,x=r.text,O=ge(t,v.line),j=ge(t,w.line),_=Te(x),H=u(x.length-1),Q=w.line-v.line;if(r.full)t.insert(0,h(0,x.length)),t.remove(x.length,t.size-x.length);else if(gp(t,r)){var te=h(0,x.length-1);p(j,j.text,H),Q&&t.remove(v.line,Q),te.length&&t.insert(v.line,te)}else if(O==j)if(x.length==1)p(O,O.text.slice(0,v.ch)+_+O.text.slice(w.ch),H);else{var se=h(1,x.length-1);se.push(new Qr(_+O.text.slice(w.ch),H,s)),p(O,O.text.slice(0,v.ch)+x[0],u(0)),t.insert(v.line+1,se)}else if(x.length==1)p(O,O.text.slice(0,v.ch)+x[0]+j.text.slice(w.ch),u(0)),t.remove(v.line+1,Q);else{p(O,O.text.slice(0,v.ch)+x[0],u(0)),p(j,_+j.text.slice(w.ch),H);var ue=h(1,x.length-1);Q>1&&t.remove(v.line+1,Q-1),t.insert(v.line+1,ue)}ft(t,"change",t,r)}function Kn(t,r,a){function s(u,p,h){if(u.linked)for(var v=0;v<u.linked.length;++v){var w=u.linked[v];if(w.doc!=p){var x=h&&w.sharedHist;a&&!x||(r(w.doc,x),s(w.doc,u,x))}}}s(t,null,!0)}function mp(t,r){if(r.cm)throw new Error("This document is already in use.");t.doc=r,r.cm=t,El(t),Hl(t),yp(t),t.options.direction=r.direction,t.options.lineWrapping||ml(t),t.options.mode=r.modeOption,Ft(t)}function yp(t){(t.doc.direction=="rtl"?Pe:ne)(t.display.lineDiv,"CodeMirror-rtl")}function yC(t){jt(t,function(){yp(t),Ft(t)})}function Is(t){this.done=[],this.undone=[],this.undoDepth=t?t.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=t?t.maxGeneration:1}function _l(t,r){var a={from:ct(r.from),to:Qn(r),text:Ln(t,r.from,r.to)};return bp(t,a,r.from.line,r.to.line+1),Kn(t,function(s){return bp(s,a,r.from.line,r.to.line+1)},!0),a}function vp(t){for(;t.length;){var r=Te(t);if(r.ranges)t.pop();else break}}function vC(t,r){if(r)return vp(t.done),Te(t.done);if(t.done.length&&!Te(t.done).ranges)return Te(t.done);if(t.done.length>1&&!t.done[t.done.length-2].ranges)return t.done.pop(),Te(t.done)}function wp(t,r,a,s){var u=t.history;u.undone.length=0;var p=+new Date,h,v;if((u.lastOp==s||u.lastOrigin==r.origin&&r.origin&&(r.origin.charAt(0)=="+"&&u.lastModTime>p-(t.cm?t.cm.options.historyEventDelay:500)||r.origin.charAt(0)=="*"))&&(h=vC(u,u.lastOp==s)))v=Te(h.changes),fe(r.from,r.to)==0&&fe(r.from,v.to)==0?v.to=Qn(r):h.changes.push(_l(t,r));else{var w=Te(u.done);for((!w||!w.ranges)&&Bs(t.sel,u.done),h={changes:[_l(t,r)],generation:u.generation},u.done.push(h);u.done.length>u.undoDepth;)u.done.shift(),u.done[0].ranges||u.done.shift()}u.done.push(a),u.generation=++u.maxGeneration,u.lastModTime=u.lastSelTime=p,u.lastOp=u.lastSelOp=s,u.lastOrigin=u.lastSelOrigin=r.origin,v||Qe(t,"historyAdded")}function wC(t,r,a,s){var u=r.charAt(0);return u=="*"||u=="+"&&a.ranges.length==s.ranges.length&&a.somethingSelected()==s.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function bC(t,r,a,s){var u=t.history,p=s&&s.origin;a==u.lastSelOp||p&&u.lastSelOrigin==p&&(u.lastModTime==u.lastSelTime&&u.lastOrigin==p||wC(t,p,Te(u.done),r))?u.done[u.done.length-1]=r:Bs(r,u.done),u.lastSelTime=+new Date,u.lastSelOrigin=p,u.lastSelOp=a,s&&s.clearRedo!==!1&&vp(u.undone)}function Bs(t,r){var a=Te(r);a&&a.ranges&&a.equals(t)||r.push(t)}function bp(t,r,a,s){var u=r["spans_"+t.id],p=0;t.iter(Math.max(t.first,a),Math.min(t.first+t.size,s),function(h){h.markedSpans&&((u||(u=r["spans_"+t.id]={}))[p]=h.markedSpans),++p})}function xC(t){if(!t)return null;for(var r,a=0;a<t.length;++a)t[a].marker.explicitlyCleared?r||(r=t.slice(0,a)):r&&r.push(t[a]);return r?r.length?r:null:t}function kC(t,r){var a=r["spans_"+t.id];if(!a)return null;for(var s=[],u=0;u<r.text.length;++u)s.push(xC(a[u]));return s}function xp(t,r){var a=kC(t,r),s=dl(t,r);if(!a)return s;if(!s)return a;for(var u=0;u<a.length;++u){var p=a[u],h=s[u];if(p&&h)e:for(var v=0;v<h.length;++v){for(var w=h[v],x=0;x<p.length;++x)if(p[x].marker==w.marker)continue e;p.push(w)}else h&&(a[u]=h)}return a}function ri(t,r,a){for(var s=[],u=0;u<t.length;++u){var p=t[u];if(p.ranges){s.push(a?Gt.prototype.deepCopy.call(p):p);continue}var h=p.changes,v=[];s.push({changes:v});for(var w=0;w<h.length;++w){var x=h[w],O=void 0;if(v.push({from:x.from,to:x.to,text:x.text}),r)for(var j in x)(O=j.match(/^spans_(\d+)$/))&&ie(r,Number(O[1]))>-1&&(Te(v)[j]=x[j],delete x[j])}}return s}function Wl(t,r,a,s){if(s){var u=t.anchor;if(a){var p=fe(r,u)<0;p!=fe(a,u)<0?(u=r,r=a):p!=fe(r,a)<0&&(r=a)}return new Be(u,r)}else return new Be(a||r,r)}function Ps(t,r,a,s,u){u==null&&(u=t.cm&&(t.cm.display.shift||t.extend)),xt(t,new Gt([Wl(t.sel.primary(),r,a,u)],0),s)}function kp(t,r,a){for(var s=[],u=t.cm&&(t.cm.display.shift||t.extend),p=0;p<t.sel.ranges.length;p++)s[p]=Wl(t.sel.ranges[p],r[p],null,u);var h=cn(t.cm,s,t.sel.primIndex);xt(t,h,a)}function $l(t,r,a,s){var u=t.sel.ranges.slice(0);u[r]=a,xt(t,cn(t.cm,u,t.sel.primIndex),s)}function Cp(t,r,a,s){xt(t,Yn(r,a),s)}function CC(t,r,a){var s={ranges:r.ranges,update:function(u){this.ranges=[];for(var p=0;p<u.length;p++)this.ranges[p]=new Be(ke(t,u[p].anchor),ke(t,u[p].head))},origin:a&&a.origin};return Qe(t,"beforeSelectionChange",t,s),t.cm&&Qe(t.cm,"beforeSelectionChange",t.cm,s),s.ranges!=r.ranges?cn(t.cm,s.ranges,s.ranges.length-1):r}function Dp(t,r,a){var s=t.history.done,u=Te(s);u&&u.ranges?(s[s.length-1]=r,js(t,r,a)):xt(t,r,a)}function xt(t,r,a){js(t,r,a),bC(t,t.sel,t.cm?t.cm.curOp.id:NaN,a)}function js(t,r,a){(Pt(t,"beforeSelectionChange")||t.cm&&Pt(t.cm,"beforeSelectionChange"))&&(r=CC(t,r,a));var s=a&&a.bias||(fe(r.primary().head,t.sel.primary().head)<0?-1:1);Ap(t,Ep(t,r,s,!0)),!(a&&a.scroll===!1)&&t.cm&&t.cm.getOption("readOnly")!="nocursor"&&ti(t.cm)}function Ap(t,r){r.equals(t.sel)||(t.sel=r,t.cm&&(t.cm.curOp.updateInput=1,t.cm.curOp.selectionChanged=!0,Zt(t.cm)),ft(t,"cursorActivity",t))}function Sp(t){Ap(t,Ep(t,t.sel,null,!1))}function Ep(t,r,a,s){for(var u,p=0;p<r.ranges.length;p++){var h=r.ranges[p],v=r.ranges.length==t.sel.ranges.length&&t.sel.ranges[p],w=zs(t,h.anchor,v&&v.anchor,a,s),x=h.head==h.anchor?w:zs(t,h.head,v&&v.head,a,s);(u||w!=h.anchor||x!=h.head)&&(u||(u=r.ranges.slice(0,p)),u[p]=new Be(w,x))}return u?cn(t.cm,u,r.primIndex):r}function ii(t,r,a,s,u){var p=ge(t,r.line);if(p.markedSpans)for(var h=0;h<p.markedSpans.length;++h){var v=p.markedSpans[h],w=v.marker,x="selectLeft"in w?!w.selectLeft:w.inclusiveLeft,O="selectRight"in w?!w.selectRight:w.inclusiveRight;if((v.from==null||(x?v.from<=r.ch:v.from<r.ch))&&(v.to==null||(O?v.to>=r.ch:v.to>r.ch))){if(u&&(Qe(w,"beforeCursorEnter"),w.explicitlyCleared))if(p.markedSpans){--h;continue}else break;if(!w.atomic)continue;if(a){var j=w.find(s<0?1:-1),_=void 0;if((s<0?O:x)&&(j=Mp(t,j,-s,j&&j.line==r.line?p:null)),j&&j.line==r.line&&(_=fe(j,a))&&(s<0?_<0:_>0))return ii(t,j,r,s,u)}var H=w.find(s<0?-1:1);return(s<0?x:O)&&(H=Mp(t,H,s,H.line==r.line?p:null)),H?ii(t,H,r,s,u):null}}return r}function zs(t,r,a,s,u){var p=s||1,h=ii(t,r,a,p,u)||!u&&ii(t,r,a,p,!0)||ii(t,r,a,-p,u)||!u&&ii(t,r,a,-p,!0);return h||(t.cantEdit=!0,Y(t.first,0))}function Mp(t,r,a,s){return a<0&&r.ch==0?r.line>t.first?ke(t,Y(r.line-1)):null:a>0&&r.ch==(s||ge(t,r.line)).text.length?r.line<t.first+t.size-1?Y(r.line+1,0):null:new Y(r.line,r.ch+a)}function Lp(t){t.setSelection(Y(t.firstLine(),0),Y(t.lastLine()),be)}function Tp(t,r,a){var s={canceled:!1,from:r.from,to:r.to,text:r.text,origin:r.origin,cancel:function(){return s.canceled=!0}};return a&&(s.update=function(u,p,h,v){u&&(s.from=ke(t,u)),p&&(s.to=ke(t,p)),h&&(s.text=h),v!==void 0&&(s.origin=v)}),Qe(t,"beforeChange",t,s),t.cm&&Qe(t.cm,"beforeChange",t.cm,s),s.canceled?(t.cm&&(t.cm.curOp.updateInput=2),null):{from:s.from,to:s.to,text:s.text,origin:s.origin}}function oi(t,r,a){if(t.cm){if(!t.cm.curOp)return dt(t.cm,oi)(t,r,a);if(t.cm.state.suppressEdits)return}if(!((Pt(t,"beforeChange")||t.cm&&Pt(t.cm,"beforeChange"))&&(r=Tp(t,r,!0),!r))){var s=xd&&!a&&bk(t,r.from,r.to);if(s)for(var u=s.length-1;u>=0;--u)Fp(t,{from:s[u].from,to:s[u].to,text:u?[""]:r.text,origin:r.origin});else Fp(t,r)}}function Fp(t,r){if(!(r.text.length==1&&r.text[0]==""&&fe(r.from,r.to)==0)){var a=Rl(t,r);wp(t,r,a,t.cm?t.cm.curOp.id:NaN),ao(t,r,a,dl(t,r));var s=[];Kn(t,function(u,p){!p&&ie(s,u.history)==-1&&(Bp(u.history,r),s.push(u.history)),ao(u,r,null,dl(u,r))})}}function Rs(t,r,a){var s=t.cm&&t.cm.state.suppressEdits;if(!(s&&!a)){for(var u=t.history,p,h=t.sel,v=r=="undo"?u.done:u.undone,w=r=="undo"?u.undone:u.done,x=0;x<v.length&&(p=v[x],!(a?p.ranges&&!p.equals(t.sel):!p.ranges));x++);if(x!=v.length){for(u.lastOrigin=u.lastSelOrigin=null;;)if(p=v.pop(),p.ranges){if(Bs(p,w),a&&!p.equals(t.sel)){xt(t,p,{clearRedo:!1});return}h=p}else if(s){v.push(p);return}else break;var O=[];Bs(h,w),w.push({changes:O,generation:u.generation}),u.generation=p.generation||++u.maxGeneration;for(var j=Pt(t,"beforeChange")||t.cm&&Pt(t.cm,"beforeChange"),_=function(te){var se=p.changes[te];if(se.origin=r,j&&!Tp(t,se,!1))return v.length=0,{};O.push(_l(t,se));var ue=te?Rl(t,se):Te(v);ao(t,se,ue,xp(t,se)),!te&&t.cm&&t.cm.scrollIntoView({from:se.from,to:Qn(se)});var de=[];Kn(t,function(ce,he){!he&&ie(de,ce.history)==-1&&(Bp(ce.history,se),de.push(ce.history)),ao(ce,se,null,xp(ce,se))})},H=p.changes.length-1;H>=0;--H){var Q=_(H);if(Q)return Q.v}}}}function Np(t,r){if(r!=0&&(t.first+=r,t.sel=new Gt(He(t.sel.ranges,function(u){return new Be(Y(u.anchor.line+r,u.anchor.ch),Y(u.head.line+r,u.head.ch))}),t.sel.primIndex),t.cm)){Ft(t.cm,t.first,t.first-r,r);for(var a=t.cm.display,s=a.viewFrom;s<a.viewTo;s++)Gn(t.cm,s,"gutter")}}function ao(t,r,a,s){if(t.cm&&!t.cm.curOp)return dt(t.cm,ao)(t,r,a,s);if(r.to.line<t.first){Np(t,r.text.length-1-(r.to.line-r.from.line));return}if(!(r.from.line>t.lastLine())){if(r.from.line<t.first){var u=r.text.length-1-(t.first-r.from.line);Np(t,u),r={from:Y(t.first,0),to:Y(r.to.line+u,r.to.ch),text:[Te(r.text)],origin:r.origin}}var p=t.lastLine();r.to.line>p&&(r={from:r.from,to:Y(p,ge(t,p).text.length),text:[r.text[0]],origin:r.origin}),r.removed=Ln(t,r.from,r.to),a||(a=Rl(t,r)),t.cm?DC(t.cm,r,s):ql(t,r,s),js(t,a,be),t.cantEdit&&zs(t,Y(t.firstLine(),0))&&(t.cantEdit=!1)}}function DC(t,r,a){var s=t.doc,u=t.display,p=r.from,h=r.to,v=!1,w=p.line;t.options.lineWrapping||(w=D(ln(ge(s,p.line))),s.iter(w,h.line+1,function(H){if(H==u.maxLine)return v=!0,!0})),s.sel.contains(r.from,r.to)>-1&&Zt(t),ql(s,r,a,Zd(t)),t.options.lineWrapping||(s.iter(w,p.line+r.text.length,function(H){var Q=ks(H);Q>u.maxLineLength&&(u.maxLine=H,u.maxLineLength=Q,u.maxLineChanged=!0,v=!1)}),v&&(t.curOp.updateMaxLine=!0)),pk(s,p.line),io(t,400);var x=r.text.length-(h.line-p.line)-1;r.full?Ft(t):p.line==h.line&&r.text.length==1&&!gp(t.doc,r)?Gn(t,p.line,"text"):Ft(t,p.line,h.line+1,x);var O=Pt(t,"changes"),j=Pt(t,"change");if(j||O){var _={from:p,to:h,text:r.text,removed:r.removed,origin:r.origin};j&&ft(t,"change",t,_),O&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(_)}t.display.selForContextMenu=null}function si(t,r,a,s,u){var p;s||(s=a),fe(s,a)<0&&(p=[s,a],a=p[0],s=p[1]),typeof r=="string"&&(r=t.splitLines(r)),oi(t,{from:a,to:s,text:r,origin:u})}function Op(t,r,a,s){a<t.line?t.line+=s:r<t.line&&(t.line=r,t.ch=0)}function Ip(t,r,a,s){for(var u=0;u<t.length;++u){var p=t[u],h=!0;if(p.ranges){p.copied||(p=t[u]=p.deepCopy(),p.copied=!0);for(var v=0;v<p.ranges.length;v++)Op(p.ranges[v].anchor,r,a,s),Op(p.ranges[v].head,r,a,s);continue}for(var w=0;w<p.changes.length;++w){var x=p.changes[w];if(a<x.from.line)x.from=Y(x.from.line+s,x.from.ch),x.to=Y(x.to.line+s,x.to.ch);else if(r<=x.to.line){h=!1;break}}h||(t.splice(0,u+1),u=0)}}function Bp(t,r){var a=r.from.line,s=r.to.line,u=r.text.length-(s-a)-1;Ip(t.done,a,s,u),Ip(t.undone,a,s,u)}function lo(t,r,a,s){var u=r,p=r;return typeof r=="number"?p=ge(t,dd(t,r)):u=D(r),u==null?null:(s(p,u)&&t.cm&&Gn(t.cm,u,a),p)}function uo(t){this.lines=t,this.parent=null;for(var r=0,a=0;a<t.length;++a)t[a].parent=this,r+=t[a].height;this.height=r}uo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,r){for(var a=t,s=t+r;a<s;++a){var u=this.lines[a];this.height-=u.height,Ak(u),ft(u,"delete")}this.lines.splice(t,r)},collapse:function(t){t.push.apply(t,this.lines)},insertInner:function(t,r,a){this.height+=a,this.lines=this.lines.slice(0,t).concat(r).concat(this.lines.slice(t));for(var s=0;s<r.length;++s)r[s].parent=this},iterN:function(t,r,a){for(var s=t+r;t<s;++t)if(a(this.lines[t]))return!0}};function co(t){this.children=t;for(var r=0,a=0,s=0;s<t.length;++s){var u=t[s];r+=u.chunkSize(),a+=u.height,u.parent=this}this.size=r,this.height=a,this.parent=null}co.prototype={chunkSize:function(){return this.size},removeInner:function(t,r){this.size-=r;for(var a=0;a<this.children.length;++a){var s=this.children[a],u=s.chunkSize();if(t<u){var p=Math.min(r,u-t),h=s.height;if(s.removeInner(t,p),this.height-=h-s.height,u==p&&(this.children.splice(a--,1),s.parent=null),(r-=p)==0)break;t=0}else t-=u}if(this.size-r<25&&(this.children.length>1||!(this.children[0]instanceof uo))){var v=[];this.collapse(v),this.children=[new uo(v)],this.children[0].parent=this}},collapse:function(t){for(var r=0;r<this.children.length;++r)this.children[r].collapse(t)},insertInner:function(t,r,a){this.size+=r.length,this.height+=a;for(var s=0;s<this.children.length;++s){var u=this.children[s],p=u.chunkSize();if(t<=p){if(u.insertInner(t,r,a),u.lines&&u.lines.length>50){for(var h=u.lines.length%25+25,v=h;v<u.lines.length;){var w=new uo(u.lines.slice(v,v+=25));u.height-=w.height,this.children.splice(++s,0,w),w.parent=this}u.lines=u.lines.slice(0,h),this.maybeSpill()}break}t-=p}},maybeSpill:function(){if(!(this.children.length<=10)){var t=this;do{var r=t.children.splice(t.children.length-5,5),a=new co(r);if(t.parent){t.size-=a.size,t.height-=a.height;var u=ie(t.parent.children,t);t.parent.children.splice(u+1,0,a)}else{var s=new co(t.children);s.parent=t,t.children=[s,a],t=s}a.parent=t.parent}while(t.children.length>10);t.parent.maybeSpill()}},iterN:function(t,r,a){for(var s=0;s<this.children.length;++s){var u=this.children[s],p=u.chunkSize();if(t<p){var h=Math.min(r,p-t);if(u.iterN(t,h,a))return!0;if((r-=h)==0)break;t=0}else t-=p}}};var fo=function(t,r,a){if(a)for(var s in a)a.hasOwnProperty(s)&&(this[s]=a[s]);this.doc=t,this.node=r};fo.prototype.clear=function(){var t=this.doc.cm,r=this.line.widgets,a=this.line,s=D(a);if(!(s==null||!r)){for(var u=0;u<r.length;++u)r[u]==this&&r.splice(u--,1);r.length||(a.widgets=null);var p=Zi(this);Ut(a,Math.max(0,a.height-p)),t&&(jt(t,function(){Pp(t,a,-p),Gn(t,s,"widget")}),ft(t,"lineWidgetCleared",t,this,s))}},fo.prototype.changed=function(){var t=this,r=this.height,a=this.doc.cm,s=this.line;this.height=null;var u=Zi(this)-r;u&&(Un(this.doc,s)||Ut(s,s.height+u),a&&jt(a,function(){a.curOp.forceUpdate=!0,Pp(a,s,u),ft(a,"lineWidgetChanged",a,t,D(s))}))},nn(fo);function Pp(t,r,a){Fn(r)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&Ol(t,a)}function AC(t,r,a,s){var u=new fo(t,a,s),p=t.cm;return p&&u.noHScroll&&(p.display.alignWidgets=!0),lo(t,r,"widget",function(h){var v=h.widgets||(h.widgets=[]);if(u.insertAt==null?v.push(u):v.splice(Math.min(v.length,Math.max(0,u.insertAt)),0,u),u.line=h,p&&!Un(t,h)){var w=Fn(h)<t.scrollTop;Ut(h,h.height+Zi(u)),w&&Ol(p,u.height),p.curOp.forceUpdate=!0}return!0}),p&&ft(p,"lineWidgetAdded",p,u,typeof r=="number"?r:D(r)),u}var jp=0,Zn=function(t,r){this.lines=[],this.type=r,this.doc=t,this.id=++jp};Zn.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&wr(t),Pt(this,"clear")){var a=this.find();a&&ft(this,"clear",a.from,a.to)}for(var s=null,u=null,p=0;p<this.lines.length;++p){var h=this.lines[p],v=Yi(h.markedSpans,this);t&&!this.collapsed?Gn(t,D(h),"text"):t&&(v.to!=null&&(u=D(h)),v.from!=null&&(s=D(h))),h.markedSpans=mk(h.markedSpans,v),v.from==null&&this.collapsed&&!Un(this.doc,h)&&t&&Ut(h,Jr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var w=0;w<this.lines.length;++w){var x=ln(this.lines[w]),O=ks(x);O>t.display.maxLineLength&&(t.display.maxLine=x,t.display.maxLineLength=O,t.display.maxLineChanged=!0)}s!=null&&t&&this.collapsed&&Ft(t,s,u+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Sp(t.doc)),t&&ft(t,"markerCleared",t,this,s,u),r&&br(t),this.parent&&this.parent.clear()}},Zn.prototype.find=function(t,r){t==null&&this.type=="bookmark"&&(t=1);for(var a,s,u=0;u<this.lines.length;++u){var p=this.lines[u],h=Yi(p.markedSpans,this);if(h.from!=null&&(a=Y(r?p:D(p),h.from),t==-1))return a;if(h.to!=null&&(s=Y(r?p:D(p),h.to),t==1))return s}return a&&{from:a,to:s}},Zn.prototype.changed=function(){var t=this,r=this.find(-1,!0),a=this,s=this.doc.cm;!r||!s||jt(s,function(){var u=r.line,p=D(r.line),h=bl(s,p);if(h&&(Wd(h),s.curOp.selectionChanged=s.curOp.forceUpdate=!0),s.curOp.updateMaxLine=!0,!Un(a.doc,u)&&a.height!=null){var v=a.height;a.height=null;var w=Zi(a)-v;w&&Ut(u,u.height+w)}ft(s,"markerChanged",s,t)})},Zn.prototype.attachLine=function(t){if(!this.lines.length&&this.doc.cm){var r=this.doc.cm.curOp;(!r.maybeHiddenMarkers||ie(r.maybeHiddenMarkers,this)==-1)&&(r.maybeUnhiddenMarkers||(r.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(t)},Zn.prototype.detachLine=function(t){if(this.lines.splice(ie(this.lines,t),1),!this.lines.length&&this.doc.cm){var r=this.doc.cm.curOp;(r.maybeHiddenMarkers||(r.maybeHiddenMarkers=[])).push(this)}},nn(Zn);function ai(t,r,a,s,u){if(s&&s.shared)return SC(t,r,a,s,u);if(t.cm&&!t.cm.curOp)return dt(t.cm,ai)(t,r,a,s,u);var p=new Zn(t,u),h=fe(r,a);if(s&&V(s,p,!1),h>0||h==0&&p.clearWhenEmpty!==!1)return p;if(p.replacedWith&&(p.collapsed=!0,p.widgetNode=X("span",[p.replacedWith],"CodeMirror-widget"),s.handleMouseEvents||p.widgetNode.setAttribute("cm-ignore-events","true"),s.insertLeft&&(p.widgetNode.insertLeft=!0)),p.collapsed){if(Ed(t,r.line,r,a,p)||r.line!=a.line&&Ed(t,a.line,r,a,p))throw new Error("Inserting collapsed marker partially overlapping an existing one");gk()}p.addToHistory&&wp(t,{from:r,to:a,origin:"markText"},t.sel,NaN);var v=r.line,w=t.cm,x;if(t.iter(v,a.line+1,function(j){w&&p.collapsed&&!w.options.lineWrapping&&ln(j)==w.display.maxLine&&(x=!0),p.collapsed&&v!=r.line&&Ut(j,0),yk(j,new vs(p,v==r.line?r.ch:null,v==a.line?a.ch:null),t.cm&&t.cm.curOp),++v}),p.collapsed&&t.iter(r.line,a.line+1,function(j){Un(t,j)&&Ut(j,0)}),p.clearOnEnter&&ye(p,"beforeCursorEnter",function(){return p.clear()}),p.readOnly&&(hk(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),p.collapsed&&(p.id=++jp,p.atomic=!0),w){if(x&&(w.curOp.updateMaxLine=!0),p.collapsed)Ft(w,r.line,a.line+1);else if(p.className||p.startStyle||p.endStyle||p.css||p.attributes||p.title)for(var O=r.line;O<=a.line;O++)Gn(w,O,"text");p.atomic&&Sp(w.doc),ft(w,"markerAdded",w,p)}return p}var po=function(t,r){this.markers=t,this.primary=r;for(var a=0;a<t.length;++a)t[a].parent=this};po.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)this.markers[t].clear();ft(this,"clear")}},po.prototype.find=function(t,r){return this.primary.find(t,r)},nn(po);function SC(t,r,a,s,u){s=V(s),s.shared=!1;var p=[ai(t,r,a,s,u)],h=p[0],v=s.widgetNode;return Kn(t,function(w){v&&(s.widgetNode=v.cloneNode(!0)),p.push(ai(w,ke(w,r),ke(w,a),s,u));for(var x=0;x<w.linked.length;++x)if(w.linked[x].isParent)return;h=Te(p)}),new po(p,h)}function zp(t){return t.findMarks(Y(t.first,0),t.clipPos(Y(t.lastLine())),function(r){return r.parent})}function EC(t,r){for(var a=0;a<r.length;a++){var s=r[a],u=s.find(),p=t.clipPos(u.from),h=t.clipPos(u.to);if(fe(p,h)){var v=ai(t,p,h,s.primary,s.primary.type);s.markers.push(v),v.parent=s}}}function MC(t){for(var r=function(s){var u=t[s],p=[u.primary.doc];Kn(u.primary.doc,function(w){return p.push(w)});for(var h=0;h<u.markers.length;h++){var v=u.markers[h];ie(p,v.doc)==-1&&(v.parent=null,u.markers.splice(h--,1))}},a=0;a<t.length;a++)r(a)}var LC=0,Nt=function(t,r,a,s,u){if(!(this instanceof Nt))return new Nt(t,r,a,s,u);a==null&&(a=0),co.call(this,[new uo([new Qr("",null)])]),this.first=a,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=a;var p=Y(a,0);this.sel=Yn(p),this.history=new Is(null),this.id=++LC,this.modeOption=r,this.lineSep=s,this.direction=u=="rtl"?"rtl":"ltr",this.extend=!1,typeof t=="string"&&(t=this.splitLines(t)),ql(this,{from:p,to:p,text:t}),xt(this,Yn(p),be)};Nt.prototype=K(co.prototype,{constructor:Nt,iter:function(t,r,a){a?this.iterN(t-this.first,r-t,a):this.iterN(this.first,this.first+this.size,t)},insert:function(t,r){for(var a=0,s=0;s<r.length;++s)a+=r[s].height;this.insertInner(t-this.first,r,a)},remove:function(t,r){this.removeInner(t-this.first,r)},getValue:function(t){var r=Gi(this,this.first,this.first+this.size);return t===!1?r:r.join(t||this.lineSeparator())},setValue:pt(function(t){var r=Y(this.first,0),a=this.first+this.size-1;oi(this,{from:r,to:Y(a,ge(this,a).text.length),text:this.splitLines(t),origin:"setValue",full:!0},!0),this.cm&&eo(this.cm,0,0),xt(this,Yn(r),be)}),replaceRange:function(t,r,a,s){r=ke(this,r),a=a?ke(this,a):r,si(this,t,r,a,s)},getRange:function(t,r,a){var s=Ln(this,ke(this,t),ke(this,r));return a===!1?s:a===""?s.join(""):s.join(a||this.lineSeparator())},getLine:function(t){var r=this.getLineHandle(t);return r&&r.text},getLineHandle:function(t){if(J(this,t))return ge(this,t)},getLineNumber:function(t){return D(t)},getLineHandleVisualStart:function(t){return typeof t=="number"&&(t=ge(this,t)),ln(t)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(t){return ke(this,t)},getCursor:function(t){var r=this.sel.primary(),a;return t==null||t=="head"?a=r.head:t=="anchor"?a=r.anchor:t=="end"||t=="to"||t===!1?a=r.to():a=r.from(),a},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:pt(function(t,r,a){Cp(this,ke(this,typeof t=="number"?Y(t,r||0):t),null,a)}),setSelection:pt(function(t,r,a){Cp(this,ke(this,t),ke(this,r||t),a)}),extendSelection:pt(function(t,r,a){Ps(this,ke(this,t),r&&ke(this,r),a)}),extendSelections:pt(function(t,r){kp(this,pd(this,t),r)}),extendSelectionsBy:pt(function(t,r){var a=He(this.sel.ranges,t);kp(this,pd(this,a),r)}),setSelections:pt(function(t,r,a){if(t.length){for(var s=[],u=0;u<t.length;u++)s[u]=new Be(ke(this,t[u].anchor),ke(this,t[u].head||t[u].anchor));r==null&&(r=Math.min(t.length-1,this.sel.primIndex)),xt(this,cn(this.cm,s,r),a)}}),addSelection:pt(function(t,r,a){var s=this.sel.ranges.slice(0);s.push(new Be(ke(this,t),ke(this,r||t))),xt(this,cn(this.cm,s,s.length-1),a)}),getSelection:function(t){for(var r=this.sel.ranges,a,s=0;s<r.length;s++){var u=Ln(this,r[s].from(),r[s].to());a=a?a.concat(u):u}return t===!1?a:a.join(t||this.lineSeparator())},getSelections:function(t){for(var r=[],a=this.sel.ranges,s=0;s<a.length;s++){var u=Ln(this,a[s].from(),a[s].to());t!==!1&&(u=u.join(t||this.lineSeparator())),r[s]=u}return r},replaceSelection:function(t,r,a){for(var s=[],u=0;u<this.sel.ranges.length;u++)s[u]=t;this.replaceSelections(s,r,a||"+input")},replaceSelections:pt(function(t,r,a){for(var s=[],u=this.sel,p=0;p<u.ranges.length;p++){var h=u.ranges[p];s[p]={from:h.from(),to:h.to(),text:this.splitLines(t[p]),origin:a}}for(var v=r&&r!="end"&&mC(this,s,r),w=s.length-1;w>=0;w--)oi(this,s[w]);v?Dp(this,v):this.cm&&ti(this.cm)}),undo:pt(function(){Rs(this,"undo")}),redo:pt(function(){Rs(this,"redo")}),undoSelection:pt(function(){Rs(this,"undo",!0)}),redoSelection:pt(function(){Rs(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,r=0,a=0,s=0;s<t.done.length;s++)t.done[s].ranges||++r;for(var u=0;u<t.undone.length;u++)t.undone[u].ranges||++a;return{undo:r,redo:a}},clearHistory:function(){var t=this;this.history=new Is(this.history),Kn(this,function(r){return r.history=t.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(t){return t&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(t){return this.history.generation==(t||this.cleanGeneration)},getHistory:function(){return{done:ri(this.history.done),undone:ri(this.history.undone)}},setHistory:function(t){var r=this.history=new Is(this.history);r.done=ri(t.done.slice(0),null,!0),r.undone=ri(t.undone.slice(0),null,!0)},setGutterMarker:pt(function(t,r,a){return lo(this,t,"gutter",function(s){var u=s.gutterMarkers||(s.gutterMarkers={});return u[r]=a,!a&&ps(u)&&(s.gutterMarkers=null),!0})}),clearGutter:pt(function(t){var r=this;this.iter(function(a){a.gutterMarkers&&a.gutterMarkers[t]&&lo(r,a,"gutter",function(){return a.gutterMarkers[t]=null,ps(a.gutterMarkers)&&(a.gutterMarkers=null),!0})})}),lineInfo:function(t){var r;if(typeof t=="number"){if(!J(this,t)||(r=t,t=ge(this,t),!t))return null}else if(r=D(t),r==null)return null;return{line:r,handle:t,text:t.text,gutterMarkers:t.gutterMarkers,textClass:t.textClass,bgClass:t.bgClass,wrapClass:t.wrapClass,widgets:t.widgets}},addLineClass:pt(function(t,r,a){return lo(this,t,r=="gutter"?"gutter":"class",function(s){var u=r=="text"?"textClass":r=="background"?"bgClass":r=="gutter"?"gutterClass":"wrapClass";if(!s[u])s[u]=a;else{if(W(a).test(s[u]))return!1;s[u]+=" "+a}return!0})}),removeLineClass:pt(function(t,r,a){return lo(this,t,r=="gutter"?"gutter":"class",function(s){var u=r=="text"?"textClass":r=="background"?"bgClass":r=="gutter"?"gutterClass":"wrapClass",p=s[u];if(p)if(a==null)s[u]=null;else{var h=p.match(W(a));if(!h)return!1;var v=h.index+h[0].length;s[u]=p.slice(0,h.index)+(!h.index||v==p.length?"":" ")+p.slice(v)||null}else return!1;return!0})}),addLineWidget:pt(function(t,r,a){return AC(this,t,r,a)}),removeLineWidget:function(t){t.clear()},markText:function(t,r,a){return ai(this,ke(this,t),ke(this,r),a,a&&a.type||"range")},setBookmark:function(t,r){var a={replacedWith:r&&(r.nodeType==null?r.widget:r),insertLeft:r&&r.insertLeft,clearWhenEmpty:!1,shared:r&&r.shared,handleMouseEvents:r&&r.handleMouseEvents};return t=ke(this,t),ai(this,t,t,a,"bookmark")},findMarksAt:function(t){t=ke(this,t);var r=[],a=ge(this,t.line).markedSpans;if(a)for(var s=0;s<a.length;++s){var u=a[s];(u.from==null||u.from<=t.ch)&&(u.to==null||u.to>=t.ch)&&r.push(u.marker.parent||u.marker)}return r},findMarks:function(t,r,a){t=ke(this,t),r=ke(this,r);var s=[],u=t.line;return this.iter(t.line,r.line+1,function(p){var h=p.markedSpans;if(h)for(var v=0;v<h.length;v++){var w=h[v];!(w.to!=null&&u==t.line&&t.ch>=w.to||w.from==null&&u!=t.line||w.from!=null&&u==r.line&&w.from>=r.ch)&&(!a||a(w.marker))&&s.push(w.marker.parent||w.marker)}++u}),s},getAllMarks:function(){var t=[];return this.iter(function(r){var a=r.markedSpans;if(a)for(var s=0;s<a.length;++s)a[s].from!=null&&t.push(a[s].marker)}),t},posFromIndex:function(t){var r,a=this.first,s=this.lineSeparator().length;return this.iter(function(u){var p=u.text.length+s;if(p>t)return r=t,!0;t-=p,++a}),ke(this,Y(a,r))},indexFromPos:function(t){t=ke(this,t);var r=t.ch;if(t.line<this.first||t.ch<0)return 0;var a=this.lineSeparator().length;return this.iter(this.first,t.line,function(s){r+=s.text.length+a}),r},copy:function(t){var r=new Nt(Gi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return r.scrollTop=this.scrollTop,r.scrollLeft=this.scrollLeft,r.sel=this.sel,r.extend=!1,t&&(r.history.undoDepth=this.history.undoDepth,r.setHistory(this.getHistory())),r},linkedDoc:function(t){t||(t={});var r=this.first,a=this.first+this.size;t.from!=null&&t.from>r&&(r=t.from),t.to!=null&&t.to<a&&(a=t.to);var s=new Nt(Gi(this,r,a),t.mode||this.modeOption,r,this.lineSep,this.direction);return t.sharedHist&&(s.history=this.history),(this.linked||(this.linked=[])).push({doc:s,sharedHist:t.sharedHist}),s.linked=[{doc:this,isParent:!0,sharedHist:t.sharedHist}],EC(s,zp(this)),s},unlinkDoc:function(t){if(t instanceof Ge&&(t=t.doc),this.linked)for(var r=0;r<this.linked.length;++r){var a=this.linked[r];if(a.doc==t){this.linked.splice(r,1),t.unlinkDoc(this),MC(zp(this));break}}if(t.history==this.history){var s=[t.id];Kn(t,function(u){return s.push(u.id)},!0),t.history=new Is(null),t.history.done=ri(this.history.done,s),t.history.undone=ri(this.history.undone,s)}},iterLinkedDocs:function(t){Kn(this,t)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(t){return this.lineSep?t.split(this.lineSep):Jt(t)},lineSeparator:function(){return this.lineSep||`
|
|
122
122
|
`},setDirection:pt(function(t){t!="rtl"&&(t="ltr"),t!=this.direction&&(this.direction=t,this.iter(function(r){return r.order=null}),this.cm&&yC(this.cm))})}),Nt.prototype.eachLine=Nt.prototype.iter;var Rp=0;function TC(t){var r=this;if(Hp(r),!(Ke(r,t)||Nn(r.display,t))){bt(t),f&&(Rp=+new Date);var a=gr(r,t,!0),s=t.dataTransfer.files;if(!(!a||r.isReadOnly()))if(s&&s.length&&window.FileReader&&window.File)for(var u=s.length,p=Array(u),h=0,v=function(){++h==u&&dt(r,function(){a=ke(r.doc,a);var H={from:a,to:a,text:r.doc.splitLines(p.filter(function(Q){return Q!=null}).join(r.doc.lineSeparator())),origin:"paste"};oi(r.doc,H),Dp(r.doc,Yn(ke(r.doc,a),ke(r.doc,Qn(H))))})()},w=function(H,Q){if(r.options.allowDropFileTypes&&ie(r.options.allowDropFileTypes,H.type)==-1){v();return}var te=new FileReader;te.onerror=function(){return v()},te.onload=function(){var se=te.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(se)){v();return}p[Q]=se,v()},te.readAsText(H)},x=0;x<s.length;x++)w(s[x],x);else{if(r.state.draggingText&&r.doc.sel.contains(a)>-1){r.state.draggingText(t),setTimeout(function(){return r.display.input.focus()},20);return}try{var O=t.dataTransfer.getData("Text");if(O){var j;if(r.state.draggingText&&!r.state.draggingText.copy&&(j=r.listSelections()),js(r.doc,Yn(a,a)),j)for(var _=0;_<j.length;++_)si(r.doc,"",j[_].anchor,j[_].head,"drag");r.replaceSelection(O,"around","paste"),r.display.input.focus()}}catch{}}}}function FC(t,r){if(f&&(!t.state.draggingText||+new Date-Rp<100)){qn(r);return}if(!(Ke(t,r)||Nn(t.display,r))&&(r.dataTransfer.setData("Text",t.getSelection()),r.dataTransfer.effectAllowed="copyMove",r.dataTransfer.setDragImage&&!M)){var a=S("img",null,null,"position: fixed; left: 0; top: 0;");a.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",C&&(a.width=a.height=1,t.display.wrapper.appendChild(a),a._top=a.offsetTop),r.dataTransfer.setDragImage(a,0,0),C&&a.parentNode.removeChild(a)}}function NC(t,r){var a=gr(t,r);if(a){var s=document.createDocumentFragment();Ml(t,a,s),t.display.dragCursor||(t.display.dragCursor=S("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),Z(t.display.dragCursor,s)}}function Hp(t){t.display.dragCursor&&(t.display.lineSpace.removeChild(t.display.dragCursor),t.display.dragCursor=null)}function qp(t){if(document.getElementsByClassName){for(var r=document.getElementsByClassName("CodeMirror"),a=[],s=0;s<r.length;s++){var u=r[s].CodeMirror;u&&a.push(u)}a.length&&a[0].operation(function(){for(var p=0;p<a.length;p++)t(a[p])})}}var _p=!1;function OC(){_p||(IC(),_p=!0)}function IC(){var t;ye(window,"resize",function(){t==null&&(t=setTimeout(function(){t=null,qp(BC)},100))}),ye(window,"blur",function(){return qp(ei)})}function BC(t){var r=t.display;r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.scrollbarsClipped=!1,t.setSize()}for(var Jn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ho=0;ho<10;ho++)Jn[ho+48]=Jn[ho+96]=String(ho);for(var Hs=65;Hs<=90;Hs++)Jn[Hs]=String.fromCharCode(Hs);for(var go=1;go<=12;go++)Jn[go+111]=Jn[go+63235]="F"+go;var In={};In.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},In.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},In.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},In.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},In.default=L?In.macDefault:In.pcDefault;function PC(t){var r=t.split(/-(?!$)/);t=r[r.length-1];for(var a,s,u,p,h=0;h<r.length-1;h++){var v=r[h];if(/^(cmd|meta|m)$/i.test(v))p=!0;else if(/^a(lt)?$/i.test(v))a=!0;else if(/^(c|ctrl|control)$/i.test(v))s=!0;else if(/^s(hift)?$/i.test(v))u=!0;else throw new Error("Unrecognized modifier name: "+v)}return a&&(t="Alt-"+t),s&&(t="Ctrl-"+t),p&&(t="Cmd-"+t),u&&(t="Shift-"+t),t}function jC(t){var r={};for(var a in t)if(t.hasOwnProperty(a)){var s=t[a];if(/^(name|fallthrough|(de|at)tach)$/.test(a))continue;if(s=="..."){delete t[a];continue}for(var u=He(a.split(" "),PC),p=0;p<u.length;p++){var h=void 0,v=void 0;p==u.length-1?(v=u.join(" "),h=s):(v=u.slice(0,p+1).join(" "),h="...");var w=r[v];if(!w)r[v]=h;else if(w!=h)throw new Error("Inconsistent bindings for "+v)}delete t[a]}for(var x in r)t[x]=r[x];return t}function li(t,r,a,s){r=qs(r);var u=r.call?r.call(t,s):r[t];if(u===!1)return"nothing";if(u==="...")return"multi";if(u!=null&&a(u))return"handled";if(r.fallthrough){if(Object.prototype.toString.call(r.fallthrough)!="[object Array]")return li(t,r.fallthrough,a,s);for(var p=0;p<r.fallthrough.length;p++){var h=li(t,r.fallthrough[p],a,s);if(h)return h}}}function Wp(t){var r=typeof t=="string"?t:Jn[t.keyCode];return r=="Ctrl"||r=="Alt"||r=="Shift"||r=="Mod"}function $p(t,r,a){var s=t;return r.altKey&&s!="Alt"&&(t="Alt-"+t),(R?r.metaKey:r.ctrlKey)&&s!="Ctrl"&&(t="Ctrl-"+t),(R?r.ctrlKey:r.metaKey)&&s!="Mod"&&(t="Cmd-"+t),!a&&r.shiftKey&&s!="Shift"&&(t="Shift-"+t),t}function Up(t,r){if(C&&t.keyCode==34&&t.char)return!1;var a=Jn[t.keyCode];return a==null||t.altGraphKey?!1:(t.keyCode==3&&t.code&&(a=t.code),$p(a,t,r))}function qs(t){return typeof t=="string"?In[t]:t}function ui(t,r){for(var a=t.doc.sel.ranges,s=[],u=0;u<a.length;u++){for(var p=r(a[u]);s.length&&fe(p.from,Te(s).to)<=0;){var h=s.pop();if(fe(h.from,p.from)<0){p.from=h.from;break}}s.push(p)}jt(t,function(){for(var v=s.length-1;v>=0;v--)si(t.doc,"",s[v].from,s[v].to,"+delete");ti(t)})}function Ul(t,r,a){var s=zn(t.text,r+a,a);return s<0||s>t.text.length?null:s}function Gl(t,r,a){var s=Ul(t,r.ch,a);return s==null?null:new Y(r.line,s,a<0?"after":"before")}function Vl(t,r,a,s,u){if(t){r.doc.direction=="rtl"&&(u=-u);var p=Le(a,r.doc.direction);if(p){var h=u<0?Te(p):p[0],v=u<0==(h.level==1),w=v?"after":"before",x;if(h.level>0||r.doc.direction=="rtl"){var O=Zr(r,a);x=u<0?a.text.length-1:0;var j=Cn(r,O,x).top;x=wn(function(_){return Cn(r,O,_).top==j},u<0==(h.level==1)?h.from:h.to-1,x),w=="before"&&(x=Ul(a,x,1))}else x=u<0?h.to:h.from;return new Y(s,x,w)}}return new Y(s,u<0?a.text.length:0,u<0?"before":"after")}function zC(t,r,a,s){var u=Le(r,t.doc.direction);if(!u)return Gl(r,a,s);a.ch>=r.text.length?(a.ch=r.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after");var p=Hn(u,a.ch,a.sticky),h=u[p];if(t.doc.direction=="ltr"&&h.level%2==0&&(s>0?h.to>a.ch:h.from<a.ch))return Gl(r,a,s);var v=function(ue,de){return Ul(r,ue instanceof Y?ue.ch:ue,de)},w,x=function(ue){return t.options.lineWrapping?(w=w||Zr(t,r),Kd(t,r,w,ue)):{begin:0,end:r.text.length}},O=x(a.sticky=="before"?v(a,-1):a.ch);if(t.doc.direction=="rtl"||h.level==1){var j=h.level==1==s<0,_=v(a,j?1:-1);if(_!=null&&(j?_<=h.to&&_<=O.end:_>=h.from&&_>=O.begin)){var H=j?"before":"after";return new Y(a.line,_,H)}}var Q=function(ue,de,ce){for(var he=function(qe,ht){return ht?new Y(a.line,v(qe,1),"before"):new Y(a.line,qe,"after")};ue>=0&&ue<u.length;ue+=de){var ve=u[ue],me=de>0==(ve.level!=1),Se=me?ce.begin:v(ce.end,-1);if(ve.from<=Se&&Se<ve.to||(Se=me?ve.from:v(ve.to,-1),ce.begin<=Se&&Se<ce.end))return he(Se,me)}},te=Q(p+s,s,O);if(te)return te;var se=s>0?O.end:v(O.begin,-1);return se!=null&&!(s>0&&se==r.text.length)&&(te=Q(s>0?0:u.length-1,s,x(se)),te)?te:null}var mo={selectAll:Lp,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),be)},killLine:function(t){return ui(t,function(r){if(r.empty()){var a=ge(t.doc,r.head.line).text.length;return r.head.ch==a&&r.head.line<t.lastLine()?{from:r.head,to:Y(r.head.line+1,0)}:{from:r.head,to:Y(r.head.line,a)}}else return{from:r.from(),to:r.to()}})},deleteLine:function(t){return ui(t,function(r){return{from:Y(r.from().line,0),to:ke(t.doc,Y(r.to().line+1,0))}})},delLineLeft:function(t){return ui(t,function(r){return{from:Y(r.from().line,0),to:r.from()}})},delWrappedLineLeft:function(t){return ui(t,function(r){var a=t.charCoords(r.head,"div").top+5,s=t.coordsChar({left:0,top:a},"div");return{from:s,to:r.from()}})},delWrappedLineRight:function(t){return ui(t,function(r){var a=t.charCoords(r.head,"div").top+5,s=t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:a},"div");return{from:r.from(),to:s}})},undo:function(t){return t.undo()},redo:function(t){return t.redo()},undoSelection:function(t){return t.undoSelection()},redoSelection:function(t){return t.redoSelection()},goDocStart:function(t){return t.extendSelection(Y(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(Y(t.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(r){return Gp(t,r.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(r){return Vp(t,r.head)},{origin:"+move",bias:1})},goLineEnd:function(t){return t.extendSelectionsBy(function(r){return RC(t,r.head.line)},{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy(function(r){var a=t.cursorCoords(r.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:a},"div")},Me)},goLineLeft:function(t){return t.extendSelectionsBy(function(r){var a=t.cursorCoords(r.head,"div").top+5;return t.coordsChar({left:0,top:a},"div")},Me)},goLineLeftSmart:function(t){return t.extendSelectionsBy(function(r){var a=t.cursorCoords(r.head,"div").top+5,s=t.coordsChar({left:0,top:a},"div");return s.ch<t.getLine(s.line).search(/\S/)?Vp(t,r.head):s},Me)},goLineUp:function(t){return t.moveV(-1,"line")},goLineDown:function(t){return t.moveV(1,"line")},goPageUp:function(t){return t.moveV(-1,"page")},goPageDown:function(t){return t.moveV(1,"page")},goCharLeft:function(t){return t.moveH(-1,"char")},goCharRight:function(t){return t.moveH(1,"char")},goColumnLeft:function(t){return t.moveH(-1,"column")},goColumnRight:function(t){return t.moveH(1,"column")},goWordLeft:function(t){return t.moveH(-1,"word")},goGroupRight:function(t){return t.moveH(1,"group")},goGroupLeft:function(t){return t.moveH(-1,"group")},goWordRight:function(t){return t.moveH(1,"word")},delCharBefore:function(t){return t.deleteH(-1,"codepoint")},delCharAfter:function(t){return t.deleteH(1,"char")},delWordBefore:function(t){return t.deleteH(-1,"word")},delWordAfter:function(t){return t.deleteH(1,"word")},delGroupBefore:function(t){return t.deleteH(-1,"group")},delGroupAfter:function(t){return t.deleteH(1,"group")},indentAuto:function(t){return t.indentSelection("smart")},indentMore:function(t){return t.indentSelection("add")},indentLess:function(t){return t.indentSelection("subtract")},insertTab:function(t){return t.replaceSelection(" ")},insertSoftTab:function(t){for(var r=[],a=t.listSelections(),s=t.options.tabSize,u=0;u<a.length;u++){var p=a[u].from(),h=le(t.getLine(p.line),p.ch,s);r.push(at(s-h%s))}t.replaceSelections(r)},defaultTab:function(t){t.somethingSelected()?t.indentSelection("add"):t.execCommand("insertTab")},transposeChars:function(t){return jt(t,function(){for(var r=t.listSelections(),a=[],s=0;s<r.length;s++)if(r[s].empty()){var u=r[s].head,p=ge(t.doc,u.line).text;if(p){if(u.ch==p.length&&(u=new Y(u.line,u.ch-1)),u.ch>0)u=new Y(u.line,u.ch+1),t.replaceRange(p.charAt(u.ch-1)+p.charAt(u.ch-2),Y(u.line,u.ch-2),u,"+transpose");else if(u.line>t.doc.first){var h=ge(t.doc,u.line-1).text;h&&(u=new Y(u.line,1),t.replaceRange(p.charAt(0)+t.doc.lineSeparator()+h.charAt(h.length-1),Y(u.line-1,h.length-1),u,"+transpose"))}}a.push(new Be(u,u))}t.setSelections(a)})},newlineAndIndent:function(t){return jt(t,function(){for(var r=t.listSelections(),a=r.length-1;a>=0;a--)t.replaceRange(t.doc.lineSeparator(),r[a].anchor,r[a].head,"+input");r=t.listSelections();for(var s=0;s<r.length;s++)t.indentLine(r[s].from().line,null,!0);ti(t)})},openLine:function(t){return t.replaceSelection(`
|
|
123
|
-
`,"start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function Gp(t,r){var a=ge(t.doc,r),s=ln(a);return s!=a&&(r=D(s)),Vl(!0,t,s,r,1)}function RC(t,r){var a=ge(t.doc,r),s=kk(a);return s!=a&&(r=D(s)),Vl(!0,t,a,r,-1)}function Vp(t,r){var a=Gp(t,r.line),s=ge(t.doc,a.line),u=Le(s,t.doc.direction);if(!u||u[0].level==0){var p=Math.max(a.ch,s.text.search(/\S/)),h=r.line==a.line&&r.ch<=p&&r.ch;return Y(a.line,h?0:p,a.sticky)}return a}function _s(t,r,a){if(typeof r=="string"&&(r=mo[r],!r))return!1;t.display.input.ensurePolled();var s=t.display.shift,u=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),a&&(t.display.shift=!1),u=r(t)!=Ce}finally{t.display.shift=s,t.state.suppressEdits=!1}return u}function HC(t,r,a){for(var s=0;s<t.state.keyMaps.length;s++){var u=li(r,t.state.keyMaps[s],a,t);if(u)return u}return t.options.extraKeys&&li(r,t.options.extraKeys,a,t)||li(r,t.options.keyMap,a,t)}var qC=new re;function yo(t,r,a,s){var u=t.state.keySeq;if(u){if(Wp(r))return"handled";if(/\'$/.test(r)?t.state.keySeq=null:qC.set(50,function(){t.state.keySeq==u&&(t.state.keySeq=null,t.display.input.reset())}),Yp(t,u+" "+r,a,s))return!0}return Yp(t,r,a,s)}function Yp(t,r,a,s){var u=HC(t,r,s);return u=="multi"&&(t.state.keySeq=r),u=="handled"&&ft(t,"keyHandled",t,r,a),(u=="handled"||u=="multi")&&(bt(a),Ll(t)),!!u}function Qp(t,r){var a=Up(r,!0);return a?r.shiftKey&&!t.state.keySeq?yo(t,"Shift-"+a,r,function(s){return _s(t,s,!0)})||yo(t,a,r,function(s){if(typeof s=="string"?/^go[A-Z]/.test(s):s.motion)return _s(t,s)}):yo(t,a,r,function(s){return _s(t,s)}):!1}function _C(t,r,a){return yo(t,"'"+a+"'",r,function(s){return _s(t,s,!0)})}var Yl=null;function Kp(t){var r=this;if(!(t.target&&t.target!=r.display.input.getField())&&(r.curOp.focus=De(yt(r)),!Ke(r,t))){f&&d<11&&t.keyCode==27&&(t.returnValue=!1);var a=t.keyCode;r.display.shift=a==16||t.shiftKey;var s=Qp(r,t);C&&(Yl=s?a:null,!s&&a==88&&!ms&&(L?t.metaKey:t.ctrlKey)&&r.replaceSelection("",null,"cut")),i&&!L&&!s&&a==46&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),a==18&&!/\bCodeMirror-crosshair\b/.test(r.display.lineDiv.className)&&WC(r)}}function WC(t){var r=t.display.lineDiv;Pe(r,"CodeMirror-crosshair");function a(s){(s.keyCode==18||!s.altKey)&&(ne(r,"CodeMirror-crosshair"),wt(document,"keyup",a),wt(document,"mouseover",a))}ye(document,"keyup",a),ye(document,"mouseover",a)}function Zp(t){t.keyCode==16&&(this.doc.sel.shift=!1),Ke(this,t)}function Jp(t){var r=this;if(!(t.target&&t.target!=r.display.input.getField())&&!(Nn(r.display,t)||Ke(r,t)||t.ctrlKey&&!t.altKey||L&&t.metaKey)){var a=t.keyCode,s=t.charCode;if(C&&a==Yl){Yl=null,bt(t);return}if(!(C&&(!t.which||t.which<10)&&Qp(r,t))){var u=String.fromCharCode(s??a);u!="\b"&&(_C(r,t,u)||r.display.input.onKeyPress(t))}}}var $C=400,Ql=function(t,r,a){this.time=t,this.pos=r,this.button=a};Ql.prototype.compare=function(t,r,a){return this.time+$C>t&&fe(r,this.pos)==0&&a==this.button};var vo,wo;function UC(t,r){var a=+new Date;return wo&&wo.compare(a,t,r)?(vo=wo=null,"triple"):vo&&vo.compare(a,t,r)?(wo=new Ql(a,t,r),vo=null,"double"):(vo=new Ql(a,t,r),wo=null,"single")}function Xp(t){var r=this,a=r.display;if(!(Ke(r,t)||a.activeTouch&&a.input.supportsTouch())){if(a.input.ensurePolled(),a.shift=t.shiftKey,Nn(a,t)){g||(a.scroller.draggable=!1,setTimeout(function(){return a.scroller.draggable=!0},100));return}if(!Kl(r,t)){var s=gr(r,t),u=rn(t),p=s?UC(s,u):"single";xe(r).focus(),u==1&&r.state.selectingText&&r.state.selectingText(t),!(s&&GC(r,u,s,p,t))&&(u==1?s?YC(r,s,p,t):Wi(t)==a.scroller&&bt(t):u==2?(s&&Ps(r.doc,s),setTimeout(function(){return a.input.focus()},20)):u==3&&(U?r.display.input.onContextMenu(t):Tl(r)))}}}function GC(t,r,a,s,u){var p="Click";return s=="double"?p="Double"+p:s=="triple"&&(p="Triple"+p),p=(r==1?"Left":r==2?"Middle":"Right")+p,yo(t,$p(p,u),u,function(h){if(typeof h=="string"&&(h=mo[h]),!h)return!1;var v=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),v=h(t,a)!=Ce}finally{t.state.suppressEdits=!1}return v})}function VC(t,r,a){var s=t.getOption("configureMouse"),u=s?s(t,r,a):{};if(u.unit==null){var p=T?a.shiftKey&&a.metaKey:a.altKey;u.unit=p?"rectangle":r=="single"?"char":r=="double"?"word":"line"}return(u.extend==null||t.doc.extend)&&(u.extend=t.doc.extend||a.shiftKey),u.addNew==null&&(u.addNew=L?a.metaKey:a.ctrlKey),u.moveOnDrag==null&&(u.moveOnDrag=!(L?a.altKey:a.ctrlKey)),u}function YC(t,r,a,s){f?setTimeout(we(ep,t),0):t.curOp.focus=De(yt(t));var u=VC(t,a,s),p=t.doc.sel,h;t.options.dragDrop&&ll&&!t.isReadOnly()&&a=="single"&&(h=p.contains(r))>-1&&(fe((h=p.ranges[h]).from(),r)<0||r.xRel>0)&&(fe(h.to(),r)>0||r.xRel<0)?QC(t,s,r,u):KC(t,s,r,u)}function QC(t,r,a,s){var u=t.display,p=!1,h=dt(t,function(x){g&&(u.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Tl(t)),wt(u.wrapper.ownerDocument,"mouseup",h),wt(u.wrapper.ownerDocument,"mousemove",v),wt(u.scroller,"dragstart",w),wt(u.scroller,"drop",h),p||(bt(x),s.addNew||Ps(t.doc,a,null,null,s.extend),g&&!M||f&&d==9?setTimeout(function(){u.wrapper.ownerDocument.body.focus({preventScroll:!0}),u.input.focus()},20):u.input.focus())}),v=function(x){p=p||Math.abs(r.clientX-x.clientX)+Math.abs(r.clientY-x.clientY)>=10},w=function(){return p=!0};g&&(u.scroller.draggable=!0),t.state.draggingText=h,h.copy=!s.moveOnDrag,ye(u.wrapper.ownerDocument,"mouseup",h),ye(u.wrapper.ownerDocument,"mousemove",v),ye(u.scroller,"dragstart",w),ye(u.scroller,"drop",h),t.state.delayingBlurEvent=!0,setTimeout(function(){return u.input.focus()},20),u.scroller.dragDrop&&u.scroller.dragDrop()}function eh(t,r,a){if(a=="char")return new Be(r,r);if(a=="word")return t.findWordAt(r);if(a=="line")return new Be(Y(r.line,0),ke(t.doc,Y(r.line+1,0)));var s=a(t,r);return new Be(s.from,s.to)}function KC(t,r,a,s){f&&Tl(t);var u=t.display,p=t.doc;bt(r);var h,v,w=p.sel,x=w.ranges;if(s.addNew&&!s.extend?(v=p.sel.contains(a),v>-1?h=x[v]:h=new Be(a,a)):(h=p.sel.primary(),v=p.sel.primIndex),s.unit=="rectangle")s.addNew||(h=new Be(a,a)),a=gr(t,r,!0,!0),v=-1;else{var O=eh(t,a,s.unit);s.extend?h=Wl(h,O.anchor,O.head,s.extend):h=O}s.addNew?v==-1?(v=x.length,xt(p,cn(t,x.concat([h]),v),{scroll:!1,origin:"*mouse"})):x.length>1&&x[v].empty()&&s.unit=="char"&&!s.extend?(xt(p,cn(t,x.slice(0,v).concat(x.slice(v+1)),0),{scroll:!1,origin:"*mouse"}),w=p.sel):$l(p,v,h,$e):(v=0,xt(p,new Gt([h],0),$e),w=p.sel);var j=a;function _(ce){if(fe(j,ce)!=0)if(j=ce,s.unit=="rectangle"){for(var he=[],ve=t.options.tabSize,me=le(ge(p,a.line).text,a.ch,ve),Se=le(ge(p,ce.line).text,ce.ch,ve),qe=Math.min(me,Se),ht=Math.max(me,Se),Ve=Math.min(a.line,ce.line),zt=Math.min(t.lastLine(),Math.max(a.line,ce.line));Ve<=zt;Ve++){var Ot=ge(p,Ve).text,it=Ue(Ot,qe,ve);qe==ht?he.push(new Be(Y(Ve,it),Y(Ve,it))):Ot.length>it&&he.push(new Be(Y(Ve,it),Y(Ve,Ue(Ot,ht,ve))))}he.length||he.push(new Be(a,a)),xt(p,cn(t,w.ranges.slice(0,v).concat(he),v),{origin:"*mouse",scroll:!1}),t.scrollIntoView(ce)}else{var It=h,mt=eh(t,ce,s.unit),lt=It.anchor,ot;fe(mt.anchor,lt)>0?(ot=mt.head,lt=Yr(It.from(),mt.anchor)):(ot=mt.anchor,lt=Tt(It.to(),mt.head));var Je=w.ranges.slice(0);Je[v]=ZC(t,new Be(ke(p,lt),ot)),xt(p,cn(t,Je,v),$e)}}var H=u.wrapper.getBoundingClientRect(),Q=0;function te(ce){var he=++Q,ve=gr(t,ce,!0,s.unit=="rectangle");if(ve)if(fe(ve,j)!=0){t.curOp.focus=De(yt(t)),_(ve);var me=Ts(u,p);(ve.line>=me.to||ve.line<me.from)&&setTimeout(dt(t,function(){Q==he&&te(ce)}),150)}else{var Se=ce.clientY<H.top?-20:ce.clientY>H.bottom?20:0;Se&&setTimeout(dt(t,function(){Q==he&&(u.scroller.scrollTop+=Se,te(ce))}),50)}}function se(ce){t.state.selectingText=!1,Q=1/0,ce&&(bt(ce),u.input.focus()),wt(u.wrapper.ownerDocument,"mousemove",ue),wt(u.wrapper.ownerDocument,"mouseup",de),p.history.lastSelOrigin=null}var ue=dt(t,function(ce){ce.buttons===0||!rn(ce)?se(ce):te(ce)}),de=dt(t,se);t.state.selectingText=de,ye(u.wrapper.ownerDocument,"mousemove",ue),ye(u.wrapper.ownerDocument,"mouseup",de)}function ZC(t,r){var a=r.anchor,s=r.head,u=ge(t.doc,a.line);if(fe(a,s)==0&&a.sticky==s.sticky)return r;var p=Le(u);if(!p)return r;var h=Hn(p,a.ch,a.sticky),v=p[h];if(v.from!=a.ch&&v.to!=a.ch)return r;var w=h+(v.from==a.ch==(v.level!=1)?0:1);if(w==0||w==p.length)return r;var x;if(s.line!=a.line)x=(s.line-a.line)*(t.doc.direction=="ltr"?1:-1)>0;else{var O=Hn(p,s.ch,s.sticky),j=O-h||(s.ch-a.ch)*(v.level==1?-1:1);O==w-1||O==w?x=j<0:x=j>0}var _=p[w+(x?-1:0)],H=x==(_.level==1),Q=H?_.from:_.to,te=H?"after":"before";return a.ch==Q&&a.sticky==te?r:new Be(new Y(a.line,Q,te),s)}function th(t,r,a,s){var u,p;if(r.touches)u=r.touches[0].clientX,p=r.touches[0].clientY;else try{u=r.clientX,p=r.clientY}catch{return!1}if(u>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;s&&bt(r);var h=t.display,v=h.lineDiv.getBoundingClientRect();if(p>v.bottom||!Pt(t,a))return Lt(r);p-=v.top-h.viewOffset;for(var w=0;w<t.display.gutterSpecs.length;++w){var x=h.gutters.childNodes[w];if(x&&x.getBoundingClientRect().right>=u){var O=P(t.doc,p),j=t.display.gutterSpecs[w];return Qe(t,a,t,O,j.className,r),Lt(r)}}}function Kl(t,r){return th(t,r,"gutterClick",!0)}function nh(t,r){Nn(t.display,r)||JC(t,r)||Ke(t,r,"contextmenu")||U||t.display.input.onContextMenu(r)}function JC(t,r){return Pt(t,"gutterContextMenu")?th(t,r,"gutterContextMenu",!1):!1}function rh(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ji(t)}var ci={toString:function(){return"CodeMirror.Init"}},ih={},Ws={};function XC(t){var r=t.optionHandlers;function a(s,u,p,h){t.defaults[s]=u,p&&(r[s]=h?function(v,w,x){x!=ci&&p(v,w,x)}:p)}t.defineOption=a,t.Init=ci,a("value","",function(s,u){return s.setValue(u)},!0),a("mode",null,function(s,u){s.doc.modeOption=u,Hl(s)},!0),a("indentUnit",2,Hl,!0),a("indentWithTabs",!1),a("smartIndent",!0),a("tabSize",4,function(s){so(s),Ji(s),Ft(s)},!0),a("lineSeparator",null,function(s,u){if(s.doc.lineSep=u,!!u){var p=[],h=s.doc.first;s.doc.iter(function(w){for(var x=0;;){var O=w.text.indexOf(u,x);if(O==-1)break;x=O+u.length,p.push(Y(h,O))}h++});for(var v=p.length-1;v>=0;v--)si(s.doc,u,p[v],Y(p[v].line,p[v].ch+u.length))}}),a("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(s,u,p){s.state.specialChars=new RegExp(u.source+(u.test(" ")?"":"| "),"g"),p!=ci&&s.refresh()}),a("specialCharPlaceholder",Mk,function(s){return s.refresh()},!0),a("electricChars",!0),a("inputStyle",b?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),a("spellcheck",!1,function(s,u){return s.getInputField().spellcheck=u},!0),a("autocorrect",!1,function(s,u){return s.getInputField().autocorrect=u},!0),a("autocapitalize",!1,function(s,u){return s.getInputField().autocapitalize=u},!0),a("rtlMoveVisually",!I),a("wholeLineUpdateBefore",!0),a("theme","default",function(s){rh(s),oo(s)},!0),a("keyMap","default",function(s,u,p){var h=qs(u),v=p!=ci&&qs(p);v&&v.detach&&v.detach(s,h),h.attach&&h.attach(s,v||null)}),a("extraKeys",null),a("configureMouse",null),a("lineWrapping",!1,t1,!0),a("gutters",[],function(s,u){s.display.gutterSpecs=zl(u,s.options.lineNumbers),oo(s)},!0),a("fixedGutter",!0,function(s,u){s.display.gutters.style.left=u?Sl(s.display)+"px":"0",s.refresh()},!0),a("coverGutterNextToScrollbar",!1,function(s){return ni(s)},!0),a("scrollbarStyle","native",function(s){sp(s),ni(s),s.display.scrollbars.setScrollTop(s.doc.scrollTop),s.display.scrollbars.setScrollLeft(s.doc.scrollLeft)},!0),a("lineNumbers",!1,function(s,u){s.display.gutterSpecs=zl(s.options.gutters,u),oo(s)},!0),a("firstLineNumber",1,oo,!0),a("lineNumberFormatter",function(s){return s},oo,!0),a("showCursorWhenSelecting",!1,Xi,!0),a("resetSelectionOnContextMenu",!0),a("lineWiseCopyCut",!0),a("pasteLinesPerSelection",!0),a("selectionsMayTouch",!1),a("readOnly",!1,function(s,u){u=="nocursor"&&(ei(s),s.display.input.blur()),s.display.input.readOnlyChanged(u)}),a("screenReaderLabel",null,function(s,u){u=u===""?null:u,s.display.input.screenReaderLabelChanged(u)}),a("disableInput",!1,function(s,u){u||s.display.input.reset()},!0),a("dragDrop",!0,e1),a("allowDropFileTypes",null),a("cursorBlinkRate",530),a("cursorScrollMargin",0),a("cursorHeight",1,Xi,!0),a("singleCursorHeightPerLine",!0,Xi,!0),a("workTime",100),a("workDelay",100),a("flattenSpans",!0,so,!0),a("addModeClass",!1,so,!0),a("pollInterval",100),a("undoDepth",200,function(s,u){return s.doc.history.undoDepth=u}),a("historyEventDelay",1250),a("viewportMargin",10,function(s){return s.refresh()},!0),a("maxHighlightLength",1e4,so,!0),a("moveInputWithCursor",!0,function(s,u){u||s.display.input.resetPosition()}),a("tabindex",null,function(s,u){return s.display.input.getField().tabIndex=u||""}),a("autofocus",null),a("direction","ltr",function(s,u){return s.doc.setDirection(u)},!0),a("phrases",null)}function e1(t,r,a){var s=a&&a!=ci;if(!r!=!s){var u=t.display.dragFunctions,p=r?ye:wt;p(t.display.scroller,"dragstart",u.start),p(t.display.scroller,"dragenter",u.enter),p(t.display.scroller,"dragover",u.over),p(t.display.scroller,"dragleave",u.leave),p(t.display.scroller,"drop",u.drop)}}function t1(t){t.options.lineWrapping?(Pe(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(ne(t.display.wrapper,"CodeMirror-wrap"),ml(t)),El(t),Ft(t),Ji(t),setTimeout(function(){return ni(t)},100)}function Ge(t,r){var a=this;if(!(this instanceof Ge))return new Ge(t,r);this.options=r=r?V(r):{},V(ih,r,!1);var s=r.value;typeof s=="string"?s=new Nt(s,r.mode,null,r.lineSeparator,r.direction):r.mode&&(s.modeOption=r.mode),this.doc=s;var u=new Ge.inputStyles[r.inputStyle](this),p=this.display=new hC(t,s,u,r);p.wrapper.CodeMirror=this,rh(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),sp(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new re,keySeq:null,specialChars:null},r.autofocus&&!b&&p.input.focus(),f&&d<11&&setTimeout(function(){return a.display.input.reset(!0)},20),n1(this),OC(),wr(this),this.curOp.forceUpdate=!0,mp(this,s),r.autofocus&&!b||this.hasFocus()?setTimeout(function(){a.hasFocus()&&!a.state.focused&&Fl(a)},20):ei(this);for(var h in Ws)Ws.hasOwnProperty(h)&&Ws[h](this,r[h],ci);up(this),r.finishInit&&r.finishInit(this);for(var v=0;v<Zl.length;++v)Zl[v](this);br(this),g&&r.lineWrapping&&getComputedStyle(p.lineDiv).textRendering=="optimizelegibility"&&(p.lineDiv.style.textRendering="auto")}Ge.defaults=ih,Ge.optionHandlers=Ws;function n1(t){var r=t.display;ye(r.scroller,"mousedown",dt(t,Xp)),f&&d<11?ye(r.scroller,"dblclick",dt(t,function(w){if(!Ke(t,w)){var x=gr(t,w);if(!(!x||Kl(t,w)||Nn(t.display,w))){bt(w);var O=t.findWordAt(x);Ps(t.doc,O.anchor,O.head)}}})):ye(r.scroller,"dblclick",function(w){return Ke(t,w)||bt(w)}),ye(r.scroller,"contextmenu",function(w){return nh(t,w)}),ye(r.input.getField(),"contextmenu",function(w){r.scroller.contains(w.target)||nh(t,w)});var a,s={end:0};function u(){r.activeTouch&&(a=setTimeout(function(){return r.activeTouch=null},1e3),s=r.activeTouch,s.end=+new Date)}function p(w){if(w.touches.length!=1)return!1;var x=w.touches[0];return x.radiusX<=1&&x.radiusY<=1}function h(w,x){if(x.left==null)return!0;var O=x.left-w.left,j=x.top-w.top;return O*O+j*j>20*20}ye(r.scroller,"touchstart",function(w){if(!Ke(t,w)&&!p(w)&&!Kl(t,w)){r.input.ensurePolled(),clearTimeout(a);var x=+new Date;r.activeTouch={start:x,moved:!1,prev:x-s.end<=300?s:null},w.touches.length==1&&(r.activeTouch.left=w.touches[0].pageX,r.activeTouch.top=w.touches[0].pageY)}}),ye(r.scroller,"touchmove",function(){r.activeTouch&&(r.activeTouch.moved=!0)}),ye(r.scroller,"touchend",function(w){var x=r.activeTouch;if(x&&!Nn(r,w)&&x.left!=null&&!x.moved&&new Date-x.start<300){var O=t.coordsChar(r.activeTouch,"page"),j;!x.prev||h(x,x.prev)?j=new Be(O,O):!x.prev.prev||h(x,x.prev.prev)?j=t.findWordAt(O):j=new Be(Y(O.line,0),ke(t.doc,Y(O.line+1,0))),t.setSelection(j.anchor,j.head),t.focus(),bt(w)}u()}),ye(r.scroller,"touchcancel",u),ye(r.scroller,"scroll",function(){r.scroller.clientHeight&&(to(t,r.scroller.scrollTop),yr(t,r.scroller.scrollLeft,!0),Qe(t,"scroll",t))}),ye(r.scroller,"mousewheel",function(w){return dp(t,w)}),ye(r.scroller,"DOMMouseScroll",function(w){return dp(t,w)}),ye(r.wrapper,"scroll",function(){return r.wrapper.scrollTop=r.wrapper.scrollLeft=0}),r.dragFunctions={enter:function(w){Ke(t,w)||qn(w)},over:function(w){Ke(t,w)||(NC(t,w),qn(w))},start:function(w){return FC(t,w)},drop:dt(t,TC),leave:function(w){Ke(t,w)||Hp(t)}};var v=r.input.getField();ye(v,"keyup",function(w){return Zp.call(t,w)}),ye(v,"keydown",dt(t,Kp)),ye(v,"keypress",dt(t,Jp)),ye(v,"focus",function(w){return Fl(t,w)}),ye(v,"blur",function(w){return ei(t,w)})}var Zl=[];Ge.defineInitHook=function(t){return Zl.push(t)};function bo(t,r,a,s){var u=t.doc,p;a==null&&(a="add"),a=="smart"&&(u.mode.indent?p=Vi(t,r).state:a="prev");var h=t.options.tabSize,v=ge(u,r),w=le(v.text,null,h);v.stateAfter&&(v.stateAfter=null);var x=v.text.match(/^\s*/)[0],O;if(!s&&!/\S/.test(v.text))O=0,a="not";else if(a=="smart"&&(O=u.mode.indent(p,v.text.slice(x.length),v.text),O==Ce||O>150)){if(!s)return;a="prev"}a=="prev"?r>u.first?O=le(ge(u,r-1).text,null,h):O=0:a=="add"?O=w+t.options.indentUnit:a=="subtract"?O=w-t.options.indentUnit:typeof a=="number"&&(O=w+a),O=Math.max(0,O);var j="",_=0;if(t.options.indentWithTabs)for(var H=Math.floor(O/h);H;--H)_+=h,j+=" ";if(_<O&&(j+=at(O-_)),j!=x)return si(u,j,Y(r,0),Y(r,x.length),"+input"),v.stateAfter=null,!0;for(var Q=0;Q<u.sel.ranges.length;Q++){var te=u.sel.ranges[Q];if(te.head.line==r&&te.head.ch<x.length){var se=Y(r,x.length);$l(u,Q,new Be(se,se));break}}}var fn=null;function $s(t){fn=t}function Jl(t,r,a,s,u){var p=t.doc;t.display.shift=!1,s||(s=p.sel);var h=+new Date-200,v=u=="paste"||t.state.pasteIncoming>h,w=Jt(r),x=null;if(v&&s.ranges.length>1)if(fn&&fn.text.join(`
|
|
123
|
+
`,"start")},toggleOverwrite:function(t){return t.toggleOverwrite()}};function Gp(t,r){var a=ge(t.doc,r),s=ln(a);return s!=a&&(r=D(s)),Vl(!0,t,s,r,1)}function RC(t,r){var a=ge(t.doc,r),s=kk(a);return s!=a&&(r=D(s)),Vl(!0,t,a,r,-1)}function Vp(t,r){var a=Gp(t,r.line),s=ge(t.doc,a.line),u=Le(s,t.doc.direction);if(!u||u[0].level==0){var p=Math.max(a.ch,s.text.search(/\S/)),h=r.line==a.line&&r.ch<=p&&r.ch;return Y(a.line,h?0:p,a.sticky)}return a}function _s(t,r,a){if(typeof r=="string"&&(r=mo[r],!r))return!1;t.display.input.ensurePolled();var s=t.display.shift,u=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),a&&(t.display.shift=!1),u=r(t)!=Ce}finally{t.display.shift=s,t.state.suppressEdits=!1}return u}function HC(t,r,a){for(var s=0;s<t.state.keyMaps.length;s++){var u=li(r,t.state.keyMaps[s],a,t);if(u)return u}return t.options.extraKeys&&li(r,t.options.extraKeys,a,t)||li(r,t.options.keyMap,a,t)}var qC=new re;function yo(t,r,a,s){var u=t.state.keySeq;if(u){if(Wp(r))return"handled";if(/\'$/.test(r)?t.state.keySeq=null:qC.set(50,function(){t.state.keySeq==u&&(t.state.keySeq=null,t.display.input.reset())}),Yp(t,u+" "+r,a,s))return!0}return Yp(t,r,a,s)}function Yp(t,r,a,s){var u=HC(t,r,s);return u=="multi"&&(t.state.keySeq=r),u=="handled"&&ft(t,"keyHandled",t,r,a),(u=="handled"||u=="multi")&&(bt(a),Ll(t)),!!u}function Qp(t,r){var a=Up(r,!0);return a?r.shiftKey&&!t.state.keySeq?yo(t,"Shift-"+a,r,function(s){return _s(t,s,!0)})||yo(t,a,r,function(s){if(typeof s=="string"?/^go[A-Z]/.test(s):s.motion)return _s(t,s)}):yo(t,a,r,function(s){return _s(t,s)}):!1}function _C(t,r,a){return yo(t,"'"+a+"'",r,function(s){return _s(t,s,!0)})}var Yl=null;function Kp(t){var r=this;if(!(t.target&&t.target!=r.display.input.getField())&&(r.curOp.focus=De(yt(r)),!Ke(r,t))){f&&d<11&&t.keyCode==27&&(t.returnValue=!1);var a=t.keyCode;r.display.shift=a==16||t.shiftKey;var s=Qp(r,t);C&&(Yl=s?a:null,!s&&a==88&&!ms&&(L?t.metaKey:t.ctrlKey)&&r.replaceSelection("",null,"cut")),i&&!L&&!s&&a==46&&t.shiftKey&&!t.ctrlKey&&document.execCommand&&document.execCommand("cut"),a==18&&!/\bCodeMirror-crosshair\b/.test(r.display.lineDiv.className)&&WC(r)}}function WC(t){var r=t.display.lineDiv;Pe(r,"CodeMirror-crosshair");function a(s){(s.keyCode==18||!s.altKey)&&(ne(r,"CodeMirror-crosshair"),wt(document,"keyup",a),wt(document,"mouseover",a))}ye(document,"keyup",a),ye(document,"mouseover",a)}function Zp(t){t.keyCode==16&&(this.doc.sel.shift=!1),Ke(this,t)}function Jp(t){var r=this;if(!(t.target&&t.target!=r.display.input.getField())&&!(Nn(r.display,t)||Ke(r,t)||t.ctrlKey&&!t.altKey||L&&t.metaKey)){var a=t.keyCode,s=t.charCode;if(C&&a==Yl){Yl=null,bt(t);return}if(!(C&&(!t.which||t.which<10)&&Qp(r,t))){var u=String.fromCharCode(s??a);u!="\b"&&(_C(r,t,u)||r.display.input.onKeyPress(t))}}}var $C=400,Ql=function(t,r,a){this.time=t,this.pos=r,this.button=a};Ql.prototype.compare=function(t,r,a){return this.time+$C>t&&fe(r,this.pos)==0&&a==this.button};var vo,wo;function UC(t,r){var a=+new Date;return wo&&wo.compare(a,t,r)?(vo=wo=null,"triple"):vo&&vo.compare(a,t,r)?(wo=new Ql(a,t,r),vo=null,"double"):(vo=new Ql(a,t,r),wo=null,"single")}function Xp(t){var r=this,a=r.display;if(!(Ke(r,t)||a.activeTouch&&a.input.supportsTouch())){if(a.input.ensurePolled(),a.shift=t.shiftKey,Nn(a,t)){g||(a.scroller.draggable=!1,setTimeout(function(){return a.scroller.draggable=!0},100));return}if(!Kl(r,t)){var s=gr(r,t),u=rn(t),p=s?UC(s,u):"single";xe(r).focus(),u==1&&r.state.selectingText&&r.state.selectingText(t),!(s&&GC(r,u,s,p,t))&&(u==1?s?YC(r,s,p,t):Wi(t)==a.scroller&&bt(t):u==2?(s&&Ps(r.doc,s),setTimeout(function(){return a.input.focus()},20)):u==3&&(U?r.display.input.onContextMenu(t):Tl(r)))}}}function GC(t,r,a,s,u){var p="Click";return s=="double"?p="Double"+p:s=="triple"&&(p="Triple"+p),p=(r==1?"Left":r==2?"Middle":"Right")+p,yo(t,$p(p,u),u,function(h){if(typeof h=="string"&&(h=mo[h]),!h)return!1;var v=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),v=h(t,a)!=Ce}finally{t.state.suppressEdits=!1}return v})}function VC(t,r,a){var s=t.getOption("configureMouse"),u=s?s(t,r,a):{};if(u.unit==null){var p=T?a.shiftKey&&a.metaKey:a.altKey;u.unit=p?"rectangle":r=="single"?"char":r=="double"?"word":"line"}return(u.extend==null||t.doc.extend)&&(u.extend=t.doc.extend||a.shiftKey),u.addNew==null&&(u.addNew=L?a.metaKey:a.ctrlKey),u.moveOnDrag==null&&(u.moveOnDrag=!(L?a.altKey:a.ctrlKey)),u}function YC(t,r,a,s){f?setTimeout(we(ep,t),0):t.curOp.focus=De(yt(t));var u=VC(t,a,s),p=t.doc.sel,h;t.options.dragDrop&&ll&&!t.isReadOnly()&&a=="single"&&(h=p.contains(r))>-1&&(fe((h=p.ranges[h]).from(),r)<0||r.xRel>0)&&(fe(h.to(),r)>0||r.xRel<0)?QC(t,s,r,u):KC(t,s,r,u)}function QC(t,r,a,s){var u=t.display,p=!1,h=dt(t,function(x){g&&(u.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Tl(t)),wt(u.wrapper.ownerDocument,"mouseup",h),wt(u.wrapper.ownerDocument,"mousemove",v),wt(u.scroller,"dragstart",w),wt(u.scroller,"drop",h),p||(bt(x),s.addNew||Ps(t.doc,a,null,null,s.extend),g&&!M||f&&d==9?setTimeout(function(){u.wrapper.ownerDocument.body.focus({preventScroll:!0}),u.input.focus()},20):u.input.focus())}),v=function(x){p=p||Math.abs(r.clientX-x.clientX)+Math.abs(r.clientY-x.clientY)>=10},w=function(){return p=!0};g&&(u.scroller.draggable=!0),t.state.draggingText=h,h.copy=!s.moveOnDrag,ye(u.wrapper.ownerDocument,"mouseup",h),ye(u.wrapper.ownerDocument,"mousemove",v),ye(u.scroller,"dragstart",w),ye(u.scroller,"drop",h),t.state.delayingBlurEvent=!0,setTimeout(function(){return u.input.focus()},20),u.scroller.dragDrop&&u.scroller.dragDrop()}function eh(t,r,a){if(a=="char")return new Be(r,r);if(a=="word")return t.findWordAt(r);if(a=="line")return new Be(Y(r.line,0),ke(t.doc,Y(r.line+1,0)));var s=a(t,r);return new Be(s.from,s.to)}function KC(t,r,a,s){f&&Tl(t);var u=t.display,p=t.doc;bt(r);var h,v,w=p.sel,x=w.ranges;if(s.addNew&&!s.extend?(v=p.sel.contains(a),v>-1?h=x[v]:h=new Be(a,a)):(h=p.sel.primary(),v=p.sel.primIndex),s.unit=="rectangle")s.addNew||(h=new Be(a,a)),a=gr(t,r,!0,!0),v=-1;else{var O=eh(t,a,s.unit);s.extend?h=Wl(h,O.anchor,O.head,s.extend):h=O}s.addNew?v==-1?(v=x.length,xt(p,cn(t,x.concat([h]),v),{scroll:!1,origin:"*mouse"})):x.length>1&&x[v].empty()&&s.unit=="char"&&!s.extend?(xt(p,cn(t,x.slice(0,v).concat(x.slice(v+1)),0),{scroll:!1,origin:"*mouse"}),w=p.sel):$l(p,v,h,$e):(v=0,xt(p,new Gt([h],0),$e),w=p.sel);var j=a;function _(ce){if(fe(j,ce)!=0)if(j=ce,s.unit=="rectangle"){for(var he=[],ve=t.options.tabSize,me=le(ge(p,a.line).text,a.ch,ve),Se=le(ge(p,ce.line).text,ce.ch,ve),qe=Math.min(me,Se),ht=Math.max(me,Se),Ve=Math.min(a.line,ce.line),zt=Math.min(t.lastLine(),Math.max(a.line,ce.line));Ve<=zt;Ve++){var Ot=ge(p,Ve).text,it=Ue(Ot,qe,ve);qe==ht?he.push(new Be(Y(Ve,it),Y(Ve,it))):Ot.length>it&&he.push(new Be(Y(Ve,it),Y(Ve,Ue(Ot,ht,ve))))}he.length||he.push(new Be(a,a)),xt(p,cn(t,w.ranges.slice(0,v).concat(he),v),{origin:"*mouse",scroll:!1}),t.scrollIntoView(ce)}else{var It=h,mt=eh(t,ce,s.unit),lt=It.anchor,ot;fe(mt.anchor,lt)>0?(ot=mt.head,lt=Yr(It.from(),mt.anchor)):(ot=mt.anchor,lt=Tt(It.to(),mt.head));var Je=w.ranges.slice(0);Je[v]=ZC(t,new Be(ke(p,lt),ot)),xt(p,cn(t,Je,v),$e)}}var H=u.wrapper.getBoundingClientRect(),Q=0;function te(ce){var he=++Q,ve=gr(t,ce,!0,s.unit=="rectangle");if(ve)if(fe(ve,j)!=0){t.curOp.focus=De(yt(t)),_(ve);var me=Ts(u,p);(ve.line>=me.to||ve.line<me.from)&&setTimeout(dt(t,function(){Q==he&&te(ce)}),150)}else{var Se=ce.clientY<H.top?-20:ce.clientY>H.bottom?20:0;Se&&setTimeout(dt(t,function(){Q==he&&(u.scroller.scrollTop+=Se,te(ce))}),50)}}function se(ce){t.state.selectingText=!1,Q=1/0,ce&&(bt(ce),u.input.focus()),wt(u.wrapper.ownerDocument,"mousemove",ue),wt(u.wrapper.ownerDocument,"mouseup",de),p.history.lastSelOrigin=null}var ue=dt(t,function(ce){ce.buttons===0||!rn(ce)?se(ce):te(ce)}),de=dt(t,se);t.state.selectingText=de,ye(u.wrapper.ownerDocument,"mousemove",ue),ye(u.wrapper.ownerDocument,"mouseup",de)}function ZC(t,r){var a=r.anchor,s=r.head,u=ge(t.doc,a.line);if(fe(a,s)==0&&a.sticky==s.sticky)return r;var p=Le(u);if(!p)return r;var h=Hn(p,a.ch,a.sticky),v=p[h];if(v.from!=a.ch&&v.to!=a.ch)return r;var w=h+(v.from==a.ch==(v.level!=1)?0:1);if(w==0||w==p.length)return r;var x;if(s.line!=a.line)x=(s.line-a.line)*(t.doc.direction=="ltr"?1:-1)>0;else{var O=Hn(p,s.ch,s.sticky),j=O-h||(s.ch-a.ch)*(v.level==1?-1:1);O==w-1||O==w?x=j<0:x=j>0}var _=p[w+(x?-1:0)],H=x==(_.level==1),Q=H?_.from:_.to,te=H?"after":"before";return a.ch==Q&&a.sticky==te?r:new Be(new Y(a.line,Q,te),s)}function th(t,r,a,s){var u,p;if(r.touches)u=r.touches[0].clientX,p=r.touches[0].clientY;else try{u=r.clientX,p=r.clientY}catch{return!1}if(u>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;s&&bt(r);var h=t.display,v=h.lineDiv.getBoundingClientRect();if(p>v.bottom||!Pt(t,a))return Lt(r);p-=v.top-h.viewOffset;for(var w=0;w<t.display.gutterSpecs.length;++w){var x=h.gutters.childNodes[w];if(x&&x.getBoundingClientRect().right>=u){var O=P(t.doc,p),j=t.display.gutterSpecs[w];return Qe(t,a,t,O,j.className,r),Lt(r)}}}function Kl(t,r){return th(t,r,"gutterClick",!0)}function nh(t,r){Nn(t.display,r)||JC(t,r)||Ke(t,r,"contextmenu")||U||t.display.input.onContextMenu(r)}function JC(t,r){return Pt(t,"gutterContextMenu")?th(t,r,"gutterContextMenu",!1):!1}function rh(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ji(t)}var ci={toString:function(){return"CodeMirror.Init"}},ih={},Ws={};function XC(t){var r=t.optionHandlers;function a(s,u,p,h){t.defaults[s]=u,p&&(r[s]=h?function(v,w,x){x!=ci&&p(v,w,x)}:p)}t.defineOption=a,t.Init=ci,a("value","",function(s,u){return s.setValue(u)},!0),a("mode",null,function(s,u){s.doc.modeOption=u,Hl(s)},!0),a("indentUnit",2,Hl,!0),a("indentWithTabs",!1),a("smartIndent",!0),a("tabSize",4,function(s){so(s),Ji(s),Ft(s)},!0),a("lineSeparator",null,function(s,u){if(s.doc.lineSep=u,!!u){var p=[],h=s.doc.first;s.doc.iter(function(w){for(var x=0;;){var O=w.text.indexOf(u,x);if(O==-1)break;x=O+u.length,p.push(Y(h,O))}h++});for(var v=p.length-1;v>=0;v--)si(s.doc,u,p[v],Y(p[v].line,p[v].ch+u.length))}}),a("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(s,u,p){s.state.specialChars=new RegExp(u.source+(u.test(" ")?"":"| "),"g"),p!=ci&&s.refresh()}),a("specialCharPlaceholder",Mk,function(s){return s.refresh()},!0),a("electricChars",!0),a("inputStyle",b?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),a("spellcheck",!1,function(s,u){return s.getInputField().spellcheck=u},!0),a("autocorrect",!1,function(s,u){return s.getInputField().autocorrect=u},!0),a("autocapitalize",!1,function(s,u){return s.getInputField().autocapitalize=u},!0),a("rtlMoveVisually",!I),a("wholeLineUpdateBefore",!0),a("theme","default",function(s){rh(s),oo(s)},!0),a("keyMap","default",function(s,u,p){var h=qs(u),v=p!=ci&&qs(p);v&&v.detach&&v.detach(s,h),h.attach&&h.attach(s,v||null)}),a("extraKeys",null),a("configureMouse",null),a("lineWrapping",!1,t1,!0),a("gutters",[],function(s,u){s.display.gutterSpecs=zl(u,s.options.lineNumbers),oo(s)},!0),a("fixedGutter",!0,function(s,u){s.display.gutters.style.left=u?Sl(s.display)+"px":"0",s.refresh()},!0),a("coverGutterNextToScrollbar",!1,function(s){return ni(s)},!0),a("scrollbarStyle","native",function(s){sp(s),ni(s),s.display.scrollbars.setScrollTop(s.doc.scrollTop),s.display.scrollbars.setScrollLeft(s.doc.scrollLeft)},!0),a("lineNumbers",!1,function(s,u){s.display.gutterSpecs=zl(s.options.gutters,u),oo(s)},!0),a("firstLineNumber",1,oo,!0),a("lineNumberFormatter",function(s){return s},oo,!0),a("showCursorWhenSelecting",!1,Xi,!0),a("resetSelectionOnContextMenu",!0),a("lineWiseCopyCut",!0),a("pasteLinesPerSelection",!0),a("selectionsMayTouch",!1),a("readOnly",!1,function(s,u){u=="nocursor"&&(ei(s),s.display.input.blur()),s.display.input.readOnlyChanged(u)}),a("screenReaderLabel",null,function(s,u){u=u===""?null:u,s.display.input.screenReaderLabelChanged(u)}),a("disableInput",!1,function(s,u){u||s.display.input.reset()},!0),a("dragDrop",!0,e1),a("allowDropFileTypes",null),a("cursorBlinkRate",530),a("cursorScrollMargin",0),a("cursorHeight",1,Xi,!0),a("singleCursorHeightPerLine",!0,Xi,!0),a("workTime",100),a("workDelay",100),a("flattenSpans",!0,so,!0),a("addModeClass",!1,so,!0),a("pollInterval",100),a("undoDepth",200,function(s,u){return s.doc.history.undoDepth=u}),a("historyEventDelay",1250),a("viewportMargin",10,function(s){return s.refresh()},!0),a("maxHighlightLength",1e4,so,!0),a("moveInputWithCursor",!0,function(s,u){u||s.display.input.resetPosition()}),a("tabindex",null,function(s,u){return s.display.input.getField().tabIndex=u||""}),a("autofocus",null),a("direction","ltr",function(s,u){return s.doc.setDirection(u)},!0),a("phrases",null)}function e1(t,r,a){var s=a&&a!=ci;if(!r!=!s){var u=t.display.dragFunctions,p=r?ye:wt;p(t.display.scroller,"dragstart",u.start),p(t.display.scroller,"dragenter",u.enter),p(t.display.scroller,"dragover",u.over),p(t.display.scroller,"dragleave",u.leave),p(t.display.scroller,"drop",u.drop)}}function t1(t){t.options.lineWrapping?(Pe(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(ne(t.display.wrapper,"CodeMirror-wrap"),ml(t)),El(t),Ft(t),Ji(t),setTimeout(function(){return ni(t)},100)}function Ge(t,r){var a=this;if(!(this instanceof Ge))return new Ge(t,r);this.options=r=r?V(r):{},V(ih,r,!1);var s=r.value;typeof s=="string"?s=new Nt(s,r.mode,null,r.lineSeparator,r.direction):r.mode&&(s.modeOption=r.mode),this.doc=s;var u=new Ge.inputStyles[r.inputStyle](this),p=this.display=new hC(t,s,u,r);p.wrapper.CodeMirror=this,rh(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),sp(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new re,keySeq:null,specialChars:null},r.autofocus&&!b&&p.input.focus(),f&&d<11&&setTimeout(function(){return a.display.input.reset(!0)},20),n1(this),OC(),wr(this),this.curOp.forceUpdate=!0,mp(this,s),r.autofocus&&!b||this.hasFocus()?setTimeout(function(){a.hasFocus()&&!a.state.focused&&Fl(a)},20):ei(this);for(var h in Ws)Ws.hasOwnProperty(h)&&Ws[h](this,r[h],ci);up(this),r.finishInit&&r.finishInit(this);for(var v=0;v<Zl.length;++v)Zl[v](this);br(this),g&&r.lineWrapping&&getComputedStyle(p.lineDiv).textRendering=="optimizelegibility"&&(p.lineDiv.style.textRendering="auto")}Ge.defaults=ih,Ge.optionHandlers=Ws;function n1(t){var r=t.display;ye(r.scroller,"mousedown",dt(t,Xp)),f&&d<11?ye(r.scroller,"dblclick",dt(t,function(w){if(!Ke(t,w)){var x=gr(t,w);if(!(!x||Kl(t,w)||Nn(t.display,w))){bt(w);var O=t.findWordAt(x);Ps(t.doc,O.anchor,O.head)}}})):ye(r.scroller,"dblclick",function(w){return Ke(t,w)||bt(w)}),ye(r.scroller,"contextmenu",function(w){return nh(t,w)}),ye(r.input.getField(),"contextmenu",function(w){r.scroller.contains(w.target)||nh(t,w)});var a,s={end:0};function u(){r.activeTouch&&(a=setTimeout(function(){return r.activeTouch=null},1e3),s=r.activeTouch,s.end=+new Date)}function p(w){if(w.touches.length!=1)return!1;var x=w.touches[0];return x.radiusX<=1&&x.radiusY<=1}function h(w,x){if(x.left==null)return!0;var O=x.left-w.left,j=x.top-w.top;return O*O+j*j>400}ye(r.scroller,"touchstart",function(w){if(!Ke(t,w)&&!p(w)&&!Kl(t,w)){r.input.ensurePolled(),clearTimeout(a);var x=+new Date;r.activeTouch={start:x,moved:!1,prev:x-s.end<=300?s:null},w.touches.length==1&&(r.activeTouch.left=w.touches[0].pageX,r.activeTouch.top=w.touches[0].pageY)}}),ye(r.scroller,"touchmove",function(){r.activeTouch&&(r.activeTouch.moved=!0)}),ye(r.scroller,"touchend",function(w){var x=r.activeTouch;if(x&&!Nn(r,w)&&x.left!=null&&!x.moved&&new Date-x.start<300){var O=t.coordsChar(r.activeTouch,"page"),j;!x.prev||h(x,x.prev)?j=new Be(O,O):!x.prev.prev||h(x,x.prev.prev)?j=t.findWordAt(O):j=new Be(Y(O.line,0),ke(t.doc,Y(O.line+1,0))),t.setSelection(j.anchor,j.head),t.focus(),bt(w)}u()}),ye(r.scroller,"touchcancel",u),ye(r.scroller,"scroll",function(){r.scroller.clientHeight&&(to(t,r.scroller.scrollTop),yr(t,r.scroller.scrollLeft,!0),Qe(t,"scroll",t))}),ye(r.scroller,"mousewheel",function(w){return dp(t,w)}),ye(r.scroller,"DOMMouseScroll",function(w){return dp(t,w)}),ye(r.wrapper,"scroll",function(){return r.wrapper.scrollTop=r.wrapper.scrollLeft=0}),r.dragFunctions={enter:function(w){Ke(t,w)||qn(w)},over:function(w){Ke(t,w)||(NC(t,w),qn(w))},start:function(w){return FC(t,w)},drop:dt(t,TC),leave:function(w){Ke(t,w)||Hp(t)}};var v=r.input.getField();ye(v,"keyup",function(w){return Zp.call(t,w)}),ye(v,"keydown",dt(t,Kp)),ye(v,"keypress",dt(t,Jp)),ye(v,"focus",function(w){return Fl(t,w)}),ye(v,"blur",function(w){return ei(t,w)})}var Zl=[];Ge.defineInitHook=function(t){return Zl.push(t)};function bo(t,r,a,s){var u=t.doc,p;a==null&&(a="add"),a=="smart"&&(u.mode.indent?p=Vi(t,r).state:a="prev");var h=t.options.tabSize,v=ge(u,r),w=le(v.text,null,h);v.stateAfter&&(v.stateAfter=null);var x=v.text.match(/^\s*/)[0],O;if(!s&&!/\S/.test(v.text))O=0,a="not";else if(a=="smart"&&(O=u.mode.indent(p,v.text.slice(x.length),v.text),O==Ce||O>150)){if(!s)return;a="prev"}a=="prev"?r>u.first?O=le(ge(u,r-1).text,null,h):O=0:a=="add"?O=w+t.options.indentUnit:a=="subtract"?O=w-t.options.indentUnit:typeof a=="number"&&(O=w+a),O=Math.max(0,O);var j="",_=0;if(t.options.indentWithTabs)for(var H=Math.floor(O/h);H;--H)_+=h,j+=" ";if(_<O&&(j+=at(O-_)),j!=x)return si(u,j,Y(r,0),Y(r,x.length),"+input"),v.stateAfter=null,!0;for(var Q=0;Q<u.sel.ranges.length;Q++){var te=u.sel.ranges[Q];if(te.head.line==r&&te.head.ch<x.length){var se=Y(r,x.length);$l(u,Q,new Be(se,se));break}}}var fn=null;function $s(t){fn=t}function Jl(t,r,a,s,u){var p=t.doc;t.display.shift=!1,s||(s=p.sel);var h=+new Date-200,v=u=="paste"||t.state.pasteIncoming>h,w=Jt(r),x=null;if(v&&s.ranges.length>1)if(fn&&fn.text.join(`
|
|
124
124
|
`)==r){if(s.ranges.length%fn.text.length==0){x=[];for(var O=0;O<fn.text.length;O++)x.push(p.splitLines(fn.text[O]))}}else w.length==s.ranges.length&&t.options.pasteLinesPerSelection&&(x=He(w,function(ue){return[ue]}));for(var j=t.curOp.updateInput,_=s.ranges.length-1;_>=0;_--){var H=s.ranges[_],Q=H.from(),te=H.to();H.empty()&&(a&&a>0?Q=Y(Q.line,Q.ch-a):t.state.overwrite&&!v?te=Y(te.line,Math.min(ge(p,te.line).text.length,te.ch+Te(w).length)):v&&fn&&fn.lineWise&&fn.text.join(`
|
|
125
125
|
`)==w.join(`
|
|
126
126
|
`)&&(Q=te=Y(Q.line,0)));var se={from:Q,to:te,text:x?x[_%x.length]:w,origin:u||(v?"paste":t.state.cutIncoming>h?"cut":"+input")};oi(t.doc,se),ft(t,"inputRead",t,se)}r&&!v&&sh(t,r),ti(t),t.curOp.updateInput<2&&(t.curOp.updateInput=j),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function oh(t,r){var a=t.clipboardData&&t.clipboardData.getData("Text");if(a)return t.preventDefault(),!r.isReadOnly()&&!r.options.disableInput&&r.hasFocus()&&jt(r,function(){return Jl(r,a,0,null,"paste")}),!0}function sh(t,r){if(!(!t.options.electricChars||!t.options.smartIndent))for(var a=t.doc.sel,s=a.ranges.length-1;s>=0;s--){var u=a.ranges[s];if(!(u.head.ch>100||s&&a.ranges[s-1].head.line==u.head.line)){var p=t.getModeAt(u.head),h=!1;if(p.electricChars){for(var v=0;v<p.electricChars.length;v++)if(r.indexOf(p.electricChars.charAt(v))>-1){h=bo(t,u.head.line,"smart");break}}else p.electricInput&&p.electricInput.test(ge(t.doc,u.head.line).text.slice(0,u.head.ch))&&(h=bo(t,u.head.line,"smart"));h&&ft(t,"electricInput",t,u.head.line)}}}function ah(t){for(var r=[],a=[],s=0;s<t.doc.sel.ranges.length;s++){var u=t.doc.sel.ranges[s].head.line,p={anchor:Y(u,0),head:Y(u+1,0)};a.push(p),r.push(t.getRange(p.anchor,p.head))}return{text:r,ranges:a}}function Xl(t,r,a,s){t.setAttribute("autocorrect",a?"on":"off"),t.setAttribute("autocapitalize",s?"on":"off"),t.setAttribute("spellcheck",!!r)}function lh(){var t=S("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),r=S("div",[t],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?t.style.width="1000px":t.setAttribute("wrap","off"),N&&(t.style.border="1px solid black"),r}function r1(t){var r=t.optionHandlers,a=t.helpers={};t.prototype={constructor:t,focus:function(){xe(this).focus(),this.display.input.focus()},setOption:function(s,u){var p=this.options,h=p[s];p[s]==u&&s!="mode"||(p[s]=u,r.hasOwnProperty(s)&&dt(this,r[s])(this,u,h),Qe(this,"optionChange",this,s))},getOption:function(s){return this.options[s]},getDoc:function(){return this.doc},addKeyMap:function(s,u){this.state.keyMaps[u?"push":"unshift"](qs(s))},removeKeyMap:function(s){for(var u=this.state.keyMaps,p=0;p<u.length;++p)if(u[p]==s||u[p].name==s)return u.splice(p,1),!0},addOverlay:At(function(s,u){var p=s.token?s:t.getMode(this.options,s);if(p.startState)throw new Error("Overlays may not be stateful.");G(this.state.overlays,{mode:p,modeSpec:s,opaque:u&&u.opaque,priority:u&&u.priority||0},function(h){return h.priority}),this.state.modeGen++,Ft(this)}),removeOverlay:At(function(s){for(var u=this.state.overlays,p=0;p<u.length;++p){var h=u[p].modeSpec;if(h==s||typeof s=="string"&&h.name==s){u.splice(p,1),this.state.modeGen++,Ft(this);return}}}),indentLine:At(function(s,u,p){typeof u!="string"&&typeof u!="number"&&(u==null?u=this.options.smartIndent?"smart":"prev":u=u?"add":"subtract"),J(this.doc,s)&&bo(this,s,u,p)}),indentSelection:At(function(s){for(var u=this.doc.sel.ranges,p=-1,h=0;h<u.length;h++){var v=u[h];if(v.empty())v.head.line>p&&(bo(this,v.head.line,s,!0),p=v.head.line,h==this.doc.sel.primIndex&&ti(this));else{var w=v.from(),x=v.to(),O=Math.max(p,w.line);p=Math.min(this.lastLine(),x.line-(x.ch?0:1))+1;for(var j=O;j<p;++j)bo(this,j,s);var _=this.doc.sel.ranges;w.ch==0&&u.length==_.length&&_[h].from().ch>0&&$l(this.doc,h,new Be(w,_[h].to()),be)}}}),getTokenAt:function(s,u){return vd(this,s,u)},getLineTokens:function(s,u){return vd(this,Y(s),u,!0)},getTokenTypeAt:function(s){s=ke(this.doc,s);var u=gd(this,ge(this.doc,s.line)),p=0,h=(u.length-1)/2,v=s.ch,w;if(v==0)w=u[2];else for(;;){var x=p+h>>1;if((x?u[x*2-1]:0)>=v)h=x;else if(u[x*2+1]<v)p=x+1;else{w=u[x*2+2];break}}var O=w?w.indexOf("overlay "):-1;return O<0?w:O==0?null:w.slice(0,O-1)},getModeAt:function(s){var u=this.doc.mode;return u.innerMode?t.innerMode(u,this.getTokenAt(s).state).mode:u},getHelper:function(s,u){return this.getHelpers(s,u)[0]},getHelpers:function(s,u){var p=[];if(!a.hasOwnProperty(u))return p;var h=a[u],v=this.getModeAt(s);if(typeof v[u]=="string")h[v[u]]&&p.push(h[v[u]]);else if(v[u])for(var w=0;w<v[u].length;w++){var x=h[v[u][w]];x&&p.push(x)}else v.helperType&&h[v.helperType]?p.push(h[v.helperType]):h[v.name]&&p.push(h[v.name]);for(var O=0;O<h._global.length;O++){var j=h._global[O];j.pred(v,this)&&ie(p,j.val)==-1&&p.push(j.val)}return p},getStateAfter:function(s,u){var p=this.doc;return s=dd(p,s??p.first+p.size-1),Vi(this,s+1,u).state},cursorCoords:function(s,u){var p,h=this.doc.sel.primary();return s==null?p=h.head:typeof s=="object"?p=ke(this.doc,s):p=s?h.from():h.to(),un(this,p,u||"page")},charCoords:function(s,u){return Ss(this,ke(this.doc,s),u||"page")},coordsChar:function(s,u){return s=Vd(this,s,u||"page"),Cl(this,s.left,s.top)},lineAtHeight:function(s,u){return s=Vd(this,{top:s,left:0},u||"page").top,P(this.doc,s+this.display.viewOffset)},heightAtLine:function(s,u,p){var h=!1,v;if(typeof s=="number"){var w=this.doc.first+this.doc.size-1;s<this.doc.first?s=this.doc.first:s>w&&(s=w,h=!0),v=ge(this.doc,s)}else v=s;return As(this,v,{top:0,left:0},u||"page",p||h).top+(h?this.doc.height-Fn(v):0)},defaultTextHeight:function(){return Jr(this.display)},defaultCharWidth:function(){return Xr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(s,u,p,h,v){var w=this.display;s=un(this,ke(this.doc,s));var x=s.bottom,O=s.left;if(u.style.position="absolute",u.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(u),w.sizer.appendChild(u),h=="over")x=s.top;else if(h=="above"||h=="near"){var j=Math.max(w.wrapper.clientHeight,this.doc.height),_=Math.max(w.sizer.clientWidth,w.lineSpace.clientWidth);(h=="above"||s.bottom+u.offsetHeight>j)&&s.top>u.offsetHeight?x=s.top-u.offsetHeight:s.bottom+u.offsetHeight<=j&&(x=s.bottom),O+u.offsetWidth>_&&(O=_-u.offsetWidth)}u.style.top=x+"px",u.style.left=u.style.right="",v=="right"?(O=w.sizer.clientWidth-u.offsetWidth,u.style.right="0px"):(v=="left"?O=0:v=="middle"&&(O=(w.sizer.clientWidth-u.offsetWidth)/2),u.style.left=O+"px"),p&&eC(this,{left:O,top:x,right:O+u.offsetWidth,bottom:x+u.offsetHeight})},triggerOnKeyDown:At(Kp),triggerOnKeyPress:At(Jp),triggerOnKeyUp:Zp,triggerOnMouseDown:At(Xp),execCommand:function(s){if(mo.hasOwnProperty(s))return mo[s].call(null,this)},triggerElectric:At(function(s){sh(this,s)}),findPosH:function(s,u,p,h){var v=1;u<0&&(v=-1,u=-u);for(var w=ke(this.doc,s),x=0;x<u&&(w=eu(this.doc,w,v,p,h),!w.hitSide);++x);return w},moveH:At(function(s,u){var p=this;this.extendSelectionsBy(function(h){return p.display.shift||p.doc.extend||h.empty()?eu(p.doc,h.head,s,u,p.options.rtlMoveVisually):s<0?h.from():h.to()},Me)}),deleteH:At(function(s,u){var p=this.doc.sel,h=this.doc;p.somethingSelected()?h.replaceSelection("",null,"+delete"):ui(this,function(v){var w=eu(h,v.head,s,u,!1);return s<0?{from:w,to:v.head}:{from:v.head,to:w}})}),findPosV:function(s,u,p,h){var v=1,w=h;u<0&&(v=-1,u=-u);for(var x=ke(this.doc,s),O=0;O<u;++O){var j=un(this,x,"div");if(w==null?w=j.left:j.left=w,x=uh(this,j,v,p),x.hitSide)break}return x},moveV:At(function(s,u){var p=this,h=this.doc,v=[],w=!this.display.shift&&!h.extend&&h.sel.somethingSelected();if(h.extendSelectionsBy(function(O){if(w)return s<0?O.from():O.to();var j=un(p,O.head,"div");O.goalColumn!=null&&(j.left=O.goalColumn),v.push(j.left);var _=uh(p,j,s,u);return u=="page"&&O==h.sel.primary()&&Ol(p,Ss(p,_,"div").top-j.top),_},Me),v.length)for(var x=0;x<h.sel.ranges.length;x++)h.sel.ranges[x].goalColumn=v[x]}),findWordAt:function(s){var u=this.doc,p=ge(u,s.line).text,h=s.ch,v=s.ch;if(p){var w=this.getHelper(s,"wordChars");(s.sticky=="before"||v==p.length)&&h?--h:++v;for(var x=p.charAt(h),O=Sn(x,w)?function(j){return Sn(j,w)}:/\s/.test(x)?function(j){return/\s/.test(j)}:function(j){return!/\s/.test(j)&&!Sn(j)};h>0&&O(p.charAt(h-1));)--h;for(;v<p.length&&O(p.charAt(v));)++v}return new Be(Y(s.line,h),Y(s.line,v))},toggleOverwrite:function(s){s!=null&&s==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Pe(this.display.cursorDiv,"CodeMirror-overwrite"):ne(this.display.cursorDiv,"CodeMirror-overwrite"),Qe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==De(yt(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:At(function(s,u){eo(this,s,u)}),getScrollInfo:function(){var s=this.display.scroller;return{left:s.scrollLeft,top:s.scrollTop,height:s.scrollHeight-kn(this)-this.display.barHeight,width:s.scrollWidth-kn(this)-this.display.barWidth,clientHeight:wl(this),clientWidth:pr(this)}},scrollIntoView:At(function(s,u){s==null?(s={from:this.doc.sel.primary().head,to:null},u==null&&(u=this.options.cursorScrollMargin)):typeof s=="number"?s={from:Y(s,0),to:null}:s.from==null&&(s={from:s,to:null}),s.to||(s.to=s.from),s.margin=u||0,s.from.line!=null?tC(this,s):np(this,s.from,s.to,s.margin)}),setSize:At(function(s,u){var p=this,h=function(w){return typeof w=="number"||/^\d+$/.test(String(w))?w+"px":w};s!=null&&(this.display.wrapper.style.width=h(s)),u!=null&&(this.display.wrapper.style.height=h(u)),this.options.lineWrapping&&$d(this);var v=this.display.viewFrom;this.doc.iter(v,this.display.viewTo,function(w){if(w.widgets){for(var x=0;x<w.widgets.length;x++)if(w.widgets[x].noHScroll){Gn(p,v,"widget");break}}++v}),this.curOp.forceUpdate=!0,Qe(this,"refresh",this)}),operation:function(s){return jt(this,s)},startOperation:function(){return wr(this)},endOperation:function(){return br(this)},refresh:At(function(){var s=this.display.cachedTextHeight;Ft(this),this.curOp.forceUpdate=!0,Ji(this),eo(this,this.doc.scrollLeft,this.doc.scrollTop),Pl(this.display),(s==null||Math.abs(s-Jr(this.display))>.5||this.options.lineWrapping)&&El(this),Qe(this,"refresh",this)}),swapDoc:At(function(s){var u=this.doc;return u.cm=null,this.state.selectingText&&this.state.selectingText(),mp(this,s),Ji(this),this.display.input.reset(),eo(this,s.scrollLeft,s.scrollTop),this.curOp.forceScroll=!0,ft(this,"swapDoc",this,u),u}),phrase:function(s){var u=this.options.phrases;return u&&Object.prototype.hasOwnProperty.call(u,s)?u[s]:s},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},nn(t),t.registerHelper=function(s,u,p){a.hasOwnProperty(s)||(a[s]=t[s]={_global:[]}),a[s][u]=p},t.registerGlobalHelper=function(s,u,p,h){t.registerHelper(s,u,h),a[s]._global.push({pred:p,val:h})}}function eu(t,r,a,s,u){var p=r,h=a,v=ge(t,r.line),w=u&&t.direction=="rtl"?-a:a;function x(){var de=r.line+w;return de<t.first||de>=t.first+t.size?!1:(r=new Y(de,r.ch,r.sticky),v=ge(t,de))}function O(de){var ce;if(s=="codepoint"){var he=v.text.charCodeAt(r.ch+(a>0?0:-1));if(isNaN(he))ce=null;else{var ve=a>0?he>=55296&&he<56320:he>=56320&&he<57343;ce=new Y(r.line,Math.max(0,Math.min(v.text.length,r.ch+a*(ve?2:1))),-a)}}else u?ce=zC(t.cm,v,r,a):ce=Gl(v,r,a);if(ce==null)if(!de&&x())r=Vl(u,t.cm,v,r.line,w);else return!1;else r=ce;return!0}if(s=="char"||s=="codepoint")O();else if(s=="column")O(!0);else if(s=="word"||s=="group")for(var j=null,_=s=="group",H=t.cm&&t.cm.getHelper(r,"wordChars"),Q=!0;!(a<0&&!O(!Q));Q=!1){var te=v.text.charAt(r.ch)||`
|
|
@@ -132,7 +132,7 @@ b`.split(/\n/).length!=3?function(t){for(var r=0,a=[],s=t.length;r<=s;){var u=t.
|
|
|
132
132
|
`)>-1?a.value=t.prevInput="":t.prevInput=u,t.composing&&(t.composing.range.clear(),t.composing.range=r.markText(t.composing.start,r.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},tt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},tt.prototype.onKeyPress=function(){f&&d>=9&&(this.hasSelection=null),this.fastPoll()},tt.prototype.onContextMenu=function(t){var r=this,a=r.cm,s=a.display,u=r.textarea;r.contextMenuPending&&r.contextMenuPending();var p=gr(a,t),h=s.scroller.scrollTop;if(!p||C)return;var v=a.options.resetSelectionOnContextMenu;v&&a.doc.sel.contains(p)==-1&&dt(a,xt)(a.doc,Yn(p),be);var w=u.style.cssText,x=r.wrapper.style.cssText,O=r.wrapper.offsetParent.getBoundingClientRect();r.wrapper.style.cssText="position: static",u.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
133
133
|
top: `+(t.clientY-O.top-5)+"px; left: "+(t.clientX-O.left-5)+`px;
|
|
134
134
|
z-index: 1000; background: `+(f?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
135
|
-
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var j;g&&(j=u.ownerDocument.defaultView.scrollY),s.input.focus(),g&&u.ownerDocument.defaultView.scrollTo(null,j),s.input.reset(),a.somethingSelected()||(u.value=r.prevInput=" "),r.contextMenuPending=H,s.selForContextMenu=a.doc.sel,clearTimeout(s.detectingSelectAll);function _(){if(u.selectionStart!=null){var te=a.somethingSelected(),se="\u200B"+(te?u.value:"");u.value="\u21DA",u.value=se,r.prevInput=te?"":"\u200B",u.selectionStart=1,u.selectionEnd=se.length,s.selForContextMenu=a.doc.sel}}function H(){if(r.contextMenuPending==H&&(r.contextMenuPending=!1,r.wrapper.style.cssText=x,u.style.cssText=w,f&&d<9&&s.scrollbars.setScrollTop(s.scroller.scrollTop=h),u.selectionStart!=null)){(!f||f&&d<9)&&_();var te=0,se=function(){s.selForContextMenu==a.doc.sel&&u.selectionStart==0&&u.selectionEnd>0&&r.prevInput=="\u200B"?dt(a,Lp)(a):te++<10?s.detectingSelectAll=setTimeout(se,500):(s.selForContextMenu=null,s.input.reset())};s.detectingSelectAll=setTimeout(se,200)}}if(f&&d>=9&&_(),U){qn(t);var Q=function(){wt(window,"mouseup",Q),setTimeout(H,20)};ye(window,"mouseup",Q)}else setTimeout(H,50)},tt.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled=t=="nocursor",this.textarea.readOnly=!!t},tt.prototype.setUneditable=function(){},tt.prototype.needsContentAttribute=!1;function a1(t,r){if(r=r?V(r):{},r.value=t.value,!r.tabindex&&t.tabIndex&&(r.tabindex=t.tabIndex),!r.placeholder&&t.placeholder&&(r.placeholder=t.placeholder),r.autofocus==null){var a=De(je(t));r.autofocus=a==t||t.getAttribute("autofocus")!=null&&a==document.body}function s(){t.value=v.getValue()}var u;if(t.form&&(ye(t.form,"submit",s),!r.leaveSubmitMethodAlone)){var p=t.form;u=p.submit;try{var h=p.submit=function(){s(),p.submit=u,p.submit(),p.submit=h}}catch{}}r.finishInit=function(w){w.save=s,w.getTextArea=function(){return t},w.toTextArea=function(){w.toTextArea=isNaN,s(),t.parentNode.removeChild(w.getWrapperElement()),t.style.display="",t.form&&(wt(t.form,"submit",s),!r.leaveSubmitMethodAlone&&typeof t.form.submit=="function"&&(t.form.submit=u))}},t.style.display="none";var v=Ge(function(w){return t.parentNode.insertBefore(w,t.nextSibling)},r);return v}function l1(t){t.off=wt,t.on=ye,t.wheelEventPixels=gC,t.Doc=Nt,t.splitLines=Jt,t.countColumn=le,t.findColumn=Ue,t.isWordChar=vt,t.Pass=Ce,t.signal=Qe,t.Line=Qr,t.changeEnd=Qn,t.scrollbarModel=op,t.Pos=Y,t.cmpPos=fe,t.modes=Wr,t.mimeModes=sn,t.resolveMode=$r,t.getMode=Ur,t.modeExtensions=$n,t.extendMode=Gr,t.copyState=bn,t.startState=Vr,t.innerMode=Ui,t.commands=mo,t.keyMap=In,t.keyName=Up,t.isModifierKey=Wp,t.lookupKey=li,t.normalizeKeyMap=jC,t.StringStream=Ze,t.SharedTextMarker=po,t.TextMarker=Zn,t.LineWidget=fo,t.e_preventDefault=bt,t.e_stopPropagation=qr,t.e_stop=qn,t.addClass=Pe,t.contains=pe,t.rmClass=ne,t.keyNames=Jn}XC(Ge),r1(Ge);var u1="iter insert remove copy getEditor constructor".split(" ");for(var Gs in Nt.prototype)Nt.prototype.hasOwnProperty(Gs)&&ie(u1,Gs)<0&&(Ge.prototype[Gs]=function(t){return function(){return t.apply(this.doc,arguments)}}(Nt.prototype[Gs]));return nn(Nt),Ge.inputStyles={textarea:tt,contenteditable:ze},Ge.defineMode=function(t){!Ge.defaults.mode&&t!="null"&&(Ge.defaults.mode=t),an.apply(this,arguments)},Ge.defineMIME=dr,Ge.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Ge.defineMIME("text/plain","null"),Ge.defineExtension=function(t,r){Ge.prototype[t]=r},Ge.defineDocExtension=function(t,r){Nt.prototype[t]=r},Ge.fromTextArea=a1,l1(Ge),Ge.version="5.65.18",Ge})});function pf(n){let e=new Set(["has","in","no","not","and","or","is","asc","ascN","ascA","ascAN","ascNA","desc","descN","descA","descAN","descNA"]),i=df.default.getMode(n,{name:"javascript",json:!0});return{...i,indent(o,l){return o.indented+n.indentUnit*(o.lastType==="{"&&l.trim()[0]!=="}"||o.lastType==="("&&l.trim()[0]!==")"||o.lastType==="["&&l.trim()[0]!=="]")},token(o,l){let c=o.peek();if(c==="#"||c==="@")return i.token(new df.default.StringStream("$",4,o.lineOracle),l),o.pos++,"variable";let f=i.token(o,l),d=o.string.slice(o.start,o.pos);if(o.string[o.start-1]!=="."){if(l.isAssertionContext){if((f==="variable"||f==="atom")&&l.isAssertionParen===0&&d!=="not")return"type";d==="("?l.isAssertionParen++:d===")"&&(l.isAssertionParen>0&&l.isAssertionParen--,l.isAssertionParen===0&&(l.isAssertionContext=!1))}if(e.has(d))return d==="is"&&(l.isAssertionContext=!0,l.isAssertionParen=0),"keyword"}if(l.isAssertionContext){if(f==="variable"||f==="atom"||f==="def"||d==="function")return"type";l.isAssertionParen===0&&(f||/\S/.test(d))&&(l.isAssertionContext=!1)}return f}}}var df,vv=z(()=>{df=dn(An(),1)});function bv(n,e){let i=typeof e.isDiscoveryViewDefined=="function"?e.isDiscoveryViewDefined:()=>{},o=wv.default.getMode(n,{name:"javascript",json:!0});return{...o,indent(l,c){return l.indented+n.indentUnit*(l.lastType==="{"&&c.trim()[0]!=="}"||l.lastType==="("&&c.trim()[0]!==")"||l.lastType==="["&&c.trim()[0]!=="]")},token:function(l,c){if(c.suspendTokens){let{pos:g,token:m}=c.suspendTokens.shift();return l.pos=g,c.suspendTokens.length===0&&(c.suspendTokens=null),m}let f=l.pos,d=o.token(l,c);if(d==="string"){let g=l.pos,[,m]=l.string.slice(f+1,g-1).match(/^(.+?)([:{]|$)/)||[];i(m)&&(l.pos=f+1,c.suspendTokens=[{pos:f+1+m.length,token:"string discovery-view-name"},{pos:g,token:d}])}return d}}}var wv,xv=z(()=>{wv=dn(An(),1)});var hf=Ct((kv,Cv)=>{(function(n){typeof kv=="object"&&typeof Cv=="object"?n(An()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)})(function(n){"use strict";n.defineMode("javascript",function(e,i){var o=e.indentUnit,l=i.statementIndent,c=i.jsonld,f=i.json||c,d=i.trackScope!==!1,g=i.typescript,m=i.wordCharacters||/[\w$\xa1-\uffff]/,y=function(){function D(ct){return{type:ct,style:"keyword"}}var P=D("keyword a"),J=D("keyword b"),oe=D("keyword c"),Y=D("keyword d"),fe=D("operator"),Ie={type:"atom",style:"atom"};return{if:D("if"),while:P,with:P,else:J,do:J,try:J,finally:J,return:Y,break:Y,continue:Y,new:D("new"),delete:oe,void:oe,throw:oe,debugger:D("debugger"),var:D("var"),const:D("var"),let:D("var"),function:D("function"),catch:D("catch"),for:D("for"),switch:D("switch"),case:D("case"),default:D("default"),in:fe,typeof:fe,instanceof:fe,true:Ie,false:Ie,null:Ie,undefined:Ie,NaN:Ie,Infinity:Ie,this:D("this"),class:D("class"),super:D("atom"),yield:oe,export:D("export"),import:D("import"),extends:oe,await:oe}}(),k=/[+\-*&%=<>!?|~^@]/,C=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function M(D){for(var P=!1,J,oe=!1;(J=D.next())!=null;){if(!P){if(J=="/"&&!oe)return;J=="["?oe=!0:oe&&J=="]"&&(oe=!1)}P=!P&&J=="\\"}}var E,F;function N(D,P,J){return E=D,F=J,P}function A(D,P){var J=D.next();if(J=='"'||J=="'")return P.tokenize=b(J),P.tokenize(D,P);if(J=="."&&D.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return N("number","number");if(J=="."&&D.match(".."))return N("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(J))return N(J);if(J=="="&&D.eat(">"))return N("=>","operator");if(J=="0"&&D.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return N("number","number");if(/\d/.test(J))return D.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),N("number","number");if(J=="/")return D.eat("*")?(P.tokenize=L,L(D,P)):D.eat("/")?(D.skipToEnd(),N("comment","comment")):Ut(D,P,1)?(M(D),D.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),N("regexp","string-2")):(D.eat("="),N("operator","operator",D.current()));if(J=="`")return P.tokenize=T,T(D,P);if(J=="#"&&D.peek()=="!")return D.skipToEnd(),N("meta","meta");if(J=="#"&&D.eatWhile(m))return N("variable","property");if(J=="<"&&D.match("!--")||J=="-"&&D.match("->")&&!/\S/.test(D.string.slice(0,D.start)))return D.skipToEnd(),N("comment","comment");if(k.test(J))return(J!=">"||!P.lexical||P.lexical.type!=">")&&(D.eat("=")?(J=="!"||J=="=")&&D.eat("="):/[<>*+\-|&?]/.test(J)&&(D.eat(J),J==">"&&D.eat(J))),J=="?"&&D.eat(".")?N("."):N("operator","operator",D.current());if(m.test(J)){D.eatWhile(m);var oe=D.current();if(P.lastType!="."){if(y.propertyIsEnumerable(oe)){var Y=y[oe];return N(Y.type,Y.style,oe)}if(oe=="async"&&D.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return N("async","keyword",oe)}return N("variable","variable",oe)}}function b(D){return function(P,J){var oe=!1,Y;if(c&&P.peek()=="@"&&P.match(C))return J.tokenize=A,N("jsonld-keyword","meta");for(;(Y=P.next())!=null&&!(Y==D&&!oe);)oe=!oe&&Y=="\\";return oe||(J.tokenize=A),N("string","string")}}function L(D,P){for(var J=!1,oe;oe=D.next();){if(oe=="/"&&J){P.tokenize=A;break}J=oe=="*"}return N("comment","comment")}function T(D,P){for(var J=!1,oe;(oe=D.next())!=null;){if(!J&&(oe=="`"||oe=="$"&&D.eat("{"))){P.tokenize=A;break}J=!J&&oe=="\\"}return N("quasi","string-2",D.current())}var I="([{}])";function B(D,P){P.fatArrowAt&&(P.fatArrowAt=null);var J=D.string.indexOf("=>",D.start);if(!(J<0)){if(g){var oe=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(D.string.slice(D.start,J));oe&&(J=oe.index)}for(var Y=0,fe=!1,Ie=J-1;Ie>=0;--Ie){var ct=D.string.charAt(Ie),Tt=I.indexOf(ct);if(Tt>=0&&Tt<3){if(!Y){++Ie;break}if(--Y==0){ct=="("&&(fe=!0);break}}else if(Tt>=3&&Tt<6)++Y;else if(m.test(ct))fe=!0;else if(/["'\/`]/.test(ct))for(;;--Ie){if(Ie==0)return;var Yr=D.string.charAt(Ie-1);if(Yr==ct&&D.string.charAt(Ie-2)!="\\"){Ie--;break}}else if(fe&&!Y){++Ie;break}}fe&&!Y&&(P.fatArrowAt=Ie)}}var R={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function U(D,P,J,oe,Y,fe){this.indented=D,this.column=P,this.type=J,this.prev=Y,this.info=fe,oe!=null&&(this.align=oe)}function W(D,P){if(!d)return!1;for(var J=D.localVars;J;J=J.next)if(J.name==P)return!0;for(var oe=D.context;oe;oe=oe.prev)for(var J=oe.vars;J;J=J.next)if(J.name==P)return!0}function ne(D,P,J,oe,Y){var fe=D.cc;for(q.state=D,q.stream=Y,q.marked=null,q.cc=fe,q.style=P,D.lexical.hasOwnProperty("align")||(D.lexical.align=!0);;){var Ie=fe.length?fe.pop():f?ie:le;if(Ie(J,oe)){for(;fe.length&&fe[fe.length-1].lex;)fe.pop()();return q.marked?q.marked:J=="variable"&&W(D,oe)?"variable-2":P}}}var q={state:null,column:null,marked:null,cc:null};function Z(){for(var D=arguments.length-1;D>=0;D--)q.cc.push(arguments[D])}function S(){return Z.apply(null,arguments),!0}function X(D,P){for(var J=P;J;J=J.next)if(J.name==D)return!0;return!1}function ee(D){var P=q.state;if(q.marked="def",!!d){if(P.context){if(P.lexical.info=="var"&&P.context&&P.context.block){var J=pe(D,P.context);if(J!=null){P.context=J;return}}else if(!X(D,P.localVars)){P.localVars=new et(D,P.localVars);return}}i.globalVars&&!X(D,P.globalVars)&&(P.globalVars=new et(D,P.globalVars))}}function pe(D,P){if(P)if(P.block){var J=pe(D,P.prev);return J?J==P.prev?P:new Pe(J,P.vars,!0):null}else return X(D,P.vars)?P:new Pe(P.prev,new et(D,P.vars),!1);else return null}function De(D){return D=="public"||D=="private"||D=="protected"||D=="abstract"||D=="readonly"}function Pe(D,P,J){this.prev=D,this.vars=P,this.block=J}function et(D,P){this.name=D,this.next=P}var nt=new et("this",new et("arguments",null));function Ye(){q.state.context=new Pe(q.state.context,q.state.localVars,!1),q.state.localVars=nt}function yt(){q.state.context=new Pe(q.state.context,q.state.localVars,!0),q.state.localVars=null}Ye.lex=yt.lex=!0;function je(){q.state.localVars=q.state.context.vars,q.state.context=q.state.context.prev}je.lex=!0;function xe(D,P){var J=function(){var oe=q.state,Y=oe.indented;if(oe.lexical.type=="stat")Y=oe.lexical.indented;else for(var fe=oe.lexical;fe&&fe.type==")"&&fe.align;fe=fe.prev)Y=fe.indented;oe.lexical=new U(Y,q.stream.column(),D,null,oe.lexical,P)};return J.lex=!0,J}function we(){var D=q.state;D.lexical.prev&&(D.lexical.type==")"&&(D.indented=D.lexical.indented),D.lexical=D.lexical.prev)}we.lex=!0;function V(D){function P(J){return J==D?S():D==";"||J=="}"||J==")"||J=="]"?Z():S(P)}return P}function le(D,P){return D=="var"?S(xe("vardef",P),qr,V(";"),we):D=="keyword a"?S(xe("form"),Ce,le,we):D=="keyword b"?S(xe("form"),le,we):D=="keyword d"?q.stream.match(/^\s*$/,!1)?S():S(xe("stat"),$e,V(";"),we):D=="debugger"?S(V(";")):D=="{"?S(xe("}"),yt,wn,we,je):D==";"?S():D=="if"?(q.state.lexical.info=="else"&&q.state.cc[q.state.cc.length-1]==we&&q.state.cc.pop()(),S(xe("form"),Ce,le,we,_r)):D=="function"?S(Jt):D=="for"?S(xe("form"),yt,gs,le,je,we):D=="class"||g&&P=="interface"?(q.marked="keyword",S(xe("form",D=="class"?D:P),Wr,we)):D=="variable"?g&&P=="declare"?(q.marked="keyword",S(le)):g&&(P=="module"||P=="enum"||P=="type")&&q.stream.match(/^\s*\w/,!1)?(q.marked="keyword",P=="enum"?S(ge):P=="type"?S(ms,V("operator"),Le,V(";")):S(xe("form"),Lt,V("{"),xe("}"),wn,we,we)):g&&P=="namespace"?(q.marked="keyword",S(xe("form"),ie,le,we)):g&&P=="abstract"?(q.marked="keyword",S(le)):S(xe("stat"),Ne):D=="switch"?S(xe("form"),Ce,V("{"),xe("}","switch"),yt,wn,we,we,je):D=="case"?S(ie,V(":")):D=="default"?S(V(":")):D=="catch"?S(xe("form"),Ye,re,le,we,je):D=="export"?S(xe("stat"),$r,we):D=="import"?S(xe("stat"),$n,we):D=="async"?S(le):P=="@"?S(ie,le):Z(xe("stat"),ie,V(";"),we)}function re(D){if(D=="(")return S(on,V(")"))}function ie(D,P){return be(D,P,!1)}function Ee(D,P){return be(D,P,!0)}function Ce(D){return D!="("?Z():S(xe(")"),$e,V(")"),we)}function be(D,P,J){if(q.state.fatArrowAt==q.stream.start){var oe=J?He:Te;if(D=="(")return S(Ye,xe(")"),rt(on,")"),we,V("=>"),oe,je);if(D=="variable")return Z(Ye,Lt,V("=>"),oe,je)}var Y=J?Ue:Me;return R.hasOwnProperty(D)?S(Y):D=="function"?S(Jt,Y):D=="class"||g&&P=="interface"?(q.marked="keyword",S(xe("form"),ul,we)):D=="keyword c"||D=="async"?S(J?Ee:ie):D=="("?S(xe(")"),$e,V(")"),we,Y):D=="operator"||D=="spread"?S(J?Ee:ie):D=="["?S(xe("]"),Ze,we,Y):D=="{"?zn(Sn,"}",null,Y):D=="quasi"?Z(ut,Y):D=="new"?S(G(J)):S()}function $e(D){return D.match(/[;\}\)\],]/)?Z():Z(ie)}function Me(D,P){return D==","?S($e):Ue(D,P,!1)}function Ue(D,P,J){var oe=J==!1?Me:Ue,Y=J==!1?ie:Ee;if(D=="=>")return S(Ye,J?He:Te,je);if(D=="operator")return/\+\+|--/.test(P)||g&&P=="!"?S(oe):g&&P=="<"&&q.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?S(xe(">"),rt(Le,">"),we,oe):P=="?"?S(ie,V(":"),Y):S(Y);if(D=="quasi")return Z(ut,oe);if(D!=";"){if(D=="(")return zn(Ee,")","call",oe);if(D==".")return S(vt,oe);if(D=="[")return S(xe("]"),$e,V("]"),we,oe);if(g&&P=="as")return q.marked="keyword",S(Le,oe);if(D=="regexp")return q.state.lastType=q.marked="operator",q.stream.backUp(q.stream.pos-q.stream.start-1),S(Y)}}function ut(D,P){return D!="quasi"?Z():P.slice(P.length-2)!="${"?S(ut):S($e,at)}function at(D){if(D=="}")return q.marked="string-2",q.state.tokenize=T,S(ut)}function Te(D){return B(q.stream,q.state),Z(D=="{"?le:ie)}function He(D){return B(q.stream,q.state),Z(D=="{"?le:Ee)}function G(D){return function(P){return P=="."?S(D?K:ae):P=="variable"&&g?S(Pt,D?Ue:Me):Z(D?Ee:ie)}}function ae(D,P){if(P=="target")return q.marked="keyword",S(Me)}function K(D,P){if(P=="target")return q.marked="keyword",S(Ue)}function Ne(D){return D==":"?S(we,le):Z(Me,V(";"),we)}function vt(D){if(D=="variable")return q.marked="property",S()}function Sn(D,P){if(D=="async")return q.marked="property",S(Sn);if(D=="variable"||q.style=="keyword"){if(q.marked="property",P=="get"||P=="set")return S(ps);var J;return g&&q.state.fatArrowAt==q.stream.start&&(J=q.stream.match(/^\s*:\s*/,!1))&&(q.state.fatArrowAt=q.stream.pos+J[0].length),S(En)}else{if(D=="number"||D=="string")return q.marked=c?"property":q.style+" property",S(En);if(D=="jsonld-keyword")return S(En);if(g&&De(P))return q.marked="keyword",S(Sn);if(D=="[")return S(ie,Rn,V("]"),En);if(D=="spread")return S(Ee,En);if(P=="*")return q.marked="keyword",S(Sn);if(D==":")return Z(En)}}function ps(D){return D!="variable"?Z(En):(q.marked="property",S(Jt))}function En(D){if(D==":")return S(Ee);if(D=="(")return Z(Jt)}function rt(D,P,J){function oe(Y,fe){if(J?J.indexOf(Y)>-1:Y==","){var Ie=q.state.lexical;return Ie.info=="call"&&(Ie.pos=(Ie.pos||0)+1),S(function(ct,Tt){return ct==P||Tt==P?Z():Z(D)},oe)}return Y==P||fe==P?S():J&&J.indexOf(";")>-1?Z(D):S(V(P))}return function(Y,fe){return Y==P||fe==P?S():Z(D,oe)}}function zn(D,P,J){for(var oe=3;oe<arguments.length;oe++)q.cc.push(arguments[oe]);return S(xe(P,J),rt(D,P),we)}function wn(D){return D=="}"?S():Z(le,wn)}function Rn(D,P){if(g){if(D==":")return S(Le);if(P=="?")return S(Rn)}}function fr(D,P){if(g&&(D==":"||P=="in"))return S(Le)}function Hn(D){if(g&&D==":")return q.stream.match(/^\s*\w+\s+is\b/,!1)?S(ie,al,Le):S(Le)}function al(D,P){if(P=="is")return q.marked="keyword",S()}function Le(D,P){if(P=="keyof"||P=="typeof"||P=="infer"||P=="readonly")return q.marked="keyword",S(P=="typeof"?Ee:Le);if(D=="variable"||P=="void")return q.marked="type",S(Zt);if(P=="|"||P=="&")return S(Le);if(D=="string"||D=="number"||D=="atom")return S(Zt);if(D=="[")return S(xe("]"),rt(Le,"]",","),we,Zt);if(D=="{")return S(xe("}"),ye,we,Zt);if(D=="(")return S(rt(Ke,")"),hs,Zt);if(D=="<")return S(rt(Le,">"),Le);if(D=="quasi")return Z(wt,Zt)}function hs(D){if(D=="=>")return S(Le)}function ye(D){return D.match(/[\}\)\]]/)?S():D==","||D==";"?S(ye):Z(Mn,ye)}function Mn(D,P){if(D=="variable"||q.style=="keyword")return q.marked="property",S(Mn);if(P=="?"||D=="number"||D=="string")return S(Mn);if(D==":")return S(Le);if(D=="[")return S(V("variable"),fr,V("]"),Mn);if(D=="(")return Z(Wn,Mn);if(!D.match(/[;\}\)\],]/))return S()}function wt(D,P){return D!="quasi"?Z():P.slice(P.length-2)!="${"?S(wt):S(Le,Qe)}function Qe(D){if(D=="}")return q.marked="string-2",q.state.tokenize=T,S(wt)}function Ke(D,P){return D=="variable"&&q.stream.match(/^\s*[?:]/,!1)||P=="?"?S(Ke):D==":"?S(Le):D=="spread"?S(Ke):Z(Le)}function Zt(D,P){if(P=="<")return S(xe(">"),rt(Le,">"),we,Zt);if(P=="|"||D=="."||P=="&")return S(Le);if(D=="[")return S(Le,V("]"),Zt);if(P=="extends"||P=="implements")return q.marked="keyword",S(Le);if(P=="?")return S(Le,V(":"),Le)}function Pt(D,P){if(P=="<")return S(xe(">"),rt(Le,">"),we,Zt)}function nn(){return Z(Le,bt)}function bt(D,P){if(P=="=")return S(Le)}function qr(D,P){return P=="enum"?(q.marked="keyword",S(ge)):Z(Lt,Rn,rn,ll)}function Lt(D,P){if(g&&De(P))return q.marked="keyword",S(Lt);if(D=="variable")return ee(P),S();if(D=="spread")return S(Lt);if(D=="[")return zn(Wi,"]");if(D=="{")return zn(qn,"}")}function qn(D,P){return D=="variable"&&!q.stream.match(/^\s*:/,!1)?(ee(P),S(rn)):(D=="variable"&&(q.marked="property"),D=="spread"?S(Lt):D=="}"?Z():D=="["?S(ie,V("]"),V(":"),qn):S(V(":"),Lt,rn))}function Wi(){return Z(Lt,rn)}function rn(D,P){if(P=="=")return S(Ee)}function ll(D){if(D==",")return S(qr)}function _r(D,P){if(D=="keyword b"&&P=="else")return S(xe("form","else"),le,we)}function gs(D,P){if(P=="await")return S(gs);if(D=="(")return S(xe(")"),$i,we)}function $i(D){return D=="var"?S(qr,_n):D=="variable"?S(_n):Z(_n)}function _n(D,P){return D==")"?S():D==";"?S(_n):P=="in"||P=="of"?(q.marked="keyword",S(ie,_n)):Z(ie,_n)}function Jt(D,P){if(P=="*")return q.marked="keyword",S(Jt);if(D=="variable")return ee(P),S(Jt);if(D=="(")return S(Ye,xe(")"),rt(on,")"),we,Hn,le,je);if(g&&P=="<")return S(xe(">"),rt(nn,">"),we,Jt)}function Wn(D,P){if(P=="*")return q.marked="keyword",S(Wn);if(D=="variable")return ee(P),S(Wn);if(D=="(")return S(Ye,xe(")"),rt(on,")"),we,Hn,je);if(g&&P=="<")return S(xe(">"),rt(nn,">"),we,Wn)}function ms(D,P){if(D=="keyword"||D=="variable")return q.marked="type",S(ms);if(P=="<")return S(xe(">"),rt(nn,">"),we)}function on(D,P){return P=="@"&&S(ie,on),D=="spread"?S(on):g&&De(P)?(q.marked="keyword",S(on)):g&&D=="this"?S(Rn,rn):Z(Lt,Rn,rn)}function ul(D,P){return D=="variable"?Wr(D,P):sn(D,P)}function Wr(D,P){if(D=="variable")return ee(P),S(sn)}function sn(D,P){if(P=="<")return S(xe(">"),rt(nn,">"),we,sn);if(P=="extends"||P=="implements"||g&&D==",")return P=="implements"&&(q.marked="keyword"),S(g?Le:ie,sn);if(D=="{")return S(xe("}"),an,we)}function an(D,P){if(D=="async"||D=="variable"&&(P=="static"||P=="get"||P=="set"||g&&De(P))&&q.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return q.marked="keyword",S(an);if(D=="variable"||q.style=="keyword")return q.marked="property",S(dr,an);if(D=="number"||D=="string")return S(dr,an);if(D=="[")return S(ie,Rn,V("]"),dr,an);if(P=="*")return q.marked="keyword",S(an);if(g&&D=="(")return Z(Wn,an);if(D==";"||D==",")return S(an);if(D=="}")return S();if(P=="@")return S(ie,an)}function dr(D,P){if(P=="!"||P=="?")return S(dr);if(D==":")return S(Le,rn);if(P=="=")return S(Ee);var J=q.state.lexical.prev,oe=J&&J.info=="interface";return Z(oe?Wn:Jt)}function $r(D,P){return P=="*"?(q.marked="keyword",S(Vr,V(";"))):P=="default"?(q.marked="keyword",S(ie,V(";"))):D=="{"?S(rt(Ur,"}"),Vr,V(";")):Z(le)}function Ur(D,P){if(P=="as")return q.marked="keyword",S(V("variable"));if(D=="variable")return Z(Ee,Ur)}function $n(D){return D=="string"?S():D=="("?Z(ie):D=="."?Z(Me):Z(Gr,bn,Vr)}function Gr(D,P){return D=="{"?zn(Gr,"}"):(D=="variable"&&ee(P),P=="*"&&(q.marked="keyword"),S(Ui))}function bn(D){if(D==",")return S(Gr,bn)}function Ui(D,P){if(P=="as")return q.marked="keyword",S(Gr)}function Vr(D,P){if(P=="from")return q.marked="keyword",S(ie)}function Ze(D){return D=="]"?S():Z(rt(Ee,"]"))}function ge(){return Z(xe("form"),Lt,V("{"),xe("}"),rt(Ln,"}"),we,we)}function Ln(){return Z(Lt,rn)}function Gi(D,P){return D.lastType=="operator"||D.lastType==","||k.test(P.charAt(0))||/[,.]/.test(P.charAt(0))}function Ut(D,P,J){return P.tokenize==A&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(P.lastType)||P.lastType=="quasi"&&/\{\s*$/.test(D.string.slice(0,D.pos-(J||0)))}return{startState:function(D){var P={tokenize:A,lastType:"sof",cc:[],lexical:new U((D||0)-o,0,"block",!1),localVars:i.localVars,context:i.localVars&&new Pe(null,null,!1),indented:D||0};return i.globalVars&&typeof i.globalVars=="object"&&(P.globalVars=i.globalVars),P},token:function(D,P){if(D.sol()&&(P.lexical.hasOwnProperty("align")||(P.lexical.align=!1),P.indented=D.indentation(),B(D,P)),P.tokenize!=L&&D.eatSpace())return null;var J=P.tokenize(D,P);return E=="comment"?J:(P.lastType=E=="operator"&&(F=="++"||F=="--")?"incdec":E,ne(P,J,E,F,D))},indent:function(D,P){if(D.tokenize==L||D.tokenize==T)return n.Pass;if(D.tokenize!=A)return 0;var J=P&&P.charAt(0),oe=D.lexical,Y;if(!/^\s*else\b/.test(P))for(var fe=D.cc.length-1;fe>=0;--fe){var Ie=D.cc[fe];if(Ie==we)oe=oe.prev;else if(Ie!=_r&&Ie!=je)break}for(;(oe.type=="stat"||oe.type=="form")&&(J=="}"||(Y=D.cc[D.cc.length-1])&&(Y==Me||Y==Ue)&&!/^[,\.=+\-*:?[\(]/.test(P));)oe=oe.prev;l&&oe.type==")"&&oe.prev.type=="stat"&&(oe=oe.prev);var ct=oe.type,Tt=J==ct;return ct=="vardef"?oe.indented+(D.lastType=="operator"||D.lastType==","?oe.info.length+1:0):ct=="form"&&J=="{"?oe.indented:ct=="form"?oe.indented+o:ct=="stat"?oe.indented+(Gi(D,P)?l||o:0):oe.info=="switch"&&!Tt&&i.doubleIndentSwitch!=!1?oe.indented+(/^(?:case|default)\b/.test(P)?o:2*o):oe.align?oe.column+(Tt?0:1):oe.indented+(Tt?0:o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:f?null:"/*",blockCommentEnd:f?null:"*/",blockCommentContinue:f?null:" * ",lineComment:f?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:f?"json":"javascript",jsonldMode:c,jsonMode:f,expressionAllowed:Ut,skipExpression:function(D){ne(D,"atom","atom","true",new n.StringStream("",2,null))}}}),n.registerHelper("wordChars","javascript",/[\w$]/),n.defineMIME("text/javascript","javascript"),n.defineMIME("text/ecmascript","javascript"),n.defineMIME("application/javascript","javascript"),n.defineMIME("application/x-javascript","javascript"),n.defineMIME("application/ecmascript","javascript"),n.defineMIME("application/json",{name:"javascript",json:!0}),n.defineMIME("application/x-json",{name:"javascript",json:!0}),n.defineMIME("application/manifest+json",{name:"javascript",json:!0}),n.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),n.defineMIME("text/typescript",{name:"javascript",typescript:!0}),n.defineMIME("application/typescript",{name:"javascript",typescript:!0})})});function Dv(n){return typeof n=="string"?n:n.text}function _M(n,e){for(;e&&e.parentNode!==n;)e=e.parentNode;return e}var _t,zM,RM,gf,HM,qM,mf,yf,Av=z(()=>{_t=dn(An(),1);Fr();Oe();zM="discovery-view-editor-hints-popup",RM="discovery-view-editor-hint",gf="active",HM=window.requestAnimationFrame||(n=>setTimeout(n,1e3/60)),qM=window.cancelAnimationFrame||clearTimeout;_t.default.commands.autocomplete=_t.default.showHint;_t.default.defineOption("showHintOptions",null);_t.default.defineExtension("showHint",function(n){n={closeOnUnfocus:!0,container:null,...this.options.showHintOptions,...n},this.state.completionActive&&this.state.completionActive.close(),!(this.listSelections().length>1)&&(this.somethingSelected()||typeof n.hint=="function"&&(this.state.completionActive=new mf(this,n),this.state.completionActive.update(!0),_t.default.signal(this,"startCompletion",this)))});mf=class{constructor(e,i){if(this.cm=e,this.options=i,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,e.on("cursorActivity",this.activityFunc=()=>this.cursorActivity()),i.closeOnUnfocus){let o;this.onFocus=()=>clearTimeout(o),this.onBlur=()=>o=setTimeout(()=>this.close(),100),e.on("focus",this.onFocus),e.on("blur",this.onBlur)}}close(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.options.closeOnUnfocus&&(this.cm.off("blur",this.onBlur),this.cm.off("focus",this.onFocus)),this.widget&&(this.data&&_t.default.signal(this.data,"close"),this.widget.close()),_t.default.signal(this.cm,"endCompletion",this.cm))}active(){return this.cm.state.completionActive===this}pick(e,i){let o=e.list[i];this.cm.state.completionEnabled=!1,o.hint?o.hint(this.cm,e,o):this.cm.replaceRange(Dv(o),o.from||e.from,o.to||e.to,"complete"),_t.default.signal(e,"pick",o),this.close()}cursorActivity(){this.debounce&&(qM(this.debounce),this.debounce=0);let e=this.cm.getCursor(),i=this.cm.getLine(e.line);e.line!=this.startPos.line||i.length-e.ch!=this.startLen-this.startPos.ch||e.ch<this.startPos.ch||this.cm.somethingSelected()?this.close():(this.debounce=HM(()=>this.update()),this.widget&&this.widget.disable())}update(e){if(this.tick===null)return;let i=++this.tick;Promise.resolve(this.options.hint(this.cm,this.options)).then(o=>{this.tick==i&&this.finishUpdate(o,e)})}finishUpdate(e){this.data&&_t.default.signal(this.data,"update");let i=this.widget&&this.widget.picked;this.widget&&this.widget.close(),this.data=e,e&&e.list.length&&(i&&e.list.length==1?this.pick(e,0):(this.widget=new yf(this,e),_t.default.signal(e,"shown")))}};yf=class{constructor(e,i){let o=e.cm,l=this.hintsEl=document.createElement("ul"),c=[zM,e.cm.options.theme].filter(Boolean),f=e.options.container||document.body;this.rootEls=new Set([f.getRootNode()]),this.completion=e,this.data=i,this.picked=!1,this.selectedHint=i.selectedHint||0,l.style.visibility="hidden",l.classList.add(...c),f.appendChild(l),this.items=i.list.map((d,g)=>{let m=l.appendChild(document.createElement("li"));return m.className=RM,g===this.selectedHint&&m.classList.add(gf),d.render?d.render(m,i,d):m.appendChild(document.createTextNode(d.displayText||Dv(d))),m}),o.addKeyMap(this.keyMap={Up:()=>this.changeActive(this.selectedHint-1),Down:()=>this.changeActive(this.selectedHint+1),Enter:()=>this.pick(),Tab:()=>this.pick(),Esc:()=>{o.state.completionEnabled=!1,e.close()}}),this.updatePosSize(),this.onScroll=()=>this.updatePosSize();for(let d of this.rootEls)d.addEventListener("scroll",this.onScroll,Rt);_t.default.on(l,"mousedown",d=>{let g=_M(l,d.target),m=this.items.indexOf(g);m!==-1&&(this.close(),this.selectedHint=m,this.pick(),setTimeout(()=>o.focus(),1))}),_t.default.signal(i,"select",i.list[this.selectedHint],this.items[this.selectedHint])}close(){if(this.completion.widget===this){this.completion.widget=null,this.completion.cm.removeKeyMap(this.keyMap),this.hintsEl.remove();for(let e of this.rootEls)e.removeEventListener("scroll",this.onScroll,Rt)}}disable(){this.completion.cm.removeKeyMap(this.keyMap),this.keyMap={Enter:()=>this.picked=!0},this.completion.cm.addKeyMap(this.keyMap)}pick(){this.completion.pick(this.data,this.selectedHint)}changeActive(e,i){e>=this.items.length?e=i?this.items.length-1:0:e<0&&(e=i?0:this.items.length-1);let o=this.items[this.selectedHint],l=this.items[this.selectedHint=e];l!==o&&(o&&o.classList.remove(gf),l.classList.add(gf),l.offsetTop<this.hintsEl.scrollTop?this.hintsEl.scrollTop=l.offsetTop-3:l.offsetTop+l.offsetHeight>this.hintsEl.scrollTop+this.hintsEl.clientHeight&&(this.hintsEl.scrollTop=l.offsetTop+l.offsetHeight-this.hintsEl.clientHeight+3),_t.default.signal(this.data,"select",this.data.list[this.selectedHint],l))}getCursorCoords(){let{completion:e,hintsEl:i}=this,o=e.cm,l=Go(i),c=o.cursorCoords(null,"local"),f=qt(o.display.wrapper,l);return{top:f.top+c.top+5,left:f.left+c.left+9,bottom:f.top+c.bottom+5,right:f.left+c.right+9}}updatePosSize(){let{hintsEl:o}=this,l=this.getCursorCoords(),{clientWidth:c,clientHeight:f}=Vo(o);o.style.left="0px",o.style.top="0px";let{width:d,height:g}=o.getBoundingClientRect(),m=f-l.bottom,y=l.top;if(m<g&&y>m){let M=Math.min(g,y-6-1);o.style.top=`${l.top-1-M-6}px`,o.style.maxHeight=`${M}px`}else o.style.top=`${l.bottom+1}px`,o.style.maxHeight=`${m-1-6}px`;let k=c-l.right,C=l.left;k<d&&C>k?(o.style.left=`${l.left+1-Math.min(d,C-6)}px`,o.style.maxWidth=`${C-6}px`):(o.style.left=`${l.right}px`,o.style.maxWidth=`${k-6}px`),o.style.visibility="visible"}}});function Sv(n){Object.assign(n.view,{QueryEditor:class extends vf{get container(){return n.dom.container}},ViewEditor:class extends wf{isViewDefined(e){return n.view.isDefined(e)}}})}var Or,BI,WM,qa,vf,wf,Ev=z(()=>{Oe();Qt();Na();Ea();Or=dn(An(),1);vv();xv();BI=dn(hf(),1);Av();Object.defineProperty(Or.default.prototype,"display",{configurable:!0,set(n){return n.scroller.addEventListener=function(e,i,o){EventTarget.prototype.addEventListener.call(this,e,i,typeof o!="boolean"?o:{capture:o,passive:["touchstart","touchmove","wheel","mousewheel"].includes(e)})},Object.defineProperty(this,"display",{configurable:!0,enumerable:!0,value:n}),n}});WM=(n,e,{entry:{type:i,text:o,value:l}})=>{let c=o[0],f=o[o.length-1],d=c==='"'||c==="'"?1:0,g=f==='"'||f==="'"?1:0,m=o.toLowerCase().substring(d,o.length-g),y=m?l.toLowerCase().indexOf(m,l[0]==='"'||l[0]==="'"?1:0):-1;y!==-1&&(l=Xe(l.substring(0,y))+'<span class="match">'+Xe(l.slice(y,y+m.length))+"</span>"+Xe(l.slice(y+m.length))),n.classList.add("type-"+i),n.appendChild($("span","name",l))},qa=class extends ir{static CodeMirror=Or.default;el;cm;get container(){return null}constructor({hint:e,mode:i,placeholder:o}){super(),this.el=document.createElement("div"),this.el.className="discovery-view-editor empty-value";let l=this,c=(0,Or.default)(this.el,{extraKeys:{"Alt-Space":"autocomplete"},mode:i||"javascript",theme:"neo",indentUnit:0,showHintOptions:{hint:e,get container(){return l.container}}});o&&(c.display.lineDiv.parentNode.dataset.placeholder=o),c.on("change",()=>{let d=c.getValue();this.el.classList.toggle("empty-value",d===""),this.emit("change",d)}),typeof e=="function"&&(c.on("cursorActivity",d=>{d.state.completionEnabled&&d.state.focused&&d.showHint()}),c.on("focus",d=>{d.getValue()===""&&(d.state.completionEnabled=!0),d.state.completionEnabled&&!d.state.completionActive&&d.showHint()}),c.on("change",(d,g)=>{g.origin!=="complete"&&(c.state.completionEnabled=!0)})),this.cm=c;let f=new Mr;f.subscribe(()=>c.refresh()),f.observe(c.display.wrapper)}getValue(){return this.cm.getValue()}setValue(e){return requestAnimationFrame(()=>this.cm.refresh()),typeof e=="string"&&this.getValue()!==e?(this.cm.setValue(e||""),!0):!1}focus(){this.cm.focus()}},vf=class extends qa{queryData;queryContext;inputPanelEl;outputPanelEl;constructor(e){super({mode:"discovery-query",placeholder:"Enter a jora query",hint:i=>{let o=i.getCursor(),l=e(i.getValue(),i.doc.indexFromPos(o),this.queryData,this.queryContext);return l?{list:l.slice(0,50).map(c=>({entry:c,text:c.value,render:WM,from:i.posFromIndex(c.from),to:i.posFromIndex(c.to)}))}:null}}),this.inputPanelEl=$("div","discovery-view-editor__input-panel"),this.outputPanelEl=$("div","discovery-view-editor__output-panel"),this.el.append(this.inputPanelEl,this.outputPanelEl)}setValue(e,i,o){let l=this.queryData!==i||this.queryContext!==o;return this.queryData=i,this.queryContext=o,super.setValue(e)?!0:(l&&this.cm.state.completionEnabled&&this.cm.state.focused&&this.cm.showHint(),!1)}},wf=class extends qa{constructor(){super({mode:{name:"discovery-view",isDiscoveryViewDefined:e=>this.isViewDefined(e)}})}isViewDefined(){return!1}};Or.default.defineMode("jora",pf);Or.default.defineMode("discovery-query",pf);Or.default.defineMode("discovery-view",bv)});var Mv,Lv=z(()=>{Mv={beforeDemo:['md:"A block has no its own look. It\'s using for wrapping some content with a `className` (btw `className` is a common property for any view when appropriate)"'],demo:{view:"block",className:"foo",content:['text:"Content inside block"']}}});function Tv(n){n.view.define("block",function(e,i,o,l){let{content:c=[],onInit:f,onChange:d}=i,g=typeof f!="function"&&typeof d!="function"?c:this.composeConfig(c,{onInit:f,onChange:d});return n.view.render(e,g,o,l)},{usage:Mv})}var Fv=z(()=>{Lv()});var _a,bf=z(()=>{_a={demo:{view:"columns",data:["one","two","three","four"],column:"text"}}});function Nv(n){n.view.define("column",function(e,i,o,l){let{content:c=[]}=i;return n.view.render(e,c,o,l)},{usage:_a})}var Ov=z(()=>{bf()});function Iv(n){n.view.define("columns",function(i,o,l,c){let{column:f,columnConfig:d,emptyText:g,limit:m}=o;if(g!==!1&&g!==""&&i.setAttribute("emptyText",g||"Empty"),!Array.isArray(l)&&l&&(l=[l]),Array.isArray(l))return n.view.renderList(i,this.composeConfig({view:"column",content:f},d),l,c,0,n.view.listLimit(m,25))},{usage:_a})}var Bv=z(()=>{bf()});var Pv,jv=z(()=>{Pv={demo:{view:"expand",header:'text:"Expand me!"',content:'text:"Content"'}}});function zv(n){n.view.define("expand",function(e,i,o,l){function c(){if(e.classList.toggle("expanded",f),f)return C=$("div","content"),n.view.render(C,g,o,l).then(()=>e.appendChild(C));C!==null&&(C.remove(),C=null)}let{expanded:f,header:d,content:g,onToggle:m}=i,y=e.appendChild($("div","header")),k=y.appendChild($("div","header-content")),C=null;return f=n.queryBool(f,o,l),y.appendChild($("div","trigger")),y.addEventListener("click",()=>{f=!f,c(),typeof m=="function"&&m(f)}),Promise.all([n.view.render(k,d||'text:"\xA0"',o,l),c()])},{usage:Pv})}var Rv=z(()=>{Oe();jv()});var Hv,qv=z(()=>{Hv={demo:{view:"hstack",content:['button:{text:"First button"}','button-primary:{text:"Second button"}']}}});function _v(n){n.view.define("hstack",function(e,i,o,l){let{content:c=[]}=i;return n.view.render(e,c,o,l)},{usage:Hv})}var Wv=z(()=>{qv()});function $v(n){n.view.define("list-item",function(e,i,o,l){let{content:c="text"}=i;return n.view.render(e,c,o,l)},{tag:"li"})}var Uv=z(()=>{});var Mi,Gv=z(()=>{Mi=(n,e)=>({demo:{view:n,data:["one","two","three","four"]},examples:[{title:"Variations",demo:{view:"context",data:["foo","bar","baz"],content:e.map(i=>[`header{ content: 'md:${JSON.stringify('`view: \\"'+i+'\\"`')}' }`,i])}},{title:"Configure item's content",demo:[{view:n,data:["one","two","three","four"],item:['text:"<item> "',{view:"link",data:'{ href: "#" + $ }'}]}]},{title:"Configure item's config",demo:{view:n,data:["one","two","three","four"],itemConfig:{className:"special"},item:{view:"text",data:'"prefix-" + $'}}}]})});function Vv(n){function e(i,o,l,c){let{item:f,itemConfig:d,limit:g,emptyText:m}=o;if(m!==!1&&m!==""&&i.setAttribute("emptyText",m||"Empty list"),!Array.isArray(l)&&l&&(l=[l]),Array.isArray(l))return n.view.renderList(i,this.composeConfig({view:"list-item",content:f},d),l,c,0,n.view.listLimit(g,25))}n.view.define("list",e,{usage:Mi}),n.view.define("inline-list",e,{usage:Mi}),n.view.define("comma-list",e,{usage:Mi}),n.view.define("ol",e,{tag:"ol",usage:Mi}),n.view.define("ul",e,{tag:"ul",usage:Mi})}var Yv=z(()=>{Gv()});var Qv,Kv=z(()=>{Qv=n=>({beforeDemo:['md:"A special view to be used as the first view in the body of the page. This view stays in place as the page scrolls (although it may move slightly to the top of the page at the start of the scroll), so that the most relevant information and important action elements can remain accessible despite page scrolling."'],demoFixed:100,demo:`${n}:"That's a \\"${n}\\""`,examples:[{title:"Prelude",demoFixed:150,highlightProps:["prelude"],demo:{view:n,prelude:['badge:{ text: "demo" }','badge:{ text: "demo", prefix: "prelude", postfix: "postfix" }'],content:'h1:"Header"'}}]})});function Zv(n){n.view.define("page-header",function(i,o,l,c){let{prelude:f,content:d,onInit:g,onChange:m}=o,y=i.appendChild($("div","view-page-header__prelude")),k=i.appendChild($("div","view-page-header__content")),C=M=>typeof g!="function"&&typeof m!="function"?M:this.composeConfig(M,{onInit:g,onChange:m});return Promise.all([n.view.render(y,C(f||[]),l,c),n.view.render(k,C(d||"text"),l,c)])},{usage:Qv})}var Jv=z(()=>{Oe();Kv()});function Xv(n){return n?n.getRootNode({composed:!0})===document:!0}function ew(n,e){return typeof n=="function"&&(n=n(e)),typeof n=="number"?xf(n):typeof n=="boolean"&&n?UM:0}function tw(n,e){n.lastChild!==e&&n.appendChild(e)}function xf(n,e=0){return Number.isFinite(n)?n:e}function GM(n){return $M.includes(n)}function nw(n){let e=[],i=new Set,o=[],l=new Set,c=null,f=A=>{c===null&&(c=setTimeout(()=>y(A),0))},d=()=>{c!==null&&(clearTimeout(c),c=null)},g=null,m=()=>{g===null&&(g=[n.addHostElEventListener("mouseenter",({target:A})=>{for(let b of o){let L=M(b,A),T=L?L.el:A.closest(b.hoverTriggers);T&&(b.hideTimer!==null&&(clearTimeout(b.hideTimer),b.hideTimer=null),T!==b.lastHoverTriggerEl&&((!L||!L.hoverPinned)&&(b.lastHoverTriggerEl=T),L||(b.hoverPinned=!1,b.el.classList.remove("pinned"),b.show(T))))}},Rt),n.addHostElEventListener("mouseleave",({target:A})=>{for(let b of o)b.lastHoverTriggerEl===A&&(E(b),b.lastHoverTriggerEl=null,b.hideTimer=setTimeout(b.hide,100))},Rt),n.addGlobalEventListener("scroll",f,Rt),n.addHostElEventListener("scroll",A=>{d(),y(A)},Rt),n.addGlobalEventListener("click",f,!0),n.addHostElEventListener("click",A=>{d(),y(A),setTimeout(k,50);for(let b of o)b.hoverPin==="trigger-click"&&b.lastHoverTriggerEl&&b.lastTriggerEl?.contains(A.target)&&(b.lastHoverTriggerEl=null,b.hoverPinned=!0,b.el.classList.add("pinned"),A.stopPropagation())},!0)])};or.subscribe(()=>{for(let A of e)A.position==="pointer"&&!A.hoverPinned&&!A.frozen&&!l.has(A)&&A.updatePosition();for(let A of i){let{showDelayArgs:b}=A;F(A,b?.[0],b?.[1])}}),n.inspectMode.subscribe(A=>A?e.forEach(b=>l.add(b)):l.clear());function y(A){e.slice().forEach(b=>b.hideIfEventOutside(A))}function k(){e.slice().forEach(A=>A.hideOnTriggerHasLeftDocument())}function C(){e.slice().forEach(A=>A.hideOnResize())}function M(A,b){return A.el.contains(b)?A:A.relatedPopups.find(L=>M(L,b))||null}function E(A){A.showDelayTimer!==null&&clearTimeout(A.showDelayTimer),A.showDelayTimer=null,A.showDelayArgs=null,i.delete(A)}function F(A,b,L){A.showDelayTimer!==null&&clearTimeout(A.showDelayTimer),A.showDelayTimer=setTimeout(()=>A.show(b,L,!0),ew(A.showDelay,b)),A.showDelayArgs=[b,L],i.add(A)}class N{el;showDelayTimer;showDelayArgs;showDelay;lastTriggerEl;lastHoverTriggerEl;render;position;positionMode;pointerOffsetX;pointerOffsetY;hoverTriggers;hoverPin;hideIfEventOutsideDisabled;hideOnResizeDisabled;hideTimer;hoverPinned;frozen;lastRenderMarker;constructor(b){let{render:L,showDelay:T=!1,position:I="trigger",positionMode:B="safe",pointerOffsetX:R,pointerOffsetY:U,hoverTriggers:W,hoverPin:ne,hideIfEventOutside:q=!0,hideOnResize:Z=!0,className:S}=b||{};this.el=document.createElement("div"),this.el.classList.add("discovery-view-popup"),this.showDelayTimer=null,this.showDelayArgs=null,this.showDelay=T,this.hideTimer=null,this.hide=this.hide.bind(this),this.lastTriggerEl=null,this.lastHoverTriggerEl=null,this.hoverPinned=!1,this.frozen=!1,this.render=L,this.lastRenderMarker=null,this.position=I,this.positionMode=B,this.pointerOffsetX=xf(R,3),this.pointerOffsetY=xf(U,3),this.hoverTriggers=W||null,this.hoverPin=GM(ne)?ne:!1,this.hideIfEventOutsideDisabled=!q,this.hideOnResizeDisabled=!Z,S&&this.el.classList.add(S),this.hoverTriggers&&(this.el.classList.add("show-on-hover"),this.el.dataset.pinMode=this.hoverPin||"none",o.push(this),m())}get relatedPopups(){return e.filter(b=>this.el.contains(b.lastTriggerEl))}get visible(){return e.includes(this)}toggle(...b){this.visible?this.hide():this.show(...b)}async show(b,L=this.render,T=!1){if(!this.visible&&!T&&ew(this.showDelay,b)>0){F(this,b,L);return}E(this),l.delete(this),n.view.setViewRoot(this.el,"popup",{config:L});let I=n.dom.container;if(this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null),this.relatedPopups.forEach(B=>B.hide()),this.el.classList.toggle("inspect",n.inspectMode.value),this.lastTriggerEl&&this.lastTriggerEl.classList.remove("discovery-view-popup-active"),b&&b.classList.add("discovery-view-popup-active"),this.lastTriggerEl=b||null,this.visible||(e.push(this),e.length===1&&window.addEventListener("resize",C)),typeof L=="function"){this.el.innerHTML="";let B=Symbol();if(this.lastRenderMarker=B,requestAnimationFrame(()=>{this.lastRenderMarker===B&&(tw(I,this.el),this.updatePosition())}),await L(this.el,b,this.hide),this.lastRenderMarker!==B)return;this.lastRenderMarker=null}tw(I,this.el),this.updatePosition()}updatePosition(){if(!this.visible)return;let b=this.position==="pointer",L=b?null:this.lastTriggerEl;if(b?this.frozen:!L)return;let T=n.dom.container,I=Go(T.firstChild),B=ef(window,I),{x:R,y:U}=or.value,{pointerOffsetX:W,pointerOffsetY:ne}=this,q=L?qt(L,T):{left:Math.round(R)-W,right:Math.round(R)+W,top:Math.round(U)-ne,bottom:Math.round(U)+ne},Z=b?q.left:q.right,S=b?q.right:q.left,X=q.top-B.top-3,ee=B.bottom-q.bottom-3,pe=Z-B.left-3,De=B.right-S-3,Pe=De>=pe,et=ee>=X;if(et||(this.el.style.maxHeight=X+"px",this.el.style.top="auto",this.el.style.bottom=B.bottom-q.top+"px",this.el.dataset.vTo="top"),Pe||(this.el.style.left="auto",this.el.style.right=B.right-Z+"px",this.el.style.maxWidth=pe+"px",this.el.dataset.hTo="left"),this.positionMode==="natural"&&(!Pe||!et)){let{height:nt,width:Ye}=qt(this.el);et=nt<=ee,Pe=Ye<=De}et&&(this.el.style.maxHeight=ee+"px",this.el.style.top=q.bottom-B.top+"px",this.el.style.bottom="auto",this.el.dataset.vTo="bottom"),Pe&&(this.el.style.left=S-B.left+"px",this.el.style.right="auto",this.el.style.maxWidth=De+"px",this.el.dataset.hTo="right"),this.relatedPopups.forEach(nt=>nt.updatePosition())}freeze(){this.frozen=!0,this.el.classList.add("frozen")}unfreeze(){this.frozen=!1,this.el.classList.remove("frozen"),this.updatePosition()}hide(){this.lastRenderMarker=null,this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null),E(this),this.visible&&!l.has(this)&&(this.relatedPopups.forEach(b=>b.hide()),e.splice(e.indexOf(this),1),this.el.remove(),this.unfreeze(),this.lastTriggerEl&&(this.lastTriggerEl.classList.remove("discovery-view-popup-active"),this.lastTriggerEl=null),e.length===0&&window.removeEventListener("resize",C))}hideIfEventOutside({target:b}){this.hideIfEventOutsideDisabled||l.has(this)||this.lastTriggerEl&&this.lastTriggerEl.contains(b)||M(this,b)||this.hide()}hideOnTriggerHasLeftDocument(){(!Xv(this.lastHoverTriggerEl)||!Xv(this.lastTriggerEl))&&this.hide()}hideOnResize(){this.hideOnResizeDisabled||l.has(this)||this.hide()}destroy(){l.delete(this),E(this);let b=o.indexOf(this);b!==-1&&o.splice(b,1),this.hide(),this.el=null,this.lastTriggerEl=null,this.lastHoverTriggerEl=null}}n.view.Popup=N}var $M,UM,rw=z(()=>{Fr();Oe();ja();$M=[!1,"popup-hover","trigger-click"],UM=300});var iw,ow=z(()=>{iw={demo:{view:"section",header:'text:"I am section"',content:['text:"content"']}}});function sw(n){n.view.define("section",function(e,i,o,l){let{header:c,content:f=[],onInit:d,onChange:g}=i,m=y=>typeof d!="function"&&typeof g!="function"?y:this.composeConfig(y,{onInit:d,onChange:g});return n.view.render(e,[{view:"header",content:m(c)},m(f)],o,l)},{usage:iw})}var aw=z(()=>{ow()});function lw(n){n.view.define("toc-section",function(e,i,o,l){let{header:c,content:f}=i;return n.view.render(e,[{view:"block",className:"header",content:c},{view:"block",className:"content",content:f}],o,l)},{tag:"section"})}var uw=z(()=>{});var Li,cw=z(()=>{Li=(n,e)=>({demo:{view:n,data:'"Alert"'},examples:[{title:"Variations",demo:e.map(i=>`${i}:"${i}"`)},{title:"Complex content",demo:{view:n,content:['h3:"Some header"','text:"Hello world!"']}}]})});function fw(n){function e(i,o,l,c){let{content:f="text"}=o;return i.classList.add("view-alert"),n.view.render(i,f,l,c)}n.view.define("alert",e,{usage:Li}),n.view.define("alert-primary",e,{usage:Li}),n.view.define("alert-success",e,{usage:Li}),n.view.define("alert-danger",e,{usage:Li}),n.view.define("alert-warning",e,{usage:Li})}var dw=z(()=>{cw()});function Ko(n){return hw.decode(QM(n))}function QM(n){typeof n=="string"&&(n=VM.encode(n));let e=new Uint8Array(Math.ceil(n.length/3)*4),i=0,o=0,l=0;for(let c=0;c<n.length;c++)for(o=o<<8|n[c],l+=8;l>=6;){let f=o>>(l-=6);e[i++]=pw[f],o-=f<<l}for(l!==0&&(e[i++]=pw[o<<6-l]);i<e.length;)e[i++]=61;return e}function Zo(n){return hw.decode(KM(n))}function KM(n){let e=n.length;for(;e>0&&n[e-1]==="=";)e--;let i=new Uint8Array(3*Math.ceil(e/4)),o=0,l=0,c=0;for(let f=0;f<e;f++)if(l=l<<6|YM[n.charCodeAt(f)&255],c+=6,c>8){let d=l>>(c-=8);i[o++]=d,l-=d<<c}return c!==0&&(i[o++]=l),i.subarray(0,(e>>2)*3+(e%4*6>>3))}var VM,hw,pw,YM,kf=z(()=>{VM=new TextEncoder,hw=new TextDecoder,[pw,YM]=(()=>{let n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Uint8Array(64),i=new Uint8Array(256);for(let o=0;o<n.length;o++){let l=n.charCodeAt(o);i[l]=o,e[o]=l}return[e,i]})()});function ZM(n){let e=$("div",{style:["position: fixed","overflow: hidden","font-size: 1px","width: 1px","height: 1px","top: 0","left: 0","white-space: pre"].join(";")});document.body.append(e);try{let i=window.getSelection(),o=document.createRange();e.append(n),o.selectNodeContents(e),i?.removeAllRanges(),i?.addRange(o),document.execCommand("copy")}finally{e.remove()}}async function Wt(n){try{if(navigator.clipboard)try{let e=await navigator.permissions.query({name:"clipboard-write"});if(e.state==="granted"||e.state==="prompt")return navigator.clipboard.writeText(n)}catch(e){if(e instanceof TypeError)return navigator.clipboard.writeText(n)}}catch{}ZM(n)}var Jo=z(()=>{Oe()});function mw(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function mn(n){return Array.isArray(n)||mw(n)}function sr(n){return pn(n)==="[object Set]"}function Xo(n){return pn(n)==="[object RegExp]"}var Ir=z(()=>{st()});function JM(n,e,i){let o=String(n),[l,c]=o.match(/^(?:\S+\s+)?(\S+)\(/)||[];if(l!=="function"&&l!=="function*"&&c===i.trim().slice(0,-1)&&(i=""),o.indexOf(`
|
|
135
|
+
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var j;g&&(j=u.ownerDocument.defaultView.scrollY),s.input.focus(),g&&u.ownerDocument.defaultView.scrollTo(null,j),s.input.reset(),a.somethingSelected()||(u.value=r.prevInput=" "),r.contextMenuPending=H,s.selForContextMenu=a.doc.sel,clearTimeout(s.detectingSelectAll);function _(){if(u.selectionStart!=null){var te=a.somethingSelected(),se="\u200B"+(te?u.value:"");u.value="\u21DA",u.value=se,r.prevInput=te?"":"\u200B",u.selectionStart=1,u.selectionEnd=se.length,s.selForContextMenu=a.doc.sel}}function H(){if(r.contextMenuPending==H&&(r.contextMenuPending=!1,r.wrapper.style.cssText=x,u.style.cssText=w,f&&d<9&&s.scrollbars.setScrollTop(s.scroller.scrollTop=h),u.selectionStart!=null)){(!f||f&&d<9)&&_();var te=0,se=function(){s.selForContextMenu==a.doc.sel&&u.selectionStart==0&&u.selectionEnd>0&&r.prevInput=="\u200B"?dt(a,Lp)(a):te++<10?s.detectingSelectAll=setTimeout(se,500):(s.selForContextMenu=null,s.input.reset())};s.detectingSelectAll=setTimeout(se,200)}}if(f&&d>=9&&_(),U){qn(t);var Q=function(){wt(window,"mouseup",Q),setTimeout(H,20)};ye(window,"mouseup",Q)}else setTimeout(H,50)},tt.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled=t=="nocursor",this.textarea.readOnly=!!t},tt.prototype.setUneditable=function(){},tt.prototype.needsContentAttribute=!1;function a1(t,r){if(r=r?V(r):{},r.value=t.value,!r.tabindex&&t.tabIndex&&(r.tabindex=t.tabIndex),!r.placeholder&&t.placeholder&&(r.placeholder=t.placeholder),r.autofocus==null){var a=De(je(t));r.autofocus=a==t||t.getAttribute("autofocus")!=null&&a==document.body}function s(){t.value=v.getValue()}var u;if(t.form&&(ye(t.form,"submit",s),!r.leaveSubmitMethodAlone)){var p=t.form;u=p.submit;try{var h=p.submit=function(){s(),p.submit=u,p.submit(),p.submit=h}}catch{}}r.finishInit=function(w){w.save=s,w.getTextArea=function(){return t},w.toTextArea=function(){w.toTextArea=isNaN,s(),t.parentNode.removeChild(w.getWrapperElement()),t.style.display="",t.form&&(wt(t.form,"submit",s),!r.leaveSubmitMethodAlone&&typeof t.form.submit=="function"&&(t.form.submit=u))}},t.style.display="none";var v=Ge(function(w){return t.parentNode.insertBefore(w,t.nextSibling)},r);return v}function l1(t){t.off=wt,t.on=ye,t.wheelEventPixels=gC,t.Doc=Nt,t.splitLines=Jt,t.countColumn=le,t.findColumn=Ue,t.isWordChar=vt,t.Pass=Ce,t.signal=Qe,t.Line=Qr,t.changeEnd=Qn,t.scrollbarModel=op,t.Pos=Y,t.cmpPos=fe,t.modes=Wr,t.mimeModes=sn,t.resolveMode=$r,t.getMode=Ur,t.modeExtensions=$n,t.extendMode=Gr,t.copyState=bn,t.startState=Vr,t.innerMode=Ui,t.commands=mo,t.keyMap=In,t.keyName=Up,t.isModifierKey=Wp,t.lookupKey=li,t.normalizeKeyMap=jC,t.StringStream=Ze,t.SharedTextMarker=po,t.TextMarker=Zn,t.LineWidget=fo,t.e_preventDefault=bt,t.e_stopPropagation=qr,t.e_stop=qn,t.addClass=Pe,t.contains=pe,t.rmClass=ne,t.keyNames=Jn}XC(Ge),r1(Ge);var u1="iter insert remove copy getEditor constructor".split(" ");for(var Gs in Nt.prototype)Nt.prototype.hasOwnProperty(Gs)&&ie(u1,Gs)<0&&(Ge.prototype[Gs]=(function(t){return function(){return t.apply(this.doc,arguments)}})(Nt.prototype[Gs]));return nn(Nt),Ge.inputStyles={textarea:tt,contenteditable:ze},Ge.defineMode=function(t){!Ge.defaults.mode&&t!="null"&&(Ge.defaults.mode=t),an.apply(this,arguments)},Ge.defineMIME=dr,Ge.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Ge.defineMIME("text/plain","null"),Ge.defineExtension=function(t,r){Ge.prototype[t]=r},Ge.defineDocExtension=function(t,r){Nt.prototype[t]=r},Ge.fromTextArea=a1,l1(Ge),Ge.version="5.65.18",Ge}))});function pf(n){let e=new Set(["has","in","no","not","and","or","is","asc","ascN","ascA","ascAN","ascNA","desc","descN","descA","descAN","descNA"]),i=df.default.getMode(n,{name:"javascript",json:!0});return{...i,indent(o,l){return o.indented+n.indentUnit*(o.lastType==="{"&&l.trim()[0]!=="}"||o.lastType==="("&&l.trim()[0]!==")"||o.lastType==="["&&l.trim()[0]!=="]")},token(o,l){let c=o.peek();if(c==="#"||c==="@")return i.token(new df.default.StringStream("$",4,o.lineOracle),l),o.pos++,"variable";let f=i.token(o,l),d=o.string.slice(o.start,o.pos);if(o.string[o.start-1]!=="."){if(l.isAssertionContext){if((f==="variable"||f==="atom")&&l.isAssertionParen===0&&d!=="not")return"type";d==="("?l.isAssertionParen++:d===")"&&(l.isAssertionParen>0&&l.isAssertionParen--,l.isAssertionParen===0&&(l.isAssertionContext=!1))}if(e.has(d))return d==="is"&&(l.isAssertionContext=!0,l.isAssertionParen=0),"keyword"}if(l.isAssertionContext){if(f==="variable"||f==="atom"||f==="def"||d==="function")return"type";l.isAssertionParen===0&&(f||/\S/.test(d))&&(l.isAssertionContext=!1)}return f}}}var df,vv=z(()=>{df=dn(An(),1)});function bv(n,e){let i=typeof e.isDiscoveryViewDefined=="function"?e.isDiscoveryViewDefined:()=>{},o=wv.default.getMode(n,{name:"javascript",json:!0});return{...o,indent(l,c){return l.indented+n.indentUnit*(l.lastType==="{"&&c.trim()[0]!=="}"||l.lastType==="("&&c.trim()[0]!==")"||l.lastType==="["&&c.trim()[0]!=="]")},token:function(l,c){if(c.suspendTokens){let{pos:g,token:m}=c.suspendTokens.shift();return l.pos=g,c.suspendTokens.length===0&&(c.suspendTokens=null),m}let f=l.pos,d=o.token(l,c);if(d==="string"){let g=l.pos,[,m]=l.string.slice(f+1,g-1).match(/^(.+?)([:{]|$)/)||[];i(m)&&(l.pos=f+1,c.suspendTokens=[{pos:f+1+m.length,token:"string discovery-view-name"},{pos:g,token:d}])}return d}}}var wv,xv=z(()=>{wv=dn(An(),1)});var hf=Ct((kv,Cv)=>{(function(n){typeof kv=="object"&&typeof Cv=="object"?n(An()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)})(function(n){"use strict";n.defineMode("javascript",function(e,i){var o=e.indentUnit,l=i.statementIndent,c=i.jsonld,f=i.json||c,d=i.trackScope!==!1,g=i.typescript,m=i.wordCharacters||/[\w$\xa1-\uffff]/,y=(function(){function D(ct){return{type:ct,style:"keyword"}}var P=D("keyword a"),J=D("keyword b"),oe=D("keyword c"),Y=D("keyword d"),fe=D("operator"),Ie={type:"atom",style:"atom"};return{if:D("if"),while:P,with:P,else:J,do:J,try:J,finally:J,return:Y,break:Y,continue:Y,new:D("new"),delete:oe,void:oe,throw:oe,debugger:D("debugger"),var:D("var"),const:D("var"),let:D("var"),function:D("function"),catch:D("catch"),for:D("for"),switch:D("switch"),case:D("case"),default:D("default"),in:fe,typeof:fe,instanceof:fe,true:Ie,false:Ie,null:Ie,undefined:Ie,NaN:Ie,Infinity:Ie,this:D("this"),class:D("class"),super:D("atom"),yield:oe,export:D("export"),import:D("import"),extends:oe,await:oe}})(),k=/[+\-*&%=<>!?|~^@]/,C=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function M(D){for(var P=!1,J,oe=!1;(J=D.next())!=null;){if(!P){if(J=="/"&&!oe)return;J=="["?oe=!0:oe&&J=="]"&&(oe=!1)}P=!P&&J=="\\"}}var E,F;function N(D,P,J){return E=D,F=J,P}function A(D,P){var J=D.next();if(J=='"'||J=="'")return P.tokenize=b(J),P.tokenize(D,P);if(J=="."&&D.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return N("number","number");if(J=="."&&D.match(".."))return N("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(J))return N(J);if(J=="="&&D.eat(">"))return N("=>","operator");if(J=="0"&&D.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return N("number","number");if(/\d/.test(J))return D.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),N("number","number");if(J=="/")return D.eat("*")?(P.tokenize=L,L(D,P)):D.eat("/")?(D.skipToEnd(),N("comment","comment")):Ut(D,P,1)?(M(D),D.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),N("regexp","string-2")):(D.eat("="),N("operator","operator",D.current()));if(J=="`")return P.tokenize=T,T(D,P);if(J=="#"&&D.peek()=="!")return D.skipToEnd(),N("meta","meta");if(J=="#"&&D.eatWhile(m))return N("variable","property");if(J=="<"&&D.match("!--")||J=="-"&&D.match("->")&&!/\S/.test(D.string.slice(0,D.start)))return D.skipToEnd(),N("comment","comment");if(k.test(J))return(J!=">"||!P.lexical||P.lexical.type!=">")&&(D.eat("=")?(J=="!"||J=="=")&&D.eat("="):/[<>*+\-|&?]/.test(J)&&(D.eat(J),J==">"&&D.eat(J))),J=="?"&&D.eat(".")?N("."):N("operator","operator",D.current());if(m.test(J)){D.eatWhile(m);var oe=D.current();if(P.lastType!="."){if(y.propertyIsEnumerable(oe)){var Y=y[oe];return N(Y.type,Y.style,oe)}if(oe=="async"&&D.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return N("async","keyword",oe)}return N("variable","variable",oe)}}function b(D){return function(P,J){var oe=!1,Y;if(c&&P.peek()=="@"&&P.match(C))return J.tokenize=A,N("jsonld-keyword","meta");for(;(Y=P.next())!=null&&!(Y==D&&!oe);)oe=!oe&&Y=="\\";return oe||(J.tokenize=A),N("string","string")}}function L(D,P){for(var J=!1,oe;oe=D.next();){if(oe=="/"&&J){P.tokenize=A;break}J=oe=="*"}return N("comment","comment")}function T(D,P){for(var J=!1,oe;(oe=D.next())!=null;){if(!J&&(oe=="`"||oe=="$"&&D.eat("{"))){P.tokenize=A;break}J=!J&&oe=="\\"}return N("quasi","string-2",D.current())}var I="([{}])";function B(D,P){P.fatArrowAt&&(P.fatArrowAt=null);var J=D.string.indexOf("=>",D.start);if(!(J<0)){if(g){var oe=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(D.string.slice(D.start,J));oe&&(J=oe.index)}for(var Y=0,fe=!1,Ie=J-1;Ie>=0;--Ie){var ct=D.string.charAt(Ie),Tt=I.indexOf(ct);if(Tt>=0&&Tt<3){if(!Y){++Ie;break}if(--Y==0){ct=="("&&(fe=!0);break}}else if(Tt>=3&&Tt<6)++Y;else if(m.test(ct))fe=!0;else if(/["'\/`]/.test(ct))for(;;--Ie){if(Ie==0)return;var Yr=D.string.charAt(Ie-1);if(Yr==ct&&D.string.charAt(Ie-2)!="\\"){Ie--;break}}else if(fe&&!Y){++Ie;break}}fe&&!Y&&(P.fatArrowAt=Ie)}}var R={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function U(D,P,J,oe,Y,fe){this.indented=D,this.column=P,this.type=J,this.prev=Y,this.info=fe,oe!=null&&(this.align=oe)}function W(D,P){if(!d)return!1;for(var J=D.localVars;J;J=J.next)if(J.name==P)return!0;for(var oe=D.context;oe;oe=oe.prev)for(var J=oe.vars;J;J=J.next)if(J.name==P)return!0}function ne(D,P,J,oe,Y){var fe=D.cc;for(q.state=D,q.stream=Y,q.marked=null,q.cc=fe,q.style=P,D.lexical.hasOwnProperty("align")||(D.lexical.align=!0);;){var Ie=fe.length?fe.pop():f?ie:le;if(Ie(J,oe)){for(;fe.length&&fe[fe.length-1].lex;)fe.pop()();return q.marked?q.marked:J=="variable"&&W(D,oe)?"variable-2":P}}}var q={state:null,column:null,marked:null,cc:null};function Z(){for(var D=arguments.length-1;D>=0;D--)q.cc.push(arguments[D])}function S(){return Z.apply(null,arguments),!0}function X(D,P){for(var J=P;J;J=J.next)if(J.name==D)return!0;return!1}function ee(D){var P=q.state;if(q.marked="def",!!d){if(P.context){if(P.lexical.info=="var"&&P.context&&P.context.block){var J=pe(D,P.context);if(J!=null){P.context=J;return}}else if(!X(D,P.localVars)){P.localVars=new et(D,P.localVars);return}}i.globalVars&&!X(D,P.globalVars)&&(P.globalVars=new et(D,P.globalVars))}}function pe(D,P){if(P)if(P.block){var J=pe(D,P.prev);return J?J==P.prev?P:new Pe(J,P.vars,!0):null}else return X(D,P.vars)?P:new Pe(P.prev,new et(D,P.vars),!1);else return null}function De(D){return D=="public"||D=="private"||D=="protected"||D=="abstract"||D=="readonly"}function Pe(D,P,J){this.prev=D,this.vars=P,this.block=J}function et(D,P){this.name=D,this.next=P}var nt=new et("this",new et("arguments",null));function Ye(){q.state.context=new Pe(q.state.context,q.state.localVars,!1),q.state.localVars=nt}function yt(){q.state.context=new Pe(q.state.context,q.state.localVars,!0),q.state.localVars=null}Ye.lex=yt.lex=!0;function je(){q.state.localVars=q.state.context.vars,q.state.context=q.state.context.prev}je.lex=!0;function xe(D,P){var J=function(){var oe=q.state,Y=oe.indented;if(oe.lexical.type=="stat")Y=oe.lexical.indented;else for(var fe=oe.lexical;fe&&fe.type==")"&&fe.align;fe=fe.prev)Y=fe.indented;oe.lexical=new U(Y,q.stream.column(),D,null,oe.lexical,P)};return J.lex=!0,J}function we(){var D=q.state;D.lexical.prev&&(D.lexical.type==")"&&(D.indented=D.lexical.indented),D.lexical=D.lexical.prev)}we.lex=!0;function V(D){function P(J){return J==D?S():D==";"||J=="}"||J==")"||J=="]"?Z():S(P)}return P}function le(D,P){return D=="var"?S(xe("vardef",P),qr,V(";"),we):D=="keyword a"?S(xe("form"),Ce,le,we):D=="keyword b"?S(xe("form"),le,we):D=="keyword d"?q.stream.match(/^\s*$/,!1)?S():S(xe("stat"),$e,V(";"),we):D=="debugger"?S(V(";")):D=="{"?S(xe("}"),yt,wn,we,je):D==";"?S():D=="if"?(q.state.lexical.info=="else"&&q.state.cc[q.state.cc.length-1]==we&&q.state.cc.pop()(),S(xe("form"),Ce,le,we,_r)):D=="function"?S(Jt):D=="for"?S(xe("form"),yt,gs,le,je,we):D=="class"||g&&P=="interface"?(q.marked="keyword",S(xe("form",D=="class"?D:P),Wr,we)):D=="variable"?g&&P=="declare"?(q.marked="keyword",S(le)):g&&(P=="module"||P=="enum"||P=="type")&&q.stream.match(/^\s*\w/,!1)?(q.marked="keyword",P=="enum"?S(ge):P=="type"?S(ms,V("operator"),Le,V(";")):S(xe("form"),Lt,V("{"),xe("}"),wn,we,we)):g&&P=="namespace"?(q.marked="keyword",S(xe("form"),ie,le,we)):g&&P=="abstract"?(q.marked="keyword",S(le)):S(xe("stat"),Ne):D=="switch"?S(xe("form"),Ce,V("{"),xe("}","switch"),yt,wn,we,we,je):D=="case"?S(ie,V(":")):D=="default"?S(V(":")):D=="catch"?S(xe("form"),Ye,re,le,we,je):D=="export"?S(xe("stat"),$r,we):D=="import"?S(xe("stat"),$n,we):D=="async"?S(le):P=="@"?S(ie,le):Z(xe("stat"),ie,V(";"),we)}function re(D){if(D=="(")return S(on,V(")"))}function ie(D,P){return be(D,P,!1)}function Ee(D,P){return be(D,P,!0)}function Ce(D){return D!="("?Z():S(xe(")"),$e,V(")"),we)}function be(D,P,J){if(q.state.fatArrowAt==q.stream.start){var oe=J?He:Te;if(D=="(")return S(Ye,xe(")"),rt(on,")"),we,V("=>"),oe,je);if(D=="variable")return Z(Ye,Lt,V("=>"),oe,je)}var Y=J?Ue:Me;return R.hasOwnProperty(D)?S(Y):D=="function"?S(Jt,Y):D=="class"||g&&P=="interface"?(q.marked="keyword",S(xe("form"),ul,we)):D=="keyword c"||D=="async"?S(J?Ee:ie):D=="("?S(xe(")"),$e,V(")"),we,Y):D=="operator"||D=="spread"?S(J?Ee:ie):D=="["?S(xe("]"),Ze,we,Y):D=="{"?zn(Sn,"}",null,Y):D=="quasi"?Z(ut,Y):D=="new"?S(G(J)):S()}function $e(D){return D.match(/[;\}\)\],]/)?Z():Z(ie)}function Me(D,P){return D==","?S($e):Ue(D,P,!1)}function Ue(D,P,J){var oe=J==!1?Me:Ue,Y=J==!1?ie:Ee;if(D=="=>")return S(Ye,J?He:Te,je);if(D=="operator")return/\+\+|--/.test(P)||g&&P=="!"?S(oe):g&&P=="<"&&q.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?S(xe(">"),rt(Le,">"),we,oe):P=="?"?S(ie,V(":"),Y):S(Y);if(D=="quasi")return Z(ut,oe);if(D!=";"){if(D=="(")return zn(Ee,")","call",oe);if(D==".")return S(vt,oe);if(D=="[")return S(xe("]"),$e,V("]"),we,oe);if(g&&P=="as")return q.marked="keyword",S(Le,oe);if(D=="regexp")return q.state.lastType=q.marked="operator",q.stream.backUp(q.stream.pos-q.stream.start-1),S(Y)}}function ut(D,P){return D!="quasi"?Z():P.slice(P.length-2)!="${"?S(ut):S($e,at)}function at(D){if(D=="}")return q.marked="string-2",q.state.tokenize=T,S(ut)}function Te(D){return B(q.stream,q.state),Z(D=="{"?le:ie)}function He(D){return B(q.stream,q.state),Z(D=="{"?le:Ee)}function G(D){return function(P){return P=="."?S(D?K:ae):P=="variable"&&g?S(Pt,D?Ue:Me):Z(D?Ee:ie)}}function ae(D,P){if(P=="target")return q.marked="keyword",S(Me)}function K(D,P){if(P=="target")return q.marked="keyword",S(Ue)}function Ne(D){return D==":"?S(we,le):Z(Me,V(";"),we)}function vt(D){if(D=="variable")return q.marked="property",S()}function Sn(D,P){if(D=="async")return q.marked="property",S(Sn);if(D=="variable"||q.style=="keyword"){if(q.marked="property",P=="get"||P=="set")return S(ps);var J;return g&&q.state.fatArrowAt==q.stream.start&&(J=q.stream.match(/^\s*:\s*/,!1))&&(q.state.fatArrowAt=q.stream.pos+J[0].length),S(En)}else{if(D=="number"||D=="string")return q.marked=c?"property":q.style+" property",S(En);if(D=="jsonld-keyword")return S(En);if(g&&De(P))return q.marked="keyword",S(Sn);if(D=="[")return S(ie,Rn,V("]"),En);if(D=="spread")return S(Ee,En);if(P=="*")return q.marked="keyword",S(Sn);if(D==":")return Z(En)}}function ps(D){return D!="variable"?Z(En):(q.marked="property",S(Jt))}function En(D){if(D==":")return S(Ee);if(D=="(")return Z(Jt)}function rt(D,P,J){function oe(Y,fe){if(J?J.indexOf(Y)>-1:Y==","){var Ie=q.state.lexical;return Ie.info=="call"&&(Ie.pos=(Ie.pos||0)+1),S(function(ct,Tt){return ct==P||Tt==P?Z():Z(D)},oe)}return Y==P||fe==P?S():J&&J.indexOf(";")>-1?Z(D):S(V(P))}return function(Y,fe){return Y==P||fe==P?S():Z(D,oe)}}function zn(D,P,J){for(var oe=3;oe<arguments.length;oe++)q.cc.push(arguments[oe]);return S(xe(P,J),rt(D,P),we)}function wn(D){return D=="}"?S():Z(le,wn)}function Rn(D,P){if(g){if(D==":")return S(Le);if(P=="?")return S(Rn)}}function fr(D,P){if(g&&(D==":"||P=="in"))return S(Le)}function Hn(D){if(g&&D==":")return q.stream.match(/^\s*\w+\s+is\b/,!1)?S(ie,al,Le):S(Le)}function al(D,P){if(P=="is")return q.marked="keyword",S()}function Le(D,P){if(P=="keyof"||P=="typeof"||P=="infer"||P=="readonly")return q.marked="keyword",S(P=="typeof"?Ee:Le);if(D=="variable"||P=="void")return q.marked="type",S(Zt);if(P=="|"||P=="&")return S(Le);if(D=="string"||D=="number"||D=="atom")return S(Zt);if(D=="[")return S(xe("]"),rt(Le,"]",","),we,Zt);if(D=="{")return S(xe("}"),ye,we,Zt);if(D=="(")return S(rt(Ke,")"),hs,Zt);if(D=="<")return S(rt(Le,">"),Le);if(D=="quasi")return Z(wt,Zt)}function hs(D){if(D=="=>")return S(Le)}function ye(D){return D.match(/[\}\)\]]/)?S():D==","||D==";"?S(ye):Z(Mn,ye)}function Mn(D,P){if(D=="variable"||q.style=="keyword")return q.marked="property",S(Mn);if(P=="?"||D=="number"||D=="string")return S(Mn);if(D==":")return S(Le);if(D=="[")return S(V("variable"),fr,V("]"),Mn);if(D=="(")return Z(Wn,Mn);if(!D.match(/[;\}\)\],]/))return S()}function wt(D,P){return D!="quasi"?Z():P.slice(P.length-2)!="${"?S(wt):S(Le,Qe)}function Qe(D){if(D=="}")return q.marked="string-2",q.state.tokenize=T,S(wt)}function Ke(D,P){return D=="variable"&&q.stream.match(/^\s*[?:]/,!1)||P=="?"?S(Ke):D==":"?S(Le):D=="spread"?S(Ke):Z(Le)}function Zt(D,P){if(P=="<")return S(xe(">"),rt(Le,">"),we,Zt);if(P=="|"||D=="."||P=="&")return S(Le);if(D=="[")return S(Le,V("]"),Zt);if(P=="extends"||P=="implements")return q.marked="keyword",S(Le);if(P=="?")return S(Le,V(":"),Le)}function Pt(D,P){if(P=="<")return S(xe(">"),rt(Le,">"),we,Zt)}function nn(){return Z(Le,bt)}function bt(D,P){if(P=="=")return S(Le)}function qr(D,P){return P=="enum"?(q.marked="keyword",S(ge)):Z(Lt,Rn,rn,ll)}function Lt(D,P){if(g&&De(P))return q.marked="keyword",S(Lt);if(D=="variable")return ee(P),S();if(D=="spread")return S(Lt);if(D=="[")return zn(Wi,"]");if(D=="{")return zn(qn,"}")}function qn(D,P){return D=="variable"&&!q.stream.match(/^\s*:/,!1)?(ee(P),S(rn)):(D=="variable"&&(q.marked="property"),D=="spread"?S(Lt):D=="}"?Z():D=="["?S(ie,V("]"),V(":"),qn):S(V(":"),Lt,rn))}function Wi(){return Z(Lt,rn)}function rn(D,P){if(P=="=")return S(Ee)}function ll(D){if(D==",")return S(qr)}function _r(D,P){if(D=="keyword b"&&P=="else")return S(xe("form","else"),le,we)}function gs(D,P){if(P=="await")return S(gs);if(D=="(")return S(xe(")"),$i,we)}function $i(D){return D=="var"?S(qr,_n):D=="variable"?S(_n):Z(_n)}function _n(D,P){return D==")"?S():D==";"?S(_n):P=="in"||P=="of"?(q.marked="keyword",S(ie,_n)):Z(ie,_n)}function Jt(D,P){if(P=="*")return q.marked="keyword",S(Jt);if(D=="variable")return ee(P),S(Jt);if(D=="(")return S(Ye,xe(")"),rt(on,")"),we,Hn,le,je);if(g&&P=="<")return S(xe(">"),rt(nn,">"),we,Jt)}function Wn(D,P){if(P=="*")return q.marked="keyword",S(Wn);if(D=="variable")return ee(P),S(Wn);if(D=="(")return S(Ye,xe(")"),rt(on,")"),we,Hn,je);if(g&&P=="<")return S(xe(">"),rt(nn,">"),we,Wn)}function ms(D,P){if(D=="keyword"||D=="variable")return q.marked="type",S(ms);if(P=="<")return S(xe(">"),rt(nn,">"),we)}function on(D,P){return P=="@"&&S(ie,on),D=="spread"?S(on):g&&De(P)?(q.marked="keyword",S(on)):g&&D=="this"?S(Rn,rn):Z(Lt,Rn,rn)}function ul(D,P){return D=="variable"?Wr(D,P):sn(D,P)}function Wr(D,P){if(D=="variable")return ee(P),S(sn)}function sn(D,P){if(P=="<")return S(xe(">"),rt(nn,">"),we,sn);if(P=="extends"||P=="implements"||g&&D==",")return P=="implements"&&(q.marked="keyword"),S(g?Le:ie,sn);if(D=="{")return S(xe("}"),an,we)}function an(D,P){if(D=="async"||D=="variable"&&(P=="static"||P=="get"||P=="set"||g&&De(P))&&q.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return q.marked="keyword",S(an);if(D=="variable"||q.style=="keyword")return q.marked="property",S(dr,an);if(D=="number"||D=="string")return S(dr,an);if(D=="[")return S(ie,Rn,V("]"),dr,an);if(P=="*")return q.marked="keyword",S(an);if(g&&D=="(")return Z(Wn,an);if(D==";"||D==",")return S(an);if(D=="}")return S();if(P=="@")return S(ie,an)}function dr(D,P){if(P=="!"||P=="?")return S(dr);if(D==":")return S(Le,rn);if(P=="=")return S(Ee);var J=q.state.lexical.prev,oe=J&&J.info=="interface";return Z(oe?Wn:Jt)}function $r(D,P){return P=="*"?(q.marked="keyword",S(Vr,V(";"))):P=="default"?(q.marked="keyword",S(ie,V(";"))):D=="{"?S(rt(Ur,"}"),Vr,V(";")):Z(le)}function Ur(D,P){if(P=="as")return q.marked="keyword",S(V("variable"));if(D=="variable")return Z(Ee,Ur)}function $n(D){return D=="string"?S():D=="("?Z(ie):D=="."?Z(Me):Z(Gr,bn,Vr)}function Gr(D,P){return D=="{"?zn(Gr,"}"):(D=="variable"&&ee(P),P=="*"&&(q.marked="keyword"),S(Ui))}function bn(D){if(D==",")return S(Gr,bn)}function Ui(D,P){if(P=="as")return q.marked="keyword",S(Gr)}function Vr(D,P){if(P=="from")return q.marked="keyword",S(ie)}function Ze(D){return D=="]"?S():Z(rt(Ee,"]"))}function ge(){return Z(xe("form"),Lt,V("{"),xe("}"),rt(Ln,"}"),we,we)}function Ln(){return Z(Lt,rn)}function Gi(D,P){return D.lastType=="operator"||D.lastType==","||k.test(P.charAt(0))||/[,.]/.test(P.charAt(0))}function Ut(D,P,J){return P.tokenize==A&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(P.lastType)||P.lastType=="quasi"&&/\{\s*$/.test(D.string.slice(0,D.pos-(J||0)))}return{startState:function(D){var P={tokenize:A,lastType:"sof",cc:[],lexical:new U((D||0)-o,0,"block",!1),localVars:i.localVars,context:i.localVars&&new Pe(null,null,!1),indented:D||0};return i.globalVars&&typeof i.globalVars=="object"&&(P.globalVars=i.globalVars),P},token:function(D,P){if(D.sol()&&(P.lexical.hasOwnProperty("align")||(P.lexical.align=!1),P.indented=D.indentation(),B(D,P)),P.tokenize!=L&&D.eatSpace())return null;var J=P.tokenize(D,P);return E=="comment"?J:(P.lastType=E=="operator"&&(F=="++"||F=="--")?"incdec":E,ne(P,J,E,F,D))},indent:function(D,P){if(D.tokenize==L||D.tokenize==T)return n.Pass;if(D.tokenize!=A)return 0;var J=P&&P.charAt(0),oe=D.lexical,Y;if(!/^\s*else\b/.test(P))for(var fe=D.cc.length-1;fe>=0;--fe){var Ie=D.cc[fe];if(Ie==we)oe=oe.prev;else if(Ie!=_r&&Ie!=je)break}for(;(oe.type=="stat"||oe.type=="form")&&(J=="}"||(Y=D.cc[D.cc.length-1])&&(Y==Me||Y==Ue)&&!/^[,\.=+\-*:?[\(]/.test(P));)oe=oe.prev;l&&oe.type==")"&&oe.prev.type=="stat"&&(oe=oe.prev);var ct=oe.type,Tt=J==ct;return ct=="vardef"?oe.indented+(D.lastType=="operator"||D.lastType==","?oe.info.length+1:0):ct=="form"&&J=="{"?oe.indented:ct=="form"?oe.indented+o:ct=="stat"?oe.indented+(Gi(D,P)?l||o:0):oe.info=="switch"&&!Tt&&i.doubleIndentSwitch!=!1?oe.indented+(/^(?:case|default)\b/.test(P)?o:2*o):oe.align?oe.column+(Tt?0:1):oe.indented+(Tt?0:o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:f?null:"/*",blockCommentEnd:f?null:"*/",blockCommentContinue:f?null:" * ",lineComment:f?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:f?"json":"javascript",jsonldMode:c,jsonMode:f,expressionAllowed:Ut,skipExpression:function(D){ne(D,"atom","atom","true",new n.StringStream("",2,null))}}}),n.registerHelper("wordChars","javascript",/[\w$]/),n.defineMIME("text/javascript","javascript"),n.defineMIME("text/ecmascript","javascript"),n.defineMIME("application/javascript","javascript"),n.defineMIME("application/x-javascript","javascript"),n.defineMIME("application/ecmascript","javascript"),n.defineMIME("application/json",{name:"javascript",json:!0}),n.defineMIME("application/x-json",{name:"javascript",json:!0}),n.defineMIME("application/manifest+json",{name:"javascript",json:!0}),n.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),n.defineMIME("text/typescript",{name:"javascript",typescript:!0}),n.defineMIME("application/typescript",{name:"javascript",typescript:!0})})});function Dv(n){return typeof n=="string"?n:n.text}function _M(n,e){for(;e&&e.parentNode!==n;)e=e.parentNode;return e}var _t,zM,RM,gf,HM,qM,mf,yf,Av=z(()=>{_t=dn(An(),1);Fr();Oe();zM="discovery-view-editor-hints-popup",RM="discovery-view-editor-hint",gf="active",HM=window.requestAnimationFrame||(n=>setTimeout(n,1e3/60)),qM=window.cancelAnimationFrame||clearTimeout;_t.default.commands.autocomplete=_t.default.showHint;_t.default.defineOption("showHintOptions",null);_t.default.defineExtension("showHint",function(n){n={closeOnUnfocus:!0,container:null,...this.options.showHintOptions,...n},this.state.completionActive&&this.state.completionActive.close(),!(this.listSelections().length>1)&&(this.somethingSelected()||typeof n.hint=="function"&&(this.state.completionActive=new mf(this,n),this.state.completionActive.update(!0),_t.default.signal(this,"startCompletion",this)))});mf=class{constructor(e,i){if(this.cm=e,this.options=i,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,e.on("cursorActivity",this.activityFunc=()=>this.cursorActivity()),i.closeOnUnfocus){let o;this.onFocus=()=>clearTimeout(o),this.onBlur=()=>o=setTimeout(()=>this.close(),100),e.on("focus",this.onFocus),e.on("blur",this.onBlur)}}close(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.options.closeOnUnfocus&&(this.cm.off("blur",this.onBlur),this.cm.off("focus",this.onFocus)),this.widget&&(this.data&&_t.default.signal(this.data,"close"),this.widget.close()),_t.default.signal(this.cm,"endCompletion",this.cm))}active(){return this.cm.state.completionActive===this}pick(e,i){let o=e.list[i];this.cm.state.completionEnabled=!1,o.hint?o.hint(this.cm,e,o):this.cm.replaceRange(Dv(o),o.from||e.from,o.to||e.to,"complete"),_t.default.signal(e,"pick",o),this.close()}cursorActivity(){this.debounce&&(qM(this.debounce),this.debounce=0);let e=this.cm.getCursor(),i=this.cm.getLine(e.line);e.line!=this.startPos.line||i.length-e.ch!=this.startLen-this.startPos.ch||e.ch<this.startPos.ch||this.cm.somethingSelected()?this.close():(this.debounce=HM(()=>this.update()),this.widget&&this.widget.disable())}update(e){if(this.tick===null)return;let i=++this.tick;Promise.resolve(this.options.hint(this.cm,this.options)).then(o=>{this.tick==i&&this.finishUpdate(o,e)})}finishUpdate(e){this.data&&_t.default.signal(this.data,"update");let i=this.widget&&this.widget.picked;this.widget&&this.widget.close(),this.data=e,e&&e.list.length&&(i&&e.list.length==1?this.pick(e,0):(this.widget=new yf(this,e),_t.default.signal(e,"shown")))}};yf=class{constructor(e,i){let o=e.cm,l=this.hintsEl=document.createElement("ul"),c=[zM,e.cm.options.theme].filter(Boolean),f=e.options.container||document.body;this.rootEls=new Set([f.getRootNode()]),this.completion=e,this.data=i,this.picked=!1,this.selectedHint=i.selectedHint||0,l.style.visibility="hidden",l.classList.add(...c),f.appendChild(l),this.items=i.list.map((d,g)=>{let m=l.appendChild(document.createElement("li"));return m.className=RM,g===this.selectedHint&&m.classList.add(gf),d.render?d.render(m,i,d):m.appendChild(document.createTextNode(d.displayText||Dv(d))),m}),o.addKeyMap(this.keyMap={Up:()=>this.changeActive(this.selectedHint-1),Down:()=>this.changeActive(this.selectedHint+1),Enter:()=>this.pick(),Tab:()=>this.pick(),Esc:()=>{o.state.completionEnabled=!1,e.close()}}),this.updatePosSize(),this.onScroll=()=>this.updatePosSize();for(let d of this.rootEls)d.addEventListener("scroll",this.onScroll,Rt);_t.default.on(l,"mousedown",d=>{let g=_M(l,d.target),m=this.items.indexOf(g);m!==-1&&(this.close(),this.selectedHint=m,this.pick(),setTimeout(()=>o.focus(),1))}),_t.default.signal(i,"select",i.list[this.selectedHint],this.items[this.selectedHint])}close(){if(this.completion.widget===this){this.completion.widget=null,this.completion.cm.removeKeyMap(this.keyMap),this.hintsEl.remove();for(let e of this.rootEls)e.removeEventListener("scroll",this.onScroll,Rt)}}disable(){this.completion.cm.removeKeyMap(this.keyMap),this.keyMap={Enter:()=>this.picked=!0},this.completion.cm.addKeyMap(this.keyMap)}pick(){this.completion.pick(this.data,this.selectedHint)}changeActive(e,i){e>=this.items.length?e=i?this.items.length-1:0:e<0&&(e=i?0:this.items.length-1);let o=this.items[this.selectedHint],l=this.items[this.selectedHint=e];l!==o&&(o&&o.classList.remove(gf),l.classList.add(gf),l.offsetTop<this.hintsEl.scrollTop?this.hintsEl.scrollTop=l.offsetTop-3:l.offsetTop+l.offsetHeight>this.hintsEl.scrollTop+this.hintsEl.clientHeight&&(this.hintsEl.scrollTop=l.offsetTop+l.offsetHeight-this.hintsEl.clientHeight+3),_t.default.signal(this.data,"select",this.data.list[this.selectedHint],l))}getCursorCoords(){let{completion:e,hintsEl:i}=this,o=e.cm,l=Go(i),c=o.cursorCoords(null,"local"),f=qt(o.display.wrapper,l);return{top:f.top+c.top+5,left:f.left+c.left+9,bottom:f.top+c.bottom+5,right:f.left+c.right+9}}updatePosSize(){let{hintsEl:o}=this,l=this.getCursorCoords(),{clientWidth:c,clientHeight:f}=Vo(o);o.style.left="0px",o.style.top="0px";let{width:d,height:g}=o.getBoundingClientRect(),m=f-l.bottom,y=l.top;if(m<g&&y>m){let M=Math.min(g,y-6-1);o.style.top=`${l.top-1-M-6}px`,o.style.maxHeight=`${M}px`}else o.style.top=`${l.bottom+1}px`,o.style.maxHeight=`${m-1-6}px`;let k=c-l.right,C=l.left;k<d&&C>k?(o.style.left=`${l.left+1-Math.min(d,C-6)}px`,o.style.maxWidth=`${C-6}px`):(o.style.left=`${l.right}px`,o.style.maxWidth=`${k-6}px`),o.style.visibility="visible"}}});function Sv(n){Object.assign(n.view,{QueryEditor:class extends vf{get container(){return n.dom.container}},ViewEditor:class extends wf{isViewDefined(e){return n.view.isDefined(e)}}})}var Or,BI,WM,qa,vf,wf,Ev=z(()=>{Oe();Qt();Na();Ea();Or=dn(An(),1);vv();xv();BI=dn(hf(),1);Av();Object.defineProperty(Or.default.prototype,"display",{configurable:!0,set(n){return n.scroller.addEventListener=function(e,i,o){EventTarget.prototype.addEventListener.call(this,e,i,typeof o!="boolean"?o:{capture:o,passive:["touchstart","touchmove","wheel","mousewheel"].includes(e)})},Object.defineProperty(this,"display",{configurable:!0,enumerable:!0,value:n}),n}});WM=(n,e,{entry:{type:i,text:o,value:l}})=>{let c=o[0],f=o[o.length-1],d=c==='"'||c==="'"?1:0,g=f==='"'||f==="'"?1:0,m=o.toLowerCase().substring(d,o.length-g),y=m?l.toLowerCase().indexOf(m,l[0]==='"'||l[0]==="'"?1:0):-1;y!==-1&&(l=Xe(l.substring(0,y))+'<span class="match">'+Xe(l.slice(y,y+m.length))+"</span>"+Xe(l.slice(y+m.length))),n.classList.add("type-"+i),n.appendChild($("span","name",l))},qa=class extends ir{static CodeMirror=Or.default;el;cm;get container(){return null}constructor({hint:e,mode:i,placeholder:o}){super(),this.el=document.createElement("div"),this.el.className="discovery-view-editor empty-value";let l=this,c=(0,Or.default)(this.el,{extraKeys:{"Alt-Space":"autocomplete"},mode:i||"javascript",theme:"neo",indentUnit:0,showHintOptions:{hint:e,get container(){return l.container}}});o&&(c.display.lineDiv.parentNode.dataset.placeholder=o),c.on("change",()=>{let d=c.getValue();this.el.classList.toggle("empty-value",d===""),this.emit("change",d)}),typeof e=="function"&&(c.on("cursorActivity",d=>{d.state.completionEnabled&&d.state.focused&&d.showHint()}),c.on("focus",d=>{d.getValue()===""&&(d.state.completionEnabled=!0),d.state.completionEnabled&&!d.state.completionActive&&d.showHint()}),c.on("change",(d,g)=>{g.origin!=="complete"&&(c.state.completionEnabled=!0)})),this.cm=c;let f=new Mr;f.subscribe(()=>c.refresh()),f.observe(c.display.wrapper)}getValue(){return this.cm.getValue()}setValue(e){return requestAnimationFrame(()=>this.cm.refresh()),typeof e=="string"&&this.getValue()!==e?(this.cm.setValue(e||""),!0):!1}focus(){this.cm.focus()}},vf=class extends qa{queryData;queryContext;inputPanelEl;outputPanelEl;constructor(e){super({mode:"discovery-query",placeholder:"Enter a jora query",hint:i=>{let o=i.getCursor(),l=e(i.getValue(),i.doc.indexFromPos(o),this.queryData,this.queryContext);return l?{list:l.slice(0,50).map(c=>({entry:c,text:c.value,render:WM,from:i.posFromIndex(c.from),to:i.posFromIndex(c.to)}))}:null}}),this.inputPanelEl=$("div","discovery-view-editor__input-panel"),this.outputPanelEl=$("div","discovery-view-editor__output-panel"),this.el.append(this.inputPanelEl,this.outputPanelEl)}setValue(e,i,o){let l=this.queryData!==i||this.queryContext!==o;return this.queryData=i,this.queryContext=o,super.setValue(e)?!0:(l&&this.cm.state.completionEnabled&&this.cm.state.focused&&this.cm.showHint(),!1)}},wf=class extends qa{constructor(){super({mode:{name:"discovery-view",isDiscoveryViewDefined:e=>this.isViewDefined(e)}})}isViewDefined(){return!1}};Or.default.defineMode("jora",pf);Or.default.defineMode("discovery-query",pf);Or.default.defineMode("discovery-view",bv)});var Mv,Lv=z(()=>{Mv={beforeDemo:['md:"A block has no its own look. It\'s using for wrapping some content with a `className` (btw `className` is a common property for any view when appropriate)"'],demo:{view:"block",className:"foo",content:['text:"Content inside block"']}}});function Tv(n){n.view.define("block",function(e,i,o,l){let{content:c=[],onInit:f,onChange:d}=i,g=typeof f!="function"&&typeof d!="function"?c:this.composeConfig(c,{onInit:f,onChange:d});return n.view.render(e,g,o,l)},{usage:Mv})}var Fv=z(()=>{Lv()});var _a,bf=z(()=>{_a={demo:{view:"columns",data:["one","two","three","four"],column:"text"}}});function Nv(n){n.view.define("column",function(e,i,o,l){let{content:c=[]}=i;return n.view.render(e,c,o,l)},{usage:_a})}var Ov=z(()=>{bf()});function Iv(n){n.view.define("columns",function(i,o,l,c){let{column:f,columnConfig:d,emptyText:g,limit:m}=o;if(g!==!1&&g!==""&&i.setAttribute("emptyText",g||"Empty"),!Array.isArray(l)&&l&&(l=[l]),Array.isArray(l))return n.view.renderList(i,this.composeConfig({view:"column",content:f},d),l,c,0,n.view.listLimit(m,25))},{usage:_a})}var Bv=z(()=>{bf()});var Pv,jv=z(()=>{Pv={demo:{view:"expand",header:'text:"Expand me!"',content:'text:"Content"'}}});function zv(n){n.view.define("expand",function(e,i,o,l){function c(){if(e.classList.toggle("expanded",f),f)return C=$("div","content"),n.view.render(C,g,o,l).then(()=>e.appendChild(C));C!==null&&(C.remove(),C=null)}let{expanded:f,header:d,content:g,onToggle:m}=i,y=e.appendChild($("div","header")),k=y.appendChild($("div","header-content")),C=null;return f=n.queryBool(f,o,l),y.appendChild($("div","trigger")),y.addEventListener("click",()=>{f=!f,c(),typeof m=="function"&&m(f)}),Promise.all([n.view.render(k,d||'text:"\xA0"',o,l),c()])},{usage:Pv})}var Rv=z(()=>{Oe();jv()});var Hv,qv=z(()=>{Hv={demo:{view:"hstack",content:['button:{text:"First button"}','button-primary:{text:"Second button"}']}}});function _v(n){n.view.define("hstack",function(e,i,o,l){let{content:c=[]}=i;return n.view.render(e,c,o,l)},{usage:Hv})}var Wv=z(()=>{qv()});function $v(n){n.view.define("list-item",function(e,i,o,l){let{content:c="text"}=i;return n.view.render(e,c,o,l)},{tag:"li"})}var Uv=z(()=>{});var Mi,Gv=z(()=>{Mi=(n,e)=>({demo:{view:n,data:["one","two","three","four"]},examples:[{title:"Variations",demo:{view:"context",data:["foo","bar","baz"],content:e.map(i=>[`header{ content: 'md:${JSON.stringify('`view: \\"'+i+'\\"`')}' }`,i])}},{title:"Configure item's content",demo:[{view:n,data:["one","two","three","four"],item:['text:"<item> "',{view:"link",data:'{ href: "#" + $ }'}]}]},{title:"Configure item's config",demo:{view:n,data:["one","two","three","four"],itemConfig:{className:"special"},item:{view:"text",data:'"prefix-" + $'}}}]})});function Vv(n){function e(i,o,l,c){let{item:f,itemConfig:d,limit:g,emptyText:m}=o;if(m!==!1&&m!==""&&i.setAttribute("emptyText",m||"Empty list"),!Array.isArray(l)&&l&&(l=[l]),Array.isArray(l))return n.view.renderList(i,this.composeConfig({view:"list-item",content:f},d),l,c,0,n.view.listLimit(g,25))}n.view.define("list",e,{usage:Mi}),n.view.define("inline-list",e,{usage:Mi}),n.view.define("comma-list",e,{usage:Mi}),n.view.define("ol",e,{tag:"ol",usage:Mi}),n.view.define("ul",e,{tag:"ul",usage:Mi})}var Yv=z(()=>{Gv()});var Qv,Kv=z(()=>{Qv=n=>({beforeDemo:['md:"A special view to be used as the first view in the body of the page. This view stays in place as the page scrolls (although it may move slightly to the top of the page at the start of the scroll), so that the most relevant information and important action elements can remain accessible despite page scrolling."'],demoFixed:100,demo:`${n}:"That's a \\"${n}\\""`,examples:[{title:"Prelude",demoFixed:150,highlightProps:["prelude"],demo:{view:n,prelude:['badge:{ text: "demo" }','badge:{ text: "demo", prefix: "prelude", postfix: "postfix" }'],content:'h1:"Header"'}}]})});function Zv(n){n.view.define("page-header",function(i,o,l,c){let{prelude:f,content:d,onInit:g,onChange:m}=o,y=i.appendChild($("div","view-page-header__prelude")),k=i.appendChild($("div","view-page-header__content")),C=M=>typeof g!="function"&&typeof m!="function"?M:this.composeConfig(M,{onInit:g,onChange:m});return Promise.all([n.view.render(y,C(f||[]),l,c),n.view.render(k,C(d||"text"),l,c)])},{usage:Qv})}var Jv=z(()=>{Oe();Kv()});function Xv(n){return n?n.getRootNode({composed:!0})===document:!0}function ew(n,e){return typeof n=="function"&&(n=n(e)),typeof n=="number"?xf(n):typeof n=="boolean"&&n?UM:0}function tw(n,e){n.lastChild!==e&&n.appendChild(e)}function xf(n,e=0){return Number.isFinite(n)?n:e}function GM(n){return $M.includes(n)}function nw(n){let e=[],i=new Set,o=[],l=new Set,c=null,f=A=>{c===null&&(c=setTimeout(()=>y(A),0))},d=()=>{c!==null&&(clearTimeout(c),c=null)},g=null,m=()=>{g===null&&(g=[n.addHostElEventListener("mouseenter",({target:A})=>{for(let b of o){let L=M(b,A),T=L?L.el:A.closest(b.hoverTriggers);T&&(b.hideTimer!==null&&(clearTimeout(b.hideTimer),b.hideTimer=null),T!==b.lastHoverTriggerEl&&((!L||!L.hoverPinned)&&(b.lastHoverTriggerEl=T),L||(b.hoverPinned=!1,b.el.classList.remove("pinned"),b.show(T))))}},Rt),n.addHostElEventListener("mouseleave",({target:A})=>{for(let b of o)b.lastHoverTriggerEl===A&&(E(b),b.lastHoverTriggerEl=null,b.hideTimer=setTimeout(b.hide,100))},Rt),n.addGlobalEventListener("scroll",f,Rt),n.addHostElEventListener("scroll",A=>{d(),y(A)},Rt),n.addGlobalEventListener("click",f,!0),n.addHostElEventListener("click",A=>{d(),y(A),setTimeout(k,50);for(let b of o)b.hoverPin==="trigger-click"&&b.lastHoverTriggerEl&&b.lastTriggerEl?.contains(A.target)&&(b.lastHoverTriggerEl=null,b.hoverPinned=!0,b.el.classList.add("pinned"),A.stopPropagation())},!0)])};or.subscribe(()=>{for(let A of e)A.position==="pointer"&&!A.hoverPinned&&!A.frozen&&!l.has(A)&&A.updatePosition();for(let A of i){let{showDelayArgs:b}=A;F(A,b?.[0],b?.[1])}}),n.inspectMode.subscribe(A=>A?e.forEach(b=>l.add(b)):l.clear());function y(A){e.slice().forEach(b=>b.hideIfEventOutside(A))}function k(){e.slice().forEach(A=>A.hideOnTriggerHasLeftDocument())}function C(){e.slice().forEach(A=>A.hideOnResize())}function M(A,b){return A.el.contains(b)?A:A.relatedPopups.find(L=>M(L,b))||null}function E(A){A.showDelayTimer!==null&&clearTimeout(A.showDelayTimer),A.showDelayTimer=null,A.showDelayArgs=null,i.delete(A)}function F(A,b,L){A.showDelayTimer!==null&&clearTimeout(A.showDelayTimer),A.showDelayTimer=setTimeout(()=>A.show(b,L,!0),ew(A.showDelay,b)),A.showDelayArgs=[b,L],i.add(A)}class N{el;showDelayTimer;showDelayArgs;showDelay;lastTriggerEl;lastHoverTriggerEl;render;position;positionMode;pointerOffsetX;pointerOffsetY;hoverTriggers;hoverPin;hideIfEventOutsideDisabled;hideOnResizeDisabled;hideTimer;hoverPinned;frozen;lastRenderMarker;constructor(b){let{render:L,showDelay:T=!1,position:I="trigger",positionMode:B="safe",pointerOffsetX:R,pointerOffsetY:U,hoverTriggers:W,hoverPin:ne,hideIfEventOutside:q=!0,hideOnResize:Z=!0,className:S}=b||{};this.el=document.createElement("div"),this.el.classList.add("discovery-view-popup"),this.showDelayTimer=null,this.showDelayArgs=null,this.showDelay=T,this.hideTimer=null,this.hide=this.hide.bind(this),this.lastTriggerEl=null,this.lastHoverTriggerEl=null,this.hoverPinned=!1,this.frozen=!1,this.render=L,this.lastRenderMarker=null,this.position=I,this.positionMode=B,this.pointerOffsetX=xf(R,3),this.pointerOffsetY=xf(U,3),this.hoverTriggers=W||null,this.hoverPin=GM(ne)?ne:!1,this.hideIfEventOutsideDisabled=!q,this.hideOnResizeDisabled=!Z,S&&this.el.classList.add(S),this.hoverTriggers&&(this.el.classList.add("show-on-hover"),this.el.dataset.pinMode=this.hoverPin||"none",o.push(this),m())}get relatedPopups(){return e.filter(b=>this.el.contains(b.lastTriggerEl))}get visible(){return e.includes(this)}toggle(...b){this.visible?this.hide():this.show(...b)}async show(b,L=this.render,T=!1){if(!this.visible&&!T&&ew(this.showDelay,b)>0){F(this,b,L);return}E(this),l.delete(this),n.view.setViewRoot(this.el,"popup",{config:L});let I=n.dom.container;if(this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null),this.relatedPopups.forEach(B=>B.hide()),this.el.classList.toggle("inspect",n.inspectMode.value),this.lastTriggerEl&&this.lastTriggerEl.classList.remove("discovery-view-popup-active"),b&&b.classList.add("discovery-view-popup-active"),this.lastTriggerEl=b||null,this.visible||(e.push(this),e.length===1&&window.addEventListener("resize",C)),typeof L=="function"){this.el.innerHTML="";let B=Symbol();if(this.lastRenderMarker=B,requestAnimationFrame(()=>{this.lastRenderMarker===B&&(tw(I,this.el),this.updatePosition())}),await L(this.el,b,this.hide),this.lastRenderMarker!==B)return;this.lastRenderMarker=null}tw(I,this.el),this.updatePosition()}updatePosition(){if(!this.visible)return;let b=this.position==="pointer",L=b?null:this.lastTriggerEl;if(b?this.frozen:!L)return;let T=n.dom.container,I=Go(T.firstChild),B=ef(window,I),{x:R,y:U}=or.value,{pointerOffsetX:W,pointerOffsetY:ne}=this,q=L?qt(L,T):{left:Math.round(R)-W,right:Math.round(R)+W,top:Math.round(U)-ne,bottom:Math.round(U)+ne},Z=b?q.left:q.right,S=b?q.right:q.left,X=q.top-B.top-3,ee=B.bottom-q.bottom-3,pe=Z-B.left-3,De=B.right-S-3,Pe=De>=pe,et=ee>=X;if(et||(this.el.style.maxHeight=X+"px",this.el.style.top="auto",this.el.style.bottom=B.bottom-q.top+"px",this.el.dataset.vTo="top"),Pe||(this.el.style.left="auto",this.el.style.right=B.right-Z+"px",this.el.style.maxWidth=pe+"px",this.el.dataset.hTo="left"),this.positionMode==="natural"&&(!Pe||!et)){let{height:nt,width:Ye}=qt(this.el);et=nt<=ee,Pe=Ye<=De}et&&(this.el.style.maxHeight=ee+"px",this.el.style.top=q.bottom-B.top+"px",this.el.style.bottom="auto",this.el.dataset.vTo="bottom"),Pe&&(this.el.style.left=S-B.left+"px",this.el.style.right="auto",this.el.style.maxWidth=De+"px",this.el.dataset.hTo="right"),this.relatedPopups.forEach(nt=>nt.updatePosition())}freeze(){this.frozen=!0,this.el.classList.add("frozen")}unfreeze(){this.frozen=!1,this.el.classList.remove("frozen"),this.updatePosition()}hide(){this.lastRenderMarker=null,this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null),E(this),this.visible&&!l.has(this)&&(this.relatedPopups.forEach(b=>b.hide()),e.splice(e.indexOf(this),1),this.el.remove(),this.unfreeze(),this.lastTriggerEl&&(this.lastTriggerEl.classList.remove("discovery-view-popup-active"),this.lastTriggerEl=null),e.length===0&&window.removeEventListener("resize",C))}hideIfEventOutside({target:b}){this.hideIfEventOutsideDisabled||l.has(this)||this.lastTriggerEl&&this.lastTriggerEl.contains(b)||M(this,b)||this.hide()}hideOnTriggerHasLeftDocument(){(!Xv(this.lastHoverTriggerEl)||!Xv(this.lastTriggerEl))&&this.hide()}hideOnResize(){this.hideOnResizeDisabled||l.has(this)||this.hide()}destroy(){l.delete(this),E(this);let b=o.indexOf(this);b!==-1&&o.splice(b,1),this.hide(),this.el=null,this.lastTriggerEl=null,this.lastHoverTriggerEl=null}}n.view.Popup=N}var $M,UM,rw=z(()=>{Fr();Oe();ja();$M=[!1,"popup-hover","trigger-click"],UM=300});var iw,ow=z(()=>{iw={demo:{view:"section",header:'text:"I am section"',content:['text:"content"']}}});function sw(n){n.view.define("section",function(e,i,o,l){let{header:c,content:f=[],onInit:d,onChange:g}=i,m=y=>typeof d!="function"&&typeof g!="function"?y:this.composeConfig(y,{onInit:d,onChange:g});return n.view.render(e,[{view:"header",content:m(c)},m(f)],o,l)},{usage:iw})}var aw=z(()=>{ow()});function lw(n){n.view.define("toc-section",function(e,i,o,l){let{header:c,content:f}=i;return n.view.render(e,[{view:"block",className:"header",content:c},{view:"block",className:"content",content:f}],o,l)},{tag:"section"})}var uw=z(()=>{});var Li,cw=z(()=>{Li=(n,e)=>({demo:{view:n,data:'"Alert"'},examples:[{title:"Variations",demo:e.map(i=>`${i}:"${i}"`)},{title:"Complex content",demo:{view:n,content:['h3:"Some header"','text:"Hello world!"']}}]})});function fw(n){function e(i,o,l,c){let{content:f="text"}=o;return i.classList.add("view-alert"),n.view.render(i,f,l,c)}n.view.define("alert",e,{usage:Li}),n.view.define("alert-primary",e,{usage:Li}),n.view.define("alert-success",e,{usage:Li}),n.view.define("alert-danger",e,{usage:Li}),n.view.define("alert-warning",e,{usage:Li})}var dw=z(()=>{cw()});function Ko(n){return hw.decode(QM(n))}function QM(n){typeof n=="string"&&(n=VM.encode(n));let e=new Uint8Array(Math.ceil(n.length/3)*4),i=0,o=0,l=0;for(let c=0;c<n.length;c++)for(o=o<<8|n[c],l+=8;l>=6;){let f=o>>(l-=6);e[i++]=pw[f],o-=f<<l}for(l!==0&&(e[i++]=pw[o<<6-l]);i<e.length;)e[i++]=61;return e}function Zo(n){return hw.decode(KM(n))}function KM(n){let e=n.length;for(;e>0&&n[e-1]==="=";)e--;let i=new Uint8Array(3*Math.ceil(e/4)),o=0,l=0,c=0;for(let f=0;f<e;f++)if(l=l<<6|YM[n.charCodeAt(f)&255],c+=6,c>8){let d=l>>(c-=8);i[o++]=d,l-=d<<c}return c!==0&&(i[o++]=l),i.subarray(0,(e>>2)*3+(e%4*6>>3))}var VM,hw,pw,YM,kf=z(()=>{VM=new TextEncoder,hw=new TextDecoder,[pw,YM]=(()=>{let n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Uint8Array(64),i=new Uint8Array(256);for(let o=0;o<n.length;o++){let l=n.charCodeAt(o);i[l]=o,e[o]=l}return[e,i]})()});function ZM(n){let e=$("div",{style:["position: fixed","overflow: hidden","font-size: 1px","width: 1px","height: 1px","top: 0","left: 0","white-space: pre"].join(";")});document.body.append(e);try{let i=window.getSelection(),o=document.createRange();e.append(n),o.selectNodeContents(e),i?.removeAllRanges(),i?.addRange(o),document.execCommand("copy")}finally{e.remove()}}async function Wt(n){try{if(navigator.clipboard)try{let e=await navigator.permissions.query({name:"clipboard-write"});if(e.state==="granted"||e.state==="prompt")return navigator.clipboard.writeText(n)}catch(e){if(e instanceof TypeError)return navigator.clipboard.writeText(n)}}catch{}ZM(n)}var Jo=z(()=>{Oe()});function mw(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function mn(n){return Array.isArray(n)||mw(n)}function sr(n){return pn(n)==="[object Set]"}function Xo(n){return pn(n)==="[object RegExp]"}var Ir=z(()=>{st()});function JM(n,e,i){let o=String(n),[l,c]=o.match(/^(?:\S+\s+)?(\S+)\(/)||[];if(l!=="function"&&l!=="function*"&&c===i.trim().slice(0,-1)&&(i=""),o.indexOf(`
|
|
136
136
|
`)===-1)return i+o;let f=o.split(/\n/),d=f[f.length-1].match(/^\s*/)?.[0].length||0,g=new RegExp("^\\s{0,"+d+"}");return i+f.map((m,y)=>y&&m.length?m.replace(g,e):m).join(`
|
|
137
137
|
`)}function XM(n,e,i){return typeof n=="function"?JM(n,e,i):n instanceof Date?`${i}new Date("${n.toISOString()}")`:i+String(n)}function ar(n,e,i=4){let o=[];return String(JSON.stringify(n,e||function(c,f){return typeof f=="string"&&pn(this[c])==="[object Date]"&&(f=this[c]),f!==null&&eL.has(pn(f))?(o.push(f),"{{{__placeholder__}}}"):f},i)).replace(/"((?:\\.|[^"])*)"(:?)/g,(c,f,d)=>d&&/^[a-z$_][a-z$_\d]*$/i.test(f)?f+d:`'${f.replace(/\\"/g,'"').replace(/'/g,"\\'")}'`+d).replace(/(^|\n)([ \t]*)(.*?)([a-zA-Z$_][a-zA-Z0-9$_]+:\s*)?'{{{__placeholder__}}}'/g,(c,f,d,g,m)=>f+d+g+XM(o.shift(),d,m))}var eL,es=z(()=>{st();wu();eL=new Set(["[object Function]","[object RegExp]","[object Date]"])});function Cf(n,e){let i=globalThis.location,o=[],l=({newURL:c,oldURL:f})=>{let d=new URL(c).hash||"#",g=new URL(f).hash||"#";d!==o.shift()&&(e?.debug("locationSync onChange:",g,"->",d),o.length=0,n(d,g))};return addEventListener("hashchange",l),{set(c,f){let d=c||"#";(i.hash||"#")!==d&&(e?.debug("locationSync set:",d,f),o.push(c),f?i.replace(c):i.hash=c)},dispose(){removeEventListener("hashchange",l)}}}var Df=z(()=>{});function tL(n,e,i=0){let o=i!==0?n.slice(i).search(e):n.search(e);return o!==-1?{offset:i+o,length:RegExp.lastMatch.length}:null}function nL(n,e,i){let o=n.indexOf(e,i);return o!==-1?{offset:o,length:e.length}:null}function lr(n,e,i,o,l=!1){if(!Xo(e)&&typeof e!="string"){i(n,!0);return}let c=String(n);l&&(typeof e=="string"?(c=c.toLowerCase(),e=e.toLowerCase()):e.ignoreCase||(e=new RegExp(e,e.flags+"i")));let f=0,d=!1;do{let g=d?null:typeof e=="string"?nL(c,e,f):tL(c,e,f);if(g===null||g.length===0&&g.offset===f){i(f>0?n.slice(f):n,!0);break}g.length!==0&&(g.offset!==f&&i(n.slice(f,g.offset),!1),d=o(n.substr(g.offset,g.length),yw)===yw),f=g.offset+g.length}while(f!==n.length)}var yw,ts=z(()=>{Ir();yw=Symbol("stop-match")});var Af=z(()=>{kf();Wo();cu();Jo();Yo();Oe();Ys();Qt();ea();Ir();es();Fr();wi();Df();_c();st();ts();au();ja();da();af();Na()});var vw,ww=z(()=>{vw={demo:{view:"app-header",name:"My app",version:"1.2.3",description:"The best of the best app"},examples:[{title:"Variations",demo:["app-header",'app-header{ name: "Only name" }','app-header{ name: "Name and version", version: "1.2.3" }','app-header{ name: "Name and description", description: "Some description" }','app-header{ name: "Everything set", version: "1.2.3", description: "Very useful description" }']}]}});function bw(n){n.view.define("app-header",function(e,i){let{name:o,icon:l,version:c,description:f}=i,d=$("h1",null,c?[o,$("span","version",c)]:[o]);l&&e.style.setProperty("--icon",/^(?:\.|\/|data:|https?:)/.test(l)?`url(${JSON.stringify(l)})`:l),e.append($("div","icon"),$("div","content",f?[d,$("div","description",f)]:[d]))},{props:iL,usage:vw})}var iL,xw=z(()=>{Af();ww();iL=`is not array? | {
|
|
138
138
|
name: name or "Untitled app",
|